drm_hwcomposer: Move HardwareSupportsLayerType into Backend
The HardwareSupportsLayerType function is used only for display validation
which is implemented in the generic backend.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
diff --git a/backend/Backend.cpp b/backend/Backend.cpp
index c7e78c9..4c2a931 100644
--- a/backend/Backend.cpp
+++ b/backend/Backend.cpp
@@ -93,13 +93,18 @@
bool Backend::IsClientLayer(DrmHwcTwo::HwcDisplay *display,
DrmHwcTwo::HwcLayer *layer) {
- return !display->HardwareSupportsLayerType(layer->sf_type()) ||
+ return !HardwareSupportsLayerType(layer->sf_type()) ||
!BufferInfoGetter::GetInstance()->IsHandleUsable(layer->buffer()) ||
display->color_transform_hint() != HAL_COLOR_TRANSFORM_IDENTITY ||
(layer->RequireScalingOrPhasing() &&
display->resource_manager()->ForcedScalingWithGpu());
}
+bool Backend::HardwareSupportsLayerType(HWC2::Composition comp_type) {
+ return comp_type == HWC2::Composition::Device ||
+ comp_type == HWC2::Composition::Cursor;
+}
+
uint32_t Backend::CalcPixOps(const std::vector<DrmHwcTwo::HwcLayer *> &layers,
size_t first_z, size_t size) {
uint32_t pixops = 0;