XilinxProcessorIPLib/drivers/dp12txss/src/xdptxss.c
u32 XDpTxSs_StartCustomMsa(XDpTxSs *InstancePtr,
				XDpTxSs_MainStreamAttributes *MsaConfigCustom)
{
	u32 Status;
	u8 Index;

	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid((InstancePtr->UsrOpt.MstSupport == 0) ||
				(InstancePtr->UsrOpt.MstSupport == 1));
	Xil_AssertNonvoid(MsaConfigCustom != NULL);

	/* Check RX device in MST/SST */
	Status = DpTxSs_CheckRxDeviceMode(InstancePtr);
	if (Status != XST_SUCCESS) {
			return Status;
	}

	/* Clear MSA values */
	(void)memset((void *)InstancePtr->DpPtr->TxInstance.MsaConfig, 0,
		InstancePtr->UsrOpt.NumOfStreams *
			sizeof(XDpTxSs_MainStreamAttributes));

	/* Copy user provided MSA values */
	(void)memcpy((void *)InstancePtr->DpPtr->TxInstance.MsaConfig,
		(const void *)MsaConfigCustom,
			InstancePtr->UsrOpt.NumOfStreams *
				sizeof(XDpTxSs_MainStreamAttributes));

	/* Calculate required MSA values from user provided MSA values */
	for (Index = 1; Index <= InstancePtr->UsrOpt.NumOfStreams; Index ++) {
		DpTxSs_CalculateMsa(InstancePtr, Index);
	}

#if (XPAR_XHDCP_NUM_INSTANCES > 0)
	/* Set physical interface (DisplayPort) down */
	Status = XHdcp1x_SetPhysicalState(InstancePtr->Hdcp1xPtr, 0);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: Setting PHY down "
			"failed.\n\r");
		return Status;
	}
#endif

	/* Start DisplayPort sub-core configuration */
	Status = XDpTxSs_DpTxStart(InstancePtr->DpPtr,
			InstancePtr->UsrOpt.MstSupport,
				InstancePtr->UsrOpt.Bpc,
					InstancePtr->UsrOpt.VmId);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: DP custom start "
			"failed in %s!\n\r",
				InstancePtr->UsrOpt.MstSupport?"MST":"SST");
		return Status;
	}

#if (XPAR_XHDCP_NUM_INSTANCES > 0)
	/* Set lane count in HDCP */
	Status = XHdcp1x_SetLaneCount(InstancePtr->Hdcp1xPtr,
		InstancePtr->DpPtr->TxInstance.LinkConfig.LaneCount);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: Setting HDCP lane "
			"count failed.\n\r");
		return Status;
	}

	/* Set physical interface (DisplayPort) up */
	Status = XHdcp1x_SetPhysicalState(InstancePtr->Hdcp1xPtr, 1);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: Setting PHY up failed."
			"\n\r");
		return Status;
	}
#endif

	/* Setup subsystem sub-cores */
	Status = DpTxSs_SetupSubCores(InstancePtr);
	if (Status != XST_SUCCESS) {
		return Status;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function starts the DisplayPort Transmitter Subsystem with custom
* multi-stream attributes (MSA)including all sub-cores.
*
* @param	InstancePtr is a pointer to the XDpTxSs core instance.
* @param	MsaConfigCustom is the structure that will be used to copy the
*		main stream attributes from (into
*		InstancePtr->DpPtr->TxInstance.MsaConfig).
*
* @return
*		- XST_SUCCESS, if DP TX Subsystem and its included sub-cores
*		configured successfully.
*		- XST_FAILURE, otherwise.
*
* @note		None.
*
******************************************************************************/
This function starts the DisplayPort Transmitter Subsystem with custom
multi-stream attributes (MSA)including all sub-cores.
This function starts the DisplayPort Transmitter Subsystem with custom multi - stream attributes ( MSA ) including all sub - cores .
u32 XDpTxSs_StartCustomMsa(XDpTxSs *InstancePtr,
				XDpTxSs_MainStreamAttributes *MsaConfigCustom)
{
	u32 Status;
	u8 Index;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid((InstancePtr->UsrOpt.MstSupport == 0) ||
				(InstancePtr->UsrOpt.MstSupport == 1));
	Xil_AssertNonvoid(MsaConfigCustom != NULL);
	Status = DpTxSs_CheckRxDeviceMode(InstancePtr);
	if (Status != XST_SUCCESS) {
			return Status;
	}
	(void)memset((void *)InstancePtr->DpPtr->TxInstance.MsaConfig, 0,
		InstancePtr->UsrOpt.NumOfStreams *
			sizeof(XDpTxSs_MainStreamAttributes));
	(void)memcpy((void *)InstancePtr->DpPtr->TxInstance.MsaConfig,
		(const void *)MsaConfigCustom,
			InstancePtr->UsrOpt.NumOfStreams *
				sizeof(XDpTxSs_MainStreamAttributes));
	for (Index = 1; Index <= InstancePtr->UsrOpt.NumOfStreams; Index ++) {
		DpTxSs_CalculateMsa(InstancePtr, Index);
	}
#if (XPAR_XHDCP_NUM_INSTANCES > 0)
	Status = XHdcp1x_SetPhysicalState(InstancePtr->Hdcp1xPtr, 0);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: Setting PHY down "
			"failed.\n\r");
		return Status;
	}
#endif
	Status = XDpTxSs_DpTxStart(InstancePtr->DpPtr,
			InstancePtr->UsrOpt.MstSupport,
				InstancePtr->UsrOpt.Bpc,
					InstancePtr->UsrOpt.VmId);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: DP custom start "
			"failed in %s!\n\r",
				InstancePtr->UsrOpt.MstSupport?"MST":"SST");
		return Status;
	}
#if (XPAR_XHDCP_NUM_INSTANCES > 0)
	Status = XHdcp1x_SetLaneCount(InstancePtr->Hdcp1xPtr,
		InstancePtr->DpPtr->TxInstance.LinkConfig.LaneCount);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: Setting HDCP lane "
			"count failed.\n\r");
		return Status;
	}
	Status = XHdcp1x_SetPhysicalState(InstancePtr->Hdcp1xPtr, 1);
	if (Status != XST_SUCCESS) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"SS ERR: Setting PHY up failed."
			"\n\r");
		return Status;
	}
#endif
	Status = DpTxSs_SetupSubCores(InstancePtr);
	if (Status != XST_SUCCESS) {
		return Status;
	}
	return XST_SUCCESS;
}
u32 XDpTxSs_StartCustomMsa ( XDpTxSs * InstancePtr , XDpTxSs_MainStreamAttributes * MsaConfigCustom ) { u32 Status ; u8 Index ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( ( InstancePtr -> UsrOpt . MstSupport == 0 ) || ( InstancePtr -> UsrOpt . MstSupport == 1 ) ) ; Xil_AssertNonvoid ( MsaConfigCustom != NULL ) ; Status = DpTxSs_CheckRxDeviceMode ( InstancePtr ) ; if ( Status != XST_SUCCESS ) { return Status ; } ( void ) memset ( ( void * ) InstancePtr -> DpPtr -> TxInstance . MsaConfig , 0 , InstancePtr -> UsrOpt . NumOfStreams * sizeof ( XDpTxSs_MainStreamAttributes ) ) ; ( void ) memcpy ( ( void * ) InstancePtr -> DpPtr -> TxInstance . MsaConfig , ( const void * ) MsaConfigCustom , InstancePtr -> UsrOpt . NumOfStreams * sizeof ( XDpTxSs_MainStreamAttributes ) ) ; for ( Index = 1 ; Index <= InstancePtr -> UsrOpt . NumOfStreams ; Index ++ ) { DpTxSs_CalculateMsa ( InstancePtr , Index ) ; } #if ( XPAR_XHDCP_NUM_INSTANCES > 0 ) Status = XHdcp1x_SetPhysicalState ( InstancePtr -> Hdcp1xPtr , 0 ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " " " \n \r " ) ; return Status ; } #endif Status = XDpTxSs_DpTxStart ( InstancePtr -> DpPtr , InstancePtr -> UsrOpt . MstSupport , InstancePtr -> UsrOpt . Bpc , InstancePtr -> UsrOpt . VmId ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " " " \n \r " , InstancePtr -> UsrOpt . MstSupport ? " " : " " ) ; return Status ; } #if ( XPAR_XHDCP_NUM_INSTANCES > 0 ) Status = XHdcp1x_SetLaneCount ( InstancePtr -> Hdcp1xPtr , InstancePtr -> DpPtr -> TxInstance . LinkConfig . LaneCount ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " " " \n \r " ) ; return Status ; } Status = XHdcp1x_SetPhysicalState ( InstancePtr -> Hdcp1xPtr , 1 ) ; if ( Status != XST_SUCCESS ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " " " \n \r " ) ; return Status ; } #endif Status = DpTxSs_SetupSubCores ( InstancePtr ) ; if ( Status != XST_SUCCESS ) { return Status ; } return XST_SUCCESS ; }
This function starts the DisplayPort Transmitter Subsystem with custom
multi-stream attributes (MSA)including all sub-cores.
This function starts the DisplayPort Transmitter Subsystem with custom multi - stream attributes ( MSA ) including all sub - cores .
/* Verify arguments. */ /* Check RX device in MST/SST */ /* Clear MSA values */ /* Copy user provided MSA values */ /* Calculate required MSA values from user provided MSA values */ /* Set physical interface (DisplayPort) down */ /* Start DisplayPort sub-core configuration */ /* Set lane count in HDCP */ /* Set physical interface (DisplayPort) up */ /* Setup subsystem sub-cores */