Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp729284lqp; Thu, 21 Mar 2024 13:48:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0KZkt2OzEvxo3P1AQcQa4O7iql7blAb39py3hxvokorYVE/wYraQrptEb1JzVedCYwYOcTDQpHejLUEe7iAs20F+leK0GscZIhgxhJA== X-Google-Smtp-Source: AGHT+IEm0J8DSc/Vowlaox6Y2BZHD9ck9hZc5AptladAs3o7x0uIvzPteEhAhf1pfmgw5gdzO10J X-Received: by 2002:a17:902:b08a:b0:1dd:bdf6:3746 with SMTP id p10-20020a170902b08a00b001ddbdf63746mr574383plr.40.1711054098769; Thu, 21 Mar 2024 13:48:18 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y16-20020a17090322d000b001def1b419bbsi438558plg.350.2024.03.21.13.48.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 13:48:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=JJAol3Z7; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-110663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110663-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 06D31282FA8 for ; Thu, 21 Mar 2024 20:47:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13277135A6F; Thu, 21 Mar 2024 20:44:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="JJAol3Z7" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) (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 75D201353F9; Thu, 21 Mar 2024 20:44:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.68 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711053867; cv=fail; b=a5eb0On/bU9nCvh2dD1dbb9H0QfS6vJ3L8mZAu0kY42wY3j67L3lbyRwAsFn4q3CMRqMuDSnJ6QVXXpCsPLNJNsLgr2AoEubwMRvfitmkFAS1PID+pK3360tOyoRHiGf/YhUMTkgF5YRfOUGk/SSYW7wN661xmC4Ys05vzx2LtQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711053867; c=relaxed/simple; bh=ccnddpyt/7dzC/oUGGD9MnTZ+Bsh44iBoPuY0cwAEY8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=bx0FBlk2kG0rdFII7Larcc3qfBsP4K/6UgOuiALCWVabxsSpir/t4nzjAVJuT0VLIvcdbobr2KoTB0NDQc3LDpFVRpfKbfSP6ct9j+htloUv97yGtPgGNg6yatxldEMxaSl5rTO1fd92I+yCkDl7gg+7+cMR7KtVW0ukfHJofDo= 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=JJAol3Z7; arc=fail smtp.client-ip=40.107.94.68 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 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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