From 89d29bdaacce48dfd584ea5c115c767ab5e0d93c Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Wed, 29 Apr 2015 17:09:49 -0700 Subject: [PATCH] dp: rx: mst: Set PBN values for each connected downstream port. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dp/src/xdp.h | 6 ++ XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c | 65 +++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp.h b/XilinxProcessorIPLib/drivers/dp/src/xdp.h index 723276e0..cd13dd45 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp.h +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp.h @@ -622,6 +622,11 @@ typedef struct { message, it responds with the associated DPCD map for the requested port. */ + u16 FullPbn; /**< The payload bandwidth number (PBN) + associated with the sink + connected to this port. */ + u16 AvailPbn; /**< The available PBN of the sink + connected to this port. */ u8 Exposed; /**< When set to 1, the RX branch device will expose the port in the LINK_ADDRESS reply. */ @@ -1050,6 +1055,7 @@ void XDp_RxMstSetPort(XDp *InstancePtr, u8 PortNum, XDp_SbMsgLinkAddressReplyPortDetail *PortDetails); void XDp_RxMstSetInputPort(XDp *InstancePtr, u8 PortNum, XDp_SbMsgLinkAddressReplyPortDetail *PortOverride); +void XDp_RxMstSetPbn(XDp *InstancePtr, u8 PortNum, u16 PbnVal); /* xdp_selftest.c: Self test function. */ u32 XDp_SelfTest(XDp *InstancePtr); diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c b/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c index 75ada3cd..6cb03be1 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c @@ -155,6 +155,7 @@ static u32 XDp_RxSetRemoteDpcdReadReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); static u32 XDp_RxSetRemoteIicReadReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); static void XDp_RxDeviceInfoToRawData(XDp *InstancePtr, XDp_SidebandMsg *Msg); static void XDp_RxAllocatePayload(XDp *InstancePtr, XDp_SidebandMsg *Msg); +static void XDp_RxSetAvailPbn(XDp *InstancePtr, XDp_SidebandMsg *Msg); static void XDp_TxIssueGuid(XDp *InstancePtr, u8 LinkCountTotal, u8 *RelativeAddress, XDp_TxTopology *Topology, u32 *Guid); @@ -2513,6 +2514,27 @@ void XDp_RxMstSetInputPort(XDp *InstancePtr, u8 PortNum, XDp_RxMstExposePort(InstancePtr, PortNum, 1); } +/******************************************************************************/ +/** + * This function will set the available payload bandwidth number (PBN) of the + * specified port that is available for allocation, and the full PBN that the + * port is capable of using. + * + * @param InstancePtr is a pointer to the XDp instance. + * @param PortNum is the port number to set the PBN values for. + * @param PbnVal is the value to set the port's available and full PBN to. + * + * @return None. + * + * @note The available PBN is set to 100% of the full PBN. + * +*******************************************************************************/ +void XDp_RxMstSetPbn(XDp *InstancePtr, u8 PortNum, u16 PbnVal) +{ + InstancePtr->RxInstance.Topology.Ports[PortNum].FullPbn = PbnVal; + InstancePtr->RxInstance.Topology.Ports[PortNum].AvailPbn = PbnVal; +} + /******************************************************************************/ /** * This function will set and format a sideband message structure for replying @@ -2896,6 +2918,49 @@ static void XDp_RxAllocatePayload(XDp *InstancePtr, XDp_SidebandMsg *Msg) XDP_RX_MST_CAP_VCP_UPDATE_MASK); } +/******************************************************************************/ +/** + * This function will set the available and full payload bandwidth numbers (PBN) + * based on CLEAR_PAYLOAD and ALLOCATE_PAYLOAD sideband messages. + * + * @param InstancePtr is a pointer to the XDp instance. + * @param Msg is a pointer to the structure holding the CLEAR_PAYLOAD or + * ALLOCATE_PAYLOAD sideband message. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ +static void XDp_RxSetAvailPbn(XDp *InstancePtr, XDp_SidebandMsg *Msg) +{ + u8 Index; + u8 PortNum; + u16 PbnReq; + XDp_RxTopology *Topology; + + Topology = &InstancePtr->RxInstance.Topology; + + if (Msg->Body.MsgData[0] == XDP_TX_SBMSG_CLEAR_PAYLOAD_ID_TABLE) { + for (Index = 0; Index < 16; Index++) { + Topology->Ports[Index].AvailPbn = + Topology->Ports[Index].FullPbn; + } + } + else if (Msg->Body.MsgData[0] == XDP_TX_SBMSG_ALLOCATE_PAYLOAD) { + PortNum = Msg->Body.MsgData[1] >> 4; + PbnReq = (Msg->Body.MsgData[3] << 8) | Msg->Body.MsgData[4]; + + if (PbnReq) { + Topology->Ports[PortNum].AvailPbn = 0; + } + else { + Topology->Ports[PortNum].AvailPbn = + Topology->Ports[PortNum].FullPbn; + } + } +} + /******************************************************************************/ /** * This function will check whether or not a DisplayPort device has a global