Skip to contentSkip to conversation

drm/atomic: allow no-op FB_ID updates for async flips

PATCH Superseded Simon Ser 2 participants 2 messages Jun 29, 2024 – Jul 11, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Simon Ser

author
#0 lore raw

PATCH 1/1 drm/atomic: allow no-op FB_ID updates for async flips

User-space is allowed to submit any property in an async flip as long as the value doesn't change. However we missed one case:
as things stand, the kernel rejects no-op FB_ID changes on non-primary planes. Fix this by changing the conditional and skipping drm_atomic_check_prop_changes() only for FB_ID on the primary plane (instead of skipping for FB_ID on any plane).

Fixes 0e26cc72c71c ("drm: Refuse to async flip with atomic prop changes")
Cc André Almeida <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Michel Dänzer <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_atomic_uapi.c +2 -9
index 22bbb2d83e30..1764bb0dbbdf 100644
@@ -1070,21 +1070,14 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
 			break;
 		}
 
-		if (async_flip && prop != config->prop_fb_id) {
+		if (async_flip && (prop != config->prop_fb_id ||
+				   plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY)) {
 			ret = drm_atomic_plane_get_property(plane, plane_state,
 							    prop, &old_val);
 			ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
 			break;
 		}
 
-		if (async_flip && plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY) {
-			drm_dbg_atomic(prop->dev,
-				       "[OBJECT:%d] Only primary planes can be changed during async flip\n",
-				       obj->id);
-			ret = -EINVAL;
-			break;
-		}
-
 		ret = drm_atomic_plane_set_property(plane,
 				plane_state, file_priv,
 				prop, prop_value);
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Simon, thanks for the fix!

Em 29/06/2024 12:22, Simon Ser escreveu:

Quoted 9 lines

User-space is allowed to submit any property in an async flip as long as the value doesn't change. However we missed one case:
as things stand, the kernel rejects no-op FB_ID changes on non-primary planes. Fix this by changing the conditional and skipping drm_atomic_check_prop_changes() only for FB_ID on the primary plane (instead of skipping for FB_ID on any plane).

Fixes 0e26cc72c71c ("drm: Refuse to async flip with atomic prop changes")