[PATCH v2 21/30] drm/sun4i: csc: use layer arg instead of mixer

Jernej Skrabec
2025-11-04T18:10:30Z

Layer will be more universal, due to DE33 support.

Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Tested-by: Ryan Walklin <ryan@testtoast.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
drivers/gpu/drm/sun4i/sun8i_csc.c | 10 +++++-----
drivers/gpu/drm/sun4i/sun8i_csc.h | 4 ++--
drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.c b/drivers/gpu/drm/sun4i/sun8i_csc.c
index ac7b62adc7df..c371e94b95bd 100644
--- a/drivers/gpu/drm/sun4i/sun8i_csc.c
+++ b/drivers/gpu/drm/sun4i/sun8i_csc.c
@@ -227,22 +227,22 @@ static u32 sun8i_csc_get_mode(struct drm_plane_state *state)
}
}

-void sun8i_csc_config(struct sun8i_mixer *mixer, int layer,
+void sun8i_csc_config(struct sun8i_layer *layer,
struct drm_plane_state *state)
{
u32 mode = sun8i_csc_get_mode(state);
u32 base;

- if (mixer->cfg->de_type == SUN8I_MIXER_DE3) {
- sun8i_de3_ccsc_setup(mixer->engine.regs, layer,
+ if (layer->mixer->cfg->de_type == SUN8I_MIXER_DE3) {
+ sun8i_de3_ccsc_setup(layer->regs, layer->channel,
mode, state->color_encoding,
state->color_range);
return;
}

- base = ccsc_base[mixer->cfg->ccsc][layer];
+ base = ccsc_base[layer->mixer->cfg->ccsc][layer->channel];

- sun8i_csc_setup(mixer->engine.regs, base,
+ sun8i_csc_setup(layer->regs, base,
mode, state->color_encoding,
state->color_range);
}
diff --git a/drivers/gpu/drm/sun4i/sun8i_csc.h b/drivers/gpu/drm/sun4i/sun8i_csc.h
index ce921521aaca..2a4b79599610 100644
--- a/drivers/gpu/drm/sun4i/sun8i_csc.h
+++ b/drivers/gpu/drm/sun4i/sun8i_csc.h
@@ -9,7 +9,7 @@
#include <drm/drm_color_mgmt.h>

struct drm_plane_state;
-struct sun8i_mixer;
+struct sun8i_layer;

/* VI channel CSC units offsets */
#define CCSC00_OFFSET 0xAA050
@@ -23,7 +23,7 @@ struct sun8i_mixer;

#define SUN8I_CSC_CTRL_EN BIT(0)

-void sun8i_csc_config(struct sun8i_mixer *mixer, int layer,
+void sun8i_csc_config(struct sun8i_layer *layer,
struct drm_plane_state *state);

#endif
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
index 2290c983e177..4f0c929faf36 100644
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
@@ -301,7 +301,7 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,

sun8i_vi_layer_update_attributes(layer, plane);
sun8i_vi_layer_update_coord(layer, plane);
- sun8i_csc_config(layer->mixer, layer->channel, new_state);
+ sun8i_csc_config(layer, new_state);
sun8i_vi_layer_update_buffer(layer, plane);
}

--
2.51.2