Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jernej Skrabec and committed by
Chen-Yu Tsai
0bc7d54d 37aba59f

+8 -8
+5 -5
drivers/gpu/drm/sun4i/sun8i_csc.c
··· 227 227 } 228 228 } 229 229 230 - void sun8i_csc_config(struct sun8i_mixer *mixer, int layer, 230 + void sun8i_csc_config(struct sun8i_layer *layer, 231 231 struct drm_plane_state *state) 232 232 { 233 233 u32 mode = sun8i_csc_get_mode(state); 234 234 u32 base; 235 235 236 - if (mixer->cfg->de_type == SUN8I_MIXER_DE3) { 237 - sun8i_de3_ccsc_setup(mixer->engine.regs, layer, 236 + if (layer->mixer->cfg->de_type == SUN8I_MIXER_DE3) { 237 + sun8i_de3_ccsc_setup(layer->regs, layer->channel, 238 238 mode, state->color_encoding, 239 239 state->color_range); 240 240 return; 241 241 } 242 242 243 - base = ccsc_base[mixer->cfg->ccsc][layer]; 243 + base = ccsc_base[layer->mixer->cfg->ccsc][layer->channel]; 244 244 245 - sun8i_csc_setup(mixer->engine.regs, base, 245 + sun8i_csc_setup(layer->regs, base, 246 246 mode, state->color_encoding, 247 247 state->color_range); 248 248 }
+2 -2
drivers/gpu/drm/sun4i/sun8i_csc.h
··· 9 9 #include <drm/drm_color_mgmt.h> 10 10 11 11 struct drm_plane_state; 12 - struct sun8i_mixer; 12 + struct sun8i_layer; 13 13 14 14 /* VI channel CSC units offsets */ 15 15 #define CCSC00_OFFSET 0xAA050 ··· 23 23 24 24 #define SUN8I_CSC_CTRL_EN BIT(0) 25 25 26 - void sun8i_csc_config(struct sun8i_mixer *mixer, int layer, 26 + void sun8i_csc_config(struct sun8i_layer *layer, 27 27 struct drm_plane_state *state); 28 28 29 29 #endif
+1 -1
drivers/gpu/drm/sun4i/sun8i_vi_layer.c
··· 301 301 302 302 sun8i_vi_layer_update_attributes(layer, plane); 303 303 sun8i_vi_layer_update_coord(layer, plane); 304 - sun8i_csc_config(layer->mixer, layer->channel, new_state); 304 + sun8i_csc_config(layer, new_state); 305 305 sun8i_vi_layer_update_buffer(layer, plane); 306 306 } 307 307