From: Ville Syrjälä <[email protected]>

The atomic async flip checks want to compare the old vs. new
property values. For normal properties that is all perfectly
clear, but for the fence/fb_id properties the old value is
not what one might expect. Add some notes to remind the reader
what is happening.

Cc: [email protected]
Cc: André Almeida <[email protected]>
Cc: Boris Brezillon <[email protected]>
Cc: Christopher Snowhill <[email protected]>
Cc: Dave Stevenson <[email protected]>
Cc: Dharma Balasubiramani <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: [email protected]
Cc: Gustavo Padovan <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Icenowy Zheng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Jianmin Lv <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Liviu Dudau <[email protected]>
Cc: Maíra Canal <[email protected]>
Cc: Manikandan Muralidharan <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Mingcong Bai <[email protected]>
Cc: [email protected]
Cc: Qianhai Wu <[email protected]>
Cc: Raspberry Pi Kernel Maintenance <[email protected]>
Cc: Simon Ser <[email protected]>
Cc: [email protected]
Cc: Xaver Hugl <[email protected]>
Cc: Xi Ruoyao <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
b/drivers/gpu/drm/drm_atomic_uapi.c
index aad71d3e2105..cf1edcb242cc 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1225,6 +1225,11 @@ int drm_atomic_set_property(struct drm_atomic_commit 
*state,
                        if (ret)
                                break;
 
+                       /*
+                        * Note that for WRITEBACK_FB_ID and 
WRITEBACK_OUT_FENCE_PTR
+                        * the old value will always be 0. So any commit that 
sets either
+                        * property to any other value will not be considered a 
no-op.
+                        */
                        if (old_val != prop_value) {
                                drm_dbg_atomic(prop->dev,
                                               "[CONNECTOR:%d:%s][PROP:%d:%s] 
Unsupported property change during async flip\n",
@@ -1256,6 +1261,11 @@ int drm_atomic_set_property(struct drm_atomic_commit 
*state,
                        if (ret)
                                break;
 
+                       /*
+                        * Note that for OUT_FENCE_PTR the old value will 
always be 0.
+                        * So any commit that sets the property to any other 
value
+                        * will not be considered a no-op.
+                        */
                        if (old_val != prop_value) {
                                drm_dbg_atomic(prop->dev,
                                               "[CRTC:%d:%s][PROP:%d:%s] 
Unsupported property change during async flip\n",
@@ -1289,7 +1299,13 @@ int drm_atomic_set_property(struct drm_atomic_commit 
*state,
                        if (ret)
                                break;
 
-                       /* fail everything that isn't no-op or a pure flip */
+                       /*
+                        * Fail everything that isn't no-op or a pure flip.
+                        *
+                        * Note that for IN_FENCE_FD the old value will always 
be -1.
+                        * So any commit that sets the property to any other 
value
+                        * will not be considered a no-op.
+                        */
                        if (old_val != prop_value &&
                            prop != config->prop_fb_id &&
                            prop != config->prop_in_fence_fd &&
-- 
2.56.0

Reply via email to