Skip to content

Commit 929725b

Browse files
committed
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: 0e26cc7 ("drm: Refuse to async flip with atomic prop changes") Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: André Almeida <andrealmeid@igalia.com> Tested-by: Xaver Hugl <xaver.hugl@kde.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Michel Dänzer <michel.daenzer@mailbox.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240731191014.878320-1-contact@emersion.fr
1 parent 1c4a057 commit 929725b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

drivers/gpu/drm/drm_atomic_uapi.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,23 +1071,16 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
10711071
}
10721072

10731073
if (async_flip &&
1074-
prop != config->prop_fb_id &&
1075-
prop != config->prop_in_fence_fd &&
1076-
prop != config->prop_fb_damage_clips) {
1074+
(plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY ||
1075+
(prop != config->prop_fb_id &&
1076+
prop != config->prop_in_fence_fd &&
1077+
prop != config->prop_fb_damage_clips))) {
10771078
ret = drm_atomic_plane_get_property(plane, plane_state,
10781079
prop, &old_val);
10791080
ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
10801081
break;
10811082
}
10821083

1083-
if (async_flip && plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY) {
1084-
drm_dbg_atomic(prop->dev,
1085-
"[OBJECT:%d] Only primary planes can be changed during async flip\n",
1086-
obj->id);
1087-
ret = -EINVAL;
1088-
break;
1089-
}
1090-
10911084
ret = drm_atomic_plane_set_property(plane,
10921085
plane_state, file_priv,
10931086
prop, prop_value);

0 commit comments

Comments
 (0)