1 // SPDX-License-Identifier: MIT
3 * Copyright 2019-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 * Author: Hans Verkuil <hverkuil-cisco@xs4all.nl>
8 #include "edid-decode.h"
10 void edid_state::parse_vtb_ext_block(const unsigned char *x
)
12 printf(" Version: %u\n", x
[1]);
14 fail("Invalid version %u.\n", x
[1]);
16 unsigned num_dtd
= x
[2];
17 unsigned num_cvt
= x
[3];
18 unsigned num_st
= x
[4];
20 const unsigned char *y
= x
+ 0x7f;
23 printf(" Detailed Timing Descriptors:\n");
24 for (unsigned i
= 0; i
< num_dtd
; i
++, x
+= 18) {
26 fail("Not enough bytes remain for more DTDs in the VTB-EXT.\n");
29 detailed_timings(" ", x
, false);
33 printf(" Coordinated Video Timings:\n");
34 for (unsigned i
= 0; i
< num_cvt
; i
++, x
+= 3) {
36 fail("Not enough bytes remain for more CVTs in the VTB-EXT.\n");
39 detailed_cvt_descriptor(" ", x
, false);
43 // Note: the VTB-EXT standard has a mistake in the example EDID
44 // that it provides: there the refresh rate (bits 5-0 of the
45 // second byte) is set to 60 for 60 Hz, but this should be 0
46 // since the actual refresh rate is the value + 60.
48 // The documentation itself is correct, though.
49 printf(" Standard Timings:\n");
50 for (unsigned i
= 0; i
< num_st
; i
++, x
+= 2) {
52 fail("Not enough bytes remain for more STs in the VTB-EXT.\n");
55 print_standard_timing(" ", x
[0], x
[1], true);
59 if (!memchk(x
, unused_bytes
)) {
60 data_block
= "Padding";
61 fail("Contains non-zero bytes.\n");