blob: 322613daf08eb946976513d418ab193e377cd7e1 [file] [log] [blame]
Narender Ankamdc32cdf2020-03-16 17:21:08 +05301/* Copyright (c) 2015-2020, 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
Chirag Khuranaed859f52019-11-20 18:18:12 +053068#define TO_S15D16(_x_) ((_x_) << 7)
69
Dhaval Patel48c76022016-09-01 17:51:23 -070070#define SDE_BLEND_FG_ALPHA_FG_CONST (0 << 0)
71#define SDE_BLEND_FG_ALPHA_BG_CONST (1 << 0)
72#define SDE_BLEND_FG_ALPHA_FG_PIXEL (2 << 0)
73#define SDE_BLEND_FG_ALPHA_BG_PIXEL (3 << 0)
74#define SDE_BLEND_FG_INV_ALPHA (1 << 2)
75#define SDE_BLEND_FG_MOD_ALPHA (1 << 3)
76#define SDE_BLEND_FG_INV_MOD_ALPHA (1 << 4)
77#define SDE_BLEND_FG_TRANSP_EN (1 << 5)
78#define SDE_BLEND_BG_ALPHA_FG_CONST (0 << 8)
79#define SDE_BLEND_BG_ALPHA_BG_CONST (1 << 8)
80#define SDE_BLEND_BG_ALPHA_FG_PIXEL (2 << 8)
81#define SDE_BLEND_BG_ALPHA_BG_PIXEL (3 << 8)
82#define SDE_BLEND_BG_INV_ALPHA (1 << 10)
83#define SDE_BLEND_BG_MOD_ALPHA (1 << 11)
84#define SDE_BLEND_BG_INV_MOD_ALPHA (1 << 12)
85#define SDE_BLEND_BG_TRANSP_EN (1 << 13)
86
Dhaval Patelaab9b522017-07-20 12:38:46 -070087#define SDE_VSYNC0_SOURCE_GPIO 0
88#define SDE_VSYNC1_SOURCE_GPIO 1
89#define SDE_VSYNC2_SOURCE_GPIO 2
90#define SDE_VSYNC_SOURCE_INTF_0 3
91#define SDE_VSYNC_SOURCE_INTF_1 4
92#define SDE_VSYNC_SOURCE_INTF_2 5
93#define SDE_VSYNC_SOURCE_INTF_3 6
94#define SDE_VSYNC_SOURCE_WD_TIMER_4 11
95#define SDE_VSYNC_SOURCE_WD_TIMER_3 12
96#define SDE_VSYNC_SOURCE_WD_TIMER_2 13
97#define SDE_VSYNC_SOURCE_WD_TIMER_1 14
98#define SDE_VSYNC_SOURCE_WD_TIMER_0 15
99
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400100enum sde_hw_blk_type {
101 SDE_HW_BLK_TOP = 0,
102 SDE_HW_BLK_SSPP,
103 SDE_HW_BLK_LM,
104 SDE_HW_BLK_DSPP,
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530105 SDE_HW_BLK_DS,
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400106 SDE_HW_BLK_CTL,
107 SDE_HW_BLK_CDM,
108 SDE_HW_BLK_PINGPONG,
109 SDE_HW_BLK_INTF,
110 SDE_HW_BLK_WB,
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800111 SDE_HW_BLK_DSC,
Alan Kwong4dd64c82017-02-04 18:41:51 -0800112 SDE_HW_BLK_ROT,
Lloyd Atkinson6b3b9dd2016-08-10 18:45:31 -0400113 SDE_HW_BLK_MAX,
114};
115
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700116enum sde_mdp {
117 MDP_TOP = 0x1,
118 MDP_MAX,
119};
120
121enum sde_sspp {
122 SSPP_NONE,
123 SSPP_VIG0,
124 SSPP_VIG1,
125 SSPP_VIG2,
126 SSPP_VIG3,
127 SSPP_RGB0,
128 SSPP_RGB1,
129 SSPP_RGB2,
130 SSPP_RGB3,
131 SSPP_DMA0,
132 SSPP_DMA1,
133 SSPP_DMA2,
134 SSPP_DMA3,
135 SSPP_CURSOR0,
136 SSPP_CURSOR1,
137 SSPP_MAX
138};
139
140enum sde_sspp_type {
141 SSPP_TYPE_VIG,
142 SSPP_TYPE_RGB,
143 SSPP_TYPE_DMA,
144 SSPP_TYPE_CURSOR,
145 SSPP_TYPE_MAX
146};
147
148enum sde_lm {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400149 LM_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700150 LM_1,
151 LM_2,
152 LM_3,
153 LM_4,
154 LM_5,
155 LM_6,
156 LM_MAX
157};
158
159enum sde_stage {
160 SDE_STAGE_BASE = 0,
161 SDE_STAGE_0,
162 SDE_STAGE_1,
163 SDE_STAGE_2,
164 SDE_STAGE_3,
165 SDE_STAGE_4,
166 SDE_STAGE_5,
167 SDE_STAGE_6,
Veera Sundaram Sankaran370b9912017-01-10 18:03:42 -0800168 SDE_STAGE_7,
169 SDE_STAGE_8,
170 SDE_STAGE_9,
171 SDE_STAGE_10,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700172 SDE_STAGE_MAX
173};
174enum sde_dspp {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400175 DSPP_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700176 DSPP_1,
177 DSPP_2,
178 DSPP_3,
179 DSPP_MAX
180};
181
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530182enum sde_ds {
183 DS_TOP,
184 DS_0,
185 DS_1,
186 DS_MAX
187};
188
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700189enum sde_ctl {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400190 CTL_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700191 CTL_1,
192 CTL_2,
193 CTL_3,
194 CTL_4,
195 CTL_MAX
196};
197
198enum sde_cdm {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400199 CDM_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700200 CDM_1,
201 CDM_MAX
202};
203
204enum sde_pingpong {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400205 PINGPONG_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700206 PINGPONG_1,
207 PINGPONG_2,
208 PINGPONG_3,
209 PINGPONG_4,
Ben Chan78647cd2016-06-26 22:02:47 -0400210 PINGPONG_S0,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700211 PINGPONG_MAX
212};
213
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800214enum sde_dsc {
215 DSC_NONE = 0,
216 DSC_0,
217 DSC_1,
218 DSC_2,
219 DSC_3,
220 DSC_4,
221 DSC_5,
222 DSC_MAX
223};
224
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700225enum sde_intf {
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400226 INTF_0 = 1,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700227 INTF_1,
228 INTF_2,
229 INTF_3,
230 INTF_4,
231 INTF_5,
232 INTF_6,
233 INTF_MAX
234};
235
236enum sde_intf_type {
237 INTF_NONE = 0x0,
238 INTF_DSI = 0x1,
239 INTF_HDMI = 0x3,
240 INTF_LCDC = 0x5,
241 INTF_EDP = 0x9,
Dhaval Patel8bf7ff32016-07-20 18:13:24 -0700242 INTF_DP = 0xa,
Alan Kwongbb27c092016-07-20 16:41:25 -0400243 INTF_TYPE_MAX,
244
245 /* virtual interfaces */
246 INTF_WB = 0x100,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700247};
248
249enum sde_intf_mode {
250 INTF_MODE_NONE = 0,
251 INTF_MODE_CMD,
252 INTF_MODE_VIDEO,
253 INTF_MODE_WB_BLOCK,
254 INTF_MODE_WB_LINE,
255 INTF_MODE_MAX
256};
257
258enum sde_wb {
259 WB_0 = 1,
260 WB_1,
261 WB_2,
262 WB_3,
263 WB_MAX
264};
265
266enum sde_ad {
267 AD_0 = 0x1,
268 AD_1,
269 AD_MAX
270};
271
Ben Chan78647cd2016-06-26 22:02:47 -0400272enum sde_cwb {
273 CWB_0 = 0x1,
274 CWB_1,
275 CWB_2,
276 CWB_3,
277 CWB_MAX
278};
279
280enum sde_wd_timer {
281 WD_TIMER_0 = 0x1,
282 WD_TIMER_1,
283 WD_TIMER_2,
284 WD_TIMER_3,
285 WD_TIMER_4,
286 WD_TIMER_5,
287 WD_TIMER_MAX
288};
289
Alan Kwongdfa8c082016-07-29 04:10:00 -0400290enum sde_vbif {
291 VBIF_0,
292 VBIF_1,
293 VBIF_MAX,
294 VBIF_RT = VBIF_0,
295 VBIF_NRT = VBIF_1
296};
297
298enum sde_iommu_domain {
299 SDE_IOMMU_DOMAIN_UNSECURE,
300 SDE_IOMMU_DOMAIN_SECURE,
301 SDE_IOMMU_DOMAIN_MAX
302};
303
Alan Kwong4dd64c82017-02-04 18:41:51 -0800304enum sde_rot {
305 ROT_0 = 1,
306 ROT_MAX
307};
308
Veera Sundaram Sankaran1e71ccb2017-05-24 18:48:50 -0700309enum sde_inline_rot {
310 INLINE_ROT_NONE,
311 INLINE_ROT0_SSPP,
312 INLINE_ROT0_WB,
313 INLINE_ROT_MAX
314};
315
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700316/**
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400317 * SDE HW,Component order color map
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700318 */
319enum {
320 C0_G_Y = 0,
321 C1_B_Cb = 1,
322 C2_R_Cr = 2,
323 C3_ALPHA = 3
324};
325
326/**
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400327 * enum sde_plane_type - defines how the color component pixel packing
328 * @SDE_PLANE_INTERLEAVED : Color components in single plane
329 * @SDE_PLANE_PLANAR : Color component in separate planes
330 * @SDE_PLANE_PSEUDO_PLANAR : Chroma components interleaved in separate plane
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700331 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400332enum sde_plane_type {
333 SDE_PLANE_INTERLEAVED,
334 SDE_PLANE_PLANAR,
335 SDE_PLANE_PSEUDO_PLANAR,
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700336};
337
338/**
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400339 * enum sde_chroma_samp_type - chroma sub-samplng type
340 * @SDE_CHROMA_RGB : No chroma subsampling
341 * @SDE_CHROMA_H2V1 : Chroma pixels are horizontally subsampled
342 * @SDE_CHROMA_H1V2 : Chroma pixels are vertically subsampled
343 * @SDE_CHROMA_420 : 420 subsampling
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700344 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400345enum sde_chroma_samp_type {
346 SDE_CHROMA_RGB,
347 SDE_CHROMA_H2V1,
348 SDE_CHROMA_H1V2,
349 SDE_CHROMA_420
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700350};
351
352/**
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400353 * sde_fetch_type - Defines How SDE HW fetches data
354 * @SDE_FETCH_LINEAR : fetch is line by line
355 * @SDE_FETCH_TILE : fetches data in Z order from a tile
356 * @SDE_FETCH_UBWC : fetch and decompress data
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700357 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400358enum sde_fetch_type {
359 SDE_FETCH_LINEAR,
360 SDE_FETCH_TILE,
361 SDE_FETCH_UBWC
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700362};
363
364/**
365 * Value of enum chosen to fit the number of bits
366 * expected by the HW programming.
367 */
368enum {
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400369 COLOR_ALPHA_1BIT = 0,
370 COLOR_ALPHA_4BIT = 1,
371 COLOR_4BIT = 0,
372 COLOR_5BIT = 1, /* No 5-bit Alpha */
373 COLOR_6BIT = 2, /* 6-Bit Alpha also = 2 */
374 COLOR_8BIT = 3, /* 8-Bit Alpha also = 3 */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700375};
376
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400377/**
378 * enum sde_3d_blend_mode
379 * Desribes how the 3d data is blended
380 * @BLEND_3D_NONE : 3d blending not enabled
381 * @BLEND_3D_FRAME_INT : Frame interleaving
382 * @BLEND_3D_H_ROW_INT : Horizontal row interleaving
383 * @BLEND_3D_V_ROW_INT : vertical row interleaving
384 * @BLEND_3D_COL_INT : column interleaving
385 * @BLEND_3D_MAX :
386 */
387enum sde_3d_blend_mode {
388 BLEND_3D_NONE = 0,
389 BLEND_3D_FRAME_INT,
390 BLEND_3D_H_ROW_INT,
391 BLEND_3D_V_ROW_INT,
392 BLEND_3D_COL_INT,
393 BLEND_3D_MAX
394};
395
Chirag Khuranaed859f52019-11-20 18:18:12 +0530396enum sde_csc_type {
397 SDE_CSC_RGB2YUV_601L,
398 SDE_CSC_RGB2YUV_601FR,
Narender Ankamdc32cdf2020-03-16 17:21:08 +0530399 SDE_CSC_RGB2YUV_709L,
Narender Ankam08247f72019-12-23 18:57:49 +0530400 SDE_CSC_RGB2YUV_709FR,
Narender Ankamdc32cdf2020-03-16 17:21:08 +0530401 SDE_CSC_RGB2YUV_2020L,
402 SDE_CSC_RGB2YUV_2020FR,
Chirag Khuranaed859f52019-11-20 18:18:12 +0530403 SDE_MAX_CSC
404};
405
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400406/** struct sde_format - defines the format configuration which
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400407 * allows SDE HW to correctly fetch and decode the format
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400408 * @base: base msm_format struture containing fourcc code
409 * @fetch_planes: how the color components are packed in pixel format
410 * @element: element color ordering
411 * @bits: element bit widths
412 * @chroma_sample: chroma sub-samplng type
413 * @unpack_align_msb: unpack aligned, 0 to LSB, 1 to MSB
414 * @unpack_tight: 0 for loose, 1 for tight
415 * @unpack_count: 0 = 1 component, 1 = 2 component
416 * @bpp: bytes per pixel
417 * @alpha_enable: whether the format has an alpha channel
418 * @num_planes: number of planes (including meta data planes)
419 * @fetch_mode: linear, tiled, or ubwc hw fetch behavior
420 * @is_yuv: is format a yuv variant
421 * @flag: usage bit flags
422 * @tile_width: format tile width
423 * @tile_height: format tile height
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700424 */
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400425struct sde_format {
426 struct msm_format base;
427 enum sde_plane_type fetch_planes;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700428 u8 element[SDE_MAX_PLANES];
429 u8 bits[SDE_MAX_PLANES];
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400430 enum sde_chroma_samp_type chroma_sample;
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400431 u8 unpack_align_msb;
432 u8 unpack_tight;
433 u8 unpack_count;
434 u8 bpp;
435 u8 alpha_enable;
436 u8 num_planes;
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400437 enum sde_fetch_type fetch_mode;
abeykun2997c812016-10-04 11:34:15 -0400438 DECLARE_BITMAP(flag, SDE_FORMAT_FLAG_BIT_MAX);
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400439 u16 tile_width;
440 u16 tile_height;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700441};
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400442#define to_sde_format(x) container_of(x, struct sde_format, base)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700443
444/**
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400445 * struct sde_hw_fmt_layout - format information of the source pixel data
446 * @format: pixel format parameters
447 * @num_planes: number of planes (including meta data planes)
448 * @width: image width
449 * @height: image height
450 * @total_size: total size in bytes
451 * @plane_addr: address of each plane
452 * @plane_size: length of each plane
453 * @plane_pitch: pitch of each plane
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700454 */
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400455struct sde_hw_fmt_layout {
Lloyd Atkinson9a673492016-07-05 11:41:57 -0400456 const struct sde_format *format;
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -0400457 uint32_t num_planes;
458 uint32_t width;
459 uint32_t height;
460 uint32_t total_size;
461 uint32_t plane_addr[SDE_MAX_PLANES];
462 uint32_t plane_size[SDE_MAX_PLANES];
463 uint32_t plane_pitch[SDE_MAX_PLANES];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700464};
465
466struct sde_rect {
467 u16 x;
468 u16 y;
469 u16 w;
470 u16 h;
471};
472
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700473struct sde_csc_cfg {
Clarence Ip373f8592016-05-26 00:58:42 -0400474 /* matrix coefficients in S15.16 format */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700475 uint32_t csc_mv[SDE_CSC_MATRIX_COEFF_SIZE];
476 uint32_t csc_pre_bv[SDE_CSC_BIAS_SIZE];
477 uint32_t csc_post_bv[SDE_CSC_BIAS_SIZE];
478 uint32_t csc_pre_lv[SDE_CSC_CLAMP_SIZE];
479 uint32_t csc_post_lv[SDE_CSC_CLAMP_SIZE];
480};
481
482/**
483 * struct sde_mdss_color - mdss color description
484 * color 0 : green
485 * color 1 : blue
486 * color 2 : red
487 * color 3 : alpha
488 */
489struct sde_mdss_color {
490 u32 color_0;
491 u32 color_1;
492 u32 color_2;
493 u32 color_3;
494};
495
Clarence Ip4ce59322016-06-26 22:27:51 -0400496/*
497 * Define bit masks for h/w logging.
498 */
499#define SDE_DBG_MASK_NONE (1 << 0)
500#define SDE_DBG_MASK_CDM (1 << 1)
501#define SDE_DBG_MASK_DSPP (1 << 2)
502#define SDE_DBG_MASK_INTF (1 << 3)
503#define SDE_DBG_MASK_LM (1 << 4)
504#define SDE_DBG_MASK_CTL (1 << 5)
505#define SDE_DBG_MASK_PINGPONG (1 << 6)
506#define SDE_DBG_MASK_SSPP (1 << 7)
507#define SDE_DBG_MASK_WB (1 << 8)
Lloyd Atkinsonbb87b5b2016-06-13 18:31:15 -0400508#define SDE_DBG_MASK_TOP (1 << 9)
Alan Kwong5d324e42016-07-28 22:56:18 -0400509#define SDE_DBG_MASK_VBIF (1 << 10)
Jeykumar Sankaran5c2f0702017-03-09 18:03:15 -0800510#define SDE_DBG_MASK_DSC (1 << 11)
Alan Kwong4dd64c82017-02-04 18:41:51 -0800511#define SDE_DBG_MASK_ROT (1 << 12)
Sravanthi Kollukuduruacdc5912017-06-22 14:53:00 +0530512#define SDE_DBG_MASK_DS (1 << 13)
Clarence Ip4ce59322016-06-26 22:27:51 -0400513
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700514/**
515 * struct sde_hw_cp_cfg: hardware dspp/lm feature payload.
516 * @payload: Feature specific payload.
517 * @len: Length of the payload.
Gopikrishnaiah Anandan7e3e3f52016-12-22 11:13:05 -0800518 * @ctl: control pointer associated with dspp/lm.
Gopikrishnaiah Anandanf5818e02017-01-30 10:46:58 -0800519 * @last_feature: last feature that will be set.
Gopikrishnaiah Anandan9ba43782017-01-31 18:23:08 -0800520 * @num_of_mixers: number of layer mixers for the display.
521 * @mixer_info: mixer info pointer associated with lm.
522 * @displayv: height of the display.
523 * @displayh: width of the display.
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700524 */
525struct sde_hw_cp_cfg {
526 void *payload;
527 u32 len;
Gopikrishnaiah Anandan7e3e3f52016-12-22 11:13:05 -0800528 void *ctl;
Gopikrishnaiah Anandanf5818e02017-01-30 10:46:58 -0800529 u32 last_feature;
Gopikrishnaiah Anandan9ba43782017-01-31 18:23:08 -0800530 u32 num_of_mixers;
531 void *mixer_info;
532 u32 displayv;
533 u32 displayh;
Gopikrishnaiah Anandane0e5e0c2016-05-25 11:05:33 -0700534};
535
Veera Sundaram Sankaran3171ff82017-01-04 14:34:47 -0800536/**
537 * struct sde_hw_dim_layer: dim layer configs
538 * @flags: Flag to represent INCLUSIVE/EXCLUSIVE
539 * @stage: Blending stage of dim layer
540 * @color_fill: Color fill to be used for the layer
541 * @rect: Dim layer coordinates
542 */
543struct sde_hw_dim_layer {
544 uint32_t flags;
545 uint32_t stage;
546 struct sde_mdss_color color_fill;
547 struct sde_rect rect;
548};
549
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700550/**
551 * struct sde_splash_lm_hw - Struct contains LM block properties
552 * @lm_id: stores the current LM ID
553 * @ctl_id: stores the current CTL ID associated with the LM.
554 * @lm_reg_value:Store the LM block register value
555 */
556struct sde_splash_lm_hw {
557 u8 lm_id;
558 u8 ctl_id;
559 u32 lm_reg_value;
560};
561
562/**
563 * struct ctl_top - Struct contains CTL block properties
564 * @value: Store the CTL block register value
565 * @mode_sel: stores the mode selected in the CTL block
566 * @dspp_sel: stores the dspp selected in the CTL block
567 * @pp_sel: stores the pp selected in the CTL block
568 * @intf_sel: stores the intf selected in the CTL block
569 * @lm: Pointer to store the list of LMs in the CTL block
570 * @ctl_lm_cnt: stores the active number of MDSS "LM" blocks in the CTL block
571 */
572struct ctl_top {
573 u32 value;
574 u8 mode_sel;
575 u8 dspp_sel;
576 u8 pp_sel;
577 u8 intf_sel;
578 struct sde_splash_lm_hw lm[LM_MAX - LM_0];
579 u8 ctl_lm_cnt;
580};
581
582/**
583 * struct sde_splash_data - Struct contains details of continuous splash
Chandan Uddaraju9bb109a2017-10-29 18:08:51 -0700584 * memory region and initial pipeline configuration.
Gopikrishnaiah Anandanb38d3292018-02-28 19:25:15 -0800585 * @resource_handoff_pending: boolean to notify boot up resource handoff
586 * is pending.
Chandan Uddaraju9bb109a2017-10-29 18:08:51 -0700587 * @splash_base: Base address of continuous splash region reserved
588 * by bootloader
589 * @splash_size: Size of continuous splash region
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700590 * @top: struct ctl_top objects
591 * @ctl_ids: stores the valid MDSS ctl block ids for the current mode
592 * @lm_ids: stores the valid MDSS layer mixer block ids for the current mode
593 * @dsc_ids: stores the valid MDSS DSC block ids for the current mode
594 * @ctl_top_cnt:stores the active number of MDSS "top" blks of the current mode
595 * @lm_cnt: stores the active number of MDSS "LM" blks for the current mode
596 * @dsc_cnt: stores the active number of MDSS "dsc" blks for the current mode
Chandan Uddaraju9efbbe32017-11-09 23:57:05 -0800597 * @cont_splash_en: Stores the cont_splash status (enabled/disbled)
Ingrid Gallardo72cd1632018-02-28 15:26:37 -0800598 * @single_flush_en: Stores if the single flush is enabled.
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700599 */
600struct sde_splash_data {
Gopikrishnaiah Anandanb38d3292018-02-28 19:25:15 -0800601 bool resource_handoff_pending;
Chandan Uddaraju9bb109a2017-10-29 18:08:51 -0700602 unsigned long splash_base;
603 u32 splash_size;
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700604 struct ctl_top top[CTL_MAX - CTL_0];
605 u8 ctl_ids[CTL_MAX - CTL_0];
606 u8 lm_ids[LM_MAX - LM_0];
607 u8 dsc_ids[DSC_MAX - DSC_0];
608 u8 ctl_top_cnt;
609 u8 lm_cnt;
610 u8 dsc_cnt;
Chandan Uddaraju9efbbe32017-11-09 23:57:05 -0800611 bool cont_splash_en;
Ingrid Gallardo72cd1632018-02-28 15:26:37 -0800612 bool single_flush_en;
Shashank Babu Chinta Venkata5d641d42017-09-29 12:16:28 -0700613};
614
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700615#endif /* _SDE_HW_MDSS_H */