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: 13682802 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBCBC39FF4 for ; Sun, 2 Jun 2024 12:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717329897; cv=none; b=AZEh3mnT0Hbej1X7eOT3ppkwMF29DEcRXaZnYrPx/Bay8IqnRTKcOWlIUqr7+KCP9z96t83VG2xzb6eotd+9iTKXfb/GkH9n1TZ1Sz/QA5OxMVj5W8hHi3/p/rMSAj94W/qSrx9HogJ7Rnl/MxLfsx4Ts+pOOMltChtMc+DA0qI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717329897; c=relaxed/simple; bh=5qwH6l5MO1K0SbjK3RylTsbBZG/ntitWTbJUNUocDzw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XLkBJOwAmMtV2NBxXK9H8DMBPyHeoS7MYQah1NqxGYS+Ki99Td0y7p6Y3taXy+Juuo8WnlzRtr7n0UN8iQnNRcc+AhrMohPlBUJqA223wu9IUZWNoGN3ZXLVZCgoFUrqXtZMlutcKkeWVQep/YMuNEahnPX9ACFAa1+n0Jh1Cl8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=QTEbhsce; arc=none smtp.client-ip=209.85.167.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QTEbhsce" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-52b83225088so3032815e87.3 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.linux.dev; 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=QTEbhsceXJ5RGXPzKVWCfX9sgL1p2lXE5Jeqq+v9oIvgcG78JmQ3TDuv6qMUGvZq2u s+iBoz5EBfJkS0cPRwK20xkL46XrxSas58BUzWBcF4gUh95xthJBfyGWGxnpegLtL5X9 vwjkme2vd5MBTFBHUVEFVNNDKFwNpjTNZwgq3XM67/hrHvuxQX85K0csc3e3qGlOL+9S 3Z4U39TJdId17CO8U+VLA5P6TNdqn+/8lY+6qI28jW+BwWpU/czkVV8+aLg2BwM3Ki0a CSg0bg1zNlEJmJSCq6RJoSvLmeoYBhidJnZCzvqpOGU8V1n2AMWSdF6BcxSgYKLFsP8C tIrQ== 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=tRYKuCtBLwvWPWyKST+PAnM1/88E/5WqxOYuwc6OB9naZUoymkRhaJJo9VlwSutkSe gTTuEGFO6Hj3mAQiL229iMEvbeuIV4Gasp6WLZOFsvjmm3avTC9hFqKKJPvfplHo7ifM 1rJtZ23AzP6gszHsQqImZ7d+n1E/UV75jpyB7Yb8cqToEnRnmvG9+RCknVbsXOWaJcc5 KFUIhDzL56qz5C9m6T0IDyYl58X4nSsAuu6qZgd484/PgZ2luwzy/Mb4lYuMTOQU0k0T 94izJXEA9lKk5U7nMRKqkF9hiOYye9LAAHIvChmOX6sjMUxVmU4xFJ3aVHWiqFKA8nSo vswQ== X-Forwarded-Encrypted: i=1; AJvYcCVy8BYWOpRkATXPOIvtzoMQPtFsGu7D4lG30sktube0H1wrrDTsOw1DKYal9/n7V7g6ahGgb5YXsbdVn5rWgJntH2+s X-Gm-Message-State: AOJu0Yw//IWX1kA4mUDRb5fkUvi4vAsMN4vqkxHXf6dGDwJH7e19Sa7M hmEfoyV4QeKpFm6Z3DGgjrNRjI86CZNH8vcKbV/Ruoae55fsNKO6s2G2EBGEORk= 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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