summaryrefslogtreecommitdiff
path: root/drmhwctwo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drmhwctwo.cpp')
-rw-r--r--drmhwctwo.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index f381862..8979b84 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -63,7 +63,16 @@ DrmHwcTwo::DrmHwcTwo() {
}
HWC2::Error DrmHwcTwo::Init() {
- int ret = drm_.Init();
+ int ret;
+
+ 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;
+ }
+
+ ret = drm_.Init(gralloc_);
if (ret) {
ALOGE("Can't initialize drm object %d", ret);
return HWC2::Error::NoResources;
@@ -75,13 +84,6 @@ 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_,