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 7E8D8C87FCF for ; Sat, 26 Jul 2025 00:38:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D23310E46A; Sat, 26 Jul 2025 00:38:53 +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="el9pm0Cp"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FF9110E46A; Sat, 26 Jul 2025 00:38:52 +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=YEB75q31Q5qGDdE0t14g3xJnrMQ0Q3G0S0xkHp/gBBI=; b=el9pm0Cp+5MyvWR7k5Uamh3yA8 WJo70Vjh1Omoz8kvsCXF+a9OLSsse9XP3mXh8Hk9fbkam2+bwJMFeTfO5NKiwfuhnANjvpRehTw1s gtQzrNC3YM2emlL6fHkka2pFFSkAAHHH/4gUOiG8ZIz07wge2n1J+vGvjcsuvuSUtdE8pD8Gq5UkW JYqeNd1aZ08mueVN1q+0u3q5iYat2q0nounAYAGk5JOscgBbxUspXhmIMynqcD3zeHxeLCpg15hph rfbMJ6iro4q9FDjqBJIvzLyyZIg8xfGNSujYrV6v6GnKEp3gqbZL/HLhIBGSXaJAtDfF6gGMswe3q AJvoE0sQ==; 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 1ufSvz-003wod-UB; Sat, 26 Jul 2025 02:38:44 +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 03/14] drm/amd/display: use drm_edid_product_id for parsing EDID product info Date: Fri, 25 Jul 2025 21:33:04 -0300 Message-ID: <20250726003816.435227-4-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" Use drm_edid_product_id [1] to get debug info from drm_edid instead of directly parsing raw EDID. [1] 3ddbd345539e ("drm/edid: add drm_edid_get_product_id()"). Signed-off-by: Melissa Wen -- v5: - replace series url to commit hash (Mario) --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 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 1edab2a440e4..5411d6029dac 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 @@ -109,6 +109,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps( struct drm_device *dev = connector->dev; struct edid *edid_buf = edid ? (struct edid *) edid->raw_edid : NULL; const struct drm_edid *drm_edid; + struct drm_edid_product_id product_id; struct cea_sad *sads; int sad_count = -1; int sadb_count = -1; @@ -125,13 +126,13 @@ enum dc_edid_status dm_helpers_parse_edid_caps( if (!drm_edid_valid(drm_edid)) result = EDID_BAD_CHECKSUM; - edid_caps->manufacturer_id = (uint16_t) edid_buf->mfg_id[0] | - ((uint16_t) edid_buf->mfg_id[1])<<8; - edid_caps->product_id = (uint16_t) edid_buf->prod_code[0] | - ((uint16_t) edid_buf->prod_code[1])<<8; - edid_caps->serial_number = edid_buf->serial; - edid_caps->manufacture_week = edid_buf->mfg_week; - edid_caps->manufacture_year = edid_buf->mfg_year; + drm_edid_get_product_id(drm_edid, &product_id); + + edid_caps->manufacturer_id = product_id.manufacturer_name; + edid_caps->product_id = le16_to_cpu(product_id.product_code); + edid_caps->serial_number = le32_to_cpu(product_id.serial_number); + edid_caps->manufacture_week = product_id.week_of_manufacture; + edid_caps->manufacture_year = product_id.year_of_manufacture; drm_edid_get_monitor_name(edid_buf, edid_caps->display_name, -- 2.47.2