1 From add1fa75101263ab4d74240f93000998d4325624 Mon Sep 17 00:00:00 2001
2 From: Mario Kleiner <mario.kleiner.de@gmail.com>
3 Date: Sat, 27 Aug 2016 01:02:28 +0200
4 Subject: drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates.
6 From: Mario Kleiner <mario.kleiner.de@gmail.com>
8 commit add1fa75101263ab4d74240f93000998d4325624 upstream.
10 Due to assigning the 'replaced' value instead of or'ing it,
11 if drm_atomic_crtc_set_property() gets called multiple times,
12 the last call will define the color_mgmt_changed flag, so
13 a non-updating call to a property can reset the flag and
14 prevent actual hw state updates required by preceding
17 Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
18 Cc: Daniel Vetter <daniel.vetter@intel.com>
19 Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
20 Signed-off-by: Dave Airlie <airlied@redhat.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 drivers/gpu/drm/drm_atomic.c | 6 +++---
25 1 file changed, 3 insertions(+), 3 deletions(-)
27 --- a/drivers/gpu/drm/drm_atomic.c
28 +++ b/drivers/gpu/drm/drm_atomic.c
29 @@ -465,7 +465,7 @@ int drm_atomic_crtc_set_property(struct
33 - state->color_mgmt_changed = replaced;
34 + state->color_mgmt_changed |= replaced;
36 } else if (property == config->ctm_property) {
37 ret = drm_atomic_replace_property_blob_from_id(crtc,
38 @@ -473,7 +473,7 @@ int drm_atomic_crtc_set_property(struct
40 sizeof(struct drm_color_ctm),
42 - state->color_mgmt_changed = replaced;
43 + state->color_mgmt_changed |= replaced;
45 } else if (property == config->gamma_lut_property) {
46 ret = drm_atomic_replace_property_blob_from_id(crtc,
47 @@ -481,7 +481,7 @@ int drm_atomic_crtc_set_property(struct
51 - state->color_mgmt_changed = replaced;
52 + state->color_mgmt_changed |= replaced;
54 } else if (crtc->funcs->atomic_set_property)
55 return crtc->funcs->atomic_set_property(crtc, state, property, val);