PDK API Guide for J721E
csl_dssTop.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
67 #ifndef CSL_DSSTOP_H_
68 #define CSL_DSSTOP_H_
69 
70 /* ========================================================================== */
71 /* Include Files */
72 /* ========================================================================== */
73 
74 #include <ti/csl/soc.h>
76 #include <ti/csl/cslr_dss.h>
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 
82 /* ========================================================================== */
83 /* Macros & Typedefs */
84 /* ========================================================================== */
85 
94 #define CSL_DSS_VID_PIPE_TYPE_VID ((uint32_t) 0x0)
95 
96 #define CSL_DSS_VID_PIPE_TYPE_VIDL ((uint32_t) 0x1)
97 /* @} */
98 
107 #define CSL_DSS_COMM_REG_ID_0 ((uint32_t) 0x0U)
108 
109 #define CSL_DSS_COMM_REG_ID_1 ((uint32_t) 0x1U)
110 
111 #define CSL_DSS_COMM_REG_ID_2 ((uint32_t) 0x2U)
112 
113 #define CSL_DSS_COMM_REG_ID_3 ((uint32_t) 0x3U)
114 
115 #define CSL_DSS_COMM_REG_ID_MAX ((uint32_t) 0x4U)
116 /* @} */
117 
126 #define CSL_DSS_VID_PIPE_ID_VID1 ((uint32_t) 0x0U)
127 
128 #define CSL_DSS_VID_PIPE_ID_VIDL1 ((uint32_t) 0x1U)
129 
130 #define CSL_DSS_VID_PIPE_ID_VID2 ((uint32_t) 0x2U)
131 
132 #define CSL_DSS_VID_PIPE_ID_VIDL2 ((uint32_t) 0x3U)
133 
134 #define CSL_DSS_VID_PIPE_ID_MAX ((uint32_t) 0x4U)
135 /* @} */
136 
145 #define CSL_DSS_OVERLAY_ID_1 ((uint32_t) 0x0U)
146 
147 #define CSL_DSS_OVERLAY_ID_2 ((uint32_t) 0x1U)
148 
149 #define CSL_DSS_OVERLAY_ID_3 ((uint32_t) 0x2U)
150 
151 #define CSL_DSS_OVERLAY_ID_4 ((uint32_t) 0x3U)
152 
153 #define CSL_DSS_OVERLAY_ID_MAX ((uint32_t) 0x4U)
154 /* @} */
155 
164 #define CSL_DSS_VP_ID_1 ((uint32_t) 0x0U)
165 
166 #define CSL_DSS_VP_ID_2 ((uint32_t) 0x1U)
167 
168 #define CSL_DSS_VP_ID_3 ((uint32_t) 0x2U)
169 
170 #define CSL_DSS_VP_ID_4 ((uint32_t) 0x3U)
171 
172 #define CSL_DSS_VP_ID_MAX ((uint32_t) 0x4U)
173 /* @} */
174 
183 #define CSL_DSS_VP_ID_1_MASK ((uint32_t) 0x1U)
184 
185 #define CSL_DSS_VP_ID_2_MASK ((uint32_t) 0x2U)
186 
187 #define CSL_DSS_VP_ID_3_MASK ((uint32_t) 0x4U)
188 
189 #define CSL_DSS_VP_ID_4_MASK ((uint32_t) 0x8U)
190 /* @} */
191 
200 #define CSL_DSS_WB_PIPE_ID_1 ((uint32_t) 0x0U)
201 
202 #define CSL_DSS_WB_PIPE_ID_MAX ((uint32_t) 0x1U)
203 /* @} */
204 
213 #define CSL_DSS_CSC_RANGE_LIMITED ((uint32_t) 0x0U)
214 
215 #define CSL_DSS_CSC_RANGE_FULL ((uint32_t) 0x1U)
216 
217 #define CSL_DSS_CSC_RANGE_CUSTOM ((uint32_t) 0x2U)
218 /* @} */
219 
228 #define CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT \
229  ((uint32_t) CSL_DSS_VID1_SAFETY_ATTRIBUTES_CAPTUREMODE_VAL_FRAMEFREEZE)
230 
231 #define CSL_DSS_SAFETY_CHK_DATA_INTEGRITY \
232  ((uint32_t) CSL_DSS_VID1_SAFETY_ATTRIBUTES_CAPTUREMODE_VAL_DATACHECK)
233 /* @} */
234 
243 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO \
244  ((uint32_t) CSL_DSS_VID1_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_DISABLE)
245 
246 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_EVEN \
247  ((uint32_t) CSL_DSS_VID1_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_EVEN)
248 
249 #define CSL_DSS_SAFETY_CHK_FRAME_SKIP_ODD \
250  ((uint32_t) CSL_DSS_VID1_SAFETY_ATTRIBUTES_FRAMESKIP_VAL_ODD)
251 /* @} */
252 
260 #define CSL_DSS_DPI_ID_DPI_0 ((uint32_t) 0x0U)
261 
262 #define CSL_DSS_DPI_ID_DPI_1 ((uint32_t) 0x1U)
263 
264 #define CSL_DSS_DPI_ID_EDP_0 ((uint32_t) 0x2U)
265 
266 #define CSL_DSS_DPI_ID_EDP_1 ((uint32_t) 0x3U)
267 
268 #define CSL_DSS_DPI_ID_EDP_2 ((uint32_t) 0x4U)
269 
270 #define CSL_DSS_DPI_ID_EDP_3 ((uint32_t) 0x5U)
271 
272 #define CSL_DSS_DPI_ID_DSI ((uint32_t) 0x6U)
273 
274 #define CSL_DSS_DPI_ID_MAX ((uint32_t) 0x7U)
275 /* @} */
276 
278 #define CSL_DSS_NUM_LUT_ENTRIES ((uint32_t) 1024U)
279 
281 #define CSL_DSS_MODULE_INVALID ((uint32_t) 0xFFU)
282 
283 /* ========================================================================== */
284 /* Structure Declarations */
285 /* ========================================================================== */
286 
290 typedef struct
291 {
292  uint32_t cscRange;
295  int32_t c00;
297  int32_t c01;
299  int32_t c02;
301  int32_t c10;
303  int32_t c11;
305  int32_t c12;
307  int32_t c20;
309  int32_t c21;
311  int32_t c22;
313  int32_t preOffset1;
315  int32_t preOffset2;
317  int32_t preOffset3;
319  int32_t postOffset1;
321  int32_t postOffset2;
323  int32_t postOffset3;
326 
330 typedef struct
331 {
332  uint32_t safetyChkEnable;
336  uint32_t safetyChkMode;
343  uint32_t thresholdValue;
347  uint32_t frameSkip;
373 
374 /* ========================================================================== */
375 /* Function Declarations */
376 /* ========================================================================== */
377 
378 /* None */
379 
380 /* ========================================================================== */
381 /* Static Function Declarations */
382 /* ========================================================================== */
383 
391 static inline void CSL_dssCscCoeffInit(
392  CSL_DssCscCoeff *cscCoeff);
393 
401 static inline void CSL_dssSafetyChkCfgInit(
402  CSL_DssSafetyChkCfg *safetyCfg);
403 
404 /* ========================================================================== */
405 /* Static Function Definitions */
406 /* ========================================================================== */
407 
408 static inline void CSL_dssCscCoeffInit(
409  CSL_DssCscCoeff *cscCoeff)
410 {
411  if(NULL != cscCoeff)
412  {
414  cscCoeff->c00 = 0;
415  cscCoeff->c01 = 0;
416  cscCoeff->c02 = 0;
417  cscCoeff->c10 = 0;
418  cscCoeff->c11 = 0;
419  cscCoeff->c12 = 0;
420  cscCoeff->c20 = 0;
421  cscCoeff->c21 = 0;
422  cscCoeff->c22 = 0;
423  cscCoeff->preOffset1 = 0;
424  cscCoeff->preOffset2 = 0;
425  cscCoeff->preOffset3 = 0;
426  cscCoeff->postOffset1 = 0;
427  cscCoeff->postOffset2 = 0;
428  cscCoeff->postOffset3 = 0;
429  }
430 }
431 
432 static inline void CSL_dssSafetyChkCfgInit(
433  CSL_DssSafetyChkCfg *safetyCfg)
434 {
435  if(NULL != safetyCfg)
436  {
437  safetyCfg->safetyChkEnable = FALSE;
439  safetyCfg->seedSelectEnable = 0U;
440  safetyCfg->thresholdValue = FALSE;
442  safetyCfg->regionPos.startX = 0U;
443  safetyCfg->regionPos.startY = 0U;
444  safetyCfg->regionSize.width = 0U;
445  safetyCfg->regionSize.height = 0U;
446  }
447 }
448 
449 #ifdef __cplusplus
450 }
451 #endif
452 
453 #endif /* #ifndef CSL_DSSTOP_H_ */
454 
455 /* @} */
int32_t preOffset1
Definition: csl_dssTop.h:313
#define CSL_DSS_SAFETY_CHK_FRAME_FREEZE_DETECT
Frame freeze detect enabled.
Definition: csl_dssTop.h:228
Fvid2_SizeConfig regionSize
Definition: csl_dssTop.h:361
Structure containing size configuration.
Definition: csl_fvid2_dataTypes.h:1378
Structure containing position configuration - used in VCOMP and CIG.
Definition: csl_fvid2_dataTypes.h:1366
int32_t c21
Definition: csl_dssTop.h:309
UInt32 height
Definition: csl_fvid2_dataTypes.h:1382
uint32_t seedSelectEnable
Definition: csl_dssTop.h:339
#define FALSE
Definition: csl_types.h:55
int32_t postOffset2
Definition: csl_dssTop.h:321
int32_t c22
Definition: csl_dssTop.h:311
static void CSL_dssSafetyChkCfgInit(CSL_DssSafetyChkCfg *safetyCfg)
CSL_DssSafetyChkCfg structure init function.
Definition: csl_dssTop.h:432
uint32_t frameSkip
Definition: csl_dssTop.h:347
int32_t c12
Definition: csl_dssTop.h:305
int32_t postOffset1
Definition: csl_dssTop.h:319
int32_t preOffset3
Definition: csl_dssTop.h:317
int32_t preOffset2
Definition: csl_dssTop.h:315
int32_t c10
Definition: csl_dssTop.h:301
uint32_t startY
Definition: csl_fvid2_dataTypes.h:1370
uint32_t safetyChkEnable
Definition: csl_dssTop.h:332
int32_t c00
Definition: csl_dssTop.h:295
CSL FVID2 Datatypes.
#define CSL_DSS_SAFETY_CHK_FRAME_SKIP_NO
No frames are skipped.
Definition: csl_dssTop.h:243
uint32_t startX
Definition: csl_fvid2_dataTypes.h:1368
uint32_t safetyChkMode
Definition: csl_dssTop.h:336
int32_t postOffset3
Definition: csl_dssTop.h:323
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
static void CSL_dssCscCoeffInit(CSL_DssCscCoeff *cscCoeff)
CSL_DssCscCoeff structure init function.
Definition: csl_dssTop.h:408
int32_t c01
Definition: csl_dssTop.h:297
Fvid2_PosConfig regionPos
Definition: csl_dssTop.h:350
Structure containing coefficients for Color Space Conversion.
Definition: csl_dssTop.h:290
uint32_t cscRange
Definition: csl_dssTop.h:292
UInt32 width
Definition: csl_fvid2_dataTypes.h:1380
uint32_t thresholdValue
Definition: csl_dssTop.h:343
#define CSL_DSS_CSC_RANGE_LIMITED
Limited range selected.
Definition: csl_dssTop.h:213
Configuration for doing safety checks.
Definition: csl_dssTop.h:330
int32_t c02
Definition: csl_dssTop.h:299
int32_t c20
Definition: csl_dssTop.h:307
int32_t c11
Definition: csl_dssTop.h:303