video_common: edid: Use color depth enumeration type.

Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
Andrei-Liviu Simion 2015-01-21 11:42:22 -08:00 committed by Nava kishore Manne
parent 9beb00b9b9
commit 051ddc74e5
4 changed files with 16 additions and 15 deletions

View file

@ -119,10 +119,9 @@ static void Edid_Print_BaseBasicDisp(u8 *EdidRaw)
/* Input is a digital video signal interface. */ /* Input is a digital video signal interface. */
xil_printf("\tVideo signal interface is digital.\n"); xil_printf("\tVideo signal interface is digital.\n");
if (XVidC_EdidGetBDispVidDigBpc(EdidRaw) != if (XVidC_EdidGetColorDepth(EdidRaw) != XVIDC_BPC_UNKNOWN) {
XVIDC_EDID_BDISP_VID_DIG_BPC_UNDEF) {
xil_printf("\tColor bit depth:\t%d\n", xil_printf("\tColor bit depth:\t%d\n",
XVidC_EdidGetBDispVidDigBpc(EdidRaw)); XVidC_EdidGetColorDepth(EdidRaw));
} }
else { else {
xil_printf("\tColor bit depth is undefined.\n"); xil_printf("\tColor bit depth is undefined.\n");

View file

@ -248,8 +248,9 @@ typedef enum {
XVIDC_BPC_8 = 8, XVIDC_BPC_8 = 8,
XVIDC_BPC_10 = 10, XVIDC_BPC_10 = 10,
XVIDC_BPC_12 = 12, XVIDC_BPC_12 = 12,
XVIDC_BPC_14 = 14,
XVIDC_BPC_16 = 16, XVIDC_BPC_16 = 16,
XVIDC_BPC_NUM_SUPPORTED = 5, XVIDC_BPC_NUM_SUPPORTED = 6,
XVIDC_BPC_UNKNOWN XVIDC_BPC_UNKNOWN
} XVidC_ColorDepth; } XVidC_ColorDepth;

View file

@ -99,7 +99,8 @@ void XVidC_EdidGetVpiIdManName(u8 *EdidRaw, char ManName[4])
/******************************************************************************/ /******************************************************************************/
/** /**
* Get the color bit depth (bits per primary color) as specified in the supplied * Get the color bit depth (bits per primary color) as specified in the basic
* display parameters and features, video input definition field of the supplied
* base Extended Display Identification Data (EDID). * base Extended Display Identification Data (EDID).
* *
* @param EdidRaw is the supplied base EDID to retrieve color depth * @param EdidRaw is the supplied base EDID to retrieve color depth
@ -111,7 +112,7 @@ void XVidC_EdidGetVpiIdManName(u8 *EdidRaw, char ManName[4])
* @note None. * @note None.
* *
*******************************************************************************/ *******************************************************************************/
u8 XVidC_EdidGetBDispVidDigBpc(u8 *EdidRaw) XVidC_ColorDepth XVidC_EdidGetColorDepth(u8 *EdidRaw)
{ {
u8 Bpc; u8 Bpc;
@ -119,31 +120,31 @@ u8 XVidC_EdidGetBDispVidDigBpc(u8 *EdidRaw)
XVIDC_EDID_BDISP_VID_DIG_BPC_MASK) >> XVIDC_EDID_BDISP_VID_DIG_BPC_MASK) >>
XVIDC_EDID_BDISP_VID_DIG_BPC_SHIFT)) { XVIDC_EDID_BDISP_VID_DIG_BPC_SHIFT)) {
case XVIDC_EDID_BDISP_VID_DIG_BPC_6: case XVIDC_EDID_BDISP_VID_DIG_BPC_6:
Bpc = 6; Bpc = XVIDC_BPC_6;
break; break;
case XVIDC_EDID_BDISP_VID_DIG_BPC_8: case XVIDC_EDID_BDISP_VID_DIG_BPC_8:
Bpc = 8; Bpc = XVIDC_BPC_8;
break; break;
case XVIDC_EDID_BDISP_VID_DIG_BPC_10: case XVIDC_EDID_BDISP_VID_DIG_BPC_10:
Bpc = 10; Bpc = XVIDC_BPC_10;
break; break;
case XVIDC_EDID_BDISP_VID_DIG_BPC_12: case XVIDC_EDID_BDISP_VID_DIG_BPC_12:
Bpc = 12; Bpc = XVIDC_BPC_12;
break; break;
case XVIDC_EDID_BDISP_VID_DIG_BPC_14: case XVIDC_EDID_BDISP_VID_DIG_BPC_14:
Bpc = 14; Bpc = XVIDC_BPC_14;
break; break;
case XVIDC_EDID_BDISP_VID_DIG_BPC_16: case XVIDC_EDID_BDISP_VID_DIG_BPC_16:
Bpc = 16; Bpc = XVIDC_BPC_16;
break; break;
default: default:
Bpc = XVIDC_EDID_BDISP_VID_DIG_BPC_UNDEF; Bpc = XVIDC_BPC_UNKNOWN;
break; break;
} }

View file

@ -307,7 +307,7 @@
((E[XVIDC_EDID_BDISP_VID] & XVIDC_EDID_BDISP_VID_ANA_COMP_SYNC_G_MASK) != 0) ((E[XVIDC_EDID_BDISP_VID] & XVIDC_EDID_BDISP_VID_ANA_COMP_SYNC_G_MASK) != 0)
#define XVidC_EdidSuppBDispVidAnaSerrVsync(E) \ #define XVidC_EdidSuppBDispVidAnaSerrVsync(E) \
((E[XVIDC_EDID_BDISP_VID] & XVIDC_EDID_BDISP_VID_ANA_SERR_V_SYNC_MASK) != 0) ((E[XVIDC_EDID_BDISP_VID] & XVIDC_EDID_BDISP_VID_ANA_SERR_V_SYNC_MASK) != 0)
/* u8 XVidC_EdidGetBDispVidDigBpc(u8 *EdidRaw); */ /* XVidC_ColorDepth XVidC_EdidGetColorDepth(u8 *EdidRaw); */
#define XVidC_EdidGetBDispVidDigVis(E) \ #define XVidC_EdidGetBDispVidDigVis(E) \
(E[XVIDC_EDID_BDISP_VID] & XVIDC_EDID_BDISP_VID_DIG_VIS_MASK) (E[XVIDC_EDID_BDISP_VID] & XVIDC_EDID_BDISP_VID_DIG_VIS_MASK)
@ -457,7 +457,7 @@
void XVidC_EdidGetVpiIdManName(u8 *EdidRaw, char ManName[4]); void XVidC_EdidGetVpiIdManName(u8 *EdidRaw, char ManName[4]);
/* Basic display parameters and features: Video input definition. */ /* Basic display parameters and features: Video input definition. */
u8 XVidC_EdidGetBDispVidDigBpc(u8 *EdidRaw); XVidC_ColorDepth XVidC_EdidGetColorDepth(u8 *EdidRaw);
/* Color characteristics (display x,y chromaticity coordinates). */ /* Color characteristics (display x,y chromaticity coordinates). */
float XVidC_EdidGetCcRedX(u8 *EdidRaw); float XVidC_EdidGetCcRedX(u8 *EdidRaw);