Commit 6b2dc8cf authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dpu: drop dpu_mdss_cfg::mdp_count field

There is always a single MDP TOP block. Drop the mdp_count field and
stop declaring dpu_mdp_cfg instances as arrays.
Tested-by: default avatarMarijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: default avatarMarijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/545355/
Link: https://lore.kernel.org/r/20230704022136.130522-5-dmitry.baryshkov@linaro.org
parent fdac4bc5
...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg msm8998_ubwc_cfg = { ...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg msm8998_ubwc_cfg = {
.highest_bank_bit = 0x2, .highest_bank_bit = 0x2,
}; };
static const struct dpu_mdp_cfg msm8998_mdp[] = { static const struct dpu_mdp_cfg msm8998_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x458, .base = 0x0, .len = 0x458,
.features = BIT(DPU_MDP_VSYNC_SEL), .features = BIT(DPU_MDP_VSYNC_SEL),
...@@ -41,7 +40,6 @@ static const struct dpu_mdp_cfg msm8998_mdp[] = { ...@@ -41,7 +40,6 @@ static const struct dpu_mdp_cfg msm8998_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 12 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 12 },
.clk_ctrls[DPU_CLK_CTRL_CURSOR0] = { .reg_off = 0x3a8, .bit_off = 16 }, .clk_ctrls[DPU_CLK_CTRL_CURSOR0] = { .reg_off = 0x3a8, .bit_off = 16 },
.clk_ctrls[DPU_CLK_CTRL_CURSOR1] = { .reg_off = 0x3b0, .bit_off = 16 }, .clk_ctrls[DPU_CLK_CTRL_CURSOR1] = { .reg_off = 0x3b0, .bit_off = 16 },
},
}; };
static const struct dpu_ctl_cfg msm8998_ctl[] = { static const struct dpu_ctl_cfg msm8998_ctl[] = {
...@@ -192,8 +190,7 @@ static const struct dpu_perf_cfg msm8998_perf_data = { ...@@ -192,8 +190,7 @@ static const struct dpu_perf_cfg msm8998_perf_data = {
const struct dpu_mdss_cfg dpu_msm8998_cfg = { const struct dpu_mdss_cfg dpu_msm8998_cfg = {
.caps = &msm8998_dpu_caps, .caps = &msm8998_dpu_caps,
.ubwc = &msm8998_ubwc_cfg, .ubwc = &msm8998_ubwc_cfg,
.mdp_count = ARRAY_SIZE(msm8998_mdp), .mdp = &msm8998_mdp,
.mdp = msm8998_mdp,
.ctl_count = ARRAY_SIZE(msm8998_ctl), .ctl_count = ARRAY_SIZE(msm8998_ctl),
.ctl = msm8998_ctl, .ctl = msm8998_ctl,
.sspp_count = ARRAY_SIZE(msm8998_sspp), .sspp_count = ARRAY_SIZE(msm8998_sspp),
......
...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg sdm845_ubwc_cfg = { ...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg sdm845_ubwc_cfg = {
.highest_bank_bit = 0x2, .highest_bank_bit = 0x2,
}; };
static const struct dpu_mdp_cfg sdm845_mdp[] = { static const struct dpu_mdp_cfg sdm845_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x45c, .base = 0x0, .len = 0x45c,
.features = BIT(DPU_MDP_AUDIO_SELECT) | BIT(DPU_MDP_VSYNC_SEL), .features = BIT(DPU_MDP_AUDIO_SELECT) | BIT(DPU_MDP_VSYNC_SEL),
...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sdm845_mdp[] = { ...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sdm845_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
},
}; };
static const struct dpu_ctl_cfg sdm845_ctl[] = { static const struct dpu_ctl_cfg sdm845_ctl[] = {
...@@ -196,8 +194,7 @@ static const struct dpu_perf_cfg sdm845_perf_data = { ...@@ -196,8 +194,7 @@ static const struct dpu_perf_cfg sdm845_perf_data = {
const struct dpu_mdss_cfg dpu_sdm845_cfg = { const struct dpu_mdss_cfg dpu_sdm845_cfg = {
.caps = &sdm845_dpu_caps, .caps = &sdm845_dpu_caps,
.ubwc = &sdm845_ubwc_cfg, .ubwc = &sdm845_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sdm845_mdp), .mdp = &sdm845_mdp,
.mdp = sdm845_mdp,
.ctl_count = ARRAY_SIZE(sdm845_ctl), .ctl_count = ARRAY_SIZE(sdm845_ctl),
.ctl = sdm845_ctl, .ctl = sdm845_ctl,
.sspp_count = ARRAY_SIZE(sdm845_sspp), .sspp_count = ARRAY_SIZE(sdm845_sspp),
......
...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg sm8150_ubwc_cfg = { ...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg sm8150_ubwc_cfg = {
.highest_bank_bit = 0x2, .highest_bank_bit = 0x2,
}; };
static const struct dpu_mdp_cfg sm8150_mdp[] = { static const struct dpu_mdp_cfg sm8150_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x45c, .base = 0x0, .len = 0x45c,
.features = BIT(DPU_MDP_AUDIO_SELECT), .features = BIT(DPU_MDP_AUDIO_SELECT),
...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sm8150_mdp[] = { ...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sm8150_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
},
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
...@@ -210,8 +208,7 @@ static const struct dpu_perf_cfg sm8150_perf_data = { ...@@ -210,8 +208,7 @@ static const struct dpu_perf_cfg sm8150_perf_data = {
const struct dpu_mdss_cfg dpu_sm8150_cfg = { const struct dpu_mdss_cfg dpu_sm8150_cfg = {
.caps = &sm8150_dpu_caps, .caps = &sm8150_dpu_caps,
.ubwc = &sm8150_ubwc_cfg, .ubwc = &sm8150_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8150_mdp), .mdp = &sm8150_mdp,
.mdp = sm8150_mdp,
.ctl_count = ARRAY_SIZE(sm8150_ctl), .ctl_count = ARRAY_SIZE(sm8150_ctl),
.ctl = sm8150_ctl, .ctl = sm8150_ctl,
.sspp_count = ARRAY_SIZE(sm8150_sspp), .sspp_count = ARRAY_SIZE(sm8150_sspp),
......
...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg sc8180x_ubwc_cfg = { ...@@ -26,8 +26,7 @@ static const struct dpu_ubwc_cfg sc8180x_ubwc_cfg = {
.highest_bank_bit = 0x3, .highest_bank_bit = 0x3,
}; };
static const struct dpu_mdp_cfg sc8180x_mdp[] = { static const struct dpu_mdp_cfg sc8180x_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x45c, .base = 0x0, .len = 0x45c,
.features = BIT(DPU_MDP_AUDIO_SELECT), .features = BIT(DPU_MDP_AUDIO_SELECT),
...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sc8180x_mdp[] = { ...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sc8180x_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
},
}; };
static const struct dpu_ctl_cfg sc8180x_ctl[] = { static const struct dpu_ctl_cfg sc8180x_ctl[] = {
...@@ -216,8 +214,7 @@ static const struct dpu_perf_cfg sc8180x_perf_data = { ...@@ -216,8 +214,7 @@ static const struct dpu_perf_cfg sc8180x_perf_data = {
const struct dpu_mdss_cfg dpu_sc8180x_cfg = { const struct dpu_mdss_cfg dpu_sc8180x_cfg = {
.caps = &sc8180x_dpu_caps, .caps = &sc8180x_dpu_caps,
.ubwc = &sc8180x_ubwc_cfg, .ubwc = &sc8180x_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc8180x_mdp), .mdp = &sc8180x_mdp,
.mdp = sc8180x_mdp,
.ctl_count = ARRAY_SIZE(sc8180x_ctl), .ctl_count = ARRAY_SIZE(sc8180x_ctl),
.ctl = sc8180x_ctl, .ctl = sc8180x_ctl,
.sspp_count = ARRAY_SIZE(sc8180x_sspp), .sspp_count = ARRAY_SIZE(sc8180x_sspp),
......
...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sm8250_ubwc_cfg = { ...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sm8250_ubwc_cfg = {
.ubwc_swizzle = 0x6, .ubwc_swizzle = 0x6,
}; };
static const struct dpu_mdp_cfg sm8250_mdp[] = { static const struct dpu_mdp_cfg sm8250_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
...@@ -40,7 +39,6 @@ static const struct dpu_mdp_cfg sm8250_mdp[] = { ...@@ -40,7 +39,6 @@ static const struct dpu_mdp_cfg sm8250_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
.clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 }, .clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
},
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
...@@ -216,8 +214,7 @@ static const struct dpu_perf_cfg sm8250_perf_data = { ...@@ -216,8 +214,7 @@ static const struct dpu_perf_cfg sm8250_perf_data = {
const struct dpu_mdss_cfg dpu_sm8250_cfg = { const struct dpu_mdss_cfg dpu_sm8250_cfg = {
.caps = &sm8250_dpu_caps, .caps = &sm8250_dpu_caps,
.ubwc = &sm8250_ubwc_cfg, .ubwc = &sm8250_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8250_mdp), .mdp = &sm8250_mdp,
.mdp = sm8250_mdp,
.ctl_count = ARRAY_SIZE(sm8250_ctl), .ctl_count = ARRAY_SIZE(sm8250_ctl),
.ctl = sm8250_ctl, .ctl = sm8250_ctl,
.sspp_count = ARRAY_SIZE(sm8250_sspp), .sspp_count = ARRAY_SIZE(sm8250_sspp),
......
...@@ -22,8 +22,7 @@ static const struct dpu_ubwc_cfg sc7180_ubwc_cfg = { ...@@ -22,8 +22,7 @@ static const struct dpu_ubwc_cfg sc7180_ubwc_cfg = {
.highest_bank_bit = 0x3, .highest_bank_bit = 0x3,
}; };
static const struct dpu_mdp_cfg sc7180_mdp[] = { static const struct dpu_mdp_cfg sc7180_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
...@@ -32,7 +31,6 @@ static const struct dpu_mdp_cfg sc7180_mdp[] = { ...@@ -32,7 +31,6 @@ static const struct dpu_mdp_cfg sc7180_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 }, .clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
},
}; };
static const struct dpu_ctl_cfg sc7180_ctl[] = { static const struct dpu_ctl_cfg sc7180_ctl[] = {
...@@ -134,8 +132,7 @@ static const struct dpu_perf_cfg sc7180_perf_data = { ...@@ -134,8 +132,7 @@ static const struct dpu_perf_cfg sc7180_perf_data = {
const struct dpu_mdss_cfg dpu_sc7180_cfg = { const struct dpu_mdss_cfg dpu_sc7180_cfg = {
.caps = &sc7180_dpu_caps, .caps = &sc7180_dpu_caps,
.ubwc = &sc7180_ubwc_cfg, .ubwc = &sc7180_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc7180_mdp), .mdp = &sc7180_mdp,
.mdp = sc7180_mdp,
.ctl_count = ARRAY_SIZE(sc7180_ctl), .ctl_count = ARRAY_SIZE(sc7180_ctl),
.ctl = sc7180_ctl, .ctl = sc7180_ctl,
.sspp_count = ARRAY_SIZE(sc7180_sspp), .sspp_count = ARRAY_SIZE(sc7180_sspp),
......
...@@ -23,14 +23,12 @@ static const struct dpu_ubwc_cfg sm6115_ubwc_cfg = { ...@@ -23,14 +23,12 @@ static const struct dpu_ubwc_cfg sm6115_ubwc_cfg = {
.ubwc_swizzle = 0x7, .ubwc_swizzle = 0x7,
}; };
static const struct dpu_mdp_cfg sm6115_mdp[] = { static const struct dpu_mdp_cfg sm6115_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
},
}; };
static const struct dpu_ctl_cfg sm6115_ctl[] = { static const struct dpu_ctl_cfg sm6115_ctl[] = {
...@@ -104,8 +102,7 @@ static const struct dpu_perf_cfg sm6115_perf_data = { ...@@ -104,8 +102,7 @@ static const struct dpu_perf_cfg sm6115_perf_data = {
const struct dpu_mdss_cfg dpu_sm6115_cfg = { const struct dpu_mdss_cfg dpu_sm6115_cfg = {
.caps = &sm6115_dpu_caps, .caps = &sm6115_dpu_caps,
.ubwc = &sm6115_ubwc_cfg, .ubwc = &sm6115_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm6115_mdp), .mdp = &sm6115_mdp,
.mdp = sm6115_mdp,
.ctl_count = ARRAY_SIZE(sm6115_ctl), .ctl_count = ARRAY_SIZE(sm6115_ctl),
.ctl = sm6115_ctl, .ctl = sm6115_ctl,
.sspp_count = ARRAY_SIZE(sm6115_sspp), .sspp_count = ARRAY_SIZE(sm6115_sspp),
......
...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sm6350_ubwc_cfg = { ...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sm6350_ubwc_cfg = {
.highest_bank_bit = 1, .highest_bank_bit = 1,
}; };
static const struct dpu_mdp_cfg sm6350_mdp[] = { static const struct dpu_mdp_cfg sm6350_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
...@@ -35,7 +34,6 @@ static const struct dpu_mdp_cfg sm6350_mdp[] = { ...@@ -35,7 +34,6 @@ static const struct dpu_mdp_cfg sm6350_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
},
}; };
static const struct dpu_ctl_cfg sm6350_ctl[] = { static const struct dpu_ctl_cfg sm6350_ctl[] = {
...@@ -143,8 +141,7 @@ static const struct dpu_perf_cfg sm6350_perf_data = { ...@@ -143,8 +141,7 @@ static const struct dpu_perf_cfg sm6350_perf_data = {
const struct dpu_mdss_cfg dpu_sm6350_cfg = { const struct dpu_mdss_cfg dpu_sm6350_cfg = {
.caps = &sm6350_dpu_caps, .caps = &sm6350_dpu_caps,
.ubwc = &sm6350_ubwc_cfg, .ubwc = &sm6350_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm6350_mdp), .mdp = &sm6350_mdp,
.mdp = sm6350_mdp,
.ctl_count = ARRAY_SIZE(sm6350_ctl), .ctl_count = ARRAY_SIZE(sm6350_ctl),
.ctl = sm6350_ctl, .ctl = sm6350_ctl,
.sspp_count = ARRAY_SIZE(sm6350_sspp), .sspp_count = ARRAY_SIZE(sm6350_sspp),
......
...@@ -20,14 +20,12 @@ static const struct dpu_ubwc_cfg qcm2290_ubwc_cfg = { ...@@ -20,14 +20,12 @@ static const struct dpu_ubwc_cfg qcm2290_ubwc_cfg = {
.highest_bank_bit = 0x2, .highest_bank_bit = 0x2,
}; };
static const struct dpu_mdp_cfg qcm2290_mdp[] = { static const struct dpu_mdp_cfg qcm2290_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
},
}; };
static const struct dpu_ctl_cfg qcm2290_ctl[] = { static const struct dpu_ctl_cfg qcm2290_ctl[] = {
...@@ -94,8 +92,7 @@ static const struct dpu_perf_cfg qcm2290_perf_data = { ...@@ -94,8 +92,7 @@ static const struct dpu_perf_cfg qcm2290_perf_data = {
const struct dpu_mdss_cfg dpu_qcm2290_cfg = { const struct dpu_mdss_cfg dpu_qcm2290_cfg = {
.caps = &qcm2290_dpu_caps, .caps = &qcm2290_dpu_caps,
.ubwc = &qcm2290_ubwc_cfg, .ubwc = &qcm2290_ubwc_cfg,
.mdp_count = ARRAY_SIZE(qcm2290_mdp), .mdp = &qcm2290_mdp,
.mdp = qcm2290_mdp,
.ctl_count = ARRAY_SIZE(qcm2290_ctl), .ctl_count = ARRAY_SIZE(qcm2290_ctl),
.ctl = qcm2290_ctl, .ctl = qcm2290_ctl,
.sspp_count = ARRAY_SIZE(qcm2290_sspp), .sspp_count = ARRAY_SIZE(qcm2290_sspp),
......
...@@ -24,14 +24,12 @@ static const struct dpu_ubwc_cfg sm6375_ubwc_cfg = { ...@@ -24,14 +24,12 @@ static const struct dpu_ubwc_cfg sm6375_ubwc_cfg = {
.highest_bank_bit = 1, .highest_bank_bit = 1,
}; };
static const struct dpu_mdp_cfg sm6375_mdp[] = { static const struct dpu_mdp_cfg sm6375_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
},
}; };
static const struct dpu_ctl_cfg sm6375_ctl[] = { static const struct dpu_ctl_cfg sm6375_ctl[] = {
...@@ -109,8 +107,7 @@ static const struct dpu_perf_cfg sm6375_perf_data = { ...@@ -109,8 +107,7 @@ static const struct dpu_perf_cfg sm6375_perf_data = {
const struct dpu_mdss_cfg dpu_sm6375_cfg = { const struct dpu_mdss_cfg dpu_sm6375_cfg = {
.caps = &sm6375_dpu_caps, .caps = &sm6375_dpu_caps,
.ubwc = &sm6375_ubwc_cfg, .ubwc = &sm6375_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm6375_mdp), .mdp = &sm6375_mdp,
.mdp = sm6375_mdp,
.ctl_count = ARRAY_SIZE(sm6375_ctl), .ctl_count = ARRAY_SIZE(sm6375_ctl),
.ctl = sm6375_ctl, .ctl = sm6375_ctl,
.sspp_count = ARRAY_SIZE(sm6375_sspp), .sspp_count = ARRAY_SIZE(sm6375_sspp),
......
...@@ -24,8 +24,7 @@ static const struct dpu_ubwc_cfg sm8350_ubwc_cfg = { ...@@ -24,8 +24,7 @@ static const struct dpu_ubwc_cfg sm8350_ubwc_cfg = {
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
}; };
static const struct dpu_mdp_cfg sm8350_mdp[] = { static const struct dpu_mdp_cfg sm8350_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = 0, .features = 0,
...@@ -38,7 +37,6 @@ static const struct dpu_mdp_cfg sm8350_mdp[] = { ...@@ -38,7 +37,6 @@ static const struct dpu_mdp_cfg sm8350_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
},
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
...@@ -215,8 +213,7 @@ static const struct dpu_perf_cfg sm8350_perf_data = { ...@@ -215,8 +213,7 @@ static const struct dpu_perf_cfg sm8350_perf_data = {
const struct dpu_mdss_cfg dpu_sm8350_cfg = { const struct dpu_mdss_cfg dpu_sm8350_cfg = {
.caps = &sm8350_dpu_caps, .caps = &sm8350_dpu_caps,
.ubwc = &sm8350_ubwc_cfg, .ubwc = &sm8350_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8350_mdp), .mdp = &sm8350_mdp,
.mdp = sm8350_mdp,
.ctl_count = ARRAY_SIZE(sm8350_ctl), .ctl_count = ARRAY_SIZE(sm8350_ctl),
.ctl = sm8350_ctl, .ctl = sm8350_ctl,
.sspp_count = ARRAY_SIZE(sm8350_sspp), .sspp_count = ARRAY_SIZE(sm8350_sspp),
......
...@@ -23,8 +23,7 @@ static const struct dpu_ubwc_cfg sc7280_ubwc_cfg = { ...@@ -23,8 +23,7 @@ static const struct dpu_ubwc_cfg sc7280_ubwc_cfg = {
.ubwc_swizzle = 0x6, .ubwc_swizzle = 0x6,
}; };
static const struct dpu_mdp_cfg sc7280_mdp[] = { static const struct dpu_mdp_cfg sc7280_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x2014, .base = 0x0, .len = 0x2014,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
...@@ -32,7 +31,6 @@ static const struct dpu_mdp_cfg sc7280_mdp[] = { ...@@ -32,7 +31,6 @@ static const struct dpu_mdp_cfg sc7280_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 }, .clk_ctrls[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
},
}; };
static const struct dpu_ctl_cfg sc7280_ctl[] = { static const struct dpu_ctl_cfg sc7280_ctl[] = {
...@@ -156,8 +154,7 @@ static const struct dpu_perf_cfg sc7280_perf_data = { ...@@ -156,8 +154,7 @@ static const struct dpu_perf_cfg sc7280_perf_data = {
const struct dpu_mdss_cfg dpu_sc7280_cfg = { const struct dpu_mdss_cfg dpu_sc7280_cfg = {
.caps = &sc7280_dpu_caps, .caps = &sc7280_dpu_caps,
.ubwc = &sc7280_ubwc_cfg, .ubwc = &sc7280_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc7280_mdp), .mdp = &sc7280_mdp,
.mdp = sc7280_mdp,
.ctl_count = ARRAY_SIZE(sc7280_ctl), .ctl_count = ARRAY_SIZE(sc7280_ctl),
.ctl = sc7280_ctl, .ctl = sc7280_ctl,
.sspp_count = ARRAY_SIZE(sc7280_sspp), .sspp_count = ARRAY_SIZE(sc7280_sspp),
......
...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sc8280xp_ubwc_cfg = { ...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sc8280xp_ubwc_cfg = {
.ubwc_swizzle = 6, .ubwc_swizzle = 6,
}; };
static const struct dpu_mdp_cfg sc8280xp_mdp[] = { static const struct dpu_mdp_cfg sc8280xp_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = BIT(DPU_MDP_PERIPH_0_REMOVED), .features = BIT(DPU_MDP_PERIPH_0_REMOVED),
...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sc8280xp_mdp[] = { ...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sc8280xp_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
},
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
...@@ -219,8 +217,7 @@ static const struct dpu_perf_cfg sc8280xp_perf_data = { ...@@ -219,8 +217,7 @@ static const struct dpu_perf_cfg sc8280xp_perf_data = {
const struct dpu_mdss_cfg dpu_sc8280xp_cfg = { const struct dpu_mdss_cfg dpu_sc8280xp_cfg = {
.caps = &sc8280xp_dpu_caps, .caps = &sc8280xp_dpu_caps,
.ubwc = &sc8280xp_ubwc_cfg, .ubwc = &sc8280xp_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc8280xp_mdp), .mdp = &sc8280xp_mdp,
.mdp = sc8280xp_mdp,
.ctl_count = ARRAY_SIZE(sc8280xp_ctl), .ctl_count = ARRAY_SIZE(sc8280xp_ctl),
.ctl = sc8280xp_ctl, .ctl = sc8280xp_ctl,
.sspp_count = ARRAY_SIZE(sc8280xp_sspp), .sspp_count = ARRAY_SIZE(sc8280xp_sspp),
......
...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sm8450_ubwc_cfg = { ...@@ -25,8 +25,7 @@ static const struct dpu_ubwc_cfg sm8450_ubwc_cfg = {
.ubwc_swizzle = 0x6, .ubwc_swizzle = 0x6,
}; };
static const struct dpu_mdp_cfg sm8450_mdp[] = { static const struct dpu_mdp_cfg sm8450_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0x0, .len = 0x494, .base = 0x0, .len = 0x494,
.features = BIT(DPU_MDP_PERIPH_0_REMOVED), .features = BIT(DPU_MDP_PERIPH_0_REMOVED),
...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sm8450_mdp[] = { ...@@ -39,7 +38,6 @@ static const struct dpu_mdp_cfg sm8450_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 }, .clk_ctrls[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
},
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
...@@ -223,8 +221,7 @@ static const struct dpu_perf_cfg sm8450_perf_data = { ...@@ -223,8 +221,7 @@ static const struct dpu_perf_cfg sm8450_perf_data = {
const struct dpu_mdss_cfg dpu_sm8450_cfg = { const struct dpu_mdss_cfg dpu_sm8450_cfg = {
.caps = &sm8450_dpu_caps, .caps = &sm8450_dpu_caps,
.ubwc = &sm8450_ubwc_cfg, .ubwc = &sm8450_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8450_mdp), .mdp = &sm8450_mdp,
.mdp = sm8450_mdp,
.ctl_count = ARRAY_SIZE(sm8450_ctl), .ctl_count = ARRAY_SIZE(sm8450_ctl),
.ctl = sm8450_ctl, .ctl = sm8450_ctl,
.sspp_count = ARRAY_SIZE(sm8450_sspp), .sspp_count = ARRAY_SIZE(sm8450_sspp),
......
...@@ -24,8 +24,7 @@ static const struct dpu_ubwc_cfg sm8550_ubwc_cfg = { ...@@ -24,8 +24,7 @@ static const struct dpu_ubwc_cfg sm8550_ubwc_cfg = {
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */ .highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
}; };
static const struct dpu_mdp_cfg sm8550_mdp[] = { static const struct dpu_mdp_cfg sm8550_mdp = {
{
.name = "top_0", .id = MDP_TOP, .name = "top_0", .id = MDP_TOP,
.base = 0, .len = 0x494, .base = 0, .len = 0x494,
.features = BIT(DPU_MDP_PERIPH_0_REMOVED), .features = BIT(DPU_MDP_PERIPH_0_REMOVED),
...@@ -40,7 +39,6 @@ static const struct dpu_mdp_cfg sm8550_mdp[] = { ...@@ -40,7 +39,6 @@ static const struct dpu_mdp_cfg sm8550_mdp[] = {
.clk_ctrls[DPU_CLK_CTRL_DMA4] = { .reg_off = 0x2c330, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_DMA4] = { .reg_off = 0x2c330, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_DMA5] = { .reg_off = 0x2e330, .bit_off = 0 }, .clk_ctrls[DPU_CLK_CTRL_DMA5] = { .reg_off = 0x2e330, .bit_off = 0 },
.clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 }, .clk_ctrls[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
},
}; };
/* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */ /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
...@@ -227,8 +225,7 @@ static const struct dpu_perf_cfg sm8550_perf_data = { ...@@ -227,8 +225,7 @@ static const struct dpu_perf_cfg sm8550_perf_data = {
const struct dpu_mdss_cfg dpu_sm8550_cfg = { const struct dpu_mdss_cfg dpu_sm8550_cfg = {
.caps = &sm8550_dpu_caps, .caps = &sm8550_dpu_caps,
.ubwc = &sm8550_ubwc_cfg, .ubwc = &sm8550_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8550_mdp), .mdp = &sm8550_mdp,
.mdp = sm8550_mdp,
.ctl_count = ARRAY_SIZE(sm8550_ctl), .ctl_count = ARRAY_SIZE(sm8550_ctl),
.ctl = sm8550_ctl, .ctl = sm8550_ctl,
.sspp_count = ARRAY_SIZE(sm8550_sspp), .sspp_count = ARRAY_SIZE(sm8550_sspp),
......
...@@ -809,7 +809,6 @@ struct dpu_mdss_cfg { ...@@ -809,7 +809,6 @@ struct dpu_mdss_cfg {
const struct dpu_ubwc_cfg *ubwc; const struct dpu_ubwc_cfg *ubwc;
u32 mdp_count;
const struct dpu_mdp_cfg *mdp; const struct dpu_mdp_cfg *mdp;
u32 ctl_count; u32 ctl_count;
......
...@@ -268,51 +268,26 @@ static void _setup_mdp_ops(struct dpu_hw_mdp_ops *ops, ...@@ -268,51 +268,26 @@ static void _setup_mdp_ops(struct dpu_hw_mdp_ops *ops,
ops->intf_audio_select = dpu_hw_intf_audio_select; ops->intf_audio_select = dpu_hw_intf_audio_select;
} }
static const struct dpu_mdp_cfg *_top_offset(enum dpu_mdp mdp, struct dpu_hw_mdp *dpu_hw_mdptop_init(const struct dpu_mdp_cfg *cfg,
const struct dpu_mdss_cfg *m,
void __iomem *addr,
struct dpu_hw_blk_reg_map *b)
{
int i;
if (!m || !addr || !b)
return ERR_PTR(-EINVAL);
for (i = 0; i < m->mdp_count; i++) {
if (mdp == m->mdp[i].id) {
b->blk_addr = addr + m->mdp[i].base;
b->log_mask = DPU_DBG_MASK_TOP;
return &m->mdp[i];
}
}
return ERR_PTR(-EINVAL);
}
struct dpu_hw_mdp *dpu_hw_mdptop_init(enum dpu_mdp idx,
void __iomem *addr, void __iomem *addr,
const struct dpu_mdss_cfg *m) const struct dpu_mdss_cfg *m)
{ {
struct dpu_hw_mdp *mdp; struct dpu_hw_mdp *mdp;
const struct dpu_mdp_cfg *cfg;
if (!addr || !m) if (!addr)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
mdp = kzalloc(sizeof(*mdp), GFP_KERNEL); mdp = kzalloc(sizeof(*mdp), GFP_KERNEL);
if (!mdp) if (!mdp)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cfg = _top_offset(idx, m, addr, &mdp->hw); mdp->hw.blk_addr = addr + cfg->base;
if (IS_ERR_OR_NULL(cfg)) { mdp->hw.log_mask = DPU_DBG_MASK_TOP;
kfree(mdp);
return ERR_PTR(-EINVAL);
}
/* /*
* Assign ops * Assign ops
*/ */
mdp->idx = idx; mdp->idx = cfg->id;
mdp->caps = cfg; mdp->caps = cfg;
_setup_mdp_ops(&mdp->ops, mdp->caps->features); _setup_mdp_ops(&mdp->ops, mdp->caps->features);
......
...@@ -145,12 +145,12 @@ struct dpu_hw_mdp { ...@@ -145,12 +145,12 @@ struct dpu_hw_mdp {
}; };
/** /**
* dpu_hw_mdptop_init - initializes the top driver for the passed idx * dpu_hw_mdptop_init - initializes the top driver for the passed config
* @idx: Interface index for which driver object is required * @cfg: MDP TOP configuration from catalog
* @addr: Mapped register io address of MDP * @addr: Mapped register io address of MDP
* @m: Pointer to mdss catalog data * @m: Pointer to mdss catalog data
*/ */
struct dpu_hw_mdp *dpu_hw_mdptop_init(enum dpu_mdp idx, struct dpu_hw_mdp *dpu_hw_mdptop_init(const struct dpu_mdp_cfg *cfg,
void __iomem *addr, void __iomem *addr,
const struct dpu_mdss_cfg *m); const struct dpu_mdss_cfg *m);
......
...@@ -1090,7 +1090,8 @@ static int dpu_kms_hw_init(struct msm_kms *kms) ...@@ -1090,7 +1090,8 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
dpu_kms->rm_init = true; dpu_kms->rm_init = true;
dpu_kms->hw_mdp = dpu_hw_mdptop_init(MDP_TOP, dpu_kms->mmio, dpu_kms->hw_mdp = dpu_hw_mdptop_init(dpu_kms->catalog->mdp,
dpu_kms->mmio,
dpu_kms->catalog); dpu_kms->catalog);
if (IS_ERR(dpu_kms->hw_mdp)) { if (IS_ERR(dpu_kms->hw_mdp)) {
rc = PTR_ERR(dpu_kms->hw_mdp); rc = PTR_ERR(dpu_kms->hw_mdp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment