1 /*
2 * Copyright (c) Texas Instruments Incorporated 2018-2022
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 */
34 /**
35 * \ingroup DRV_DSS_MODULE
36 * \defgroup DRV_DSS_DCTRL_MODULE Display Controller Driver
37 * This is DSS Display Controller driver documentation
38 *
39 * @{
40 */
42 /**
43 * \file dss_dctrl.h
44 *
45 * \brief DSS Controller Driver API/interface file.
46 */
48 #ifndef DSS_DCTRL_H_
49 #define DSS_DCTRL_H_
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
55 /* None */
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
65 /**
66 * \brief Video Port sync loss callback function prototype.
67 *
68 * \param vpId [OUT] Video Port Id.
69 * \param appData [OUT] Application's private data.
70 *
71 * \return None.
72 */
73 typedef void (*Dss_DctrlSyncLostCbFxn)(uint32_t vpId, void *appData);
75 /** \brief Forward declaration for instance object. */
76 typedef struct Dss_DctrlVpSafetyCbData_t Dss_DctrlVpSafetyCbData;
78 /**
79 * \brief Video Port safety error callback function prototype.
80 *
81 * \param vpId [OUT] Video Port Id.
82 * \param safetyCbData [OUT] Safety Callback Data.
83 * Refer #Dss_DctrlVpSafetyCbData_t for details
84 * \param appData [OUT] Application's private data.
85 *
86 * \return None.
87 */
88 typedef void (*Dss_DctrlSafetyErrCbFxn)(uint32_t vpId,
89 Dss_DctrlVpSafetyCbData safetyCbData,
90 void *appData);
92 /**
93 * \brief Video Port line number callback function prototype.
94 *
95 * \param vpId [OUT] Video Port Id.
96 * \param appData [OUT] Application's private data.
97 *
98 * \return None.
99 */
100 typedef void (*Dss_DctrlLineNumCbFxn)(uint32_t vpId, void *appData);
102 /*
103 * Display controller driver IOCTLs.
104 */
106 /**
107 * \ingroup DRV_DSS_DCTRL_MODULE
108 * \defgroup DRV_DSS_DCTRL_IOCTL Display Controller IOCTLs
109 * @{
110 *
111 * These are display controller FVID2 APIs that can be called by the
112 * application.
113 */
115 /**
116 * \brief Command to set the DSS display path configuration.
117 *
118 * All the DSS modules handled by the Display Controller can be
119 * represented by a graph, where node represents a module like video port,
120 * overlay etc. and edge is present between two nodes if they are connected.
121 * All DSS paths can be configured by this IOCTL in one shot. Use macros
122 * defined in <dss_soc.h> for different node ids.
123 *
124 * This IOCTL takes list of edges connecting nodes and configures display
125 * paths. It first validates these paths and then configures DSS for the
126 * display paths. It configures all the modules present in the path.
127 *
128 * \param cmdArgs [IN] Pointer of type #Dss_DctrlPathInfo
129 * \param cmdArgsStatus [OUT] NULL
130 *
131 * \return FVID2_SOK if successful, else suitable error code
132 */
133 #define IOCTL_DSS_DCTRL_SET_PATH (DSS_DCTRL_IOCTL_BASE + 0x01U)
135 /**
136 * \brief Command to clear the DSS display path configuration.
137 *
138 * This IOCTL takes list of edges connecting nodes and clears the
139 * configuration. It also stops Video Ports.
140 *
141 * It does not validates the edge list. It simply disables the edge
142 * connecting nodes. For the Video Ports, it checks for the validity and
143 * then disables the video port if there are no errors.
144 * Use macros defined in <dss_soc.h> for different node ids.
145 *
146 * \param cmdArgs [IN] Pointer of type #Dss_DctrlPathInfo
147 * \param cmdArgsStatus [OUT] NULL
148 *
149 * \return FVID2_SOK if successful, else suitable error code
150 */
151 #define IOCTL_DSS_DCTRL_CLEAR_PATH (DSS_DCTRL_IOCTL_BASE + 0x02U)
153 /**
154 * \brief Command to set Video Port configuration.
155 *
156 * This IOCTL is used to set the Video Port configuration if Video Port
157 * is not on. For the enabled Video Port, port has to be stopped first,
158 * then configuration can can be changed. Refer #Dss_DctrlVpParams
159 * for configuration details.
160 * This IOCTL should be called before IOCTL_DSS_DCTRL_SET_PATH.
161 *
162 * \param cmdArgs [IN] Pointer of type #Dss_DctrlVpParams
163 * \param cmdArgsStatus [OUT] NULL
164 *
165 * \return FVID2_SOK if successful, else suitable error code
166 *
167 */
168 #define IOCTL_DSS_DCTRL_SET_VP_PARAMS (DSS_DCTRL_IOCTL_BASE + 0x03U)
170 /**
171 * \brief Command to set configuration of the given overlay.
172 *
173 * This IOCTL is used to set the different Overlay parameters. Refer
174 * #Dss_DctrlOverlayParams for configuration details.
175 * Note: In case color bar enable is TRUE then this IOCTL should be called at
176 * the end after doing all other display controller configuration.
177 *
178 * \param cmdArgs [IN] Pointer of type #Dss_DctrlOverlayParams
179 * \param cmdArgsStatus [OUT] NULL
180 *
181 * \return FVID2_SOK if successful, else suitable error code
182 *
183 */
184 #define IOCTL_DSS_DCTRL_SET_OVERLAY_PARAMS (DSS_DCTRL_IOCTL_BASE + 0x04U)
186 /**
187 * \brief Command to set layer/Z-order configuration of the given overlay.
188 *
189 * This IOCTL is used to set the layer/Z-order configuration. Refer
190 * #Dss_DctrlOverlayLayerParams for details.
191 * Note: User should pass the layer configuration for all the video pipes which
192 * are present in the DSS in order to set/change the Z order.
193 * In case a particular pipe is disabled, layerNum should be set to
194 * CSL_DSS_OVERLAY_LAYER_INVALID.
195 *
196 * \param cmdArgs [IN] Pointer of type #Dss_DctrlOverlayLayerParams
197 * \param cmdArgsStatus [OUT] NULL
198 *
199 * \return FVID2_SOK if successful, else suitable error code
200 *
201 */
202 #define IOCTL_DSS_DCTRL_SET_LAYER_PARAMS (DSS_DCTRL_IOCTL_BASE + 0x05U)
204 /**
205 * \brief Command to program the CSC coefficients for Video Port.
206 * By default BT 601 coefficients are set.
207 *
208 * \param cmdArgs [IN] Pointer of type #Dss_DctrlVpCscCoeff
209 * \param cmdArgsStatus [OUT] NULL
210 *
211 * \return FVID2_SOK if successful, else suitable error code
212 */
213 #define IOCTL_DSS_DCTRL_SET_VP_CSC_COEFF (DSS_DCTRL_IOCTL_BASE + 0x06U)
215 /**
216 * \brief Command to set advance Video Port configuration.
217 *
218 * This IOCTL is used to program the advance Video Port configuration.
219 * Refer #Dss_DctrlAdvVpParams for configuration details.
220 *
221 * \param cmdArgs [IN] Pointer of type #Dss_DctrlAdvVpParams
222 * \param cmdArgsStatus [OUT] NULL
223 *
224 * \return FVID2_SOK if successful, else suitable error code
225 */
226 #define IOCTL_DSS_DCTRL_SET_ADV_VP_PARAMS (DSS_DCTRL_IOCTL_BASE + 0x07U)
228 /**
229 * \brief Command to program blank timing parameters of given LCD.
230 *
231 * This IOCTL is used to program the blank timing parameters for the LCD.
232 * This IOCTL can be called dynamically at runtime.
233 * Note: The change in timing will take effect from the next vsync.
234 * This API should be called in the vsync callback to the application in the
235 * ISR context or immediately after that in task/swi context. Calling this
236 * IOCTL near the vsync should be avoided as the shadow to work copy could
237 * happens while we are changing the timing parameters and could result in
238 * taking only a part of this configuration for next one frame or delaying the
239 * timing change by next one frame. Subsequent frames will have proper timing.
240 *
241 * \param cmdArgs [IN] Pointer of type #Dss_DctrlLcdBlankTimingParams
242 * \param cmdArgsStatus [OUT] NULL
243 *
244 * \return FVID2_SOK if successful, else suitable error code
245 */
246 #define IOCTL_DSS_DCTRL_SET_LCD_BLANK_TIMING_PARAMS \
247 (DSS_DCTRL_IOCTL_BASE + 0x08U)
249 /**
250 * \brief Command to program Safety Check configuration at Video Port Output.
251 *
252 * This IOCTL is used to program the safety check configuration parameters.
253 * Note: There are up to four sub-regions within the active video output in
254 * which safety check can be enabled. This IOCTL should be called separately
255 * for each region.
256 *
257 * \param cmdArgs [IN] Pointer of type #Dss_DctrlVpSafetyChkParams
258 * \param cmdArgsStatus [OUT] NULL
259 *
260 * \return FVID2_SOK if successful, else suitable error code
261 */
262 #define IOCTL_DSS_DCTRL_SET_VP_SAFETY_CHK_PARAMS \
263 (DSS_DCTRL_IOCTL_BASE + 0x09U)
265 /**
266 * \brief IOCTL to get the number of errors for a given Video Port.
267 *
268 * This IOCTL is used to get the count of sync lost errors, security violations
269 * and safety check errors for a given video port.
270 *
271 * \param cmdArgs [IN] Pointer of type #Dss_DctrlVpErrorStats
272 * \param cmdArgsStatus [OUT] NULL
273 *
274 * \return FVID2_SOK if successful, else suitable error code
275 *
276 */
277 #define IOCTL_DSS_DCTRL_GET_VP_ERROR_STATS (DSS_DCTRL_IOCTL_BASE + 0x0AU)
279 /**
280 * \brief IOCTL to set the global DSS parameters.
281 *
282 * This IOCTL can be used to set the global mflag and CBA configuration.
283 *
284 * \param cmdArgs [IN] Pointer of type #Dss_DctrlGlobalDssParams
285 * \param cmdArgsStatus [OUT] NULL
286 *
287 * \return FVID2_SOK if successful, else suitable error code
288 *
289 */
290 #define IOCTL_DSS_DCTRL_SET_GLOBAL_DSS_PARAMS (DSS_DCTRL_IOCTL_BASE + 0x0BU)
292 /**
293 * \brief Command to disable Video Port.
294 *
295 * This IOCTL is used to disable the Video Port.
296 * Refer #Dss_DctrlVpParams for configuration details.
297 *
298 * \param cmdArgs [IN] Pointer of type #Dss_DctrlVpParams
299 * \param cmdArgsStatus [OUT] NULL
300 *
301 * \return FVID2_SOK if successful, else suitable error code
302 *
303 */
304 #define IOCTL_DSS_DCTRL_STOP_VP (DSS_DCTRL_IOCTL_BASE + 0x0CU)
306 /**
307 * \brief Command to register Video Port sync lost callback function.
308 *
309 * This IOCTL can be used to register a callback when there is a sync loss for
310 * a particular video port. See #Dss_DctrlSyncLostCbFxn for details. This IOCTL
311 * is per Video Port and hence should be called separately for each port.
312 * Note: syncLostCbFxn should be set to NULL in order to unregister
313 * the callback.
314 *
315 * \param cmdArgs [IN] Pointer of type #Dss_DctrlSyncLostCbParams
316 * \param cmdArgsStatus [OUT] NULL
317 *
318 * \return FVID2_SOK if successful, else suitable error code
319 */
320 #define IOCTL_DSS_DCTRL_REGISTER_SYNCLOST_CB (DSS_DCTRL_IOCTL_BASE + 0x0DU)
322 /**
323 * \brief Command to register Video Port line number callback function
324 *
325 * This IOCTL can be used to register a callback when there is a line number
326 * interrupt for a particular video port. See #Dss_DctrlLineNumCbFxn for
327 * details. This IOCTL is per Video Port and hence should be called separately
328 * for each port.
329 * Note: lineNumCbFxn should be set to NULL in order to unregister
330 * the callback.
331 *
332 * \param cmdArgs [IN] Pointer of type #Dss_DctrlLineNumCbParams
333 * \param cmdArgsStatus [OUT] NULL
334 *
335 * \return FVID2_SOK if successful, else suitable error code
336 */
337 #define IOCTL_DSS_DCTRL_REGISTER_LINENUM_CB (DSS_DCTRL_IOCTL_BASE + 0x0EU)
339 /**
340 * \brief Command to set the DSI specific parameters
341 *
342 * Currently used to set number of output lanes.
343 *
344 * \param cmdArgs [IN] Pointer of type #Dss_DctrlDsiParams
345 * \param cmdArgsStatus [OUT] NULL
346 *
347 * \return FVID2_SOK if successful, else suitable error code
348 */
349 #define IOCTL_DSS_DCTRL_SET_DSI_PARAMS (DSS_DCTRL_IOCTL_BASE + 0x0FU)
351 /**
352 * \brief Command to detect if the DP cable is connected or not.
353 *
354 * \return FVID2_SOK if successful, else suitable error code
355 */
356 #define IOCTL_DSS_DCTRL_IS_DP_CONNECTED (DSS_DCTRL_IOCTL_BASE + 0x10U)
357 /* @} */
359 /* ========================================================================== */
360 /* Structure Declarations */
361 /* ========================================================================== */
363 /**
364 * \brief Structure containing DSS path information.
365 * This structure is used as an argument to IOCTL_DSS_DCTRL_SET_PATH.
366 * This IOCTL takes the array of edges connected between nodes.
367 */
368 typedef struct
369 {
370 uint32_t numEdges;
371 /**< Number edge in the edgeInfo array */
372 Fvid2_GraphEdgeInfo edgeInfo[DSS_DCTRL_MAX_EDGES];
373 /**< List of edges connecting DSS modules. Display controller parses these
374 * edges and enables/disables input/output path in the appropriate DSS
375 * module. This edge tells which module is connected to which module
376 * enabling output in edge start module and input in edge end module.*/
377 } Dss_DctrlPathInfo;
379 /**
380 * \brief Structure containing DSS sync operations configuration.
381 * This structure is used as a part of \ref Dss_DctrlVpParams.
382 */
383 typedef struct
384 {
385 uint32_t enabled;
386 /**< Enable sync operations configuration */
387 uint32_t isPrimary;
388 /**< Whether this VP is the primary output.
389 * Only operations on the primary VP results in H/W
390 * register operations.
391 * For secondary VPs, the enable / setGo operations
392 * pend on the corresponding operation on the primary VP */
393 uint32_t syncVpIds[CSL_DSS_VP_ID_MAX];
394 /**< Array of VP Ids for Sync operations */
395 uint32_t numSyncVpIds;
396 /**< Number of valid VP Ids in #syncVpIds */
397 } Dss_DctrlSyncOpCfg;
399 /**
400 * \brief Structure containing Video Port information.
401 * This structure is used as an argument to IOCTL_DSS_DCTRL_SET_VP_PARAMS.
402 */
403 typedef struct
404 {
405 uint32_t vpId;
406 /**< Video Port Id. See \ref CSL_DssVpId for values */
407 CSL_DssVpLcdOpTimingCfg lcdOpTimingCfg;
408 /**< Timing configuration for the LCD output.
409 * See \ref CSL_DssVpLcdOpTimingCfg for details */
410 CSL_DssVpLcdSignalPolarityCfg lcdPolarityCfg;
411 /**< LCD Polarity Configuration.
412 * See \ref CSL_DssVpLcdSignalPolarityCfg for details */
413 CSL_DssVpLcdTdmCfg lcdTdmCfg;
414 /**< LCD TDM Configuration. See \ref CSL_DssVpLcdTdmCfg for details */
415 Dss_DctrlSyncOpCfg syncOpCfg;
416 /**< Sync operation Configuration. See \ref Dss_DctrlSyncOpCfg for details */
417 } Dss_DctrlVpParams;
419 /**
420 * \brief Structure containing Overlay information.
421 * This structure is used as an argument to IOCTL_DSS_DCTRL_SET_OVERLAY_PARAMS.
422 */
423 typedef struct
424 {
425 uint32_t overlayId;
426 /**< Overlay Id. See \ref CSL_DssOverlayId for values */
427 uint32_t colorbarEnable;
428 /**< Overlay Color bar Enable. TRUE: Enable FALSE: Disable */
429 CSL_DssOverlayCfg overlayCfg;
430 /**< Overlay Configuration. See \ref CSL_DssOverlayCfg for details */
431 } Dss_DctrlOverlayParams;
433 /**
434 * \brief Structure containing Overlay layer information.
435 * This structure is used as an argument to IOCTL_DSS_DCTRL_SET_LAYER_PARAMS.
436 */
437 typedef struct
438 {
439 uint32_t overlayId;
440 /**< Overlay Id. See \ref CSL_DssOverlayId for values */
441 uint32_t pipeLayerNum[CSL_DSS_VID_PIPE_ID_MAX];
442 /**< Layer to which a particular Video Pipe Id is connected.
443 * For valid values see \ref CSL_DssOverlayLayerNum */
444 } Dss_DctrlOverlayLayerParams;
446 /**
447 * \brief Structure containing Video Port CSC information.
448 * This structure is used as an argument to IOCTL_DSS_DCTRL_SET_VP_CSC_COEFF.
449 */
450 typedef struct
451 {
452 uint32_t vpId;
453 /**< Video Port Id. See \ref CSL_DssVpId for values */
454 uint32_t cscPos;
455 /**< Position of CSC block wrt GAMMA module.
456 * Refer \ref CSL_DssVpCscPos for values */
457 CSL_DssCscCoeff cscCoeff;
458 /**< Video Port CSC coefficients.
459 * See \ref CSL_DssCscCoeff for details */
460 } Dss_DctrlVpCscCoeff;
462 /**
463 * \brief Structure containing advance Video Port information.
464 * This structure is used as an argument to IOCTL_DSS_DCTRL_SET_ADV_VP_PARAMS.
465 */
466 typedef struct
467 {
468 uint32_t vpId;
469 /**< Video Port Id. See \ref CSL_DssVpId for values */
470 CSL_DssVpLcdAdvSignalCfg lcdAdvSignalCfg;
471 /**< Advance Signal Configuration for the LCD.
472 * See \ref CSL_DssVpLcdAdvSignalCfg for details */
473 } Dss_DctrlAdvVpParams;
475 /**
476 * \brief Structure containing LCD Blank Timing Configuration.
477 * This structure is used as an argument to
478 * IOCTL_DSS_DCTRL_SET_LCD_BLANK_TIMING_PARAMS.
479 */
480 typedef struct
481 {
482 uint32_t vpId;
483 /**< Video Port Id. See \ref CSL_DssVpId for values */
484 uint32_t dvoFormat;
485 /**< Digital output format. For valid values see \ref Fvid2_DVFormat */
486 CSL_DssVpLcdBlankTimingCfg lcdBlankTimingCfg;
487 /**< Timing configuration for the LCD.
488 * See \ref CSL_DssVpLcdBlankTimingCfg for details */
489 } Dss_DctrlLcdBlankTimingParams;
491 /**
492 * \brief Structure containing Safety Check configuration for a particular
493 * region.
494 */
495 typedef struct
496 {
497 uint32_t regionId;
498 /**< Safety Region Id */
499 uint32_t referenceSign;
500 /**< Reference Safety Signature for Data Correctness Check */
501 CSL_DssSafetyChkCfg safetyChkCfg;
502 /**< Safety Check Configuration. See \ref CSL_DssSafetyChkCfg for details */
503 } Dss_DctrlRegionSafetyChkCfg;
505 /**
506 * \brief Structure containing safety error callback data.
507 * This structure is returned by the driver .
508 */
509 struct Dss_DctrlVpSafetyCbData_t
510 {
511 uint32_t regionId;
512 /**< Region Id for which interrupt has occurred */
513 uint32_t capturedSign;
514 /**< Captured Safety Signature by Data Correctness Check, set to 0x0 in case
515 * of frame freeze detect */
516 };
518 /**
519 * \brief Structure containing Safety Check configuration of Video Port.
520 * This structure is used as an argument to
521 * IOCTL_DSS_DCTRL_SET_VP_SAFETY_CHK_PARAMS.
522 */
523 typedef struct
524 {
525 uint32_t vpId;
526 /**< Video Port Id. See \ref CSL_DssVpId for values */
527 uint32_t safetySignSeedVal;
528 /**< Safety Signature Seed Value, only one non-zero value is possible in a
529 * particular context. In case user passes multiple non-zero values for
530 * different regions, previous value is overwritten. */
531 Dss_DctrlRegionSafetyChkCfg regionSafetyChkCfg;
532 /**< Safety Check Configuration for a particular region.
533 * See \ref Dss_DctrlRegionSafetyChkCfg for details */
534 Dss_DctrlSafetyErrCbFxn safetyErrCbFxn;
535 /**< Safety Error callback function */
536 Dss_DctrlVpSafetyCbData safetyCbData;
537 /**< Safety Error callback data to be returned to application */
538 void *appData;
539 /**< Private data of application */
540 } Dss_DctrlVpSafetyChkParams;
542 /**
543 * \brief Structure containing Error Stats of Video Port.
544 * This structure is used as an argument to IOCTL_DSS_DCTRL_GET_VP_ERROR_STATS.
545 */
546 typedef struct
547 {
548 uint32_t vpId;
549 /**< Video Port Id. See \ref CSL_DssVpId for values */
550 uint32_t syncLost;
551 /**< SyncLost Error Count of the LCD */
552 uint32_t safetyViolation[CSL_DSS_VP_SAFETY_REGION_MAX];
553 /**< Safety Violation Count */
554 uint32_t securityViolation;
555 /**< Security Violation Count */
556 } Dss_DctrlVpErrorStats;
558 /**
559 * \brief Structure containing global DSS Configuration.
560 * This structure is used as an argument to
561 * IOCTL_DSS_DCTRL_SET_GLOBAL_DSS_PARAMS.
562 */
563 typedef struct
564 {
565 CSL_DssGlobalMFlagCfg globalMflagCfg;
566 /**< Global Mflag Configuration.
567 * See \ref CSL_DssGlobalMFlagCfg for details */
568 CSL_DssCbaCfg cbaCfg;
569 /**< CBA Priority Configuration. See \ref CSL_DssCbaCfg for details */
570 } Dss_DctrlGlobalDssParams;
572 /**
573 * \brief Structure containing Sync Lost callback parameters.
574 * This structure is used as an argument to
575 * IOCTL_DSS_DCTRL_REGISTER_SYNCLOST_CB.
576 */
577 typedef struct
578 {
579 uint32_t vpId;
580 /**< Video Port Id. See \ref CSL_DssVpId for values */
581 Dss_DctrlSyncLostCbFxn syncLostCbFxn;
582 /**< Sync lost callback function */
583 void *appData;
584 /**< Private data of application */
585 } Dss_DctrlSyncLostCbParams;
587 /**
588 * \brief Structure containing line number interrupt callback parameters.
589 * This structure is used as an argument to
590 * IOCTL_DSS_DCTRL_REGISTER_LINENUM_CB.
591 */
592 typedef struct
593 {
594 uint32_t vpId;
595 /**< Video Port Id. See \ref CSL_DssVpId for values */
596 Dss_DctrlLineNumCbFxn lineNumCbFxn;
597 /**< Line number callback function */
598 void *appData;
599 /**< Private data of application */
600 } Dss_DctrlLineNumCbParams;
602 /**
603 * \brief Structure containing DSI Output parameters.
604 * This structure is used as an argument to
605 * IOCTL_DSS_DCTRL_SET_DSI_PARAMS.
606 */
607 typedef struct
608 {
609 uint32_t instId;
610 /**< DSI Instance ID, currently note used */
611 uint32_t numOfLanes;
612 /**< Number of outputs lanes for DSI output, max 4 */
613 uint32_t laneSpeedInKbps;
614 /**< Exact DPHY lane speed from the selected speed band in Megabits per sec.
615 * This parameter is set to default value during init time.
616 * If updated in the application after init, newly set value will be used
617 * for DPHY clock configurations.
618 */
619 } Dss_DctrlDsiParams;
621 /* ========================================================================== */
622 /* Internal/Private Function Declarations */
623 /* ========================================================================== */
625 /**
626 * \brief Dss_DctrlPathInfo structure init function.
627 *
628 * \param pathInfo [IN]Pointer to #Dss_DctrlPathInfo structure.
629 *
630 * \return None
631 */
632 static inline void Dss_dctrlPathInfoInit(Dss_DctrlPathInfo *pathInfo);
634 /**
635 * \brief Dss_DctrlVpParams structure init function.
636 *
637 * \param vpParams [IN]Pointer to #Dss_DctrlVpParams structure.
638 *
639 * \return None
640 */
641 static inline void Dss_dctrlVpParamsInit(Dss_DctrlVpParams *vpParams);
643 /**
644 * \brief Dss_DctrlOverlayParams structure init function.
645 *
646 * \param overlayParams [IN]Pointer to #Dss_DctrlOverlayParams structure.
647 *
648 * \return None
649 */
650 static inline void Dss_dctrlOverlayParamsInit(
651 Dss_DctrlOverlayParams *overlayParams);
653 /**
654 * \brief Dss_DctrlOverlayLayerParams structure init function.
655 *
656 * \param layerParams [IN]Pointer to #Dss_DctrlOverlayLayerParams structure.
657 *
658 * \return None
659 */
660 static inline void Dss_dctrlOverlayLayerParamsInit(
661 Dss_DctrlOverlayLayerParams *layerParams);
663 /**
664 * \brief Dss_DctrlAdvVpParams structure init function.
665 *
666 * \param advVpParams [IN]Pointer to #Dss_DctrlAdvVpParams structure.
667 *
668 * \return None
669 */
670 static inline void Dss_dctrlAdvVpParamsInit(Dss_DctrlAdvVpParams *advVpParams);
672 /**
673 * \brief Dss_DctrlLcdBlankTimingParams structure init function.
674 *
675 * \param lcdBlankTimingParams [IN]Pointer to #Dss_DctrlLcdBlankTimingParams
676 * structure.
677 *
678 * \return None
679 */
680 static inline void Dss_dctrlLcdBlankTimingParamsInit(
681 Dss_DctrlLcdBlankTimingParams *lcdBlankTimingParams);
683 /**
684 * \brief Dss_DctrlRegionSafetyChkCfg structure init function.
685 *
686 * \param regionSafetyChkCfg [IN]Pointer to #Dss_DctrlRegionSafetyChkCfg
687 * structure.
688 *
689 * \return None
690 */
691 static inline void Dss_dctrlRegionSafetyChkCfgInit(
692 Dss_DctrlRegionSafetyChkCfg *regionSafetyChkCfg);
694 /**
695 * \brief Dss_DctrlVpSafetyCbData structure init function.
696 *
697 * \param safetyCbData [IN]Pointer to #Dss_DctrlVpSafetyCbData_t structure.
698 *
699 * \return None
700 */
701 static inline void Dss_dctrlVpSafetyCbDataInit(
702 Dss_DctrlVpSafetyCbData *safetyCbData);
704 /**
705 * \brief Dss_DctrlVpSafetyChkParams structure init function.
706 *
707 * \param vpSafetyChkParams [IN]Pointer to #Dss_DctrlVpSafetyChkParams
708 * structure.
709 *
710 * \return None
711 */
712 static inline void Dss_dctrlVpSafetyChkParamsInit(
713 Dss_DctrlVpSafetyChkParams *vpSafetyChkParams);
715 /**
716 * \brief Dss_DctrlVpErrorStats structure init function.
717 *
718 * \param vpErrorStats [IN]Pointer to #Dss_DctrlVpErrorStats structure.
719 *
720 * \return None
721 */
722 static inline void Dss_dctrlVpErrorStatsInit(
723 Dss_DctrlVpErrorStats *vpErrorStats);
725 /**
726 * \brief Dss_DctrlGlobalDssParams structure init function.
727 *
728 * \param globalDssParams [IN]Pointer to #Dss_DctrlGlobalDssParams structure.
729 *
730 * \return None
731 */
732 static inline void Dss_dctrlGlobalDssParamsInit(
733 Dss_DctrlGlobalDssParams *globalDssParams);
735 /**
736 * \brief Dss_DctrlSyncLostCbParams structure init function.
737 *
738 * \param syncLostCbParams [IN]Pointer to #Dss_DctrlSyncLostCbParams structure.
739 *
740 * \return None
741 */
742 static inline void Dss_dctrlSyncLostCbParamsInit(
743 Dss_DctrlSyncLostCbParams *syncLostCbParams);
745 /**
746 * \brief Dss_DctrlLineNumCbParams structure init function.
747 *
748 * \param lineNumCbParams [IN]Pointer to #Dss_DctrlLineNumCbParams structure.
749 *
750 * \return None
751 */
752 static inline void Dss_dctrlLineNumCbParamsInit(
753 Dss_DctrlLineNumCbParams *lineNumCbParams);
755 /* ========================================================================== */
756 /* Function Declarations */
757 /* ========================================================================== */
759 /* None */
761 /* ========================================================================== */
762 /* Static Function Definitions */
763 /* ========================================================================== */
765 static inline void Dss_dctrlPathInfoInit(Dss_DctrlPathInfo *pathInfo)
766 {
767 uint32_t i;
768 if(NULL != pathInfo)
769 {
770 pathInfo->numEdges = 0U;
771 for(i=0U; i<DSS_DCTRL_MAX_EDGES; i++)
772 {
773 pathInfo->edgeInfo[i].startNode = 0U;
774 pathInfo->edgeInfo[i].endNode = 0U;
775 }
776 }
777 }
779 static inline void Dss_DctrlSyncOpCfgInit(Dss_DctrlSyncOpCfg *syncOpCfg)
780 {
781 uint32_t i;
783 if(NULL != syncOpCfg)
784 {
785 syncOpCfg->enabled = FALSE;
786 syncOpCfg->isPrimary = TRUE;
787 for(i = 0; i < CSL_DSS_VP_ID_MAX; i++)
788 {
789 syncOpCfg->syncVpIds[i] = CSL_DSS_VP_ID_1;
790 }
791 syncOpCfg->numSyncVpIds = 0;
792 }
793 }
795 static inline void Dss_dctrlVpParamsInit(Dss_DctrlVpParams *vpParams)
796 {
797 if(NULL != vpParams)
798 {
799 vpParams->vpId = CSL_DSS_VP_ID_1;
800 CSL_dssVpLcdOpTimingCfgInit(&(vpParams->lcdOpTimingCfg));
801 CSL_dssVpLcdSignalPolarityCfgInit(&(vpParams->lcdPolarityCfg));
802 CSL_dssVpLcdTdmCfgInit(&(vpParams->lcdTdmCfg));
803 Dss_DctrlSyncOpCfgInit(&(vpParams->syncOpCfg));
804 }
805 }
807 static inline void Dss_dctrlOverlayParamsInit(
808 Dss_DctrlOverlayParams *overlayParams)
809 {
810 if(NULL != overlayParams)
811 {
812 overlayParams->overlayId = CSL_DSS_OVERLAY_ID_1;
813 overlayParams->colorbarEnable = FALSE;
814 CSL_dssOverlayCfgInit(&(overlayParams->overlayCfg));
815 }
816 }
818 static inline void Dss_dctrlOverlayLayerParamsInit(
819 Dss_DctrlOverlayLayerParams *layerParams)
820 {
821 uint32_t i;
822 if(NULL != layerParams)
823 {
824 layerParams->overlayId = CSL_DSS_OVERLAY_ID_1;
825 for(i=0U; i<CSL_DSS_VID_PIPE_ID_MAX; i++)
826 {
827 layerParams->pipeLayerNum[i] = CSL_DSS_OVERLAY_LAYER_INVALID;
828 }
829 }
830 }
832 static inline void Dss_dctrlAdvVpParamsInit(Dss_DctrlAdvVpParams *advVpParams)
833 {
834 if(NULL != advVpParams)
835 {
836 advVpParams->vpId = CSL_DSS_VP_ID_1;
837 CSL_dssVpLcdAdvSignalCfgInit(&(advVpParams->lcdAdvSignalCfg));
838 }
839 }
841 static inline void Dss_dctrlLcdBlankTimingParamsInit(
842 Dss_DctrlLcdBlankTimingParams *lcdBlankTimingParams)
843 {
844 if(NULL != lcdBlankTimingParams)
845 {
846 lcdBlankTimingParams->vpId = CSL_DSS_VP_ID_1;
847 CSL_dssVpLcdBlankTimingCfgInit(&(lcdBlankTimingParams->lcdBlankTimingCfg));
848 }
849 }
851 static inline void Dss_dctrlRegionSafetyChkCfgInit(
852 Dss_DctrlRegionSafetyChkCfg *regionSafetyChkCfg)
853 {
854 if(NULL != regionSafetyChkCfg)
855 {
856 regionSafetyChkCfg->regionId = CSL_DSS_VP_SAFETY_REGION_0;
857 regionSafetyChkCfg->referenceSign = 0U;
858 CSL_dssSafetyChkCfgInit(&(regionSafetyChkCfg->safetyChkCfg));
859 }
860 }
862 static inline void Dss_dctrlVpSafetyCbDataInit(
863 Dss_DctrlVpSafetyCbData *safetyCbData)
864 {
865 if(NULL != safetyCbData)
866 {
867 safetyCbData->regionId = CSL_DSS_VP_SAFETY_REGION_0;
868 safetyCbData->capturedSign = 0U;
869 }
870 }
872 static inline void Dss_dctrlVpSafetyChkParamsInit(
873 Dss_DctrlVpSafetyChkParams *vpSafetyChkParams)
874 {
875 if(NULL != vpSafetyChkParams)
876 {
877 vpSafetyChkParams->vpId = CSL_DSS_VP_ID_1;
878 vpSafetyChkParams->safetySignSeedVal = 0U;
879 Dss_dctrlRegionSafetyChkCfgInit(&(vpSafetyChkParams->regionSafetyChkCfg));
880 vpSafetyChkParams->safetyErrCbFxn = NULL;
881 Dss_dctrlVpSafetyCbDataInit(&(vpSafetyChkParams->safetyCbData));
882 vpSafetyChkParams->appData = NULL;
883 }
884 }
886 static inline void Dss_dctrlVpErrorStatsInit(Dss_DctrlVpErrorStats *vpErrorStats)
887 {
888 uint32_t i;
889 if(NULL != vpErrorStats)
890 {
891 vpErrorStats->vpId = CSL_DSS_VP_ID_1;
892 vpErrorStats->syncLost = 0U;
893 for(i=0U; i<CSL_DSS_VP_SAFETY_REGION_MAX; i++)
894 {
895 vpErrorStats->safetyViolation[i] = 0U;
896 }
897 vpErrorStats->securityViolation = 0U;
898 }
899 }
901 static inline void Dss_dctrlGlobalDssParamsInit(
902 Dss_DctrlGlobalDssParams *globalDssParams)
903 {
904 if(NULL != globalDssParams)
905 {
906 CSL_dssGlobalMFlagCfgInit(&(globalDssParams->globalMflagCfg));
907 CSL_dssCbaCfgInit(&(globalDssParams->cbaCfg));
908 }
909 }
911 static inline void Dss_dctrlSyncLostCbParamsInit(
912 Dss_DctrlSyncLostCbParams *syncLostCbParams)
913 {
914 if(NULL != syncLostCbParams)
915 {
916 syncLostCbParams->vpId = CSL_DSS_VP_ID_1;
917 syncLostCbParams->syncLostCbFxn = NULL;
918 syncLostCbParams->appData = NULL;
919 }
920 }
922 static inline void Dss_dctrlLineNumCbParamsInit(
923 Dss_DctrlLineNumCbParams *lineNumCbParams)
924 {
925 if(NULL != lineNumCbParams)
926 {
927 lineNumCbParams->vpId = CSL_DSS_VP_ID_1;
928 lineNumCbParams->lineNumCbFxn = NULL;
929 lineNumCbParams->appData = NULL;
930 }
931 }
933 #ifdef __cplusplus
934 }
935 #endif
937 #endif /* #ifndef DSS_DCTRL_H_ */
939 /* @} */