Skip to content

Commit

Permalink
Add a whine for descriptor block ordering.
Browse files Browse the repository at this point in the history
  • Loading branch information
anholt committed Feb 14, 2007
1 parent 49da179 commit 7b4fa26
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions edid-decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ int has_valid_week = 0;
int has_valid_year = 0;
int has_valid_detailed_blocks = 0;
int has_valid_extension_count = 0;
int has_valid_descriptor_ordering = 1;
int seen_non_detailed_descriptor = 0;

int conformant = 1;

Expand All @@ -68,6 +70,7 @@ detailed_block(unsigned char *x)
int ha, hbl, hso, hspw, hborder, va, vbl, vso, vspw, vborder;

if (!x[0] && !x[1] && !x[2] && !x[4]) {
seen_non_detailed_descriptor = 1;
switch (x[3]) {
case 0x10:
printf("Dummy block\n");
Expand Down Expand Up @@ -109,6 +112,10 @@ detailed_block(unsigned char *x)
}
}

if (seen_non_detailed_descriptor) {
has_valid_descriptor_ordering = 0;
}

did_detailed_timing = 1;
ha = (x[2] + ((x[4] & 0xF0) << 4));
hbl = (x[3] + ((x[4] & 0x0F) << 8));
Expand Down Expand Up @@ -396,6 +403,14 @@ int main(int argc, char **argv)
printf("\tImpossible extension block count\n");
}

/* Not sure which chunk of spec exactly requires this. See E-EDID guide
* section 3.7.3.
*/
if (!has_valid_descriptor_ordering) {
printf("EDID block has detailed timing descriptors after other "
"descriptors!\n");
}

free(edid);

return 0;
Expand Down

0 comments on commit 7b4fa26

Please sign in to comment.