xref: /linux/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h (revision 2c1ed907520c50326b8f604907a8478b27881a2e)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
4  * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
5  */
6 
7 #ifndef _DPU_HW_CATALOG_H
8 #define _DPU_HW_CATALOG_H
9 
10 #include <linux/kernel.h>
11 #include <linux/bug.h>
12 #include <linux/bitmap.h>
13 #include <linux/err.h>
14 
15 /**
16  * Max hardware block count: For ex: max 12 SSPP pipes or
17  * 5 ctl paths. In all cases, it can have max 12 hardware blocks
18  * based on current design
19  */
20 #define MAX_BLOCKS    12
21 
22 #define DPU_HW_BLK_NAME_LEN	16
23 
24 #define DPU_MAX_IMG_WIDTH 0x3fff
25 #define DPU_MAX_IMG_HEIGHT 0x3fff
26 
27 #define CRTC_DUAL_MIXERS	2
28 
29 #define MAX_XIN_COUNT 16
30 
31 /**
32  * MDP TOP BLOCK features
33  * @DPU_MDP_PANIC_PER_PIPE Panic configuration needs to be done per pipe
34  * @DPU_MDP_10BIT_SUPPORT, Chipset supports 10 bit pixel formats
35  * @DPU_MDP_PERIPH_0_REMOVED Indicates that access to periph top0 block results
36  *			   in a failure
37  * @DPU_MDP_VSYNC_SEL      Enables vsync source selection via MDP_VSYNC_SEL register
38  *                         (moved into INTF block since DPU 5.0.0)
39  * @DPU_MDP_MAX            Maximum value
40 
41  */
42 enum {
43 	DPU_MDP_PANIC_PER_PIPE = 0x1,
44 	DPU_MDP_10BIT_SUPPORT,
45 	DPU_MDP_AUDIO_SELECT,
46 	DPU_MDP_PERIPH_0_REMOVED,
47 	DPU_MDP_VSYNC_SEL,
48 	DPU_MDP_MAX
49 };
50 
51 /**
52  * SSPP sub-blocks/features
53  * @DPU_SSPP_SCALER_QSEED2,  QSEED2 algorithm support
54  * @DPU_SSPP_SCALER_QSEED3_COMPATIBLE,  QSEED3-compatible alogorithm support (includes QSEED3, QSEED3LITE and QSEED4)
55  * @DPU_SSPP_SCALER_RGB,     RGB Scaler, supported by RGB pipes
56  * @DPU_SSPP_CSC,            Support of Color space converion
57  * @DPU_SSPP_CSC_10BIT,      Support of 10-bit Color space conversion
58  * @DPU_SSPP_CURSOR,         SSPP can be used as a cursor layer
59  * @DPU_SSPP_QOS,            SSPP support QoS control, danger/safe/creq
60  * @DPU_SSPP_QOS_8LVL,       SSPP support 8-level QoS control
61  * @DPU_SSPP_EXCL_RECT,      SSPP supports exclusion rect
62  * @DPU_SSPP_SMART_DMA_V1,   SmartDMA 1.0 support
63  * @DPU_SSPP_SMART_DMA_V2,   SmartDMA 2.0 support
64  * @DPU_SSPP_TS_PREFILL      Supports prefill with traffic shaper
65  * @DPU_SSPP_TS_PREFILL_REC1 Supports prefill with traffic shaper multirec
66  * @DPU_SSPP_CDP             Supports client driven prefetch
67  * @DPU_SSPP_INLINE_ROTATION Support inline rotation
68  * @DPU_SSPP_MAX             maximum value
69  */
70 enum {
71 	DPU_SSPP_SCALER_QSEED2 = 0x1,
72 	DPU_SSPP_SCALER_QSEED3_COMPATIBLE,
73 	DPU_SSPP_SCALER_RGB,
74 	DPU_SSPP_CSC,
75 	DPU_SSPP_CSC_10BIT,
76 	DPU_SSPP_CURSOR,
77 	DPU_SSPP_QOS,
78 	DPU_SSPP_QOS_8LVL,
79 	DPU_SSPP_EXCL_RECT,
80 	DPU_SSPP_SMART_DMA_V1,
81 	DPU_SSPP_SMART_DMA_V2,
82 	DPU_SSPP_TS_PREFILL,
83 	DPU_SSPP_TS_PREFILL_REC1,
84 	DPU_SSPP_CDP,
85 	DPU_SSPP_INLINE_ROTATION,
86 	DPU_SSPP_MAX
87 };
88 
89 /*
90  * MIXER sub-blocks/features
91  * @DPU_MIXER_LAYER           Layer mixer layer blend configuration,
92  * @DPU_MIXER_SOURCESPLIT     Layer mixer supports source-split configuration
93  * @DPU_MIXER_GC              Gamma correction block
94  * @DPU_DIM_LAYER             Layer mixer supports dim layer
95  * @DPU_MIXER_COMBINED_ALPHA  Layer mixer has combined alpha register
96  * @DPU_MIXER_MAX             maximum value
97  */
98 enum {
99 	DPU_MIXER_LAYER = 0x1,
100 	DPU_MIXER_SOURCESPLIT,
101 	DPU_MIXER_GC,
102 	DPU_DIM_LAYER,
103 	DPU_MIXER_COMBINED_ALPHA,
104 	DPU_MIXER_MAX
105 };
106 
107 /**
108  * DSPP sub-blocks
109  * @DPU_DSPP_PCC             Panel color correction block
110  */
111 enum {
112 	DPU_DSPP_PCC = 0x1,
113 	DPU_DSPP_MAX
114 };
115 
116 /**
117  * PINGPONG sub-blocks
118  * @DPU_PINGPONG_TE2        Additional tear check block for split pipes
119  * @DPU_PINGPONG_SPLIT      PP block supports split fifo
120  * @DPU_PINGPONG_SLAVE      PP block is a suitable slave for split fifo
121  * @DPU_PINGPONG_DITHER     Dither blocks
122  * @DPU_PINGPONG_DSC        PP block supports DSC
123  * @DPU_PINGPONG_MAX
124  */
125 enum {
126 	DPU_PINGPONG_TE2 = 0x1,
127 	DPU_PINGPONG_SPLIT,
128 	DPU_PINGPONG_SLAVE,
129 	DPU_PINGPONG_DITHER,
130 	DPU_PINGPONG_DSC,
131 	DPU_PINGPONG_MAX
132 };
133 
134 /**
135  * CTL sub-blocks
136  * @DPU_CTL_SPLIT_DISPLAY:	CTL supports video mode split display
137  * @DPU_CTL_FETCH_ACTIVE:	Active CTL for fetch HW (SSPPs)
138  * @DPU_CTL_VM_CFG:		CTL config to support multiple VMs
139  * @DPU_CTL_HAS_LAYER_EXT4:	CTL has the CTL_LAYER_EXT4 register
140  * @DPU_CTL_DSPP_BLOCK_FLUSH:	CTL config to support dspp sub-block flush
141  * @DPU_CTL_MAX
142  */
143 enum {
144 	DPU_CTL_SPLIT_DISPLAY = 0x1,
145 	DPU_CTL_ACTIVE_CFG,
146 	DPU_CTL_FETCH_ACTIVE,
147 	DPU_CTL_VM_CFG,
148 	DPU_CTL_HAS_LAYER_EXT4,
149 	DPU_CTL_DSPP_SUB_BLOCK_FLUSH,
150 	DPU_CTL_MAX
151 };
152 
153 /**
154  * INTF sub-blocks
155  * @DPU_INTF_INPUT_CTRL             Supports the setting of pp block from which
156  *                                  pixel data arrives to this INTF
157  * @DPU_DATA_HCTL_EN                Allows data to be transferred at different rate
158  *                                  than video timing
159  * @DPU_INTF_STATUS_SUPPORTED       INTF block has INTF_STATUS register
160  * @DPU_INTF_MAX
161  */
162 enum {
163 	DPU_INTF_INPUT_CTRL = 0x1,
164 	DPU_DATA_HCTL_EN,
165 	DPU_INTF_STATUS_SUPPORTED,
166 	DPU_INTF_MAX
167 };
168 
169 /**
170   * WB sub-blocks and features
171   * @DPU_WB_LINE_MODE        Writeback module supports line/linear mode
172   * @DPU_WB_BLOCK_MODE       Writeback module supports block mode read
173   * @DPU_WB_CHROMA_DOWN,     Writeback chroma down block,
174   * @DPU_WB_DOWNSCALE,       Writeback integer downscaler,
175   * @DPU_WB_DITHER,          Dither block
176   * @DPU_WB_TRAFFIC_SHAPER,  Writeback traffic shaper bloc
177   * @DPU_WB_UBWC,            Writeback Universal bandwidth compression
178   * @DPU_WB_YUV_CONFIG       Writeback supports output of YUV colorspace
179   * @DPU_WB_PIPE_ALPHA       Writeback supports pipe alpha
180   * @DPU_WB_XY_ROI_OFFSET    Writeback supports x/y-offset of out ROI in
181   *                          the destination image
182   * @DPU_WB_QOS,             Writeback supports QoS control, danger/safe/creq
183   * @DPU_WB_QOS_8LVL,        Writeback supports 8-level QoS control
184   * @DPU_WB_CDP              Writeback supports client driven prefetch
185   * @DPU_WB_INPUT_CTRL       Writeback supports from which pp block input pixel
186   *                          data arrives.
187   * @DPU_WB_CROP             CWB supports cropping
188   * @DPU_WB_MAX              maximum value
189   */
190 enum {
191 	DPU_WB_LINE_MODE = 0x1,
192 	DPU_WB_BLOCK_MODE,
193 	DPU_WB_UBWC,
194 	DPU_WB_YUV_CONFIG,
195 	DPU_WB_PIPE_ALPHA,
196 	DPU_WB_XY_ROI_OFFSET,
197 	DPU_WB_QOS,
198 	DPU_WB_QOS_8LVL,
199 	DPU_WB_CDP,
200 	DPU_WB_INPUT_CTRL,
201 	DPU_WB_CROP,
202 	DPU_WB_MAX
203 };
204 
205 /**
206  * VBIF sub-blocks and features
207  * @DPU_VBIF_QOS_OTLIM        VBIF supports OT Limit
208  * @DPU_VBIF_QOS_REMAP        VBIF supports QoS priority remap
209  * @DPU_VBIF_MAX              maximum value
210  */
211 enum {
212 	DPU_VBIF_QOS_OTLIM = 0x1,
213 	DPU_VBIF_QOS_REMAP,
214 	DPU_VBIF_MAX
215 };
216 
217 /**
218  * DSC sub-blocks/features
219  * @DPU_DSC_OUTPUT_CTRL       Configure which PINGPONG block gets
220  *                            the pixel output from this DSC.
221  * @DPU_DSC_HW_REV_1_2        DSC block supports DSC 1.1 and 1.2
222  * @DPU_DSC_NATIVE_42x_EN     Supports NATIVE_422_EN and NATIVE_420_EN encoding
223  * @DPU_DSC_MAX
224  */
225 enum {
226 	DPU_DSC_OUTPUT_CTRL = 0x1,
227 	DPU_DSC_HW_REV_1_2,
228 	DPU_DSC_NATIVE_42x_EN,
229 	DPU_DSC_MAX
230 };
231 
232 /**
233  * MACRO DPU_HW_BLK_INFO - information of HW blocks inside DPU
234  * @name:              string name for debug purposes
235  * @id:                enum identifying this block
236  * @base:              register base offset to mdss
237  * @len:               length of hardware block
238  * @features           bit mask identifying sub-blocks/features
239  */
240 #define DPU_HW_BLK_INFO \
241 	char name[DPU_HW_BLK_NAME_LEN]; \
242 	u32 id; \
243 	u32 base; \
244 	u32 len; \
245 	unsigned long features
246 
247 /**
248  * struct dpu_scaler_blk: Scaler information
249  * @name: string name for debug purposes
250  * @base: offset of this sub-block relative to the block offset
251  * @len: register block length of this sub-block
252  * @version: qseed block revision, on QSEED3+ platforms this is the value of
253  *           scaler_blk.base + QSEED3_HW_VERSION registers.
254  */
255 struct dpu_scaler_blk {
256 	char name[DPU_HW_BLK_NAME_LEN];
257 	u32 base;
258 	u32 len;
259 	u32 version;
260 };
261 
262 struct dpu_csc_blk {
263 	char name[DPU_HW_BLK_NAME_LEN];
264 	u32 base;
265 	u32 len;
266 };
267 
268 /**
269  * struct dpu_pp_blk : Pixel processing sub-blk information
270  * @name: string name for debug purposes
271  * @base: offset of this sub-block relative to the block offset
272  * @len: register block length of this sub-block
273  * @version: HW Algorithm version
274  */
275 struct dpu_pp_blk {
276 	char name[DPU_HW_BLK_NAME_LEN];
277 	u32 base;
278 	u32 len;
279 	u32 version;
280 };
281 
282 /**
283  * struct dpu_dsc_blk - DSC Encoder sub-blk information
284  * @name: string name for debug purposes
285  * @base: offset of this sub-block relative to the block offset
286  * @len: register block length of this sub-block
287  */
288 struct dpu_dsc_blk {
289 	char name[DPU_HW_BLK_NAME_LEN];
290 	u32 base;
291 	u32 len;
292 };
293 
294 /**
295  * enum dpu_qos_lut_usage - define QoS LUT use cases
296  */
297 enum dpu_qos_lut_usage {
298 	DPU_QOS_LUT_USAGE_LINEAR,
299 	DPU_QOS_LUT_USAGE_MACROTILE,
300 	DPU_QOS_LUT_USAGE_NRT,
301 	DPU_QOS_LUT_USAGE_MAX,
302 };
303 
304 /**
305  * struct dpu_qos_lut_entry - define QoS LUT table entry
306  * @fl: fill level, or zero on last entry to indicate default lut
307  * @lut: lut to use if equal to or less than fill level
308  */
309 struct dpu_qos_lut_entry {
310 	u32 fl;
311 	u64 lut;
312 };
313 
314 /**
315  * struct dpu_qos_lut_tbl - define QoS LUT table
316  * @nentry: number of entry in this table
317  * @entries: Pointer to table entries
318  */
319 struct dpu_qos_lut_tbl {
320 	u32 nentry;
321 	const struct dpu_qos_lut_entry *entries;
322 };
323 
324 /**
325  * struct dpu_rotation_cfg - define inline rotation config
326  * @rot_maxheight: max pre rotated height allowed for rotation
327  * @rot_num_formats: number of elements in @rot_format_list
328  * @rot_format_list: list of supported rotator formats
329  */
330 struct dpu_rotation_cfg {
331 	u32 rot_maxheight;
332 	size_t rot_num_formats;
333 	const u32 *rot_format_list;
334 };
335 
336 /**
337  * struct dpu_caps - define DPU capabilities
338  * @max_mixer_width    max layer mixer line width support.
339  * @max_mixer_blendstages max layer mixer blend stages or
340  *                       supported z order
341  * @has_src_split      source split feature status
342  * @has_dim_layer      dim layer feature status
343  * @has_idle_pc        indicate if idle power collapse feature is supported
344  * @has_3d_merge       indicate if 3D merge is supported
345  * @max_linewidth      max linewidth for sspp
346  * @pixel_ram_size     size of latency hiding and de-tiling buffer in bytes
347  * @max_hdeci_exp      max horizontal decimation supported (max is 2^value)
348  * @max_vdeci_exp      max vertical decimation supported (max is 2^value)
349  */
350 struct dpu_caps {
351 	u32 max_mixer_width;
352 	u32 max_mixer_blendstages;
353 	bool has_src_split;
354 	bool has_dim_layer;
355 	bool has_idle_pc;
356 	bool has_3d_merge;
357 	/* SSPP limits */
358 	u32 max_linewidth;
359 	u32 pixel_ram_size;
360 	u32 max_hdeci_exp;
361 	u32 max_vdeci_exp;
362 };
363 
364 /**
365  * struct dpu_sspp_sub_blks : SSPP sub-blocks
366  * common: Pointer to common configurations shared by sub blocks
367  * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps
368  * @qseed_ver: qseed version
369  * @scaler_blk:
370  * @csc_blk:
371  * @format_list: Pointer to list of supported formats
372  * @num_formats: Number of supported formats
373  * @dpu_rotation_cfg: inline rotation configuration
374  */
375 struct dpu_sspp_sub_blks {
376 	u32 max_per_pipe_bw;
377 	u32 qseed_ver;
378 	struct dpu_scaler_blk scaler_blk;
379 	struct dpu_pp_blk csc_blk;
380 
381 	const u32 *format_list;
382 	u32 num_formats;
383 	const struct dpu_rotation_cfg *rotation_cfg;
384 };
385 
386 /**
387  * struct dpu_lm_sub_blks:      information of mixer block
388  * @maxwidth:               Max pixel width supported by this mixer
389  * @maxblendstages:         Max number of blend-stages supported
390  * @blendstage_base:        Blend-stage register base offset
391  */
392 struct dpu_lm_sub_blks {
393 	u32 maxwidth;
394 	u32 maxblendstages;
395 	u32 blendstage_base[MAX_BLOCKS];
396 };
397 
398 /**
399  * struct dpu_dspp_sub_blks: Information of DSPP block
400  * @pcc: pixel color correction block
401  */
402 struct dpu_dspp_sub_blks {
403 	struct dpu_pp_blk pcc;
404 };
405 
406 struct dpu_pingpong_sub_blks {
407 	struct dpu_pp_blk te;
408 	struct dpu_pp_blk te2;
409 	struct dpu_pp_blk dither;
410 };
411 
412 /**
413  * struct dpu_dsc_sub_blks - DSC sub-blks
414  * @enc: DSC encoder sub-block
415  * @ctl: DSC controller sub-block
416  */
417 struct dpu_dsc_sub_blks {
418 	struct dpu_dsc_blk enc;
419 	struct dpu_dsc_blk ctl;
420 };
421 
422 /**
423  * dpu_clk_ctrl_type - Defines top level clock control signals
424  */
425 enum dpu_clk_ctrl_type {
426 	DPU_CLK_CTRL_NONE,
427 	DPU_CLK_CTRL_VIG0,
428 	DPU_CLK_CTRL_VIG1,
429 	DPU_CLK_CTRL_VIG2,
430 	DPU_CLK_CTRL_VIG3,
431 	DPU_CLK_CTRL_VIG4,
432 	DPU_CLK_CTRL_RGB0,
433 	DPU_CLK_CTRL_RGB1,
434 	DPU_CLK_CTRL_RGB2,
435 	DPU_CLK_CTRL_RGB3,
436 	DPU_CLK_CTRL_DMA0,
437 	DPU_CLK_CTRL_DMA1,
438 	DPU_CLK_CTRL_DMA2,
439 	DPU_CLK_CTRL_DMA3,
440 	DPU_CLK_CTRL_DMA4,
441 	DPU_CLK_CTRL_DMA5,
442 	DPU_CLK_CTRL_CURSOR0,
443 	DPU_CLK_CTRL_CURSOR1,
444 	DPU_CLK_CTRL_INLINE_ROT0_SSPP,
445 	DPU_CLK_CTRL_REG_DMA,
446 	DPU_CLK_CTRL_WB2,
447 	DPU_CLK_CTRL_MAX,
448 };
449 
450 /* struct dpu_clk_ctrl_reg : Clock control register
451  * @reg_off:           register offset
452  * @bit_off:           bit offset
453  */
454 struct dpu_clk_ctrl_reg {
455 	u32 reg_off;
456 	u32 bit_off;
457 };
458 
459 /* struct dpu_mdp_cfg : MDP TOP-BLK instance info
460  * @id:                index identifying this block
461  * @base:              register base offset to mdss
462  * @features           bit mask identifying sub-blocks/features
463  * @clk_ctrls          clock control register definition
464  */
465 struct dpu_mdp_cfg {
466 	DPU_HW_BLK_INFO;
467 	struct dpu_clk_ctrl_reg clk_ctrls[DPU_CLK_CTRL_MAX];
468 };
469 
470 /* struct dpu_ctl_cfg : MDP CTL instance info
471  * @id:                index identifying this block
472  * @base:              register base offset to mdss
473  * @features           bit mask identifying sub-blocks/features
474  * @intr_start:        interrupt index for CTL_START
475  */
476 struct dpu_ctl_cfg {
477 	DPU_HW_BLK_INFO;
478 	unsigned int intr_start;
479 };
480 
481 /**
482  * struct dpu_sspp_cfg - information of source pipes
483  * @id:                index identifying this block
484  * @base               register offset of this block
485  * @features           bit mask identifying sub-blocks/features
486  * @sblk:              SSPP sub-blocks information
487  * @xin_id:            bus client identifier
488  * @clk_ctrl           clock control identifier
489  * @type               sspp type identifier
490  */
491 struct dpu_sspp_cfg {
492 	DPU_HW_BLK_INFO;
493 	const struct dpu_sspp_sub_blks *sblk;
494 	u32 xin_id;
495 	enum dpu_clk_ctrl_type clk_ctrl;
496 	u32 type;
497 };
498 
499 /**
500  * struct dpu_lm_cfg - information of layer mixer blocks
501  * @id:                index identifying this block
502  * @base               register offset of this block
503  * @features           bit mask identifying sub-blocks/features
504  * @sblk:              LM Sub-blocks information
505  * @pingpong:          ID of connected PingPong, PINGPONG_NONE if unsupported
506  * @lm_pair:           ID of LM that can be controlled by same CTL
507  */
508 struct dpu_lm_cfg {
509 	DPU_HW_BLK_INFO;
510 	const struct dpu_lm_sub_blks *sblk;
511 	u32 pingpong;
512 	u32 dspp;
513 	unsigned long lm_pair;
514 };
515 
516 /**
517  * struct dpu_dspp_cfg - information of DSPP blocks
518  * @id                 enum identifying this block
519  * @base               register offset of this block
520  * @features           bit mask identifying sub-blocks/features
521  *                     supported by this block
522  * @sblk               sub-blocks information
523  */
524 struct dpu_dspp_cfg  {
525 	DPU_HW_BLK_INFO;
526 	const struct dpu_dspp_sub_blks *sblk;
527 };
528 
529 /**
530  * struct dpu_pingpong_cfg - information of PING-PONG blocks
531  * @id                 enum identifying this block
532  * @base               register offset of this block
533  * @features           bit mask identifying sub-blocks/features
534  * @intr_done:         index for PINGPONG done interrupt
535  * @intr_rdptr:        index for PINGPONG readpointer done interrupt
536  * @sblk               sub-blocks information
537  */
538 struct dpu_pingpong_cfg  {
539 	DPU_HW_BLK_INFO;
540 	u32 merge_3d;
541 	unsigned int intr_done;
542 	unsigned int intr_rdptr;
543 	const struct dpu_pingpong_sub_blks *sblk;
544 };
545 
546 /**
547  * struct dpu_merge_3d_cfg - information of DSPP blocks
548  * @id                 enum identifying this block
549  * @base               register offset of this block
550  * @features           bit mask identifying sub-blocks/features
551  *                     supported by this block
552  * @sblk               sub-blocks information
553  */
554 struct dpu_merge_3d_cfg  {
555 	DPU_HW_BLK_INFO;
556 	const struct dpu_merge_3d_sub_blks *sblk;
557 };
558 
559 /**
560  * struct dpu_dsc_cfg - information of DSC blocks
561  * @id                 enum identifying this block
562  * @base               register offset of this block
563  * @len:               length of hardware block
564  * @features           bit mask identifying sub-blocks/features
565  * @sblk:              sub-blocks information
566  */
567 struct dpu_dsc_cfg {
568 	DPU_HW_BLK_INFO;
569 	const struct dpu_dsc_sub_blks *sblk;
570 };
571 
572 /**
573  * struct dpu_intf_cfg - information of timing engine blocks
574  * @id                 enum identifying this block
575  * @base               register offset of this block
576  * @features           bit mask identifying sub-blocks/features
577  * @type:              Interface type(DSI, DP, HDMI)
578  * @controller_id:     Controller Instance ID in case of multiple of intf type
579  * @prog_fetch_lines_worst_case	Worst case latency num lines needed to prefetch
580  * @intr_underrun:	index for INTF underrun interrupt
581  * @intr_vsync:	        index for INTF VSYNC interrupt
582  * @intr_tear_rd_ptr:  Index for INTF TEAR_RD_PTR interrupt
583  */
584 struct dpu_intf_cfg  {
585 	DPU_HW_BLK_INFO;
586 	u32 type;   /* interface type*/
587 	u32 controller_id;
588 	u32 prog_fetch_lines_worst_case;
589 	unsigned int intr_underrun;
590 	unsigned int intr_vsync;
591 	unsigned int intr_tear_rd_ptr;
592 };
593 
594 /**
595  * struct dpu_wb_cfg - information of writeback blocks
596  * @DPU_HW_BLK_INFO:    refer to the description above for DPU_HW_BLK_INFO
597  * @vbif_idx:           vbif client index
598  * @maxlinewidth:       max line width supported by writeback block
599  * @xin_id:             bus client identifier
600  * @intr_wb_done:       interrupt index for WB_DONE
601  * @format_list:	    list of formats supported by this writeback block
602  * @num_formats:	    number of formats supported by this writeback block
603  * @clk_ctrl:	        clock control identifier
604  */
605 struct dpu_wb_cfg {
606 	DPU_HW_BLK_INFO;
607 	u8 vbif_idx;
608 	u32 maxlinewidth;
609 	u32 xin_id;
610 	unsigned int intr_wb_done;
611 	const u32 *format_list;
612 	u32 num_formats;
613 	enum dpu_clk_ctrl_type clk_ctrl;
614 };
615 
616 /*
617  * struct dpu_cwb_cfg : MDP CWB mux instance info
618  * @id:                enum identifying this block
619  * @base:              register base offset to mdss
620  * @features           bit mask identifying sub-blocks/features
621  */
622 struct dpu_cwb_cfg {
623 	DPU_HW_BLK_INFO;
624 };
625 
626 /**
627  * struct dpu_vbif_dynamic_ot_cfg - dynamic OT setting
628  * @pps                pixel per seconds
629  * @ot_limit           OT limit to use up to specified pixel per second
630  */
631 struct dpu_vbif_dynamic_ot_cfg {
632 	u64 pps;
633 	u32 ot_limit;
634 };
635 
636 /**
637  * struct dpu_vbif_dynamic_ot_tbl - dynamic OT setting table
638  * @count              length of cfg
639  * @cfg                pointer to array of configuration settings with
640  *                     ascending requirements
641  */
642 struct dpu_vbif_dynamic_ot_tbl {
643 	u32 count;
644 	const struct dpu_vbif_dynamic_ot_cfg *cfg;
645 };
646 
647 /**
648  * struct dpu_vbif_qos_tbl - QoS priority table
649  * @npriority_lvl      num of priority level
650  * @priority_lvl       pointer to array of priority level in ascending order
651  */
652 struct dpu_vbif_qos_tbl {
653 	u32 npriority_lvl;
654 	const u32 *priority_lvl;
655 };
656 
657 /**
658  * struct dpu_vbif_cfg - information of VBIF blocks
659  * @id                 enum identifying this block
660  * @base               register offset of this block
661  * @features           bit mask identifying sub-blocks/features
662  * @ot_rd_limit        default OT read limit
663  * @ot_wr_limit        default OT write limit
664  * @xin_halt_timeout   maximum time (in usec) for xin to halt
665  * @qos_rp_remap_size  size of VBIF_XINL_QOS_RP_REMAP register space
666  * @dynamic_ot_rd_tbl  dynamic OT read configuration table
667  * @dynamic_ot_wr_tbl  dynamic OT write configuration table
668  * @qos_rt_tbl         real-time QoS priority table
669  * @qos_nrt_tbl        non-real-time QoS priority table
670  * @memtype_count      number of defined memtypes
671  * @memtype            array of xin memtype definitions
672  */
673 struct dpu_vbif_cfg {
674 	DPU_HW_BLK_INFO;
675 	u32 default_ot_rd_limit;
676 	u32 default_ot_wr_limit;
677 	u32 xin_halt_timeout;
678 	u32 qos_rp_remap_size;
679 	struct dpu_vbif_dynamic_ot_tbl dynamic_ot_rd_tbl;
680 	struct dpu_vbif_dynamic_ot_tbl dynamic_ot_wr_tbl;
681 	struct dpu_vbif_qos_tbl qos_rt_tbl;
682 	struct dpu_vbif_qos_tbl qos_nrt_tbl;
683 	u32 memtype_count;
684 	u32 memtype[MAX_XIN_COUNT];
685 };
686 
687 /**
688  * struct dpu_cdm_cfg - information of chroma down blocks
689  * @name               string name for debug purposes
690  * @id                 enum identifying this block
691  * @base               register offset of this block
692  * @features           bit mask identifying sub-blocks/features
693  */
694 struct dpu_cdm_cfg {
695 	DPU_HW_BLK_INFO;
696 };
697 
698 /**
699  * Define CDP use cases
700  * @DPU_PERF_CDP_UDAGE_RT: real-time use cases
701  * @DPU_PERF_CDP_USAGE_NRT: non real-time use cases such as WFD
702  */
703 enum {
704 	DPU_PERF_CDP_USAGE_RT,
705 	DPU_PERF_CDP_USAGE_NRT,
706 	DPU_PERF_CDP_USAGE_MAX
707 };
708 
709 /**
710  * struct dpu_perf_cdp_cfg - define CDP use case configuration
711  * @rd_enable: true if read pipe CDP is enabled
712  * @wr_enable: true if write pipe CDP is enabled
713  */
714 struct dpu_perf_cdp_cfg {
715 	bool rd_enable;
716 	bool wr_enable;
717 };
718 
719 /**
720  * struct dpu_mdss_version - DPU's major and minor versions
721  * @core_major_ver: DPU core's major version
722  * @core_minor_ver: DPU core's minor version
723  */
724 struct dpu_mdss_version {
725 	u8 core_major_ver;
726 	u8 core_minor_ver;
727 };
728 
729 /**
730  * struct dpu_perf_cfg - performance control settings
731  * @max_bw_low         low threshold of maximum bandwidth (kbps)
732  * @max_bw_high        high threshold of maximum bandwidth (kbps)
733  * @min_core_ib        minimum bandwidth for core (kbps)
734  * @min_core_ib        minimum mnoc ib vote in kbps
735  * @min_llcc_ib        minimum llcc ib vote in kbps
736  * @min_dram_ib        minimum dram ib vote in kbps
737  * @undersized_prefill_lines   undersized prefill in lines
738  * @xtra_prefill_lines         extra prefill latency in lines
739  * @dest_scale_prefill_lines   destination scaler latency in lines
740  * @macrotile_perfill_lines    macrotile latency in lines
741  * @yuv_nv12_prefill_lines     yuv_nv12 latency in lines
742  * @linear_prefill_lines       linear latency in lines
743  * @downscaling_prefill_lines  downscaling latency in lines
744  * @amortizable_theshold minimum y position for traffic shaping prefill
745  * @min_prefill_lines  minimum pipeline latency in lines
746  * @clk_inefficiency_factor DPU src clock inefficiency factor
747  * @bw_inefficiency_factor DPU axi bus bw inefficiency factor
748  * @safe_lut_tbl: LUT tables for safe signals
749  * @danger_lut_tbl: LUT tables for danger signals
750  * @qos_lut_tbl: LUT tables for QoS signals
751  * @cdp_cfg            cdp use case configurations
752  */
753 struct dpu_perf_cfg {
754 	u32 max_bw_low;
755 	u32 max_bw_high;
756 	u32 min_core_ib;
757 	u32 min_llcc_ib;
758 	u32 min_dram_ib;
759 	u32 undersized_prefill_lines;
760 	u32 xtra_prefill_lines;
761 	u32 dest_scale_prefill_lines;
762 	u32 macrotile_prefill_lines;
763 	u32 yuv_nv12_prefill_lines;
764 	u32 linear_prefill_lines;
765 	u32 downscaling_prefill_lines;
766 	u32 amortizable_threshold;
767 	u32 min_prefill_lines;
768 	u32 clk_inefficiency_factor;
769 	u32 bw_inefficiency_factor;
770 	u32 safe_lut_tbl[DPU_QOS_LUT_USAGE_MAX];
771 	u32 danger_lut_tbl[DPU_QOS_LUT_USAGE_MAX];
772 	struct dpu_qos_lut_tbl qos_lut_tbl[DPU_QOS_LUT_USAGE_MAX];
773 	struct dpu_perf_cdp_cfg cdp_cfg[DPU_PERF_CDP_USAGE_MAX];
774 };
775 
776 /**
777  * struct dpu_mdss_cfg - information of MDSS HW
778  * This is the main catalog data structure representing
779  * this HW version. Contains dpu's major and minor versions,
780  * number of instances, register offsets, capabilities of the
781  * all MDSS HW sub-blocks.
782  *
783  * @dma_formats        Supported formats for dma pipe
784  * @cursor_formats     Supported formats for cursor pipe
785  * @vig_formats        Supported formats for vig pipe
786  */
787 struct dpu_mdss_cfg {
788 	const struct dpu_mdss_version *mdss_ver;
789 
790 	const struct dpu_caps *caps;
791 
792 	const struct dpu_mdp_cfg *mdp;
793 
794 	u32 ctl_count;
795 	const struct dpu_ctl_cfg *ctl;
796 
797 	u32 sspp_count;
798 	const struct dpu_sspp_cfg *sspp;
799 
800 	u32 mixer_count;
801 	const struct dpu_lm_cfg *mixer;
802 
803 	u32 pingpong_count;
804 	const struct dpu_pingpong_cfg *pingpong;
805 
806 	u32 merge_3d_count;
807 	const struct dpu_merge_3d_cfg *merge_3d;
808 
809 	u32 dsc_count;
810 	const struct dpu_dsc_cfg *dsc;
811 
812 	u32 intf_count;
813 	const struct dpu_intf_cfg *intf;
814 
815 	u32 vbif_count;
816 	const struct dpu_vbif_cfg *vbif;
817 
818 	u32 wb_count;
819 	const struct dpu_wb_cfg *wb;
820 
821 	const struct dpu_cdm_cfg *cdm;
822 
823 	u32 ad_count;
824 
825 	u32 dspp_count;
826 	const struct dpu_dspp_cfg *dspp;
827 
828 	u32 cwb_count;
829 	const struct dpu_cwb_cfg *cwb;
830 
831 	/* Add additional block data structures here */
832 
833 	const struct dpu_perf_cfg *perf;
834 	const struct dpu_format_extended *dma_formats;
835 	const struct dpu_format_extended *cursor_formats;
836 	const struct dpu_format_extended *vig_formats;
837 };
838 
839 extern const struct dpu_mdss_cfg dpu_msm8917_cfg;
840 extern const struct dpu_mdss_cfg dpu_msm8937_cfg;
841 extern const struct dpu_mdss_cfg dpu_msm8953_cfg;
842 extern const struct dpu_mdss_cfg dpu_msm8996_cfg;
843 extern const struct dpu_mdss_cfg dpu_msm8998_cfg;
844 extern const struct dpu_mdss_cfg dpu_sdm630_cfg;
845 extern const struct dpu_mdss_cfg dpu_sdm660_cfg;
846 extern const struct dpu_mdss_cfg dpu_sdm845_cfg;
847 extern const struct dpu_mdss_cfg dpu_sdm670_cfg;
848 extern const struct dpu_mdss_cfg dpu_sm8150_cfg;
849 extern const struct dpu_mdss_cfg dpu_sc8180x_cfg;
850 extern const struct dpu_mdss_cfg dpu_sm7150_cfg;
851 extern const struct dpu_mdss_cfg dpu_sm8250_cfg;
852 extern const struct dpu_mdss_cfg dpu_sc7180_cfg;
853 extern const struct dpu_mdss_cfg dpu_sm6115_cfg;
854 extern const struct dpu_mdss_cfg dpu_sm6125_cfg;
855 extern const struct dpu_mdss_cfg dpu_sm6150_cfg;
856 extern const struct dpu_mdss_cfg dpu_sm6350_cfg;
857 extern const struct dpu_mdss_cfg dpu_qcm2290_cfg;
858 extern const struct dpu_mdss_cfg dpu_sm6375_cfg;
859 extern const struct dpu_mdss_cfg dpu_sm8350_cfg;
860 extern const struct dpu_mdss_cfg dpu_sc7280_cfg;
861 extern const struct dpu_mdss_cfg dpu_sc8280xp_cfg;
862 extern const struct dpu_mdss_cfg dpu_sm8450_cfg;
863 extern const struct dpu_mdss_cfg dpu_sa8775p_cfg;
864 extern const struct dpu_mdss_cfg dpu_sm8550_cfg;
865 extern const struct dpu_mdss_cfg dpu_sm8650_cfg;
866 extern const struct dpu_mdss_cfg dpu_x1e80100_cfg;
867 
868 #endif /* _DPU_HW_CATALOG_H */
869