lib/igt_eld: Accept the ASoC hdmi-codec ELD format
PATCH 1/1 lib/igt_eld: Accept the ASoC hdmi-codec ELD format
eld_parse_entry() only reports a monitor when the ELD file has "monitor_present 1", and eld_get_igt() also needs "eld_valid 1". Those two fields are printed by the HDA HDMI codec only. The ELD files of the ASoC hdmi-codec, used by HDMI audio on Arm boards, start at monitor_name, so every ELD there is treated as having no monitor.
On a Raspberry Pi 5 (vc4), kms_hdmi_inject's inject-audio fails even though the ELD shows the injected EDID:
(kms_hdmi_inject) igt_eld-DEBUG: Monitor not present in ELD: /proc/asound/card0/eld#0 (kms_hdmi_inject) CRITICAL: HDMI ELD missing after retry
while /proc/asound/card0/eld#0 has:
monitor_name IGT
connection_type HDMI
eld_version [0x2] CEA-861D or below
When the two fields are missing, use the ELD version instead. The hdmi-codec shows an all-zero ELD, with eld_version [0x0], when no sink is connected, so a non-zero version means a monitor is present and its ELD is valid. ELD files that have the fields are handled as before.
Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39):kms_hdmi_inject inject-audio fails before and passes after; inject-4k passes both times.
This change and its description were written with the help of an AI coding assistant (Claude); the test runs above were done on real hardware.
--- lib/igt_eld.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
lib/igt_eld.c +17 -0
@@ -167,6 +167,11 @@ static bool parse_sad_field(struct eld_sad *sad, const char *key, char *value)* * Each entry contains one or more SAD blocks. Their contents is exposed in * sadN_* fields. +* +* The monitor_present and eld_valid fields are printed by the HDA HDMI codec +* only. The ASoC hdmi-codec starts at monitor_name and shows an all-zero ELD +* (eld_version [0x0]) when no sink is connected, so without those fields a +* non-zero ELD version means a monitor is present and its ELD is valid. */ static bool eld_parse_entry (const char *path,struct eld_entry *eld) {
@@ -175,6 +180,8 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)char *key, *value, *sad_key;size_t len;bool monitor_present = false; +bool has_present = false, has_valid = false; +unsigned int eld_version =0 ;bool sad_ok;int sad_index;
@@ -196,10 +203,15 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)/* Skip whitespace at the beginning */ value +=strspn (value,ELD_DELIM ); + has_present |=strcmp (key,"monitor_present" ) ==0 ; + has_valid |=strcmp (key,"eld_valid" ) ==0 ; +if (strcmp (key,"monitor_present" ) ==0 ) monitor_present =strcmp (value,"1" ) ==0 ;else if (strcmp (key,"eld_valid" ) ==0 ) eld->valid =strcmp (value,"1" ) ==0 ; +else if (strcmp (key,"eld_version" ) ==0 ) +sscanf (value,"[0x%x]" , &eld_version);else if (strcmp (key,"monitor_name" ) ==0 )snprintf (eld->monitor_name,sizeof (eld->monitor_name),"%s" , value);
@@ -227,6 +239,11 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)fclose (f); +if (!has_present) + monitor_present = eld_version !=0 ; +if (!has_valid) + eld->valid = monitor_present; +if (!monitor_present)igt_debug ("Monitor not present in ELD: %s\n" , path);return monitor_present;
Signature · 1 line
2.51.1.windows.1
Patchwork
CI✗ LGCI.VerificationFailed: failure for lib/igt_eld: Accept the ASoC hdmi-codec ELD format
== Series Details ==
== Series Details ==
Series: lib/igt_eld: Accept the ASoC hdmi-codec ELD format
URL : https://patchwork.freedesktop.org/series/179743/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_IGTPW_check/244228/ (on cidrm1)
Hi Roy,
Quoted 23 lines · Roy
eld_parse_entry()only reports a monitor when the ELD file has "monitor_present1", andeld_get_igt()also needs "eld_valid1". Those two fields are printed by the HDA HDMI codec only. The ELD files of the ASoC hdmi-codec, used by HDMI audio on Arm boards, start atmonitor_name, so every ELD there is treated as having no monitor.On a Raspberry Pi 5 (vc4), kms_hdmi_inject's inject-audio fails even though the ELD shows the injected EDID:
(
kms_hdmi_inject) igt_eld-DEBUG: Monitor not present in ELD: /proc/asound/card0/eld#0 (kms_hdmi_inject) CRITICAL: HDMI ELD missing after retrywhile /proc/asound/card0/eld#0 has:
monitor_nameIGT
connection_typeHDMI
eld_version[0x2] CEA-861D or belowWhen the two fields are missing, use the ELD version instead. The hdmi-codec shows an all-zero ELD, with
eld_version[0x0], when no sink is connected, so a non-zero version means a monitor is present and its ELD is valid. ELD files that have the fields are handled as before.
Quoted 7 lines
Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39):
kms_hdmi_injectinject-audio fails before and passes after; inject-4k passes both times.This change and its description were written with the help of an AI coding assistant (Claude); the test runs above were done on real hardware.
Move this note about AI use after '---' so it will not enter git log.
Quoted 2 lines
Signed-off-by Roy <[email protected]>
As I wrote, it is better to have full name here like first_name last_name <your@email>
but short nick is also ok, up to you.
+cc Swati Sharma <[email protected]>,
Karthik B S <[email protected]>
Quoted 60 lines
--- lib/igt_eld.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)lib/igt_eld.c +17
-0@@ -167,6 +167,11 @@ static bool parse_sad_field(struct eld_sad *sad, const char *key, char *value)* * Each entry contains one or more SAD blocks. Their contents is exposed in * sadN_* fields. +* +* The monitor_present and eld_valid fields are printed by the HDA HDMI codec +* only. The ASoC hdmi-codec starts at monitor_name and shows an all-zero ELD +* (eld_version [0x0]) when no sink is connected, so without those fields a +* non-zero ELD version means a monitor is present and its ELD is valid. */ static bool eld_parse_entry (const char *path,struct eld_entry *eld) {@@ -175,6 +180,8 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)char *key, *value, *sad_key;size_t len;bool monitor_present = false; +bool has_present = false, has_valid = false; +unsigned int eld_version =0 ;bool sad_ok;int sad_index;@@ -196,10 +203,15 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)/* Skip whitespace at the beginning */ value +=strspn (value,ELD_DELIM ); + has_present |=strcmp (key,"monitor_present" ) ==0 ; + has_valid |=strcmp (key,"eld_valid" ) ==0 ; +if (strcmp (key,"monitor_present" ) ==0 ) monitor_present =strcmp (value,"1" ) ==0 ;else if (strcmp (key,"eld_valid" ) ==0 ) eld->valid =strcmp (value,"1" ) ==0 ; +else if (strcmp (key,"eld_version" ) ==0 ) +sscanf (value,"[0x%x]" , &eld_version);else if (strcmp (key,"monitor_name" ) ==0 )snprintf (eld->monitor_name,sizeof (eld->monitor_name),"%s" , value);@@ -227,6 +239,11 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)fclose (f); +if (!has_present) + monitor_present = eld_version !=0 ; +if (!has_valid) + eld->valid = monitor_present; +if (!monitor_present)igt_debug ("Monitor not present in ELD: %s\n" , path);return monitor_present;Signature · 1 line
2.51.1.windows.1
PATCH v2 1/1 lib/igt_eld: Accept the ASoC hdmi-codec ELD format
In reply to Royeld_parse_entry() only reports a monitor when the ELD file has "monitor_present 1", and eld_get_igt() also needs "eld_valid 1". Those two fields are printed by the HDA HDMI codec only. The ELD files of the ASoC hdmi-codec, used by HDMI audio on Arm boards, start at monitor_name, so every ELD there is treated as having no monitor.
On a Raspberry Pi 5 (vc4), kms_hdmi_inject's inject-audio fails even though the ELD shows the injected EDID:
(kms_hdmi_inject) igt_eld-DEBUG: Monitor not present in ELD: /proc/asound/card0/eld#0 (kms_hdmi_inject) CRITICAL: HDMI ELD missing after retry
while /proc/asound/card0/eld#0 has:
monitor_name IGT
connection_type HDMI
eld_version [0x2] CEA-861D or below
When the two fields are missing, use the ELD version instead. The hdmi-codec shows an all-zero ELD, with eld_version [0x0], when no sink is connected, so a non-zero version means a monitor is present and its ELD is valid. ELD files that have the fields are handled as before.
Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39):kms_hdmi_inject inject-audio fails before and passes after; inject-4k passes both times.
---
v2:
- Move the note about AI use below the --- line (Kamil).
- Use my full name in the author and Signed-off-by (Kamil).
This change was written with the help of an AI coding assistant (Claude); the test runs were done on real hardware.
lib/igt_eld.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
lib/igt_eld.c +17 -0
@@ -167,6 +167,11 @@ static bool parse_sad_field(struct eld_sad *sad, const char *key, char *value)* * Each entry contains one or more SAD blocks. Their contents is exposed in * sadN_* fields. +* +* The monitor_present and eld_valid fields are printed by the HDA HDMI codec +* only. The ASoC hdmi-codec starts at monitor_name and shows an all-zero ELD +* (eld_version [0x0]) when no sink is connected, so without those fields a +* non-zero ELD version means a monitor is present and its ELD is valid. */ static bool eld_parse_entry (const char *path,struct eld_entry *eld) {
@@ -175,6 +180,8 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)char *key, *value, *sad_key;size_t len;bool monitor_present = false; +bool has_present = false, has_valid = false; +unsigned int eld_version =0 ;bool sad_ok;int sad_index;
@@ -196,10 +203,15 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)/* Skip whitespace at the beginning */ value +=strspn (value,ELD_DELIM ); + has_present |=strcmp (key,"monitor_present" ) ==0 ; + has_valid |=strcmp (key,"eld_valid" ) ==0 ; +if (strcmp (key,"monitor_present" ) ==0 ) monitor_present =strcmp (value,"1" ) ==0 ;else if (strcmp (key,"eld_valid" ) ==0 ) eld->valid =strcmp (value,"1" ) ==0 ; +else if (strcmp (key,"eld_version" ) ==0 ) +sscanf (value,"[0x%x]" , &eld_version);else if (strcmp (key,"monitor_name" ) ==0 )snprintf (eld->monitor_name,sizeof (eld->monitor_name),"%s" , value);
@@ -227,6 +239,11 @@ static bool eld_parse_entry(const char *path, struct eld_entry *eld)fclose (f); +if (!has_present) + monitor_present = eld_version !=0 ; +if (!has_valid) + eld->valid = monitor_present; +if (!monitor_present)igt_debug ("Monitor not present in ELD: %s\n" , path);return monitor_present;
Signature · 1 line
2.51.1.windows.1
Patchwork
CI✗ LGCI.VerificationFailed: failure for lib/igt_eld: Accept the ASoC hdmi-codec ELD format (rev2)
In reply to Roy== Series Details ==
== Series Details ==
Series: lib/igt_eld: Accept the ASoC hdmi-codec ELD format (rev2)
URL : https://patchwork.freedesktop.org/series/179743/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_IGTPW_check/244735/ (on cidrm1)