[PATCH] drm/amd/display: Make plane z-pos explicit to userspace

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

 



[Why]
Many userspace assumes that the DRM plane index indicates the plane
z-order, with a lower index being lower depth and a higher index being
higher depth. This is currently what we assume in DM.

DRM has a zpos plane property to make this explicit to userspace and
there are clients that make use of this information.

[How]
Attach the immutable zpos property to the plane.

While we can technically order the planes in any manner since we
virtualize them in DC we don't currently have the software support.

The z-pos could potentially become immutable later but for now
just let userspace do the ordering.

Cc: Leo Li <sunpeng.li@xxxxxxx>
Cc: Harry Wentland <harry.wentland@xxxxxxx>
Cc: Rodrigo Siqueira <rodrigo.siqueira@xxxxxxx>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 239b1ae86007..e58b0b7e3c52 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4897,6 +4897,9 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 	if (res)
 		return res;
 
+	/* Make z-pos of each plane explicit - lower ID is lower depth */
+	drm_plane_create_zpos_immutable_property(plane, plane->index);
+
 	if (plane->type == DRM_PLANE_TYPE_OVERLAY &&
 	    plane_cap && plane_cap->per_pixel_alpha) {
 		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux