drm_hwcomposer: Tracking of the DRM FB objects using RAII

DRM framebuffer objects must be kept registered in DRM/KMS
while used for scanning-out (After atomic commit applied
for processing by display controller and until next atomic
commit is applied for processing).

Existing logic for tracking current state is overcomplicated and
needs to be redesigned. Also further developing of drm_hwc will
require migration to asynchronous atomic commit, so additional
asynchronous FB cleanup logic must be created.
Buffer caching logic will also benefit from this.

With the RAII all further changes will be less painful and more robust.

By this commit I also renamed DrmGenericImporter to DrmFbImporter:
'Fb' word is present in most of existing composers (android and linux)
so it will be easier to compare different implementations.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/drm/ResourceManager.cpp b/drm/ResourceManager.cpp
index f8e9cab..ef44180 100644
--- a/drm/ResourceManager.cpp
+++ b/drm/ResourceManager.cpp
@@ -74,20 +74,11 @@
                        (const hw_module_t **)&gralloc_);
 }
 
-int ResourceManager::AddDrmDevice(std::string const &path) {
-  std::unique_ptr<DrmDevice> drm = std::make_unique<DrmDevice>();
+int ResourceManager::AddDrmDevice(const std::string &path) {
+  auto drm = std::make_unique<DrmDevice>();
   int displays_added = 0;
   int ret = 0;
   std::tie(ret, displays_added) = drm->Init(path.c_str(), num_displays_);
-  if (ret)
-    return ret;
-  std::shared_ptr<Importer> importer;
-  importer = std::make_shared<DrmGenericImporter>(drm.get());
-  if (!importer) {
-    ALOGE("Failed to create importer instance");
-    return -ENODEV;
-  }
-  importers_.push_back(importer);
   drms_.push_back(std::move(drm));
   num_displays_ += displays_added;
   return ret;
@@ -139,14 +130,6 @@
   return nullptr;
 }
 
-std::shared_ptr<Importer> ResourceManager::GetImporter(int display) {
-  for (unsigned int i = 0; i < drms_.size(); i++) {
-    if (drms_[i]->HandlesDisplay(display))
-      return importers_[i];
-  }
-  return nullptr;
-}
-
 const gralloc_module_t *ResourceManager::gralloc() {
   return gralloc_;
 }