dpdma
Vitis Drivers API Documentation
xdpdma.c File Reference

Overview

This file contains the implementation of the interface functions of the XDpDma driver.

Refer to xdpdma.h for detailed information.

Note
None.
MODIFICATION HISTORY:
Ver     Who   Date     Changes


1.0 aad 04/12/16 Initial release. 1.1 aad 04/26/18 Fixed Warnings

Functions

void XDpDma_CfgInitialize (XDpDma *InstancePtr, XDpDma_Config *CfgPtr)
 This functions retrieves the configuration for this DPDMA driver and fills in the InstancePtr->Config structure. More...
 
int XDpDma_SetChannelState (XDpDma *InstancePtr, XDpDma_ChannelType Channel, XDpDma_ChannelState ChannelState)
 This functions controls the states in which a channel should go into. More...
 
int XDpDma_SetVideoFormat (XDpDma *InstancePtr, XAVBuf_VideoFormat Format)
 This function allocates DPDMA Video Channels depending on the number of planes in the video. More...
 
int XDpDma_SetGraphicsFormat (XDpDma *InstancePtr, XAVBuf_VideoFormat Format)
 This function allocates DPDMA Graphics Channels. More...
 
void XDpDma_SetQOS (XDpDma *InstancePtr, u8 QOS)
 This function starts the operation on the a given channel. More...
 
int XDpDma_Trigger (XDpDma *InstancePtr, XDpDma_ChannelType Channel)
 This function Triggers DPDMA to start the transaction. More...
 
int XDpDma_ReTrigger (XDpDma *InstancePtr, XDpDma_ChannelType Channel)
 This function Retriggers DPDMA to fetch data from new descriptor. More...
 
void XDpDma_InitVideoDescriptor (XDpDma_Descriptor *CurrDesc, XDpDma_FrameBuffer *FrameBuffer)
 This function intializes Video Descriptor for Video and Graphics channel. More...
 
void XDpDma_InitAudioDescriptor (XDpDma_AudioChannel *Channel, XDpDma_AudioBuffer *AudioBuffer)
 This function intializes Descriptors for transactions on Audio Channel. More...
 
void XDpDma_DisplayVideoFrameBuffer (XDpDma *InstancePtr, XDpDma_FrameBuffer *Plane0, XDpDma_FrameBuffer *Plane1, XDpDma_FrameBuffer *Plane2)
 This function sets the next Frame Buffers to be displayed on the Video Channel. More...
 
void XDpDma_DisplayGfxFrameBuffer (XDpDma *InstancePtr, XDpDma_FrameBuffer *Plane)
 This function sets the next Frame Buffers to be displayed on the Graphics Channel. More...
 
int XDpDma_PlayAudio (XDpDma *InstancePtr, XDpDma_AudioBuffer *Buffer, u8 ChannelNum)
 This function sets the next Audio Buffer to be played on Audio Channel 0. More...
 
void XDpDma_SetupChannel (XDpDma *InstancePtr, XDpDma_ChannelType Channel)
 This function sets the channel with the latest framebuffer and the available descriptor for transfer on the next Vsync. More...
 

Function Documentation

void XDpDma_CfgInitialize ( XDpDma *  InstancePtr,
XDpDma_Config *  CfgPtr 
)

This functions retrieves the configuration for this DPDMA driver and fills in the InstancePtr->Config structure.

Parameters
InstancePtris a pointer to the driver instance.
CfgPtris a pointer to the configuration structure that will be used to copy the settings from.
Returns
None.
Note
None.

Referenced by InitDpDmaSubsystem().

void XDpDma_DisplayGfxFrameBuffer ( XDpDma *  InstancePtr,
XDpDma_FrameBuffer *  Plane 
)

This function sets the next Frame Buffers to be displayed on the Graphics Channel.

Parameters
InstancePtris pointer to the instance of DPDMA.
Planeis a pointer to the Frame Buffer structure.
Returns
None.
Note
None.

Referenced by DpPsu_Run().

void XDpDma_DisplayVideoFrameBuffer ( XDpDma *  InstancePtr,
XDpDma_FrameBuffer *  Plane0,
XDpDma_FrameBuffer *  Plane1,
XDpDma_FrameBuffer *  Plane2 
)

This function sets the next Frame Buffers to be displayed on the Video Channel.

Parameters
InstancePtris pointer to the instance of DPDMA.
Plane0is a pointer to the Frame Buffer structure.
Plane1is a pointer to the Frame Buffer structure.
Plane2is a pointer to the Frame Buffer structure.
Returns
None.
Note
For interleaved mode use Plane0. For semi-planar mode use Plane0 and Plane1. For planar mode use Plane0, Plane1 and Plane2
void XDpDma_InitAudioDescriptor ( XDpDma_AudioChannel *  Channel,
XDpDma_AudioBuffer *  AudioBuffer 
)

This function intializes Descriptors for transactions on Audio Channel.

Parameters
Channelis a pointer to the XDpDma_AudioChannel instance
AudioBufferis a pointer to the Audio Buffer structure
Returns
None.
Note
None.

Referenced by XDpDma_PlayAudio(), and XDpDma_SetupChannel().

void XDpDma_InitVideoDescriptor ( XDpDma_Descriptor *  CurrDesc,
XDpDma_FrameBuffer *  FrameBuffer 
)

This function intializes Video Descriptor for Video and Graphics channel.

Parameters
CurrDescis a pointer to the current Descriptor of Video or Graphics Channel.
FrameBufferis a pointer to the Frame Buffer structure
Returns
None.
Note
None.

Referenced by XDpDma_SetupChannel().

int XDpDma_PlayAudio ( XDpDma *  InstancePtr,
XDpDma_AudioBuffer *  Buffer,
u8  ChannelNum 
)

This function sets the next Audio Buffer to be played on Audio Channel 0.

Parameters
InstancePtris pointer to the instance of DPDMA.
Bufferis a pointer to the attributes of the Audio information to be played.
ChannelNumselects between Audio Channel 0 and Audio Channel 1
Returns
XST_SUCCESS when the play audio request is successful. XST_FAILURE when the play audio request fails, user has to retry to play the audio.
Note
The user has to schedule new audio buffer before half the audio information is consumed by DPDMA to have a seamless playback.

References XDpDma_InitAudioDescriptor().

int XDpDma_ReTrigger ( XDpDma *  InstancePtr,
XDpDma_ChannelType  Channel 
)

This function Retriggers DPDMA to fetch data from new descriptor.

Parameters
InstancePtris a pointer to the XDpDma instance.
Channelis the XDpDma_ChannelType on which the transaction is to be retriggered.
Returns
XST_SUCCESS The channel has successfully been Triggered. XST_FAILURE When the triggering Video and Graphics channel without setting the Video Formats.
Note
None.

References XDPDMA_GBL, and XDpDma_WriteReg.

Referenced by XDpDma_VSyncHandler().

int XDpDma_SetChannelState ( XDpDma *  InstancePtr,
XDpDma_ChannelType  Channel,
XDpDma_ChannelState  ChannelState 
)

This functions controls the states in which a channel should go into.

Parameters
InstancePtris a pointer to the driver instance.
Channelis an enum of XDpDma_ChannelType.
ChannelStateis an enum of type XDpDma_ChannelState.
Returns
XST_SUCCESS when the mentioned channel is enabled successfully. XST_FAILURE when the mentioned channel fails to be enabled.
Note
None.

Referenced by DpPsu_Run(), XDpDma_InterruptHandler(), and XDpDma_VSyncHandler().

int XDpDma_SetGraphicsFormat ( XDpDma *  InstancePtr,
XAVBuf_VideoFormat  Format 
)

This function allocates DPDMA Graphics Channels.

Parameters
InstancePtris a pointer to the driver instance.
Formatis the video format to be used for the DPDMA transfer
Returns
XST_SUCCESS, When the format is a valid Graphics Format. XST_FAILURE, When the format is not valid Graphics Format.
Note
None.

Referenced by InitDpDmaSubsystem().

void XDpDma_SetQOS ( XDpDma *  InstancePtr,
u8  QOS 
)

This function starts the operation on the a given channel.

Parameters
InstancePtris a pointer to the driver instance.
QOSis the Quality of Service value to be selected.
Returns
None.
Note
.

References XDPDMA_CH0_CNTL, and XDpDma_ReadModifyWrite.

Referenced by InitDpDmaSubsystem().

void XDpDma_SetupChannel ( XDpDma *  InstancePtr,
XDpDma_ChannelType  Channel 
)

This function sets the channel with the latest framebuffer and the available descriptor for transfer on the next Vsync.

Parameters
InstancePtris pointer to the instance of DPDMA.
Channelindicates which channels are being setup for transfer.
Returns
None.
Note
None.

References XDpDma_InitAudioDescriptor(), and XDpDma_InitVideoDescriptor().

Referenced by XDpDma_VSyncHandler().

int XDpDma_SetVideoFormat ( XDpDma *  InstancePtr,
XAVBuf_VideoFormat  Format 
)

This function allocates DPDMA Video Channels depending on the number of planes in the video.

Parameters
InstancePtris a pointer to the driver instance.
Formatis the video format to be used for the DPDMA transfer
Returns
XST_SUCCESS, When the format is valid Video Format. XST_FAILURE, When the format is not valid Video Format
Note
None.
int XDpDma_Trigger ( XDpDma *  InstancePtr,
XDpDma_ChannelType  Channel 
)

This function Triggers DPDMA to start the transaction.

Parameters
InstancePtris a pointer to the XDpDma instance.
Channelis the XDpDma_ChannelType on which the transaction is to be triggered.
Returns
XST_SUCCESS The channel has successfully been Triggered. XST_FAILURE When the triggering Video and Graphics channel without setting the Video Formats.
Note
None.

References XDPDMA_GBL, and XDpDma_WriteReg.

Referenced by XDpDma_VSyncHandler().