Re: [PATCH v1] drm/atomic: Clear plane pipeline for legacy clients

Pekka Paalanen <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <20260730174100.017a1b5a@fluorite>
On Thu,  9 Jul 2026 13:58:55 +0200
Robert Mader <[email protected]> wrote:

> Clients that do not enable DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE and try to
> apply a new plane state currently have no way to unset/reset an existing
> non-bypass color pipeline, resulting in unexpected behavior.
> 
> As we can be sure that such clients do not expect plane pipelines to be
> set, let's reset the later for them, ensuring clean bypass-only pipeline
> states.
> 
> This is a less comprehensive but more backward compatible approach compared
> to a DRM_MODE_ATOMIC_RESET flag (link) that is currently being discussed.
> Considering the simplicity and clearly defined behavior of this case,
> this change could serve as an additional stop-gap solution to smoothen the
> transition to the new APIs, resulting in less breakage on systems with
> existing clients.
> 
> Link: https://lore.kernel.org/all/CAFZQkGzw2MZGivy=oyYgZE3_dmxu-z-NbDgzh9uyqSsj=MG=2w@mail.gmail.com/
> 
> Signed-off-by: Robert Mader <[email protected]>
> 
> ---
> 
> If an approach like this was previously rejected or clearly goes against
> API rules (or is unacceptable for other reason), please excuse me (and
> just let me know).
> 
> The main motivation for the patch came up during testing the Weston
> implementation (link) for the fixed-matrix color-ops. The test there checks
> both the color pipeline and legacy property ways of offloading YCbCr
> buffers and the current reset-less situation results in the legacy one
> failing once the color pipeline test ran before.
> 
> Link: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/2133
> ---
>  drivers/gpu/drm/drm_atomic.c | 3 +++
>  1 file changed, 3 insertions(+)

Hi Robert,

this sounds reasonable indeed.

Acked-by: Pekka Paalanen <[email protected]>

Thanks,
pq

> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 735ab7badc2e..581fde90dbd8 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -656,6 +656,9 @@ drm_atomic_get_plane_state(struct drm_atomic_commit *state,
>  	state->planes[index].new_state = plane_state;
>  	plane_state->state = state;
>  
> +	if (!state->plane_color_pipeline)
> +		plane_state->color_pipeline = NULL;
> +
>  	drm_dbg_atomic(plane->dev, "Added [PLANE:%d:%s] %p state to %p\n",
>  		       plane->base.id, plane->name, plane_state, state);
>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAmprYnwACgkQI1/ltBGq
qqc9NBAAjd+8qJIov3iv9e/hSncWRbtA/6mrQ2FKhV2B15dRjfyj/X9Y4rJcXVKo
yRghJ3oPNZO3zpJKKUVTHhAnXZ/qsPxUAQGUbC2tlVD95NEMowaSftNRXFbjTaI5
b/TEgb4iau6lHYQzUWRrmB0kExnkVwZZCisWeMBC0etN+fdsr01bzFvMXuK0Hj3J
ImFCfua5YxHm65to7VTKbBGWLqNQ6DYMZ+831gbkhZ91Ht5utBg/ntnndn39h6Bf
Z3tCXKcBTLTDSeSKRRhfDQV9LjedHAVoTx8ZfCi1L7yhyspqWpaqAvAubqEIM1Ee
Z9F/iyZLRR7drV7GyCfDXt0nbrPyWDoYkbGqwk1HcPq9ubul47dNPdnYl6FFLdFF
gL7lK1UTBEuo5HBpJhjGdgFOEV0c190IRkETCoEN1fj7W2Rqp3LThpJRsCLfXbb2
+6khGzvORJyUsoXSe0ktskAH7vjEsblzyEWuF4ID3EVJWuIYYycZI8Woyz8/N8N6
YP45QG+TObIzOybDZsOiwxkToynd6GJOq4FrLdHRGqvdpG65/UZjvJ2X+RLqssml
tZm+Hp1NjKicw5BrEm1BBpCjvUfRa7PLAIRWy0QRzRyZ2ON2mm15HYksBo86z9cd
00xCf9rmJQiuI1bnC/cJCKDtC5yOLclAx1rqx+lWgxBg+HfN5dI=
=zoKo
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.