This is a private function which parses DTDs. This will be useful
in the next commit to parse DTDs from the CTA extension.
Signed-off-by: Simon Ser <contact@emersion.fr>
EDID 1.2- allow the first byte descriptor to contain a display
descriptor. EDID 1.3+ require the first byte descriptor to contain
a detailed timing definition describing the display's preferred
(ie, optimal) mode.
Signed-off-by: Simon Ser <contact@emersion.fr>
EDID 1.4 forbids years < 2006, but EDID 1.3 allows them.
Error out when an EDID uses a reserved value. Correctly parse the
year on older EDID revisions.
Signed-off-by: Simon Ser <contact@emersion.fr>
These functions now only return false on fatal failures
(e.g. out of memory). They no longer return false for unsupported
block types.
Signed-off-by: Simon Ser <contact@emersion.fr>
Mirror upstream edid-decode.
samsung-s27a950d-dp and hp-5dq99aa-hdmi are missing some failures
about features we haven't implemented yet. panasonic-mei96a2-dp
has a bogus "Missing Display Product Name" failure, see [1].
[1]: https://lore.kernel.org/linux-media/20220802093219.30599-1-contact@emersion.fr/T/#u
Signed-off-by: Simon Ser <contact@emersion.fr>
This is a bit messy because the values depend on various misc flags
defined earlier in the spec, and the meaning changes between EDID 1.3
and 1.4. On top of that edid-decode prints something confusing in the
EDID 1.3 case.
Signed-off-by: Simon Ser <contact@emersion.fr>
The only caller skips any descriptor with errors, it doesn't surface
back the errno to the library user.
Signed-off-by: Simon Ser <contact@emersion.fr>
This will allow us to use the helpers from cta.c.
The functions are marked "static inline" to avoid warnings about
unused functions.
Signed-off-by: Simon Ser <contact@emersion.fr>
The Display Monitor Timing specification is a PDF with data tables.
A small Python script can be used to extract its contents in a
machine-readable form.
For now only extract a few fields. This can be extended later.
Signed-off-by: Simon Ser <contact@emersion.fr>
The analog/digital flags are left for a future patch.
A join_str() function is introduced in di-edid-decode: upstream
edid-decode uses a comma-separated list with a handful of other
flags.
Signed-off-by: Simon Ser <contact@emersion.fr>
This makes it clearer what the range of the value can be: we no
longer need to deal with 16-bit integers.
Signed-off-by: Simon Ser <contact@emersion.fr>
The spec allows manufacturers to store the aspect ratio in these
fields. Instead of exposing bogus values to the user, mark the
size in mm as undefined.
Signed-off-by: Simon Ser <contact@emersion.fr>
According to table 3.21 note 17, these fields should be set to zero
for some sinks, e.g. front projectors.
edid-decode hides the size from its output if both fields are zero.
Signed-off-by: Simon Ser <contact@emersion.fr>
These two compilers may have different warnings. Make sure we
don't miss any.
The Clang build also supports ASan + UBSan.
Signed-off-by: Simon Ser <contact@emersion.fr>
The motivation is two-fold:
- These were added back when we exposed values outside of the enum
entries. We no longer do that, so these can't be hit.
- The compiler now warns when we are missing an entry from the switch.
Signed-off-by: Simon Ser <contact@emersion.fr>
This should remove the risk to merge a patch with the
FDO_FORCE_REBUILD line uncommented. Mentionning the command in the
manifest makes it easier to remember.
Signed-off-by: Simon Ser <contact@emersion.fr>
A simple version script is used because it allows us to consistently
expose all symbols starting with "di_", removing the risk to forget
to mark a symbol as public.
Signed-off-by: Simon Ser <contact@emersion.fr>
The extra underscore indicates that it's not a function which is
part of our public API. This will allow the next commit to setup the
linker to export functions based on their name.
Signed-off-by: Simon Ser <contact@emersion.fr>