XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c
static void SetPowerOnDefaultState(XVprocSs *XVprocSsPtr)
{
  XVidC_VideoStream vidStrmIn;
  XVidC_VideoStream vidStrmOut;
  XVidC_VideoWindow win;
  u16 PixPrecisionIndex;
  XVidC_VideoTiming const *TimingPtr;

  memset(&vidStrmIn,  0, sizeof(XVidC_VideoStream));
  memset(&vidStrmOut, 0, sizeof(XVidC_VideoStream));

  /* Setup Default Output Stream configuration */
  vidStrmOut.VmId          = XVIDC_VM_1920x1080_60_P;
  vidStrmOut.ColorFormatId = XVIDC_CSF_RGB;
  vidStrmOut.FrameRate     = XVIDC_FR_60HZ;
  vidStrmOut.IsInterlaced  = FALSE;
  vidStrmOut.ColorDepth    = (XVidC_ColorDepth)XVprocSsPtr->Config.ColorDepth;
  vidStrmOut.PixPerClk     = (XVidC_PixelsPerClock)XVprocSsPtr->Config.PixPerClock;

  TimingPtr = XVidC_GetTimingInfo(vidStrmOut.VmId);
  vidStrmOut.Timing = *TimingPtr;

  /* 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    = (XVidC_ColorDepth)XVprocSsPtr->Config.ColorDepth;
  vidStrmIn.PixPerClk     = (XVidC_PixelsPerClock)XVprocSsPtr->Config.PixPerClock;

  TimingPtr = XVidC_GetTimingInfo(vidStrmIn.VmId);
  vidStrmIn.Timing = *TimingPtr;

  /* Setup Video Processing subsystem input/output  configuration */
  XVprocSs_SetVidStreamIn(XVprocSsPtr,  &vidStrmIn);
  XVprocSs_SetVidStreamOut(XVprocSsPtr, &vidStrmOut);

  /* 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(XVprocSsPtr->Config.ColorDepth == XVIDC_BPC_10)
	 {
	   /* Align the bit width to next byte boundary for this particular case
	    * Num_Channel	Color Depth		PixelWidth		Align
	    * ----------------------------------------------------
	    *    2				10				20			 24
	    *    3				10				30			 32
	    *
	    *    HW will do the bit padding for 20->24 and 30->32
	    */
	   XVprocSsPtr->CtxtData.PixelWidthInBits = ((XVprocSsPtr->CtxtData.PixelWidthInBits + 7)/8)*8;
	 }
	 break;

    default:
	 break;
  }

  /* Set default Pip/Zoom window increment step size */
  switch(XVprocSsPtr->Config.ColorDepth)
  {
    case XVIDC_BPC_8:  PixPrecisionIndex = 0; break;
    case XVIDC_BPC_10: PixPrecisionIndex = 1; break;
    case XVIDC_BPC_12: PixPrecisionIndex = 2; break;
    case XVIDC_BPC_16: PixPrecisionIndex = 3; break;
    default:           PixPrecisionIndex = 0; break;
  }

  XVprocSsPtr->CtxtData.PixelHStepSize = XVprocSs_PixelHStep[XVprocSsPtr->Config.PixPerClock>>1][PixPrecisionIndex];

  if(XVprocSs_IsConfigModeMax(XVprocSsPtr))
  {
	/* Set default PIP Background color */
	XVprocSsPtr->CtxtData.LboxBkgndColor = XLBOX_BKGND_BLACK;

    /* Set default Zoom Window */
    win.Width  = 400;
    win.Height = 400;
    win.StartX = win.StartY = 0;

    XVprocSs_SetZoomPipWindow(XVprocSsPtr,
                              XVPROCSS_ZOOM_WIN,
                              &win);

    /* Set default PIP Window */
    XVprocSs_SetZoomPipWindow(XVprocSsPtr,
                              XVPROCSS_PIP_WIN,
                              &win);
  }

  /* Release reset before programming any IP Block */
  XVprocSs_EnableBlock(XVprocSsPtr->RstAxisPtr,  GPIO_CH_RESET_SEL, XVPROCSS_RSTMASK_ALL_BLOCKS);
}
/*****************************************************************************/
/**
* This function configures the Video Processing subsystem internal blocks
* to power on default configuration
*
* @param  XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
*
* @return None
*
******************************************************************************/
This function configures the Video Processing subsystem internal blocks
to power on default configuration
This function configures the Video Processing subsystem internal blocks to power on default configuration
static void SetPowerOnDefaultState(XVprocSs *XVprocSsPtr)
{
  XVidC_VideoStream vidStrmIn;
  XVidC_VideoStream vidStrmOut;
  XVidC_VideoWindow win;
  u16 PixPrecisionIndex;
  XVidC_VideoTiming const *TimingPtr;
  memset(&vidStrmIn,  0, sizeof(XVidC_VideoStream));
  memset(&vidStrmOut, 0, sizeof(XVidC_VideoStream));
  vidStrmOut.VmId          = XVIDC_VM_1920x1080_60_P;
  vidStrmOut.ColorFormatId = XVIDC_CSF_RGB;
  vidStrmOut.FrameRate     = XVIDC_FR_60HZ;
  vidStrmOut.IsInterlaced  = FALSE;
  vidStrmOut.ColorDepth    = (XVidC_ColorDepth)XVprocSsPtr->Config.ColorDepth;
  vidStrmOut.PixPerClk     = (XVidC_PixelsPerClock)XVprocSsPtr->Config.PixPerClock;
  TimingPtr = XVidC_GetTimingInfo(vidStrmOut.VmId);
  vidStrmOut.Timing = *TimingPtr;
  vidStrmIn.VmId          = XVIDC_VM_1920x1080_60_P;
  vidStrmIn.ColorFormatId = XVIDC_CSF_RGB;
  vidStrmIn.FrameRate     = XVIDC_FR_60HZ;
  vidStrmIn.IsInterlaced  = FALSE;
  vidStrmIn.ColorDepth    = (XVidC_ColorDepth)XVprocSsPtr->Config.ColorDepth;
  vidStrmIn.PixPerClk     = (XVidC_PixelsPerClock)XVprocSsPtr->Config.PixPerClock;
  TimingPtr = XVidC_GetTimingInfo(vidStrmIn.VmId);
  vidStrmIn.Timing = *TimingPtr;
  XVprocSs_SetVidStreamIn(XVprocSsPtr,  &vidStrmIn);
  XVprocSs_SetVidStreamOut(XVprocSsPtr, &vidStrmOut);
  XVprocSsPtr->CtxtData.PixelWidthInBits = XVprocSsPtr->Config.NumVidComponents *
			                               XVprocSsPtr->VidIn.ColorDepth;
  switch(XVprocSsPtr->Config.PixPerClock)
  {
    case XVIDC_PPC_1:
    case XVIDC_PPC_2:
	 if(XVprocSsPtr->Config.ColorDepth == XVIDC_BPC_10)
	 {
	   XVprocSsPtr->CtxtData.PixelWidthInBits = ((XVprocSsPtr->CtxtData.PixelWidthInBits + 7)/8)*8;
	 }
	 break;
    default:
	 break;
  }
  switch(XVprocSsPtr->Config.ColorDepth)
  {
    case XVIDC_BPC_8:  PixPrecisionIndex = 0; break;
    case XVIDC_BPC_10: PixPrecisionIndex = 1; break;
    case XVIDC_BPC_12: PixPrecisionIndex = 2; break;
    case XVIDC_BPC_16: PixPrecisionIndex = 3; break;
    default:           PixPrecisionIndex = 0; break;
  }
  XVprocSsPtr->CtxtData.PixelHStepSize = XVprocSs_PixelHStep[XVprocSsPtr->Config.PixPerClock>>1][PixPrecisionIndex];
  if(XVprocSs_IsConfigModeMax(XVprocSsPtr))
  {
	XVprocSsPtr->CtxtData.LboxBkgndColor = XLBOX_BKGND_BLACK;
    win.Width  = 400;
    win.Height = 400;
    win.StartX = win.StartY = 0;
    XVprocSs_SetZoomPipWindow(XVprocSsPtr,
                              XVPROCSS_ZOOM_WIN,
                              &win);
    XVprocSs_SetZoomPipWindow(XVprocSsPtr,
                              XVPROCSS_PIP_WIN,
                              &win);
  }
  XVprocSs_EnableBlock(XVprocSsPtr->RstAxisPtr,  GPIO_CH_RESET_SEL, XVPROCSS_RSTMASK_ALL_BLOCKS);
}
static void SetPowerOnDefaultState ( XVprocSs * XVprocSsPtr ) { XVidC_VideoStream vidStrmIn ; XVidC_VideoStream vidStrmOut ; XVidC_VideoWindow win ; u16 PixPrecisionIndex ; XVidC_VideoTiming const * TimingPtr ; memset ( & vidStrmIn , 0 , sizeof ( XVidC_VideoStream ) ) ; memset ( & vidStrmOut , 0 , sizeof ( XVidC_VideoStream ) ) ; vidStrmOut . VmId = XVIDC_VM_1920x1080_60_P ; vidStrmOut . ColorFormatId = XVIDC_CSF_RGB ; vidStrmOut . FrameRate = XVIDC_FR_60HZ ; vidStrmOut . IsInterlaced = FALSE ; vidStrmOut . ColorDepth = ( XVidC_ColorDepth ) XVprocSsPtr -> Config . ColorDepth ; vidStrmOut . PixPerClk = ( XVidC_PixelsPerClock ) XVprocSsPtr -> Config . PixPerClock ; TimingPtr = XVidC_GetTimingInfo ( vidStrmOut . VmId ) ; vidStrmOut . Timing = * TimingPtr ; vidStrmIn . VmId = XVIDC_VM_1920x1080_60_P ; vidStrmIn . ColorFormatId = XVIDC_CSF_RGB ; vidStrmIn . FrameRate = XVIDC_FR_60HZ ; vidStrmIn . IsInterlaced = FALSE ; vidStrmIn . ColorDepth = ( XVidC_ColorDepth ) XVprocSsPtr -> Config . ColorDepth ; vidStrmIn . PixPerClk = ( XVidC_PixelsPerClock ) XVprocSsPtr -> Config . PixPerClock ; TimingPtr = XVidC_GetTimingInfo ( vidStrmIn . VmId ) ; vidStrmIn . Timing = * TimingPtr ; XVprocSs_SetVidStreamIn ( XVprocSsPtr , & vidStrmIn ) ; XVprocSs_SetVidStreamOut ( XVprocSsPtr , & vidStrmOut ) ; XVprocSsPtr -> CtxtData . PixelWidthInBits = XVprocSsPtr -> Config . NumVidComponents * XVprocSsPtr -> VidIn . ColorDepth ; switch ( XVprocSsPtr -> Config . PixPerClock ) { case XVIDC_PPC_1 : case XVIDC_PPC_2 : if ( XVprocSsPtr -> Config . ColorDepth == XVIDC_BPC_10 ) { XVprocSsPtr -> CtxtData . PixelWidthInBits = ( ( XVprocSsPtr -> CtxtData . PixelWidthInBits + 7 ) / 8 ) * 8 ; } break ; default : break ; } switch ( XVprocSsPtr -> Config . ColorDepth ) { case XVIDC_BPC_8 : PixPrecisionIndex = 0 ; break ; case XVIDC_BPC_10 : PixPrecisionIndex = 1 ; break ; case XVIDC_BPC_12 : PixPrecisionIndex = 2 ; break ; case XVIDC_BPC_16 : PixPrecisionIndex = 3 ; break ; default : PixPrecisionIndex = 0 ; break ; } XVprocSsPtr -> CtxtData . PixelHStepSize = XVprocSs_PixelHStep [ XVprocSsPtr -> Config . PixPerClock >> 1 ] [ PixPrecisionIndex ] ; if ( XVprocSs_IsConfigModeMax ( XVprocSsPtr ) ) { XVprocSsPtr -> CtxtData . LboxBkgndColor = XLBOX_BKGND_BLACK ; win . Width = 400 ; win . Height = 400 ; win . StartX = win . StartY = 0 ; XVprocSs_SetZoomPipWindow ( XVprocSsPtr , XVPROCSS_ZOOM_WIN , & win ) ; XVprocSs_SetZoomPipWindow ( XVprocSsPtr , XVPROCSS_PIP_WIN , & win ) ; } XVprocSs_EnableBlock ( XVprocSsPtr -> RstAxisPtr , GPIO_CH_RESET_SEL , XVPROCSS_RSTMASK_ALL_BLOCKS ) ; }
This function configures the Video Processing subsystem internal blocks
to power on default configuration
This function configures the Video Processing subsystem internal blocks to power on default configuration
/* Setup Default Output Stream configuration */ /* Setup Default Input Stream configuration */ /* Setup Video Processing subsystem input/output  configuration */ /* compute data width supported by Vdma */ /* Align the bit width to next byte boundary for this particular case
	    * Num_Channel	Color Depth		PixelWidth		Align
	    * ----------------------------------------------------
	    *    2				10				20			 24
	    *    3				10				30			 32
	    *
	    *    HW will do the bit padding for 20->24 and 30->32
	    */ /* Set default Pip/Zoom window increment step size */ /* Set default PIP Background color */ /* Set default Zoom Window */ /* Set default PIP Window */ /* Release reset before programming any IP Block */