[PATCH 1/3] drm: xlnx: zynqmp_dpsub: Fix plane ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The DPSUB has a fixed plane order, with the video plane being at the
bottom and the graphics plane at the top. Register the video plane as
the primary plane, as a bottom overlay plane doesn't make sense.

While at it, add immutable zorder properties to the planes to report
this information to userspace.

Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/xlnx/zynqmp_disp.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
index 148add0ca1d6..6296f6d5acbc 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
@@ -1236,8 +1236,11 @@ static int zynqmp_disp_create_planes(struct zynqmp_disp *disp)
 		for (j = 0; j < layer->info->num_formats; ++j)
 			drm_formats[j] = layer->info->formats[j].drm_fmt;
 
-		/* Graphics layer is primary, and video layer is overlay. */
-		type = i == ZYNQMP_DISP_LAYER_GFX
+		/*
+		 * The video layer is at the bottom of the stack and the
+		 * graphics layer at the top.
+		 */
+		type = i == ZYNQMP_DISP_LAYER_VID
 		     ? DRM_PLANE_TYPE_PRIMARY : DRM_PLANE_TYPE_OVERLAY;
 		ret = drm_universal_plane_init(disp->drm, &layer->plane, 0,
 					       &zynqmp_disp_plane_funcs,
@@ -1249,6 +1252,8 @@ static int zynqmp_disp_create_planes(struct zynqmp_disp *disp)
 
 		drm_plane_helper_add(&layer->plane,
 				     &zynqmp_disp_plane_helper_funcs);
+
+		drm_plane_create_zpos_immutable_property(&layer->plane, i);
 	}
 
 	return 0;
@@ -1573,7 +1578,7 @@ static const struct drm_crtc_funcs zynqmp_disp_crtc_funcs = {
 
 static int zynqmp_disp_create_crtc(struct zynqmp_disp *disp)
 {
-	struct drm_plane *plane = &disp->layers[ZYNQMP_DISP_LAYER_GFX].plane;
+	struct drm_plane *plane = &disp->layers[ZYNQMP_DISP_LAYER_VID].plane;
 	int ret;
 
 	ret = drm_crtc_init_with_planes(disp->drm, &disp->crtc, plane,
-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux