PDK API Guide for AM65xx
dss_soc.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_SOC_H_
49 #define DSS_SOC_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 
65 /*
66  * Macros for different driver instance numbers to be passed as instance ID
67  * at the time of driver create.
68  * Note: These are read only macros. Don't modify the value of these macros.
69  */
70 
78 #define DSS_DCTRL_INST_0 (0U)
79 
81 #define DSS_DCTRL_INST_MAX (1U)
82 /* @} */
83 
91 #define DSS_DISP_INST_VID1 (CSL_DSS_VID_PIPE_ID_VID1)
92 
94 #define DSS_DISP_INST_VIDL1 (CSL_DSS_VID_PIPE_ID_VIDL1)
95 
97 #define DSS_DISP_INST_MAX (CSL_DSS_VID_PIPE_ID_MAX)
98 /* @} */
99 
109 #define DSS_DCTRL_NODE_TYPE_INVALID ((uint32_t) 0x0U)
110 #define DSS_DCTRL_NODE_TYPE_PIPE ((uint32_t) 0x1U)
111 #define DSS_DCTRL_NODE_TYPE_OVERLAY ((uint32_t) 0x2U)
112 #define DSS_DCTRL_NODE_TYPE_VP ((uint32_t) 0x3U)
113 #define DSS_DCTRL_NODE_TYPE_OUTPUT ((uint32_t) 0x4U)
114 /* @} */
115 
125 #define DSS_DCTRL_NODE_INVALID ((uint32_t) 0x0U)
126 #define DSS_DCTRL_NODE_VID1 ((uint32_t) 0x1U)
127 #define DSS_DCTRL_NODE_VIDL1 ((uint32_t) 0x2U)
128 #define DSS_DCTRL_NODE_OVERLAY1 ((uint32_t) 0x3U)
129 #define DSS_DCTRL_NODE_OVERLAY2 ((uint32_t) 0x4U)
130 #define DSS_DCTRL_NODE_VP1 ((uint32_t) 0x5U)
131 #define DSS_DCTRL_NODE_VP2 ((uint32_t) 0x6U)
132 #define DSS_DCTRL_NODE_OLDI ((uint32_t) 0x7U)
133 #define DSS_DCTRL_NODE_DPI1 ((uint32_t) 0x8U)
134 /* @} */
135 
138 #define DSS_DCTRL_MAX_NODES ((uint32_t) 9U)
139 
143 #define DSS_DCTRL_MAX_EDGES ((uint32_t) 8U)
144 
146 #define DSS_FUNC_IRQ_DEFAULT_NUM (CSL_GIC0_INTR_DSS0_BUS_DISPC_INTR_REQ_0)
147 
155 #define DSS_EVT_MGR_INST_ID_FUNC ((uint32_t) 0x00U)
156 
157 #define DSS_EVT_MGR_INST_ID_MAX ((uint32_t) 0x01U)
158 
159 #define DSS_EVT_MGR_INST_ID_INVALID ((uint32_t) 0xFFU)
160 /* @} */
161 
162 /*
163  * SOC specific IOCTLs.
164  */
165 
183 #define IOCTL_DSS_DCTRL_SET_OLDI_PARAMS (DSS_DCTRL_SOC_IOCTL_BASE + 0x01U)
184 /* @} */
185 
186 /* ========================================================================== */
187 /* Structure Declarations */
188 /* ========================================================================== */
189 
194 typedef struct
195 {
203  uint32_t numValidIrq;
207  uint32_t irqNum[DSS_EVT_MGR_INST_ID_MAX];
216 } Dss_IrqParams;
217 
222 typedef struct
223 {
224  uint32_t isCommRegAvailable[CSL_DSS_COMM_REG_ID_MAX];
226  uint32_t isPipeAvailable[CSL_DSS_VID_PIPE_ID_MAX];
228  uint32_t isOverlayAvailable[CSL_DSS_OVERLAY_ID_MAX];
230  uint32_t isPortAvailable[CSL_DSS_VP_ID_MAX];
232 } Dss_RmInfo;
233 
237 typedef struct
238 {
243 } Dss_SocParams;
244 
249 typedef struct
250 {
251  uint32_t vpId;
256 
257 /* ========================================================================== */
258 /* Internal/Private Function Declarations */
259 /* ========================================================================== */
260 
268 static inline uint32_t Dss_dispIsVidInst(uint32_t instId);
269 
277 static inline uint32_t Dss_dispIsVidLInst(uint32_t instId);
278 
286 static inline void Dss_irqParamsInit(Dss_IrqParams *irqParams);
287 
295 static inline void Dss_rmInfoInit(Dss_RmInfo *rmInfo);
296 
304 static inline void Dss_socParamsInit(Dss_SocParams *socParams);
305 
313 static inline void Dss_dctrlOldiParamsInit(Dss_DctrlOldiParams *oldiParams);
314 
315 /* ========================================================================== */
316 /* Function Declarations */
317 /* ========================================================================== */
318 
319 /* None */
320 
321 /* ========================================================================== */
322 /* Static Function Definitions */
323 /* ========================================================================== */
324 
325 static inline uint32_t Dss_dispIsVidInst(uint32_t instId)
326 {
327  uint32_t isVidInst = FALSE;
328 
329  if(DSS_DISP_INST_VID1 == instId)
330  {
331  isVidInst = TRUE;
332  }
333 
334  return (isVidInst);
335 }
336 
337 static inline uint32_t Dss_dispIsVidLInst(uint32_t instId)
338 {
339  uint32_t isVidLInst = FALSE;
340 
341  if(DSS_DISP_INST_VIDL1 == instId)
342  {
343  isVidLInst = TRUE;
344  }
345 
346  return (isVidLInst);
347 }
348 
349 static inline void Dss_irqParamsInit(Dss_IrqParams *irqParams)
350 {
351  if(NULL != irqParams)
352  {
356  }
357 }
358 
359 static inline void Dss_rmInfoInit(Dss_RmInfo *rmInfo)
360 {
361  uint32_t i = 0U;
362  if(NULL != rmInfo)
363  {
365  {
366  rmInfo->isCommRegAvailable[i] = TRUE;
367  }
369  {
370  rmInfo->isPipeAvailable[i] = TRUE;
371  }
373  {
374  rmInfo->isOverlayAvailable[i] = TRUE;
375  }
376  for(i=CSL_DSS_VP_ID_1; i<CSL_DSS_VP_ID_MAX; i++)
377  {
378  rmInfo->isPortAvailable[i] = TRUE;
379  }
380  }
381 }
382 
383 static inline void Dss_socParamsInit(Dss_SocParams *socParams)
384 {
385  if(NULL != socParams)
386  {
387  Dss_irqParamsInit(&(socParams->irqParams));
388  Dss_rmInfoInit(&(socParams->rmInfo));
389  }
390 }
391 
392 static inline void Dss_dctrlOldiParamsInit(Dss_DctrlOldiParams *oldiParams)
393 {
394  if(NULL != oldiParams)
395  {
396  oldiParams->vpId = CSL_DSS_VP_ID_1;
397  CSL_dssVpOldiCfgInit(&(oldiParams->oldiCfg));
398  }
399 }
400 
401 #ifdef __cplusplus
402 }
403 #endif
404 
405 #endif /* #ifndef DSS_SOC_VO_H_ */
406 
407 /* @} */
uint32_t vpId
Definition: dss_soc.h:251
#define CSL_DSS_COMM_REG_ID_0
Common Region 0.
Definition: csl_dssTop.h:106
#define TRUE
Definition: csl_types.h:54
Structure containing OLDI configuration. This structure is used as an argument to IOCTL_DSS_DCTRL_SET...
Definition: dss_soc.h:249
#define CSL_DSS_VID_PIPE_ID_MAX
Video Pipeline Max Id.
Definition: csl_dssTop.h:125
static void Dss_dctrlOldiParamsInit(Dss_DctrlOldiParams *oldiParams)
Dss_DctrlOldiParams structure init function.
Definition: dss_soc.h:392
#define CSL_DSS_COMM_REG_ID_MAX
Common Region Max Id.
Definition: csl_dssTop.h:110
#define FALSE
Definition: csl_types.h:55
#define DSS_EVT_MGR_INST_ID_MAX
Invalid Instance Id.
Definition: dss_soc.h:157
Structure containing resources manager information. This enables display sharing between two differen...
Definition: dss_soc.h:222
uint32_t isCommRegAvailable[CSL_DSS_COMM_REG_ID_MAX]
Definition: dss_soc.h:224
Structure containing DSS interrupt information. Events should be enabled only for available Video Por...
Definition: dss_soc.h:194
#define CSL_DSS_VP_ID_1
Video Port 1.
Definition: csl_dssTop.h:151
static void Dss_socParamsInit(Dss_SocParams *socParams)
Dss_SocParams structure init function.
Definition: dss_soc.h:383
static uint32_t Dss_dispIsVidLInst(uint32_t instId)
Check if the display driver instance is of type Video lite pipeline.
Definition: dss_soc.h:337
#define CSL_DSS_VP_ID_MAX
Video Port Max Id.
Definition: csl_dssTop.h:155
#define CSL_DSS_VID_PIPE_ID_VID1
Video Pipeline 1.
Definition: csl_dssTop.h:121
Dss_IrqParams irqParams
Definition: dss_soc.h:239
uint32_t isPortAvailable[CSL_DSS_VP_ID_MAX]
Definition: dss_soc.h:230
#define DSS_DISP_INST_VIDL1
Video Lite 1 Pipeline display driver instance number.
Definition: dss_soc.h:94
static void CSL_dssVpOldiCfgInit(CSL_DssVpOldiCfg *oldiCfg)
CSL_DssVpOldiCfg structure init function.
Definition: csl_dssVideoPort.h:968
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
#define DSS_DISP_INST_VID1
Video 1 Pipeline display driver instance number.
Definition: dss_soc.h:91
static void Dss_irqParamsInit(Dss_IrqParams *irqParams)
Dss_IrqParams structure init function.
Definition: dss_soc.h:349
static uint32_t Dss_dispIsVidInst(uint32_t instId)
Check if the display driver instance is of type Video pipeline.
Definition: dss_soc.h:325
OLDI Configuration.
Definition: csl_dssVideoPort.h:543
uint32_t dssCommonRegionId
Definition: dss_soc.h:196
uint32_t numValidIrq
Definition: dss_soc.h:203
static void Dss_rmInfoInit(Dss_RmInfo *rmInfo)
Dss_RmInfo structure init function.
Definition: dss_soc.h:359
#define DSS_EVT_MGR_INST_ID_FUNC
Instance Id for functional interrupts.
Definition: dss_soc.h:155
uint32_t isOverlayAvailable[CSL_DSS_OVERLAY_ID_MAX]
Definition: dss_soc.h:228
DSS SOC parameters.
Definition: dss_soc.h:237
Dss_RmInfo rmInfo
Definition: dss_soc.h:241
#define CSL_DSS_OVERLAY_ID_MAX
Overlay Max Id.
Definition: csl_dssTop.h:140
uint32_t irqNum[DSS_EVT_MGR_INST_ID_MAX]
Definition: dss_soc.h:207
CSL_DssVpOldiCfg oldiCfg
Definition: dss_soc.h:253
#define DSS_FUNC_IRQ_DEFAULT_NUM
Definition: dss_soc.h:146
uint32_t isPipeAvailable[CSL_DSS_VID_PIPE_ID_MAX]
Definition: dss_soc.h:226
#define CSL_DSS_OVERLAY_ID_1
Overlay 1.
Definition: csl_dssTop.h:136