197fb5e8dSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
225fdd593SJeykumar Sankaran /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
30d1b10c6SAbhinav Kumar  * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
425fdd593SJeykumar Sankaran  */
525fdd593SJeykumar Sankaran 
625fdd593SJeykumar Sankaran #define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
725fdd593SJeykumar Sankaran #include <linux/slab.h>
825fdd593SJeykumar Sankaran #include <linux/of_address.h>
925fdd593SJeykumar Sankaran #include <linux/platform_device.h>
1025fdd593SJeykumar Sankaran #include "dpu_hw_mdss.h"
11597762d5SDmitry Baryshkov #include "dpu_hw_interrupts.h"
1225fdd593SJeykumar Sankaran #include "dpu_hw_catalog.h"
1325fdd593SJeykumar Sankaran #include "dpu_kms.h"
1425fdd593SJeykumar Sankaran 
15a2a448b4SDmitry Baryshkov #define VIG_BASE_MASK \
167e3d6c54SDmitry Baryshkov 	(BIT(DPU_SSPP_QOS) |\
17a2a448b4SDmitry Baryshkov 	BIT(DPU_SSPP_CDP) |\
1825fdd593SJeykumar Sankaran 	BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_EXCL_RECT))
1925fdd593SJeykumar Sankaran 
20a2a448b4SDmitry Baryshkov #define VIG_MASK \
21a2a448b4SDmitry Baryshkov 	(VIG_BASE_MASK | \
22a2a448b4SDmitry Baryshkov 	BIT(DPU_SSPP_CSC_10BIT))
23a2a448b4SDmitry Baryshkov 
2494391a14SAngeloGioacchino Del Regno #define VIG_MSM8998_MASK \
2594391a14SAngeloGioacchino Del Regno 	(VIG_MASK | BIT(DPU_SSPP_SCALER_QSEED3))
2694391a14SAngeloGioacchino Del Regno 
277bdc0c4bSKalyan Thota #define VIG_SDM845_MASK \
28b8dab65bSAngeloGioacchino Del Regno 	(VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED3))
297bdc0c4bSKalyan Thota 
308b409996SDmitry Baryshkov #define VIG_SDM845_MASK_SDMA \
318b409996SDmitry Baryshkov 	(VIG_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
328b409996SDmitry Baryshkov 
337bdc0c4bSKalyan Thota #define VIG_SC7180_MASK \
34b8dab65bSAngeloGioacchino Del Regno 	(VIG_MASK | BIT(DPU_SSPP_QOS_8LVL) | BIT(DPU_SSPP_SCALER_QSEED4))
357bdc0c4bSKalyan Thota 
368b409996SDmitry Baryshkov #define VIG_SC7180_MASK_SDMA \
378b409996SDmitry Baryshkov 	(VIG_SC7180_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
388b409996SDmitry Baryshkov 
39a2a448b4SDmitry Baryshkov #define VIG_QCM2290_MASK (VIG_BASE_MASK | BIT(DPU_SSPP_QOS_8LVL))
405334087eSLoic Poulain 
4194391a14SAngeloGioacchino Del Regno #define DMA_MSM8998_MASK \
427e3d6c54SDmitry Baryshkov 	(BIT(DPU_SSPP_QOS) |\
4394391a14SAngeloGioacchino Del Regno 	BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
4494391a14SAngeloGioacchino Del Regno 	BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
4594391a14SAngeloGioacchino Del Regno 
46dabfdd89SVinod Polimera #define VIG_SC7280_MASK \
47dabfdd89SVinod Polimera 	(VIG_SC7180_MASK | BIT(DPU_SSPP_INLINE_ROTATION))
48dabfdd89SVinod Polimera 
498b409996SDmitry Baryshkov #define VIG_SC7280_MASK_SDMA \
508b409996SDmitry Baryshkov 	(VIG_SC7280_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
518b409996SDmitry Baryshkov 
5225fdd593SJeykumar Sankaran #define DMA_SDM845_MASK \
537e3d6c54SDmitry Baryshkov 	(BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\
5425fdd593SJeykumar Sankaran 	BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\
5525fdd593SJeykumar Sankaran 	BIT(DPU_SSPP_CDP) | BIT(DPU_SSPP_EXCL_RECT))
5625fdd593SJeykumar Sankaran 
5707ca1fc0SSravanthi Kollukuduru #define DMA_CURSOR_SDM845_MASK \
5807ca1fc0SSravanthi Kollukuduru 	(DMA_SDM845_MASK | BIT(DPU_SSPP_CURSOR))
5907ca1fc0SSravanthi Kollukuduru 
608b409996SDmitry Baryshkov #define DMA_SDM845_MASK_SDMA \
618b409996SDmitry Baryshkov 	(DMA_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
628b409996SDmitry Baryshkov 
638b409996SDmitry Baryshkov #define DMA_CURSOR_SDM845_MASK_SDMA \
648b409996SDmitry Baryshkov 	(DMA_CURSOR_SDM845_MASK | BIT(DPU_SSPP_SMART_DMA_V2))
658b409996SDmitry Baryshkov 
6694391a14SAngeloGioacchino Del Regno #define DMA_CURSOR_MSM8998_MASK \
6794391a14SAngeloGioacchino Del Regno 	(DMA_MSM8998_MASK | BIT(DPU_SSPP_CURSOR))
6894391a14SAngeloGioacchino Del Regno 
692d8a4edbSDmitry Baryshkov #define MIXER_MSM8998_MASK \
70a5045b00SDmitry Baryshkov 	(BIT(DPU_MIXER_SOURCESPLIT))
7125fdd593SJeykumar Sankaran 
722d8a4edbSDmitry Baryshkov #define MIXER_SDM845_MASK \
732d8a4edbSDmitry Baryshkov 	(BIT(DPU_MIXER_SOURCESPLIT) | BIT(DPU_DIM_LAYER) | BIT(DPU_MIXER_COMBINED_ALPHA))
742d8a4edbSDmitry Baryshkov 
7500feff8fSDmitry Baryshkov #define MIXER_QCM2290_MASK \
762d8a4edbSDmitry Baryshkov 	(BIT(DPU_DIM_LAYER) | BIT(DPU_MIXER_COMBINED_ALPHA))
777bdc0c4bSKalyan Thota 
78fe9d66cfSMarijn Suijten #define PINGPONG_SDM845_MASK \
79c20c4440SKuogee Hsieh 	(BIT(DPU_PINGPONG_DITHER) | BIT(DPU_PINGPONG_TE) | BIT(DPU_PINGPONG_DSC))
8025fdd593SJeykumar Sankaran 
81fe9d66cfSMarijn Suijten #define PINGPONG_SDM845_TE2_MASK \
8225fdd593SJeykumar Sankaran 	(PINGPONG_SDM845_MASK | BIT(DPU_PINGPONG_TE2))
8325fdd593SJeykumar Sankaran 
84fe9d66cfSMarijn Suijten #define PINGPONG_SM8150_MASK \
85c20c4440SKuogee Hsieh 	(BIT(DPU_PINGPONG_DITHER) | BIT(DPU_PINGPONG_DSC))
86fe9d66cfSMarijn Suijten 
87591e34a0SKrishna Manikandan #define CTL_SC7280_MASK \
8883a58b20SKalyan Thota 	(BIT(DPU_CTL_ACTIVE_CFG) | \
8983a58b20SKalyan Thota 	 BIT(DPU_CTL_FETCH_ACTIVE) | \
9083a58b20SKalyan Thota 	 BIT(DPU_CTL_VM_CFG) | \
9183a58b20SKalyan Thota 	 BIT(DPU_CTL_DSPP_SUB_BLOCK_FLUSH))
92591e34a0SKrishna Manikandan 
93e92a4ae1SDmitry Baryshkov #define CTL_SM8550_MASK \
94e92a4ae1SDmitry Baryshkov 	(CTL_SC7280_MASK | BIT(DPU_CTL_HAS_LAYER_EXT4))
95e92a4ae1SDmitry Baryshkov 
964259ff7aSKalyan Thota #define DSPP_SC7180_MASK BIT(DPU_DSPP_PCC)
97e47616dfSKalyan Thota 
98e3969eadSVinod Polimera #define INTF_SC7180_MASK \
99a7129231SKonrad Dybcio 	(BIT(DPU_INTF_INPUT_CTRL) | \
100a7129231SKonrad Dybcio 	 BIT(DPU_INTF_TE) | \
101a7129231SKonrad Dybcio 	 BIT(DPU_INTF_STATUS_SUPPORTED) | \
102a7129231SKonrad Dybcio 	 BIT(DPU_DATA_HCTL_EN))
103cace3ac4SJonathan Marek 
10422598cfcSJessica Zhang #define INTF_SC7280_MASK (INTF_SC7180_MASK | BIT(DPU_INTF_DATA_COMPRESS))
105591e34a0SKrishna Manikandan 
10653324b99SAbhinav Kumar #define WB_SM8250_MASK (BIT(DPU_WB_LINE_MODE) | \
10753324b99SAbhinav Kumar 			 BIT(DPU_WB_UBWC) | \
10853324b99SAbhinav Kumar 			 BIT(DPU_WB_YUV_CONFIG) | \
10953324b99SAbhinav Kumar 			 BIT(DPU_WB_PIPE_ALPHA) | \
11053324b99SAbhinav Kumar 			 BIT(DPU_WB_XY_ROI_OFFSET) | \
11153324b99SAbhinav Kumar 			 BIT(DPU_WB_QOS) | \
11253324b99SAbhinav Kumar 			 BIT(DPU_WB_QOS_8LVL) | \
11353324b99SAbhinav Kumar 			 BIT(DPU_WB_CDP) | \
11453324b99SAbhinav Kumar 			 BIT(DPU_WB_INPUT_CTRL))
11553324b99SAbhinav Kumar 
11625fdd593SJeykumar Sankaran #define DEFAULT_PIXEL_RAM_SIZE		(50 * 1024)
11725fdd593SJeykumar Sankaran #define DEFAULT_DPU_LINE_WIDTH		2048
11825fdd593SJeykumar Sankaran #define DEFAULT_DPU_OUTPUT_LINE_WIDTH	2560
11925fdd593SJeykumar Sankaran 
12025fdd593SJeykumar Sankaran #define MAX_HORZ_DECIMATION	4
12125fdd593SJeykumar Sankaran #define MAX_VERT_DECIMATION	4
12225fdd593SJeykumar Sankaran 
12325fdd593SJeykumar Sankaran #define MAX_UPSCALE_RATIO	20
12425fdd593SJeykumar Sankaran #define MAX_DOWNSCALE_RATIO	4
12525fdd593SJeykumar Sankaran #define SSPP_UNITY_SCALE	1
12625fdd593SJeykumar Sankaran 
12725fdd593SJeykumar Sankaran #define STRCAT(X, Y) (X Y)
12825fdd593SJeykumar Sankaran 
12909c7e370SLee Jones static const uint32_t plane_formats[] = {
13009c7e370SLee Jones 	DRM_FORMAT_ARGB8888,
13109c7e370SLee Jones 	DRM_FORMAT_ABGR8888,
13209c7e370SLee Jones 	DRM_FORMAT_RGBA8888,
13309c7e370SLee Jones 	DRM_FORMAT_BGRA8888,
13409c7e370SLee Jones 	DRM_FORMAT_XRGB8888,
13509c7e370SLee Jones 	DRM_FORMAT_RGBX8888,
13609c7e370SLee Jones 	DRM_FORMAT_BGRX8888,
13709c7e370SLee Jones 	DRM_FORMAT_XBGR8888,
138ffbbed63SLeonard Lausen 	DRM_FORMAT_ARGB2101010,
139da7716a2SJessica Zhang 	DRM_FORMAT_XRGB2101010,
14009c7e370SLee Jones 	DRM_FORMAT_RGB888,
14109c7e370SLee Jones 	DRM_FORMAT_BGR888,
14209c7e370SLee Jones 	DRM_FORMAT_RGB565,
14309c7e370SLee Jones 	DRM_FORMAT_BGR565,
14409c7e370SLee Jones 	DRM_FORMAT_ARGB1555,
14509c7e370SLee Jones 	DRM_FORMAT_ABGR1555,
14609c7e370SLee Jones 	DRM_FORMAT_RGBA5551,
14709c7e370SLee Jones 	DRM_FORMAT_BGRA5551,
14809c7e370SLee Jones 	DRM_FORMAT_XRGB1555,
14909c7e370SLee Jones 	DRM_FORMAT_XBGR1555,
15009c7e370SLee Jones 	DRM_FORMAT_RGBX5551,
15109c7e370SLee Jones 	DRM_FORMAT_BGRX5551,
15209c7e370SLee Jones 	DRM_FORMAT_ARGB4444,
15309c7e370SLee Jones 	DRM_FORMAT_ABGR4444,
15409c7e370SLee Jones 	DRM_FORMAT_RGBA4444,
15509c7e370SLee Jones 	DRM_FORMAT_BGRA4444,
15609c7e370SLee Jones 	DRM_FORMAT_XRGB4444,
15709c7e370SLee Jones 	DRM_FORMAT_XBGR4444,
15809c7e370SLee Jones 	DRM_FORMAT_RGBX4444,
15909c7e370SLee Jones 	DRM_FORMAT_BGRX4444,
16009c7e370SLee Jones };
16109c7e370SLee Jones 
16209c7e370SLee Jones static const uint32_t plane_formats_yuv[] = {
16309c7e370SLee Jones 	DRM_FORMAT_ARGB8888,
16409c7e370SLee Jones 	DRM_FORMAT_ABGR8888,
16509c7e370SLee Jones 	DRM_FORMAT_RGBA8888,
16609c7e370SLee Jones 	DRM_FORMAT_BGRX8888,
16709c7e370SLee Jones 	DRM_FORMAT_BGRA8888,
168ffbbed63SLeonard Lausen 	DRM_FORMAT_ARGB2101010,
169da7716a2SJessica Zhang 	DRM_FORMAT_XRGB2101010,
17009c7e370SLee Jones 	DRM_FORMAT_XRGB8888,
17109c7e370SLee Jones 	DRM_FORMAT_XBGR8888,
17209c7e370SLee Jones 	DRM_FORMAT_RGBX8888,
17309c7e370SLee Jones 	DRM_FORMAT_RGB888,
17409c7e370SLee Jones 	DRM_FORMAT_BGR888,
17509c7e370SLee Jones 	DRM_FORMAT_RGB565,
17609c7e370SLee Jones 	DRM_FORMAT_BGR565,
17709c7e370SLee Jones 	DRM_FORMAT_ARGB1555,
17809c7e370SLee Jones 	DRM_FORMAT_ABGR1555,
17909c7e370SLee Jones 	DRM_FORMAT_RGBA5551,
18009c7e370SLee Jones 	DRM_FORMAT_BGRA5551,
18109c7e370SLee Jones 	DRM_FORMAT_XRGB1555,
18209c7e370SLee Jones 	DRM_FORMAT_XBGR1555,
18309c7e370SLee Jones 	DRM_FORMAT_RGBX5551,
18409c7e370SLee Jones 	DRM_FORMAT_BGRX5551,
18509c7e370SLee Jones 	DRM_FORMAT_ARGB4444,
18609c7e370SLee Jones 	DRM_FORMAT_ABGR4444,
18709c7e370SLee Jones 	DRM_FORMAT_RGBA4444,
18809c7e370SLee Jones 	DRM_FORMAT_BGRA4444,
18909c7e370SLee Jones 	DRM_FORMAT_XRGB4444,
19009c7e370SLee Jones 	DRM_FORMAT_XBGR4444,
19109c7e370SLee Jones 	DRM_FORMAT_RGBX4444,
19209c7e370SLee Jones 	DRM_FORMAT_BGRX4444,
19309c7e370SLee Jones 
194f07c9946SJessica Zhang 	DRM_FORMAT_P010,
19509c7e370SLee Jones 	DRM_FORMAT_NV12,
19609c7e370SLee Jones 	DRM_FORMAT_NV21,
19709c7e370SLee Jones 	DRM_FORMAT_NV16,
19809c7e370SLee Jones 	DRM_FORMAT_NV61,
19909c7e370SLee Jones 	DRM_FORMAT_VYUY,
20009c7e370SLee Jones 	DRM_FORMAT_UYVY,
20109c7e370SLee Jones 	DRM_FORMAT_YUYV,
20209c7e370SLee Jones 	DRM_FORMAT_YVYU,
20309c7e370SLee Jones 	DRM_FORMAT_YUV420,
20409c7e370SLee Jones 	DRM_FORMAT_YVU420,
20509c7e370SLee Jones };
20609c7e370SLee Jones 
207dabfdd89SVinod Polimera static const u32 rotation_v2_formats[] = {
208dabfdd89SVinod Polimera 	DRM_FORMAT_NV12,
209dabfdd89SVinod Polimera 	/* TODO add formats after validation */
210dabfdd89SVinod Polimera };
211dabfdd89SVinod Polimera 
21253324b99SAbhinav Kumar static const uint32_t wb2_formats[] = {
21353324b99SAbhinav Kumar 	DRM_FORMAT_RGB565,
21453324b99SAbhinav Kumar 	DRM_FORMAT_BGR565,
21553324b99SAbhinav Kumar 	DRM_FORMAT_RGB888,
21653324b99SAbhinav Kumar 	DRM_FORMAT_ARGB8888,
21753324b99SAbhinav Kumar 	DRM_FORMAT_RGBA8888,
21853324b99SAbhinav Kumar 	DRM_FORMAT_ABGR8888,
21953324b99SAbhinav Kumar 	DRM_FORMAT_XRGB8888,
22053324b99SAbhinav Kumar 	DRM_FORMAT_RGBX8888,
22153324b99SAbhinav Kumar 	DRM_FORMAT_XBGR8888,
22253324b99SAbhinav Kumar 	DRM_FORMAT_ARGB1555,
22353324b99SAbhinav Kumar 	DRM_FORMAT_RGBA5551,
22453324b99SAbhinav Kumar 	DRM_FORMAT_XRGB1555,
22553324b99SAbhinav Kumar 	DRM_FORMAT_RGBX5551,
22653324b99SAbhinav Kumar 	DRM_FORMAT_ARGB4444,
22753324b99SAbhinav Kumar 	DRM_FORMAT_RGBA4444,
22853324b99SAbhinav Kumar 	DRM_FORMAT_RGBX4444,
22953324b99SAbhinav Kumar 	DRM_FORMAT_XRGB4444,
23053324b99SAbhinav Kumar 	DRM_FORMAT_BGR565,
23153324b99SAbhinav Kumar 	DRM_FORMAT_BGR888,
23253324b99SAbhinav Kumar 	DRM_FORMAT_ABGR8888,
23353324b99SAbhinav Kumar 	DRM_FORMAT_BGRA8888,
23453324b99SAbhinav Kumar 	DRM_FORMAT_BGRX8888,
23553324b99SAbhinav Kumar 	DRM_FORMAT_XBGR8888,
23653324b99SAbhinav Kumar 	DRM_FORMAT_ABGR1555,
23753324b99SAbhinav Kumar 	DRM_FORMAT_BGRA5551,
23853324b99SAbhinav Kumar 	DRM_FORMAT_XBGR1555,
23953324b99SAbhinav Kumar 	DRM_FORMAT_BGRX5551,
24053324b99SAbhinav Kumar 	DRM_FORMAT_ABGR4444,
24153324b99SAbhinav Kumar 	DRM_FORMAT_BGRA4444,
24253324b99SAbhinav Kumar 	DRM_FORMAT_BGRX4444,
24353324b99SAbhinav Kumar 	DRM_FORMAT_XBGR4444,
24453324b99SAbhinav Kumar };
24553324b99SAbhinav Kumar 
24625fdd593SJeykumar Sankaran /*************************************************************
24725fdd593SJeykumar Sankaran  * SSPP sub blocks config
24825fdd593SJeykumar Sankaran  *************************************************************/
24925fdd593SJeykumar Sankaran 
25025fdd593SJeykumar Sankaran /* SSPP common configuration */
251b75ab05aSShubhashree Dhar #define _VIG_SBLK(num, sdma_pri, qseed_ver) \
25225fdd593SJeykumar Sankaran 	{ \
25325fdd593SJeykumar Sankaran 	.maxdwnscale = MAX_DOWNSCALE_RATIO, \
25425fdd593SJeykumar Sankaran 	.maxupscale = MAX_UPSCALE_RATIO, \
25525fdd593SJeykumar Sankaran 	.smart_dma_priority = sdma_pri, \
25625fdd593SJeykumar Sankaran 	.scaler_blk = {.name = STRCAT("sspp_scaler", num), \
257b75ab05aSShubhashree Dhar 		.id = qseed_ver, \
25825fdd593SJeykumar Sankaran 		.base = 0xa00, .len = 0xa0,}, \
25925fdd593SJeykumar Sankaran 	.csc_blk = {.name = STRCAT("sspp_csc", num), \
26025fdd593SJeykumar Sankaran 		.id = DPU_SSPP_CSC_10BIT, \
26125fdd593SJeykumar Sankaran 		.base = 0x1a00, .len = 0x100,}, \
26225fdd593SJeykumar Sankaran 	.format_list = plane_formats_yuv, \
263e6b63a7bSFritz Koenig 	.num_formats = ARRAY_SIZE(plane_formats_yuv), \
26425fdd593SJeykumar Sankaran 	.virt_format_list = plane_formats, \
265e6b63a7bSFritz Koenig 	.virt_num_formats = ARRAY_SIZE(plane_formats), \
266dabfdd89SVinod Polimera 	.rotation_cfg = NULL, \
267dabfdd89SVinod Polimera 	}
268dabfdd89SVinod Polimera 
269dabfdd89SVinod Polimera #define _VIG_SBLK_ROT(num, sdma_pri, qseed_ver, rot_cfg) \
270dabfdd89SVinod Polimera 	{ \
271dabfdd89SVinod Polimera 	.maxdwnscale = MAX_DOWNSCALE_RATIO, \
272dabfdd89SVinod Polimera 	.maxupscale = MAX_UPSCALE_RATIO, \
273dabfdd89SVinod Polimera 	.smart_dma_priority = sdma_pri, \
274dabfdd89SVinod Polimera 	.scaler_blk = {.name = STRCAT("sspp_scaler", num), \
275dabfdd89SVinod Polimera 		.id = qseed_ver, \
276dabfdd89SVinod Polimera 		.base = 0xa00, .len = 0xa0,}, \
277dabfdd89SVinod Polimera 	.csc_blk = {.name = STRCAT("sspp_csc", num), \
278dabfdd89SVinod Polimera 		.id = DPU_SSPP_CSC_10BIT, \
279dabfdd89SVinod Polimera 		.base = 0x1a00, .len = 0x100,}, \
280dabfdd89SVinod Polimera 	.format_list = plane_formats_yuv, \
281dabfdd89SVinod Polimera 	.num_formats = ARRAY_SIZE(plane_formats_yuv), \
282dabfdd89SVinod Polimera 	.virt_format_list = plane_formats, \
283dabfdd89SVinod Polimera 	.virt_num_formats = ARRAY_SIZE(plane_formats), \
284dabfdd89SVinod Polimera 	.rotation_cfg = rot_cfg, \
28525fdd593SJeykumar Sankaran 	}
28625fdd593SJeykumar Sankaran 
287*1071a22cSRyan McCann #define _DMA_SBLK(sdma_pri) \
28825fdd593SJeykumar Sankaran 	{ \
28925fdd593SJeykumar Sankaran 	.maxdwnscale = SSPP_UNITY_SCALE, \
29025fdd593SJeykumar Sankaran 	.maxupscale = SSPP_UNITY_SCALE, \
29125fdd593SJeykumar Sankaran 	.smart_dma_priority = sdma_pri, \
29225fdd593SJeykumar Sankaran 	.format_list = plane_formats, \
293e6b63a7bSFritz Koenig 	.num_formats = ARRAY_SIZE(plane_formats), \
29425fdd593SJeykumar Sankaran 	.virt_format_list = plane_formats, \
295e6b63a7bSFritz Koenig 	.virt_num_formats = ARRAY_SIZE(plane_formats), \
29625fdd593SJeykumar Sankaran 	}
29725fdd593SJeykumar Sankaran 
29894391a14SAngeloGioacchino Del Regno static const struct dpu_sspp_sub_blks msm8998_vig_sblk_0 =
29994391a14SAngeloGioacchino Del Regno 				_VIG_SBLK("0", 0, DPU_SSPP_SCALER_QSEED3);
30094391a14SAngeloGioacchino Del Regno static const struct dpu_sspp_sub_blks msm8998_vig_sblk_1 =
30194391a14SAngeloGioacchino Del Regno 				_VIG_SBLK("1", 0, DPU_SSPP_SCALER_QSEED3);
30294391a14SAngeloGioacchino Del Regno static const struct dpu_sspp_sub_blks msm8998_vig_sblk_2 =
30394391a14SAngeloGioacchino Del Regno 				_VIG_SBLK("2", 0, DPU_SSPP_SCALER_QSEED3);
30494391a14SAngeloGioacchino Del Regno static const struct dpu_sspp_sub_blks msm8998_vig_sblk_3 =
30594391a14SAngeloGioacchino Del Regno 				_VIG_SBLK("3", 0, DPU_SSPP_SCALER_QSEED3);
30694391a14SAngeloGioacchino Del Regno 
307dabfdd89SVinod Polimera static const struct dpu_rotation_cfg dpu_rot_sc7280_cfg_v2 = {
308dabfdd89SVinod Polimera 	.rot_maxheight = 1088,
309dabfdd89SVinod Polimera 	.rot_num_formats = ARRAY_SIZE(rotation_v2_formats),
310dabfdd89SVinod Polimera 	.rot_format_list = rotation_v2_formats,
311dabfdd89SVinod Polimera };
312dabfdd89SVinod Polimera 
313b75ab05aSShubhashree Dhar static const struct dpu_sspp_sub_blks sdm845_vig_sblk_0 =
314b75ab05aSShubhashree Dhar 				_VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED3);
315b75ab05aSShubhashree Dhar static const struct dpu_sspp_sub_blks sdm845_vig_sblk_1 =
316b75ab05aSShubhashree Dhar 				_VIG_SBLK("1", 6, DPU_SSPP_SCALER_QSEED3);
317b75ab05aSShubhashree Dhar static const struct dpu_sspp_sub_blks sdm845_vig_sblk_2 =
318b75ab05aSShubhashree Dhar 				_VIG_SBLK("2", 7, DPU_SSPP_SCALER_QSEED3);
319b75ab05aSShubhashree Dhar static const struct dpu_sspp_sub_blks sdm845_vig_sblk_3 =
320b75ab05aSShubhashree Dhar 				_VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED3);
32125fdd593SJeykumar Sankaran 
322*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks sdm845_dma_sblk_0 = _DMA_SBLK(1);
323*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks sdm845_dma_sblk_1 = _DMA_SBLK(2);
324*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks sdm845_dma_sblk_2 = _DMA_SBLK(3);
325*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks sdm845_dma_sblk_3 = _DMA_SBLK(4);
32625fdd593SJeykumar Sankaran 
327b75ab05aSShubhashree Dhar static const struct dpu_sspp_sub_blks sc7180_vig_sblk_0 =
328b75ab05aSShubhashree Dhar 				_VIG_SBLK("0", 4, DPU_SSPP_SCALER_QSEED4);
329b75ab05aSShubhashree Dhar 
330dabfdd89SVinod Polimera static const struct dpu_sspp_sub_blks sc7280_vig_sblk_0 =
331dabfdd89SVinod Polimera 			_VIG_SBLK_ROT("0", 4, DPU_SSPP_SCALER_QSEED4, &dpu_rot_sc7280_cfg_v2);
332dabfdd89SVinod Polimera 
3333581b706SAdam Skladowski static const struct dpu_sspp_sub_blks sm6115_vig_sblk_0 =
33438164e99SDmitry Baryshkov 				_VIG_SBLK("0", 2, DPU_SSPP_SCALER_QSEED4);
3353581b706SAdam Skladowski 
336d21fc5dfSDmitry Baryshkov static const struct dpu_sspp_sub_blks sm8250_vig_sblk_0 =
33703c0c3cbSDmitry Baryshkov 				_VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED4);
338d21fc5dfSDmitry Baryshkov static const struct dpu_sspp_sub_blks sm8250_vig_sblk_1 =
33903c0c3cbSDmitry Baryshkov 				_VIG_SBLK("1", 6, DPU_SSPP_SCALER_QSEED4);
340d21fc5dfSDmitry Baryshkov static const struct dpu_sspp_sub_blks sm8250_vig_sblk_2 =
34103c0c3cbSDmitry Baryshkov 				_VIG_SBLK("2", 7, DPU_SSPP_SCALER_QSEED4);
342d21fc5dfSDmitry Baryshkov static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 =
34303c0c3cbSDmitry Baryshkov 				_VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED4);
344d21fc5dfSDmitry Baryshkov 
345efcd0107SNeil Armstrong static const struct dpu_sspp_sub_blks sm8550_vig_sblk_0 =
346d113d267SDmitry Baryshkov 				_VIG_SBLK("0", 7, DPU_SSPP_SCALER_QSEED4);
347efcd0107SNeil Armstrong static const struct dpu_sspp_sub_blks sm8550_vig_sblk_1 =
348d113d267SDmitry Baryshkov 				_VIG_SBLK("1", 8, DPU_SSPP_SCALER_QSEED4);
349efcd0107SNeil Armstrong static const struct dpu_sspp_sub_blks sm8550_vig_sblk_2 =
350d113d267SDmitry Baryshkov 				_VIG_SBLK("2", 9, DPU_SSPP_SCALER_QSEED4);
351efcd0107SNeil Armstrong static const struct dpu_sspp_sub_blks sm8550_vig_sblk_3 =
352d113d267SDmitry Baryshkov 				_VIG_SBLK("3", 10, DPU_SSPP_SCALER_QSEED4);
353*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks sm8550_dma_sblk_4 = _DMA_SBLK(5);
354*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks sm8550_dma_sblk_5 = _DMA_SBLK(6);
355efcd0107SNeil Armstrong 
356*1071a22cSRyan McCann #define _VIG_SBLK_NOSCALE(sdma_pri) \
3575334087eSLoic Poulain 	{ \
3585334087eSLoic Poulain 	.maxdwnscale = SSPP_UNITY_SCALE, \
3595334087eSLoic Poulain 	.maxupscale = SSPP_UNITY_SCALE, \
3605334087eSLoic Poulain 	.smart_dma_priority = sdma_pri, \
3615334087eSLoic Poulain 	.format_list = plane_formats_yuv, \
3625334087eSLoic Poulain 	.num_formats = ARRAY_SIZE(plane_formats_yuv), \
3635334087eSLoic Poulain 	.virt_format_list = plane_formats, \
3645334087eSLoic Poulain 	.virt_num_formats = ARRAY_SIZE(plane_formats), \
3655334087eSLoic Poulain 	}
3665334087eSLoic Poulain 
367*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks qcm2290_vig_sblk_0 = _VIG_SBLK_NOSCALE(2);
368*1071a22cSRyan McCann static const struct dpu_sspp_sub_blks qcm2290_dma_sblk_0 = _DMA_SBLK(1);
3695334087eSLoic Poulain 
37025fdd593SJeykumar Sankaran /*************************************************************
37125fdd593SJeykumar Sankaran  * MIXER sub blocks config
37225fdd593SJeykumar Sankaran  *************************************************************/
3737bdc0c4bSKalyan Thota 
37494391a14SAngeloGioacchino Del Regno /* MSM8998 */
37594391a14SAngeloGioacchino Del Regno 
37694391a14SAngeloGioacchino Del Regno static const struct dpu_lm_sub_blks msm8998_lm_sblk = {
37794391a14SAngeloGioacchino Del Regno 	.maxwidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
37894391a14SAngeloGioacchino Del Regno 	.maxblendstages = 7, /* excluding base layer */
37994391a14SAngeloGioacchino Del Regno 	.blendstage_base = { /* offsets relative to mixer base */
38094391a14SAngeloGioacchino Del Regno 		0x20, 0x50, 0x80, 0xb0, 0x230,
38194391a14SAngeloGioacchino Del Regno 		0x260, 0x290
38294391a14SAngeloGioacchino Del Regno 	},
38394391a14SAngeloGioacchino Del Regno };
38494391a14SAngeloGioacchino Del Regno 
38594391a14SAngeloGioacchino Del Regno /* SDM845 */
38694391a14SAngeloGioacchino Del Regno 
38794391a14SAngeloGioacchino Del Regno static const struct dpu_lm_sub_blks sdm845_lm_sblk = {
38894391a14SAngeloGioacchino Del Regno 	.maxwidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
38994391a14SAngeloGioacchino Del Regno 	.maxblendstages = 11, /* excluding base layer */
39094391a14SAngeloGioacchino Del Regno 	.blendstage_base = { /* offsets relative to mixer base */
39194391a14SAngeloGioacchino Del Regno 		0x20, 0x38, 0x50, 0x68, 0x80, 0x98,
39294391a14SAngeloGioacchino Del Regno 		0xb0, 0xc8, 0xe0, 0xf8, 0x110
39394391a14SAngeloGioacchino Del Regno 	},
39494391a14SAngeloGioacchino Del Regno };
39594391a14SAngeloGioacchino Del Regno 
3967bdc0c4bSKalyan Thota /* SC7180 */
3977bdc0c4bSKalyan Thota 
3987bdc0c4bSKalyan Thota static const struct dpu_lm_sub_blks sc7180_lm_sblk = {
3997bdc0c4bSKalyan Thota 	.maxwidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
4007bdc0c4bSKalyan Thota 	.maxblendstages = 7, /* excluding base layer */
4017bdc0c4bSKalyan Thota 	.blendstage_base = { /* offsets relative to mixer base */
4027bdc0c4bSKalyan Thota 		0x20, 0x38, 0x50, 0x68, 0x80, 0x98, 0xb0
4037bdc0c4bSKalyan Thota 	},
4047bdc0c4bSKalyan Thota };
4057bdc0c4bSKalyan Thota 
4065334087eSLoic Poulain /* QCM2290 */
4075334087eSLoic Poulain 
4085334087eSLoic Poulain static const struct dpu_lm_sub_blks qcm2290_lm_sblk = {
409da06be8bSDmitry Baryshkov 	.maxwidth = DEFAULT_DPU_LINE_WIDTH,
4105334087eSLoic Poulain 	.maxblendstages = 4, /* excluding base layer */
4115334087eSLoic Poulain 	.blendstage_base = { /* offsets relative to mixer base */
4125334087eSLoic Poulain 		0x20, 0x38, 0x50, 0x68
4135334087eSLoic Poulain 	},
4145334087eSLoic Poulain };
4155334087eSLoic Poulain 
41625fdd593SJeykumar Sankaran /*************************************************************
417e47616dfSKalyan Thota  * DSPP sub blocks config
418e47616dfSKalyan Thota  *************************************************************/
41994391a14SAngeloGioacchino Del Regno static const struct dpu_dspp_sub_blks msm8998_dspp_sblk = {
42094391a14SAngeloGioacchino Del Regno 	.pcc = {.id = DPU_DSPP_PCC, .base = 0x1700,
42194391a14SAngeloGioacchino Del Regno 		.len = 0x90, .version = 0x10007},
42294391a14SAngeloGioacchino Del Regno };
42394391a14SAngeloGioacchino Del Regno 
4249891b3dfSKonrad Dybcio static const struct dpu_dspp_sub_blks sdm845_dspp_sblk = {
42505ae91d9SDmitry Baryshkov 	.pcc = {.id = DPU_DSPP_PCC, .base = 0x1700,
42605ae91d9SDmitry Baryshkov 		.len = 0x90, .version = 0x40000},
42705ae91d9SDmitry Baryshkov };
42805ae91d9SDmitry Baryshkov 
429e47616dfSKalyan Thota /*************************************************************
43025fdd593SJeykumar Sankaran  * PINGPONG sub blocks config
43125fdd593SJeykumar Sankaran  *************************************************************/
43225fdd593SJeykumar Sankaran static const struct dpu_pingpong_sub_blks sdm845_pp_sblk_te = {
43325fdd593SJeykumar Sankaran 	.te2 = {.id = DPU_PINGPONG_TE2, .base = 0x2000, .len = 0x0,
43425fdd593SJeykumar Sankaran 		.version = 0x1},
43525fdd593SJeykumar Sankaran 	.dither = {.id = DPU_PINGPONG_DITHER, .base = 0x30e0,
43625fdd593SJeykumar Sankaran 		.len = 0x20, .version = 0x10000},
43725fdd593SJeykumar Sankaran };
43825fdd593SJeykumar Sankaran 
43925fdd593SJeykumar Sankaran static const struct dpu_pingpong_sub_blks sdm845_pp_sblk = {
44025fdd593SJeykumar Sankaran 	.dither = {.id = DPU_PINGPONG_DITHER, .base = 0x30e0,
44125fdd593SJeykumar Sankaran 		.len = 0x20, .version = 0x10000},
44225fdd593SJeykumar Sankaran };
44325fdd593SJeykumar Sankaran 
444591e34a0SKrishna Manikandan static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = {
445591e34a0SKrishna Manikandan 	.dither = {.id = DPU_PINGPONG_DITHER, .base = 0xe0,
446591e34a0SKrishna Manikandan 	.len = 0x20, .version = 0x20000},
447591e34a0SKrishna Manikandan };
448591e34a0SKrishna Manikandan 
4494369c93cSDmitry Baryshkov /*************************************************************
4507c5ab05eSVinod Koul  * DSC sub blocks config
4517c5ab05eSVinod Koul  *************************************************************/
4520d1b10c6SAbhinav Kumar static const struct dpu_dsc_sub_blks dsc_sblk_0 = {
4530d1b10c6SAbhinav Kumar 	.enc = {.base = 0x100, .len = 0x100},
4540d1b10c6SAbhinav Kumar 	.ctl = {.base = 0xF00, .len = 0x10},
4550d1b10c6SAbhinav Kumar };
4560d1b10c6SAbhinav Kumar 
4570d1b10c6SAbhinav Kumar static const struct dpu_dsc_sub_blks dsc_sblk_1 = {
4580d1b10c6SAbhinav Kumar 	.enc = {.base = 0x200, .len = 0x100},
4590d1b10c6SAbhinav Kumar 	.ctl = {.base = 0xF80, .len = 0x10},
4600d1b10c6SAbhinav Kumar };
4610d1b10c6SAbhinav Kumar 
46225fdd593SJeykumar Sankaran /*************************************************************
46325fdd593SJeykumar Sankaran  * VBIF sub blocks config
46425fdd593SJeykumar Sankaran  *************************************************************/
46525fdd593SJeykumar Sankaran /* VBIF QOS remap */
46694391a14SAngeloGioacchino Del Regno static const u32 msm8998_rt_pri_lvl[] = {1, 2, 2, 2};
46794391a14SAngeloGioacchino Del Regno static const u32 msm8998_nrt_pri_lvl[] = {1, 1, 1, 1};
468abda0d92SStephen Boyd static const u32 sdm845_rt_pri_lvl[] = {3, 3, 4, 4, 5, 5, 6, 6};
469abda0d92SStephen Boyd static const u32 sdm845_nrt_pri_lvl[] = {3, 3, 3, 3, 3, 3, 3, 3};
47025fdd593SJeykumar Sankaran 
47194391a14SAngeloGioacchino Del Regno static const struct dpu_vbif_dynamic_ot_cfg msm8998_ot_rdwr_cfg[] = {
47294391a14SAngeloGioacchino Del Regno 	{
4733f23a52fSArnaud Vrac 		.pps = 1920 * 1080 * 30,
47494391a14SAngeloGioacchino Del Regno 		.ot_limit = 2,
47594391a14SAngeloGioacchino Del Regno 	},
47694391a14SAngeloGioacchino Del Regno 	{
4773f23a52fSArnaud Vrac 		.pps = 1920 * 1080 * 60,
4783f23a52fSArnaud Vrac 		.ot_limit = 4,
47994391a14SAngeloGioacchino Del Regno 	},
48094391a14SAngeloGioacchino Del Regno 	{
48194391a14SAngeloGioacchino Del Regno 		.pps = 3840 * 2160 * 30,
48294391a14SAngeloGioacchino Del Regno 		.ot_limit = 16,
48394391a14SAngeloGioacchino Del Regno 	},
48494391a14SAngeloGioacchino Del Regno };
48594391a14SAngeloGioacchino Del Regno 
48694391a14SAngeloGioacchino Del Regno static const struct dpu_vbif_cfg msm8998_vbif[] = {
48794391a14SAngeloGioacchino Del Regno 	{
488606f015bSDmitry Baryshkov 	.name = "vbif_rt", .id = VBIF_RT,
48994391a14SAngeloGioacchino Del Regno 	.base = 0, .len = 0x1040,
49094391a14SAngeloGioacchino Del Regno 	.default_ot_rd_limit = 32,
49194391a14SAngeloGioacchino Del Regno 	.default_ot_wr_limit = 32,
49294391a14SAngeloGioacchino Del Regno 	.features = BIT(DPU_VBIF_QOS_REMAP) | BIT(DPU_VBIF_QOS_OTLIM),
49394391a14SAngeloGioacchino Del Regno 	.xin_halt_timeout = 0x4000,
494c8744315SDmitry Baryshkov 	.qos_rp_remap_size = 0x20,
49594391a14SAngeloGioacchino Del Regno 	.dynamic_ot_rd_tbl = {
49694391a14SAngeloGioacchino Del Regno 		.count = ARRAY_SIZE(msm8998_ot_rdwr_cfg),
49794391a14SAngeloGioacchino Del Regno 		.cfg = msm8998_ot_rdwr_cfg,
49894391a14SAngeloGioacchino Del Regno 		},
49994391a14SAngeloGioacchino Del Regno 	.dynamic_ot_wr_tbl = {
50094391a14SAngeloGioacchino Del Regno 		.count = ARRAY_SIZE(msm8998_ot_rdwr_cfg),
50194391a14SAngeloGioacchino Del Regno 		.cfg = msm8998_ot_rdwr_cfg,
50294391a14SAngeloGioacchino Del Regno 		},
50394391a14SAngeloGioacchino Del Regno 	.qos_rt_tbl = {
50494391a14SAngeloGioacchino Del Regno 		.npriority_lvl = ARRAY_SIZE(msm8998_rt_pri_lvl),
50594391a14SAngeloGioacchino Del Regno 		.priority_lvl = msm8998_rt_pri_lvl,
50694391a14SAngeloGioacchino Del Regno 		},
50794391a14SAngeloGioacchino Del Regno 	.qos_nrt_tbl = {
50894391a14SAngeloGioacchino Del Regno 		.npriority_lvl = ARRAY_SIZE(msm8998_nrt_pri_lvl),
50994391a14SAngeloGioacchino Del Regno 		.priority_lvl = msm8998_nrt_pri_lvl,
51094391a14SAngeloGioacchino Del Regno 		},
51194391a14SAngeloGioacchino Del Regno 	.memtype_count = 14,
51294391a14SAngeloGioacchino Del Regno 	.memtype = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
51394391a14SAngeloGioacchino Del Regno 	},
51494391a14SAngeloGioacchino Del Regno };
51594391a14SAngeloGioacchino Del Regno 
516abda0d92SStephen Boyd static const struct dpu_vbif_cfg sdm845_vbif[] = {
51725fdd593SJeykumar Sankaran 	{
518606f015bSDmitry Baryshkov 	.name = "vbif_rt", .id = VBIF_RT,
51925fdd593SJeykumar Sankaran 	.base = 0, .len = 0x1040,
52025fdd593SJeykumar Sankaran 	.features = BIT(DPU_VBIF_QOS_REMAP),
52125fdd593SJeykumar Sankaran 	.xin_halt_timeout = 0x4000,
522c8744315SDmitry Baryshkov 	.qos_rp_remap_size = 0x40,
52325fdd593SJeykumar Sankaran 	.qos_rt_tbl = {
52425fdd593SJeykumar Sankaran 		.npriority_lvl = ARRAY_SIZE(sdm845_rt_pri_lvl),
52525fdd593SJeykumar Sankaran 		.priority_lvl = sdm845_rt_pri_lvl,
52625fdd593SJeykumar Sankaran 		},
52725fdd593SJeykumar Sankaran 	.qos_nrt_tbl = {
52825fdd593SJeykumar Sankaran 		.npriority_lvl = ARRAY_SIZE(sdm845_nrt_pri_lvl),
52925fdd593SJeykumar Sankaran 		.priority_lvl = sdm845_nrt_pri_lvl,
53025fdd593SJeykumar Sankaran 		},
53125fdd593SJeykumar Sankaran 	.memtype_count = 14,
53225fdd593SJeykumar Sankaran 	.memtype = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
53325fdd593SJeykumar Sankaran 	},
53425fdd593SJeykumar Sankaran };
53525fdd593SJeykumar Sankaran 
53625fdd593SJeykumar Sankaran /*************************************************************
53725fdd593SJeykumar Sankaran  * PERF data config
53825fdd593SJeykumar Sankaran  *************************************************************/
53925fdd593SJeykumar Sankaran 
54025fdd593SJeykumar Sankaran /* SSPP QOS LUTs */
54194391a14SAngeloGioacchino Del Regno static const struct dpu_qos_lut_entry msm8998_qos_linear[] = {
54294391a14SAngeloGioacchino Del Regno 	{.fl = 4,  .lut = 0x1b},
54394391a14SAngeloGioacchino Del Regno 	{.fl = 5,  .lut = 0x5b},
54494391a14SAngeloGioacchino Del Regno 	{.fl = 6,  .lut = 0x15b},
54594391a14SAngeloGioacchino Del Regno 	{.fl = 7,  .lut = 0x55b},
54694391a14SAngeloGioacchino Del Regno 	{.fl = 8,  .lut = 0x155b},
54794391a14SAngeloGioacchino Del Regno 	{.fl = 9,  .lut = 0x555b},
54894391a14SAngeloGioacchino Del Regno 	{.fl = 10, .lut = 0x1555b},
54994391a14SAngeloGioacchino Del Regno 	{.fl = 11, .lut = 0x5555b},
55094391a14SAngeloGioacchino Del Regno 	{.fl = 12, .lut = 0x15555b},
5513f23a52fSArnaud Vrac 	{.fl = 0,  .lut = 0x55555b}
55294391a14SAngeloGioacchino Del Regno };
55394391a14SAngeloGioacchino Del Regno 
554abda0d92SStephen Boyd static const struct dpu_qos_lut_entry sdm845_qos_linear[] = {
55525fdd593SJeykumar Sankaran 	{.fl = 4, .lut = 0x357},
55625fdd593SJeykumar Sankaran 	{.fl = 5, .lut = 0x3357},
55725fdd593SJeykumar Sankaran 	{.fl = 6, .lut = 0x23357},
55825fdd593SJeykumar Sankaran 	{.fl = 7, .lut = 0x223357},
55925fdd593SJeykumar Sankaran 	{.fl = 8, .lut = 0x2223357},
56025fdd593SJeykumar Sankaran 	{.fl = 9, .lut = 0x22223357},
56125fdd593SJeykumar Sankaran 	{.fl = 10, .lut = 0x222223357},
56225fdd593SJeykumar Sankaran 	{.fl = 11, .lut = 0x2222223357},
56325fdd593SJeykumar Sankaran 	{.fl = 12, .lut = 0x22222223357},
56425fdd593SJeykumar Sankaran 	{.fl = 13, .lut = 0x222222223357},
56525fdd593SJeykumar Sankaran 	{.fl = 14, .lut = 0x1222222223357},
56625fdd593SJeykumar Sankaran 	{.fl = 0, .lut = 0x11222222223357}
56725fdd593SJeykumar Sankaran };
56825fdd593SJeykumar Sankaran 
56994391a14SAngeloGioacchino Del Regno static const struct dpu_qos_lut_entry msm8998_qos_macrotile[] = {
57094391a14SAngeloGioacchino Del Regno 	{.fl = 10, .lut = 0x1aaff},
57194391a14SAngeloGioacchino Del Regno 	{.fl = 11, .lut = 0x5aaff},
57294391a14SAngeloGioacchino Del Regno 	{.fl = 12, .lut = 0x15aaff},
5733f23a52fSArnaud Vrac 	{.fl = 0,  .lut = 0x55aaff},
57494391a14SAngeloGioacchino Del Regno };
57594391a14SAngeloGioacchino Del Regno 
5767bdc0c4bSKalyan Thota static const struct dpu_qos_lut_entry sc7180_qos_linear[] = {
5777bdc0c4bSKalyan Thota 	{.fl = 0, .lut = 0x0011222222335777},
5787bdc0c4bSKalyan Thota };
5797bdc0c4bSKalyan Thota 
5803186acbaSKonrad Dybcio static const struct dpu_qos_lut_entry sm6350_qos_linear_macrotile[] = {
5813186acbaSKonrad Dybcio 	{.fl = 0, .lut = 0x0011223445566777 },
5823186acbaSKonrad Dybcio };
5833186acbaSKonrad Dybcio 
584386fced3SJonathan Marek static const struct dpu_qos_lut_entry sm8150_qos_linear[] = {
585386fced3SJonathan Marek 	{.fl = 0, .lut = 0x0011222222223357 },
586386fced3SJonathan Marek };
587386fced3SJonathan Marek 
588f3af2d6eSRob Clark static const struct dpu_qos_lut_entry sc8180x_qos_linear[] = {
589f3af2d6eSRob Clark 	{.fl = 4, .lut = 0x0000000000000357 },
590f3af2d6eSRob Clark };
591f3af2d6eSRob Clark 
5925334087eSLoic Poulain static const struct dpu_qos_lut_entry qcm2290_qos_linear[] = {
5935334087eSLoic Poulain 	{.fl = 0, .lut = 0x0011222222335777},
5945334087eSLoic Poulain };
5955334087eSLoic Poulain 
596abda0d92SStephen Boyd static const struct dpu_qos_lut_entry sdm845_qos_macrotile[] = {
59725fdd593SJeykumar Sankaran 	{.fl = 10, .lut = 0x344556677},
59825fdd593SJeykumar Sankaran 	{.fl = 11, .lut = 0x3344556677},
59925fdd593SJeykumar Sankaran 	{.fl = 12, .lut = 0x23344556677},
60025fdd593SJeykumar Sankaran 	{.fl = 13, .lut = 0x223344556677},
60125fdd593SJeykumar Sankaran 	{.fl = 14, .lut = 0x1223344556677},
60225fdd593SJeykumar Sankaran 	{.fl = 0, .lut = 0x112233344556677},
60325fdd593SJeykumar Sankaran };
60425fdd593SJeykumar Sankaran 
6057bdc0c4bSKalyan Thota static const struct dpu_qos_lut_entry sc7180_qos_macrotile[] = {
6067bdc0c4bSKalyan Thota 	{.fl = 0, .lut = 0x0011223344556677},
6077bdc0c4bSKalyan Thota };
6087bdc0c4bSKalyan Thota 
609f3af2d6eSRob Clark static const struct dpu_qos_lut_entry sc8180x_qos_macrotile[] = {
610f3af2d6eSRob Clark 	{.fl = 10, .lut = 0x0000000344556677},
611f3af2d6eSRob Clark };
612f3af2d6eSRob Clark 
61394391a14SAngeloGioacchino Del Regno static const struct dpu_qos_lut_entry msm8998_qos_nrt[] = {
61494391a14SAngeloGioacchino Del Regno 	{.fl = 0, .lut = 0x0},
61594391a14SAngeloGioacchino Del Regno };
61694391a14SAngeloGioacchino Del Regno 
617abda0d92SStephen Boyd static const struct dpu_qos_lut_entry sdm845_qos_nrt[] = {
61825fdd593SJeykumar Sankaran 	{.fl = 0, .lut = 0x0},
61925fdd593SJeykumar Sankaran };
62025fdd593SJeykumar Sankaran 
6217bdc0c4bSKalyan Thota static const struct dpu_qos_lut_entry sc7180_qos_nrt[] = {
6227bdc0c4bSKalyan Thota 	{.fl = 0, .lut = 0x0},
6237bdc0c4bSKalyan Thota };
6247bdc0c4bSKalyan Thota 
62525fdd593SJeykumar Sankaran /*************************************************************
626de7d480fSDmitry Baryshkov  * Hardware catalog
62725fdd593SJeykumar Sankaran  *************************************************************/
62825fdd593SJeykumar Sankaran 
6291c611c48SDmitry Baryshkov #include "catalog/dpu_3_0_msm8998.h"
6301c611c48SDmitry Baryshkov 
631460c410fSDmitry Baryshkov #include "catalog/dpu_4_0_sdm845.h"
632460c410fSDmitry Baryshkov 
63325035306SDmitry Baryshkov #include "catalog/dpu_5_0_sm8150.h"
63497e2c803SDmitry Baryshkov #include "catalog/dpu_5_1_sc8180x.h"
635f3af2d6eSRob Clark 
6362f36168eSDmitry Baryshkov #include "catalog/dpu_6_0_sm8250.h"
637c9cd1552SDmitry Baryshkov #include "catalog/dpu_6_2_sc7180.h"
63801f2e9a7SDmitry Baryshkov #include "catalog/dpu_6_3_sm6115.h"
6393186acbaSKonrad Dybcio #include "catalog/dpu_6_4_sm6350.h"
6405ce22484SDmitry Baryshkov #include "catalog/dpu_6_5_qcm2290.h"
64127f0df03SKonrad Dybcio #include "catalog/dpu_6_9_sm6375.h"
64201f2e9a7SDmitry Baryshkov 
643b8ece0c6SDmitry Baryshkov #include "catalog/dpu_7_0_sm8350.h"
644f0f2c32aSDmitry Baryshkov #include "catalog/dpu_7_2_sc7280.h"
645f0f2c32aSDmitry Baryshkov 
646225978f4SDmitry Baryshkov #include "catalog/dpu_8_0_sc8280xp.h"
6479cc54793SDmitry Baryshkov #include "catalog/dpu_8_1_sm8450.h"
6489cc54793SDmitry Baryshkov 
6499cc54793SDmitry Baryshkov #include "catalog/dpu_9_0_sm8550.h"
650