[RFC weston 09/14] compositor-drm: Track all plane types

Daniel Stone daniels at collabora.com
Thu May 21 00:29:06 PDT 2015


Retain drm_plane tracking objects for all actual DRM planes when using
universal planes, not just overlay planes.

These are currently unused.

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 src/compositor-drm.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 2a70728..6053c18 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -215,6 +215,8 @@ struct drm_plane {
 
 	struct weston_plane base;
 
+	enum wdrm_plane_type type;
+
 	struct drm_fb *current, *next;
 	struct drm_output *output;
 	struct drm_compositor *compositor;
@@ -1015,6 +1017,9 @@ drm_output_repaint(struct weston_output *output_base,
 			.request.sequence = 1,
 		};
 
+		if (s->type != WDRM_PLANE_TYPE_OVERLAY)
+			continue;
+
 		if ((!s->current && !s->next) ||
 		    !drm_plane_crtc_supported(output, s->possible_crtcs))
 			continue;
@@ -1253,6 +1258,9 @@ drm_output_prepare_overlay_view(struct drm_output *output,
 		if (!drm_plane_crtc_supported(output, p->possible_crtcs))
 			continue;
 
+		if (p->type != WDRM_PLANE_TYPE_OVERLAY)
+			continue;
+
 		if (!p->next) {
 			found = 1;
 			break;
@@ -2688,6 +2696,11 @@ drm_plane_create(struct drm_compositor *ec, const drmModePlane *kplane)
 		return NULL;
 	}
 
+	if (ec->universal_planes)
+		plane->type = drm_plane_property_get(plane, WDRM_PLANE_TYPE);
+	else
+		plane->type = WDRM_PLANE_TYPE_OVERLAY;
+
 	weston_plane_init(&plane->base, &ec->base, 0, 0);
 	wl_list_insert(&ec->sprite_list, &plane->link);
 
@@ -2750,17 +2763,10 @@ create_sprites(struct drm_compositor *ec)
 		if (!drm_plane)
 			continue;
 
-		/* Ignore non-overlay planes for now. */
-		if (ec->universal_planes &&
-		    drm_plane_property_get(drm_plane, WDRM_PLANE_TYPE) !=
-			WDRM_PLANE_TYPE_OVERLAY) {
-			drm_plane_destroy(drm_plane);
-			continue;
-		}
-
-		weston_compositor_stack_plane(&ec->base,
-					      &drm_plane->base,
-					      &ec->base.primary_plane);
+		if (drm_plane->type == WDRM_PLANE_TYPE_OVERLAY)
+			weston_compositor_stack_plane(&ec->base,
+						      &drm_plane->base,
+						      &ec->base.primary_plane);
 	}
 
 	drmModeFreePlaneResources(kplane_res);
@@ -3048,11 +3054,15 @@ session_notify(struct wl_listener *listener, void *data)
 		output = container_of(ec->base.output_list.next,
 				      struct drm_output, base.link);
 
-		wl_list_for_each(sprite, &ec->sprite_list, link)
+		wl_list_for_each(sprite, &ec->sprite_list, link) {
+			if (sprite->type != WDRM_PLANE_TYPE_OVERLAY)
+				continue;
+
 			drmModeSetPlane(ec->drm.fd,
 					sprite->plane_id,
 					output->crtc_id, 0, 0,
 					0, 0, 0, 0, 0, 0, 0, 0);
+		}
 	};
 }
 
-- 
2.4.1



More information about the wayland-devel mailing list