From patchwork Tue Apr 16 13:22:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13631809 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8DA24C4345F for ; Tue, 16 Apr 2024 13:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JPFPX3gvOsrXuqD4F/i0JhCRI/GZ2i321ZtgalVUKzU=; b=H1WwTxeyX5PsLt CAgb7yf55LGyshZ8303P7CHNJtG7Bf+gB9zjkIF/FvkR4NX6RJcyo8H/ct9FpSAds7NsGxGtvYqZP DPGAPH/uFvcjc4J1OuRMu+Pv+aJ/VOnu8+xDqdz1m2VHjjxyk1iNkPWM4Z3fMxstG60sjR4vperVn Wq9q3nzXseVu5QpnKySiNVV4cxm4CO+bduFlvmezpTB4Dj1IT3bU3TCfUMCIjbXBDysZXJmyxbEMv cMneBXQ2mWY5z7+ZlgocHcVSGGzkBeOcNUWawZ9Vs0PLeWZvHeIcMelX1+MKcpQlyH98T1igSWnkW rzWhjXtvADb06oA32iDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwims-0000000CIBg-3QF6; Tue, 16 Apr 2024 13:23:50 +0000 Received: from mgamail.intel.com ([198.175.65.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwimm-0000000CI9I-2kRv; Tue, 16 Apr 2024 13:23:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713273825; x=1744809825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oG2GtV3nt+5QkO7h/AQtyjTIPvu8JRijgCsInOXsQmY=; b=bbk3X60RDIlFKh+jaBTx6pcSL+nj8u1MDFBWzcYZTIiW7TpbmA6k5LPJ u5VqqSrtGhOCsJQ8Min1CcfmuniIFtT90t2Kaf7Hlou6XkhHk03IB0AZR jvETlCybrHnY2MPPVgf3ofNSUPw2/Bmuvp42l7xb3XbMqJnVlO1Bh1BLJ AGDXiTvfli4DGym1dvJJK2H+xqFQQeCXSz1erxPW+6kfN/2D5MtaASJdq hKEeWNUvmZtunWGU9DP2W0Tx+IeXGIwSyXTKu0/+uwFfQJuRz/WgsrLf3 J/iv4ePlNk2HLbPSR0kVjd7shNwtPBSKvfc6rj8MWHdKxzA8StsId2EAF Q==; X-CSE-ConnectionGUID: gDlbl36qS5ip3FmnyqG3iQ== X-CSE-MsgGUID: gcRpOYMeTV2Hl0EXPggvxQ== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="20131400" X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="20131400" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:23:43 -0700 X-CSE-ConnectionGUID: N7hGG/BORvyEuSp7FzE8Ig== X-CSE-MsgGUID: KQolT1WkSp6IgVi/HsO/bg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="27055466" Received: from martakit-mobl.ger.corp.intel.com (HELO localhost) ([10.252.44.100]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:23:40 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: Jani Nikula , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 13/15] drm/rockchip: cdn-dp: switch to struct drm_edid Date: Tue, 16 Apr 2024 16:22:27 +0300 Message-Id: <59d2feb9f8b28d1a1cf49077a35941aa9b3d36af.1713273659.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240416_062344_761523_5B126EAE X-CRM114-Status: GOOD ( 15.48 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Prefer struct drm_edid based functions over struct edid. Signed-off-by: Jani Nikula Acked-by: Heiko Stuebner --- Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Andy Yan Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 33 +++++++++++++++----------- drivers/gpu/drm/rockchip/cdn-dp-core.h | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index a855c45ae7f3..9e3d7cb84c5d 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -262,20 +262,21 @@ static const struct drm_connector_funcs cdn_dp_atomic_connector_funcs = { static int cdn_dp_connector_get_modes(struct drm_connector *connector) { struct cdn_dp_device *dp = connector_to_dp(connector); - struct edid *edid; int ret = 0; mutex_lock(&dp->lock); - edid = dp->edid; - if (edid) { + + if (dp->drm_edid) { + /* FIXME: get rid of drm_edid_raw() */ + const struct edid *edid = drm_edid_raw(dp->drm_edid); + DRM_DEV_DEBUG_KMS(dp->dev, "got edid: width[%d] x height[%d]\n", edid->width_cm, edid->height_cm); - dp->sink_has_audio = drm_detect_monitor_audio(edid); - - drm_connector_update_edid_property(connector, edid); - ret = drm_add_edid_modes(connector, edid); } + + ret = drm_edid_connector_add_modes(connector); + mutex_unlock(&dp->lock); return ret; @@ -380,9 +381,13 @@ static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp) return ret; } - kfree(dp->edid); - dp->edid = drm_do_get_edid(&dp->connector, - cdn_dp_get_edid_block, dp); + drm_edid_free(dp->drm_edid); + dp->drm_edid = drm_edid_read_custom(&dp->connector, + cdn_dp_get_edid_block, dp); + drm_edid_connector_update(&dp->connector, dp->drm_edid); + + dp->sink_has_audio = dp->connector.display_info.has_audio; + return 0; } @@ -488,8 +493,8 @@ static int cdn_dp_disable(struct cdn_dp_device *dp) dp->max_lanes = 0; dp->max_rate = 0; if (!dp->connected) { - kfree(dp->edid); - dp->edid = NULL; + drm_edid_free(dp->drm_edid); + dp->drm_edid = NULL; } return 0; @@ -1131,8 +1136,8 @@ static void cdn_dp_unbind(struct device *dev, struct device *master, void *data) pm_runtime_disable(dev); if (dp->fw_loaded) release_firmware(dp->fw); - kfree(dp->edid); - dp->edid = NULL; + drm_edid_free(dp->drm_edid); + dp->drm_edid = NULL; } static const struct component_ops cdn_dp_component_ops = { diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.h b/drivers/gpu/drm/rockchip/cdn-dp-core.h index 5b2fed1f5f55..8e6e95d269da 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.h +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.h @@ -70,7 +70,7 @@ struct cdn_dp_device { struct drm_display_mode mode; struct platform_device *audio_pdev; struct work_struct event_work; - struct edid *edid; + const struct drm_edid *drm_edid; struct mutex lock; bool connected; From patchwork Tue Apr 16 13:22:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13631810 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C22EDC4345F for ; Tue, 16 Apr 2024 13:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UQ1Iq+wVdeqI42XpB1JzJ85xcuX3Z57vrxrxzf6I2JQ=; b=lDcTJ/q679oUr9 eK1/8YFLrkrzw1wUptaxWIX/OaOl2j1WpezXVbFPQhqqWj/AFKLK+pw26gRExJUq8GSovCC24qbvz X3Uzki+Cdj71AyLuTWr9ygo+bsF/rI1++GnQrsXnuWEisRgpPHHRTyJPn94w1AGI/3BZy/rglgrOZ 5tSyzBCN3Oy3ZC1Krg/5zymK9I1SGYC4v4sRjz/YALVwENShHVz8TTqeJcEHD80pUY26rumqkCZ5m c27KKcxDkYpVVfchgr4zREWdSjIM9Q/VEOrWD0ID8qeHLNAYPB3ZpC0i1WIyKsQ27lumDc6Bnfv4T qJgSvOKvvT4RlJS1OxYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwin7-0000000CIJe-0zN8; Tue, 16 Apr 2024 13:24:05 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwimr-0000000CIAE-2BBq; Tue, 16 Apr 2024 13:23:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713273830; x=1744809830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5nXrXIDLBlKi4Z6zegaSBQ/zMeZdxeF3Ujvn8Hi1gnk=; b=EK3RQMTSE11G29MPeyBgJSfIxC4QL50IywIDoUOjgM411ubSsW9uoiu0 FHgrUV0tKc1QcRFJcROvhYD+eRgVFdojIvdMKodn6hxSEr21dqYbXQJCX ec/a36A/RP3/fvrWdZUZsPimRGhpoWCVaGjl5cx4RWjMiPtQgIH8LDVdy Y3JOzhcXMKOvYKRrgfAfPvGQTB9eVKac51GaHvxmBeZnh/XlJKSaA6EiK hVGQaDBNz0S2bzr7yW8JOWTC4HF7HChk3SxHf1TRQ1Yw4z3Kh6fWAMni8 lQ4IcaxnkXchmxNYlOraYKYh3MBle6CYGLpq7IaQCoXP0Ga8nf9Ote1kt Q==; X-CSE-ConnectionGUID: EvJE/QMZRFWovDvWnr2RhA== X-CSE-MsgGUID: KS1MuhGtTcGc2lrvLzCniQ== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="31191369" X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="31191369" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:23:48 -0700 X-CSE-ConnectionGUID: BovRYRspTR2fPsG8cCa1qw== X-CSE-MsgGUID: aN/gRYSTT62HH5y/HjjR9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="22326162" Received: from martakit-mobl.ger.corp.intel.com (HELO localhost) ([10.252.44.100]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:23:45 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: Jani Nikula , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 14/15] drm/rockchip: inno_hdmi: switch to struct drm_edid Date: Tue, 16 Apr 2024 16:22:28 +0300 Message-Id: <1218cb4fd79149c90dc0c82c42ae0c8a36acf055.1713273659.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240416_062349_701262_03D07295 X-CRM114-Status: GOOD ( 10.02 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Prefer struct drm_edid based functions over struct edid. Signed-off-by: Jani Nikula Acked-by: Heiko Stuebner --- Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Andy Yan Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org --- drivers/gpu/drm/rockchip/inno_hdmi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 1d2261643743..3df2cfcf9998 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -606,18 +606,16 @@ inno_hdmi_connector_detect(struct drm_connector *connector, bool force) static int inno_hdmi_connector_get_modes(struct drm_connector *connector) { struct inno_hdmi *hdmi = connector_to_inno_hdmi(connector); - struct edid *edid; + const struct drm_edid *drm_edid; int ret = 0; if (!hdmi->ddc) return 0; - edid = drm_get_edid(connector, hdmi->ddc); - if (edid) { - drm_connector_update_edid_property(connector, edid); - ret = drm_add_edid_modes(connector, edid); - kfree(edid); - } + drm_edid = drm_edid_read_ddc(connector, hdmi->ddc); + drm_edid_connector_update(connector, drm_edid); + ret = drm_edid_connector_add_modes(connector); + drm_edid_free(drm_edid); return ret; } From patchwork Tue Apr 16 13:22:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13631811 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1A3A7C04FF9 for ; Tue, 16 Apr 2024 13:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8F8g/oScjuwhjFpTPmKV407KhtXsRFE8p3XmJ91CC0o=; b=0YhajwNMeovPdm siHYh702cRIZk+6837VCQ5QW8uYRTnfsnauiFSa1+iI5KfCBW+aRa4AgFyAMN/P1mAeFP+WSwSopx dKRLXCyWpsP2deA3S7CO+Nc2ry3uTwlL4aGOzfNGeHzc3XLCI0OHJT/zF2N9r/7/6IHjM6EN7jzT2 HXXwjMQamRS+6XZFWdMhvRH5Woj120FxHKt9MSgKWDLw0pch457zM3EfQpBICjnbrBADW4ZjDD5ul qqq2sD5rzNyn4hQFDYOlVGuJxiYJEw/aiS0vJ7E4GmK7l8bYEIGmfATc8xubQYIhNQOnMCwjG5sqH dnJlwcTxP8aanHNt0s7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwinD-0000000CIMR-1WH0; Tue, 16 Apr 2024 13:24:11 +0000 Received: from mgamail.intel.com ([192.198.163.19]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwimv-0000000CICw-00i4; Tue, 16 Apr 2024 13:23:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713273834; x=1744809834; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9ad/OeNIb41awZjNgaw6mdG+DAmsdITzEiZNtm/IXMU=; b=Vz4oS926MMxVxpJJ6vzLc7QI+Lxj3b+b/zF54XzKAL/T/30+OvDhe7RD Ql2rdxwxD1Oab1Ob1M+xIVFCWAu7RKPaORrVYuzDXBNcD6ZV2FaVgzzbo KNVnV1WHjjSukjLXS2ARMXpVfBVa2X9dkl6p9OkCbD03hjTsIWfN1Ade7 zN85um2nPzHsBVYFztqrwcaHHV1A1peiqGJ3wm5WKzqp4D/iR7xXmUJvx +JWrfK1741WKzuaYTOrTU45GbHdoAdMHIPRsM6zEpUg5tRlIHFX4jzBz5 hpkFY1w1vGvA7/5jRduemnPF7uRtvRrdSvMj5q/J5ukthZFXCcKYkVBJY Q==; X-CSE-ConnectionGUID: Jf1ZDQTQS/OGvFBrZcBquA== X-CSE-MsgGUID: eX2mYlT+TIebgvAg9wp6cQ== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="8571790" X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="8571790" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:23:54 -0700 X-CSE-ConnectionGUID: v7ShSl14RJeH8tmgR1Fa1Q== X-CSE-MsgGUID: yY7cMnh0TZelqeNhrO7x7w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="53438796" Received: from martakit-mobl.ger.corp.intel.com (HELO localhost) ([10.252.44.100]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:23:50 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: Jani Nikula , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 15/15] drm/rockchip: rk3066_hdmi: switch to struct drm_edid Date: Tue, 16 Apr 2024 16:22:29 +0300 Message-Id: <56ee6b7c3c018df55f5fe48a3e6d705dbad5ef74.1713273659.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240416_062353_173932_8CD44E74 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Prefer struct drm_edid based functions over struct edid. Signed-off-by: Jani Nikula Acked-by: Heiko Stuebner --- Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Andy Yan Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org --- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c index 95cd1b49eda8..784de990da1b 100644 --- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c +++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c @@ -466,18 +466,16 @@ rk3066_hdmi_connector_detect(struct drm_connector *connector, bool force) static int rk3066_hdmi_connector_get_modes(struct drm_connector *connector) { struct rk3066_hdmi *hdmi = connector_to_rk3066_hdmi(connector); - struct edid *edid; + const struct drm_edid *drm_edid; int ret = 0; if (!hdmi->ddc) return 0; - edid = drm_get_edid(connector, hdmi->ddc); - if (edid) { - drm_connector_update_edid_property(connector, edid); - ret = drm_add_edid_modes(connector, edid); - kfree(edid); - } + drm_edid = drm_edid_read_ddc(connector, hdmi->ddc); + drm_edid_connector_update(connector, drm_edid); + ret = drm_edid_connector_add_modes(connector); + drm_edid_free(drm_edid); return ret; }