XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c
void XVprocSs_SetZoomPipWindow(XVprocSs *InstancePtr,
                               XVprocSs_Win   mode,
                               XVidC_VideoWindow *win)
{
  /* Verify arguments */
  Xil_AssertVoid(InstancePtr != NULL);
  Xil_AssertVoid(win != NULL);

  if(XVprocSs_IsConfigModeMax(InstancePtr))
  {
    if(mode == XVPROCSS_ZOOM_WIN) {
      /* If DMA engine does not support unaligned transfers then
       * - align window StartX to next PixelHStepSize boundary
       * - align window size to 2*Pixels/Clock
       */
      if(!InstancePtr->VdmaPtr->ReadChannel.HasDRE) {
        u32 AlignStartX, AlignWidth;

        AlignStartX = InstancePtr->CtxtData.PixelHStepSize;
        AlignWidth  = 2*InstancePtr->Config.PixPerClock;

        win->StartX = ((win->StartX + AlignStartX - 1)/AlignStartX)*AlignStartX;
        win->Width  = ((win->Width  + AlignWidth  - 1)/AlignWidth)*AlignWidth;
      }
      //VDMA RD Client
      InstancePtr->CtxtData.RdWindow.StartX = win->StartX;
      InstancePtr->CtxtData.RdWindow.StartY = win->StartY;
      InstancePtr->CtxtData.RdWindow.Width  = win->Width;
      InstancePtr->CtxtData.RdWindow.Height = win->Height;

      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_ZOOMWIN, XVPROCSS_EDAT_SUCCESS);
    } else { //PIP
      /* If DMA engine does not support unaligned transfers then
       * - align window StartX to next PixelHStepSize boundary
       * - align window size to 2*Pixels/Clock
       */
      if(!InstancePtr->VdmaPtr->WriteChannel.HasDRE)
      {
        u32 AlignStartX, AlignWidth;

        AlignStartX = InstancePtr->CtxtData.PixelHStepSize;
        AlignWidth  = 2*InstancePtr->Config.PixPerClock;

        win->StartX = ((win->StartX + AlignStartX - 1)/AlignStartX)*AlignStartX;
        win->Width  = ((win->Width  + AlignWidth  - 1)/AlignWidth)*AlignWidth;
      }
      //VDMA WR Client
      InstancePtr->CtxtData.WrWindow.StartX = win->StartX;
      InstancePtr->CtxtData.WrWindow.StartY = win->StartY;
      InstancePtr->CtxtData.WrWindow.Width  = win->Width;
      InstancePtr->CtxtData.WrWindow.Height = win->Height;

      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_PIPWIN, XVPROCSS_EDAT_SUCCESS);
    }
  } else { // streaming Config - no PIP or ZOOM window
    if (mode == XVPROCSS_ZOOM_WIN)
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_ZOOMWIN, XVPROCSS_EDAT_FAILURE);
    else
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_PIPWIN, XVPROCSS_EDAT_FAILURE);
  }
}
/*****************************************************************************/
/**
* This function allows user to set the Zoom or PIP window. Scratch pad memory
* is updated with the new window information
*
* @param  InstancePtr is a pointer to the Subsystem instance to be worked on.
* @param  mode is feature to be updated PIP or ZOOM
* @param  win is structure that contains window coordinates and size
*
* @return None
*
* @note For Zoom mode RD client window is written in scratch pad memory
*       For Pip mode WR client window is written in scratch pad memory
*       This function is not applicable in Subsystem Stream Mode Configuration
*
******************************************************************************/
This function allows user to set the Zoom or PIP window. Scratch pad memory
is updated with the new window information
This function allows user to set the Zoom or PIP window . Scratch pad memory is updated with the new window information
void XVprocSs_SetZoomPipWindow(XVprocSs *InstancePtr,
                               XVprocSs_Win   mode,
                               XVidC_VideoWindow *win)
{
  Xil_AssertVoid(InstancePtr != NULL);
  Xil_AssertVoid(win != NULL);
  if(XVprocSs_IsConfigModeMax(InstancePtr))
  {
    if(mode == XVPROCSS_ZOOM_WIN) {
      if(!InstancePtr->VdmaPtr->ReadChannel.HasDRE) {
        u32 AlignStartX, AlignWidth;
        AlignStartX = InstancePtr->CtxtData.PixelHStepSize;
        AlignWidth  = 2*InstancePtr->Config.PixPerClock;
        win->StartX = ((win->StartX + AlignStartX - 1)/AlignStartX)*AlignStartX;
        win->Width  = ((win->Width  + AlignWidth  - 1)/AlignWidth)*AlignWidth;
      }
      InstancePtr->CtxtData.RdWindow.StartX = win->StartX;
      InstancePtr->CtxtData.RdWindow.StartY = win->StartY;
      InstancePtr->CtxtData.RdWindow.Width  = win->Width;
      InstancePtr->CtxtData.RdWindow.Height = win->Height;
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_ZOOMWIN, XVPROCSS_EDAT_SUCCESS);
    } else { 
      if(!InstancePtr->VdmaPtr->WriteChannel.HasDRE)
      {
        u32 AlignStartX, AlignWidth;
        AlignStartX = InstancePtr->CtxtData.PixelHStepSize;
        AlignWidth  = 2*InstancePtr->Config.PixPerClock;
        win->StartX = ((win->StartX + AlignStartX - 1)/AlignStartX)*AlignStartX;
        win->Width  = ((win->Width  + AlignWidth  - 1)/AlignWidth)*AlignWidth;
      }
      InstancePtr->CtxtData.WrWindow.StartX = win->StartX;
      InstancePtr->CtxtData.WrWindow.StartY = win->StartY;
      InstancePtr->CtxtData.WrWindow.Width  = win->Width;
      InstancePtr->CtxtData.WrWindow.Height = win->Height;
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_PIPWIN, XVPROCSS_EDAT_SUCCESS);
    }
  } else { 
    if (mode == XVPROCSS_ZOOM_WIN)
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_ZOOMWIN, XVPROCSS_EDAT_FAILURE);
    else
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_SET_PIPWIN, XVPROCSS_EDAT_FAILURE);
  }
}
void XVprocSs_SetZoomPipWindow ( XVprocSs * InstancePtr , XVprocSs_Win mode , XVidC_VideoWindow * win ) { Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( win != NULL ) ; if ( XVprocSs_IsConfigModeMax ( InstancePtr ) ) { if ( mode == XVPROCSS_ZOOM_WIN ) { if ( ! InstancePtr -> VdmaPtr -> ReadChannel . HasDRE ) { u32 AlignStartX , AlignWidth ; AlignStartX = InstancePtr -> CtxtData . PixelHStepSize ; AlignWidth = 2 * InstancePtr -> Config . PixPerClock ; win -> StartX = ( ( win -> StartX + AlignStartX - 1 ) / AlignStartX ) * AlignStartX ; win -> Width = ( ( win -> Width + AlignWidth - 1 ) / AlignWidth ) * AlignWidth ; } InstancePtr -> CtxtData . RdWindow . StartX = win -> StartX ; InstancePtr -> CtxtData . RdWindow . StartY = win -> StartY ; InstancePtr -> CtxtData . RdWindow . Width = win -> Width ; InstancePtr -> CtxtData . RdWindow . Height = win -> Height ; XVprocSs_LogWrite ( InstancePtr , XVPROCSS_EVT_SET_ZOOMWIN , XVPROCSS_EDAT_SUCCESS ) ; } else { if ( ! InstancePtr -> VdmaPtr -> WriteChannel . HasDRE ) { u32 AlignStartX , AlignWidth ; AlignStartX = InstancePtr -> CtxtData . PixelHStepSize ; AlignWidth = 2 * InstancePtr -> Config . PixPerClock ; win -> StartX = ( ( win -> StartX + AlignStartX - 1 ) / AlignStartX ) * AlignStartX ; win -> Width = ( ( win -> Width + AlignWidth - 1 ) / AlignWidth ) * AlignWidth ; } InstancePtr -> CtxtData . WrWindow . StartX = win -> StartX ; InstancePtr -> CtxtData . WrWindow . StartY = win -> StartY ; InstancePtr -> CtxtData . WrWindow . Width = win -> Width ; InstancePtr -> CtxtData . WrWindow . Height = win -> Height ; XVprocSs_LogWrite ( InstancePtr , XVPROCSS_EVT_SET_PIPWIN , XVPROCSS_EDAT_SUCCESS ) ; } } else { if ( mode == XVPROCSS_ZOOM_WIN ) XVprocSs_LogWrite ( InstancePtr , XVPROCSS_EVT_SET_ZOOMWIN , XVPROCSS_EDAT_FAILURE ) ; else XVprocSs_LogWrite ( InstancePtr , XVPROCSS_EVT_SET_PIPWIN , XVPROCSS_EDAT_FAILURE ) ; } }
This function allows user to set the Zoom or PIP window.
This function allows user to set the Zoom or PIP window .
/* Verify arguments */ /* If DMA engine does not support unaligned transfers then
       * - align window StartX to next PixelHStepSize boundary
       * - align window size to 2*Pixels/Clock
       */ //VDMA RD Client //PIP /* If DMA engine does not support unaligned transfers then
       * - align window StartX to next PixelHStepSize boundary
       * - align window size to 2*Pixels/Clock
       */ //VDMA WR Client // streaming Config - no PIP or ZOOM window