Browse Source

drm_hwcomposer: Basic support for shared primary planes

For now just bind the first suitable primary plane to the pipeline
on creation.

Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/68
Change-Id: Idc4a7a5ac9d768d2614e1cd8a460d742f406a1cc
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Roman Stratiienko 1 year ago
parent
commit
ce2ce75a36
1 changed files with 6 additions and 6 deletions
  1. 6 6
      drm/DrmDisplayPipeline.cpp

+ 6 - 6
drm/DrmDisplayPipeline.cpp

@@ -86,15 +86,15 @@ static auto TryCreatePipeline(DrmDevice &dev, DrmConnector &connector,
     return {};
   }
 
-  if (primary_planes.size() > 1) {
-    ALOGE("Found more than 1 primary plane for CRTC %d", crtc.GetId());
-    return {};
+  for (const auto &plane : primary_planes) {
+    pipe->primary_plane = plane->BindPipeline(pipe.get());
+    if (pipe->primary_plane) {
+      break;
+    }
   }
 
-  pipe->primary_plane = primary_planes[0]->BindPipeline(pipe.get());
   if (!pipe->primary_plane) {
-    ALOGE("Primary plane %d is already owned. Internal error.",
-          primary_planes[0]->GetId());
+    ALOGE("Failed to bind primary plane");
     return {};
   }