From patchwork Sat Jul 6 03:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 13725633 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 D86FFC38150 for ; Sat, 6 Jul 2024 03:41:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B75710E322; Sat, 6 Jul 2024 03:41:11 +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="c7GAy7uD"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3262510E322; Sat, 6 Jul 2024 03:41:10 +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=AnsOKoEzDmNSzE92+IKLJ2v1TxbNdRSLqT9vi1safok=; b=c7GAy7uDpxzBz3DpD6wGPkEs09 1ChdX+qkafJbBdLildnDAx1nswSpQlqTkMZnjhHT8NaO9nlZNUsYjZrYYiwzKmSeFdz2Ga5cLcqJD Mq/U+Jk9EAPl2mOcH7nz7UXKy0E26Hru10fIzSHX7t9NL7L6+aEw/2OJhWBTL3hP04lwa5gG8K6Sz mmjGPNmuU9ZgjYqExTnLx5ieUE9nhqIb4XcmVlZVS0Ie9Iwhei119JUMrUmI3Z7CviDOABwvlFzoP nu2FycB+aZbw7Ze2L4x/lyDvgzaqjudINL+Zzr80yx0Pwpe1S+EpHZqUNMRA/Hi4yh0uyGb2VyIKf o5PZEBgA==; Received: from [189.6.17.125] (helo=killbill.home) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1sPwIL-00Bj27-Fa; Sat, 06 Jul 2024 05:41:06 +0200 From: Melissa Wen To: harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: Alex Hung , Mario Limonciello , Jani Nikula , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-dev@igalia.com Subject: [PATCH v4 10/11] drm/amd/display: get SADB from drm_eld when parsing EDID caps Date: Sat, 6 Jul 2024 00:35:11 -0300 Message-ID: <20240706034004.801329-11-mwen@igalia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240706034004.801329-1-mwen@igalia.com> References: <20240706034004.801329-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" instead of parsing struct edid. 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 45c04de08c65..3fb07f437793 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 @@ -97,9 +97,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; @@ -143,20 +142,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; }