From patchwork Wed Mar 13 00:55:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13590806 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2050.outbound.protection.outlook.com [40.107.223.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49D2F1B7E8; Wed, 13 Mar 2024 00:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710291326; cv=fail; b=XZqWjAk7tO4GYbuCI1vOQSNjKjv3fFf6xQHdFtmixA0tsKIUv8RaxgOJBSVxK34N0otyOA0oOYpD2ytSbs1vQaomxCCxkt1xwAAdOkcCnSfKHtERaiC2gxpgxvWerKLTTt22pj6aY1LUV1d2itW6Ta0rw8I2M2LBoiwYBUG3ktU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710291326; c=relaxed/simple; bh=Jd7u9WBFOKNygbnNgg0+DPjpD6tZI4jWgphY11m2vR0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Rt4//MEyjacU/bym/uamYVyBsBUAXijP2dwSGHb9FTHiea2P6HmE/WCsz0roYP3tByY/DlcMYeOq6q2MwbP1eCcHC9N+7+sIYmVxNDgYnN4Katfcmk+I+RwfO7Kmc3wG+pK/o393di0IfxijUDwaYVS8F2dvElIxmiUBbsU9niQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=yV7mDLpy; arc=fail smtp.client-ip=40.107.223.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="yV7mDLpy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EIidyQnFkG0fVwcIixrVdTJagw9WZd1qPalfQQDblMNzndzrkqQ6D0M4Yuol90AOJfT2VLvWrwsUPXuvJtMKmKFu+O/Lc2gnc8oTnuSALIFYdu2tRgNjZYWDXP2LkRHxCBtQ/6OEdan4IoSA3y4tyRhCTsPQT9l4dDocjOJZoL5GYMu45FXS4DOlXFbj96ApmaHjb74q+oaRpySzWT2xhEn07EZb43U098tjBWN5f8vDyP1uSmh/vhhYRz7V0juLxVwfPKYcyIyn/nNdSPQLAwf0h2djebLYRtISXBW9VY3DoKsdWcOmjC4O4J73ixbQHh0w29WFJo2PKJW6x35g4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/mhBnJetDh2ISuZtVbJDU1WUDkFbcaOYKB/Avbg4uFk=; b=OW5zBxCqLpxZ/PZruGR5aT9t4ZcsYwxbpLKctR+WYEIkq5Evytb8/q4JpvGalTViyIiax/oNJScgBj6Hx7po1yiR7zz5+klA7XmvtxeRsPtsX9vbirlIczA1DPLT19aafX+yKA3AtPPYQw6Dze/0HhTfYSFfabHnQs7o3lsbPzYo5TQXFgzxP07/l8x/ZzzF5frxTqb2YVRi1Ddw9BqLZzRYxK50BLZIvHmlXJq5HdrCq7ADN7yBKMdFtokeVnIrgXKj7O1r2iaYG97i9F4ALEG6A5uKP3l+PFhcRulOiIQpDf6F8l1c7UciRZkb9Kv8UFETaLzTfEhMcmrW5GaymQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kwiboo.se smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/mhBnJetDh2ISuZtVbJDU1WUDkFbcaOYKB/Avbg4uFk=; b=yV7mDLpy+4SdwbkUL5ysuyQi8n1yFbYOfua1WbQTegzcqxBNhRjniuj55+yZ89Do3V4Cqdl3rWwEoE4N+jh2GNVxvSOO4oOSiJVA+NHVKekJb7AhHveaHOQDz0vRvexeLMZoMWz9wHWHsb1I0CiR+vavDV+sYel5E3ACYjP5G0w= Received: from CH2PR08CA0025.namprd08.prod.outlook.com (2603:10b6:610:5a::35) by BL3PR12MB6451.namprd12.prod.outlook.com (2603:10b6:208:3ba::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Wed, 13 Mar 2024 00:55:19 +0000 Received: from CH1PEPF0000AD7B.namprd04.prod.outlook.com (2603:10b6:610:5a:cafe::62) by CH2PR08CA0025.outlook.office365.com (2603:10b6:610:5a::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.49 via Frontend Transport; Wed, 13 Mar 2024 00:55:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CH1PEPF0000AD7B.mail.protection.outlook.com (10.167.244.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 00:55:15 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 12 Mar 2024 19:55:15 -0500 Received: from xsjanatoliy50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 12 Mar 2024 19:55:13 -0500 From: Anatoliy Klymenko Date: Tue, 12 Mar 2024 17:55:05 -0700 Subject: [PATCH v2 8/8] drm: xlnx: Intoduce TPG CRTC driver Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240312-dp-live-fmt-v2-8-a9c35dc5c50d@amd.com> References: <20240312-dp-live-fmt-v2-0-a9c35dc5c50d@amd.com> In-Reply-To: <20240312-dp-live-fmt-v2-0-a9c35dc5c50d@amd.com> To: Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Michal Simek , "Andrzej Hajda" , Neil Armstrong , Robert Foss , Jonas Karlman , "Jernej Skrabec" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mauro Carvalho Chehab CC: , , , , , Anatoliy Klymenko X-Mailer: b4 0.13.0 Received-SPF: None (SATLEXMB03.amd.com: anatoliy.klymenko@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7B:EE_|BL3PR12MB6451:EE_ X-MS-Office365-Filtering-Correlation-Id: dfea06b7-3c5f-4882-5ab0-08dc42f83f2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rqrCC5gnOdxlb3jTiVTVSbpltc0LT1fpRLrx4DL+0Mf/YH3MuvtOavn/V4w0YJ7i0CNyD9v1WLBWqxTFZz04idendMs3QhpJ2Ww3bWq59QGw186zEjN3lHxLpmb/lOns+ahAEB95ej22MyUACtaLfeMLPaCx+Bn6pJb0NUuk1zE+36RWlSG7sGXeCv+nyZNTq7/1qJ0+f/XOQ0Fm1ydqXZxWH9dAdLhSfHbw4ivkwC9kh5LyK2qnjC3wx0zN4jfYPwoPWojA3Y/wqviwDIoXcIUnkq8BkPf4vpFOa4zyVlDpLf9GdQMFgAMEItrGWdQiCJUar9y3xzAbje8JVZMEsaYMVA2VMqvZNpDv4jxB3eYZ1/VfK5x+5PLyXKGTTNtigM/SODkn5BsCMy3dQCP5unMRWtT2ninHme4B52nUfNguGXwYEu4QPT5w7RMazR9DuNZdlwVXgHdOl2E+/Bmxgv9FlowldEr9B9ikn2MIeIi/T5lQ1nQ1wfZQTy3ps8FQO7JKz8ytnG/uRMKd/ZIlDFv5uwHGVjVveBxeusTr5mqUtn3n+tbrUU2GAdx4SJLW7ipqaO8IabgGnOT68vYZXZ0DPY7z+Oy0Ue+ai2v6V4APwDBHCVZzwdaU/w2/o62Owufqd8SQUezPV3/lzInEpxfymy/edDnkG6uXKaT7hdJ3haux0k0TTDvo78wqCiAldUifzNp9Fk6twll20bP7HTEJmH4L28RfoOGPiSqZUi0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(376005)(1800799015)(7416005)(82310400014)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 00:55:15.8467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfea06b7-3c5f-4882-5ab0-08dc42f83f2e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD7B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6451 DO NOT MERGE. REFERENCE ONLY. Add CRTC driver based on AMD/Xilinx Video Test Pattern Generator IP. TPG based FPGA design represents minimalistic harness useful for testing links between FPGA based CRTC and external DRM encoders, both FPGA and hardened IP based. Add driver for AMD/Xilinx Video Timing Controller. The VTC, working in generator mode, suplements TPG with video timing signals. Signed-off-by: Anatoliy Klymenko --- drivers/gpu/drm/xlnx/Kconfig | 21 + drivers/gpu/drm/xlnx/Makefile | 4 + drivers/gpu/drm/xlnx/xlnx_tpg.c | 854 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/xlnx/xlnx_vtc.c | 452 ++++++++++++++++++ drivers/gpu/drm/xlnx/xlnx_vtc.h | 101 +++++ drivers/gpu/drm/xlnx/xlnx_vtc_list.c | 160 +++++++ 6 files changed, 1592 insertions(+) diff --git a/drivers/gpu/drm/xlnx/Kconfig b/drivers/gpu/drm/xlnx/Kconfig index 68ee897de9d7..c40e98c1a5e6 100644 --- a/drivers/gpu/drm/xlnx/Kconfig +++ b/drivers/gpu/drm/xlnx/Kconfig @@ -15,3 +15,24 @@ config DRM_ZYNQMP_DPSUB This is a DRM/KMS driver for ZynqMP DisplayPort controller. Choose this option if you have a Xilinx ZynqMP SoC with DisplayPort subsystem. + +config DRM_XLNX_BRIDGE_VTC + bool "Xilinx DRM VTC Driver" + depends on OF + help + DRM brige driver for Xilinx Video Timing Controller. Choose + this option to make VTC a part of the CRTC in display pipeline. + Currently the support is added to the Xilinx Video Mixer and + Xilinx PL display CRTC drivers. This driver provides ability + to generate timings through the bridge layer. + +config DRM_XLNX_TPG + bool "Xilinx DRM TPG Driver" + depends on DRM && OF + select DRM_XLNX_BRIDGE_VTC + select VIDEOMODE_HELPERS + help + CRTC driver based on AMD/Xilinx Test Pattern Generator IP. Choose + this driver to enable Test Pattern Generator CRTC. This driver + implements simplistic CRTC with the single plane and is perfect for + testing PL to PS and PL to PL display output pipelines. diff --git a/drivers/gpu/drm/xlnx/Makefile b/drivers/gpu/drm/xlnx/Makefile index ea1422a39502..26fb3ad21fa9 100644 --- a/drivers/gpu/drm/xlnx/Makefile +++ b/drivers/gpu/drm/xlnx/Makefile @@ -1,2 +1,6 @@ zynqmp-dpsub-y := zynqmp_disp.o zynqmp_dpsub.o zynqmp_dp.o zynqmp_kms.o obj-$(CONFIG_DRM_ZYNQMP_DPSUB) += zynqmp-dpsub.o +xlnx-tpg-objs := xlnx_tpg.o +xlnx-tpg-$(CONFIG_DRM_XLNX_BRIDGE_VTC) += xlnx_vtc_list.o +obj-$(CONFIG_DRM_XLNX_TPG) += xlnx-tpg.o +obj-$(CONFIG_DRM_XLNX_BRIDGE_VTC) += xlnx_vtc.o diff --git a/drivers/gpu/drm/xlnx/xlnx_tpg.c b/drivers/gpu/drm/xlnx/xlnx_tpg.c new file mode 100644 index 000000000000..297a65fdb289 --- /dev/null +++ b/drivers/gpu/drm/xlnx/xlnx_tpg.c @@ -0,0 +1,854 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx logicore test pattern generator driver + * + * Copyright (C) 2024 Advanced Micro Devices, Inc. + * + * Author: Anatoliy Klymenko + * + * This driver introduces support for the test CRTC based on AMD/Xilinx + * Test Pattern Generator IP. The main goal of the driver is to enable + * simplistic FPGA design that could be used to test FPGA CRTC to external + * encoder IP connectivity. + * Reference: https://docs.xilinx.com/r/en-US/pg103-v-tpg + */ + +#include "xlnx_vtc.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include