mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
drm/sun4i: ui_scaler: use layer instead of mixer for args
Layer related peripherals should take layer struct as a input. This looks cleaner and also necessary for proper DE33 support later. 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-19-jernej.skrabec@gmail.com Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
This commit is contained in:
parent
f10a80105e
commit
1ebec02bba
|
|
@ -110,17 +110,16 @@ static void sun8i_ui_layer_update_coord(struct sun8i_layer *layer,
|
|||
state->fb->format);
|
||||
sun8i_vi_scaler_enable(mixer, layer->channel, true);
|
||||
} else {
|
||||
sun8i_ui_scaler_setup(mixer, layer->channel, src_w, src_h,
|
||||
dst_w, dst_h, hscale, vscale,
|
||||
hphase, vphase);
|
||||
sun8i_ui_scaler_enable(mixer, layer->channel, true);
|
||||
sun8i_ui_scaler_setup(layer, src_w, src_h, dst_w, dst_h,
|
||||
hscale, vscale, hphase, vphase);
|
||||
sun8i_ui_scaler_enable(layer, true);
|
||||
}
|
||||
} else {
|
||||
DRM_DEBUG_DRIVER("HW scaling is not needed\n");
|
||||
if (mixer->cfg->de_type == SUN8I_MIXER_DE33)
|
||||
sun8i_vi_scaler_enable(mixer, layer->channel, false);
|
||||
else
|
||||
sun8i_ui_scaler_enable(mixer, layer->channel, false);
|
||||
sun8i_ui_scaler_enable(layer, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,14 +127,15 @@ static int sun8i_ui_scaler_coef_index(unsigned int step)
|
|||
}
|
||||
}
|
||||
|
||||
void sun8i_ui_scaler_enable(struct sun8i_mixer *mixer, int layer, bool enable)
|
||||
void sun8i_ui_scaler_enable(struct sun8i_layer *layer, bool enable)
|
||||
{
|
||||
struct sun8i_mixer *mixer = layer->mixer;
|
||||
u32 val, base;
|
||||
|
||||
if (WARN_ON(layer < mixer->cfg->vi_num))
|
||||
if (WARN_ON(layer->channel < mixer->cfg->vi_num))
|
||||
return;
|
||||
|
||||
base = sun8i_ui_scaler_base(mixer, layer);
|
||||
base = sun8i_ui_scaler_base(mixer, layer->channel);
|
||||
|
||||
if (enable)
|
||||
val = SUN8I_SCALER_GSU_CTRL_EN |
|
||||
|
|
@ -145,18 +146,19 @@ void sun8i_ui_scaler_enable(struct sun8i_mixer *mixer, int layer, bool enable)
|
|||
regmap_write(mixer->engine.regs, SUN8I_SCALER_GSU_CTRL(base), val);
|
||||
}
|
||||
|
||||
void sun8i_ui_scaler_setup(struct sun8i_mixer *mixer, int layer,
|
||||
void sun8i_ui_scaler_setup(struct sun8i_layer *layer,
|
||||
u32 src_w, u32 src_h, u32 dst_w, u32 dst_h,
|
||||
u32 hscale, u32 vscale, u32 hphase, u32 vphase)
|
||||
{
|
||||
struct sun8i_mixer *mixer = layer->mixer;
|
||||
u32 insize, outsize;
|
||||
int i, offset;
|
||||
u32 base;
|
||||
|
||||
if (WARN_ON(layer < mixer->cfg->vi_num))
|
||||
if (WARN_ON(layer->channel < mixer->cfg->vi_num))
|
||||
return;
|
||||
|
||||
base = sun8i_ui_scaler_base(mixer, layer);
|
||||
base = sun8i_ui_scaler_base(mixer, layer->channel);
|
||||
|
||||
hphase <<= SUN8I_UI_SCALER_PHASE_FRAC - 16;
|
||||
vphase <<= SUN8I_UI_SCALER_PHASE_FRAC - 16;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@
|
|||
#define SUN8I_SCALER_GSU_CTRL_EN BIT(0)
|
||||
#define SUN8I_SCALER_GSU_CTRL_COEFF_RDY BIT(4)
|
||||
|
||||
void sun8i_ui_scaler_enable(struct sun8i_mixer *mixer, int layer, bool enable);
|
||||
void sun8i_ui_scaler_setup(struct sun8i_mixer *mixer, int layer,
|
||||
void sun8i_ui_scaler_enable(struct sun8i_layer *layer, bool enable);
|
||||
void sun8i_ui_scaler_setup(struct sun8i_layer *layer,
|
||||
u32 src_w, u32 src_h, u32 dst_w, u32 dst_h,
|
||||
u32 hscale, u32 vscale, u32 hphase, u32 vphase);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user