* [PATCH v4] drm: re-allow no-op changes on non-primary planes in async flips
@ 2025-08-08 23:22 Xaver Hugl
2025-08-22 14:45 ` André Almeida
0 siblings, 1 reply; 2+ messages in thread
From: Xaver Hugl @ 2025-08-08 23:22 UTC (permalink / raw)
To: dri-devel
Cc: andrealmeid, chris, naveen1.kumar, ville.syrjala, mdaenzer,
intel-gfx, amd-gfx, alexdeucher, arun.r.murthy, Xaver Hugl
Commit fd40a63c63a1 unintentionally disallowed no-op changes on non-primary
planes that the driver doesn't allow async flips on. This broke async flips
for compositors that disable the cursor plane in every async atomic commit.
This changes drm_atomic_set_property to again only run atomic_async_check
if the plane would actually be changed by the atomic commit.
Fixes: fd40a63c63a1 ("drm/atomic: Let drivers decide which planes to async flip")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4263
Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
---
drivers/gpu/drm/drm_atomic_uapi.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index c2726af6698e..317303cf5b8c 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1077,19 +1077,20 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
}
if (async_flip) {
- /* check if the prop does a nop change */
- if ((prop != config->prop_fb_id &&
- prop != config->prop_in_fence_fd &&
- prop != config->prop_fb_damage_clips)) {
- ret = drm_atomic_plane_get_property(plane, plane_state,
- prop, &old_val);
- ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
- }
+ /* no-op changes are always allowed */
+ ret = drm_atomic_plane_get_property(plane, plane_state,
+ prop, &old_val);
+ ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
- /* ask the driver if this non-primary plane is supported */
- if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
- ret = -EINVAL;
+ /* fail everything that isn't no-op or a pure flip */
+ if (ret && prop != config->prop_fb_id &&
+ prop != config->prop_in_fence_fd &&
+ prop != config->prop_fb_damage_clips) {
+ break;
+ }
+ if (ret && plane->type != DRM_PLANE_TYPE_PRIMARY) {
+ /* ask the driver if this non-primary plane is supported */
if (plane_funcs && plane_funcs->atomic_async_check)
ret = plane_funcs->atomic_async_check(plane, state, true);
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4] drm: re-allow no-op changes on non-primary planes in async flips
2025-08-08 23:22 [PATCH v4] drm: re-allow no-op changes on non-primary planes in async flips Xaver Hugl
@ 2025-08-22 14:45 ` André Almeida
0 siblings, 0 replies; 2+ messages in thread
From: André Almeida @ 2025-08-22 14:45 UTC (permalink / raw)
To: Xaver Hugl
Cc: chris, naveen1.kumar, ville.syrjala, mdaenzer, intel-gfx,
dri-devel, amd-gfx, alexdeucher, arun.r.murthy
Hi Xaver,
Thanks for the patch and sorry for the delay.
Em 08/08/2025 20:22, Xaver Hugl escreveu:
> Commit fd40a63c63a1 unintentionally disallowed no-op changes on non-primary
> planes that the driver doesn't allow async flips on. This broke async flips
> for compositors that disable the cursor plane in every async atomic commit.
> This changes drm_atomic_set_property to again only run atomic_async_check
> if the plane would actually be changed by the atomic commit.
Small nit: kernel commit messages goes in the imperative form:
"Change drm_atomic_set_property to again only run atomic_async_check..."
>
> Fixes: fd40a63c63a1 ("drm/atomic: Let drivers decide which planes to async flip")
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4263
>
> Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
> ---
Reviewed-by: André Almeida <andrealmeid@igalia.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-22 14:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08 23:22 [PATCH v4] drm: re-allow no-op changes on non-primary planes in async flips Xaver Hugl
2025-08-22 14:45 ` André Almeida
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).