path: root/parse-base-block.cpp
AgeCommit message (Collapse)AuthorFilesLines
2021-11-07edid-decode: improve image size checksHans Verkuil1-7/+12
Carefully check if the image sizes in the base and DisplayID blocks are consistent. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-09-27edid-decode: replace data_block_oHans Verkuil1-1/+1
This is a rather ugly macro with side-effects. Drop it and code it explicitly. Also add a new warning to the Makefile to detect implicit fallthroughs in switches. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-09-27edid-decode: fix standard timing vertical pixelsjoevt1-1/+4
Don't do ceiling to nearest 8 pixels for active vertical lines. See examples elo-4600l-hdmi and kogan-kaled24144f-hdmi. Section 3.9 and of EDID 1.4 does not say vertical lines must be a multiple of 8. This line of code appears to have been added to satisfy the 3rd example in VTB-EXT spec but that example has an incorrect HAP indicator decimal value so it cannot be trusted. Also, all 3 examples have an incorrect vertical refresh value as noted in parse-vtb-ext-block.cpp. The VESA DMT spec has the following examples that are not a multiple of 8 lines which support this change: 1400x1050 4:3 1440x900 16:10 1600x900 16:9 1680x1050 16:10 Finally, Ref. D-8 of EDID 1.4 says about Section 3.9 that "The Standard Timings Identification code may not be used to identify timings which do not match one of these standard aspect ratios." If vertical lines is odd then a warning is output. That way an attempt to use ST to describe 1360x768 (a common resolution) will result in a warning (since the nearest result that can be described by an ST is 1360x765). Signed-off-by: Joe van Tunen <joevt@shaw.ca> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-09-16edid-decode: warn if sRGB and gamma != 2.2Hans Verkuil1-1/+3
If the sRGB bit is set, but the gamma is not 2.2, then warn about that. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-09-15edid-decode: linefeed before failjoevt1-1/+1
Always output linefeed before fail message. See example dell-up2715k-dp1-optomedia-cmv535. Signed-off-by: Joe van Tunen <joevt@shaw.ca> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-08-05edid-decode: DTDs 0xf7 and 0xf8 are for >= 1.4 onlyHans Verkuil1-0/+4
The DTDs with tag 0xf7 and 0xf8 are only defined in EDID 1.4 and up, so fail if they are used in older EDID versions. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-08-03edid-decode: Display Range Limits needs another indent levelHans Verkuil1-21/+21
The Display Range Limits block is part of the detailed timings descriptors, so it needs to be intented one more level to the right. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-05-27edid-decode: fail if sRGB is not signalled, but it shouldHans Verkuil1-10/+14
If the chromaticities match those of sRGB, then fail if the sRGB bit is not set. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-03-24edid-decode: warn if a DTD closely matches a VIC or DMTHans Verkuil1-0/+12
Detailed Timing Descriptors often are identical to a VIC or DMT. But sometimes they are off a little bit, either due to slightly different porches or sync widths, or due to different polarities. Warn if this is the case, since it is probably a bug in the EDID. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-03-20edid-decode: don't report bogus CTA-861 pref/native timingsHans Verkuil1-2/+4
If the CTA-861 block is absent, then edid-decode would still show the preferred and native timings 'if Block 0 and CTA-861 Blocks are parsed'. Fix this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-16edid-decode: show byte/bit of established timingsHans Verkuil1-2/+4
This makes it a bit easier to map an established timing to a specific bit. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-15edid-decode: fix DTD and non-zero bordersHans Verkuil1-4/+26
EDID 1.3 and 1.4 have conflicting definitions about how to interpret borders and blanking in a DTD. And actual EDIDs interpret different from both specs. Follow what EDIDs do, and add a warning that non-zero borders in a DTD is not recommended. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-15edid-decode: show or calculate timingsHans Verkuil1-374/+64
Add new options to show all Established Timings, DMTs, VICs and HDMI VICs. Add new options to show the timings for specific Standard Timing codes, or DMT, VIC and HDMI VIC codes. Add new options to calculate GTF and CVT timings, fully implementing the GTF and CVT standards, including interlaced, overscan, reduced blanking and support for the GTF Secondary Curve. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-14edid-decode: the borders are not part of the front/back porchesHans Verkuil1-2/+2
Update DMT 4 and 5 accordingly, and add the borders to the horizontal and vertical blanking calculations. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-13edid-decode: improve GTF Secondary Curve handlingHans Verkuil1-10/+10
1) Add units where applicable for the sec. curve params. 2) Show only one decimal for C and J 3) Remove check if x[13] or x[17] > 127: this is wrong since x[13] is C / 2, not C. 4) Add check if the sec curve block is all 0, even though support for the sec curve is signaled in the EDID. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-09edid-decode: improve GTF/CVT checksHans Verkuil1-19/+45
1) Warn if a 1.4 EDID supports GTF instead of CVT (GTF is deprecated) 2) If a 1.4 EDID only supports GTF, then do not report Standard Timings as CVT. 3) Drop the check that GTF and/or CVT support must be present if an explicit GTF or CVT timing is supported: GTF/CVT support indicates that any GTF/CVT timings within the Display Range Limits is accepted, but explicitly indicated GTF/CVT timings are always assumed to be supported as discrete timings. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-03edid-decode: improve fail messageHans Verkuil1-1/+1
Explicitly state that all DTD image sizes fit inside 255x255cm. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-02-03edid-decode: improve image/display size checksHans Verkuil1-0/+7
1) when print_timings is called to show preferred and/or native timings, skip any checks. Those have been done already when these timings were first parsed, and doing it again results in duplicate messages. 2) if the display size is 0x0 and the max image size > 2559x2559mm, then do not fail since the display size can only report sizes smaller than that. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-01-15edid-decode: improve RCDB/SLDB checksHans Verkuil1-1/+1
CTA-861-H more clearly described the relationship between the RCDB and SLDB Data Blocks, so implement new checks that verify the correctness of these DBs. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-12-30edid-decode: use DTD or T10VTDB for a T7VTDB if possibleHans Verkuil1-0/+12
Check if a T7VTDB can also be represented by a DTD or a T10VTDB. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-12-30edid-decode: add support for CVT RBv2 and RBv3Hans Verkuil1-11/+24
CVT Reduced Blanking version 2 was never implemented, do this now. Also add support for the new version 3. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-23edid-decode: all error/warn messages should end with '.'Hans Verkuil1-3/+3
Make sure the message formatting is consistent. Most fail/warn messages ended with a period, but not all. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-22edid-decode: drop duplicate assign to t.vsyncHans Verkuil1-1/+0
edid_cvt_mode() assigns t.vsync twice. Drop the first assignment. Reported by val.zapod.vz@gmail.com. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-21edid-decode: add --hide-serial-numbers optionHans Verkuil1-7/+15
If this option is used, then all serial numbers in the human readable output are placed by ... Note that they can still be extracted via the hex dump at the start, but at least it is not easily readable anymore. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-21edid-decode: improve Block Map checksHans Verkuil1-3/+9
Check the EDID 1.3 requirement for a Block Map if there are more than 2 blocks. If there is a Block Map in Block 128, then the maximum number of blocks in the EDID is 255, not 256. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-04edid-decode: t.rb is an integer, not a boolHans Verkuil1-2/+2
t.rb contains the reduced blanking version, so use 0 and 1, not false and true. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-04edid-decode: remove last 'XXX' and 'TODO' commentsHans Verkuil1-27/+9
I went through the few remaining XXX and TODO comments and removed or fixed them. There were a few 1.3/1.4 EDID mixups that are now resolved as well: blank level setup was actually the same for both 1.3 and 1.4, ditto for gamma. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-03edid-decode: use correct aspect ratio formattingHans Verkuil1-2/+2
Use %.2f instead of %.f. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-30edid-decode: fix EDID 1.4 Aspect Ratio calculationHans Verkuil1-2/+2
The aspect ratio calculation was buggy, fix this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Maxime Ripard <maxime@cerno.tech>
2020-08-26edid-decode: improve fail messageHans Verkuil1-1/+1
Make it clear that bytes 12-17 must all be 0x20. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-12edid-decode: move high-level checks to the corresponding sourceHans Verkuil1-0/+65
Move the high-level base, CTA and DisplayID checks to the corresponding source to simplify maintenance of the code. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-12edid-decode: CTA -> CTA-861Hans Verkuil1-1/+1
Be specific and use CTA-861 instead of just CTA. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-12edid-decode: add DisplayID preferred timingsHans Verkuil1-5/+7
List the preferred timings as per the DisplayID extension blocks. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-12edid-decode: group state data into structsHans Verkuil1-83/+83
Group state data belonging to a specific block into a separate struct to easily see to which block each state variable belongs to. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-09edid-decode: improve preferred/native timing handlingHans Verkuil1-11/+20
This adds support for multiple preferred and native timings, such as via the VFPDB. The sanity checks have been improved a lot as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-08edid-decode: introduce timings_ext structHans Verkuil1-6/+6
This simplifies storing timings together with the type and flags strings. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-08edid-decode: report and check native timingsHans Verkuil1-8/+14
Determine what the native timings are (if any) and report them. Also check against the preferred timing to see if there are major discrepancies. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-08edid-decode: drop dtd_cnt for non-CTA/Block-0 DTDsHans Verkuil1-5/+9
The VFPDB in the CTA extensions can refer to DTDs by their index, but that only applies to DTDs in block 0 and in CTA blocks, the DTDs in other extension blocks are ignored. So just show them as "DTD" without a counter. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-22edid-decode: various fixesHans Verkuil1-11/+2
1) Drop an obsolete and always false test in print_standard_timing 2) Drop a test for image width/height where one of the two is 0. 3) Simplify rate test in cta_hf_scdb() (rate is always > 0) 4) Fix Dolby Vision bit for global dimming (0x04 instead of 0x02) Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: val.zapod.vz@gmail.com
2020-02-27edid-decode: correctly report YCbCr 4:2:0 timingsHans Verkuil1-0/+13
These formats transmit two lines as if it was one line. So the pixelclock is actually running at half the speed, and the same is true for the horizontal frequency. This incorrect reporting caused incorrect display range checks as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-13edid-decode: CTA serial number check is now a warningHans Verkuil1-5/+7
The CTA-861 specification says 'should', not 'shall', so setting both serial numbers is a warning, not a failure. Also avoid printing the Serial Number if it is 0 (meaning it is unused). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-13edid-decode: fix missing spaces and an operator prio bugHans Verkuil1-1/+1
In one place I forgot to add spaces after GTF leading to this: Standard Timings: DMT 0x04: 640x480 59.940 Hz 4:3 31.469 kHz 25.175 MHz DMT 0x09: 800x600 60.317 Hz 4:3 37.879 kHz 40.000 MHz DMT 0x10: 1024x768 60.004 Hz 4:3 48.363 kHz 65.000 MHz GTF: 1152x864 60.000 Hz 4:3 53.700 kHz 81.624 MHz DMT 0x23: 1280x1024 60.020 Hz 5:4 63.981 kHz 108.000 MHz And it fixes a compiler warning: edid-decode.cpp:253:40: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] (unsigned)(0.5 + t->interlaced ? refresh / 2.0 : refresh), Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
2020-02-12edid-decode: use prefix to align unknown std timingsHans Verkuil1-1/+1
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-12edid-decode: major cleanupHans Verkuil1-130/+157
This makes the layout of the parsed EDID data consistent. New sections start with 'Section Name:' and the following lines are one more indent to the right. Flags are shown as simple strings (no ':'). Values are shown as 'Value: 1234'. Also DMTs now show the DMT ID instead of just 'DMT'. Various new tests were also added. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-12edid-decode: cleanupsHans Verkuil1-14/+6
Move add_str to edid-decode.h and use it where needed. Also rename 'suffix' to 'type' after the print_timings() prototype. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-10edid-decode: small improvementsHans Verkuil1-5/+4
data_block for a DTD has a DTD index that was off by 1. Some small textual improvements as well. And the VTB extension block also had DTDs, so that had to be preparsed as well to get the correct total of DTDs. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-10edid-decode: improve how timings are loggedHans Verkuil1-23/+32
Separate timing type and timing flags. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-10edid-decode: initialize edid_state in constructorHans Verkuil1-1/+0
This makes it possible to do 'state = edid_state();' to (re-)initialize the state object. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-09edid-decode: always fill in suffix in print_timingsHans Verkuil1-1/+1
Add the type as suffix for DTDs as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-02-09edid-decode: fix incorrect hbp GTF calculationHans Verkuil1-1/+5
The horizontal back porch calculation was wrong, causing incorrect timing values for very small resolutions (296x192, 384x240). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Privacy Policy