dppsu: xdppsu_spm.c File Reference

| dppsu Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xdppsu_spm.c File Reference

## Overview

This file contains the stream policy maker functions for the XDpPsu driver.

These functions set up the DisplayPort TX core's main stream attributes that determine how a video stream will be displayed.

Note
  None.

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.0   aad  01/17/17 Initial release.

## Functions
void | XDpPsu_SetColorEncode (XDpPsu *InstancePtr, XDpPsu_ColorEncoding ColorEncode)
| This function sets the output Video format for the DP core. More...
void | XDpPsu_CfgMsaRecalculate (XDpPsu *InstancePtr)
| This function calculates the following Main Stream Attributes (MSA): More...
void | XDpPsu_CfgMsaUseStandardVideoMode (XDpPsu *InstancePtr, XVidC_VideoMode VideoMode)
| This function sets the Main Stream Attribute (MSA) values in the configuration structure to match one of the standard display mode timings from the XDpPsu_DmtModes[] standard Display Monitor Timing (DMT) table. More...
void | XDpPsu_CfgMsaUseEdidPreferredTiming (XDpPsu *InstancePtr, u8 *Edid)
| This function sets the main stream attribute values in the configuration structure to match the preferred timing of the sink monitor. More...
void | XDpPsu_CfgMsaUseCustom (XDpPsu *InstancePtr, XDpPsu_MainStreamAttributes *MsaConfigCustom, u8 Recalculate)
| This function takes a the main stream attributes from MsaConfigCustom and copies them into InstancePtr->MsaConfig. More...
void | XDpPsu_CfgMsaSetBpc (XDpPsu *InstancePtr, u8 BitsPerColor)
| This function sets the bits per color value of the video stream. More...
void | XDpPsu_CfgMsaEnSynchClkMode (XDpPsu *InstancePtr, u8 Enable)
| This function enables or disables synchronous clock mode for a video stream. More...
void | XDpPsu_SetVideoMode (XDpPsu *InstancePtr)
| This function clears the main stream attributes registers of the DisplayPort TX core and sets them to the values specified in the main stream attributes configuration structure. More...
void | XDpPsu_SetMsaValues (XDpPsu *InstancePtr)
| This function sets the main stream attributes registers of the DisplayPort TX core with the values specified in the main stream attributes configuration structure. More...

## Function Documentation

void XDpPsu_CfgMsaEnSynchClkMode | ( | XDpPsu * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables or disables synchronous clock mode for a video stream.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance
  Enable | if set to 1, will enable synchronous clock mode. Otherwise, if set to 0, synchronous clock mode will be disabled.

Returns
  None.

Note
  None.

References XDpPsu_MainStreamAttributes::Misc0, XDpPsu::MsaConfig, XDpPsu_MainStreamAttributes::SynchronousClockMode, and XDPPSU_MAIN_STREAM_MISC0_COMPONENT_FORMAT_SHIFT.

void XDpPsu_CfgMsaRecalculate | ( | XDpPsu * | InstancePtr | ) |

This function calculates the following Main Stream Attributes (MSA):

     - Transfer unit size
     - User pixel width
     - Horizontal start
     - Vertical start
     - Horizontal total clock
     - Vertical total clock
     - Misc0
     - Misc1
     - Data per lane
     - Average number of bytes per transfer unit
     - Number of initial wait cycles

These values are derived from:

- Bits per color
- Horizontal resolution
- Vertical resolution
- Pixel clock (in KHz)
- Horizontal sync polarity
- Vertical sync polarity
- Horizontal front porch
- Horizontal sync pulse width
- Horizontal back porch
- Vertical front porch
- Vertical sync pulse width
- Vertical back porch

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  None.

Note
  The MsaConfig structure is modified with the new, calculated values. The main stream attributes that were used to derive the calculated values are untouched in the MsaConfig structure.

References XDpPsu_MainStreamAttributes::AvgBytesPerTU, XDpPsu_MainStreamAttributes::BitsPerColor, XDpPsu_MainStreamAttributes::ComponentFormat, XDpPsu_MainStreamAttributes::DataPerLane, XDpPsu_MainStreamAttributes::DynamicRange, XDpPsu_MainStreamAttributes::HStart, XDpPsu_MainStreamAttributes::InitWait, XDpPsu_LinkConfig::LaneCount, XDpPsu::LinkConfig, XDpPsu_LinkConfig::LinkRate, XDpPsu_MainStreamAttributes::Misc0, XDpPsu_MainStreamAttributes::Misc1, XDpPsu::MsaConfig, XDpPsu_MainStreamAttributes::NVid, XDpPsu_MainStreamAttributes::PixelClockHz, XDpPsu_MainStreamAttributes::SynchronousClockMode, XDpPsu_MainStreamAttributes::TransferUnitSize, XDpPsu_MainStreamAttributes::UserPixelWidth, XDpPsu_MainStreamAttributes::VStart, XDpPsu_MainStreamAttributes::Vtm, XDPPSU_LANE_COUNT_SET_1, XDPPSU_LANE_COUNT_SET_2, XDPPSU_LINK_BW_SET_162GBPS, XDPPSU_LINK_BW_SET_270GBPS, XDPPSU_LINK_BW_SET_540GBPS, XDPPSU_MAIN_STREAM_MISC0_BDC_10BPC, XDPPSU_MAIN_STREAM_MISC0_BDC_12BPC, XDPPSU_MAIN_STREAM_MISC0_BDC_16BPC, XDPPSU_MAIN_STREAM_MISC0_BDC_6BPC, XDPPSU_MAIN_STREAM_MISC0_BDC_8BPC, XDPPSU_MAIN_STREAM_MISC0_BDC_SHIFT, XDPPSU_MAIN_STREAM_MISC0_COMPONENT_FORMAT_SHIFT, XDPPSU_MAIN_STREAM_MISC0_COMPONENT_FORMAT_YCBCR422, XDPPSU_MAIN_STREAM_MISC0_DYNAMIC_RANGE_SHIFT, XDPPSU_MAIN_STREAM_MISC0_YCBCR_COLORIMETRY_SHIFT, XDPPSU_MAIN_STREAM_MISC1_Y_ONLY_EN_MASK, and XDpPsu_MainStreamAttributes::YCbCrColorimetry.

Referenced by XDpPsu_CfgMsaSetBpc(), XDpPsu_CfgMsaUseCustom(), XDpPsu_CfgMsaUseEdidPreferredTiming(), and XDpPsu_CfgMsaUseStandardVideoMode().

void XDpPsu_CfgMsaSetBpc | ( | XDpPsu * | InstancePtr,
|  | u8 | BitsPerColor
| ) |  |

This function sets the bits per color value of the video stream.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance
  BitsPerColor | is the new number of bits per color to use.

Returns
  None.

Note
  The InstancePtr->MsaConfig structure is modified to reflect the new main stream attributes associated with a new bits per color value.

References XDpPsu_MainStreamAttributes::BitsPerColor, XDpPsu::MsaConfig, and XDpPsu_CfgMsaRecalculate().

void XDpPsu_CfgMsaUseCustom | ( | XDpPsu * | InstancePtr,
|  | XDpPsu_MainStreamAttributes * | MsaConfigCustom,
|  | u8 | Recalculate
| ) |  |

This function takes a the main stream attributes from MsaConfigCustom and copies them into InstancePtr->MsaConfig.

If desired, given a base set of attributes, the rest of the attributes may be derived. The minimal required main stream attributes (MSA) that must be contained in the MsaConfigCustom structure are:

- Pixel clock (in Hz)
- Horizontal sync polarity
- Vertical sync polarity
- Horizontal sync pulse width
- Vertical sync pulse width
- Horizontal resolution
- Vertical resolution
- Vertical back porch
- Vertical front porch
- Horizontal back porch
- Horizontal front porch

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  MsaConfigCustom | is the structure that will be used to copy the main stream attributes from (into InstancePtr->MsaConfig).
  Recalculate | is a boolean enable that determines whether or not the main stream attributes should be recalculated.

Returns
  None.

Note
  The InstancePtr->MsaConfig structure is modified with the new values.

References XDpPsu_MainStreamAttributes::AvgBytesPerTU, XDpPsu_MainStreamAttributes::DataPerLane, XDpPsu_MainStreamAttributes::HStart, XDpPsu_MainStreamAttributes::InitWait, XDpPsu_MainStreamAttributes::Misc0, XDpPsu_MainStreamAttributes::Misc1, XDpPsu::MsaConfig, XDpPsu_MainStreamAttributes::NVid, XDpPsu_MainStreamAttributes::PixelClockHz, XDpPsu_MainStreamAttributes::TransferUnitSize, XDpPsu_MainStreamAttributes::UserPixelWidth, XDpPsu_MainStreamAttributes::VStart, XDpPsu_MainStreamAttributes::Vtm, and XDpPsu_CfgMsaRecalculate().

void XDpPsu_CfgMsaUseEdidPreferredTiming | ( | XDpPsu * | InstancePtr,
|  | u8 * | Edid
| ) |  |

This function sets the main stream attribute values in the configuration structure to match the preferred timing of the sink monitor.

This Preferred Timing Mode (PTM) information is stored in the sink's Extended Display Identification Data (EDID).

Parameters

  InstancePtr | is a pointer to the XDpPsu instance
  Edid | is a pointer to the Edid to use for the specified stream.

Returns
  None.

Note
  The InstancePtr->MsaConfig structure is modified to reflect the main stream attribute values associated to the preferred timing of the sink monitor.

References XDpPsu::MsaConfig, XDpPsu_MainStreamAttributes::PixelClockHz, XDpPsu_MainStreamAttributes::Vtm, and XDpPsu_CfgMsaRecalculate().

void XDpPsu_CfgMsaUseStandardVideoMode | ( | XDpPsu * | InstancePtr,
|  | XVidC_VideoMode | VideoMode
| ) |  |

This function sets the Main Stream Attribute (MSA) values in the configuration structure to match one of the standard display mode timings from the XDpPsu_DmtModes[] standard Display Monitor Timing (DMT) table.

The XDpPsu_VideoMode enumeration in xdppsu.h lists the available video modes.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  VideoMode | is one of the enumerated standard video modes that is used to determine the MSA values to be used.

Returns
  None.

Note
  The InstancePtr->MsaConfig structure is modified to reflect the MSA values associated to the specified video mode.

References XDpPsu::MsaConfig, XDpPsu_MainStreamAttributes::PixelClockHz, XDpPsu_MainStreamAttributes::Vtm, and XDpPsu_CfgMsaRecalculate().

void XDpPsu_SetColorEncode | ( | XDpPsu * | InstancePtr,
|  | XDpPsu_ColorEncoding | ColorEncode
| ) |  |

This function sets the output Video format for the DP core.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  ColorEncode | is an enumarator for output color encoding schemes

Returns
  None.

Note
  The MsaConfig structure is modified with the new, calculated values. The main stream attributes that were used to derive the calculated values are untouched in the MsaConfig structure.

References XDpPsu_MainStreamAttributes::ComponentFormat, XDpPsu_MainStreamAttributes::DynamicRange, XDpPsu_MainStreamAttributes::Misc0, XDpPsu_MainStreamAttributes::Misc1, XDpPsu::MsaConfig, XDPPSU_CENC_RGB, XDPPSU_CENC_XVYCC_422_BT601, XDPPSU_CENC_XVYCC_422_BT709, XDPPSU_CENC_XVYCC_444_BT601, XDPPSU_CENC_XVYCC_444_BT709, XDPPSU_CENC_YCBCR_422_BT601, XDPPSU_CENC_YCBCR_422_BT709, XDPPSU_CENC_YCBCR_444_BT601, XDPPSU_CENC_YCBCR_444_BT709, XDPPSU_CENC_YONLY, XDPPSU_MAIN_STREAM_MISC0_COMPONENT_FORMAT_RGB, XDPPSU_MAIN_STREAM_MISC0_COMPONENT_FORMAT_YCBCR422, XDPPSU_MAIN_STREAM_MISC0_COMPONENT_FORMAT_YCBCR444, XDPPSU_MAIN_STREAM_MISC1_Y_ONLY_EN_MASK, and XDpPsu_MainStreamAttributes::YCbCrColorimetry.

void XDpPsu_SetMsaValues | ( | XDpPsu * | InstancePtr | ) |

This function sets the main stream attributes registers of the DisplayPort TX core with the values specified in the main stream attributes configuration structure.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  None.

Note
  None.

References XDpPsu_MainStreamAttributes::AvgBytesPerTU, XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu_MainStreamAttributes::DataPerLane, XDpPsu_MainStreamAttributes::HStart, XDpPsu_MainStreamAttributes::InitWait, XDpPsu::IsReady, XDpPsu_MainStreamAttributes::Misc0, XDpPsu_MainStreamAttributes::Misc1, XDpPsu::MsaConfig, XDpPsu_MainStreamAttributes::NVid, XDpPsu_MainStreamAttributes::PixelClockHz, XDpPsu_MainStreamAttributes::TransferUnitSize, XDpPsu_MainStreamAttributes::UserPixelWidth, XDpPsu_MainStreamAttributes::VStart, XDpPsu_MainStreamAttributes::Vtm, XDPPSU_FRAC_BYTES_PER_TU, XDPPSU_INIT_WAIT, XDPPSU_M_VID, XDPPSU_MAIN_STREAM_HRES, XDPPSU_MAIN_STREAM_HSTART, XDPPSU_MAIN_STREAM_HSWIDTH, XDPPSU_MAIN_STREAM_HTOTAL, XDPPSU_MAIN_STREAM_MISC0, XDPPSU_MAIN_STREAM_MISC1, XDPPSU_MAIN_STREAM_POLARITY, XDPPSU_MAIN_STREAM_POLARITY_VSYNC_POL_SHIFT, XDPPSU_MAIN_STREAM_VRES, XDPPSU_MAIN_STREAM_VSTART, XDPPSU_MAIN_STREAM_VSWIDTH, XDPPSU_MAIN_STREAM_VTOTAL, XDPPSU_MIN_BYTES_PER_TU, XDPPSU_N_VID, XDPPSU_TU_SIZE, XDPPSU_USER_DATA_COUNT_PER_LANE, XDPPSU_USER_PIXEL_WIDTH, and XDpPsu_WriteReg.

Referenced by XDpPsu_SetVideoMode().

void XDpPsu_SetVideoMode | ( | XDpPsu * | InstancePtr | ) |

This function clears the main stream attributes registers of the DisplayPort TX core and sets them to the values specified in the main stream attributes configuration structure.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance

Returns
  None.

Note
  None.

References XDpPsu::IsReady, and XDpPsu_SetMsaValues().