edid.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | Timing
struct | DetailedTiming
struct | MonitorInfo

## Typedefs

typedef unsigned char | uchar

## Enumerations

enum | Interface { UNDEFINED, DVI, HDMI_A, HDMI_B, MDDI, DISPLAY_PORT }
enum | ColorType { UNDEFINED_COLOR, MONOCHROME, RGB, OTHER_COLOR }
enum | StereoType { NO_STEREO, FIELD_RIGHT, FIELD_LEFT, TWO_WAY_RIGHT_ON_EVEN, TWO_WAY_LEFT_ON_EVEN, FOUR_WAY_INTERLEAVED, SIDE_BY_SIDE }

## Functions

MonitorInfo * | decode_edid (const uchar *data)
void | dump_monitor_info (MonitorInfo *info)
char * | make_display_name (const char *output_name, const MonitorInfo *info)

## Typedef Documentation

## uchar

typedef unsigned char uchar

Definition at line 1 of file edid.h.

## Enumeration Type Documentation

## ColorType

enum ColorType

Enumerator
UNDEFINED_COLOR |
MONOCHROME |
RGB |
OTHER_COLOR |

Definition at line 16 of file edid.h.

{
UNDEFINED_COLOR,
MONOCHROME,
RGB,
OTHER_COLOR
} ColorType;

## Interface

enum Interface

Enumerator
UNDEFINED |
DVI |
HDMI_A |
HDMI_B |
MDDI |
DISPLAY_PORT |

Definition at line 6 of file edid.h.

{
UNDEFINED,
DVI,
HDMI_A,
HDMI_B,
MDDI,
DISPLAY_PORT
} Interface;

## StereoType

enum StereoType

Enumerator
NO_STEREO |
FIELD_RIGHT |
FIELD_LEFT |
TWO_WAY_RIGHT_ON_EVEN |
TWO_WAY_LEFT_ON_EVEN |
FOUR_WAY_INTERLEAVED |
SIDE_BY_SIDE |

Definition at line 24 of file edid.h.

{
NO_STEREO,
FIELD_RIGHT,
FIELD_LEFT,
TWO_WAY_RIGHT_ON_EVEN,
TWO_WAY_LEFT_ON_EVEN,
FOUR_WAY_INTERLEAVED,
SIDE_BY_SIDE
} StereoType;

## Function Documentation

## decode_edid()

MonitorInfo* decode_edid | ( | const uchar * | data | ) |

Definition at line 523 of file edid-parse.c.

{
MonitorInfo *info = calloc (1, sizeof (MonitorInfo));
decode_check_sum (edid, info);
if (!decode_header (edid) ||
!decode_vendor_and_product_identification (edid, info) ||
!decode_edid_version (edid, info) ||
!decode_display_parameters (edid, info) ||
!decode_color_characteristics (edid, info) ||
!decode_established_timings (edid, info) ||
!decode_standard_timings (edid, info) ||
!decode_descriptors (edid, info)) {
free(info);
return NULL;
}
return info;
}

References decode_check_sum(), decode_color_characteristics(), decode_descriptors(), decode_display_parameters(), decode_edid_version(), decode_established_timings(), decode_header(), decode_standard_timings(), decode_vendor_and_product_identification(), free, and NULL.

## dump_monitor_info()

void dump_monitor_info | ( | MonitorInfo * | info | ) |

Definition at line 551 of file edid-parse.c.

{
int i;
printf ("Checksum: %d (%s)\n",
info->checksum, info->checksum? "incorrect" : "correct");
printf ("Manufacturer Code: %s\n", info->manufacturer_code);
printf ("Product Code: 0x%x\n", info->product_code);
printf ("Serial Number: %u\n", info->serial_number);
if (info->production_week != -1)
printf ("Production Week: %d\n", info->production_week);
else
printf ("Production Week: unspecified\n");
if (info->production_year != -1)
printf ("Production Year: %d\n", info->production_year);
else
printf ("Production Year: unspecified\n");
if (info->model_year != -1)
printf ("Model Year: %d\n", info->model_year);
else
printf ("Model Year: unspecified\n");
printf ("EDID revision: %d.%d\n", info->major_version, info->minor_version);
printf ("Display is %s\n", info->is_digital? "digital" : "analog");
if (info->is_digital)
{
const char *interface;
if (info->ad.digital.bits_per_primary != -1)
printf ("Bits Per Primary: %d\n", info->ad.digital.bits_per_primary);
else
printf ("Bits Per Primary: undefined\n");
switch (info->ad.digital.interface)
{
case DVI: interface = "DVI"; break;
case HDMI_A: interface = "HDMI-a"; break;
case HDMI_B: interface = "HDMI-b"; break;
case MDDI: interface = "MDDI"; break;
case DISPLAY_PORT: interface = "DisplayPort"; break;
case UNDEFINED: interface = "undefined"; break;
default: interface = "unknown"; break;
}
printf ("Interface: %s\n", interface);
printf ("RGB 4:4:4: %s\n", yesno (info->ad.digital.rgb444));
printf ("YCrCb 4:4:4: %s\n", yesno (info->ad.digital.ycrcb444));
printf ("YCrCb 4:2:2: %s\n", yesno (info->ad.digital.ycrcb422));
}
else
{
const char *s;
printf ("Video Signal Level: %f\n", info->ad.analog.video_signal_level);
printf ("Sync Signal Level: %f\n", info->ad.analog.sync_signal_level);
printf ("Total Signal Level: %f\n", info->ad.analog.total_signal_level);
printf ("Blank to Black: %s\n",
yesno (info->ad.analog.blank_to_black));
printf ("Separate HV Sync: %s\n",
yesno (info->ad.analog.separate_hv_sync));
printf ("Composite Sync on H: %s\n",
yesno (info->ad.analog.composite_sync_on_h));
printf ("Serration on VSync: %s\n",
yesno (info->ad.analog.serration_on_vsync));
switch (info->ad.analog.color_type)
{
case UNDEFINED_COLOR: s = "undefined"; break;
case MONOCHROME: s = "monochrome"; break;
case RGB: s = "rgb"; break;
case OTHER_COLOR: s = "other color"; break;
default: s = "unknown"; break;
};
printf ("Color: %s\n", s);
}
if (info->width_mm == -1)
printf ("Width: undefined\n");
else
printf ("Width: %d mm\n", info->width_mm);
if (info->height_mm == -1)
printf ("Height: undefined\n");
else
printf ("Height: %d mm\n", info->height_mm);
if (info->aspect_ratio > 0)
printf ("Aspect Ratio: %f\n", info->aspect_ratio);
else
printf ("Aspect Ratio: undefined\n");
if (info->gamma >= 0)
printf ("Gamma: %f\n", info->gamma);
else
printf ("Gamma: undefined\n");
printf ("Standby: %s\n", yesno (info->standby));
printf ("Suspend: %s\n", yesno (info->suspend));
printf ("Active Off: %s\n", yesno (info->active_off));
printf ("SRGB is Standard: %s\n", yesno (info->srgb_is_standard));
printf ("Preferred Timing Includes Native: %s\n",
yesno (info->preferred_timing_includes_native));
printf ("Continuous Frequency: %s\n", yesno (info->continuous_frequency));
printf ("Red X: %f\n", info->red_x);
printf ("Red Y: %f\n", info->red_y);
printf ("Green X: %f\n", info->green_x);
printf ("Green Y: %f\n", info->green_y);
printf ("Blue X: %f\n", info->blue_x);
printf ("Blue Y: %f\n", info->blue_y);
printf ("White X: %f\n", info->white_x);
printf ("White Y: %f\n", info->white_y);
printf ("Established Timings:\n");
for (i = 0; i < 24; ++i)
{
Timing *timing = &(info->established[i]);
if (timing->frequency == 0)
break;
printf (" %d x %d @ %d Hz\n",
timing->width, timing->height, timing->frequency);
}
printf ("Standard Timings:\n");
for (i = 0; i < 8; ++i)
{
Timing *timing = &(info->standard[i]);
if (timing->frequency == 0)
break;
printf (" %d x %d @ %d Hz\n",
timing->width, timing->height, timing->frequency);
}
for (i = 0; i < info->n_detailed_timings; ++i)
{
DetailedTiming *timing = &(info->detailed_timings[i]);
const char *s;
printf ("Timing%s: \n",
(i == 0 && info->preferred_timing_includes_native)?
" (Preferred)" : "");
printf (" Pixel Clock: %d\n", timing->pixel_clock);
printf (" H Addressable: %d\n", timing->h_addr);
printf (" H Blank: %d\n", timing->h_blank);
printf (" H Front Porch: %d\n", timing->h_front_porch);
printf (" H Sync: %d\n", timing->h_sync);
printf (" V Addressable: %d\n", timing->v_addr);
printf (" V Blank: %d\n", timing->v_blank);
printf (" V Front Porch: %d\n", timing->v_front_porch);
printf (" V Sync: %d\n", timing->v_sync);
printf (" Width: %d mm\n", timing->width_mm);
printf (" Height: %d mm\n", timing->height_mm);
printf (" Right Border: %d\n", timing->right_border);
printf (" Top Border: %d\n", timing->top_border);
switch (timing->stereo)
{
default:
case NO_STEREO: s = "No Stereo"; break;
case FIELD_RIGHT: s = "Field Sequential, Right on Sync"; break;
case FIELD_LEFT: s = "Field Sequential, Left on Sync"; break;
case TWO_WAY_RIGHT_ON_EVEN: s = "Two-way, Right on Even"; break;
case TWO_WAY_LEFT_ON_EVEN: s = "Two-way, Left on Even"; break;
case FOUR_WAY_INTERLEAVED: s = "Four-way Interleaved"; break;
case SIDE_BY_SIDE: s = "Side-by-Side"; break;
}
printf (" Stereo: %s\n", s);
if (timing->digital_sync)
{
printf (" Digital Sync:\n");
printf (" composite: %s\n", yesno (timing->ad.digital.composite));
printf (" serrations: %s\n", yesno (timing->ad.digital.serrations));
printf (" negative vsync: %s\n",
yesno (timing->ad.digital.negative_vsync));
printf (" negative hsync: %s\n",
yesno (timing->ad.digital.negative_hsync));
}
else
{
printf (" Analog Sync:\n");
printf (" bipolar: %s\n", yesno (timing->ad.analog.bipolar));
printf (" serrations: %s\n", yesno (timing->ad.analog.serrations));
printf (" sync on green: %s\n", yesno (
timing->ad.analog.sync_on_green));
}
}
printf ("Detailed Product information:\n");
printf (" Product Name: %s\n", info->dsc_product_name);
printf (" Serial Number: %s\n", info->dsc_serial_number);
printf (" Unspecified String: %s\n", info->dsc_string);
}

References MonitorInfo::active_off, DetailedTiming::ad, MonitorInfo::ad, DetailedTiming::analog, MonitorInfo::analog, MonitorInfo::aspect_ratio, MonitorInfo::blue_x, MonitorInfo::blue_y, MonitorInfo::checksum, MonitorInfo::continuous_frequency, MonitorInfo::detailed_timings, DetailedTiming::digital, MonitorInfo::digital, DetailedTiming::digital_sync, DISPLAY_PORT, MonitorInfo::dsc_product_name, MonitorInfo::dsc_serial_number, MonitorInfo::dsc_string, DVI, MonitorInfo::established, FIELD_LEFT, FIELD_RIGHT, FOUR_WAY_INTERLEAVED, Timing::frequency, MonitorInfo::gamma, MonitorInfo::green_x, MonitorInfo::green_y, DetailedTiming::h_addr, DetailedTiming::h_blank, DetailedTiming::h_front_porch, DetailedTiming::h_sync, HDMI_A, HDMI_B, Timing::height, DetailedTiming::height_mm, MonitorInfo::height_mm, i, MonitorInfo::is_digital, MonitorInfo::major_version, MonitorInfo::manufacturer_code, MDDI, MonitorInfo::minor_version, MonitorInfo::model_year, MONOCHROME, MonitorInfo::n_detailed_timings, NO_STEREO, OTHER_COLOR, DetailedTiming::pixel_clock, MonitorInfo::preferred_timing_includes_native, MonitorInfo::product_code, MonitorInfo::production_week, MonitorInfo::production_year, MonitorInfo::red_x, MonitorInfo::red_y, RGB, DetailedTiming::right_border, MonitorInfo::serial_number, SIDE_BY_SIDE, MonitorInfo::srgb_is_standard, MonitorInfo::standard, MonitorInfo::standby, DetailedTiming::stereo, MonitorInfo::suspend, DetailedTiming::top_border, TWO_WAY_LEFT_ON_EVEN, TWO_WAY_RIGHT_ON_EVEN, UNDEFINED, UNDEFINED_COLOR, DetailedTiming::v_addr, DetailedTiming::v_blank, DetailedTiming::v_front_porch, DetailedTiming::v_sync, MonitorInfo::white_x, MonitorInfo::white_y, Timing::width, DetailedTiming::width_mm, MonitorInfo::width_mm, and yesno().

## make_display_name()

char* make_display_name | ( | const char * | output_name,
|  | const MonitorInfo * | info
| ) |  |

MonitorInfo::preferred_timing_includes_native
int preferred_timing_includes_native
Definition: edid.h:134
MonitorInfo::dsc_string
char dsc_string[14]
Definition: edid.h:161
OTHER_COLOR
@ OTHER_COLOR
Definition: edid.h:21
DetailedTiming::h_sync
int h_sync
Definition: edid.h:47
decode_descriptors
static int decode_descriptors(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:482
FOUR_WAY_INTERLEAVED
@ FOUR_WAY_INTERLEAVED
Definition: edid.h:31
NULL
#define NULL
Definition: begin_code.h:167
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109
MonitorInfo::standard
Timing standard[8]
Definition: edid.h:147
MonitorInfo
Definition: edid.h:80
HDMI_B
@ HDMI_B
Definition: edid.h:11
DetailedTiming::height_mm
int height_mm
Definition: edid.h:54
MonitorInfo::established
Timing established[24]
Definition: edid.h:146
DetailedTiming::top_border
int top_border
Definition: edid.h:56
UNDEFINED
@ UNDEFINED
Definition: edid.h:8
TWO_WAY_LEFT_ON_EVEN
@ TWO_WAY_LEFT_ON_EVEN
Definition: edid.h:30
MonitorInfo::manufacturer_code
char manufacturer_code[4]
Definition: edid.h:83
decode_edid_version
static int decode_edid_version(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:114
MDDI
@ MDDI
Definition: edid.h:12
StereoType
StereoType
Definition: edid.h:24
RGB
@ RGB
Definition: edid.h:20
decode_established_timings
static int decode_established_timings(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:273
MonitorInfo::digital
struct MonitorInfo::@277::@278 digital
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
DetailedTiming::digital
struct DetailedTiming::@274::@276 digital
MONOCHROME
@ MONOCHROME
Definition: edid.h:19
HDMI_A
@ HDMI_A
Definition: edid.h:10
decode_display_parameters
static int decode_display_parameters(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:123
DetailedTiming::analog
struct DetailedTiming::@274::@275 analog
Timing::frequency
int frequency
Definition: edid.h:39
MonitorInfo::aspect_ratio
double aspect_ratio
Definition: edid.h:125
TWO_WAY_RIGHT_ON_EVEN
@ TWO_WAY_RIGHT_ON_EVEN
Definition: edid.h:29
Timing::height
int height
Definition: edid.h:38
MonitorInfo::analog
struct MonitorInfo::@277::@279 analog
MonitorInfo::blue_x
double blue_x
Definition: edid.h:141
MonitorInfo::active_off
int active_off
Definition: edid.h:131
MonitorInfo::suspend
int suspend
Definition: edid.h:130
DetailedTiming::pixel_clock
int pixel_clock
Definition: edid.h:44
MonitorInfo::green_x
double green_x
Definition: edid.h:139
DetailedTiming::h_addr
int h_addr
Definition: edid.h:45
decode_color_characteristics
static int decode_color_characteristics(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:258
MonitorInfo::blue_y
double blue_y
Definition: edid.h:142
DetailedTiming::right_border
int right_border
Definition: edid.h:55
MonitorInfo::dsc_serial_number
char dsc_serial_number[14]
Definition: edid.h:159
MonitorInfo::n_detailed_timings
int n_detailed_timings
Definition: edid.h:149
MonitorInfo::width_mm
int width_mm
Definition: edid.h:123
MonitorInfo::minor_version
int minor_version
Definition: edid.h:92
MonitorInfo::height_mm
int height_mm
Definition: edid.h:124
DetailedTiming::v_front_porch
int v_front_porch
Definition: edid.h:52
ColorType
ColorType
Definition: edid.h:16
DetailedTiming::digital_sync
int digital_sync
Definition: edid.h:60
MonitorInfo::production_week
int production_week
Definition: edid.h:87
NO_STEREO
@ NO_STEREO
Definition: edid.h:26
decode_header
static int decode_header(const uchar *edid)
Definition: edid-parse.c:51
MonitorInfo::is_digital
int is_digital
Definition: edid.h:94
DetailedTiming::v_sync
int v_sync
Definition: edid.h:51
MonitorInfo::ad
union MonitorInfo::@277 ad
MonitorInfo::serial_number
unsigned int serial_number
Definition: edid.h:85
DetailedTiming::v_addr
int v_addr
Definition: edid.h:49
Timing
Definition: edid.h:35
DetailedTiming::ad
union DetailedTiming::@274 ad
MonitorInfo::green_y
double green_y
Definition: edid.h:140
yesno
static const char * yesno(int v)
Definition: edid-parse.c:545
Timing::width
int width
Definition: edid.h:37
DetailedTiming::v_blank
int v_blank
Definition: edid.h:50
MonitorInfo::standby
int standby
Definition: edid.h:129
UNDEFINED_COLOR
@ UNDEFINED_COLOR
Definition: edid.h:18
FIELD_RIGHT
@ FIELD_RIGHT
Definition: edid.h:27
MonitorInfo::srgb_is_standard
int srgb_is_standard
Definition: edid.h:133
DetailedTiming::stereo
StereoType stereo
Definition: edid.h:58
DetailedTiming::width_mm
int width_mm
Definition: edid.h:53
s
GLdouble s
Definition: SDL_opengl.h:2063
MonitorInfo::detailed_timings
DetailedTiming detailed_timings[4]
Definition: edid.h:150
Interface
Interface
Definition: edid.h:6
SIDE_BY_SIDE
@ SIDE_BY_SIDE
Definition: edid.h:32
FIELD_LEFT
@ FIELD_LEFT
Definition: edid.h:28
decode_check_sum
static void decode_check_sum(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:510
MonitorInfo::red_y
double red_y
Definition: edid.h:138
DISPLAY_PORT
@ DISPLAY_PORT
Definition: edid.h:13
MonitorInfo::gamma
double gamma
Definition: edid.h:127
MonitorInfo::white_y
double white_y
Definition: edid.h:144
decode_vendor_and_product_identification
static int decode_vendor_and_product_identification(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:59
DetailedTiming::h_blank
int h_blank
Definition: edid.h:46
DetailedTiming::h_front_porch
int h_front_porch
Definition: edid.h:48
MonitorInfo::dsc_product_name
char dsc_product_name[14]
Definition: edid.h:160
decode_standard_timings
static int decode_standard_timings(const uchar *edid, MonitorInfo *info)
Definition: edid-parse.c:326
MonitorInfo::model_year
int model_year
Definition: edid.h:89
MonitorInfo::white_x
double white_x
Definition: edid.h:143
MonitorInfo::product_code
int product_code
Definition: edid.h:84
free
SDL_EventEntry * free
Definition: SDL_events.c:82
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
MonitorInfo::checksum
int checksum
Definition: edid.h:82
MonitorInfo::major_version
int major_version
Definition: edid.h:91
MonitorInfo::production_year
int production_year
Definition: edid.h:88
MonitorInfo::continuous_frequency
int continuous_frequency
Definition: edid.h:135
DVI
@ DVI
Definition: edid.h:9
MonitorInfo::red_x
double red_x
Definition: edid.h:137
DetailedTiming
Definition: edid.h:42