XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c
static int SetupModeCscOnly(XVprocSs *XVprocSsPtr)
{
  XVidC_ColorFormat CscIn, CscOut;
  XVidC_ColorStd StdIn, StdOut;
  XVidC_ColorRange RangeOut;
  XVidC_ColorDepth ColorDepth;
  u32 HeightOut = 0;
  u32 WidthOut = 0;
  u16 Allow422;
  u16 Allow420;
  int status = XST_SUCCESS;

  if(!XVprocSsPtr->CscPtr) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_IPABSENT);
    return(XST_FAILURE);
  }

  Allow422 = XV_CscIs422Enabled(XVprocSsPtr->CscPtr);
  Allow420 = XV_CscIs420Enabled(XVprocSsPtr->CscPtr);

  /* check if input/output stream configuration is supported */
  status = ValidateCscOnlyConfig(XVprocSsPtr, Allow422, Allow420);

  if(status ==  XST_SUCCESS) {
    /* In the single-IP cases the reset has been done outside this routine */

	// when setting up a new resolution, start with default picture settings
    XV_CscSetPowerOnDefaultState(XVprocSsPtr->CscPtr);

	// set the proper color depth: get it from the vprocss config
	ColorDepth = (XVidC_ColorDepth)XVprocSs_GetColorDepth(XVprocSsPtr);
	XV_CscSetColorDepth(XVprocSsPtr->CscPtr, ColorDepth);

	// all other picture settings are filled in by XV_CscSetColorspace
    CscIn = XVprocSsPtr->VidIn.ColorFormatId;
    CscOut = XVprocSsPtr->VidOut.ColorFormatId;
    StdIn = XVprocSsPtr->CscPtr->StandardIn;
    StdOut = XVprocSsPtr->CscPtr->StandardOut;
    RangeOut = XVprocSsPtr->CscPtr->OutputRange;
    XV_CscSetColorspace(XVprocSsPtr->CscPtr,
                        CscIn, CscOut,
                        StdIn, StdOut,
                        RangeOut);

	// set the Global Window size
	HeightOut = XVprocSsPtr->VidOut.Timing.VActive;
    WidthOut = XVprocSsPtr->VidOut.Timing.HActive;
    XV_CscSetActiveSize(XVprocSsPtr->CscPtr,
                        WidthOut,
                        HeightOut);

    /* Start Csc sub-core */
    XV_CscStart(XVprocSsPtr->CscPtr);
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_SETUPOK);
  } else {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_IGNORE);
  }
  return(status);
}
/*****************************************************************************/
/**
* This function configures the video subsystem pipeline for CscOnly
* topology of the subsystem
*
* @param  XVprocSsPtr is a pointer to the Subsystem instance to be worked on.
*
* @return XST_SUCCESS if successful else XST_FAILURE
*
* @note If use case is possible the subsystem will configure the sub-cores
*       accordingly else will ignore the request
*
******************************************************************************/
This function configures the video subsystem pipeline for CscOnly
topology of the subsystem
This function configures the video subsystem pipeline for CscOnly topology of the subsystem
static int SetupModeCscOnly(XVprocSs *XVprocSsPtr)
{
  XVidC_ColorFormat CscIn, CscOut;
  XVidC_ColorStd StdIn, StdOut;
  XVidC_ColorRange RangeOut;
  XVidC_ColorDepth ColorDepth;
  u32 HeightOut = 0;
  u32 WidthOut = 0;
  u16 Allow422;
  u16 Allow420;
  int status = XST_SUCCESS;
  if(!XVprocSsPtr->CscPtr) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_IPABSENT);
    return(XST_FAILURE);
  }
  Allow422 = XV_CscIs422Enabled(XVprocSsPtr->CscPtr);
  Allow420 = XV_CscIs420Enabled(XVprocSsPtr->CscPtr);
  status = ValidateCscOnlyConfig(XVprocSsPtr, Allow422, Allow420);
  if(status ==  XST_SUCCESS) {
    XV_CscSetPowerOnDefaultState(XVprocSsPtr->CscPtr);
	ColorDepth = (XVidC_ColorDepth)XVprocSs_GetColorDepth(XVprocSsPtr);
	XV_CscSetColorDepth(XVprocSsPtr->CscPtr, ColorDepth);
    CscIn = XVprocSsPtr->VidIn.ColorFormatId;
    CscOut = XVprocSsPtr->VidOut.ColorFormatId;
    StdIn = XVprocSsPtr->CscPtr->StandardIn;
    StdOut = XVprocSsPtr->CscPtr->StandardOut;
    RangeOut = XVprocSsPtr->CscPtr->OutputRange;
    XV_CscSetColorspace(XVprocSsPtr->CscPtr,
                        CscIn, CscOut,
                        StdIn, StdOut,
                        RangeOut);
	HeightOut = XVprocSsPtr->VidOut.Timing.VActive;
    WidthOut = XVprocSsPtr->VidOut.Timing.HActive;
    XV_CscSetActiveSize(XVprocSsPtr->CscPtr,
                        WidthOut,
                        HeightOut);
    XV_CscStart(XVprocSsPtr->CscPtr);
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_SETUPOK);
  } else {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_IGNORE);
  }
  return(status);
}
static int SetupModeCscOnly ( XVprocSs * XVprocSsPtr ) { XVidC_ColorFormat CscIn , CscOut ; XVidC_ColorStd StdIn , StdOut ; XVidC_ColorRange RangeOut ; XVidC_ColorDepth ColorDepth ; u32 HeightOut = 0 ; u32 WidthOut = 0 ; u16 Allow422 ; u16 Allow420 ; int status = XST_SUCCESS ; if ( ! XVprocSsPtr -> CscPtr ) { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_IPABSENT ) ; return ( XST_FAILURE ) ; } Allow422 = XV_CscIs422Enabled ( XVprocSsPtr -> CscPtr ) ; Allow420 = XV_CscIs420Enabled ( XVprocSsPtr -> CscPtr ) ; status = ValidateCscOnlyConfig ( XVprocSsPtr , Allow422 , Allow420 ) ; if ( status == XST_SUCCESS ) { XV_CscSetPowerOnDefaultState ( XVprocSsPtr -> CscPtr ) ; ColorDepth = ( XVidC_ColorDepth ) XVprocSs_GetColorDepth ( XVprocSsPtr ) ; XV_CscSetColorDepth ( XVprocSsPtr -> CscPtr , ColorDepth ) ; CscIn = XVprocSsPtr -> VidIn . ColorFormatId ; CscOut = XVprocSsPtr -> VidOut . ColorFormatId ; StdIn = XVprocSsPtr -> CscPtr -> StandardIn ; StdOut = XVprocSsPtr -> CscPtr -> StandardOut ; RangeOut = XVprocSsPtr -> CscPtr -> OutputRange ; XV_CscSetColorspace ( XVprocSsPtr -> CscPtr , CscIn , CscOut , StdIn , StdOut , RangeOut ) ; HeightOut = XVprocSsPtr -> VidOut . Timing . VActive ; WidthOut = XVprocSsPtr -> VidOut . Timing . HActive ; XV_CscSetActiveSize ( XVprocSsPtr -> CscPtr , WidthOut , HeightOut ) ; XV_CscStart ( XVprocSsPtr -> CscPtr ) ; XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_SETUPOK ) ; } else { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_IGNORE ) ; } return ( status ) ; }
This function configures the video subsystem pipeline for CscOnly
topology of the subsystem
This function configures the video subsystem pipeline for CscOnly topology of the subsystem
/* check if input/output stream configuration is supported */ /* In the single-IP cases the reset has been done outside this routine */ // when setting up a new resolution, start with default picture settings // set the proper color depth: get it from the vprocss config // all other picture settings are filled in by XV_CscSetColorspace // set the Global Window size /* Start Csc sub-core */