XilinxProcessorIPLib/drivers/dp14txss/examples/src/zcu_pt_dp14_mst/xvid_pat_gen.c
int Vpg_StreamSrcConfigure(XDp *InstancePtr, u8 VSplitMode, u8 first_time)
{
	Vpg_VidgenConfig VidgenConfig;
	u8 StreamIndex;

	/* Set up timing parameters */
	memset((void *)&VidgenConfig.Timing, 0, sizeof(XVidC_VideoTiming));

	/* Check MST enable flag */
	if (InstancePtr->TxInstance.MstEnable) {
		for (StreamIndex = 0; StreamIndex < 4; StreamIndex++) {
			if (XDp_TxMstStreamIsEnabled(InstancePtr,
					(XDP_TX_STREAM_ID1) + StreamIndex)) {
				/* Calculate VPG parameters */
				VidgenSetConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1) + StreamIndex,
						VSplitMode, first_time);

				/* Update VPG with parameter */
				VidgenWriteConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1) + StreamIndex);

				/* Set pattern to stream 1, 2, 3, 4 */
				Vpg_VidgenSetTestPattern(InstancePtr,
					(XDP_TX_STREAM_ID1) + StreamIndex);

				/* Enable VPG for each stream. Number of VPG
				 * are equal to number of streams
				 */
				XDp_WriteReg(
					XILINX_DISPLAYPORT_VID_BASE_ADDRESS,
						StreamOffset[StreamIndex],
							0x1);
			}
		}
	}
	else {
		/* Calculate VPG parameters */
		VidgenSetConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1), 0, first_time);

		/* Update VPG with parameter */
		VidgenWriteConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1));

		/* Set pattern to stream 1, 2, 3, 4 */
		Vpg_VidgenSetTestPattern(InstancePtr,
			(XDP_TX_STREAM_ID1));

		/* Enable VPG for only one stream */
		XDp_WriteReg(XILINX_DISPLAYPORT_VID_BASE_ADDRESS,
				PatternGeneratorEnable, 0x1);
	}

	return (XST_SUCCESS);
}
/*****************************************************************************/
/**
*
* This function updates required timing values in Video Pattern Generator
* core.
*
* @param	InstancePtr is a pointer to the XDp instance.
* @param	VSplitMode specifies vertical split mode to be used for
*		splitting resolution vertically.
*
* @return
*		- XST_SUCCESS if Video pattern configured successfully.
*
* @note		None.
*
******************************************************************************/
This function updates required timing values in Video Pattern Generator
core.
This function updates required timing values in Video Pattern Generator core .
int Vpg_StreamSrcConfigure(XDp *InstancePtr, u8 VSplitMode, u8 first_time)
{
	Vpg_VidgenConfig VidgenConfig;
	u8 StreamIndex;
	memset((void *)&VidgenConfig.Timing, 0, sizeof(XVidC_VideoTiming));
	if (InstancePtr->TxInstance.MstEnable) {
		for (StreamIndex = 0; StreamIndex < 4; StreamIndex++) {
			if (XDp_TxMstStreamIsEnabled(InstancePtr,
					(XDP_TX_STREAM_ID1) + StreamIndex)) {
				VidgenSetConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1) + StreamIndex,
						VSplitMode, first_time);
				VidgenWriteConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1) + StreamIndex);
				Vpg_VidgenSetTestPattern(InstancePtr,
					(XDP_TX_STREAM_ID1) + StreamIndex);
				XDp_WriteReg(
					XILINX_DISPLAYPORT_VID_BASE_ADDRESS,
						StreamOffset[StreamIndex],
							0x1);
			}
		}
	}
	else {
		VidgenSetConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1), 0, first_time);
		VidgenWriteConfig(InstancePtr, &VidgenConfig,
					(XDP_TX_STREAM_ID1));
		Vpg_VidgenSetTestPattern(InstancePtr,
			(XDP_TX_STREAM_ID1));
		XDp_WriteReg(XILINX_DISPLAYPORT_VID_BASE_ADDRESS,
				PatternGeneratorEnable, 0x1);
	}
	return (XST_SUCCESS);
}
int Vpg_StreamSrcConfigure ( XDp * InstancePtr , u8 VSplitMode , u8 first_time ) { Vpg_VidgenConfig VidgenConfig ; u8 StreamIndex ; memset ( ( void * ) & VidgenConfig . Timing , 0 , sizeof ( XVidC_VideoTiming ) ) ; if ( InstancePtr -> TxInstance . MstEnable ) { for ( StreamIndex = 0 ; StreamIndex < 4 ; StreamIndex ++ ) { if ( XDp_TxMstStreamIsEnabled ( InstancePtr , ( XDP_TX_STREAM_ID1 ) + StreamIndex ) ) { VidgenSetConfig ( InstancePtr , & VidgenConfig , ( XDP_TX_STREAM_ID1 ) + StreamIndex , VSplitMode , first_time ) ; VidgenWriteConfig ( InstancePtr , & VidgenConfig , ( XDP_TX_STREAM_ID1 ) + StreamIndex ) ; Vpg_VidgenSetTestPattern ( InstancePtr , ( XDP_TX_STREAM_ID1 ) + StreamIndex ) ; XDp_WriteReg ( XILINX_DISPLAYPORT_VID_BASE_ADDRESS , StreamOffset [ StreamIndex ] , 0x1 ) ; } } } else { VidgenSetConfig ( InstancePtr , & VidgenConfig , ( XDP_TX_STREAM_ID1 ) , 0 , first_time ) ; VidgenWriteConfig ( InstancePtr , & VidgenConfig , ( XDP_TX_STREAM_ID1 ) ) ; Vpg_VidgenSetTestPattern ( InstancePtr , ( XDP_TX_STREAM_ID1 ) ) ; XDp_WriteReg ( XILINX_DISPLAYPORT_VID_BASE_ADDRESS , PatternGeneratorEnable , 0x1 ) ; } return ( XST_SUCCESS ) ; }
This function updates required timing values in Video Pattern Generator
core.
This function updates required timing values in Video Pattern Generator core .
/* Set up timing parameters */ /* Check MST enable flag */ /* Calculate VPG parameters */ /* Update VPG with parameter */ /* Set pattern to stream 1, 2, 3, 4 */ /* Enable VPG for each stream. Number of VPG
				 * are equal to number of streams
				 */ /* Calculate VPG parameters */ /* Update VPG with parameter */ /* Set pattern to stream 1, 2, 3, 4 */ /* Enable VPG for only one stream */