drm/sun4i: csc: use layer arg instead of mixer

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>
Link: https://patch.msgid.link/20251104180942.61538-22-jernej.skrabec@gmail.com
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
This commit is contained in:
Jernej Skrabec 2025-11-04 19:09:33 +01:00 committed by Chen-Yu Tsai
parent 37aba59f5f
commit 0bc7d54dcc
3 changed files with 8 additions and 8 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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);
}