From patchwork Wed Sep 11 21:35:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13801140 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 C943EEE57E1 for ; Wed, 11 Sep 2024 21:36:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E8D410EABF; Wed, 11 Sep 2024 21:36:08 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="BAnHwzo6"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id D04C310EABC; Wed, 11 Sep 2024 21:36:02 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A83655C0774; Wed, 11 Sep 2024 21:35:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C723C4CEC6; Wed, 11 Sep 2024 21:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726090562; bh=1T51Tb6/BNcKzoFLfJU76j99M3iPitxo8d33dkbNssY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BAnHwzo6smNkSBNq412Nc2CMyZIpbi8OGfbMyZ3SJfw0IolgvlxwkXRoE3fXdrORT RjBhk919f6Ie8kFGqM0/PvIJwm1tj7yh7t9IugLI18P64ekGJtTrLqdQPIHulh3QBp n0UvuLxuRpkUVs7Os59q6X8VDO9+g455Ko3IGI99lqVYx/DFBrhALhFNSAOWhHEuZa ZoBQszGVrYPyQUatSON0X/KoKRIntPaVkEYlqBchzsSaKxenLvEysxYii59bONKujo Je5GgPhXDrlULIVoFoZBWYzeWfLv1mwJM7MazSCwM6bOrSxx+04g8sckYn77DmmUXy qTeiKmqXLV0mA== From: Mario Limonciello To: Alex Hung , Alexander Deucher , Melissa Wen Cc: kernel-dev@igalia.com, Mario Limonciello , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, harry.wentland@amd.com, sunpeng.li@amd.com, Mark Pearson Subject: [PATCH v6 08/10] drm/amd/display: get SADB from drm_eld when parsing EDID caps Date: Wed, 11 Sep 2024 16:35:34 -0500 Message-ID: <20240911213537.2338164-9-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911213537.2338164-1-superm1@kernel.org> References: <20240911213537.2338164-1-superm1@kernel.org> 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" From: Melissa Wen 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 Signed-off-by: Mario Limonciello --- v6: Move changelog below cutlist v5: add more informative commit description (Alex H) --- .../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 1bc9c12ab120..72ea78ff2c5b 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 @@ -98,9 +98,8 @@ enum dc_edid_status dm_helpers_parse_edid_caps( const struct drm_edid *drm_edid = aconnector->drm_edid; struct drm_edid_product_id product_id; struct edid *edid_buf = edid ? (struct edid *) edid->raw_edid : NULL; - int sad_count, sadb_count; + int sad_count; int i = 0; - uint8_t *sadb = NULL; enum dc_edid_status result = EDID_OK; @@ -144,20 +143,12 @@ 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); - return result; }