From d49f9f84fc44c1bacc8f40d6ced1c255d3f85546 Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Tue, 4 Nov 2014 14:44:20 -0800 Subject: [PATCH] dptx: Moved functions related to retrieval of EDID information into xdptx_edid.c Consolidated the functions that obtain the base EDID block into the EDID utility file. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dptx/src/xdptx.c | 33 --------- XilinxProcessorIPLib/drivers/dptx/src/xdptx.h | 6 +- .../drivers/dptx/src/xdptx_edid.c | 74 +++++++++++++++++++ .../drivers/dptx/src/xdptx_mst.c | 41 ---------- 4 files changed, 77 insertions(+), 77 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx.c b/XilinxProcessorIPLib/drivers/dptx/src/xdptx.c index 069fcc79..24ff4054 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx.c +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx.c @@ -348,39 +348,6 @@ u32 XDptx_GetRxCapabilities(XDptx *InstancePtr) return XST_SUCCESS; } -/******************************************************************************/ -/** - * This function retrieves the RX device's Extended Display Identification Data - * (EDID). - * - * @param InstancePtr is a pointer to the XDptx instance. - * @param Edid is a pointer to the Edid buffer to save to. - * - * @return - * - 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. - * -*******************************************************************************/ -u32 XDptx_GetEdid(XDptx *InstancePtr, u8 *Edid) -{ - u32 Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertNonvoid(Edid != NULL); - - Status = XDptx_IicRead(InstancePtr, XDPTX_EDID_ADDR, 0, - XDPTX_EDID_BLOCK_SIZE, Edid); - - return Status; -} - /******************************************************************************/ /** * This function determines the common capabilities between the DisplayPort TX diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx.h b/XilinxProcessorIPLib/drivers/dptx/src/xdptx.h index fc92fd63..0951805d 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx.h +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx.h @@ -744,7 +744,6 @@ u32 XDptx_InitializeTx(XDptx *InstancePtr); void XDptx_CfgInitialize(XDptx *InstancePtr, XDptx_Config *ConfigPtr, u32 EffectiveAddr); u32 XDptx_GetRxCapabilities(XDptx *InstancePtr); -u32 XDptx_GetEdid(XDptx *InstancePtr, u8 *Edid); /* xdptx.c: Link policy maker functions. */ u32 XDptx_CfgMainLinkMax(XDptx *InstancePtr); @@ -875,10 +874,11 @@ void XDptx_WriteGuid(XDptx *InstancePtr, u8 LinkCountTotal, u8 *RelativeAddress, u32 Guid[4]); void XDptx_GetGuid(XDptx *InstancePtr, u8 LinkCountTotal, u8 *RelativeAddress, u32 *Guid); -u32 XDptx_GetRemoteEdid(XDptx *InstancePtr, u8 LinkCountTotal, - u8 *RelativeAddress, u8 *Edid); /* xdptx_edid.c: EDID utility functions. */ +u32 XDptx_GetEdid(XDptx *InstancePtr, u8 *Edid); +u32 XDptx_GetRemoteEdid(XDptx *InstancePtr, u8 LinkCountTotal, + u8 *RelativeAddress, u8 *Edid); u32 XDptx_GetEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum); u32 XDptx_GetRemoteEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum, u8 LinkCountTotal, u8 *RelativeAddress); diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c index 1882e8c4..1673b8b2 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_edid.c @@ -55,6 +55,80 @@ /**************************** Function Definitions ****************************/ +/******************************************************************************/ +/** + * This function retrieves an immediately connected RX device's Extended Display + * Identification Data (EDID) structure. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param Edid is a pointer to the Edid buffer to save to. + * + * @return + * - 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. + * +*******************************************************************************/ +u32 XDptx_GetEdid(XDptx *InstancePtr, u8 *Edid) +{ + u32 Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + Xil_AssertNonvoid(Edid != NULL); + + Status = XDptx_IicRead(InstancePtr, XDPTX_EDID_ADDR, 0, + XDPTX_EDID_BLOCK_SIZE, Edid); + + return Status; +} + +/******************************************************************************/ +/** + * This function retrieves a remote RX device's Extended Display Identification + * Data (EDID) structure. + * + * @param InstancePtr is a pointer to the XDptx instance. + * @param LinkCountTotal is the number of DisplayPort links from the + * DisplayPort source to the target DisplayPort device. + * @param RelativeAddress is the relative address from the DisplayPort + * source to the target DisplayPort device. + * @param Edid is a pointer to the Edid buffer to save to. + * + * @return + * - 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. + * +*******************************************************************************/ +u32 XDptx_GetRemoteEdid(XDptx *InstancePtr, u8 LinkCountTotal, + u8 *RelativeAddress, u8 *Edid) +{ + u32 Status; + + /* Verify arguments. */ + Xil_AssertNonvoid(InstancePtr != NULL); + Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); + Xil_AssertNonvoid(LinkCountTotal > 0); + Xil_AssertNonvoid((RelativeAddress != NULL) || (LinkCountTotal == 1)); + Xil_AssertNonvoid(Edid != NULL); + + Status = XDptx_RemoteIicRead(InstancePtr, LinkCountTotal, + RelativeAddress, XDPTX_EDID_ADDR, 0, XDPTX_EDID_BLOCK_SIZE, + Edid); + + return Status; +} + u32 XDptx_GetEdidBlock(XDptx *InstancePtr, u8 *Data, u8 BlockNum) { u32 Status; diff --git a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c index eb982c26..9486195a 100644 --- a/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c +++ b/XilinxProcessorIPLib/drivers/dptx/src/xdptx_mst.c @@ -2044,47 +2044,6 @@ void XDptx_GetGuid(XDptx *InstancePtr, u8 LinkCountTotal, u8 *RelativeAddress, } } -/******************************************************************************/ -/** - * This function retrieves a remote RX device's Extended Display Identification - * Data (EDID). - * - * @param InstancePtr is a pointer to the XDptx instance. - * @param LinkCountTotal is the number of DisplayPort links from the - * DisplayPort source to the target DisplayPort device. - * @param RelativeAddress is the relative address from the DisplayPort - * source to the target DisplayPort device. - * @param Edid is a pointer to the Edid buffer to save to. - * - * @return - * - 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. - * -*******************************************************************************/ -u32 XDptx_GetRemoteEdid(XDptx *InstancePtr, u8 LinkCountTotal, - u8 *RelativeAddress, u8 *Edid) -{ - u32 Status; - - /* Verify arguments. */ - Xil_AssertNonvoid(InstancePtr != NULL); - Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY); - Xil_AssertNonvoid(LinkCountTotal > 0); - Xil_AssertNonvoid((RelativeAddress != NULL) || (LinkCountTotal == 1)); - Xil_AssertNonvoid(Edid != NULL); - - Status = XDptx_RemoteIicRead(InstancePtr, LinkCountTotal, - RelativeAddress, XDPTX_EDID_ADDR, 0, XDPTX_EDID_BLOCK_SIZE, - Edid); - - return Status; -} - /******************************************************************************/ /** * This function will check whether or not a DisplayPort device has a global