dppsu: xdppsu.h File Reference

| dppsu Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Data Structures | Typedefs | Enumerations | Functions
xdppsu.h File Reference

## Overview

The Xilinx DisplayPort transmitter (DPTX_PS) driver.

This driver supports the Xilinx DisplayPort PS core in TX mode. This driver follows the DisplayPort 1.2a specification.

The Xilinx DisplayPort soft IP supports the following features:

- 1, 2 lanes.
- A link rate of 1.62, 2.70, or 5.40Gbps per lane.
- 1, 2, or 4 pixel-wide video interfaces.
- RGB and YCbCr color space.
- Up to 12 bits per component.
- Up to 4Kx2K monitor resolution.
- Auto lane rate and width negotiation.
- I2C over a 1Mb/s AUX channel.
- Secondary channel audio support (2 channels).

    MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.0   aad  05/17/14 Initial release.

## Data Structures
struct | XDpPsu_Config
| This typedef contains configuration information for the DisplayPort TX core. More...
struct | XDpPsu_SinkConfig
| This typedef contains configuration information about the RX device. More...
struct | XDpPsu_LinkConfig
| This typedef contains configuration information about the main link settings. More...
struct | XDpPsu_MainStreamAttributes
| This typedef contains the main stream attributes which determine how the video will be displayed. More...
struct | XDpPsu_BoardChar
| This typedef describes some board characteristics information that affects link training. More...
struct | XDpPsu
| The XDpPsu driver instance data. More...

## Typedefs
typedef void(* | XDpPsu_HpdEventHandler )(void *InstancePtr)
| Callback type which represents the handler for a Hot-Plug-Detect (HPD) event interrupt. More...
typedef void(* | XDpPsu_HpdPulseHandler )(void *InstancePtr)
| Callback type which represents the handler for a Hot-Plug-Detect (HPD) pulse interrupt. More...

## Enumerations
enum | XDpPsu_ColorEncoding { XDPPSU_CENC_RGB = 0, 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 }
| This typedef contains the color encoding schemes that are supported. More...

## Functions
u32 | XDpPsu_InitializeTx (XDpPsu *InstancePtr)
| This function prepares the DisplayPort TX core for use. More...
void | XDpPsu_CfgInitialize (XDpPsu *InstancePtr, XDpPsu_Config *ConfigPtr, u32 EffectiveAddr)
| This function retrieves the configuration for this DisplayPort TX instance and fills in the InstancePtr->Config structure. More...
u32 | XDpPsu_GetRxCapabilities (XDpPsu *InstancePtr)
| This function retrieves the RX device's capabilities from the RX device's DisplayPort Configuration Data (DPCD). More...
u32 | XDpPsu_CfgMainLinkMax (XDpPsu *InstancePtr)
| This function determines the common capabilities between the DisplayPort TX core and the RX device. More...
u32 | XDpPsu_EstablishLink (XDpPsu *InstancePtr)
| This function checks if the link needs training and runs the training sequence if training is required. More...
u32 | XDpPsu_CheckLinkStatus (XDpPsu *InstancePtr, u8 LaneCount)
| This function checks if the reciever's DisplayPort Configuration Data (DPCD) indicates the reciever has achieved and maintained clock recovery, channel equalization, symbol lock, and interlane alignment for all lanes currently in use. More...
u32 | XDpPsu_AuxRead (XDpPsu *InstancePtr, u32 DpcdAddress, u32 BytesToRead, void *ReadData)
| This function issues a read request over the AUX channel that will read from the RX device's DisplayPort Configuration Data (DPCD) address space. More...
u32 | XDpPsu_AuxWrite (XDpPsu *InstancePtr, u32 DpcdAddress, u32 BytesToWrite, void *WriteData)
| This function issues a write request over the AUX channel that will write to the RX device's DisplayPort Configuration Data (DPCD) address space. More...
u32 | XDpPsu_IicRead (XDpPsu *InstancePtr, u8 IicAddress, u16 Offset, u16 BytesToRead, void *ReadData)
| This function performs an I2C read over the AUX channel. More...
u32 | XDpPsu_IicWrite (XDpPsu *InstancePtr, u8 IicAddress, u8 BytesToWrite, void *WriteData)
| This function performs an I2C write over the AUX channel. More...
u32 | XDpPsu_SetDownspread (XDpPsu *InstancePtr, u8 Enable)
| This function enables or disables 0.5% spreading of the clock for both the DisplayPort and the RX device. More...
u32 | XDpPsu_SetEnhancedFrameMode (XDpPsu *InstancePtr, u8 Enable)
| This function enables or disables the enhanced framing symbol sequence for both the DisplayPort TX core and the RX device. More...
u32 | XDpPsu_SetLaneCount (XDpPsu *InstancePtr, u8 LaneCount)
| This function sets the number of lanes to be used by the main link for both the DisplayPort TX core and the RX device. More...
u32 | XDpPsu_SetLinkRate (XDpPsu *InstancePtr, u8 LinkRate)
| This function sets the data rate to be used by the main link for both the DisplayPort TX core and the RX device. More...
u32 | XDpPsu_SetScrambler (XDpPsu *InstancePtr, u8 Enable)
| This function enables or disables scrambling of symbols for both the DisplayPort and the RX device. More...
u32 | XDpPsu_IsConnected (XDpPsu *InstancePtr)
| This function checks if there is a connected RX device. More...
void | XDpPsu_EnableMainLink (XDpPsu *InstancePtr, u8 Enable)
| This function enables the main link. More...
void | XDpPsu_ResetPhy (XDpPsu *InstancePtr, u32 Reset)
| This function does a PHY reset. 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...
void | XDpPsu_SetHpdEventHandler (XDpPsu *InstancePtr, XDpPsu_HpdEventHandler CallbackFunc, void *CallbackRef)
| This function installs a callback function for when a hot-plug-detect event interrupt occurs. More...
void | XDpPsu_SetHpdPulseHandler (XDpPsu *InstancePtr, XDpPsu_HpdPulseHandler CallbackFunc, void *CallbackRef)
| This function installs a callback function for when a hot-plug-detect pulse interrupt occurs. More...
void | XDpPsu_HpdInterruptHandler (XDpPsu *InstancePtr)
| This function is the interrupt handler for the XDpPsu driver. More...
u32 | XDpPsu_SelfTest (XDpPsu *InstancePtr)
| This function runs a self-test on the XDpPsu driver/device. More...
XDpPsu_Config * | XDpPsu_LookupConfig (u16 DeviceId)
| This function looks for the device configuration based on the unique device ID. More...
u32 | XDpPsu_GetEdid (XDpPsu *InstancePtr, u8 *Edid)
| This function retrieves an immediately connected RX device's Extended Display Identification Data (EDID) structure. More...
u32 | XDpPsu_GetEdidBlock (XDpPsu *InstancePtr, u8 *Data, u8 BlockNum)
| Retrieve an immediately connected RX device's Extended Display Identification Data (EDID) block given the block number. More...
u32 | XDpPsu_GetDispIdDataBlock (u8 *DisplayIdRaw, u8 SectionTag, u8 **DataBlockPtr)
| Given a section tag, search for and retrieve the appropriate section data block that is part of the specified DisplayID structure. More...
void | XDpPsu_SetColorEncode (XDpPsu *InstancePtr, XDpPsu_ColorEncoding ColorEncode)
| This function sets the output Video format for the DP core. More...

## Typedef Documentation

typedef void(* XDpPsu_HpdEventHandler)(void *InstancePtr)

Callback type which represents the handler for a Hot-Plug-Detect (HPD) event interrupt.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Note
  None.

typedef void(* XDpPsu_HpdPulseHandler)(void *InstancePtr)

Callback type which represents the handler for a Hot-Plug-Detect (HPD) pulse interrupt.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Note
  None.

## Enumeration Type Documentation

enum XDpPsu_ColorEncoding

This typedef contains the color encoding schemes that are supported.

Enumerator
XDPPSU_CENC_RGB | RGB Color Encoding.
XDPPSU_CENC_XVYCC_422_BT601 | XVYCC 422 Color Encoding BT601 standard.
XDPPSU_CENC_XVYCC_422_BT709 | XVYCC 422 Color Encoding BT709 standard.
XDPPSU_CENC_XVYCC_444_BT601 | XVYCC 444 Color Encoding BT601 standard.
XDPPSU_CENC_XVYCC_444_BT709 | XVYCC 444 Color Encoding BT709 standard.
XDPPSU_CENC_YCBCR_422_BT601 | YCbCr 422 Color Encoding BT601 standard.
XDPPSU_CENC_YCBCR_422_BT709 | YCbCr 422 Color Encoding BT709 standard.
XDPPSU_CENC_YCBCR_444_BT601 | XVYCC 444 Color Encoding BT601 standard.
XDPPSU_CENC_YCBCR_444_BT709 | XVYCC 444 Color Encoding BT709 standard.
XDPPSU_CENC_YONLY | XVYCC 422 Color Encoding BT709 standard.

## Function Documentation

u32 XDpPsu_AuxRead | ( | XDpPsu * | InstancePtr,
|  | u32 | DpcdAddress,
|  | u32 | BytesToRead,
|  | void * | ReadData
| ) |  |

This function issues a read request over the AUX channel that will read from the RX device's DisplayPort Configuration Data (DPCD) address space.

The read message will be divided into multiple transactions which read a maximum of 16 bytes each.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  DpcdAddress | is the starting address to read from the RX device.
  BytesToRead | is the number of bytes to read from the RX device.
  ReadData | is a pointer to the data buffer that will be filled with read data.

Returns
  - XST_SUCCESS if the AUX read request was successfully acknowledged.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_ERROR_COUNT_MAX if the AUX request timed out.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::IsReady, and XDPPSU_AUX_CMD_READ.

Referenced by XDpPsu_GetRxCapabilities(), XDpPsu_SetDownspread(), XDpPsu_SetEnhancedFrameMode(), XDpPsu_SetLaneCount(), and XDpPsu_SetScrambler().

u32 XDpPsu_AuxWrite | ( | XDpPsu * | InstancePtr,
|  | u32 | DpcdAddress,
|  | u32 | BytesToWrite,
|  | void * | WriteData
| ) |  |

This function issues a write request over the AUX channel that will write to the RX device's DisplayPort Configuration Data (DPCD) address space.

The write message will be divided into multiple transactions which write a maximum of 16 bytes each.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  DpcdAddress | is the starting address to write to the RX device.
  BytesToWrite | is the number of bytes to write to the RX device.
  WriteData | is a pointer to the data buffer that contains the data to be written to the RX device.

Returns
  - XST_SUCCESS if the AUX write request was successfully acknowledged.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_ERROR_COUNT_MAX if the AUX request timed out.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::IsReady, and XDPPSU_AUX_CMD_WRITE.

Referenced by XDpPsu_SetDownspread(), XDpPsu_SetEnhancedFrameMode(), XDpPsu_SetLaneCount(), XDpPsu_SetLinkRate(), and XDpPsu_SetScrambler().

void XDpPsu_CfgInitialize | ( | XDpPsu * | InstancePtr,
|  | XDpPsu_Config * | ConfigPtr,
|  | u32 | EffectiveAddr
| ) |  |

This function retrieves the configuration for this DisplayPort TX instance and fills in the InstancePtr->Config structure.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  ConfigPtr | is a pointer to the configuration structure that will be used to copy the settings from.
  EffectiveAddr | is the device base address in the virtual memory space. If the address translation is not used, then the physical address is passed.

Returns
  None.

Note
  Unexpected errors may occur if the address mapping is changed after this function is invoked.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu_Config::DeviceId, XDpPsu::IsReady, and XDpPsu::SAxiClkHz.

Referenced by DpPsu_SelfTestExample().

u32 XDpPsu_CfgMainLinkMax | ( | XDpPsu * | InstancePtr | ) |

This function determines the common capabilities between the DisplayPort TX core and the RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  - XST_SUCCESS if main link settings were successfully set.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::IsReady, XDpPsu::LinkConfig, XDpPsu_LinkConfig::MaxLaneCount, XDpPsu_LinkConfig::MaxLinkRate, XDpPsu_SetLaneCount(), and XDpPsu_SetLinkRate().

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().

u32 XDpPsu_CheckLinkStatus | ( | XDpPsu * | InstancePtr,
|  | u8 | LaneCount
| ) |  |

This function checks if the reciever's DisplayPort Configuration Data (DPCD) indicates the reciever has achieved and maintained clock recovery, channel equalization, symbol lock, and interlane alignment for all lanes currently in use.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  LaneCount | is the number of lanes to check.

Returns
  - XST_SUCCESS if the RX device has maintained clock recovery, channel equalization, symbol lock, and interlane alignment.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::IsReady, XDPPSU_LANE_COUNT_SET_1, and XDPPSU_LANE_COUNT_SET_2.

Referenced by XDpPsu_EstablishLink().

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

This function enables the main link.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Enable | is a control flag to enable or disable main link

Returns
  None.

Note
  Enable = 1, Enable main link Enable =0, Disable main link.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDPPSU_ENABLE_MAIN_STREAM, XDPPSU_FORCE_SCRAMBLER_RESET, and XDpPsu_WriteReg.

Referenced by XDpPsu_EstablishLink().

u32 XDpPsu_EstablishLink | ( | XDpPsu * | InstancePtr | ) |

This function checks if the link needs training and runs the training sequence if training is required.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  - XST_SUCCESS was either already trained, or has been trained successfully.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDpPsu_LinkConfig::LaneCount, XDpPsu::LinkConfig, XDpPsu_LinkConfig::LinkRate, XDpPsu_CheckLinkStatus(), XDPPSU_ENABLE_MAIN_STREAM, XDpPsu_EnableMainLink(), 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_PHY_CONFIG_PHY_RESET_MASK, XDPPSU_PHY_CONFIG_TX_PHY_8B10BEN_MASK, XDpPsu_ReadReg, XDpPsu_ResetPhy(), and XDPPSU_TRAINING_PATTERN_SET_OFF.

u32 XDpPsu_GetDispIdDataBlock | ( | u8 * | DisplayIdRaw,
|  | u8 | SectionTag,
|  | u8 ** | DataBlockPtr
| ) |  |

Given a section tag, search for and retrieve the appropriate section data block that is part of the specified DisplayID structure.

Parameters

  DisplayIdRaw | is a pointer to the DisplayID data.
  SectionTag | is the tag to search for that represents the desired section data block.
  DataBlockPtr | will be set by this function to point to the appropriate section data block that is part of the DisplayIdRaw.

Returns
  - XST_SUCCESS if the section data block with the specified tag was found.
  - XST_FAILURE otherwise.

Note
  The DataBlockPtr argument is modified to point to the entry in DisplayIdRaw that represents the beginning of the desired section data block.

u32 XDpPsu_GetEdid | ( | XDpPsu * | InstancePtr,
|  | u8 * | Edid
| ) |  |

This function retrieves an immediately connected RX device's Extended Display Identification Data (EDID) structure.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Edid | is a pointer to the Edid buffer to save to.

Returns
  - XST_SUCCESS if the I2C transactions to read the EDID were successful.
  - XST_ERROR_COUNT_MAX if the EDID read request timed out.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::IsReady, and XDpPsu_GetEdidBlock().

u32 XDpPsu_GetEdidBlock | ( | XDpPsu * | InstancePtr,
|  | u8 * | Data,
|  | u8 | BlockNum
| ) |  |

Retrieve an immediately connected RX device's Extended Display Identification Data (EDID) block given the block number.

A block number of 0 represents the base EDID and subsequent block numbers represent EDID extension blocks.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Data | is a pointer to the data buffer to save the block data to.
  BlockNum | is the EDID block number to retrieve.

Returns
  - XST_SUCCESS if the block read has successfully completed with no errors.
  - XST_ERROR_COUNT_MAX if a time out occurred while attempting to read the requested block.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_IicRead().

Referenced by XDpPsu_GetEdid().

u32 XDpPsu_GetRxCapabilities | ( | XDpPsu * | InstancePtr | ) |

This function retrieves the RX device's capabilities from the RX device's DisplayPort Configuration Data (DPCD).

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  - XST_SUCCESS if the DisplayPort Configuration Data was read successfully.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::Config, XDpPsu_SinkConfig::DpcdRxCapsField, XDpPsu::IsReady, XDpPsu::LinkConfig, XDpPsu_LinkConfig::MaxLaneCount, XDpPsu_LinkConfig::MaxLinkRate, XDpPsu::RxConfig, XDpPsu_LinkConfig::SupportDownspreadControl, XDpPsu_LinkConfig::SupportEnhancedFramingMode, and XDpPsu_AuxRead().

void XDpPsu_HpdInterruptHandler | ( | XDpPsu * | InstancePtr | ) |

This function is the interrupt handler for the XDpPsu driver.

When an interrupt happens, it first detects what kind of interrupt happened, then decides which callback function to invoke.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  None.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::HpdEventCallbackRef, XDpPsu::HpdEventHandler, XDpPsu::HpdPulseCallbackRef, XDpPsu::HpdPulseHandler, XDPPSU_HPD_DURATION, XDPPSU_INTR_HPD_EVENT_MASK, XDPPSU_INTR_HPD_PULSE_DETECTED_MASK, XDPPSU_INTR_STATUS, XDpPsu_IsConnected(), XDpPsu_ReadReg, and XDpPsu_WriteReg.

u32 XDpPsu_IicRead | ( | XDpPsu * | InstancePtr,
|  | u8 | IicAddress,
|  | u16 | Offset,
|  | u16 | BytesToRead,
|  | void * | ReadData
| ) |  |

This function performs an I2C read over the AUX channel.

The read message will be divided into multiple transactions if the requested data spans multiple segments. The segment pointer is automatically incremented and the offset is calibrated as needed. E.g. For an overall offset of:

- 128, an I2C read is done on segptr=0; offset=128.
- 256, an I2C read is done on segptr=1; offset=0.
- 384, an I2C read is done on segptr=1; offset=128.
- 512, an I2C read is done on segptr=2; offset=0.
- etc.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  IicAddress | is the address on the I2C bus of the target device.
  Offset | is the offset at the specified address of the targeted I2C device that the read will start from.
  BytesToRead | is the number of bytes to read.
  ReadData | is a pointer to a buffer that will be filled with the I2C read data.

Returns
  - XST_SUCCESS if the I2C read has successfully completed with no errors.
  - XST_ERROR_COUNT_MAX if the AUX request timed out.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDPPSU_AUX_CMD_I2C_READ, XDPPSU_AUX_CMD_I2C_WRITE_MOT, XDpPsu_IicWrite(), XDPPSU_INTR_HPD_EVENT_MASK, XDPPSU_INTR_STATUS, and XDpPsu_ReadReg.

Referenced by XDpPsu_GetEdidBlock().

u32 XDpPsu_IicWrite | ( | XDpPsu * | InstancePtr,
|  | u8 | IicAddress,
|  | u8 | BytesToWrite,
|  | void * | WriteData
| ) |  |

This function performs an I2C write over the AUX channel.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  IicAddress | is the address on the I2C bus of the target device.
  BytesToWrite | is the number of bytes to write.
  WriteData | is a pointer to a buffer which will be used as the data source for the write.

Returns
  - XST_SUCCESS if the I2C write has successfully completed with no errors.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_ERROR_COUNT_MAX if the AUX request timed out.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu::IsReady, and XDPPSU_AUX_CMD_I2C_WRITE.

Referenced by XDpPsu_IicRead().

u32 XDpPsu_InitializeTx | ( | XDpPsu * | InstancePtr | ) |

This function prepares the DisplayPort TX core for use.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  - XST_SUCCESS if the DisplayPort TX core was successfully initialized.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDpPsu::SAxiClkHz, XDPPSU_AUX_CLK_DIVIDER, XDPPSU_AUX_CLK_DIVIDER_VAL_MASK, XDPPSU_DP_DISABLE, XDPPSU_DP_ENABLE, XDPPSU_ENABLE, XDPPSU_INTR_HPD_EVENT_MASK, XDPPSU_INTR_HPD_IRQ_MASK, XDPPSU_INTR_HPD_PULSE_DETECTED_MASK, XDPPSU_INTR_MASK, XDPPSU_PHY_CLOCK_SELECT, XDPPSU_PHY_CLOCK_SELECT_540GBPS, XDPPSU_PHY_CONFIG, XDPPSU_PHY_CONFIG_GT_ALL_RESET_MASK, XDpPsu_ReadReg, XDPPSU_SOFT_RESET, XDPPSU_SOFT_RESET_EN, and XDpPsu_WriteReg.

u32 XDpPsu_IsConnected | ( | XDpPsu * | InstancePtr | ) |

This function checks if there is a connected RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  - TRUE if there is a connection.
  - FALSE if there is no connection.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDPPSU_INTERRUPT_SIG_STATE, XDPPSU_INTERRUPT_SIG_STATE_HPD_STATE_MASK, and XDpPsu_ReadReg.

Referenced by XDpPsu_HpdInterruptHandler().

XDpPsu_Config* XDpPsu_LookupConfig | ( | u16 | DeviceId | ) |

This function looks for the device configuration based on the unique device ID.

The table XDpPsu_ConfigTable[] contains the configuration information for each device in the system.

Parameters

  DeviceId | is the unique device ID of the device being looked up.

Returns
  A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.

Note
  None.

Referenced by DpPsu_SelfTestExample().

void XDpPsu_ResetPhy | ( | XDpPsu * | InstancePtr,
|  | u32 | Reset
| ) |  |

This function does a PHY reset.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Reset | is the type of reset to assert.

Returns
  None.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDPPSU_ENABLE, XDPPSU_PHY_CONFIG, XDpPsu_ReadReg, and XDpPsu_WriteReg.

Referenced by XDpPsu_EstablishLink().

u32 XDpPsu_SelfTest | ( | XDpPsu * | InstancePtr | ) |

This function runs a self-test on the XDpPsu driver/device.

The sanity test checks whether or not all tested registers hold their default reset values.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.

Returns
  - XST_SUCCESS if the self-test passed - all tested registers hold their default reset values.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, ResetValues, ResetValuesMsa, and XDpPsu_ReadReg.

Referenced by DpPsu_SelfTestExample().

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.

u32 XDpPsu_SetDownspread | ( | XDpPsu * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables or disables 0.5% spreading of the clock for both the DisplayPort and the RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Enable | will downspread the main link signal if set to 1 and disable downspreading if set to 0.

Returns
  - XST_SUCCESS if setting the downspread control enable was successful.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu_LinkConfig::DownspreadControl, XDpPsu::IsReady, XDpPsu::LinkConfig, XDpPsu_AuxRead(), XDpPsu_AuxWrite(), XDPPSU_DOWNSPREAD_CTRL, and XDpPsu_WriteReg.

u32 XDpPsu_SetEnhancedFrameMode | ( | XDpPsu * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables or disables the enhanced framing symbol sequence for both the DisplayPort TX core and the RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Enable | will enable enhanced frame mode if set to 1 and disable it if set to 0.

Returns
  - XST_SUCCESS if setting the enhanced frame mode enable was successful.
  - XST_DEVICE_NOT_FOUND if no RX is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu_LinkConfig::EnhancedFramingMode, XDpPsu::IsReady, XDpPsu::LinkConfig, XDpPsu_AuxRead(), XDpPsu_AuxWrite(), XDPPSU_ENHANCED_FRAME_EN, and XDpPsu_WriteReg.

void XDpPsu_SetHpdEventHandler | ( | XDpPsu * | InstancePtr,
|  | XDpPsu_HpdEventHandler | CallbackFunc,
|  | void * | CallbackRef
| ) |  |

This function installs a callback function for when a hot-plug-detect event interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  CallbackFunc | is the address to the callback function.
  CallbackRef | is the user data item that will be passed to the callback function when it is invoked.

Returns
  None.

Note
  None.

References XDpPsu::HpdEventCallbackRef, and XDpPsu::HpdEventHandler.

void XDpPsu_SetHpdPulseHandler | ( | XDpPsu * | InstancePtr,
|  | XDpPsu_HpdPulseHandler | CallbackFunc,
|  | void * | CallbackRef
| ) |  |

This function installs a callback function for when a hot-plug-detect pulse interrupt occurs.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  CallbackFunc | is the address to the callback function.
  CallbackRef | is the user data item that will be passed to the callback function when it is invoked.

Returns
  None.

Note
  None.

References XDpPsu::HpdPulseCallbackRef, and XDpPsu::HpdPulseHandler.

u32 XDpPsu_SetLaneCount | ( | XDpPsu * | InstancePtr,
|  | u8 | LaneCount
| ) |  |

This function sets the number of lanes to be used by the main link for both the DisplayPort TX core and the RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  LaneCount | is the number of lanes to be used over the main link.

Returns
  - XST_SUCCESS if setting the new lane count was successful.
  - XST_DEVICE_NOT_FOUND if no RX is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDpPsu_LinkConfig::LaneCount, XDpPsu::LinkConfig, XDpPsu_AuxRead(), XDpPsu_AuxWrite(), XDPPSU_LANE_COUNT_SET, XDPPSU_LANE_COUNT_SET_1, XDPPSU_LANE_COUNT_SET_2, and XDpPsu_WriteReg.

Referenced by XDpPsu_CfgMainLinkMax().

u32 XDpPsu_SetLinkRate | ( | XDpPsu * | InstancePtr,
|  | u8 | LinkRate
| ) |  |

This function sets the data rate to be used by the main link for both the DisplayPort TX core and the RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  LinkRate | is the link rate to be used over the main link based on one of the following selects: XDPPSU_LINK_BW_SET_162GBPS = 0x06 (for a 1.62 Gbps data rate) XDPPSU_LINK_BW_SET_270GBPS = 0x0A (for a 2.70 Gbps data rate) XDPPSU_LINK_BW_SET_540GBPS = 0x14 (for a 5.40 Gbps data rate)

Returns
  - XST_SUCCESS if setting the new link rate was successful.
  - XST_DEVICE_NOT_FOUND if no RX device is connected.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDpPsu::LinkConfig, XDpPsu_LinkConfig::LinkRate, XDpPsu_AuxWrite(), XDPPSU_LINK_BW_SET, XDPPSU_LINK_BW_SET_162GBPS, XDPPSU_LINK_BW_SET_270GBPS, XDPPSU_LINK_BW_SET_540GBPS, XDPPSU_PHY_CLOCK_SELECT_162GBPS, XDPPSU_PHY_CLOCK_SELECT_270GBPS, XDPPSU_PHY_CLOCK_SELECT_540GBPS, and XDpPsu_WriteReg.

Referenced by XDpPsu_CfgMainLinkMax().

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().

u32 XDpPsu_SetScrambler | ( | XDpPsu * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables or disables scrambling of symbols for both the DisplayPort and the RX device.

Parameters

  InstancePtr | is a pointer to the XDpPsu instance.
  Enable | will enable or disable scrambling.

Returns
  - XST_SUCCESS if setting the scrambling enable was successful.
  - XST_FAILURE otherwise.

Note
  None.

References XDpPsu_Config::BaseAddr, XDpPsu::Config, XDpPsu::IsReady, XDpPsu::LinkConfig, XDpPsu_LinkConfig::ScramblerEn, XDpPsu_AuxRead(), XDpPsu_AuxWrite(), XDPPSU_SCRAMBLING_DISABLE, and XDpPsu_WriteReg.

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().