From c1f33ddd8f03775395f6b0e799a7ab6fd0323995 Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Wed, 21 Jan 2015 13:56:41 -0800 Subject: [PATCH] video_common: edid: Added function headers for commenting. Signed-off-by: Andrei-Liviu Simion --- .../examples/xvidc_edid_print_example.c | 131 +++++++++++++++++- .../examples/xvidc_edid_print_example.h | 2 +- .../drivers/video_common/src/xvidc.c | 11 -- 3 files changed, 130 insertions(+), 14 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.c b/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.c index 1c4990f6..7029bea2 100644 --- a/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.c +++ b/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.c @@ -32,7 +32,7 @@ /******************************************************************************/ /** * - * @file xvidc_edid_print.c + * @file xvidc_edid_print_example.c * * Contains an example that, given a supplied base Extended Display * Identification Data (EDID) structure, will parse, decode, and print its @@ -74,6 +74,20 @@ static u8 Edid_CalculateChecksum(u8 *Data, u8 Size); /*************************** Function Definitions *****************************/ +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure and prints its contents. + * + * @param EdidRaw is the base EDID structure to decode and print. + * + * @return + * - XST_SUCCESS if the supplied base EDID has a valid EDID header. + * - XST_FAILURE otherwise. The EDID wasn't decoded further. + * + * @note None. + * +*******************************************************************************/ u32 Edid_PrintDecodeBase(u8 *EdidRaw) { /* Check valid header. */ @@ -114,6 +128,20 @@ u32 Edid_PrintDecodeBase(u8 *EdidRaw) return XST_SUCCESS; } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for supported video timing modes and prints all video + * timing modes that are both supported in the EDID and listed in the + * XVidC_VideoTimingModes table. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ void Edid_PrintSuppVmTable(u8 *EdidRaw) { u8 Index; @@ -129,6 +157,18 @@ void Edid_PrintSuppVmTable(u8 *EdidRaw) } } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for the vendor and product ID and prints this information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintBaseVPId(u8 *EdidRaw) { char ManName[4]; @@ -156,6 +196,19 @@ static void Edid_PrintBaseVPId(u8 *EdidRaw) } } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for the EDID version and revision and prints this + * information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintBaseVerRev(u8 *EdidRaw) { /* EDID structure version and revision. */ @@ -164,6 +217,19 @@ static void Edid_PrintBaseVerRev(u8 *EdidRaw) XVidC_EdidGetStructRev(EdidRaw)); } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for basic display parameters and features and prints this + * information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintBaseBasicDisp(u8 *EdidRaw) { /* Basic display parameters and features. */ @@ -416,6 +482,18 @@ static void Edid_PrintBaseBasicDisp(u8 *EdidRaw) xil_printf("continuous frequency.\n"); } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for color characteristics and prints this information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintColorChar(u8 *EdidRaw) { xil_printf("Color characterisitics:\n"); @@ -445,6 +523,19 @@ static void Edid_PrintColorChar(u8 *EdidRaw) FLOAT_FRAC_TO_U32(XVidC_EdidGetCcWhiteY(EdidRaw), 1000000000)); } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for supported established timings and prints this + * information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintEstTimings(u8 *EdidRaw) { xil_printf("Established timings:\n"); @@ -503,9 +594,20 @@ static void Edid_PrintEstTimings(u8 *EdidRaw) XVidC_EdidGetTimingsMan(EdidRaw)); } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for supported standard timings and prints this information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintStdTimings(u8 *EdidRaw) { - /* Standard timings. */ u8 Index; xil_printf("Standard timings:\n"); @@ -522,6 +624,19 @@ static void Edid_PrintStdTimings(u8 *EdidRaw) } } +/******************************************************************************/ +/** + * This function decodes the supplied base Extended Display Identification Data + * (EDID) structure for the preferred timing mode (PTM) and prints its timing + * information. + * + * @param EdidRaw is the base EDID structure to decode. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ static void Edid_PrintPtm(u8 *EdidRaw) { u8 *Ptm; @@ -605,6 +720,18 @@ static void Edid_PrintPtm(u8 *EdidRaw) "Yes." : "No (progressive)."); } +/******************************************************************************/ +/** + * This function calculates a checksum. + * + * @param Data is a pointer to the data to calculate the checksum on. + * @param Size the number of bytes of Data to calculate the checksum on. + * + * @return The checksum value (truncated to a 8 bits). + * + * @note None. + * +*******************************************************************************/ static u8 Edid_CalculateChecksum(u8 *Data, u8 Size) { u8 Index; diff --git a/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.h b/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.h index e5cd30a2..244b93e9 100644 --- a/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.h +++ b/XilinxProcessorIPLib/drivers/video_common/examples/xvidc_edid_print_example.h @@ -32,7 +32,7 @@ /******************************************************************************/ /** * - * @file xvidc_edid_print.h + * @file xvidc_edid_print_example.h * * Contains an example that, given a supplied base Extended Display * Identification Data (EDID) structure, will parse, decode, and print its diff --git a/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c b/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c index 21e52b71..b8c251b4 100644 --- a/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c +++ b/XilinxProcessorIPLib/drivers/video_common/src/xvidc.c @@ -59,7 +59,6 @@ /******************************************************************************/ /** - * * This function calculates pixel clock based on the inputs. * * @param HTotal specifies horizontal total. @@ -78,7 +77,6 @@ u32 XVidC_GetPixelClockHzByHVFr(u32 HTotal, u32 VTotal, u8 FrameRate) /******************************************************************************/ /** - * * This function calculates pixel clock from video mode. * * @param VmId specifies the resolution id. @@ -118,7 +116,6 @@ u32 XVidC_GetPixelClockHzByVmId(XVidC_VideoMode VmId) /******************************************************************************/ /** - * * This function check input video mode is interlaced/progressive. * * @param VmId specifies the resolution id. @@ -141,7 +138,6 @@ XVidC_VideoFormat XVidC_GetVideoFormat(XVidC_VideoMode VmId) /******************************************************************************/ /** - * * This function returns the Video Mode ID that matches the detected input * width, height, frame rate and I/P flag * @@ -244,7 +240,6 @@ XVidC_VideoMode XVidC_GetVideoModeId(u32 Width, u32 Height, u32 FrameRate, /******************************************************************************/ /** - * * This function returns the pointer to video mode data at index provided. * * @param VmId specifies the resolution id. @@ -289,7 +284,6 @@ const char *XVidC_GetVideoModeStr(XVidC_VideoMode VmId) /******************************************************************************/ /** - * * This function returns the frame rate name for index specified. * * @param VmId specifies the resolution id. @@ -362,7 +356,6 @@ char *XVidC_GetFrameRateStr(XVidC_VideoMode VmId) /******************************************************************************/ /** - * * This function returns the color format name for index specified. * * @param ColorSpaceId specifies the index of color space. @@ -398,7 +391,6 @@ char *XVidC_GetColorFormatStr(XVidC_ColorSpace ColorSpaceId) /******************************************************************************/ /** - * * This function returns the frame rate for index specified. * * @param VmId specifies the resolution id. @@ -420,7 +412,6 @@ XVidC_FrameRate XVidC_GetFrameRate(XVidC_VideoMode VmId) /******************************************************************************/ /** - * * This function returns the timing parameters for specified resolution. * * @param VmId specifies the resolution id. @@ -442,7 +433,6 @@ const XVidC_VideoTiming *XVidC_GetTimingInfo(XVidC_VideoMode VmId) /******************************************************************************/ /** - * * This function prints the stream information on STDIO/UART console. * * @param Stream is a pointer to video stream. @@ -468,7 +458,6 @@ void XVidC_ReportStreamInfo(XVidC_VideoStream *Stream) /******************************************************************************/ /** - * * This function prints timing information on STDIO/Uart console. * * @param Timing is a pointer to Video Timing structure of the stream.