AM62x MCU+ SDK  10.01.00
csl_dssVideoPipe.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2023-24
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_DSSVIDEOPIPE_H_
49 #define CSL_DSSVIDEOPIPE_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 
73 
82 #define CSL_DSS_VID_PIPE_YUV_ALIGN_LSB \
83  ((uint32_t) CSL_DSS_VID_ATTRIBUTES2_YUV_ALIGN_VAL_LSB)
84 
85 #define CSL_DSS_VID_PIPE_YUV_ALIGN_MSB \
86  ((uint32_t) CSL_DSS_VID_ATTRIBUTES2_YUV_ALIGN_VAL_MSB)
87 
96 #define CSL_DSS_VID_PIPE_SC_DISABLED \
97  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_RESIZEENABLE_VAL_RESIZEPROC)
98 
99 #define CSL_DSS_VID_PIPE_SC_ENABLED_H \
100  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_RESIZEENABLE_VAL_HRESIZE)
101 
102 #define CSL_DSS_VID_PIPE_SC_ENABLED_V \
103  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_RESIZEENABLE_VAL_VRESIZE)
104 
105 #define CSL_DSS_VID_PIPE_SC_ENABLED_HV \
106  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_RESIZEENABLE_VAL_HVRESIZE)
107 
117 #define CSL_DSS_VID_PIPE_PRELOAD_CONTROL_SW \
118  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_BUFPRELOAD_VAL_DEFVAL)
119 
120 #define CSL_DSS_VID_PIPE_PRELOAD_CONTROL_HW \
121  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_BUFPRELOAD_VAL_HIGHTHRES)
122 
131 #define CSL_DSS_VID_PIPE_PRIORITY_NORMAL \
132  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_ARBITRATION_VAL_NORMALPRIO)
133 
134 #define CSL_DSS_VID_PIPE_PRIORITY_HIGH \
135  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_ARBITRATION_VAL_HIGHPRIO)
136 
145 #define CSL_DSS_VID_PIPE_REFRESH_CONTROL_SW \
146  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_SELFREFRESHAUTO_VAL_SELFREFRESHAUTODIS)
147 
148 #define CSL_DSS_VID_PIPE_REFRESH_CONTROL_HW \
149  ((uint32_t) CSL_DSS_VID_ATTRIBUTES_SELFREFRESHAUTO_VAL_SELFREFRESHAUTOEN)
150 
152 /* ========================================================================== */
153 /* Structure Declarations */
154 /* ========================================================================== */
155 
159 typedef struct
160 {
161  uint32_t pipeType;
244  uint32_t pixelInc;
251  uint32_t yuvAlign;
254  uint32_t outWidth;
256  uint32_t outHeight;
258  uint32_t scEnable;
262  uint32_t cscRange;
271  uint32_t flipType;
274  uint32_t clutData[CSL_DSS_NUM_LUT_ENTRIES];
280  uint32_t gammaEnable;
285 
289 typedef struct
290 {
295  uint32_t preloadVal;
297  uint32_t bufLowThreshold;
311  uint32_t arbitration;
315 
319 typedef struct
320 {
321  uint32_t lumaKeyEnable;
325  uint32_t lumaKeyMinVal;
328  uint32_t lumaKeyMaxVal;
332 
336 typedef struct
337 {
338  uint32_t globalAlpha;
347 
351 typedef struct
352 {
353  uint32_t vc1Enable;
355  uint32_t rangeY;
357  uint32_t rangeUV;
360 
364 typedef struct
365 {
366  uint32_t thresholdLow;
368  uint32_t thresholdHigh;
371 
372 /* ========================================================================== */
373 /* Function Declarations */
374 /* ========================================================================== */
375 
389  const CSL_DssVidPipeCfg *pipeCfg,
390  const CSL_DssVidPipeVC1Cfg *vc1Cfg);
391 
402  const CSL_DssVidPipeDmaCfg *dmaCfg);
403 
414  const CSL_DssVidPipeLumaCfg *lumaCfg);
415 
426  const CSL_DssVidPipeAlphaCfg *alphaCfg);
427 
438  const CSL_DssCscCoeff *coeff);
439 
452  uint32_t field,
453  uint64_t baseAddrRGBY,
454  uint64_t baseAddrUV);
455 
465 void CSL_dssVidPipeEnable(CSL_dss_pipeRegs *pipeRegs, uint32_t enable);
466 
476  uint32_t signSeedVal);
477 
487  uint32_t referenceSign);
488 
499  const CSL_DssSafetyChkCfg *safetyCfg);
500 
510 
521  const CSL_DssVidPipeMFlagCfg *mflagCfg);
522 
523 /* ========================================================================== */
524 /* Static Function Declarations */
525 /* ========================================================================== */
526 
533 static inline void CSL_dssVidPipeCfgInit(
534  CSL_DssVidPipeCfg *pipeCfg);
535 
542 static inline void CSL_dssVidPipeDmaCfgInit(
543  CSL_DssVidPipeDmaCfg *dmaCfg);
544 
551 static inline void CSL_dssVidPipeLumaCfgInit(
552  CSL_DssVidPipeLumaCfg *lumaCfg);
553 
560 static inline void CSL_dssVidPipeAlphaCfgInit(
561  CSL_DssVidPipeAlphaCfg *alphaCfg);
562 
569 static inline void CSL_dssVidPipeVC1CfgInit(
570  CSL_DssVidPipeVC1Cfg *vc1Cfg);
571 
578 static inline void CSL_dssVidPipeMFlagCfgInit(
579  CSL_DssVidPipeMFlagCfg *mflagCfg);
580 
581 /* ========================================================================== */
582 /* Static Function Definitions */
583 /* ========================================================================== */
584 
585 static inline void CSL_dssVidPipeCfgInit(
586  CSL_DssVidPipeCfg *pipeCfg)
587 {
588  uint32_t i;
589  if(NULL != pipeCfg)
590  {
591  Fvid2Format_init(&pipeCfg->inFmt);
593  pipeCfg->pixelInc = 1U;
595  pipeCfg->outWidth = 800U;
596  pipeCfg->outHeight = 480U;
598  pipeCfg->cscRange = CSL_DSS_CSC_RANGE_FULL;
601  pipeCfg->flipType = FVID2_FLIP_TYPE_NONE;
602  for(i=0U; i<CSL_DSS_NUM_LUT_ENTRIES; i++)
603  {
604  pipeCfg->clutData[i] = 0x0U;
605  }
606  pipeCfg->nibbleModeEnable = FALSE;
607  pipeCfg->gammaEnable = FALSE;
608  }
609 }
610 
611 static inline void CSL_dssVidPipeDmaCfgInit(
612  CSL_DssVidPipeDmaCfg *dmaCfg)
613 {
614  if(NULL != dmaCfg)
615  {
617  dmaCfg->bufLowThreshold = 0x09FFU;
618  dmaCfg->bufHighThreshold = 0x09F8U;
620  dmaCfg->selfRefreshEnable = FALSE;
622  }
623 }
624 
625 static inline void CSL_dssVidPipeLumaCfgInit(
626  CSL_DssVidPipeLumaCfg *lumaCfg)
627 {
628  if(NULL != lumaCfg)
629  {
630  lumaCfg->lumaKeyEnable = FALSE;
631  lumaCfg->lumaKeyMinVal = 0U;
632  lumaCfg->lumaKeyMaxVal = 0U;
633  }
634 }
635 
636 static inline void CSL_dssVidPipeAlphaCfgInit(
637  CSL_DssVidPipeAlphaCfg *alphaCfg)
638 {
639  if(NULL != alphaCfg)
640  {
641  alphaCfg->globalAlpha = 0xFFU;
642  alphaCfg->preMultiplyAlpha = FALSE;
643  }
644 }
645 
646 static inline void CSL_dssVidPipeVC1CfgInit(
647  CSL_DssVidPipeVC1Cfg *vc1Cfg)
648 {
649  if(NULL != vc1Cfg)
650  {
651  vc1Cfg->vc1Enable = FALSE;
652  vc1Cfg->rangeY = 0U;
653  vc1Cfg->rangeUV = 0U;
654  }
655 }
656 
657 static inline void CSL_dssVidPipeMFlagCfgInit(
658  CSL_DssVidPipeMFlagCfg *mflagCfg)
659 {
660  if(NULL != mflagCfg)
661  {
662  mflagCfg->thresholdLow = 0U;
663  mflagCfg->thresholdHigh = 0U;
664  }
665 }
666 
667 #ifdef __cplusplus
668 }
669 #endif
670 
671 #endif /* #ifndef CSL_DSSVIDEOPIPE_H_ */
672 
CSL_DssVidPipeCfg::cscRange
uint32_t cscRange
Definition: csl_dssVideoPipe.h:262
CSL_DssSafetyChkCfg
Configuration for doing safety checks.
Definition: csl_dssTop.h:260
CSL_DssVidPipeLumaCfg::lumaKeyEnable
uint32_t lumaKeyEnable
Definition: csl_dssVideoPipe.h:321
CSL_DSS_VID_PIPE_PRIORITY_NORMAL
#define CSL_DSS_VID_PIPE_PRIORITY_NORMAL
Priority of video pipeline is normal.
Definition: csl_dssVideoPipe.h:131
CSL_DssVidPipeCfg::custCscCoeff
CSL_DssCscCoeff custCscCoeff
Definition: csl_dssVideoPipe.h:265
CSL_DssVidPipeCfg
Configuration for DSS Video Pipe.
Definition: csl_dssVideoPipe.h:160
CSL_DssVidPipeCfg::flipType
uint32_t flipType
Definition: csl_dssVideoPipe.h:271
CSL_dssVidPipeMFlagCfgInit
static void CSL_dssVidPipeMFlagCfgInit(CSL_DssVidPipeMFlagCfg *mflagCfg)
CSL_DssVidPipeMFlagCfg structure init function.
Definition: csl_dssVideoPipe.h:657
CSL_dssVidPipeSetSafetyReferenceSign
void CSL_dssVidPipeSetSafetyReferenceSign(CSL_dss_pipeRegs *pipeRegs, uint32_t referenceSign)
Set the reference safety signature for data correctness check.
CSL_DssVidPipeDmaCfg
DSS Video Pipe DMA related Config parameters.
Definition: csl_dssVideoPipe.h:290
CSL_DssVidPipeCfg::pixelInc
uint32_t pixelInc
Definition: csl_dssVideoPipe.h:244
CSL_dssVidPipeCfgInit
static void CSL_dssVidPipeCfgInit(CSL_DssVidPipeCfg *pipeCfg)
CSL_DssVidPipeCfg structure init function.
Definition: csl_dssVideoPipe.h:585
CSL_dssVidPipeGetSafetySign
uint32_t CSL_dssVidPipeGetSafetySign(const CSL_dss_pipeRegs *pipeRegs)
Get the Safety Signature.
CSL_DssCscCoeff
Structure containing coefficients for Color Space Conversion.
Definition: csl_dssTop.h:220
CSL_DSS_CSC_RANGE_FULL
#define CSL_DSS_CSC_RANGE_FULL
Full range selected.
Definition: csl_dssTop.h:168
CSL_DssVidPipeVC1Cfg
DSS Video Pipe VC1 configuration.
Definition: csl_dssVideoPipe.h:352
CSL_DssVidPipeCfg::inFmt
Fvid2_Format inFmt
Definition: csl_dssVideoPipe.h:163
CSL_DssVidPipeDmaCfg::selfRefreshEnable
uint32_t selfRefreshEnable
Definition: csl_dssVideoPipe.h:307
NULL
#define NULL
Define NULL if not defined.
Definition: csl_types.h:100
CSL_DssVidPipeDmaCfg::bufLowThreshold
uint32_t bufLowThreshold
Definition: csl_dssVideoPipe.h:297
CSL_DssVidPipeAlphaCfg::globalAlpha
uint32_t globalAlpha
Definition: csl_dssVideoPipe.h:338
CSL_dssVidPipeAlphaCfgInit
static void CSL_dssVidPipeAlphaCfgInit(CSL_DssVidPipeAlphaCfg *alphaCfg)
CSL_DssVidPipeAlphaCfg structure init function.
Definition: csl_dssVideoPipe.h:636
CSL_dssVidPipeVC1CfgInit
static void CSL_dssVidPipeVC1CfgInit(CSL_DssVidPipeVC1Cfg *vc1Cfg)
CSL_DssVidPipeVC1Cfg structure init function.
Definition: csl_dssVideoPipe.h:646
CSL_dssVidPipeSetMflagConfig
void CSL_dssVidPipeSetMflagConfig(CSL_dss_pipeRegs *pipeRegs, const CSL_DssVidPipeMFlagCfg *mflagCfg)
Set the MFLAG configuration.
Fvid2Format_init
static void Fvid2Format_init(Fvid2_Format *fmt)
Fvid2_Format structure init function.
Definition: fvid2_dataTypes.h:2201
CSL_DssVidPipeLumaCfg::lumaKeyMinVal
uint32_t lumaKeyMinVal
Definition: csl_dssVideoPipe.h:325
CSL_DSS_VID_PIPE_PRELOAD_CONTROL_HW
#define CSL_DSS_VID_PIPE_PRELOAD_CONTROL_HW
HW pre-fetches pixels up to high threshold value.
Definition: csl_dssVideoPipe.h:120
CSL_DssVidPipeCfg::scEnable
uint32_t scEnable
Definition: csl_dssVideoPipe.h:258
FVID2_FLIP_TYPE_NONE
#define FVID2_FLIP_TYPE_NONE
Flip Type is None.
Definition: fvid2_dataTypes.h:241
CSL_DssVidPipeCfg::clutData
uint32_t clutData[CSL_DSS_NUM_LUT_ENTRIES]
Definition: csl_dssVideoPipe.h:274
CSL_dssVidPipeEnableTransparency
void CSL_dssVidPipeEnableTransparency(CSL_dss_pipeRegs *pipeRegs, const CSL_DssVidPipeLumaCfg *lumaCfg)
Enable the Luma Key transparency matching and set luma params.
CSL_DssVidPipeMFlagCfg::thresholdLow
uint32_t thresholdLow
Definition: csl_dssVideoPipe.h:366
CSL_DssVidPipeDmaCfg::bufPreloadControl
uint32_t bufPreloadControl
Definition: csl_dssVideoPipe.h:291
CSL_dssVidPipeSetCSCCoeff
void CSL_dssVidPipeSetCSCCoeff(CSL_dss_pipeRegs *pipeRegs, const CSL_DssCscCoeff *coeff)
Configure the coefficients for Color Space Conversion.
CSL_dssCscCoeffInit
static void CSL_dssCscCoeffInit(CSL_DssCscCoeff *cscCoeff)
CSL_DssCscCoeff structure init function.
Definition: csl_dssTop.h:335
CSL_dssVidPipeEnable
void CSL_dssVidPipeEnable(CSL_dss_pipeRegs *pipeRegs, uint32_t enable)
Enable the DSS Video Pipe.
CSL_dssVidPipeDmaCfgInit
static void CSL_dssVidPipeDmaCfgInit(CSL_DssVidPipeDmaCfg *dmaCfg)
CSL_DssVidPipeDmaCfg structure init function.
Definition: csl_dssVideoPipe.h:611
CSL_DssCscCoeff::cscRange
uint32_t cscRange
Definition: csl_dssTop.h:221
CSL_DssVidPipeDmaCfg::arbitration
uint32_t arbitration
Definition: csl_dssVideoPipe.h:311
CSL_DssVidPipeLumaCfg
DSS Video Pipe Luma Key Config parameters.
Definition: csl_dssVideoPipe.h:320
CSL_DssVidPipeLumaCfg::lumaKeyMaxVal
uint32_t lumaKeyMaxVal
Definition: csl_dssVideoPipe.h:328
CSL_dssVidPipeLumaCfgInit
static void CSL_dssVidPipeLumaCfgInit(CSL_DssVidPipeLumaCfg *lumaCfg)
CSL_DssVidPipeLumaCfg structure init function.
Definition: csl_dssVideoPipe.h:625
CSL_DssVidPipeMFlagCfg
DSS Video Pipe MFLAG Config parameters.
Definition: csl_dssVideoPipe.h:365
CSL_dss_pipeRegs
CSL_dss_vidRegs CSL_dss_pipeRegs
DSS Video Pipe Registers.
Definition: csl_dssVideoPipe.h:72
CSL_DSS_NUM_LUT_ENTRIES
#define CSL_DSS_NUM_LUT_ENTRIES
Number of entries for CLUT/Gamma Correction.
Definition: csl_dssTop.h:207
CSL_DssVidPipeVC1Cfg::rangeY
uint32_t rangeY
Definition: csl_dssVideoPipe.h:355
CSL_DSS_VID_PIPE_TYPE_VID
#define CSL_DSS_VID_PIPE_TYPE_VID
Video Pipe is of type VID.
Definition: csl_dssTop.h:78
CSL_DSS_VID_PIPE_REFRESH_CONTROL_SW
#define CSL_DSS_VID_PIPE_REFRESH_CONTROL_SW
Transition is controlled by SW.
Definition: csl_dssVideoPipe.h:145
CSL_DssVidPipeCfg::nibbleModeEnable
uint32_t nibbleModeEnable
Definition: csl_dssVideoPipe.h:276
CSL_dssVidPipeSetBuffAddr
void CSL_dssVidPipeSetBuffAddr(CSL_dss_pipeRegs *pipeRegs, uint32_t field, uint64_t baseAddrRGBY, uint64_t baseAddrUV)
Set the video buffer address.
CSL_DSS_VID_PIPE_YUV_ALIGN_LSB
#define CSL_DSS_VID_PIPE_YUV_ALIGN_LSB
Data is LSB aligned (MSB unused)
Definition: csl_dssVideoPipe.h:82
CSL_dssVidPipeSetAlphaConfig
void CSL_dssVidPipeSetAlphaConfig(CSL_dss_pipeRegs *pipeRegs, const CSL_DssVidPipeAlphaCfg *alphaCfg)
Set DSS Video Pipe Alpha parameters.
CSL_DSS_VID_PIPE_SC_DISABLED
#define CSL_DSS_VID_PIPE_SC_DISABLED
Scaler is disabled.
Definition: csl_dssVideoPipe.h:96
CSL_dssVidPipeSetDmaConfig
void CSL_dssVidPipeSetDmaConfig(CSL_dss_pipeRegs *pipeRegs, const CSL_DssVidPipeDmaCfg *dmaCfg)
Configure the Video Pipe DMA parameters.
Fvid2_Format
FVID2 video buffer format specification.
Definition: fvid2_dataTypes.h:1107
CSL_DSS_CSC_RANGE_CUSTOM
#define CSL_DSS_CSC_RANGE_CUSTOM
Custom range selected.
Definition: csl_dssTop.h:170
CSL_DssVidPipeVC1Cfg::rangeUV
uint32_t rangeUV
Definition: csl_dssVideoPipe.h:357
CSL_DssVidPipeDmaCfg::preloadVal
uint32_t preloadVal
Definition: csl_dssVideoPipe.h:295
CSL_DssVidPipeCfg::outWidth
uint32_t outWidth
Definition: csl_dssVideoPipe.h:254
CSL_dssVidPipeSetSafetySignSeedVal
void CSL_dssVidPipeSetSafetySignSeedVal(CSL_dss_pipeRegs *pipeRegs, uint32_t signSeedVal)
Set the seed value for the signature calculation.
CSL_DssVidPipeCfg::yuvAlign
uint32_t yuvAlign
Definition: csl_dssVideoPipe.h:251
CSL_DssVidPipeAlphaCfg
DSS Video Pipe Alpha Config parameters.
Definition: csl_dssVideoPipe.h:337
CSL_DssVidPipeCfg::pipeType
uint32_t pipeType
Definition: csl_dssVideoPipe.h:161
CSL_DssVidPipeVC1Cfg::vc1Enable
uint32_t vc1Enable
Definition: csl_dssVideoPipe.h:353
CSL_dss_vidRegs
Definition: cslr_dss.h:2594
CSL_DssVidPipeCfg::gammaEnable
uint32_t gammaEnable
Definition: csl_dssVideoPipe.h:280
CSL_DssVidPipeCfg::outHeight
uint32_t outHeight
Definition: csl_dssVideoPipe.h:256
CSL_DssVidPipeDmaCfg::selfRefreshControl
uint32_t selfRefreshControl
Definition: csl_dssVideoPipe.h:303
CSL_DssVidPipeDmaCfg::bufHighThreshold
uint32_t bufHighThreshold
Definition: csl_dssVideoPipe.h:300
CSL_dssVidPipeSetConfig
int32_t CSL_dssVidPipeSetConfig(CSL_dss_pipeRegs *pipeRegs, const CSL_DssVidPipeCfg *pipeCfg, const CSL_DssVidPipeVC1Cfg *vc1Cfg)
Configure the Video Pipe.
FALSE
#define FALSE
Definition: csl_types.h:62
CSL_dssVidPipeSetSafetyChkConfig
void CSL_dssVidPipeSetSafetyChkConfig(CSL_dss_pipeRegs *pipeRegs, const CSL_DssSafetyChkCfg *safetyCfg)
Configure the Safety Check Params.
CSL_DssVidPipeAlphaCfg::preMultiplyAlpha
uint32_t preMultiplyAlpha
Definition: csl_dssVideoPipe.h:341
CSL_DssVidPipeMFlagCfg::thresholdHigh
uint32_t thresholdHigh
Definition: csl_dssVideoPipe.h:368