The lcdc_csc_init callback was introduced in commit aa71584b323a ("drm:
atmel-hlcdc: add driver ops to differentiate HLCDC and XLCDC IP") and
called only once, at init time, from atmel_hlcdc_plane_init_properties().

commit 81af99cbd9e4 ("drm/atmel-hlcdc: destroy properly the plane state
in the reset callback") then reworked the reset hook to use
atmel_hlcdc_plane_atomic_destroy_state() instead of duplicating the
code. However, it also introduced a new call to lcdc_csc_init in the
reset path that wasn't there before and wasn't mentioned in the commit
log.

Since CSC coefficients are hardware constants that only need to be
written once at init time. This also prevents the conversion to
atomic_create_state, which must not have any hardware side-effect.

Fixes: 81af99cbd9e4 ("drm/atmel-hlcdc: destroy properly the plane state in the 
reset callback")
Signed-off-by: Maxime Ripard <[email protected]>

---
Cc: Dharma Balasubiramani <[email protected]>
Cc: Ludovic Desroches <[email protected]>
Cc: Manikandan Muralidharan <[email protected]>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index f17a832351e9..70a1cef24388 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -1184,12 +1184,10 @@ static void 
atmel_hlcdc_plane_atomic_destroy_state(struct drm_plane *p,
 }
 
 static void atmel_hlcdc_plane_reset(struct drm_plane *p)
 {
        struct atmel_hlcdc_plane_state *state;
-       struct atmel_hlcdc_dc *dc = p->dev->dev_private;
-       struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
 
        if (p->state) {
                atmel_hlcdc_plane_atomic_destroy_state(p, p->state);
                p->state = NULL;
        }
@@ -1202,13 +1200,10 @@ static void atmel_hlcdc_plane_reset(struct drm_plane *p)
                                "Failed to allocate initial plane state\n");
                        return;
                }
                __drm_atomic_helper_plane_reset(p, &state->base);
        }
-
-       if (plane->layer.desc->layout.csc)
-               dc->desc->ops->lcdc_csc_init(plane, plane->layer.desc);
 }
 
 static const struct drm_plane_funcs layer_plane_funcs = {
        .update_plane = drm_atomic_helper_update_plane,
        .disable_plane = drm_atomic_helper_disable_plane,

-- 
2.55.0

Reply via email to