XilinxProcessorIPLib/drivers/dp14rxss/src/xdprxss.c
static void DpRxSs_PopulateDpRxPorts(XDpRxSs *InstancePtr)
{
	XDp_SbMsgLinkAddressReplyPortDetail Port;
	u8 PortIndex;
	u8 GuidIndex;
	u8 StreamIndex;

	/* Check for MST */
	if (InstancePtr->Config.MstSupport) {
		/* Ensure that all ports are not exposed in the link address */
		for (PortIndex = 0; PortIndex < XDP_MAX_NPORTS; PortIndex++) {
			XDp_RxMstExposePort(InstancePtr->DpPtr, PortIndex, 0);
		}

		/* Configure the commonality between the downstream sink
		 * devices
		 */
		Port.InputPort = 0;
		Port.PeerDeviceType = 0x3;
		Port.MsgCapStatus = 0;
		Port.DpDevPlugStatus = 1;
		Port.LegacyDevPlugStatus = 0;
		Port.DpcdRev = 0x11;
		Port.NumSdpStreams = InstancePtr->Config.MaxNumAudioCh;
		Port.NumSdpStreamSinks = InstancePtr->Config.MaxNumAudioCh;

		/* Configure the unique port number and GUID for all possible
		 * downstream sinks
		 */
		for (PortIndex = 1; PortIndex < XDPRXSS_MAX_NPORTS;
								PortIndex++) {
			/* Set the GUID to a repeating pattern of the port
			 * number
			 */
			for (GuidIndex = 0; GuidIndex < XDPRXSS_GUID_NBYTES;
								GuidIndex++) {
				Port.Guid[GuidIndex] = PortIndex;
			}
			/* Port.PortNum is set to the index. */
			XDp_RxMstSetPort(InstancePtr->DpPtr, PortIndex, &Port);
		}

		/* Configure each port with I2C, DPCD and PBN values */
		for (StreamIndex = 0;
			StreamIndex < InstancePtr->Config.NumMstStreams;
							StreamIndex++) {
			/* Set I2C maps. */
			if (!InstancePtr->EdidSize[StreamIndex]) {
				XDp_RxSetIicMapEntry(InstancePtr->DpPtr,
					StreamIndex + 1, EDID_IIC_ADDRESS,
					sizeof(GenEdid), GenEdid);
			} else {
				XDp_RxSetIicMapEntry(InstancePtr->DpPtr,
					StreamIndex + 1, EDID_IIC_ADDRESS,
					InstancePtr->EdidSize[StreamIndex],
					InstancePtr->EdidDataPtr[StreamIndex]);
			}

			/* Set DPCD maps. */
			XDp_RxSetDpcdMap(InstancePtr->DpPtr, StreamIndex + 1,
				0, sizeof(GenDpcd), GenDpcd);

			/* Set available PBN. */
			XDp_RxMstSetPbn(InstancePtr->DpPtr, StreamIndex + 1,
				2560);

			/* Expose the ports configured above. Used when
			 * replying to a LINK_ADDRESS request. Make sure that
			 * the number of downstream ports matches the number
			 * exposed, otherwise the LINK_ADDRESS reply will be
			 * incorrect
			 */
			XDp_RxMstExposePort(InstancePtr->DpPtr,
				StreamIndex + 1, 1);
		}

		/* Set up the input port and expose it */
		XDp_RxMstSetInputPort(InstancePtr->DpPtr, 0, NULL);
	}
}
/*****************************************************************************/
/**
*
* This function sets up the downstream topology that will be used by the
* DisplayPort RX to respond to down requests coming from the TX.
* - Sinks equal to number of streams (each with its own global unique
*   identifier) are exposed to LINK_ADDRESS sideband messages.
* - The extended display identification data (EDID) will be set to a generic
*   EDID (GenEdid) for each of the sinks. REMOTE_I2C_READ sideband messages
*   on address 0x50 will be replied to with the contents set by
*   XDp_RxSetIicMapEntry for 0x50.
* - REMOTE_DPCD_READ sideband messages will be responded to with the contents
*   set for the sink using XDp_RxSetDpcdMap. All sinks are given the a generic
*   DPCD (GenDpcd).
* - ENUM_PATH_RESOURCES sideband messages will be responded to with the value
*   set by XDp_RxMstSetPbn (or 0 if the sink already has a stream allocated to
*   it).
*
* @param	InstancePtr is a pointer to the XDpRxSs core instance.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function sets up the downstream topology that will be used by the
DisplayPort RX to respond to down requests coming from the TX.
Sinks equal to number of streams (each with its own global unique
identifier) are exposed to LINK_ADDRESS sideband messages.
The extended display identification data (EDID) will be set to a generic
EDID (GenEdid) for each of the sinks. REMOTE_I2C_READ sideband messages
on address 0x50 will be replied to with the contents set by
XDp_RxSetIicMapEntry for 0x50.
REMOTE_DPCD_READ sideband messages will be responded to with the contents
set for the sink using XDp_RxSetDpcdMap. All sinks are given the a generic
DPCD (GenDpcd).
ENUM_PATH_RESOURCES sideband messages will be responded to with the value
set by XDp_RxMstSetPbn (or 0 if the sink already has a stream allocated to
it).
This function sets up the downstream topology that will be used by the DisplayPort RX to respond to down requests coming from the TX . Sinks equal to number of streams ( each with its own global unique identifier ) are exposed to LINK_ADDRESS sideband messages . The extended display identification data ( EDID ) will be set to a generic EDID ( GenEdid ) for each of the sinks . REMOTE_I2C_READ sideband messages on address 0x50 will be replied to with the contents set by XDp_RxSetIicMapEntry for 0x50 . REMOTE_DPCD_READ sideband messages will be responded to with the contents set for the sink using XDp_RxSetDpcdMap . All sinks are given the a generic DPCD ( GenDpcd ) . ENUM_PATH_RESOURCES sideband messages will be responded to with the value set by XDp_RxMstSetPbn ( or 0 if the sink already has a stream allocated to it ) .
static void DpRxSs_PopulateDpRxPorts(XDpRxSs *InstancePtr)
{
	XDp_SbMsgLinkAddressReplyPortDetail Port;
	u8 PortIndex;
	u8 GuidIndex;
	u8 StreamIndex;
	if (InstancePtr->Config.MstSupport) {
		for (PortIndex = 0; PortIndex < XDP_MAX_NPORTS; PortIndex++) {
			XDp_RxMstExposePort(InstancePtr->DpPtr, PortIndex, 0);
		}
		Port.InputPort = 0;
		Port.PeerDeviceType = 0x3;
		Port.MsgCapStatus = 0;
		Port.DpDevPlugStatus = 1;
		Port.LegacyDevPlugStatus = 0;
		Port.DpcdRev = 0x11;
		Port.NumSdpStreams = InstancePtr->Config.MaxNumAudioCh;
		Port.NumSdpStreamSinks = InstancePtr->Config.MaxNumAudioCh;
		for (PortIndex = 1; PortIndex < XDPRXSS_MAX_NPORTS;
								PortIndex++) {
			for (GuidIndex = 0; GuidIndex < XDPRXSS_GUID_NBYTES;
								GuidIndex++) {
				Port.Guid[GuidIndex] = PortIndex;
			}
			XDp_RxMstSetPort(InstancePtr->DpPtr, PortIndex, &Port);
		}
		for (StreamIndex = 0;
			StreamIndex < InstancePtr->Config.NumMstStreams;
							StreamIndex++) {
			if (!InstancePtr->EdidSize[StreamIndex]) {
				XDp_RxSetIicMapEntry(InstancePtr->DpPtr,
					StreamIndex + 1, EDID_IIC_ADDRESS,
					sizeof(GenEdid), GenEdid);
			} else {
				XDp_RxSetIicMapEntry(InstancePtr->DpPtr,
					StreamIndex + 1, EDID_IIC_ADDRESS,
					InstancePtr->EdidSize[StreamIndex],
					InstancePtr->EdidDataPtr[StreamIndex]);
			}
			XDp_RxSetDpcdMap(InstancePtr->DpPtr, StreamIndex + 1,
				0, sizeof(GenDpcd), GenDpcd);
			XDp_RxMstSetPbn(InstancePtr->DpPtr, StreamIndex + 1,
				2560);
			XDp_RxMstExposePort(InstancePtr->DpPtr,
				StreamIndex + 1, 1);
		}
		XDp_RxMstSetInputPort(InstancePtr->DpPtr, 0, NULL);
	}
}
static void DpRxSs_PopulateDpRxPorts ( XDpRxSs * InstancePtr ) { XDp_SbMsgLinkAddressReplyPortDetail Port ; u8 PortIndex ; u8 GuidIndex ; u8 StreamIndex ; if ( InstancePtr -> Config . MstSupport ) { for ( PortIndex = 0 ; PortIndex < XDP_MAX_NPORTS ; PortIndex ++ ) { XDp_RxMstExposePort ( InstancePtr -> DpPtr , PortIndex , 0 ) ; } Port . InputPort = 0 ; Port . PeerDeviceType = 0x3 ; Port . MsgCapStatus = 0 ; Port . DpDevPlugStatus = 1 ; Port . LegacyDevPlugStatus = 0 ; Port . DpcdRev = 0x11 ; Port . NumSdpStreams = InstancePtr -> Config . MaxNumAudioCh ; Port . NumSdpStreamSinks = InstancePtr -> Config . MaxNumAudioCh ; for ( PortIndex = 1 ; PortIndex < XDPRXSS_MAX_NPORTS ; PortIndex ++ ) { for ( GuidIndex = 0 ; GuidIndex < XDPRXSS_GUID_NBYTES ; GuidIndex ++ ) { Port . Guid [ GuidIndex ] = PortIndex ; } XDp_RxMstSetPort ( InstancePtr -> DpPtr , PortIndex , & Port ) ; } for ( StreamIndex = 0 ; StreamIndex < InstancePtr -> Config . NumMstStreams ; StreamIndex ++ ) { if ( ! InstancePtr -> EdidSize [ StreamIndex ] ) { XDp_RxSetIicMapEntry ( InstancePtr -> DpPtr , StreamIndex + 1 , EDID_IIC_ADDRESS , sizeof ( GenEdid ) , GenEdid ) ; } else { XDp_RxSetIicMapEntry ( InstancePtr -> DpPtr , StreamIndex + 1 , EDID_IIC_ADDRESS , InstancePtr -> EdidSize [ StreamIndex ] , InstancePtr -> EdidDataPtr [ StreamIndex ] ) ; } XDp_RxSetDpcdMap ( InstancePtr -> DpPtr , StreamIndex + 1 , 0 , sizeof ( GenDpcd ) , GenDpcd ) ; XDp_RxMstSetPbn ( InstancePtr -> DpPtr , StreamIndex + 1 , 2560 ) ; XDp_RxMstExposePort ( InstancePtr -> DpPtr , StreamIndex + 1 , 1 ) ; } XDp_RxMstSetInputPort ( InstancePtr -> DpPtr , 0 , NULL ) ; } }
This function sets up the downstream topology that will be used by the
DisplayPort RX to respond to down requests coming from the TX.
This function sets up the downstream topology that will be used by the DisplayPort RX to respond to down requests coming from the TX .
/* Check for MST */ /* Ensure that all ports are not exposed in the link address */ /* Configure the commonality between the downstream sink
		 * devices
		 */ /* Configure the unique port number and GUID for all possible
		 * downstream sinks
		 */ /* Set the GUID to a repeating pattern of the port
			 * number
			 */ /* Port.PortNum is set to the index. */ /* Configure each port with I2C, DPCD and PBN values */ /* Set I2C maps. */ /* Set DPCD maps. */ /* Set available PBN. */ /* Expose the ports configured above. Used when
			 * replying to a LINK_ADDRESS request. Make sure that
			 * the number of downstream ports matches the number
			 * exposed, otherwise the LINK_ADDRESS reply will be
			 * incorrect
			 */ /* Set up the input port and expose it */