Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 258AF606A320 for ; Mon, 30 Nov 2026 11:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=kTWaPXbu Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CFFC710E5BA; Mon, 30 Nov 2026 11:52:09 +0000 (UTC) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC6FA10E5BA for ; Mon, 30 Nov 2026 11:51:03 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-cded3aee68bso1315166a12.0 for ; Mon, 30 Nov 2026 03:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796039463; x=1796644263; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CG4bPmuNrRZwWqfcozESEG15PZrM+BoOJp/BR1DC26E=; b=kTWaPXbumEuUcow5dXUakEXLzFjBwlDtwBOOwnBUNKwlwlD9RQPz+UxwzLe7Z8vWD2 CVeLOKtgyQwImik1tRoIjoh7kgG/Zfl8WINPRQoCwhmq/hE9Tzo7a662Jw0N4KYRIWKW 8JsXdmWClskctuOhpEfRBL9+/jW22+iReNME6QIQL157c2TDuvZ6YSggGReMVzX85iOa jMhIcKdpeh/choBDARoRuRAu3d6DTts1nRShhd8y9nn1SSgVzQOBa3VF+Q/pA1YBA7BS tSFCqbtH51h/fyfET6IouY0h5NESJE2qPTihngRkZK+7D123NNvAIucOyhPDLhooLUQc zSfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796039463; x=1796644263; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CG4bPmuNrRZwWqfcozESEG15PZrM+BoOJp/BR1DC26E=; b=fjxUX0pR68SwmfzDUr3a2VGZW0ikyaE2TrBROIuM4zSvIqkAmKkndveAkHJXjsEHbf sseDnz/ZtWKEHWH5GvDwQSONeKjoHy1L+6QGRvrbHhvRYE+tkcWyPYQL6bBfTjlZdSXq lu0BOCGXcLsiaEU9Ok4FDaTJywtSdAZMDFF3zuqrRRsW+SUcb7GJ95/SsC1vBmNXrn5f CjQhRrYzs16w+Sv4ijSGIaHaUOD2zACg9UshHvCEeKWY786SIw4ecQrNXIv09IzT8EEy L4LKZ3lWuYvl2sd1hqafgJF4DPx4kJFwChsF4exxs4SqX9eUrVlif5d01j2yh82P7bDW KylA== X-Gm-Message-State: APuU4Z9xBRaAEicJEp6Udn5WC2FqJ0CDlhuskdHixv4/ZLTLFE7ZA2iV pq+Z2hBUCFuXDN/2RDXch8U0wd/OAJkiMPG4eOADfaYuuTrZntC/ZY0ClQNm1piS X-Gm-Gg: AZFdTZf27aMjPIzklb/d0KAaI4e0TDNOC4qECH3CAsNBmn4ShaAr9TOKXl8yavNC3f9 nZFl+bwTCu1QL6soqTyO7TBuaUUAx1M37Gqxk4DH5PIc/2sY6IyuQy6czbB0Mb4mOaqb7QNFkF8 ST5HQQKcvTqBw0VDM7n9IYe2swU6TfCtQJKwpVgH1jKSv6aAKU5MVhfJjMPdFEkAZFrykYStenN cuoR/THOQMbHBYeT9EZ/OdhHRqAvzbuKFyey/MD+SRQprmHvnlfd1bgwhL4I6zhNeVxcuU4lNnP aSK7/5k9/d6yPa9xj9pX1HInWkwx1Joqn7RasfeNvo/HQyjEauXb0dOlDSKbKU55FdMPUaovNSF 6SNaWN5eh/ZkdZgQQsMOMPnjsM1xLQZnlz9RW3L5q3L6a1glob70QT0R4aCirypVr97X8D9L1Jd X3nkN+zlVnmTxYizVKXlrwxH2+RPG7j9GaqT8NqhSR2fJOO/nMumsjCLZI20IUnG/AFicOyrmS+ FGmkq6kLGTOtM9oW6W8MaM1wc+m3gxa79PD4xf0zujXzABPFASqe165bWwJkXkTcOGQx6uok1+q fuzq7jgm1IwcccLAD0MtMqNU/EsmVKqYc6jZvUmlZprrpuxHRsZwr1jj1o+B8p9hWmAvyWkcPRr hshNzLFY= X-Received: by 2002:a17:903:244b:b0:2e5:457d:6c20 with SMTP id d9443c01a7336-2f031f7a49emr274681415ad.23.1796039462839; Mon, 30 Nov 2026 03:51:02 -0800 (PST) Received: from DESKTOP-TPPBPA1 (36-226-254-86.dynamic-ip.hinet.net. [36.226.254.86]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0667679d8sm146553955ad.48.2026.11.30.03.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 03:51:02 -0800 (PST) From: Lin Tzu Yang To: igt-dev@lists.freedesktop.org Cc: kamil.konieczny@linux.intel.com, swati2.sharma@intel.com, karthik.b.s@intel.com Subject: [PATCH i-g-t v2] lib/igt_eld: Accept the ASoC hdmi-codec ELD format Date: Mon, 30 Nov 2026 19:50:59 +0800 Message-ID: <20261130115059.842838-1-rongh7426@gmail.com> X-Mailer: git-send-email 2.51.1.windows.1 In-Reply-To: <20261126105345.656307-1-rongh7426@gmail.com> References: <20261126105345.656307-1-rongh7426@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "igt-dev" X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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. Signed-off-by: Lin Tzu Yang --- 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(+) diff --git a/lib/igt_eld.c b/lib/igt_eld.c index 0d3c668..51d2ee7 100644 --- a/lib/igt_eld.c +++ b/lib/igt_eld.c @@ -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; -- 2.51.1.windows.1