public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: airlied@gmail.com, alexander.deucher@amd.com, alex.hung@amd.com,
	andrzej.hajda@intel.com, christian.koenig@amd.com,
	harry.wentland@amd.com, jernej.skrabec@gmail.com,
	jonas@kwiboo.se, Laurent.pinchart@ideasonboard.com,
	maarten.lankhorst@linux.intel.com, mario.limonciello@amd.com,
	mripard@kernel.org, mwen@igalia.com, neil.armstrong@linaro.org,
	rfoss@kernel.org, simona@ffwll.ch, siqueira@igalia.com,
	sunpeng.li@amd.com, tzimmermann@suse.de
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Michel Daenzer <michel.daenzer@mailbox.org>,
	Timur Kristóf <timur.kristof@gmail.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	kernel-dev@igalia.com
Subject: [PATCH v8 8/8] drm/amd/display: get SADB from drm_eld when parsing EDID caps
Date: Wed, 25 Feb 2026 09:04:37 -0300	[thread overview]
Message-ID: <20260225121903.236115-9-mwen@igalia.com> (raw)
In-Reply-To: <20260225121903.236115-1-mwen@igalia.com>

drm_edid_connector_update() updates display info, filling ELD with
speaker allocation data in the last step of update_dislay_info(). Our
goal is stopping using raw edid, so we can extract SADB from drm_eld
instead of access raw edid to get audio caps.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c    | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 519b80f43b90..4f0e8e46f0bd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -108,9 +108,8 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
 	struct edid *edid_buf = edid ? (struct edid *) edid->raw_edid : NULL;
 	const struct drm_edid *drm_edid;
 	struct drm_edid_product_id product_id;
-	int sad_count, sadb_count;
+	int sad_count;
 	int i = 0;
-	uint8_t *sadb = NULL;
 	enum dc_edid_status result = EDID_OK;
 
 
@@ -161,20 +160,11 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
 		edid_caps->audio_modes[i].sample_size = sad.byte2;
 	}
 
-	sadb_count = drm_edid_to_speaker_allocation((struct edid *) edid->raw_edid, &sadb);
-
-	if (sadb_count < 0) {
-		DRM_ERROR("Couldn't read Speaker Allocation Data Block: %d\n", sadb_count);
-		sadb_count = 0;
-	}
-
-	if (sadb_count)
-		edid_caps->speaker_flags = sadb[0];
+	if (connector->eld[DRM_ELD_SPEAKER])
+		edid_caps->speaker_flags = connector->eld[DRM_ELD_SPEAKER];
 	else
 		edid_caps->speaker_flags = DEFAULT_SPEAKER_LOCATION;
 
-	kfree(sadb);
-
 cleanup:
 	drm_edid_free(drm_edid);
 	return result;
-- 
2.51.0


  parent reply	other threads:[~2026-02-25 12:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 12:04 [PATCH v8 0/8] drm/amd/display: more drm_edid to AMD display driver (partial) Melissa Wen
2026-02-25 12:04 ` [PATCH v8 1/8] drm/amd/display: make sure drm_edid stored in aconnector doesn't leak Melissa Wen
2026-02-25 12:04 ` [PATCH v8 2/8] drm/amd/display: start using drm_edid helpers to parse EDID caps Melissa Wen
2026-02-25 12:04 ` [PATCH v8 3/8] drm/amd/display: use drm_edid_product_id for parsing EDID product info Melissa Wen
2026-02-25 12:04 ` [PATCH v8 4/8] drm/amd/display: use drm_edid helper to set analog EDID caps Melissa Wen
2026-02-25 12:04 ` [PATCH v8 5/8] drm/edid: introduce a helper that gets monitor name from drm_edid Melissa Wen
2026-02-25 12:04 ` [PATCH v8 6/8] drm/amd/display: get panel id with drm_edid helper Melissa Wen
2026-02-25 12:04 ` [PATCH v8 7/8] drm/amd/display: get SAD from drm_eld when parsing EDID caps Melissa Wen
2026-02-25 12:04 ` Melissa Wen [this message]
2026-02-27  3:29 ` Claude review: drm/amd/display: more drm_edid to AMD display driver (partial) Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260225121903.236115-9-mwen@igalia.com \
    --to=mwen@igalia.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrzej.hajda@intel.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel-dev@igalia.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mario.limonciello@amd.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=timur.kristof@gmail.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox