Skip to content

Commit

Permalink
Print the HDMI resolution next to the HDMI VICs
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
  • Loading branch information
Damien Lespiau committed Aug 19, 2013
1 parent 6ade66a commit c630139
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions edid-decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,13 @@ cea_video_block(unsigned char *x)
}
}

static const char *edid_cea_hdmi_modes[] = {
"3840x2160@30Hz",
"3840x2160@25Hz",
"3840x2160@24Hz",
"4096x2160@24Hz",
};

static void
cea_hdmi_block(unsigned char *x)
{
Expand Down Expand Up @@ -737,8 +744,18 @@ cea_hdmi_block(unsigned char *x)
if (len_vic) {
int i;

for (i = 0; i < len_vic; i++)
printf(" HDMI VIC %d\n", x[9 + b + i]);
for (i = 0; i < len_vic; i++) {
unsigned char vic = x[9 + b + i];
const char *mode;

vic--;
if (vic < ARRAY_SIZE(edid_cea_hdmi_modes))
mode = edid_cea_hdmi_modes[vic];
else
mode = "Unknown mode";

printf(" HDMI VIC %d %s\n", vic, mode);
}

b += len_vic;
}
Expand Down

0 comments on commit c630139

Please sign in to comment.