aboutsummaryrefslogtreecommitdiff
path: root/platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform.h')
-rw-r--r--platform.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/platform.h b/platform.h
index 37c4647..6c12fe9 100644
--- a/platform.h
+++ b/platform.h
@@ -73,16 +73,23 @@ class Planner {
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,
DrmCompositionPlane::Type type, DrmCrtc *crtc,
- size_t source_layer) {
+ std::pair<size_t, DrmHwcLayer *> layer) {
DrmPlane *plane = PopPlane(planes);
+ int ret;
if (!plane)
return -ENOENT;
- composition->emplace_back(type, plane, crtc, source_layer);
+ ret = ValidatePlane(plane, layer.second);
+ if (ret)
+ return -EINVAL;
+
+ composition->emplace_back(type, plane, crtc, layer.first);
return 0;
}
};