From patchwork Sun Mar 31 20:29:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13612300 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 03512CD1284 for ; Sun, 31 Mar 2024 20:30:19 +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=3Svw5ixYJXpBmCyFvjsr/FPEp8RwXsPQr37WVnwjzGg=; b=L7cGQxmUcSXbyO /ng3qaLyH8jXA4rVZraJHjpor5JSztEhap0i6ghEZsxQDcAB+kGHMFBNAyYzHIqIDayWT6MxHJdy5 3oHARYn2/nB+wgkv+y3qZ/OKukcgP+ZtVL/TrrJg/4IgGsmIJMnc8BTiHlQn0fJ+s7dvNbBxoaUbz 0itYuoFHnkt/5GlulX3XV4EXIAhVwXWKURRDW9yu0LwXnUhPCUgcSPULuGo5S7HEBpS/1gJUW5Bv4 TR35yqMuRVUC6MRuNYhs81ScUl7sjVKcicr97CoqrvyXdjiNNgJiluTPx1ns7yYjdeKZKAJPJenBm E+IOssy3jzYZywMmEjMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rr1oe-00000006GMR-05ld; Sun, 31 Mar 2024 20:30:08 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rr1no-00000006Fqh-1rTb for linux-arm-kernel@lists.infradead.org; Sun, 31 Mar 2024 20:29:19 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2d4360ab3daso44027931fa.3 for ; Sun, 31 Mar 2024 13:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711916953; x=1712521753; 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=R1A7wX6hNUy8P/zQgxOCI5nxQ7K8DEqd4NjplmpDLtE=; b=pxr9+OJDg7RwMq1TJykNgn/eha2jJyjjmhGoNiRUy+Jwh9x4zj0wx00la5kMnr8VJx 9WLTlDw9JBHcRLvEApHTgoGd1RL+3SXEA80uKiDWOiNjt2o398TLUuijs/ih8X9kTQAB CCBIFLkoZxF82dVkJxFcz4shCFPf8wd0Cfah8NS83zTTPodJazrCa5kEw2Jmh4944hlR ZfX/w0wzfXWCzoX9TrVdahaDfSKwaFMTvat26EbrKNSWSEpZ5JBq8LeqRxlRBpVLfOGS a2fuJ+DIFj3riX2H6+IteSel5KlawpvtQWOO4B8y8fXImn4jjZhcXEuhN2l5yYB2MRX2 vn6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711916953; x=1712521753; 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=R1A7wX6hNUy8P/zQgxOCI5nxQ7K8DEqd4NjplmpDLtE=; b=QGEcSdE66BgzPM+QAyKD+wie/uPU5sNrGgEVdgA3Iz+ga2PoHUVQ4TBgHbYZtwfpjw 5QZAnQHpzkARwYDdBUXrUjTxJg8etPyMRguSekN4I1Ox4dsvSqQT1boDq/ghLM7sWn6L FjrcQOIfJvGrxgC6lYWsK5jTxkBVOYNSjRBjwQLdjtRcbsnFmZAyhdaEru7RlUaloOAt k08WIaDU2sIq7WvjdZ7/xZicF2nk0EsLwF+3pBir8TsTnEBkRWHFk+evQPM/g8X0NxaL jXQFVRqybVhM/Hk4qImGg7+l29ZDfvY/6Rmvg8Rx+c44cxNO80RMM1NDKoB8kdf3z6jE XD+Q== X-Forwarded-Encrypted: i=1; AJvYcCVdDgpIPem4L92sgbh54Gma0YwrfQVn5TIiZUkKGO+vunn/D2QZqE/H7mWNAxJ5msIyj+ZVLQwUunmIZMO6eisEx4Ul+fGej2ebTyRCg5yjRZqmick= X-Gm-Message-State: AOJu0YyP8S151GBwhWBiufVNwdMTRc71UIWCAPgoi2gjI5ieSkw14+6j Mk6A9Ufg8WmaR+4FLuOWQKtIXZ7pIhB+g2r4v6eMIeGwPUgAwxrceRIYk+ifkC0= X-Google-Smtp-Source: AGHT+IFeEoM8GV8Dslk18QS96m4eggtkhs8tlJAqZBtQtN8yS93vJNhUK8FsHkm5EtHKM8q5pMJXzA== X-Received: by 2002:a05:6512:526:b0:515:d5c6:16ec with SMTP id o6-20020a056512052600b00515d5c616ecmr3266515lfc.10.1711916953132; Sun, 31 Mar 2024 13:29:13 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id y25-20020a197519000000b00513cfc2a7aesm1237276lfe.71.2024.03.31.13.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 13:29:12 -0700 (PDT) From: Dmitry Baryshkov Date: Sun, 31 Mar 2024 23:29:06 +0300 Subject: [PATCH v2 09/12] drm/imx: add internal bridge handling display-timings DT node MIME-Version: 1.0 Message-Id: <20240331-drm-imx-cleanup-v2-9-d81c1d1c1026@linaro.org> References: <20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org> In-Reply-To: <20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@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=hxbKkqcQVL6lamyV1sJxDUeKsmUL5K/DPfRJzqUHXP0=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmCceP1c/UajzRsbpS3x8XnHVlfzmTQvPuCd3+5 jTxebl4Y0iJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZgnHjwAKCRCLPIo+Aiko 1ZLgCACeDb8Bblu2K94cHFSwyB441Rf7xL7iwtjmzImMhrnu5em43wI2ZsuNUoFKqlPSidDaw1b lL5kPJ553MBXYYTUEgb+fFpDyeyC8eSJ7qow+lfpz0LyOz5pUWiDgD6cTMilL8GHjAf/3MfBR1n lQ+wavMGNVI/w174nh9+DLZmD2Ff+D5348JS8pFCDKUY+P64euq1jT2rLpcSd4d47so1cFRLIa7 b3WJKksgA9RE6X/bdihxEzh4LRSu4a5AKHdQYajyGSZytA4d4ghiOmDnNkb7bjRmNYCK3S34bvb +fTqx1fpv0rbNJVSm9Xi7z8M+kC5w3NWp8W9qfyyfOo76GSc 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-20240331_132916_688531_61722744 X-CRM114-Status: GOOD ( 18.17 ) 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/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 5965e8027529..708faf0b75ae 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