Commit fbbd8cce authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dpu: move UBWC/memory configuration to separate struct

UBWC and highest bank settings differ slightly between different DPU
units of the same generation, while the dpu_caps and dpu_mdp_cfg are
much more stable. To ease configuration reuse move ubwc_swizzle and
highest_bank_bit data to separate structure.
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/530820/
Link: https://lore.kernel.org/r/20230404130622.509628-7-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent ac1c5ed6
...@@ -323,7 +323,6 @@ static const struct dpu_caps msm8998_dpu_caps = { ...@@ -323,7 +323,6 @@ static const struct dpu_caps msm8998_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0x7, .max_mixer_blendstages = 0x7,
.qseed_type = DPU_SSPP_SCALER_QSEED3, .qseed_type = DPU_SSPP_SCALER_QSEED3,
.ubwc_version = DPU_HW_UBWC_VER_10,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -347,7 +346,6 @@ static const struct dpu_caps sdm845_dpu_caps = { ...@@ -347,7 +346,6 @@ static const struct dpu_caps sdm845_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED3, .qseed_type = DPU_SSPP_SCALER_QSEED3,
.ubwc_version = DPU_HW_UBWC_VER_20,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -362,7 +360,6 @@ static const struct dpu_caps sc7180_dpu_caps = { ...@@ -362,7 +360,6 @@ static const struct dpu_caps sc7180_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0x9, .max_mixer_blendstages = 0x9,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_20,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
.max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
...@@ -373,7 +370,6 @@ static const struct dpu_caps sm6115_dpu_caps = { ...@@ -373,7 +370,6 @@ static const struct dpu_caps sm6115_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_LINE_WIDTH,
.max_mixer_blendstages = 0x4, .max_mixer_blendstages = 0x4,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_10,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
.max_linewidth = 2160, .max_linewidth = 2160,
...@@ -384,7 +380,6 @@ static const struct dpu_caps sm8150_dpu_caps = { ...@@ -384,7 +380,6 @@ static const struct dpu_caps sm8150_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED3, .qseed_type = DPU_SSPP_SCALER_QSEED3,
.ubwc_version = DPU_HW_UBWC_VER_30,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -399,7 +394,6 @@ static const struct dpu_caps sc8180x_dpu_caps = { ...@@ -399,7 +394,6 @@ static const struct dpu_caps sc8180x_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED3, .qseed_type = DPU_SSPP_SCALER_QSEED3,
.ubwc_version = DPU_HW_UBWC_VER_30,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -414,7 +408,6 @@ static const struct dpu_caps sc8280xp_dpu_caps = { ...@@ -414,7 +408,6 @@ static const struct dpu_caps sc8280xp_dpu_caps = {
.max_mixer_width = 2560, .max_mixer_width = 2560,
.max_mixer_blendstages = 11, .max_mixer_blendstages = 11,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_40,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -427,7 +420,6 @@ static const struct dpu_caps sm8250_dpu_caps = { ...@@ -427,7 +420,6 @@ static const struct dpu_caps sm8250_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_40,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -440,7 +432,6 @@ static const struct dpu_caps sm8350_dpu_caps = { ...@@ -440,7 +432,6 @@ static const struct dpu_caps sm8350_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_40,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -453,7 +444,6 @@ static const struct dpu_caps sm8450_dpu_caps = { ...@@ -453,7 +444,6 @@ static const struct dpu_caps sm8450_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_40,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -466,7 +456,6 @@ static const struct dpu_caps sm8550_dpu_caps = { ...@@ -466,7 +456,6 @@ static const struct dpu_caps sm8550_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0xb, .max_mixer_blendstages = 0xb,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_40,
.has_src_split = true, .has_src_split = true,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
...@@ -479,19 +468,86 @@ static const struct dpu_caps sc7280_dpu_caps = { ...@@ -479,19 +468,86 @@ static const struct dpu_caps sc7280_dpu_caps = {
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
.max_mixer_blendstages = 0x7, .max_mixer_blendstages = 0x7,
.qseed_type = DPU_SSPP_SCALER_QSEED4, .qseed_type = DPU_SSPP_SCALER_QSEED4,
.ubwc_version = DPU_HW_UBWC_VER_30,
.has_dim_layer = true, .has_dim_layer = true,
.has_idle_pc = true, .has_idle_pc = true,
.max_linewidth = 2400, .max_linewidth = 2400,
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE, .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
}; };
static const struct dpu_ubwc_cfg msm8998_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_10,
.highest_bank_bit = 0x2,
};
static const struct dpu_ubwc_cfg qcm2290_ubwc_cfg = {
.highest_bank_bit = 0x2,
};
static const struct dpu_ubwc_cfg sdm845_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_20,
.highest_bank_bit = 0x2,
};
static const struct dpu_ubwc_cfg sc7180_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_20,
.highest_bank_bit = 0x3,
};
static const struct dpu_ubwc_cfg sm6115_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_10,
.highest_bank_bit = 0x1,
.ubwc_swizzle = 0x7,
};
static const struct dpu_ubwc_cfg sm8150_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_30,
.highest_bank_bit = 0x2,
};
static const struct dpu_ubwc_cfg sc8180x_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_30,
.highest_bank_bit = 0x3,
};
static const struct dpu_ubwc_cfg sc8280xp_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_40,
.highest_bank_bit = 2,
.ubwc_swizzle = 6,
};
static const struct dpu_ubwc_cfg sm8250_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_40,
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
.ubwc_swizzle = 0x6,
};
static const struct dpu_ubwc_cfg sm8350_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_40,
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
};
static const struct dpu_ubwc_cfg sm8450_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_40,
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
.ubwc_swizzle = 0x6,
};
static const struct dpu_ubwc_cfg sm8550_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_40,
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
};
static const struct dpu_ubwc_cfg sc7280_ubwc_cfg = {
.ubwc_version = DPU_HW_UBWC_VER_30,
.highest_bank_bit = 0x1,
.ubwc_swizzle = 0x6,
};
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 = 0, .features = 0,
.highest_bank_bit = 0x2,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -520,7 +576,6 @@ static const struct dpu_mdp_cfg sdm845_mdp[] = { ...@@ -520,7 +576,6 @@ 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), .features = BIT(DPU_MDP_AUDIO_SELECT),
.highest_bank_bit = 0x2,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -545,7 +600,6 @@ static const struct dpu_mdp_cfg sc7180_mdp[] = { ...@@ -545,7 +600,6 @@ 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,
.highest_bank_bit = 0x3,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
...@@ -564,7 +618,6 @@ static const struct dpu_mdp_cfg sc8180x_mdp[] = { ...@@ -564,7 +618,6 @@ 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),
.highest_bank_bit = 0x3,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -589,8 +642,6 @@ static const struct dpu_mdp_cfg sm6115_mdp[] = { ...@@ -589,8 +642,6 @@ 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,
.highest_bank_bit = 0x1,
.ubwc_swizzle = 0x7,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2ac, .bit_off = 0}, .reg_off = 0x2ac, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
...@@ -603,8 +654,6 @@ static const struct dpu_mdp_cfg sm8250_mdp[] = { ...@@ -603,8 +654,6 @@ 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,
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
.ubwc_swizzle = 0x6,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -633,7 +682,6 @@ static const struct dpu_mdp_cfg sm8350_mdp[] = { ...@@ -633,7 +682,6 @@ 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,
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2ac, .bit_off = 0}, .reg_off = 0x2ac, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -660,8 +708,6 @@ static const struct dpu_mdp_cfg sm8450_mdp[] = { ...@@ -660,8 +708,6 @@ 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),
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
.ubwc_swizzle = 0x6,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -687,8 +733,6 @@ static const struct dpu_mdp_cfg sc7280_mdp[] = { ...@@ -687,8 +733,6 @@ 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,
.highest_bank_bit = 0x1,
.ubwc_swizzle = 0x6,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
...@@ -705,8 +749,6 @@ static const struct dpu_mdp_cfg sc8280xp_mdp[] = { ...@@ -705,8 +749,6 @@ 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),
.highest_bank_bit = 2,
.ubwc_swizzle = 6,
.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_VIG1] = { .reg_off = 0x2b4, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0}, .clk_ctrls[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0},
...@@ -724,8 +766,6 @@ static const struct dpu_mdp_cfg sm8550_mdp[] = { ...@@ -724,8 +766,6 @@ 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),
.highest_bank_bit = 0x3, /* TODO: 2 for LP_DDR4 */
.ubwc_swizzle = 0x6,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x4330, .bit_off = 0}, .reg_off = 0x4330, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_VIG1] = { .clk_ctrls[DPU_CLK_CTRL_VIG1] = {
...@@ -756,7 +796,6 @@ static const struct dpu_mdp_cfg qcm2290_mdp[] = { ...@@ -756,7 +796,6 @@ 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,
.highest_bank_bit = 0x2,
.clk_ctrls[DPU_CLK_CTRL_VIG0] = { .clk_ctrls[DPU_CLK_CTRL_VIG0] = {
.reg_off = 0x2AC, .bit_off = 0}, .reg_off = 0x2AC, .bit_off = 0},
.clk_ctrls[DPU_CLK_CTRL_DMA0] = { .clk_ctrls[DPU_CLK_CTRL_DMA0] = {
...@@ -2530,6 +2569,7 @@ static const struct dpu_perf_cfg qcm2290_perf_data = { ...@@ -2530,6 +2569,7 @@ static const struct dpu_perf_cfg qcm2290_perf_data = {
static const struct dpu_mdss_cfg msm8998_dpu_cfg = { static const struct dpu_mdss_cfg msm8998_dpu_cfg = {
.caps = &msm8998_dpu_caps, .caps = &msm8998_dpu_caps,
.ubwc = &msm8998_ubwc_cfg,
.mdp_count = ARRAY_SIZE(msm8998_mdp), .mdp_count = ARRAY_SIZE(msm8998_mdp),
.mdp = msm8998_mdp, .mdp = msm8998_mdp,
.ctl_count = ARRAY_SIZE(msm8998_ctl), .ctl_count = ARRAY_SIZE(msm8998_ctl),
...@@ -2553,6 +2593,7 @@ static const struct dpu_mdss_cfg msm8998_dpu_cfg = { ...@@ -2553,6 +2593,7 @@ static const struct dpu_mdss_cfg msm8998_dpu_cfg = {
static const struct dpu_mdss_cfg sdm845_dpu_cfg = { static const struct dpu_mdss_cfg sdm845_dpu_cfg = {
.caps = &sdm845_dpu_caps, .caps = &sdm845_dpu_caps,
.ubwc = &sdm845_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sdm845_mdp), .mdp_count = ARRAY_SIZE(sdm845_mdp),
.mdp = sdm845_mdp, .mdp = sdm845_mdp,
.ctl_count = ARRAY_SIZE(sdm845_ctl), .ctl_count = ARRAY_SIZE(sdm845_ctl),
...@@ -2577,6 +2618,7 @@ static const struct dpu_mdss_cfg sdm845_dpu_cfg = { ...@@ -2577,6 +2618,7 @@ static const struct dpu_mdss_cfg sdm845_dpu_cfg = {
static const struct dpu_mdss_cfg sc7180_dpu_cfg = { static const struct dpu_mdss_cfg sc7180_dpu_cfg = {
.caps = &sc7180_dpu_caps, .caps = &sc7180_dpu_caps,
.ubwc = &sc7180_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc7180_mdp), .mdp_count = ARRAY_SIZE(sc7180_mdp),
.mdp = sc7180_mdp, .mdp = sc7180_mdp,
.ctl_count = ARRAY_SIZE(sc7180_ctl), .ctl_count = ARRAY_SIZE(sc7180_ctl),
...@@ -2603,6 +2645,7 @@ static const struct dpu_mdss_cfg sc7180_dpu_cfg = { ...@@ -2603,6 +2645,7 @@ static const struct dpu_mdss_cfg sc7180_dpu_cfg = {
static const struct dpu_mdss_cfg sm6115_dpu_cfg = { static const struct dpu_mdss_cfg sm6115_dpu_cfg = {
.caps = &sm6115_dpu_caps, .caps = &sm6115_dpu_caps,
.ubwc = &sm6115_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm6115_mdp), .mdp_count = ARRAY_SIZE(sm6115_mdp),
.mdp = sm6115_mdp, .mdp = sm6115_mdp,
.ctl_count = ARRAY_SIZE(qcm2290_ctl), .ctl_count = ARRAY_SIZE(qcm2290_ctl),
...@@ -2625,6 +2668,7 @@ static const struct dpu_mdss_cfg sm6115_dpu_cfg = { ...@@ -2625,6 +2668,7 @@ static const struct dpu_mdss_cfg sm6115_dpu_cfg = {
static const struct dpu_mdss_cfg sm8150_dpu_cfg = { static const struct dpu_mdss_cfg sm8150_dpu_cfg = {
.caps = &sm8150_dpu_caps, .caps = &sm8150_dpu_caps,
.ubwc = &sm8150_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sdm845_mdp), .mdp_count = ARRAY_SIZE(sdm845_mdp),
.mdp = sdm845_mdp, .mdp = sdm845_mdp,
.ctl_count = ARRAY_SIZE(sm8150_ctl), .ctl_count = ARRAY_SIZE(sm8150_ctl),
...@@ -2653,6 +2697,7 @@ static const struct dpu_mdss_cfg sm8150_dpu_cfg = { ...@@ -2653,6 +2697,7 @@ static const struct dpu_mdss_cfg sm8150_dpu_cfg = {
static const struct dpu_mdss_cfg sc8180x_dpu_cfg = { static const struct dpu_mdss_cfg sc8180x_dpu_cfg = {
.caps = &sc8180x_dpu_caps, .caps = &sc8180x_dpu_caps,
.ubwc = &sc8180x_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc8180x_mdp), .mdp_count = ARRAY_SIZE(sc8180x_mdp),
.mdp = sc8180x_mdp, .mdp = sc8180x_mdp,
.ctl_count = ARRAY_SIZE(sm8150_ctl), .ctl_count = ARRAY_SIZE(sm8150_ctl),
...@@ -2677,6 +2722,7 @@ static const struct dpu_mdss_cfg sc8180x_dpu_cfg = { ...@@ -2677,6 +2722,7 @@ static const struct dpu_mdss_cfg sc8180x_dpu_cfg = {
static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = { static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = {
.caps = &sc8280xp_dpu_caps, .caps = &sc8280xp_dpu_caps,
.ubwc = &sc8280xp_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc8280xp_mdp), .mdp_count = ARRAY_SIZE(sc8280xp_mdp),
.mdp = sc8280xp_mdp, .mdp = sc8280xp_mdp,
.ctl_count = ARRAY_SIZE(sc8280xp_ctl), .ctl_count = ARRAY_SIZE(sc8280xp_ctl),
...@@ -2703,6 +2749,7 @@ static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = { ...@@ -2703,6 +2749,7 @@ static const struct dpu_mdss_cfg sc8280xp_dpu_cfg = {
static const struct dpu_mdss_cfg sm8250_dpu_cfg = { static const struct dpu_mdss_cfg sm8250_dpu_cfg = {
.caps = &sm8250_dpu_caps, .caps = &sm8250_dpu_caps,
.ubwc = &sm8250_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8250_mdp), .mdp_count = ARRAY_SIZE(sm8250_mdp),
.mdp = sm8250_mdp, .mdp = sm8250_mdp,
.ctl_count = ARRAY_SIZE(sm8150_ctl), .ctl_count = ARRAY_SIZE(sm8150_ctl),
...@@ -2733,6 +2780,7 @@ static const struct dpu_mdss_cfg sm8250_dpu_cfg = { ...@@ -2733,6 +2780,7 @@ static const struct dpu_mdss_cfg sm8250_dpu_cfg = {
static const struct dpu_mdss_cfg sm8350_dpu_cfg = { static const struct dpu_mdss_cfg sm8350_dpu_cfg = {
.caps = &sm8350_dpu_caps, .caps = &sm8350_dpu_caps,
.ubwc = &sm8350_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8350_mdp), .mdp_count = ARRAY_SIZE(sm8350_mdp),
.mdp = sm8350_mdp, .mdp = sm8350_mdp,
.ctl_count = ARRAY_SIZE(sm8350_ctl), .ctl_count = ARRAY_SIZE(sm8350_ctl),
...@@ -2759,6 +2807,7 @@ static const struct dpu_mdss_cfg sm8350_dpu_cfg = { ...@@ -2759,6 +2807,7 @@ static const struct dpu_mdss_cfg sm8350_dpu_cfg = {
static const struct dpu_mdss_cfg sm8450_dpu_cfg = { static const struct dpu_mdss_cfg sm8450_dpu_cfg = {
.caps = &sm8450_dpu_caps, .caps = &sm8450_dpu_caps,
.ubwc = &sm8450_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8450_mdp), .mdp_count = ARRAY_SIZE(sm8450_mdp),
.mdp = sm8450_mdp, .mdp = sm8450_mdp,
.ctl_count = ARRAY_SIZE(sm8450_ctl), .ctl_count = ARRAY_SIZE(sm8450_ctl),
...@@ -2785,6 +2834,7 @@ static const struct dpu_mdss_cfg sm8450_dpu_cfg = { ...@@ -2785,6 +2834,7 @@ static const struct dpu_mdss_cfg sm8450_dpu_cfg = {
static const struct dpu_mdss_cfg sm8550_dpu_cfg = { static const struct dpu_mdss_cfg sm8550_dpu_cfg = {
.caps = &sm8550_dpu_caps, .caps = &sm8550_dpu_caps,
.ubwc = &sm8550_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sm8550_mdp), .mdp_count = ARRAY_SIZE(sm8550_mdp),
.mdp = sm8550_mdp, .mdp = sm8550_mdp,
.ctl_count = ARRAY_SIZE(sm8550_ctl), .ctl_count = ARRAY_SIZE(sm8550_ctl),
...@@ -2811,6 +2861,7 @@ static const struct dpu_mdss_cfg sm8550_dpu_cfg = { ...@@ -2811,6 +2861,7 @@ static const struct dpu_mdss_cfg sm8550_dpu_cfg = {
static const struct dpu_mdss_cfg sc7280_dpu_cfg = { static const struct dpu_mdss_cfg sc7280_dpu_cfg = {
.caps = &sc7280_dpu_caps, .caps = &sc7280_dpu_caps,
.ubwc = &sc7280_ubwc_cfg,
.mdp_count = ARRAY_SIZE(sc7280_mdp), .mdp_count = ARRAY_SIZE(sc7280_mdp),
.mdp = sc7280_mdp, .mdp = sc7280_mdp,
.ctl_count = ARRAY_SIZE(sc7280_ctl), .ctl_count = ARRAY_SIZE(sc7280_ctl),
...@@ -2833,6 +2884,7 @@ static const struct dpu_mdss_cfg sc7280_dpu_cfg = { ...@@ -2833,6 +2884,7 @@ static const struct dpu_mdss_cfg sc7280_dpu_cfg = {
static const struct dpu_mdss_cfg qcm2290_dpu_cfg = { static const struct dpu_mdss_cfg qcm2290_dpu_cfg = {
.caps = &qcm2290_dpu_caps, .caps = &qcm2290_dpu_caps,
.ubwc = &qcm2290_ubwc_cfg,
.mdp_count = ARRAY_SIZE(qcm2290_mdp), .mdp_count = ARRAY_SIZE(qcm2290_mdp),
.mdp = qcm2290_mdp, .mdp = qcm2290_mdp,
.ctl_count = ARRAY_SIZE(qcm2290_ctl), .ctl_count = ARRAY_SIZE(qcm2290_ctl),
......
...@@ -400,7 +400,6 @@ struct dpu_rotation_cfg { ...@@ -400,7 +400,6 @@ struct dpu_rotation_cfg {
* @max_mixer_blendstages max layer mixer blend stages or * @max_mixer_blendstages max layer mixer blend stages or
* supported z order * supported z order
* @qseed_type qseed2 or qseed3 support. * @qseed_type qseed2 or qseed3 support.
* @ubwc_version UBWC feature version (0x0 for not supported)
* @has_src_split source split feature status * @has_src_split source split feature status
* @has_dim_layer dim layer feature status * @has_dim_layer dim layer feature status
* @has_idle_pc indicate if idle power collapse feature is supported * @has_idle_pc indicate if idle power collapse feature is supported
...@@ -414,7 +413,6 @@ struct dpu_caps { ...@@ -414,7 +413,6 @@ struct dpu_caps {
u32 max_mixer_width; u32 max_mixer_width;
u32 max_mixer_blendstages; u32 max_mixer_blendstages;
u32 qseed_type; u32 qseed_type;
u32 ubwc_version;
bool has_src_split; bool has_src_split;
bool has_dim_layer; bool has_dim_layer;
bool has_idle_pc; bool has_idle_pc;
...@@ -543,15 +541,24 @@ struct dpu_clk_ctrl_reg { ...@@ -543,15 +541,24 @@ struct dpu_clk_ctrl_reg {
* @id: index identifying this block * @id: index identifying this block
* @base: register base offset to mdss * @base: register base offset to mdss
* @features bit mask identifying sub-blocks/features * @features bit mask identifying sub-blocks/features
* @highest_bank_bit: UBWC parameter
* @ubwc_swizzle: ubwc default swizzle setting
* @clk_ctrls clock control register definition * @clk_ctrls clock control register definition
*/ */
struct dpu_mdp_cfg { struct dpu_mdp_cfg {
DPU_HW_BLK_INFO; DPU_HW_BLK_INFO;
struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX];
};
/**
* struct dpu_ubwc_cfg - UBWC and memory configuration
*
* @ubwc_version UBWC feature version (0x0 for not supported)
* @highest_bank_bit: UBWC parameter
* @ubwc_swizzle: ubwc default swizzle setting
*/
struct dpu_ubwc_cfg {
u32 ubwc_version;
u32 highest_bank_bit; u32 highest_bank_bit;
u32 ubwc_swizzle; u32 ubwc_swizzle;
struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX];
}; };
/* struct dpu_ctl_cfg : MDP CTL instance info /* struct dpu_ctl_cfg : MDP CTL instance info
...@@ -853,6 +860,8 @@ struct dpu_perf_cfg { ...@@ -853,6 +860,8 @@ struct dpu_perf_cfg {
struct dpu_mdss_cfg { struct dpu_mdss_cfg {
const struct dpu_caps *caps; const struct dpu_caps *caps;
const struct dpu_ubwc_cfg *ubwc;
u32 mdp_count; u32 mdp_count;
const struct dpu_mdp_cfg *mdp; const struct dpu_mdp_cfg *mdp;
......
...@@ -307,25 +307,25 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, ...@@ -307,25 +307,25 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */ src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */
DPU_REG_WRITE(c, SSPP_FETCH_CONFIG, DPU_REG_WRITE(c, SSPP_FETCH_CONFIG,
DPU_FETCH_CONFIG_RESET_VALUE | DPU_FETCH_CONFIG_RESET_VALUE |
ctx->mdp->highest_bank_bit << 18); ctx->ubwc->highest_bank_bit << 18);
switch (ctx->catalog->caps->ubwc_version) { switch (ctx->ubwc->ubwc_version) {
case DPU_HW_UBWC_VER_10: case DPU_HW_UBWC_VER_10:
fast_clear = fmt->alpha_enable ? BIT(31) : 0; fast_clear = fmt->alpha_enable ? BIT(31) : 0;
DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
fast_clear | (ctx->mdp->ubwc_swizzle & 0x1) | fast_clear | (ctx->ubwc->ubwc_swizzle & 0x1) |
BIT(8) | BIT(8) |
(ctx->mdp->highest_bank_bit << 4)); (ctx->ubwc->highest_bank_bit << 4));
break; break;
case DPU_HW_UBWC_VER_20: case DPU_HW_UBWC_VER_20:
fast_clear = fmt->alpha_enable ? BIT(31) : 0; fast_clear = fmt->alpha_enable ? BIT(31) : 0;
DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
fast_clear | (ctx->mdp->ubwc_swizzle) | fast_clear | (ctx->ubwc->ubwc_swizzle) |
(ctx->mdp->highest_bank_bit << 4)); (ctx->ubwc->highest_bank_bit << 4));
break; break;
case DPU_HW_UBWC_VER_30: case DPU_HW_UBWC_VER_30:
DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
BIT(30) | (ctx->mdp->ubwc_swizzle) | BIT(30) | (ctx->ubwc->ubwc_swizzle) |
(ctx->mdp->highest_bank_bit << 4)); (ctx->ubwc->highest_bank_bit << 4));
break; break;
case DPU_HW_UBWC_VER_40: case DPU_HW_UBWC_VER_40:
DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
...@@ -813,7 +813,7 @@ struct dpu_hw_sspp *dpu_hw_sspp_init(enum dpu_sspp idx, ...@@ -813,7 +813,7 @@ struct dpu_hw_sspp *dpu_hw_sspp_init(enum dpu_sspp idx,
/* Assign ops */ /* Assign ops */
hw_pipe->catalog = catalog; hw_pipe->catalog = catalog;
hw_pipe->mdp = &catalog->mdp[0]; hw_pipe->ubwc = catalog->ubwc;
hw_pipe->idx = idx; hw_pipe->idx = idx;
hw_pipe->cap = cfg; hw_pipe->cap = cfg;
_setup_layer_ops(hw_pipe, hw_pipe->cap->features); _setup_layer_ops(hw_pipe, hw_pipe->cap->features);
......
...@@ -342,7 +342,7 @@ struct dpu_hw_sspp_ops { ...@@ -342,7 +342,7 @@ struct dpu_hw_sspp_ops {
* @base: hardware block base structure * @base: hardware block base structure
* @hw: block hardware details * @hw: block hardware details
* @catalog: back pointer to catalog * @catalog: back pointer to catalog
* @mdp: pointer to associated mdp portion of the catalog * @ubwc: ubwc configuration data
* @idx: pipe index * @idx: pipe index
* @cap: pointer to layer_cfg * @cap: pointer to layer_cfg
* @ops: pointer to operations possible for this pipe * @ops: pointer to operations possible for this pipe
...@@ -351,7 +351,7 @@ struct dpu_hw_sspp { ...@@ -351,7 +351,7 @@ struct dpu_hw_sspp {
struct dpu_hw_blk base; struct dpu_hw_blk base;
struct dpu_hw_blk_reg_map hw; struct dpu_hw_blk_reg_map hw;
const struct dpu_mdss_cfg *catalog; const struct dpu_mdss_cfg *catalog;
const struct dpu_mdp_cfg *mdp; const struct dpu_ubwc_cfg *ubwc;
/* Pipe */ /* Pipe */
enum dpu_sspp idx; enum dpu_sspp idx;
......
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