XilinxProcessorIPLib/drivers/v_sditx/src/xv_sditx.c
u32 XV_SdiTx_GetPayloadEotf(XV_SdiTx *InstancePtr,
			    XVidC_Eotf Eotf, XVidC_ColorStd Colorimetry)
{
	XVidC_Eotf eotf;
	XVidC_ColorStd colorimetry;
	u32 payload = 0;

	switch(Eotf) {
	case XVIDC_EOTF_TG_SDR:
		eotf = XSDIVID_EOTF_SDRTV;
		break;
	case XVIDC_EOTF_SMPTE2084:
		eotf = XSDIVID_EOTF_SMPTE2084;
		break;
	case XVIDC_EOTF_HLG:
		eotf = XSDIVID_EOTF_HLG;
		break;
	case XVIDC_EOTF_UNKNOWN:
		eotf = XSDIVID_EOTF_UNKNOWN;
		break;
	default:
		eotf = XSDIVID_EOTF_SDRTV;
		break;
	}

	switch(Colorimetry) {
	case XVIDC_BT_709:
		colorimetry = XV_SDIVID_COLORIMETRY_BT709;
		break;
	case XVIDC_BT_2020:
		colorimetry = XV_SDIVID_COLORIMETRY_BT2020;
		break;
	default:
		colorimetry = XV_SDIVID_COLORIMETRY_BT709;
		break;
	}

	/*
	 * For HD mode, bit 23 and bit 20 of payload represents colorimetry as per
	 * SMPTE 292-1:2018 Sec 9.5
	 * For other modes, its bit 21 and bit 20.
	 * For BT709 and BT2020 -bit 20 is always zero.
	 */
	if (InstancePtr->Transport.TMode == XSDIVID_MODE_HD) {
		payload &= ~(XV_SDITX_TX_ST352_EOTF_MASK |
			     XV_SDITX_TX_ST352_COLORIMETRY_HD_MASK);
		payload |= eotf << XV_SDITX_TX_ST352_EOTF_SHIFT |
			colorimetry << XV_SDITX_TX_ST352_COLORIMETRY_HD_SHIFT;
	} else {
		payload &= ~(XV_SDITX_TX_ST352_EOTF_MASK |
			     XV_SDITX_TX_ST352_COLORIMETRY_MASK);
		payload |= eotf << XV_SDITX_TX_ST352_EOTF_SHIFT |
			colorimetry << XV_SDITX_TX_ST352_COLORIMETRY_SHIFT;
	}

	return payload;
}
/*****************************************************************************/
/**
 *
 * This function updates the eotf and colorimetry fields of st352 payload
 * value for all SDI modes.
 *
 * @param	InstancePtr is a pointer to the XV_SdiTx core instance.
 * @param	Eotf is a variable of type XVidC_Eotf
 * @param	Colorimetry is a variable of type XVidC_ColorStd
 *
 * @return
 *		Updated payload value.
 *
 * @note
 *		This function depends on sdi mode(Transport.TMode) being set, to
 *		correctly calculate the payload
 *
 ******************************************************************************/
This function updates the eotf and colorimetry fields of st352 payload
value for all SDI modes.

@param       InstancePtr is a pointer to the XV_SdiTx core instance.
@param       Eotf is a variable of type XVidC_Eotf
@param       Colorimetry is a variable of type XVidC_ColorStd

@return
Updated payload value.

@note
This function depends on sdi mode(Transport.TMode) being set, to
correctly calculate the payload
This function updates the eotf and colorimetry fields of st352 payload value for all SDI modes . @param InstancePtr is a pointer to the XV_SdiTx core instance . @param Eotf is a variable of type XVidC_Eotf @param Colorimetry is a variable of type XVidC_ColorStd @return Updated payload value . @note This function depends on sdi mode ( Transport . TMode ) being set to correctly calculate the payload
u32 XV_SdiTx_GetPayloadEotf(XV_SdiTx *InstancePtr,
			    XVidC_Eotf Eotf, XVidC_ColorStd Colorimetry)
{
	XVidC_Eotf eotf;
	XVidC_ColorStd colorimetry;
	u32 payload = 0;
	switch(Eotf) {
	case XVIDC_EOTF_TG_SDR:
		eotf = XSDIVID_EOTF_SDRTV;
		break;
	case XVIDC_EOTF_SMPTE2084:
		eotf = XSDIVID_EOTF_SMPTE2084;
		break;
	case XVIDC_EOTF_HLG:
		eotf = XSDIVID_EOTF_HLG;
		break;
	case XVIDC_EOTF_UNKNOWN:
		eotf = XSDIVID_EOTF_UNKNOWN;
		break;
	default:
		eotf = XSDIVID_EOTF_SDRTV;
		break;
	}
	switch(Colorimetry) {
	case XVIDC_BT_709:
		colorimetry = XV_SDIVID_COLORIMETRY_BT709;
		break;
	case XVIDC_BT_2020:
		colorimetry = XV_SDIVID_COLORIMETRY_BT2020;
		break;
	default:
		colorimetry = XV_SDIVID_COLORIMETRY_BT709;
		break;
	}
	if (InstancePtr->Transport.TMode == XSDIVID_MODE_HD) {
		payload &= ~(XV_SDITX_TX_ST352_EOTF_MASK |
			     XV_SDITX_TX_ST352_COLORIMETRY_HD_MASK);
		payload |= eotf << XV_SDITX_TX_ST352_EOTF_SHIFT |
			colorimetry << XV_SDITX_TX_ST352_COLORIMETRY_HD_SHIFT;
	} else {
		payload &= ~(XV_SDITX_TX_ST352_EOTF_MASK |
			     XV_SDITX_TX_ST352_COLORIMETRY_MASK);
		payload |= eotf << XV_SDITX_TX_ST352_EOTF_SHIFT |
			colorimetry << XV_SDITX_TX_ST352_COLORIMETRY_SHIFT;
	}
	return payload;
}
u32 XV_SdiTx_GetPayloadEotf ( XV_SdiTx * InstancePtr , XVidC_Eotf Eotf , XVidC_ColorStd Colorimetry ) { XVidC_Eotf eotf ; XVidC_ColorStd colorimetry ; u32 payload = 0 ; switch ( Eotf ) { case XVIDC_EOTF_TG_SDR : eotf = XSDIVID_EOTF_SDRTV ; break ; case XVIDC_EOTF_SMPTE2084 : eotf = XSDIVID_EOTF_SMPTE2084 ; break ; case XVIDC_EOTF_HLG : eotf = XSDIVID_EOTF_HLG ; break ; case XVIDC_EOTF_UNKNOWN : eotf = XSDIVID_EOTF_UNKNOWN ; break ; default : eotf = XSDIVID_EOTF_SDRTV ; break ; } switch ( Colorimetry ) { case XVIDC_BT_709 : colorimetry = XV_SDIVID_COLORIMETRY_BT709 ; break ; case XVIDC_BT_2020 : colorimetry = XV_SDIVID_COLORIMETRY_BT2020 ; break ; default : colorimetry = XV_SDIVID_COLORIMETRY_BT709 ; break ; } if ( InstancePtr -> Transport . TMode == XSDIVID_MODE_HD ) { payload &= ~ ( XV_SDITX_TX_ST352_EOTF_MASK | XV_SDITX_TX_ST352_COLORIMETRY_HD_MASK ) ; payload |= eotf << XV_SDITX_TX_ST352_EOTF_SHIFT | colorimetry << XV_SDITX_TX_ST352_COLORIMETRY_HD_SHIFT ; } else { payload &= ~ ( XV_SDITX_TX_ST352_EOTF_MASK | XV_SDITX_TX_ST352_COLORIMETRY_MASK ) ; payload |= eotf << XV_SDITX_TX_ST352_EOTF_SHIFT | colorimetry << XV_SDITX_TX_ST352_COLORIMETRY_SHIFT ; } return payload ; }
This function updates the eotf and colorimetry fields of st352 payload
 value for all SDI modes.
This function updates the eotf and colorimetry fields of st352 payload value for all SDI modes .
/*
	 * For HD mode, bit 23 and bit 20 of payload represents colorimetry as per
	 * SMPTE 292-1:2018 Sec 9.5
	 * For other modes, its bit 21 and bit 20.
	 * For BT709 and BT2020 -bit 20 is always zero.
	 */