drm_hwcomposer: Move ValidatePlane method into DrmPlane
It is more common to validate the layer for the proper object.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
diff --git a/compositor/Planner.h b/compositor/Planner.h
index 7c1fe80..3390acb 100644
--- a/compositor/Planner.h
+++ b/compositor/Planner.h
@@ -52,8 +52,6 @@
return plane;
}
- static int ValidatePlane(DrmPlane *plane, DrmHwcLayer *layer);
-
// Inserts the given layer:plane in the composition at the back
static int Emplace(std::vector<DrmCompositionPlane> *composition,
std::vector<DrmPlane *> *planes,
@@ -63,7 +61,7 @@
std::vector<DrmPlane *> unused_planes;
int ret = -ENOENT;
while (plane) {
- ret = ValidatePlane(plane, layer.second);
+ ret = plane->IsValidForLayer(layer.second) ? 0 : -EINVAL;
if (!ret)
break;
if (!plane->zpos_property().is_immutable())