drm_hwcomposer: Simplify DrmHwcTwo::GetDisplay()
Cosmetic change: make GetDisplay() non-static class method + use
deduced return type.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
diff --git a/hwc2_device/hwc2_device.cpp b/hwc2_device/hwc2_device.cpp
index 6d258e8..57bc205 100644
--- a/hwc2_device/hwc2_device.cpp
+++ b/hwc2_device/hwc2_device.cpp
@@ -74,8 +74,8 @@
GetFuncName(__PRETTY_FUNCTION__).c_str());
DrmHwcTwo *hwc = ToDrmHwcTwo(dev);
const std::lock_guard<std::mutex> lock(hwc->GetResMan().GetMainLock());
- HwcDisplay *display = DrmHwcTwo::GetDisplay(hwc, display_handle);
- if (!display)
+ auto *display = hwc->GetDisplay(display_handle);
+ if (display == nullptr)
return static_cast<int32_t>(HWC2::Error::BadDisplay);
return static_cast<int32_t>((display->*func)(std::forward<Args>(args)...));
@@ -88,8 +88,8 @@
layer_handle, GetFuncName(__PRETTY_FUNCTION__).c_str());
DrmHwcTwo *hwc = ToDrmHwcTwo(dev);
const std::lock_guard<std::mutex> lock(hwc->GetResMan().GetMainLock());
- HwcDisplay *display = DrmHwcTwo::GetDisplay(hwc, display_handle);
- if (!display)
+ auto *display = hwc->GetDisplay(display_handle);
+ if (display == nullptr)
return static_cast<int32_t>(HWC2::Error::BadDisplay);
HwcLayer *layer = display->get_layer(layer_handle);