[PATCH] drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates.

2016-08-28 Thread Daniel Vetter
On Sat, Aug 27, 2016 at 01:02:28AM +0200, Mario Kleiner wrote:
> Due to assigning the 'replaced' value instead of or'ing it,
> if drm_atomic_crtc_set_property() gets called multiple times,
> the last call will define the color_mgmt_changed flag, so
> a non-updating call to a property can reset the flag and
> prevent actual hw state updates required by preceding
> property updates.
> 
> Signed-off-by: Mario Kleiner 
> Cc: Daniel Vetter 
> Cc:  # v4.6+
Fixes: 5488dc16fde7 ("drm: introduce pipe color correction properties")

Oops. I wonder why we didn't catch this in testcases ...

Reviewed-by: Daniel Vetter 

Dave, can you pls pick this up?

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


[PATCH] drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates.

2016-08-27 Thread Mario Kleiner
Due to assigning the 'replaced' value instead of or'ing it,
if drm_atomic_crtc_set_property() gets called multiple times,
the last call will define the color_mgmt_changed flag, so
a non-updating call to a property can reset the flag and
prevent actual hw state updates required by preceding
property updates.

Signed-off-by: Mario Kleiner 
Cc: Daniel Vetter 
Cc:  # v4.6+
---
 drivers/gpu/drm/drm_atomic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 8d2f111..3a985d6 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -475,7 +475,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
val,
-1,
);
-   state->color_mgmt_changed = replaced;
+   state->color_mgmt_changed |= replaced;
return ret;
} else if (property == config->ctm_property) {
ret = drm_atomic_replace_property_blob_from_id(crtc,
@@ -483,7 +483,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
val,
sizeof(struct drm_color_ctm),
);
-   state->color_mgmt_changed = replaced;
+   state->color_mgmt_changed |= replaced;
return ret;
} else if (property == config->gamma_lut_property) {
ret = drm_atomic_replace_property_blob_from_id(crtc,
@@ -491,7 +491,7 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
val,
-1,
);
-   state->color_mgmt_changed = replaced;
+   state->color_mgmt_changed |= replaced;
return ret;
} else if (crtc->funcs->atomic_set_property)
return crtc->funcs->atomic_set_property(crtc, state, property, 
val);
-- 
2.7.0