xref: /linux/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
4  * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
5  */
6 
7 #ifndef _DPU_7_0_SM8350_H
8 #define _DPU_7_0_SM8350_H
9 
10 static const struct dpu_caps sm8350_dpu_caps = {
11 	.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
12 	.max_mixer_blendstages = 0xb,
13 	.has_src_split = true,
14 	.has_dim_layer = true,
15 	.has_idle_pc = true,
16 	.has_3d_merge = true,
17 	.max_linewidth = 4096,
18 	.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
19 };
20 
21 static const struct dpu_mdp_cfg sm8350_mdp = {
22 	.name = "top_0",
23 	.base = 0x0, .len = 0x494,
24 	.clk_ctrls = {
25 		[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
26 		[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 },
27 		[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 },
28 		[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 },
29 		[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
30 		[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
31 		[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
32 		[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
33 		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },
34 		[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
35 	},
36 };
37 
38 static const struct dpu_ctl_cfg sm8350_ctl[] = {
39 	{
40 		.name = "ctl_0", .id = CTL_0,
41 		.base = 0x15000, .len = 0x1e8,
42 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
43 	}, {
44 		.name = "ctl_1", .id = CTL_1,
45 		.base = 0x16000, .len = 0x1e8,
46 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10),
47 	}, {
48 		.name = "ctl_2", .id = CTL_2,
49 		.base = 0x17000, .len = 0x1e8,
50 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11),
51 	}, {
52 		.name = "ctl_3", .id = CTL_3,
53 		.base = 0x18000, .len = 0x1e8,
54 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12),
55 	}, {
56 		.name = "ctl_4", .id = CTL_4,
57 		.base = 0x19000, .len = 0x1e8,
58 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13),
59 	}, {
60 		.name = "ctl_5", .id = CTL_5,
61 		.base = 0x1a000, .len = 0x1e8,
62 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23),
63 	},
64 };
65 
66 static const struct dpu_sspp_cfg sm8350_sspp[] = {
67 	{
68 		.name = "sspp_0", .id = SSPP_VIG0,
69 		.base = 0x4000, .len = 0x1f8,
70 		.features = VIG_SDM845_MASK_SDMA,
71 		.sblk = &dpu_vig_sblk_qseed3_3_0,
72 		.xin_id = 0,
73 		.type = SSPP_TYPE_VIG,
74 		.clk_ctrl = DPU_CLK_CTRL_VIG0,
75 	}, {
76 		.name = "sspp_1", .id = SSPP_VIG1,
77 		.base = 0x6000, .len = 0x1f8,
78 		.features = VIG_SDM845_MASK_SDMA,
79 		.sblk = &dpu_vig_sblk_qseed3_3_0,
80 		.xin_id = 4,
81 		.type = SSPP_TYPE_VIG,
82 		.clk_ctrl = DPU_CLK_CTRL_VIG1,
83 	}, {
84 		.name = "sspp_2", .id = SSPP_VIG2,
85 		.base = 0x8000, .len = 0x1f8,
86 		.features = VIG_SDM845_MASK_SDMA,
87 		.sblk = &dpu_vig_sblk_qseed3_3_0,
88 		.xin_id = 8,
89 		.type = SSPP_TYPE_VIG,
90 		.clk_ctrl = DPU_CLK_CTRL_VIG2,
91 	}, {
92 		.name = "sspp_3", .id = SSPP_VIG3,
93 		.base = 0xa000, .len = 0x1f8,
94 		.features = VIG_SDM845_MASK_SDMA,
95 		.sblk = &dpu_vig_sblk_qseed3_3_0,
96 		.xin_id = 12,
97 		.type = SSPP_TYPE_VIG,
98 		.clk_ctrl = DPU_CLK_CTRL_VIG3,
99 	}, {
100 		.name = "sspp_8", .id = SSPP_DMA0,
101 		.base = 0x24000, .len = 0x1f8,
102 		.features = DMA_SDM845_MASK_SDMA,
103 		.sblk = &dpu_dma_sblk,
104 		.xin_id = 1,
105 		.type = SSPP_TYPE_DMA,
106 		.clk_ctrl = DPU_CLK_CTRL_DMA0,
107 	}, {
108 		.name = "sspp_9", .id = SSPP_DMA1,
109 		.base = 0x26000, .len = 0x1f8,
110 		.features = DMA_SDM845_MASK_SDMA,
111 		.sblk = &dpu_dma_sblk,
112 		.xin_id = 5,
113 		.type = SSPP_TYPE_DMA,
114 		.clk_ctrl = DPU_CLK_CTRL_DMA1,
115 	}, {
116 		.name = "sspp_10", .id = SSPP_DMA2,
117 		.base = 0x28000, .len = 0x1f8,
118 		.features = DMA_CURSOR_SDM845_MASK_SDMA,
119 		.sblk = &dpu_dma_sblk,
120 		.xin_id = 9,
121 		.type = SSPP_TYPE_DMA,
122 		.clk_ctrl = DPU_CLK_CTRL_DMA2,
123 	}, {
124 		.name = "sspp_11", .id = SSPP_DMA3,
125 		.base = 0x2a000, .len = 0x1f8,
126 		.features = DMA_CURSOR_SDM845_MASK_SDMA,
127 		.sblk = &dpu_dma_sblk,
128 		.xin_id = 13,
129 		.type = SSPP_TYPE_DMA,
130 		.clk_ctrl = DPU_CLK_CTRL_DMA3,
131 	},
132 };
133 
134 static const struct dpu_lm_cfg sm8350_lm[] = {
135 	{
136 		.name = "lm_0", .id = LM_0,
137 		.base = 0x44000, .len = 0x320,
138 		.features = MIXER_MSM8998_MASK,
139 		.sblk = &sdm845_lm_sblk,
140 		.lm_pair = LM_1,
141 		.pingpong = PINGPONG_0,
142 		.dspp = DSPP_0,
143 	}, {
144 		.name = "lm_1", .id = LM_1,
145 		.base = 0x45000, .len = 0x320,
146 		.features = MIXER_MSM8998_MASK,
147 		.sblk = &sdm845_lm_sblk,
148 		.lm_pair = LM_0,
149 		.pingpong = PINGPONG_1,
150 		.dspp = DSPP_1,
151 	}, {
152 		.name = "lm_2", .id = LM_2,
153 		.base = 0x46000, .len = 0x320,
154 		.features = MIXER_MSM8998_MASK,
155 		.sblk = &sdm845_lm_sblk,
156 		.lm_pair = LM_3,
157 		.pingpong = PINGPONG_2,
158 		.dspp = DSPP_2,
159 	}, {
160 		.name = "lm_3", .id = LM_3,
161 		.base = 0x47000, .len = 0x320,
162 		.features = MIXER_MSM8998_MASK,
163 		.sblk = &sdm845_lm_sblk,
164 		.lm_pair = LM_2,
165 		.pingpong = PINGPONG_3,
166 		.dspp = DSPP_3,
167 	}, {
168 		.name = "lm_4", .id = LM_4,
169 		.base = 0x48000, .len = 0x320,
170 		.features = MIXER_MSM8998_MASK,
171 		.sblk = &sdm845_lm_sblk,
172 		.lm_pair = LM_5,
173 		.pingpong = PINGPONG_4,
174 	}, {
175 		.name = "lm_5", .id = LM_5,
176 		.base = 0x49000, .len = 0x320,
177 		.features = MIXER_MSM8998_MASK,
178 		.sblk = &sdm845_lm_sblk,
179 		.lm_pair = LM_4,
180 		.pingpong = PINGPONG_5,
181 	},
182 };
183 
184 static const struct dpu_dspp_cfg sm8350_dspp[] = {
185 	{
186 		.name = "dspp_0", .id = DSPP_0,
187 		.base = 0x54000, .len = 0x1800,
188 		.sblk = &sdm845_dspp_sblk,
189 	}, {
190 		.name = "dspp_1", .id = DSPP_1,
191 		.base = 0x56000, .len = 0x1800,
192 		.sblk = &sdm845_dspp_sblk,
193 	}, {
194 		.name = "dspp_2", .id = DSPP_2,
195 		.base = 0x58000, .len = 0x1800,
196 		.sblk = &sdm845_dspp_sblk,
197 	}, {
198 		.name = "dspp_3", .id = DSPP_3,
199 		.base = 0x5a000, .len = 0x1800,
200 		.sblk = &sdm845_dspp_sblk,
201 	},
202 };
203 
204 static const struct dpu_pingpong_cfg sm8350_pp[] = {
205 	{
206 		.name = "pingpong_0", .id = PINGPONG_0,
207 		.base = 0x69000, .len = 0,
208 		.sblk = &sc7280_pp_sblk,
209 		.merge_3d = MERGE_3D_0,
210 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
211 	}, {
212 		.name = "pingpong_1", .id = PINGPONG_1,
213 		.base = 0x6a000, .len = 0,
214 		.sblk = &sc7280_pp_sblk,
215 		.merge_3d = MERGE_3D_0,
216 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
217 	}, {
218 		.name = "pingpong_2", .id = PINGPONG_2,
219 		.base = 0x6b000, .len = 0,
220 		.sblk = &sc7280_pp_sblk,
221 		.merge_3d = MERGE_3D_1,
222 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
223 	}, {
224 		.name = "pingpong_3", .id = PINGPONG_3,
225 		.base = 0x6c000, .len = 0,
226 		.sblk = &sc7280_pp_sblk,
227 		.merge_3d = MERGE_3D_1,
228 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
229 	}, {
230 		.name = "pingpong_4", .id = PINGPONG_4,
231 		.base = 0x6d000, .len = 0,
232 		.sblk = &sc7280_pp_sblk,
233 		.merge_3d = MERGE_3D_2,
234 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
235 	}, {
236 		.name = "pingpong_5", .id = PINGPONG_5,
237 		.base = 0x6e000, .len = 0,
238 		.sblk = &sc7280_pp_sblk,
239 		.merge_3d = MERGE_3D_2,
240 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31),
241 	},
242 };
243 
244 static const struct dpu_merge_3d_cfg sm8350_merge_3d[] = {
245 	{
246 		.name = "merge_3d_0", .id = MERGE_3D_0,
247 		.base = 0x4e000, .len = 0x8,
248 	}, {
249 		.name = "merge_3d_1", .id = MERGE_3D_1,
250 		.base = 0x4f000, .len = 0x8,
251 	}, {
252 		.name = "merge_3d_2", .id = MERGE_3D_2,
253 		.base = 0x50000, .len = 0x8,
254 	},
255 };
256 
257 /*
258  * NOTE: Each display compression engine (DCE) contains dual hard
259  * slice DSC encoders so both share same base address but with
260  * its own different sub block address.
261  */
262 static const struct dpu_dsc_cfg sm8350_dsc[] = {
263 	{
264 		.name = "dce_0_0", .id = DSC_0,
265 		.base = 0x80000, .len = 0x4,
266 		.sblk = &dsc_sblk_0,
267 	}, {
268 		.name = "dce_0_1", .id = DSC_1,
269 		.base = 0x80000, .len = 0x4,
270 		.sblk = &dsc_sblk_1,
271 	}, {
272 		.name = "dce_1_0", .id = DSC_2,
273 		.base = 0x81000, .len = 0x4,
274 		.features = BIT(DPU_DSC_NATIVE_42x_EN),
275 		.sblk = &dsc_sblk_0,
276 	}, {
277 		.name = "dce_1_1", .id = DSC_3,
278 		.base = 0x81000, .len = 0x4,
279 		.features = BIT(DPU_DSC_NATIVE_42x_EN),
280 		.sblk = &dsc_sblk_1,
281 	},
282 };
283 
284 static const struct dpu_wb_cfg sm8350_wb[] = {
285 	{
286 		.name = "wb_2", .id = WB_2,
287 		.base = 0x65000, .len = 0x2c8,
288 		.features = WB_SDM845_MASK,
289 		.format_list = wb2_formats_rgb_yuv,
290 		.num_formats = ARRAY_SIZE(wb2_formats_rgb_yuv),
291 		.clk_ctrl = DPU_CLK_CTRL_WB2,
292 		.xin_id = 6,
293 		.vbif_idx = VBIF_RT,
294 		.maxlinewidth = 4096,
295 		.intr_wb_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 4),
296 	},
297 };
298 
299 static const struct dpu_intf_cfg sm8350_intf[] = {
300 	{
301 		.name = "intf_0", .id = INTF_0,
302 		.base = 0x34000, .len = 0x280,
303 		.type = INTF_DP,
304 		.controller_id = MSM_DP_CONTROLLER_0,
305 		.prog_fetch_lines_worst_case = 24,
306 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
307 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25),
308 	}, {
309 		.name = "intf_1", .id = INTF_1,
310 		.base = 0x35000, .len = 0x2c4,
311 		.type = INTF_DSI,
312 		.controller_id = MSM_DSI_CONTROLLER_0,
313 		.prog_fetch_lines_worst_case = 24,
314 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
315 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
316 		.intr_tear_rd_ptr = DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2),
317 	}, {
318 		.name = "intf_2", .id = INTF_2,
319 		.base = 0x36000, .len = 0x2c4,
320 		.type = INTF_DSI,
321 		.controller_id = MSM_DSI_CONTROLLER_1,
322 		.prog_fetch_lines_worst_case = 24,
323 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
324 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
325 		.intr_tear_rd_ptr = DPU_IRQ_IDX(MDP_INTF2_TEAR_INTR, 2),
326 	}, {
327 		.name = "intf_3", .id = INTF_3,
328 		.base = 0x37000, .len = 0x280,
329 		.type = INTF_DP,
330 		.controller_id = MSM_DP_CONTROLLER_1,
331 		.prog_fetch_lines_worst_case = 24,
332 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
333 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31),
334 	},
335 };
336 
337 static const struct dpu_perf_cfg sm8350_perf_data = {
338 	.max_bw_low = 11800000,
339 	.max_bw_high = 15500000,
340 	.min_core_ib = 2500000,
341 	.min_llcc_ib = 0,
342 	.min_dram_ib = 800000,
343 	.min_prefill_lines = 40,
344 	/* FIXME: lut tables */
345 	.danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0},
346 	.safe_lut_tbl = {0xfe00, 0xfe00, 0xffff},
347 	.qos_lut_tbl = {
348 		{.nentry = ARRAY_SIZE(sc7180_qos_linear),
349 		.entries = sc7180_qos_linear
350 		},
351 		{.nentry = ARRAY_SIZE(sc7180_qos_macrotile),
352 		.entries = sc7180_qos_macrotile
353 		},
354 		{.nentry = ARRAY_SIZE(sc7180_qos_nrt),
355 		.entries = sc7180_qos_nrt
356 		},
357 		/* TODO: macrotile-qseed is different from macrotile */
358 	},
359 	.cdp_cfg = {
360 		{.rd_enable = 1, .wr_enable = 1},
361 		{.rd_enable = 1, .wr_enable = 0}
362 	},
363 	.clk_inefficiency_factor = 105,
364 	.bw_inefficiency_factor = 120,
365 };
366 
367 static const struct dpu_mdss_version sm8350_mdss_ver = {
368 	.core_major_ver = 7,
369 	.core_minor_ver = 0,
370 };
371 
372 const struct dpu_mdss_cfg dpu_sm8350_cfg = {
373 	.mdss_ver = &sm8350_mdss_ver,
374 	.caps = &sm8350_dpu_caps,
375 	.mdp = &sm8350_mdp,
376 	.cdm = &dpu_cdm_5_x,
377 	.ctl_count = ARRAY_SIZE(sm8350_ctl),
378 	.ctl = sm8350_ctl,
379 	.sspp_count = ARRAY_SIZE(sm8350_sspp),
380 	.sspp = sm8350_sspp,
381 	.mixer_count = ARRAY_SIZE(sm8350_lm),
382 	.mixer = sm8350_lm,
383 	.dspp_count = ARRAY_SIZE(sm8350_dspp),
384 	.dspp = sm8350_dspp,
385 	.pingpong_count = ARRAY_SIZE(sm8350_pp),
386 	.pingpong = sm8350_pp,
387 	.dsc_count = ARRAY_SIZE(sm8350_dsc),
388 	.dsc = sm8350_dsc,
389 	.merge_3d_count = ARRAY_SIZE(sm8350_merge_3d),
390 	.merge_3d = sm8350_merge_3d,
391 	.wb_count = ARRAY_SIZE(sm8350_wb),
392 	.wb = sm8350_wb,
393 	.intf_count = ARRAY_SIZE(sm8350_intf),
394 	.intf = sm8350_intf,
395 	.vbif_count = ARRAY_SIZE(sdm845_vbif),
396 	.vbif = sdm845_vbif,
397 	.perf = &sm8350_perf_data,
398 };
399 
400 #endif
401