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[] = {