drm_hwcomposer: Remove gralloc from generic code

Clean up direct gralloc usage from generic code.
Because of gralloc0/gralloc1 difference, it should
be only used by platform* part.

Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
diff --git a/drmdisplaycomposition.h b/drmdisplaycomposition.h
index 9183925..d8b5ad1 100644
--- a/drmdisplaycomposition.h
+++ b/drmdisplaycomposition.h
@@ -25,7 +25,6 @@
 #include <sstream>
 #include <vector>
 
-#include <hardware/gralloc.h>
 #include <hardware/hardware.h>
 #include <hardware/hwcomposer.h>
 
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index 7ca3e62..dee7401 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -70,17 +70,9 @@
     return HWC2::Error::NoResources;
   }
 
-  ret = hw_get_module(GRALLOC_HARDWARE_MODULE_ID,
-                      (const hw_module_t **)&gralloc_);
-  if (ret) {
-    ALOGE("Failed to open gralloc module %d", ret);
-    return HWC2::Error::NoResources;
-  }
-
   displays_.emplace(std::piecewise_construct,
                     std::forward_as_tuple(HWC_DISPLAY_PRIMARY),
-                    std::forward_as_tuple(&drm_, importer_, gralloc_,
-                                          HWC_DISPLAY_PRIMARY,
+                    std::forward_as_tuple(&drm_, importer_, HWC_DISPLAY_PRIMARY,
                                           HWC2::DisplayType::Physical));
 
   DrmCrtc *crtc = drm_.GetCrtcForDisplay(static_cast<int>(HWC_DISPLAY_PRIMARY));
@@ -160,13 +152,8 @@
 
 DrmHwcTwo::HwcDisplay::HwcDisplay(DrmResources *drm,
                                   std::shared_ptr<Importer> importer,
-                                  const gralloc_module_t *gralloc,
                                   hwc2_display_t handle, HWC2::DisplayType type)
-    : drm_(drm),
-      importer_(importer),
-      gralloc_(gralloc),
-      handle_(handle),
-      type_(type) {
+    : drm_(drm), importer_(importer), handle_(handle), type_(type) {
   supported(__func__);
 }
 
diff --git a/drmhwctwo.h b/drmhwctwo.h
index 0490e2a..aa9de3f 100644
--- a/drmhwctwo.h
+++ b/drmhwctwo.h
@@ -136,8 +136,7 @@
   class HwcDisplay {
    public:
     HwcDisplay(DrmResources *drm, std::shared_ptr<Importer> importer,
-               const gralloc_module_t *gralloc, hwc2_display_t handle,
-               HWC2::DisplayType type);
+               hwc2_display_t handle, HWC2::DisplayType type);
     HwcDisplay(const HwcDisplay &) = delete;
     HWC2::Error Init(std::vector<DrmPlane *> *planes);
 
@@ -192,7 +191,6 @@
     DrmDisplayCompositor compositor_;
     std::shared_ptr<Importer> importer_;
     std::unique_ptr<Planner> planner_;
-    const gralloc_module_t *gralloc_;
 
     std::vector<DrmPlane *> primary_planes_;
     std::vector<DrmPlane *> overlay_planes_;
@@ -264,7 +262,6 @@
 
   DrmResources drm_;
   std::shared_ptr<Importer> importer_;  // Shared with HwcDisplay
-  const gralloc_module_t *gralloc_;
   std::map<hwc2_display_t, HwcDisplay> displays_;
   std::map<HWC2::Callback, HwcCallback> callbacks_;
 };