Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp727813lqp; Thu, 21 Mar 2024 13:44:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9N339/8wYpwuwIrPLbczk0Javgd3iBT5vmMEPUINNQfY57p4EqtQ20XCfSD7MiYlv1UpUIAAiLKBNNlIaHdm5xHSfOn/qsAd99upYFw== X-Google-Smtp-Source: AGHT+IGhJQmOCRI57sSDrZjor8/u9HHO7A9rikBJU3B2AQr8yIVF/seljI7is4jcEdNoFZuUsa7r X-Received: by 2002:a50:d714:0:b0:568:a420:7d80 with SMTP id t20-20020a50d714000000b00568a4207d80mr244188edi.27.1711053885624; Thu, 21 Mar 2024 13:44:45 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ds5-20020a0564021cc500b00568c17247aasi224461edb.229.2024.03.21.13.44.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 13:44:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ttZcs6Hn; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-110654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110654-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1A0D91F233D7 for ; Thu, 21 Mar 2024 20:44:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BA41136650; Thu, 21 Mar 2024 20:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ttZcs6Hn" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2080.outbound.protection.outlook.com [40.107.243.80]) (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 07DF613540B; Thu, 21 Mar 2024 20:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.80 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711053844; cv=fail; b=FJBE34MffMXs05cqSfnrfmHH2qvsnuCK15eftRcwcqkfeaaxCH2g6b8b3lyouwvaD316t6Qkp8G4Sita+AaLGqmY/ACqdU5elsOHZUKfYrbOiCYkGrsUYEHnSYv/uowbV8hV31jz45OZYoNL+koJgnvvrih5O9shK8Qfx3kmqQk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711053844; c=relaxed/simple; bh=GxH2hYokxC9hMdXYhXBvPLIe/yKn4vDy1ll/na3b1T4=; h=From:Subject:Date:Message-ID:MIME-Version:Content-Type:To:CC; b=KbgltH7GXApLrEsQuI+V4mwfb2AOMebFvvXnORmRvFzNlHB90APRjfLxFSoJ5NWdxXDnT+vPg+jInmhLUQX5pqQ5bkh9de4Oig2BAAasCsQ43nQEzrtM/kMNSbSa78yGPPsGD66lwZR0M8YXA04UzvSR9cc6S+z//5H3bgGdzo4= 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=ttZcs6Hn; arc=fail smtp.client-ip=40.107.243.80 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=aLVkF0jxL5ab1kkExkrutgp+nnZ5zoRWDhzNDQrE4fuy4bvtJ059MMG7VCg3WADqFIqHrV1r6mnYt+CpHgLfalftmjCGPapRuKcDlO10EbiOXhEj5lPt+4af0bm5lVccvPQimOCtNmr6cncm0TC4Ejr7NqwfE+HzhXGwVaSUZimWFpnREGuC7IHt+IUSeq0dafyEOy/3SV5nnJBWuzshqlLfrApNKYm1Z+zKjs0O4ZTEybMWiq/WBL27HjnSYDFJU92mpsZQ2ZEKC2c13QTPP412o5p/OPzGcavCQsdyZs88HltMTpCNE/3w9uuNBCLB4VEwVNHPNJsHZVjllwYnvQ== 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=P7GmaPQc8cB3nmmi+u9VgQ5j9rUoOGbwUFhhTMAJynQ=; b=bQbtOYJP/J3a6A5m5RlA/5EQfFPceX3Z9D/NRXEZD60FWk8mji7i15kEe4bbx6hyewLYhEEdf377/NUOoXR4RheNLcavsDAVpHxa4iaE5RjGFlH5wU4FHWjWWVgq2A77nvf5l/suQK5T5Zqf/i97d51cNknceyPDpfYWsBEs3DYHRXOABDkdHJaxCqPMVJypCAdvwUQtb9/GY7GKe5d5mZUBfANqh5QOcYnZqqDQelUAgL6Pq9KLzKm7S84ADzo54O2EWItWc05/vRwgAxlyDwkA/eYbI/UUVKJkANgJq9dNsw6mAeObzftJM5ZPQzvua15whUKaBTu0geMmFfoftA== 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=P7GmaPQc8cB3nmmi+u9VgQ5j9rUoOGbwUFhhTMAJynQ=; b=ttZcs6Hn5XPebLB80KsUrGspBi7+HYcMjDEqH95K1+mhDm9pZyZUfgA+OWd2yn+JE/7FwKDpEbcHAJwnZfACPZUI5YP91wsWhRqWwqp++vFaAC4d8pTvm+Qp3Rz3Q6q8v6uK1d5S8osdLDMVovHHNr+eoK1WWfgtStfaBo3m40c= Received: from BN9P220CA0014.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::19) by MW6PR12MB8999.namprd12.prod.outlook.com (2603:10b6:303:247::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.31; Thu, 21 Mar 2024 20:43:58 +0000 Received: from BN3PEPF0000B36E.namprd21.prod.outlook.com (2603:10b6:408:13e:cafe::74) by BN9P220CA0014.outlook.office365.com (2603:10b6:408:13e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27 via Frontend Transport; Thu, 21 Mar 2024 20:43:57 +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 BN3PEPF0000B36E.mail.protection.outlook.com (10.167.243.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7430.0 via Frontend Transport; Thu, 21 Mar 2024 20:43:57 +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; Thu, 21 Mar 2024 15:43:56 -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; Thu, 21 Mar 2024 15:43:55 -0500 From: Anatoliy Klymenko Subject: [PATCH v3 0/9] Setting live video input format for ZynqMP DPSUB Date: Thu, 21 Mar 2024 13:43:38 -0700 Message-ID: <20240321-dp-live-fmt-v3-0-d5090d796b7e@amd.com> 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 X-B4-Tracking: v=1; b=H4sIAPqb/GUC/23MSwrCMBSF4a1Ixl5Jbpq0deQ+xEF6k9qAfZCUo JTu3bSTIjg8B75/YdEF7yK7nhYWXPLRj0Me8nxi1Jnh6cDbvBlyLDiiBjvByycHbT+DLoQqS9k ooyuWxRRc69977f7Iu/NxHsNnjyexvf87SQCHpqxItrqm2lY309sLjT3bKgkPKQX+SszS1CSVJ UWK20Ou6/oFMWEU994AAAA= 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 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: BN3PEPF0000B36E:EE_|MW6PR12MB8999:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f52e4c1-26d7-4b40-e1cd-08dc49e7a1bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IVzFjiTgSspAib4ThmmDTsFBYvRWoTkqz/2fUGOOUNyEx02ujAkoW1aFnHSO/bu37KAR6Zu0zpy6QyBu6D7/9rIuBVibW2ZMVs3ya90bNrRkydbWc5N6oOlDjH4gGidRRFjoUw1JuDg5FUU2bkkKqAPeXHXwa8wA6/7a1frpoAXe/+79CIvfrEFGwflB6wc8SGlShUqgnGQYDf6GNNrNoj22ZOE6qnBsf19h/jofG0539u6BEqVNJtKeg4+20Fjb6N4658dJsnq0xgFhEJ1rwArQ+DAzjWeNZ6INGe/rPfRX16o0oeuIiOYd6SHJ1gugaKWOaaEY98WxkXNnfYAoP6VLsokRJh0ndb2sqp0N8uBi+Duu3MrNwe+PF2NVcTLYoSyBqj6BqL/nAB5oHiX2KB2tIag7vAi72cucshzuVYCb6K/KvWbcaVuxrWGRE+W3Gi/yg3BcwpBwJFQWswHoomOMMhGp3cr5PdhhbTGUxYTzOkV7dCdIElNmHys1kei6CcM6/5IY9n9mNCjunh5GGt/ZjFjVV5g3G970bDirSjSKZFJKKkJchodnQ7jfUIMdp7oDOZADEVD9oR13GtMqD2qQDGv/If/cwWavrOReEFW0sLE2gHhbXSR0n2ixzIySddR+RveMoNSswaQIhuX+aAEVU/Df1jIhRBZkfm+/CYFcHLhgKHav2Pz+D/6Y13KeAFkIWYA1I1eQsajxkddE/PTY9y3BZBEwhAfdKb14zWw= 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)(82310400014)(36860700004)(1800799015)(7416005)(376005)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2024 20:43:57.7454 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f52e4c1-26d7-4b40-e1cd-08dc49e7a1bb 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: BN3PEPF0000B36E.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8999 Implement live video input format setting for ZynqMP DPSUB. ZynqMP DPSUB can operate in 2 modes: DMA-based and live. In the live mode, DPSUB receives a live video signal from FPGA-based CRTC. DPSUB acts as a DRM encoder bridge in such a scenario. To properly tune into the incoming video signal, DPSUB should be programmed with the proper media bus format. This patch series addresses this task. Patch 1/9: Set the DPSUB layer mode of operation prior to enabling the layer. Allows to use layer operational mode before its enablement. Patch 2/9: Update some IP register defines. Patch 3/9: Factor out some code into a helper function. Patch 4/9: Announce supported input media bus formats via drm_bridge_funcs.atomic_get_input_bus_fmts callback. Patch 5/9: Minimize usage of a global flag. Minor improvement. Patch 6/9: Program DPSUB live video input format based on selected bus config in the new atomic bridge state. Patch 7/9: New optional CRTC atomic helper proposal that will allow CRTC to participate in DRM bridge chain format negotiation and impose format restrictions. Incorporate this callback into the DRM bridge format negotiation process. Patch 8/9: DT bindings documentation for Video Timing Controller and Test Pattern Generator IPs. Patch 9/9: Reference FPGA CRTC driver based on AMD/Xilinx Test Pattern Generator (TPG) IP. Add driver for the AMD/Xilinx Video Timing Controller (VTC), which supplements TPG. To: Laurent Pinchart To: Maarten Lankhorst To: Maxime Ripard To: Thomas Zimmermann To: David Airlie To: Daniel Vetter To: Michal Simek To: Andrzej Hajda To: Neil Armstrong To: Robert Foss To: Jonas Karlman To: Jernej Skrabec To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Mauro Carvalho Chehab Cc: Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-media@vger.kernel.org Signed-off-by: Anatoliy Klymenko Changes in v3: - Add connected live layer helper - Include reference DRM format in zynqmp_disp_format for live layerss. - Add default bus format list for non-live case. - Explain removal of redundant checks in the commit message. - Minor fixes and improvements from review comments. Link to v2: https://lore.kernel.org/r/20240312-dp-live-fmt-v2-0-a9c35dc5c50d@amd.com Changes in v2: - Factor out register defines update into separate patch. - Add some improvements minimizing ithe usage of a global flag. - Reuse existing format setting API instead of introducing new versions. - Add warning around NULL check on new bridge state within atomic enable callback. - Add drm_helper_crtc_select_output_bus_format() that wraps drm_crtc_helper_funcs.select_output_bus_format(). - Update API comments per review recommendations. - Address some minor review comments. - Add reference CRTC driver that demonstrates the usage of the proposed drm_crtc_helper_funcs.select_output_bus_format() API. - Link to v1: https://lore.kernel.org/r/20240226-dp-live-fmt-v1-0-b78c3f69c9d8@amd.com --- Anatoliy Klymenko (9): drm: xlnx: zynqmp_dpsub: Set layer mode during creation drm: xlnx: zynqmp_dpsub: Update live format defines drm: xlnx: zynqmp_dpsub: Add connected live layer helper drm: xlnx: zynqmp_dpsub: Anounce supported input formats drm: xlnx: zynqmp_dpsub: Minimize usage of global flag drm: xlnx: zynqmp_dpsub: Set input live format drm/atomic-helper: Add select_output_bus_format callback dt-bindings: xlnx: Add VTC and TPG bindings drm: xlnx: Intoduce TPG CRTC driver .../bindings/display/xlnx/xlnx,v-tpg.yaml | 87 +++ .../devicetree/bindings/display/xlnx/xlnx,vtc.yaml | 65 ++ drivers/gpu/drm/drm_bridge.c | 14 +- drivers/gpu/drm/drm_crtc_helper.c | 36 + 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 ++++ drivers/gpu/drm/xlnx/zynqmp_disp.c | 170 ++++- drivers/gpu/drm/xlnx/zynqmp_disp.h | 19 +- drivers/gpu/drm/xlnx/zynqmp_disp_regs.h | 8 +- drivers/gpu/drm/xlnx/zynqmp_dp.c | 81 +- drivers/gpu/drm/xlnx/zynqmp_kms.c | 6 +- include/drm/drm_crtc_helper.h | 5 + include/drm/drm_modeset_helper_vtables.h | 30 + include/dt-bindings/media/media-bus-format.h | 177 +++++ 18 files changed, 2198 insertions(+), 84 deletions(-) --- base-commit: bfa4437fd3938ae2e186e7664b2db65bb8775670 change-id: 20240226-dp-live-fmt-6415773b5a68 Best regards, -- Anatoliy Klymenko