From 139854677ef200307ad5a87920fa01a99e0d567c Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Fri, 7 Nov 2014 13:17:37 -0800 Subject: [PATCH] dptx: Added function header comments describing new functionality. Signed-off-by: Andrei-Liviu Simion --- .../drivers/dptx/src/xdptx_edid.c | 122 +++++++++++++++++- .../drivers/dptx/src/xdptx_mst.c | 63 ++++++++- 2 files changed, 181 insertions(+), 4 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c index a8a77baf..0a7bc8a3 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c @@ -130,6 +130,27 @@ u32 XDptx_GetRemoteEdid(XDptx *InstancePtr, u8 LinkCountTotal, return Status; } +/******************************************************************************/ +/** + * 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. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param Data is a pointer to the data buffer to save the block data to. + * @param BlockNum is the EDID block number to retrieve. + * + * @return + * - 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. + * +*******************************************************************************/ u32 XDptx_GetEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum) { u32 Status; @@ -145,6 +166,31 @@ u32 XDptx_GetEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum) return Status; } +/******************************************************************************/ +/** + * Retrieve a downstream DisplayPort 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. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param Data is a pointer to the data buffer to save the block data to. + * @param BlockNum is the EDID block number to retrieve. + * @param LinkCountTotal is the total DisplayPort links connecting the + * DisplayPort TX to the targeted downstream device. + * @param RelativeAddress is the relative address from the DisplayPort + * source to the targeted DisplayPort device. + * + * @return + * - 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. + * +*******************************************************************************/ u32 XDptx_GetRemoteEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum, u8 LinkCountTotal, u8 *RelativeAddress) { @@ -162,6 +208,29 @@ u32 XDptx_GetRemoteEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum, return Status; } +/******************************************************************************/ +/** + * Search for and retrieve a downstream DisplayPort device's Extended Display + * Identification Data (EDID) extension block of type DisplayID. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param Data is a pointer to the data buffer to save the DisplayID to. + * @param LinkCountTotal is the total DisplayPort links connecting the + * DisplayPort TX to the targeted downstream device. + * @param RelativeAddress is the relative address from the DisplayPort + * source to the targeted DisplayPort device. + * + * @return + * - XST_SUCCESS a DisplayID extension block was found. + * - XST_ERROR_COUNT_MAX if a time out occurred while attempting to + * read an extension block. + * - XST_DEVICE_NOT_FOUND if no RX device is connected. + * - XST_FAILURE if no DisplayID extension block was found or some + * error occurred in the search. + * + * @note None. + * +*******************************************************************************/ u32 XDptx_GetRemoteEdidDispIdExt(XDptx *InstancePtr, u8 *Data, u8 LinkCountTotal, u8 *RelativeAddress) { @@ -196,6 +265,27 @@ u32 XDptx_GetRemoteEdidDispIdExt(XDptx *InstancePtr, u8 *Data, return XST_FAILURE; } +/******************************************************************************/ +/** + * Given a section tag, search for and retrieve the appropriate section data + * block that is part of the specified DisplayID structure. + * + * @param DisplayIdRaw is a pointer to the DisplayID data. + * @param SectionTag is the tag to search for that represents the desired + * section data block. + * @param DataBlockPtr will be set by this function to point to the + * appropriate section data block that is part of the DisplayIdRaw. + * + * @return + * - 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 XDptx_GetDispIdDataBlock(u8 *DisplayIdRaw, u8 SectionTag, u8 **DataBlockPtr) { u8 Index; @@ -230,6 +320,36 @@ u32 XDptx_GetDispIdDataBlock(u8 *DisplayIdRaw, u8 SectionTag, u8 **DataBlockPtr) return XST_FAILURE; } +/******************************************************************************/ +/** + * Search for and retrieve a downstream DisplayPort device's Tiled Display + * Topology (TDT) section data block that is part of the downstream device's + * DisplayID structure. The DisplayID structure is part of the Extended Display + * Identification Data (EDID) in the form of an extension block. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param EdidExt is a pointer to the data area that will be filled by the + * retrieved DisplayID extension block. + * @param LinkCountTotal is the total DisplayPort links connecting the + * DisplayPort TX to the targeted downstream device. + * @param RelativeAddress is the relative address from the DisplayPort + * source to the targeted DisplayPort device. + * @param DataBlockPtr will be set by this function to point to the TDT + * data block that is part of the EdidExt extension block. + * + * @return + * - XST_SUCCESS a DisplayID extension block was found. + * - XST_ERROR_COUNT_MAX if a time out occurred while attempting to + * read an extension block. + * - XST_DEVICE_NOT_FOUND if no RX device is connected. + * - XST_FAILURE if no DisplayID extension block was found or some + * error occurred in the search. + * + * @note The EdidExt will be filled with the DisplayID EDID extension + * block and the DataBlockPtr argument is modified to point to the + * EdidExt entry representing the TDT section data block. + * +*******************************************************************************/ u32 XDptx_GetRemoteTiledDisplayDb(XDptx *InstancePtr, u8 *EdidExt, u8 LinkCountTotal, u8 *RelativeAddress, u8 **DataBlockPtr) { @@ -240,7 +360,7 @@ u32 XDptx_GetRemoteTiledDisplayDb(XDptx *InstancePtr, u8 *EdidExt, Status = XDptx_GetRemoteEdidDispIdExt(InstancePtr, EdidExt, LinkCountTotal, RelativeAddress); if (Status != XST_SUCCESS) { - /* The sink does not possess a DisplayID EDID extension block. */ + /* The sink does not have a DisplayID EDID extension block. */ return Status; } diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c index dad8504d..92d7034d 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c @@ -707,6 +707,25 @@ u32 XDptx_FindAccessibleDpDevices(XDptx *InstancePtr, u8 LinkCountTotal, return XST_SUCCESS; } +/******************************************************************************/ +/** + * Swap the ordering of the sinks in the topology's sink list. All sink + * information is preserved in the node table - the swapping takes place only on + * the pointers to the sinks in the node table. The reason this swapping is done + * is so that functions that use the sink list will act on the sinks in a + * different order. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param Index0 is the sink list's index of one of the sink pointers to + * be swapped. + * @param Index1 is the sink list's index of the other sink pointer to be + * swapped. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ void XDptx_TopologySwapSinks(XDptx *InstancePtr, u8 Index0, u8 Index1) { XDptx_TopologyNode *TmpSink = InstancePtr->Topology.SinkList[Index0]; @@ -717,6 +736,26 @@ void XDptx_TopologySwapSinks(XDptx *InstancePtr, u8 Index0, u8 Index1) InstancePtr->Topology.SinkList[Index1] = TmpSink; } +/******************************************************************************/ +/** + * Order the sink list with all sinks of the same tiled display being sorted by + * 'tile order'. Refer to the XDptx_GetDispIdTdtTileOrder macro on how to + * determine the 'tile order'. Sinks of a tiled display will have an index in + * the sink list that is lower than all indices of other sinks within that same + * tiled display that have a greater 'tile order'. + * When operations are done on the sink list, this ordering will ensure that + * sinks within the same tiled display will be acted upon in a consistent + * manner - with an incrementing sink list index, sinks with a lower 'tile + * order' will be acted upon first relative to the other sinks in the same tiled + * display. Multiple tiled displays may exist in the sink list. + * + * @param InstancePtr is a pointer to the XDptx instance. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ u32 XDptx_TopologySortSinksByTiling(XDptx *InstancePtr) { u32 Status; @@ -735,7 +774,7 @@ u32 XDptx_TopologySortSinksByTiling(XDptx *InstancePtr) CurrSink->LinkCountTotal, CurrSink->RelativeAddress, &CurrTdt); if (Status != XST_SUCCESS) { - /* No tiled display topology data block exists. */ + /* No Tiled Display Topology (TDT) data block exists. */ return XST_FAILURE; } @@ -747,7 +786,7 @@ u32 XDptx_TopologySortSinksByTiling(XDptx *InstancePtr) SameTileDispNum = XDptx_GetDispIdTdtNumTiles(CurrTdt); /* Try to find a sink that is part of the same tiled display, - * but has a smaller tile location - the sink with a smaller + * but has a smaller tile location - the sink with a smallest * tile location should be ordered first in the topology's sink * list. */ for (CmpIndex = (CurrIndex + 1); @@ -761,7 +800,7 @@ u32 XDptx_TopologySortSinksByTiling(XDptx *InstancePtr) CmpSink->LinkCountTotal, CmpSink->RelativeAddress, &CmpTdt); if (Status != XST_SUCCESS) { - /* No tiled display topology data block. */ + /* No TDT data block. */ return XST_FAILURE; } @@ -2890,6 +2929,24 @@ static u8 XDptx_CrcCalculate(const u8 *Data, u32 NumberOfBits, u8 Polynomial) return Remainder & 0xFF; } +/******************************************************************************/ +/** + * Check whether or not the two specified Tiled Display Topology (TDT) data + * blocks represent devices that are part of the same tiled display. This is + * done by comparing the TDT ID descriptor (tiled display manufacturer/vendor + * ID, product ID and serial number fields). + * + * @param TileDisp0 is one of the TDT data blocks to be compared. + * @param TileDisp1 is the other TDT data block to be compared. + * + * @return + * - 1 if the two TDT sections represent devices that are part of + * the same tiled display. + * - 0 otherwise. + * + * @note None. + * +*******************************************************************************/ static u32 XDptx_IsSameTileDisplay(u8 *TileDisp0, u8 *TileDisp1) { if ((TileDisp0[XDPTX_DISPID_TDT_VENID0] !=