From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C671C87FCA for ; Sat, 26 Jul 2025 00:39:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4305D10EA2A; Sat, 26 Jul 2025 00:39:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="NnCR29uf"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id D25DF10EA2A; Sat, 26 Jul 2025 00:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XOMKudt2IDPBJatqa+F6NOTrbCwkRbn6eEdJfk7Q7o4=; b=NnCR29ufb4aUp4/qLoQheuJg/1 sewT2Ect//O/TyqRe2vMfX6z0AKWjO1AEfd9pHaL3O0Gl9G8ZITgBK2Xr8DZlu7lnihocp4McfBD3 VMAw2BZmy6xOF1I5EoCwp6QSbF7sb/KUhjAZoKK9mypMfeT3XI6qlmE+Qt4MoGpm68YU0QtxCELWw /poqp6Q7kuOAUaqrl6UMXEe+F0N6a455USzBT5bx3RYhCsQWWimQE3CKd+dm8Heqf/B3pSUDRd3JW lFgPQ2r0/LkEXo/wzyqhSzzfd5QwR+xyqKZZmrLqo2hSbd2FAXMeN8q3PPiiuMVyUrW7MpJfJSPRF jRyDBVUg==; Received: from [189.6.13.79] (helo=killbill.home) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1ufSwM-003wod-BH; Sat, 26 Jul 2025 02:39:06 +0200 From: Melissa Wen To: Mario Limonciello , Alex Hung , Rodrigo Siqueira , harry.wentland@amd.com, sunpeng.li@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch Cc: Michel Daenzer , Jani Nikula , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, kernel-dev@igalia.com Subject: [PATCH v6 07/14] drm/amd/display: get SADB from drm_eld when parsing EDID caps Date: Fri, 25 Jul 2025 21:33:08 -0300 Message-ID: <20250726003816.435227-8-mwen@igalia.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250726003816.435227-1-mwen@igalia.com> References: <20250726003816.435227-1-mwen@igalia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" 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 Signed-off-by: Melissa Wen --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 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 2e6116a6b518..ab8dad538308 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 @@ -106,9 +106,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; @@ -156,19 +155,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); drm_edid_free(drm_edid); return result; -- 2.47.2