From 1d224e83270be782040e00a8eb51d4b20dc740d0 Mon Sep 17 00:00:00 2001 From: Andrii Chepurnyi Date: Thu, 17 May 2018 18:34:01 +0300 Subject: 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 --- drmdisplaycomposition.h | 1 - drmhwctwo.cpp | 17 ++--------------- drmhwctwo.h | 5 +---- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drmdisplaycomposition.h b/drmdisplaycomposition.h index 9183925..d8b5ad1 100644 --- a/drmdisplaycomposition.h +++ b/drmdisplaycomposition.h @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index 7ca3e62..dee7401 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -70,17 +70,9 @@ HWC2::Error DrmHwcTwo::Init() { 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(HWC_DISPLAY_PRIMARY)); @@ -160,13 +152,8 @@ HWC2::Error DrmHwcTwo::RegisterCallback(int32_t descriptor, DrmHwcTwo::HwcDisplay::HwcDisplay(DrmResources *drm, std::shared_ptr 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 DrmHwcTwo : public hwc2_device_t { class HwcDisplay { public: HwcDisplay(DrmResources *drm, std::shared_ptr 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 *planes); @@ -192,7 +191,6 @@ class DrmHwcTwo : public hwc2_device_t { DrmDisplayCompositor compositor_; std::shared_ptr importer_; std::unique_ptr planner_; - const gralloc_module_t *gralloc_; std::vector primary_planes_; std::vector overlay_planes_; @@ -264,7 +262,6 @@ class DrmHwcTwo : public hwc2_device_t { DrmResources drm_; std::shared_ptr importer_; // Shared with HwcDisplay - const gralloc_module_t *gralloc_; std::map displays_; std::map callbacks_; }; -- cgit v1.2.3