From patchwork Sun Jun 2 12:04:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13682814 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 32030C27C44 for ; Sun, 2 Jun 2024 12:05:24 +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=RadwQllnLlDR/deJJfhMDd2f6E7vDZqHFjvqHkyHl3g=; b=gBAgo86AxHpOuK tFl49gLmH736ylivgKN0CGWhgWdDKANfIbGikYG41e6Ggd88vXU4FBw/0ofg4NL9x9CTGSPvh8bMW lhz9ssfqlKvqAdgIri6MlezZ3rWpn58srmNtJnfVWl6JQKj38dodibmYyXvJg5JTJBfvQ5Wb1sMbj j/ec3U4IgawiK6InFlOCPcaNvkV/cP8P+UD4QGb+iYn14yzqofes/dcVGNnX3ESpIHO/z1PhrleZM 4E+S7NLNR9PscGbbzSBxFqijXm7TG5lSbLGdFlSa+8kWG/kCbhonmVlkS8jm63fVn8XojEcG12c/4 ktknO+ESYe+y2axRGydQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDjxX-0000000EBeU-3Tsr; Sun, 02 Jun 2024 12:05:11 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDjxH-0000000EBO8-2ne4 for linux-arm-kernel@lists.infradead.org; Sun, 02 Jun 2024 12:04:57 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-52b976b5d22so369774e87.1 for ; Sun, 02 Jun 2024 05:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717329894; x=1717934694; 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=YwLGlhS8c4MSDhZlnMfqrMoYx9jr0+buWOu6Q2vrZUo=; b=Goof2f1XaOrfq9+SnlJpyZFhpZVZVeXupnihy+Cn+2A6JfyeqKZSC2eGrncixFeKga dFRdGApJsaSenGzhQfbqhj0MFqeViWBmkV4pqfOPceDQQW2FKQeXZBwrFTbjd1eNECkr Ra/Qb0PK6RFdPDTa4YQ1i5kLJn0IVCcL+CTQAsRb4dXFJyAvnkcRsxTfw33ZTGHGVbZ4 tOhXpV5r6/yFQtrXbCV8VnLDzsQAG3LjLtQH8LV7xZakIRYbQZ9kALEoOOFBS30bKCVp Npe1yfgEIBY7+qQdLpKO54sdZpokBIAYerCvczkCi3rTyYImrYmGuDRQbzGpAUlqdOcM bxqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717329894; x=1717934694; 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=YwLGlhS8c4MSDhZlnMfqrMoYx9jr0+buWOu6Q2vrZUo=; b=amGx5xMy3g0e/o4dHLCZKt82jS9r7IwCYfoUltV88f6/VKoAnU0VbaoFSKL6BMFNJH rm9qrxkBgArQ868K+VUB4HYhLHAi0bwmzM0AdIbw564WGyuLbjDviku9NuHCxhLOxq+j vQ5Q3lZ5yZZ90yHQPDkyy0NT/UnRtMjVNi6PWSO4WCRneolXun3jKeRvoke2iFbYdaeZ Qc5Ju4Cic3ZvNnClyEX6S5F1RkBVpgjdnbXCQ4b7P92sqIgTSDRKvcCBFtGS44u5P3vs MQLaGHcG/FOQniSlVUDyYO2GFrwmXqvcUHHzfPHfggw9za8wjOIUrtv3yXTrBIC0qwkk rLgA== X-Forwarded-Encrypted: i=1; AJvYcCWCynRi5j5KZEETOW/yroEuir78gpXFWJmDVti3ExPKqyUOyy72Ujjhmr0+6DaAAnR0GSL9RW/hcsi1p1vfbkUb12uS2PkVjJ51JACV5Sy6a1bSq+0= X-Gm-Message-State: AOJu0YwJirEyLULQh488zW9uaAAJVzjIKlWl2D9Q/b1BsOhfQegpwz1Q Jcj4zH25rW5XM6vsxtYkeoYIxF7rIvmR5Uov0x/xi7CZ11SYqhiQEA5OvdqONOI= X-Google-Smtp-Source: AGHT+IHQTqu9po4Q58mn5dmh/iNF52AD9wdFkQoRIF/Qt4N/Ulzqw4wOqZkzdJsVft3tRiPNgYeHdg== X-Received: by 2002:ac2:4556:0:b0:526:81ab:191 with SMTP id 2adb3069b0e04-52b8970078fmr3604279e87.60.1717329894052; Sun, 02 Jun 2024 05:04:54 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b8b56867fsm759398e87.44.2024.06.02.05.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 05:04:53 -0700 (PDT) From: Dmitry Baryshkov Date: Sun, 02 Jun 2024 15:04:49 +0300 Subject: [PATCH v3 09/12] drm/imx: add internal bridge handling display-timings DT node MIME-Version: 1.0 Message-Id: <20240602-drm-imx-cleanup-v3-9-e549e2a43100@linaro.org> References: <20240602-drm-imx-cleanup-v3-0-e549e2a43100@linaro.org> In-Reply-To: <20240602-drm-imx-cleanup-v3-0-e549e2a43100@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=4905; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=5qwH6l5MO1K0SbjK3RylTsbBZG/ntitWTbJUNUocDzw=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmXF/d/Fah3CGztXwsM4kY3CMDCT+cEaYdiMGWa 3/3qeABMJSJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlxf3QAKCRCLPIo+Aiko 1YFGCACQRurwdwe8yveOmxw8xeQgho8g6nkzyJ3kQ+gCq9JB2tSgAze+ZI4VDVW41MZ5u77trMB jfxDeC7F4oSTGz0+cvoLiqd5iFxLg7fOsLjLaW0XsFp5HqR2Ujgj69oLKtl3eCZwW93VtLwVjCV QF20Qc398qLsZoCWU/DUtwvUYH2kchX/mmQ/gLK9qeM+b8/FuKCix3CWW+BrLY3dWXAy5bxKdFS vUdTre5Ulmcdhsz8hpehTUDFyUjcRd3913TosViZUGou2j6GgO3dytGOOZ4mZIuzqodgchDtXBv Ma13/Sp4iomIpGUDn+j9HQWTADrjoZgk42vPGI3UD63QZZHP 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-20240602_050455_767133_DCA0CE35 X-CRM114-Status: GOOD ( 18.02 ) 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 Reviewed-by: Philipp Zabel --- drivers/gpu/drm/bridge/imx/Kconfig | 10 +++ drivers/gpu/drm/bridge/imx/Makefile | 1 + drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c | 85 ++++++++++++++++++++++++++ include/drm/bridge/imx.h | 13 ++++ 4 files changed, 109 insertions(+) diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 8dd89efa8ea7..9a480c6abb85 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -3,6 +3,16 @@ if ARCH_MXC || COMPILE_TEST config DRM_IMX_LDB_HELPER tristate +config DRM_IMX_LEGACY_BRIDGE + tristate + depends on DRM_IMX + help + This is a DRM bridge implementation for the DRM i.MX IPUv3 driver, + that 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_IMX8MP_DW_HDMI_BRIDGE tristate "Freescale i.MX8MP HDMI-TX bridge support" depends on OF diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index edb0a7b71b30..dd5d48584806 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_DRM_IMX_LDB_HELPER) += imx-ldb-helper.o +obj-$(CONFIG_DRM_IMX_LEGACY_BRIDGE) += imx-legacy-bridge.o obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE) += imx8mp-hdmi-tx.o obj-$(CONFIG_DRM_IMX8MP_HDMI_PVI) += imx8mp-hdmi-pvi.o obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.o diff --git a/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c b/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c new file mode 100644 index 000000000000..fb3a030928f0 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/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 + +#include