blob: be44accf09076d8ec422db143e26202a308ef560 [file] [log] [blame]
Dhaval Patel79797b12018-02-13 19:58:05 -08001/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _SDE_HW_CATALOG_H
14#define _SDE_HW_CATALOG_H
15
16#include <linux/kernel.h>
17#include <linux/bug.h>
18#include <linux/bitmap.h>
19#include <linux/err.h>
Alan Kwong67a3f792016-11-01 23:16:53 -040020#include <linux/msm-bus.h>
Dhaval Patel8bf7ff32016-07-20 18:13:24 -070021#include <drm/drmP.h>
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070022
Dhaval Patel8bf7ff32016-07-20 18:13:24 -070023/**
24 * Max hardware block count: For ex: max 12 SSPP pipes or
25 * 5 ctl paths. In all cases, it can have max 12 hardware blocks
26 * based on current design
27 */
28#define MAX_BLOCKS 12
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070029
30#define SDE_HW_VER(MAJOR, MINOR, STEP) (((MAJOR & 0xF) << 28) |\
31 ((MINOR & 0xFFF) << 16) |\
32 (STEP & 0xFFFF))
33
34#define SDE_HW_MAJOR(rev) ((rev) >> 28)
abeykunb85a5e32016-08-24 13:51:40 -040035#define SDE_HW_MINOR(rev) (((rev) >> 16) & 0xFFF)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070036#define SDE_HW_STEP(rev) ((rev) & 0xFFFF)
37#define SDE_HW_MAJOR_MINOR(rev) ((rev) >> 16)
38
39#define IS_SDE_MAJOR_MINOR_SAME(rev1, rev2) \
40 (SDE_HW_MAJOR_MINOR((rev1)) == SDE_HW_MAJOR_MINOR((rev2)))
41
42#define SDE_HW_VER_170 SDE_HW_VER(1, 7, 0) /* 8996 v1.0 */
43#define SDE_HW_VER_171 SDE_HW_VER(1, 7, 1) /* 8996 v2.0 */
44#define SDE_HW_VER_172 SDE_HW_VER(1, 7, 2) /* 8996 v3.0 */
45#define SDE_HW_VER_300 SDE_HW_VER(3, 0, 0) /* 8998 v1.0 */
Lloyd Atkinson274cc462017-02-21 11:52:06 -050046#define SDE_HW_VER_301 SDE_HW_VER(3, 0, 1) /* 8998 v1.1 */
Kyle Yan6a20fae2017-02-14 13:34:41 -080047#define SDE_HW_VER_400 SDE_HW_VER(4, 0, 0) /* sdm845 v1.0 */
Benjamin Chanbeaaf6f2017-09-08 15:25:50 -040048#define SDE_HW_VER_401 SDE_HW_VER(4, 0, 1) /* sdm845 v2.0 */
Jayant Shekhar2b72ce22017-09-12 11:26:44 +053049#define SDE_HW_VER_410 SDE_HW_VER(4, 1, 0) /* sdm670 v1.0 */
abeykunb85a5e32016-08-24 13:51:40 -040050
Benjamin Chanbeaaf6f2017-09-08 15:25:50 -040051#define IS_MSM8996_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_170)
52#define IS_MSM8998_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_300)
Kyle Yan6a20fae2017-02-14 13:34:41 -080053#define IS_SDM845_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_400)
Jayant Shekhar2b72ce22017-09-12 11:26:44 +053054#define IS_SDM670_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_410)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070055
Lloyd Atkinson77158732016-10-23 13:02:00 -040056#define SDE_HW_BLK_NAME_LEN 16
57
Dhaval Patel47302cf2016-08-18 15:04:28 -070058#define MAX_IMG_WIDTH 0x3fff
59#define MAX_IMG_HEIGHT 0x3fff
60
Dhaval Patel44f12472016-08-29 12:19:47 -070061#define CRTC_DUAL_MIXERS 2
62
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -080063#define SDE_COLOR_PROCESS_VER(MAJOR, MINOR) \
64 ((((MAJOR) & 0xFFFF) << 16) | (((MINOR) & 0xFFFF)))
65#define SDE_COLOR_PROCESS_MAJOR(version) (((version) & 0xFFFF0000) >> 16)
66#define SDE_COLOR_PROCESS_MINOR(version) ((version) & 0xFFFF)
67
Clarence Ip7f0de632017-05-31 14:59:14 -040068#define MAX_XIN_COUNT 16
69
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070070/**
Clarence Ip32bcb002017-03-13 12:26:44 -070071 * Supported UBWC feature versions
72 */
73enum {
74 SDE_HW_UBWC_VER_10 = 0x100,
75 SDE_HW_UBWC_VER_20 = 0x200,
76 SDE_HW_UBWC_VER_30 = 0x300,
77};
78
79#define IS_UBWC_20_SUPPORTED(rev) ((rev) >= SDE_HW_UBWC_VER_20)
80
81/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070082 * MDP TOP BLOCK features
83 * @SDE_MDP_PANIC_PER_PIPE Panic configuration needs to be be done per pipe
84 * @SDE_MDP_10BIT_SUPPORT, Chipset supports 10 bit pixel formats
85 * @SDE_MDP_BWC, MDSS HW supports Bandwidth compression.
86 * @SDE_MDP_UBWC_1_0, This chipsets supports Universal Bandwidth
87 * compression initial revision
88 * @SDE_MDP_UBWC_1_5, Universal Bandwidth compression version 1.5
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070089 * @SDE_MDP_MAX Maximum value
90
91 */
92enum {
93 SDE_MDP_PANIC_PER_PIPE = 0x1,
94 SDE_MDP_10BIT_SUPPORT,
95 SDE_MDP_BWC,
96 SDE_MDP_UBWC_1_0,
97 SDE_MDP_UBWC_1_5,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070098 SDE_MDP_MAX
99};
100
101/**
102 * SSPP sub-blocks/features
103 * @SDE_SSPP_SRC Src and fetch part of the pipes,
Clarence Ipe78efb72016-06-24 18:35:21 -0400104 * @SDE_SSPP_SCALER_QSEED2, QSEED2 algorithm support
105 * @SDE_SSPP_SCALER_QSEED3, QSEED3 alogorithm support
106 * @SDE_SSPP_SCALER_RGB, RGB Scaler, supported by RGB pipes
107 * @SDE_SSPP_CSC, Support of Color space converion
abeykun62576142016-08-25 17:44:05 -0400108 * @SDE_SSPP_CSC_10BIT, Support of 10-bit Color space conversion
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800109 * @SDE_SSPP_HSIC, Global HSIC control
110 * @SDE_SSPP_MEMCOLOR Memory Color Support
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700111 * @SDE_SSPP_IGC, Inverse gamma correction
112 * @SDE_SSPP_PCC, Color correction support
113 * @SDE_SSPP_CURSOR, SSPP can be used as a cursor layer
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400114 * @SDE_SSPP_QOS, SSPP support QoS control, danger/safe/creq
Alan Kwongdce56da2017-04-27 15:50:34 -0700115 * @SDE_SSPP_QOS_8LVL, SSPP support 8-level QoS control
Veera Sundaram Sankaran02dd6ac2016-12-22 15:08:29 -0800116 * @SDE_SSPP_EXCL_RECT, SSPP supports exclusion rect
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800117 * @SDE_SSPP_SMART_DMA_V1, SmartDMA 1.0 support
118 * @SDE_SSPP_SMART_DMA_V2, SmartDMA 2.0 support
Alan Kwong4dd64c82017-02-04 18:41:51 -0800119 * @SDE_SSPP_SBUF, SSPP support inline stream buffer
Alan Kwong2349d742017-04-20 08:27:30 -0700120 * @SDE_SSPP_TS_PREFILL Supports prefill with traffic shaper
121 * @SDE_SSPP_TS_PREFILL_REC1 Supports prefill with traffic shaper multirec
Alan Kwong143f50c2017-04-28 07:34:28 -0700122 * @SDE_SSPP_CDP Supports client driven prefetch
Veera Sundaram Sankaran7b121cb2018-03-02 08:43:04 -0800123 * @SDE_SSPP_SEC_UI_ALLOWED Allows secure-ui layers
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700124 * @SDE_SSPP_MAX maximum value
125 */
126enum {
127 SDE_SSPP_SRC = 0x1,
Clarence Ipe78efb72016-06-24 18:35:21 -0400128 SDE_SSPP_SCALER_QSEED2,
129 SDE_SSPP_SCALER_QSEED3,
130 SDE_SSPP_SCALER_RGB,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700131 SDE_SSPP_CSC,
abeykun62576142016-08-25 17:44:05 -0400132 SDE_SSPP_CSC_10BIT,
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800133 SDE_SSPP_HSIC,
134 SDE_SSPP_MEMCOLOR,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700135 SDE_SSPP_IGC,
136 SDE_SSPP_PCC,
137 SDE_SSPP_CURSOR,
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400138 SDE_SSPP_QOS,
Alan Kwongdce56da2017-04-27 15:50:34 -0700139 SDE_SSPP_QOS_8LVL,
Veera Sundaram Sankaran02dd6ac2016-12-22 15:08:29 -0800140 SDE_SSPP_EXCL_RECT,
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800141 SDE_SSPP_SMART_DMA_V1,
142 SDE_SSPP_SMART_DMA_V2,
Alan Kwong4dd64c82017-02-04 18:41:51 -0800143 SDE_SSPP_SBUF,
Alan Kwong2349d742017-04-20 08:27:30 -0700144 SDE_SSPP_TS_PREFILL,
145 SDE_SSPP_TS_PREFILL_REC1,
Alan Kwong143f50c2017-04-28 07:34:28 -0700146 SDE_SSPP_CDP,
Veera Sundaram Sankaran7b121cb2018-03-02 08:43:04 -0800147 SDE_SSPP_SEC_UI_ALLOWED,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700148 SDE_SSPP_MAX
149};
150
151/*
152 * MIXER sub-blocks/features
153 * @SDE_MIXER_LAYER Layer mixer layer blend configuration,
154 * @SDE_MIXER_SOURCESPLIT Layer mixer supports source-split configuration
155 * @SDE_MIXER_GC Gamma correction block
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800156 * @SDE_DIM_LAYER Layer mixer supports dim layer
Jeykumar Sankaran6f215d42017-09-12 16:15:23 -0700157 * @SDE_DISP_PRIMARY_PREF Layer mixer preferred for primary display
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700158 * @SDE_MIXER_MAX maximum value
159 */
160enum {
161 SDE_MIXER_LAYER = 0x1,
162 SDE_MIXER_SOURCESPLIT,
163 SDE_MIXER_GC,
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800164 SDE_DIM_LAYER,
Jeykumar Sankaran6f215d42017-09-12 16:15:23 -0700165 SDE_DISP_PRIMARY_PREF,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700166 SDE_MIXER_MAX
167};
168
169/**
170 * DSPP sub-blocks
171 * @SDE_DSPP_IGC DSPP Inverse gamma correction block
172 * @SDE_DSPP_PCC Panel color correction block
173 * @SDE_DSPP_GC Gamma correction block
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800174 * @SDE_DSPP_HSIC Global HSIC block
175 * @SDE_DSPP_MEMCOLOR Memory Color block
176 * @SDE_DSPP_SIXZONE Six zone block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700177 * @SDE_DSPP_GAMUT Gamut bloc
178 * @SDE_DSPP_DITHER Dither block
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700179 * @SDE_DSPP_HIST Histogram block
180 * @SDE_DSPP_VLUT PA VLUT block
181 * @SDE_DSPP_AD AD block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700182 * @SDE_DSPP_MAX maximum value
183 */
184enum {
185 SDE_DSPP_IGC = 0x1,
186 SDE_DSPP_PCC,
187 SDE_DSPP_GC,
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800188 SDE_DSPP_HSIC,
189 SDE_DSPP_MEMCOLOR,
190 SDE_DSPP_SIXZONE,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700191 SDE_DSPP_GAMUT,
192 SDE_DSPP_DITHER,
193 SDE_DSPP_HIST,
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700194 SDE_DSPP_VLUT,
Gopikrishnaiah Anandan41980b42016-06-21 16:01:33 -0700195 SDE_DSPP_AD,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700196 SDE_DSPP_MAX
197};
198
199/**
200 * PINGPONG sub-blocks
201 * @SDE_PINGPONG_TE Tear check block
202 * @SDE_PINGPONG_TE2 Additional tear check block for split pipes
203 * @SDE_PINGPONG_SPLIT PP block supports split fifo
Clarence Ip8e69ad02016-12-09 09:43:57 -0500204 * @SDE_PINGPONG_SLAVE PP block is a suitable slave for split fifo
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700205 * @SDE_PINGPONG_DSC, Display stream compression blocks
Ping Li8430ee12017-02-24 14:14:44 -0800206 * @SDE_PINGPONG_DITHER, Dither blocks
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700207 * @SDE_PINGPONG_MAX
208 */
209enum {
210 SDE_PINGPONG_TE = 0x1,
211 SDE_PINGPONG_TE2,
212 SDE_PINGPONG_SPLIT,
Clarence Ip8e69ad02016-12-09 09:43:57 -0500213 SDE_PINGPONG_SLAVE,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700214 SDE_PINGPONG_DSC,
Ping Li8430ee12017-02-24 14:14:44 -0800215 SDE_PINGPONG_DITHER,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700216 SDE_PINGPONG_MAX
217};
218
219/**
Lloyd Atkinsoncf8996b2016-08-23 09:34:13 -0400220 * CTL sub-blocks
221 * @SDE_CTL_SPLIT_DISPLAY CTL supports video mode split display
222 * @SDE_CTL_PINGPONG_SPLIT CTL supports pingpong split
Alan Kwong4dd64c82017-02-04 18:41:51 -0800223 * @SDE_CTL_SBUF CTL supports inline stream buffer
Jeykumar Sankaran6f215d42017-09-12 16:15:23 -0700224 * @SDE_CTL_PRIMARY_PREF CTL preferred for primary display
Lloyd Atkinsoncf8996b2016-08-23 09:34:13 -0400225 * @SDE_CTL_MAX
226 */
227enum {
228 SDE_CTL_SPLIT_DISPLAY = 0x1,
229 SDE_CTL_PINGPONG_SPLIT,
Alan Kwong4dd64c82017-02-04 18:41:51 -0800230 SDE_CTL_SBUF,
Jeykumar Sankaran6f215d42017-09-12 16:15:23 -0700231 SDE_CTL_PRIMARY_PREF,
Lloyd Atkinsoncf8996b2016-08-23 09:34:13 -0400232 SDE_CTL_MAX
233};
234
235/**
Alan Kwong4aacd532017-02-04 18:51:33 -0800236 * INTF sub-blocks
237 * @SDE_INTF_ROT_START INTF supports rotator start trigger
238 * @SDE_INTF_MAX
239 */
240enum {
241 SDE_INTF_ROT_START = 0x1,
242 SDE_INTF_MAX
243};
244
245/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700246 * WB sub-blocks and features
247 * @SDE_WB_LINE_MODE Writeback module supports line/linear mode
248 * @SDE_WB_BLOCK_MODE Writeback module supports block mode read
249 * @SDE_WB_ROTATE rotation support,this is available if writeback
250 * supports block mode read
251 * @SDE_WB_CSC Writeback color conversion block support
252 * @SDE_WB_CHROMA_DOWN, Writeback chroma down block,
253 * @SDE_WB_DOWNSCALE, Writeback integer downscaler,
254 * @SDE_WB_DITHER, Dither block
255 * @SDE_WB_TRAFFIC_SHAPER, Writeback traffic shaper bloc
Clarence Ip32bcb002017-03-13 12:26:44 -0700256 * @SDE_WB_UBWC, Writeback Universal bandwidth compression
Alan Kwong3232ca52016-07-29 02:27:47 -0400257 * @SDE_WB_YUV_CONFIG Writeback supports output of YUV colorspace
Alan Kwong9ffcd592016-09-27 07:41:56 -0400258 * @SDE_WB_PIPE_ALPHA Writeback supports pipe alpha
abeykunf1539f72016-08-24 16:08:03 -0400259 * @SDE_WB_XY_ROI_OFFSET Writeback supports x/y-offset of out ROI in
260 * the destination image
Alan Kwongdce56da2017-04-27 15:50:34 -0700261 * @SDE_WB_QOS, Writeback supports QoS control, danger/safe/creq
262 * @SDE_WB_QOS_8LVL, Writeback supports 8-level QoS control
Alan Kwong143f50c2017-04-28 07:34:28 -0700263 * @SDE_WB_CDP Writeback supports client driven prefetch
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700264 * @SDE_WB_MAX maximum value
265 */
266enum {
267 SDE_WB_LINE_MODE = 0x1,
268 SDE_WB_BLOCK_MODE,
269 SDE_WB_ROTATE = SDE_WB_BLOCK_MODE,
270 SDE_WB_CSC,
271 SDE_WB_CHROMA_DOWN,
272 SDE_WB_DOWNSCALE,
273 SDE_WB_DITHER,
274 SDE_WB_TRAFFIC_SHAPER,
Clarence Ip32bcb002017-03-13 12:26:44 -0700275 SDE_WB_UBWC,
Alan Kwong3232ca52016-07-29 02:27:47 -0400276 SDE_WB_YUV_CONFIG,
Alan Kwong9ffcd592016-09-27 07:41:56 -0400277 SDE_WB_PIPE_ALPHA,
abeykunf1539f72016-08-24 16:08:03 -0400278 SDE_WB_XY_ROI_OFFSET,
Alan Kwongdce56da2017-04-27 15:50:34 -0700279 SDE_WB_QOS,
280 SDE_WB_QOS_8LVL,
Alan Kwong143f50c2017-04-28 07:34:28 -0700281 SDE_WB_CDP,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700282 SDE_WB_MAX
283};
284
285/**
Alan Kwong5d324e42016-07-28 22:56:18 -0400286 * VBIF sub-blocks and features
287 * @SDE_VBIF_QOS_OTLIM VBIF supports OT Limit
Alan Kwonga62eeb82017-04-19 08:57:55 -0700288 * @SDE_VBIF_QOS_REMAP VBIF supports QoS priority remap
Alan Kwong5d324e42016-07-28 22:56:18 -0400289 * @SDE_VBIF_MAX maximum value
290 */
291enum {
292 SDE_VBIF_QOS_OTLIM = 0x1,
Alan Kwonga62eeb82017-04-19 08:57:55 -0700293 SDE_VBIF_QOS_REMAP,
Alan Kwong5d324e42016-07-28 22:56:18 -0400294 SDE_VBIF_MAX
295};
296
297/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700298 * MACRO SDE_HW_BLK_INFO - information of HW blocks inside SDE
Lloyd Atkinson77158732016-10-23 13:02:00 -0400299 * @name: string name for debug purposes
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700300 * @id: enum identifying this block
301 * @base: register base offset to mdss
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700302 * @len: length of hardware block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700303 * @features bit mask identifying sub-blocks/features
304 */
305#define SDE_HW_BLK_INFO \
Lloyd Atkinson77158732016-10-23 13:02:00 -0400306 char name[SDE_HW_BLK_NAME_LEN]; \
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700307 u32 id; \
308 u32 base; \
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700309 u32 len; \
310 unsigned long features; \
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700311
312/**
313 * MACRO SDE_HW_SUBBLK_INFO - information of HW sub-block inside SDE
Lloyd Atkinson77158732016-10-23 13:02:00 -0400314 * @name: string name for debug purposes
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700315 * @id: enum identifying this sub-block
316 * @base: offset of this sub-block relative to the block
317 * offset
318 * @len register block length of this sub-block
319 */
320#define SDE_HW_SUBBLK_INFO \
Lloyd Atkinson77158732016-10-23 13:02:00 -0400321 char name[SDE_HW_BLK_NAME_LEN]; \
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700322 u32 id; \
323 u32 base; \
324 u32 len
325
326/**
327 * struct sde_src_blk: SSPP part of the source pipes
328 * @info: HW register and features supported by this sub-blk
329 */
330struct sde_src_blk {
331 SDE_HW_SUBBLK_INFO;
332};
333
334/**
Clarence Ipe78efb72016-06-24 18:35:21 -0400335 * struct sde_scaler_blk: Scaler information
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700336 * @info: HW register and features supported by this sub-blk
abeykun48f407a2016-08-25 12:06:44 -0400337 * @version: qseed block revision
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700338 */
Clarence Ipe78efb72016-06-24 18:35:21 -0400339struct sde_scaler_blk {
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700340 SDE_HW_SUBBLK_INFO;
abeykun48f407a2016-08-25 12:06:44 -0400341 u32 version;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700342};
343
344struct sde_csc_blk {
345 SDE_HW_SUBBLK_INFO;
346};
347
348/**
349 * struct sde_pp_blk : Pixel processing sub-blk information
350 * @info: HW register and features supported by this sub-blk
351 * @version: HW Algorithm version
352 */
353struct sde_pp_blk {
354 SDE_HW_SUBBLK_INFO;
355 u32 version;
356};
357
358/**
Clarence Ipea3d6262016-07-15 16:20:11 -0400359 * struct sde_format_extended - define sde specific pixel format+modifier
360 * @fourcc_format: Base FOURCC pixel format code
361 * @modifier: 64-bit drm format modifier, same modifier must be applied to all
362 * framebuffer planes
363 */
364struct sde_format_extended {
365 uint32_t fourcc_format;
366 uint64_t modifier;
367};
368
369/**
Alan Kwongdce56da2017-04-27 15:50:34 -0700370 * enum sde_qos_lut_usage - define QoS LUT use cases
371 */
372enum sde_qos_lut_usage {
373 SDE_QOS_LUT_USAGE_LINEAR,
374 SDE_QOS_LUT_USAGE_MACROTILE,
375 SDE_QOS_LUT_USAGE_NRT,
376 SDE_QOS_LUT_USAGE_CWB,
377 SDE_QOS_LUT_USAGE_MAX,
378};
379
380/**
381 * struct sde_qos_lut_entry - define QoS LUT table entry
382 * @fl: fill level, or zero on last entry to indicate default lut
383 * @lut: lut to use if equal to or less than fill level
384 */
385struct sde_qos_lut_entry {
386 u32 fl;
387 u64 lut;
388};
389
390/**
391 * struct sde_qos_lut_tbl - define QoS LUT table
392 * @nentry: number of entry in this table
393 * @entries: Pointer to table entries
394 */
395struct sde_qos_lut_tbl {
396 u32 nentry;
397 struct sde_qos_lut_entry *entries;
398};
399
400/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700401 * struct sde_sspp_sub_blks : SSPP sub-blocks
402 * @maxdwnscale: max downscale ratio supported(without DECIMATION)
403 * @maxupscale: maxupscale ratio supported
404 * @maxwidth: max pixelwidth supported by this pipe
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400405 * @creq_vblank: creq priority during vertical blanking
406 * @danger_vblank: danger priority during vertical blanking
407 * @pixel_ram_size: size of latency hiding and de-tiling buffer in bytes
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800408 * @smart_dma_priority: hw priority of rect1 of multirect pipe
Steve Cohen57428172017-07-18 10:57:17 -0400409 * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700410 * @src_blk:
Clarence Ipe78efb72016-06-24 18:35:21 -0400411 * @scaler_blk:
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700412 * @csc_blk:
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800413 * @hsic:
414 * @memcolor:
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700415 * @pcc_blk:
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800416 * @igc_blk:
Clarence Ipea3d6262016-07-15 16:20:11 -0400417 * @format_list: Pointer to list of supported formats
Steve Cohen57428172017-07-18 10:57:17 -0400418 * @virt_format_list: Pointer to list of supported formats for virtual planes
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700419 */
420struct sde_sspp_sub_blks {
421 u32 maxlinewidth;
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400422 u32 creq_vblank;
423 u32 danger_vblank;
424 u32 pixel_ram_size;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700425 u32 maxdwnscale;
426 u32 maxupscale;
Clarence Ip5e2a9222016-06-26 22:38:24 -0400427 u32 maxhdeciexp; /* max decimation is 2^value */
428 u32 maxvdeciexp; /* max decimation is 2^value */
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800429 u32 smart_dma_priority;
Alan Kwong6259a382017-04-04 06:18:02 -0700430 u32 max_per_pipe_bw;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700431 struct sde_src_blk src_blk;
Clarence Ipe78efb72016-06-24 18:35:21 -0400432 struct sde_scaler_blk scaler_blk;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700433 struct sde_pp_blk csc_blk;
Benet Clark37809e62016-10-24 10:14:00 -0700434 struct sde_pp_blk hsic_blk;
435 struct sde_pp_blk memcolor_blk;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700436 struct sde_pp_blk pcc_blk;
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800437 struct sde_pp_blk igc_blk;
Clarence Ipea3d6262016-07-15 16:20:11 -0400438
439 const struct sde_format_extended *format_list;
Steve Cohen57428172017-07-18 10:57:17 -0400440 const struct sde_format_extended *virt_format_list;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700441};
442
443/**
444 * struct sde_lm_sub_blks: information of mixer block
445 * @maxwidth: Max pixel width supported by this mixer
446 * @maxblendstages: Max number of blend-stages supported
447 * @blendstage_base: Blend-stage register base offset
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800448 * @gc: gamma correction block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700449 */
450struct sde_lm_sub_blks {
451 u32 maxwidth;
452 u32 maxblendstages;
453 u32 blendstage_base[MAX_BLOCKS];
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800454 struct sde_pp_blk gc;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700455};
456
457struct sde_dspp_sub_blks {
458 struct sde_pp_blk igc;
459 struct sde_pp_blk pcc;
460 struct sde_pp_blk gc;
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800461 struct sde_pp_blk hsic;
462 struct sde_pp_blk memcolor;
463 struct sde_pp_blk sixzone;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700464 struct sde_pp_blk gamut;
465 struct sde_pp_blk dither;
466 struct sde_pp_blk hist;
Gopikrishnaiah Anandan41980b42016-06-21 16:01:33 -0700467 struct sde_pp_blk ad;
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700468 struct sde_pp_blk vlut;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700469};
470
471struct sde_pingpong_sub_blks {
472 struct sde_pp_blk te;
473 struct sde_pp_blk te2;
474 struct sde_pp_blk dsc;
Ping Li8430ee12017-02-24 14:14:44 -0800475 struct sde_pp_blk dither;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700476};
477
478struct sde_wb_sub_blocks {
479 u32 maxlinewidth;
480};
481
Ben Chan78647cd2016-06-26 22:02:47 -0400482struct sde_mdss_base_cfg {
483 SDE_HW_BLK_INFO;
484};
485
Alan Kwong5d324e42016-07-28 22:56:18 -0400486/**
487 * sde_clk_ctrl_type - Defines top level clock control signals
488 */
489enum sde_clk_ctrl_type {
490 SDE_CLK_CTRL_NONE,
491 SDE_CLK_CTRL_VIG0,
492 SDE_CLK_CTRL_VIG1,
493 SDE_CLK_CTRL_VIG2,
494 SDE_CLK_CTRL_VIG3,
495 SDE_CLK_CTRL_VIG4,
496 SDE_CLK_CTRL_RGB0,
497 SDE_CLK_CTRL_RGB1,
498 SDE_CLK_CTRL_RGB2,
499 SDE_CLK_CTRL_RGB3,
500 SDE_CLK_CTRL_DMA0,
501 SDE_CLK_CTRL_DMA1,
502 SDE_CLK_CTRL_CURSOR0,
503 SDE_CLK_CTRL_CURSOR1,
504 SDE_CLK_CTRL_WB0,
505 SDE_CLK_CTRL_WB1,
506 SDE_CLK_CTRL_WB2,
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700507 SDE_CLK_CTRL_INLINE_ROT0_SSPP,
508 SDE_CLK_CTRL_INLINE_ROT0_WB,
Alan Kwong5d324e42016-07-28 22:56:18 -0400509 SDE_CLK_CTRL_MAX,
510};
511
512/* struct sde_clk_ctrl_reg : Clock control register
513 * @reg_off: register offset
514 * @bit_off: bit offset
515 */
516struct sde_clk_ctrl_reg {
517 u32 reg_off;
518 u32 bit_off;
519};
520
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700521/* struct sde_mdp_cfg : MDP TOP-BLK instance info
522 * @id: index identifying this block
523 * @base: register base offset to mdss
524 * @features bit mask identifying sub-blocks/features
525 * @highest_bank_bit: UBWC parameter
Clarence Ip32bcb002017-03-13 12:26:44 -0700526 * @ubwc_static: ubwc static configuration
527 * @ubwc_swizzle: ubwc default swizzle setting
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530528 * @has_dest_scaler: indicates support of destination scaler
Sravanthi Kollukuduru15421d82017-10-26 12:05:04 +0530529 * @smart_panel_align_mode: split display smart panel align modes
Alan Kwong5d324e42016-07-28 22:56:18 -0400530 * @clk_ctrls clock control register definition
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700531 */
532struct sde_mdp_cfg {
533 SDE_HW_BLK_INFO;
534 u32 highest_bank_bit;
Clarence Ip32bcb002017-03-13 12:26:44 -0700535 u32 ubwc_static;
536 u32 ubwc_swizzle;
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530537 bool has_dest_scaler;
Sravanthi Kollukuduru15421d82017-10-26 12:05:04 +0530538 u32 smart_panel_align_mode;
Alan Kwong5d324e42016-07-28 22:56:18 -0400539 struct sde_clk_ctrl_reg clk_ctrls[SDE_CLK_CTRL_MAX];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700540};
541
542/* struct sde_mdp_cfg : MDP TOP-BLK instance info
543 * @id: index identifying this block
544 * @base: register base offset to mdss
545 * @features bit mask identifying sub-blocks/features
546 */
547struct sde_ctl_cfg {
548 SDE_HW_BLK_INFO;
549};
550
551/**
552 * struct sde_sspp_cfg - information of source pipes
553 * @id: index identifying this block
554 * @base register offset of this block
555 * @features bit mask identifying sub-blocks/features
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400556 * @sblk: SSPP sub-blocks information
Alan Kwong5d324e42016-07-28 22:56:18 -0400557 * @xin_id: bus client identifier
558 * @clk_ctrl clock control identifier
abeykunf35ff332016-12-20 13:06:09 -0500559 * @type sspp type identifier
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700560 */
561struct sde_sspp_cfg {
562 SDE_HW_BLK_INFO;
563 const struct sde_sspp_sub_blks *sblk;
Alan Kwong5d324e42016-07-28 22:56:18 -0400564 u32 xin_id;
565 enum sde_clk_ctrl_type clk_ctrl;
abeykunf35ff332016-12-20 13:06:09 -0500566 u32 type;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700567};
568
569/**
570 * struct sde_lm_cfg - information of layer mixer blocks
571 * @id: index identifying this block
572 * @base register offset of this block
573 * @features bit mask identifying sub-blocks/features
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400574 * @sblk: LM Sub-blocks information
575 * @dspp: ID of connected DSPP, DSPP_MAX if unsupported
576 * @pingpong: ID of connected PingPong, PINGPONG_MAX if unsupported
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530577 * @ds: ID of connected DS, DS_MAX if unsupported
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400578 * @lm_pair_mask: Bitmask of LMs that can be controlled by same CTL
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700579 */
580struct sde_lm_cfg {
581 SDE_HW_BLK_INFO;
582 const struct sde_lm_sub_blks *sblk;
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400583 u32 dspp;
584 u32 pingpong;
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530585 u32 ds;
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400586 unsigned long lm_pair_mask;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700587};
588
589/**
Rajesh Yadavec93afb2017-06-08 19:28:33 +0530590 * struct sde_dspp_cfg - information of DSPP top block
591 * @id enum identifying this block
592 * @base register offset of this block
593 * @features bit mask identifying sub-blocks/features
594 * supported by this block
595 */
596struct sde_dspp_top_cfg {
597 SDE_HW_BLK_INFO;
598};
599
600/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700601 * struct sde_dspp_cfg - information of DSPP blocks
602 * @id enum identifying this block
603 * @base register offset of this block
604 * @features bit mask identifying sub-blocks/features
605 * supported by this block
606 * @sblk sub-blocks information
607 */
608struct sde_dspp_cfg {
609 SDE_HW_BLK_INFO;
610 const struct sde_dspp_sub_blks *sblk;
611};
612
613/**
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530614 * struct sde_ds_top_cfg - information of dest scaler top
615 * @id enum identifying this block
616 * @base register offset of this block
617 * @features bit mask identifying features
618 * @version hw version of dest scaler
619 * @maxinputwidth maximum input line width
620 * @maxoutputwidth maximum output line width
621 * @maxupscale maximum upscale ratio
622 */
623struct sde_ds_top_cfg {
624 SDE_HW_BLK_INFO;
625 u32 version;
626 u32 maxinputwidth;
627 u32 maxoutputwidth;
628 u32 maxupscale;
629};
630
631/**
632 * struct sde_ds_cfg - information of dest scaler blocks
633 * @id enum identifying this block
634 * @base register offset wrt DS top offset
635 * @features bit mask identifying features
636 * @version hw version of the qseed block
637 * @top DS top information
638 */
639struct sde_ds_cfg {
640 SDE_HW_BLK_INFO;
641 u32 version;
642 const struct sde_ds_top_cfg *top;
643};
644
645/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700646 * struct sde_pingpong_cfg - information of PING-PONG blocks
647 * @id enum identifying this block
648 * @base register offset of this block
649 * @features bit mask identifying sub-blocks/features
650 * @sblk sub-blocks information
651 */
652struct sde_pingpong_cfg {
653 SDE_HW_BLK_INFO;
654 const struct sde_pingpong_sub_blks *sblk;
655};
656
657/**
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800658 * struct sde_dsc_cfg - information of DSC blocks
659 * @id enum identifying this block
660 * @base register offset of this block
661 * @features bit mask identifying sub-blocks/features
662 */
663struct sde_dsc_cfg {
664 SDE_HW_BLK_INFO;
665};
666
667/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700668 * struct sde_cdm_cfg - information of chroma down blocks
669 * @id enum identifying this block
670 * @base register offset of this block
671 * @features bit mask identifying sub-blocks/features
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400672 * @intf_connect Bitmask of INTF IDs this CDM can connect to
673 * @wb_connect: Bitmask of Writeback IDs this CDM can connect to
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700674 */
675struct sde_cdm_cfg {
676 SDE_HW_BLK_INFO;
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400677 unsigned long intf_connect;
678 unsigned long wb_connect;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700679};
680
681/**
682 * struct sde_intf_cfg - information of timing engine blocks
683 * @id enum identifying this block
684 * @base register offset of this block
685 * @features bit mask identifying sub-blocks/features
686 * @type: Interface type(DSI, DP, HDMI)
Lloyd Atkinson2d4e7662015-11-05 15:52:07 -0500687 * @controller_id: Controller Instance ID in case of multiple of intf type
Lloyd Atkinsonf30546e2016-06-26 10:08:25 -0400688 * @prog_fetch_lines_worst_case Worst case latency num lines needed to prefetch
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700689 */
690struct sde_intf_cfg {
691 SDE_HW_BLK_INFO;
692 u32 type; /* interface type*/
Lloyd Atkinson2d4e7662015-11-05 15:52:07 -0500693 u32 controller_id;
Lloyd Atkinsonf30546e2016-06-26 10:08:25 -0400694 u32 prog_fetch_lines_worst_case;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700695};
696
697/**
698 * struct sde_wb_cfg - information of writeback blocks
699 * @id enum identifying this block
700 * @base register offset of this block
701 * @features bit mask identifying sub-blocks/features
Alan Kwongbb27c092016-07-20 16:41:25 -0400702 * @sblk sub-block information
703 * @format_list: Pointer to list of supported formats
Alan Kwong5d324e42016-07-28 22:56:18 -0400704 * @vbif_idx vbif identifier
705 * @xin_id client interface identifier
706 * @clk_ctrl clock control identifier
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700707 */
708struct sde_wb_cfg {
709 SDE_HW_BLK_INFO;
Alan Kwongbb27c092016-07-20 16:41:25 -0400710 const struct sde_wb_sub_blocks *sblk;
711 const struct sde_format_extended *format_list;
Alan Kwong5d324e42016-07-28 22:56:18 -0400712 u32 vbif_idx;
713 u32 xin_id;
714 enum sde_clk_ctrl_type clk_ctrl;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700715};
716
717/**
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700718 * struct sde_rot_vbif_cfg - inline rotator vbif configs
719 * @xin_id xin client id
720 * @num enum identifying this block
721 * @is_read indicates read/write client
722 * @clk_ctrl index to clk control
723 */
724struct sde_rot_vbif_cfg {
725 u32 xin_id;
726 u32 num;
727 bool is_read;
728 enum sde_clk_ctrl_type clk_ctrl;
729};
730
731/**
Alan Kwong4dd64c82017-02-04 18:41:51 -0800732 * struct sde_rot_cfg - information of rotator blocks
733 * @id enum identifying this block
734 * @base register offset of this block
735 * @len length of hardware block
736 * @features bit mask identifying sub-blocks/features
737 * @pdev private device handle
738 * @scid subcache identifier
739 * @slice_size subcache slice size
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700740 * @vbif_idx vbif identifier
741 * @xin_count number of xin clients
742 * @vbif_cfg vbif settings related to rotator
Alan Kwong4dd64c82017-02-04 18:41:51 -0800743 */
744struct sde_rot_cfg {
745 SDE_HW_BLK_INFO;
746 void *pdev;
747 int scid;
748 size_t slice_size;
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700749 u32 vbif_idx;
750
751 u32 xin_count;
752 struct sde_rot_vbif_cfg vbif_cfg[MAX_BLOCKS];
Alan Kwong4dd64c82017-02-04 18:41:51 -0800753};
754
755/**
Alan Kwong5d324e42016-07-28 22:56:18 -0400756 * struct sde_vbif_dynamic_ot_cfg - dynamic OT setting
757 * @pps pixel per seconds
758 * @ot_limit OT limit to use up to specified pixel per second
759 */
760struct sde_vbif_dynamic_ot_cfg {
761 u64 pps;
762 u32 ot_limit;
763};
764
765/**
766 * struct sde_vbif_dynamic_ot_tbl - dynamic OT setting table
767 * @count length of cfg
768 * @cfg pointer to array of configuration settings with
769 * ascending requirements
770 */
771struct sde_vbif_dynamic_ot_tbl {
772 u32 count;
Alan Kwongb9d2f6f2016-10-12 00:27:07 -0400773 struct sde_vbif_dynamic_ot_cfg *cfg;
Alan Kwong5d324e42016-07-28 22:56:18 -0400774};
775
776/**
Alan Kwonga62eeb82017-04-19 08:57:55 -0700777 * struct sde_vbif_qos_tbl - QoS priority table
778 * @npriority_lvl num of priority level
779 * @priority_lvl pointer to array of priority level in ascending order
780 */
781struct sde_vbif_qos_tbl {
782 u32 npriority_lvl;
783 u32 *priority_lvl;
784};
785
786/**
Alan Kwong5d324e42016-07-28 22:56:18 -0400787 * struct sde_vbif_cfg - information of VBIF blocks
788 * @id enum identifying this block
789 * @base register offset of this block
790 * @features bit mask identifying sub-blocks/features
791 * @ot_rd_limit default OT read limit
792 * @ot_wr_limit default OT write limit
793 * @xin_halt_timeout maximum time (in usec) for xin to halt
794 * @dynamic_ot_rd_tbl dynamic OT read configuration table
795 * @dynamic_ot_wr_tbl dynamic OT write configuration table
Alan Kwonga62eeb82017-04-19 08:57:55 -0700796 * @qos_rt_tbl real-time QoS priority table
797 * @qos_nrt_tbl non-real-time QoS priority table
Clarence Ip7f0de632017-05-31 14:59:14 -0400798 * @memtype_count number of defined memtypes
799 * @memtype array of xin memtype definitions
Alan Kwong5d324e42016-07-28 22:56:18 -0400800 */
801struct sde_vbif_cfg {
802 SDE_HW_BLK_INFO;
803 u32 default_ot_rd_limit;
804 u32 default_ot_wr_limit;
805 u32 xin_halt_timeout;
806 struct sde_vbif_dynamic_ot_tbl dynamic_ot_rd_tbl;
807 struct sde_vbif_dynamic_ot_tbl dynamic_ot_wr_tbl;
Alan Kwonga62eeb82017-04-19 08:57:55 -0700808 struct sde_vbif_qos_tbl qos_rt_tbl;
809 struct sde_vbif_qos_tbl qos_nrt_tbl;
Clarence Ip7f0de632017-05-31 14:59:14 -0400810 u32 memtype_count;
811 u32 memtype[MAX_XIN_COUNT];
Alan Kwong5d324e42016-07-28 22:56:18 -0400812};
Gopikrishnaiah Anandan031d8ff2016-12-15 16:58:45 -0800813/**
814 * struct sde_reg_dma_cfg - information of lut dma blocks
815 * @id enum identifying this block
816 * @base register offset of this block
817 * @features bit mask identifying sub-blocks/features
818 * @version version of lutdma hw block
819 * @trigger_sel_off offset to trigger select registers of lutdma
820 */
821struct sde_reg_dma_cfg {
822 SDE_HW_BLK_INFO;
823 u32 version;
824 u32 trigger_sel_off;
825};
Alan Kwong5d324e42016-07-28 22:56:18 -0400826
827/**
Alan Kwong143f50c2017-04-28 07:34:28 -0700828 * Define CDP use cases
829 * @SDE_PERF_CDP_UDAGE_RT: real-time use cases
830 * @SDE_PERF_CDP_USAGE_NRT: non real-time use cases such as WFD
831 */
832enum {
833 SDE_PERF_CDP_USAGE_RT,
834 SDE_PERF_CDP_USAGE_NRT,
835 SDE_PERF_CDP_USAGE_MAX
836};
837
838/**
839 * struct sde_perf_cdp_cfg - define CDP use case configuration
840 * @rd_enable: true if read pipe CDP is enabled
841 * @wr_enable: true if write pipe CDP is enabled
842 */
843struct sde_perf_cdp_cfg {
844 bool rd_enable;
845 bool wr_enable;
846};
847
848/**
Alan Kwong9aa061c2016-11-06 21:17:12 -0500849 * struct sde_perf_cfg - performance control settings
850 * @max_bw_low low threshold of maximum bandwidth (kbps)
851 * @max_bw_high high threshold of maximum bandwidth (kbps)
Narendra Muppallaa50934b2017-08-15 19:43:37 -0700852 * @min_core_ib minimum bandwidth for core (kbps)
853 * @min_core_ib minimum mnoc ib vote in kbps
854 * @min_llcc_ib minimum llcc ib vote in kbps
855 * @min_dram_ib minimum dram ib vote in kbps
Alan Kwong6259a382017-04-04 06:18:02 -0700856 * @core_ib_ff core instantaneous bandwidth fudge factor
857 * @core_clk_ff core clock fudge factor
858 * @comp_ratio_rt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
859 * @comp_ratio_nrt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
860 * @undersized_prefill_lines undersized prefill in lines
861 * @xtra_prefill_lines extra prefill latency in lines
862 * @dest_scale_prefill_lines destination scaler latency in lines
863 * @macrotile_perfill_lines macrotile latency in lines
864 * @yuv_nv12_prefill_lines yuv_nv12 latency in lines
865 * @linear_prefill_lines linear latency in lines
866 * @downscaling_prefill_lines downscaling latency in lines
867 * @amortizable_theshold minimum y position for traffic shaping prefill
868 * @min_prefill_lines minimum pipeline latency in lines
Alan Kwongdce56da2017-04-27 15:50:34 -0700869 * @danger_lut_tbl: LUT tables for danger signals
Ingrid Gallardo3b720fc2017-10-06 17:23:55 -0700870 * @sfe_lut_tbl: LUT tables for safe signals
Alan Kwongdce56da2017-04-27 15:50:34 -0700871 * @qos_lut_tbl: LUT tables for QoS signals
Alan Kwong143f50c2017-04-28 07:34:28 -0700872 * @cdp_cfg cdp use case configurations
Lloyd Atkinson1fb32ea2017-10-10 17:10:28 -0400873 * @cpu_mask: pm_qos cpu mask value
874 * @cpu_dma_latency: pm_qos cpu dma latency value
Alan Kwong9aa061c2016-11-06 21:17:12 -0500875 */
876struct sde_perf_cfg {
877 u32 max_bw_low;
878 u32 max_bw_high;
Narendra Muppallaa50934b2017-08-15 19:43:37 -0700879 u32 min_core_ib;
880 u32 min_llcc_ib;
881 u32 min_dram_ib;
Alan Kwong6259a382017-04-04 06:18:02 -0700882 const char *core_ib_ff;
883 const char *core_clk_ff;
884 const char *comp_ratio_rt;
885 const char *comp_ratio_nrt;
886 u32 undersized_prefill_lines;
887 u32 xtra_prefill_lines;
888 u32 dest_scale_prefill_lines;
889 u32 macrotile_prefill_lines;
890 u32 yuv_nv12_prefill_lines;
891 u32 linear_prefill_lines;
892 u32 downscaling_prefill_lines;
893 u32 amortizable_threshold;
894 u32 min_prefill_lines;
Alan Kwongdce56da2017-04-27 15:50:34 -0700895 u32 danger_lut_tbl[SDE_QOS_LUT_USAGE_MAX];
Ingrid Gallardo3b720fc2017-10-06 17:23:55 -0700896 struct sde_qos_lut_tbl sfe_lut_tbl[SDE_QOS_LUT_USAGE_MAX];
Alan Kwongdce56da2017-04-27 15:50:34 -0700897 struct sde_qos_lut_tbl qos_lut_tbl[SDE_QOS_LUT_USAGE_MAX];
Alan Kwong143f50c2017-04-28 07:34:28 -0700898 struct sde_perf_cdp_cfg cdp_cfg[SDE_PERF_CDP_USAGE_MAX];
Lloyd Atkinson1fb32ea2017-10-10 17:10:28 -0400899 u32 cpu_mask;
900 u32 cpu_dma_latency;
Alan Kwong9aa061c2016-11-06 21:17:12 -0500901};
902
903/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700904 * struct sde_mdss_cfg - information of MDSS HW
905 * This is the main catalog data structure representing
906 * this HW version. Contains number of instances,
907 * register offsets, capabilities of the all MDSS HW sub-blocks.
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700908 *
909 * @max_sspp_linewidth max source pipe line width support.
910 * @max_mixer_width max layer mixer line width support.
911 * @max_mixer_blendstages max layer mixer blend stages or
912 * supported z order
913 * @max_wb_linewidth max writeback line width support.
Dhaval Patel79797b12018-02-13 19:58:05 -0800914 * @max_display_width maximum display width support.
915 * @max_display_height maximum display height support.
916 * @max_lm_per_display maximum layer mixer per display
917 * @min_display_width minimum display width support.
918 * @min_display_height minimum display height support.
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700919 * @qseed_type qseed2 or qseed3 support.
Dhaval Patel5aad7452017-01-12 09:59:31 -0800920 * @csc_type csc or csc_10bit support.
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800921 * @smart_dma_rev Supported version of SmartDMA feature.
Dhaval Patel1964fb92016-10-13 19:28:08 -0700922 * @has_src_split source split feature status
Alan Kwong143f50c2017-04-28 07:34:28 -0700923 * @has_cdp Client driven prefetch feature status
Clarence Ip32bcb002017-03-13 12:26:44 -0700924 * @has_wb_ubwc UBWC feature supported on WB
925 * @ubwc_version UBWC feature version (0x0 for not supported)
Alan Kwong4dd64c82017-02-04 18:41:51 -0800926 * @has_sbuf indicate if stream buffer is available
927 * @sbuf_headroom stream buffer headroom in lines
Clarence Ip8dece622017-12-22 18:25:25 -0500928 * @sbuf_prefill stream buffer prefill default in lines
Veera Sundaram Sankaranc9efbec2017-03-29 18:59:05 -0700929 * @has_idle_pc indicate if idle power collapse feature is supported
Srikanth Rajagopalan203b2782017-07-05 22:08:52 -0700930 * @has_hdr HDR feature support
abeykunf35ff332016-12-20 13:06:09 -0500931 * @dma_formats Supported formats for dma pipe
932 * @cursor_formats Supported formats for cursor pipe
933 * @vig_formats Supported formats for vig pipe
934 * @wb_formats Supported formats for wb
Alan Kwonga62eeb82017-04-19 08:57:55 -0700935 * @vbif_qos_nlvl number of vbif QoS priority level
Alan Kwong2349d742017-04-20 08:27:30 -0700936 * @ts_prefill_rev prefill traffic shaper feature revision
Veera Sundaram Sankaran61e4fba2018-02-27 17:59:22 -0800937 * @sui_misr_supported indicate if secure-ui-misr is supported
Veera Sundaram Sankaran7b121cb2018-03-02 08:43:04 -0800938 * @sui_allow_xin_mask mask of all the xin-clients allowed during secure-ui
939 * when secure-ui-misr feature is supported
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700940 */
941struct sde_mdss_cfg {
942 u32 hwversion;
943
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700944 u32 max_sspp_linewidth;
945 u32 max_mixer_width;
946 u32 max_mixer_blendstages;
947 u32 max_wb_linewidth;
Dhaval Patel79797b12018-02-13 19:58:05 -0800948
949 u32 max_display_width;
950 u32 max_display_height;
951 u32 min_display_width;
952 u32 min_display_height;
953 u32 max_lm_per_display;
954
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700955 u32 qseed_type;
Dhaval Patel5aad7452017-01-12 09:59:31 -0800956 u32 csc_type;
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800957 u32 smart_dma_rev;
Dhaval Patel1964fb92016-10-13 19:28:08 -0700958 bool has_src_split;
959 bool has_cdp;
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800960 bool has_dim_layer;
Clarence Ip32bcb002017-03-13 12:26:44 -0700961 bool has_wb_ubwc;
962 u32 ubwc_version;
Alan Kwong4dd64c82017-02-04 18:41:51 -0800963 bool has_sbuf;
964 u32 sbuf_headroom;
Clarence Ip8dece622017-12-22 18:25:25 -0500965 u32 sbuf_prefill;
Veera Sundaram Sankaranc9efbec2017-03-29 18:59:05 -0700966 bool has_idle_pc;
Alan Kwonga62eeb82017-04-19 08:57:55 -0700967 u32 vbif_qos_nlvl;
Alan Kwong2349d742017-04-20 08:27:30 -0700968 u32 ts_prefill_rev;
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700969
Veera Sundaram Sankaran61e4fba2018-02-27 17:59:22 -0800970 bool sui_misr_supported;
Veera Sundaram Sankaran7b121cb2018-03-02 08:43:04 -0800971 u32 sui_allow_xin_mask;
Veera Sundaram Sankaran61e4fba2018-02-27 17:59:22 -0800972
Srikanth Rajagopalan203b2782017-07-05 22:08:52 -0700973 bool has_hdr;
Ben Chan78647cd2016-06-26 22:02:47 -0400974 u32 mdss_count;
975 struct sde_mdss_base_cfg mdss[MAX_BLOCKS];
976
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700977 u32 mdp_count;
978 struct sde_mdp_cfg mdp[MAX_BLOCKS];
979
980 u32 ctl_count;
981 struct sde_ctl_cfg ctl[MAX_BLOCKS];
982
983 u32 sspp_count;
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700984 struct sde_sspp_cfg sspp[MAX_BLOCKS];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700985
986 u32 mixer_count;
987 struct sde_lm_cfg mixer[MAX_BLOCKS];
988
Rajesh Yadavec93afb2017-06-08 19:28:33 +0530989 struct sde_dspp_top_cfg dspp_top;
990
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700991 u32 dspp_count;
992 struct sde_dspp_cfg dspp[MAX_BLOCKS];
993
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530994 u32 ds_count;
995 struct sde_ds_cfg ds[MAX_BLOCKS];
996
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700997 u32 pingpong_count;
998 struct sde_pingpong_cfg pingpong[MAX_BLOCKS];
999
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -08001000 u32 dsc_count;
1001 struct sde_dsc_cfg dsc[MAX_BLOCKS];
1002
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001003 u32 cdm_count;
1004 struct sde_cdm_cfg cdm[MAX_BLOCKS];
1005
1006 u32 intf_count;
1007 struct sde_intf_cfg intf[MAX_BLOCKS];
1008
1009 u32 wb_count;
1010 struct sde_wb_cfg wb[MAX_BLOCKS];
1011
Alan Kwong4dd64c82017-02-04 18:41:51 -08001012 u32 rot_count;
1013 struct sde_rot_cfg rot[MAX_BLOCKS];
1014
Alan Kwong5d324e42016-07-28 22:56:18 -04001015 u32 vbif_count;
1016 struct sde_vbif_cfg vbif[MAX_BLOCKS];
Gopikrishnaiah Anandan031d8ff2016-12-15 16:58:45 -08001017
1018 u32 reg_dma_count;
1019 struct sde_reg_dma_cfg dma_cfg;
Gopikrishnaiah Anandan9ba43782017-01-31 18:23:08 -08001020
1021 u32 ad_count;
1022
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001023 /* Add additional block data structures here */
Alan Kwong9aa061c2016-11-06 21:17:12 -05001024
1025 struct sde_perf_cfg perf;
abeykunf35ff332016-12-20 13:06:09 -05001026 struct sde_format_extended *dma_formats;
1027 struct sde_format_extended *cursor_formats;
1028 struct sde_format_extended *vig_formats;
1029 struct sde_format_extended *wb_formats;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001030};
1031
1032struct sde_mdss_hw_cfg_handler {
1033 u32 major;
1034 u32 minor;
1035 struct sde_mdss_cfg* (*cfg_init)(u32);
1036};
1037
1038/*
1039 * Access Macros
1040 */
1041#define BLK_MDP(s) ((s)->mdp)
1042#define BLK_CTL(s) ((s)->ctl)
1043#define BLK_VIG(s) ((s)->vig)
1044#define BLK_RGB(s) ((s)->rgb)
1045#define BLK_DMA(s) ((s)->dma)
1046#define BLK_CURSOR(s) ((s)->cursor)
1047#define BLK_MIXER(s) ((s)->mixer)
1048#define BLK_DSPP(s) ((s)->dspp)
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +05301049#define BLK_DS(s) ((s)->ds)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001050#define BLK_PINGPONG(s) ((s)->pingpong)
1051#define BLK_CDM(s) ((s)->cdm)
1052#define BLK_INTF(s) ((s)->intf)
1053#define BLK_WB(s) ((s)->wb)
1054#define BLK_AD(s) ((s)->ad)
1055
Dhaval Patel8bf7ff32016-07-20 18:13:24 -07001056/**
Clarence Ip17162b52016-11-24 17:06:29 -05001057 * sde_hw_catalog_init - sde hardware catalog init API parses dtsi property
Dhaval Patel8bf7ff32016-07-20 18:13:24 -07001058 * and stores all parsed offset, hardware capabilities in config structure.
1059 * @dev: drm device node.
1060 * @hw_rev: caller needs provide the hardware revision before parsing.
1061 *
1062 * Return: parsed sde config structure
1063 */
1064struct sde_mdss_cfg *sde_hw_catalog_init(struct drm_device *dev, u32 hw_rev);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001065
Clarence Ip17162b52016-11-24 17:06:29 -05001066/**
1067 * sde_hw_catalog_deinit - sde hardware catalog cleanup
1068 * @sde_cfg: pointer returned from init function
1069 */
1070void sde_hw_catalog_deinit(struct sde_mdss_cfg *sde_cfg);
1071
Jeykumar Sankaran2e655032017-02-04 14:05:45 -08001072/**
1073 * sde_hw_sspp_multirect_enabled - check multirect enabled for the sspp
1074 * @cfg: pointer to sspp cfg
1075 */
1076static inline bool sde_hw_sspp_multirect_enabled(const struct sde_sspp_cfg *cfg)
1077{
1078 return test_bit(SDE_SSPP_SMART_DMA_V1, &cfg->features) ||
1079 test_bit(SDE_SSPP_SMART_DMA_V2, &cfg->features);
1080}
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001081#endif /* _SDE_HW_CATALOG_H */