Skip to content

Commit 386fced

Browse files
fltorobclark
authored andcommitted
drm/msm/dpu: add SM8150 to hw catalog
This brings up basic video mode functionality for SM8150 DPU. Command mode and dual mixer/intf configurations are not working, future patches will address this. Scaler functionality and multiple planes is also untested. Signed-off-by: Jonathan Marek <[email protected]> [fixup max_linewidth warning] Signed-off-by: Rob Clark <[email protected]>
1 parent fc3a69e commit 386fced

File tree

2 files changed

+149
-0
lines changed

2 files changed

+149
-0
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ static const struct dpu_caps sc7180_dpu_caps = {
9292
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
9393
};
9494

95+
static const struct dpu_caps sm8150_dpu_caps = {
96+
.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
97+
.max_mixer_blendstages = 0xb,
98+
.qseed_type = DPU_SSPP_SCALER_QSEED3,
99+
.smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */
100+
.ubwc_version = DPU_HW_UBWC_VER_30,
101+
.has_src_split = true,
102+
.has_dim_layer = true,
103+
.has_idle_pc = true,
104+
.has_3d_merge = true,
105+
.max_linewidth = 4096,
106+
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
107+
.max_hdeci_exp = MAX_HORZ_DECIMATION,
108+
.max_vdeci_exp = MAX_VERT_DECIMATION,
109+
};
110+
95111
static const struct dpu_mdp_cfg sdm845_mdp[] = {
96112
{
97113
.name = "top_0", .id = MDP_TOP,
@@ -183,6 +199,39 @@ static const struct dpu_ctl_cfg sc7180_ctl[] = {
183199
},
184200
};
185201

202+
static const struct dpu_ctl_cfg sm8150_ctl[] = {
203+
{
204+
.name = "ctl_0", .id = CTL_0,
205+
.base = 0x1000, .len = 0x1e0,
206+
.features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY)
207+
},
208+
{
209+
.name = "ctl_1", .id = CTL_1,
210+
.base = 0x1200, .len = 0x1e0,
211+
.features = BIT(DPU_CTL_ACTIVE_CFG) | BIT(DPU_CTL_SPLIT_DISPLAY)
212+
},
213+
{
214+
.name = "ctl_2", .id = CTL_2,
215+
.base = 0x1400, .len = 0x1e0,
216+
.features = BIT(DPU_CTL_ACTIVE_CFG)
217+
},
218+
{
219+
.name = "ctl_3", .id = CTL_3,
220+
.base = 0x1600, .len = 0x1e0,
221+
.features = BIT(DPU_CTL_ACTIVE_CFG)
222+
},
223+
{
224+
.name = "ctl_4", .id = CTL_4,
225+
.base = 0x1800, .len = 0x1e0,
226+
.features = BIT(DPU_CTL_ACTIVE_CFG)
227+
},
228+
{
229+
.name = "ctl_5", .id = CTL_5,
230+
.base = 0x1a00, .len = 0x1e0,
231+
.features = BIT(DPU_CTL_ACTIVE_CFG)
232+
},
233+
};
234+
186235
/*************************************************************
187236
* SSPP sub blocks config
188237
*************************************************************/
@@ -338,6 +387,23 @@ static const struct dpu_lm_cfg sc7180_lm[] = {
338387
&sc7180_lm_sblk, PINGPONG_1, LM_0, 0),
339388
};
340389

390+
/* SM8150 */
391+
392+
static const struct dpu_lm_cfg sm8150_lm[] = {
393+
LM_BLK("lm_0", LM_0, 0x44000, MIXER_SDM845_MASK,
394+
&sdm845_lm_sblk, PINGPONG_0, LM_1, 0),
395+
LM_BLK("lm_1", LM_1, 0x45000, MIXER_SDM845_MASK,
396+
&sdm845_lm_sblk, PINGPONG_1, LM_0, 0),
397+
LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK,
398+
&sdm845_lm_sblk, PINGPONG_2, LM_3, 0),
399+
LM_BLK("lm_3", LM_3, 0x47000, MIXER_SDM845_MASK,
400+
&sdm845_lm_sblk, PINGPONG_3, LM_2, 0),
401+
LM_BLK("lm_4", LM_4, 0x48000, MIXER_SDM845_MASK,
402+
&sdm845_lm_sblk, PINGPONG_4, LM_5, 0),
403+
LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK,
404+
&sdm845_lm_sblk, PINGPONG_5, LM_4, 0),
405+
};
406+
341407
/*************************************************************
342408
* DSPP sub blocks config
343409
*************************************************************/
@@ -357,6 +423,7 @@ static const struct dpu_dspp_sub_blks sc7180_dspp_sblk = {
357423
static const struct dpu_dspp_cfg sc7180_dspp[] = {
358424
DSPP_BLK("dspp_0", DSPP_0, 0x54000),
359425
};
426+
360427
/*************************************************************
361428
* PINGPONG sub blocks config
362429
*************************************************************/
@@ -399,6 +466,15 @@ static struct dpu_pingpong_cfg sc7180_pp[] = {
399466
PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800),
400467
};
401468

469+
static const struct dpu_pingpong_cfg sm8150_pp[] = {
470+
PP_BLK_TE("pingpong_0", PINGPONG_0, 0x70000),
471+
PP_BLK_TE("pingpong_1", PINGPONG_1, 0x70800),
472+
PP_BLK("pingpong_2", PINGPONG_2, 0x71000),
473+
PP_BLK("pingpong_3", PINGPONG_3, 0x71800),
474+
PP_BLK("pingpong_4", PINGPONG_4, 0x72000),
475+
PP_BLK("pingpong_5", PINGPONG_5, 0x72800),
476+
};
477+
402478
/*************************************************************
403479
* INTF sub blocks config
404480
*************************************************************/
@@ -424,6 +500,13 @@ static const struct dpu_intf_cfg sc7180_intf[] = {
424500
INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, INTF_SC7180_MASK),
425501
};
426502

503+
static const struct dpu_intf_cfg sm8150_intf[] = {
504+
INTF_BLK("intf_0", INTF_0, 0x6A000, INTF_DP, 0, INTF_SC7180_MASK),
505+
INTF_BLK("intf_1", INTF_1, 0x6A800, INTF_DSI, 0, INTF_SC7180_MASK),
506+
INTF_BLK("intf_2", INTF_2, 0x6B000, INTF_DSI, 1, INTF_SC7180_MASK),
507+
INTF_BLK("intf_3", INTF_3, 0x6B800, INTF_DP, 1, INTF_SC7180_MASK),
508+
};
509+
427510
/*************************************************************
428511
* VBIF sub blocks config
429512
*************************************************************/
@@ -454,6 +537,10 @@ static const struct dpu_reg_dma_cfg sdm845_regdma = {
454537
.base = 0x0, .version = 0x1, .trigger_sel_off = 0x119c
455538
};
456539

540+
static const struct dpu_reg_dma_cfg sm8150_regdma = {
541+
.base = 0x0, .version = 0x00010001, .trigger_sel_off = 0x119c
542+
};
543+
457544
/*************************************************************
458545
* PERF data config
459546
*************************************************************/
@@ -478,6 +565,10 @@ static const struct dpu_qos_lut_entry sc7180_qos_linear[] = {
478565
{.fl = 0, .lut = 0x0011222222335777},
479566
};
480567

568+
static const struct dpu_qos_lut_entry sm8150_qos_linear[] = {
569+
{.fl = 0, .lut = 0x0011222222223357 },
570+
};
571+
481572
static const struct dpu_qos_lut_entry sdm845_qos_macrotile[] = {
482573
{.fl = 10, .lut = 0x344556677},
483574
{.fl = 11, .lut = 0x3344556677},
@@ -562,6 +653,31 @@ static const struct dpu_perf_cfg sc7180_perf_data = {
562653
},
563654
};
564655

656+
static const struct dpu_perf_cfg sm8150_perf_data = {
657+
.max_bw_low = 12800000,
658+
.max_bw_high = 12800000,
659+
.min_core_ib = 2400000,
660+
.min_llcc_ib = 800000,
661+
.min_dram_ib = 800000,
662+
.danger_lut_tbl = {0xf, 0xffff, 0x0},
663+
.qos_lut_tbl = {
664+
{.nentry = ARRAY_SIZE(sm8150_qos_linear),
665+
.entries = sm8150_qos_linear
666+
},
667+
{.nentry = ARRAY_SIZE(sc7180_qos_macrotile),
668+
.entries = sc7180_qos_macrotile
669+
},
670+
{.nentry = ARRAY_SIZE(sc7180_qos_nrt),
671+
.entries = sc7180_qos_nrt
672+
},
673+
/* TODO: macrotile-qseed is different from macrotile */
674+
},
675+
.cdp_cfg = {
676+
{.rd_enable = 1, .wr_enable = 1},
677+
{.rd_enable = 1, .wr_enable = 0}
678+
},
679+
};
680+
565681
/*************************************************************
566682
* Hardware catalog init
567683
*************************************************************/
@@ -626,9 +742,40 @@ static void sc7180_cfg_init(struct dpu_mdss_cfg *dpu_cfg)
626742
};
627743
}
628744

745+
/*
746+
* sm8150_cfg_init(): populate sm8150 dpu sub-blocks reg offsets
747+
* and instance counts.
748+
*/
749+
static void sm8150_cfg_init(struct dpu_mdss_cfg *dpu_cfg)
750+
{
751+
*dpu_cfg = (struct dpu_mdss_cfg){
752+
.caps = &sm8150_dpu_caps,
753+
.mdp_count = ARRAY_SIZE(sdm845_mdp),
754+
.mdp = sdm845_mdp,
755+
.ctl_count = ARRAY_SIZE(sm8150_ctl),
756+
.ctl = sm8150_ctl,
757+
.sspp_count = ARRAY_SIZE(sdm845_sspp),
758+
.sspp = sdm845_sspp,
759+
.mixer_count = ARRAY_SIZE(sm8150_lm),
760+
.mixer = sm8150_lm,
761+
.pingpong_count = ARRAY_SIZE(sm8150_pp),
762+
.pingpong = sm8150_pp,
763+
.intf_count = ARRAY_SIZE(sm8150_intf),
764+
.intf = sm8150_intf,
765+
.vbif_count = ARRAY_SIZE(sdm845_vbif),
766+
.vbif = sdm845_vbif,
767+
.reg_dma_count = 1,
768+
.dma_cfg = sm8150_regdma,
769+
.perf = sm8150_perf_data,
770+
.mdss_irqs = 0x3ff,
771+
};
772+
}
773+
629774
static const struct dpu_mdss_hw_cfg_handler cfg_handler[] = {
630775
{ .hw_rev = DPU_HW_VER_400, .cfg_init = sdm845_cfg_init},
631776
{ .hw_rev = DPU_HW_VER_401, .cfg_init = sdm845_cfg_init},
777+
{ .hw_rev = DPU_HW_VER_500, .cfg_init = sm8150_cfg_init},
778+
{ .hw_rev = DPU_HW_VER_501, .cfg_init = sm8150_cfg_init},
632779
{ .hw_rev = DPU_HW_VER_620, .cfg_init = sc7180_cfg_init},
633780
};
634781

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ enum dpu_ctl {
171171
CTL_2,
172172
CTL_3,
173173
CTL_4,
174+
CTL_5,
174175
CTL_MAX
175176
};
176177

@@ -180,6 +181,7 @@ enum dpu_pingpong {
180181
PINGPONG_2,
181182
PINGPONG_3,
182183
PINGPONG_4,
184+
PINGPONG_5,
183185
PINGPONG_S0,
184186
PINGPONG_MAX
185187
};

0 commit comments

Comments
 (0)