diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2017-08-31 13:41:04 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-09-07 12:13:31 -0400 |
commit | b0d44a8b55f9d961e8af02d74411afae1ce687c2 (patch) | |
tree | 2e3d93a5a685462a6f2df9f9520630297af29a38 | |
parent | 83cd9713a3eb07e687471d117d3cde017a3ae58b (diff) |
edid-decode: add support for the Color Point
Support the Color Point Descriptor Definition (tag 0xfb).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r-- | edid-decode.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/edid-decode.c b/edid-decode.c index e4d70e8..e204104 100644 --- a/edid-decode.c +++ b/edid-decode.c @@ -381,9 +381,35 @@ detailed_block(unsigned char *x, int in_extension) print_standard_timing(x[5 + i * 2], x[5 + i * 2 + 1]); return 1; case 0xFB: - /* TODO */ - printf("Color point\n"); + { + unsigned w_x, w_y; + unsigned gamma; + + printf("Color point:\n"); + w_x = (x[7] << 2) | ((x[6] >> 2) & 3); + w_y = (x[8] << 2) | (x[6] & 3); + gamma = x[9]; + printf(" Index: %u White: 0.%04u, 0.%04u", x[5], + (w_x * 10000) / 1024, (w_y * 10000) / 1024); + if (gamma == 0xff) + printf(" Gamma: is defined in an extension block"); + else + printf(" Gamma: %.2f", ((gamma + 100.0) / 100.0)); + printf("\n"); + if (x[10] == 0) + return 1; + w_x = (x[12] << 2) | ((x[11] >> 2) & 3); + w_y = (x[13] << 2) | (x[11] & 3); + gamma = x[14]; + printf(" Index: %u White: 0.%04u, 0.%04u", x[10], + (w_x * 10000) / 1024, (w_y * 10000) / 1024); + if (gamma == 0xff) + printf(" Gamma: is defined in an extension block"); + else + printf(" Gamma: %.2f", ((gamma + 100.0) / 100.0)); + printf("\n"); return 1; + } case 0xFC: /* XXX should check for spaces after the \n */ /* XXX check: terminated with 0x0A, padded with 0x20 */ |