diff options
author | Andrii Chepurnyi <andrii_chepurnyi@epam.com> | 2018-05-17 18:34:01 +0300 |
---|---|---|
committer | Andrii Chepurnyi <andrii_chepurnyi@epam.com> | 2018-05-17 19:45:49 +0300 |
commit | 1d224e83270be782040e00a8eb51d4b20dc740d0 (patch) | |
tree | 3eb13e8d5473d611f340206a732623875e4867ee | |
parent | dc1278c078b1035e86085f568f2e8ff103d478a0 (diff) |
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>
-rw-r--r-- | drmdisplaycomposition.h | 1 | ||||
-rw-r--r-- | drmhwctwo.cpp | 17 | ||||
-rw-r--r-- | 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 <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 @@ 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<int>(HWC_DISPLAY_PRIMARY)); @@ -160,13 +152,8 @@ HWC2::Error DrmHwcTwo::RegisterCallback(int32_t descriptor, 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 DrmHwcTwo : public hwc2_device_t { 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 @@ class DrmHwcTwo : public hwc2_device_t { 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 @@ class DrmHwcTwo : public hwc2_device_t { 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_; }; |