XilinxProcessorIPLib/drivers/dppsu/src/xdppsu_edid.c
u32 XDpPsu_GetDispIdDataBlock(u8 *DisplayIdRaw, u8 SectionTag, u8 **DataBlockPtr)
{
	u8 Index;
	u8 DispIdSize = DisplayIdRaw[XDPPSU_DISPID_SIZE];
	u8 *DataBlock;

	/* Search for a section data block matching the specified tag. */
	for (Index = XDPPSU_DISPID_PAYLOAD_START; Index < DispIdSize; Index++) {
		DataBlock = &DisplayIdRaw[Index];

		/* Check if the tag mataches the current section data block. */
		if (DataBlock[XDPPSU_DISPID_DB_SEC_TAG] == SectionTag) {
			*DataBlockPtr = DataBlock;
			return XST_SUCCESS;
		}

		if (DataBlock[XDPPSU_DISPID_DB_SEC_SIZE] == 0) {
			/* End of valid section data blocks. */
			break;
		}
		else {
			/* Increment the search index to skip the remaining
			 * bytes of the current section data block. */
			Index += (XDPPSU_DISPID_DB_SEC_SIZE +
					DataBlock[XDPPSU_DISPID_DB_SEC_SIZE]);
		}
	}

	/* The entire DisplayID was searched or the search ended due to data
	 * no longer containing a valid section data block. No section data
	 * block with the specified tag was found. */
	return XST_FAILURE;
}
/******************************************************************************/
/**
 * Given a section tag, search for and retrieve the appropriate section data
 * block that is part of the specified DisplayID structure.
 *
 * @param	DisplayIdRaw is a pointer to the DisplayID data.
 * @param	SectionTag is the tag to search for that represents the desired
 *		section data block.
 * @param	DataBlockPtr will be set by this function to point to the
 *		appropriate section data block that is part of the DisplayIdRaw.
 *
 * @return
 *		- XST_SUCCESS if the section data block with the specified tag
 *		  was found.
 *		- XST_FAILURE otherwise.
 *
 * @note	The DataBlockPtr argument is modified to point to the entry
 *		in DisplayIdRaw that represents the beginning of the desired
		section data block.
 *
*******************************************************************************/
Given a section tag, search for and retrieve the appropriate section data
block that is part of the specified DisplayID structure.

@param       DisplayIdRaw is a pointer to the DisplayID data.
@param       SectionTag is the tag to search for that represents the desired
section data block.
@param       DataBlockPtr will be set by this function to point to the
appropriate section data block that is part of the DisplayIdRaw.

@return
- XST_SUCCESS if the section data block with the specified tag
was found.

@note        The DataBlockPtr argument is modified to point to the entry
in DisplayIdRaw that represents the beginning of the desired
section data block.
Given a section tag search for and retrieve the appropriate section data block that is part of the specified DisplayID structure . @param DisplayIdRaw is a pointer to the DisplayID data . @param SectionTag is the tag to search for that represents the desired section data block . @param DataBlockPtr will be set by this function to point to the appropriate section data block that is part of the DisplayIdRaw . @return - XST_SUCCESS if the section data block with the specified tag was found . @note The DataBlockPtr argument is modified to point to the entry in DisplayIdRaw that represents the beginning of the desired section data block .
u32 XDpPsu_GetDispIdDataBlock(u8 *DisplayIdRaw, u8 SectionTag, u8 **DataBlockPtr)
{
	u8 Index;
	u8 DispIdSize = DisplayIdRaw[XDPPSU_DISPID_SIZE];
	u8 *DataBlock;
	for (Index = XDPPSU_DISPID_PAYLOAD_START; Index < DispIdSize; Index++) {
		DataBlock = &DisplayIdRaw[Index];
		if (DataBlock[XDPPSU_DISPID_DB_SEC_TAG] == SectionTag) {
			*DataBlockPtr = DataBlock;
			return XST_SUCCESS;
		}
		if (DataBlock[XDPPSU_DISPID_DB_SEC_SIZE] == 0) {
			break;
		}
		else {
			Index += (XDPPSU_DISPID_DB_SEC_SIZE +
					DataBlock[XDPPSU_DISPID_DB_SEC_SIZE]);
		}
	}
	return XST_FAILURE;
}
u32 XDpPsu_GetDispIdDataBlock ( u8 * DisplayIdRaw , u8 SectionTag , u8 * * DataBlockPtr ) { u8 Index ; u8 DispIdSize = DisplayIdRaw [ XDPPSU_DISPID_SIZE ] ; u8 * DataBlock ; for ( Index = XDPPSU_DISPID_PAYLOAD_START ; Index < DispIdSize ; Index ++ ) { DataBlock = & DisplayIdRaw [ Index ] ; if ( DataBlock [ XDPPSU_DISPID_DB_SEC_TAG ] == SectionTag ) { * DataBlockPtr = DataBlock ; return XST_SUCCESS ; } if ( DataBlock [ XDPPSU_DISPID_DB_SEC_SIZE ] == 0 ) { break ; } else { Index += ( XDPPSU_DISPID_DB_SEC_SIZE + DataBlock [ XDPPSU_DISPID_DB_SEC_SIZE ] ) ; } } return XST_FAILURE ; }
Given a section tag, search for and retrieve the appropriate section data
 block that is part of the specified DisplayID structure.
Given a section tag search for and retrieve the appropriate section data block that is part of the specified DisplayID structure .
/* Search for a section data block matching the specified tag. */ /* Check if the tag mataches the current section data block. */ /* End of valid section data blocks. */ /* Increment the search index to skip the remaining
			 * bytes of the current section data block. */ /* The entire DisplayID was searched or the search ended due to data
	 * no longer containing a valid section data block. No section data
	 * block with the specified tag was found. */