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: 13590816 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 CF601C54E58 for ; Wed, 13 Mar 2024 00:57:05 +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=P448v3yLlBsWFLUFWNsdcDhGBpbu4MvkAIY60xxKfFc=; b=bQ6gEI1OQAzA0A O74EHU8UbF/4QMZlGVyhFU+IqRFrFkxGSL5IFgSyGu4uo3lpvvBTptHC/GIMMs3DfpyMd/2jD7euN 7pMydJjgdkaNWDC0AVP1zE98NSMV3XHa0DVfbpYGNh6UfksDQymZpDgD5jkSjVxLvB5GRgvKXqa9h IBSmcMRaRAa5fK/VScOclp48e5l0INbk83zBwSOmN4p5uWedPj+8UwbcydD9Kenb+XbWXlqOHhhkM fR43N0pYaN3ij0QsECmP0XlWOSQ9LTNLY6tBIiD0ZDHmZlBGKtkRLKetIEZuVwgAtN3Wgy1ibmSlC 3gEe3vuT7OpN3/jE64NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkCvG-00000008Coh-1xEq; Wed, 13 Mar 2024 00:56:46 +0000 Received: from mail-dm6nam11on2044.outbound.protection.outlook.com ([40.107.223.44] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkCu0-00000008C2q-05EI for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2024 00:55:55 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_175529_255297_4031B14C X-CRM114-Status: GOOD ( 21.18 ) 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 | 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