PDK API Guide for J721E
dss_disp.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 
48 #ifndef DSS_DISP_H_
49 #define DSS_DISP_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 
119 typedef Fvid2_Frame *(*Dss_DispBufPrgmCbFxn)(Fvid2_Handle handle,
120  Fvid2_Frame *curFrm,
121  uint32_t isFrmRepeat,
122  uint32_t frmRepeatCnt);
123 
145 typedef int32_t (*Dss_DispPipePrgmCbFxn)(Fvid2_Frame *progFrm,
146  void *appData);
147 
155 typedef void (*Dss_DispUnderFlowCbFxn)(void *appData);
156 
165 typedef void (*Dss_DispSafetyErrCbFxn)(uint32_t capturedSign,
166  void *appData);
167 
172 #define DSS_BUFFER_ALIGNMENT (16U)
173 
174 /*
175  * Display driver IOCTLs.
176  */
177 
197 #define IOCTL_DSS_DISP_SET_DSS_PARAMS (DSS_DISP_IOCTL_BASE + 0x0001U)
198 
210 #define IOCTL_DSS_DISP_SET_PIPE_MFLAG_PARAMS (DSS_DISP_IOCTL_BASE + 0x0002U)
211 
227 #define IOCTL_DSS_DISP_GET_CURRENT_STATUS (DSS_DISP_IOCTL_BASE + 0x0003U)
228 
239 #define IOCTL_DSS_DISP_SET_PIPE_SAFETY_CHK_PARAMS \
240  (DSS_DISP_IOCTL_BASE + 0x0004U)
241 
251 #define IOCTL_DSS_DISP_SET_PIPE_CSC_COEFF (DSS_DISP_IOCTL_BASE + 0x0005U)
252 
269 #define IOCTL_DSS_DISP_REGISTER_BUF_PRGM_CB (DSS_DISP_IOCTL_BASE + 0x0006U)
270 
287 #define IOCTL_DSS_DISP_REGISTER_PIPE_PRGM_CB (DSS_DISP_IOCTL_BASE + 0x0007U)
288 
305 #define IOCTL_DSS_DISP_REGISTER_PIPE_UNDERFLOW_CB \
306  (DSS_DISP_IOCTL_BASE + 0x0008U)
307 
308 /* @} */
309 
310 /* ========================================================================== */
311 /* Structure Declarations */
312 /* ========================================================================== */
313 
318 typedef struct
319 {
344 
349 typedef struct
350 {
351  int32_t retVal;
353  uint32_t standard;
356  uint32_t dispWidth;
358  uint32_t dispHeight;
360  uint32_t minNumPrimeBuf;
364 
368 typedef struct
369 {
370  uint32_t cropEnable;
387 
392 typedef struct
393 {
416 
422 typedef struct
423 {
428 
433 typedef struct
434 {
435  uint32_t queueCount;
438  uint32_t dequeueCount;
442  uint32_t dispFrmCount;
446  uint32_t repeatFrmCount;
450  uint32_t underflowCount;
457 
463 typedef struct
464 {
467  uint32_t referenceSign;
473  uint32_t capturedSign;
475  void *appData;
478 
484 typedef struct
485 {
490 
496 typedef struct
497 {
501  void *appData;
504 
510 typedef struct
511 {
514  void *appData;
517 
521 typedef struct
522 {
523  uint32_t pixelInc;
526 
530 typedef struct
531 {
532  uint32_t width;
534  uint32_t height;
536  uint32_t pitch[FVID2_MAX_PLANES];
542  uint32_t dataFormat;
545 
551 typedef struct
552 {
575 
576 /* ========================================================================== */
577 /* Internal/Private Function Declarations */
578 /* ========================================================================== */
579 
587 static inline void Dss_dispCreateParamsInit(Dss_DispCreateParams *createParams);
588 
596 static inline void Dss_dispParamsInit(Dss_DispParams *dssParams);
597 
605 static inline void Dss_dispPipeMflagParamsInit(
606  Dss_DispPipeMflagParams *pipeMflagParams);
607 
616 static inline void Dss_dispPipeSafetyChkParamsInit(
617  Dss_DispPipeSafetyChkParams *pipeSafetyChkParams);
618 
626 static inline void Dss_dispBufPrgmCbParamsInit(
627  Dss_DispBufPrgmCbParams *bufPrgmCbParams);
628 
636 static inline void Dss_dispPipePrgmCbParamsInit(
637  Dss_DispPipePrgmCbParams *pipePrgmCbParams);
638 
646 static inline void Dss_dispUnderFlowCbParamsInit(
647  Dss_DispUnderFlowCbParams *underFlowCbParams);
648 
656 static inline void Dss_scRtParamsInit(Dss_ScRtParams *scRtParams);
657 
665 static inline void Dss_frameRtParamsInit(Dss_FrameRtParams *frameRtParams);
666 
674 static inline void Dss_dispRtParamsInit(Dss_DispRtParams *rtParams);
675 
676 /* ========================================================================== */
677 /* Function Declarations */
678 /* ========================================================================== */
679 
680 /* None */
681 
682 /* ========================================================================== */
683 /* Static Function Definitions */
684 /* ========================================================================== */
685 
686 static inline void Dss_dispCreateParamsInit(Dss_DispCreateParams *createParams)
687 {
688  if(NULL != createParams)
689  {
690  createParams->periodicCbEnable = TRUE;
691  createParams->progPipeVsyncEnable = FALSE;
692  }
693 }
694 
695 static inline void Dss_dispPipeCropParamsInit(
696  Dss_DispPipeCropParams *cropParams)
697 {
698  if(NULL != cropParams)
699  {
700  cropParams->cropEnable = FALSE;
701  Fvid2EdgeCropConfig_init(&(cropParams->cropCfg));
702  }
703 }
704 
705 static inline void Dss_dispParamsInit(Dss_DispParams *dssParams)
706 {
707  if(NULL != dssParams)
708  {
709  CSL_dssVidPipeCfgInit(&(dssParams->pipeCfg));
710  CSL_dssVidPipeDmaCfgInit(&(dssParams->dmaCfg));
711  CSL_dssVidPipeAlphaCfgInit(&(dssParams->alphaCfg));
712  CSL_dssVidPipeVC1CfgInit(&(dssParams->vc1Cfg));
713  Dss_dispPipeCropParamsInit(&(dssParams->cropParams));
714  Fvid2PosConfig_init(&(dssParams->layerPos));
715  }
716 }
717 
718 static inline void Dss_dispPipeMflagParamsInit(
719  Dss_DispPipeMflagParams *pipeMflagParams)
720 {
721  if(NULL != pipeMflagParams)
722  {
723  CSL_dssVidPipeMFlagCfgInit(&(pipeMflagParams->mflagCfg));
724  }
725 }
726 
728  Dss_DispPipeSafetyChkParams *pipeSafetyChkParams)
729 {
730  if(NULL != pipeSafetyChkParams)
731  {
732  pipeSafetyChkParams->safetySignSeedVal = 0U;
733  pipeSafetyChkParams->referenceSign = 0U;
734  CSL_dssSafetyChkCfgInit(&(pipeSafetyChkParams->safetyChkCfg));
735  pipeSafetyChkParams->safetyErrCbFxn = NULL;
736  pipeSafetyChkParams->capturedSign = 0U;
737  pipeSafetyChkParams->appData = NULL;
738  }
739 }
740 
741 static inline void Dss_dispBufPrgmCbParamsInit(
742  Dss_DispBufPrgmCbParams *bufPrgmCbParams)
743 {
744  if(NULL != bufPrgmCbParams)
745  {
746  bufPrgmCbParams->bufPrgmCbFxn = NULL;
747  }
748 }
749 
750 static inline void Dss_dispPipePrgmCbParamsInit(
751  Dss_DispPipePrgmCbParams *pipePrgmCbParams)
752 {
753  if(NULL != pipePrgmCbParams)
754  {
755  pipePrgmCbParams->pipePrgmCbFxn = NULL;
756  }
757 }
758 
759 static inline void Dss_dispUnderFlowCbParamsInit(
760  Dss_DispUnderFlowCbParams *underFlowCbParams)
761 {
762  if(NULL != underFlowCbParams)
763  {
764  underFlowCbParams->underFlowCbFxn = NULL;
765  }
766 }
767 
768 static inline void Dss_scRtParamsInit(Dss_ScRtParams *scRtParams)
769 {
770  if(NULL != scRtParams)
771  {
772  scRtParams->pixelInc = 1U;
773  }
774 }
775 
776 static inline void Dss_frameRtParamsInit(Dss_FrameRtParams *frameRtParams)
777 {
778  uint32_t i;
779  if(NULL != frameRtParams)
780  {
781  frameRtParams->width = 1920U;
782  frameRtParams->height = 1080U;
783  frameRtParams->dataFormat = FVID2_DF_YUV422I_YUYV;
784  for(i=0U; i<FVID2_MAX_PLANES; i++)
785  {
786  frameRtParams->pitch[i] = 1920U*3U;
787  }
788  }
789 }
790 
791 static inline void Dss_dispRtParamsInit(Dss_DispRtParams *rtParams)
792 {
793  if(NULL != rtParams)
794  {
795  rtParams->posCfg = NULL;
796  rtParams->inFrmParams = NULL;
797  rtParams->outFrmParams = NULL;
798  rtParams->scParams = NULL;
799  }
800 }
801 
802 #ifdef __cplusplus
803 }
804 #endif
805 
806 #endif /* #ifndef DSS_DISP_H_ */
807 
808 /* @} */
static void Dss_dispBufPrgmCbParamsInit(Dss_DispBufPrgmCbParams *bufPrgmCbParams)
Dss_DispBufPrgmCbParams structure init function.
Definition: dss_disp.h:741
DSS Video Pipe VC1 configuration.
Definition: csl_dssVideoPipe.h:349
static void CSL_dssVidPipeAlphaCfgInit(CSL_DssVidPipeAlphaCfg *alphaCfg)
CSL_DssVidPipeAlphaCfg structure init function.
Definition: csl_dssVideoPipe.h:666
#define TRUE
Definition: csl_types.h:54
CSL_DssVidPipeDmaCfg dmaCfg
Definition: dss_disp.h:396
int32_t(* Dss_DispPipePrgmCbFxn)(Fvid2_Frame *progFrm, void *appData)
Display driver video pipe program callback function prototype.
Definition: dss_disp.h:145
DSS Video Pipe MFLAG Config parameters.
Definition: csl_dssVideoPipe.h:362
uint32_t progPipeVsyncEnable
Definition: dss_disp.h:329
Fvid2_PosConfig * posCfg
Definition: dss_disp.h:553
Structure containing position configuration - used in VCOMP and CIG.
Definition: csl_fvid2_dataTypes.h:1360
static void CSL_dssVidPipeMFlagCfgInit(CSL_DssVidPipeMFlagCfg *mflagCfg)
CSL_DssVidPipeMFlagCfg structure init function.
Definition: csl_dssVideoPipe.h:687
Dss_DispUnderFlowCbFxn underFlowCbFxn
Definition: dss_disp.h:512
#define FALSE
Definition: csl_types.h:55
uint32_t cropEnable
Definition: dss_disp.h:370
static void CSL_dssSafetyChkCfgInit(CSL_DssSafetyChkCfg *safetyCfg)
CSL_DssSafetyChkCfg structure init function.
Definition: csl_dssTop.h:432
static void Dss_dispPipeSafetyChkParamsInit(Dss_DispPipeSafetyChkParams *pipeSafetyChkParams)
Dss_DispPipeSafetyChkParams structure init function.
Definition: dss_disp.h:727
uint32_t minNumPrimeBuf
Definition: dss_disp.h:360
static void Fvid2EdgeCropConfig_init(Fvid2_EdgeCropConfig *edgeCropCfg)
Fvid2_EdgeCropConfig structure init function.
Definition: csl_fvid2_dataTypes.h:2288
CSL_DssVidPipeAlphaCfg alphaCfg
Definition: dss_disp.h:398
CSL_DssVidPipeVC1Cfg vc1Cfg
Definition: dss_disp.h:400
DSS Video Pipe DMA related Config parameters.
Definition: csl_dssVideoPipe.h:287
Fvid2_PosConfig layerPos
Definition: dss_disp.h:404
Structure containing display driver create arguments, used when calling Fvid2_create().
Definition: dss_disp.h:318
Structure containing pipe under flow callback parameters. This structure is used as an argument to IO...
Definition: dss_disp.h:510
static void Dss_dispPipeMflagParamsInit(Dss_DispPipeMflagParams *pipeMflagParams)
Dss_DispPipeMflagParams structure init function.
Definition: dss_disp.h:718
Structure containing Video Pipe Mflag Information. This structure is used as an argument to IOCTL_DSS...
Definition: dss_disp.h:422
uint32_t width
Definition: dss_disp.h:532
DSS Video Pipe Alpha Config parameters.
Definition: csl_dssVideoPipe.h:334
CSL_DssSafetyChkCfg safetyChkCfg
Definition: dss_disp.h:469
Configuration for DSS Video Pipe.
Definition: csl_dssVideoPipe.h:158
Structure containing display buffer program callback parameters. This structure is used as an argumen...
Definition: dss_disp.h:484
Structure containing video pipe program callback parameters. This structure is used as an argument to...
Definition: dss_disp.h:496
uint32_t capturedSign
Definition: dss_disp.h:473
FVID2 frame buffer structure.
Definition: csl_fvid2_dataTypes.h:1159
Dss_ScRtParams * scParams
Definition: dss_disp.h:570
uint32_t dispFrmCount
Definition: dss_disp.h:442
Structure containing edge crop configuration - used in DSS.
Definition: csl_fvid2_dataTypes.h:1344
uint32_t height
Definition: dss_disp.h:534
Structure containing run time scaler configuration.
Definition: dss_disp.h:521
static void Dss_dispParamsInit(Dss_DispParams *dssParams)
Dss_DispParams structure init function.
Definition: dss_disp.h:705
uint32_t dequeueCount
Definition: dss_disp.h:438
Fvid2_Frame *(* Dss_DispBufPrgmCbFxn)(Fvid2_Handle handle, Fvid2_Frame *curFrm, uint32_t isFrmRepeat, uint32_t frmRepeatCnt)
Display driver buffer program callback function prototype.
Definition: dss_disp.h:119
uint32_t dataFormat
Definition: dss_disp.h:542
Structure containing DSS parameters. This structure is used as an argument to IOCTL_DSS_DISP_SET_DSS_...
Definition: dss_disp.h:392
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
uint32_t dispWidth
Definition: dss_disp.h:356
static void Dss_dispPipePrgmCbParamsInit(Dss_DispPipePrgmCbParams *pipePrgmCbParams)
Dss_DispPipePrgmCbParams structure init function.
Definition: dss_disp.h:750
static void CSL_dssVidPipeVC1CfgInit(CSL_DssVidPipeVC1Cfg *vc1Cfg)
CSL_DssVidPipeVC1Cfg structure init function.
Definition: csl_dssVideoPipe.h:676
uint32_t pixelInc
Definition: dss_disp.h:523
Structure containing video pipeline crop configuration.
Definition: dss_disp.h:368
Dss_DispBufPrgmCbFxn bufPrgmCbFxn
Definition: dss_disp.h:486
uint32_t queueCount
Definition: dss_disp.h:435
int32_t retVal
Definition: dss_disp.h:351
static void CSL_dssVidPipeCfgInit(CSL_DssVidPipeCfg *pipeCfg)
CSL_DssVidPipeCfg structure init function.
Definition: csl_dssVideoPipe.h:615
uint32_t safetyViolationCount
Definition: dss_disp.h:453
Structure containing create status for the display driver. This should be passed as a status argument...
Definition: dss_disp.h:349
Dss_DispPipeCropParams cropParams
Definition: dss_disp.h:402
uint32_t periodicCbEnable
Definition: dss_disp.h:320
Fvid2_EdgeCropConfig cropCfg
Definition: dss_disp.h:372
Structure containing run time configuration of the display driver. This needs to be passed along with...
Definition: dss_disp.h:551
Dss_FrameRtParams * inFrmParams
Definition: dss_disp.h:557
void * appData
Definition: dss_disp.h:514
uint32_t underflowCount
Definition: dss_disp.h:450
uint32_t referenceSign
Definition: dss_disp.h:467
Structure containing Safety Check configuration of Video Port. This structure is used as an argument ...
Definition: dss_disp.h:463
static void Dss_dispCreateParamsInit(Dss_DispCreateParams *createParams)
Dss_DispCreateParams structure init function.
Definition: dss_disp.h:686
static void Dss_frameRtParamsInit(Dss_FrameRtParams *frameRtParams)
Dss_FrameRtParams structure init function.
Definition: dss_disp.h:776
CSL_DssVidPipeCfg pipeCfg
Definition: dss_disp.h:394
uint32_t pitch[FVID2_MAX_PLANES]
Definition: dss_disp.h:536
void * appData
Definition: dss_disp.h:501
void(* Dss_DispSafetyErrCbFxn)(uint32_t capturedSign, void *appData)
Video Pipe safety error callback function prototype.
Definition: dss_disp.h:165
static void Dss_dispUnderFlowCbParamsInit(Dss_DispUnderFlowCbParams *underFlowCbParams)
Dss_DispUnderFlowCbParams structure init function.
Definition: dss_disp.h:759
static void Dss_dispPipeCropParamsInit(Dss_DispPipeCropParams *cropParams)
Definition: dss_disp.h:695
Dss_DispSafetyErrCbFxn safetyErrCbFxn
Definition: dss_disp.h:471
uint32_t repeatFrmCount
Definition: dss_disp.h:446
Dss_DispPipePrgmCbFxn pipePrgmCbFxn
Definition: dss_disp.h:498
uint32_t safetySignSeedVal
Definition: dss_disp.h:465
void(* Dss_DispUnderFlowCbFxn)(void *appData)
Video pipe underflow callback function prototype.
Definition: dss_disp.h:155
void * appData
Definition: dss_disp.h:475
uint32_t dispHeight
Definition: dss_disp.h:358
CSL_DssVidPipeMFlagCfg mflagCfg
Definition: dss_disp.h:424
Configuration for doing safety checks.
Definition: csl_dssTop.h:330
static void CSL_dssVidPipeDmaCfgInit(CSL_DssVidPipeDmaCfg *dmaCfg)
CSL_DssVidPipeDmaCfg structure init function.
Definition: csl_dssVideoPipe.h:641
#define FVID2_MAX_PLANES
This macro determines the maximum number of planes/address used to represent a video buffer....
Definition: csl_fvid2_dataTypes.h:160
static void Fvid2PosConfig_init(Fvid2_PosConfig *posCfg)
Fvid2_PosConfig structure init function.
Definition: csl_fvid2_dataTypes.h:2301
static void Dss_scRtParamsInit(Dss_ScRtParams *scRtParams)
Dss_ScRtParams structure init function.
Definition: dss_disp.h:768
uint32_t standard
Definition: dss_disp.h:353
Structure containing run time configuration per frame.
Definition: dss_disp.h:530
#define FVID2_DF_YUV422I_YUYV
YUV 422 Interleaved format - YUYV.
Definition: csl_fvid2_dataTypes.h:318
Dss_FrameRtParams * outFrmParams
Definition: dss_disp.h:565
Structure containing current status of the display driver. This structure is used as an argument to I...
Definition: dss_disp.h:433
static void Dss_dispRtParamsInit(Dss_DispRtParams *rtParams)
Dss_DispRtParams structure init function.
Definition: dss_disp.h:791