blob: 3125ebf431be836c9bd2b763852f9cf41de2a49d [file] [log] [blame]
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -07001/* 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_MDSS_H
14#define _SDE_HW_MDSS_H
15
16#include <linux/kernel.h>
17#include <linux/err.h>
18
Lloyd Atkinson9a673492016-07-05 11:41:57 -040019#include "msm_drv.h"
20
Lloyd Atkinson113aefd2016-10-23 13:15:18 -040021#define SDE_DBG_NAME "sde"
22
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -040023#define SDE_NONE 0
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070024
Clarence Ip5e2a9222016-06-26 22:38:24 -040025#ifndef SDE_CSC_MATRIX_COEFF_SIZE
26#define SDE_CSC_MATRIX_COEFF_SIZE 9
27#endif
28
29#ifndef SDE_CSC_CLAMP_SIZE
30#define SDE_CSC_CLAMP_SIZE 6
31#endif
32
33#ifndef SDE_CSC_BIAS_SIZE
34#define SDE_CSC_BIAS_SIZE 3
35#endif
36
37#ifndef SDE_MAX_PLANES
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070038#define SDE_MAX_PLANES 4
Clarence Ip5e2a9222016-06-26 22:38:24 -040039#endif
40
Dhaval Patel48c76022016-09-01 17:51:23 -070041#define PIPES_PER_STAGE 2
abeykun48f407a2016-08-25 12:06:44 -040042#ifndef SDE_MAX_DE_CURVES
43#define SDE_MAX_DE_CURVES 3
44#endif
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070045
abeykun2997c812016-10-04 11:34:15 -040046enum sde_format_flags {
47 SDE_FORMAT_FLAG_YUV_BIT,
48 SDE_FORMAT_FLAG_DX_BIT,
Alan Kwong4fc006e2017-01-29 18:19:34 -080049 SDE_FORMAT_FLAG_COMPRESSED_BIT,
abeykun2997c812016-10-04 11:34:15 -040050 SDE_FORMAT_FLAG_BIT_MAX,
51};
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -040052
abeykun2997c812016-10-04 11:34:15 -040053#define SDE_FORMAT_FLAG_YUV BIT(SDE_FORMAT_FLAG_YUV_BIT)
54#define SDE_FORMAT_FLAG_DX BIT(SDE_FORMAT_FLAG_DX_BIT)
Alan Kwong4fc006e2017-01-29 18:19:34 -080055#define SDE_FORMAT_FLAG_COMPRESSED BIT(SDE_FORMAT_FLAG_COMPRESSED_BIT)
abeykun2997c812016-10-04 11:34:15 -040056#define SDE_FORMAT_IS_YUV(X) \
57 (test_bit(SDE_FORMAT_FLAG_YUV_BIT, (X)->flag))
58#define SDE_FORMAT_IS_DX(X) \
59 (test_bit(SDE_FORMAT_FLAG_DX_BIT, (X)->flag))
Alan Kwong3232ca52016-07-29 02:27:47 -040060#define SDE_FORMAT_IS_LINEAR(X) ((X)->fetch_mode == SDE_FETCH_LINEAR)
Alan Kwong4fc006e2017-01-29 18:19:34 -080061#define SDE_FORMAT_IS_TILE(X) \
62 (((X)->fetch_mode == SDE_FETCH_UBWC) && \
63 !test_bit(SDE_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
64#define SDE_FORMAT_IS_UBWC(X) \
65 (((X)->fetch_mode == SDE_FETCH_UBWC) && \
66 test_bit(SDE_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -040067
Dhaval Patel48c76022016-09-01 17:51:23 -070068#define SDE_BLEND_FG_ALPHA_FG_CONST (0 << 0)
69#define SDE_BLEND_FG_ALPHA_BG_CONST (1 << 0)
70#define SDE_BLEND_FG_ALPHA_FG_PIXEL (2 << 0)
71#define SDE_BLEND_FG_ALPHA_BG_PIXEL (3 << 0)
72#define SDE_BLEND_FG_INV_ALPHA (1 << 2)
73#define SDE_BLEND_FG_MOD_ALPHA (1 << 3)
74#define SDE_BLEND_FG_INV_MOD_ALPHA (1 << 4)
75#define SDE_BLEND_FG_TRANSP_EN (1 << 5)
76#define SDE_BLEND_BG_ALPHA_FG_CONST (0 << 8)
77#define SDE_BLEND_BG_ALPHA_BG_CONST (1 << 8)
78#define SDE_BLEND_BG_ALPHA_FG_PIXEL (2 << 8)
79#define SDE_BLEND_BG_ALPHA_BG_PIXEL (3 << 8)
80#define SDE_BLEND_BG_INV_ALPHA (1 << 10)
81#define SDE_BLEND_BG_MOD_ALPHA (1 << 11)
82#define SDE_BLEND_BG_INV_MOD_ALPHA (1 << 12)
83#define SDE_BLEND_BG_TRANSP_EN (1 << 13)
84
Dhaval Patelaab9b522017-07-20 12:38:46 -070085#define SDE_VSYNC0_SOURCE_GPIO 0
86#define SDE_VSYNC1_SOURCE_GPIO 1
87#define SDE_VSYNC2_SOURCE_GPIO 2
88#define SDE_VSYNC_SOURCE_INTF_0 3
89#define SDE_VSYNC_SOURCE_INTF_1 4
90#define SDE_VSYNC_SOURCE_INTF_2 5
91#define SDE_VSYNC_SOURCE_INTF_3 6
92#define SDE_VSYNC_SOURCE_WD_TIMER_4 11
93#define SDE_VSYNC_SOURCE_WD_TIMER_3 12
94#define SDE_VSYNC_SOURCE_WD_TIMER_2 13
95#define SDE_VSYNC_SOURCE_WD_TIMER_1 14
96#define SDE_VSYNC_SOURCE_WD_TIMER_0 15
97
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -040098enum sde_hw_blk_type {
99 SDE_HW_BLK_TOP = 0,
100 SDE_HW_BLK_SSPP,
101 SDE_HW_BLK_LM,
102 SDE_HW_BLK_DSPP,
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530103 SDE_HW_BLK_DS,
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400104 SDE_HW_BLK_CTL,
105 SDE_HW_BLK_CDM,
106 SDE_HW_BLK_PINGPONG,
107 SDE_HW_BLK_INTF,
108 SDE_HW_BLK_WB,
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800109 SDE_HW_BLK_DSC,
Alan Kwong4dd64c82017-02-04 18:41:51 -0800110 SDE_HW_BLK_ROT,
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400111 SDE_HW_BLK_MAX,
112};
113
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700114enum sde_mdp {
115 MDP_TOP = 0x1,
116 MDP_MAX,
117};
118
119enum sde_sspp {
120 SSPP_NONE,
121 SSPP_VIG0,
122 SSPP_VIG1,
123 SSPP_VIG2,
124 SSPP_VIG3,
125 SSPP_RGB0,
126 SSPP_RGB1,
127 SSPP_RGB2,
128 SSPP_RGB3,
129 SSPP_DMA0,
130 SSPP_DMA1,
131 SSPP_DMA2,
132 SSPP_DMA3,
133 SSPP_CURSOR0,
134 SSPP_CURSOR1,
135 SSPP_MAX
136};
137
138enum sde_sspp_type {
139 SSPP_TYPE_VIG,
140 SSPP_TYPE_RGB,
141 SSPP_TYPE_DMA,
142 SSPP_TYPE_CURSOR,
143 SSPP_TYPE_MAX
144};
145
146enum sde_lm {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400147 LM_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700148 LM_1,
149 LM_2,
150 LM_3,
151 LM_4,
152 LM_5,
153 LM_6,
154 LM_MAX
155};
156
157enum sde_stage {
158 SDE_STAGE_BASE = 0,
159 SDE_STAGE_0,
160 SDE_STAGE_1,
161 SDE_STAGE_2,
162 SDE_STAGE_3,
163 SDE_STAGE_4,
164 SDE_STAGE_5,
165 SDE_STAGE_6,
Veera Sundaram Sankaran370b9912017-01-10 18:03:42 -0800166 SDE_STAGE_7,
167 SDE_STAGE_8,
168 SDE_STAGE_9,
169 SDE_STAGE_10,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700170 SDE_STAGE_MAX
171};
172enum sde_dspp {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400173 DSPP_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700174 DSPP_1,
175 DSPP_2,
176 DSPP_3,
177 DSPP_MAX
178};
179
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530180enum sde_ds {
181 DS_TOP,
182 DS_0,
183 DS_1,
184 DS_MAX
185};
186
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700187enum sde_ctl {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400188 CTL_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700189 CTL_1,
190 CTL_2,
191 CTL_3,
192 CTL_4,
193 CTL_MAX
194};
195
196enum sde_cdm {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400197 CDM_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700198 CDM_1,
199 CDM_MAX
200};
201
202enum sde_pingpong {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400203 PINGPONG_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700204 PINGPONG_1,
205 PINGPONG_2,
206 PINGPONG_3,
207 PINGPONG_4,
Ben Chan78647cd2016-06-26 22:02:47 -0400208 PINGPONG_S0,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700209 PINGPONG_MAX
210};
211
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800212enum sde_dsc {
213 DSC_NONE = 0,
214 DSC_0,
215 DSC_1,
216 DSC_2,
217 DSC_3,
218 DSC_4,
219 DSC_5,
220 DSC_MAX
221};
222
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700223enum sde_intf {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400224 INTF_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700225 INTF_1,
226 INTF_2,
227 INTF_3,
228 INTF_4,
229 INTF_5,
230 INTF_6,
231 INTF_MAX
232};
233
234enum sde_intf_type {
235 INTF_NONE = 0x0,
236 INTF_DSI = 0x1,
237 INTF_HDMI = 0x3,
238 INTF_LCDC = 0x5,
239 INTF_EDP = 0x9,
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700240 INTF_DP = 0xa,
Alan Kwongbb27c092016-07-20 16:41:25 -0400241 INTF_TYPE_MAX,
242
243 /* virtual interfaces */
244 INTF_WB = 0x100,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700245};
246
247enum sde_intf_mode {
248 INTF_MODE_NONE = 0,
249 INTF_MODE_CMD,
250 INTF_MODE_VIDEO,
251 INTF_MODE_WB_BLOCK,
252 INTF_MODE_WB_LINE,
253 INTF_MODE_MAX
254};
255
256enum sde_wb {
257 WB_0 = 1,
258 WB_1,
259 WB_2,
260 WB_3,
261 WB_MAX
262};
263
264enum sde_ad {
265 AD_0 = 0x1,
266 AD_1,
267 AD_MAX
268};
269
Ben Chan78647cd2016-06-26 22:02:47 -0400270enum sde_cwb {
271 CWB_0 = 0x1,
272 CWB_1,
273 CWB_2,
274 CWB_3,
275 CWB_MAX
276};
277
278enum sde_wd_timer {
279 WD_TIMER_0 = 0x1,
280 WD_TIMER_1,
281 WD_TIMER_2,
282 WD_TIMER_3,
283 WD_TIMER_4,
284 WD_TIMER_5,
285 WD_TIMER_MAX
286};
287
Alan Kwongdfa8c082016-07-29 04:10:00 -0400288enum sde_vbif {
289 VBIF_0,
290 VBIF_1,
291 VBIF_MAX,
292 VBIF_RT = VBIF_0,
293 VBIF_NRT = VBIF_1
294};
295
296enum sde_iommu_domain {
297 SDE_IOMMU_DOMAIN_UNSECURE,
298 SDE_IOMMU_DOMAIN_SECURE,
299 SDE_IOMMU_DOMAIN_MAX
300};
301
Alan Kwong4dd64c82017-02-04 18:41:51 -0800302enum sde_rot {
303 ROT_0 = 1,
304 ROT_MAX
305};
306
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700307enum sde_inline_rot {
308 INLINE_ROT_NONE,
309 INLINE_ROT0_SSPP,
310 INLINE_ROT0_WB,
311 INLINE_ROT_MAX
312};
313
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700314/**
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400315 * SDE HW,Component order color map
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700316 */
317enum {
318 C0_G_Y = 0,
319 C1_B_Cb = 1,
320 C2_R_Cr = 2,
321 C3_ALPHA = 3
322};
323
324/**
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400325 * enum sde_plane_type - defines how the color component pixel packing
326 * @SDE_PLANE_INTERLEAVED : Color components in single plane
327 * @SDE_PLANE_PLANAR : Color component in separate planes
328 * @SDE_PLANE_PSEUDO_PLANAR : Chroma components interleaved in separate plane
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700329 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400330enum sde_plane_type {
331 SDE_PLANE_INTERLEAVED,
332 SDE_PLANE_PLANAR,
333 SDE_PLANE_PSEUDO_PLANAR,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700334};
335
336/**
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400337 * enum sde_chroma_samp_type - chroma sub-samplng type
338 * @SDE_CHROMA_RGB : No chroma subsampling
339 * @SDE_CHROMA_H2V1 : Chroma pixels are horizontally subsampled
340 * @SDE_CHROMA_H1V2 : Chroma pixels are vertically subsampled
341 * @SDE_CHROMA_420 : 420 subsampling
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700342 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400343enum sde_chroma_samp_type {
344 SDE_CHROMA_RGB,
345 SDE_CHROMA_H2V1,
346 SDE_CHROMA_H1V2,
347 SDE_CHROMA_420
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700348};
349
350/**
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400351 * sde_fetch_type - Defines How SDE HW fetches data
352 * @SDE_FETCH_LINEAR : fetch is line by line
353 * @SDE_FETCH_TILE : fetches data in Z order from a tile
354 * @SDE_FETCH_UBWC : fetch and decompress data
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700355 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400356enum sde_fetch_type {
357 SDE_FETCH_LINEAR,
358 SDE_FETCH_TILE,
359 SDE_FETCH_UBWC
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700360};
361
362/**
363 * Value of enum chosen to fit the number of bits
364 * expected by the HW programming.
365 */
366enum {
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400367 COLOR_ALPHA_1BIT = 0,
368 COLOR_ALPHA_4BIT = 1,
369 COLOR_4BIT = 0,
370 COLOR_5BIT = 1, /* No 5-bit Alpha */
371 COLOR_6BIT = 2, /* 6-Bit Alpha also = 2 */
372 COLOR_8BIT = 3, /* 8-Bit Alpha also = 3 */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700373};
374
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400375/**
376 * enum sde_3d_blend_mode
377 * Desribes how the 3d data is blended
378 * @BLEND_3D_NONE : 3d blending not enabled
379 * @BLEND_3D_FRAME_INT : Frame interleaving
380 * @BLEND_3D_H_ROW_INT : Horizontal row interleaving
381 * @BLEND_3D_V_ROW_INT : vertical row interleaving
382 * @BLEND_3D_COL_INT : column interleaving
383 * @BLEND_3D_MAX :
384 */
385enum sde_3d_blend_mode {
386 BLEND_3D_NONE = 0,
387 BLEND_3D_FRAME_INT,
388 BLEND_3D_H_ROW_INT,
389 BLEND_3D_V_ROW_INT,
390 BLEND_3D_COL_INT,
391 BLEND_3D_MAX
392};
393
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400394/** struct sde_format - defines the format configuration which
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400395 * allows SDE HW to correctly fetch and decode the format
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400396 * @base: base msm_format struture containing fourcc code
397 * @fetch_planes: how the color components are packed in pixel format
398 * @element: element color ordering
399 * @bits: element bit widths
400 * @chroma_sample: chroma sub-samplng type
401 * @unpack_align_msb: unpack aligned, 0 to LSB, 1 to MSB
402 * @unpack_tight: 0 for loose, 1 for tight
403 * @unpack_count: 0 = 1 component, 1 = 2 component
404 * @bpp: bytes per pixel
405 * @alpha_enable: whether the format has an alpha channel
406 * @num_planes: number of planes (including meta data planes)
407 * @fetch_mode: linear, tiled, or ubwc hw fetch behavior
408 * @is_yuv: is format a yuv variant
409 * @flag: usage bit flags
410 * @tile_width: format tile width
411 * @tile_height: format tile height
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700412 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400413struct sde_format {
414 struct msm_format base;
415 enum sde_plane_type fetch_planes;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700416 u8 element[SDE_MAX_PLANES];
417 u8 bits[SDE_MAX_PLANES];
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400418 enum sde_chroma_samp_type chroma_sample;
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400419 u8 unpack_align_msb;
420 u8 unpack_tight;
421 u8 unpack_count;
422 u8 bpp;
423 u8 alpha_enable;
424 u8 num_planes;
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400425 enum sde_fetch_type fetch_mode;
abeykun2997c812016-10-04 11:34:15 -0400426 DECLARE_BITMAP(flag, SDE_FORMAT_FLAG_BIT_MAX);
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400427 u16 tile_width;
428 u16 tile_height;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700429};
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400430#define to_sde_format(x) container_of(x, struct sde_format, base)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700431
432/**
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400433 * struct sde_hw_fmt_layout - format information of the source pixel data
434 * @format: pixel format parameters
435 * @num_planes: number of planes (including meta data planes)
436 * @width: image width
437 * @height: image height
438 * @total_size: total size in bytes
439 * @plane_addr: address of each plane
440 * @plane_size: length of each plane
441 * @plane_pitch: pitch of each plane
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700442 */
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400443struct sde_hw_fmt_layout {
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400444 const struct sde_format *format;
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400445 uint32_t num_planes;
446 uint32_t width;
447 uint32_t height;
448 uint32_t total_size;
449 uint32_t plane_addr[SDE_MAX_PLANES];
450 uint32_t plane_size[SDE_MAX_PLANES];
451 uint32_t plane_pitch[SDE_MAX_PLANES];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700452};
453
454struct sde_rect {
455 u16 x;
456 u16 y;
457 u16 w;
458 u16 h;
459};
460
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700461struct sde_csc_cfg {
Clarence Ip373f8592016-05-26 00:58:42 -0400462 /* matrix coefficients in S15.16 format */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700463 uint32_t csc_mv[SDE_CSC_MATRIX_COEFF_SIZE];
464 uint32_t csc_pre_bv[SDE_CSC_BIAS_SIZE];
465 uint32_t csc_post_bv[SDE_CSC_BIAS_SIZE];
466 uint32_t csc_pre_lv[SDE_CSC_CLAMP_SIZE];
467 uint32_t csc_post_lv[SDE_CSC_CLAMP_SIZE];
468};
469
470/**
471 * struct sde_mdss_color - mdss color description
472 * color 0 : green
473 * color 1 : blue
474 * color 2 : red
475 * color 3 : alpha
476 */
477struct sde_mdss_color {
478 u32 color_0;
479 u32 color_1;
480 u32 color_2;
481 u32 color_3;
482};
483
Clarence Ip4ce59322016-06-26 22:27:51 -0400484/*
485 * Define bit masks for h/w logging.
486 */
487#define SDE_DBG_MASK_NONE (1 << 0)
488#define SDE_DBG_MASK_CDM (1 << 1)
489#define SDE_DBG_MASK_DSPP (1 << 2)
490#define SDE_DBG_MASK_INTF (1 << 3)
491#define SDE_DBG_MASK_LM (1 << 4)
492#define SDE_DBG_MASK_CTL (1 << 5)
493#define SDE_DBG_MASK_PINGPONG (1 << 6)
494#define SDE_DBG_MASK_SSPP (1 << 7)
495#define SDE_DBG_MASK_WB (1 << 8)
Lloyd Atkinsonbb87b5b2016-06-13 18:31:15 -0400496#define SDE_DBG_MASK_TOP (1 << 9)
Alan Kwong5d324e42016-07-28 22:56:18 -0400497#define SDE_DBG_MASK_VBIF (1 << 10)
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800498#define SDE_DBG_MASK_DSC (1 << 11)
Alan Kwong4dd64c82017-02-04 18:41:51 -0800499#define SDE_DBG_MASK_ROT (1 << 12)
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530500#define SDE_DBG_MASK_DS (1 << 13)
Clarence Ip4ce59322016-06-26 22:27:51 -0400501
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700502/**
503 * struct sde_hw_cp_cfg: hardware dspp/lm feature payload.
504 * @payload: Feature specific payload.
505 * @len: Length of the payload.
Gopikrishnaiah Anandan7e3e3f52016-12-22 11:13:05 -0800506 * @ctl: control pointer associated with dspp/lm.
Gopikrishnaiah Anandanf5818e02017-01-30 10:46:58 -0800507 * @last_feature: last feature that will be set.
Gopikrishnaiah Anandan9ba43782017-01-31 18:23:08 -0800508 * @num_of_mixers: number of layer mixers for the display.
509 * @mixer_info: mixer info pointer associated with lm.
510 * @displayv: height of the display.
511 * @displayh: width of the display.
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700512 */
513struct sde_hw_cp_cfg {
514 void *payload;
515 u32 len;
Gopikrishnaiah Anandan7e3e3f52016-12-22 11:13:05 -0800516 void *ctl;
Gopikrishnaiah Anandanf5818e02017-01-30 10:46:58 -0800517 u32 last_feature;
Gopikrishnaiah Anandan9ba43782017-01-31 18:23:08 -0800518 u32 num_of_mixers;
519 void *mixer_info;
520 u32 displayv;
521 u32 displayh;
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700522};
523
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800524/**
525 * struct sde_hw_dim_layer: dim layer configs
526 * @flags: Flag to represent INCLUSIVE/EXCLUSIVE
527 * @stage: Blending stage of dim layer
528 * @color_fill: Color fill to be used for the layer
529 * @rect: Dim layer coordinates
530 */
531struct sde_hw_dim_layer {
532 uint32_t flags;
533 uint32_t stage;
534 struct sde_mdss_color color_fill;
535 struct sde_rect rect;
536};
537
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700538/**
539 * struct sde_splash_lm_hw - Struct contains LM block properties
540 * @lm_id: stores the current LM ID
541 * @ctl_id: stores the current CTL ID associated with the LM.
542 * @lm_reg_value:Store the LM block register value
543 */
544struct sde_splash_lm_hw {
545 u8 lm_id;
546 u8 ctl_id;
547 u32 lm_reg_value;
548};
549
550/**
551 * struct ctl_top - Struct contains CTL block properties
552 * @value: Store the CTL block register value
553 * @mode_sel: stores the mode selected in the CTL block
554 * @dspp_sel: stores the dspp selected in the CTL block
555 * @pp_sel: stores the pp selected in the CTL block
556 * @intf_sel: stores the intf selected in the CTL block
557 * @lm: Pointer to store the list of LMs in the CTL block
558 * @ctl_lm_cnt: stores the active number of MDSS "LM" blocks in the CTL block
559 */
560struct ctl_top {
561 u32 value;
562 u8 mode_sel;
563 u8 dspp_sel;
564 u8 pp_sel;
565 u8 intf_sel;
566 struct sde_splash_lm_hw lm[LM_MAX - LM_0];
567 u8 ctl_lm_cnt;
568};
569
570/**
571 * struct sde_splash_data - Struct contains details of continuous splash
Chandan Uddaraju9bb109a2017-10-29 18:08:51 -0700572 * memory region and initial pipeline configuration.
573 * @smmu_handoff_pending:boolean to notify handoff from splash memory to smmu
574 * @splash_base: Base address of continuous splash region reserved
575 * by bootloader
576 * @splash_size: Size of continuous splash region
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700577 * @top: struct ctl_top objects
578 * @ctl_ids: stores the valid MDSS ctl block ids for the current mode
579 * @lm_ids: stores the valid MDSS layer mixer block ids for the current mode
580 * @dsc_ids: stores the valid MDSS DSC block ids for the current mode
581 * @ctl_top_cnt:stores the active number of MDSS "top" blks of the current mode
582 * @lm_cnt: stores the active number of MDSS "LM" blks for the current mode
583 * @dsc_cnt: stores the active number of MDSS "dsc" blks for the current mode
584 */
585struct sde_splash_data {
Chandan Uddaraju9bb109a2017-10-29 18:08:51 -0700586 bool smmu_handoff_pending;
587 unsigned long splash_base;
588 u32 splash_size;
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700589 struct ctl_top top[CTL_MAX - CTL_0];
590 u8 ctl_ids[CTL_MAX - CTL_0];
591 u8 lm_ids[LM_MAX - LM_0];
592 u8 dsc_ids[DSC_MAX - DSC_0];
593 u8 ctl_top_cnt;
594 u8 lm_cnt;
595 u8 dsc_cnt;
596};
597
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700598#endif /* _SDE_HW_MDSS_H */