From patchwork Tue Jun 18 03:00:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Almeida?= X-Patchwork-Id: 13701734 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 5B53EC2BA18 for ; Tue, 18 Jun 2024 03:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ArM+639iudtviX5z1Tlj1/XIkLX2KQBeY8XxqJXMBcQ=; b=1XG8/2f+Ei9fyk a3fIQj0WBr28j2AyizFDvvWqLNTgm3H4993P0EqpodCP/kyS8z19umfYKRzTxyKfDX8nnqTGwSfBb EKhf30gioFubhOzY6SfxHYBoSPeWhwN8AG9oHQTD8UBMri3Z8h33zw8MAeZdqSYegxf8CNcPOZg8c eHR5RTeXU8IkD1g5riTMg3BiwcP8BEtt9GgYc/frQ2YoH+u1dY9LycTcOeIOrSnv7MAxXtlbrIOM6 wyE9JP4hqByP9fInCDgUbFVgDFtVa08z0X0B3T2bJ8OfLhst6GyY79j33VQvepY0r+WsXuqLBCg32 ZtjMSK8+y9omtTe6Tqng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJP64-0000000DMjZ-13B7; Tue, 18 Jun 2024 03:01:24 +0000 Received: from fanzine.igalia.com ([178.60.130.6] helo=fanzine2.igalia.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJP5q-0000000DMXM-3kB4 for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2024 03:01:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ArM+639iudtviX5z1Tlj1/XIkLX2KQBeY8XxqJXMBcQ=; b=bXJeBIcaIhMdj818RLv9AY0d9W nYzL4JUAlUcu4IF8fq8+54iIoD+284k0ffEAsYRMiT/ySb3XsUDm6TVGJfiu0LzekGQEVLoLkW2r+ jIxjQQxIONQJkQLbYb99sNkx8YLcIjgZnKPb0Y+ox0C1IqJGUuCniisOrpThhQXBjgf6gNP/+uyzn 3fwQIH/5z0VNWzsuI3BfOPnzkqYHHzfKosChM/fcLUY0iDzcRSewqFDXbNzM9V4n9SOUcBU70CxMA g7ItUzhSvd3inPkGNfFRCIauLdF5UBU69yvGao9qJ95lVUiRq8ZuyBQ9tn+r0+aHChfGe68UCY50t mc3mo2LQ==; Received: from [191.8.29.108] (helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1sJP5G-004YXc-E1; Tue, 18 Jun 2024 05:00:34 +0200 From: =?utf-8?q?Andr=C3=A9_Almeida?= To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Dmitry Baryshkov Subject: [PATCH v7 0/9] drm: Support per-plane async flip configuration Date: Tue, 18 Jun 2024 00:00:15 -0300 Message-ID: <20240618030024.500532-1-andrealmeid@igalia.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_200112_375849_038663F9 X-CRM114-Status: GOOD ( 12.73 ) 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: , Cc: Alexandre Belloni , =?utf-8?b?J01hcmVr?= =?utf-8?b?IE9sxaHDoWsn?= , Claudiu Beznea , =?utf-8?q?Andr=C3=A9_Almeida?= , Sam Ravnborg , ville.syrjala@linux.intel.com, Karol Herbst , =?utf-8?q?Michel_D=C3=A4nzer?= , Dave Airlie , Daniel Stone , kernel-dev@igalia.com, Lyude Paul , Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , Melissa Wen , Pekka Paalanen , Jani Nikula , Rodrigo Vivi , Boris Brezillon , Simon Ser , Xaver Hugl , daniel@ffwll.ch, alexander.deucher@amd.com, christian.koenig@amd.com, Joshua Ashton Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org AMD hardware can do async flips with overlay planes, but currently there's no easy way to enable that in DRM. To solve that, this patchset creates a new drm_plane field, bool async_flip, that allows drivers to choose which plane can or cannot do async flips. This is latter used on drm_atomic_set_property when users want to do async flips. Patch 1 allows async commits with IN_FENCE_ID in any driver. Patches 2 to 7 have no functional change. As per current code, every driver that allows async page flips using the atomic API, allows doing it only in the primary plane. Those patches then enable it for every driver. Every driver that I found out capable of doing async flips were changed here. The drivers that weren't touch don't have any mention to mode_config::async_page_flip, so they are not currently advertising to userspace that they can do async flips. Patch 8 changes the current DRM uAPI check from allowing only primary planes to allowing any plane that the driver allows flipping asynchronously. Patch 9 finally enables async flip on overlay planes for amdgpu. Changes from v6: - Added async_flip check for i915/skl planes (Rodrigo) - Commit the plane->async_flip check just after all driver had set their async_flip capabilities (Dmitry) https://lore.kernel.org/dri-devel/20240614153535.351689-1-andrealmeid@igalia.com/ Changes from v5: - Instead of enabling plane->async_flip in the common code, move it to driver code. - Enable primary plane async flip on every driver https://lore.kernel.org/dri-devel/20240612193713.167448-1-andrealmeid@igalia.com/ André Almeida (9): drm/atomic: Allow userspace to use explicit sync with atomic async flips drm: Support per-plane async flip configuration drm/amdgpu: Enable async flips on the primary plane drm: atmel-hlcdc: Enable async flips on the primary plane drm/i915: Enable async flips on the primary plane drm/nouveau: Enable async flips on the primary plane drm/vc4: Enable async flips on the primary plane drm: Enable per-plane async flip check drm/amdgpu: Make it possible to async flip overlay planes drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 2 ++ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 +++ drivers/gpu/drm/drm_atomic_uapi.c | 8 +++++--- drivers/gpu/drm/i915/display/i9xx_plane.c | 3 +++ drivers/gpu/drm/i915/display/skl_universal_plane.c | 1 + drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 ++++ drivers/gpu/drm/nouveau/dispnv50/wndw.c | 4 ++++ drivers/gpu/drm/vc4/vc4_plane.c | 4 +++- include/drm/drm_plane.h | 5 +++++ 9 files changed, 30 insertions(+), 4 deletions(-)