diff --git a/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl b/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl index 32996075..ef6327aa 100755 --- a/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl +++ b/XilinxProcessorIPLib/drivers/vprocss/data/vprocss.tcl @@ -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" diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c index 523b73ee..db80f815 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.c @@ -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); diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h index 83ac0610..6ce8a0a1 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/vdma/xvprocss_vdma.h @@ -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 } diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c index 441a49f3..06e643a7 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c @@ -33,8 +33,6 @@ /** * * @file xvprocss.c -* @addtogroup vprocss_v1_0 -* @{ * * This is main code of Xilinx Video Processing Subsystem device driver. * Please see xvprocss.h for more details of the driver. @@ -87,23 +85,23 @@ */ typedef struct { - XAxis_Switch router; - XGpio rstAxis; //Reset for IP's running at AXIS Clk - XGpio rstAximm; //Reset for IP's with AXI MM interface + XAxis_Switch Router; + XGpio RstAxis; //Reset for IP's running at AXIS Clk + XGpio RstAximm; //Reset for IP's with AXI MM interface - XV_hcresampler hcrsmplr; - XV_vcresampler vcrsmplrIn; - XV_vcresampler vcrsmplrOut; - XV_vscaler vscaler; - XV_hscaler hscaler; - XAxiVdma vdma; - XV_letterbox lbox; - XV_csc csc; - XV_deinterlacer deint; -}XVprocss_SubCores; + XV_hcresampler Hcrsmplr; + XV_vcresampler VcrsmplrIn; + XV_vcresampler VcrsmplrOut; + XV_vscaler Vscaler; + XV_hscaler Hscaler; + XAxiVdma Vdma; + XV_letterbox Lbox; + XV_csc Csc; + XV_deinterlacer Deint; +}XVprocSs_SubCores; /**************************** Local Global ***********************************/ -XVprocss_SubCores subcoreRepo; /**< Define Driver instance of all sub-core +XVprocSs_SubCores subcoreRepo; /**< Define Driver instance of all sub-core included in the design */ /** @name VDMA Alignment required step size @@ -120,7 +118,7 @@ XVprocss_SubCores subcoreRepo; /**< Define Driver instance of all sub-core * - Pixels/Clock = 1, 2, 4 * - Color Depth = 8, 10, 12, 16 (4 variations) */ -const u16 XVprocss_PixelHStep[XVIDC_PPC_NUM_SUPPORTED][4] = +const u16 XVprocSs_PixelHStep[XVIDC_PPC_NUM_SUPPORTED][4] = { {16, 4, 32, 8}, //XVIDC_PPC_1 {16, 4, 64, 16}, //XVIDC_PPC_2 @@ -128,13 +126,13 @@ const u16 XVprocss_PixelHStep[XVIDC_PPC_NUM_SUPPORTED][4] = }; /************************** Function Prototypes ******************************/ -static void SetPODConfiguration(XVprocss *pVprocss); -static void GetIncludedSubcores(XVprocss *pVprocss); -static int ValidateSubsystemConfig(XVprocss *InstancePtr); +static void SetPODConfiguration(XVprocSs *XVprocSsPtr); +static void GetIncludedSubcores(XVprocSs *XVprocSsPtr); +static int ValidateSubsystemConfig(XVprocSs *InstancePtr); static int ValidateScalerOnlyConfig(XVidC_VideoStream *pStrmIn, XVidC_VideoStream *pStrmOut); -static int SetupModeScalerOnly(XVprocss *pVprocss); -static int SetupModeMax(XVprocss *pVprocss); +static int SetupModeScalerOnly(XVprocSs *XVprocSsPtr); +static int SetupModeMax(XVprocSs *XVprocSsPtr); /***************** Macros (Inline Functions) Definitions *********************/ /*****************************************************************************/ @@ -149,7 +147,7 @@ static int SetupModeMax(XVprocss *pVprocss); * -0: Reset * ******************************************************************************/ -static __inline u32 XVprocss_GetResetState(XGpio *pReset, u32 channel) +static __inline u32 XVprocSs_GetResetState(XGpio *pReset, u32 channel) { return(XGpio_DiscreteRead(pReset, channel)); } @@ -167,13 +165,13 @@ static __inline u32 XVprocss_GetResetState(XGpio *pReset, u32 channel) * @note If reset block is not included in the subsystem instance function does * not do anything ******************************************************************************/ -static __inline void XVprocss_EnableBlock(XGpio *pReset, u32 channel, u32 ipBlock) +static __inline void XVprocSs_EnableBlock(XGpio *pReset, u32 channel, u32 ipBlock) { u32 val; if(pReset) { - val = XVprocss_GetResetState(pReset, channel); + val = XVprocSs_GetResetState(pReset, channel); val |= ipBlock; XGpio_DiscreteWrite(pReset, channel, val); } @@ -192,13 +190,13 @@ static __inline void XVprocss_EnableBlock(XGpio *pReset, u32 channel, u32 ipBloc * @note If reset block is not included in the subsystem instance function does * not do anything ******************************************************************************/ -static __inline void XVprocss_ResetBlock(XGpio *pReset, u32 channel, u32 ipBlock) +static __inline void XVprocSs_ResetBlock(XGpio *pReset, u32 channel, u32 ipBlock) { u32 val; if(pReset) { - val = XVprocss_GetResetState(pReset, channel); + val = XVprocSs_GetResetState(pReset, channel); val &= ~ipBlock; XGpio_DiscreteWrite(pReset, channel, val); } @@ -210,13 +208,13 @@ static __inline void XVprocss_ResetBlock(XGpio *pReset, u32 channel, u32 ipBlock * given to the user registered timer based routine. If no delay handler is * registered then it uses the platform specific delay handler * -* @param pVprocss is a pointer to the subsystem instance +* @param XVprocSsPtr is a pointer to the subsystem instance * @param msec is delay required * * @return None * ******************************************************************************/ -static __inline void WaitUs(XVprocss *pVprocss, u32 MicroSeconds) +static __inline void WaitUs(XVprocSs *XVprocSsPtr, u32 MicroSeconds) { if(MicroSeconds == 0) return; @@ -225,12 +223,12 @@ static __inline void WaitUs(XVprocss *pVprocss, u32 MicroSeconds) /* Wait the requested amount of time. */ usleep(MicroSeconds); #elif defined(__MICROBLAZE__) - if(pVprocss->UsrDelayUs) + if(XVprocSsPtr->UsrDelayUs) { /* Use the time handler specified by the user for * better accuracy */ - pVprocss->UsrDelayUs(pVprocss->pUsrTmr, MicroSeconds); + XVprocSsPtr->UsrDelayUs(XVprocSsPtr->UsrTmrPtr, MicroSeconds); } else { @@ -254,69 +252,69 @@ static __inline void WaitUs(XVprocss *pVprocss, u32 MicroSeconds) * @return None * ******************************************************************************/ -void XVprocss_ReportCoreInfo(XVprocss *InstancePtr) +void XVprocSs_ReportCoreInfo(XVprocSs *InstancePtr) { Xil_AssertVoid(InstancePtr != NULL); xil_printf("\r\n ->Video Processing Subsystem Cores\r\n"); /* Report all the included cores in the subsystem instance */ - if(InstancePtr->hcrsmplr) + if(InstancePtr->HcrsmplrPtr) { xil_printf(" : Horiz. Chroma Resampler \r\n"); } - if(InstancePtr->vcrsmplrIn) + if(InstancePtr->VcrsmplrInPtr) { xil_printf(" : Vert Chroma Resampler - Input\r\n"); } - if(InstancePtr->vcrsmplrOut) + if(InstancePtr->VcrsmplrOutPtr) { xil_printf(" : Vert Chroma Resampler - Output\r\n"); } - if(InstancePtr->hscaler) + if(InstancePtr->HscalerPtr) { xil_printf(" : H Scaler\r\n"); } - if(InstancePtr->vscaler) + if(InstancePtr->VscalerPtr) { xil_printf(" : V Scaler\r\n"); } - if(InstancePtr->vdma) + if(InstancePtr->VdmaPtr) { xil_printf(" : VDMA\r\n"); } - if(InstancePtr->lbox) + if(InstancePtr->LboxPtr) { xil_printf(" : LetterBox\r\n"); } - if(InstancePtr->csc) + if(InstancePtr->CscPtr) { xil_printf(" : Color Space Converter\r\n"); } - if(InstancePtr->deint) + if(InstancePtr->DeintPtr) { xil_printf(" : Deinterlacer\r\n"); } - if(InstancePtr->rstAxis) + if(InstancePtr->RstAxisPtr) { xil_printf(" : Reset (AXIS)\r\n"); } - if(InstancePtr->rstAximm) + if(InstancePtr->RstAximmPtr) { xil_printf(" : Reset (AXI-MM) \r\n"); } - if(InstancePtr->router) + if(InstancePtr->RouterPtr) { xil_printf(" : AXIS Router\r\n"); } @@ -335,9 +333,9 @@ void XVprocss_ReportCoreInfo(XVprocss *InstancePtr) * @return None * ******************************************************************************/ -void XVprocss_RegisterDelayHandler(XVprocss *InstancePtr, - XVidC_DelayHandler CallbackFunc, - void *CallbackRef) +void XVprocSs_SetUserTimerHandler(XVprocSs *InstancePtr, + XVidC_DelayHandler CallbackFunc, + void *CallbackRef) { /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); @@ -345,7 +343,7 @@ void XVprocss_RegisterDelayHandler(XVprocss *InstancePtr, Xil_AssertVoid(CallbackRef != NULL); InstancePtr->UsrDelayUs = CallbackFunc; - InstancePtr->pUsrTmr = CallbackRef; + InstancePtr->UsrTmrPtr = CallbackRef; } /*****************************************************************************/ @@ -355,37 +353,37 @@ void XVprocss_RegisterDelayHandler(XVprocss *InstancePtr, * the sub-core driver instance is binded with the subsystem sub-core driver * handle * -* @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 * ******************************************************************************/ -static void GetIncludedSubcores(XVprocss *pVprocss) +static void GetIncludedSubcores(XVprocSs *XVprocSsPtr) { - pVprocss->hcrsmplr = ((pVprocss->Config.HCrsmplr.isPresent) \ - ? (&subcoreRepo.hcrsmplr) : NULL); - pVprocss->vcrsmplrIn = ((pVprocss->Config.VCrsmplrIn.isPresent) \ - ? (&subcoreRepo.vcrsmplrIn) : NULL); - pVprocss->vcrsmplrOut = ((pVprocss->Config.VCrsmplrOut.isPresent) \ - ? (&subcoreRepo.vcrsmplrOut) : NULL); - pVprocss->vscaler = ((pVprocss->Config.Vscale.isPresent) \ - ? (&subcoreRepo.vscaler) : NULL); - pVprocss->hscaler = ((pVprocss->Config.Hscale.isPresent) \ - ? (&subcoreRepo.hscaler) : NULL); - pVprocss->vdma = ((pVprocss->Config.Vdma.isPresent) \ - ? (&subcoreRepo.vdma) : NULL); - pVprocss->lbox = ((pVprocss->Config.Lbox.isPresent) \ - ? (&subcoreRepo.lbox) : NULL); - pVprocss->csc = ((pVprocss->Config.Csc.isPresent) \ - ? (&subcoreRepo.csc) : NULL); - pVprocss->deint = ((pVprocss->Config.Deint.isPresent) \ - ? (&subcoreRepo.deint) : NULL); - pVprocss->router = ((pVprocss->Config.Router.isPresent) \ - ? (&subcoreRepo.router) : NULL); - pVprocss->rstAxis = ((pVprocss->Config.RstAxis.isPresent) \ - ? (&subcoreRepo.rstAxis) : NULL); - pVprocss->rstAximm = ((pVprocss->Config.RstAximm.isPresent) \ - ? (&subcoreRepo.rstAximm) : NULL); + XVprocSsPtr->HcrsmplrPtr = ((XVprocSsPtr->Config.HCrsmplr.IsPresent) \ + ? (&subcoreRepo.Hcrsmplr) : NULL); + XVprocSsPtr->VcrsmplrInPtr = ((XVprocSsPtr->Config.VCrsmplrIn.IsPresent) \ + ? (&subcoreRepo.VcrsmplrIn) : NULL); + XVprocSsPtr->VcrsmplrOutPtr = ((XVprocSsPtr->Config.VCrsmplrOut.IsPresent) \ + ? (&subcoreRepo.VcrsmplrOut) : NULL); + XVprocSsPtr->VscalerPtr = ((XVprocSsPtr->Config.Vscale.IsPresent) \ + ? (&subcoreRepo.Vscaler) : NULL); + XVprocSsPtr->HscalerPtr = ((XVprocSsPtr->Config.Hscale.IsPresent) \ + ? (&subcoreRepo.Hscaler) : NULL); + XVprocSsPtr->VdmaPtr = ((XVprocSsPtr->Config.Vdma.IsPresent) \ + ? (&subcoreRepo.Vdma) : NULL); + XVprocSsPtr->LboxPtr = ((XVprocSsPtr->Config.Lbox.IsPresent) \ + ? (&subcoreRepo.Lbox) : NULL); + XVprocSsPtr->CscPtr = ((XVprocSsPtr->Config.Csc.IsPresent) \ + ? (&subcoreRepo.Csc) : NULL); + XVprocSsPtr->DeintPtr = ((XVprocSsPtr->Config.Deint.IsPresent) \ + ? (&subcoreRepo.Deint) : NULL); + XVprocSsPtr->RouterPtr = ((XVprocSsPtr->Config.Router.IsPresent) \ + ? (&subcoreRepo.Router) : NULL); + XVprocSsPtr->RstAxisPtr = ((XVprocSsPtr->Config.RstAxis.IsPresent) \ + ? (&subcoreRepo.RstAxis) : NULL); + XVprocSsPtr->RstAximmPtr = ((XVprocSsPtr->Config.RstAximm.IsPresent) \ + ? (&subcoreRepo.RstAximm) : NULL); } /*****************************************************************************/ @@ -399,7 +397,7 @@ static void GetIncludedSubcores(XVprocss *pVprocss) * @return None * ******************************************************************************/ -void XVprocss_SetFrameBufBaseaddr(XVprocss *InstancePtr, u32 addr) +void XVprocSs_SetFrameBufBaseaddr(XVprocSs *InstancePtr, u32 addr) { /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); @@ -427,31 +425,31 @@ void XVprocss_SetFrameBufBaseaddr(XVprocss *InstancePtr, u32 addr) * @return XST_SUCCESS if initialization is successful else XST_FAILURE * ******************************************************************************/ -int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, +int XVprocSs_CfgInitialize(XVprocSs *InstancePtr, XVprocSs_Config *CfgPtr, u32 EffectiveAddr) { - XVprocss *pVprocss = InstancePtr; + XVprocSs *XVprocSsPtr = InstancePtr; XAxiVdma_Config *VdmaCfgPtr; int status; u32 AbsAddr; /* Verify arguments */ - Xil_AssertNonvoid(pVprocss != NULL); + Xil_AssertNonvoid(XVprocSsPtr != NULL); Xil_AssertNonvoid(CfgPtr != NULL); Xil_AssertNonvoid(EffectiveAddr != (u32)NULL); /* Setup the instance */ - memcpy((void *)&(pVprocss->Config), (const void *)CfgPtr, sizeof(XVprocss_Config)); - pVprocss->Config.BaseAddress = EffectiveAddr; + memcpy((void *)&(XVprocSsPtr->Config), (const void *)CfgPtr, sizeof(XVprocSs_Config)); + XVprocSsPtr->Config.BaseAddress = EffectiveAddr; - switch(pVprocss->Config.Topology) + switch(XVprocSsPtr->Config.Topology) { case XVPROCSS_TOPOLOGY_FULL_FLEDGED: - xdbg_printf(XDBG_DEBUG_GENERAL," [Subsystem Configuration Mode - Full]\r\n\r\n"); + xdbg_printf(XDBG_DEBUG_GENERAL," [Subsystem Configuration Mode - Full]\r\n\r\n"); break; case XVPROCSS_TOPOLOGY_SCALER_ONLY: - xdbg_printf(XDBG_DEBUG_GENERAL," [Subsystem Configuration Mode - Scaler-Only]\r\n\r\n"); + xdbg_printf(XDBG_DEBUG_GENERAL," [Subsystem Configuration Mode - Scaler-Only]\r\n\r\n"); break; default: @@ -460,20 +458,20 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, } /* Determine sub-cores included in the provided instance of subsystem */ - GetIncludedSubcores(pVprocss); + GetIncludedSubcores(XVprocSsPtr); /* Initialize all included sub_cores */ - if(pVprocss->rstAxis) + if(XVprocSsPtr->RstAxisPtr) { - if(XVprocss_SubcoreInitResetAxis(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitResetAxis(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->rstAximm) + if(XVprocSsPtr->RstAximmPtr) { - if(XVprocss_SubcoreInitResetAximm(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitResetAximm(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } @@ -481,123 +479,123 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, * Make sure AXI-MM interface is not in reset. If in reset it will prevent * Deinterlacer from being initialized */ - XVprocss_EnableBlock(InstancePtr->rstAximm, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); + XVprocSs_EnableBlock(InstancePtr->RstAximmPtr, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); } - if(pVprocss->router) + if(XVprocSsPtr->RouterPtr) { - if(XVprocss_SubcoreInitRouter(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitRouter(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->csc) + if(XVprocSsPtr->CscPtr) { - if(XVprocss_SubcoreInitCsc(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitCsc(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->hscaler) + if(XVprocSsPtr->HscalerPtr) { - if(XVprocss_SubcoreInitHScaler(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitHScaler(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->vscaler) + if(XVprocSsPtr->VscalerPtr) { - if(XVprocss_SubcoreInitVScaler(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitVScaler(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->hcrsmplr) + if(XVprocSsPtr->HcrsmplrPtr) { - if(XVprocss_SubcoreInitHCrsmplr(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitHCrsmplr(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->vcrsmplrIn) + if(XVprocSsPtr->VcrsmplrInPtr) { - if(XVprocss_SubcoreInitVCrsmpleIn(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitVCrsmpleIn(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->vcrsmplrOut) + if(XVprocSsPtr->VcrsmplrOutPtr) { - if(XVprocss_SubcoreInitVCrsmpleOut(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitVCrsmpleOut(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->lbox) + if(XVprocSsPtr->LboxPtr) { - if(XVprocss_SubcoreInitLetterbox(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitLetterbox(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } } - if(pVprocss->vdma) + if(XVprocSsPtr->VdmaPtr) { - if(XVprocss_SubcoreInitVdma(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitVdma(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } - if(pVprocss->FrameBufBaseaddr == 0) + if(XVprocSsPtr->FrameBufBaseaddr == 0) { xil_printf("\r\nVPROCSS ERR:: Video Frame Buffer base address not set\r\n"); - xil_printf(" Use XVprocss_SetFrameBufBaseaddr() API before subsystem init\r\n\r\n"); + xil_printf(" Use XVprocSs_SetFrameBufBaseaddr() API before subsystem init\r\n\r\n"); return(XST_FAILURE); } } - if(pVprocss->deint) + if(XVprocSsPtr->DeintPtr) { - if(XVprocss_SubcoreInitDeinterlacer(pVprocss) != XST_SUCCESS) + if(XVprocSs_SubcoreInitDeinterlacer(XVprocSsPtr) != XST_SUCCESS) { return(XST_FAILURE); } /* Set Deinterlacer buffer offset in allocated DDR Frame Buffer */ - if(pVprocss->vdma) //vdma must be present for this to work + if(XVprocSsPtr->VdmaPtr) //Vdma must be present for this to work { u32 vdmaBufReq, bufsize; u32 Bpp; //bytes per pixel - Bpp = (pVprocss->Config.ColorDepth + 7)/8; + Bpp = (XVprocSsPtr->Config.ColorDepth + 7)/8; //compute buffer size based on subsystem configuration //For 1 4K2K buffer (YUV444 16-bit) size is ~48MB - bufsize = pVprocss->Config.MaxWidth * - pVprocss->Config.MaxHeight * - pVprocss->Config.NumVidComponents * + bufsize = XVprocSsPtr->Config.MaxWidth * + XVprocSsPtr->Config.MaxHeight * + XVprocSsPtr->Config.NumVidComponents * Bpp; //VDMA requires 4 buffers for total size of ~190MB - vdmaBufReq = pVprocss->vdma->MaxNumFrames * bufsize; + vdmaBufReq = XVprocSsPtr->VdmaPtr->MaxNumFrames * bufsize; /* * vdmaBufReq = 0x0BDD 80000 - * padBuf = 0x02F7 6000 (1 buffer is added as pad between vdma and deint) + * padBuf = 0x02F7 6000 (1 buffer is added as pad between Vdma and Deint) * ------------- * DeInt Offst= 0x0ED4 E000 * ------------- */ /* Set Deint Buffer Address Offset */ - pVprocss->idata.deintBufAddr = pVprocss->FrameBufBaseaddr + vdmaBufReq + bufsize; + XVprocSsPtr->CtxtData.DeintBufAddr = XVprocSsPtr->FrameBufBaseaddr + vdmaBufReq + bufsize; } else { @@ -606,56 +604,14 @@ int XVprocss_CfgInitialize(XVprocss *InstancePtr, XVprocss_Config *CfgPtr, } } - return(XST_SUCCESS); -} - -/*****************************************************************************/ -/** -* This function initializes the subsystem to power on default state. Subsystem -* device id is used to access the HW configuration for the instance. -* This configuration is then initialized along with any sub-cores included. -* As the last step the internal state of the subsystem is set to pre-defined -* power up default and Subsystem Ready state is set -* -* @param InstancePtr is the pointer to subsystem instance -* @param DeviceId is the unique device ID of the device for the lookup operation. -* -* @return XST_SUCCESS if successful -* XST_DEVICE_NOT_FOUND if no device match is found. -* XST_FAILURE otherwise -* -*******************************************************************************/ -int XVprocss_PowerOnInit(XVprocss *InstancePtr, u32 DeviceId) -{ - XVprocss_Config *ConfigPtr; - int status; - - Xil_AssertNonvoid(InstancePtr != NULL); - - ConfigPtr = XVprocss_LookupConfig(DeviceId); - if(ConfigPtr == NULL) - { - InstancePtr->IsReady = 0; - return (XST_DEVICE_NOT_FOUND); - } - - //Initialize top level and all included sub-cores - status = XVprocss_CfgInitialize(InstancePtr, ConfigPtr, ConfigPtr->BaseAddress); - if(status != XST_SUCCESS) - { - xil_printf("ERR:: Video Processing Subsystem Initialization failed %d\r\n", status); - return(XST_FAILURE); - } - - /* All sub-cores static configuration extracted. Next configure subsystem to - * power on default state - */ + /* Set subsystem to power on default state */ SetPODConfiguration(InstancePtr); /* Reset the hardware and set the flag to indicate the subsystem is ready */ - XVprocss_Reset(InstancePtr); + XVprocSs_Reset(InstancePtr); + InstancePtr->IsReady = XIL_COMPONENT_IS_READY; return(XST_SUCCESS); @@ -666,12 +622,12 @@ int XVprocss_PowerOnInit(XVprocss *InstancePtr, u32 DeviceId) * This function configures the Video Processing subsystem internal blocks * to power on default 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 None * ******************************************************************************/ -static void SetPODConfiguration(XVprocss *pVprocss) +static void SetPODConfiguration(XVprocSs *XVprocSsPtr) { XVidC_VideoStream vidStrmIn; XVidC_VideoStream vidStrmOut; @@ -683,29 +639,29 @@ static void SetPODConfiguration(XVprocss *pVprocss) vidStrmOut.ColorFormatId = XVIDC_CSF_RGB; vidStrmOut.FrameRate = XVIDC_FR_60HZ; vidStrmOut.IsInterlaced = FALSE; - vidStrmOut.ColorDepth = pVprocss->Config.ColorDepth; - vidStrmOut.PixPerClk = pVprocss->Config.PixPerClock; + vidStrmOut.ColorDepth = XVprocSsPtr->Config.ColorDepth; + vidStrmOut.PixPerClk = XVprocSsPtr->Config.PixPerClock; /* Setup Default Input Stream configuration */ vidStrmIn.VmId = XVIDC_VM_1920x1080_60_P; vidStrmIn.ColorFormatId = XVIDC_CSF_RGB; vidStrmIn.FrameRate = XVIDC_FR_60HZ; vidStrmIn.IsInterlaced = FALSE; - vidStrmIn.ColorDepth = pVprocss->Config.ColorDepth; - vidStrmIn.PixPerClk = pVprocss->Config.PixPerClock; + vidStrmIn.ColorDepth = XVprocSsPtr->Config.ColorDepth; + vidStrmIn.PixPerClk = XVprocSsPtr->Config.PixPerClock; /* Setup Video Processing subsystem input/output configuration */ - XVprocss_SetVidStreamIn(pVprocss, &vidStrmIn); - XVprocss_SetVidStreamOut(pVprocss, &vidStrmOut); + XVprocSs_SetVidStreamIn(XVprocSsPtr, &vidStrmIn); + XVprocSs_SetVidStreamOut(XVprocSsPtr, &vidStrmOut); - /* compute data width supported by vdma */ - pVprocss->idata.PixelWidthInBits = pVprocss->Config.NumVidComponents * - pVprocss->VidIn.ColorDepth; - switch(pVprocss->Config.PixPerClock) + /* compute data width supported by Vdma */ + XVprocSsPtr->CtxtData.PixelWidthInBits = XVprocSsPtr->Config.NumVidComponents * + XVprocSsPtr->VidIn.ColorDepth; + switch(XVprocSsPtr->Config.PixPerClock) { case XVIDC_PPC_1: case XVIDC_PPC_2: - if(pVprocss->Config.ColorDepth == XVIDC_BPC_10) + if(XVprocSsPtr->Config.ColorDepth == XVIDC_BPC_10) { /* Align the bit width to next byte boundary for this particular case * Num_Channel Color Depth PixelWidth Align @@ -715,7 +671,7 @@ static void SetPODConfiguration(XVprocss *pVprocss) * * HW will do the bit padding for 20->24 and 30->32 */ - pVprocss->idata.PixelWidthInBits = ((pVprocss->idata.PixelWidthInBits + 7)/8)*8; + XVprocSsPtr->CtxtData.PixelWidthInBits = ((XVprocSsPtr->CtxtData.PixelWidthInBits + 7)/8)*8; } break; @@ -724,7 +680,7 @@ static void SetPODConfiguration(XVprocss *pVprocss) } /* Setup Pixel Step size for define HW configuration */ - switch(pVprocss->Config.ColorDepth) + switch(XVprocSsPtr->Config.ColorDepth) { case XVIDC_BPC_8: PixPrecisionIndex = 0; break; case XVIDC_BPC_10: PixPrecisionIndex = 1; break; @@ -732,42 +688,42 @@ static void SetPODConfiguration(XVprocss *pVprocss) case XVIDC_BPC_16: PixPrecisionIndex = 3; break; default: break; } - pVprocss->idata.PixelHStepSize = XVprocss_PixelHStep[pVprocss->Config.PixPerClock>>1][PixPrecisionIndex]; + XVprocSsPtr->CtxtData.PixelHStepSize = XVprocSs_PixelHStep[XVprocSsPtr->Config.PixPerClock>>1][PixPrecisionIndex]; - if(XVprocss_IsConfigModeMax(pVprocss)) + if(XVprocSs_IsConfigModeMax(XVprocSsPtr)) { /* Set default Zoom Window */ win.Width = 400; win.Height = 400; win.StartX = win.StartY = 0; - XVprocss_SetZoomPipWindow(pVprocss, + XVprocSs_SetZoomPipWindow(XVprocSsPtr, XVPROCSS_ZOOM_WIN, &win); /* Set default PIP Window */ - XVprocss_SetZoomPipWindow(pVprocss, + XVprocSs_SetZoomPipWindow(XVprocSsPtr, XVPROCSS_PIP_WIN, &win); } /* Release reset before programming any IP Block */ - XVprocss_EnableBlock(pVprocss->rstAxis, GPIO_CH_RESET_SEL, RESET_MASK_ALL_BLOCKS); + XVprocSs_EnableBlock(XVprocSsPtr->RstAxisPtr, GPIO_CH_RESET_SEL, RESET_MASK_ALL_BLOCKS); /* User parameter configuration */ /* Set default background color for Letter Box */ - if(pVprocss->lbox) + if(XVprocSsPtr->LboxPtr) { - XV_LboxSetBackgroundColor(pVprocss->lbox, + XV_LboxSetBackgroundColor(XVprocSsPtr->LboxPtr, XLBOX_BKGND_BLACK, - pVprocss->VidOut.ColorFormatId, - pVprocss->VidOut.ColorDepth); + XVprocSsPtr->VidOut.ColorFormatId, + XVprocSsPtr->VidOut.ColorDepth); } /* Initialize CSC sub-core layer 2 driver. This block has FW register map */ - if(pVprocss->csc) + if(XVprocSsPtr->CscPtr) { - XV_CscInitPowerOnDefault(&pVprocss->cscL2Reg); - XV_CscSetColorDepth((&pVprocss->cscL2Reg), vidStrmIn.ColorDepth); + XV_CscInitPowerOnDefault(&XVprocSsPtr->CscL2Reg); + XV_CscSetColorDepth((&XVprocSsPtr->CscL2Reg), vidStrmIn.ColorDepth); } } @@ -784,45 +740,45 @@ static void SetPODConfiguration(XVprocss *pVprocss) * pad memory is set. This allows to selectively start only those cores * included in the processing chain ******************************************************************************/ -void XVprocss_Start(XVprocss *InstancePtr) +void XVprocSs_Start(XVprocSs *InstancePtr) { - u8 *pStartCore; + u8 *StartCorePtr; /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); - pStartCore = &InstancePtr->idata.startCore[0]; + StartCorePtr = &InstancePtr->CtxtData.StartCore[0]; xdbg_printf(XDBG_DEBUG_GENERAL," ->Start Video Processing Subsystem.... \r\n"); - if(pStartCore[XVPROCSS_RTR_CR_V_OUT]) - XV_VCrsmplStart(InstancePtr->vcrsmplrOut); + if(StartCorePtr[XVPROCSS_RTR_CR_V_OUT]) + XV_VCrsmplStart(InstancePtr->VcrsmplrOutPtr); - if(pStartCore[XVPROCSS_RTR_CR_H]) - XV_HCrsmplStart(InstancePtr->hcrsmplr); + if(StartCorePtr[XVPROCSS_RTR_CR_H]) + XV_HCrsmplStart(InstancePtr->HcrsmplrPtr); - if(pStartCore[XVPROCSS_RTR_CSC]) - XV_CscStart(InstancePtr->csc); + if(StartCorePtr[XVPROCSS_RTR_CSC]) + XV_CscStart(InstancePtr->CscPtr); - if(pStartCore[XVPROCSS_RTR_LBOX]) - XV_LBoxStart(InstancePtr->lbox); + if(StartCorePtr[XVPROCSS_RTR_LBOX]) + XV_LBoxStart(InstancePtr->LboxPtr); - if(pStartCore[XVPROCSS_RTR_SCALER_H]) - XV_HScalerStart(InstancePtr->hscaler); + if(StartCorePtr[XVPROCSS_RTR_SCALER_H]) + XV_HScalerStart(InstancePtr->HscalerPtr); - if(pStartCore[XVPROCSS_RTR_SCALER_V]) - XV_VScalerStart(InstancePtr->vscaler); + if(StartCorePtr[XVPROCSS_RTR_SCALER_V]) + XV_VScalerStart(InstancePtr->VscalerPtr); - if(pStartCore[XVPROCSS_RTR_VDMA]) - XVprocss_VdmaStartTransfer(InstancePtr->vdma); + if(StartCorePtr[XVPROCSS_RTR_VDMA]) + XVprocSs_VdmaStartTransfer(InstancePtr->VdmaPtr); - if(pStartCore[XVPROCSS_RTR_DEINT]) - XV_DeintStart(InstancePtr->deint); + if(StartCorePtr[XVPROCSS_RTR_DEINT]) + XV_DeintStart(InstancePtr->DeintPtr); - if(pStartCore[XVPROCSS_RTR_CR_V_IN]) - XV_VCrsmplStart(InstancePtr->vcrsmplrIn); + if(StartCorePtr[XVPROCSS_RTR_CR_V_IN]) + XV_VCrsmplStart(InstancePtr->VcrsmplrInPtr); /* Subsystem ready to accept axis - Enable Video Input */ - XVprocss_EnableBlock(InstancePtr->rstAxis, GPIO_CH_RESET_SEL, RESET_MASK_VIDEO_IN); + XVprocSs_EnableBlock(InstancePtr->RstAxisPtr, GPIO_CH_RESET_SEL, RESET_MASK_VIDEO_IN); } /*****************************************************************************/ @@ -835,39 +791,39 @@ void XVprocss_Start(XVprocss *InstancePtr) * @return None * ******************************************************************************/ -void XVprocss_Stop(XVprocss *InstancePtr) +void XVprocSs_Stop(XVprocSs *InstancePtr) { /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); xdbg_printf(XDBG_DEBUG_GENERAL," ->Stop Video Processing Subsystem.... \r\n"); - if(InstancePtr->vcrsmplrIn) - XV_VCrsmplStop(InstancePtr->vcrsmplrIn); + if(InstancePtr->VcrsmplrInPtr) + XV_VCrsmplStop(InstancePtr->VcrsmplrInPtr); - if(InstancePtr->deint) - XV_DeintStop(InstancePtr->deint); + if(InstancePtr->DeintPtr) + XV_DeintStop(InstancePtr->DeintPtr); - if(InstancePtr->vdma) - XVprocss_VdmaStop(InstancePtr->vdma); + if(InstancePtr->VdmaPtr) + XVprocSs_VdmaStop(InstancePtr->VdmaPtr); - if(InstancePtr->vscaler) - XV_VScalerStop(InstancePtr->vscaler); + if(InstancePtr->VscalerPtr) + XV_VScalerStop(InstancePtr->VscalerPtr); - if(InstancePtr->hscaler) - XV_HScalerStop(InstancePtr->hscaler); + if(InstancePtr->HscalerPtr) + XV_HScalerStop(InstancePtr->HscalerPtr); - if(InstancePtr->lbox) - XV_LBoxStop(InstancePtr->lbox); + if(InstancePtr->LboxPtr) + XV_LBoxStop(InstancePtr->LboxPtr); - if(InstancePtr->csc) - XV_CscStop(InstancePtr->csc); + if(InstancePtr->CscPtr) + XV_CscStop(InstancePtr->CscPtr); - if(InstancePtr->hcrsmplr) - XV_HCrsmplStop(InstancePtr->hcrsmplr); + if(InstancePtr->HcrsmplrPtr) + XV_HCrsmplStop(InstancePtr->HcrsmplrPtr); - if(InstancePtr->vcrsmplrOut) - XV_VCrsmplStop(InstancePtr->vcrsmplrOut); + if(InstancePtr->VcrsmplrOutPtr) + XV_VCrsmplStop(InstancePtr->VcrsmplrOutPtr); } /*****************************************************************************/ @@ -882,7 +838,7 @@ void XVprocss_Stop(XVprocss *InstancePtr) * @return None * ******************************************************************************/ -void XVprocss_Reset(XVprocss *InstancePtr) +void XVprocSs_Reset(XVprocSs *InstancePtr) { /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); @@ -890,16 +846,16 @@ void XVprocss_Reset(XVprocss *InstancePtr) xdbg_printf(XDBG_DEBUG_GENERAL," ->Reset Video Processing Subsystem.... \r\n"); /* Soft Reset */ - XVprocss_VdmaReset(InstancePtr->vdma); + XVprocSs_VdmaReset(InstancePtr->VdmaPtr); /* Reset All IP Blocks on AXIS interface*/ - XVprocss_ResetBlock(InstancePtr->rstAxis, GPIO_CH_RESET_SEL, RESET_MASK_ALL_BLOCKS); + XVprocSs_ResetBlock(InstancePtr->RstAxisPtr, GPIO_CH_RESET_SEL, RESET_MASK_ALL_BLOCKS); /* Reset All IP Blocks on AXI-MM interface*/ -// XVprocss_ResetBlock(InstancePtr->rstAximm, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); +// XVprocSs_ResetBlock(InstancePtr->RstAximmPtr, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); /* If enabled, Stop AXI-MM traffic */ - if((InstancePtr->deint) && (InstancePtr->idata.startCore[XVPROCSS_RTR_DEINT])) + if((InstancePtr->DeintPtr) && (InstancePtr->CtxtData.StartCore[XVPROCSS_RTR_DEINT])) { - XV_DeintStop(InstancePtr->deint); + XV_DeintStop(InstancePtr->DeintPtr); } WaitUs(InstancePtr, 100); /* hold reset line for 100us */ @@ -908,13 +864,13 @@ void XVprocss_Reset(XVprocss *InstancePtr) * in reset. Will cause Axi-Lite bus to lock. * Release IP reset - but hold vid_in in reset */ -// XVprocss_EnableBlock(InstancePtr->rstAximm, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); +// XVprocSs_EnableBlock(InstancePtr->RstAximmPtr, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIMM); // Waitms(InstancePtr, 10); /* wait for AXI-MM IP's to stabilize */ - XVprocss_EnableBlock(InstancePtr->rstAxis, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIS); + XVprocSs_EnableBlock(InstancePtr->RstAxisPtr, GPIO_CH_RESET_SEL, RESET_MASK_IP_AXIS); WaitUs(InstancePtr, 1000); /* wait 1ms for AXIS to stabilize */ /* Reset start core flags */ - memset(InstancePtr->idata.startCore, 0, sizeof(InstancePtr->idata.startCore)); + memset(InstancePtr->CtxtData.StartCore, 0, sizeof(InstancePtr->CtxtData.StartCore)); } /*****************************************************************************/ @@ -927,7 +883,7 @@ void XVprocss_Reset(XVprocss *InstancePtr) * @return XST_SUCESS if successful else XST_FAILURE * ******************************************************************************/ -int XVprocss_SetVidStreamIn(XVprocss *InstancePtr, +int XVprocSs_SetVidStreamIn(XVprocSs *InstancePtr, const XVidC_VideoStream *StrmIn) { int status; @@ -937,7 +893,7 @@ int XVprocss_SetVidStreamIn(XVprocss *InstancePtr, Xil_AssertNonvoid(StrmIn != NULL); /* Set Timing information based on resolution ID */ - status = XVprocss_SetStreamResolution(&InstancePtr->VidIn, StrmIn->VmId); + status = XVprocSs_SetStreamResolution(&InstancePtr->VidIn, StrmIn->VmId); if(!status) { @@ -960,7 +916,7 @@ int XVprocss_SetVidStreamIn(XVprocss *InstancePtr, * @return XST_SUCESS if successful else XST_FAILURE * ******************************************************************************/ -int XVprocss_SetVidStreamOut(XVprocss *InstancePtr, +int XVprocSs_SetVidStreamOut(XVprocSs *InstancePtr, const XVidC_VideoStream *StrmOut) { int status; @@ -970,7 +926,7 @@ int XVprocss_SetVidStreamOut(XVprocss *InstancePtr, Xil_AssertNonvoid(StrmOut != NULL); /* Set Timing information based on resolution ID */ - status = XVprocss_SetStreamResolution(&InstancePtr->VidOut, StrmOut->VmId); + status = XVprocSs_SetStreamResolution(&InstancePtr->VidOut, StrmOut->VmId); if(!status) { @@ -994,7 +950,7 @@ int XVprocss_SetVidStreamOut(XVprocss *InstancePtr, * @return XST_SUCESS if successful else XST_FAILURE * ******************************************************************************/ -int XVprocss_SetStreamResolution(XVidC_VideoStream *StreamPtr, +int XVprocSs_SetStreamResolution(XVidC_VideoStream *StreamPtr, const XVidC_VideoMode VmId) { int status; @@ -1033,33 +989,33 @@ int XVprocss_SetStreamResolution(XVidC_VideoStream *StreamPtr, * This function is not applicable in Subsystem Stream Mode Configuration * ******************************************************************************/ -void XVprocss_UpdateZoomPipWindow(XVprocss *InstancePtr) +void XVprocSs_UpdateZoomPipWindow(XVprocSs *InstancePtr) { /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); - if(XVprocss_IsConfigModeMax(InstancePtr)) + if(XVprocSs_IsConfigModeMax(InstancePtr)) { - /* send vdma update window to IP */ - if(XVprocss_IsPipModeOn(InstancePtr)) + /* send Vdma update window to IP */ + if(XVprocSs_IsPipModeOn(InstancePtr)) { - XVprocss_VdmaSetWinToDnScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_WR_CH); + XVprocSs_VdmaSetWinToDnScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_WR_CH); } else { - XVprocss_VdmaSetWinToUpScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_RD_CH); + XVprocSs_VdmaSetWinToUpScaleMode(InstancePtr, XVPROCSS_VDMA_UPDATE_RD_CH); } - XVprocss_VdmaStartTransfer(InstancePtr->vdma); + XVprocSs_VdmaStartTransfer(InstancePtr->VdmaPtr); /* * Final output of Video Processing subsystem goes via LBox IP * Program the output resolution window */ - if(XVprocss_IsPipModeOn(InstancePtr)) + if(XVprocSs_IsPipModeOn(InstancePtr)) { - XV_LBoxSetActiveWin(InstancePtr->lbox, - &InstancePtr->idata.wrWindow, + XV_LBoxSetActiveWin(InstancePtr->LboxPtr, + &InstancePtr->CtxtData.WrWindow, InstancePtr->VidOut.Timing.HActive, InstancePtr->VidOut.Timing.VActive); } @@ -1086,8 +1042,8 @@ void XVprocss_UpdateZoomPipWindow(XVprocss *InstancePtr) * This function is not applicable in Subsystem Stream Mode Configuration * ******************************************************************************/ -void XVprocss_SetZoomPipWindow(XVprocss *InstancePtr, - XVprocss_Win mode, +void XVprocSs_SetZoomPipWindow(XVprocSs *InstancePtr, + XVprocSs_Win mode, XVidC_VideoWindow *win) { u16 wordlen; @@ -1096,39 +1052,39 @@ void XVprocss_SetZoomPipWindow(XVprocss *InstancePtr, Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(win != NULL); - if(XVprocss_IsConfigModeMax(InstancePtr)) + if(XVprocSs_IsConfigModeMax(InstancePtr)) { if(mode == XVPROCSS_ZOOM_WIN) { /* check if DMA includes DRE. If not then auto-align to selected bus width */ - if(!InstancePtr->vdma->ReadChannel.HasDRE) + if(!InstancePtr->VdmaPtr->ReadChannel.HasDRE) { - wordlen = InstancePtr->idata.PixelHStepSize-1; + wordlen = InstancePtr->CtxtData.PixelHStepSize-1; win->StartX = ((win->StartX + wordlen) & ~(wordlen)); win->Width = ((win->Width + wordlen) & ~(wordlen)); } //VDMA RD Client - InstancePtr->idata.rdWindow.StartX = win->StartX; - InstancePtr->idata.rdWindow.StartY = win->StartY; - InstancePtr->idata.rdWindow.Width = win->Width; - InstancePtr->idata.rdWindow.Height = win->Height; + InstancePtr->CtxtData.RdWindow.StartX = win->StartX; + InstancePtr->CtxtData.RdWindow.StartY = win->StartY; + InstancePtr->CtxtData.RdWindow.Width = win->Width; + InstancePtr->CtxtData.RdWindow.Height = win->Height; } else //PIP { /* check if DMA does not have DRE then auto-align */ - if(!InstancePtr->vdma->WriteChannel.HasDRE) + if(!InstancePtr->VdmaPtr->WriteChannel.HasDRE) { - wordlen = InstancePtr->idata.PixelHStepSize-1; + wordlen = InstancePtr->CtxtData.PixelHStepSize-1; win->StartX = ((win->StartX + wordlen) & ~(wordlen)); win->Width = ((win->Width + wordlen) & ~(wordlen)); } //VDMA WR Client - InstancePtr->idata.wrWindow.StartX = win->StartX; - InstancePtr->idata.wrWindow.StartY = win->StartY; - InstancePtr->idata.wrWindow.Width = win->Width; - InstancePtr->idata.wrWindow.Height = win->Height; + InstancePtr->CtxtData.WrWindow.StartX = win->StartX; + InstancePtr->CtxtData.WrWindow.StartY = win->StartY; + InstancePtr->CtxtData.WrWindow.Width = win->Width; + InstancePtr->CtxtData.WrWindow.Height = win->Height; } } else //Scaler Only Config @@ -1151,29 +1107,29 @@ void XVprocss_SetZoomPipWindow(XVprocss *InstancePtr, * This function is not applicable in Subsystem Stream Mode Configuration * ******************************************************************************/ -void XVprocss_GetZoomPipWindow(XVprocss *InstancePtr, - XVprocss_Win mode, +void XVprocSs_GetZoomPipWindow(XVprocSs *InstancePtr, + XVprocSs_Win mode, XVidC_VideoWindow *win) { /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); Xil_AssertVoid(win != NULL); - if(XVprocss_IsConfigModeMax(InstancePtr)) + if(XVprocSs_IsConfigModeMax(InstancePtr)) { if(mode == XVPROCSS_ZOOM_WIN) { - win->StartX = InstancePtr->idata.rdWindow.StartX; - win->StartY = InstancePtr->idata.rdWindow.StartY; - win->Width = InstancePtr->idata.rdWindow.Width; - win->Height = InstancePtr->idata.rdWindow.Height; + win->StartX = InstancePtr->CtxtData.RdWindow.StartX; + win->StartY = InstancePtr->CtxtData.RdWindow.StartY; + win->Width = InstancePtr->CtxtData.RdWindow.Width; + win->Height = InstancePtr->CtxtData.RdWindow.Height; } else //PIP { - win->StartX = InstancePtr->idata.wrWindow.StartX; - win->StartY = InstancePtr->idata.wrWindow.StartY; - win->Width = InstancePtr->idata.wrWindow.Width; - win->Height = InstancePtr->idata.wrWindow.Height; + win->StartX = InstancePtr->CtxtData.WrWindow.StartX; + win->StartY = InstancePtr->CtxtData.WrWindow.StartY; + win->Width = InstancePtr->CtxtData.WrWindow.Width; + win->Height = InstancePtr->CtxtData.WrWindow.Height; } } else //Scaler Only Config @@ -1194,7 +1150,7 @@ void XVprocss_GetZoomPipWindow(XVprocss *InstancePtr, * * @return None * -* @note User must call XVprocss_ConfigureSubsystem() for change to take effect +* @note User must call XVprocSs_ConfigureSubsystem() for change to take effect * This call has not been added here such that it provides an opportunity * to make the change during vertical blanking at system level. This * behavior will change once shadow register support is available in @@ -1202,19 +1158,19 @@ void XVprocss_GetZoomPipWindow(XVprocss *InstancePtr, * This function is not applicable in Subsystem Stream Mode Configuration * ******************************************************************************/ -void XVprocss_SetZoomMode(XVprocss *InstancePtr, u8 OnOff) +void XVprocSs_SetZoomMode(XVprocSs *InstancePtr, u8 OnOff) { char *status[] = {"OFF","ON"}; /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); - if(XVprocss_IsConfigModeMax(InstancePtr)) + if(XVprocSs_IsConfigModeMax(InstancePtr)) { - InstancePtr->idata.ZoomEn = OnOff; - InstancePtr->idata.PipEn = FALSE; + InstancePtr->CtxtData.ZoomEn = OnOff; + InstancePtr->CtxtData.PipEn = FALSE; - xdbg_printf(XDBG_DEBUG_GENERAL,"\r\n :ZOOM Mode %s \r\n", status[InstancePtr->idata.ZoomEn]); + xdbg_printf(XDBG_DEBUG_GENERAL,"\r\n :ZOOM Mode %s \r\n", status[InstancePtr->CtxtData.ZoomEn]); } else //Scaler Only Config { @@ -1234,7 +1190,7 @@ void XVprocss_SetZoomMode(XVprocss *InstancePtr, u8 OnOff) * * @return None * -* @note User must call XVprocss_ConfigureSubsystem() for change to take effect +* @note User must call XVprocSs_ConfigureSubsystem() for change to take effect * This call has not been added here such that it provides an opportunity * to make the change during vertical blanking at system level. This * behavior will change once shadow register support is available in @@ -1242,19 +1198,19 @@ void XVprocss_SetZoomMode(XVprocss *InstancePtr, u8 OnOff) * This function is not applicable in Subsystem Stream Mode Configuration * ******************************************************************************/ -void XVprocss_SetPipMode(XVprocss *InstancePtr, u8 OnOff) +void XVprocSs_SetPipMode(XVprocSs *InstancePtr, u8 OnOff) { char *status[] = {"OFF","ON"}; /* Verify arguments */ Xil_AssertVoid(InstancePtr != NULL); - if(XVprocss_IsConfigModeMax(InstancePtr)) + if(XVprocSs_IsConfigModeMax(InstancePtr)) { - InstancePtr->idata.PipEn = OnOff; - InstancePtr->idata.ZoomEn = FALSE; + InstancePtr->CtxtData.PipEn = OnOff; + InstancePtr->CtxtData.ZoomEn = FALSE; - xdbg_printf(XDBG_DEBUG_GENERAL,"\r\n :PIP Mode %s \r\n", status[InstancePtr->idata.PipEn]); + xdbg_printf(XDBG_DEBUG_GENERAL,"\r\n :PIP Mode %s \r\n", status[InstancePtr->CtxtData.PipEn]); } else //Scaler Only Config { @@ -1304,7 +1260,7 @@ static int ValidateScalerOnlyConfig(XVidC_VideoStream *pStrmIn, * This function configures the video subsystem pipeline for ScalerOnly * topology of the subsystem * -* @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 successful else XST_FAILURE * @@ -1312,7 +1268,7 @@ static int ValidateScalerOnlyConfig(XVidC_VideoStream *pStrmIn, * accordingly else will ignore the request * ******************************************************************************/ -static int SetupModeScalerOnly(XVprocss *pVprocss) +static int SetupModeScalerOnly(XVprocSs *XVprocSsPtr) { u32 vsc_WidthIn, vsc_HeightIn, vsc_HeightOut; u32 hsc_HeightIn, hsc_WidthIn, hsc_WidthOut; @@ -1321,36 +1277,36 @@ static int SetupModeScalerOnly(XVprocss *pVprocss) vsc_WidthIn = vsc_HeightIn = vsc_HeightOut = 0; hsc_HeightIn = hsc_WidthIn = hsc_WidthOut = 0; - if((!pVprocss->vscaler) || (!pVprocss->hscaler)) + if((!XVprocSsPtr->VscalerPtr) || (!XVprocSsPtr->HscalerPtr)) { xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Scaler IP not found\r\n"); return(XST_FAILURE); } /* check if input/output stream configuration is supported */ - status = ValidateScalerOnlyConfig(&pVprocss->VidIn, - &pVprocss->VidOut); + status = ValidateScalerOnlyConfig(&XVprocSsPtr->VidIn, + &XVprocSsPtr->VidOut); if(status == XST_SUCCESS) { /* Reset All IP Blocks */ - XVprocss_Reset(pVprocss); + XVprocSs_Reset(XVprocSsPtr); /* UpScale mode V Scaler is before H Scaler */ - vsc_WidthIn = pVprocss->VidIn.Timing.HActive; - vsc_HeightIn = pVprocss->VidIn.Timing.VActive; - vsc_HeightOut = pVprocss->VidOut.Timing.VActive; + vsc_WidthIn = XVprocSsPtr->VidIn.Timing.HActive; + vsc_HeightIn = XVprocSsPtr->VidIn.Timing.VActive; + vsc_HeightOut = XVprocSsPtr->VidOut.Timing.VActive; hsc_WidthIn = vsc_WidthIn; hsc_HeightIn = vsc_HeightOut; - hsc_WidthOut = pVprocss->VidOut.Timing.HActive; + hsc_WidthOut = XVprocSsPtr->VidOut.Timing.HActive; /* Configure scaler to scale input to output resolution */ 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); @@ -1358,19 +1314,19 @@ static int SetupModeScalerOnly(XVprocss *pVprocss) 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->VidIn.ColorFormatId); + XVprocSsPtr->VidIn.ColorFormatId); /* Start Scaler sub-cores */ - XV_HScalerStart(pVprocss->hscaler); - XV_VScalerStart(pVprocss->vscaler); + XV_HScalerStart(XVprocSsPtr->HscalerPtr); + XV_VScalerStart(XVprocSsPtr->VscalerPtr); /* Subsystem Ready to accept input stream - Enable Video Input */ - XVprocss_EnableBlock(pVprocss->rstAxis, GPIO_CH_RESET_SEL, RESET_MASK_VIDEO_IN); + XVprocSs_EnableBlock(XVprocSsPtr->RstAxisPtr, GPIO_CH_RESET_SEL, RESET_MASK_VIDEO_IN); } else { @@ -1384,28 +1340,28 @@ static int SetupModeScalerOnly(XVprocss *pVprocss) * This function configures the video subsystem pipeline for Maximum * (Full_Fledged) topology * -* @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 successful else XST_FAILURE * ******************************************************************************/ -static int SetupModeMax(XVprocss *pVprocss) +static int SetupModeMax(XVprocSs *XVprocSsPtr) { int status; /* Build Routing table */ - status = XVprocss_BuildRoutingTable(pVprocss); + status = XVprocSs_BuildRoutingTable(XVprocSsPtr); if(status == XST_SUCCESS) { /* Reset All IP Blocks */ - XVprocss_Reset(pVprocss); + XVprocSs_Reset(XVprocSsPtr); /* Set AXI Switch registers */ - XVprocss_ProgRouterMux(pVprocss); + XVprocSs_ProgRouterMux(XVprocSsPtr); /* program use case */ - XVprocss_SetupRouterDataFlow(pVprocss); + XVprocSs_SetupRouterDataFlow(XVprocSsPtr); } else { @@ -1426,7 +1382,7 @@ static int SetupModeMax(XVprocss *pVprocss) * @return XST_SUCCESS if successful else XST_FAILURE * ******************************************************************************/ -static int ValidateSubsystemConfig(XVprocss *InstancePtr) +static int ValidateSubsystemConfig(XVprocSs *InstancePtr) { XVidC_VideoStream *StrmIn = &InstancePtr->VidIn; XVidC_VideoStream *StrmOut = &InstancePtr->VidOut; @@ -1470,7 +1426,7 @@ static int ValidateSubsystemConfig(XVprocss *InstancePtr) /* Check for YUV420 In stream width and height is even */ if(StrmIn->ColorFormatId == XVIDC_CSF_YCRCB_420) { - if(InstancePtr->vcrsmplrIn) + if(InstancePtr->VcrsmplrInPtr) { if(((StrmIn->Timing.HActive % 2) != 0) && ((StrmIn->Timing.VActive % 2) != 0)) { @@ -1488,7 +1444,7 @@ static int ValidateSubsystemConfig(XVprocss *InstancePtr) /* Check for YUV420 out stream width and height is even */ if(StrmOut->ColorFormatId == XVIDC_CSF_YCRCB_420) { - if(InstancePtr->vcrsmplrOut) + if(InstancePtr->VcrsmplrOutPtr) { if(((StrmOut->Timing.HActive % 2) != 0) && ((StrmOut->Timing.VActive % 2) != 0)) { @@ -1511,7 +1467,7 @@ static int ValidateSubsystemConfig(XVprocss *InstancePtr) xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Interlaced YUV420 stream not supported\r\n"); return(XST_FAILURE); } - if(!InstancePtr->deint) + if(!InstancePtr->DeintPtr) { xdbg_printf(XDBG_DEBUG_GENERAL,"VPROCSS ERR:: Interlaced input not supported\r\n"); return(XST_FAILURE); @@ -1534,7 +1490,7 @@ static int ValidateSubsystemConfig(XVprocss *InstancePtr) * @return XST_SUCCESS if successful else XST_FAILURE * ******************************************************************************/ -int XVprocss_SetSubsystemConfig(XVprocss *InstancePtr) +int XVprocSs_SetSubsystemConfig(XVprocSs *InstancePtr) { int status = XST_SUCCESS; @@ -1584,7 +1540,7 @@ int XVprocss_SetSubsystemConfig(XVprocss *InstancePtr) * @return None * ******************************************************************************/ -void XVprocss_ReportSubsystemConfig(XVprocss *InstancePtr) +void XVprocSs_ReportSubsystemConfig(XVprocSs *InstancePtr) { char *topology[2] = {"Scaler-Only", "Full-Fledged"}; XVidC_VideoWindow win; @@ -1597,7 +1553,7 @@ void XVprocss_ReportSubsystemConfig(XVprocss *InstancePtr) if(InstancePtr->Config.Topology <= XVPROCSS_TOPOLOGY_FULL_FLEDGED) { xil_printf("\r\nTopology: %s\r\n", topology[InstancePtr->Config.Topology]); - XVprocss_ReportCoreInfo(InstancePtr); + XVprocSs_ReportCoreInfo(InstancePtr); } else { @@ -1616,12 +1572,12 @@ void XVprocss_ReportSubsystemConfig(XVprocss *InstancePtr) xil_printf("\r\n->OUTPUT\r\n"); XVidC_ReportStreamInfo(&InstancePtr->VidOut); - if(XVprocss_IsConfigModeMax(InstancePtr)) + if(XVprocSs_IsConfigModeMax(InstancePtr)) { - if(XVprocss_IsZoomModeOn(InstancePtr)) + if(XVprocSs_IsZoomModeOn(InstancePtr)) { xil_printf("\r\nZoom Mode: ON\r\n"); - XVprocss_GetZoomPipWindow(InstancePtr, XVPROCSS_ZOOM_WIN, &win); + XVprocSs_GetZoomPipWindow(InstancePtr, XVPROCSS_ZOOM_WIN, &win); xil_printf(" Start X = %d\r\n", win.StartX); xil_printf(" Start Y = %d\r\n", win.StartY); xil_printf(" Win Width = %d\r\n", win.Width); @@ -1632,10 +1588,10 @@ void XVprocss_ReportSubsystemConfig(XVprocss *InstancePtr) xil_printf("\r\nZoom Mode: OFF\r\n"); } - if(XVprocss_IsPipModeOn(InstancePtr)) + if(XVprocSs_IsPipModeOn(InstancePtr)) { xil_printf("\r\nPip Mode: ON\r\n"); - XVprocss_GetZoomPipWindow(InstancePtr, XVPROCSS_PIP_WIN, &win); + XVprocSs_GetZoomPipWindow(InstancePtr, XVPROCSS_PIP_WIN, &win); xil_printf(" Start X = %d\r\n", win.StartX); xil_printf(" Start Y = %d\r\n", win.StartY); xil_printf(" Win Width = %d\r\n", win.Width); @@ -1648,4 +1604,3 @@ void XVprocss_ReportSubsystemConfig(XVprocss *InstancePtr) } xil_printf("**************************************************\r\n\r\n"); } -/** @} */ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h index 52402198..0c0a1b41 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.h @@ -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 * * Interrupt Service * @@ -178,7 +175,7 @@ * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- -* 1.00 rco 07/21/15 Initial Release +* 1.00 rco 08/17/15 Initial Release * * @@ -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 */ -/** @} */ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c index cdc4f7a1..14b82ffe 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.c @@ -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); diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h index 4cabc53d..d9d2c456 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_coreinit.h @@ -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 } diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c index 337c1f87..baeacb2f 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_g.c @@ -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, diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c index 05281a04..9d66b860 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.c @@ -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; countrouter, 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; countRtrNumCores; ++count) + for(count=0; countRtrNumCores; ++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); } /** @} */ diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h index 066ece24..1b8ad730 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_router.h @@ -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 } diff --git a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c index d53af85d..0137d168 100644 --- a/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c +++ b/XilinxProcessorIPLib/drivers/vprocss/src/xvprocss_sinit.c @@ -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; } }