edid-decode: move audio fail/warn messages
commit9f52a3b5c2443de21a74eeb88237838954078cd7
authorjoevt <joevt@shaw.ca>
Sun, 26 Sep 2021 08:33:17 +0000 (26 01:33 -0700)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 27 Sep 2021 10:29:44 +0000 (27 12:29 +0200)
tree8f8aed13dfba3a0583168cd676509f83c3569125
parentb6361986212d3e031d78e2970996369107e109fc
edid-decode: move audio fail/warn messages

For tag 0x711, the "Audio information is present" fail message appears before
the block name. Output the block name before any fail/warning messages related
to the block.

For tags that are supposed to have an OUI but are not long enough:
- Output the block name before the "Invalid length" fail message. The fail
  message should include the block name but we don't want cta_block to output
  data_block so clear it after the fail, before exiting.

For tags with a 3 byte OUI:
- Since we are calling data_block_oui early (before data_block is output in
  cta_block), don't output block name in data_block_oui - cta_block will do
  that for us.
- data_block now includes the OUI (the block name in the failure/warning
  section will match block name in the EDID section).

Probably things would be simpler if we always set data_block to the block name,
then have fail/warning messages that don't include the block name so they don't
look redundant in the failures/warnings sections. For example we could have
something like: Unknown CTA-861 Data Block (tag 0x00): Invalid tag.
Vendor-Specific Data Block, OUI $$-$$-$$: Unknown OUI.  etc.

Sample corrupted EDID (combination of vizio-e65e0-hdmi and
/System/Library/Displays/Contents/Resources/Overrides/DisplayVendorID-593a/DisplayProductID-1018:edid-patches):

00ffffffffffff00593a181001010101001a0103808f50782a6a6da4554f9e270e474aa5ce00d1c0010101010101010101010101010104740030f2705a80b0588a0048684200001e023a801871382d40582c450048684200001e000000fc004536352d45310a202020202020000000fd00174c0f8c26000a202020202020014502035171575f645d625e631022201f2105041307060302111215160132570600000000000000000000090707150750830100006f030c002000383ca05b5b0060010000000061666065e3060f01e305e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ea

Signed-off-by: Joe van Tunen <joevt@shaw.ca>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
edid-decode.cpp
parse-cta-block.cpp