From patchwork Wed Mar 13 00:55:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13590811 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 42E13C54E5D for ; Wed, 13 Mar 2024 00:56:02 +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=iNbhGiV7mknSFc8UtFx1LhKQBYBeHqWRh7jHv1yX4js=; b=Rj16Q4WU/+tkV4 l0yvBVSJW8zdylfwskdt4IBUAhmoekipkEGjyQCwoMuHvkmsktT5O+1jmkV8Y0ohohMmVLbjtwBMl codF+aVc3J0AqGy63Qgk5oS9gjvNxevlG4VT4J0VnwMFcmtFxnTSiwjRSXomRpTpJL80VK/4KddAl fU7xprnJD0RKhwIW7UwmeaqMtBx2ZgO/zR8X5fq6yLYYDmvPhFjf+5+rxawBtshyhXrg6FHSVJCGL 3nHxE5PSuVL8WkrSqAPepN6H6YEhir8qh+kz+ggGiSRCg39+nZlPCOAevPh02pyMl+LTTIArulpS9 OHGV1VAWK1eesRUJm5QQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkCuI-00000008CDv-2M7R; Wed, 13 Mar 2024 00:55:46 +0000 Received: from mail-mw2nam12on20601.outbound.protection.outlook.com ([2a01:111:f403:200a::601] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkCtr-00000008But-14Jw for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2024 00:55:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MaQJeOWxUzO1s7Pox6JVOo3CwH4PzPnW4ztSrl/3pmnjTzKjYcnKUQ6jAP+LjSRiJN+yYpAzIxmreqJpabghtJgUD2DtlfLqQb6mJvRmO0e9LZbsrMNcoNzIpe9cd5D8hODtmVnLQpCpHCA4xUh/px+kMW9SAV4Cj5zsuXaFmPYx845h1vzI4C5R8ILIZZzKFstIhx9Zs2YoF5qnYtAZCpIR7Pj8zm61jKOo6MsuqMDbzuqp2i+VNXdc5HdG2gmXzIa8/+N7c1qkcaJha7yJ82E5XONBQPAtPz+cOBfGtNku1gizKJh1vBkN4krhqE2NilSofjhEvxzqLyAZaXuybw== 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=+2DwGrSu2jUWc49F+HOCYQHBQGGwOqBE37O8Ck5UkZ4=; b=IkgIN3gnVH0HoGZe9ONBh99MA1M/ZY9qgLot+acyqhgLqef/usZB4gYIejh7KcP8eBKU9DmsL2RdNJU8OJTaaXADOSzs0bD70xU98MMmWDsaaP2tgPafUWQbTqwpJjJYS6iuUvlw68vzRfU6HprKiYzlRj5lUq6kUe/ZdUwKyz3R1xIkIQMBbRIbTmGY4hkmjviGwlfJtYKlJHxH373klz9D+nyQ1z+8XZNlzh1HuMVLNdWzo+U55uBInvD3frug56HTOCqmz92Y3+gvlblfqQR80hOL7vZc5+AbZEBhomjZbfHDLVZLO8t6fuAU/hC5MKYoFJxwUKFXszKPiZD8NA== 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=+2DwGrSu2jUWc49F+HOCYQHBQGGwOqBE37O8Ck5UkZ4=; b=jk4ScPx+4Oi6TJbKkIuNh6mEBAp0+AV8/HeNj2PA69Gktpxu9ft5o8vIJnktAOogWVtF0bR2KkCQL7+PHaR5v825oii8383hPUtSMSxoBjCMpTHquwpb9L7kKqop1B/rg6II9usfYd9aXAxOxh32BCyg2CkCYQ2SDzNEpCzq70Q= Received: from CH5P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::26) by SA1PR12MB8723.namprd12.prod.outlook.com (2603:10b6:806:385::12) 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:11 +0000 Received: from CH1PEPF0000AD7A.namprd04.prod.outlook.com (2603:10b6:610:1ee:cafe::fe) by CH5P222CA0011.outlook.office365.com (2603:10b6:610:1ee::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19 via Frontend Transport; Wed, 13 Mar 2024 00:55:11 +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 CH1PEPF0000AD7A.mail.protection.outlook.com (10.167.244.59) 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:11 +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:08 -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:07 -0500 From: Anatoliy Klymenko Date: Tue, 12 Mar 2024 17:55:01 -0700 Subject: [PATCH v2 4/8] drm: xlnx: zynqmp_dpsub: Minimize usage of global flag MIME-Version: 1.0 Message-ID: <20240312-dp-live-fmt-v2-4-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: CH1PEPF0000AD7A:EE_|SA1PR12MB8723:EE_ X-MS-Office365-Filtering-Correlation-Id: be69a5a1-5736-47c2-6fa9-08dc42f83ca0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9v+7fmB4ly79jTCBWGd7EezStCs4fgKecvvIWa9lBygmY0JNg+FCP+vELZTwyqQF331g4wvTjx0mx+6udizt87BbZdLOtgJldSiu2yWpLTC71520RhMpOPR3Py2vh+rAGpuvJ4uniP3hzthXCGIxgpfT2vfjtF/M3oeLEd4/FDwwIzW2BtANv8AcUp1HAvsagZxQQYy8AqvnB4p3I4w3Cs3vJJcXZK9xnw5VFdt+xJRDge+4qTqZ0xuCf4RUIxznaZnFp2HIHsIguauy8mWh3pkz94rC3tH4fLvJrsMXwxvkTbYypAewPdowCbDnmfp5nTFd1JiTT+E1R/3oiw5QL7uLwnVmfOE1Hkb3LxMbe3HTg3phBQx74Rt7s1/F27Q4V8niSk1SX3zBVjcyHhKHH6u+1rVkOHT+fcGs7taCGvPdbAURH7jt5nqxhPh8Dg8diPm5kHNu23LNmh4HNCTQN4438zUjOECGpfU2krk6T9Hx/U5F8FtNJfW3JrxwJFy+2OAPIhg/H3d1wjq+kIQOPPaq/sNZc6xQ9rFFJ4Y1oPHGJyJUdVFbra2w8heltC3xQzFGPiTEVQRTxYyiVU2REsUfkHhYiNopRdFq3VSRFWTpnkbV8/jEGryPEuNO4bQ+KsMAUgpCpz53x1SjGJnhJsRvn1VgxZjTgCO7wD9jHRXlYgunxhYAnHekz8prCKhh1TKG76wRvbA+uGuamE67ymJ2nd3CrH44SCZtIEnB1isYZPtmxWxdMJwL/f9YxIGkpNQrD+t3O7O2RGO9Ac7MVg== 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)(7416005)(1800799015)(376005)(82310400014)(921011);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 00:55:11.5612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be69a5a1-5736-47c2-6fa9-08dc42f83ca0 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: CH1PEPF0000AD7A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8723 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_175519_629448_86536DAC X-CRM114-Status: GOOD ( 15.31 ) 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 Avoid usage of global zynqmp_dpsub.dma_enabled flag in DPSUB layer context. This flag signals whether the driver runs in DRM CRTC or DRM bridge mode, assuming that all display layers share the same live or non-live mode of operation. Using per-layer mode instead of global flag will siplify future support of the hybrid scenario. Signed-off-by: Anatoliy Klymenko --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index af851190f447..dd48fa60fa9a 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -975,7 +975,7 @@ void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer) { unsigned int i; - if (layer->disp->dpsub->dma_enabled) { + if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) { for (i = 0; i < layer->drm_fmt->num_planes; i++) dmaengine_terminate_sync(layer->dmas[i].chan); } @@ -1001,7 +1001,7 @@ void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); - if (!layer->disp->dpsub->dma_enabled) + if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) return; /* @@ -1039,7 +1039,7 @@ int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer, const struct drm_format_info *info = layer->drm_fmt; unsigned int i; - if (!layer->disp->dpsub->dma_enabled) + if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) return 0; for (i = 0; i < info->num_planes; i++) { @@ -1089,7 +1089,7 @@ static void zynqmp_disp_layer_release_dma(struct zynqmp_disp *disp, { unsigned int i; - if (!layer->info || !disp->dpsub->dma_enabled) + if (!layer->info) return; for (i = 0; i < layer->info->num_channels; i++) { @@ -1132,9 +1132,6 @@ static int zynqmp_disp_layer_request_dma(struct zynqmp_disp *disp, unsigned int i; int ret; - if (!disp->dpsub->dma_enabled) - return 0; - for (i = 0; i < layer->info->num_channels; i++) { struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; char dma_channel_name[16];