dcsub
Vitis Drivers API Documentation
xdcsub.c File Reference

Overview

This file implements all the functions related to the Video Pipeline of the DisplayPort Subsystem.

See xdc.h for the detailed description of the driver.

Note
None.
MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.0 ck 03/14/2025 Initial Version

Functions

u32 XDcSub_CfgInitialize (XDcSub *InstancePtr)
 This function intializes the configuration of all instances part of DC subsystem i.e DC, DCDMA, Interrupts. More...
 
u32 XDcSub_Initialize (XDcSub *InstancePtr)
 This function initializes all the data structures of the XDcSub Instance. More...
 
u32 XDcSub_SetVidInterfaceMode (XDcSub *InstancePtr, XDc_VidInterface Mode)
 This function sets the Interface mode for DCSub DC Instance. More...
 
u32 XDcSub_SetBlenderBgColor (XDcSub *InstancePtr, XDc_BlenderBgClr *Color)
 This function sets the blender background color. More...
 
u32 XDcSub_SetGlobalAlpha (XDcSub *InstancePtr, XDc_AlphaBlend AlphaEnable, u8 Alpha)
 This function enables or disables global alpha. More...
 
u32 XDcSub_SetVidStreamSrc (XDcSub *InstancePtr, XDc_VideoStream1 VidStream1, XDc_VideoStream2 VidStream2)
 This function selects the source type for the Video and Graphics input streams that are passed on to the blender block. More...
 
u32 XDcSub_SetInputAudioSelect (XDcSub *InstancePtr, XDc_AudioStream AudStream)
 This function selects the source type for audio stream. More...
 
u32 XDcSub_SetInputNonLiveVideoFormat (XDcSub *InstancePtr, XDc_VideoFormat Format1, XDc_VideoFormat Format2)
 This function selects the source type for audio stream. More...
 
u32 XDcSub_SetInputLiveStreamFormat (XDcSub *InstancePtr, XDc_VideoFormat Format1, XDc_VideoFormat Format2)
 This function sets the stream1 format for the live video. More...
 
u32 XDcSub_SetOutputVideoFormat (XDcSub *InstancePtr, XDc_VideoFormat Format)
 This function sets the Output Video Format. More...
 
u32 XDcSub_SetStreamPixelScaling (XDcSub *InstancePtr, u32 *Stream1_ScaleFactors, u32 *Stream2_ScaleFactors)
 This function sets the scaling factors depending on the source video stream. More...
 
u32 XDcSub_SetInputStreamCSC (XDcSub *InstancePtr, u32 *Stream1CSCCoeff, u32 *Stream1CSCOffset, u32 *Stream2CSCCoeff, u32 *Stream2CSCOffset)
 This function sets the Stream Color space conversion matrix. More...
 
u32 XDcSub_SetOutputStreamCSC (XDcSub *InstancePtr, u32 *OutCSCCoeff, u32 *OutCSCOffset)
 This function sets the Output Stream Color space conversion matrix. More...
 
u32 XDcSub_SetInputStreamLayerControl (XDcSub *InstancePtr, u8 BlendBypass1, u8 BlendBypass2)
 This function sets the Stream1 Blend enable, disable option. More...
 
u32 XDcSub_SetChromaKey (XDcSub *InstancePtr, u8 ChromaEnable, u8 ChromaMasterSel, XDc_ChromaKey *Key)
 This function enables Chroma Keying. More...
 
u32 XDcSub_SetCursorBlend (XDcSub *InstancePtr, XDc_CursorBlend Enable, XDc_Cursor *Cursor)
 This function enables Cursor Blending. More...
 
u32 XDcSub_SetAudioVideoClkSrc (XDcSub *InstancePtr)
 This function sets the Audio and Video Clock Source and the video timing source. More...
 
u32 XDcSub_VidClkSelect (XDcSub *InstancePtr, u8 Stream1Sel, u8 Stream2Sel)
 This function configures DC Video Clock Select. More...
 
u32 XDcSub_EnableStream1Buffers (XDcSub *InstancePtr, u8 Enable, u8 Burst)
 This function enables the video channel interface between the DCDMA and the DC. More...
 
u32 XDcSub_EnableStream2Buffers (XDcSub *InstancePtr, u8 Enable, u8 Burst)
 This function enables the video channel interface between the DCDMA and the DC. More...
 
u32 XDcSub_AudLineResetDisable (XDcSub *InstancePtr, u8 Disable)
 This function enables End of Line Reset for reduced blanking resolutions. More...
 
u32 XDcSub_AudExtraBSControl (XDcSub *InstancePtr, u8 Bypass)
 This function enables Extra BS Control for AUDIO_SOFT_RESET. More...
 
u32 XDcSub_SetSdp (XDcSub *InstancePtr, XDc_Sdp Sdp)
 This function enables SDP from DMA or PL. More...
 
u32 XDcSub_SetSdpEmptyThreshold (XDcSub *InstancePtr, u8 Threshold)
 This function sets SDP Empty Threshold value. More...
 
u32 XDcSub_SetSdpCursorBuffers (XDcSub *InstancePtr, u8 Enable, u8 BurstLen)
 This function enables SDP & Cursor buffers. More...
 
u32 XDcSub_SetStreamPartialBlend (XDcSub *InstancePtr, XDc_PartialBlendEn Enable1, XDc_PartialBlend *Coords1, XDc_PartialBlendEn Enable2, XDc_PartialBlend *Coords2)
 This function enables Partial Blend for both video streams. More...
 
u32 XDcSub_SetVidFrameSwitch (XDcSub *InstancePtr, u32 Control)
 This function configures the register to gate input video on/off at video frame boundary. More...
 
u32 XDcSub_SetNonLiveLatency (XDcSub *InstancePtr, u16 Latency)
 This function configures the memory fetch latency. More...
 
u32 XDcSub_EnableStcCtrl (XDcSub *InstancePtr)
 This function enables STC Control. More...
 
u32 XDcSub_ClearStcCtrl (XDcSub *InstancePtr)
 This function clears STC Control. More...
 
u32 XDcSub_SetStcLoad (XDcSub *InstancePtr, u64 InitVal)
 This function loads STC Init value. More...
 
u32 XDcSub_SetStcAdjust (XDcSub *InstancePtr, u32 InitVal)
 This function Adjust STC value. More...
 
u64 XDcSub_GetStcVSyncTs (XDcSub *InstancePtr)
 This function reads VSync STC value and returns it. More...
 
u64 XDcSub_GetStcExtVSyncTs (XDcSub *InstancePtr)
 This function reads External VSync STC value and returns it. More...
 
u64 XDcSub_GetStcCustomEventTs (XDcSub *InstancePtr)
 This function reads Custom VSync Event STC value and returns it. More...
 
u64 XDcSub_GetStcCustomEvent2Ts (XDcSub *InstancePtr)
 This function reads Custom VSync Event STC value and returns it. More...
 
u64 XDcSub_GetStcSnapshot (XDcSub *InstancePtr)
 This function returns StcSnapshot value. More...
 
u32 XDcSub_EnableAudioBuffer (XDcSub *InstancePtr, u8 Enable, u8 BurstLen)
 This function Enable Audio Buffer channel and sets the burst length. More...
 
u32 XDcSub_AudioChannelSelect (XDcSub *InstancePtr, u8 ChannelSel, u8 SampleRate)
 This function enables audio channel select and programs sample rate. More...
 
u32 XDcSub_AudClkSelect (XDcSub *InstancePtr, u32 Select)
 This function configures DC Audio Clock Select. More...
 
u32 XDcSub_SetAudInterfaceMode (XDcSub *InstancePtr, XDc_AudInterface Mode)
 This function sets the Interface mode for DCSub DC Instance. More...
 
u32 XDcSub_EnableAudio (XDcSub *InstancePtr)
 This function enables DC Aud mode. More...
 
u32 XDcSub_DisableAudio (XDcSub *InstancePtr)
 This function disable DC Aud mode. More...
 
u32 XDcSub_ConfigureDcVideo (XDc *InstancePtr)
 This function configures Dc Video registers in the required sequence. More...
 

Function Documentation

u32 XDcSub_AudClkSelect ( XDcSub *  InstancePtr,
u32  Select 
)

This function configures DC Audio Clock Select.

Parameters
InstancePtris a pointer to the XDc instance.
Selectconfigures Audio Clock mode
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_AudExtraBSControl ( XDcSub *  InstancePtr,
u8  Bypass 
)

This function enables Extra BS Control for AUDIO_SOFT_RESET.

Parameters
InstancePtris a pointer to the XDc Instance.
Bypassis to be override the extra BS on link.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_AudioChannelSelect ( XDcSub *  InstancePtr,
u8  ChannelSel,
u8  SampleRate 
)

This function enables audio channel select and programs sample rate.

Parameters
InstancePtris a pointer to the XDc instance.
ChannelSelselects the different audio channels.
SampleRateselects the different sample rates.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_AudLineResetDisable ( XDcSub *  InstancePtr,
u8  Disable 
)

This function enables End of Line Reset for reduced blanking resolutions.

Parameters
InstancePtris a pointer to the XDc Instance.
Disableis to be set while using Reduced Blanking Resolutions.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_CfgInitialize ( XDcSub *  InstancePtr)

This function intializes the configuration of all instances part of DC subsystem i.e DC, DCDMA, Interrupts.

Parameters
InstancePtris a pointer to the XDcSub instance.
DeviceIdis the id of the device from the design.
Returns
XST_SUCCESS or XST_FAILURE.
Note
Base address and DeviceId is same as the DP Core driver.

References XDc_CfgInitialize().

u32 XDcSub_ClearStcCtrl ( XDcSub *  InstancePtr)

This function clears STC Control.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_ConfigureDcVideo ( XDc *  InstancePtr)

This function configures Dc Video registers in the required sequence.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.

References XDc_ConfigureStream(), XDc_EnablePartialBlend(), XDc_EnableStream1Buffers(), XDc_EnableStream2Buffers(), XDc_SetAudioVideoClkSrc(), XDc_SetChromaKey(), XDc_SetCursorBlend(), XDc_SetGlobalAlpha(), XDc_SetInputVideoSelect(), XDc_SetNonLiveLatency(), XDc_SetOutputCSC(), XDc_SetOutputVideoFormat(), and XDc_SetSdpCursorBuffers().

u32 XDcSub_DisableAudio ( XDcSub *  InstancePtr)

This function disable DC Aud mode.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_EnableAudio ( XDcSub *  InstancePtr)

This function enables DC Aud mode.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_EnableAudioBuffer ( XDcSub *  InstancePtr,
u8  Enable,
u8  BurstLen 
)

This function Enable Audio Buffer channel and sets the burst length.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_EnableStcCtrl ( XDcSub *  InstancePtr)

This function enables STC Control.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_EnableStream1Buffers ( XDcSub *  InstancePtr,
u8  Enable,
u8  Burst 
)

This function enables the video channel interface between the DCDMA and the DC.

Parameters
InstancePtris a pointer to the XDc Instance.
Enablesets the corresponding buffers.
Burstprograms burstlength.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_EnableStream2Buffers ( XDcSub *  InstancePtr,
u8  Enable,
u8  Burst 
)

This function enables the video channel interface between the DCDMA and the DC.

Parameters
InstancePtris a pointer to the XDc Instance.
Enablesets the corresponding buffers.
Burstprograms burstlength.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u64 XDcSub_GetStcCustomEvent2Ts ( XDcSub *  InstancePtr)

This function reads Custom VSync Event STC value and returns it.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u64 XDcSub_GetStcCustomEventTs ( XDcSub *  InstancePtr)

This function reads Custom VSync Event STC value and returns it.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u64 XDcSub_GetStcExtVSyncTs ( XDcSub *  InstancePtr)

This function reads External VSync STC value and returns it.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u64 XDcSub_GetStcSnapshot ( XDcSub *  InstancePtr)

This function returns StcSnapshot value.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u64 XDcSub_GetStcVSyncTs ( XDcSub *  InstancePtr)

This function reads VSync STC value and returns it.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_Initialize ( XDcSub *  InstancePtr)

This function initializes all the data structures of the XDcSub Instance.

Parameters
InstancePtris a pointer to the XDcSub instance.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.

References XDc_AudioSoftReset(), XDc_SetVidInterfaceMode(), and XDc_WriteProtDisable().

u32 XDcSub_SetAudInterfaceMode ( XDcSub *  InstancePtr,
XDc_AudInterface  Mode 
)

This function sets the Interface mode for DCSub DC Instance.

DC can be either in bypass mode or functional mode.

Parameters
InstancePtris a pointer to the XDc instance.
Modeis the enum val to enable or diasable bypass mode.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_SetAudioVideoClkSrc ( XDcSub *  InstancePtr)

This function sets the Audio and Video Clock Source and the video timing source.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
Note
System uses PL Clock for Video when Live source is in use.
u32 XDcSub_SetBlenderBgColor ( XDcSub *  InstancePtr,
XDc_BlenderBgClr *  Color 
)

This function sets the blender background color.

Parameters
InstancePtris an pointer to the XDcSub Instance.
Coloris a pointer to the structure XDc_BlenderBgClr
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetChromaKey ( XDcSub *  InstancePtr,
u8  ChromaEnable,
u8  ChromaMasterSel,
XDc_ChromaKey Key 
)

This function enables Chroma Keying.

Parameters
InstancePtris an pointer to the XDc Instance.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetCursorBlend ( XDcSub *  InstancePtr,
XDc_CursorBlend  Enable,
XDc_Cursor Cursor 
)

This function enables Cursor Blending.

Parameters
InstancePtris a pointer to the XDc Instance.
CursorCoordinates.
CursorVideo Attributes.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetGlobalAlpha ( XDcSub *  InstancePtr,
XDc_AlphaBlend  AlphaEnable,
u8  Alpha 
)

This function enables or disables global alpha.

Parameters
InstancePtris an pointer to the XDc Instance.
Returns
XST_SUCCESS or XST_FAILURE.
Note
GlobalAlphaEn = 1, enables the global alpha. GlobalAlphaEn = 0, disables the global alpha. Alpha = 0, transparent Alpha = 255, Opaque Alpha = 8:1 (Alpha value)
u32 XDcSub_SetInputAudioSelect ( XDcSub *  InstancePtr,
XDc_AudioStream  AudStream 
)

This function selects the source type for audio stream.

Parameters
InstancePtris a pointer to the XDcSub instance.
AudStreamselects the audio stream source type
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetInputLiveStreamFormat ( XDcSub *  InstancePtr,
XDc_VideoFormat  Format1,
XDc_VideoFormat  Format2 
)

This function sets the stream1 format for the live video.

Parameters
InstancePtris a pointer to the XDcSub instance.
Format1is the enum for the live video1 format
Format2is the enum for the live video2 format
Returns
XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.
Note
None.

References XDc_GetLiveVideoAttribute().

u32 XDcSub_SetInputNonLiveVideoFormat ( XDcSub *  InstancePtr,
XDc_VideoFormat  Format1,
XDc_VideoFormat  Format2 
)

This function selects the source type for audio stream.

Parameters
InstancePtris a pointer to the XDcSub instance.
Format1selects the nonlive video1 format
Format2selects the nonlive video2 format
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.

References XDc_GetNonLiveVideoAttribute().

u32 XDcSub_SetInputStreamCSC ( XDcSub *  InstancePtr,
u32 *  Stream1CSCCoeff,
u32 *  Stream1CSCOffset,
u32 *  Stream2CSCCoeff,
u32 *  Stream2CSCOffset 
)

This function sets the Stream Color space conversion matrix.

Parameters
InstancePtris a pointer to the XDc instance.
Stream1CSCCoeffis a pointer to the CSCCoeff values
Stream1CSCOffsetis a pointer to the CSCCOffset values
Stream2CSCCoeffis a pointer to the CSCCoeff values
Stream2CSCOffsetis a pointer to the CSCCOffset values
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetInputStreamLayerControl ( XDcSub *  InstancePtr,
u8  BlendBypass1,
u8  BlendBypass2 
)

This function sets the Stream1 Blend enable, disable option.

Parameters
InstancePtris a pointer to the XDc instance.
BlendBypass1is enables, disables blending for stream
BlendBypass2is enables, disables blending for stream
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetNonLiveLatency ( XDcSub *  InstancePtr,
u16  Latency 
)

This function configures the memory fetch latency.

Parameters
InstancePtris a pointer to the XDc instance.
Valbits sets the offset for early timing
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_SetOutputStreamCSC ( XDcSub *  InstancePtr,
u32 *  OutCSCCoeff,
u32 *  OutCSCOffset 
)

This function sets the Output Stream Color space conversion matrix.

Parameters
InstancePtris a pointer to the XDc instance.
OutCSCCoeffis a pointer to the CSCCoeff values
OutCSCOffsetis a pointer to the CSCOffset values
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetOutputVideoFormat ( XDcSub *  InstancePtr,
XDc_VideoFormat  Format 
)

This function sets the Output Video Format.

Parameters
InstancePtris a pointer to the XDc instance.
Formatis the enum for the non-live video format
Returns
XST_SUCCESS if the correct format has been set. XST_FAILURE if the format is invalid.
Note
None.

References XDc_GetOutputVideoAttribute().

u32 XDcSub_SetSdp ( XDcSub *  InstancePtr,
XDc_Sdp  Sdp 
)

This function enables SDP from DMA or PL.

Parameters
InstancePtris a pointer to the XDc Instance.
Enablesets the corresponding buffers.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetSdpCursorBuffers ( XDcSub *  InstancePtr,
u8  Enable,
u8  BurstLen 
)

This function enables SDP & Cursor buffers.

Parameters
InstancePtris a pointer to the XDc Instance.
Enable.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetSdpEmptyThreshold ( XDcSub *  InstancePtr,
u8  Threshold 
)

This function sets SDP Empty Threshold value.

Parameters
InstancePtris a pointer to the XDc Instance.
EmptyThreshold value.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetStcAdjust ( XDcSub *  InstancePtr,
u32  InitVal 
)

This function Adjust STC value.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_SetStcLoad ( XDcSub *  InstancePtr,
u64  InitVal 
)

This function loads STC Init value.

Parameters
InstancePtris a pointer to the XDc instance.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_SetStreamPartialBlend ( XDcSub *  InstancePtr,
XDc_PartialBlendEn  Enable1,
XDc_PartialBlend Coords1,
XDc_PartialBlendEn  Enable2,
XDc_PartialBlend Coords2 
)

This function enables Partial Blend for both video streams.

Parameters
InstancePtris a pointer to the XDc Instance.
Stream1_Enable.
Stream2_Enable.
Stream1Partial Blend Coordinates.
Stream2Partial Blend Coordinates.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetStreamPixelScaling ( XDcSub *  InstancePtr,
u32 *  Stream1_ScaleFactors,
u32 *  Stream2_ScaleFactors 
)

This function sets the scaling factors depending on the source video stream.

Parameters
InstancePtris a pointer to the XDc instance.
ScalingFactors is a pointer to the scaling factors needed for scaling colors to 12 BPC.
ScalingFactors is a pointer to the scaling factors needed for scaling colors to 12 BPC.
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_SetVidFrameSwitch ( XDcSub *  InstancePtr,
u32  Control 
)

This function configures the register to gate input video on/off at video frame boundary.

Parameters
InstancePtris a pointer to the XDc instance.
Valbits set different control signals
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_SetVidInterfaceMode ( XDcSub *  InstancePtr,
XDc_VidInterface  Mode 
)

This function sets the Interface mode for DCSub DC Instance.

DC can be either in bypass mode or functional mode.

Parameters
InstancePtris a pointer to the XDc instance.
Modeis the enum val to enable or diasable bypass mode.
Returns
XST_SUCCESS or XST_FAILURE.
u32 XDcSub_SetVidStreamSrc ( XDcSub *  InstancePtr,
XDc_VideoStream1  VidStream1,
XDc_VideoStream2  VidStream2 
)

This function selects the source type for the Video and Graphics input streams that are passed on to the blender block.

Parameters
InstancePtris a pointer to the XDc instance.
VidStream1selects the stream coming from the video source1
VidStream2selects the stream coming from the video source2
Returns
XST_SUCCESS or XST_FAILURE.
Note
None.
u32 XDcSub_VidClkSelect ( XDcSub *  InstancePtr,
u8  Stream1Sel,
u8  Stream2Sel 
)

This function configures DC Video Clock Select.

Parameters
InstancePtris a pointer to the XDc instance.
Selectconfigures Video Clock mode
Returns
XST_SUCCESS or XST_FAILURE.