From patchwork Mon Mar 11 11:20:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13588647 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 3E00EC5475B for ; Mon, 11 Mar 2024 11:21:37 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N2hoZNdioOgzs5PWWv+CPG4JIhwcyFjLf28URteu490=; b=A3RYQ4rsDexfAw S9qoPm92x44aFaHG3/Z7o4ZI96kZJ2b0/PNh2bdh6PceJ8yXeSfJ7D/g18SvNOiAp/w3Pd9wnAr5e 7huCVArMBtB+2qkou3yCKAfbZ6HbTC55GGxCWtiV/HXfr2129EbSKSQfqpDHMXpPnJFO3PnNDkZLH x7KDCERj3AXMBE0i75Fi5NzcQos8qcETNrp9D9HQlbWKD+my+GwMAZk1vY3Fib2Hq4YwVF85yXZIQ AS5beQVHmVkeNzE2oO/Mdqd3BwNmDrKynzPAQUAMC3Bq/QcohVTeTBqMWa71eMAB3tXeQ/h6HnVFO WCUrgoeVMgw29MeagU0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjdia-00000001G9f-1JMU; Mon, 11 Mar 2024 11:21:20 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjdi3-00000001Fgt-37sj for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2024 11:20:50 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d220e39907so69056181fa.1 for ; Mon, 11 Mar 2024 04:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710156046; x=1710760846; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DIYz4B8ZOSG+Y7DKuT4sPVVM3JvUfc/5hNpGzRUmXfM=; b=qpaXp+1NK2XRJL6I2RC11N/tzXaYzd55MTwKTgEE0EJSWWazIAd1Ae3xRgefc/yK0W F/o3yvjWESk4DzIN9mwI/V6pnZW0P2LOWT2dj9qJsPBT+1sCOc4Yn3LYQ09KkKkfcLTb IG3rgfVZgDjlohOKTdnhWAcfR64aLPiHSrBKUoqfz9C1Y11+d04EZ9+hhVqcSsjyLC/p CYqQ25eo+nrycRftvtXMyyUSLgdHqqF1HTgE9W95nvERdDqWoK3AezxKBCRtPW3mrbsR x4jwITINf1/doxzypca8Sp63+dBWZfcUR13ewnsn8NkuN18S/KJKyW2Ppgvd47utl3nm tbCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710156046; x=1710760846; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DIYz4B8ZOSG+Y7DKuT4sPVVM3JvUfc/5hNpGzRUmXfM=; b=GxmyILoDy9bNq/u4r/CoVAiEl8F9cKwY9BRjzeksWm1xcS0Ih6MO4hSQ+N6SYePFte OUUQ0P9P2wpmaEN583Z1O6hScgdaKUybO2w7T4xOhUAd7quJwoP3WaEKbqbPq7OjtE7l lokB1yQiAJcHbCZ44a3uro1KCPVqahlwGbuahFmmhfrlIPIt994bpdoRcse5dRukiZmY k2QQ2+ig/0Um0M+ecMG99Ci7sYKC3qKSfARe6k39aSf3jtzKu6VQeiEe8zGEb8XG4jZY xJwvoKVMFNN0qoFhRdbqoYrPuLbzkfdvCmUy+gCOfnn+ZvfalWGNOEliBsNP+kclhUzZ ZKpA== X-Forwarded-Encrypted: i=1; AJvYcCW3oE7/nS7Sd8NxlT3Uo9Snvty/cryY0q9OX/A+C4DcEZ738ACKhKkJ/wTnc09Jpln4C+7e7XlzX0zWuPhoH2TlCFZf5zhxNMW1UpAMtAyq/UTd/l4= X-Gm-Message-State: AOJu0Yyr5yD79o6nE3oCK+pfOLtTW//VEFasVkCf4OOzkC5qLTthFU2A GNlSUdzJVtyS0MW/vOwP003Mhx6IoZTL7vvh7lH2+z4eAZ+18xgh0NCVEX5bVts= X-Google-Smtp-Source: AGHT+IGU/7/dwO3YAwA43NYcOB8G8o2RoIjLDiWIgVyxQPGvLLiCKMFIsjTxtWIzaK9CURl38ycFKQ== X-Received: by 2002:a2e:7c10:0:b0:2d4:24cc:b499 with SMTP id x16-20020a2e7c10000000b002d424ccb499mr110587ljc.15.1710156046254; Mon, 11 Mar 2024 04:20:46 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id by10-20020a05651c1a0a00b002d2aa0b0d01sm1075200ljb.82.2024.03.11.04.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 04:20:45 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 11 Mar 2024 13:20:17 +0200 Subject: [PATCH 09/12] drm/imx: add internal bridge handling display-timings DT node MIME-Version: 1.0 Message-Id: <20240311-drm-imx-cleanup-v1-9-e104f05caa51@linaro.org> References: <20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org> In-Reply-To: <20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org> To: Philipp Zabel , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Chris Healy , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5036; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=3H9fCE7mPj818x+Q1/UwHSmVLPut7h2b14rUQzFEIk8=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBl7ukE4AP8YIIr6aZRHLy1srF2zcsnsshABwwfU UzNfZKIAweJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZe7pBAAKCRCLPIo+Aiko 1bcDB/9jr4bSDVP/hHMlo3Q1hfu2LW9AjVffzljxaiUsM+DUqg9thoMTnwySV+eJjTqvqoI+6mt LxaeK7GPxnXVK2xLnErJRJtKZptWuUNG9RDeg9yP6IGjB5e00P5FwWVAFSIyikE2lKvVJLu0bZA RoCbHEhlqvKOrGF1GoSH7c6QR06zGxgX67Px4UjwlOB6nTSJKJ9+F4lGoEq4NaXQAhF1FjW9zK2 INz2yDbxUjE1UQuL/rNQIz0j+twJfXxHAmT/NI6Iz6AqUgvrzCcM2S0Pwks+I3cUZdOv//uTfxW Y57+PAdwMm8csec7+NcVSt8gO5zI5bXvT0HnGq88WbzGaV3W X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240311_042047_959752_5486E1A8 X-CRM114-Status: GOOD ( 18.47 ) 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 i.MX DRM DT bindings allow using either a proper panel / bridge graph to provide information about connected panels, or just a display-timings DT node, describing just the timings and the flags. Add helper bridge driver supporting the latter usecase. It will be used by both LDB and parallel-display drivers. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/imx/ipuv3/Kconfig | 10 ++++ drivers/gpu/drm/imx/ipuv3/Makefile | 2 + drivers/gpu/drm/imx/ipuv3/imx-drm.h | 5 ++ drivers/gpu/drm/imx/ipuv3/imx-legacy-bridge.c | 85 +++++++++++++++++++++++++++ 4 files changed, 102 insertions(+) diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig index 8aaf2441bcef..119e1431177f 100644 --- a/drivers/gpu/drm/imx/ipuv3/Kconfig +++ b/drivers/gpu/drm/imx/ipuv3/Kconfig @@ -37,6 +37,16 @@ config DRM_IMX_LDB Choose this to enable the internal LVDS Display Bridge (LDB) found on i.MX53 and i.MX6 processors. +config DRM_IMX_LEGACY_BRIDGE + tristate + depends on DRM_IMX + help + This is a DRM bridge implementation for the DRM i.MX driver, which + uses of_get_drm_display_mode to acquire display mode. + + Newer designs should not use this bridge and should use proper panel + driver instead. + config DRM_IMX_HDMI tristate "Freescale i.MX DRM HDMI" select DRM_DW_HDMI diff --git a/drivers/gpu/drm/imx/ipuv3/Makefile b/drivers/gpu/drm/imx/ipuv3/Makefile index 21cdcc2faabc..dfc495e495ec 100644 --- a/drivers/gpu/drm/imx/ipuv3/Makefile +++ b/drivers/gpu/drm/imx/ipuv3/Makefile @@ -8,4 +8,6 @@ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o +obj-$(CONFIG_DRM_IMX_LEGACY_BRIDGE) += imx-legacy-bridge.o + obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o diff --git a/drivers/gpu/drm/imx/ipuv3/imx-drm.h b/drivers/gpu/drm/imx/ipuv3/imx-drm.h index e01f026047de..57a95926c492 100644 --- a/drivers/gpu/drm/imx/ipuv3/imx-drm.h +++ b/drivers/gpu/drm/imx/ipuv3/imx-drm.h @@ -3,6 +3,7 @@ #define _IMX_DRM_H_ struct device_node; +struct drm_bridge; struct drm_connector; struct drm_device; struct drm_encoder; @@ -30,4 +31,8 @@ void imx_drm_connector_destroy(struct drm_connector *connector); int ipu_planes_assign_pre(struct drm_device *dev, struct drm_atomic_state *state); +struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev, + struct device_node *np, + int type); + #endif /* _IMX_DRM_H_ */ diff --git a/drivers/gpu/drm/imx/ipuv3/imx-legacy-bridge.c b/drivers/gpu/drm/imx/ipuv3/imx-legacy-bridge.c new file mode 100644 index 000000000000..4853e0c41ab2 --- /dev/null +++ b/drivers/gpu/drm/imx/ipuv3/imx-legacy-bridge.c @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Freescale i.MX drm driver + * + * bridge driver for legacy DT bindings, utilizing display-timings node + */ + +#include +#include +#include + +#include