edid-decode: bug fixes, additions, changes
Subsystems (2)
cover edid-decode: bug fixes, additions, changes
This patchset is a set of bug-fixes, additions, and changes I've made while examining various EDIDs I have encountered.
I made a fork at https://github.com/joevt/edid-decode with the commits listed below.
For the first commit, I have a script to convert C printf format strings in the source code to regular expressions and then use those to find EDIDs in my collection (or in linuxhw/EDID) that contain matches to those regular expressions that are not matched by the EDIDs in the data directory. It prioritizes EDIDs that contain the most matches.
joevt (11):
edid-decode: add more example EDIDs
edid-decode: ignore dSYM
edid-decode: change install directories for macOS
edid-decode: add bounds checking
edid-decode: fix standard timing vertical pixels
edid-decode: linefeed before fail
edid-decode: always linefeed after hex_block
edid-decode: output full frequencies for 4:2:0
edid-decode: allow undefined aspect ratio
edid-decode: add warnings to VESA VSDB
edid-decode: cta and displayid changes
.gitignore | 1 +
Makefile | 22 +-
data/_EDID_ACR_0497 | Bin 0 -> 256 bytes
data/_EDID_AIC_1005 | Bin 0 -> 256 bytes
data/_EDID_APP_921f | Bin 0 -> 256 bytes
data/_EDID_APP_9220 | Bin 0 -> 256 bytes
data/_EDID_BNQ_802e | Bin 0 -> 256 bytes
data/_EDID_CMN_152a | Bin 0 -> 256 bytes
data/_EDID_CVT_0003 | Bin 0 -> 256 bytes
data/_EDID_DEL_0001 | Bin 0 -> 128 bytes
data/_EDID_DEL_a07b | Bin 0 -> 384 bytes
data/_EDID_DLM_0000 | Bin 0 -> 256 bytes
data/_EDID_DON_0046 | Bin 0 -> 256 bytes
data/_EDID_DVI_0000 | Bin 0 -> 128 bytes
data/_EDID_ELE_0938 | Bin 0 -> 256 bytes
data/_EDID_GDH_0030 | Bin 0 -> 256 bytes
data/_EDID_GSM_0001 | Bin 0 -> 256 bytes
data/_EDID_GSM_5b08 | Bin 0 -> 256 bytes
data/_EDID_GSM_5b08_2 | Bin 0 -> 256 bytes
data/_EDID_HPN_3530 | Bin 0 -> 256 bytes
data/_EDID_HPN_3645 | Bin 0 -> 256 bytes
data/_EDID_HSD_03e9 | Bin 0 -> 128 bytes
data/_EDID_HSD_04bb | Bin 0 -> 128 bytes
data/_EDID_HWP_331b | Bin 0 -> 256 bytes
data/_EDID_HYO_049b | Bin 0 -> 256 bytes
data/_EDID_IVM_6615 | Bin 0 -> 256 bytes
data/_EDID_IVM_6640 | Bin 0 -> 256 bytes
data/_EDID_KMR_461a | Bin 0 -> 256 bytes
data/_EDID_LEN_65cf | Bin 0 -> 256 bytes
data/_EDID_LEN_65ed | Bin 0 -> 384 bytes
data/_EDID_LEN_b800 | Bin 0 -> 256 bytes
data/_EDID_LGD_05c0 | Bin 0 -> 128 bytes
data/_EDID_LGD_4601 | Bin 0 -> 128 bytes
data/_EDID_LTM_2c02 | Bin 0 -> 256 bytes
data/_EDID_MSI_1462 | Bin 0 -> 256 bytes
data/_EDID_NOV_0405 | Bin 0 -> 256 bytes
data/_EDID_NSO_5605 | Bin 0 -> 128 bytes
data/_EDID_OEC_d501 | Bin 0 -> 128 bytes
data/_EDID_PDI_0030 | Bin 0 -> 128 bytes
data/_EDID_PHL_01ea | Bin 0 -> 256 bytes
data/_EDID_PHL_01ea_2 | Bin 0 -> 256 bytes
data/_EDID_PHL_08fa | Bin 0 -> 512 bytes
data/_EDID_PHL_c193 | Bin 0 -> 256 bytes
data/_EDID_PIO_0000 | Bin 0 -> 256 bytes
data/_EDID_PKB_00f8 | Bin 0 -> 128 bytes
data/_EDID_RHT_1234 | Bin 0 -> 256 bytes
data/_EDID_RJT_003a | Bin 0 -> 256 bytes
data/_EDID_SAM_08f1 | Bin 0 -> 256 bytes
data/_EDID_SAM_0f14 | Bin 0 -> 256 bytes
data/_EDID_SAM_0f99 | Bin 0 -> 512 bytes
data/_EDID_SAM_7004 | Bin 0 -> 256 bytes
data/_EDID_SAN_2400 | Bin 0 -> 128 bytes
data/_EDID_SCN_03ff | Bin 0 -> 128 bytes
data/_EDID_SEK_0000 | Bin 0 -> 256 bytes
data/_EDID_SHP_1008 | Bin 0 -> 256 bytes
data/_EDID_SPT_1801 | Bin 0 -> 128 bytes
data/_EDID_SUN_058f | Bin 0 -> 256 bytes
data/_EDID_TCL_5655 | Bin 0 -> 256 bytes
data/_EDID_TGL_00f1 | Bin 0 -> 256 bytes
data/_EDID_UPD_4843 | Bin 0 -> 256 bytes
data/_EDID_USR_0100 | Bin 0 -> 256 bytes
data/_EDID_VIT_03dc | Bin 0 -> 128 bytes
data/_EDID_VIZ_0030 | Bin 0 -> 128 bytes
data/_EDID_VIZ_0067 | Bin 0 -> 256 bytes
data/_EDID_VIZ_0092 | Bin 0 -> 256 bytes
data/_EDID_VIZ_1018 | Bin 0 -> 256 bytes
data/_EDID_VIZ_1018_2 | Bin 0 -> 256 bytes
data/_EDID_VSC_0e23 | Bin 0 -> 256 bytes
data/_EDID_VSC_0f1e | Bin 0 -> 256 bytes
data/_EDID_VSC_2034 | Bin 0 -> 256 bytes
data/_EDID_VSC_bd2b | Bin 0 -> 384 bytes
data/_EDID_XXX_001a | Bin 0 -> 256 bytes
data/_EDID_YTH_0156 | Bin 0 -> 256 bytes
data/_EDID_YTH_1560 | Bin 0 -> 256 bytes
data/acer-xb321hk-dp | Bin 0 -> 256 bytes
data/acer-xv273k-corrected_difdb | Bin 0 -> 384 bytes
data/{acer-xv273k-dp => acer-xv273k-dp1} | Bin
data/acer-xv273k-dp1-corrupted | Bin 0 -> 384 bytes
data/acer-xv273k-dp2 | Bin 0 -> 384 bytes
data/acer-xv273k-dp2-corrupted | Bin 0 -> 384 bytes
data/acer-xv273k-hdmi1 | Bin 0 -> 256 bytes
data/acer-xv273k-hdmi2 | Bin 0 -> 256 bytes
data/aoc-c24g1-dp | Bin 0 -> 256 bytes
data/aoc-c24g1-hdmi | Bin 0 -> 256 bytes
.../apple-17-inch-studio-display-crt-override | Bin 0 -> 128 bytes
data/apple-applevision-750-override | Bin 0 -> 128 bytes
data/apple-applevision-850-override | Bin 0 -> 128 bytes
data/apple-cinemahd-23-2006-dvi | Bin 0 -> 256 bytes
data/apple-cinemahd-23-2008-dvi | Bin 0 -> 256 bytes
data/apple-imac-27-inch-mid-2010 | Bin 0 -> 128 bytes
data/apple-imac-retina-5k-27-inch-2017-tile0 | Bin 0 -> 256 bytes
data/apple-imac-retina-5k-27-inch-2017-tile1 | Bin 0 -> 256 bytes
data/apple-macbookpro-16inch-2019 | Bin 0 -> 256 bytes
data/apple-xdr-5k-tile0 | Bin 0 -> 768 bytes
data/apple-xdr-5k-tile1 | Bin 0 -> 512 bytes
data/apple-xdr-6k | Bin 0 -> 640 bytes
data/apple-xdr-6k-tile0 | Bin 0 -> 896 bytes
data/apple-xdr-6k-tile1 | Bin 0 -> 640 bytes
data/asus-pb287 | Bin 0 -> 256 bytes
data/asus-pq321-dp-tile0 | Bin 0 -> 384 bytes
data/asus-xg438q-dp | Bin 0 -> 384 bytes
data/atlona-athd420-hdmi-override | Bin 0 -> 256 bytes
data/chiyakeji-r1811-dp | Bin 0 -> 384 bytes
data/chiyakeji-r9a18-dp-tile1 | Bin 0 -> 384 bytes
data/dell-up2715k-dp1-optomedia-cmv535 | Bin 0 -> 128 bytes
data/hisense-h9g-hdmi | Bin 0 -> 256 bytes
data/kds-vs555-vga | Bin 0 -> 128 bytes
data/lg-31mu97-override | Bin 0 -> 384 bytes
data/lg-34gn850b-dp | Bin 0 -> 384 bytes
data/lg-34wk95uw-dp | Bin 0 -> 384 bytes
data/lg-34wk95uw-overlay | Bin 0 -> 384 bytes
data/lg-34wk95uw-thunderbolt-dp1-tile0 | Bin 0 -> 512 bytes
data/lg-34wk95uw-thunderbolt-dp2-tile1 | Bin 0 -> 256 bytes
data/lg-55sj850v-hdmi | Bin 0 -> 256 bytes
data/lg-c8-hdmi | Bin 0 -> 256 bytes
data/lg-ultrafine-5k-v1-thunderbolt-dp1-tile0 | Bin 0 -> 384 bytes
data/lg-ultrafine-5k-v1-thunderbolt-dp2-tile1 | Bin 0 -> 256 bytes
data/microsoft-surfacebook | Bin 0 -> 128 bytes
data/optomedia-cmv535-hdmi_dip00-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip00-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip00-v20180618 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip01-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip01-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip01-v20180618 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip10-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip10-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip11-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip11-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip11-v20180731 | Bin 0 -> 256 bytes
data/panasonic-tx65gxr900-hdmi | Bin 0 -> 256 bytes
data/philips-ftv-hdmi1.4 | Bin 0 -> 256 bytes
data/philips-ftv-hdmi2.0 | Bin 0 -> 256 bytes
data/planar-ix2790 | Bin 0 -> 384 bytes
data/realtek-r9a18-hdmi | Bin 0 -> 256 bytes
data/samsung-lu28r55-hdmi | Bin 0 -> 256 bytes
data/samsung-q800t-hdmi2.0 | Bin 0 -> 256 bytes
data/samsung-q800t-hdmi2.1 | Bin 0 -> 256 bytes
data/samsung-q800t-hdmi2.1-game | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi1 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi2 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi3 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi4 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-vga | Bin 0 -> 128 bytes
data/sony-gdmf520-vga | Bin 0 -> 128 bytes
data/sony-snyc901-override | Bin 0 -> 256 bytes
data/sony-snyd301-override | Bin 0 -> 256 bytes
data/sony-x900f-hdmi | Bin 0 -> 256 bytes
data/vizio-e65e0-hdmi | Bin 0 -> 256 bytes
data/vizio-m60c3-hdmi-onkyo-txnr555 | Bin 0 -> 256 bytes
edid-decode.cpp | 109 +++-
edid-decode.h | 20 +-
oui.h | 20 +
parse-base-block.cpp | 3 +-
parse-cta-block.cpp | 456 ++++++----------
parse-displayid-block.cpp | 512 +++++++++---------
parse-vtb-ext-block.cpp | 13 +-
156 files changed, 575 insertions(+), 581 deletions(-)
create mode 100644 data/_EDID_ACR_0497
create mode 100644 data/_EDID_AIC_1005
create mode 100644 data/_EDID_APP_921f
create mode 100644 data/_EDID_APP_9220
create mode 100644 data/_EDID_BNQ_802e
create mode 100644 data/_EDID_CMN_152a
create mode 100644 data/_EDID_CVT_0003
create mode 100644 data/_EDID_DEL_0001
create mode 100644 data/_EDID_DEL_a07b
create mode 100644 data/_EDID_DLM_0000
create mode 100644 data/_EDID_DON_0046
create mode 100644 data/_EDID_DVI_0000
create mode 100644 data/_EDID_ELE_0938
create mode 100644 data/_EDID_GDH_0030
create mode 100644 data/_EDID_GSM_0001
create mode 100644 data/_EDID_GSM_5b08
create mode 100644 data/_EDID_GSM_5b08_2
create mode 100644 data/_EDID_HPN_3530
create mode 100644 data/_EDID_HPN_3645
create mode 100644 data/_EDID_HSD_03e9
create mode 100644 data/_EDID_HSD_04bb
create mode 100644 data/_EDID_HWP_331b
create mode 100644 data/_EDID_HYO_049b
create mode 100644 data/_EDID_IVM_6615
create mode 100644 data/_EDID_IVM_6640
create mode 100644 data/_EDID_KMR_461a
create mode 100644 data/_EDID_LEN_65cf
create mode 100644 data/_EDID_LEN_65ed
create mode 100644 data/_EDID_LEN_b800
create mode 100644 data/_EDID_LGD_05c0
create mode 100644 data/_EDID_LGD_4601
create mode 100644 data/_EDID_LTM_2c02
create mode 100644 data/_EDID_MSI_1462
create mode 100644 data/_EDID_NOV_0405
create mode 100644 data/_EDID_NSO_5605
create mode 100644 data/_EDID_OEC_d501
create mode 100644 data/_EDID_PDI_0030
create mode 100644 data/_EDID_PHL_01ea
create mode 100644 data/_EDID_PHL_01ea_2
create mode 100644 data/_EDID_PHL_08fa
create mode 100644 data/_EDID_PHL_c193
create mode 100644 data/_EDID_PIO_0000
create mode 100644 data/_EDID_PKB_00f8
create mode 100644 data/_EDID_RHT_1234
create mode 100644 data/_EDID_RJT_003a
create mode 100644 data/_EDID_SAM_08f1
create mode 100644 data/_EDID_SAM_0f14
create mode 100644 data/_EDID_SAM_0f99
create mode 100644 data/_EDID_SAM_7004
create mode 100644 data/_EDID_SAN_2400
create mode 100644 data/_EDID_SCN_03ff
create mode 100644 data/_EDID_SEK_0000
create mode 100644 data/_EDID_SHP_1008
create mode 100644 data/_EDID_SPT_1801
create mode 100644 data/_EDID_SUN_058f
create mode 100644 data/_EDID_TCL_5655
create mode 100644 data/_EDID_TGL_00f1
create mode 100644 data/_EDID_UPD_4843
create mode 100644 data/_EDID_USR_0100
create mode 100644 data/_EDID_VIT_03dc
create mode 100644 data/_EDID_VIZ_0030
create mode 100644 data/_EDID_VIZ_0067
create mode 100644 data/_EDID_VIZ_0092
create mode 100644 data/_EDID_VIZ_1018
create mode 100644 data/_EDID_VIZ_1018_2
create mode 100644 data/_EDID_VSC_0e23
create mode 100644 data/_EDID_VSC_0f1e
create mode 100644 data/_EDID_VSC_2034
create mode 100644 data/_EDID_VSC_bd2b
create mode 100644 data/_EDID_XXX_001a
create mode 100644 data/_EDID_YTH_0156
create mode 100644 data/_EDID_YTH_1560
create mode 100644 data/acer-xb321hk-dp
create mode 100644 data/acer-xv273k-corrected_difdb
rename data/{acer-xv273k-dp => acer-xv273k-dp1} (100%)
create mode 100644 data/acer-xv273k-dp1-corrupted
create mode 100644 data/acer-xv273k-dp2
create mode 100644 data/acer-xv273k-dp2-corrupted
create mode 100644 data/acer-xv273k-hdmi1
create mode 100644 data/acer-xv273k-hdmi2
create mode 100644 data/aoc-c24g1-dp
create mode 100644 data/aoc-c24g1-hdmi
create mode 100644 data/apple-17-inch-studio-display-crt-override
create mode 100644 data/apple-applevision-750-override
create mode 100644 data/apple-applevision-850-override
create mode 100644 data/apple-cinemahd-23-2006-dvi
create mode 100644 data/apple-cinemahd-23-2008-dvi
create mode 100644 data/apple-imac-27-inch-mid-2010
create mode 100644 data/apple-imac-retina-5k-27-inch-2017-tile0
create mode 100644 data/apple-imac-retina-5k-27-inch-2017-tile1
create mode 100644 data/apple-macbookpro-16inch-2019
create mode 100644 data/apple-xdr-5k-tile0
create mode 100644 data/apple-xdr-5k-tile1
create mode 100644 data/apple-xdr-6k
create mode 100644 data/apple-xdr-6k-tile0
create mode 100644 data/apple-xdr-6k-tile1
create mode 100644 data/asus-pb287
create mode 100644 data/asus-pq321-dp-tile0
create mode 100644 data/asus-xg438q-dp
create mode 100644 data/atlona-athd420-hdmi-override
create mode 100644 data/chiyakeji-r1811-dp
create mode 100644 data/chiyakeji-r9a18-dp-tile1
create mode 100644 data/dell-up2715k-dp1-optomedia-cmv535
create mode 100644 data/hisense-h9g-hdmi
create mode 100644 data/kds-vs555-vga
create mode 100644 data/lg-31mu97-override
create mode 100644 data/lg-34gn850b-dp
create mode 100644 data/lg-34wk95uw-dp
create mode 100644 data/lg-34wk95uw-overlay
create mode 100644 data/lg-34wk95uw-thunderbolt-dp1-tile0
create mode 100644 data/lg-34wk95uw-thunderbolt-dp2-tile1
create mode 100644 data/lg-55sj850v-hdmi
create mode 100644 data/lg-c8-hdmi
create mode 100644 data/lg-ultrafine-5k-v1-thunderbolt-dp1-tile0
create mode 100644 data/lg-ultrafine-5k-v1-thunderbolt-dp2-tile1
create mode 100644 data/microsoft-surfacebook
create mode 100644 data/optomedia-cmv535-hdmi_dip00-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip00-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip00-v20180618
create mode 100644 data/optomedia-cmv535-hdmi_dip01-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip01-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip01-v20180618
create mode 100644 data/optomedia-cmv535-hdmi_dip10-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip10-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip11-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip11-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip11-v20180731
create mode 100644 data/panasonic-tx65gxr900-hdmi
create mode 100644 data/philips-ftv-hdmi1.4
create mode 100644 data/philips-ftv-hdmi2.0
create mode 100644 data/planar-ix2790
create mode 100644 data/realtek-r9a18-hdmi
create mode 100644 data/samsung-lu28r55-hdmi
create mode 100644 data/samsung-q800t-hdmi2.0
create mode 100644 data/samsung-q800t-hdmi2.1
create mode 100644 data/samsung-q800t-hdmi2.1-game
create mode 100644 data/sharp-lc70uq17u-hdmi1
create mode 100644 data/sharp-lc70uq17u-hdmi2
create mode 100644 data/sharp-lc70uq17u-hdmi3
create mode 100644 data/sharp-lc70uq17u-hdmi4
create mode 100644 data/sharp-lc70uq17u-vga
create mode 100644 data/sony-gdmf520-vga
create mode 100644 data/sony-snyc901-override
create mode 100644 data/sony-snyd301-override
create mode 100644 data/sony-x900f-hdmi
create mode 100644 data/vizio-e65e0-hdmi
create mode 100644 data/vizio-m60c3-hdmi-onkyo-txnr555
create mode 100644 oui.hSignature · 1 line
2.24.3 (Apple Git-128)
PATCH 1/11 edid-decode: add more example EDIDs
_EDID_AAA_0000
- EDIDs with names of this format are from https://github.com/linuxhw/EDID
- These EDIDs contain strings not seen in the other EDIDs of the data directory.
- AAA is the vendor ID.
- 0000 is the product ID.
acer-xb321hk-dp
- Acer Predator XB321HK
- This is a G-Sync display. Contains an NVIDIA VSDB.
acer-xv273k-dp1
acer-xv273k-dp2
- Acer XV273K DisplayPort 1.4 inputs when 4K 144K mode is disabled.
acer-xv273k-hdmi1
acer-xv273k-hdmi2
- Acer XV273K HDMI 2.0 inputs.
acer-xv273k-corrected_difdb
- Contains a corrected Display Interface Features Data Block for the Acer XV273K.
acer-xv273k-dp1-corrupted
- Sometimes the 3rd block of DisplayPort EDID from XV273K is a copy of the first or second block.
- Example of "Unknown Extension Block."
acer-xv273k-dp2-corrupted
- Sometimes the 3rd block of DisplayPort EDID from XV273K is a copy of the first or second block.
- Example of "Only one instance of this Data Block is allowed."
aoc-c24g1
- AOC C24G1
apple-17-inch-studio-display-crt-override
- macOS override for the 17 inch Studio Display (CRT).
apple-applevision-850-override
- macOS override for the AppleVision/ColorSync 850 Display
apple-applevision-750-override
- macOS override for the AppleVision/ColorSync 750 Display
apple-cinemahd-23-2008-dvi
- Apple Cinema HD Display, 23 inch, aluminum. This 2008 version supports HDCP.
apple-cinemahd-23-2006-dvi
- Apple Cinema HD Display, 23 inch, aluminum. This 2006 version does not support HDCP.
apple-imac-27-inch-mid-2010
- iMac (27-inch, Mid 2010)
- Example of "Monitor descriptor block has byte 4 nonzero".
apple-imac-retina-5k-27-inch-2017
- iMac (Retina 5K, 27-inch, 2017)
- Contains a dual-tile 5K display.
- Apple VSDB type 1 appears to be constant between different iMacs (sample size of 2)
- Color characteristics for red and blue may vary between different iMacs. Not sure about white and green.
apple-macbookpro-16-inch-2019
- MacBook Pro (16-inch, 2019)
- The EDID may contain different values for Color Characteristics: blue (0.0488, 0.0527, 0.0537, 0.0546)
- Apple VSDB type 3 contains a display panel model number (LP160WT1-SJA1, LP160WT1-SJA2, LP160WT1-SJA3, LP160WT1-SJA4) and some kind of serial number.
- Apple VSDB type 2 contains unknown data that varies.
apple-xdr-5k-tile0
apple-xdr-5k-tile1
- Apple Pro Display XDR. These EDIDs may be used for 6K single tile mode or 5K tiled mode (Thunderbolt connection).
- The Tiled Display Topology has info for 6K tiled but the tiled timings are sized for 5K. Apple uses an mtdd file for tile information.
apple-xdr-6k
- Apple Pro Display XDR. This EDID may be used for 6K. It contains no tile topology or tile timings.
apple-xdr-6k-tile0
apple-xdr-6k-tile1
- These EDIDs may be used for tiled 6K mode (two HBR3 x4 signals over Thunderbolt 3 with no DSC).
- Largest EDID ever with 6 extension blocks.
- Has one 60Hz mode for 1440p (for DisplayPort 1.1 compatibility) and five refresh rates for each of 4K, 5K, 6K, 5K/2 tiled modes, 6K/2 tiled modes.
- The five refresh rates are for 47.95, 48, 50, 59.94, 60Hz.
- For each resolution, only the delay between frames (just the vertical front porch) is different between different refresh rates.
- Tile topology has info for 6K tiled mode only, not 5K tiled mode even though 5K tile timings are also included.
For any of xdr EDIDs above:
- The EDIDs may exclude BT2020RGB from the Colorimetry Data Block and/or HDR and SMPTE ST2084 from the Electro optical transfer functions.
- If HDR is removed from Electro optical transfer functions, then Desired content max luminance is reduced from 1600 nits to 507.620 nits and Desired content min luminance is increased from value 1 to value 2 (both values are 0 nits).
- An alternative SDR mode may have max luminance and max frame-average luminance reduced from 507.620 nits to 161.049 nits while min luminance is increased from value 2 to value 4 (both values are 0 nits).
- Perhaps other presets (selectable in macOS via the Displays preferences panel or in Windows by the Boot Camp control panel) will make other changes to the EDIDs.
asus-pb287
- ASUS PB287Q Monitor - 28 inch 4K UHD (3840x2160), 1ms, Flicker free
asus-pq321
- ASUS PQ321
- 4K MST display.
- macOS doesn't support MST for multiple displays but does support MST for old 4K MST displays which use seperate streams for the left half and right half of the display.
- Left tile only. EDID for right tile of 4K MST display is not easily accessible in macOS.
asus-xg438q
- ASUS ROG Strix XG438Q
atlona-athd420-hdmi-override
- macOS override for the Atlona AT-HD420 HDMI to VGA/Component and Stereo Audio Format Converter
chiyakeji-r9a18
- 5K LCD controller driver board R9A18 LCD hd display motherboard HDR Freesync 4K 144Hz DIY For LCD LED screen LM270QQ2 LM270QQ1.
- Only EDID for tile 1 is included.
chiyakeji-r1811
- 5K universal DIY HD R1811 driver board USB-C HDR Freesync EDP VBO 144Hz DP1.4 LCD driver board for LM270QQ1 LM270QQ2.
- A 5K display, not tiled but I think you can get a tiled firmware.
- Maybe same board used in Geekon 27-inch 5K display.
- Other EDID may have display name "DP 5K3K".
- Supports DSC but I have not seen confirmation of 5K 60Hz 10bpc RGB.
dell-up2715k-dp1-optomedia-cmv535
- A Dell UP2715K connected to the DisplayPort output of a Optomedia CMV-535 HDMI 2.0 to DisplayPort 1.2 adapter.
- Example of "EDID 1.4 block does not set max dotclock.".
hisense-h9g-hdmi
- 65 inch Hisense H9G HDMI 2.0
kds-vs555
- KDS Visual Sensations VS-555 - CRT monitor - 15 inch
lg-31mu97-override
- macOS override for the LG 31MU97-B.
- Example of "DIRECT DRIVE monitor".
lg-34gn850b
- LG UltraGear 34GN850-B 34 inch 21:9 Curved UltraGear QHD 1ms Gaming Monitor with 144Hz
lg-34wk95uw
- LG 34WK95U-W 5K2K display.
- Thunderbolt 3 HBR2 tiled mode (dual 2560x2160).
- DisplayPort 1.4 HBR3 mode 5120x2160.
lg-34wk95uw-overlay
- In macOS, a supported dual-tile display usually has a .mtdd file containing an overlay which is an EDID that represents the display as a single tile.
- Example of "There are more Native DTDs \(\d+\) than DTDs \(\d+\)\.\n"
lg-55sj850v
- LG 55SJ850V
lg-c8
- LG C8 OLED TV
lg-ultrafine-5k-v1
- LG UltraFine 5K v1
- Has some minor differences from v2.
microsoft-surfacebook
- Microsoft Surface Book
optomedia-cmv535
- This converter has two dip switches to select between 4 EDIDs.
- Similar models:
-- Optomedia CMV-535 HDMI 2.0a to DisplayPort 1.2a Converter -- SIIG HDMI 2.0 to DisplayPort 1.2 Converter - 4Kx2K 60Hz -- gofanco Prophecy HDMI 2.0 to DisplayPort 1.2 Converter/Adapter
panasonic-tx65gxr900
- Panasonic TX-65GXR900
philips-ftv
- Philips FTV
- The HDMI 2.0 version comes from enabling UHD HDMI.
- Example of Dolby VSDB items "10 bit", "Standard + Low-Latency + Low-Latency-HDMI".
planar-ix2790
- Planar IX2790
- A single tile 5K display
samsung-lu28r55
- Samsung 28 inch UHD resolution monitor with IPS panel
- Example of "The year %d is more than one year in the future."
samsung-q800t
- Samsung 75 inch Q800T 2020 8K monitor has some HDMI 2.0 connectors and one HDMI 2.1 connector. The Game mode option enabled VRR.
sharp-lc70uq17u
- SHARP LC-70UQ17U has four HDMI inputs and a VGA input. Other inputs don’t have EDID.
sony-gdmf520
- Sony GDM-F520
sony-snyc901-override
sony-snyd301-override
- macOS overrides for some unknown Sony TVs.
- Examples of "Interlaced audio" and "Interlaced video".
sony-x900f
- Sony X900F
vizio-e65e0-hdmi
- Vizio E65-E0
vizio-m60c3-hdmi-onkyo-txnr555
- VIZIO M-Series 60" Class Ultra HD Full-Array LED Smart TV | M60-C3
- Connected to Onkyo TX-NR555 (receiver)
---
data/_EDID_ACR_0497 | Bin 0 -> 256 bytes
data/_EDID_AIC_1005 | Bin 0 -> 256 bytes
data/_EDID_APP_921f | Bin 0 -> 256 bytes
data/_EDID_APP_9220 | Bin 0 -> 256 bytes
data/_EDID_BNQ_802e | Bin 0 -> 256 bytes
data/_EDID_CMN_152a | Bin 0 -> 256 bytes
data/_EDID_CVT_0003 | Bin 0 -> 256 bytes
data/_EDID_DEL_0001 | Bin 0 -> 128 bytes
data/_EDID_DEL_a07b | Bin 0 -> 384 bytes
data/_EDID_DLM_0000 | Bin 0 -> 256 bytes
data/_EDID_DON_0046 | Bin 0 -> 256 bytes
data/_EDID_DVI_0000 | Bin 0 -> 128 bytes
data/_EDID_ELE_0938 | Bin 0 -> 256 bytes
data/_EDID_GDH_0030 | Bin 0 -> 256 bytes
data/_EDID_GSM_0001 | Bin 0 -> 256 bytes
data/_EDID_GSM_5b08 | Bin 0 -> 256 bytes
data/_EDID_GSM_5b08_2 | Bin 0 -> 256 bytes
data/_EDID_HPN_3530 | Bin 0 -> 256 bytes
data/_EDID_HPN_3645 | Bin 0 -> 256 bytes
data/_EDID_HSD_03e9 | Bin 0 -> 128 bytes
data/_EDID_HSD_04bb | Bin 0 -> 128 bytes
data/_EDID_HWP_331b | Bin 0 -> 256 bytes
data/_EDID_HYO_049b | Bin 0 -> 256 bytes
data/_EDID_IVM_6615 | Bin 0 -> 256 bytes
data/_EDID_IVM_6640 | Bin 0 -> 256 bytes
data/_EDID_KMR_461a | Bin 0 -> 256 bytes
data/_EDID_LEN_65cf | Bin 0 -> 256 bytes
data/_EDID_LEN_65ed | Bin 0 -> 384 bytes
data/_EDID_LEN_b800 | Bin 0 -> 256 bytes
data/_EDID_LGD_05c0 | Bin 0 -> 128 bytes
data/_EDID_LGD_4601 | Bin 0 -> 128 bytes
data/_EDID_LTM_2c02 | Bin 0 -> 256 bytes
data/_EDID_MSI_1462 | Bin 0 -> 256 bytes
data/_EDID_NOV_0405 | Bin 0 -> 256 bytes
data/_EDID_NSO_5605 | Bin 0 -> 128 bytes
data/_EDID_OEC_d501 | Bin 0 -> 128 bytes
data/_EDID_PDI_0030 | Bin 0 -> 128 bytes
data/_EDID_PHL_01ea | Bin 0 -> 256 bytes
data/_EDID_PHL_01ea_2 | Bin 0 -> 256 bytes
data/_EDID_PHL_08fa | Bin 0 -> 512 bytes
data/_EDID_PHL_c193 | Bin 0 -> 256 bytes
data/_EDID_PIO_0000 | Bin 0 -> 256 bytes
data/_EDID_PKB_00f8 | Bin 0 -> 128 bytes
data/_EDID_RHT_1234 | Bin 0 -> 256 bytes
data/_EDID_RJT_003a | Bin 0 -> 256 bytes
data/_EDID_SAM_08f1 | Bin 0 -> 256 bytes
data/_EDID_SAM_0f14 | Bin 0 -> 256 bytes
data/_EDID_SAM_0f99 | Bin 0 -> 512 bytes
data/_EDID_SAM_7004 | Bin 0 -> 256 bytes
data/_EDID_SAN_2400 | Bin 0 -> 128 bytes
data/_EDID_SCN_03ff | Bin 0 -> 128 bytes
data/_EDID_SEK_0000 | Bin 0 -> 256 bytes
data/_EDID_SHP_1008 | Bin 0 -> 256 bytes
data/_EDID_SPT_1801 | Bin 0 -> 128 bytes
data/_EDID_SUN_058f | Bin 0 -> 256 bytes
data/_EDID_TCL_5655 | Bin 0 -> 256 bytes
data/_EDID_TGL_00f1 | Bin 0 -> 256 bytes
data/_EDID_UPD_4843 | Bin 0 -> 256 bytes
data/_EDID_USR_0100 | Bin 0 -> 256 bytes
data/_EDID_VIT_03dc | Bin 0 -> 128 bytes
data/_EDID_VIZ_0030 | Bin 0 -> 128 bytes
data/_EDID_VIZ_0067 | Bin 0 -> 256 bytes
data/_EDID_VIZ_0092 | Bin 0 -> 256 bytes
data/_EDID_VIZ_1018 | Bin 0 -> 256 bytes
data/_EDID_VIZ_1018_2 | Bin 0 -> 256 bytes
data/_EDID_VSC_0e23 | Bin 0 -> 256 bytes
data/_EDID_VSC_0f1e | Bin 0 -> 256 bytes
data/_EDID_VSC_2034 | Bin 0 -> 256 bytes
data/_EDID_VSC_bd2b | Bin 0 -> 384 bytes
data/_EDID_XXX_001a | Bin 0 -> 256 bytes
data/_EDID_YTH_0156 | Bin 0 -> 256 bytes
data/_EDID_YTH_1560 | Bin 0 -> 256 bytes
data/acer-xb321hk-dp | Bin 0 -> 256 bytes
data/acer-xv273k-corrected_difdb | Bin 0 -> 384 bytes
data/{acer-xv273k-dp => acer-xv273k-dp1} | Bin
data/acer-xv273k-dp1-corrupted | Bin 0 -> 384 bytes
data/acer-xv273k-dp2 | Bin 0 -> 384 bytes
data/acer-xv273k-dp2-corrupted | Bin 0 -> 384 bytes
data/acer-xv273k-hdmi1 | Bin 0 -> 256 bytes
data/acer-xv273k-hdmi2 | Bin 0 -> 256 bytes
data/aoc-c24g1-dp | Bin 0 -> 256 bytes
data/aoc-c24g1-hdmi | Bin 0 -> 256 bytes
data/apple-17-inch-studio-display-crt-override | Bin 0 -> 128 bytes
data/apple-applevision-750-override | Bin 0 -> 128 bytes
data/apple-applevision-850-override | Bin 0 -> 128 bytes
data/apple-cinemahd-23-2006-dvi | Bin 0 -> 256 bytes
data/apple-cinemahd-23-2008-dvi | Bin 0 -> 256 bytes
data/apple-imac-27-inch-mid-2010 | Bin 0 -> 128 bytes
data/apple-imac-retina-5k-27-inch-2017-tile0 | Bin 0 -> 256 bytes
data/apple-imac-retina-5k-27-inch-2017-tile1 | Bin 0 -> 256 bytes
data/apple-macbookpro-16inch-2019 | Bin 0 -> 256 bytes
data/apple-xdr-5k-tile0 | Bin 0 -> 768 bytes
data/apple-xdr-5k-tile1 | Bin 0 -> 512 bytes
data/apple-xdr-6k | Bin 0 -> 640 bytes
data/apple-xdr-6k-tile0 | Bin 0 -> 896 bytes
data/apple-xdr-6k-tile1 | Bin 0 -> 640 bytes
data/asus-pb287 | Bin 0 -> 256 bytes
data/asus-pq321-dp-tile0 | Bin 0 -> 384 bytes
data/asus-xg438q-dp | Bin 0 -> 384 bytes
data/atlona-athd420-hdmi-override | Bin 0 -> 256 bytes
data/chiyakeji-r1811-dp | Bin 0 -> 384 bytes
data/chiyakeji-r9a18-dp-tile1 | Bin 0 -> 384 bytes
data/dell-up2715k-dp1-optomedia-cmv535 | Bin 0 -> 128 bytes
data/hisense-h9g-hdmi | Bin 0 -> 256 bytes
data/kds-vs555-vga | Bin 0 -> 128 bytes
data/lg-31mu97-override | Bin 0 -> 384 bytes
data/lg-34gn850b-dp | Bin 0 -> 384 bytes
data/lg-34wk95uw-dp | Bin 0 -> 384 bytes
data/lg-34wk95uw-overlay | Bin 0 -> 384 bytes
data/lg-34wk95uw-thunderbolt-dp1-tile0 | Bin 0 -> 512 bytes
data/lg-34wk95uw-thunderbolt-dp2-tile1 | Bin 0 -> 256 bytes
data/lg-55sj850v-hdmi | Bin 0 -> 256 bytes
data/lg-c8-hdmi | Bin 0 -> 256 bytes
data/lg-ultrafine-5k-v1-thunderbolt-dp1-tile0 | Bin 0 -> 384 bytes
data/lg-ultrafine-5k-v1-thunderbolt-dp2-tile1 | Bin 0 -> 256 bytes
data/microsoft-surfacebook | Bin 0 -> 128 bytes
data/optomedia-cmv535-hdmi_dip00-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip00-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip00-v20180618 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip01-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip01-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip01-v20180618 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip10-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip10-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip11-v2018 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip11-v20180312 | Bin 0 -> 256 bytes
data/optomedia-cmv535-hdmi_dip11-v20180731 | Bin 0 -> 256 bytes
data/panasonic-tx65gxr900-hdmi | Bin 0 -> 256 bytes
data/philips-ftv-hdmi1.4 | Bin 0 -> 256 bytes
data/philips-ftv-hdmi2.0 | Bin 0 -> 256 bytes
data/planar-ix2790 | Bin 0 -> 384 bytes
data/realtek-r9a18-hdmi | Bin 0 -> 256 bytes
data/samsung-lu28r55-hdmi | Bin 0 -> 256 bytes
data/samsung-q800t-hdmi2.0 | Bin 0 -> 256 bytes
data/samsung-q800t-hdmi2.1 | Bin 0 -> 256 bytes
data/samsung-q800t-hdmi2.1-game | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi1 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi2 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi3 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-hdmi4 | Bin 0 -> 256 bytes
data/sharp-lc70uq17u-vga | Bin 0 -> 128 bytes
data/sony-gdmf520-vga | Bin 0 -> 128 bytes
data/sony-snyc901-override | Bin 0 -> 256 bytes
data/sony-snyd301-override | Bin 0 -> 256 bytes
data/sony-x900f-hdmi | Bin 0 -> 256 bytes
data/vizio-e65e0-hdmi | Bin 0 -> 256 bytes
data/vizio-m60c3-hdmi-onkyo-txnr555 | Bin 0 -> 256 bytes
147 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 data/_EDID_ACR_0497
create mode 100644 data/_EDID_AIC_1005
create mode 100644 data/_EDID_APP_921f
create mode 100644 data/_EDID_APP_9220
create mode 100644 data/_EDID_BNQ_802e
create mode 100644 data/_EDID_CMN_152a
create mode 100644 data/_EDID_CVT_0003
create mode 100644 data/_EDID_DEL_0001
create mode 100644 data/_EDID_DEL_a07b
create mode 100644 data/_EDID_DLM_0000
create mode 100644 data/_EDID_DON_0046
create mode 100644 data/_EDID_DVI_0000
create mode 100644 data/_EDID_ELE_0938
create mode 100644 data/_EDID_GDH_0030
create mode 100644 data/_EDID_GSM_0001
create mode 100644 data/_EDID_GSM_5b08
create mode 100644 data/_EDID_GSM_5b08_2
create mode 100644 data/_EDID_HPN_3530
create mode 100644 data/_EDID_HPN_3645
create mode 100644 data/_EDID_HSD_03e9
create mode 100644 data/_EDID_HSD_04bb
create mode 100644 data/_EDID_HWP_331b
create mode 100644 data/_EDID_HYO_049b
create mode 100644 data/_EDID_IVM_6615
create mode 100644 data/_EDID_IVM_6640
create mode 100644 data/_EDID_KMR_461a
create mode 100644 data/_EDID_LEN_65cf
create mode 100644 data/_EDID_LEN_65ed
create mode 100644 data/_EDID_LEN_b800
create mode 100644 data/_EDID_LGD_05c0
create mode 100644 data/_EDID_LGD_4601
create mode 100644 data/_EDID_LTM_2c02
create mode 100644 data/_EDID_MSI_1462
create mode 100644 data/_EDID_NOV_0405
create mode 100644 data/_EDID_NSO_5605
create mode 100644 data/_EDID_OEC_d501
create mode 100644 data/_EDID_PDI_0030
create mode 100644 data/_EDID_PHL_01ea
create mode 100644 data/_EDID_PHL_01ea_2
create mode 100644 data/_EDID_PHL_08fa
create mode 100644 data/_EDID_PHL_c193
create mode 100644 data/_EDID_PIO_0000
create mode 100644 data/_EDID_PKB_00f8
create mode 100644 data/_EDID_RHT_1234
create mode 100644 data/_EDID_RJT_003a
create mode 100644 data/_EDID_SAM_08f1
create mode 100644 data/_EDID_SAM_0f14
create mode 100644 data/_EDID_SAM_0f99
create mode 100644 data/_EDID_SAM_7004
create mode 100644 data/_EDID_SAN_2400
create mode 100644 data/_EDID_SCN_03ff
create mode 100644 data/_EDID_SEK_0000
create mode 100644 data/_EDID_SHP_1008
create mode 100644 data/_EDID_SPT_1801
create mode 100644 data/_EDID_SUN_058f
create mode 100644 data/_EDID_TCL_5655
create mode 100644 data/_EDID_TGL_00f1
create mode 100644 data/_EDID_UPD_4843
create mode 100644 data/_EDID_USR_0100
create mode 100644 data/_EDID_VIT_03dc
create mode 100644 data/_EDID_VIZ_0030
create mode 100644 data/_EDID_VIZ_0067
create mode 100644 data/_EDID_VIZ_0092
create mode 100644 data/_EDID_VIZ_1018
create mode 100644 data/_EDID_VIZ_1018_2
create mode 100644 data/_EDID_VSC_0e23
create mode 100644 data/_EDID_VSC_0f1e
create mode 100644 data/_EDID_VSC_2034
create mode 100644 data/_EDID_VSC_bd2b
create mode 100644 data/_EDID_XXX_001a
create mode 100644 data/_EDID_YTH_0156
create mode 100644 data/_EDID_YTH_1560
create mode 100644 data/acer-xb321hk-dp
create mode 100644 data/acer-xv273k-corrected_difdb
rename data/{acer-xv273k-dp => acer-xv273k-dp1} (100%)
create mode 100644 data/acer-xv273k-dp1-corrupted
create mode 100644 data/acer-xv273k-dp2
create mode 100644 data/acer-xv273k-dp2-corrupted
create mode 100644 data/acer-xv273k-hdmi1
create mode 100644 data/acer-xv273k-hdmi2
create mode 100644 data/aoc-c24g1-dp
create mode 100644 data/aoc-c24g1-hdmi
create mode 100644 data/apple-17-inch-studio-display-crt-override
create mode 100644 data/apple-applevision-750-override
create mode 100644 data/apple-applevision-850-override
create mode 100644 data/apple-cinemahd-23-2006-dvi
create mode 100644 data/apple-cinemahd-23-2008-dvi
create mode 100644 data/apple-imac-27-inch-mid-2010
create mode 100644 data/apple-imac-retina-5k-27-inch-2017-tile0
create mode 100644 data/apple-imac-retina-5k-27-inch-2017-tile1
create mode 100644 data/apple-macbookpro-16inch-2019
create mode 100644 data/apple-xdr-5k-tile0
create mode 100644 data/apple-xdr-5k-tile1
create mode 100644 data/apple-xdr-6k
create mode 100644 data/apple-xdr-6k-tile0
create mode 100644 data/apple-xdr-6k-tile1
create mode 100644 data/asus-pb287
create mode 100644 data/asus-pq321-dp-tile0
create mode 100644 data/asus-xg438q-dp
create mode 100644 data/atlona-athd420-hdmi-override
create mode 100644 data/chiyakeji-r1811-dp
create mode 100644 data/chiyakeji-r9a18-dp-tile1
create mode 100644 data/dell-up2715k-dp1-optomedia-cmv535
create mode 100644 data/hisense-h9g-hdmi
create mode 100644 data/kds-vs555-vga
create mode 100644 data/lg-31mu97-override
create mode 100644 data/lg-34gn850b-dp
create mode 100644 data/lg-34wk95uw-dp
create mode 100644 data/lg-34wk95uw-overlay
create mode 100644 data/lg-34wk95uw-thunderbolt-dp1-tile0
create mode 100644 data/lg-34wk95uw-thunderbolt-dp2-tile1
create mode 100644 data/lg-55sj850v-hdmi
create mode 100644 data/lg-c8-hdmi
create mode 100644 data/lg-ultrafine-5k-v1-thunderbolt-dp1-tile0
create mode 100644 data/lg-ultrafine-5k-v1-thunderbolt-dp2-tile1
create mode 100644 data/microsoft-surfacebook
create mode 100644 data/optomedia-cmv535-hdmi_dip00-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip00-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip00-v20180618
create mode 100644 data/optomedia-cmv535-hdmi_dip01-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip01-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip01-v20180618
create mode 100644 data/optomedia-cmv535-hdmi_dip10-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip10-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip11-v2018
create mode 100644 data/optomedia-cmv535-hdmi_dip11-v20180312
create mode 100644 data/optomedia-cmv535-hdmi_dip11-v20180731
create mode 100644 data/panasonic-tx65gxr900-hdmi
create mode 100644 data/philips-ftv-hdmi1.4
create mode 100644 data/philips-ftv-hdmi2.0
create mode 100644 data/planar-ix2790
create mode 100644 data/realtek-r9a18-hdmi
create mode 100644 data/samsung-lu28r55-hdmi
create mode 100644 data/samsung-q800t-hdmi2.0
create mode 100644 data/samsung-q800t-hdmi2.1
create mode 100644 data/samsung-q800t-hdmi2.1-game
create mode 100644 data/sharp-lc70uq17u-hdmi1
create mode 100644 data/sharp-lc70uq17u-hdmi2
create mode 100644 data/sharp-lc70uq17u-hdmi3
create mode 100644 data/sharp-lc70uq17u-hdmi4
create mode 100644 data/sharp-lc70uq17u-vga
create mode 100644 data/sony-gdmf520-vga
create mode 100644 data/sony-snyc901-override
create mode 100644 data/sony-snyd301-override
create mode 100644 data/sony-x900f-hdmi
create mode 100644 data/vizio-e65e0-hdmi
create mode 100644 data/vizio-m60c3-hdmi-onkyo-txnr555data/_EDID_ACR_0497 new file binary +0 -0
data/_EDID_AIC_1005 new file binary +0 -0
data/_EDID_APP_921f new file binary +0 -0
data/_EDID_APP_9220 new file binary +0 -0
data/_EDID_BNQ_802e new file binary +0 -0
data/_EDID_CMN_152a new file binary +0 -0
data/_EDID_CVT_0003 new file binary +0 -0
data/_EDID_DEL_0001 new file binary +0 -0
data/_EDID_DEL_a07b new file binary +0 -0
data/_EDID_DLM_0000 new file binary +0 -0
data/_EDID_DON_0046 new file binary +0 -0
data/_EDID_DVI_0000 new file binary +0 -0
data/_EDID_ELE_0938 new file binary +0 -0
data/_EDID_GDH_0030 new file binary +0 -0
data/_EDID_GSM_0001 new file binary +0 -0
data/_EDID_GSM_5b08 new file binary +0 -0
data/_EDID_GSM_5b08_2 new file binary +0 -0
data/_EDID_HPN_3530 new file binary +0 -0
data/_EDID_HPN_3645 new file binary +0 -0
data/_EDID_HSD_03e9 new file binary +0 -0
data/_EDID_HSD_04bb new file binary +0 -0
data/_EDID_HWP_331b new file binary +0 -0
data/_EDID_HYO_049b new file binary +0 -0
data/_EDID_IVM_6615 new file binary +0 -0
data/_EDID_IVM_6640 new file binary +0 -0
data/_EDID_KMR_461a new file binary +0 -0
data/_EDID_LEN_65cf new file binary +0 -0
data/_EDID_LEN_65ed new file binary +0 -0
data/_EDID_LEN_b800 new file binary +0 -0
data/_EDID_LGD_05c0 new file binary +0 -0
data/_EDID_LGD_4601 new file binary +0 -0
data/_EDID_LTM_2c02 new file binary +0 -0
data/_EDID_MSI_1462 new file binary +0 -0
data/_EDID_NOV_0405 new file binary +0 -0
data/_EDID_NSO_5605 new file binary +0 -0
data/_EDID_OEC_d501 new file binary +0 -0
data/_EDID_PDI_0030 new file binary +0 -0
data/_EDID_PHL_01ea new file binary +0 -0
data/_EDID_PHL_01ea_2 new file binary +0 -0
data/_EDID_PHL_08fa new file binary +0 -0
data/_EDID_PHL_c193 new file binary +0 -0
data/_EDID_PIO_0000 new file binary +0 -0
data/_EDID_PKB_00f8 new file binary +0 -0
data/_EDID_RHT_1234 new file binary +0 -0
data/_EDID_RJT_003a new file binary +0 -0
data/_EDID_SAM_08f1 new file binary +0 -0
data/_EDID_SAM_0f14 new file binary +0 -0
data/_EDID_SAM_0f99 new file binary +0 -0
data/_EDID_SAM_7004 new file binary +0 -0
data/_EDID_SAN_2400 new file binary +0 -0
data/_EDID_SCN_03ff new file binary +0 -0
data/_EDID_SEK_0000 new file binary +0 -0
data/_EDID_SHP_1008 new file binary +0 -0
data/_EDID_SPT_1801 new file binary +0 -0
data/_EDID_SUN_058f new file binary +0 -0
data/_EDID_TCL_5655 new file binary +0 -0
data/_EDID_TGL_00f1 new file binary +0 -0
data/_EDID_UPD_4843 new file binary +0 -0
data/_EDID_USR_0100 new file binary +0 -0
data/_EDID_VIT_03dc new file binary +0 -0
data/_EDID_VIZ_0030 new file binary +0 -0
data/_EDID_VIZ_0067 new file binary +0 -0
data/_EDID_VIZ_0092 new file binary +0 -0
data/_EDID_VIZ_1018 new file binary +0 -0
data/_EDID_VIZ_1018_2 new file binary +0 -0
data/_EDID_VSC_0e23 new file binary +0 -0
data/_EDID_VSC_0f1e new file binary +0 -0
data/_EDID_VSC_2034 new file binary +0 -0
data/_EDID_VSC_bd2b new file binary +0 -0
data/_EDID_XXX_001a new file binary +0 -0
data/_EDID_YTH_0156 new file binary +0 -0
data/_EDID_YTH_1560 new file binary +0 -0
data/acer-xb321hk-dp new file binary +0 -0
data/acer-xv273k-corrected_difdb new file binary +0 -0
data/acer-xv273k-dp1 renamed from data/acer-xv273k-dp +0 -0
data/acer-xv273k-dp1-corrupted new file binary +0 -0
data/acer-xv273k-dp2 new file binary +0 -0
data/acer-xv273k-dp2-corrupted new file binary +0 -0
data/acer-xv273k-hdmi1 new file binary +0 -0
data/acer-xv273k-hdmi2 new file binary +0 -0
data/aoc-c24g1-dp new file binary +0 -0
data/aoc-c24g1-hdmi new file binary +0 -0
data/apple-17-inch-studio-display-crt-override new file binary +0 -0
data/apple-applevision-750-override new file binary +0 -0
data/apple-applevision-850-override new file binary +0 -0
data/apple-cinemahd-23-2006-dvi new file binary +0 -0
data/apple-cinemahd-23-2008-dvi new file binary +0 -0
data/apple-imac-27-inch-mid-2010 new file binary +0 -0
data/apple-imac-retina-5k-27-inch-2017-tile0 new file binary +0 -0
data/apple-imac-retina-5k-27-inch-2017-tile1 new file binary +0 -0
data/apple-macbookpro-16inch-2019 new file binary +0 -0
data/apple-xdr-5k-tile0 new file binary +0 -0
data/apple-xdr-5k-tile1 new file binary +0 -0
data/apple-xdr-6k new file binary +0 -0
data/apple-xdr-6k-tile0 new file binary +0 -0
data/apple-xdr-6k-tile1 new file binary +0 -0
data/asus-pb287 new file binary +0 -0
data/asus-pq321-dp-tile0 new file binary +0 -0
data/asus-xg438q-dp new file binary +0 -0
data/atlona-athd420-hdmi-override new file binary +0 -0
data/chiyakeji-r1811-dp new file binary +0 -0
data/chiyakeji-r9a18-dp-tile1 new file binary +0 -0
data/dell-up2715k-dp1-optomedia-cmv535 new file binary +0 -0
data/hisense-h9g-hdmi new file binary +0 -0
data/kds-vs555-vga new file binary +0 -0
data/lg-31mu97-override new file binary +0 -0
data/lg-34gn850b-dp new file binary +0 -0
data/lg-34wk95uw-dp new file binary +0 -0
data/lg-34wk95uw-overlay new file binary +0 -0
data/lg-34wk95uw-thunderbolt-dp1-tile0 new file binary +0 -0
data/lg-34wk95uw-thunderbolt-dp2-tile1 new file binary +0 -0
data/lg-55sj850v-hdmi new file binary +0 -0
data/lg-c8-hdmi new file binary +0 -0
data/lg-ultrafine-5k-v1-thunderbolt-dp1-tile0 new file binary +0 -0
data/lg-ultrafine-5k-v1-thunderbolt-dp2-tile1 new file binary +0 -0
data/microsoft-surfacebook new file binary +0 -0
data/optomedia-cmv535-hdmi_dip00-v2018 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip00-v20180312 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip00-v20180618 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip01-v2018 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip01-v20180312 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip01-v20180618 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip10-v2018 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip10-v20180312 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip11-v2018 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip11-v20180312 new file binary +0 -0
data/optomedia-cmv535-hdmi_dip11-v20180731 new file binary +0 -0
data/panasonic-tx65gxr900-hdmi new file binary +0 -0
data/philips-ftv-hdmi1.4 new file binary +0 -0
data/philips-ftv-hdmi2.0 new file binary +0 -0
data/planar-ix2790 new file binary +0 -0
data/realtek-r9a18-hdmi new file binary +0 -0
data/samsung-lu28r55-hdmi new file binary +0 -0
data/samsung-q800t-hdmi2.0 new file binary +0 -0
data/samsung-q800t-hdmi2.1 new file binary +0 -0
data/samsung-q800t-hdmi2.1-game new file binary +0 -0
data/sharp-lc70uq17u-hdmi1 new file binary +0 -0
data/sharp-lc70uq17u-hdmi2 new file binary +0 -0
data/sharp-lc70uq17u-hdmi3 new file binary +0 -0
data/sharp-lc70uq17u-hdmi4 new file binary +0 -0
data/sharp-lc70uq17u-vga new file binary +0 -0
data/sony-gdmf520-vga new file binary +0 -0
data/sony-snyc901-override new file binary +0 -0
data/sony-snyd301-override new file binary +0 -0
data/sony-x900f-hdmi new file binary +0 -0
data/vizio-e65e0-hdmi new file binary +0 -0
data/vizio-m60c3-hdmi-onkyo-txnr555 new file binary +0 -0
Signature · 1 line
2.24.3 (Apple Git-128)
PATCH 2/11 edid-decode: ignore dSYM
In reply to joevtBuilding in macOS may create a .dSYM file for debugger symbols.
--- .gitignore | 1 + 1 file changed, 1 insertion(+)
.gitignore +1 -0
@@ -1 +1,2 @@ edid-decode +*.dSYM
Signature · 1 line
2.24.3 (Apple Git-128)
PATCH 3/11 edid-decode: change install directories for macOS
In reply to joevtIn macOS, /usr/bin and /usr/share/man belong to root:wheel so install to /usr/local/bin and /usr/local/share/man instead.
--- Makefile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
Makefile +17 -5
@@ -1,11 +1,23 @@ -bindir ?= /usr/bin -mandir ?= /usr/share/man +ifeq ($(OS),Windows_NT) + bindir ?= /usr/bin + mandir ?= /usr/share/man +else + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Darwin) + bindir ?= /usr/local/sbin + mandir ?= /usr/local/share/man + else + bindir ?= /usr/bin + mandir ?= /usr/share/man + endif +endif EMXX ?= em++ -SOURCES = edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \ - parse-displayid-block.cpp parse-ls-ext-block.cpp \ - parse-di-ext-block.cpp parse-vtb-ext-block.cpp calc-gtf-cvt.cpp +SOURCES = \ + edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \ + parse-displayid-block.cpp parse-ls-ext-block.cpp \ + parse-di-ext-block.cpp parse-vtb-ext-block.cpp calc-gtf-cvt.cpp WARN_FLAGS = -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter all: edid-decode
Signature · 1 line
2.24.3 (Apple Git-128)
Re: [PATCH 03/11] edid-decode: change install directories for macOS
Quoted 27 lines · joevt
In macOS,
/usr/binand/usr/share/manbelong to root:wheel so install to/usr/local/binand/usr/local/share/maninstead.Signed-off-by Joe van Tunen <[email protected]>--- Makefile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)Makefile +13
-2@@ -1,11 +1,23 @@ -bindir ?= /usr/bin -mandir ?= /usr/share/man +ifeq ($(OS),Windows_NT) + bindir ?= /usr/bin + mandir ?= /usr/share/man +else + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Darwin) + bindir ?= /usr/local/sbin + mandir ?= /usr/local/share/man + else + bindir ?= /usr/bin + mandir ?= /usr/share/man + endif +endif
Makefile line 20
Quoted 10 lines
Makefile +4
-3EMXX ?= em++ -SOURCES = edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \ - parse-displayid-block.cpp parse-ls-ext-block.cpp \ - parse-di-ext-block.cpp parse-vtb-ext-block.cpp calc-gtf-cvt.cpp +SOURCES = \ + edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \ + parse-displayid-block.cpp parse-ls-ext-block.cpp \ + parse-di-ext-block.cpp parse-vtb-ext-block.cpp calc-gtf-cvt.cpp
This last change is a spurious change, I'll drop this and keep the rest.
No need for you to do anything.
Regards,
Hans
Quoted 4 lines
Makefile +0
-0WARN_FLAGS = -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter all: edid-decode
Re: [PATCH 03/11] edid-decode: change install directories for macOS
Thanks. That last change was made because I don't like to do aligning between lines that have different indents. That way you don't have to mix tabs and spaces or worry about different tab widths used by different people using different editors.
On 2021-09-15, 3:06 AM, "Hans Verkuil" <[email protected]> wrote:
On 14/09/2021 14:11, joevt wrote:
> In macOS, /usr/bin and /usr/share/man belong to root:wheel so install to /usr/local/bin and /usr/local/share/man instead.
>
> Signed-off-by: Joe van Tunen <[email protected]>
> ---
> Makefile | 22 +++++++++++++++++-----
> 1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 287b72d..adf6123 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,11 +1,23 @@
> -bindir ?= /usr/bin
> -mandir ?= /usr/share/man
> +ifeq ($(OS),Windows_NT)
> + bindir ?= /usr/bin
> + mandir ?= /usr/share/man
> +else
> + UNAME_S := $(shell uname -s)
> + ifeq ($(UNAME_S),Darwin)
> + bindir ?= /usr/local/sbin
> + mandir ?= /usr/local/share/man
> + else
> + bindir ?= /usr/bin
> + mandir ?= /usr/share/man
> + endif
> +endif
>
> EMXX ?= em++
>
> -SOURCES = edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \
> - parse-displayid-block.cpp parse-ls-ext-block.cpp \
> - parse-di-ext-block.cpp parse-vtb-ext-block.cpp calc-gtf-cvt.cpp
> +SOURCES = \
> + edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \
> + parse-displayid-block.cpp parse-ls-ext-block.cpp \
> + parse-di-ext-block.cpp parse-vtb-ext-block.cpp calc-gtf-cvt.cpp
This last change is a spurious change, I'll drop this and keep the rest.
No need for you to do anything.
Regards,
Hans
> WARN_FLAGS = -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
>
> all: edid-decode
> PATCH 4/11 edid-decode: add bounds checking
In reply to joevt--- parse-vtb-ext-block.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
parse-vtb-ext-block.cpp +10 -3
@@ -17,16 +17,21 @@ void edid_state::parse_vtb_ext_block(const unsigned char *x) unsigned num_cvt = x[3]; unsigned num_st = x[4]; + const unsigned char *y = x + 0x7f; x += 5; if (num_dtd) { printf(" Detailed Timing Descriptors:\n"); - for (unsigned i = 0; i < num_dtd; i++, x += 18) + for (unsigned i = 0; i < num_dtd; i++, x += 18) { + if (x + 18 > y) { fail("Not enough bytes remain for more DTBs in the VTB-EXT\n"); return; } detailed_timings(" ", x, false); + } } if (num_cvt) { printf(" Coordinated Video Timings:\n"); - for (unsigned i = 0; i < num_cvt; i++, x += 3) + for (unsigned i = 0; i < num_cvt; i++, x += 3) { + if (x + 3 > y) { fail("Not enough bytes remain for more CVTs in the VTB-EXT\n"); return; } detailed_cvt_descriptor(" ", x, false); + } } if (num_st) { // Note: the VTB-EXT standard has a mistake in the example EDID
@@ -36,7 +41,9 @@ void edid_state::parse_vtb_ext_block(const unsigned char *x) // // The documentation itself is correct, though. printf(" Standard Timings:\n"); - for (unsigned i = 0; i < num_st; i++, x += 2) + for (unsigned i = 0; i < num_st; i++, x += 2) { + if (x + 2 > y) { fail("Not enough bytes remain for more STs in the VTB-EXT\n"); return; } print_standard_timing(" ", x[0], x[1], true); + } } }
Signature · 1 line
2.24.3 (Apple Git-128)
Re: [PATCH 04/11] edid-decode: add bounds checking
On 14/09/2021 14:11, joevt wrote:
Please always add a commit log here, even if it is just a copy of the subject.
No need to do anything, I'll take care of it this time.
Regards,
Hans
Quoted 45 lines
Signed-off-by Joe van Tunen <[email protected]>--- parse-vtb-ext-block.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)parse-vtb-ext-block.cpp +10
-3@@ -17,16 +17,21 @@ void edid_state::parse_vtb_ext_block(const unsigned char *x) unsigned num_cvt = x[3]; unsigned num_st = x[4]; + const unsigned char *y = x + 0x7f; x += 5; if (num_dtd) { printf(" Detailed Timing Descriptors:\n"); - for (unsigned i = 0; i < num_dtd; i++, x += 18) + for (unsigned i = 0; i < num_dtd; i++, x += 18) { + if (x + 18 > y) { fail("Not enough bytes remain for more DTBs in the VTB-EXT\n"); return; } detailed_timings(" ", x, false); + } } if (num_cvt) { printf(" Coordinated Video Timings:\n"); - for (unsigned i = 0; i < num_cvt; i++, x += 3) + for (unsigned i = 0; i < num_cvt; i++, x += 3) { + if (x + 3 > y) { fail("Not enough bytes remain for more CVTs in the VTB-EXT\n"); return; } detailed_cvt_descriptor(" ", x, false); + } } if (num_st) { // Note: the VTB-EXT standard has a mistake in the example EDID@@ -36,7 +41,9 @@ void edid_state::parse_vtb_ext_block(const unsigned char *x) // // The documentation itself is correct, though. printf(" Standard Timings:\n"); - for (unsigned i = 0; i < num_st; i++, x += 2) + for (unsigned i = 0; i < num_st; i++, x += 2) { + if (x + 2 > y) { fail("Not enough bytes remain for more STs in the VTB-EXT\n"); return; } print_standard_timing(" ", x[0], x[1], true); + } } }
PATCH 5/11 edid-decode: fix standard timing vertical pixels
In reply to joevtDon't do ceiling to nearest 8 pixels for active vertical lines. See examples elo-4600l-hdmi and kogan-kaled24144f-hdmi.
Section 3.9 and 3.10.3.6 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
--- parse-base-block.cpp | 1 - 1 file changed, 1 deletion(-)
parse-base-block.cpp +0 -1
@@ -573,7 +573,6 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns break; } vact = (double)hact * vratio / hratio; - vact = 8 * ((vact + 7) / 8); refresh = (b2 & 0x3f) + 60; formula.hact = hact;
Signature · 1 line
2.24.3 (Apple Git-128)
Re: [PATCH 05/11] edid-decode: fix standard timing vertical pixels
Quoted 18 lines · joevt
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 3.10.3.6 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:10Signed-off-by Joe van Tunen <[email protected]>--- parse-base-block.cpp | 1 - 1 file changed, 1 deletion(-)parse-base-block.cpp +0
-0
parse-base-block.cpp void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns · line 576
Quoted 4 lines
parse-base-block.cpp +0
-1@@ -573,7 +573,6 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns break; } vact = (double)hact * vratio / hratio; - vact = 8 * ((vact + 7) / 8);
I need to look closer at this. I think it was added to help with 1360x768, which without this line maps to 1360x765.
I'll get back to you on this.
Regards,
Hans
Quoted 4 lines
parse-base-block.cpp +0
-0refresh = (b2 & 0x3f) + 60; formula.hact = hact;
Re: [PATCH 05/11] edid-decode: fix standard timing vertical pixels
Quoted 27 lines · Hans Verkuil
Quoted 18 lines · joevt
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 3.10.3.6 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:10Signed-off-by Joe van Tunen <[email protected]>--- parse-base-block.cpp | 1 - 1 file changed, 1 deletion(-)parse-base-block.cpp +0
-0parse-base-block.cpp void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns · line 576
Quoted 4 lines
parse-base-block.cpp +0
-1@@ -573,7 +573,6 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns break; } vact = (double)hact * vratio / hratio; - vact = 8 * ((vact + 7) / 8);I need to look closer at this. I think it was added to help with 1360x768, which without this line maps to 1360x765.
Quoted 1 line
I'll get back to you on this.
I did some more reading on this, and appendix D of the EDID 1.4 spec says this (D-8):
"If calculated aspect ratio is not 16 : 10 AR, 4 : 3 AR, 5 : 4 AR or 16 : 9 AR
what timing description should be used?"
"Ref.: Section 3.9 (E-EDID Standard Release A, Revision 2)
The Standard Timings Identification code may not be used to identify timings which do not match one of these standard aspect ratios. Support for such timings must be indicated elsewhere, e.g., by use of a Detailed Timing Descriptor."
So you are correct with your change, but I think it would make sense to add a new check:
// See also Ref. D-8 in the EDID-1.4 spec
if (vact & 1)
warn("Standard Timing %ux%u has a dubious odd vertical resolution.\n", hact, vact);So that way an attempt to use ST to describe 1360x768 will result in a warning.
Regards,
Hans
Quoted 10 lines
Regards,
Hans
Quoted 4 lines
parse-base-block.cpp +0
-0refresh = (b2 & 0x3f) + 60; formula.hact = hact;
Re: [PATCH 05/11] edid-decode: fix standard timing vertical pixels
Good find. I agree with that warning.
On 2021-09-15, 4:10 AM, "Hans Verkuil" <[email protected]> wrote:
On 15/09/2021 12:08, Hans Verkuil wrote:
> On 14/09/2021 14:11, joevt wrote:
>> 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 3.10.3.6 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
>>
>> Signed-off-by: Joe van Tunen <[email protected]>
>> ---
>> parse-base-block.cpp | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/parse-base-block.cpp b/parse-base-block.cpp
>> index e2901a6..32d2079 100644
>> --- a/parse-base-block.cpp
>> +++ b/parse-base-block.cpp
>> @@ -573,7 +573,6 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns
>> break;
>> }
>> vact = (double)hact * vratio / hratio;
>> - vact = 8 * ((vact + 7) / 8);
>
> I need to look closer at this. I think it was added to help with 1360x768, which without
> this line maps to 1360x765.
>
> I'll get back to you on this.
I did some more reading on this, and appendix D of the EDID 1.4 spec
says this (D-8):
"If calculated aspect ratio is not 16 : 10 AR, 4 : 3 AR, 5 : 4 AR or 16 : 9 AR
what timing description should be used?"
"Ref.: Section 3.9 (E-EDID Standard Release A, Revision 2)
The Standard Timings Identification code may not be used to
identify timings which do not match one of these standard aspect
ratios. Support for such timings must be indicated elsewhere,
e.g., by use of a Detailed Timing Descriptor."
So you are correct with your change, but I think it would make
sense to add a new check:
// See also Ref. D-8 in the EDID-1.4 spec
if (vact & 1)
warn("Standard Timing %ux%u has a dubious odd vertical resolution.\n", hact, vact);
So that way an attempt to use ST to describe 1360x768 will result in a warning.
Regards,
Hans
>
> Regards,
>
> Hans
>
>> refresh = (b2 & 0x3f) + 60;
>>
>> formula.hact = hact;
>>
> PATCH 6/11 edid-decode: linefeed before fail
In reply to joevtAlways output linefeed before fail message. See example dell-up2715k-dp1-optomedia-cmv535.
--- parse-base-block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
parse-base-block.cpp +1 -1
@@ -700,9 +700,9 @@ void edid_state::detailed_display_range_limits(const unsigned char *x) base.max_display_pixclk_khz = x[9] * 10000; printf(", max dotclock %d MHz\n", x[9] * 10); } else { + printf("\n"); if (base.edid_minor >= 4) fail("EDID 1.4 block does not set max dotclock.\n"); - printf("\n"); } if (has_sec_gtf) {
Signature · 1 line
2.24.3 (Apple Git-128)
PATCH 7/11 edid-decode: always linefeed after hex_block
In reply to joevthex_block should not return without printing a newline (which occurs when the length is zero). This causes a missing newline after "Application Version: 1" with cta_hdr10plus for an EDID I have. Any place that calls hex_block will have the same problem if it's possible for the length to be zero.
In other words, a hex_block needs to have a linefeed even if it has zero length, because the caller assumes it will go to the next line as it does when the hex block is not zero length.
--- edid-decode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
edid-decode.cpp +3 -1
@@ -698,8 +698,10 @@ void hex_block(const char *prefix, const unsigned char *x, { unsigned i, j; - if (!length) + if (!length) { + printf("\n"); return; + } for (i = 0; i < length; i += step) { unsigned len = min(step, length - i);
Signature · 1 line
2.24.3 (Apple Git-128)
Re: [PATCH 07/11] edid-decode: always linefeed after hex_block
Quoted 15 lines · joevt
hex_blockshould not return without printing a newline (which occurs when the length is zero). This causes a missing newline after "Application Version: 1" withcta_hdr10plusfor an EDID I have. Any place that callshex_blockwill have the same problem if it's possible for the length to be zero.In other words, a
hex_blockneeds to have a linefeed even if it has zero length, because the caller assumes it will go to the next line as it does when the hex block is not zero length.Signed-off-by Joe van Tunen <[email protected]>--- edid-decode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)edid-decode.cpp +0
-0
edid-decode.cpp void hex_block(const char *prefix, const unsigned char *x, · line 704
Quoted 8 lines
edid-decode.cpp +3
-1@@ -698,8 +698,10 @@ void hex_block(const char *prefix, const unsigned char *x, { unsigned i, j; - if (!length) + if (!length) { + printf("\n"); return; + }
Hmm, with this change I get this:
edid-decode -c Digital/Acer/ACR0282/B12D637C1F12 with the linuxhw database:
Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
Source physical address: 2.0.0.0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
That looks pretty ugly.
Regards,
Hans
Quoted 4 lines
edid-decode.cpp +0
-0for (i = 0; i < length; i += step) { unsigned len = min(step, length - i);
Re: [PATCH 07/11] edid-decode: always linefeed after hex_block
Yes, that's ugly. I will do a search for the EDID that prompted me to make this change. Maybe it's not a problem anymore.
...
Seems like the problem I had was fixed in cta_hdr10plus. I'll do more checking and testing with other calls to hex_block.
On 2021-09-15, 3:10 AM, "Hans Verkuil" <[email protected]> wrote:
On 14/09/2021 14:11, joevt wrote:
> hex_block should not return without printing a newline (which occurs when the length is zero). This causes a missing newline after "Application Version: 1" with cta_hdr10plus for an EDID I have.
> Any place that calls hex_block will have the same problem if it's possible for the length to be zero.
>
> In other words, a hex_block needs to have a linefeed even if it has zero length, because the caller assumes it will go to the next line as it does when the hex block is not zero length.
>
> Signed-off-by: Joe van Tunen <[email protected]>
> ---
> edid-decode.cpp | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/edid-decode.cpp b/edid-decode.cpp
> index 2316abc..6aa93fb 100644
> --- a/edid-decode.cpp
> +++ b/edid-decode.cpp
> @@ -698,8 +698,10 @@ void hex_block(const char *prefix, const unsigned char *x,
> {
> unsigned i, j;
>
> - if (!length)
> + if (!length) {
> + printf("\n");
> return;
> + }
Hmm, with this change I get this:
edid-decode -c Digital/Acer/ACR0282/B12D637C1F12 with the linuxhw database:
Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
Source physical address: 2.0.0.0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
That looks pretty ugly.
Regards,
Hans
>
> for (i = 0; i < length; i += step) {
> unsigned len = min(step, length - i);
> Re: [PATCH 07/11] edid-decode: always linefeed after hex_block
I found no place that requires this change to hex_block. This patch should be ignored.
I did find one call to hex_block that should be modified:cta_hdr10plus outputs hex on the same line as the "Application Version: %u".
It either needs to always output a linefeed before calling hex_block like this:
printf(" Application Version: %u\n", x[0]);
hex_block(" ", x + 1, length - 1);Or it needs to set step to the same value as length, like this:
printf(" Application Version: %u", x[0]);
if (length > 1)
hex_block(" ", x + 1, length - 1, true, length - 1);
else
printf("\n");Those are probably the only acceptable ways to call hex_block (first is multi-line or no-line, second is one-line)
It should also probably check the length:
if (length == 0) {
fail("Empty Data Block with length %u.\n", length);
return;
}On 2021-09-15, 8:43 AM, "Joe van Tunen" <[email protected]> wrote:
Yes, that's ugly. I will do a search for the EDID that prompted me to make this change. Maybe it's not a problem anymore.
...
Seems like the problem I had was fixed in cta_hdr10plus. I'll do more checking and testing with other calls to hex_block.
On 2021-09-15, 3:10 AM, "Hans Verkuil" <[email protected]> wrote:
On 14/09/2021 14:11, joevt wrote:
> hex_block should not return without printing a newline (which occurs when the length is zero). This causes a missing newline after "Application Version: 1" with cta_hdr10plus for an EDID I have.
> Any place that calls hex_block will have the same problem if it's possible for the length to be zero.
>
> In other words, a hex_block needs to have a linefeed even if it has zero length, because the caller assumes it will go to the next line as it does when the hex block is not zero length.
>
> Signed-off-by: Joe van Tunen <[email protected]>
> ---
> edid-decode.cpp | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/edid-decode.cpp b/edid-decode.cpp
> index 2316abc..6aa93fb 100644
> --- a/edid-decode.cpp
> +++ b/edid-decode.cpp
> @@ -698,8 +698,10 @@ void hex_block(const char *prefix, const unsigned char *x,
> {
> unsigned i, j;
>
> - if (!length)
> + if (!length) {
> + printf("\n");
> return;
> + }
Hmm, with this change I get this:
edid-decode -c Digital/Acer/ACR0282/B12D637C1F12 with the linuxhw database:
Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
Source physical address: 2.0.0.0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
Unknown CTA-861 tag 0x00, length 0
That looks pretty ugly.
Regards,
Hans
>
> for (i = 0; i < length; i += step) {
> unsigned len = min(step, length - i);
> PATCH 8/11 edid-decode: output full frequencies for 4:2:0
In reply to joevtDon't half hfreq for 4:2:0 timings - the character clock is halved, but the number of characters per line is also halved (two luminance values per character for 4:2:0), so there's no change in hfreq.
Don't half pixel clock because it looks weird. Character clock is halved but the number of pixels remains the same (two luminance values per character for 4:2:0).
Continue to use the half hfreq and half pixel clock for the ranges calculations because some non-HDMI 2.0 displays have max pixel clock halved when they have 4:2:0 modes and because other reasons that lead to adding this code in the first place?
--- edid-decode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
edid-decode.cpp +4 -2
@@ -513,6 +513,7 @@ bool edid_state::print_timings(const char *prefix, const struct timings *t, if (t->interlaced) vact /= 2; + double out_hor_freq_khz = hor_freq_khz; if (t->ycbcr420) hor_freq_khz /= 2;
@@ -558,6 +559,7 @@ bool edid_state::print_timings(const char *prefix, const struct timings *t, dtd_max_vsize_mm = t->vsize_mm; if (!s.empty()) s = " (" + s + ")"; + unsigned out_pixclk_khz = t->pixclk_khz; unsigned pixclk_khz = t->pixclk_khz / (t->ycbcr420 ? 2 : 1); char buf[10];
@@ -568,8 +570,8 @@ bool edid_state::print_timings(const char *prefix, const struct timings *t, t->hact, buf, refresh, t->hratio, t->vratio, - hor_freq_khz, - pixclk_khz / 1000.0, + out_hor_freq_khz, + out_pixclk_khz / 1000.0, s.c_str()); unsigned len = strlen(prefix) + 2;
Signature · 1 line
2.24.3 (Apple Git-128)
PATCH 9/11 edid-decode: allow undefined aspect ratio
In reply to joevtDistinguish between "undefined" and "reserved" aspect ratios. See examples apple-xdr-6k-tile0, lg-ultrafine-5k-v1-thunderbolt-dp1-tile0, asus-xg438q-dp "undefined" is for an aspect ratio that doesn't exist in the list of known aspect ratios. This does not deserve a fail. "reserved" should not be used and still deserves the fail.
--- parse-displayid-block.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
parse-displayid-block.cpp +10 -6
@@ -270,10 +270,12 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x, t.hratio = 256; t.vratio = 135; break; - default: + case 8: s += "undefined"; - if ((x[3] & 0xf) > (dispid.version <= 0x12 ? 7 : 8)) - fail("Unknown aspect 0x%02x.\n", x[3] & 0xf); + break; + default: + s += "reserved"; + fail("Unknown aspect 0x%02x.\n", x[3] & 0xf); break; } switch ((x[3] >> 5) & 0x3) {
@@ -455,10 +457,12 @@ void edid_state::parse_displayid_type_3_timing(const unsigned char *x) t.hratio = 256; t.vratio = 135; break; - default: + case 8: s += "undefined"; - if ((x[3] & 0xf) > (dispid.version <= 0x12 ? 7 : 8)) - fail("Unknown aspect 0x%02x.\n", x[3] & 0xf); + break; + default: + s += "reserved"; + fail("Unknown aspect 0x%02x.\n", x[0] & 0xf); break; }
Signature · 1 line
2.24.3 (Apple Git-128)
PATCH 10/11 edid-decode: add warnings to VESA VSDB
In reply to joevtAdd warnings for VESA vendor specific datablock (bits that should be zero and reserved values).
--- parse-displayid-block.cpp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-)
parse-displayid-block.cpp +24 -9
@@ -1461,22 +1461,37 @@ void edid_state::parse_displayid_vesa(const unsigned char *x) unsigned len = x[2]; x += 6; printf(" Data Structure Type: "); - switch (x[0] & 0x07) { - case 0x00: printf("eDP\n"); break; - case 0x01: printf("DP\n"); break; - default: printf("Reserved\n"); break; + switch (x[0] & 7) { + case 0: printf("eDP\n"); break; + case 1: printf("DP\n"); break; + default: printf("Reserved (%d)\n", x[0] & 7); break; } + + if ((x[0] >> 3) & 15) + warn("Reserved bits 6:3 (%d) are not 0.\n", (x[0] >> 3) & 15); + printf(" Default Colorspace and EOTF Handling: %s\n", (x[0] & 0x80) ? "Native as specified in the Display Parameters DB" : "sRGB"); + printf(" Number of Pixels in Hor Pix Cnt Overlapping an Adjacent Panel: %u\n", x[1] & 0xf); + if ((x[1] & 0xf) > 8) + warn("Number of Pixels in Hor Pix Cnt Overlapping an Adjacent Panel exceeds 8.\n"); + + if ((x[1] >> 4) & 1) + warn("Reserved bit 4 is not 0.\n"); + printf(" Multi-SST Operation: "); - switch ((x[1] >> 5) & 0x03) { - case 0x00: printf("Not Supported\n"); break; - case 0x01: printf("Two Streams (number of links shall be 2 or 4)\n"); break; - case 0x02: printf("Four Streams (number of links shall be 4)\n"); break; - case 0x03: printf("Reserved\n"); break; + switch ((x[1] >> 5) & 3) { + case 0: printf("Not Supported\n"); break; + case 1: printf("Two Streams (number of links shall be 2 or 4)\n"); break; + case 2: printf("Four Streams (number of links shall be 4)\n"); break; + case 3: printf("Reserved\n"); warn("Invalid option for Multi-SST Operation.\n"); break; } + + if ((x[1] >> 7) & 1) + warn("Reserved bit 7 is not 0.\n"); + if (len >= 7) { double bpp = (x[2] & 0x3f) + (x[3] & 0x0f) / 16.0; printf(" Pass through timing's target DSC bits per pixel: %.4f\n", bpp);
Signature · 1 line
2.24.3 (Apple Git-128)
PATCH 11/11 edid-decode: cta and displayid changes
In reply to joevtGoal: make OUI blocks equal to normal blocks to simplify decoding and make handling of all types of blocks consistent. This will reduce duplicated code (only one place for checking duplicate blocks, only one place for handling unknown blocks, etc.)
oui.h
- This contains a list of OUI and CID and PNP values.
- It is included in various places with varying definitions of the oneoui macro.
edid-decode.h
- Add list of OUI constants using oui.h.
- Other changes described below.
parse-cta-block.cpp
- Modified oui_name. Returns a name and a number for a OUI.
- Added data_block_oui. For data blocks with an OUI, does size check, OUI endianness check, and PNP vs OUI check. Returns a value representing the OUI (if it is known).
- Modify cta_block. Reduce code by flattening the switch statement. This means constructing a case value from three values.
Side effects include making reporting of "Only one instance of this Data Block is allowed." more consistant (always report this fail after the block type is output instead of sometimes before and sometimes after). See example acer-xv273k-dp2-corrupted. First, get the extended type and append it to the tag type (i.e. add 0x700 if extended), then get the OUI if it's vendor specific, and convert it to a number that can be appended (bitwise or) to the tag/extended type value.
- Init static variables
- Replace last_block_was_hdmi_vsdb with previous_cta_tag; this means instead of remembering if the last block was hdmi vsdb, we just remember the previous block's tag.
- Replace first_block with cta_block_number; this means instead of remembering if this is the first block or not, we just remember the current block number.
- Remove name and oui, we'll just get the data_block string and a oui index directly.
- Report OUI for extended tag 11h (Vendor-Specific Audio Data Block)
- Fix capitalization of "Audio information is present" fail message.
- Add bounds check on length field (must be at least 1 for extended tags).
- Don't parse after OUI if there's not enough length for OUI.
- Adjust x offsets in cta_hdmi_block so it is like other OUI extended blocks such that x points to after the OUI.
- A block that outputs only hex is reported as an unknown block type even if we know the OUI. See example acer-xb321hk-dp.
parse-disableid-block.cpp
- Add displayid_block to do a single data block - like cta_block does for cta extension block
- Vendor specific data block for DisplayID 1.3 is assumed to be PNP (string order). See example apple-macbookpro-16inch-2019.
- Vendor specific data block for DisplayID 2.0 is assumed to have OUI (little endian).
- Interpret Vendor specific data block 0x7e or 0x7f even if DisplayID is not correct for that type (there's already a FAIL message to identify the problem). See example apple-xdr-6k.
- Add bounds check: if length is < 3, only check x[1] if length is 2.
Don't report "Not enough bytes remain (1) for a DisplayID data block or the DisplayID filler is non-0." if the bytes are zero (also change the word "or" to "and"). See example apple-xdr-6k-tile0.
- Report datablock name before failing.
- For unknown vendor specific data blocks, don't output the OUI part as hex since the new data_block_oui function has already reported it. See example apple-macbookpro-16inch-2019.
- Replace first_data_block with disp.block_number
--- edid-decode.cpp | 99 ++++++-- edid-decode.h | 20 +- oui.h | 20 ++ parse-cta-block.cpp | 456 ++++++++++++++----------------------- parse-displayid-block.cpp | 463 ++++++++++++++++++-------------------- 5 files changed, 505 insertions(+), 553 deletions(-) create mode 100644 oui.h
edid-decode.cpp +82 -17
@@ -657,25 +657,90 @@ std::string utohex(unsigned char x) return buf; } -const char *oui_name(unsigned oui, bool reverse) +const char *oui_name(unsigned oui, unsigned *ouinum) { - if (reverse) - oui = (oui >> 16) | (oui & 0xff00) | ((oui & 0xff) << 16); - + unsigned ouinumscratch; + if (!ouinum) ouinum = &ouinumscratch; + const char *name; switch (oui) { - case 0x00001a: return "AMD"; - case 0x000c03: return "HDMI"; - case 0x00044b: return "NVIDIA"; - case 0x000c6e: return "ASUS"; - case 0x0010fa: return "Apple"; - case 0x0014b9: return "MSTAR"; - case 0x00d046: return "Dolby"; - case 0x00e047: return "InFocus"; - case 0x3a0292: return "VESA"; - case 0x90848b: return "HDR10+"; - case 0xc45dd8: return "HDMI Forum"; - case 0xca125c: return "Microsoft"; - default: return NULL; + #define oneoui(c,k,n) case c: *ouinum = kOUI_##k; name = n; break; + #include "oui.h" + default: *ouinum = 0; name = NULL; + } + return name; +} + +void edid_state::data_block_oui(std::string block_name, const unsigned char *x, unsigned length, bool ignorezeros, unsigned *ouinum, bool do_ascii, bool big_endian) +{ + std::string buf; + char ascii[4]; + unsigned oui; + const char *ouiname = NULL; + bool matched_reverse = false; + bool matched_ascii = false; + bool valid_ascii = false; + + if (big_endian) + oui = ((length > 0 ? x[0] : 0) << 16) + ((length > 1 ? x[1] : 0) << 8) + (length > 2 ? x[2] : 0); + else + oui = ((length > 2 ? x[2] : 0) << 16) + ((length > 1 ? x[1] : 0) << 8) + (length > 0 ? x[0] : 0); + + buf = ouitohex(oui); + if (length < 3) { + sprintf(ascii, "?"); // some characters are null + if (ouinum) *ouinum = 0; // doesn't match a known OUI + } else { + valid_ascii = (x[0] >= 'A' && x[1] >= 'A' && x[2] >= 'A' && x[0] <= 'Z' && x[1] <= 'Z' && x[2] <= 'Z'); + sprintf(ascii, "%c%c%c", x[0], x[1], x[2]); + + ouiname = oui_name(oui, ouinum); + if (!ouiname) { + big_endian = !big_endian; + unsigned reversedoui = ((oui & 0xff) << 16) + (oui & 0x00ff00) + (oui >> 16); + ouiname = oui_name(reversedoui, ouinum); + if (ouiname) { + oui = reversedoui; + buf = ouitohex(oui); + matched_reverse = true; + } + else if (do_ascii && valid_ascii) + { + unsigned asciioui = (x[0] << 24) + (x[1] << 16) + (x[2] << 8); + ouiname = oui_name(asciioui, ouinum); + if (ouiname) { + matched_ascii = true; + } + } + } + } + + std::string name; + if (ouiname) { + if (matched_ascii) + name = block_name + " (" + ouiname + ")" + ", PNP ID '" + ascii + "'"; + else + name = block_name + " (" + ouiname + ")" + ", OUI " + buf; + } else if (do_ascii && valid_ascii) { + name = block_name + ", PNP ID '" + ascii + "'"; + } else { + name = block_name + ", OUI " + buf; + } + // assign string to data_block before outputting errors + data_block = name; + + if (oui || !ignorezeros) { + if (length < 3) + fail("Data block length is not enough to contain an OUI.\n"); + if (ouiname && do_ascii && !valid_ascii) + warn("Expected PNP ID but found OUI.\n"); + if (ouiname && matched_reverse) + warn("Endian-ness (%s) of OUI is different than expected (%s).\n", big_endian ? "be" : "le", big_endian ? "le" : "be"); + if (!ouiname) { + if (valid_ascii) + warn("Unknown OUI %s (possible PNP %s).\n", buf.c_str(), ascii); + else + warn("Unknown OUI %s.\n", buf.c_str()); + } } }
edid-decode.h +15 -5
@@ -153,8 +153,10 @@ struct edid_state {// CTA-861 block state cta.has_vic_1 = cta.first_svd_might_be_preferred = cta.has_sldb = cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = false; - cta.last_block_was_hdmi_vsdb = cta.have_hf_vsdb = cta.have_hf_scdb = false; - cta.first_block = cta.first_svd = true; + cta.have_hf_vsdb = cta.have_hf_scdb = false; + cta.previous_cta_tag =0xfff ; + cta.block_number =0 ; + cta.first_svd = true; cta.supported_hdmi_vic_codes = cta.supported_hdmi_vic_vsb_codes =0 ;memset (cta.vics,0 ,sizeof (cta.vics));memset (cta.preparsed_has_vic,0 ,sizeof (cta.preparsed_has_vic));
@@ -175,6 +177,7 @@ struct edid_state { dispid.is_display = dispid.has_product_identification = dispid.has_display_parameters = dispid.has_type_1_7 = dispid.has_display_interface_features = false; + dispid.block_number =0 ;// Block Map block state block_map.saw_block_1 = false;
@@ -257,9 +260,9 @@ struct edid_state {bool preparsed_sld;bool has_sldb;unsigned short preparsed_phys_addr; -bool last_block_was_hdmi_vsdb; +unsigned previous_cta_tag;bool have_hf_vsdb, have_hf_scdb; -bool first_block; +unsigned block_number;bool first_svd;unsigned supported_hdmi_vic_codes;unsigned supported_hdmi_vic_vsb_codes;
@@ -282,6 +285,7 @@ struct edid_state {bool has_display_interface_features;vec_timings_ext preferred_timings;unsigned native_width, native_height; +unsigned block_number;// Keep track of the found CTA-861 Tag/Extended Tag pairs. // The unsigned value is equal to: (tag << 8) | ext_tag std::set<unsigned> found_tags;
@@ -331,6 +335,8 @@ struct edid_state {void list_dmts ();void list_established_timings (); + void data_block_oui(std::string block_name, const unsigned char *x, unsigned length, bool ignorezeros, unsigned *ouinum, bool do_ascii = false, bool big_endian = false); + void print_vic_index(const char *prefix, unsigned idx, const char *suffix, bool ycbcr420 = false);void hdmi_latency (unsigned char vid_lat,unsigned char aud_lat,bool is_ilaced);void cta_vcdb (const unsigned char *x,unsigned length);
@@ -390,6 +396,7 @@ struct edid_state {void parse_displayid_type_10_timing (const unsigned char *x,unsigned sz, bool is_cta = false);void preparse_displayid_block (const unsigned char *x); +unsigned displayid_block (const unsigned version,const unsigned char *x,unsigned length);void parse_displayid_block (const unsigned char *x);void parse_displayid_vesa (const unsigned char *x);void parse_displayid_cta_data_block (const unsigned char *x);
@@ -454,7 +461,7 @@ void hex_block(const char *prefix, const unsigned char *x, unsigned length, bool show_ascii = true, unsigned step = 16); std::string block_name(unsigned char block);void calc_ratio (struct timings *t); -const char *oui_name(unsigned oui, bool reverse = false); +const char *oui_name(unsigned oui, unsigned *ouinum = NULL); bool timings_close_match(const timings &t1, const timings &t2);const struct timings *find_dmt_id (unsigned char dmt_id);
@@ -465,4 +472,7 @@ const struct timings *cta_close_match_to_vic(const timings &t, unsigned &vic);unsigned char hdmi_vic_to_vic (unsigned char hdmi_vic);char *extract_string (const unsigned char *x,unsigned len); +#define oneoui (c,k,n) const unsigned kOUI_##k = __LINE__<<12; +#include "oui.h" +#endif
oui.h new file +20 -0
@@ -0,0 +1,20 @@ +// http://standards-oui.ieee.org/oui/oui.txt +oneoui(0x000c03, HDMI, "HDMI" ) +oneoui(0xc45dd8, HDMIForum, "HDMI Forum" ) +oneoui(0x90848b, HDR10, "HDR10+" ) +oneoui(0x00001a, AMD, "AMD" ) +oneoui(0x00044b, NVIDIA, "NVIDIA" ) +oneoui(0x000c6e, ASUS, "ASUS" ) +oneoui(0x0010fa, Apple, "Apple" ) +oneoui(0x0014b9, MSTAR, "MSTAR" ) +oneoui(0x00d046, Dolby, "Dolby" ) +oneoui(0x00e047, InFocus, "InFocus" ) +oneoui (0xca125c , Microsoft,"Microsoft" ) + +// http://standards-oui.ieee.org/cid/cid.txt +oneoui (0x3a0292 ,VESA ,"VESA" ) + +// https://uefi.org/pnp_id_list +oneoui('APP\0' , asciiApple, "Apple" ) + +#undef oneoui
parse-cta-block.cpp +166 -290
534 lines not on this page · raw message
parse-displayid-block.cpp +222 -241
481 lines not on this page · raw message
Signature · 1 line
2.24.3 (Apple Git-128)
Re: [PATCH 11/11] edid-decode: cta and displayid changes
Quoted 27 lines · joevt
Goal: make OUI blocks equal to normal blocks to simplify decoding and make handling of all types of blocks consistent. This will reduce duplicated code (only one place for checking duplicate blocks, only one place for handling unknown blocks, etc.)
oui.h
- This contains a list of OUI and CID and PNP values.
- It is included in various places with varying definitions of the oneoui macro.
edid-decode.h
- Add list of OUI constants usingoui.h.
- Other changes described below.parse-cta-block.cpp
- Modifiedoui_name. Returns a name and a number for a OUI.
- Addeddata_block_oui. For data blocks with an OUI, does size check, OUI endianness check, and PNP vs OUI check. Returns a value representing the OUI (if it is known).
- Modifycta_block. Reduce code by flattening the switch statement. This means constructing a case value from three values.
Side effects include making reporting of "Only one instance of this Data Block is allowed." more consistant (always report this fail after the block type is output instead of sometimes before and sometimes after). See example acer-xv273k-dp2-corrupted. First, get the extended type and append it to the tag type (i.e. add0x700if extended), then get the OUI if it's vendor specific, and convert it to a number that can be appended (bitwise or) to the tag/extended type value.
- Init static variables
- Replacelast_block_was_hdmi_vsdbwithprevious_cta_tag; this means instead of remembering if the last block was hdmi vsdb, we just remember the previous block's tag.
- Replacefirst_blockwithcta_block_number; this means instead of remembering if this is the first block or not, we just remember the current block number.
- Remove name and oui, we'll just get thedata_blockstring and a oui index directly.
- Report OUI for extended tag 11h (Vendor-Specific Audio Data Block)
- Fix capitalization of "Audio information is present" fail message.
- Add bounds check on length field (must be at least 1 for extended tags).
- Don't parse after OUI if there's not enough length for OUI.
- Adjust x offsets incta_hdmi_blockso it is like other OUI extended blocks such that x points to after the OUI.
- A block that outputs only hex is reported as an unknown block type even if we know the OUI. See example acer-xb321hk-dp.
Quoted 10 lines
parse-disableid-block.cpp
- Adddisplayid_blockto do a single data block - likecta_blockdoes for cta extension block
- Vendor specific data block for DisplayID 1.3 is assumed to be PNP (string order). See example apple-macbookpro-16inch-2019.
- Vendor specific data block for DisplayID 2.0 is assumed to have OUI (little endian).
- Interpret Vendor specific data block0x7eor0x7feven if DisplayID is not correct for that type (there's already a FAIL message to identify the problem). See example apple-xdr-6k.
- Add bounds check: if length is < 3, only check x[1] if length is 2.
Don't report "Not enough bytes remain (1) for a DisplayID data block or the DisplayID filler is non-0." if the bytes are zero (also change the word "or" to "and"). See example apple-xdr-6k-tile0.
- Report datablock name before failing.
- For unknown vendor specific data blocks, don't output the OUI part as hex since the newdata_block_ouifunction has already reported it. See example apple-macbookpro-16inch-2019.
- Replacefirst_data_blockwith disp.block_number
I've decided not to merge this patch. It does too many things at the same time, so it really should be split up into smaller pieces.
I'm also getting ugly lines like this:
Unknown CTA-861 Data Block (tag 0x00): Unknown block type: Unknown CTA-861 Data Block (tag 0x00).
or this:
Vendor-Specific Data Block (NVIDIA), OUI 00-04-4B: Unknown block type: Vendor-Specific Data Block (NVIDIA), OUI 00-04-4B.
(which shouldn't be a warning anyway)
Quoted 9 lines
Signed-off-by Joe van Tunen <[email protected]>--- edid-decode.cpp | 99 ++++++-- edid-decode.h | 20 +- oui.h | 20 ++ parse-cta-block.cpp | 456 ++++++++++++++----------------------- parse-displayid-block.cpp | 463 ++++++++++++++++++-------------------- 5 files changed, 505 insertions(+), 553 deletions(-)
While it does reduce the code size a bit, it really isn't by all that much, so I am not convinced that all the churn is worth it.
If this is split up into first fixes and small improvements, and then rework the tag handling, then I can take another look at whether it makes sense to apply this.
I've applied patches 1, 2, 3, 4, 6, 8, 9 and 10. The others need more work.
Regards,
Hans
Quoted 1,249 lines
create mode 100644 oui.hedid-decode.cpp +82
-17@@ -657,25 +657,90 @@ std::string utohex(unsigned char x) return buf; } -const char *oui_name(unsigned oui, bool reverse) +const char *oui_name(unsigned oui, unsigned *ouinum) { - if (reverse) - oui = (oui >> 16) | (oui & 0xff00) | ((oui & 0xff) << 16); - + unsigned ouinumscratch; + if (!ouinum) ouinum = &ouinumscratch; + const char *name; switch (oui) { - case 0x00001a: return "AMD"; - case 0x000c03: return "HDMI"; - case 0x00044b: return "NVIDIA"; - case 0x000c6e: return "ASUS"; - case 0x0010fa: return "Apple"; - case 0x0014b9: return "MSTAR"; - case 0x00d046: return "Dolby"; - case 0x00e047: return "InFocus"; - case 0x3a0292: return "VESA"; - case 0x90848b: return "HDR10+"; - case 0xc45dd8: return "HDMI Forum"; - case 0xca125c: return "Microsoft"; - default: return NULL; + #define oneoui(c,k,n) case c: *ouinum = kOUI_##k; name = n; break; + #include "oui.h" + default: *ouinum = 0; name = NULL; + } + return name; +} + +void edid_state::data_block_oui(std::string block_name, const unsigned char *x, unsigned length, bool ignorezeros, unsigned *ouinum, bool do_ascii, bool big_endian) +{ + std::string buf; + char ascii[4]; + unsigned oui; + const char *ouiname = NULL; + bool matched_reverse = false; + bool matched_ascii = false; + bool valid_ascii = false; + + if (big_endian) + oui = ((length > 0 ? x[0] : 0) << 16) + ((length > 1 ? x[1] : 0) << 8) + (length > 2 ? x[2] : 0); + else + oui = ((length > 2 ? x[2] : 0) << 16) + ((length > 1 ? x[1] : 0) << 8) + (length > 0 ? x[0] : 0); + + buf = ouitohex(oui); + if (length < 3) { + sprintf(ascii, "?"); // some characters are null + if (ouinum) *ouinum = 0; // doesn't match a known OUI + } else { + valid_ascii = (x[0] >= 'A' && x[1] >= 'A' && x[2] >= 'A' && x[0] <= 'Z' && x[1] <= 'Z' && x[2] <= 'Z'); + sprintf(ascii, "%c%c%c", x[0], x[1], x[2]); + + ouiname = oui_name(oui, ouinum); + if (!ouiname) { + big_endian = !big_endian; + unsigned reversedoui = ((oui & 0xff) << 16) + (oui & 0x00ff00) + (oui >> 16); + ouiname = oui_name(reversedoui, ouinum); + if (ouiname) { + oui = reversedoui; + buf = ouitohex(oui); + matched_reverse = true; + } + else if (do_ascii && valid_ascii) + { + unsigned asciioui = (x[0] << 24) + (x[1] << 16) + (x[2] << 8); + ouiname = oui_name(asciioui, ouinum); + if (ouiname) { + matched_ascii = true; + } + } + } + } + + std::string name; + if (ouiname) { + if (matched_ascii) + name = block_name + " (" + ouiname + ")" + ", PNP ID '" + ascii + "'"; + else + name = block_name + " (" + ouiname + ")" + ", OUI " + buf; + } else if (do_ascii && valid_ascii) { + name = block_name + ", PNP ID '" + ascii + "'"; + } else { + name = block_name + ", OUI " + buf; + } + // assign string to data_block before outputting errors + data_block = name; + + if (oui || !ignorezeros) { + if (length < 3) + fail("Data block length is not enough to contain an OUI.\n"); + if (ouiname && do_ascii && !valid_ascii) + warn("Expected PNP ID but found OUI.\n"); + if (ouiname && matched_reverse) + warn("Endian-ness (%s) of OUI is different than expected (%s).\n", big_endian ? "be" : "le", big_endian ? "le" : "be"); + if (!ouiname) { + if (valid_ascii) + warn("Unknown OUI %s (possible PNP %s).\n", buf.c_str(), ascii); + else + warn("Unknown OUI %s.\n", buf.c_str()); + } } }edid-decode.h +15
-5@@ -153,8 +153,10 @@ struct edid_state {// CTA-861 block state cta.has_vic_1 = cta.first_svd_might_be_preferred = cta.has_sldb = cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = false; - cta.last_block_was_hdmi_vsdb = cta.have_hf_vsdb = cta.have_hf_scdb = false; - cta.first_block = cta.first_svd = true; + cta.have_hf_vsdb = cta.have_hf_scdb = false; + cta.previous_cta_tag =0xfff ; + cta.block_number =0 ; + cta.first_svd = true; cta.supported_hdmi_vic_codes = cta.supported_hdmi_vic_vsb_codes =0 ;memset (cta.vics,0 ,sizeof (cta.vics));memset (cta.preparsed_has_vic,0 ,sizeof (cta.preparsed_has_vic));@@ -175,6 +177,7 @@ struct edid_state { dispid.is_display = dispid.has_product_identification = dispid.has_display_parameters = dispid.has_type_1_7 = dispid.has_display_interface_features = false; + dispid.block_number =0 ;// Block Map block state block_map.saw_block_1 = false;@@ -257,9 +260,9 @@ struct edid_state {bool preparsed_sld;bool has_sldb;unsigned short preparsed_phys_addr; -bool last_block_was_hdmi_vsdb; +unsigned previous_cta_tag;bool have_hf_vsdb, have_hf_scdb; -bool first_block; +unsigned block_number;bool first_svd;unsigned supported_hdmi_vic_codes;unsigned supported_hdmi_vic_vsb_codes;@@ -282,6 +285,7 @@ struct edid_state {bool has_display_interface_features;vec_timings_ext preferred_timings;unsigned native_width, native_height; +unsigned block_number;// Keep track of the found CTA-861 Tag/Extended Tag pairs. // The unsigned value is equal to: (tag << 8) | ext_tag std::set<unsigned> found_tags;@@ -331,6 +335,8 @@ struct edid_state {void list_dmts ();void list_established_timings (); + void data_block_oui(std::string block_name, const unsigned char *x, unsigned length, bool ignorezeros, unsigned *ouinum, bool do_ascii = false, bool big_endian = false); + void print_vic_index(const char *prefix, unsigned idx, const char *suffix, bool ycbcr420 = false);void hdmi_latency (unsigned char vid_lat,unsigned char aud_lat,bool is_ilaced);void cta_vcdb (const unsigned char *x,unsigned length);@@ -390,6 +396,7 @@ struct edid_state {void parse_displayid_type_10_timing (const unsigned char *x,unsigned sz, bool is_cta = false);void preparse_displayid_block (const unsigned char *x); +unsigned displayid_block (const unsigned version,const unsigned char *x,unsigned length);void parse_displayid_block (const unsigned char *x);void parse_displayid_vesa (const unsigned char *x);void parse_displayid_cta_data_block (const unsigned char *x);@@ -454,7 +461,7 @@ void hex_block(const char *prefix, const unsigned char *x, unsigned length, bool show_ascii = true, unsigned step = 16); std::string block_name(unsigned char block);void calc_ratio (struct timings *t); -const char *oui_name(unsigned oui, bool reverse = false); +const char *oui_name(unsigned oui, unsigned *ouinum = NULL); bool timings_close_match(const timings &t1, const timings &t2);const struct timings *find_dmt_id (unsigned char dmt_id);@@ -465,4 +472,7 @@ const struct timings *cta_close_match_to_vic(const timings &t, unsigned &vic);unsigned char hdmi_vic_to_vic (unsigned char hdmi_vic);char *extract_string (const unsigned char *x,unsigned len); +#define oneoui (c,k,n) const unsigned kOUI_##k = __LINE__<<12; +#include "oui.h" +#endif oui.h new file +20
-0@@ -0,0 +1,20 @@ +// http://standards-oui.ieee.org/oui/oui.txt +oneoui(0x000c03, HDMI, "HDMI" ) +oneoui(0xc45dd8, HDMIForum, "HDMI Forum" ) +oneoui(0x90848b, HDR10, "HDR10+" ) +oneoui(0x00001a, AMD, "AMD" ) +oneoui(0x00044b, NVIDIA, "NVIDIA" ) +oneoui(0x000c6e, ASUS, "ASUS" ) +oneoui(0x0010fa, Apple, "Apple" ) +oneoui(0x0014b9, MSTAR, "MSTAR" ) +oneoui(0x00d046, Dolby, "Dolby" ) +oneoui(0x00e047, InFocus, "InFocus" ) +oneoui (0xca125c , Microsoft,"Microsoft" ) + +// http://standards-oui.ieee.org/cid/cid.txt +oneoui (0x3a0292 ,VESA ,"VESA" ) + +// https://uefi.org/pnp_id_list +oneoui('APP\0' , asciiApple, "Apple" ) + +#undef oneouiparse-cta-block.cpp +166
-290@@ -652,57 +652,57 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length) { unsigned len_vic, len_3d; - if (length < 4) { - fail("Empty Data Block with length %u.\n", length); + if (length < 1) { + fail("Empty Data Block.\n"); return; } - printf(" Source physical address: %x.%x.%x.%x\n", x[3] >> 4, x[3] & 0x0f, - x[4] >> 4, x[4] & 0x0f); + printf(" Source physical address: %x.%x.%x.%x\n", x[0] >> 4, x[0] & 0x0f, + x[1] >> 4, x[1] & 0x0f); - if (length < 6) + if (length < 3) return; - if (x[5] & 0x80) + if (x[2] & 0x80) printf(" Supports_AI\n"); - if (x[5] & 0x40) + if (x[2] & 0x40) printf(" DC_48bit\n"); - if (x[5] & 0x20) + if (x[2] & 0x20) printf(" DC_36bit\n"); - if (x[5] & 0x10) + if (x[2] & 0x10) printf(" DC_30bit\n"); - if (x[5] & 0x08) + if (x[2] & 0x08) printf(" DC_Y444\n"); /* two reserved bits */ - if (x[5] & 0x01) + if (x[2] & 0x01) printf(" DVI_Dual\n"); - if (length < 7) + if (length < 4) return; - printf(" Maximum TMDS clock: %u MHz\n", x[6] * 5); - if (x[6] * 5 > 340) + printf(" Maximum TMDS clock: %u MHz\n", x[3] * 5); + if (x[3] * 5 > 340) fail("HDMI VSDB Max TMDS rate is > 340.\n"); - if (length < 8) + if (length < 5) return; - if (x[7] & 0x0f) { + if (x[4] & 0x0f) { printf(" Supported Content Types:\n"); - if (x[7] & 0x01) + if (x[4] & 0x01) printf(" Graphics\n"); - if (x[7] & 0x02) + if (x[4] & 0x02) printf(" Photo\n"); - if (x[7] & 0x04) + if (x[4] & 0x04) printf(" Cinema\n"); - if (x[7] & 0x08) + if (x[4] & 0x08) printf(" Game\n"); } - unsigned b = 8; - if (x[7] & 0x80) { + unsigned b = 5; + if (x[4] & 0x80) { hdmi_latency(x[b], x[b + 1], false); - if (x[7] & 0x40) { + if (x[4] & 0x40) { if (x[b] == x[b + 2] && x[b + 1] == x[b + 3]) warn("Progressive and Interlaced latency values are identical, no need for both.\n");@@ -712,7 +712,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length) b += 2; } - if (!(x[7] & 0x20)) + if (!(x[4] & 0x20)) return; bool mask = false;@@ -1990,293 +1990,169 @@ static void cta_hdmi_audio_block(const unsigned char *x, unsigned length) } } -void edid_state::cta_ext_block(const unsigned char *x, unsigned length, - bool duplicate) +#define data_block_o(n) do { data_block_oui(n, x, length, false, &ouinum); if (length < 3) return; length -= 3; x += 3; } while(0) + +void edid_state::cta_block(const unsigned char *x, bool duplicate) { - const char *name; - unsigned oui; - bool reverse = false; + unsigned length = x[0] & 0x1f; // number of bytes after the tag/length byte + unsigned ouinum = 0; + unsigned tag=(x[0] & 0xe0) >> 5; + unsigned extended = (tag == 0x07) ? 1 : 0; + x++; + if (extended) { + if (!length) { + fail("Extended tag cannot have length 0.\n"); + return; + } + length--; + tag = 0x700 + x[0]; + x++; + } + bool audio_block = false; - switch (x[0]) { - case 0x00: data_block = "Video Capability Data Block"; break; - case 0x01: data_block.clear(); break; - case 0x02: data_block = "VESA Video Display Device Data Block"; break; - case 0x03: data_block = "VESA Video Timing Block Extension"; break; - case 0x04: data_block = "Reserved for HDMI Video Data Block"; break; - case 0x05: data_block = "Colorimetry Data Block"; break; - case 0x06: data_block = "HDR Static Metadata Data Block"; break; - case 0x07: data_block = "HDR Dynamic Metadata Data Block"; break; - - case 0x0d: data_block = "Video Format Preference Data Block"; break; - case 0x0e: data_block = "YCbCr 4:2:0 Video Data Block"; break; - case 0x0f: data_block = "YCbCr 4:2:0 Capability Map Data Block"; break; - case 0x10: data_block = "Reserved for CTA-861 Miscellaneous Audio Fields"; break; - case 0x11: data_block.clear(); audio_block = true; break; - case 0x12: data_block = "HDMI Audio Data Block"; audio_block = true; break; - case 0x13: data_block = "Room Configuration Data Block"; audio_block = true; break; - case 0x14: data_block = "Speaker Location Data Block"; audio_block = true; break; - - case 0x20: data_block = "InfoFrame Data Block"; break; - - case 0x34: data_block = "DisplayID Type VII Video Timing Data Block"; break; - case 0x35: data_block = "DisplayID Type VIII Video Timing Data Block"; break; - case 0x42: data_block = "DisplayID Type X Video Timing Data Block"; break; - - case 0x78: data_block = "HDMI Forum EDID Extension Override Data Block"; break; - case 0x79: data_block = "HDMI Forum Sink Capability Data Block"; break; + switch (tag) { + case 0x001: data_block = "Audio Data Block"; audio_block = true; break; + case 0x002: data_block = "Video Data Block"; break; + case 0x003: data_block_o("Vendor-Specific Data Block"); break; + case 0x004: data_block = "Speaker Allocation Data Block"; audio_block = true; break; + case 0x005: data_block = "VESA Display Transfer Characteristics Data Block"; break; + + case 0x700: data_block = "Video Capability Data Block"; break; + case 0x701: data_block_o("Vendor-Specific Video Data Block"); break; + case 0x702: data_block = "VESA Video Display Device Data Block"; break; + case 0x703: data_block = "VESA Video Timing Block Extension"; break; // not implemented + case 0x704: data_block = "Reserved for HDMI Video Data Block"; break; // reserved + case 0x705: data_block = "Colorimetry Data Block"; break; + case 0x706: data_block = "HDR Static Metadata Data Block"; break; + case 0x707: data_block = "HDR Dynamic Metadata Data Block"; break; + + case 0x70d: data_block = "Video Format Preference Data Block"; break; + case 0x70e: data_block = "YCbCr 4:2:0 Video Data Block"; break; + case 0x70f: data_block = "YCbCr 4:2:0 Capability Map Data Block"; break; + case 0x710: data_block = "Reserved for CTA-861 Miscellaneous Audio Fields"; break; // reserved + case 0x711: data_block_o("Vendor-Specific Audio Data Block"); audio_block = true; break; // no vendors implemented + case 0x712: data_block = "HDMI Audio Data Block"; audio_block = true; break; + case 0x713: data_block = "Room Configuration Data Block"; audio_block = true; break; + case 0x714: data_block = "Speaker Location Data Block"; audio_block = true; break; + + case 0x720: data_block = "InfoFrame Data Block"; break; + + case 0x734: data_block = "DisplayID Type VII Video Timing Data Block"; break; + case 0x735: data_block = "DisplayID Type VIII Video Timing Data Block"; break; + case 0x742: data_block = "DisplayID Type X Video Timing Data Block"; break; + + case 0x778: data_block = "HDMI Forum EDID Extension Override Data Block"; break; + case 0x779: data_block = "HDMI Forum Sink Capability Data Block"; break; default: - if (x[0] <= 12) - printf(" Unknown CTA-861 Video-Related"); - else if (x[0] <= 31) - printf(" Unknown CTA-861 Audio-Related"); - else if (x[0] >= 120 && x[0] <= 127) - printf(" Unknown CTA-861 HDMI-Related"); - else - printf(" Unknown CTA-861"); - printf(" Data Block (extended tag 0x%02x, length %u)\n", x[0], length); - hex_block(" ", x + 1, length); - data_block.clear(); - warn("Unknown Extended CTA-861 Data Block 0x%02x.\n", x[0]); - return; - } - - switch (x[0]) { - case 0x00: - case 0x02: - case 0x05: - case 0x06: - case 0x0d: - case 0x0f: - case 0x12: - case 0x13: - case 0x78: - case 0x79: + if (tag < 0x700) data_block = "Unknown CTA-861 Data Block"; + else if (tag < 0x70d) data_block = "Unknown CTA-861 Video-Related Data Block"; + else if (tag < 0x720) data_block = "Unknown CTA-861 Audio-Related Data Block"; + else if (tag < 0x778) data_block = "Unknown CTA-861 Data Block"; + else if (tag < 0x780) data_block = "Unknown CTA-861 HDMI-Related Data Block"; + else data_block = "Unknown CTA-861 Data Block"; + data_block += std::string(" (") + (extended ? "extended " : "") + "tag " + utohex(tag & 0xff) + ")"; + } + + printf(" %s:\n", data_block.c_str()); + + switch (tag) { + case 0x004: + case 0x005: + case 0x700: + case 0x702: + case 0x705: + case 0x706: + case 0x70d: + case 0x70f: + case 0x712: + case 0x713: + case 0x778: + case 0x779: if (duplicate) fail("Only one instance of this Data Block is allowed.\n"); - break; } - // See Table 52 of CTA-861-G for a description of Byte 3 if (audio_block && !(cta.byte3 & 0x40)) - fail("audio information is present, but bit 6 of Byte 3 of the CTA-861 Extension header indicates no Basic Audio support.\n"); - - if (data_block.length()) - printf(" %s:\n", data_block.c_str()); - - switch (x[0]) { - case 0x00: cta_vcdb(x + 1, length); return; - case 0x01: - if (length < 3) { - data_block = std::string("Vendor-Specific Video Data Block"); - fail("Invalid length %u < 3.\n", length); - return; - } - oui = (x[3] << 16) + (x[2] << 8) + x[1]; - name = oui_name(oui); - if (!name) { - name = oui_name(oui, true); - if (name) - reverse = true; - } - if (!name) { - printf(" Vendor-Specific Video Data Block, OUI %s:\n", - ouitohex(oui).c_str()); - hex_block(" ", x + 4, length - 3); - data_block.clear(); - warn("Unknown Extended Vendor-Specific Video Data Block, OUI %s.\n", - ouitohex(oui).c_str()); - return; - } - data_block = std::string("Vendor-Specific Video Data Block (") + name + ")"; - if (reverse) - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str()); - printf(" %s, OUI %s:\n", data_block.c_str(), ouitohex(oui).c_str()); - if (oui == 0x90848b) - cta_hdr10plus(x + 4, length - 3); - else if (oui == 0x00d046) - cta_dolby_video(x + 4, length - 3); - else - hex_block(" ", x + 4, length - 3); - return; - case 0x02: cta_vesa_vdddb(x + 1, length); return; - case 0x05: cta_colorimetry_block(x + 1, length); return; - case 0x06: cta_hdr_static_metadata_block(x + 1, length); return; - case 0x07: cta_hdr_dyn_metadata_block(x + 1, length); return; - case 0x0d: cta_vfpdb(x + 1, length); return; - case 0x0e: cta_svd(x + 1, length, true); return; - case 0x0f: cta_y420cmdb(x + 1, length); return; - case 0x11: - if (length < 3) { - data_block = std::string("Vendor-Specific Audio Data Block"); - fail("Invalid length %u < 3.\n", length); - return; - } - oui = (x[3] << 16) + (x[2] << 8) + x[1]; - name = oui_name(oui); - if (!name) { - name = oui_name(oui, true); - if (name) - reverse = true; - } - if (!name) { - printf(" Vendor-Specific Audio Data Block, OUI %s:\n", - ouitohex(oui).c_str()); - hex_block(" ", x + 4, length - 3); - data_block.clear(); - warn("Unknown Extended Vendor-Specific Audio Data Block, OUI %s.\n", - ouitohex(oui).c_str()); - return; - } - data_block = std::string("Vendor-Specific Audio Data Block (") + name + ")"; - if (reverse) - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str()); - printf(" %s, OUI %s:\n", data_block.c_str(), ouitohex(oui).c_str()); - if (oui == 0x00d046) - cta_dolby_audio(x + 4, length - 3); + fail("Audio information is present, but bit 6 of Byte 3 of the CTA-861 Extension header indicates no Basic Audio support.\n"); + + tag |= ouinum; + switch (tag) { + case 0x001: cta_audio_block(x, length); break; + case 0x002: cta_svd(x, length, false); break; + case 0x003|kOUI_HDMI: + cta_hdmi_block(x, length); + // The HDMI OUI is present, so this EDID represents an HDMI + // interface. And HDMI interfaces must use EDID version 1.3 + // according to the HDMI Specification, so check for this. + if (base.edid_minor != 3) + fail("The HDMI Specification requires EDID 1.3 instead of 1.%u.\n", + base.edid_minor); + break; + case 0x003|kOUI_HDMIForum: + if (cta.previous_cta_tag != (0x003|kOUI_HDMI)) + fail("HDMI Forum VSDB did not immediately follow the HDMI VSDB.\n"); + if (cta.have_hf_scdb || cta.have_hf_vsdb) + fail("Duplicate HDMI Forum VSDB/SCDB.\n"); + cta_hf_scdb(x, length); + cta.have_hf_vsdb = true; + break; + case 0x003|kOUI_AMD: cta_amd(x, length); break; + case 0x003|kOUI_Microsoft: + if (length == 0x12) + cta_microsoft(x, length); else - hex_block(" ", x + 4, length - 3); - return; - case 0x12: cta_hdmi_audio_block(x + 1, length); return; - case 0x13: cta_rcdb(x + 1, length); return; - case 0x14: cta_sldb(x + 1, length); return; - case 0x20: cta_ifdb(x + 1, length); return; - case 0x34: cta_displayid_type_7(x + 1, length); return; - case 0x35: cta_displayid_type_8(x + 1, length); return; - case 0x42: cta_displayid_type_10(x + 1, length); return; - case 0x78: - cta_hf_eeodb(x + 1, length); + goto dohex; + break; + case 0x004: cta_sadb(x, length); break; + case 0x005: cta_vesa_dtcdb(x, length); break; + case 0x700: cta_vcdb(x, length); break; + case 0x701|kOUI_HDR10: cta_hdr10plus(x, length); break; + case 0x701|kOUI_Dolby: cta_dolby_video(x, length); break; + case 0x702: cta_vesa_vdddb(x, length); break; + case 0x705: cta_colorimetry_block(x, length); break; + case 0x706: cta_hdr_static_metadata_block(x, length); break; + case 0x707: cta_hdr_dyn_metadata_block(x, length); break; + case 0x70d: cta_vfpdb(x, length); break; + case 0x70e: cta_svd(x, length, true); break; + case 0x70f: cta_y420cmdb(x, length); break; + case 0x711|kOUI_Dolby: cta_dolby_audio(x, length); break; + case 0x712: cta_hdmi_audio_block(x, length); break; + case 0x713: cta_rcdb(x, length); break; + case 0x714: cta_sldb(x, length); break; + case 0x720: cta_ifdb(x, length); break; + case 0x734: cta_displayid_type_7(x, length); break; + case 0x735: cta_displayid_type_8(x, length); break; + case 0x742: cta_displayid_type_10(x, length); break; + case 0x778: + cta_hf_eeodb(x, length); // This must be the first CTA-861 block - if (!cta.first_block) + if (cta.block_number > 0) fail("Block starts at a wrong offset.\n"); - return; - case 0x79: - if (!cta.last_block_was_hdmi_vsdb) + break; + case 0x779: + if (cta.previous_cta_tag != (0x003|kOUI_HDMI)) fail("HDMI Forum SCDB did not immediately follow the HDMI VSDB.\n"); if (cta.have_hf_scdb || cta.have_hf_vsdb) fail("Duplicate HDMI Forum VSDB/SCDB.\n"); if (length < 2) { data_block = std::string("HDMI Forum SCDB"); fail("Invalid length %u < 2.\n", length); - return; - } - if (x[1] || x[2]) - printf(" Non-zero SCDB reserved fields!\n"); - cta_hf_scdb(x + 3, length - 2); - cta.have_hf_scdb = 1; - return; - } - - hex_block(" ", x + 1, length); -} - -void edid_state::cta_block(const unsigned char *x, bool duplicate) -{ - unsigned length = x[0] & 0x1f; - const char *name; - unsigned oui; - bool reverse = false; - bool audio_block = false; - - switch ((x[0] & 0xe0) >> 5) { - case 0x01: - data_block = "Audio Data Block"; - printf(" %s:\n", data_block.c_str()); - cta_audio_block(x + 1, length); - audio_block = true; - break; - case 0x02: - data_block = "Video Data Block"; - printf(" %s:\n", data_block.c_str()); - cta_svd(x + 1, length, false); - break; - case 0x03: - oui = (x[3] << 16) + (x[2] << 8) + x[1]; - name = oui_name(oui); - if (!name) { - name = oui_name(oui, true); - if (name) - reverse = true; - } - if (!name) { - printf(" Vendor-Specific Data Block, OUI %s:\n", ouitohex(oui).c_str()); - hex_block(" ", x + 4, length - 3); - data_block.clear(); - warn("Unknown Vendor-Specific Data Block, OUI %s.\n", - ouitohex(oui).c_str()); - return; - } - data_block = std::string("Vendor-Specific Data Block (") + name + ")"; - if (reverse) - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str()); - printf(" %s, OUI %s:\n", data_block.c_str(), ouitohex(oui).c_str()); - if (oui == 0x000c03) { - cta_hdmi_block(x + 1, length); - cta.last_block_was_hdmi_vsdb = 1; - cta.first_block = 0; - // The HDMI OUI is present, so this EDID represents an HDMI - // interface. And HDMI interfaces must use EDID version 1.3 - // according to the HDMI Specification, so check for this. - if (base.edid_minor != 3) - fail("The HDMI Specification requires EDID 1.3 instead of 1.%u.\n", - base.edid_minor); - return; - } - if (oui == 0xc45dd8) { - if (!cta.last_block_was_hdmi_vsdb) - fail("HDMI Forum VSDB did not immediately follow the HDMI VSDB.\n"); - if (cta.have_hf_scdb || cta.have_hf_vsdb) - fail("Duplicate HDMI Forum VSDB/SCDB.\n"); - cta_hf_scdb(x + 4, length - 3); - cta.have_hf_vsdb = 1; - break; - } - if (oui == 0x00001a) { - cta_amd(x + 4, length - 3); - break; - } - if (oui == 0xca125c && length == 0x15) { - cta_microsoft(x + 4, length - 3); break; } - hex_block(" ", x + 4, length - 3); - break; - case 0x04: - data_block = "Speaker Allocation Data Block"; - printf(" %s:\n", data_block.c_str()); - cta_sadb(x + 1, length); - audio_block = true; - if (duplicate) - fail("Only one instance of this Data Block is allowed.\n"); - break; - case 0x05: - data_block = "VESA Display Transfer Characteristics Data Block"; - printf(" %s:\n", data_block.c_str()); - cta_vesa_dtcdb(x + 1, length); - if (duplicate) - fail("Only one instance of this Data Block is allowed.\n"); - break; - case 0x07: - cta_ext_block(x + 1, length - 1, duplicate); - break; - default: { - unsigned tag = (*x & 0xe0) >> 5; - unsigned length = *x & 0x1f; - - printf(" Unknown CTA-861 tag 0x%02x, length %u\n", tag, length); - hex_block(" ", x + 1, length); - data_block.clear(); - warn("Unknown CTA-861 Data Block %u.\n", tag); + if (x[0] || x[1]) + printf(" Non-zero SCDB reserved fields!\n"); + cta_hf_scdb(x + 2, length - 2); + cta.have_hf_scdb = true; break; +dohex: + default: + hex_block(" ", x, length); + warn("Unknown block type: %s.\n", data_block.c_str()); } - } - - // See Table 52 of CTA-861-G for a description of Byte 3 - if (audio_block && !(cta.byte3 & 0x40)) - fail("audio information is present, but bit 6 of Byte 3 of the CTA-861 Extension header indicates no Basic Audio support.\n"); - cta.first_block = 0; - cta.last_block_was_hdmi_vsdb = 0; + cta.block_number++; + cta.previous_cta_tag = tag; } void edid_state::preparse_cta_block(const unsigned char *x)@@ -2392,11 +2268,11 @@ void edid_state::parse_cta_block(const unsigned char *x) // msg(!cta.has_hdmi, "If YCbCr support is indicated, then both 4:2:2 and 4:4:4 %s be supported.\n", // cta.has_hdmi ? "shall" : "should"); printf(" Native detailed modes: %u\n", x[3] & 0x0f); - if (cta.first_block) + if (cta.block_number == 0) cta.byte3 = x[3]; else if (x[3] != cta.byte3) fail("Byte 3 must be the same for all CTA-861 Extension Blocks.\n"); - if (cta.first_block) { + if (cta.block_number == 0) { unsigned native_dtds = x[3] & 0x0f; cta.native_timings.clear();parse-displayid-block.cpp +222
-241@@ -1609,13 +1609,230 @@ void edid_state::preparse_displayid_block(const unsigned char *x) } } +#define data_block_o(n, a, b) data_block_oui(n, x + 3, len, tag == 0, &ouinum, a, b) + +unsigned edid_state::displayid_block(const unsigned version, const unsigned char *x, unsigned length) +{ + unsigned i; + unsigned tag = x[0]; + unsigned ouinum = 0; + unsigned len = (length < 3) ? 0 : x[2]; + + switch (tag) { + // DisplayID 1.3: + case 0x00: data_block_o("Product Identification Data Block (" + utohex(tag) + ")", true, false); ouinum = 0; break; + case 0x01: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break; + case 0x02: data_block = "Color Characteristics Data Block"; break; + case 0x03: data_block = "Video Timing Modes Type 1 - Detailed Timings Data Block"; break; + case 0x04: data_block = "Video Timing Modes Type 2 - Detailed Timings Data Block"; break; + case 0x05: data_block = "Video Timing Modes Type 3 - Short Timings Data Block"; break; + case 0x06: data_block = "Video Timing Modes Type 4 - DMT Timings Data Block"; break; + case 0x07: data_block = "Supported Timing Modes Type 1 - VESA DMT Timings Data Block"; break; + case 0x08: data_block = "Supported Timing Modes Type 2 - CTA-861 Timings Data Block"; break; + case 0x09: data_block = "Video Timing Range Data Block"; break; + case 0x0a: data_block = "Product Serial Number Data Block"; break; + case 0x0b: data_block = "GP ASCII String Data Block"; break; + case 0x0c: data_block = "Display Device Data Data Block"; break; + case 0x0d: data_block = "Interface Power Sequencing Data Block"; break; + case 0x0e: data_block = "Transfer Characteristics Data Block"; break; + case 0x0f: data_block = "Display Interface Data Block"; break; + case 0x10: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break; + case 0x11: data_block = "Video Timing Modes Type 5 - Short Timings Data Block"; break; + case 0x12: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break; + case 0x13: data_block = "Video Timing Modes Type 6 - Detailed Timings Data Block"; break; + // 0x14 .. 0x7e RESERVED for Additional VESA-defined Data Blocks + // DisplayID 2.0 + case 0x20: data_block_o("Product Identification Data Block (" + utohex(tag) + ")", false, false); ouinum = 0; break; + case 0x21: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break; + case 0x22: data_block = "Video Timing Modes Type 7 - Detailed Timings Data Block"; break; + case 0x23: data_block = "Video Timing Modes Type 8 - Enumerated Timing Codes Data Block"; break; + case 0x24: data_block = "Video Timing Modes Type 9 - Formula-based Timings Data Block"; break; + case 0x25: data_block = "Dynamic Video Timing Range Limits Data Block"; break; + case 0x26: data_block = "Display Interface Features Data Block"; break; + case 0x27: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break; + case 0x28: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break; + case 0x29: data_block = "ContainerID Data Block"; break; + case 0x32: data_block = "Video Timing Modes Type 10 - Formula-based Timings Data Block"; break; + // 0x2a .. 0x7d RESERVED for Additional VESA-defined Data Blocks + case 0x7e: data_block_o("Vendor-Specific Data Block (" + utohex(tag) + ")", false, true); break; // DisplayID 2.0 + case 0x7f: data_block_o("Vendor-Specific Data Block (" + utohex(tag) + ")", true, false); break; // DisplayID 1.3 + // 0x80 RESERVED + case 0x81: data_block = "CTA-861 DisplayID Data Block (" + utohex(tag) + ")"; break; + // 0x82 .. 0xff RESERVED + default: data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")"; break; + } + + if (version >= 0x20 && (tag < 0x20 || tag == 0x7f)) + fail("Use of DisplayID v1.x tag for DisplayID v%u.%u.\n", + version >> 4, version & 0xf); + if (version < 0x20 && tag >= 0x20 && tag <= 0x7e) + fail("Use of DisplayID v2.0 tag for DisplayID v%u.%u.\n", + version >> 4, version & 0xf); + + if (length < 3) { + // report a problem when the remaining bytes are not 0. + if (tag || (length > 1 && x[1])) { + fail("Not enough bytes remain (%d) for a DisplayID data block and the DisplayID filler is non-0.\n", length); + } + return length; + } + + unsigned block_rev = x[1] & 0x07; + + if (length < len + 3) { + fail("The length of this DisplayID data block (%d) exceeds the number of bytes remaining (%d)\n", len + 3, length); + return length; + } + + if (!tag && !len) { + // A Product Identification Data Block with no payload bytes is not valid - assume this is the end. + if (!memchk(x, length)) { + fail("Non-0 filler bytes in the DisplayID block.\n"); + } + return length; + } + + printf(" %s:\n", data_block.c_str()); + + tag |= ouinum; + switch (tag) { + case 0x00: parse_displayid_product_id(x); break; + case 0x01: parse_displayid_parameters(x); break; + case 0x02: parse_displayid_color_characteristics(x); break; + case 0x03: + check_displayid_datablock_revision(x[1], 0, block_rev & 1); + for (i = 0; i < len / 20; i++) + parse_displayid_type_1_7_timing(&x[3 + (i * 20)], false, block_rev); + break; + case 0x04: + check_displayid_datablock_revision(x[1]); + for (i = 0; i < len / 11; i++) + parse_displayid_type_2_timing(&x[3 + (i * 11)]); + break; + case 0x05: + check_displayid_datablock_revision(x[1], 0, block_rev & 1); + for (i = 0; i < len / 3; i++) + parse_displayid_type_3_timing(&x[3 + (i * 3)]); + break; + case 0x06: + check_displayid_datablock_revision(x[1], 0xc0, 1); + for (i = 0; i < len; i++) + parse_displayid_type_4_8_timing((x[1] & 0xc0) >> 6, x[3 + i]); + break; + case 0x07: + check_displayid_datablock_revision(x[1]); + for (i = 0; i < min(len, 10) * 8; i++) + if (x[3 + i / 8] & (1 << (i % 8))) { + char type[16]; + sprintf(type, "DMT 0x%02x", i + 1); + print_timings(" ", find_dmt_id(i + 1), type); + } + break; + case 0x08: + check_displayid_datablock_revision(x[1]); + for (i = 0; i < min(len, 8) * 8; i++) + if (x[3 + i / 8] & (1 << (i % 8))) { + char type[16]; + sprintf(type, "VIC %3u", i + 1); + print_timings(" ", find_vic_id(i + 1), type); + } + break; + case 0x09: parse_displayid_video_timing_range_limits(x); break; + case 0x0a: + case 0x0b: parse_displayid_string(x); break; + case 0x0c: parse_displayid_display_device(x); break; + case 0x0d: parse_displayid_intf_power_sequencing(x); break; + case 0x0e: parse_displayid_transfer_characteristics(x); break; + case 0x0f: parse_displayid_display_intf(x); break; + case 0x10: parse_displayid_stereo_display_intf(x); break; + case 0x11: + check_displayid_datablock_revision(x[1]); + for (i = 0; i < len / 7; i++) + parse_displayid_type_5_timing(&x[3 + (i * 7)]); + break; + case 0x12: parse_displayid_tiled_display_topology(x, false); break; + case 0x13: + check_displayid_datablock_revision(x[1]); + for (i = 0; i < len; i += (x[3 + i + 2] & 0x40) ? 17 : 14) + parse_displayid_type_6_timing(&x[3 + i]); + break; + case 0x20: parse_displayid_product_id(x); break; + case 0x21: + if (block_rev >= 1) + check_displayid_datablock_revision(x[1], 0x80, 1); + else + check_displayid_datablock_revision(x[1], 0x80, 0); + parse_displayid_parameters_v2(x, block_rev); + break; + case 0x22: { + unsigned sz = 20; + + if (block_rev >= 2) + check_displayid_datablock_revision(x[1], 0x08, 2); + else if (block_rev == 1) + check_displayid_datablock_revision(x[1], 0x08, 1); + else + check_displayid_datablock_revision(x[1]); + sz += (x[1] & 0x70) >> 4; + if (block_rev >= 1 && (x[1] & 0x08)) + printf(" These timings support DSC pass-through\n"); + for (i = 0; i < len / sz; i++) + parse_displayid_type_1_7_timing(&x[3 + i * sz], true, block_rev); + break; + } + case 0x23: + if (block_rev) + check_displayid_datablock_revision(x[1], 0xe8, 1); + else + check_displayid_datablock_revision(x[1], 0xc8); + if (x[1] & 0x08) { + for (i = 0; i < len / 2; i++) + parse_displayid_type_4_8_timing((x[1] & 0xc0) >> 6, + x[3 + i * 2] | + (x[4 + i * 2] << 8)); + } else { + for (i = 0; i < len; i++) + parse_displayid_type_4_8_timing((x[1] & 0xc0) >> 6, + x[3 + i]); + } + break; + case 0x24: + check_displayid_datablock_revision(x[1]); + for (i = 0; i < len / 6; i++) + parse_displayid_type_9_timing(&x[3 + i * 6]); + break; + case 0x25: parse_displayid_dynamic_video_timings_range_limits(x); break; + case 0x26: parse_displayid_interface_features(x); break; + case 0x27: parse_displayid_stereo_display_intf(x); break; + case 0x28: parse_displayid_tiled_display_topology(x, true); break; + case 0x29: parse_displayid_ContainerID(x); break; + case 0x32: { + unsigned sz = 6 + ((x[1] & 0x70) >> 4); + + check_displayid_datablock_revision(x[1], 0x70); + for (i = 0; i < len / sz; i++) + parse_displayid_type_10_timing(&x[3 + i * sz], sz); + break; + } + case 0x81: parse_displayid_cta_data_block(x); break; + case 0x7e|kOUI_VESA: parse_displayid_vesa(x); break; + default: hex_block(" ", x + 3 + (ouinum ? 3 : 0), len - (ouinum ? 3 : 0)); break; + } + + if ((tag == 0x00 || tag == 0x20) && + (!dispid.is_base_block || dispid.block_number > 0)) + fail("%s is required to be the first DisplayID Data Block.\n", + data_block.c_str()); + dispid.block_number++; + return len + 3; +} + void edid_state::parse_displayid_block(const unsigned char *x) { unsigned version = x[1]; unsigned length = x[2]; unsigned prod_type = x[3]; // future check: based on type, check for required data blocks unsigned ext_count = x[4]; - unsigned i; printf(" Version: %u.%u\n Extension Count: %u\n", version >> 4, version & 0xf, ext_count);@@ -1647,246 +1864,10 @@ void edid_state::parse_displayid_block(const unsigned char *x) length = 121; } - unsigned offset = 5; - bool first_data_block = true; - while (length > 0) { - unsigned tag = x[offset]; - unsigned oui = 0; - - switch (tag) { - // DisplayID 1.3: - case 0x00: data_block = "Product Identification Data Block (" + utohex(tag) + ")"; break; - case 0x01: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break; - case 0x02: data_block = "Color Characteristics Data Block"; break; - case 0x03: data_block = "Video Timing Modes Type 1 - Detailed Timings Data Block"; break; - case 0x04: data_block = "Video Timing Modes Type 2 - Detailed Timings Data Block"; break; - case 0x05: data_block = "Video Timing Modes Type 3 - Short Timings Data Block"; break; - case 0x06: data_block = "Video Timing Modes Type 4 - DMT Timings Data Block"; break; - case 0x07: data_block = "Supported Timing Modes Type 1 - VESA DMT Timings Data Block"; break; - case 0x08: data_block = "Supported Timing Modes Type 2 - CTA-861 Timings Data Block"; break; - case 0x09: data_block = "Video Timing Range Data Block"; break; - case 0x0a: data_block = "Product Serial Number Data Block"; break; - case 0x0b: data_block = "GP ASCII String Data Block"; break; - case 0x0c: data_block = "Display Device Data Data Block"; break; - case 0x0d: data_block = "Interface Power Sequencing Data Block"; break; - case 0x0e: data_block = "Transfer Characteristics Data Block"; break; - case 0x0f: data_block = "Display Interface Data Block"; break; - case 0x10: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break; - case 0x11: data_block = "Video Timing Modes Type 5 - Short Timings Data Block"; break; - case 0x12: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break; - case 0x13: data_block = "Video Timing Modes Type 6 - Detailed Timings Data Block"; break; - // 0x14 .. 0x7e RESERVED for Additional VESA-defined Data Blocks - // DisplayID 2.0 - case 0x20: data_block = "Product Identification Data Block (" + utohex(tag) + ")"; break; - case 0x21: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break; - case 0x22: data_block = "Video Timing Modes Type 7 - Detailed Timings Data Block"; break; - case 0x23: data_block = "Video Timing Modes Type 8 - Enumerated Timing Codes Data Block"; break; - case 0x24: data_block = "Video Timing Modes Type 9 - Formula-based Timings Data Block"; break; - case 0x25: data_block = "Dynamic Video Timing Range Limits Data Block"; break; - case 0x26: data_block = "Display Interface Features Data Block"; break; - case 0x27: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break; - case 0x28: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break; - case 0x29: data_block = "ContainerID Data Block"; break; - case 0x32: data_block = "Video Timing Modes Type 10 - Formula-based Timings Data Block"; break; - // 0x2a .. 0x7d RESERVED for Additional VESA-defined Data Blocks - case 0x7e: // DisplayID 2.0 - case 0x7f: // DisplayID 1.3 - if ((tag == 0x7e && version >= 0x20) || - (tag == 0x7f && version < 0x20)) { - oui = (x[offset + 3] << 16) + (x[offset + 4] << 8) + x[offset + 5]; - const char *name = oui_name(oui); - bool reversed = false; - - if (!name) { - name = oui_name(oui, true); - if (name) - reversed = true; - } - if (name) - data_block = std::string("Vendor-Specific Data Block (") + name + ")"; - else - data_block = "Vendor-Specific Data Block, OUI " + ouitohex(oui); - if (reversed) - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order.\n").c_str()); - } else { - data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")"; - } - break; - // 0x80 RESERVED - case 0x81: data_block = "CTA-861 DisplayID Data Block (" + utohex(tag) + ")"; break; - // 0x82 .. 0xff RESERVED - default: data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")"; break; - } - - if (version >= 0x20 && (tag < 0x20 || tag == 0x7f)) - fail("Use of DisplayID v1.x tag for DisplayID v%u.%u.\n", - version >> 4, version & 0xf); - if (version < 0x20 && tag >= 0x20 && tag <= 0x7e) - fail("Use of DisplayID v2.0 tag for DisplayID v%u.%u.\n", - version >> 4, version & 0xf); - - if (length < 3) { - // report a problem when the remaining bytes are not 0. - if (tag || x[offset + 1]) { - fail("Not enough bytes remain (%d) for a DisplayID data block or the DisplayID filler is non-0.\n", length); - } - break; - } - - unsigned block_rev = x[offset + 1] & 0x07; - unsigned len = x[offset + 2]; - - if (length < len + 3) { - fail("The length of this DisplayID data block (%d) exceeds the number of bytes remaining (%d).\n", len + 3, length); - break; - } - - if (!tag && !len) { - // A Product Identification Data Block with no payload bytes is not valid - assume this is the end. - if (!memchk(x + offset, length)) { - fail("Non-0 filler bytes in the DisplayID block.\n"); - } - break; - } - - printf(" %s:\n", data_block.c_str()); - - switch (tag) { - case 0x00: parse_displayid_product_id(x + offset); break; - case 0x01: parse_displayid_parameters(x + offset); break; - case 0x02: parse_displayid_color_characteristics(x + offset); break; - case 0x03: - check_displayid_datablock_revision(x[offset + 1], 0, block_rev & 1); - for (i = 0; i < len / 20; i++) - parse_displayid_type_1_7_timing(&x[offset + 3 + (i * 20)], false, block_rev); - break; - case 0x04: - check_displayid_datablock_revision(x[offset + 1]); - for (i = 0; i < len / 11; i++) - parse_displayid_type_2_timing(&x[offset + 3 + (i * 11)]); - break; - case 0x05: - check_displayid_datablock_revision(x[offset + 1], 0, block_rev & 1); - for (i = 0; i < len / 3; i++) - parse_displayid_type_3_timing(&x[offset + 3 + (i * 3)]); - break; - case 0x06: - check_displayid_datablock_revision(x[offset + 1], 0xc0, 1); - for (i = 0; i < len; i++) - parse_displayid_type_4_8_timing((x[offset + 1] & 0xc0) >> 6, x[offset + 3 + i]); - break; - case 0x07: - check_displayid_datablock_revision(x[offset + 1]); - for (i = 0; i < min(len, 10) * 8; i++) - if (x[offset + 3 + i / 8] & (1 << (i % 8))) { - char type[16]; - sprintf(type, "DMT 0x%02x", i + 1); - print_timings(" ", find_dmt_id(i + 1), type); - } - break; - case 0x08: - check_displayid_datablock_revision(x[offset + 1]); - for (i = 0; i < min(len, 8) * 8; i++) - if (x[offset + 3 + i / 8] & (1 << (i % 8))) { - char type[16]; - sprintf(type, "VIC %3u", i + 1); - print_timings(" ", find_vic_id(i + 1), type); - } - break; - case 0x09: parse_displayid_video_timing_range_limits(x + offset); break; - case 0x0a: - case 0x0b: parse_displayid_string(x + offset); break; - case 0x0c: parse_displayid_display_device(x + offset); break; - case 0x0d: parse_displayid_intf_power_sequencing(x + offset); break; - case 0x0e: parse_displayid_transfer_characteristics(x + offset); break; - case 0x0f: parse_displayid_display_intf(x + offset); break; - case 0x10: parse_displayid_stereo_display_intf(x + offset); break; - case 0x11: - check_displayid_datablock_revision(x[offset + 1]); - for (i = 0; i < len / 7; i++) - parse_displayid_type_5_timing(&x[offset + 3 + (i * 7)]); - break; - case 0x12: parse_displayid_tiled_display_topology(x + offset, false); break; - case 0x13: - check_displayid_datablock_revision(x[offset + 1]); - for (i = 0; i < len; i += (x[offset + 3 + i + 2] & 0x40) ? 17 : 14) - parse_displayid_type_6_timing(&x[offset + 3 + i]); - break; - case 0x20: parse_displayid_product_id(x + offset); break; - case 0x21: - if (block_rev >= 1) - check_displayid_datablock_revision(x[offset + 1], 0x80, 1); - else - check_displayid_datablock_revision(x[offset + 1], 0x80, 0); - parse_displayid_parameters_v2(x + offset, block_rev); - break; - case 0x22: { - unsigned sz = 20; - - if (block_rev >= 2) - check_displayid_datablock_revision(x[offset + 1], 0x08, 2); - else if (block_rev == 1) - check_displayid_datablock_revision(x[offset + 1], 0x08, 1); - else - check_displayid_datablock_revision(x[offset + 1]); - sz += (x[offset + 1] & 0x70) >> 4; - if (block_rev >= 1 && (x[offset + 1] & 0x08)) - printf(" These timings support DSC pass-through\n"); - for (i = 0; i < len / sz; i++) - parse_displayid_type_1_7_timing(&x[offset + 3 + i * sz], true, block_rev); - break; - } - case 0x23: - if (block_rev) - check_displayid_datablock_revision(x[offset + 1], 0xe8, 1); - else - check_displayid_datablock_revision(x[offset + 1], 0xc8); - if (x[offset + 1] & 0x08) { - for (i = 0; i < len / 2; i++) - parse_displayid_type_4_8_timing((x[offset + 1] & 0xc0) >> 6, - x[offset + 3 + i * 2] | - (x[offset + 4 + i * 2] << 8)); - } else { - for (i = 0; i < len; i++) - parse_displayid_type_4_8_timing((x[offset + 1] & 0xc0) >> 6, - x[offset + 3 + i]); - } - break; - case 0x24: - check_displayid_datablock_revision(x[offset + 1]); - for (i = 0; i < len / 6; i++) - parse_displayid_type_9_timing(&x[offset + 3 + i * 6]); - break; - case 0x25: parse_displayid_dynamic_video_timings_range_limits(x + offset); break; - case 0x26: parse_displayid_interface_features(x + offset); break; - case 0x27: parse_displayid_stereo_display_intf(x + offset); break; - case 0x28: parse_displayid_tiled_display_topology(x + offset, true); break; - case 0x29: parse_displayid_ContainerID(x + offset); break; - case 0x32: { - unsigned sz = 6 + ((x[offset + 1] & 0x70) >> 4); - - check_displayid_datablock_revision(x[offset + 1], 0x70); - for (i = 0; i < len / sz; i++) - parse_displayid_type_10_timing(&x[offset + 3 + i * sz], sz); - break; - } - case 0x81: parse_displayid_cta_data_block(x + offset); break; - case 0x7e: - if (oui == 0x3a0292) { - parse_displayid_vesa(x + offset); - break; - } - // fall-through - default: hex_block(" ", x + offset + 3, len); break; - } - - if ((tag == 0x00 || tag == 0x20) && - (!dispid.is_base_block || !first_data_block)) - fail("%s is required to be the first DisplayID Data Block.\n", - data_block.c_str()); - length -= len + 3; - offset += len + 3; - first_data_block = false; + unsigned len; + for (const unsigned char *y = x + 5; length > 0; y += len) { + len = displayid_block(version, y, length); + length -= len; } /*
Re: [PATCH 11/11] edid-decode: cta and displayid changes
1) Regarding large changes:
I will try making smaller changes with commits that build on each other. Git is good for code changes but not for code moving/rearranging. Many of the changes don't actually change anything (wanting to keep the output the same as before). Some fixes are easier to apply after doing the rearranging so I'll think about what order to make each change.
2) Regarding code reduction:
The code reduction for cta tag parsing (288 lines originally) is 43%. Not insignificant.
The code reduction for displayid tag parsing (241 lines originally) is 8% which is not as much (no extended tags and only one oui), but it's nice that it's arranged like cta tag parsing.
3) Regarding ugly lines:
The ugly lines were because of hex_block issues discussed in [PATCH 07/11]. What you should see (when hex_block is working properly) is something like this:
Unknown CTA-861 Data Block (tag 0x00):
WARN: Unknown block type: Unknown CTA-861 Data Block (tag 0x00).
The warning is "Unknown block type: %s\n" where %s is the block type which is determined in the first switch statement.
Here's an example from _EDID_BNQ_802e with non-zero length hex:
Before patches:
Unknown CTA-861 tag 0x00, length 5
c0 00 e6 06 05 '.....'
WARN: Unknown CTA-861 Data Block 0.
Length is unnecessary since you can just count the hex bytes. Block 0 sounds like it's referring to block index 0 instead of block tag 0x00. After all patches:
Unknown CTA-861 Data Block (tag 0x00):
c0 00 e6 06 05 '.....'
WARN: Unknown block type: Unknown CTA-861 Data Block (tag 0x00).
With these changes, we have a consistent naming scheme for the block type (having " Data Block" suffix and adding tag in cases where the name is not enough to determine the tag) and the warning refers to that block type. Might be better if the warning comes after the block type instead of after the hex.
4) Regarding the NVIDIA oui:
You are saying that only blocks with an invalid tag should have the unknown block type warning. Not knowing how to parse a tag/oui should not be the cause of a warning. I can agree with that. If the user sees only hex then they know that edid-decode doesn't know how to decode it.
On 2021-09-15, 6:37 AM, "Hans Verkuil" <[email protected]> wrote:
On 14/09/2021 14:11, joevt wrote:
> Goal: make OUI blocks equal to normal blocks to simplify decoding and make handling of all types of blocks consistent. This will reduce duplicated code (only one place for checking duplicate blocks, only one place for handling unknown blocks, etc.)
>
> oui.h
> - This contains a list of OUI and CID and PNP values.
> - It is included in various places with varying definitions of the oneoui macro.
>
> edid-decode.h
> - Add list of OUI constants using oui.h.
> - Other changes described below.
>
> parse-cta-block.cpp
> - Modified oui_name. Returns a name and a number for a OUI.
> - Added data_block_oui. For data blocks with an OUI, does size check, OUI endianness check, and PNP vs OUI check. Returns a value representing the OUI (if it is known).
> - Modify cta_block. Reduce code by flattening the switch statement. This means constructing a case value from three values.
> Side effects include making reporting of "Only one instance of this Data Block is allowed." more consistant (always report this fail after the block type is output instead of sometimes before and sometimes after). See example acer-xv273k-dp2-corrupted.
> First, get the extended type and append it to the tag type (i.e. add 0x700 if extended), then get the OUI if it's vendor specific, and convert it to a number that can be appended (bitwise or) to the tag/extended type value.
> - Init static variables
> - Replace last_block_was_hdmi_vsdb with previous_cta_tag; this means instead of remembering if the last block was hdmi vsdb, we just remember the previous block's tag.
> - Replace first_block with cta_block_number; this means instead of remembering if this is the first block or not, we just remember the current block number.
> - Remove name and oui, we'll just get the data_block string and a oui index directly.
> - Report OUI for extended tag 11h (Vendor-Specific Audio Data Block)
> - Fix capitalization of "Audio information is present" fail message.
> - Add bounds check on length field (must be at least 1 for extended tags).
> - Don't parse after OUI if there's not enough length for OUI.
> - Adjust x offsets in cta_hdmi_block so it is like other OUI extended blocks such that x points to after the OUI.
> - A block that outputs only hex is reported as an unknown block type even if we know the OUI. See example acer-xb321hk-dp.
>
> parse-disableid-block.cpp
> - Add displayid_block to do a single data block - like cta_block does for cta extension block
> - Vendor specific data block for DisplayID 1.3 is assumed to be PNP (string order). See example apple-macbookpro-16inch-2019.
> - Vendor specific data block for DisplayID 2.0 is assumed to have OUI (little endian).
> - Interpret Vendor specific data block 0x7e or 0x7f even if DisplayID is not correct for that type (there's already a FAIL message to identify the problem). See example apple-xdr-6k.
> - Add bounds check: if length is < 3, only check x[1] if length is 2.
> Don't report "Not enough bytes remain (1) for a DisplayID data block or the DisplayID filler is non-0." if the bytes are zero (also change the word "or" to "and"). See example apple-xdr-6k-tile0.
> - Report datablock name before failing.
> - For unknown vendor specific data blocks, don't output the OUI part as hex since the new data_block_oui function has already reported it. See example apple-macbookpro-16inch-2019.
> - Replace first_data_block with disp.block_number
I've decided not to merge this patch. It does too many things at the same time,
so it really should be split up into smaller pieces.
I'm also getting ugly lines like this:
Unknown CTA-861 Data Block (tag 0x00): Unknown block type: Unknown CTA-861 Data Block (tag 0x00).
or this:
Vendor-Specific Data Block (NVIDIA), OUI 00-04-4B: Unknown block type: Vendor-Specific Data Block (NVIDIA),
OUI 00-04-4B.
(which shouldn't be a warning anyway)
>
> Signed-off-by: Joe van Tunen <[email protected]>
> ---
> edid-decode.cpp | 99 ++++++--
> edid-decode.h | 20 +-
> oui.h | 20 ++
> parse-cta-block.cpp | 456 ++++++++++++++-----------------------
> parse-displayid-block.cpp | 463 ++++++++++++++++++--------------------
> 5 files changed, 505 insertions(+), 553 deletions(-)
While it does reduce the code size a bit, it really isn't by all that much,
so I am not convinced that all the churn is worth it.
If this is split up into first fixes and small improvements, and then rework
the tag handling, then I can take another look at whether it makes sense to
apply this.
I've applied patches 1, 2, 3, 4, 6, 8, 9 and 10. The others need more work.
Regards,
Hans
> create mode 100644 oui.h
>
> diff --git a/edid-decode.cpp b/edid-decode.cpp
> index 0c83e0e..ed3223d 100644
> --- a/edid-decode.cpp
> +++ b/edid-decode.cpp
> @@ -657,25 +657,90 @@ std::string utohex(unsigned char x)
> return buf;
> }
>
> -const char *oui_name(unsigned oui, bool reverse)
> +const char *oui_name(unsigned oui, unsigned *ouinum)
> {
> - if (reverse)
> - oui = (oui >> 16) | (oui & 0xff00) | ((oui & 0xff) << 16);
> -
> + unsigned ouinumscratch;
> + if (!ouinum) ouinum = &ouinumscratch;
> + const char *name;
> switch (oui) {
> - case 0x00001a: return "AMD";
> - case 0x000c03: return "HDMI";
> - case 0x00044b: return "NVIDIA";
> - case 0x000c6e: return "ASUS";
> - case 0x0010fa: return "Apple";
> - case 0x0014b9: return "MSTAR";
> - case 0x00d046: return "Dolby";
> - case 0x00e047: return "InFocus";
> - case 0x3a0292: return "VESA";
> - case 0x90848b: return "HDR10+";
> - case 0xc45dd8: return "HDMI Forum";
> - case 0xca125c: return "Microsoft";
> - default: return NULL;
> + #define oneoui(c,k,n) case c: *ouinum = kOUI_##k; name = n; break;
> + #include "oui.h"
> + default: *ouinum = 0; name = NULL;
> + }
> + return name;
> +}
> +
> +void edid_state::data_block_oui(std::string block_name, const unsigned char *x, unsigned length, bool ignorezeros, unsigned *ouinum, bool do_ascii, bool big_endian)
> +{
> + std::string buf;
> + char ascii[4];
> + unsigned oui;
> + const char *ouiname = NULL;
> + bool matched_reverse = false;
> + bool matched_ascii = false;
> + bool valid_ascii = false;
> +
> + if (big_endian)
> + oui = ((length > 0 ? x[0] : 0) << 16) + ((length > 1 ? x[1] : 0) << 8) + (length > 2 ? x[2] : 0);
> + else
> + oui = ((length > 2 ? x[2] : 0) << 16) + ((length > 1 ? x[1] : 0) << 8) + (length > 0 ? x[0] : 0);
> +
> + buf = ouitohex(oui);
> + if (length < 3) {
> + sprintf(ascii, "?"); // some characters are null
> + if (ouinum) *ouinum = 0; // doesn't match a known OUI
> + } else {
> + valid_ascii = (x[0] >= 'A' && x[1] >= 'A' && x[2] >= 'A' && x[0] <= 'Z' && x[1] <= 'Z' && x[2] <= 'Z');
> + sprintf(ascii, "%c%c%c", x[0], x[1], x[2]);
> +
> + ouiname = oui_name(oui, ouinum);
> + if (!ouiname) {
> + big_endian = !big_endian;
> + unsigned reversedoui = ((oui & 0xff) << 16) + (oui & 0x00ff00) + (oui >> 16);
> + ouiname = oui_name(reversedoui, ouinum);
> + if (ouiname) {
> + oui = reversedoui;
> + buf = ouitohex(oui);
> + matched_reverse = true;
> + }
> + else if (do_ascii && valid_ascii)
> + {
> + unsigned asciioui = (x[0] << 24) + (x[1] << 16) + (x[2] << 8);
> + ouiname = oui_name(asciioui, ouinum);
> + if (ouiname) {
> + matched_ascii = true;
> + }
> + }
> + }
> + }
> +
> + std::string name;
> + if (ouiname) {
> + if (matched_ascii)
> + name = block_name + " (" + ouiname + ")" + ", PNP ID '" + ascii + "'";
> + else
> + name = block_name + " (" + ouiname + ")" + ", OUI " + buf;
> + } else if (do_ascii && valid_ascii) {
> + name = block_name + ", PNP ID '" + ascii + "'";
> + } else {
> + name = block_name + ", OUI " + buf;
> + }
> + // assign string to data_block before outputting errors
> + data_block = name;
> +
> + if (oui || !ignorezeros) {
> + if (length < 3)
> + fail("Data block length is not enough to contain an OUI.\n");
> + if (ouiname && do_ascii && !valid_ascii)
> + warn("Expected PNP ID but found OUI.\n");
> + if (ouiname && matched_reverse)
> + warn("Endian-ness (%s) of OUI is different than expected (%s).\n", big_endian ? "be" : "le", big_endian ? "le" : "be");
> + if (!ouiname) {
> + if (valid_ascii)
> + warn("Unknown OUI %s (possible PNP %s).\n", buf.c_str(), ascii);
> + else
> + warn("Unknown OUI %s.\n", buf.c_str());
> + }
> }
> }
>
> diff --git a/edid-decode.h b/edid-decode.h
> index 612d22a..9e6a955 100644
> --- a/edid-decode.h
> +++ b/edid-decode.h
> @@ -153,8 +153,10 @@ struct edid_state {
> // CTA-861 block state
> cta.has_vic_1 = cta.first_svd_might_be_preferred = cta.has_sldb =
> cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = false;
> - cta.last_block_was_hdmi_vsdb = cta.have_hf_vsdb = cta.have_hf_scdb = false;
> - cta.first_block = cta.first_svd = true;
> + cta.have_hf_vsdb = cta.have_hf_scdb = false;
> + cta.previous_cta_tag = 0xfff;
> + cta.block_number = 0;
> + cta.first_svd = true;
> cta.supported_hdmi_vic_codes = cta.supported_hdmi_vic_vsb_codes = 0;
> memset(cta.vics, 0, sizeof(cta.vics));
> memset(cta.preparsed_has_vic, 0, sizeof(cta.preparsed_has_vic));
> @@ -175,6 +177,7 @@ struct edid_state {
> dispid.is_display = dispid.has_product_identification =
> dispid.has_display_parameters = dispid.has_type_1_7 =
> dispid.has_display_interface_features = false;
> + dispid.block_number = 0;
>
> // Block Map block state
> block_map.saw_block_1 = false;
> @@ -257,9 +260,9 @@ struct edid_state {
> bool preparsed_sld;
> bool has_sldb;
> unsigned short preparsed_phys_addr;
> - bool last_block_was_hdmi_vsdb;
> + unsigned previous_cta_tag;
> bool have_hf_vsdb, have_hf_scdb;
> - bool first_block;
> + unsigned block_number;
> bool first_svd;
> unsigned supported_hdmi_vic_codes;
> unsigned supported_hdmi_vic_vsb_codes;
> @@ -282,6 +285,7 @@ struct edid_state {
> bool has_display_interface_features;
> vec_timings_ext preferred_timings;
> unsigned native_width, native_height;
> + unsigned block_number;
> // Keep track of the found CTA-861 Tag/Extended Tag pairs.
> // The unsigned value is equal to: (tag << 8) | ext_tag
> std::set<unsigned> found_tags;
> @@ -331,6 +335,8 @@ struct edid_state {
> void list_dmts();
> void list_established_timings();
>
> + void data_block_oui(std::string block_name, const unsigned char *x, unsigned length, bool ignorezeros, unsigned *ouinum, bool do_ascii = false, bool big_endian = false);
> +
> void print_vic_index(const char *prefix, unsigned idx, const char *suffix, bool ycbcr420 = false);
> void hdmi_latency(unsigned char vid_lat, unsigned char aud_lat, bool is_ilaced);
> void cta_vcdb(const unsigned char *x, unsigned length);
> @@ -390,6 +396,7 @@ struct edid_state {
> void parse_displayid_type_10_timing(const unsigned char *x, unsigned sz,
> bool is_cta = false);
> void preparse_displayid_block(const unsigned char *x);
> + unsigned displayid_block(const unsigned version, const unsigned char *x, unsigned length);
> void parse_displayid_block(const unsigned char *x);
> void parse_displayid_vesa(const unsigned char *x);
> void parse_displayid_cta_data_block(const unsigned char *x);
> @@ -454,7 +461,7 @@ void hex_block(const char *prefix, const unsigned char *x, unsigned length,
> bool show_ascii = true, unsigned step = 16);
> std::string block_name(unsigned char block);
> void calc_ratio(struct timings *t);
> -const char *oui_name(unsigned oui, bool reverse = false);
> +const char *oui_name(unsigned oui, unsigned *ouinum = NULL);
>
> bool timings_close_match(const timings &t1, const timings &t2);
> const struct timings *find_dmt_id(unsigned char dmt_id);
> @@ -465,4 +472,7 @@ const struct timings *cta_close_match_to_vic(const timings &t, unsigned &vic);
> unsigned char hdmi_vic_to_vic(unsigned char hdmi_vic);
> char *extract_string(const unsigned char *x, unsigned len);
>
> +#define oneoui(c,k,n) const unsigned kOUI_##k = __LINE__<<12;
> +#include "oui.h"
> +
> #endif
> diff --git a/oui.h b/oui.h
> new file mode 100644
> index 0000000..c90f025
> --- /dev/null
> +++ b/oui.h
> @@ -0,0 +1,20 @@
> +// http://standards-oui.ieee.org/oui/oui.txt
> +oneoui(0x000c03, HDMI, "HDMI" )
> +oneoui(0xc45dd8, HDMIForum, "HDMI Forum" )
> +oneoui(0x90848b, HDR10, "HDR10+" )
> +oneoui(0x00001a, AMD, "AMD" )
> +oneoui(0x00044b, NVIDIA, "NVIDIA" )
> +oneoui(0x000c6e, ASUS, "ASUS" )
> +oneoui(0x0010fa, Apple, "Apple" )
> +oneoui(0x0014b9, MSTAR, "MSTAR" )
> +oneoui(0x00d046, Dolby, "Dolby" )
> +oneoui(0x00e047, InFocus, "InFocus" )
> +oneoui(0xca125c, Microsoft, "Microsoft" )
> +
> +// http://standards-oui.ieee.org/cid/cid.txt
> +oneoui(0x3a0292, VESA, "VESA" )
> +
> +// https://uefi.org/pnp_id_list
> +oneoui('APP\0' , asciiApple, "Apple" )
> +
> +#undef oneoui
> diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
> index 4edaa1d..9bc0c77 100644
> --- a/parse-cta-block.cpp
> +++ b/parse-cta-block.cpp
> @@ -652,57 +652,57 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
> {
> unsigned len_vic, len_3d;
>
> - if (length < 4) {
> - fail("Empty Data Block with length %u.\n", length);
> + if (length < 1) {
> + fail("Empty Data Block.\n");
> return;
> }
> - printf(" Source physical address: %x.%x.%x.%x\n", x[3] >> 4, x[3] & 0x0f,
> - x[4] >> 4, x[4] & 0x0f);
> + printf(" Source physical address: %x.%x.%x.%x\n", x[0] >> 4, x[0] & 0x0f,
> + x[1] >> 4, x[1] & 0x0f);
>
> - if (length < 6)
> + if (length < 3)
> return;
>
> - if (x[5] & 0x80)
> + if (x[2] & 0x80)
> printf(" Supports_AI\n");
> - if (x[5] & 0x40)
> + if (x[2] & 0x40)
> printf(" DC_48bit\n");
> - if (x[5] & 0x20)
> + if (x[2] & 0x20)
> printf(" DC_36bit\n");
> - if (x[5] & 0x10)
> + if (x[2] & 0x10)
> printf(" DC_30bit\n");
> - if (x[5] & 0x08)
> + if (x[2] & 0x08)
> printf(" DC_Y444\n");
> /* two reserved bits */
> - if (x[5] & 0x01)
> + if (x[2] & 0x01)
> printf(" DVI_Dual\n");
>
> - if (length < 7)
> + if (length < 4)
> return;
>
> - printf(" Maximum TMDS clock: %u MHz\n", x[6] * 5);
> - if (x[6] * 5 > 340)
> + printf(" Maximum TMDS clock: %u MHz\n", x[3] * 5);
> + if (x[3] * 5 > 340)
> fail("HDMI VSDB Max TMDS rate is > 340.\n");
>
> - if (length < 8)
> + if (length < 5)
> return;
>
> - if (x[7] & 0x0f) {
> + if (x[4] & 0x0f) {
> printf(" Supported Content Types:\n");
> - if (x[7] & 0x01)
> + if (x[4] & 0x01)
> printf(" Graphics\n");
> - if (x[7] & 0x02)
> + if (x[4] & 0x02)
> printf(" Photo\n");
> - if (x[7] & 0x04)
> + if (x[4] & 0x04)
> printf(" Cinema\n");
> - if (x[7] & 0x08)
> + if (x[4] & 0x08)
> printf(" Game\n");
> }
>
> - unsigned b = 8;
> - if (x[7] & 0x80) {
> + unsigned b = 5;
> + if (x[4] & 0x80) {
> hdmi_latency(x[b], x[b + 1], false);
>
> - if (x[7] & 0x40) {
> + if (x[4] & 0x40) {
> if (x[b] == x[b + 2] &&
> x[b + 1] == x[b + 3])
> warn("Progressive and Interlaced latency values are identical, no need for both.\n");
> @@ -712,7 +712,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
> b += 2;
> }
>
> - if (!(x[7] & 0x20))
> + if (!(x[4] & 0x20))
> return;
>
> bool mask = false;
> @@ -1990,293 +1990,169 @@ static void cta_hdmi_audio_block(const unsigned char *x, unsigned length)
> }
> }
>
> -void edid_state::cta_ext_block(const unsigned char *x, unsigned length,
> - bool duplicate)
> +#define data_block_o(n) do { data_block_oui(n, x, length, false, &ouinum); if (length < 3) return; length -= 3; x += 3; } while(0)
> +
> +void edid_state::cta_block(const unsigned char *x, bool duplicate)
> {
> - const char *name;
> - unsigned oui;
> - bool reverse = false;
> + unsigned length = x[0] & 0x1f; // number of bytes after the tag/length byte
> + unsigned ouinum = 0;
> + unsigned tag=(x[0] & 0xe0) >> 5;
> + unsigned extended = (tag == 0x07) ? 1 : 0;
> + x++;
> + if (extended) {
> + if (!length) {
> + fail("Extended tag cannot have length 0.\n");
> + return;
> + }
> + length--;
> + tag = 0x700 + x[0];
> + x++;
> + }
> +
> bool audio_block = false;
>
> - switch (x[0]) {
> - case 0x00: data_block = "Video Capability Data Block"; break;
> - case 0x01: data_block.clear(); break;
> - case 0x02: data_block = "VESA Video Display Device Data Block"; break;
> - case 0x03: data_block = "VESA Video Timing Block Extension"; break;
> - case 0x04: data_block = "Reserved for HDMI Video Data Block"; break;
> - case 0x05: data_block = "Colorimetry Data Block"; break;
> - case 0x06: data_block = "HDR Static Metadata Data Block"; break;
> - case 0x07: data_block = "HDR Dynamic Metadata Data Block"; break;
> -
> - case 0x0d: data_block = "Video Format Preference Data Block"; break;
> - case 0x0e: data_block = "YCbCr 4:2:0 Video Data Block"; break;
> - case 0x0f: data_block = "YCbCr 4:2:0 Capability Map Data Block"; break;
> - case 0x10: data_block = "Reserved for CTA-861 Miscellaneous Audio Fields"; break;
> - case 0x11: data_block.clear(); audio_block = true; break;
> - case 0x12: data_block = "HDMI Audio Data Block"; audio_block = true; break;
> - case 0x13: data_block = "Room Configuration Data Block"; audio_block = true; break;
> - case 0x14: data_block = "Speaker Location Data Block"; audio_block = true; break;
> -
> - case 0x20: data_block = "InfoFrame Data Block"; break;
> -
> - case 0x34: data_block = "DisplayID Type VII Video Timing Data Block"; break;
> - case 0x35: data_block = "DisplayID Type VIII Video Timing Data Block"; break;
> - case 0x42: data_block = "DisplayID Type X Video Timing Data Block"; break;
> -
> - case 0x78: data_block = "HDMI Forum EDID Extension Override Data Block"; break;
> - case 0x79: data_block = "HDMI Forum Sink Capability Data Block"; break;
> + switch (tag) {
> + case 0x001: data_block = "Audio Data Block"; audio_block = true; break;
> + case 0x002: data_block = "Video Data Block"; break;
> + case 0x003: data_block_o("Vendor-Specific Data Block"); break;
> + case 0x004: data_block = "Speaker Allocation Data Block"; audio_block = true; break;
> + case 0x005: data_block = "VESA Display Transfer Characteristics Data Block"; break;
> +
> + case 0x700: data_block = "Video Capability Data Block"; break;
> + case 0x701: data_block_o("Vendor-Specific Video Data Block"); break;
> + case 0x702: data_block = "VESA Video Display Device Data Block"; break;
> + case 0x703: data_block = "VESA Video Timing Block Extension"; break; // not implemented
> + case 0x704: data_block = "Reserved for HDMI Video Data Block"; break; // reserved
> + case 0x705: data_block = "Colorimetry Data Block"; break;
> + case 0x706: data_block = "HDR Static Metadata Data Block"; break;
> + case 0x707: data_block = "HDR Dynamic Metadata Data Block"; break;
> +
> + case 0x70d: data_block = "Video Format Preference Data Block"; break;
> + case 0x70e: data_block = "YCbCr 4:2:0 Video Data Block"; break;
> + case 0x70f: data_block = "YCbCr 4:2:0 Capability Map Data Block"; break;
> + case 0x710: data_block = "Reserved for CTA-861 Miscellaneous Audio Fields"; break; // reserved
> + case 0x711: data_block_o("Vendor-Specific Audio Data Block"); audio_block = true; break; // no vendors implemented
> + case 0x712: data_block = "HDMI Audio Data Block"; audio_block = true; break;
> + case 0x713: data_block = "Room Configuration Data Block"; audio_block = true; break;
> + case 0x714: data_block = "Speaker Location Data Block"; audio_block = true; break;
> +
> + case 0x720: data_block = "InfoFrame Data Block"; break;
> +
> + case 0x734: data_block = "DisplayID Type VII Video Timing Data Block"; break;
> + case 0x735: data_block = "DisplayID Type VIII Video Timing Data Block"; break;
> + case 0x742: data_block = "DisplayID Type X Video Timing Data Block"; break;
> +
> + case 0x778: data_block = "HDMI Forum EDID Extension Override Data Block"; break;
> + case 0x779: data_block = "HDMI Forum Sink Capability Data Block"; break;
> default:
> - if (x[0] <= 12)
> - printf(" Unknown CTA-861 Video-Related");
> - else if (x[0] <= 31)
> - printf(" Unknown CTA-861 Audio-Related");
> - else if (x[0] >= 120 && x[0] <= 127)
> - printf(" Unknown CTA-861 HDMI-Related");
> - else
> - printf(" Unknown CTA-861");
> - printf(" Data Block (extended tag 0x%02x, length %u)\n", x[0], length);
> - hex_block(" ", x + 1, length);
> - data_block.clear();
> - warn("Unknown Extended CTA-861 Data Block 0x%02x.\n", x[0]);
> - return;
> - }
> -
> - switch (x[0]) {
> - case 0x00:
> - case 0x02:
> - case 0x05:
> - case 0x06:
> - case 0x0d:
> - case 0x0f:
> - case 0x12:
> - case 0x13:
> - case 0x78:
> - case 0x79:
> + if (tag < 0x700) data_block = "Unknown CTA-861 Data Block";
> + else if (tag < 0x70d) data_block = "Unknown CTA-861 Video-Related Data Block";
> + else if (tag < 0x720) data_block = "Unknown CTA-861 Audio-Related Data Block";
> + else if (tag < 0x778) data_block = "Unknown CTA-861 Data Block";
> + else if (tag < 0x780) data_block = "Unknown CTA-861 HDMI-Related Data Block";
> + else data_block = "Unknown CTA-861 Data Block";
> + data_block += std::string(" (") + (extended ? "extended " : "") + "tag " + utohex(tag & 0xff) + ")";
> + }
> +
> + printf(" %s:\n", data_block.c_str());
> +
> + switch (tag) {
> + case 0x004:
> + case 0x005:
> + case 0x700:
> + case 0x702:
> + case 0x705:
> + case 0x706:
> + case 0x70d:
> + case 0x70f:
> + case 0x712:
> + case 0x713:
> + case 0x778:
> + case 0x779:
> if (duplicate)
> fail("Only one instance of this Data Block is allowed.\n");
> - break;
> }
>
> -
> // See Table 52 of CTA-861-G for a description of Byte 3
> if (audio_block && !(cta.byte3 & 0x40))
> - fail("audio information is present, but bit 6 of Byte 3 of the CTA-861 Extension header indicates no Basic Audio support.\n");
> -
> - if (data_block.length())
> - printf(" %s:\n", data_block.c_str());
> -
> - switch (x[0]) {
> - case 0x00: cta_vcdb(x + 1, length); return;
> - case 0x01:
> - if (length < 3) {
> - data_block = std::string("Vendor-Specific Video Data Block");
> - fail("Invalid length %u < 3.\n", length);
> - return;
> - }
> - oui = (x[3] << 16) + (x[2] << 8) + x[1];
> - name = oui_name(oui);
> - if (!name) {
> - name = oui_name(oui, true);
> - if (name)
> - reverse = true;
> - }
> - if (!name) {
> - printf(" Vendor-Specific Video Data Block, OUI %s:\n",
> - ouitohex(oui).c_str());
> - hex_block(" ", x + 4, length - 3);
> - data_block.clear();
> - warn("Unknown Extended Vendor-Specific Video Data Block, OUI %s.\n",
> - ouitohex(oui).c_str());
> - return;
> - }
> - data_block = std::string("Vendor-Specific Video Data Block (") + name + ")";
> - if (reverse)
> - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str());
> - printf(" %s, OUI %s:\n", data_block.c_str(), ouitohex(oui).c_str());
> - if (oui == 0x90848b)
> - cta_hdr10plus(x + 4, length - 3);
> - else if (oui == 0x00d046)
> - cta_dolby_video(x + 4, length - 3);
> - else
> - hex_block(" ", x + 4, length - 3);
> - return;
> - case 0x02: cta_vesa_vdddb(x + 1, length); return;
> - case 0x05: cta_colorimetry_block(x + 1, length); return;
> - case 0x06: cta_hdr_static_metadata_block(x + 1, length); return;
> - case 0x07: cta_hdr_dyn_metadata_block(x + 1, length); return;
> - case 0x0d: cta_vfpdb(x + 1, length); return;
> - case 0x0e: cta_svd(x + 1, length, true); return;
> - case 0x0f: cta_y420cmdb(x + 1, length); return;
> - case 0x11:
> - if (length < 3) {
> - data_block = std::string("Vendor-Specific Audio Data Block");
> - fail("Invalid length %u < 3.\n", length);
> - return;
> - }
> - oui = (x[3] << 16) + (x[2] << 8) + x[1];
> - name = oui_name(oui);
> - if (!name) {
> - name = oui_name(oui, true);
> - if (name)
> - reverse = true;
> - }
> - if (!name) {
> - printf(" Vendor-Specific Audio Data Block, OUI %s:\n",
> - ouitohex(oui).c_str());
> - hex_block(" ", x + 4, length - 3);
> - data_block.clear();
> - warn("Unknown Extended Vendor-Specific Audio Data Block, OUI %s.\n",
> - ouitohex(oui).c_str());
> - return;
> - }
> - data_block = std::string("Vendor-Specific Audio Data Block (") + name + ")";
> - if (reverse)
> - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str());
> - printf(" %s, OUI %s:\n", data_block.c_str(), ouitohex(oui).c_str());
> - if (oui == 0x00d046)
> - cta_dolby_audio(x + 4, length - 3);
> + fail("Audio information is present, but bit 6 of Byte 3 of the CTA-861 Extension header indicates no Basic Audio support.\n");
> +
> + tag |= ouinum;
> + switch (tag) {
> + case 0x001: cta_audio_block(x, length); break;
> + case 0x002: cta_svd(x, length, false); break;
> + case 0x003|kOUI_HDMI:
> + cta_hdmi_block(x, length);
> + // The HDMI OUI is present, so this EDID represents an HDMI
> + // interface. And HDMI interfaces must use EDID version 1.3
> + // according to the HDMI Specification, so check for this.
> + if (base.edid_minor != 3)
> + fail("The HDMI Specification requires EDID 1.3 instead of 1.%u.\n",
> + base.edid_minor);
> + break;
> + case 0x003|kOUI_HDMIForum:
> + if (cta.previous_cta_tag != (0x003|kOUI_HDMI))
> + fail("HDMI Forum VSDB did not immediately follow the HDMI VSDB.\n");
> + if (cta.have_hf_scdb || cta.have_hf_vsdb)
> + fail("Duplicate HDMI Forum VSDB/SCDB.\n");
> + cta_hf_scdb(x, length);
> + cta.have_hf_vsdb = true;
> + break;
> + case 0x003|kOUI_AMD: cta_amd(x, length); break;
> + case 0x003|kOUI_Microsoft:
> + if (length == 0x12)
> + cta_microsoft(x, length);
> else
> - hex_block(" ", x + 4, length - 3);
> - return;
> - case 0x12: cta_hdmi_audio_block(x + 1, length); return;
> - case 0x13: cta_rcdb(x + 1, length); return;
> - case 0x14: cta_sldb(x + 1, length); return;
> - case 0x20: cta_ifdb(x + 1, length); return;
> - case 0x34: cta_displayid_type_7(x + 1, length); return;
> - case 0x35: cta_displayid_type_8(x + 1, length); return;
> - case 0x42: cta_displayid_type_10(x + 1, length); return;
> - case 0x78:
> - cta_hf_eeodb(x + 1, length);
> + goto dohex;
> + break;
> + case 0x004: cta_sadb(x, length); break;
> + case 0x005: cta_vesa_dtcdb(x, length); break;
> + case 0x700: cta_vcdb(x, length); break;
> + case 0x701|kOUI_HDR10: cta_hdr10plus(x, length); break;
> + case 0x701|kOUI_Dolby: cta_dolby_video(x, length); break;
> + case 0x702: cta_vesa_vdddb(x, length); break;
> + case 0x705: cta_colorimetry_block(x, length); break;
> + case 0x706: cta_hdr_static_metadata_block(x, length); break;
> + case 0x707: cta_hdr_dyn_metadata_block(x, length); break;
> + case 0x70d: cta_vfpdb(x, length); break;
> + case 0x70e: cta_svd(x, length, true); break;
> + case 0x70f: cta_y420cmdb(x, length); break;
> + case 0x711|kOUI_Dolby: cta_dolby_audio(x, length); break;
> + case 0x712: cta_hdmi_audio_block(x, length); break;
> + case 0x713: cta_rcdb(x, length); break;
> + case 0x714: cta_sldb(x, length); break;
> + case 0x720: cta_ifdb(x, length); break;
> + case 0x734: cta_displayid_type_7(x, length); break;
> + case 0x735: cta_displayid_type_8(x, length); break;
> + case 0x742: cta_displayid_type_10(x, length); break;
> + case 0x778:
> + cta_hf_eeodb(x, length);
> // This must be the first CTA-861 block
> - if (!cta.first_block)
> + if (cta.block_number > 0)
> fail("Block starts at a wrong offset.\n");
> - return;
> - case 0x79:
> - if (!cta.last_block_was_hdmi_vsdb)
> + break;
> + case 0x779:
> + if (cta.previous_cta_tag != (0x003|kOUI_HDMI))
> fail("HDMI Forum SCDB did not immediately follow the HDMI VSDB.\n");
> if (cta.have_hf_scdb || cta.have_hf_vsdb)
> fail("Duplicate HDMI Forum VSDB/SCDB.\n");
> if (length < 2) {
> data_block = std::string("HDMI Forum SCDB");
> fail("Invalid length %u < 2.\n", length);
> - return;
> - }
> - if (x[1] || x[2])
> - printf(" Non-zero SCDB reserved fields!\n");
> - cta_hf_scdb(x + 3, length - 2);
> - cta.have_hf_scdb = 1;
> - return;
> - }
> -
> - hex_block(" ", x + 1, length);
> -}
> -
> -void edid_state::cta_block(const unsigned char *x, bool duplicate)
> -{
> - unsigned length = x[0] & 0x1f;
> - const char *name;
> - unsigned oui;
> - bool reverse = false;
> - bool audio_block = false;
> -
> - switch ((x[0] & 0xe0) >> 5) {
> - case 0x01:
> - data_block = "Audio Data Block";
> - printf(" %s:\n", data_block.c_str());
> - cta_audio_block(x + 1, length);
> - audio_block = true;
> - break;
> - case 0x02:
> - data_block = "Video Data Block";
> - printf(" %s:\n", data_block.c_str());
> - cta_svd(x + 1, length, false);
> - break;
> - case 0x03:
> - oui = (x[3] << 16) + (x[2] << 8) + x[1];
> - name = oui_name(oui);
> - if (!name) {
> - name = oui_name(oui, true);
> - if (name)
> - reverse = true;
> - }
> - if (!name) {
> - printf(" Vendor-Specific Data Block, OUI %s:\n", ouitohex(oui).c_str());
> - hex_block(" ", x + 4, length - 3);
> - data_block.clear();
> - warn("Unknown Vendor-Specific Data Block, OUI %s.\n",
> - ouitohex(oui).c_str());
> - return;
> - }
> - data_block = std::string("Vendor-Specific Data Block (") + name + ")";
> - if (reverse)
> - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str());
> - printf(" %s, OUI %s:\n", data_block.c_str(), ouitohex(oui).c_str());
> - if (oui == 0x000c03) {
> - cta_hdmi_block(x + 1, length);
> - cta.last_block_was_hdmi_vsdb = 1;
> - cta.first_block = 0;
> - // The HDMI OUI is present, so this EDID represents an HDMI
> - // interface. And HDMI interfaces must use EDID version 1.3
> - // according to the HDMI Specification, so check for this.
> - if (base.edid_minor != 3)
> - fail("The HDMI Specification requires EDID 1.3 instead of 1.%u.\n",
> - base.edid_minor);
> - return;
> - }
> - if (oui == 0xc45dd8) {
> - if (!cta.last_block_was_hdmi_vsdb)
> - fail("HDMI Forum VSDB did not immediately follow the HDMI VSDB.\n");
> - if (cta.have_hf_scdb || cta.have_hf_vsdb)
> - fail("Duplicate HDMI Forum VSDB/SCDB.\n");
> - cta_hf_scdb(x + 4, length - 3);
> - cta.have_hf_vsdb = 1;
> - break;
> - }
> - if (oui == 0x00001a) {
> - cta_amd(x + 4, length - 3);
> - break;
> - }
> - if (oui == 0xca125c && length == 0x15) {
> - cta_microsoft(x + 4, length - 3);
> break;
> }
> - hex_block(" ", x + 4, length - 3);
> - break;
> - case 0x04:
> - data_block = "Speaker Allocation Data Block";
> - printf(" %s:\n", data_block.c_str());
> - cta_sadb(x + 1, length);
> - audio_block = true;
> - if (duplicate)
> - fail("Only one instance of this Data Block is allowed.\n");
> - break;
> - case 0x05:
> - data_block = "VESA Display Transfer Characteristics Data Block";
> - printf(" %s:\n", data_block.c_str());
> - cta_vesa_dtcdb(x + 1, length);
> - if (duplicate)
> - fail("Only one instance of this Data Block is allowed.\n");
> - break;
> - case 0x07:
> - cta_ext_block(x + 1, length - 1, duplicate);
> - break;
> - default: {
> - unsigned tag = (*x & 0xe0) >> 5;
> - unsigned length = *x & 0x1f;
> -
> - printf(" Unknown CTA-861 tag 0x%02x, length %u\n", tag, length);
> - hex_block(" ", x + 1, length);
> - data_block.clear();
> - warn("Unknown CTA-861 Data Block %u.\n", tag);
> + if (x[0] || x[1])
> + printf(" Non-zero SCDB reserved fields!\n");
> + cta_hf_scdb(x + 2, length - 2);
> + cta.have_hf_scdb = true;
> break;
> +dohex:
> + default:
> + hex_block(" ", x, length);
> + warn("Unknown block type: %s.\n", data_block.c_str());
> }
> - }
> -
> - // See Table 52 of CTA-861-G for a description of Byte 3
> - if (audio_block && !(cta.byte3 & 0x40))
> - fail("audio information is present, but bit 6 of Byte 3 of the CTA-861 Extension header indicates no Basic Audio support.\n");
> - cta.first_block = 0;
> - cta.last_block_was_hdmi_vsdb = 0;
> + cta.block_number++;
> + cta.previous_cta_tag = tag;
> }
>
> void edid_state::preparse_cta_block(const unsigned char *x)
> @@ -2392,11 +2268,11 @@ void edid_state::parse_cta_block(const unsigned char *x)
> // msg(!cta.has_hdmi, "If YCbCr support is indicated, then both 4:2:2 and 4:4:4 %s be supported.\n",
> // cta.has_hdmi ? "shall" : "should");
> printf(" Native detailed modes: %u\n", x[3] & 0x0f);
> - if (cta.first_block)
> + if (cta.block_number == 0)
> cta.byte3 = x[3];
> else if (x[3] != cta.byte3)
> fail("Byte 3 must be the same for all CTA-861 Extension Blocks.\n");
> - if (cta.first_block) {
> + if (cta.block_number == 0) {
> unsigned native_dtds = x[3] & 0x0f;
>
> cta.native_timings.clear();
> diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
> index 5c81294..ff7a6db 100644
> --- a/parse-displayid-block.cpp
> +++ b/parse-displayid-block.cpp
> @@ -1609,13 +1609,230 @@ void edid_state::preparse_displayid_block(const unsigned char *x)
> }
> }
>
> +#define data_block_o(n, a, b) data_block_oui(n, x + 3, len, tag == 0, &ouinum, a, b)
> +
> +unsigned edid_state::displayid_block(const unsigned version, const unsigned char *x, unsigned length)
> +{
> + unsigned i;
> + unsigned tag = x[0];
> + unsigned ouinum = 0;
> + unsigned len = (length < 3) ? 0 : x[2];
> +
> + switch (tag) {
> + // DisplayID 1.3:
> + case 0x00: data_block_o("Product Identification Data Block (" + utohex(tag) + ")", true, false); ouinum = 0; break;
> + case 0x01: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break;
> + case 0x02: data_block = "Color Characteristics Data Block"; break;
> + case 0x03: data_block = "Video Timing Modes Type 1 - Detailed Timings Data Block"; break;
> + case 0x04: data_block = "Video Timing Modes Type 2 - Detailed Timings Data Block"; break;
> + case 0x05: data_block = "Video Timing Modes Type 3 - Short Timings Data Block"; break;
> + case 0x06: data_block = "Video Timing Modes Type 4 - DMT Timings Data Block"; break;
> + case 0x07: data_block = "Supported Timing Modes Type 1 - VESA DMT Timings Data Block"; break;
> + case 0x08: data_block = "Supported Timing Modes Type 2 - CTA-861 Timings Data Block"; break;
> + case 0x09: data_block = "Video Timing Range Data Block"; break;
> + case 0x0a: data_block = "Product Serial Number Data Block"; break;
> + case 0x0b: data_block = "GP ASCII String Data Block"; break;
> + case 0x0c: data_block = "Display Device Data Data Block"; break;
> + case 0x0d: data_block = "Interface Power Sequencing Data Block"; break;
> + case 0x0e: data_block = "Transfer Characteristics Data Block"; break;
> + case 0x0f: data_block = "Display Interface Data Block"; break;
> + case 0x10: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break;
> + case 0x11: data_block = "Video Timing Modes Type 5 - Short Timings Data Block"; break;
> + case 0x12: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break;
> + case 0x13: data_block = "Video Timing Modes Type 6 - Detailed Timings Data Block"; break;
> + // 0x14 .. 0x7e RESERVED for Additional VESA-defined Data Blocks
> + // DisplayID 2.0
> + case 0x20: data_block_o("Product Identification Data Block (" + utohex(tag) + ")", false, false); ouinum = 0; break;
> + case 0x21: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break;
> + case 0x22: data_block = "Video Timing Modes Type 7 - Detailed Timings Data Block"; break;
> + case 0x23: data_block = "Video Timing Modes Type 8 - Enumerated Timing Codes Data Block"; break;
> + case 0x24: data_block = "Video Timing Modes Type 9 - Formula-based Timings Data Block"; break;
> + case 0x25: data_block = "Dynamic Video Timing Range Limits Data Block"; break;
> + case 0x26: data_block = "Display Interface Features Data Block"; break;
> + case 0x27: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break;
> + case 0x28: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break;
> + case 0x29: data_block = "ContainerID Data Block"; break;
> + case 0x32: data_block = "Video Timing Modes Type 10 - Formula-based Timings Data Block"; break;
> + // 0x2a .. 0x7d RESERVED for Additional VESA-defined Data Blocks
> + case 0x7e: data_block_o("Vendor-Specific Data Block (" + utohex(tag) + ")", false, true); break; // DisplayID 2.0
> + case 0x7f: data_block_o("Vendor-Specific Data Block (" + utohex(tag) + ")", true, false); break; // DisplayID 1.3
> + // 0x80 RESERVED
> + case 0x81: data_block = "CTA-861 DisplayID Data Block (" + utohex(tag) + ")"; break;
> + // 0x82 .. 0xff RESERVED
> + default: data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")"; break;
> + }
> +
> + if (version >= 0x20 && (tag < 0x20 || tag == 0x7f))
> + fail("Use of DisplayID v1.x tag for DisplayID v%u.%u.\n",
> + version >> 4, version & 0xf);
> + if (version < 0x20 && tag >= 0x20 && tag <= 0x7e)
> + fail("Use of DisplayID v2.0 tag for DisplayID v%u.%u.\n",
> + version >> 4, version & 0xf);
> +
> + if (length < 3) {
> + // report a problem when the remaining bytes are not 0.
> + if (tag || (length > 1 && x[1])) {
> + fail("Not enough bytes remain (%d) for a DisplayID data block and the DisplayID filler is non-0.\n", length);
> + }
> + return length;
> + }
> +
> + unsigned block_rev = x[1] & 0x07;
> +
> + if (length < len + 3) {
> + fail("The length of this DisplayID data block (%d) exceeds the number of bytes remaining (%d)\n", len + 3, length);
> + return length;
> + }
> +
> + if (!tag && !len) {
> + // A Product Identification Data Block with no payload bytes is not valid - assume this is the end.
> + if (!memchk(x, length)) {
> + fail("Non-0 filler bytes in the DisplayID block.\n");
> + }
> + return length;
> + }
> +
> + printf(" %s:\n", data_block.c_str());
> +
> + tag |= ouinum;
> + switch (tag) {
> + case 0x00: parse_displayid_product_id(x); break;
> + case 0x01: parse_displayid_parameters(x); break;
> + case 0x02: parse_displayid_color_characteristics(x); break;
> + case 0x03:
> + check_displayid_datablock_revision(x[1], 0, block_rev & 1);
> + for (i = 0; i < len / 20; i++)
> + parse_displayid_type_1_7_timing(&x[3 + (i * 20)], false, block_rev);
> + break;
> + case 0x04:
> + check_displayid_datablock_revision(x[1]);
> + for (i = 0; i < len / 11; i++)
> + parse_displayid_type_2_timing(&x[3 + (i * 11)]);
> + break;
> + case 0x05:
> + check_displayid_datablock_revision(x[1], 0, block_rev & 1);
> + for (i = 0; i < len / 3; i++)
> + parse_displayid_type_3_timing(&x[3 + (i * 3)]);
> + break;
> + case 0x06:
> + check_displayid_datablock_revision(x[1], 0xc0, 1);
> + for (i = 0; i < len; i++)
> + parse_displayid_type_4_8_timing((x[1] & 0xc0) >> 6, x[3 + i]);
> + break;
> + case 0x07:
> + check_displayid_datablock_revision(x[1]);
> + for (i = 0; i < min(len, 10) * 8; i++)
> + if (x[3 + i / 8] & (1 << (i % 8))) {
> + char type[16];
> + sprintf(type, "DMT 0x%02x", i + 1);
> + print_timings(" ", find_dmt_id(i + 1), type);
> + }
> + break;
> + case 0x08:
> + check_displayid_datablock_revision(x[1]);
> + for (i = 0; i < min(len, 8) * 8; i++)
> + if (x[3 + i / 8] & (1 << (i % 8))) {
> + char type[16];
> + sprintf(type, "VIC %3u", i + 1);
> + print_timings(" ", find_vic_id(i + 1), type);
> + }
> + break;
> + case 0x09: parse_displayid_video_timing_range_limits(x); break;
> + case 0x0a:
> + case 0x0b: parse_displayid_string(x); break;
> + case 0x0c: parse_displayid_display_device(x); break;
> + case 0x0d: parse_displayid_intf_power_sequencing(x); break;
> + case 0x0e: parse_displayid_transfer_characteristics(x); break;
> + case 0x0f: parse_displayid_display_intf(x); break;
> + case 0x10: parse_displayid_stereo_display_intf(x); break;
> + case 0x11:
> + check_displayid_datablock_revision(x[1]);
> + for (i = 0; i < len / 7; i++)
> + parse_displayid_type_5_timing(&x[3 + (i * 7)]);
> + break;
> + case 0x12: parse_displayid_tiled_display_topology(x, false); break;
> + case 0x13:
> + check_displayid_datablock_revision(x[1]);
> + for (i = 0; i < len; i += (x[3 + i + 2] & 0x40) ? 17 : 14)
> + parse_displayid_type_6_timing(&x[3 + i]);
> + break;
> + case 0x20: parse_displayid_product_id(x); break;
> + case 0x21:
> + if (block_rev >= 1)
> + check_displayid_datablock_revision(x[1], 0x80, 1);
> + else
> + check_displayid_datablock_revision(x[1], 0x80, 0);
> + parse_displayid_parameters_v2(x, block_rev);
> + break;
> + case 0x22: {
> + unsigned sz = 20;
> +
> + if (block_rev >= 2)
> + check_displayid_datablock_revision(x[1], 0x08, 2);
> + else if (block_rev == 1)
> + check_displayid_datablock_revision(x[1], 0x08, 1);
> + else
> + check_displayid_datablock_revision(x[1]);
> + sz += (x[1] & 0x70) >> 4;
> + if (block_rev >= 1 && (x[1] & 0x08))
> + printf(" These timings support DSC pass-through\n");
> + for (i = 0; i < len / sz; i++)
> + parse_displayid_type_1_7_timing(&x[3 + i * sz], true, block_rev);
> + break;
> + }
> + case 0x23:
> + if (block_rev)
> + check_displayid_datablock_revision(x[1], 0xe8, 1);
> + else
> + check_displayid_datablock_revision(x[1], 0xc8);
> + if (x[1] & 0x08) {
> + for (i = 0; i < len / 2; i++)
> + parse_displayid_type_4_8_timing((x[1] & 0xc0) >> 6,
> + x[3 + i * 2] |
> + (x[4 + i * 2] << 8));
> + } else {
> + for (i = 0; i < len; i++)
> + parse_displayid_type_4_8_timing((x[1] & 0xc0) >> 6,
> + x[3 + i]);
> + }
> + break;
> + case 0x24:
> + check_displayid_datablock_revision(x[1]);
> + for (i = 0; i < len / 6; i++)
> + parse_displayid_type_9_timing(&x[3 + i * 6]);
> + break;
> + case 0x25: parse_displayid_dynamic_video_timings_range_limits(x); break;
> + case 0x26: parse_displayid_interface_features(x); break;
> + case 0x27: parse_displayid_stereo_display_intf(x); break;
> + case 0x28: parse_displayid_tiled_display_topology(x, true); break;
> + case 0x29: parse_displayid_ContainerID(x); break;
> + case 0x32: {
> + unsigned sz = 6 + ((x[1] & 0x70) >> 4);
> +
> + check_displayid_datablock_revision(x[1], 0x70);
> + for (i = 0; i < len / sz; i++)
> + parse_displayid_type_10_timing(&x[3 + i * sz], sz);
> + break;
> + }
> + case 0x81: parse_displayid_cta_data_block(x); break;
> + case 0x7e|kOUI_VESA: parse_displayid_vesa(x); break;
> + default: hex_block(" ", x + 3 + (ouinum ? 3 : 0), len - (ouinum ? 3 : 0)); break;
> + }
> +
> + if ((tag == 0x00 || tag == 0x20) &&
> + (!dispid.is_base_block || dispid.block_number > 0))
> + fail("%s is required to be the first DisplayID Data Block.\n",
> + data_block.c_str());
> + dispid.block_number++;
> + return len + 3;
> +}
> +
> void edid_state::parse_displayid_block(const unsigned char *x)
> {
> unsigned version = x[1];
> unsigned length = x[2];
> unsigned prod_type = x[3]; // future check: based on type, check for required data blocks
> unsigned ext_count = x[4];
> - unsigned i;
>
> printf(" Version: %u.%u\n Extension Count: %u\n",
> version >> 4, version & 0xf, ext_count);
> @@ -1647,246 +1864,10 @@ void edid_state::parse_displayid_block(const unsigned char *x)
> length = 121;
> }
>
> - unsigned offset = 5;
> - bool first_data_block = true;
> - while (length > 0) {
> - unsigned tag = x[offset];
> - unsigned oui = 0;
> -
> - switch (tag) {
> - // DisplayID 1.3:
> - case 0x00: data_block = "Product Identification Data Block (" + utohex(tag) + ")"; break;
> - case 0x01: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break;
> - case 0x02: data_block = "Color Characteristics Data Block"; break;
> - case 0x03: data_block = "Video Timing Modes Type 1 - Detailed Timings Data Block"; break;
> - case 0x04: data_block = "Video Timing Modes Type 2 - Detailed Timings Data Block"; break;
> - case 0x05: data_block = "Video Timing Modes Type 3 - Short Timings Data Block"; break;
> - case 0x06: data_block = "Video Timing Modes Type 4 - DMT Timings Data Block"; break;
> - case 0x07: data_block = "Supported Timing Modes Type 1 - VESA DMT Timings Data Block"; break;
> - case 0x08: data_block = "Supported Timing Modes Type 2 - CTA-861 Timings Data Block"; break;
> - case 0x09: data_block = "Video Timing Range Data Block"; break;
> - case 0x0a: data_block = "Product Serial Number Data Block"; break;
> - case 0x0b: data_block = "GP ASCII String Data Block"; break;
> - case 0x0c: data_block = "Display Device Data Data Block"; break;
> - case 0x0d: data_block = "Interface Power Sequencing Data Block"; break;
> - case 0x0e: data_block = "Transfer Characteristics Data Block"; break;
> - case 0x0f: data_block = "Display Interface Data Block"; break;
> - case 0x10: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break;
> - case 0x11: data_block = "Video Timing Modes Type 5 - Short Timings Data Block"; break;
> - case 0x12: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break;
> - case 0x13: data_block = "Video Timing Modes Type 6 - Detailed Timings Data Block"; break;
> - // 0x14 .. 0x7e RESERVED for Additional VESA-defined Data Blocks
> - // DisplayID 2.0
> - case 0x20: data_block = "Product Identification Data Block (" + utohex(tag) + ")"; break;
> - case 0x21: data_block = "Display Parameters Data Block (" + utohex(tag) + ")"; break;
> - case 0x22: data_block = "Video Timing Modes Type 7 - Detailed Timings Data Block"; break;
> - case 0x23: data_block = "Video Timing Modes Type 8 - Enumerated Timing Codes Data Block"; break;
> - case 0x24: data_block = "Video Timing Modes Type 9 - Formula-based Timings Data Block"; break;
> - case 0x25: data_block = "Dynamic Video Timing Range Limits Data Block"; break;
> - case 0x26: data_block = "Display Interface Features Data Block"; break;
> - case 0x27: data_block = "Stereo Display Interface Data Block (" + utohex(tag) + ")"; break;
> - case 0x28: data_block = "Tiled Display Topology Data Block (" + utohex(tag) + ")"; break;
> - case 0x29: data_block = "ContainerID Data Block"; break;
> - case 0x32: data_block = "Video Timing Modes Type 10 - Formula-based Timings Data Block"; break;
> - // 0x2a .. 0x7d RESERVED for Additional VESA-defined Data Blocks
> - case 0x7e: // DisplayID 2.0
> - case 0x7f: // DisplayID 1.3
> - if ((tag == 0x7e && version >= 0x20) ||
> - (tag == 0x7f && version < 0x20)) {
> - oui = (x[offset + 3] << 16) + (x[offset + 4] << 8) + x[offset + 5];
> - const char *name = oui_name(oui);
> - bool reversed = false;
> -
> - if (!name) {
> - name = oui_name(oui, true);
> - if (name)
> - reversed = true;
> - }
> - if (name)
> - data_block = std::string("Vendor-Specific Data Block (") + name + ")";
> - else
> - data_block = "Vendor-Specific Data Block, OUI " + ouitohex(oui);
> - if (reversed)
> - fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order.\n").c_str());
> - } else {
> - data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")";
> - }
> - break;
> - // 0x80 RESERVED
> - case 0x81: data_block = "CTA-861 DisplayID Data Block (" + utohex(tag) + ")"; break;
> - // 0x82 .. 0xff RESERVED
> - default: data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")"; break;
> - }
> -
> - if (version >= 0x20 && (tag < 0x20 || tag == 0x7f))
> - fail("Use of DisplayID v1.x tag for DisplayID v%u.%u.\n",
> - version >> 4, version & 0xf);
> - if (version < 0x20 && tag >= 0x20 && tag <= 0x7e)
> - fail("Use of DisplayID v2.0 tag for DisplayID v%u.%u.\n",
> - version >> 4, version & 0xf);
> -
> - if (length < 3) {
> - // report a problem when the remaining bytes are not 0.
> - if (tag || x[offset + 1]) {
> - fail("Not enough bytes remain (%d) for a DisplayID data block or the DisplayID filler is non-0.\n", length);
> - }
> - break;
> - }
> -
> - unsigned block_rev = x[offset + 1] & 0x07;
> - unsigned len = x[offset + 2];
> -
> - if (length < len + 3) {
> - fail("The length of this DisplayID data block (%d) exceeds the number of bytes remaining (%d).\n", len + 3, length);
> - break;
> - }
> -
> - if (!tag && !len) {
> - // A Product Identification Data Block with no payload bytes is not valid - assume this is the end.
> - if (!memchk(x + offset, length)) {
> - fail("Non-0 filler bytes in the DisplayID block.\n");
> - }
> - break;
> - }
> -
> - printf(" %s:\n", data_block.c_str());
> -
> - switch (tag) {
> - case 0x00: parse_displayid_product_id(x + offset); break;
> - case 0x01: parse_displayid_parameters(x + offset); break;
> - case 0x02: parse_displayid_color_characteristics(x + offset); break;
> - case 0x03:
> - check_displayid_datablock_revision(x[offset + 1], 0, block_rev & 1);
> - for (i = 0; i < len / 20; i++)
> - parse_displayid_type_1_7_timing(&x[offset + 3 + (i * 20)], false, block_rev);
> - break;
> - case 0x04:
> - check_displayid_datablock_revision(x[offset + 1]);
> - for (i = 0; i < len / 11; i++)
> - parse_displayid_type_2_timing(&x[offset + 3 + (i * 11)]);
> - break;
> - case 0x05:
> - check_displayid_datablock_revision(x[offset + 1], 0, block_rev & 1);
> - for (i = 0; i < len / 3; i++)
> - parse_displayid_type_3_timing(&x[offset + 3 + (i * 3)]);
> - break;
> - case 0x06:
> - check_displayid_datablock_revision(x[offset + 1], 0xc0, 1);
> - for (i = 0; i < len; i++)
> - parse_displayid_type_4_8_timing((x[offset + 1] & 0xc0) >> 6, x[offset + 3 + i]);
> - break;
> - case 0x07:
> - check_displayid_datablock_revision(x[offset + 1]);
> - for (i = 0; i < min(len, 10) * 8; i++)
> - if (x[offset + 3 + i / 8] & (1 << (i % 8))) {
> - char type[16];
> - sprintf(type, "DMT 0x%02x", i + 1);
> - print_timings(" ", find_dmt_id(i + 1), type);
> - }
> - break;
> - case 0x08:
> - check_displayid_datablock_revision(x[offset + 1]);
> - for (i = 0; i < min(len, 8) * 8; i++)
> - if (x[offset + 3 + i / 8] & (1 << (i % 8))) {
> - char type[16];
> - sprintf(type, "VIC %3u", i + 1);
> - print_timings(" ", find_vic_id(i + 1), type);
> - }
> - break;
> - case 0x09: parse_displayid_video_timing_range_limits(x + offset); break;
> - case 0x0a:
> - case 0x0b: parse_displayid_string(x + offset); break;
> - case 0x0c: parse_displayid_display_device(x + offset); break;
> - case 0x0d: parse_displayid_intf_power_sequencing(x + offset); break;
> - case 0x0e: parse_displayid_transfer_characteristics(x + offset); break;
> - case 0x0f: parse_displayid_display_intf(x + offset); break;
> - case 0x10: parse_displayid_stereo_display_intf(x + offset); break;
> - case 0x11:
> - check_displayid_datablock_revision(x[offset + 1]);
> - for (i = 0; i < len / 7; i++)
> - parse_displayid_type_5_timing(&x[offset + 3 + (i * 7)]);
> - break;
> - case 0x12: parse_displayid_tiled_display_topology(x + offset, false); break;
> - case 0x13:
> - check_displayid_datablock_revision(x[offset + 1]);
> - for (i = 0; i < len; i += (x[offset + 3 + i + 2] & 0x40) ? 17 : 14)
> - parse_displayid_type_6_timing(&x[offset + 3 + i]);
> - break;
> - case 0x20: parse_displayid_product_id(x + offset); break;
> - case 0x21:
> - if (block_rev >= 1)
> - check_displayid_datablock_revision(x[offset + 1], 0x80, 1);
> - else
> - check_displayid_datablock_revision(x[offset + 1], 0x80, 0);
> - parse_displayid_parameters_v2(x + offset, block_rev);
> - break;
> - case 0x22: {
> - unsigned sz = 20;
> -
> - if (block_rev >= 2)
> - check_displayid_datablock_revision(x[offset + 1], 0x08, 2);
> - else if (block_rev == 1)
> - check_displayid_datablock_revision(x[offset + 1], 0x08, 1);
> - else
> - check_displayid_datablock_revision(x[offset + 1]);
> - sz += (x[offset + 1] & 0x70) >> 4;
> - if (block_rev >= 1 && (x[offset + 1] & 0x08))
> - printf(" These timings support DSC pass-through\n");
> - for (i = 0; i < len / sz; i++)
> - parse_displayid_type_1_7_timing(&x[offset + 3 + i * sz], true, block_rev);
> - break;
> - }
> - case 0x23:
> - if (block_rev)
> - check_displayid_datablock_revision(x[offset + 1], 0xe8, 1);
> - else
> - check_displayid_datablock_revision(x[offset + 1], 0xc8);
> - if (x[offset + 1] & 0x08) {
> - for (i = 0; i < len / 2; i++)
> - parse_displayid_type_4_8_timing((x[offset + 1] & 0xc0) >> 6,
> - x[offset + 3 + i * 2] |
> - (x[offset + 4 + i * 2] << 8));
> - } else {
> - for (i = 0; i < len; i++)
> - parse_displayid_type_4_8_timing((x[offset + 1] & 0xc0) >> 6,
> - x[offset + 3 + i]);
> - }
> - break;
> - case 0x24:
> - check_displayid_datablock_revision(x[offset + 1]);
> - for (i = 0; i < len / 6; i++)
> - parse_displayid_type_9_timing(&x[offset + 3 + i * 6]);
> - break;
> - case 0x25: parse_displayid_dynamic_video_timings_range_limits(x + offset); break;
> - case 0x26: parse_displayid_interface_features(x + offset); break;
> - case 0x27: parse_displayid_stereo_display_intf(x + offset); break;
> - case 0x28: parse_displayid_tiled_display_topology(x + offset, true); break;
> - case 0x29: parse_displayid_ContainerID(x + offset); break;
> - case 0x32: {
> - unsigned sz = 6 + ((x[offset + 1] & 0x70) >> 4);
> -
> - check_displayid_datablock_revision(x[offset + 1], 0x70);
> - for (i = 0; i < len / sz; i++)
> - parse_displayid_type_10_timing(&x[offset + 3 + i * sz], sz);
> - break;
> - }
> - case 0x81: parse_displayid_cta_data_block(x + offset); break;
> - case 0x7e:
> - if (oui == 0x3a0292) {
> - parse_displayid_vesa(x + offset);
> - break;
> - }
> - // fall-through
> - default: hex_block(" ", x + offset + 3, len); break;
> - }
> -
> - if ((tag == 0x00 || tag == 0x20) &&
> - (!dispid.is_base_block || !first_data_block))
> - fail("%s is required to be the first DisplayID Data Block.\n",
> - data_block.c_str());
> - length -= len + 3;
> - offset += len + 3;
> - first_data_block = false;
> + unsigned len;
> + for (const unsigned char *y = x + 5; length > 0; y += len) {
> + len = displayid_block(version, y, length);
> + length -= len;
> }
>
> /*
>