[PATCH 1/2] drm/blend: Account also the primary plane of the crtc for normalized_zpos

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Dec 21 12:55:16 UTC 2017


On Thu, Dec 21, 2017 at 02:11:00PM +0200, Peter Ujfalusi wrote:
> Make sure that the primary plane will get normalized_zpos=0 if it's zpos is
> set to 0, avoiding other planes to be placed in the background.

Can you describe the actual "bad" configuration?

Without knowing the details this looks like it's making things
more complicated for no particularly good reason. If you're worried
about clients that don't set zpos, then I think you should just
assign the default zpos values better and/or allocate the planes
in a better order. But it's definitely possible I'm missing the
reason why you're doing this.

> 
> If user space wants to move the primary plane forward, it can set the zpos
> of the plane.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
> ---
>  drivers/gpu/drm/drm_blend.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c
> index 4c62dff14893..bdc4f714afb8 100644
> --- a/drivers/gpu/drm/drm_blend.c
> +++ b/drivers/gpu/drm/drm_blend.c
> @@ -301,7 +301,11 @@ static int drm_atomic_state_zpos_cmp(const void *a, const void *b)
>  	const struct drm_plane_state *sa = *(struct drm_plane_state **)a;
>  	const struct drm_plane_state *sb = *(struct drm_plane_state **)b;
>  
> -	if (sa->zpos != sb->zpos)
> +	if (sa->plane == sa->crtc->primary && sa->zpos == 0)
> +		return -1;
> +	else if (sb->plane == sb->crtc->primary && sb->zpos == 0)
> +		return 1;
> +	else if (sa->zpos != sb->zpos)
>  		return sa->zpos - sb->zpos;
>  	else
>  		return sa->plane->base.id - sb->plane->base.id;
> -- 
> Peter
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC


More information about the dri-devel mailing list