From patchwork Fri Apr 11 20:08:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 14048702 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 2DCD5C369B1 for ; Fri, 11 Apr 2025 20:14:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8348F10EC97; Fri, 11 Apr 2025 20:14:18 +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="TBSSzx6F"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E5DF10EC94; Fri, 11 Apr 2025 20:14:17 +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=kNH4EoiW+25DXwI9IK1z0N9UI+fH7xxFQRZdVpHfKSc=; b=TBSSzx6F9hzC+VZvAX3AqBEAW6 DZqAh3yrzBbHUMmlbnm7yF1PYYIu86W1nVvISIRMAJpJaafoaqEGTnR2xabhNYdwqJz3W0biS99a2 XbMgsCDcOZ+cLPu6Keu/rOxl7y9iETXFcImAcT5816m2aoHl0EcVHBEsb1acYGQm+J9sfiqvzbKlK OBJGmiCxT31PoDlmwMReZDOpWCm/eUyIkVw9aRc9Aco11IOSsyUvXr9oU84y0kFXPx9Kp4E8iWkUK HaGf651TVFUH2szqBbYm7Taxw44r+AdEpyqKSHWVw1n6xtTkcSWFcEmK/Tm5yoODmj5FUA+cV8JHu QlFmcmuA==; Received: from [189.6.35.67] (helo=killbill.home) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1u3KlP-00FIP5-OD; Fri, 11 Apr 2025 22:14:12 +0200 From: Melissa Wen To: Alex Hung , Mario Limonciello , 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: Jani Nikula , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-dev@igalia.com Subject: [PATCH 06/13] drm/amd/display: get SADB from drm_eld when parsing EDID caps Date: Fri, 11 Apr 2025 17:08:36 -0300 Message-ID: <20250411201333.151335-7-mwen@igalia.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250411201333.151335-1-mwen@igalia.com> References: <20250411201333.151335-1-mwen@igalia.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Signed-off-by: Melissa Wen --- .../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 ca9fe423e18e..a96f527a59df 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,10 +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; if (!edid_caps || !edid) @@ -157,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;