blob: fa10a88891e71b2d6f044ba99563753b9572f618 [file] [log] [blame]
abeykunb85a5e32016-08-24 13:51:40 -04001/* Copyright (c) 2015-2017, 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 */
abeykunb85a5e32016-08-24 13:51:40 -040048
Kyle Yan6a20fae2017-02-14 13:34:41 -080049#define IS_SDM845_TARGET(rev) IS_SDE_MAJOR_MINOR_SAME((rev), SDE_HW_VER_400)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070050
Lloyd Atkinson77158732016-10-23 13:02:00 -040051#define SDE_HW_BLK_NAME_LEN 16
52
Dhaval Patel47302cf2016-08-18 15:04:28 -070053#define MAX_IMG_WIDTH 0x3fff
54#define MAX_IMG_HEIGHT 0x3fff
55
Dhaval Patel44f12472016-08-29 12:19:47 -070056#define CRTC_DUAL_MIXERS 2
57
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -080058#define SDE_COLOR_PROCESS_VER(MAJOR, MINOR) \
59 ((((MAJOR) & 0xFFFF) << 16) | (((MINOR) & 0xFFFF)))
60#define SDE_COLOR_PROCESS_MAJOR(version) (((version) & 0xFFFF0000) >> 16)
61#define SDE_COLOR_PROCESS_MINOR(version) ((version) & 0xFFFF)
62
Clarence Ip7f0de632017-05-31 14:59:14 -040063#define MAX_XIN_COUNT 16
64
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070065/**
Clarence Ip32bcb002017-03-13 12:26:44 -070066 * Supported UBWC feature versions
67 */
68enum {
69 SDE_HW_UBWC_VER_10 = 0x100,
70 SDE_HW_UBWC_VER_20 = 0x200,
71 SDE_HW_UBWC_VER_30 = 0x300,
72};
73
74#define IS_UBWC_20_SUPPORTED(rev) ((rev) >= SDE_HW_UBWC_VER_20)
75
76/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070077 * MDP TOP BLOCK features
78 * @SDE_MDP_PANIC_PER_PIPE Panic configuration needs to be be done per pipe
79 * @SDE_MDP_10BIT_SUPPORT, Chipset supports 10 bit pixel formats
80 * @SDE_MDP_BWC, MDSS HW supports Bandwidth compression.
81 * @SDE_MDP_UBWC_1_0, This chipsets supports Universal Bandwidth
82 * compression initial revision
83 * @SDE_MDP_UBWC_1_5, Universal Bandwidth compression version 1.5
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070084 * @SDE_MDP_MAX Maximum value
85
86 */
87enum {
88 SDE_MDP_PANIC_PER_PIPE = 0x1,
89 SDE_MDP_10BIT_SUPPORT,
90 SDE_MDP_BWC,
91 SDE_MDP_UBWC_1_0,
92 SDE_MDP_UBWC_1_5,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070093 SDE_MDP_MAX
94};
95
96/**
97 * SSPP sub-blocks/features
98 * @SDE_SSPP_SRC Src and fetch part of the pipes,
Clarence Ipe78efb72016-06-24 18:35:21 -040099 * @SDE_SSPP_SCALER_QSEED2, QSEED2 algorithm support
100 * @SDE_SSPP_SCALER_QSEED3, QSEED3 alogorithm support
101 * @SDE_SSPP_SCALER_RGB, RGB Scaler, supported by RGB pipes
102 * @SDE_SSPP_CSC, Support of Color space converion
abeykun62576142016-08-25 17:44:05 -0400103 * @SDE_SSPP_CSC_10BIT, Support of 10-bit Color space conversion
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800104 * @SDE_SSPP_HSIC, Global HSIC control
105 * @SDE_SSPP_MEMCOLOR Memory Color Support
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700106 * @SDE_SSPP_IGC, Inverse gamma correction
107 * @SDE_SSPP_PCC, Color correction support
108 * @SDE_SSPP_CURSOR, SSPP can be used as a cursor layer
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400109 * @SDE_SSPP_QOS, SSPP support QoS control, danger/safe/creq
Alan Kwongdce56da2017-04-27 15:50:34 -0700110 * @SDE_SSPP_QOS_8LVL, SSPP support 8-level QoS control
Veera Sundaram Sankaran02dd6ac2016-12-22 15:08:29 -0800111 * @SDE_SSPP_EXCL_RECT, SSPP supports exclusion rect
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800112 * @SDE_SSPP_SMART_DMA_V1, SmartDMA 1.0 support
113 * @SDE_SSPP_SMART_DMA_V2, SmartDMA 2.0 support
Alan Kwong4dd64c82017-02-04 18:41:51 -0800114 * @SDE_SSPP_SBUF, SSPP support inline stream buffer
Alan Kwong2349d742017-04-20 08:27:30 -0700115 * @SDE_SSPP_TS_PREFILL Supports prefill with traffic shaper
116 * @SDE_SSPP_TS_PREFILL_REC1 Supports prefill with traffic shaper multirec
Alan Kwong143f50c2017-04-28 07:34:28 -0700117 * @SDE_SSPP_CDP Supports client driven prefetch
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700118 * @SDE_SSPP_MAX maximum value
119 */
120enum {
121 SDE_SSPP_SRC = 0x1,
Clarence Ipe78efb72016-06-24 18:35:21 -0400122 SDE_SSPP_SCALER_QSEED2,
123 SDE_SSPP_SCALER_QSEED3,
124 SDE_SSPP_SCALER_RGB,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700125 SDE_SSPP_CSC,
abeykun62576142016-08-25 17:44:05 -0400126 SDE_SSPP_CSC_10BIT,
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800127 SDE_SSPP_HSIC,
128 SDE_SSPP_MEMCOLOR,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700129 SDE_SSPP_IGC,
130 SDE_SSPP_PCC,
131 SDE_SSPP_CURSOR,
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400132 SDE_SSPP_QOS,
Alan Kwongdce56da2017-04-27 15:50:34 -0700133 SDE_SSPP_QOS_8LVL,
Veera Sundaram Sankaran02dd6ac2016-12-22 15:08:29 -0800134 SDE_SSPP_EXCL_RECT,
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800135 SDE_SSPP_SMART_DMA_V1,
136 SDE_SSPP_SMART_DMA_V2,
Alan Kwong4dd64c82017-02-04 18:41:51 -0800137 SDE_SSPP_SBUF,
Alan Kwong2349d742017-04-20 08:27:30 -0700138 SDE_SSPP_TS_PREFILL,
139 SDE_SSPP_TS_PREFILL_REC1,
Alan Kwong143f50c2017-04-28 07:34:28 -0700140 SDE_SSPP_CDP,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700141 SDE_SSPP_MAX
142};
143
144/*
145 * MIXER sub-blocks/features
146 * @SDE_MIXER_LAYER Layer mixer layer blend configuration,
147 * @SDE_MIXER_SOURCESPLIT Layer mixer supports source-split configuration
148 * @SDE_MIXER_GC Gamma correction block
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800149 * @SDE_DIM_LAYER Layer mixer supports dim layer
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700150 * @SDE_MIXER_MAX maximum value
151 */
152enum {
153 SDE_MIXER_LAYER = 0x1,
154 SDE_MIXER_SOURCESPLIT,
155 SDE_MIXER_GC,
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800156 SDE_DIM_LAYER,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700157 SDE_MIXER_MAX
158};
159
160/**
161 * DSPP sub-blocks
162 * @SDE_DSPP_IGC DSPP Inverse gamma correction block
163 * @SDE_DSPP_PCC Panel color correction block
164 * @SDE_DSPP_GC Gamma correction block
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800165 * @SDE_DSPP_HSIC Global HSIC block
166 * @SDE_DSPP_MEMCOLOR Memory Color block
167 * @SDE_DSPP_SIXZONE Six zone block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700168 * @SDE_DSPP_GAMUT Gamut bloc
169 * @SDE_DSPP_DITHER Dither block
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700170 * @SDE_DSPP_HIST Histogram block
171 * @SDE_DSPP_VLUT PA VLUT block
172 * @SDE_DSPP_AD AD block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700173 * @SDE_DSPP_MAX maximum value
174 */
175enum {
176 SDE_DSPP_IGC = 0x1,
177 SDE_DSPP_PCC,
178 SDE_DSPP_GC,
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800179 SDE_DSPP_HSIC,
180 SDE_DSPP_MEMCOLOR,
181 SDE_DSPP_SIXZONE,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700182 SDE_DSPP_GAMUT,
183 SDE_DSPP_DITHER,
184 SDE_DSPP_HIST,
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700185 SDE_DSPP_VLUT,
Gopikrishnaiah Anandan41980b42016-06-21 16:01:33 -0700186 SDE_DSPP_AD,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700187 SDE_DSPP_MAX
188};
189
190/**
191 * PINGPONG sub-blocks
192 * @SDE_PINGPONG_TE Tear check block
193 * @SDE_PINGPONG_TE2 Additional tear check block for split pipes
194 * @SDE_PINGPONG_SPLIT PP block supports split fifo
Clarence Ip8e69ad02016-12-09 09:43:57 -0500195 * @SDE_PINGPONG_SLAVE PP block is a suitable slave for split fifo
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700196 * @SDE_PINGPONG_DSC, Display stream compression blocks
Ping Li8430ee12017-02-24 14:14:44 -0800197 * @SDE_PINGPONG_DITHER, Dither blocks
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700198 * @SDE_PINGPONG_MAX
199 */
200enum {
201 SDE_PINGPONG_TE = 0x1,
202 SDE_PINGPONG_TE2,
203 SDE_PINGPONG_SPLIT,
Clarence Ip8e69ad02016-12-09 09:43:57 -0500204 SDE_PINGPONG_SLAVE,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700205 SDE_PINGPONG_DSC,
Ping Li8430ee12017-02-24 14:14:44 -0800206 SDE_PINGPONG_DITHER,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700207 SDE_PINGPONG_MAX
208};
209
210/**
Lloyd Atkinsoncf8996b2016-08-23 09:34:13 -0400211 * CTL sub-blocks
212 * @SDE_CTL_SPLIT_DISPLAY CTL supports video mode split display
213 * @SDE_CTL_PINGPONG_SPLIT CTL supports pingpong split
Alan Kwong4dd64c82017-02-04 18:41:51 -0800214 * @SDE_CTL_SBUF CTL supports inline stream buffer
Lloyd Atkinsoncf8996b2016-08-23 09:34:13 -0400215 * @SDE_CTL_MAX
216 */
217enum {
218 SDE_CTL_SPLIT_DISPLAY = 0x1,
219 SDE_CTL_PINGPONG_SPLIT,
Alan Kwong4dd64c82017-02-04 18:41:51 -0800220 SDE_CTL_SBUF,
Lloyd Atkinsoncf8996b2016-08-23 09:34:13 -0400221 SDE_CTL_MAX
222};
223
224/**
Alan Kwong4aacd532017-02-04 18:51:33 -0800225 * INTF sub-blocks
226 * @SDE_INTF_ROT_START INTF supports rotator start trigger
227 * @SDE_INTF_MAX
228 */
229enum {
230 SDE_INTF_ROT_START = 0x1,
231 SDE_INTF_MAX
232};
233
234/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700235 * WB sub-blocks and features
236 * @SDE_WB_LINE_MODE Writeback module supports line/linear mode
237 * @SDE_WB_BLOCK_MODE Writeback module supports block mode read
238 * @SDE_WB_ROTATE rotation support,this is available if writeback
239 * supports block mode read
240 * @SDE_WB_CSC Writeback color conversion block support
241 * @SDE_WB_CHROMA_DOWN, Writeback chroma down block,
242 * @SDE_WB_DOWNSCALE, Writeback integer downscaler,
243 * @SDE_WB_DITHER, Dither block
244 * @SDE_WB_TRAFFIC_SHAPER, Writeback traffic shaper bloc
Clarence Ip32bcb002017-03-13 12:26:44 -0700245 * @SDE_WB_UBWC, Writeback Universal bandwidth compression
Alan Kwong3232ca52016-07-29 02:27:47 -0400246 * @SDE_WB_YUV_CONFIG Writeback supports output of YUV colorspace
Alan Kwong9ffcd592016-09-27 07:41:56 -0400247 * @SDE_WB_PIPE_ALPHA Writeback supports pipe alpha
abeykunf1539f72016-08-24 16:08:03 -0400248 * @SDE_WB_XY_ROI_OFFSET Writeback supports x/y-offset of out ROI in
249 * the destination image
Alan Kwongdce56da2017-04-27 15:50:34 -0700250 * @SDE_WB_QOS, Writeback supports QoS control, danger/safe/creq
251 * @SDE_WB_QOS_8LVL, Writeback supports 8-level QoS control
Alan Kwong143f50c2017-04-28 07:34:28 -0700252 * @SDE_WB_CDP Writeback supports client driven prefetch
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700253 * @SDE_WB_MAX maximum value
254 */
255enum {
256 SDE_WB_LINE_MODE = 0x1,
257 SDE_WB_BLOCK_MODE,
258 SDE_WB_ROTATE = SDE_WB_BLOCK_MODE,
259 SDE_WB_CSC,
260 SDE_WB_CHROMA_DOWN,
261 SDE_WB_DOWNSCALE,
262 SDE_WB_DITHER,
263 SDE_WB_TRAFFIC_SHAPER,
Clarence Ip32bcb002017-03-13 12:26:44 -0700264 SDE_WB_UBWC,
Alan Kwong3232ca52016-07-29 02:27:47 -0400265 SDE_WB_YUV_CONFIG,
Alan Kwong9ffcd592016-09-27 07:41:56 -0400266 SDE_WB_PIPE_ALPHA,
abeykunf1539f72016-08-24 16:08:03 -0400267 SDE_WB_XY_ROI_OFFSET,
Alan Kwongdce56da2017-04-27 15:50:34 -0700268 SDE_WB_QOS,
269 SDE_WB_QOS_8LVL,
Alan Kwong143f50c2017-04-28 07:34:28 -0700270 SDE_WB_CDP,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700271 SDE_WB_MAX
272};
273
274/**
Alan Kwong5d324e42016-07-28 22:56:18 -0400275 * VBIF sub-blocks and features
276 * @SDE_VBIF_QOS_OTLIM VBIF supports OT Limit
Alan Kwonga62eeb82017-04-19 08:57:55 -0700277 * @SDE_VBIF_QOS_REMAP VBIF supports QoS priority remap
Alan Kwong5d324e42016-07-28 22:56:18 -0400278 * @SDE_VBIF_MAX maximum value
279 */
280enum {
281 SDE_VBIF_QOS_OTLIM = 0x1,
Alan Kwonga62eeb82017-04-19 08:57:55 -0700282 SDE_VBIF_QOS_REMAP,
Alan Kwong5d324e42016-07-28 22:56:18 -0400283 SDE_VBIF_MAX
284};
285
286/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700287 * MACRO SDE_HW_BLK_INFO - information of HW blocks inside SDE
Lloyd Atkinson77158732016-10-23 13:02:00 -0400288 * @name: string name for debug purposes
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700289 * @id: enum identifying this block
290 * @base: register base offset to mdss
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700291 * @len: length of hardware block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700292 * @features bit mask identifying sub-blocks/features
293 */
294#define SDE_HW_BLK_INFO \
Lloyd Atkinson77158732016-10-23 13:02:00 -0400295 char name[SDE_HW_BLK_NAME_LEN]; \
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700296 u32 id; \
297 u32 base; \
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700298 u32 len; \
299 unsigned long features; \
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700300
301/**
302 * MACRO SDE_HW_SUBBLK_INFO - information of HW sub-block inside SDE
Lloyd Atkinson77158732016-10-23 13:02:00 -0400303 * @name: string name for debug purposes
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700304 * @id: enum identifying this sub-block
305 * @base: offset of this sub-block relative to the block
306 * offset
307 * @len register block length of this sub-block
308 */
309#define SDE_HW_SUBBLK_INFO \
Lloyd Atkinson77158732016-10-23 13:02:00 -0400310 char name[SDE_HW_BLK_NAME_LEN]; \
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700311 u32 id; \
312 u32 base; \
313 u32 len
314
315/**
316 * struct sde_src_blk: SSPP part of the source pipes
317 * @info: HW register and features supported by this sub-blk
318 */
319struct sde_src_blk {
320 SDE_HW_SUBBLK_INFO;
321};
322
323/**
Clarence Ipe78efb72016-06-24 18:35:21 -0400324 * struct sde_scaler_blk: Scaler information
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700325 * @info: HW register and features supported by this sub-blk
abeykun48f407a2016-08-25 12:06:44 -0400326 * @version: qseed block revision
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700327 */
Clarence Ipe78efb72016-06-24 18:35:21 -0400328struct sde_scaler_blk {
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700329 SDE_HW_SUBBLK_INFO;
abeykun48f407a2016-08-25 12:06:44 -0400330 u32 version;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700331};
332
333struct sde_csc_blk {
334 SDE_HW_SUBBLK_INFO;
335};
336
337/**
338 * struct sde_pp_blk : Pixel processing sub-blk information
339 * @info: HW register and features supported by this sub-blk
340 * @version: HW Algorithm version
341 */
342struct sde_pp_blk {
343 SDE_HW_SUBBLK_INFO;
344 u32 version;
345};
346
347/**
Clarence Ipea3d6262016-07-15 16:20:11 -0400348 * struct sde_format_extended - define sde specific pixel format+modifier
349 * @fourcc_format: Base FOURCC pixel format code
350 * @modifier: 64-bit drm format modifier, same modifier must be applied to all
351 * framebuffer planes
352 */
353struct sde_format_extended {
354 uint32_t fourcc_format;
355 uint64_t modifier;
356};
357
358/**
Alan Kwongdce56da2017-04-27 15:50:34 -0700359 * enum sde_qos_lut_usage - define QoS LUT use cases
360 */
361enum sde_qos_lut_usage {
362 SDE_QOS_LUT_USAGE_LINEAR,
363 SDE_QOS_LUT_USAGE_MACROTILE,
364 SDE_QOS_LUT_USAGE_NRT,
365 SDE_QOS_LUT_USAGE_CWB,
366 SDE_QOS_LUT_USAGE_MAX,
367};
368
369/**
370 * struct sde_qos_lut_entry - define QoS LUT table entry
371 * @fl: fill level, or zero on last entry to indicate default lut
372 * @lut: lut to use if equal to or less than fill level
373 */
374struct sde_qos_lut_entry {
375 u32 fl;
376 u64 lut;
377};
378
379/**
380 * struct sde_qos_lut_tbl - define QoS LUT table
381 * @nentry: number of entry in this table
382 * @entries: Pointer to table entries
383 */
384struct sde_qos_lut_tbl {
385 u32 nentry;
386 struct sde_qos_lut_entry *entries;
387};
388
389/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700390 * struct sde_sspp_sub_blks : SSPP sub-blocks
391 * @maxdwnscale: max downscale ratio supported(without DECIMATION)
392 * @maxupscale: maxupscale ratio supported
393 * @maxwidth: max pixelwidth supported by this pipe
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400394 * @creq_vblank: creq priority during vertical blanking
395 * @danger_vblank: danger priority during vertical blanking
396 * @pixel_ram_size: size of latency hiding and de-tiling buffer in bytes
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800397 * @smart_dma_priority: hw priority of rect1 of multirect pipe
Steve Cohen57428172017-07-18 10:57:17 -0400398 * @max_per_pipe_bw: maximum allowable bandwidth of this pipe in kBps
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700399 * @src_blk:
Clarence Ipe78efb72016-06-24 18:35:21 -0400400 * @scaler_blk:
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700401 * @csc_blk:
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800402 * @hsic:
403 * @memcolor:
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700404 * @pcc_blk:
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800405 * @igc_blk:
Clarence Ipea3d6262016-07-15 16:20:11 -0400406 * @format_list: Pointer to list of supported formats
Steve Cohen57428172017-07-18 10:57:17 -0400407 * @virt_format_list: Pointer to list of supported formats for virtual planes
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700408 */
409struct sde_sspp_sub_blks {
410 u32 maxlinewidth;
Alan Kwong1a00e4d2016-07-18 09:42:30 -0400411 u32 creq_vblank;
412 u32 danger_vblank;
413 u32 pixel_ram_size;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700414 u32 maxdwnscale;
415 u32 maxupscale;
Clarence Ip5e2a9222016-06-26 22:38:24 -0400416 u32 maxhdeciexp; /* max decimation is 2^value */
417 u32 maxvdeciexp; /* max decimation is 2^value */
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800418 u32 smart_dma_priority;
Alan Kwong6259a382017-04-04 06:18:02 -0700419 u32 max_per_pipe_bw;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700420 struct sde_src_blk src_blk;
Clarence Ipe78efb72016-06-24 18:35:21 -0400421 struct sde_scaler_blk scaler_blk;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700422 struct sde_pp_blk csc_blk;
Benet Clark37809e62016-10-24 10:14:00 -0700423 struct sde_pp_blk hsic_blk;
424 struct sde_pp_blk memcolor_blk;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700425 struct sde_pp_blk pcc_blk;
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800426 struct sde_pp_blk igc_blk;
Clarence Ipea3d6262016-07-15 16:20:11 -0400427
428 const struct sde_format_extended *format_list;
Steve Cohen57428172017-07-18 10:57:17 -0400429 const struct sde_format_extended *virt_format_list;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700430};
431
432/**
433 * struct sde_lm_sub_blks: information of mixer block
434 * @maxwidth: Max pixel width supported by this mixer
435 * @maxblendstages: Max number of blend-stages supported
436 * @blendstage_base: Blend-stage register base offset
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800437 * @gc: gamma correction block
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700438 */
439struct sde_lm_sub_blks {
440 u32 maxwidth;
441 u32 maxblendstages;
442 u32 blendstage_base[MAX_BLOCKS];
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800443 struct sde_pp_blk gc;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700444};
445
446struct sde_dspp_sub_blks {
447 struct sde_pp_blk igc;
448 struct sde_pp_blk pcc;
449 struct sde_pp_blk gc;
Gopikrishnaiah Anandane3842f32015-11-05 12:18:41 -0800450 struct sde_pp_blk hsic;
451 struct sde_pp_blk memcolor;
452 struct sde_pp_blk sixzone;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700453 struct sde_pp_blk gamut;
454 struct sde_pp_blk dither;
455 struct sde_pp_blk hist;
Gopikrishnaiah Anandan41980b42016-06-21 16:01:33 -0700456 struct sde_pp_blk ad;
Gopikrishnaiah Anandanb67b0d12016-06-23 11:43:08 -0700457 struct sde_pp_blk vlut;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700458};
459
460struct sde_pingpong_sub_blks {
461 struct sde_pp_blk te;
462 struct sde_pp_blk te2;
463 struct sde_pp_blk dsc;
Ping Li8430ee12017-02-24 14:14:44 -0800464 struct sde_pp_blk dither;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700465};
466
467struct sde_wb_sub_blocks {
468 u32 maxlinewidth;
469};
470
Ben Chan78647cd2016-06-26 22:02:47 -0400471struct sde_mdss_base_cfg {
472 SDE_HW_BLK_INFO;
473};
474
Alan Kwong5d324e42016-07-28 22:56:18 -0400475/**
476 * sde_clk_ctrl_type - Defines top level clock control signals
477 */
478enum sde_clk_ctrl_type {
479 SDE_CLK_CTRL_NONE,
480 SDE_CLK_CTRL_VIG0,
481 SDE_CLK_CTRL_VIG1,
482 SDE_CLK_CTRL_VIG2,
483 SDE_CLK_CTRL_VIG3,
484 SDE_CLK_CTRL_VIG4,
485 SDE_CLK_CTRL_RGB0,
486 SDE_CLK_CTRL_RGB1,
487 SDE_CLK_CTRL_RGB2,
488 SDE_CLK_CTRL_RGB3,
489 SDE_CLK_CTRL_DMA0,
490 SDE_CLK_CTRL_DMA1,
491 SDE_CLK_CTRL_CURSOR0,
492 SDE_CLK_CTRL_CURSOR1,
493 SDE_CLK_CTRL_WB0,
494 SDE_CLK_CTRL_WB1,
495 SDE_CLK_CTRL_WB2,
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700496 SDE_CLK_CTRL_INLINE_ROT0_SSPP,
497 SDE_CLK_CTRL_INLINE_ROT0_WB,
Alan Kwong5d324e42016-07-28 22:56:18 -0400498 SDE_CLK_CTRL_MAX,
499};
500
501/* struct sde_clk_ctrl_reg : Clock control register
502 * @reg_off: register offset
503 * @bit_off: bit offset
504 */
505struct sde_clk_ctrl_reg {
506 u32 reg_off;
507 u32 bit_off;
508};
509
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700510/* struct sde_mdp_cfg : MDP TOP-BLK instance info
511 * @id: index identifying this block
512 * @base: register base offset to mdss
513 * @features bit mask identifying sub-blocks/features
514 * @highest_bank_bit: UBWC parameter
Clarence Ip32bcb002017-03-13 12:26:44 -0700515 * @ubwc_static: ubwc static configuration
516 * @ubwc_swizzle: ubwc default swizzle setting
Alan Kwong5d324e42016-07-28 22:56:18 -0400517 * @clk_ctrls clock control register definition
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700518 */
519struct sde_mdp_cfg {
520 SDE_HW_BLK_INFO;
521 u32 highest_bank_bit;
Clarence Ip32bcb002017-03-13 12:26:44 -0700522 u32 ubwc_static;
523 u32 ubwc_swizzle;
Alan Kwong5d324e42016-07-28 22:56:18 -0400524 struct sde_clk_ctrl_reg clk_ctrls[SDE_CLK_CTRL_MAX];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700525};
526
527/* struct sde_mdp_cfg : MDP TOP-BLK instance info
528 * @id: index identifying this block
529 * @base: register base offset to mdss
530 * @features bit mask identifying sub-blocks/features
531 */
532struct sde_ctl_cfg {
533 SDE_HW_BLK_INFO;
534};
535
536/**
537 * struct sde_sspp_cfg - information of source pipes
538 * @id: index identifying this block
539 * @base register offset of this block
540 * @features bit mask identifying sub-blocks/features
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400541 * @sblk: SSPP sub-blocks information
Alan Kwong5d324e42016-07-28 22:56:18 -0400542 * @xin_id: bus client identifier
543 * @clk_ctrl clock control identifier
abeykunf35ff332016-12-20 13:06:09 -0500544 * @type sspp type identifier
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700545 */
546struct sde_sspp_cfg {
547 SDE_HW_BLK_INFO;
548 const struct sde_sspp_sub_blks *sblk;
Alan Kwong5d324e42016-07-28 22:56:18 -0400549 u32 xin_id;
550 enum sde_clk_ctrl_type clk_ctrl;
abeykunf35ff332016-12-20 13:06:09 -0500551 u32 type;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700552};
553
554/**
555 * struct sde_lm_cfg - information of layer mixer blocks
556 * @id: index identifying this block
557 * @base register offset of this block
558 * @features bit mask identifying sub-blocks/features
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400559 * @sblk: LM Sub-blocks information
560 * @dspp: ID of connected DSPP, DSPP_MAX if unsupported
561 * @pingpong: ID of connected PingPong, PINGPONG_MAX if unsupported
562 * @lm_pair_mask: Bitmask of LMs that can be controlled by same CTL
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700563 */
564struct sde_lm_cfg {
565 SDE_HW_BLK_INFO;
566 const struct sde_lm_sub_blks *sblk;
Lloyd Atkinson350bb412016-07-06 10:47:29 -0400567 u32 dspp;
568 u32 pingpong;
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400569 unsigned long lm_pair_mask;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700570};
571
572/**
Rajesh Yadavec93afb2017-06-08 19:28:33 +0530573 * struct sde_dspp_cfg - information of DSPP top block
574 * @id enum identifying this block
575 * @base register offset of this block
576 * @features bit mask identifying sub-blocks/features
577 * supported by this block
578 */
579struct sde_dspp_top_cfg {
580 SDE_HW_BLK_INFO;
581};
582
583/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700584 * struct sde_dspp_cfg - information of DSPP blocks
585 * @id enum identifying this block
586 * @base register offset of this block
587 * @features bit mask identifying sub-blocks/features
588 * supported by this block
589 * @sblk sub-blocks information
590 */
591struct sde_dspp_cfg {
592 SDE_HW_BLK_INFO;
593 const struct sde_dspp_sub_blks *sblk;
594};
595
596/**
597 * struct sde_pingpong_cfg - information of PING-PONG blocks
598 * @id enum identifying this block
599 * @base register offset of this block
600 * @features bit mask identifying sub-blocks/features
601 * @sblk sub-blocks information
602 */
603struct sde_pingpong_cfg {
604 SDE_HW_BLK_INFO;
605 const struct sde_pingpong_sub_blks *sblk;
606};
607
608/**
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800609 * struct sde_dsc_cfg - information of DSC blocks
610 * @id enum identifying this block
611 * @base register offset of this block
612 * @features bit mask identifying sub-blocks/features
613 */
614struct sde_dsc_cfg {
615 SDE_HW_BLK_INFO;
616};
617
618/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700619 * struct sde_cdm_cfg - information of chroma down blocks
620 * @id enum identifying this block
621 * @base register offset of this block
622 * @features bit mask identifying sub-blocks/features
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400623 * @intf_connect Bitmask of INTF IDs this CDM can connect to
624 * @wb_connect: Bitmask of Writeback IDs this CDM can connect to
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700625 */
626struct sde_cdm_cfg {
627 SDE_HW_BLK_INFO;
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400628 unsigned long intf_connect;
629 unsigned long wb_connect;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700630};
631
632/**
633 * struct sde_intf_cfg - information of timing engine blocks
634 * @id enum identifying this block
635 * @base register offset of this block
636 * @features bit mask identifying sub-blocks/features
637 * @type: Interface type(DSI, DP, HDMI)
Lloyd Atkinson2d4e7662015-11-05 15:52:07 -0500638 * @controller_id: Controller Instance ID in case of multiple of intf type
Lloyd Atkinsonf30546e2016-06-26 10:08:25 -0400639 * @prog_fetch_lines_worst_case Worst case latency num lines needed to prefetch
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700640 */
641struct sde_intf_cfg {
642 SDE_HW_BLK_INFO;
643 u32 type; /* interface type*/
Lloyd Atkinson2d4e7662015-11-05 15:52:07 -0500644 u32 controller_id;
Lloyd Atkinsonf30546e2016-06-26 10:08:25 -0400645 u32 prog_fetch_lines_worst_case;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700646};
647
648/**
649 * struct sde_wb_cfg - information of writeback blocks
650 * @id enum identifying this block
651 * @base register offset of this block
652 * @features bit mask identifying sub-blocks/features
Alan Kwongbb27c092016-07-20 16:41:25 -0400653 * @sblk sub-block information
654 * @format_list: Pointer to list of supported formats
Alan Kwong5d324e42016-07-28 22:56:18 -0400655 * @vbif_idx vbif identifier
656 * @xin_id client interface identifier
657 * @clk_ctrl clock control identifier
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700658 */
659struct sde_wb_cfg {
660 SDE_HW_BLK_INFO;
Alan Kwongbb27c092016-07-20 16:41:25 -0400661 const struct sde_wb_sub_blocks *sblk;
662 const struct sde_format_extended *format_list;
Alan Kwong5d324e42016-07-28 22:56:18 -0400663 u32 vbif_idx;
664 u32 xin_id;
665 enum sde_clk_ctrl_type clk_ctrl;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700666};
667
668/**
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700669 * struct sde_rot_vbif_cfg - inline rotator vbif configs
670 * @xin_id xin client id
671 * @num enum identifying this block
672 * @is_read indicates read/write client
673 * @clk_ctrl index to clk control
674 */
675struct sde_rot_vbif_cfg {
676 u32 xin_id;
677 u32 num;
678 bool is_read;
679 enum sde_clk_ctrl_type clk_ctrl;
680};
681
682/**
Alan Kwong4dd64c82017-02-04 18:41:51 -0800683 * struct sde_rot_cfg - information of rotator blocks
684 * @id enum identifying this block
685 * @base register offset of this block
686 * @len length of hardware block
687 * @features bit mask identifying sub-blocks/features
688 * @pdev private device handle
689 * @scid subcache identifier
690 * @slice_size subcache slice size
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700691 * @vbif_idx vbif identifier
692 * @xin_count number of xin clients
693 * @vbif_cfg vbif settings related to rotator
Alan Kwong4dd64c82017-02-04 18:41:51 -0800694 */
695struct sde_rot_cfg {
696 SDE_HW_BLK_INFO;
697 void *pdev;
698 int scid;
699 size_t slice_size;
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700700 u32 vbif_idx;
701
702 u32 xin_count;
703 struct sde_rot_vbif_cfg vbif_cfg[MAX_BLOCKS];
Alan Kwong4dd64c82017-02-04 18:41:51 -0800704};
705
706/**
Alan Kwong5d324e42016-07-28 22:56:18 -0400707 * struct sde_vbif_dynamic_ot_cfg - dynamic OT setting
708 * @pps pixel per seconds
709 * @ot_limit OT limit to use up to specified pixel per second
710 */
711struct sde_vbif_dynamic_ot_cfg {
712 u64 pps;
713 u32 ot_limit;
714};
715
716/**
717 * struct sde_vbif_dynamic_ot_tbl - dynamic OT setting table
718 * @count length of cfg
719 * @cfg pointer to array of configuration settings with
720 * ascending requirements
721 */
722struct sde_vbif_dynamic_ot_tbl {
723 u32 count;
Alan Kwongb9d2f6f2016-10-12 00:27:07 -0400724 struct sde_vbif_dynamic_ot_cfg *cfg;
Alan Kwong5d324e42016-07-28 22:56:18 -0400725};
726
727/**
Alan Kwonga62eeb82017-04-19 08:57:55 -0700728 * struct sde_vbif_qos_tbl - QoS priority table
729 * @npriority_lvl num of priority level
730 * @priority_lvl pointer to array of priority level in ascending order
731 */
732struct sde_vbif_qos_tbl {
733 u32 npriority_lvl;
734 u32 *priority_lvl;
735};
736
737/**
Alan Kwong5d324e42016-07-28 22:56:18 -0400738 * struct sde_vbif_cfg - information of VBIF blocks
739 * @id enum identifying this block
740 * @base register offset of this block
741 * @features bit mask identifying sub-blocks/features
742 * @ot_rd_limit default OT read limit
743 * @ot_wr_limit default OT write limit
744 * @xin_halt_timeout maximum time (in usec) for xin to halt
745 * @dynamic_ot_rd_tbl dynamic OT read configuration table
746 * @dynamic_ot_wr_tbl dynamic OT write configuration table
Alan Kwonga62eeb82017-04-19 08:57:55 -0700747 * @qos_rt_tbl real-time QoS priority table
748 * @qos_nrt_tbl non-real-time QoS priority table
Clarence Ip7f0de632017-05-31 14:59:14 -0400749 * @memtype_count number of defined memtypes
750 * @memtype array of xin memtype definitions
Alan Kwong5d324e42016-07-28 22:56:18 -0400751 */
752struct sde_vbif_cfg {
753 SDE_HW_BLK_INFO;
754 u32 default_ot_rd_limit;
755 u32 default_ot_wr_limit;
756 u32 xin_halt_timeout;
757 struct sde_vbif_dynamic_ot_tbl dynamic_ot_rd_tbl;
758 struct sde_vbif_dynamic_ot_tbl dynamic_ot_wr_tbl;
Alan Kwonga62eeb82017-04-19 08:57:55 -0700759 struct sde_vbif_qos_tbl qos_rt_tbl;
760 struct sde_vbif_qos_tbl qos_nrt_tbl;
Clarence Ip7f0de632017-05-31 14:59:14 -0400761 u32 memtype_count;
762 u32 memtype[MAX_XIN_COUNT];
Alan Kwong5d324e42016-07-28 22:56:18 -0400763};
Gopikrishnaiah Anandan031d8ff2016-12-15 16:58:45 -0800764/**
765 * struct sde_reg_dma_cfg - information of lut dma blocks
766 * @id enum identifying this block
767 * @base register offset of this block
768 * @features bit mask identifying sub-blocks/features
769 * @version version of lutdma hw block
770 * @trigger_sel_off offset to trigger select registers of lutdma
771 */
772struct sde_reg_dma_cfg {
773 SDE_HW_BLK_INFO;
774 u32 version;
775 u32 trigger_sel_off;
776};
Alan Kwong5d324e42016-07-28 22:56:18 -0400777
778/**
Alan Kwong143f50c2017-04-28 07:34:28 -0700779 * Define CDP use cases
780 * @SDE_PERF_CDP_UDAGE_RT: real-time use cases
781 * @SDE_PERF_CDP_USAGE_NRT: non real-time use cases such as WFD
782 */
783enum {
784 SDE_PERF_CDP_USAGE_RT,
785 SDE_PERF_CDP_USAGE_NRT,
786 SDE_PERF_CDP_USAGE_MAX
787};
788
789/**
790 * struct sde_perf_cdp_cfg - define CDP use case configuration
791 * @rd_enable: true if read pipe CDP is enabled
792 * @wr_enable: true if write pipe CDP is enabled
793 */
794struct sde_perf_cdp_cfg {
795 bool rd_enable;
796 bool wr_enable;
797};
798
799/**
Alan Kwong9aa061c2016-11-06 21:17:12 -0500800 * struct sde_perf_cfg - performance control settings
801 * @max_bw_low low threshold of maximum bandwidth (kbps)
802 * @max_bw_high high threshold of maximum bandwidth (kbps)
Alan Kwong6259a382017-04-04 06:18:02 -0700803 * @core_ib_ff core instantaneous bandwidth fudge factor
804 * @core_clk_ff core clock fudge factor
805 * @comp_ratio_rt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
806 * @comp_ratio_nrt string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
807 * @undersized_prefill_lines undersized prefill in lines
808 * @xtra_prefill_lines extra prefill latency in lines
809 * @dest_scale_prefill_lines destination scaler latency in lines
810 * @macrotile_perfill_lines macrotile latency in lines
811 * @yuv_nv12_prefill_lines yuv_nv12 latency in lines
812 * @linear_prefill_lines linear latency in lines
813 * @downscaling_prefill_lines downscaling latency in lines
814 * @amortizable_theshold minimum y position for traffic shaping prefill
815 * @min_prefill_lines minimum pipeline latency in lines
Alan Kwongdce56da2017-04-27 15:50:34 -0700816 * @safe_lut_tbl: LUT tables for safe signals
817 * @danger_lut_tbl: LUT tables for danger signals
818 * @qos_lut_tbl: LUT tables for QoS signals
Alan Kwong143f50c2017-04-28 07:34:28 -0700819 * @cdp_cfg cdp use case configurations
Alan Kwong9aa061c2016-11-06 21:17:12 -0500820 */
821struct sde_perf_cfg {
822 u32 max_bw_low;
823 u32 max_bw_high;
Alan Kwong6259a382017-04-04 06:18:02 -0700824 const char *core_ib_ff;
825 const char *core_clk_ff;
826 const char *comp_ratio_rt;
827 const char *comp_ratio_nrt;
828 u32 undersized_prefill_lines;
829 u32 xtra_prefill_lines;
830 u32 dest_scale_prefill_lines;
831 u32 macrotile_prefill_lines;
832 u32 yuv_nv12_prefill_lines;
833 u32 linear_prefill_lines;
834 u32 downscaling_prefill_lines;
835 u32 amortizable_threshold;
836 u32 min_prefill_lines;
Alan Kwongdce56da2017-04-27 15:50:34 -0700837 u32 safe_lut_tbl[SDE_QOS_LUT_USAGE_MAX];
838 u32 danger_lut_tbl[SDE_QOS_LUT_USAGE_MAX];
839 struct sde_qos_lut_tbl qos_lut_tbl[SDE_QOS_LUT_USAGE_MAX];
Alan Kwong143f50c2017-04-28 07:34:28 -0700840 struct sde_perf_cdp_cfg cdp_cfg[SDE_PERF_CDP_USAGE_MAX];
Alan Kwong9aa061c2016-11-06 21:17:12 -0500841};
842
843/**
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700844 * struct sde_mdss_cfg - information of MDSS HW
845 * This is the main catalog data structure representing
846 * this HW version. Contains number of instances,
847 * register offsets, capabilities of the all MDSS HW sub-blocks.
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700848 *
849 * @max_sspp_linewidth max source pipe line width support.
850 * @max_mixer_width max layer mixer line width support.
851 * @max_mixer_blendstages max layer mixer blend stages or
852 * supported z order
853 * @max_wb_linewidth max writeback line width support.
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700854 * @qseed_type qseed2 or qseed3 support.
Dhaval Patel5aad7452017-01-12 09:59:31 -0800855 * @csc_type csc or csc_10bit support.
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800856 * @smart_dma_rev Supported version of SmartDMA feature.
Dhaval Patel1964fb92016-10-13 19:28:08 -0700857 * @has_src_split source split feature status
Alan Kwong143f50c2017-04-28 07:34:28 -0700858 * @has_cdp Client driven prefetch feature status
Clarence Ip32bcb002017-03-13 12:26:44 -0700859 * @has_wb_ubwc UBWC feature supported on WB
860 * @ubwc_version UBWC feature version (0x0 for not supported)
Alan Kwong4dd64c82017-02-04 18:41:51 -0800861 * @has_sbuf indicate if stream buffer is available
862 * @sbuf_headroom stream buffer headroom in lines
Veera Sundaram Sankaranc9efbec2017-03-29 18:59:05 -0700863 * @has_idle_pc indicate if idle power collapse feature is supported
abeykunf35ff332016-12-20 13:06:09 -0500864 * @dma_formats Supported formats for dma pipe
865 * @cursor_formats Supported formats for cursor pipe
866 * @vig_formats Supported formats for vig pipe
867 * @wb_formats Supported formats for wb
Alan Kwonga62eeb82017-04-19 08:57:55 -0700868 * @vbif_qos_nlvl number of vbif QoS priority level
Alan Kwong2349d742017-04-20 08:27:30 -0700869 * @ts_prefill_rev prefill traffic shaper feature revision
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700870 */
871struct sde_mdss_cfg {
872 u32 hwversion;
873
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700874 u32 max_sspp_linewidth;
875 u32 max_mixer_width;
876 u32 max_mixer_blendstages;
877 u32 max_wb_linewidth;
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700878 u32 qseed_type;
Dhaval Patel5aad7452017-01-12 09:59:31 -0800879 u32 csc_type;
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800880 u32 smart_dma_rev;
Dhaval Patel1964fb92016-10-13 19:28:08 -0700881 bool has_src_split;
882 bool has_cdp;
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800883 bool has_dim_layer;
Clarence Ip32bcb002017-03-13 12:26:44 -0700884 bool has_wb_ubwc;
885 u32 ubwc_version;
Alan Kwong4dd64c82017-02-04 18:41:51 -0800886 bool has_sbuf;
887 u32 sbuf_headroom;
Veera Sundaram Sankaranc9efbec2017-03-29 18:59:05 -0700888 bool has_idle_pc;
Alan Kwonga62eeb82017-04-19 08:57:55 -0700889 u32 vbif_qos_nlvl;
Alan Kwong2349d742017-04-20 08:27:30 -0700890 u32 ts_prefill_rev;
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700891
Ben Chan78647cd2016-06-26 22:02:47 -0400892 u32 mdss_count;
893 struct sde_mdss_base_cfg mdss[MAX_BLOCKS];
894
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700895 u32 mdp_count;
896 struct sde_mdp_cfg mdp[MAX_BLOCKS];
897
898 u32 ctl_count;
899 struct sde_ctl_cfg ctl[MAX_BLOCKS];
900
901 u32 sspp_count;
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700902 struct sde_sspp_cfg sspp[MAX_BLOCKS];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700903
904 u32 mixer_count;
905 struct sde_lm_cfg mixer[MAX_BLOCKS];
906
Rajesh Yadavec93afb2017-06-08 19:28:33 +0530907 struct sde_dspp_top_cfg dspp_top;
908
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700909 u32 dspp_count;
910 struct sde_dspp_cfg dspp[MAX_BLOCKS];
911
912 u32 pingpong_count;
913 struct sde_pingpong_cfg pingpong[MAX_BLOCKS];
914
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800915 u32 dsc_count;
916 struct sde_dsc_cfg dsc[MAX_BLOCKS];
917
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700918 u32 cdm_count;
919 struct sde_cdm_cfg cdm[MAX_BLOCKS];
920
921 u32 intf_count;
922 struct sde_intf_cfg intf[MAX_BLOCKS];
923
924 u32 wb_count;
925 struct sde_wb_cfg wb[MAX_BLOCKS];
926
Alan Kwong4dd64c82017-02-04 18:41:51 -0800927 u32 rot_count;
928 struct sde_rot_cfg rot[MAX_BLOCKS];
929
Alan Kwong5d324e42016-07-28 22:56:18 -0400930 u32 vbif_count;
931 struct sde_vbif_cfg vbif[MAX_BLOCKS];
Gopikrishnaiah Anandan031d8ff2016-12-15 16:58:45 -0800932
933 u32 reg_dma_count;
934 struct sde_reg_dma_cfg dma_cfg;
Gopikrishnaiah Anandan9ba43782017-01-31 18:23:08 -0800935
936 u32 ad_count;
937
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700938 /* Add additional block data structures here */
Alan Kwong9aa061c2016-11-06 21:17:12 -0500939
940 struct sde_perf_cfg perf;
abeykunf35ff332016-12-20 13:06:09 -0500941 struct sde_format_extended *dma_formats;
942 struct sde_format_extended *cursor_formats;
943 struct sde_format_extended *vig_formats;
944 struct sde_format_extended *wb_formats;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700945};
946
947struct sde_mdss_hw_cfg_handler {
948 u32 major;
949 u32 minor;
950 struct sde_mdss_cfg* (*cfg_init)(u32);
951};
952
953/*
954 * Access Macros
955 */
956#define BLK_MDP(s) ((s)->mdp)
957#define BLK_CTL(s) ((s)->ctl)
958#define BLK_VIG(s) ((s)->vig)
959#define BLK_RGB(s) ((s)->rgb)
960#define BLK_DMA(s) ((s)->dma)
961#define BLK_CURSOR(s) ((s)->cursor)
962#define BLK_MIXER(s) ((s)->mixer)
963#define BLK_DSPP(s) ((s)->dspp)
964#define BLK_PINGPONG(s) ((s)->pingpong)
965#define BLK_CDM(s) ((s)->cdm)
966#define BLK_INTF(s) ((s)->intf)
967#define BLK_WB(s) ((s)->wb)
968#define BLK_AD(s) ((s)->ad)
969
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700970/**
Clarence Ip17162b52016-11-24 17:06:29 -0500971 * sde_hw_catalog_init - sde hardware catalog init API parses dtsi property
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700972 * and stores all parsed offset, hardware capabilities in config structure.
973 * @dev: drm device node.
974 * @hw_rev: caller needs provide the hardware revision before parsing.
975 *
976 * Return: parsed sde config structure
977 */
978struct sde_mdss_cfg *sde_hw_catalog_init(struct drm_device *dev, u32 hw_rev);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700979
Clarence Ip17162b52016-11-24 17:06:29 -0500980/**
981 * sde_hw_catalog_deinit - sde hardware catalog cleanup
982 * @sde_cfg: pointer returned from init function
983 */
984void sde_hw_catalog_deinit(struct sde_mdss_cfg *sde_cfg);
985
Jeykumar Sankaran2e655032017-02-04 14:05:45 -0800986/**
987 * sde_hw_sspp_multirect_enabled - check multirect enabled for the sspp
988 * @cfg: pointer to sspp cfg
989 */
990static inline bool sde_hw_sspp_multirect_enabled(const struct sde_sspp_cfg *cfg)
991{
992 return test_bit(SDE_SSPP_SMART_DMA_V1, &cfg->features) ||
993 test_bit(SDE_SSPP_SMART_DMA_V2, &cfg->features);
994}
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700995#endif /* _SDE_HW_CATALOG_H */