From patchwork Thu Aug 22 17:42:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13774044 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 4D716C3DA4A for ; Thu, 22 Aug 2024 17:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cWLS/76VqceLFQEd1CQbSBFcAWpXcdDWDNYPtLYN2oE=; b=1zvFLvRArAUjQCWUC95dHhkXWP FQ/JrhwO5n2xb1m03VYjjurBdKH68Y+juoPloSAhp6e9p2rkgLtuQ9QsbKzo3iUWOA6c2l2UMVn53 Oax6i5BpdGzHlX/WiOIq54TZ0Ukfb1nFjXd9xzDcLv1wdAqno4SUthVmFSIdjIbfWAeNzoSTea/sO miNf9spvCGvQQtVec5WtFZVSpxmVgfmwMOK0pv2FUcaHAuLTxsBuhiuah6+KqDbAzaiMXM3CxFG7z /rr5SlS8EuXmY5TGmCBj7Ly1rougMhPB+cr4lwWkxLrXZKMiuOOInF7NUWLEacgq6F9jt5cyvM/XF OFyzqFcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBrt-0000000Dpzv-47s8; Thu, 22 Aug 2024 17:45:05 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBqS-0000000Dpe9-3PFg for linux-arm-kernel@bombadil.infradead.org; Thu, 22 Aug 2024 17:43:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=cWLS/76VqceLFQEd1CQbSBFcAWpXcdDWDNYPtLYN2oE=; b=kwsqYDAYR/5XV4mr5aYyNxa6zk 6qRKOp+4PvhrZd+AOf8hUHlNTGYEzymxQJHFFBkanT8x4SIc+IgH7khODsQ6C3Yk87UAywaVpIk+B F5VXiEwXj0/J6xRnAG60+uEdj9nbH6+gX48Z83PljWG5CzXubqy9cLQEuzz67apj4P3XnoB8G5u3X nbkv4YmCCPLJOSQ6ljK2a67phN2Wd5KPi+aoLvI/pUeWgeFH13Wubh9hDhxDjPF2We5E0YtIGuZso WA2RQd1wsWvQ0VAqTi1cFsl6eHKElHNABpgp1S54uiUAqTsBKqaoJgDoyOjv0EFNyS1eyEEViUW4N obK/AbpA==; Received: from mgamail.intel.com ([192.198.163.15]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBqN-0000000A0JM-3vfh for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 17:43:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724348612; x=1755884612; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E7weO86RaaW0WwgTg3wIfhJ+GMQh3XUa23negJ/H4uk=; b=bx+NV85DwS9Ip0y1GIlPtKQF06/DK+Iq4uqMRA9jpQNjstzqtV9pmswj IHjZlgQ69cMJ6TpqfHG5yXcsA2Ui7SpUV70vw+mbYTZAkpd9xVAyQaIR5 se5Ti2/0Sh2Xw9WTAH4LwO4phVPd54nCm9eBGijY+GKs8QvtNyyWW1uPn O/dqwfXqPqfv3qZeG7l3BcmdyHbkcMSMUX7/O1qScKTF5Wb8gM5XzEs6Q W+rJbr6HbIhhKtXXSiXhXN6D/OIPqQeOTdXWYZ5vxiTb2aZRuHDCm9TGd NYqO7pt4XMq9pLlggyVj1HHF96t3xsnAt8fRhqoFFHswnJgtLVvJx0/k7 A==; X-CSE-ConnectionGUID: 3ad/K6NeTMqCxCcFxjLHMg== X-CSE-MsgGUID: MRli2eX3SeyRUT7QL++zww== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22955370" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22955370" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:15 -0700 X-CSE-ConnectionGUID: s3uJDQv4SrKmVtyLgQ7tmQ== X-CSE-MsgGUID: UbB7lboWTFCHCoz7CG6Bgw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="65862350" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.121]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:11 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: jani.nikula@intel.com, Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/6] drm/exynos: hdmi: use display_info for printing display dimensions Date: Thu, 22 Aug 2024 20:42:48 +0300 Message-Id: <8a6fd6de1853dbc337c5c26c65268604d3e91fe2.1724348429.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-20240822_184333_023479_766E6711 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Look up display dimensions from display_info instead of the EDID directly. This will be helpful for the follow-up work. Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter --- Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/gpu/drm/exynos/exynos_hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 1e26cd4f8347..25d508b25921 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -883,6 +883,7 @@ static const struct drm_connector_funcs hdmi_connector_funcs = { static int hdmi_get_modes(struct drm_connector *connector) { struct hdmi_context *hdata = connector_to_hdmi(connector); + const struct drm_display_info *info = &connector->display_info; struct edid *edid; int ret; @@ -893,10 +894,10 @@ static int hdmi_get_modes(struct drm_connector *connector) if (!edid) goto no_edid; - hdata->dvi_mode = !connector->display_info.is_hdmi; + hdata->dvi_mode = !info->is_hdmi; DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n", (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), - edid->width_cm, edid->height_cm); + info->width_mm / 10, info->height_mm / 10); drm_connector_update_edid_property(connector, edid); cec_notifier_set_phys_addr_from_edid(hdata->notifier, edid); From patchwork Thu Aug 22 17:42:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13774043 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 B7853C3DA4A for ; Thu, 22 Aug 2024 17:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lpJnj9wl9YnU5RxQyb69WMm/SKDevL3CjpEWAYH8JgM=; b=yBjtynnEF5GcCB/lszbpj4jzPU f+d0NBA3zAmOPNlOzdYRI5mpqkFQtHOjnt3OhPskmI2DaUo/qENetV30lKuYeJcJRFLXo7T5vXTNP qo6ZrB1/JwtOL9Qi7ZI4Yef34wowjrTmgl8R+GHNg9MUwZn38abTCv/s1owYT8jc4LBtk1jDU2hXX CNZ0McowhL5iCaPoc0+uLMC+2wES462OO+qS3WaZbnjYhK6KLN4hb+64gGbJ4sAc4vNg0j9f+u0Do Ib1/hKXp4k0Uj6g7Cw9U/4lwDVVebVXgwZyUdZQwfOo8yv9ZV5CfPC6LBXKQI7lZfHJxzPHP/OB7A RNauLK0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBrB-0000000Dpoi-0xX7; Thu, 22 Aug 2024 17:44:21 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBqQ-0000000Dpde-1YU8 for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 17:43:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724348614; x=1755884614; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lq2ZDp6MTf10HE4gqxlSJaCI0iEPX29iqODst1YOJcc=; b=QywsDJRrVFFlYsiPiv3FmxswJQUlZ3TOJMpqqKEDrzI68b3LY8xRXdju gZxCKJZi+hU+fYbrs0uQe72bOPvBpwuz+FEq7RRQwaKyoYXm9wIpqenjk j0LKvJHfVqeHdoMCFN5Bxrmjlkmoz388BsEO4rNRzD2ixmGpN11qJ46uY S6+FV5+sVcwEfzbTFXGIgM7xoVDlUwQzvZ+uxq+2G9G8UhnXQuHem+6o6 F2qaGQ5FLswsa4f1UHgLlL69xBu7L5pE1mfWljyJhduH72PRk20lKwoJR Wr4b6BbETV5yLT1Mkpd8Vm+VUkWCLt/8e7u+8LSBAtCQWOdCxCz9+PSdN A==; X-CSE-ConnectionGUID: sTBxMqgpRRqxSPogjIG/Fg== X-CSE-MsgGUID: RrbqH/GpTAGKsajLYuanvA== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22955394" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22955394" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:21 -0700 X-CSE-ConnectionGUID: 4rHKlYFvQ3KDlZAtBi6X3w== X-CSE-MsgGUID: ZiejBel7QECrwpTufup+ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="65862367" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.121]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:17 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: jani.nikula@intel.com, Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 3/6] drm/exynos: hdmi: convert to struct drm_edid Date: Thu, 22 Aug 2024 20:42:49 +0300 Message-Id: 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-20240822_104334_425279_D4FD41D7 X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Prefer the struct drm_edid based functions for reading the EDID and updating the connector. The functional change is that the CEC physical address gets invalidated when the EDID could not be read. v2: - display info usage was split to a separate patch - check drm_edid_connector_update() return value Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter --- Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 25d508b25921..c9d4b9146df9 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -884,14 +884,21 @@ static int hdmi_get_modes(struct drm_connector *connector) { struct hdmi_context *hdata = connector_to_hdmi(connector); const struct drm_display_info *info = &connector->display_info; - struct edid *edid; + const struct drm_edid *drm_edid; int ret; if (!hdata->ddc_adpt) goto no_edid; - edid = drm_get_edid(connector, hdata->ddc_adpt); - if (!edid) + drm_edid = drm_edid_read_ddc(connector, hdata->ddc_adpt); + + ret = drm_edid_connector_update(connector, drm_edid); + if (ret) + return 0; + + cec_notifier_set_phys_addr(hdata->notifier, info->source_physical_address); + + if (!drm_edid) goto no_edid; hdata->dvi_mode = !info->is_hdmi; @@ -899,12 +906,9 @@ static int hdmi_get_modes(struct drm_connector *connector) (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"), info->width_mm / 10, info->height_mm / 10); - drm_connector_update_edid_property(connector, edid); - cec_notifier_set_phys_addr_from_edid(hdata->notifier, edid); - - ret = drm_add_edid_modes(connector, edid); + ret = drm_edid_connector_add_modes(connector); - kfree(edid); + drm_edid_free(drm_edid); return ret; From patchwork Thu Aug 22 17:42:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13774049 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 73FE0C3DA4A for ; Thu, 22 Aug 2024 17:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BPgsCZN1TmDuAEk+wOiLDHpNJvs+XNwncxP7yxYEz08=; b=wJIRzzJzfXDcz+kOnd/duXSQhu s75RHuRgjDkJjqJY+JqET4JCWSUFiB+ukb9sJWc78ish9wtpVsbWBoHBkJ06/SRjKzVNRKcKR1oYZ TOiGU3Rap86iilCM1jU/hykY7NsJKjGh2JBeEPLlcTvCgvYzp3iq7paXRyhL5q03HIaYg+UO8qmnZ Me2fiTpNblaKQoikpIAT/eHUiakVZWZO7URp/HdgJnpAFmJbaxePPJFaHKIsbwgaHJlI1l+tQvAHh xMUUhodQtXpvlVIT62qfUwDxFffJJ5gdirEzOqCmbKAmgiIwcgYIXoPdCu20OJMRVzr91Ofkw3E4S mczhQ77Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBu4-0000000DqcX-1e1l; Thu, 22 Aug 2024 17:47:20 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBqW-0000000Dpg2-0egm for linux-arm-kernel@bombadil.infradead.org; Thu, 22 Aug 2024 17:43:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=BPgsCZN1TmDuAEk+wOiLDHpNJvs+XNwncxP7yxYEz08=; b=ok3Miqfah0UYYNXm55IW+AzC4F lUZMcq2AfepvIgLI9n6nd5gOdnd6rk6IRJvfzxS8uGh47CJQxAmAcbvtcRa6FkG9/itWFTKvc7lIz 7IX9QqaindFDT+hvMqzxozEAgAbCjjWzOnU1afA9lrXISLemWXy6qvwKazpscKvR8enQCkAdErBLz EhNDZdMmCd6eHlUGLgT/HSHEB1mn8WCVJmfEwVfkUsrqzk3EuuKtlJ6blVXgT76hQRkNxZCOklopR 9QUUw4PchpTsH9/sUGl7qn2zw9CGVK3kb5FMblzEMfVEUDH0+noiYiRHNWNv/+vgNCDDHIkdV12gV u1AKVuYg==; Received: from mgamail.intel.com ([192.198.163.15]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shBqS-0000000A0JM-2FNh for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 17:43:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724348617; x=1755884617; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cInaH5YhWjMHXB+Tiq+aUkG/UqKzahFJ+y1X1Oh0Rj8=; b=CUvmrcuDHPv1EyLApIikvgTdvOGsjVw7h09c6SoqL3yU5tYxO71t6A0C EP0LuZJb9wyfyCbK7v1vTVmK3WBqVeWiV7drRkFQp1WLijvUa9fw7+9Dd SIHXoL4nc6zp02vQ96ht5zrB57UXT04Zb+7TAwfQBV6wMWSRZ2A9GsLCa L3As0U2Z1rBZha8OsNy6nrDklIjHqcjOTwqyd2wwEK6IAbJx1g0af1Cl1 h8kF/hJlJNj4HCYGuQJt/p69Pxbcu8wux2c70xU3OCLpsZUtHeFjMKS6L Ew7s81apLTR0/osVLygMyLyRgphFZ5TQ4f6PkmKCohk/OLubEgG7juJjM w==; X-CSE-ConnectionGUID: nOBYmQI0S5yc5q7swLWYuw== X-CSE-MsgGUID: OyHR4bPTQLuObNtUF7wBsA== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22955423" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="22955423" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:33 -0700 X-CSE-ConnectionGUID: xddZFUq+STWsls54hLqKCA== X-CSE-MsgGUID: p9mUht6HSpSCc/xMX6OHSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="65862403" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.121]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 10:43:29 -0700 From: Jani Nikula To: dri-devel@lists.freedesktop.org Cc: jani.nikula@intel.com, Philipp Zabel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/6] drm/ipuv3/parallel: convert to struct drm_edid Date: Thu, 22 Aug 2024 20:42:51 +0300 Message-Id: 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-20240822_184337_128711_8163E0C4 X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Prefer the struct drm_edid based functions for storing the EDID and updating the connector. Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter --- Cc: Philipp Zabel Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: dri-devel@lists.freedesktop.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/imx/ipuv3/parallel-display.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c index 55dedd73f528..91d7808a2d8d 100644 --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c @@ -34,7 +34,7 @@ struct imx_parallel_display_encoder { struct imx_parallel_display { struct device *dev; - void *edid; + const struct drm_edid *drm_edid; u32 bus_format; u32 bus_flags; struct drm_display_mode mode; @@ -62,9 +62,9 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) if (num_modes > 0) return num_modes; - if (imxpd->edid) { - drm_connector_update_edid_property(connector, imxpd->edid); - num_modes = drm_add_edid_modes(connector, imxpd->edid); + if (imxpd->drm_edid) { + drm_edid_connector_update(connector, imxpd->drm_edid); + num_modes = drm_edid_connector_add_modes(connector); } if (np) { @@ -331,7 +331,7 @@ static int imx_pd_probe(struct platform_device *pdev) edidp = of_get_property(np, "edid", &edid_len); if (edidp) - imxpd->edid = devm_kmemdup(dev, edidp, edid_len, GFP_KERNEL); + imxpd->drm_edid = drm_edid_alloc(edidp, edid_len); ret = of_property_read_string(np, "interface-pix-fmt", &fmt); if (!ret) { @@ -355,7 +355,11 @@ static int imx_pd_probe(struct platform_device *pdev) static void imx_pd_remove(struct platform_device *pdev) { + struct imx_parallel_display *imxpd = platform_get_drvdata(pdev); + component_del(&pdev->dev, &imx_pd_ops); + + drm_edid_free(imxpd->drm_edid); } static const struct of_device_id imx_pd_dt_ids[] = {