summaryrefslogtreecommitdiff
path: root/lib/igt_eld.c
AgeCommit message (Collapse)Author
2019-11-26igt_eld: Add eld_is_igtSimon Ser
This function parses the monitor name from an ELD blob and checks whether it comes from an IGT EDID. v2: replace a bunch of random numbers with constants (Chris, Andi) v3: rabase and fix subject (Arek) Signed-off-by: Simon Ser <simon.ser@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Andi Shyti <andi.shyti@intel.com> Cc: Martin Peres <martin.peres@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-09-16lib/igt_eld: fix eld_is_supported failing if not supportedSimon Ser
When glob(3) doesn't find any results, it returns GLOB_NOMATCH. I've been confused by GLOB_NOCHECK's description and thought it would return 0. Instead of failing on the assert, return that ELDs aren't supported in case there's no match. While at it, also include glob's return value in the assert message. Signed-off-by: Simon Ser <simon.ser@intel.com> Fixes: 3374cd0b048f ("lib/igt_eld: introduce eld_is_supported") Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-09-12lib/igt_eld: introduce eld_is_supportedSimon Ser
We've seen cases in which /proc/asound doesn't exist (e.g. with the new SOF framework). We've also seen cases in which no soundcard is exposed by ALSA (see bugzilla link). Last, some audio drivers din't support ELDs (non-Intel drivers). In all of these cases, skipping the tests depending on ELD support makes more sense and makes it clearer what happens. v2: also check that the driver supports ELDs entries in procfs Signed-off-by: Simon Ser <simon.ser@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102370 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-07-03lib/igt_eld: print debug message when no ELD is foundSimon Ser
When this happens, the logs were completely empty previously, which can be quite confusing. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-06-19lib/igt_eld: fix potential read from undefined valueSimon Ser
If the ELD doesn't contain a monitor_present line (this shouldn't happen), then the value is garbage. Define the variable as a safety net. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-12lib/igt_eld: add eld_get_igtSimon Ser
The existing eld_has_igt function doesn't allow the caller to retrieve the parsed ELD and check audio parameters. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-07lib/igt_eld: improve loggingSimon Ser
- Print a log line when a monitor isn't present - Print a log line when a non-IGT ELD is parsed (rejigger the code flow to make skips uniform) - Print the ELD path on read failure, just in case Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-04lib/igt_eld: parse Short Audio DescriptorsSimon Ser
Each valid ELD entry can contain zero, one or more Short Audio Descriptor blocks. These are exposed in sadN_* fields (N being the index of the SAD). We need to parse them to be able to check that ALSA has properly processed them. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-04lib/igt_eld: consolidate ELD parsingSimon Ser
Make the ELD enumeration more robust, and implement proper parsing for ELD fields. This will become useful when other ELD fields (formats, sample rates, sample sizes) will be parsed and checked. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-06-04lib/igt_eld: introduce an ELD librarySimon Ser
There are two reasons why I want to introduce this library: - I want to use it from the Chamelium tests for DisplayPort - I want to expand it to also check that audio parameters parsed by ALSA are correct (formats, sampling rates, sample sizes and so on) Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>