[RFC] drm/omap: Create only one primary plane for CRTC

Tony Lindgren tony at atomide.com
Fri Feb 28 20:05:34 UTC 2020


Hi,

Looks like sway and wlroots won't work with omaprdrm because of
the following error:

backend/drm/drm.c:86: add_plane: Assertion
!(type == DRM_PLANE_TYPE_PRIMARY &&  crtc->primary)

Looks like there should only be one primary plane per CRTC?

There's some discussion about that for a wlroots bug at:

https://github.com/swaywm/wlroots/issues/1943

And there's a link pointing to the kms docs:

https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#plane-abstraction

Below is a quick hack fix I used to get sway started.

Not sure how the primary plane should be picked? I just
used 0 as the primary plane to get things working :)

I can start xterm on sway, but so far no fonts only the
borders.

Regards,

Tony

8< ----------------------
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index d2750f60f519..122f8c4cf45b 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -268,7 +268,7 @@ static int omap_modeset_init(struct drm_device *dev)
 	plane_crtc_mask = (1 << priv->num_pipes) - 1;
 
 	for (i = 0; i < num_ovls; i++) {
-		enum drm_plane_type type = i < priv->num_pipes
+		enum drm_plane_type type = i == 0
 					 ? DRM_PLANE_TYPE_PRIMARY
 					 : DRM_PLANE_TYPE_OVERLAY;
 		struct drm_plane *plane;


More information about the dri-devel mailing list