Skip to content

Commit 644f1d4

Browse files
mripardgregkh
authored andcommitted
drm/sun4i: frontend: Rework a bit the phase data
[ Upstream commit 84c971b ] The scaler filter phase setup in the allwinner kernel has two different cases for setting up the scaler filter, the first one using different phase parameters for the two channels, and the second one reusing the first channel parameters on the second channel. The allwinner kernel has a third option where the horizontal phase of the second channel will be set to a different value than the vertical one (and seems like it's the same value than one used on the first channel). However, that code path seems to never be taken, so we can ignore it for now, and it's essentially what we're doing so far as well. Since we will have always the same values across each components of the filter setup for a given channel, we can simplify a bit our frontend structure by only storing the phase value we want to apply to a given channel. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Acked-by: Jernej Skrabec <jernej.skrabec@siol.net> Link: https://patchwork.freedesktop.org/patch/msgid/20201015093642.261440-1-maxime@cerno.tech Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8d971d2 commit 644f1d4

2 files changed

Lines changed: 9 additions & 31 deletions

File tree

drivers/gpu/drm/sun4i/sun4i_frontend.c

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -443,17 +443,17 @@ int sun4i_frontend_update_formats(struct sun4i_frontend *frontend,
443443
* related to the scaler FIR filter phase parameters.
444444
*/
445445
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG,
446-
frontend->data->ch_phase[0].horzphase);
446+
frontend->data->ch_phase[0]);
447447
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG,
448-
frontend->data->ch_phase[1].horzphase);
448+
frontend->data->ch_phase[1]);
449449
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG,
450-
frontend->data->ch_phase[0].vertphase[0]);
450+
frontend->data->ch_phase[0]);
451451
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG,
452-
frontend->data->ch_phase[1].vertphase[0]);
452+
frontend->data->ch_phase[1]);
453453
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG,
454-
frontend->data->ch_phase[0].vertphase[1]);
454+
frontend->data->ch_phase[0]);
455455
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG,
456-
frontend->data->ch_phase[1].vertphase[1]);
456+
frontend->data->ch_phase[1]);
457457

458458
/*
459459
* Checking the input format is sufficient since we currently only
@@ -687,30 +687,12 @@ static const struct dev_pm_ops sun4i_frontend_pm_ops = {
687687
};
688688

689689
static const struct sun4i_frontend_data sun4i_a10_frontend = {
690-
.ch_phase = {
691-
{
692-
.horzphase = 0,
693-
.vertphase = { 0, 0 },
694-
},
695-
{
696-
.horzphase = 0xfc000,
697-
.vertphase = { 0xfc000, 0xfc000 },
698-
},
699-
},
690+
.ch_phase = { 0x000, 0xfc000 },
700691
.has_coef_rdy = true,
701692
};
702693

703694
static const struct sun4i_frontend_data sun8i_a33_frontend = {
704-
.ch_phase = {
705-
{
706-
.horzphase = 0x400,
707-
.vertphase = { 0x400, 0x400 },
708-
},
709-
{
710-
.horzphase = 0x400,
711-
.vertphase = { 0x400, 0x400 },
712-
},
713-
},
695+
.ch_phase = { 0x400, 0x400 },
714696
.has_coef_access_ctrl = true,
715697
};
716698

drivers/gpu/drm/sun4i/sun4i_frontend.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ struct reset_control;
115115
struct sun4i_frontend_data {
116116
bool has_coef_access_ctrl;
117117
bool has_coef_rdy;
118-
119-
struct {
120-
u32 horzphase;
121-
u32 vertphase[2];
122-
} ch_phase[2];
118+
u32 ch_phase[2];
123119
};
124120

125121
struct sun4i_frontend {

0 commit comments

Comments
 (0)