Skip to contentSkip to conversation

drm/atomic: reject colorop property changes in async flips

PATCH New Melissa Wen 1 participant 1 message Nov 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/atomic: reject colorop property changes in async flips

Commit 0e26cc72c71c ("drm: Refuse to async flip with atomic prop changes") only allows async flip with plane's framebuffer and a few related plane property changes and don't include color management properties.

Apply the same rule to colorops: accept a value that matches the current state, so userspace can keep resubmitting its whole color pipeline with every flip, and reject any change with -EINVAL.

Fixes cfc27680ee20 ("drm/colorop: Introduce new drm_colorop mode object")
---
 drivers/gpu/drm/drm_atomic_uapi.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +8 -0
index 1eebcf6f5e05..a45e61cd9bc3 100644
@@ -1322,6 +1322,14 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 			break;
 		}
 
+		if (async_flip) {
+			/* no-op changes are always allowed */
+			ret = drm_atomic_colorop_get_property(colorop, colorop_state,
+							      prop, &old_val);
+			ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
+			break;
+		}
+
 		ret = drm_atomic_colorop_set_property(colorop, colorop_state,
 						      file_priv, prop, prop_value,
 						      &replaced);
Signature · 1 line
2.53.0