From patchwork Thu Mar 21 20:43:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13599378 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 6C5C8CD11BF for ; Thu, 21 Mar 2024 20:45:22 +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=URlq0uCGOOrTmXcYVwt5DMdR2pJNz46HbaWW5CujJqE=; b=kFeIhvdNvV/eOy q6J5GLjSdoKdbKt6yhbKfLjySei69v32JfWLnwjVuZ/YiivAvAJ6zVEkfQGA63lK4N84LgBnDGEM6 TF8h9wYsmd6ceTQrXyQvmE82UDHCwee5l2aOe8ciLqBF4bBepjFXT/Eh02lZm1lYw96spHx1GZO9H H8LId1R8atSIgfhSA2viPwaC3unrUvdkX1vEz62oVmLr4Q7GUHLaHiaFOpZNyjaxYQjPMFSvQIhyv 5AhKh+W0dvp+MaWWKROCW9KiBfNx8ns2kvpfjHo7M0yoc82uDH09Whh64uXcUKjI/lHHB8BaAKpdr 1rfT8A/sdV3r6pLHAHtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnPHf-00000004Za2-3XGS; Thu, 21 Mar 2024 20:45:07 +0000 Received: from mail-mw2nam10on20601.outbound.protection.outlook.com ([2a01:111:f403:2412::601] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnPH0-00000004ZAh-3GwS for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 20:44:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b68qf90bGeZDFJ9HRT1Q6gpWZi5uUJpFN6DPz5E0DoKI5WJZiHsxboSK12bMjCyhRmODwlQ2IFVAs2Jy95tY9Bzysw2i+MNF47Foea+pMV297+4nzYKFzi4p7N9tTzpN29EBveizVgajKWSvICpPoPpQFy0KFihPZ3vu8phCM5KBsGiebCbTc2yuULZv2h5BH7j14z6CFrDY4MuUi3PNBPgAouV+CfJ1G/ubchJXFxzu8mMc7Ith369WpD0NcAKLxaCS3UzfEiZV13B9fiXEAi6ne8XEA01egOZbUt2cFuecB0IXPvhzvQtMbPf+n59BWQfmrfiG+Nr8MjH7Wf084w== 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=Z94ce+/n0RvmiJVtVAbri9i36FVONgDviQgEhnE5AwI=; b=RObg36cKncE7Or377GUlA/TXYIUwmycPiD/mAoQCTkXe8PQd/Xg25qScjqLfnRavktgobvDr/fyIuJawyptJh8qC6FZ36Xvr+hvF2z+iykWcyoSNm0pFDYdLDDo27tHJyvEkYuD8ahmOdjmhxkZHoQrcb4tXJ9JWBbokx2uksjqg4rk0ZOzhGlK5QGwUluuUIJHyAsZqpbtuqpoNsYVmxP6eECHfd9rgpoaZLwG40OHqVHOISCNpjxGwtYvPACWb9z2xTNYQ6XmNvr+xAPdQhkL3LKWjOKBg+P7V06cuQcuvbATvdwef3NjU3dquFl8tLdH/ZEioWCfiIPGaAwsNuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com 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=Z94ce+/n0RvmiJVtVAbri9i36FVONgDviQgEhnE5AwI=; b=JJAol3Z7AjeDc3Qos+xm4KzXZGPCstSdJjcEYtnHSAQ93s+ZLaBlFrg7srTp4qm4I8DgDCGCLZwmVXLrA0IObGgRyYh/DRq/q0jQdR2bZc6fw3CwPAJ5paJ598oJ0RyOvRr3pjGCbEN0XyeyGsUa3FOmV+G4IdQp/b9x48rr+aM= Received: from BN9PR03CA0683.namprd03.prod.outlook.com (2603:10b6:408:10e::28) by PH7PR12MB6980.namprd12.prod.outlook.com (2603:10b6:510:1ba::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Thu, 21 Mar 2024 20:44:19 +0000 Received: from BN3PEPF0000B075.namprd04.prod.outlook.com (2603:10b6:408:10e:cafe::49) by BN9PR03CA0683.outlook.office365.com (2603:10b6:408:10e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.13 via Frontend Transport; Thu, 21 Mar 2024 20:44: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B075.mail.protection.outlook.com (10.167.243.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Thu, 21 Mar 2024 20:44:16 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 21 Mar 2024 15:44:11 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 21 Mar 2024 13:44:11 -0700 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; Thu, 21 Mar 2024 15:44:10 -0500 From: Anatoliy Klymenko Date: Thu, 21 Mar 2024 13:43:47 -0700 Subject: [PATCH v3 9/9] drm: xlnx: Intoduce TPG CRTC driver MIME-Version: 1.0 Message-ID: <20240321-dp-live-fmt-v3-9-d5090d796b7e@amd.com> References: <20240321-dp-live-fmt-v3-0-d5090d796b7e@amd.com> In-Reply-To: <20240321-dp-live-fmt-v3-0-d5090d796b7e@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: Tomi Valkeinen , , , , , , Anatoliy Klymenko X-Mailer: b4 0.13.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B075:EE_|PH7PR12MB6980:EE_ X-MS-Office365-Filtering-Correlation-Id: b333e939-0510-436e-8325-08dc49e7ad02 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yEUKuwlrz8Tj7KA+noOmz+tsRIuA+hnCGhCjx70hpHDUuW4KX0rwlF0X+BzjYTIpMJtR0ozSzeLCHB+yrtOIZEB7SZX48FkeKuyYRpSZXSQ0LVy5ktlKui9jnoon3z6rZkvy0go1Nfd/k2Gpvsn0/pFqDf/oXTeStxoGeJGLpYjRKf7MYzc/DjILzdU0BtBea8XBMdNlWZQmrda8PasOd+E7p0r79ahdOb2vNrn9yCbjZVu2a/l1quTK0WR0uq8NSqlEx4B/hwdXwFRLINvSIG+pq3VD6uy546K+5ObBDs6M4LFzD1WYqKTwd3kVerRdJCbjGP+H+M/qilAHKqbOfnvQOwH+qwxvUorMpdLsxiUKG6RFxKKaUqAWK5itoSGo99cmkOx3eGncu+hoDRWpE1YVfQNFpK7FmuVpyRLbyGRKg6t4kRDO1sUT86PbatgGHfOYvMVkmxGt/26Tf9udbG7CU1dPvuiT4IblejBo6ymGWVlLbSxbEgIASlkTuywJhX0bcPoM4gPL0sBTVcZa8da/WBS29nn/LOFePo9K68AUIOzINTbZlW9q0zCkjIj/pjbA7MyY8qglwuwbsAR3cInorNjJAuhSJyage1QOtLKQ6sT9jqCBjBtE2ko98Ws4aVMoMmp4uJ6RrUSst2+W4YERXmCjsEz4uoajfw8GAxOzLBM4ma3bIgBlnq9EEUcvM/jj3vYPEfELsaQAYS7bGNxt4kSbWzNCGh5kUMeIvjo= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(7416005)(1800799015)(36860700004)(82310400014)(376005)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2024 20:44:16.6788 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b333e939-0510-436e-8325-08dc49e7ad02 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B075.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6980 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_134428_314933_8C151DB2 X-CRM114-Status: GOOD ( 20.25 ) 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 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 | 846 +++++++++++++++++++++++++++++++++++ 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, 1584 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..3056bf278414 --- /dev/null +++ b/drivers/gpu/drm/xlnx/xlnx_tpg.c @@ -0,0 +1,846 @@ +// 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