vprocss: Align with SSW coding guidelines and few bug fixes
-Updated driver structure, variable and API names to align with defined coding guidelines -Load scalers and chroma resampler coefficients only if the instantiated configuration supports it Signed-off-by: Rohit Consul <rohit.consul@xilinx.com> Acked-by: Srikanth Vemula <svemula@xilinx.com>
This commit is contained in:
parent
a9740e3b93
commit
478171fa76
11 changed files with 853 additions and 877 deletions
|
@ -36,11 +36,11 @@
|
|||
###############################################################################
|
||||
|
||||
proc generate {drv_handle} {
|
||||
::hsi::utils::define_include_file $drv_handle "xparameters.h" "XVprocss" "NUM_INSTANCES" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_SCALER_ALGORITHM" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" "C_H_SCALER_TAPS" "C_V_SCALER_TAPS" "C_H_SCALER_PHASES" "C_V_SCALER_PHASES" "C_CHROMA_ALGORITHM" "C_H_CHROMA_TAPS" "C_V_CHROMA_TAPS"
|
||||
::hsi::utils::define_include_file $drv_handle "xparameters.h" "XVprocSs" "NUM_INSTANCES" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_SCALER_ALGORITHM" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" "C_H_SCALER_TAPS" "C_V_SCALER_TAPS" "C_H_SCALER_PHASES" "C_V_SCALER_PHASES" "C_CHROMA_ALGORITHM" "C_H_CHROMA_TAPS" "C_V_CHROMA_TAPS"
|
||||
|
||||
hier_ip_define_config_file $drv_handle "xvprocss_g.c" "XVprocss" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS"
|
||||
hier_ip_define_config_file $drv_handle "xvprocss_g.c" "XVprocSs" "DEVICE_ID" "C_BASEADDR" "C_HIGHADDR" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS"
|
||||
|
||||
::hsi::utils::define_canonical_xpars $drv_handle "xparameters.h" "Vprocss" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_SCALER_ALGORITHM" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" "C_H_SCALER_TAPS" "C_V_SCALER_TAPS" "C_H_SCALER_PHASES" "C_V_SCALER_PHASES" "C_CHROMA_ALGORITHM" "C_H_CHROMA_TAPS" "C_V_CHROMA_TAPS"
|
||||
::hsi::utils::define_canonical_xpars $drv_handle "xparameters.h" "XVprocSs" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_SCALER_ALGORITHM" "C_TOPOLOGY" "C_SAMPLES_PER_CLK" "C_MAX_DATA_WIDTH" "C_NUM_VIDEO_COMPONENTS" "C_MAX_COLS" "C_MAX_ROWS" "C_H_SCALER_TAPS" "C_V_SCALER_TAPS" "C_H_SCALER_PHASES" "C_V_SCALER_PHASES" "C_CHROMA_ALGORITHM" "C_H_CHROMA_TAPS" "C_V_CHROMA_TAPS"
|
||||
}
|
||||
|
||||
|
||||
|
@ -227,9 +227,7 @@ proc hier_ip_define_config_file {drv_handle file_name drv_string args} {
|
|||
|
||||
if {[dict exists $ss_ip_list $sub_core]} {
|
||||
#puts "****Sub-core found in dictionary****"
|
||||
if {[string compare -nocase "V_DEINTERLACER" $sub_core] == 0} {
|
||||
set base_addr_name "S_AXI_AXILITES_BASEADDR"
|
||||
} elseif {[string match -nocase v_* $sub_core]} {
|
||||
if {[string match -nocase v_* $sub_core]} {
|
||||
set base_addr_name "S_AXI_CTRL_BASEADDR"
|
||||
} else {
|
||||
set base_addr_name "BASEADDR"
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss_vdma.c
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @addtogroup vprocss
|
||||
* @{
|
||||
* @details
|
||||
|
||||
* Video buffer management routine.
|
||||
* The functions in this file provides an abstraction from the register peek/poke
|
||||
|
@ -63,17 +64,17 @@
|
|||
/**
|
||||
* This function starts Read and Write channels
|
||||
*
|
||||
* @param pVdma is the pointer to core instance to be worked on
|
||||
* @param XVdmaPtr is the pointer to core instance to be worked on
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XVprocss_VdmaStart(XAxiVdma *pVdma)
|
||||
void XVprocSs_VdmaStart(XAxiVdma *XVdmaPtr)
|
||||
{
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
XAxiVdma_DmaStart(pVdma, XAXIVDMA_WRITE);
|
||||
XAxiVdma_DmaStart(pVdma, XAXIVDMA_READ);
|
||||
XAxiVdma_DmaStart(XVdmaPtr, XAXIVDMA_WRITE);
|
||||
XAxiVdma_DmaStart(XVdmaPtr, XAXIVDMA_READ);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,17 +82,17 @@ void XVprocss_VdmaStart(XAxiVdma *pVdma)
|
|||
/**
|
||||
* This function stops Read and Write channels
|
||||
*
|
||||
* @param pVdma is the pointer to core instance to be worked on
|
||||
* @param XVdmaPtr is the pointer to core instance to be worked on
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XVprocss_VdmaStop(XAxiVdma *pVdma)
|
||||
void XVprocSs_VdmaStop(XAxiVdma *XVdmaPtr)
|
||||
{
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
XAxiVdma_DmaStop(pVdma, XAXIVDMA_WRITE);
|
||||
XAxiVdma_DmaStop(pVdma, XAXIVDMA_READ);
|
||||
XAxiVdma_DmaStop(XVdmaPtr, XAXIVDMA_WRITE);
|
||||
XAxiVdma_DmaStop(XVdmaPtr, XAXIVDMA_READ);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,20 +100,20 @@ void XVprocss_VdmaStop(XAxiVdma *pVdma)
|
|||
/**
|
||||
* This function resets Read and Write channels.
|
||||
*
|
||||
* @param pVdma is the pointer to core instance to be worked on
|
||||
* @param XVdmaPtr is the pointer to core instance to be worked on
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XVprocss_VdmaReset(XAxiVdma *pVdma)
|
||||
void XVprocSs_VdmaReset(XAxiVdma *XVdmaPtr)
|
||||
{
|
||||
u32 timeout;
|
||||
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
XAxiVdma_Reset(pVdma, XAXIVDMA_WRITE);
|
||||
XAxiVdma_Reset(XVdmaPtr, XAXIVDMA_WRITE);
|
||||
timeout = XVDMA_RESET_TIMEOUT;
|
||||
while(timeout && XAxiVdma_ResetNotDone(pVdma, XAXIVDMA_WRITE))
|
||||
while(timeout && XAxiVdma_ResetNotDone(XVdmaPtr, XAXIVDMA_WRITE))
|
||||
{
|
||||
timeout -= 1;
|
||||
}
|
||||
|
@ -122,8 +123,8 @@ void XVprocss_VdmaReset(XAxiVdma *pVdma)
|
|||
}
|
||||
|
||||
timeout = XVDMA_RESET_TIMEOUT;
|
||||
XAxiVdma_Reset(pVdma, XAXIVDMA_READ);
|
||||
while(timeout && XAxiVdma_ResetNotDone(pVdma, XAXIVDMA_READ))
|
||||
XAxiVdma_Reset(XVdmaPtr, XAXIVDMA_READ);
|
||||
while(timeout && XAxiVdma_ResetNotDone(XVdmaPtr, XAXIVDMA_READ))
|
||||
{
|
||||
timeout -= 1;
|
||||
}
|
||||
|
@ -140,17 +141,17 @@ void XVprocss_VdmaReset(XAxiVdma *pVdma)
|
|||
*
|
||||
* This function sets up the write channel
|
||||
*
|
||||
* @param pVdma is the instance pointer to the DMA engine.
|
||||
* @param XVdmaPtr is the instance pointer to the DMA engine.
|
||||
* @param WrBaseAddress is the address in DDR where frame buffers are located
|
||||
* @param window is pointer to sub-frame window
|
||||
* @param FrameWidth is the active width of the stream to be written
|
||||
* @param FrameHeight is the active height of the stream to be written
|
||||
* @param Bpp is Bytes Per Pixel required for the stream to be written
|
||||
* @param PixelWidthInBits is Bits Per Pixel required for the stream
|
||||
*
|
||||
* @return XST_SUCCESS if the setup is successful, XST_FAILURE otherwise.
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
||||
int XVprocSs_VdmaWriteSetup(XAxiVdma *XVdmaPtr,
|
||||
u32 WrBaseAddress,
|
||||
XVidC_VideoWindow *window,
|
||||
u32 FrameWidth,
|
||||
|
@ -166,7 +167,7 @@ int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
|||
u32 BlockOffset;
|
||||
u32 alignBytes = 0;
|
||||
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
HSizeInBytes = (window->Width*PixelWidthInBits)/8;
|
||||
StrideInBytes = (FrameWidth*PixelWidthInBits)/8;
|
||||
|
@ -177,9 +178,9 @@ int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
|||
/* If DMA engine does not support unaligned transfers then align block
|
||||
* offset, hsize and stride to next data width boundary
|
||||
*/
|
||||
if(!pVdma->WriteChannel.HasDRE)
|
||||
if(!XVdmaPtr->WriteChannel.HasDRE)
|
||||
{
|
||||
alignBytes = pVdma->WriteChannel.WordLength-1;
|
||||
alignBytes = XVdmaPtr->WriteChannel.WordLength-1;
|
||||
BlockOffset = (BlockOffset + alignBytes) & ~(alignBytes);
|
||||
HSizeInBytes = (HSizeInBytes + alignBytes) & ~(alignBytes);
|
||||
StrideInBytes = (StrideInBytes + alignBytes) & ~(alignBytes);
|
||||
|
@ -200,7 +201,7 @@ int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
|||
WriteCfg.FixedFrameStoreAddr = 0; /* We are not doing parking */
|
||||
|
||||
WriteCfg.GenLockRepeat = 1; /* Repeat previous frame on frame errors */
|
||||
Status = XAxiVdma_DmaConfig(pVdma, XAXIVDMA_WRITE, &WriteCfg);
|
||||
Status = XAxiVdma_DmaConfig(XVdmaPtr, XAXIVDMA_WRITE, &WriteCfg);
|
||||
if (Status != XST_SUCCESS)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"Write channel config failed %d\r\n", Status);
|
||||
|
@ -212,14 +213,14 @@ int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
|||
* Use physical addresses
|
||||
*/
|
||||
Addr = WrBaseAddress + BlockOffset;
|
||||
for(Index = 0; Index < pVdma->MaxNumFrames; Index++)
|
||||
for(Index = 0; Index < XVdmaPtr->MaxNumFrames; Index++)
|
||||
{
|
||||
WriteCfg.FrameStoreStartAddr[Index] = Addr;
|
||||
Addr += StrideInBytes * FrameHeight;
|
||||
}
|
||||
|
||||
/* Set the buffer addresses for transfer in the DMA engine */
|
||||
Status = XAxiVdma_DmaSetBufferAddr(pVdma, XAXIVDMA_WRITE,
|
||||
Status = XAxiVdma_DmaSetBufferAddr(XVdmaPtr, XAXIVDMA_WRITE,
|
||||
WriteCfg.FrameStoreStartAddr);
|
||||
if (Status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -235,19 +236,19 @@ int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
|||
*
|
||||
* This function sets up the read channel
|
||||
*
|
||||
* @param pVdma is the instance pointer to the DMA engine.
|
||||
* @param XVdmaPtr is the instance pointer to the DMA engine.
|
||||
* @param RdBaseAddress is the address in DDR where frame buffers are located
|
||||
* @param window is pointer to sub-frame window
|
||||
* @param FrameWidth is the active width of the stream to be read
|
||||
* @param FrameHeight is the active height of the stream to be read
|
||||
* @param Bpp is Bytes Per Pixel required for the stream to be read
|
||||
* @param PixelWidthInBits is Bits Per Pixel required for the stream
|
||||
*
|
||||
* @return XST_SUCCESS if the setup is successful, XST_FAILURE otherwise.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
||||
int XVprocSs_VdmaReadSetup(XAxiVdma *XVdmaPtr,
|
||||
u32 RdBaseAddress,
|
||||
XVidC_VideoWindow *window,
|
||||
u32 FrameWidth,
|
||||
|
@ -263,7 +264,7 @@ int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
|||
u32 BlockOffset;
|
||||
u32 alignBytes = 0;
|
||||
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
HSizeInBytes = (window->Width*PixelWidthInBits)/8;
|
||||
StrideInBytes = (FrameWidth*PixelWidthInBits)/8;
|
||||
|
@ -274,9 +275,9 @@ int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
|||
/* If DMA engine does not support unaligned transfers then align block
|
||||
* offset, hsize and stride to next data width boundary
|
||||
*/
|
||||
if(!pVdma->ReadChannel.HasDRE)
|
||||
if(!XVdmaPtr->ReadChannel.HasDRE)
|
||||
{
|
||||
alignBytes = pVdma->ReadChannel.WordLength-1;
|
||||
alignBytes = XVdmaPtr->ReadChannel.WordLength-1;
|
||||
BlockOffset = (BlockOffset + alignBytes) & ~(alignBytes);
|
||||
HSizeInBytes = (HSizeInBytes + alignBytes) & ~(alignBytes);
|
||||
StrideInBytes = (StrideInBytes + alignBytes) & ~(alignBytes);
|
||||
|
@ -296,7 +297,7 @@ int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
|||
|
||||
ReadCfg.FixedFrameStoreAddr = 0; /* We are not doing parking */
|
||||
|
||||
Status = XAxiVdma_DmaConfig(pVdma, XAXIVDMA_READ, &ReadCfg);
|
||||
Status = XAxiVdma_DmaConfig(XVdmaPtr, XAXIVDMA_READ, &ReadCfg);
|
||||
if (Status != XST_SUCCESS)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"Read channel config failed %d\r\n", Status);
|
||||
|
@ -308,7 +309,7 @@ int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
|||
* These addresses are physical addresses
|
||||
*/
|
||||
Addr = RdBaseAddress + BlockOffset;
|
||||
for(Index = 0; Index < pVdma->MaxNumFrames; Index++)
|
||||
for(Index = 0; Index < XVdmaPtr->MaxNumFrames; Index++)
|
||||
{
|
||||
ReadCfg.FrameStoreStartAddr[Index] = Addr;
|
||||
Addr += StrideInBytes * FrameHeight;
|
||||
|
@ -317,7 +318,7 @@ int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
|||
/* Set the buffer addresses for transfer in the DMA engine
|
||||
* The buffer addresses are physical addresses
|
||||
*/
|
||||
Status = XAxiVdma_DmaSetBufferAddr(pVdma, XAXIVDMA_READ,
|
||||
Status = XAxiVdma_DmaSetBufferAddr(XVdmaPtr, XAXIVDMA_READ,
|
||||
ReadCfg.FrameStoreStartAddr);
|
||||
if (Status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -334,27 +335,27 @@ int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
|||
* This function starts the transfer on Read/Write channels. Both channels must
|
||||
* have been configured before this call is made
|
||||
*
|
||||
* @param pVdma is the instance pointer to the DMA engine.
|
||||
* @param XVdmaPtr is the instance pointer to the DMA engine.
|
||||
*
|
||||
* @return XST_SUCCESS if the setup is successful, XST_FAILURE otherwise.
|
||||
*
|
||||
* @note Currently the return value is ignored at subsystem level.
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_VdmaStartTransfer(XAxiVdma *pVdma)
|
||||
int XVprocSs_VdmaStartTransfer(XAxiVdma *XVdmaPtr)
|
||||
{
|
||||
int Status;
|
||||
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
Status = XAxiVdma_DmaStart(pVdma, XAXIVDMA_WRITE);
|
||||
Status = XAxiVdma_DmaStart(XVdmaPtr, XAXIVDMA_WRITE);
|
||||
if (Status != XST_SUCCESS)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VDMA ERR:: Start Write transfer failed %d\r\n", Status);
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
Status = XAxiVdma_DmaStart(pVdma, XAXIVDMA_READ);
|
||||
Status = XAxiVdma_DmaStart(XVdmaPtr, XAXIVDMA_READ);
|
||||
if (Status != XST_SUCCESS)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VDMA ERR:: Start read transfer failed %d\r\n", Status);
|
||||
|
@ -368,20 +369,20 @@ int XVprocss_VdmaStartTransfer(XAxiVdma *pVdma)
|
|||
/**
|
||||
* This function configures the VDMA RD/WR channel for down scale mode
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
* @param updateCh defines VDMA channel (RD/WR or RD+WR) to update
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
******************************************************************************/
|
||||
void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh)
|
||||
void XVprocSs_VdmaSetWinToDnScaleMode(XVprocSs *XVprocSsPtr, u32 updateCh)
|
||||
{
|
||||
XVidC_VideoWindow wrWin, rdWin;
|
||||
u32 OutputWidth, OutputHeight;
|
||||
int status;
|
||||
|
||||
OutputWidth = pVprocss->VidOut.Timing.HActive;
|
||||
OutputHeight = pVprocss->VidOut.Timing.VActive;
|
||||
OutputWidth = XVprocSsPtr->VidOut.Timing.HActive;
|
||||
OutputHeight = XVprocSsPtr->VidOut.Timing.VActive;
|
||||
|
||||
/*VDMA is After Scaler
|
||||
WR client will receive PIP (or down scaled) stream from Scaler
|
||||
|
@ -393,10 +394,10 @@ void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
)
|
||||
{
|
||||
/* Setup WR CLIENT window size */
|
||||
if(XVprocss_IsPipModeOn(pVprocss))
|
||||
if(XVprocSs_IsPipModeOn(XVprocSsPtr))
|
||||
{
|
||||
/* Read PIP window setting - set elsewhere */
|
||||
XVprocss_GetZoomPipWindow(pVprocss, XVPROCSS_PIP_WIN, &wrWin);
|
||||
XVprocSs_GetZoomPipWindow(XVprocSsPtr, XVPROCSS_PIP_WIN, &wrWin);
|
||||
}
|
||||
else //Normal Downscale mode
|
||||
{
|
||||
|
@ -408,12 +409,12 @@ void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
}
|
||||
|
||||
/* write PIP window stream to DDR */
|
||||
status = XVprocss_VdmaWriteSetup(pVprocss->vdma,
|
||||
pVprocss->FrameBufBaseaddr,
|
||||
status = XVprocSs_VdmaWriteSetup(XVprocSsPtr->VdmaPtr,
|
||||
XVprocSsPtr->FrameBufBaseaddr,
|
||||
&wrWin,
|
||||
OutputWidth,
|
||||
OutputHeight,
|
||||
pVprocss->idata.PixelWidthInBits);
|
||||
XVprocSsPtr->CtxtData.PixelWidthInBits);
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Unable to configure VDMA Write Channel \r\n");
|
||||
|
@ -430,12 +431,12 @@ void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
rdWin.Width = OutputWidth;
|
||||
rdWin.Height = OutputHeight;
|
||||
|
||||
status = XVprocss_VdmaReadSetup(pVprocss->vdma,
|
||||
pVprocss->FrameBufBaseaddr,
|
||||
status = XVprocSs_VdmaReadSetup(XVprocSsPtr->VdmaPtr,
|
||||
XVprocSsPtr->FrameBufBaseaddr,
|
||||
&rdWin,
|
||||
OutputWidth,
|
||||
OutputHeight,
|
||||
pVprocss->idata.PixelWidthInBits);
|
||||
XVprocSsPtr->CtxtData.PixelWidthInBits);
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Unable to configure VDMA Read Channel \r\n");
|
||||
|
@ -448,20 +449,20 @@ void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
/**
|
||||
* This function configures the VDMA RD/WR channel for UP scale (or 1:1) mode
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
* @param updateCh defines VDMA channel (RD/WR or RD+WR) to update
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
******************************************************************************/
|
||||
void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh)
|
||||
void XVprocSs_VdmaSetWinToUpScaleMode(XVprocSs *XVprocSsPtr, u32 updateCh)
|
||||
{
|
||||
XVidC_VideoWindow wrWin, rdWin;
|
||||
u32 InputWidth, InputHeight;
|
||||
int status;
|
||||
|
||||
InputWidth = pVprocss->idata.vidInWidth;
|
||||
InputHeight = pVprocss->idata.vidInHeight;
|
||||
InputWidth = XVprocSsPtr->CtxtData.VidInWidth;
|
||||
InputHeight = XVprocSsPtr->CtxtData.VidInHeight;
|
||||
|
||||
/*VDMA is before Scaler
|
||||
WR client will receive streaming input
|
||||
|
@ -477,12 +478,12 @@ void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
wrWin.Height = InputHeight;
|
||||
|
||||
/* write input stream to DDR */
|
||||
status = XVprocss_VdmaWriteSetup(pVprocss->vdma,
|
||||
pVprocss->FrameBufBaseaddr,
|
||||
status = XVprocSs_VdmaWriteSetup(XVprocSsPtr->VdmaPtr,
|
||||
XVprocSsPtr->FrameBufBaseaddr,
|
||||
&wrWin,
|
||||
InputWidth,
|
||||
InputHeight,
|
||||
pVprocss->idata.PixelWidthInBits);
|
||||
XVprocSsPtr->CtxtData.PixelWidthInBits);
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Unable to configure VDMA Write Channel \r\n");
|
||||
|
@ -494,10 +495,10 @@ void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
)
|
||||
{
|
||||
/* Setup RD CLIENT window size to either crop window or input resolution */
|
||||
if(XVprocss_IsZoomModeOn(pVprocss))
|
||||
if(XVprocSs_IsZoomModeOn(XVprocSsPtr))
|
||||
{
|
||||
/* Read user defined ZOOM window */
|
||||
XVprocss_GetZoomPipWindow(pVprocss, XVPROCSS_ZOOM_WIN, &rdWin);
|
||||
XVprocSs_GetZoomPipWindow(XVprocSsPtr, XVPROCSS_ZOOM_WIN, &rdWin);
|
||||
}
|
||||
else //set RD window to input resolution
|
||||
{
|
||||
|
@ -507,12 +508,12 @@ void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
rdWin.Height = InputHeight;
|
||||
}
|
||||
|
||||
status = XVprocss_VdmaReadSetup(pVprocss->vdma,
|
||||
pVprocss->FrameBufBaseaddr,
|
||||
status = XVprocSs_VdmaReadSetup(XVprocSsPtr->VdmaPtr,
|
||||
XVprocSsPtr->FrameBufBaseaddr,
|
||||
&rdWin,
|
||||
InputWidth,
|
||||
InputHeight,
|
||||
pVprocss->idata.PixelWidthInBits);
|
||||
XVprocSsPtr->CtxtData.PixelWidthInBits);
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Unable to configure VDMA Read Channel \r\n");
|
||||
|
@ -525,32 +526,32 @@ void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh)
|
|||
*
|
||||
* This function prints VDMA status on the console
|
||||
*
|
||||
* @param pVdma is the instance pointer to the DMA engine.
|
||||
* @param XVdmaPtr is the instance pointer to the DMA engine.
|
||||
* @param Bpp is Bytes per pixel to be used for data transfer
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
******************************************************************************/
|
||||
void XVprocss_VdmaDbgReportStatus(XAxiVdma *pVdma, u32 PixelWidthInBits)
|
||||
void XVprocSs_VdmaDbgReportStatus(XAxiVdma *XVdmaPtr, u32 PixelWidthInBits)
|
||||
{
|
||||
u32 height,width,stride;
|
||||
u32 regOffset;
|
||||
|
||||
if(pVdma)
|
||||
if(XVdmaPtr)
|
||||
{
|
||||
xil_printf("\r\n\r\n----->VDMA IP STATUS<----\r\n");
|
||||
xil_printf("INFO: VDMA Rd/Wr Client Width/Stride defined in Bytes Per Pixel\r\n");
|
||||
xil_printf("Bytes Per Pixel = %d\r\n\r\n", PixelWidthInBits/8);
|
||||
xil_printf("Read Channel Setting \r\n" );
|
||||
//clear status register before reading
|
||||
XAxiVdma_ClearDmaChannelErrors(pVdma, XAXIVDMA_READ, 0xFFFFFFFF);
|
||||
XAxiVdma_ClearDmaChannelErrors(XVdmaPtr, XAXIVDMA_READ, 0xFFFFFFFF);
|
||||
|
||||
//Read Registers
|
||||
XAxiVdma_DmaRegisterDump(pVdma, XAXIVDMA_READ);
|
||||
XAxiVdma_DmaRegisterDump(XVdmaPtr, XAXIVDMA_READ);
|
||||
regOffset = XAXIVDMA_MM2S_ADDR_OFFSET;
|
||||
height = XAxiVdma_ReadReg(pVdma->BaseAddr, regOffset+0);
|
||||
width = XAxiVdma_ReadReg(pVdma->BaseAddr, regOffset+4);
|
||||
stride = XAxiVdma_ReadReg(pVdma->BaseAddr, regOffset+8);
|
||||
height = XAxiVdma_ReadReg(XVdmaPtr->BaseAddr, regOffset+0);
|
||||
width = XAxiVdma_ReadReg(XVdmaPtr->BaseAddr, regOffset+4);
|
||||
stride = XAxiVdma_ReadReg(XVdmaPtr->BaseAddr, regOffset+8);
|
||||
stride &= XAXIVDMA_STRIDE_MASK;
|
||||
|
||||
xil_printf("Height: %d \r\n", height);
|
||||
|
@ -559,14 +560,14 @@ void XVprocss_VdmaDbgReportStatus(XAxiVdma *pVdma, u32 PixelWidthInBits)
|
|||
|
||||
xil_printf("\r\nWrite Channel Setting \r\n" );
|
||||
//clear status register before reading
|
||||
XAxiVdma_ClearDmaChannelErrors(pVdma, XAXIVDMA_WRITE, 0xFFFFFFFF);
|
||||
XAxiVdma_ClearDmaChannelErrors(XVdmaPtr, XAXIVDMA_WRITE, 0xFFFFFFFF);
|
||||
|
||||
//Read Registers
|
||||
XAxiVdma_DmaRegisterDump(pVdma, XAXIVDMA_WRITE);
|
||||
XAxiVdma_DmaRegisterDump(XVdmaPtr, XAXIVDMA_WRITE);
|
||||
regOffset = XAXIVDMA_S2MM_ADDR_OFFSET;
|
||||
height = XAxiVdma_ReadReg(pVdma->BaseAddr, regOffset+0);
|
||||
width = XAxiVdma_ReadReg(pVdma->BaseAddr, regOffset+4);
|
||||
stride = XAxiVdma_ReadReg(pVdma->BaseAddr, regOffset+8);
|
||||
height = XAxiVdma_ReadReg(XVdmaPtr->BaseAddr, regOffset+0);
|
||||
width = XAxiVdma_ReadReg(XVdmaPtr->BaseAddr, regOffset+4);
|
||||
stride = XAxiVdma_ReadReg(XVdmaPtr->BaseAddr, regOffset+8);
|
||||
stride &= XAXIVDMA_STRIDE_MASK;
|
||||
|
||||
xil_printf("Height: %d \r\n", height);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
* @file xvprocss_vdma.h
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This header file contains the video processing engine DMA buffer management
|
||||
* routines and helper functions. AXI-VDMA core is used to provide DMA
|
||||
|
@ -97,25 +98,25 @@ typedef enum
|
|||
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
void XVprocss_VdmaStart(XAxiVdma *pVdma);
|
||||
void XVprocss_VdmaStop(XAxiVdma *pVdma);
|
||||
void XVprocss_VdmaReset(XAxiVdma *pVdma);
|
||||
int XVprocss_VdmaWriteSetup(XAxiVdma *pVdma,
|
||||
void XVprocSs_VdmaStart(XAxiVdma *XVdmaPtr);
|
||||
void XVprocSs_VdmaStop(XAxiVdma *XVdmaPtr);
|
||||
void XVprocSs_VdmaReset(XAxiVdma *XVdmaPtr);
|
||||
int XVprocSs_VdmaWriteSetup(XAxiVdma *XVdmaPtr,
|
||||
u32 WrBaseAddress,
|
||||
XVidC_VideoWindow *window,
|
||||
u32 FrameWidth,
|
||||
u32 FrameHeight,
|
||||
u32 PixelWidthInBits);
|
||||
int XVprocss_VdmaReadSetup(XAxiVdma *pVdma,
|
||||
int XVprocSs_VdmaReadSetup(XAxiVdma *XVdmaPtr,
|
||||
u32 RdBaseAddress,
|
||||
XVidC_VideoWindow *window,
|
||||
u32 FrameWidth,
|
||||
u32 FrameHeight,
|
||||
u32 PixelWidthInBits);
|
||||
int XVprocss_VdmaStartTransfer(XAxiVdma *pVdma);
|
||||
void XVprocss_VdmaDbgReportStatus(XAxiVdma *pVdma, u32 PixelWidthInBits);
|
||||
void XVprocss_VdmaSetWinToUpScaleMode(XVprocss *pVprocss, u32 updateCh);
|
||||
void XVprocss_VdmaSetWinToDnScaleMode(XVprocss *pVprocss, u32 updateCh);
|
||||
int XVprocSs_VdmaStartTransfer(XAxiVdma *XVdmaPtr);
|
||||
void XVprocSs_VdmaDbgReportStatus(XAxiVdma *XVdmaPtr, u32 PixelWidthInBits);
|
||||
void XVprocSs_VdmaSetWinToUpScaleMode(XVprocSs *XVprocSsPtr, u32 updateCh);
|
||||
void XVprocSs_VdmaSetWinToDnScaleMode(XVprocSs *XVprocSsPtr, u32 updateCh);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -33,9 +33,6 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss.h
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This is main header file of the Xilinx Video Processing Subsystem driver
|
||||
*
|
||||
|
@ -121,7 +118,7 @@
|
|||
* make use of provided API's to configure it at boot-up. Thereafter application
|
||||
* SW is responsible to monitor the system for external impetus and call the
|
||||
* subsystem API's to communicate the change and trigger the reconfiguration of
|
||||
* internal data processing pipe (refer API XVprocss_ConfigureSubsystem())
|
||||
* internal data processing pipe (refer API XVprocSs_ConfigureSubsystem())
|
||||
* AXI Stream configuration for input/output interface is derived from the
|
||||
* Xilinx video common driver and only the resolutions listed therein are
|
||||
* supported at this time
|
||||
|
@ -145,7 +142,7 @@
|
|||
* must be determined by the system designer and the application code is
|
||||
* responsible to program the base address of the buffer memory prior to
|
||||
* initializing the subsystem. API to use is defined below
|
||||
* - XVprocss_SetFrameBufBaseaddr
|
||||
* - XVprocSs_SetFrameBufBaseaddr
|
||||
*
|
||||
* <b>Interrupt Service</b>
|
||||
*
|
||||
|
@ -178,7 +175,7 @@
|
|||
*
|
||||
* Ver Who Date Changes
|
||||
* ----- ---- -------- -------------------------------------------------------
|
||||
* 1.00 rco 07/21/15 Initial Release
|
||||
* 1.00 rco 08/17/15 Initial Release
|
||||
|
||||
* </pre>
|
||||
*
|
||||
|
@ -246,7 +243,7 @@ typedef enum
|
|||
XVPROCSS_ZOOM_WIN = 0,
|
||||
XVPROCSS_PIP_WIN,
|
||||
XVPROCSS_PIXEL_WIN
|
||||
}XVprocss_Win;
|
||||
}XVprocSs_Win;
|
||||
|
||||
/**
|
||||
* Scaling Modes supported
|
||||
|
@ -257,45 +254,45 @@ typedef enum
|
|||
XVPROCSS_SCALE_UP,
|
||||
XVPROCSS_SCALE_DN,
|
||||
XVPROCSS_SCALE_NOT_SUPPORTED
|
||||
}XVprocss_ScaleMode;
|
||||
}XVprocSs_ScaleMode;
|
||||
|
||||
/**
|
||||
* Video Processing Subsystem internal scratch pad memory.
|
||||
* Video Processing Subsystem context scratch pad memory.
|
||||
* This contains internal flags, state variables, routing table
|
||||
* and other meta-data required by the subsystem. Each instance
|
||||
* of the subsystem will have its own scratch pad memory
|
||||
* of the subsystem will have its own context data memory
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
XVidC_VideoWindow rdWindow; /**< window for Zoom/Pip feature support */
|
||||
XVidC_VideoWindow wrWindow; /**< window for Zoom/Pip feature support */
|
||||
XVidC_VideoWindow RdWindow; /**< window for Zoom/Pip feature support */
|
||||
XVidC_VideoWindow WrWindow; /**< window for Zoom/Pip feature support */
|
||||
|
||||
u32 deintBufAddr; /**< Deinterlacer field buffer Addr. in DDR */
|
||||
u32 DeintBufAddr; /**< Deinterlacer field buffer Addr. in DDR */
|
||||
u8 PixelWidthInBits; /**< Number of bits required to store 1 pixel */
|
||||
|
||||
u8 RtngTable[XVPROCSS_RTR_MAX]; /**< Storage for computed routing map */
|
||||
u8 startCore[XVPROCSS_RTR_MAX]; /**< Enable flag to start sub-core */
|
||||
u8 StartCore[XVPROCSS_RTR_MAX]; /**< Enable flag to start sub-core */
|
||||
u8 RtrNumCores; /**< Number of sub-cores in routing map */
|
||||
u8 ScaleMode; /**< Stored computed scaling mode - UP/DN/1:1 */
|
||||
u8 memEn; /**< Flag to indicate if stream routes through memory */
|
||||
u8 MemEn; /**< Flag to indicate if stream routes through memory */
|
||||
u8 ZoomEn; /**< Flag to store Zoom feature state */
|
||||
u8 PipEn; /**< Flag to store PIP feature state */
|
||||
u16 vidInWidth; /**< Input H Active */
|
||||
u16 vidInHeight; /**< Input V Active */
|
||||
u16 VidInWidth; /**< Input H Active */
|
||||
u16 VidInHeight; /**< Input V Active */
|
||||
u16 PixelHStepSize; /**< Increment step size for Pip/Zoom window */
|
||||
XVidC_ColorFormat strmCformat; /**< processing pipe color format */
|
||||
XVidC_ColorFormat cscIn; /**< CSC core input color format */
|
||||
XVidC_ColorFormat cscOut; /**< CSC core output color format */
|
||||
XVidC_ColorFormat hcrIn; /**< horiz. cresmplr core input color format */
|
||||
XVidC_ColorFormat hcrOut; /**< horiz. cresmplr core output color format */
|
||||
}XVprocss_IData;
|
||||
XVidC_ColorFormat StrmCformat; /**< processing pipe color format */
|
||||
XVidC_ColorFormat CscIn; /**< CSC core input color format */
|
||||
XVidC_ColorFormat CscOut; /**< CSC core output color format */
|
||||
XVidC_ColorFormat HcrIn; /**< horiz. cresmplr core input color format */
|
||||
XVidC_ColorFormat HcrOut; /**< horiz. cresmplr core output color format */
|
||||
}XVprocSs_ContextData;
|
||||
|
||||
/**
|
||||
* Sub-Core Configuration Table
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
u16 isPresent; /**< Flag to indicate if sub-core is present in the design*/
|
||||
u16 IsPresent; /**< Flag to indicate if sub-core is present in the design*/
|
||||
u16 DeviceId; /**< Device ID of the sub-core */
|
||||
u32 AddrOffset; /**< sub-core offset from subsystem base address */
|
||||
}XSubCore;
|
||||
|
@ -331,79 +328,79 @@ typedef struct
|
|||
XSubCore VCrsmplrIn; /**< Sub-core instance configuration */
|
||||
XSubCore VCrsmplrOut; /**< Sub-core instance configuration */
|
||||
XSubCore Vscale; /**< Sub-core instance configuration */
|
||||
} XVprocss_Config;
|
||||
} XVprocSs_Config;
|
||||
|
||||
/**
|
||||
* The XVprocss driver instance data. The user is required to allocate a variable
|
||||
* of this type for every XVprocss device in the system. A pointer to a variable
|
||||
* The XVprocSs driver instance data. The user is required to allocate a variable
|
||||
* of this type for every XVprocSs device in the system. A pointer to a variable
|
||||
* of this type is then passed to the driver API functions.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
XVprocss_Config Config; /**< Hardware configuration */
|
||||
u32 IsReady; /**< Device and the driver instance are
|
||||
XVprocSs_Config Config; /**< Hardware configuration */
|
||||
u32 IsReady; /**< Device and the driver instance are
|
||||
initialized */
|
||||
XAxis_Switch *router; /**< handle to sub-core driver instance */
|
||||
XGpio *rstAxis; /**< handle to sub-core driver instance */
|
||||
XGpio *rstAximm; /**< handle to sub-core driver instance */
|
||||
/**< handle to sub-core driver instance */
|
||||
XV_hcresampler *hcrsmplr; /**< handle to sub-core driver instance */
|
||||
XV_vcresampler *vcrsmplrIn; /**< handle to sub-core driver instance */
|
||||
XV_vcresampler *vcrsmplrOut; /**< handle to sub-core driver instance */
|
||||
XV_vscaler *vscaler; /**< handle to sub-core driver instance */
|
||||
XV_hscaler *hscaler; /**< handle to sub-core driver instance */
|
||||
XAxiVdma *vdma; /**< handle to sub-core driver instance */
|
||||
XV_letterbox *lbox; /**< handle to sub-core driver instance */
|
||||
XV_csc *csc; /**< handle to sub-core driver instance */
|
||||
XV_deinterlacer *deint; /**< handle to sub-core driver instance */
|
||||
XAxis_Switch *RouterPtr; /**< handle to sub-core driver instance */
|
||||
XGpio *RstAxisPtr; /**< handle to sub-core driver instance */
|
||||
XGpio *RstAximmPtr; /**< handle to sub-core driver instance */
|
||||
/**< handle to sub-core driver instance */
|
||||
XV_hcresampler *HcrsmplrPtr; /**< handle to sub-core driver instance */
|
||||
XV_vcresampler *VcrsmplrInPtr; /**< handle to sub-core driver instance */
|
||||
XV_vcresampler *VcrsmplrOutPtr; /**< handle to sub-core driver instance */
|
||||
XV_vscaler *VscalerPtr; /**< handle to sub-core driver instance */
|
||||
XV_hscaler *HscalerPtr; /**< handle to sub-core driver instance */
|
||||
XAxiVdma *VdmaPtr; /**< handle to sub-core driver instance */
|
||||
XV_letterbox *LboxPtr; /**< handle to sub-core driver instance */
|
||||
XV_csc *CscPtr; /**< handle to sub-core driver instance */
|
||||
XV_deinterlacer *DeintPtr; /**< handle to sub-core driver instance */
|
||||
|
||||
/**
|
||||
* Layer2 SW Register (Every Subsystem instance will have it's own copy
|
||||
of Layer 2 register bank for applicable sub-cores)
|
||||
*/
|
||||
XV_csc_L2Reg cscL2Reg; /**< Layer 2 register bank for csc sub-core */
|
||||
XV_vscaler_l2 vscL2Reg; /**< Layer 2 register bank for vsc sub-core */
|
||||
XV_hscaler_l2 hscL2Reg; /**< Layer 2 register bank for hsc sub-core */
|
||||
XV_hcresampler_l2 hcrL2Reg; /**< Layer 2 register bank for hcr sub-core */
|
||||
XV_vcresampler_l2 vcrInL2Reg; /**< Layer 2 register bank for hcr sub-core */
|
||||
XV_vcresampler_l2 vcrOutL2Reg; /**< Layer 2 register bank for hcr sub-core */
|
||||
XV_csc_L2Reg CscL2Reg; /**< Layer 2 register bank for csc sub-core */
|
||||
XV_vscaler_l2 VscL2Reg; /**< Layer 2 register bank for vsc sub-core */
|
||||
XV_hscaler_l2 HscL2Reg; /**< Layer 2 register bank for hsc sub-core */
|
||||
XV_hcresampler_l2 HcrL2Reg; /**< Layer 2 register bank for hcr sub-core */
|
||||
XV_vcresampler_l2 VcrInL2Reg; /**< Layer 2 register bank for hcr sub-core */
|
||||
XV_vcresampler_l2 VcrOutL2Reg; /**< Layer 2 register bank for hcr sub-core */
|
||||
|
||||
//I/O Streams
|
||||
XVidC_VideoStream VidIn; /**< Input AXIS configuration */
|
||||
XVidC_VideoStream VidOut; /**< Output AXIS configuration */
|
||||
|
||||
XVprocss_IData idata; /**< Internal Scratch pad memory for subsystem
|
||||
XVprocSs_ContextData CtxtData; /**< Internal Scratch pad memory for subsystem
|
||||
instance */
|
||||
u32 FrameBufBaseaddr; /**< Base address for frame buffer storage */
|
||||
|
||||
XVidC_DelayHandler UsrDelayUs; /**< custom user function for delay/sleep */
|
||||
void *pUsrTmr; /**< handle to timer instance used by user
|
||||
void *UsrTmrPtr; /**< handle to timer instance used by user
|
||||
delay function */
|
||||
} XVprocss;
|
||||
} XVprocSs;
|
||||
|
||||
/************************** Macros Definitions *******************************/
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro checks if subsystem is in Maximum configuration mode
|
||||
*
|
||||
* @param pVprocss is a pointer to the Video Processing subsystem instance
|
||||
* @param XVprocSsPtr is a pointer to the Video Processing subsystem instance
|
||||
* @return Return 1 if condition is TRUE or 0 if FALSE
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_IsConfigModeMax(pVprocss) \
|
||||
((pVprocss)->Config.Topology == XVPROCSS_TOPOLOGY_FULL_FLEDGED)
|
||||
#define XVprocSs_IsConfigModeMax(XVprocSsPtr) \
|
||||
((XVprocSsPtr)->Config.Topology == XVPROCSS_TOPOLOGY_FULL_FLEDGED)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro checks if subsystem configuration is in Stream Mode (Scaler Only)
|
||||
*
|
||||
* @param pVprocss is pointer to the Video Processing subsystem instance
|
||||
* @param XVprocSsPtr is pointer to the Video Processing subsystem instance
|
||||
*
|
||||
* @return Returns 1 if condition is TRUE or 0 if FALSE
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_IsConfigModeSscalerOnly(pVprocss) \
|
||||
((pVprocss)->Config.Topology == XVPROCSS_TOPOLOGY_SCALER_ONLY)
|
||||
#define XVprocSs_IsConfigModeSscalerOnly(XVprocSsPtr) \
|
||||
((XVprocSsPtr)->Config.Topology == XVPROCSS_TOPOLOGY_SCALER_ONLY)
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -411,55 +408,57 @@ typedef struct
|
|||
* This macro returns the current state of PIP Mode stored in subsystem internal
|
||||
* scratch pad memory
|
||||
*
|
||||
* @param pVprocss is a pointer to the Video Processing subsystem instance
|
||||
* @param XVprocSsPtr is a pointer to the Video Processing subsystem instance
|
||||
*
|
||||
* @return Returns 1 if PIP mode is ON or 0 if OFF
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_IsPipModeOn(pVprocss) ((pVprocss)->idata.PipEn)
|
||||
#define XVprocSs_IsPipModeOn(XVprocSsPtr) ((XVprocSsPtr)->CtxtData.PipEn)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro returns the current state of Zoom Mode stored in subsystem internal
|
||||
* scratch pad memory
|
||||
*
|
||||
* @param pVprocss is a pointer to the Video Processing subsystem instance
|
||||
* @param XVprocSsPtr is a pointer to the Video Processing subsystem instance
|
||||
*
|
||||
* @return Returns 1 if ZOOM mode is ON or 0 if OFF
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_IsZoomModeOn(pVprocss) ((pVprocss)->idata.ZoomEn)
|
||||
#define XVprocSs_IsZoomModeOn(XVprocSsPtr) ((XVprocSsPtr)->CtxtData.ZoomEn)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro clears the PIP mode flag stored in subsystem internal scratch
|
||||
* pad memory. This call has no side-effect
|
||||
*
|
||||
* @param pVprocss is a pointer to the Video Processing subsystem instance
|
||||
* @param XVprocSsPtr is a pointer to the Video Processing subsystem instance
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_ResetPipModeFlag(pVprocss) ((pVprocss)->idata.PipEn = FALSE)
|
||||
#define XVprocSs_ResetPipModeFlag(XVprocSsPtr) \
|
||||
((XVprocSsPtr)->CtxtData.PipEn = FALSE)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro clears the ZOOM mode flag stored in subsystem internal scratch
|
||||
* pad memory. This call has no side-effect
|
||||
*
|
||||
* @param pVprocss is pointer to the Video Processing subsystem instance
|
||||
* @param XVprocSsPtr is pointer to the Video Processing subsystem instance
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_ResetZoomModeFlag(pVprocss) ((pVprocss)->idata.ZoomEn = FALSE)
|
||||
#define XVprocSs_ResetZoomModeFlag(XVprocSsPtr) \
|
||||
((XVprocSsPtr)->CtxtData.ZoomEn = FALSE)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro sets the specified stream's color format. It can be used to
|
||||
* update input or output stream. This call has no side-effect in isolation.
|
||||
* For change to take effect user must trigger processing path reconfiguration
|
||||
* by calling XVprocss_ConfigureSubsystem()
|
||||
* by calling XVprocSs_ConfigureSubsystem()
|
||||
*
|
||||
* @param Stream is a pointer to the Subsystem Input or Output Stream
|
||||
* @param ColorFormat is the requested color format
|
||||
|
@ -467,15 +466,15 @@ typedef struct
|
|||
* @return None
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_SetStreamColorFormat(Stream, ColorFormat) \
|
||||
((Stream)->ColorFormatId = ColorFormat)
|
||||
#define XVprocSs_SetStreamColorFormat(Stream, ColorFormat) \
|
||||
((Stream)->ColorFormatId = ColorFormat)
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This macro sets the specified stream's color depth. It can be used to update
|
||||
* input or output stream. This call has no side-effect in isolation
|
||||
* For change to take effect user must trigger processing path reconfiguration
|
||||
* by calling XVprocss_ConfigureSubsystem()
|
||||
* by calling XVprocSs_ConfigureSubsystem()
|
||||
*
|
||||
* @param Stream is a pointer to the Subsystem Input or Output Stream
|
||||
* @param ColorDepth is the requested color depth
|
||||
|
@ -483,48 +482,46 @@ typedef struct
|
|||
* @return None
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define XVprocss_SetStreamColorDepth(Stream, ColorDepth) \
|
||||
((Stream)->ColorDepth = ColorDepth)
|
||||
#define XVprocSs_SetStreamColorDepth(Stream, ColorDepth) \
|
||||
((Stream)->ColorDepth = ColorDepth)
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
XVprocss_Config* XVprocss_LookupConfig(u32 DeviceId);
|
||||
void XVprocss_SetFrameBufBaseaddr(XVprocss *InstancePtr, u32 addr);
|
||||
int XVprocss_CfgInitialize(XVprocss *InstancePtr,
|
||||
XVprocss_Config *CfgPtr,
|
||||
void XVprocSs_SetFrameBufBaseaddr(XVprocSs *InstancePtr, u32 addr);
|
||||
|
||||
XVprocSs_Config* XVprocSs_LookupConfig(u32 DeviceId);
|
||||
int XVprocSs_CfgInitialize(XVprocSs *InstancePtr,
|
||||
XVprocSs_Config *CfgPtr,
|
||||
u32 EffectiveAddr);
|
||||
int XVprocss_PowerOnInit(XVprocss *InstancePtr, u32 DeviceId);
|
||||
void XVprocss_Start(XVprocss *InstancePtr);
|
||||
void XVprocss_Stop(XVprocss *InstancePtr);
|
||||
void XVprocss_Reset(XVprocss *InstancePtr);
|
||||
int XVprocss_SetVidStreamIn(XVprocss *InstancePtr,
|
||||
|
||||
void XVprocSs_Start(XVprocSs *InstancePtr);
|
||||
void XVprocSs_Stop(XVprocSs *InstancePtr);
|
||||
void XVprocSs_Reset(XVprocSs *InstancePtr);
|
||||
int XVprocSs_SetVidStreamIn(XVprocSs *InstancePtr,
|
||||
const XVidC_VideoStream *StrmIn);
|
||||
int XVprocss_SetVidStreamOut(XVprocss *InstancePtr,
|
||||
int XVprocSs_SetVidStreamOut(XVprocSs *InstancePtr,
|
||||
const XVidC_VideoStream *StrmOut);
|
||||
int XVprocss_SetStreamResolution(XVidC_VideoStream *StreamPtr,
|
||||
int XVprocSs_SetStreamResolution(XVidC_VideoStream *StreamPtr,
|
||||
const XVidC_VideoMode VmId);
|
||||
void XVprocss_ReportCoreInfo(XVprocss *InstancePtr);
|
||||
void XVprocss_ReportSubsystemConfig(XVprocss *InstancePtr);
|
||||
int XVprocss_SetSubsystemConfig(XVprocss *InstancePtr);
|
||||
void XVprocss_SetZoomMode(XVprocss *InstancePtr, u8 OnOff);
|
||||
void XVprocss_SetPipMode(XVprocss *InstancePtr, u8 OnOff);
|
||||
|
||||
void XVprocss_SetZoomPipWindow(XVprocss *InstancePtr,
|
||||
XVprocss_Win mode,
|
||||
int XVprocSs_SetSubsystemConfig(XVprocSs *InstancePtr);
|
||||
void XVprocSs_SetZoomMode(XVprocSs *InstancePtr, u8 OnOff);
|
||||
void XVprocSs_SetPipMode(XVprocSs *InstancePtr, u8 OnOff);
|
||||
void XVprocSs_SetZoomPipWindow(XVprocSs *InstancePtr,
|
||||
XVprocSs_Win mode,
|
||||
XVidC_VideoWindow *win);
|
||||
void XVprocss_GetZoomPipWindow(XVprocss *InstancePtr,
|
||||
XVprocss_Win mode,
|
||||
void XVprocSs_GetZoomPipWindow(XVprocSs *InstancePtr,
|
||||
XVprocSs_Win mode,
|
||||
XVidC_VideoWindow *win);
|
||||
void XVprocSs_UpdateZoomPipWindow(XVprocSs *InstancePtr);
|
||||
|
||||
void XVprocss_UpdateZoomPipWindow(XVprocss *InstancePtr);
|
||||
|
||||
void XVprocss_RegisterDelayHandler(XVprocss *InstancePtr,
|
||||
XVidC_DelayHandler CallbackFunc,
|
||||
void *CallbackRef);
|
||||
void XVprocSs_SetUserTimerHandler(XVprocSs *InstancePtr,
|
||||
XVidC_DelayHandler CallbackFunc,
|
||||
void *CallbackRef);
|
||||
|
||||
void XVprocSs_ReportCoreInfo(XVprocSs *InstancePtr);
|
||||
void XVprocSs_ReportSubsystemConfig(XVprocSs *InstancePtr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* end of protection macro */
|
||||
/** @} */
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss_coreinit.c
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @addtogroup vprocss
|
||||
* @{
|
||||
* @details
|
||||
|
||||
* Video Processing Subsystem Sub-Cores initialization
|
||||
* The functions in this file provides an abstraction from the initialization
|
||||
|
@ -111,22 +112,22 @@ static int ComputeSubcoreAbsAddr(u32 subsys_baseaddr,
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitResetAxis(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitResetAxis(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XGpio_Config *pConfig;
|
||||
|
||||
if(pVprocss->rstAxis)
|
||||
if(XVprocSsPtr->RstAxisPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXIS Reset core.... \r\n");
|
||||
pConfig = XGpio_LookupConfig(pVprocss->Config.RstAxis.DeviceId);
|
||||
pConfig = XGpio_LookupConfig(XVprocSsPtr->Config.RstAxis.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Reset AXIS device not found\r\n");
|
||||
|
@ -135,10 +136,10 @@ int XVprocss_SubcoreInitResetAxis(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.RstAxis.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.RstAxis.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -147,7 +148,7 @@ int XVprocss_SubcoreInitResetAxis(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XGpio_CfgInitialize(pVprocss->rstAxis,
|
||||
status = XGpio_CfgInitialize(XVprocSsPtr->RstAxisPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -164,22 +165,22 @@ int XVprocss_SubcoreInitResetAxis(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitResetAximm(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XGpio_Config *pConfig;
|
||||
|
||||
if(pVprocss->rstAximm)
|
||||
if(XVprocSsPtr->RstAximmPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXI-MM Reset core.... \r\n");
|
||||
pConfig = XGpio_LookupConfig(pVprocss->Config.RstAximm .DeviceId);
|
||||
pConfig = XGpio_LookupConfig(XVprocSsPtr->Config.RstAximm .DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Reset AXI-MM device not found\r\n");
|
||||
|
@ -188,10 +189,10 @@ int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.RstAximm.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.RstAximm.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -200,7 +201,7 @@ int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XGpio_CfgInitialize(pVprocss->rstAximm,
|
||||
status = XGpio_CfgInitialize(XVprocSsPtr->RstAximmPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -217,22 +218,22 @@ int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitRouter(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitRouter(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XAxis_Switch_Config *pConfig;
|
||||
|
||||
if(pVprocss->router)
|
||||
if(XVprocSsPtr->RouterPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing AXIS Switch core.... \r\n");
|
||||
pConfig = XAxisScr_LookupConfig(pVprocss->Config.Router.DeviceId);
|
||||
pConfig = XAxisScr_LookupConfig(XVprocSsPtr->Config.Router.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: AXIS Switch device not found\r\n");
|
||||
|
@ -241,10 +242,10 @@ int XVprocss_SubcoreInitRouter(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Router.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Router.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -253,7 +254,7 @@ int XVprocss_SubcoreInitRouter(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XAxisScr_CfgInitialize(pVprocss->router,
|
||||
status = XAxisScr_CfgInitialize(XVprocSsPtr->RouterPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -270,22 +271,22 @@ int XVprocss_SubcoreInitRouter(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitCsc(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitCsc(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_csc_Config *pConfig;
|
||||
|
||||
if(pVprocss->csc)
|
||||
if(XVprocSsPtr->CscPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing CSC core.... \r\n");
|
||||
pConfig = XV_csc_LookupConfig(pVprocss->Config.Csc.DeviceId);
|
||||
pConfig = XV_csc_LookupConfig(XVprocSsPtr->Config.Csc.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: CSC device not found\r\n");
|
||||
|
@ -294,10 +295,10 @@ int XVprocss_SubcoreInitCsc(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Csc.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Csc.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -306,7 +307,7 @@ int XVprocss_SubcoreInitCsc(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_csc_CfgInitialize(pVprocss->csc,
|
||||
status = XV_csc_CfgInitialize(XVprocSsPtr->CscPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -324,22 +325,22 @@ int XVprocss_SubcoreInitCsc(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitHScaler(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_hscaler_Config *pConfig;
|
||||
|
||||
if(pVprocss->hscaler)
|
||||
if(XVprocSsPtr->HscalerPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Horiz. Scaler core.... \r\n");
|
||||
pConfig = XV_hscaler_LookupConfig(pVprocss->Config.Hscale.DeviceId);
|
||||
pConfig = XV_hscaler_LookupConfig(XVprocSsPtr->Config.Hscale.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Horiz. Scaler device not found\r\n");
|
||||
|
@ -348,10 +349,10 @@ int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Hscale.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Hscale.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -360,7 +361,7 @@ int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_hscaler_CfgInitialize(pVprocss->hscaler,
|
||||
status = XV_hscaler_CfgInitialize(XVprocSsPtr->HscalerPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -370,8 +371,11 @@ int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss)
|
|||
return(XST_FAILURE);
|
||||
}
|
||||
|
||||
/* Load Default filter coefficients */
|
||||
XV_HScalerLoadDefaultCoeff(pVprocss->hscaler, &pVprocss->hscL2Reg);
|
||||
if(XVprocSsPtr->HscalerPtr->Config.ScalerType == XV_HSCALER_POLYPHASE)
|
||||
{
|
||||
/* Load Default filter coefficients */
|
||||
XV_HScalerLoadDefaultCoeff(XVprocSsPtr->HscalerPtr, &XVprocSsPtr->HscL2Reg);
|
||||
}
|
||||
}
|
||||
return(XST_SUCCESS);
|
||||
}
|
||||
|
@ -380,22 +384,22 @@ int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitVScaler(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_vscaler_Config *pConfig;
|
||||
|
||||
if(pVprocss->vscaler)
|
||||
if(XVprocSsPtr->VscalerPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Vert. Scaler core.... \r\n");
|
||||
pConfig = XV_vscaler_LookupConfig(pVprocss->Config.Vscale.DeviceId);
|
||||
pConfig = XV_vscaler_LookupConfig(XVprocSsPtr->Config.Vscale.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Vert. Scaler device not found\r\n");
|
||||
|
@ -404,10 +408,10 @@ int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Vscale.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Vscale.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -416,7 +420,7 @@ int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_vscaler_CfgInitialize(pVprocss->vscaler,
|
||||
status = XV_vscaler_CfgInitialize(XVprocSsPtr->VscalerPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -426,8 +430,11 @@ int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss)
|
|||
return(XST_FAILURE);
|
||||
}
|
||||
|
||||
/* Load Default filter coefficients */
|
||||
XV_VScalerLoadDefaultCoeff(pVprocss->vscaler, &pVprocss->vscL2Reg);
|
||||
if(XVprocSsPtr->VscalerPtr->Config.ScalerType == XV_VSCALER_POLYPHASE)
|
||||
{
|
||||
/* Load Default filter coefficients */
|
||||
XV_VScalerLoadDefaultCoeff(XVprocSsPtr->VscalerPtr, &XVprocSsPtr->VscL2Reg);
|
||||
}
|
||||
|
||||
}
|
||||
return(XST_SUCCESS);
|
||||
|
@ -437,22 +444,22 @@ int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitHCrsmplr(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_hcresampler_Config *pConfig;
|
||||
|
||||
if(pVprocss->hcrsmplr)
|
||||
if(XVprocSsPtr->HcrsmplrPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing H Chroma Resampler core.... \r\n");
|
||||
pConfig = XV_hcresampler_LookupConfig(pVprocss->Config.HCrsmplr.DeviceId);
|
||||
pConfig = XV_hcresampler_LookupConfig(XVprocSsPtr->Config.HCrsmplr.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: H Chroma Resampler device not found\r\n");
|
||||
|
@ -461,10 +468,10 @@ int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.HCrsmplr.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.HCrsmplr.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -473,7 +480,7 @@ int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_hcresampler_CfgInitialize(pVprocss->hcrsmplr,
|
||||
status = XV_hcresampler_CfgInitialize(XVprocSsPtr->HcrsmplrPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -483,8 +490,11 @@ int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss)
|
|||
return(XST_FAILURE);
|
||||
}
|
||||
|
||||
/* Load default filter coefficients */
|
||||
XV_HCrsmplLoadDefaultCoeff(pVprocss->hcrsmplr, &pVprocss->hcrL2Reg);
|
||||
if(XVprocSsPtr->HcrsmplrPtr->Config.ResamplingType == XV_HCRSMPLR_TYPE_FIR)
|
||||
{
|
||||
/* Load default filter coefficients */
|
||||
XV_HCrsmplLoadDefaultCoeff(XVprocSsPtr->HcrsmplrPtr, &XVprocSsPtr->HcrL2Reg);
|
||||
}
|
||||
}
|
||||
return(XST_SUCCESS);
|
||||
}
|
||||
|
@ -493,22 +503,22 @@ int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitVCrsmpleIn(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_vcresampler_Config *pConfig;
|
||||
|
||||
if(pVprocss->vcrsmplrIn)
|
||||
if(XVprocSsPtr->VcrsmplrInPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Input V Chroma Resampler core.... \r\n");
|
||||
pConfig = XV_vcresampler_LookupConfig(pVprocss->Config.VCrsmplrIn.DeviceId);
|
||||
pConfig = XV_vcresampler_LookupConfig(XVprocSsPtr->Config.VCrsmplrIn.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Input V Chroma Resampler device not found\r\n");
|
||||
|
@ -517,10 +527,10 @@ int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.VCrsmplrIn.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.VCrsmplrIn.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -529,7 +539,7 @@ int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_vcresampler_CfgInitialize(pVprocss->vcrsmplrIn,
|
||||
status = XV_vcresampler_CfgInitialize(XVprocSsPtr->VcrsmplrInPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -539,8 +549,11 @@ int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss)
|
|||
return(XST_FAILURE);
|
||||
}
|
||||
|
||||
/* Load default filter coefficients */
|
||||
XV_VCrsmplLoadDefaultCoeff(pVprocss->vcrsmplrIn, &pVprocss->vcrInL2Reg);
|
||||
if(XVprocSsPtr->VcrsmplrInPtr->Config.ResamplingType == XV_VCRSMPLR_TYPE_FIR)
|
||||
{
|
||||
/* Load default filter coefficients */
|
||||
XV_VCrsmplLoadDefaultCoeff(XVprocSsPtr->VcrsmplrInPtr, &XVprocSsPtr->VcrInL2Reg);
|
||||
}
|
||||
}
|
||||
return(XST_SUCCESS);
|
||||
}
|
||||
|
@ -549,22 +562,22 @@ int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitVCrsmpleOut(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_vcresampler_Config *pConfig;
|
||||
|
||||
if(pVprocss->vcrsmplrOut)
|
||||
if(XVprocSsPtr->VcrsmplrOutPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Output V Chroma Resampler core.... \r\n");
|
||||
pConfig = XV_vcresampler_LookupConfig(pVprocss->Config.VCrsmplrOut.DeviceId);
|
||||
pConfig = XV_vcresampler_LookupConfig(XVprocSsPtr->Config.VCrsmplrOut.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Output V Chroma Resampler device not found\r\n");
|
||||
|
@ -573,10 +586,10 @@ int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.VCrsmplrOut.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.VCrsmplrOut.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -585,7 +598,7 @@ int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_vcresampler_CfgInitialize(pVprocss->vcrsmplrOut,
|
||||
status = XV_vcresampler_CfgInitialize(XVprocSsPtr->VcrsmplrOutPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -595,8 +608,11 @@ int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss)
|
|||
return(XST_FAILURE);
|
||||
}
|
||||
|
||||
/* Load default filter coefficients */
|
||||
XV_VCrsmplLoadDefaultCoeff(pVprocss->vcrsmplrOut, &pVprocss->vcrOutL2Reg);
|
||||
if(XVprocSsPtr->VcrsmplrOutPtr->Config.ResamplingType == XV_VCRSMPLR_TYPE_FIR)
|
||||
{
|
||||
/* Load default filter coefficients */
|
||||
XV_VCrsmplLoadDefaultCoeff(XVprocSsPtr->VcrsmplrOutPtr, &XVprocSsPtr->VcrOutL2Reg);
|
||||
}
|
||||
}
|
||||
return(XST_SUCCESS);
|
||||
}
|
||||
|
@ -605,22 +621,22 @@ int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitLetterbox(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_letterbox_Config *pConfig;
|
||||
|
||||
if(pVprocss->lbox)
|
||||
if(XVprocSsPtr->LboxPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Letterbox core.... \r\n");
|
||||
pConfig = XV_letterbox_LookupConfig(pVprocss->Config.Lbox.DeviceId);
|
||||
pConfig = XV_letterbox_LookupConfig(XVprocSsPtr->Config.Lbox.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Letterbox device not found\r\n");
|
||||
|
@ -629,10 +645,10 @@ int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Lbox.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Lbox.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -641,7 +657,7 @@ int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_letterbox_CfgInitialize(pVprocss->lbox,
|
||||
status = XV_letterbox_CfgInitialize(XVprocSsPtr->LboxPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -658,22 +674,22 @@ int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitVdma(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitVdma(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XAxiVdma_Config *pConfig;
|
||||
|
||||
if(pVprocss->vdma)
|
||||
if(XVprocSsPtr->VdmaPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing VDMA core.... \r\n");
|
||||
pConfig = XAxiVdma_LookupConfig(pVprocss->Config.Vdma.DeviceId);
|
||||
pConfig = XAxiVdma_LookupConfig(XVprocSsPtr->Config.Vdma.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: VDMA device not found\r\n");
|
||||
|
@ -682,10 +698,10 @@ int XVprocss_SubcoreInitVdma(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Vdma.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Vdma.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -694,7 +710,7 @@ int XVprocss_SubcoreInitVdma(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XAxiVdma_CfgInitialize(pVprocss->vdma,
|
||||
status = XAxiVdma_CfgInitialize(XVprocSsPtr->VdmaPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
@ -711,22 +727,22 @@ int XVprocss_SubcoreInitVdma(XVprocss *pVprocss)
|
|||
/**
|
||||
* This function initializes the included sub-core to it's static configuration
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS/XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_SubcoreInitDeinterlacer(XVprocss *pVprocss)
|
||||
int XVprocSs_SubcoreInitDeinterlacer(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
u32 AbsAddr;
|
||||
XV_deinterlacer_Config *pConfig;
|
||||
|
||||
if(pVprocss->deint)
|
||||
if(XVprocSsPtr->DeintPtr)
|
||||
{
|
||||
/* Get core configuration */
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Initializing Deinterlacer core.... \r\n");
|
||||
pConfig = XV_deinterlacer_LookupConfig(pVprocss->Config.Deint.DeviceId);
|
||||
pConfig = XV_deinterlacer_LookupConfig(XVprocSsPtr->Config.Deint.DeviceId);
|
||||
if(pConfig == NULL)
|
||||
{
|
||||
xil_printf("VPROCSS ERR:: Deinterlacer device not found\r\n");
|
||||
|
@ -735,10 +751,10 @@ int XVprocss_SubcoreInitDeinterlacer(XVprocss *pVprocss)
|
|||
|
||||
/* Compute absolute base address */
|
||||
AbsAddr = 0;
|
||||
status = ComputeSubcoreAbsAddr(pVprocss->Config.BaseAddress,
|
||||
pVprocss->Config.HighAddress,
|
||||
pVprocss->Config.Deint.AddrOffset,
|
||||
&AbsAddr);
|
||||
status = ComputeSubcoreAbsAddr(XVprocSsPtr->Config.BaseAddress,
|
||||
XVprocSsPtr->Config.HighAddress,
|
||||
XVprocSsPtr->Config.Deint.AddrOffset,
|
||||
&AbsAddr);
|
||||
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
|
@ -747,7 +763,7 @@ int XVprocss_SubcoreInitDeinterlacer(XVprocss *pVprocss)
|
|||
}
|
||||
|
||||
/* Initialize core */
|
||||
status = XV_deinterlacer_CfgInitialize(pVprocss->deint,
|
||||
status = XV_deinterlacer_CfgInitialize(XVprocSsPtr->DeintPtr,
|
||||
pConfig,
|
||||
AbsAddr);
|
||||
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss_coreinit.h
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @addtogroup vprocss
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This header file contains the video processing engine sub-cores
|
||||
* initialization routines and helper functions.
|
||||
|
@ -60,18 +61,18 @@ extern "C" {
|
|||
/************************** Constant Definitions *****************************/
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
int XVprocss_SubcoreInitResetAxis(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitResetAximm(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitRouter(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitCsc(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitHScaler(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitVScaler(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitHCrsmplr(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitVCrsmpleIn(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitVCrsmpleOut(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitLetterbox(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitVdma(XVprocss *pVprocss);
|
||||
int XVprocss_SubcoreInitDeinterlacer(XVprocss *pVprocss);
|
||||
int XVprocSs_SubcoreInitResetAxis(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitResetAximm(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitRouter(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitCsc(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitHScaler(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitVScaler(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitHCrsmplr(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitVCrsmpleIn(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitVCrsmpleOut(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitLetterbox(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitVdma(XVprocSs *XVprocSsPtr);
|
||||
int XVprocSs_SubcoreInitDeinterlacer(XVprocSs *XVprocSsPtr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -53,10 +53,11 @@
|
|||
#define XPAR_V_PROC_SS_0_V_HCRESAMPLER_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_HSCALER_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_LETTERBOX_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_VCRESAMPLER_IN_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_VCRESAMPLER_OUT_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_V_VSCALER_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_AXIS_SWITCH_PRESENT 1
|
||||
#define XPAR_V_PROC_SS_0_VIDEO_ROUTER_XBAR_PRESENT 1
|
||||
|
||||
|
||||
/*
|
||||
* List of Sub-cores excluded from the subsystem
|
||||
|
@ -67,7 +68,7 @@
|
|||
|
||||
|
||||
|
||||
XVprocss_Config XVprocss_ConfigTable[] =
|
||||
XVprocSs_Config XVprocSs_ConfigTable[] =
|
||||
{
|
||||
{
|
||||
XPAR_V_PROC_SS_0_DEVICE_ID,
|
||||
|
@ -96,9 +97,9 @@ XVprocss_Config XVprocss_ConfigTable[] =
|
|||
XPAR_V_PROC_SS_0_AXI_VDMA_BASEADDR
|
||||
},
|
||||
{
|
||||
XPAR_V_PROC_SS_0_AXIS_SWITCH_PRESENT,
|
||||
XPAR_V_PROC_SS_0_AXIS_SWITCH_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_AXIS_SWITCH_BASEADDR
|
||||
XPAR_V_PROC_SS_0_VIDEO_ROUTER_XBAR_PRESENT,
|
||||
XPAR_V_PROC_SS_0_VIDEO_ROUTER_XBAR_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_VIDEO_ROUTER_XBAR_BASEADDR
|
||||
},
|
||||
{
|
||||
XPAR_V_PROC_SS_0_V_CSC_PRESENT,
|
||||
|
@ -108,7 +109,7 @@ XVprocss_Config XVprocss_ConfigTable[] =
|
|||
{
|
||||
XPAR_V_PROC_SS_0_V_DEINTERLACER_PRESENT,
|
||||
XPAR_V_PROC_SS_0_V_DEINTERLACER_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_V_DEINTERLACER_S_AXI_AXILITES_BASEADDR
|
||||
XPAR_V_PROC_SS_0_V_DEINTERLACER_S_AXI_CTRL_BASEADDR
|
||||
},
|
||||
{
|
||||
XPAR_V_PROC_SS_0_V_HCRESAMPLER_PRESENT,
|
||||
|
@ -126,14 +127,14 @@ XVprocss_Config XVprocss_ConfigTable[] =
|
|||
XPAR_V_PROC_SS_0_V_LETTERBOX_S_AXI_CTRL_BASEADDR
|
||||
},
|
||||
{
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_PRESENT,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_0_S_AXI_CTRL_BASEADDR
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_IN_PRESENT,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_IN_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_IN_S_AXI_CTRL_BASEADDR
|
||||
},
|
||||
{
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_PRESENT,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_1_S_AXI_CTRL_BASEADDR
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_OUT_PRESENT,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_OUT_DEVICE_ID,
|
||||
XPAR_V_PROC_SS_0_V_VCRESAMPLER_OUT_S_AXI_CTRL_BASEADDR
|
||||
},
|
||||
{
|
||||
XPAR_V_PROC_SS_0_V_VSCALER_PRESENT,
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss_router.c
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @addtogroup vprocss
|
||||
* @{
|
||||
* @details
|
||||
|
||||
* Video buffer management routine.
|
||||
* The functions in this file provides an abstraction from the register peek/poke
|
||||
|
@ -65,7 +66,7 @@ static int validateWindowSize(const XVidC_VideoWindow *win,
|
|||
const u32 HActive,
|
||||
const u32 VActive);
|
||||
|
||||
static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss);
|
||||
static XVprocSs_ScaleMode GetScalingMode(XVprocSs *XVprocSsPtr);
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -73,7 +74,8 @@ static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss);
|
|||
* This function checks to make sure sub-frame is inside full frame
|
||||
*
|
||||
* @param win is a pointer to the sub-frame window
|
||||
* @param Resolution is a pointer to the current output resolution
|
||||
* @param HActive is frame width
|
||||
* @param VActive is frame height
|
||||
*
|
||||
* @return XST_SUCCESS if window is valid else XST_FAILURE
|
||||
*
|
||||
|
@ -109,27 +111,27 @@ static int validateWindowSize(const XVidC_VideoWindow *win,
|
|||
* This function computes the scaling mode based on input/output stream
|
||||
* resolution. It also accounts for Zoom or PIP mode, if enabled
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return Scaling mode Up/Dpwn or 1:1
|
||||
*
|
||||
******************************************************************************/
|
||||
static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss)
|
||||
static XVprocSs_ScaleMode GetScalingMode(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
int status;
|
||||
XVprocss_ScaleMode mode;
|
||||
XVprocSs_ScaleMode mode;
|
||||
XVidC_VideoWindow win;
|
||||
XVidC_VideoStream *pStrIn = &pVprocss->VidIn;
|
||||
XVidC_VideoStream *pStrOut = &pVprocss->VidOut;
|
||||
XVidC_VideoStream *StrmInPtr = &XVprocSsPtr->VidIn;
|
||||
XVidC_VideoStream *StrmOutPtr = &XVprocSsPtr->VidOut;
|
||||
|
||||
if(XVprocss_IsPipModeOn(pVprocss))
|
||||
if(XVprocSs_IsPipModeOn(XVprocSsPtr))
|
||||
{
|
||||
/* Read PIP window setting - set elsewhere */
|
||||
XVprocss_GetZoomPipWindow(pVprocss, XVPROCSS_PIP_WIN, &win);
|
||||
XVprocSs_GetZoomPipWindow(XVprocSsPtr, XVPROCSS_PIP_WIN, &win);
|
||||
/* validate window */
|
||||
status = validateWindowSize(&win,
|
||||
pVprocss->VidOut.Timing.HActive,
|
||||
pVprocss->VidOut.Timing.VActive);
|
||||
XVprocSsPtr->VidOut.Timing.HActive,
|
||||
XVprocSsPtr->VidOut.Timing.VActive);
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: VDMA Write Channel Window Invalid \r\n");
|
||||
|
@ -138,23 +140,23 @@ static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss)
|
|||
else
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"\r\n PIP Mode ON: Scale %dx%d -> %dx%d window in output stream\r\n",
|
||||
pStrIn->Timing.HActive,
|
||||
pStrIn->Timing.VActive,
|
||||
pVprocss->idata.wrWindow.Width,
|
||||
pVprocss->idata.wrWindow.Height);
|
||||
StrmInPtr->Timing.HActive,
|
||||
StrmInPtr->Timing.VActive,
|
||||
XVprocSsPtr->CtxtData.WrWindow.Width,
|
||||
XVprocSsPtr->CtxtData.WrWindow.Height);
|
||||
|
||||
return(XVPROCSS_SCALE_DN);
|
||||
}
|
||||
}
|
||||
|
||||
if(XVprocss_IsZoomModeOn(pVprocss))
|
||||
if(XVprocSs_IsZoomModeOn(XVprocSsPtr))
|
||||
{
|
||||
/* Read PIP window setting - set elsewhere */
|
||||
XVprocss_GetZoomPipWindow(pVprocss, XVPROCSS_ZOOM_WIN, &win);
|
||||
XVprocSs_GetZoomPipWindow(XVprocSsPtr, XVPROCSS_ZOOM_WIN, &win);
|
||||
/* validate window */
|
||||
status = validateWindowSize(&win,
|
||||
pStrIn->Timing.HActive,
|
||||
pStrIn->Timing.VActive);
|
||||
StrmInPtr->Timing.HActive,
|
||||
StrmInPtr->Timing.VActive);
|
||||
if(status != XST_SUCCESS)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: VDMA Read Channel Window Invalid \r\n");
|
||||
|
@ -163,23 +165,23 @@ static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss)
|
|||
else
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"\r\n Zoom Mode ON: Scale %dx%d window from Input Stream -> %dx%d\r\n",
|
||||
pVprocss->idata.rdWindow.Width,
|
||||
pVprocss->idata.rdWindow.Height,
|
||||
pStrOut->Timing.HActive,
|
||||
pStrOut->Timing.VActive);
|
||||
XVprocSsPtr->CtxtData.RdWindow.Width,
|
||||
XVprocSsPtr->CtxtData.RdWindow.Height,
|
||||
StrmOutPtr->Timing.HActive,
|
||||
StrmOutPtr->Timing.VActive);
|
||||
|
||||
return (XVPROCSS_SCALE_UP);
|
||||
}
|
||||
}
|
||||
|
||||
/* Pip & Zoom mode are off. Check input/output resolution */
|
||||
if((pStrIn->Timing.HActive > pStrOut->Timing.HActive) ||
|
||||
(pStrIn->Timing.VActive > pStrOut->Timing.VActive))
|
||||
if((StrmInPtr->Timing.HActive > StrmOutPtr->Timing.HActive) ||
|
||||
(StrmInPtr->Timing.VActive > StrmOutPtr->Timing.VActive))
|
||||
{
|
||||
mode = XVPROCSS_SCALE_DN;
|
||||
}
|
||||
else if((pStrIn->Timing.HActive < pStrOut->Timing.HActive) ||
|
||||
(pStrIn->Timing.VActive < pStrOut->Timing.VActive))
|
||||
else if((StrmInPtr->Timing.HActive < StrmOutPtr->Timing.HActive) ||
|
||||
(StrmInPtr->Timing.VActive < StrmOutPtr->Timing.VActive))
|
||||
{
|
||||
mode = XVPROCSS_SCALE_UP;
|
||||
}
|
||||
|
@ -196,12 +198,12 @@ static XVprocss_ScaleMode GetScalingMode(XVprocss *pVprocss)
|
|||
* builds a routing table for the supported use-case. The computed routing
|
||||
* table is stored in the scratch pad memory
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return XST_SUCCESS if routing table can be created else XST_FAILURE
|
||||
*
|
||||
******************************************************************************/
|
||||
int XVprocss_BuildRoutingTable(XVprocss *pVprocss)
|
||||
int XVprocSs_BuildRoutingTable(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
const char *ipStr[XVPROCSS_RTR_MAX] =
|
||||
|
@ -220,68 +222,68 @@ int XVprocss_BuildRoutingTable(XVprocss *pVprocss)
|
|||
#endif
|
||||
|
||||
u32 index = 0;
|
||||
XVidC_VideoStream *pStrIn = &pVprocss->VidIn;
|
||||
XVidC_VideoStream *pStrOut = &pVprocss->VidOut;
|
||||
XVprocss_IData *pCfg = &pVprocss->idata;
|
||||
u8 *pTable = &pVprocss->idata.RtngTable[0];
|
||||
XVidC_VideoStream *StrmInPtr = &XVprocSsPtr->VidIn;
|
||||
XVidC_VideoStream *StrmOutPtr = &XVprocSsPtr->VidOut;
|
||||
XVprocSs_ContextData *CtxtPtr = &XVprocSsPtr->CtxtData;
|
||||
u8 *pTable = &XVprocSsPtr->CtxtData.RtngTable[0];
|
||||
int status = XST_SUCCESS;
|
||||
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," ->Build AXIS Routing Map for Subsystem Use-Case.... \r\n");
|
||||
|
||||
/* Save input resolution */
|
||||
pCfg->vidInWidth = pStrIn->Timing.HActive;
|
||||
pCfg->vidInHeight = pStrIn->Timing.VActive;
|
||||
pCfg->strmCformat = pStrIn->ColorFormatId;
|
||||
CtxtPtr->VidInWidth = StrmInPtr->Timing.HActive;
|
||||
CtxtPtr->VidInHeight = StrmInPtr->Timing.VActive;
|
||||
CtxtPtr->StrmCformat = StrmInPtr->ColorFormatId;
|
||||
|
||||
/* Determine Scaling Mode */
|
||||
pCfg->memEn = FALSE;
|
||||
pCfg->ScaleMode = GetScalingMode(pVprocss);
|
||||
if(pCfg->ScaleMode == XVPROCSS_SCALE_NOT_SUPPORTED)
|
||||
CtxtPtr->MemEn = FALSE;
|
||||
CtxtPtr->ScaleMode = GetScalingMode(XVprocSsPtr);
|
||||
if(CtxtPtr->ScaleMode == XVPROCSS_SCALE_NOT_SUPPORTED)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Scaling Mode not supported\r\n");
|
||||
return(XST_FAILURE);
|
||||
}
|
||||
|
||||
/* Reset Routing Table */
|
||||
memset(pTable, 0, sizeof(pCfg->RtngTable));
|
||||
memset(pTable, 0, sizeof(CtxtPtr->RtngTable));
|
||||
|
||||
/* Check if input is I/P */
|
||||
if(pStrIn->IsInterlaced)
|
||||
if(StrmInPtr->IsInterlaced)
|
||||
{
|
||||
pTable[index++] = XVPROCSS_RTR_DEINT;
|
||||
}
|
||||
|
||||
/* Check if input is 420 */
|
||||
if(pStrIn->ColorFormatId == XVIDC_CSF_YCRCB_420)
|
||||
if(StrmInPtr->ColorFormatId == XVIDC_CSF_YCRCB_420)
|
||||
{
|
||||
//up-sample vertically to 422 as none of the IP supports 420
|
||||
pTable[index++] = XVPROCSS_RTR_CR_V_IN;
|
||||
pCfg->strmCformat = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->StrmCformat = XVIDC_CSF_YCRCB_422;
|
||||
}
|
||||
|
||||
switch(pCfg->ScaleMode)
|
||||
switch(CtxtPtr->ScaleMode)
|
||||
{
|
||||
case XVPROCSS_SCALE_1_1:
|
||||
pTable[index++] = XVPROCSS_RTR_VDMA;
|
||||
pCfg->memEn = TRUE;
|
||||
CtxtPtr->MemEn = TRUE;
|
||||
break;
|
||||
|
||||
case XVPROCSS_SCALE_UP:
|
||||
pTable[index++] = XVPROCSS_RTR_VDMA; /* VDMA is before Scaler */
|
||||
pTable[index++] = XVPROCSS_RTR_SCALER_V;
|
||||
pTable[index++] = XVPROCSS_RTR_SCALER_H;
|
||||
pCfg->memEn = TRUE;
|
||||
CtxtPtr->MemEn = TRUE;
|
||||
break;
|
||||
|
||||
case XVPROCSS_SCALE_DN:
|
||||
pTable[index++] = XVPROCSS_RTR_SCALER_H;
|
||||
pTable[index++] = XVPROCSS_RTR_SCALER_V;
|
||||
pTable[index++] = XVPROCSS_RTR_VDMA; /* VDMA is after Scaler */
|
||||
pCfg->memEn = TRUE;
|
||||
CtxtPtr->MemEn = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Scaling Mode cannot be determined.\r\n");
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Scaling Mode cannot be determined.\r\n");
|
||||
return(XST_FAILURE);
|
||||
break;
|
||||
}
|
||||
|
@ -290,37 +292,37 @@ int XVprocss_BuildRoutingTable(XVprocss *pVprocss)
|
|||
pTable[index++] = XVPROCSS_RTR_LBOX;
|
||||
|
||||
/* Check for input and output color format to derive required conversions */
|
||||
switch(pStrOut->ColorFormatId)
|
||||
switch(StrmOutPtr->ColorFormatId)
|
||||
{
|
||||
case XVIDC_CSF_YCRCB_420:
|
||||
switch(pStrIn->ColorFormatId)
|
||||
switch(StrmInPtr->ColorFormatId)
|
||||
{
|
||||
case XVIDC_CSF_RGB:
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //convert RGB->444
|
||||
pTable[index++] = XVPROCSS_RTR_CR_H; //convert 444->422
|
||||
pTable[index++] = XVPROCSS_RTR_CR_V_OUT; //convert 422->420
|
||||
pCfg->cscIn = XVIDC_CSF_RGB;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrOut = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_RGB;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrOut = XVIDC_CSF_YCRCB_422;
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_444:
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //picture control in 444
|
||||
pTable[index++] = XVPROCSS_RTR_CR_H; //convert 444->422
|
||||
pTable[index++] = XVPROCSS_RTR_CR_V_OUT; //convert 422->420
|
||||
pCfg->cscIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrOut = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrOut = XVIDC_CSF_YCRCB_422;
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_422:
|
||||
case XVIDC_CSF_YCRCB_420: //Input was up converted to 422
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //picture control in 422
|
||||
pTable[index++] = XVPROCSS_RTR_CR_V_OUT; //convert 422->420
|
||||
pCfg->cscIn = XVIDC_CSF_YCRCB_422;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_422;
|
||||
break;
|
||||
|
||||
default: //Unsupported color format
|
||||
|
@ -331,89 +333,89 @@ int XVprocss_BuildRoutingTable(XVprocss *pVprocss)
|
|||
break;
|
||||
|
||||
case XVIDC_CSF_RGB:
|
||||
switch(pStrIn->ColorFormatId)
|
||||
switch(StrmInPtr->ColorFormatId)
|
||||
{
|
||||
case XVIDC_CSF_RGB:
|
||||
case XVIDC_CSF_YCRCB_444: //convert 444->RGB
|
||||
pTable[index++] = XVPROCSS_RTR_CSC;
|
||||
pCfg->cscIn = pStrIn->ColorFormatId;
|
||||
pCfg->cscOut = XVIDC_CSF_RGB;
|
||||
CtxtPtr->CscIn = StrmInPtr->ColorFormatId;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_RGB;
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_422:
|
||||
case XVIDC_CSF_YCRCB_420: //Input was up converted to 422
|
||||
pTable[index++] = XVPROCSS_RTR_CR_H; //convert 422->444
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //convert 444->RGB
|
||||
pCfg->hcrIn = XVIDC_CSF_YCRCB_422;
|
||||
pCfg->hcrOut = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->cscIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->cscOut = XVIDC_CSF_RGB;
|
||||
CtxtPtr->HcrIn = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->HcrOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_RGB;
|
||||
break;
|
||||
|
||||
default: //Unsupported color format
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Input Color Format Not Supported \r\n");
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Input Color Format Not Supported \r\n");
|
||||
status = XST_FAILURE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_422:
|
||||
switch(pStrIn->ColorFormatId)
|
||||
switch(StrmInPtr->ColorFormatId)
|
||||
{
|
||||
case XVIDC_CSF_RGB:
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //convert RGB->444
|
||||
pTable[index++] = XVPROCSS_RTR_CR_H; //convert 444->422
|
||||
pCfg->cscIn = XVIDC_CSF_RGB;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrOut = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_RGB;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrOut = XVIDC_CSF_YCRCB_422;
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_444:
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //picture control in 444
|
||||
pTable[index++] = XVPROCSS_RTR_CR_H; //convert 444->422
|
||||
pCfg->cscIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->hcrOut = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrOut = XVIDC_CSF_YCRCB_422;
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_422:
|
||||
case XVIDC_CSF_YCRCB_420: //Input was up converted to 422
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //picture control in 422
|
||||
pCfg->cscIn = XVIDC_CSF_YCRCB_422;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_422;
|
||||
break;
|
||||
|
||||
default: //Unsupported color format
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Input Color Format Not Supported \r\n");
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Input Color Format Not Supported \r\n");
|
||||
status = XST_FAILURE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_444:
|
||||
switch(pStrIn->ColorFormatId)
|
||||
switch(StrmInPtr->ColorFormatId)
|
||||
{
|
||||
case XVIDC_CSF_RGB: //convert 444->RGB
|
||||
case XVIDC_CSF_YCRCB_444:
|
||||
pTable[index++] = XVPROCSS_RTR_CSC;
|
||||
pCfg->cscIn = pStrIn->ColorFormatId;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscIn = StrmInPtr->ColorFormatId;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_444;
|
||||
break;
|
||||
|
||||
case XVIDC_CSF_YCRCB_422:
|
||||
case XVIDC_CSF_YCRCB_420: //Input was up converted to 422
|
||||
pTable[index++] = XVPROCSS_RTR_CR_H; //convert 422->444
|
||||
pTable[index++] = XVPROCSS_RTR_CSC; //picture control
|
||||
pCfg->hcrIn = XVIDC_CSF_YCRCB_422;
|
||||
pCfg->hcrOut = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->cscIn = XVIDC_CSF_YCRCB_444;
|
||||
pCfg->cscOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->HcrIn = XVIDC_CSF_YCRCB_422;
|
||||
CtxtPtr->HcrOut = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscIn = XVIDC_CSF_YCRCB_444;
|
||||
CtxtPtr->CscOut = XVIDC_CSF_YCRCB_444;
|
||||
break;
|
||||
|
||||
default: //Unsupported color format
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Input Color Format Not Supported \r\n");
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Input Color Format Not Supported \r\n");
|
||||
status = XST_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
@ -429,7 +431,7 @@ int XVprocss_BuildRoutingTable(XVprocss *pVprocss)
|
|||
pTable[index++] = XVPROCSS_RTR_VIDOUT;
|
||||
|
||||
/* save number of cores in processing path */
|
||||
pCfg->RtrNumCores = index;
|
||||
CtxtPtr->RtrNumCores = index;
|
||||
|
||||
#ifdef DEBUG
|
||||
if(status == XST_SUCCESS)
|
||||
|
@ -455,36 +457,36 @@ int XVprocss_BuildRoutingTable(XVprocss *pVprocss)
|
|||
* switch registers, to route the stream through processing cores, in the order
|
||||
* defined in the routing map
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
******************************************************************************/
|
||||
void XVprocss_ProgRouterMux(XVprocss *pVprocss)
|
||||
void XVprocSs_ProgRouterMux(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
u32 count, nextMi, prevSi;
|
||||
u8 *pTable = &pVprocss->idata.RtngTable[0];
|
||||
u32 numProcElem = pVprocss->idata.RtrNumCores;
|
||||
u8 *pTable = &XVprocSsPtr->CtxtData.RtngTable[0];
|
||||
u32 numProcElem = XVprocSsPtr->CtxtData.RtrNumCores;
|
||||
|
||||
XAxisScr_RegUpdateDisable(pVprocss->router);
|
||||
XAxisScr_RegUpdateDisable(XVprocSsPtr->RouterPtr);
|
||||
|
||||
/* Disable all ports */
|
||||
XAxisScr_MiPortDisableAll(pVprocss->router);
|
||||
XAxisScr_MiPortDisableAll(XVprocSsPtr->RouterPtr);
|
||||
|
||||
/* Connect Input Stream to the 1st core in path */
|
||||
nextMi = prevSi = pTable[0];
|
||||
XAxisScr_MiPortEnable(pVprocss->router, nextMi, AXIS_SWITCH_VIDIN_S0);
|
||||
XAxisScr_MiPortEnable(XVprocSsPtr->RouterPtr, nextMi, AXIS_SWITCH_VIDIN_S0);
|
||||
|
||||
/* Traverse routing map and connect cores in the chain */
|
||||
for(count=1; count<numProcElem; ++count)
|
||||
{
|
||||
nextMi = pTable[count];
|
||||
XAxisScr_MiPortEnable(pVprocss->router, nextMi, prevSi);
|
||||
XAxisScr_MiPortEnable(XVprocSsPtr->RouterPtr, nextMi, prevSi);
|
||||
prevSi = nextMi;
|
||||
}
|
||||
|
||||
//Enable Router register update
|
||||
XAxisScr_RegUpdateEnable(pVprocss->router);
|
||||
XAxisScr_RegUpdateEnable(XVprocSsPtr->RouterPtr);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -494,119 +496,121 @@ void XVprocss_ProgRouterMux(XVprocss *pVprocss)
|
|||
* Each core in the processing path is marked and only marked cores are started
|
||||
* All remaining cores stay disabled
|
||||
*
|
||||
* @param pVprocss is a pointer to the Subsystem instance to be worked on.
|
||||
* @param XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
******************************************************************************/
|
||||
void XVprocss_SetupRouterDataFlow(XVprocss *pVprocss)
|
||||
void XVprocSs_SetupRouterDataFlow(XVprocSs *XVprocSsPtr)
|
||||
{
|
||||
XVidC_VideoWindow lboxWin;
|
||||
u32 vsc_WidthIn, vsc_HeightIn, vsc_HeightOut;
|
||||
u32 hsc_HeightIn, hsc_WidthIn, hsc_WidthOut;
|
||||
u32 count;
|
||||
XVprocss_IData *pCfg = &pVprocss->idata;
|
||||
u8 *pTable = &pVprocss->idata.RtngTable[0];
|
||||
u8 *pStartCore = &pVprocss->idata.startCore[0];
|
||||
XVprocSs_ContextData *CtxtPtr = &XVprocSsPtr->CtxtData;
|
||||
u8 *pTable = &XVprocSsPtr->CtxtData.RtngTable[0];
|
||||
u8 *StartCorePtr = &XVprocSsPtr->CtxtData.StartCore[0];
|
||||
|
||||
|
||||
vsc_WidthIn = vsc_HeightIn = vsc_HeightOut = 0;
|
||||
hsc_HeightIn = hsc_WidthIn = hsc_WidthOut = 0;
|
||||
|
||||
/* Program Video Pipe Sub-Cores */
|
||||
if(pVprocss->VidIn.IsInterlaced)
|
||||
if(XVprocSsPtr->VidIn.IsInterlaced)
|
||||
{
|
||||
/* Input will de-interlaced first. All downstream IP's work
|
||||
* with progressive frame. Adjust active height to reflect the
|
||||
* progressive frame to downstream cores
|
||||
*/
|
||||
pCfg->vidInHeight *= 2;
|
||||
CtxtPtr->VidInHeight *= 2;
|
||||
}
|
||||
|
||||
/* If Vdma is enabled, RD/WR Client needs to be programmed before Scaler */
|
||||
if((pVprocss->vdma) && (pCfg->memEn))
|
||||
if((XVprocSsPtr->VdmaPtr) && (CtxtPtr->MemEn))
|
||||
{
|
||||
switch(pCfg->ScaleMode)
|
||||
switch(CtxtPtr->ScaleMode)
|
||||
{
|
||||
case XVPROCSS_SCALE_1_1:
|
||||
case XVPROCSS_SCALE_UP:
|
||||
XVprocss_VdmaSetWinToUpScaleMode(pVprocss, XVPROCSS_VDMA_UPDATE_ALL_CH);
|
||||
XVprocSs_VdmaSetWinToUpScaleMode(XVprocSsPtr, XVPROCSS_VDMA_UPDATE_ALL_CH);
|
||||
break;
|
||||
|
||||
case XVPROCSS_SCALE_DN:
|
||||
XVprocss_VdmaSetWinToDnScaleMode(pVprocss, XVPROCSS_VDMA_UPDATE_ALL_CH);
|
||||
XVprocSs_VdmaSetWinToDnScaleMode(XVprocSsPtr, XVPROCSS_VDMA_UPDATE_ALL_CH);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
pStartCore[XVPROCSS_RTR_VDMA] = TRUE;
|
||||
StartCorePtr[XVPROCSS_RTR_VDMA] = TRUE;
|
||||
}
|
||||
|
||||
for(count=0; count<pCfg->RtrNumCores; ++count)
|
||||
for(count=0; count<CtxtPtr->RtrNumCores; ++count)
|
||||
{
|
||||
switch(pTable[count])
|
||||
{
|
||||
case XVPROCSS_RTR_SCALER_V:
|
||||
if(pVprocss->vscaler)
|
||||
if(XVprocSsPtr->VscalerPtr)
|
||||
{
|
||||
if(pCfg->ScaleMode == XVPROCSS_SCALE_DN)
|
||||
if(CtxtPtr->ScaleMode == XVPROCSS_SCALE_DN)
|
||||
{
|
||||
/* Downscale mode H Scaler is before V Scaler */
|
||||
vsc_WidthIn = hsc_WidthOut;
|
||||
vsc_HeightIn = hsc_HeightIn;
|
||||
vsc_HeightOut = ((XVprocss_IsPipModeOn(pVprocss)) ? pCfg->wrWindow.Height
|
||||
: pVprocss->VidOut.Timing.VActive);
|
||||
vsc_HeightOut = ((XVprocSs_IsPipModeOn(XVprocSsPtr)) ? CtxtPtr->WrWindow.Height
|
||||
: XVprocSsPtr->VidOut.Timing.VActive);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* UpScale mode V Scaler is before H Scaler */
|
||||
vsc_WidthIn = ((XVprocss_IsZoomModeOn(pVprocss)) ? pCfg->rdWindow.Width
|
||||
: pCfg->vidInWidth);
|
||||
vsc_HeightIn = ((XVprocss_IsZoomModeOn(pVprocss)) ? pCfg->rdWindow.Height
|
||||
: pCfg->vidInHeight);
|
||||
vsc_HeightOut = pVprocss->VidOut.Timing.VActive;
|
||||
vsc_WidthIn = ((XVprocSs_IsZoomModeOn(XVprocSsPtr)) ? CtxtPtr->RdWindow.Width
|
||||
: CtxtPtr->VidInWidth);
|
||||
vsc_HeightIn = ((XVprocSs_IsZoomModeOn(XVprocSsPtr)) ? CtxtPtr->RdWindow.Height
|
||||
: CtxtPtr->VidInHeight);
|
||||
vsc_HeightOut = XVprocSsPtr->VidOut.Timing.VActive;
|
||||
}
|
||||
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," -> Configure VScaler for %dx%d to %dx%d\r\n", \
|
||||
(int)vsc_WidthIn, (int)vsc_HeightIn, (int)vsc_WidthIn, (int)vsc_HeightOut);
|
||||
|
||||
XV_VScalerSetup(pVprocss->vscaler,
|
||||
&pVprocss->vscL2Reg,
|
||||
XV_VScalerSetup(XVprocSsPtr->VscalerPtr,
|
||||
&XVprocSsPtr->VscL2Reg,
|
||||
vsc_WidthIn,
|
||||
vsc_HeightIn,
|
||||
vsc_HeightOut);
|
||||
pStartCore[XVPROCSS_RTR_SCALER_V] = TRUE;
|
||||
StartCorePtr[XVPROCSS_RTR_SCALER_V] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVPROCSS_RTR_SCALER_H:
|
||||
if(pVprocss->hscaler)
|
||||
if(XVprocSsPtr->HscalerPtr)
|
||||
{
|
||||
if(pCfg->ScaleMode == XVPROCSS_SCALE_DN)
|
||||
if(CtxtPtr->ScaleMode == XVPROCSS_SCALE_DN)
|
||||
{
|
||||
/* Downscale mode H Scaler is before V Scaler */
|
||||
hsc_WidthIn = pCfg->vidInWidth;
|
||||
hsc_HeightIn = pCfg->vidInHeight;
|
||||
hsc_WidthOut = ((XVprocss_IsPipModeOn(pVprocss)) ? pCfg->wrWindow.Width
|
||||
: pVprocss->VidOut.Timing.HActive);
|
||||
hsc_WidthIn = CtxtPtr->VidInWidth;
|
||||
hsc_HeightIn = CtxtPtr->VidInHeight;
|
||||
hsc_WidthOut = ((XVprocSs_IsPipModeOn(XVprocSsPtr)) ? CtxtPtr->WrWindow.Width
|
||||
: XVprocSsPtr->VidOut.Timing.HActive);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Upscale mode V Scaler is before H Scaler */
|
||||
hsc_WidthIn = vsc_WidthIn;
|
||||
hsc_HeightIn = vsc_HeightOut;
|
||||
hsc_WidthOut = pVprocss->VidOut.Timing.HActive;
|
||||
hsc_WidthOut = XVprocSsPtr->VidOut.Timing.HActive;
|
||||
}
|
||||
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," -> Configure HScaler for %dx%d to %dx%d\r\n", \
|
||||
(int)hsc_WidthIn, (int)hsc_HeightIn, (int)hsc_WidthOut, (int)hsc_HeightIn);
|
||||
|
||||
XV_HScalerSetup(pVprocss->hscaler,
|
||||
&pVprocss->hscL2Reg,
|
||||
XV_HScalerSetup(XVprocSsPtr->HscalerPtr,
|
||||
&XVprocSsPtr->HscL2Reg,
|
||||
hsc_HeightIn,
|
||||
hsc_WidthIn,
|
||||
hsc_WidthOut,
|
||||
pVprocss->idata.strmCformat);
|
||||
pStartCore[XVPROCSS_RTR_SCALER_H] = TRUE;
|
||||
XVprocSsPtr->CtxtData.StrmCformat);
|
||||
StartCorePtr[XVPROCSS_RTR_SCALER_H] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -615,127 +619,127 @@ void XVprocss_SetupRouterDataFlow(XVprocss *pVprocss)
|
|||
break;
|
||||
|
||||
case XVPROCSS_RTR_LBOX:
|
||||
if(pVprocss->lbox)
|
||||
if(XVprocSsPtr->LboxPtr)
|
||||
{
|
||||
if(XVprocss_IsPipModeOn(pVprocss))
|
||||
if(XVprocSs_IsPipModeOn(XVprocSsPtr))
|
||||
{
|
||||
/* get the active window for lbox */
|
||||
lboxWin = pCfg->wrWindow;
|
||||
/* get the active window for Lbox */
|
||||
lboxWin = CtxtPtr->WrWindow;
|
||||
}
|
||||
else //Downscale - Read full image from VDMA
|
||||
{
|
||||
/* window is same as output resolution */
|
||||
lboxWin.StartX = 0;
|
||||
lboxWin.StartY = 0;
|
||||
lboxWin.Width = pVprocss->VidOut.Timing.HActive;
|
||||
lboxWin.Height = pVprocss->VidOut.Timing.VActive;
|
||||
lboxWin.Width = XVprocSsPtr->VidOut.Timing.HActive;
|
||||
lboxWin.Height = XVprocSsPtr->VidOut.Timing.VActive;
|
||||
}
|
||||
XV_LBoxSetActiveWin(pVprocss->lbox,
|
||||
XV_LBoxSetActiveWin(XVprocSsPtr->LboxPtr,
|
||||
&lboxWin,
|
||||
pVprocss->VidOut.Timing.HActive,
|
||||
pVprocss->VidOut.Timing.VActive);
|
||||
XVprocSsPtr->VidOut.Timing.HActive,
|
||||
XVprocSsPtr->VidOut.Timing.VActive);
|
||||
|
||||
/* set background to default color on pipe reset */
|
||||
XV_LboxSetBackgroundColor(pVprocss->lbox,
|
||||
XV_LboxSetBackgroundColor(XVprocSsPtr->LboxPtr,
|
||||
XLBOX_BKGND_BLACK,
|
||||
pVprocss->idata.strmCformat,
|
||||
pVprocss->VidOut.ColorDepth);
|
||||
XVprocSsPtr->CtxtData.StrmCformat,
|
||||
XVprocSsPtr->VidOut.ColorDepth);
|
||||
|
||||
pStartCore[XVPROCSS_RTR_LBOX] = TRUE;
|
||||
StartCorePtr[XVPROCSS_RTR_LBOX] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVPROCSS_RTR_CR_H:
|
||||
if(pVprocss->hcrsmplr)
|
||||
if(XVprocSsPtr->HcrsmplrPtr)
|
||||
{
|
||||
XV_HCrsmplSetActiveSize(pVprocss->hcrsmplr,
|
||||
pVprocss->VidOut.Timing.HActive,
|
||||
pVprocss->VidOut.Timing.VActive);
|
||||
XV_HCrsmplSetActiveSize(XVprocSsPtr->HcrsmplrPtr,
|
||||
XVprocSsPtr->VidOut.Timing.HActive,
|
||||
XVprocSsPtr->VidOut.Timing.VActive);
|
||||
|
||||
XV_HCrsmplSetFormat(pVprocss->hcrsmplr,
|
||||
&pVprocss->hcrL2Reg,
|
||||
pCfg->hcrIn,
|
||||
pCfg->hcrOut);
|
||||
pStartCore[XVPROCSS_RTR_CR_H] = TRUE;
|
||||
XV_HCrsmplSetFormat(XVprocSsPtr->HcrsmplrPtr,
|
||||
&XVprocSsPtr->HcrL2Reg,
|
||||
CtxtPtr->HcrIn,
|
||||
CtxtPtr->HcrOut);
|
||||
StartCorePtr[XVPROCSS_RTR_CR_H] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVPROCSS_RTR_CR_V_IN:
|
||||
if(pVprocss->vcrsmplrIn)
|
||||
if(XVprocSsPtr->VcrsmplrInPtr)
|
||||
{
|
||||
XV_VCrsmplSetActiveSize(pVprocss->vcrsmplrIn,
|
||||
pCfg->vidInWidth,
|
||||
pCfg->vidInHeight);
|
||||
XV_VCrsmplSetActiveSize(XVprocSsPtr->VcrsmplrInPtr,
|
||||
CtxtPtr->VidInWidth,
|
||||
CtxtPtr->VidInHeight);
|
||||
|
||||
XV_VCrsmplSetFormat(pVprocss->vcrsmplrIn,
|
||||
&pVprocss->vcrInL2Reg,
|
||||
XV_VCrsmplSetFormat(XVprocSsPtr->VcrsmplrInPtr,
|
||||
&XVprocSsPtr->VcrInL2Reg,
|
||||
XVIDC_CSF_YCRCB_420,
|
||||
XVIDC_CSF_YCRCB_422);
|
||||
pStartCore[XVPROCSS_RTR_CR_V_IN] = TRUE;
|
||||
StartCorePtr[XVPROCSS_RTR_CR_V_IN] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVPROCSS_RTR_CR_V_OUT:
|
||||
if(pVprocss->vcrsmplrOut)
|
||||
if(XVprocSsPtr->VcrsmplrOutPtr)
|
||||
{
|
||||
XV_VCrsmplSetActiveSize(pVprocss->vcrsmplrOut,
|
||||
pVprocss->VidOut.Timing.HActive,
|
||||
pVprocss->VidOut.Timing.VActive);
|
||||
XV_VCrsmplSetActiveSize(XVprocSsPtr->VcrsmplrOutPtr,
|
||||
XVprocSsPtr->VidOut.Timing.HActive,
|
||||
XVprocSsPtr->VidOut.Timing.VActive);
|
||||
|
||||
XV_VCrsmplSetFormat(pVprocss->vcrsmplrOut,
|
||||
&pVprocss->vcrOutL2Reg,
|
||||
XV_VCrsmplSetFormat(XVprocSsPtr->VcrsmplrOutPtr,
|
||||
&XVprocSsPtr->VcrOutL2Reg,
|
||||
XVIDC_CSF_YCRCB_422,
|
||||
XVIDC_CSF_YCRCB_420);
|
||||
pStartCore[XVPROCSS_RTR_CR_V_OUT] = TRUE;
|
||||
StartCorePtr[XVPROCSS_RTR_CR_V_OUT] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVPROCSS_RTR_CSC:
|
||||
if(pVprocss->csc)
|
||||
if(XVprocSsPtr->CscPtr)
|
||||
{
|
||||
XV_CscSetColorspace(pVprocss->csc,
|
||||
&pVprocss->cscL2Reg,
|
||||
pCfg->cscIn,
|
||||
pCfg->cscOut,
|
||||
pVprocss->cscL2Reg.StandardIn,
|
||||
pVprocss->cscL2Reg.StandardOut,
|
||||
pVprocss->cscL2Reg.OutputRange);
|
||||
XV_CscSetColorspace(XVprocSsPtr->CscPtr,
|
||||
&XVprocSsPtr->CscL2Reg,
|
||||
CtxtPtr->CscIn,
|
||||
CtxtPtr->CscOut,
|
||||
XVprocSsPtr->CscL2Reg.StandardIn,
|
||||
XVprocSsPtr->CscL2Reg.StandardOut,
|
||||
XVprocSsPtr->CscL2Reg.OutputRange);
|
||||
|
||||
XV_CscSetActiveSize(pVprocss->csc,
|
||||
pVprocss->VidOut.Timing.HActive,
|
||||
pVprocss->VidOut.Timing.VActive);
|
||||
XV_CscSetActiveSize(XVprocSsPtr->CscPtr,
|
||||
XVprocSsPtr->VidOut.Timing.HActive,
|
||||
XVprocSsPtr->VidOut.Timing.VActive);
|
||||
|
||||
pStartCore[XVPROCSS_RTR_CSC] = TRUE;
|
||||
StartCorePtr[XVPROCSS_RTR_CSC] = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XVPROCSS_RTR_DEINT:
|
||||
if(pVprocss->deint)
|
||||
if(XVprocSsPtr->DeintPtr)
|
||||
{
|
||||
xdbg_printf(XDBG_DEBUG_GENERAL," -> Configure Deinterlacer for %dx%d to %dx%d\r\n", \
|
||||
(int)pVprocss->VidIn.Timing.HActive,
|
||||
(int)pVprocss->VidIn.Timing.VActive,
|
||||
(int)pCfg->vidInWidth,
|
||||
(int)pCfg->vidInHeight);
|
||||
(int)XVprocSsPtr->VidIn.Timing.HActive,
|
||||
(int)XVprocSsPtr->VidIn.Timing.VActive,
|
||||
(int)CtxtPtr->VidInWidth,
|
||||
(int)CtxtPtr->VidInHeight);
|
||||
|
||||
XV_DeintSetFieldBuffers(pVprocss->deint,
|
||||
pCfg->deintBufAddr,
|
||||
pVprocss->VidIn.ColorFormatId);
|
||||
XV_DeintSetFieldBuffers(XVprocSsPtr->DeintPtr,
|
||||
CtxtPtr->DeintBufAddr,
|
||||
XVprocSsPtr->VidIn.ColorFormatId);
|
||||
|
||||
XV_deinterlacer_Set_width(pVprocss->deint,
|
||||
pCfg->vidInWidth);
|
||||
XV_deinterlacer_Set_width(XVprocSsPtr->DeintPtr,
|
||||
CtxtPtr->VidInWidth);
|
||||
|
||||
XV_deinterlacer_Set_height(pVprocss->deint,
|
||||
pVprocss->VidIn.Timing.VActive); //field height
|
||||
XV_deinterlacer_Set_height(XVprocSsPtr->DeintPtr,
|
||||
XVprocSsPtr->VidIn.Timing.VActive); //field height
|
||||
|
||||
XV_deinterlacer_Set_invert_field_id(pVprocss->deint, 0); //TBD
|
||||
pStartCore[XVPROCSS_RTR_DEINT] = TRUE;
|
||||
XV_deinterlacer_Set_invert_field_id(XVprocSsPtr->DeintPtr, 0); //TBD
|
||||
StartCorePtr[XVPROCSS_RTR_DEINT] = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Start all IP Blocks in the processing chain */
|
||||
XVprocss_Start(pVprocss);
|
||||
XVprocSs_Start(XVprocSsPtr);
|
||||
}
|
||||
/** @} */
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss_router.h
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @addtogroup vprocss
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This header file contains the video processing engine data flow setup
|
||||
* routines and helper functions.
|
||||
|
@ -60,9 +61,9 @@ extern "C" {
|
|||
/************************** Constant Definitions *****************************/
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
int XVprocss_BuildRoutingTable(XVprocss *pVprocss);
|
||||
void XVprocss_ProgRouterMux(XVprocss *pVprocss);
|
||||
void XVprocss_SetupRouterDataFlow(XVprocss *pVprocss);
|
||||
int XVprocSs_BuildRoutingTable(XVprocSs *XVprocSsPtr);
|
||||
void XVprocSs_ProgRouterMux(XVprocSs *XVprocSsPtr);
|
||||
void XVprocSs_SetupRouterDataFlow(XVprocSs *XVprocSsPtr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -33,8 +33,9 @@
|
|||
/**
|
||||
*
|
||||
* @file xvprocss_sinit.c
|
||||
* @addtogroup vprocss_v1_0
|
||||
* @addtogroup vprocss
|
||||
* @{
|
||||
* @details
|
||||
*
|
||||
* This file contains the implementation of the Video Processing Subsystem
|
||||
* driver's static initialization functionality.
|
||||
|
@ -66,12 +67,12 @@
|
|||
/************************** Function Prototypes ******************************/
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
extern XVprocss_Config XVprocss_ConfigTable[];
|
||||
extern XVprocSs_Config XVprocSs_ConfigTable[];
|
||||
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* This function looks for the device configuration based on the unique device
|
||||
* ID. The table XVprocss_ConfigTable[] contains the configuration information
|
||||
* ID. The table XVprocSs_ConfigTable[] contains the configuration information
|
||||
* for each instance of the device in the system.
|
||||
*
|
||||
* @param DeviceId is the unique device ID of the device being looked up
|
||||
|
@ -80,16 +81,16 @@ extern XVprocss_Config XVprocss_ConfigTable[];
|
|||
* given device ID, or NULL if no match is found
|
||||
*
|
||||
*******************************************************************************/
|
||||
XVprocss_Config* XVprocss_LookupConfig(u32 DeviceId)
|
||||
XVprocSs_Config* XVprocSs_LookupConfig(u32 DeviceId)
|
||||
{
|
||||
XVprocss_Config *CfgPtr = NULL;
|
||||
XVprocSs_Config *CfgPtr = NULL;
|
||||
u32 index;
|
||||
|
||||
for (index = 0U; index < (u32)XPAR_XVPROCSS_NUM_INSTANCES; index++)
|
||||
{
|
||||
if (XVprocss_ConfigTable[index].DeviceId == DeviceId)
|
||||
if (XVprocSs_ConfigTable[index].DeviceId == DeviceId)
|
||||
{
|
||||
CfgPtr = &XVprocss_ConfigTable[index];
|
||||
CfgPtr = &XVprocSs_ConfigTable[index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue