Skip to contentSkip to conversation

drm: don't run atomic_async_check for disabled planes

PATCH Superseded Xaver Hugl 4 participants 4 messages Jul 23, 2025 – Jul 29, 2025

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Xaver Hugl

author
#0 lore raw

PATCH 1/1 drm: don't run atomic_async_check for disabled planes

It's entirely valid and correct for compositors to include disabled planes in the atomic commit, and doing that should not prevent async flips from working. To fix that, this commit skips the async checks if the plane was and still is not visible.

Fixes fd40a63c drm/atomic: Let drivers decide which planes to async flip
---
 drivers/gpu/drm/drm_atomic_uapi.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_uapi.c +9 -1
index c2726af6698e..2e62561fd94d 100644
@@ -1066,6 +1066,7 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
 	}
 	case DRM_MODE_OBJECT_PLANE: {
 		struct drm_plane *plane = obj_to_plane(obj);
+		struct drm_plane_state *old_plane_state;
 		struct drm_plane_state *plane_state;
 		struct drm_mode_config *config = &plane->dev->mode_config;
 		const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
@@ -1086,8 +1087,15 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
 				ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
 			}
 
+			old_plane_state = drm_atomic_get_old_plane_state(state, plane);
+			if (IS_ERR(old_plane_state)) {
+				ret = PTR_ERR(plane_state);
+				break;
+			}
+
 			/* ask the driver if this non-primary plane is supported */
-			if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+			if (plane->type != DRM_PLANE_TYPE_PRIMARY &&
+					(plane_state->visible || old_plane_state->visible)) {
 				ret = -EINVAL;
 
 				if (plane_funcs && plane_funcs->atomic_async_check)
Signature · 1 line
2.50.1
#1 lore raw

✗ LGCI.VerificationFailed: failure for drm: don't run atomic_async_check for disabled planes

== Series Details ==

== Series Details ==

Series: drm: don't run atomic_async_check for disabled planes
URL : https://patchwork.freedesktop.org/series/152013/
State : failure

== Summary ==

Address '[email protected]' is not on the allowlist, which prevents CI from being triggered for this patch. If you want Intel GFX CI to accept this address, please contact the script maintainers at [email protected]. Exception occurred during validation, bailing out!

#2 lore raw
In reply to Xaver Hugl
Quoted 7 lines · Xaver Hugl

It's entirely valid and correct for compositors to include disabled planes in the atomic commit, and doing that should not prevent async flips from working. To fix that, this commit skips the async checks if the plane was and still is not visible.

Fixes fd40a63c drm/atomic: Let drivers decide which planes to async flip

This should be:

Fixes fd40a63c63a1 ("drm/atomic: Let drivers decide which planes to

async flip")

Quoted 39 lines
---
 drivers/gpu/drm/drm_atomic_uapi.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_uapi.c +9 -2
index c2726af6698e..2e62561fd94d 100644
@@ -1066,6 +1066,7 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
        }
        case DRM_MODE_OBJECT_PLANE: {
                struct drm_plane *plane = obj_to_plane(obj);
+               struct drm_plane_state *old_plane_state;
                struct drm_plane_state *plane_state;
                struct drm_mode_config *config = &plane->dev->mode_config;
                const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
@@ -1086,8 +1087,15 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
                                ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
                        }
 
+                       old_plane_state = drm_atomic_get_old_plane_state(state, plane);
+                       if (IS_ERR(old_plane_state)) {
+                               ret = PTR_ERR(plane_state);
+                               break;
+                       }
+
                        /* ask the driver if this non-primary plane is supported */
-                       if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+                       if (plane->type != DRM_PLANE_TYPE_PRIMARY &&
+                                       (plane_state->visible || old_plane_state->visible)) {
                                ret = -EINVAL;
 
                                if (plane_funcs && plane_funcs->atomic_async_check)
--

2.50.1

#3 lore raw
Quoted 48 lines

-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, July 29, 2025 12:30 AM
To: Xaver Hugl <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Kumar, Naveen1 <[email protected]>; [email protected]; [email protected]; intel- [email protected]; [email protected]
Subject: Re: [PATCH] drm: don't run atomic_async_check for disabled planes

Quoted 8 lines · Xaver Hugl

It's entirely valid and correct for compositors to include disabled planes in the atomic commit, and doing that should not prevent async flips from working. To fix that, this commit skips the async checks if the plane was and still is not visible.

Fixes fd40a63c drm/atomic: Let drivers decide which planes to async

flip

This should be:

Fixes fd40a63c63a1 ("drm/atomic: Let drivers decide which planes to async

flip")

drivers/gpu/drm/drm_atomic_uapi.c int drm_atomic_set_property(struct

Quoted 13 lines
---
 drivers/gpu/drm/drm_atomic_uapi.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_uapi.c +0 -0
index c2726af6698e..2e62561fd94d 100644
@@ -1066,6 +1066,7 @@ int drm_atomic_set_property(struct

drm_atomic_state *state,

Quoted 8 lines
drivers/gpu/drm/drm_atomic_uapi.c +1 -0
        }
        case DRM_MODE_OBJECT_PLANE: {
                struct drm_plane *plane = obj_to_plane(obj);
+               struct drm_plane_state *old_plane_state;
                struct drm_plane_state *plane_state;
                struct drm_mode_config *config = &plane->dev->mode_config;
                const struct drm_plane_helper_funcs *plane_funcs =

plane->helper_private; @@ -1086,8 +1087,15 @@ int

Quoted 9 lines

drm_atomic_set_property(struct drm_atomic_state *state,

Quoted 1 line

ret = drm_atomic_check_prop_changes(ret, old_val,

prop_value, prop);

Quoted 3 lines
                        }

+ old_plane_state = drm_atomic_get_old_plane_state(state,

plane);

Quoted 2 lines
drivers/gpu/drm/drm_atomic_uapi.c +2 -0
+                       if (IS_ERR(old_plane_state)) {
+                               ret = PTR_ERR(plane_state);

This should be PTR_ERR(old_plane_state)

Quoted 8 lines

drivers/gpu/drm/drm_atomic_uapi.c int drm_atomic_set_property(struct drm_atomic_state *state,

Quoted 8 lines
drivers/gpu/drm/drm_atomic_uapi.c +6 -1
+                               break;
+                       }
+
                        /* ask the driver if this non-primary plane is supported */
-                       if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+                       if (plane->type != DRM_PLANE_TYPE_PRIMARY &&
+                                       (plane_state->visible ||
+ old_plane_state->visible)) {

The present plane_state->visible will be updated based on the current list of properties in atomic_check() which is called after this set_property(). For ex in the present flip the FB is NULL then we disable the plane, the flag for doing this is done later in atomic_check().

Thanks and Regards,
Arun R Murthy
-------------------

Quoted 7 lines
Quoted 7 lines
                                ret = -EINVAL;

                                if (plane_funcs &&

plane_funcs->atomic_async_check)
--
2.50.1