From patchwork Tue May 14 12:55:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13664083 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 E6CC5C04FFE for ; Tue, 14 May 2024 12:55:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAC6110E5CC; Tue, 14 May 2024 12:55:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="MAt8yKQ1"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id E385810E5CC for ; Tue, 14 May 2024 12:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715691345; x=1747227345; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fqmhO3wAvGOr+Ed4Ge08sneB6jFgcpp+F7cJwrcjgA8=; b=MAt8yKQ1TOqcJQ+JUhCbF3XbnS02Wgu0QLC21RyXGN3h74rqtIAAUxhN URAlOf0pKcaovLfGKCjEZdn6fNfHwZufulUQDURt/kUfHhemokzqLN4wq KTg9BYiutvPG0OafbQp+0oz1EClXHVl4+rjA3dJt73ZyVbpZxDAo/TVZJ yo0a+DgVa78FQsSGuZUa31oqBZKgN30iBUUNqijQHvrpo08HnkIB/ndzF EANz3Cp3cZbv0t/iOY6yTjifTOOkxF/swvZbwYzMINEtApUWJ2skB9HQL Suwh78kfBtaySZpCUDGdPEg/m+mvVrk6yj3XTEmSBSvshzCnqHUQydfvx w==; X-CSE-ConnectionGUID: wmwrDHttRE67zqqoNFrNLQ== X-CSE-MsgGUID: Dn9eRyRFSOSSL/rwRdgijg== X-IronPort-AV: E=McAfee;i="6600,9927,11073"; a="15458715" X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208";a="15458715" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2024 05:55:45 -0700 X-CSE-ConnectionGUID: 2GTEnCgRRKaO1AjjKzarkw== X-CSE-MsgGUID: E4EvIwMvSc2tg1wP9PwESw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208";a="30507466" Received: from mjarzebo-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.91]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2024 05:55:41 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: jani.nikula@intel.com, Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Subject: [PATCH 03/11] drm/bridge: analogix_dp: convert to struct drm_edid Date: Tue, 14 May 2024 15:55:09 +0300 Message-Id: <6f3bd1233a0922551761666f0c96c3766e3c5f96.1715691257.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Prefer the struct drm_edid based functions for reading the EDID and updating the connector. Signed-off-by: Jani Nikula Reviewed-by: Dmitry Baryshkov --- Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann --- .../gpu/drm/bridge/analogix/analogix_dp_core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 7b841232321f..9360b63ad37c 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1108,7 +1108,7 @@ static int analogix_dp_prepare_panel(struct analogix_dp_device *dp, static int analogix_dp_get_modes(struct drm_connector *connector) { struct analogix_dp_device *dp = to_dp(connector); - struct edid *edid; + const struct drm_edid *drm_edid; int ret, num_modes = 0; if (dp->plat_data->panel) { @@ -1120,12 +1120,13 @@ static int analogix_dp_get_modes(struct drm_connector *connector) return 0; } - edid = drm_get_edid(connector, &dp->aux.ddc); - if (edid) { - drm_connector_update_edid_property(&dp->connector, - edid); - num_modes += drm_add_edid_modes(&dp->connector, edid); - kfree(edid); + drm_edid = drm_edid_read_ddc(connector, &dp->aux.ddc); + + drm_edid_connector_update(&dp->connector, drm_edid); + + if (drm_edid) { + num_modes += drm_edid_connector_add_modes(&dp->connector); + drm_edid_free(drm_edid); } ret = analogix_dp_prepare_panel(dp, false, false);