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

Harry Wentland hwentlan at amd.com
Fri Oct 4 15:05:40 UTC 2019


On 2019-10-03 10:46 a.m., Nicholas Kazlauskas wrote:
> [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 at amd.com>
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Rodrigo Siqueira <rodrigo.siqueira at amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>

Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

> ---
>  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) |
> 


More information about the amd-gfx mailing list