v_mix
Vitis Drivers API Documentation
Overview

Data Structures

struct  XVMix_LogoColorKey
 This typedef contains configuration information for Logo Color Key. More...
 
struct  XVMix_Layer
 This typedef contains configuration information for a given layer. More...
 
struct  XV_Mix_l2
 Mixer driver Layer 2 data. More...
 

Macros

#define XVMix_GetNumLayers(InstancePtr)   ((InstancePtr)->Mix.Config.NumLayers)
 This macro returns the available layers in IP. More...
 
#define XVMix_GetBackgndColor(InstancePtr)   ((InstancePtr)->BkgndColor)
 This macro returns the current set background color id. More...
 
#define XVMix_GetLayerInterfaceType(InstancePtr, LayerId)   ((InstancePtr)->Mix.Config.LayerIntrfType[LayerId-1])
 This macro returns the interface type for the specified layer. More...
 
#define XVMix_IsLogoEnabled(InstancePtr)   ((InstancePtr)->Mix.Config.LogoEn)
 This macro returns if Logo layer is enabled. More...
 
#define XVMix_IsLogoColorKeyEnabled(InstancePtr)   ((InstancePtr)->Mix.Config.LogoColorKeyEn)
 This macro returns if Logo layer color key feature is enabled. More...
 
#define XVMix_IsLogoPixAlphaEnabled(InstancePtr)   ((InstancePtr)->Mix.Config.LogoPixAlphaEn)
 This macro returns if Logo layer alpha feature is enabled. More...
 
#define XVMix_IsCscCoeffsRegsEnabled(InstancePtr)   ((InstancePtr)->Mix.Config.CscCoeffsRegsEn)
 This macro returns if CSC Coefficient Registers is enabled. More...
 
#define XVMix_IsAlphaEnabled(InstancePtr, LayerId)   ((InstancePtr)->Mix.Config.AlphaEn[LayerId-1])
 This macro returns if alpha feature of specified layer is available. More...
 
#define XVMix_IsTileFormatEnabled(InstancePtr)   ((InstancePtr)->Mix.Config.IsTileFormat)
 Checks if the tile format is enabled for the given XVMix instance. More...
 
#define XVMix_IsScalingEnabled(InstancePtr, LayerId)   ((InstancePtr)->Mix.Config.ScalingEn[LayerId-1])
 This macro returns if scaling feature of specified layer is available. More...
 
#define XVMix_IsLayerInterfaceStream(InstancePtr, LayerId)   ((InstancePtr)->Mix.Config.LayerIntrfType[LayerId-1] == XVMIX_LAYER_TYPE_STREAM)
 This macro check if specified layer interface type is STREAM. More...
 

Typedefs

typedef void(* XVMix_Callback )(void *CallbackRef)
 Callback type for interrupt. More...
 

Enumerations

enum  XVMix_BackgroundId
 This typedef enumerates supported background colors. More...
 
enum  XVMix_Scalefactor
 This typedef enumerates scale factors supported by mixer core. More...
 
enum  XVMix_LayerId
 This typedef enumerates layer index. More...
 
enum  XVMix_LayerType
 This typedef enumerates layer interface type. More...
 

Functions

int XVMix_Initialize (XV_Mix_l2 *InstancePtr, u16 DeviceId)
 XVMix_Initialize - Initialize the XV_Mix_l2 instance. More...
 
void XVMix_InterruptEnable (XV_Mix_l2 *InstancePtr)
 Enables interrupts for the XV_Mix_l2 instance. More...
 
void XVMix_InterruptDisable (XV_Mix_l2 *InstancePtr)
 XVMix_InterruptDisable - Disables interrupts for the XV_Mix_l2 instance. More...
 
void XVMix_Start (XV_Mix_l2 *InstancePtr)
 Starts the video mixer hardware. More...
 
void XVMix_Stop (XV_Mix_l2 *InstancePtr)
 Stops the XV_Mix_l2 core operation. More...
 
void XVMix_SetVidStream (XV_Mix_l2 *InstancePtr, const XVidC_VideoStream *StrmIn)
 Sets the video stream configuration for the mixer instance. More...
 
int XVMix_LayerEnable (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function enables the specified layer of the core instance. More...
 
int XVMix_LayerDisable (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function disables the specified layer of the core instance. More...
 
int XVMix_IsLayerEnabled (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function returns state of the specified layer [enabled or disabled]. More...
 
void XVMix_SetBackgndColor (XV_Mix_l2 *InstancePtr, XVMix_BackgroundId ColorId, XVidC_ColorDepth bpc)
 This function sets the background color to be displayed when stream layer is disabled. More...
 
int XVMix_SetLayerWindow (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, XVidC_VideoWindow *Win, u32 StrideInBytes)
 This function configures the window coordinates of the specified layer. More...
 
int XVMix_GetLayerWindow (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, XVidC_VideoWindow *Win)
 This function read the window coordinates of the specified layer. More...
 
int XVMix_MoveLayerWindow (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, u16 StartX, u16 StartY)
 This function moved the window position of the specified layer to new coordinates. More...
 
int XVMix_SetLayerScaleFactor (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, XVMix_Scalefactor Scale)
 This function configures the scaling factor of the specified layer. More...
 
int XVMix_GetLayerScaleFactor (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function returns the scaling factor of the specified layer. More...
 
int XVMix_SetLayerAlpha (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, u16 Alpha)
 This function configures the Alpha level of the specified layer. More...
 
int XVMix_GetLayerAlpha (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function returns the alpha of the specified layer. More...
 
int XVMix_GetLayerColorFormat (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, XVidC_ColorFormat *Cfmt)
 This function reads the color format of the specified layer. More...
 
int XVMix_SetLayerBufferAddr (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, UINTPTR Addr)
 This function sets the buffer address of the specified layer. More...
 
UINTPTR XVMix_GetLayerBufferAddr (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function reads the buffer address of the specified layer. More...
 
int XVMix_SetLayerChromaBufferAddr (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, UINTPTR Addr)
 This function sets the buffer address of the specified layer for the UV plane for semi-planar formats for the U plane for 3-planar formats. More...
 
UINTPTR XVMix_GetLayerChromaBufferAddr (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 This function reads the buffer address of the specified layer for the UV plane for semi-planar formats and for the U plane for 3-planar formats. More...
 
int XVMix_SetLayerChromaBuffer2Addr (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId, UINTPTR Addr)
 Set the chroma buffer address for the specified layer. More...
 
UINTPTR XVMix_GetLayerChromaBuffer2Addr (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 Retrieves the address of the second chroma buffer for a specified layer in the video mixer instance. More...
 
int XVMix_SetLogoColorKey (XV_Mix_l2 *InstancePtr, XVMix_LogoColorKey ColorKeyData)
 Set the logo color key values for the XV_Mix_l2 instance. More...
 
int XVMix_GetLogoColorKey (XV_Mix_l2 *InstancePtr, XVMix_LogoColorKey *ColorKeyData)
 Retrieves the current logo color key range from the hardware. More...
 
int XVMix_LoadLogo (XV_Mix_l2 *InstancePtr, XVidC_VideoWindow *Win, u8 *RBuffer, u8 *GBuffer, u8 *BBuffer)
 Loads a logo image into the mixer hardware. More...
 
int XVMix_LoadLogoPixelAlpha (XV_Mix_l2 *InstancePtr, XVidC_VideoWindow *Win, u8 *ABuffer)
 XVMix_LoadLogoPixelAlpha - Loads per-pixel alpha values for a logo window into the hardware. More...
 
void XVMix_DbgReportStatus (XV_Mix_l2 *InstancePtr)
 XVMix_DbgReportStatus - Prints the current status and configuration of the mixer instance. More...
 
void XVMix_DbgLayerInfo (XV_Mix_l2 *InstancePtr, XVMix_LayerId LayerId)
 Prints debug information for a specific layer in the video mixer. More...
 
u32 XVMix_SetCscCoeffs (XV_Mix_l2 *InstancePtr, XVidC_ColorStd colorStandard, XVidC_ColorRange colorRange, u8 colorDepth)
 Sets the Color Space Conversion (CSC) coefficients for the XV_Mix_l2 instance. More...
 
void XV_mix_SetFlushbit (XV_mix *InstancePtr)
 Sets the flush bit in the control register of the XV_mix hardware instance. More...
 
u32 XV_mix_Get_FlushDone (XV_mix *InstancePtr)
 Retrieves the flush done status from the XV_mix hardware instance. More...
 
void XVMix_InterruptHandler (void *InstancePtr)
 This function is the interrupt handler for the mixer core driver. More...
 
int XVMix_SetCallback (XV_Mix_l2 *InstancePtr, void *CallbackFunc, void *CallbackRef)
 This function installs an asynchronous callback function for Mixer interrupt. More...
 

Macro Definition Documentation

#define XVMix_GetBackgndColor (   InstancePtr)    ((InstancePtr)->BkgndColor)

This macro returns the current set background color id.

Parameters
InstancePtris a pointer to the core instance.
Returns
Background color id
Note
None.
#define XVMix_GetLayerInterfaceType (   InstancePtr,
  LayerId 
)    ((InstancePtr)->Mix.Config.LayerIntrfType[LayerId-1])

This macro returns the interface type for the specified layer.

Parameters
InstancePtris a pointer to the core instance.
LayerIdis the layer index for which information is requested
Returns
Layer Interface Type
Note
None.

Referenced by XVMix_DbgLayerInfo().

#define XVMix_GetNumLayers (   InstancePtr)    ((InstancePtr)->Mix.Config.NumLayers)
#define XVMix_IsAlphaEnabled (   InstancePtr,
  LayerId 
)    ((InstancePtr)->Mix.Config.AlphaEn[LayerId-1])

This macro returns if alpha feature of specified layer is available.

Parameters
InstancePtris a pointer to the core instance.
LayerIdis the layer index for which information is requested
Returns
Enabled(1)/Disabled(0)
Note
None.

Referenced by XVMix_DbgLayerInfo(), XVMix_GetLayerAlpha(), and XVMix_SetLayerAlpha().

#define XVMix_IsCscCoeffsRegsEnabled (   InstancePtr)    ((InstancePtr)->Mix.Config.CscCoeffsRegsEn)

This macro returns if CSC Coefficient Registers is enabled.

Parameters
InstancePtris a pointer to the core instance.
Returns
Enabled(1)/Disabled(0)
Note
None.

Referenced by XVMix_SetCscCoeffs().

#define XVMix_IsLayerInterfaceStream (   InstancePtr,
  LayerId 
)    ((InstancePtr)->Mix.Config.LayerIntrfType[LayerId-1] == XVMIX_LAYER_TYPE_STREAM)

This macro check if specified layer interface type is STREAM.

Parameters
InstancePtris a pointer to the core instance.
LayerIdis the layer index for which information is requested
Returns
TRUE(1)/FALSE(0)

Referenced by main(), and XVMix_SetLayerWindow().

#define XVMix_IsLogoColorKeyEnabled (   InstancePtr)    ((InstancePtr)->Mix.Config.LogoColorKeyEn)

This macro returns if Logo layer color key feature is enabled.

Parameters
InstancePtris a pointer to the core instance.
Returns
Enabled(1)/Disabled(0)
Note
None.

Referenced by XVMix_DbgLayerInfo(), XVMix_GetLogoColorKey(), and XVMix_SetLogoColorKey().

#define XVMix_IsLogoEnabled (   InstancePtr)    ((InstancePtr)->Mix.Config.LogoEn)
#define XVMix_IsLogoPixAlphaEnabled (   InstancePtr)    ((InstancePtr)->Mix.Config.LogoPixAlphaEn)

This macro returns if Logo layer alpha feature is enabled.

Parameters
InstancePtris a pointer to the core instance.
Returns
Enabled(1)/Disabled(0)
Note
None.

Referenced by XVMix_DbgLayerInfo(), and XVMix_LoadLogoPixelAlpha().

#define XVMix_IsScalingEnabled (   InstancePtr,
  LayerId 
)    ((InstancePtr)->Mix.Config.ScalingEn[LayerId-1])

This macro returns if scaling feature of specified layer is available.

Parameters
InstancePtris a pointer to the core instance.
LayerIdis the layer index for which information is requested
Returns
Enabled(1)/Disabled(0)
Note
None.

Referenced by XVMix_DbgLayerInfo(), XVMix_GetLayerScaleFactor(), and XVMix_SetLayerScaleFactor().

#define XVMix_IsTileFormatEnabled (   InstancePtr)    ((InstancePtr)->Mix.Config.IsTileFormat)

Checks if the tile format is enabled for the given XVMix instance.

This macro evaluates to the value of the IsTileFormat field in the Mix configuration structure of the specified instance. It is used to determine whether the tile format feature is enabled for the XVMix hardware.

Parameters
InstancePtrA pointer to the XVMix instance to be checked.
Returns
Non-zero if tile format is enabled, zero otherwise.

Referenced by XVMix_DbgReportStatus().

Typedef Documentation

typedef void(* XVMix_Callback)(void *CallbackRef)

Callback type for interrupt.

Parameters
CallbackRefis a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked.
Returns
None.
Note
None.

Enumeration Type Documentation

This typedef enumerates supported background colors.

This typedef enumerates layer index.

This typedef enumerates layer interface type.

This typedef enumerates scale factors supported by mixer core.

Function Documentation

u32 XV_mix_Get_FlushDone ( XV_mix InstancePtr)

Retrieves the flush done status from the XV_mix hardware instance.

This function reads the FLUSH status bit from the AP_CTRL register of the XV_mix hardware core to determine if the flush operation has completed.

Parameters
InstancePtris a pointer to the XV_mix instance.
Returns
The value of the FLUSH status bit (non-zero if flush is done, zero otherwise).
Note
The function asserts that InstancePtr is not NULL and that the instance is ready before accessing the hardware register.

References XV_mix_Config::BaseAddress, XV_mix::Config, and XV_mix::IsReady.

Referenced by XVMix_Stop().

void XV_mix_SetFlushbit ( XV_mix InstancePtr)

Sets the flush bit in the control register of the XV_mix hardware instance.

This function reads the current value of the control register, sets the flush bit, and writes the updated value back to the register. The flush bit is typically used to trigger a hardware flush operation, ensuring that any pending data is processed.

Parameters
InstancePtrPointer to the XV_mix instance.
Note
The function asserts that the InstancePtr is not NULL and that the hardware instance is ready before performing the operation.
Returns
None.

References XV_mix_Config::BaseAddress, XV_mix::Config, and XV_mix::IsReady.

Referenced by XVMix_Stop().

void XVMix_DbgLayerInfo ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

Prints debug information for a specific layer in the video mixer.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
LayerIdIdentifier of the layer to report (master, logo, or regular layer).

This function prints detailed status and configuration information for the specified layer in the video mixer. The information includes:

  • Whether the layer is enabled or disabled.
  • For the master layer: color format, resolution, and stream info.
  • For the logo layer: alpha, scale factor, window position/size, color key data, and pixel alpha status.
  • For regular layers: interface type (memory/stream), buffer addresses, alpha and scaling status/values, color format, window position/size, and stride.

The function uses xil_printf for output and is intended for debugging purposes. Assertions are used to validate input parameters.

Returns
none
Note
none

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, XV_Mix_l2::Stream, XV_mix_Get_HwReg_height(), XV_mix_Get_HwReg_width(), XVMix_GetLayerAlpha(), XVMix_GetLayerBufferAddr(), XVMix_GetLayerChromaBufferAddr(), XVMix_GetLayerColorFormat(), XVMix_GetLayerInterfaceType, XVMix_GetLayerScaleFactor(), XVMix_GetLayerWindow(), XVMix_GetLogoColorKey(), XVMix_IsAlphaEnabled, XVMix_IsLayerEnabled(), XVMix_IsLogoColorKeyEnabled, XVMix_IsLogoPixAlphaEnabled, and XVMix_IsScalingEnabled.

void XVMix_DbgReportStatus ( XV_Mix_l2 InstancePtr)

XVMix_DbgReportStatus - Prints the current status and configuration of the mixer instance.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance to report status for.

This function outputs detailed information about the mixer hardware and its configuration to the standard output using xil_printf. The reported information includes:

  • Pixels per clock
  • Color depth
  • Number of layers
  • Control register value
  • Layer enable register value
  • Enable/disable status of each layer (Master, Layer 1-N, Logo)
  • Background color values (Y/R, U/G, V/B)

The function asserts that the provided instance pointer is not NULL. It is intended for debugging and diagnostic purposes.

Returns
None.

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_mix_Config::MaxDataWidth, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, XV_mix_Get_HwReg_background_U_G(), XV_mix_Get_HwReg_background_V_B(), XV_mix_Get_HwReg_background_Y_R(), XV_mix_Get_HwReg_layerEnable(), XVMix_GetNumLayers, XVMix_IsLayerEnabled(), and XVMix_IsTileFormatEnabled.

int XVMix_GetLayerAlpha ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function returns the alpha of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer for which information is requested
Returns
If layer enabled, current set value, else ~0
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, XV_mix_Get_HwReg_logoAlpha(), XVMix_GetNumLayers, XVMix_IsAlphaEnabled, and XVMix_IsLogoEnabled.

Referenced by XVMix_DbgLayerInfo().

UINTPTR XVMix_GetLayerBufferAddr ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function reads the buffer address of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Returns
Address of buffer in memory
Note
Applicable only for Layer1-16

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, and XVMix_GetNumLayers.

Referenced by XVMix_DbgLayerInfo().

UINTPTR XVMix_GetLayerChromaBuffer2Addr ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

Retrieves the address of the second chroma buffer for a specified layer in the video mixer instance.

Parameters
InstancePtr,:Pointer to the XV_Mix_l2 instance.
LayerId,:Identifier of the layer for which the chroma buffer address is requested. Must be greater than XVMIX_LAYER_MASTER and less than XVMIX_LAYER_LOGO.
Returns
The address (UINTPTR) of the second chroma buffer for the specified layer. Returns 0 if the LayerId is invalid or out of range.
Note
The function asserts that InstancePtr is not NULL and that LayerId is within the valid range. The function only returns a valid address if LayerId is less than the number of layers configured in the instance.

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, and XVMix_GetNumLayers.

UINTPTR XVMix_GetLayerChromaBufferAddr ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function reads the buffer address of the specified layer for the UV plane for semi-planar formats and for the U plane for 3-planar formats.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Returns
Address of second buffer in memory
Note
Applicable only for Layer1-8

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, and XVMix_GetNumLayers.

Referenced by XVMix_DbgLayerInfo().

int XVMix_GetLayerColorFormat ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
XVidC_ColorFormat *  Cfmt 
)

This function reads the color format of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Cfmtis pointer to color format return variable
Returns
XST_SUCCESS or XST_FAILURE
Note
none

References XV_mix_Config::BaseAddress, XV_mix_Config::ColorFormat, XV_mix::Config, XV_Mix_l2::Mix, XV_mix_Get_HwReg_video_format(), and XVMix_GetNumLayers.

Referenced by main(), and XVMix_DbgLayerInfo().

int XVMix_GetLayerScaleFactor ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function returns the scaling factor of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer for which information is requested
Returns
If layer enabled, current set value, else ~0
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, XV_mix_Get_HwReg_logoScaleFactor(), XVMix_GetNumLayers, XVMix_IsLogoEnabled, and XVMix_IsScalingEnabled.

Referenced by XVMix_DbgLayerInfo(), XVMix_MoveLayerWindow(), and XVMix_SetLayerWindow().

int XVMix_GetLayerWindow ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
XVidC_VideoWindow *  Win 
)

This function read the window coordinates of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer for which window coordinates are to be set
Winis the pointer to return window coordinates
Returns
XST_SUCCESS if command is successful else error code with reason
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, XV_mix_Get_HwReg_logoHeight(), XV_mix_Get_HwReg_logoStartX(), XV_mix_Get_HwReg_logoStartY(), XV_mix_Get_HwReg_logoWidth(), XVMix_GetNumLayers, and XVMix_IsLogoEnabled.

Referenced by XVMix_DbgLayerInfo(), XVMix_MoveLayerWindow(), and XVMix_SetLayerScaleFactor().

int XVMix_GetLogoColorKey ( XV_Mix_l2 InstancePtr,
XVMix_LogoColorKey ColorKeyData 
)

Retrieves the current logo color key range from the hardware.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
ColorKeyDataPointer to an XVMix_LogoColorKey structure where the color key minimum and maximum RGB values will be stored.

This function checks if the logo and logo color key features are enabled. If both are enabled, it reads the minimum and maximum RGB values for the logo color key from the hardware registers and stores them in the provided ColorKeyData structure.

Returns
XST_SUCCESS if the color key values were successfully retrieved, XST_FAILURE otherwise.

References XV_Mix_l2::Mix, XV_mix_Get_HwReg_logoClrKeyMax_B(), XV_mix_Get_HwReg_logoClrKeyMax_G(), XV_mix_Get_HwReg_logoClrKeyMax_R(), XV_mix_Get_HwReg_logoClrKeyMin_B(), XV_mix_Get_HwReg_logoClrKeyMin_G(), XV_mix_Get_HwReg_logoClrKeyMin_R(), XVMix_IsLogoColorKeyEnabled, and XVMix_IsLogoEnabled.

Referenced by XVMix_DbgLayerInfo().

int XVMix_Initialize ( XV_Mix_l2 InstancePtr,
u16  DeviceId 
)

XVMix_Initialize - Initialize the XV_Mix_l2 instance.

This function initializes the XV_Mix_l2 instance specified by InstancePtr using the hardware configuration identified by DeviceId. It first asserts that the provided pointer is not NULL, clears the instance memory, and then calls the lower-level XV_mix_Initialize function. If initialization is successful, it sets the instance to its power-on default state.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance to be initialized.
DeviceIdDevice ID of the hardware configuration to use.
Returns
  • XST_SUCCESS if initialization was successful.
  • Error code defined by XV_mix_Initialize otherwise.

References XV_Mix_l2::Mix, and XV_mix_Initialize().

void XVMix_InterruptDisable ( XV_Mix_l2 InstancePtr)

XVMix_InterruptDisable - Disables interrupts for the XV_Mix_l2 instance.

This function disables the DONE interrupt and the global interrupt for the specified XV_Mix_l2 instance. After disabling interrupts, it enables the auto-restart feature to allow the hardware to automatically restart processing without requiring software intervention.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
Returns
none
Note
The InstancePtr must not be NULL.

References XV_Mix_l2::Mix, XV_mix_EnableAutoRestart(), XV_mix_InterruptDisable(), and XV_mix_InterruptGlobalDisable().

void XVMix_InterruptEnable ( XV_Mix_l2 InstancePtr)

Enables interrupts for the XV_Mix_l2 instance.

This function performs the following actions:

  1. Asserts that the provided instance pointer is not NULL.
  2. Enables the DONE interrupt for the underlying XV_mix hardware.
  3. Globally enables interrupts for the XV_mix hardware.
  4. Disables the auto-restart feature of the XV_mix hardware.
Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
Returns
none

References XV_Mix_l2::Mix, XV_mix_DisableAutoRestart(), XV_mix_InterruptEnable(), and XV_mix_InterruptGlobalEnable().

void XVMix_InterruptHandler ( void *  InstancePtr)

This function is the interrupt handler for the mixer core driver.

This handler clears the pending interrupt and determined if the source is frame done signal. If yes, starts the next frame processing and calls the registered callback function

The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XVMix_SetCallback() during initialization phase.

Parameters
InstancePtris a pointer to the core instance that just interrupted.
Returns
None.
Note
None.

References XV_Mix_l2::CallbackRef, XV_Mix_l2::FrameDoneCallback, XV_mix::IsReady, XV_Mix_l2::Mix, XV_mix_InterruptClear(), XV_mix_InterruptGetStatus(), and XV_mix_Start().

int XVMix_IsLayerEnabled ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function returns state of the specified layer [enabled or disabled].

Parameters
InstancePtris a pointer to the core instance.
LayerIdis the layer index for which information is requested
Returns
Enabled(1)/Disabled(0)

References XV_Mix_l2::Mix, and XV_mix_Get_HwReg_layerEnable().

Referenced by XVMix_DbgLayerInfo(), and XVMix_DbgReportStatus().

int XVMix_LayerDisable ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function disables the specified layer of the core instance.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis layer number to be disabled
Returns
XST_SUCCESS or XST_FAILURE
Note
To disable all layers use layer id XVMIX_LAYER_ALL

References XV_Mix_l2::Mix, XV_mix_Get_HwReg_layerEnable(), XV_mix_Set_HwReg_layerEnable(), XVMix_GetNumLayers, and XVMix_IsLogoEnabled.

int XVMix_LayerEnable ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId 
)

This function enables the specified layer of the core instance.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis layer number to be enabled
Returns
XST_SUCCESS or XST_FAILURE
Note
To enable all layers use layer id XVMIX_LAYER_ALL

References XV_Mix_l2::Mix, XV_mix_Get_HwReg_layerEnable(), XV_mix_Set_HwReg_layerEnable(), XVMix_GetNumLayers, and XVMix_IsLogoEnabled.

int XVMix_LoadLogo ( XV_Mix_l2 InstancePtr,
XVidC_VideoWindow *  Win,
u8 *  RBuffer,
u8 *  GBuffer,
u8 *  BBuffer 
)

Loads a logo image into the mixer hardware.

This function takes separate R, G, and B buffers representing a logo image, and writes the pixel data into the hardware registers of the video mixer for display as a logo overlay. The function supports logos with dimensions and alignment constraints as specified by the hardware configuration.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
WinPointer to an XVidC_VideoWindow structure specifying the position and size of the logo window.
RBufferPointer to the buffer containing the red channel data.
GBufferPointer to the buffer containing the green channel data.
BBufferPointer to the buffer containing the blue channel data.
Returns
  • XST_SUCCESS if the logo was loaded successfully.
  • XST_FAILURE if the logo could not be loaded (e.g., invalid parameters or logo not enabled).

Preconditions:

  • The logo feature must be enabled in the mixer hardware.
  • The window dimensions and alignment must meet hardware requirements.
  • The input buffers must be valid and sized appropriately for the window.

Side Effects:

  • Writes logo pixel data to hardware registers.
  • Updates the logo layer buffer pointers in the instance.

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Layer, XV_mix_Config::MaxLogoHeight, XV_mix_Config::MaxLogoWidth, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, XVMix_IsLogoEnabled, and XVMix_SetLayerWindow().

int XVMix_LoadLogoPixelAlpha ( XV_Mix_l2 InstancePtr,
XVidC_VideoWindow *  Win,
u8 *  ABuffer 
)

XVMix_LoadLogoPixelAlpha - Loads per-pixel alpha values for a logo window into the hardware.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
WinPointer to the XVidC_VideoWindow structure specifying the logo window position and size.
ABufferPointer to the buffer containing alpha values for each pixel in the logo window.

This function loads the per-pixel alpha values from the provided buffer into the hardware registers for the specified logo window. The function checks that the logo and per-pixel alpha features are enabled, and that the window parameters are within valid ranges. The alpha values are packed into 32-bit words (4 pixels per word) and written to the hardware.

Returns
XST_SUCCESS if the operation is successful, XST_FAILURE otherwise.

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_mix_Config::MaxLogoHeight, XV_mix_Config::MaxLogoWidth, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, XVMix_IsLogoEnabled, and XVMix_IsLogoPixAlphaEnabled.

int XVMix_MoveLayerWindow ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
u16  StartX,
u16  StartY 
)

This function moved the window position of the specified layer to new coordinates.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer for which window position is to be set
StartXis the new X position
StartYis the new Y position
Returns
XST_SUCCESS if command is successful else error code with reason
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Layer, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, XV_Mix_l2::Stream, XV_mix_Set_HwReg_logoStartX(), XV_mix_Set_HwReg_logoStartY(), XVMix_GetLayerScaleFactor(), XVMix_GetLayerWindow(), XVMix_GetNumLayers, and XVMix_IsLogoEnabled.

void XVMix_SetBackgndColor ( XV_Mix_l2 InstancePtr,
XVMix_BackgroundId  ColorId,
XVidC_ColorDepth  bpc 
)

This function sets the background color to be displayed when stream layer is disabled.

Parameters
InstancePtris a pointer to core instance to be worked upon
ColorIdis requested background color
bpcis color depth
Returns
none
Note
none

References XV_Mix_l2::Mix, XV_mix_Get_HwReg_video_format(), XV_mix_Set_HwReg_background_U_G(), XV_mix_Set_HwReg_background_V_B(), and XV_mix_Set_HwReg_background_Y_R().

int XVMix_SetCallback ( XV_Mix_l2 InstancePtr,
void *  CallbackFunc,
void *  CallbackRef 
)

This function installs an asynchronous callback function for Mixer interrupt.

Parameters
InstancePtris a pointer to the mixer core instance.
CallbackFuncis the address of the callback function.
CallbackRefis a user data item that will be passed to the callback function when it is invoked.
Returns
XST_SUCCESS if callback function installed successfully.
Note
Invoking this function for a handler that already has been installed replaces it with the new handler.

References XV_Mix_l2::CallbackRef, and XV_Mix_l2::FrameDoneCallback.

u32 XVMix_SetCscCoeffs ( XV_Mix_l2 InstancePtr,
XVidC_ColorStd  colorStandard,
XVidC_ColorRange  colorRange,
u8  colorDepth 
)

Sets the Color Space Conversion (CSC) coefficients for the XV_Mix_l2 instance.

This function configures the CSC coefficients based on the specified color standard, color range, and color depth. It first checks if the provided color standard and color range are supported. If the CSC coefficient registers are enabled in the hardware, it sets the coefficients for both YUV-to-RGB and RGB-to-YUV conversions. If the registers are not enabled, it returns an error indicating that the feature is not available.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
colorStandardSpecifies the color standard (e.g., BT.601, BT.709).
colorRangeSpecifies the color range (e.g., full, limited).
colorDepthSpecifies the color depth (in bits).
Returns
  • XST_SUCCESS if the coefficients are set successfully.
  • XST_FAILURE if an unknown color standard or color range is provided.
  • XST_NO_FEATURE if the CSC coefficient registers are not enabled.

References XVMix_IsCscCoeffsRegsEnabled.

int XVMix_SetLayerAlpha ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
u16  Alpha 
)

This function configures the Alpha level of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Alphais the new value
Returns
XST_SUCCESS if command is successful else error code with reason
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, XV_mix_Set_HwReg_logoAlpha(), XVMix_GetNumLayers, XVMix_IsAlphaEnabled, and XVMix_IsLogoEnabled.

int XVMix_SetLayerBufferAddr ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
UINTPTR  Addr 
)

This function sets the buffer address of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Addris the absolute address of buffer in memory
Returns
XST_SUCCESS or XST_FAILURE
Note
Applicable only for Layer1-16

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Layer, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, and XVMix_GetNumLayers.

int XVMix_SetLayerChromaBuffer2Addr ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
UINTPTR  Addr 
)

Set the chroma buffer address for the specified layer.

This function sets the address of the second chroma buffer for a given layer in the XV_Mix_l2 instance. It checks for valid input parameters, ensures the address is properly aligned according to the AXI memory interface requirements, and writes the address to the appropriate hardware register. The function updates the internal state of the instance with the new buffer address.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
LayerIdID of the layer for which the chroma buffer address is to be set. Must be greater than XVMIX_LAYER_MASTER and less than XVMIX_LAYER_LOGO.
AddrPhysical address of the chroma buffer. Must be non-zero and properly aligned.
Returns
  • XST_SUCCESS if the address was set successfully.
  • XVMIX_ERR_MEM_ADDR_MISALIGNED if the address is not properly aligned.
  • XST_FAILURE for other failures (e.g., invalid parameters).
Note
The address must be aligned to (2 * PixPerClk * 4) bytes. The function does not perform any memory allocation or buffer management.

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Layer, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, and XVMix_GetNumLayers.

int XVMix_SetLayerChromaBufferAddr ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
UINTPTR  Addr 
)

This function sets the buffer address of the specified layer for the UV plane for semi-planar formats for the U plane for 3-planar formats.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Addris the absolute address of second buffer in memory
Returns
XST_SUCCESS or XST_FAILURE
Note
Applicable only for Layer1-16

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Layer, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, and XVMix_GetNumLayers.

int XVMix_SetLayerScaleFactor ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
XVMix_Scalefactor  Scale 
)

This function configures the scaling factor of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer to be updated
Scaleis the scale factor
Returns
XST_SUCCESS if command is successful else error code with reason
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Mix, XV_Mix_l2::Stream, XV_mix_Set_HwReg_logoScaleFactor(), XVMix_GetLayerWindow(), XVMix_GetNumLayers, XVMix_IsLogoEnabled, and XVMix_IsScalingEnabled.

int XVMix_SetLayerWindow ( XV_Mix_l2 InstancePtr,
XVMix_LayerId  LayerId,
XVidC_VideoWindow *  Win,
u32  StrideInBytes 
)

This function configures the window coordinates of the specified layer.

Parameters
InstancePtris a pointer to core instance to be worked upon
LayerIdis the layer for which window coordinates are to be set
Winis the window coordinates in pixels
StrideInBytesis the stride of the requested window yuv422 Color space requires 2 Bytes/Pixel yuv444 Color space requires 4 Bytes/Pixel Equation to compute stride is as follows Stride = (Window_Width * (YUV422 ? 2 : 4)) (Applicable only when layer type is Memory)
Returns
XST_SUCCESS if command is successful else error code with reason
Note
Applicable only for Layer1-8 and Logo Layer

References XV_mix_Config::BaseAddress, XV_mix::Config, XV_Mix_l2::Layer, XV_mix_Config::MaxHeight, XV_mix_Config::MaxLogoHeight, XV_mix_Config::MaxLogoWidth, XV_Mix_l2::Mix, XV_mix_Config::PixPerClk, XV_Mix_l2::Stream, XV_mix_Set_HwReg_logoHeight(), XV_mix_Set_HwReg_logoStartX(), XV_mix_Set_HwReg_logoStartY(), XV_mix_Set_HwReg_logoWidth(), XVMix_GetLayerScaleFactor(), XVMix_GetNumLayers, XVMix_IsLayerInterfaceStream, and XVMix_IsLogoEnabled.

Referenced by XVMix_LoadLogo().

int XVMix_SetLogoColorKey ( XV_Mix_l2 InstancePtr,
XVMix_LogoColorKey  ColorKeyData 
)

Set the logo color key values for the XV_Mix_l2 instance.

This function configures the minimum and maximum RGB values for the logo color key, which are used to enable color keying (transparency) for the logo overlay in the video mixer. The function only sets the color key values if both the logo and logo color key features are enabled in the instance.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
ColorKeyDataStructure containing the minimum and maximum RGB values for the color key.
Returns
  • XST_SUCCESS if the color key values were set successfully.
  • XST_FAILURE if the logo or logo color key feature is not enabled.

References XV_Mix_l2::Mix, XV_mix_Set_HwReg_logoClrKeyMax_B(), XV_mix_Set_HwReg_logoClrKeyMax_G(), XV_mix_Set_HwReg_logoClrKeyMax_R(), XV_mix_Set_HwReg_logoClrKeyMin_B(), XV_mix_Set_HwReg_logoClrKeyMin_G(), XV_mix_Set_HwReg_logoClrKeyMin_R(), XVMix_IsLogoColorKeyEnabled, and XVMix_IsLogoEnabled.

void XVMix_SetVidStream ( XV_Mix_l2 InstancePtr,
const XVidC_VideoStream *  StrmIn 
)

Sets the video stream configuration for the mixer instance.

This function copies the provided video stream structure into the mixer instance, and programs the hardware registers for the active video width and height.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.
StrmInPointer to the input XVidC_VideoStream structure.
Returns
None.
Note
The function asserts that the input pointers are valid and that the resolution is within the supported range.

References XV_mix::Config, XV_mix_Config::MaxHeight, XV_mix_Config::MaxWidth, XV_Mix_l2::Mix, XV_Mix_l2::Stream, XV_mix_Set_HwReg_height(), and XV_mix_Set_HwReg_width().

void XVMix_Start ( XV_Mix_l2 InstancePtr)

Starts the video mixer hardware.

This function asserts that the provided instance pointer is not NULL, and then starts the underlying XV_mix hardware by calling its Start function.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance to be started.
Returns
none

References XV_Mix_l2::Mix, and XV_mix_Start().

void XVMix_Stop ( XV_Mix_l2 InstancePtr)

Stops the XV_Mix_l2 core operation.

This function disables the autostart feature, initiates a flush operation, and waits for the flush to complete or until a timeout occurs.

Parameters
InstancePtrPointer to the XV_Mix_l2 instance.

The function performs the following steps:

  1. Asserts that the instance pointer is not NULL.
  2. Disables the autostart mode of the core.
  3. Sets the flush bit to initiate a flush operation.
  4. Waits for the flush operation to complete by polling the flush done status, with a timeout to prevent indefinite waiting.
  5. Returns early if the flush operation does not complete within the timeout.
Returns
none

References XV_Mix_l2::Mix, XV_mix_DisableAutoRestart(), XV_mix_Get_FlushDone(), and XV_mix_SetFlushbit().