AM62x MCU+ SDK  10.01.00
csl_dssOverlay.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2023
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 
48 #ifndef CSL_DSSOVERLAY_H_
49 #define CSL_DSSOVERLAY_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 /* None */
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
64 
71 
79 #define CSL_DSS_OVERLAY_TRANS_COLOR_DEST \
80  ((uint32_t) CSL_DSS_OVR1_CONFIG_TCKLCDSELECTION_VAL_GDTK)
81 
82 #define CSL_DSS_OVERLAY_TRANS_COLOR_SRC \
83  ((uint32_t) CSL_DSS_OVR1_CONFIG_TCKLCDSELECTION_VAL_VSTK)
84 
93 #define CSL_DSS_OVERLAY_LAYER_NUM_0 ((uint32_t) 0x0U)
94 
95 #define CSL_DSS_OVERLAY_LAYER_NUM_1 ((uint32_t) 0x1U)
96 
97 #define CSL_DSS_OVERLAY_LAYER_MAX ((uint32_t) 0x2U)
98 
99 #define CSL_DSS_OVERLAY_LAYER_INVALID ((uint32_t) 0xFFU)
100 
102 /* ========================================================================== */
103 /* Structure Declarations */
104 /* ========================================================================== */
105 
109 typedef struct
110 {
111  uint32_t colorKeyEnable;
115  uint32_t colorKeySel;
126  uint32_t backGroundColor;
131 
135 typedef struct
136 {
137  uint32_t layerEnable;
141  uint32_t layerNum;
144  uint32_t inputPipe;
148 
152 typedef struct
153 {
166 
167 /* ========================================================================== */
168 /* Function Declarations */
169 /* ========================================================================== */
170 
181  const CSL_DssOverlayCfg *overlayCfg);
182 
192  uint32_t enable);
193 
204  const CSL_DssOverlayLayerCfg *layerCfg);
205 
217  const CSL_DssOverlayPipePosCfg *pipePosCfg,
218  uint32_t layerNum);
219 
232  const CSL_dss_overlayRegs *overlayRegs,
233  uint32_t pipeId);
234 
235 /* ========================================================================== */
236 /* Static Function Declarations */
237 /* ========================================================================== */
238 
245 static inline void CSL_dssOverlayCfgInit(
246  CSL_DssOverlayCfg *overlayCfg);
247 
254 static inline void CSL_dssOverlayLayerCfgInit(
255  CSL_DssOverlayLayerCfg *layerCfg);
256 
263 static inline void CSL_dssOverlayPipePosCfgInit(
264  CSL_DssOverlayPipePosCfg *pipePosCfg);
265 
266 /* ========================================================================== */
267 /* Static Function Definitions */
268 /* ========================================================================== */
269 
270 static inline void CSL_dssOverlayCfgInit(
271  CSL_DssOverlayCfg *overlayCfg)
272 {
273  if(NULL != overlayCfg)
274  {
275  overlayCfg->colorKeyEnable = FALSE;
277  overlayCfg->transColorKeyMin = 0x0U;
278  overlayCfg->transColorKeyMax = 0x0U;
279  overlayCfg->backGroundColor = 0x0U;
280  }
281 }
282 
283 static inline void CSL_dssOverlayLayerCfgInit(
284  CSL_DssOverlayLayerCfg *layerCfg)
285 {
286  if(NULL != layerCfg)
287  {
288  layerCfg->layerEnable = FALSE;
291  }
292 }
293 
294 static inline void CSL_dssOverlayPipePosCfgInit(
295  CSL_DssOverlayPipePosCfg *pipePosCfg)
296 {
297  if(NULL != pipePosCfg)
298  {
299  Fvid2PosConfig_init(&pipePosCfg->layerPos);
300  }
301 }
302 
303 #ifdef __cplusplus
304 }
305 #endif
306 
307 #endif /* #ifndef CSL_DSSOVERLAY_H_ */
308 
Fvid2PosConfig_init
static void Fvid2PosConfig_init(Fvid2_PosConfig *posCfg)
Fvid2_PosConfig structure init function.
Definition: fvid2_dataTypes.h:2325
CSL_DssOverlayCfg::transColorKeyMin
uint32_t transColorKeyMin
Definition: csl_dssOverlay.h:118
CSL_DssOverlayCfg::backGroundColor
uint32_t backGroundColor
Definition: csl_dssOverlay.h:126
CSL_DssOverlayCfg::colorKeySel
uint32_t colorKeySel
Definition: csl_dssOverlay.h:115
CSL_dssOverlaySetPipePosConfig
void CSL_dssOverlaySetPipePosConfig(CSL_dss_overlayRegs *overlayRegs, const CSL_DssOverlayPipePosCfg *pipePosCfg, uint32_t layerNum)
Configure the Video Pipe Position in Overlay.
CSL_DssOverlayLayerCfg
Configuration for selecting overlay input layers.
Definition: csl_dssOverlay.h:136
CSL_dssOverlayPipePosCfgInit
static void CSL_dssOverlayPipePosCfgInit(CSL_DssOverlayPipePosCfg *pipePosCfg)
CSL_DssOverlayPipePosCfg structure init function.
Definition: csl_dssOverlay.h:294
CSL_DssOverlayPipePosCfg
Video Pipe Position Configuration in Overlay.
Definition: csl_dssOverlay.h:153
NULL
#define NULL
Define NULL if not defined.
Definition: csl_types.h:100
CSL_dss_ovr1Regs
Definition: cslr_dss.h:3942
CSL_DSS_OVERLAY_TRANS_COLOR_DEST
#define CSL_DSS_OVERLAY_TRANS_COLOR_DEST
Destination transparency color key selected.
Definition: csl_dssOverlay.h:79
Fvid2_PosConfig
Structure containing position configuration - used in VCOMP and CIG.
Definition: fvid2_dataTypes.h:1383
CSL_dss_overlayRegs
CSL_dss_ovr1Regs CSL_dss_overlayRegs
DSS Overlay Registers.
Definition: csl_dssOverlay.h:70
CSL_DssOverlayCfg::transColorKeyMax
uint32_t transColorKeyMax
Definition: csl_dssOverlay.h:122
CSL_dssOverlayCfgInit
static void CSL_dssOverlayCfgInit(CSL_DssOverlayCfg *overlayCfg)
CSL_DssOverlayCfg structure init function.
Definition: csl_dssOverlay.h:270
CSL_dssOverlayGetEnabledPipeLayerNum
uint32_t CSL_dssOverlayGetEnabledPipeLayerNum(const CSL_dss_overlayRegs *overlayRegs, uint32_t pipeId)
Get the layer number where a particular Video Pipe is connected.
CSL_DSS_VID_PIPE_ID_VID1
#define CSL_DSS_VID_PIPE_ID_VID1
Video Pipeline 1.
Definition: csl_dssTop.h:106
CSL_dssOverlayColorBarEnable
void CSL_dssOverlayColorBarEnable(CSL_dss_overlayRegs *overlayRegs, uint32_t enable)
Enable the Color Bar in DSS Overlay.
CSL_dssOverlaySetLayerConfig
void CSL_dssOverlaySetLayerConfig(CSL_dss_overlayRegs *overlayRegs, const CSL_DssOverlayLayerCfg *layerCfg)
Configure the Overlay input selection.
CSL_dssOverlayLayerCfgInit
static void CSL_dssOverlayLayerCfgInit(CSL_DssOverlayLayerCfg *layerCfg)
CSL_DssOverlayLayerCfg structure init function.
Definition: csl_dssOverlay.h:283
CSL_DssOverlayLayerCfg::layerNum
uint32_t layerNum
Definition: csl_dssOverlay.h:141
CSL_DssOverlayLayerCfg::inputPipe
uint32_t inputPipe
Definition: csl_dssOverlay.h:144
CSL_DssOverlayCfg
Configuration for DSS Overlay.
Definition: csl_dssOverlay.h:110
CSL_DssOverlayLayerCfg::layerEnable
uint32_t layerEnable
Definition: csl_dssOverlay.h:137
CSL_DssOverlayCfg::colorKeyEnable
uint32_t colorKeyEnable
Definition: csl_dssOverlay.h:111
CSL_DSS_OVERLAY_LAYER_NUM_0
#define CSL_DSS_OVERLAY_LAYER_NUM_0
Overlay Layer 0.
Definition: csl_dssOverlay.h:93
FALSE
#define FALSE
Definition: csl_types.h:62
CSL_DssOverlayPipePosCfg::layerPos
Fvid2_PosConfig layerPos
Definition: csl_dssOverlay.h:154
CSL_dssOverlaySetConfig
void CSL_dssOverlaySetConfig(CSL_dss_overlayRegs *overlayRegs, const CSL_DssOverlayCfg *overlayCfg)
Configure the Overlay Params.