From patchwork Tue Aug 15 18:57:04 2023 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: 13645 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp128539vqi; Wed, 16 Aug 2023 09:19:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHumA5PsUTyG3oMfxouj2QAj95DDzlw+LPgIwGp7tILIHHYKGV8LLuu2WVpQMN2y7HTrcVy X-Received: by 2002:a05:6a20:1586:b0:135:4858:681 with SMTP id h6-20020a056a20158600b0013548580681mr3030287pzj.9.1692202793231; Wed, 16 Aug 2023 09:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692202793; cv=none; d=google.com; s=arc-20160816; b=sKEgYB35ZlJj4OVsfwf/fCGCgvP6z/7712EqwIVnIzvWNwEw7o/WHckjOBdloEx1mY s70zTpiY+EyFBAGMrhlXklU0TW5CQ+9Hua5k9cAXi3jBDSdZ2ypSbUrB3Se69LTkPHdS nJS5O680GHOj+Bck6VEnUWrEk0fmJ2ODRBxNaCHKkH7qGiyBeQNouB93W16iJV3o0wFy lVK7MGc5AUsm9omb8NZY7Fow9MGT4QWVswKKvPZp/W7p/W7WVV3c0WYCOQ66yAKSWb7l dfg6Wjdf2Sv2UDVP1ybgetLOkX5/m0CrT+4moZGIcQGJHPtPtXMRrS25QFlRpT6ooZB9 ybMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZfJw8YtuAWgIpX4SalJKvaAgHxhkNMLGIJqI30FWQpI=; fh=qbfaDyBg+GqerSAvcu3kFTx3mMThVk/CBXk9qNOf42k=; b=FRx8fEuleMmc/6l984fWHlHCVarx3NKRE3TnmOzB7Tdhtj6XbDyLVONVHOQNsIKEhz fe6kRUR77g6r4EjxHIm7V7wHoz29vpAGm2W0JIOYtIrD88q3ZHqSofhbJsmnR2jKLxE2 QpcKtsMS1WHfdN34sTyiRpW3KnPIbH7xa0lxphso2diYQwbTn36FowS/iWdpCpnplAXs x3A6yqypQ0sjJt32IzvhCodH57h9cXO0QGHVBShd7YhSgdgRes3lV8P31OmoCRZljGvr 4YthjQXDr+TXpBUKBY4g3Id2xTZFZ341IMUZhd+BFF/a31P/NNCHHiTwus422K7Q9xRa LX1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="GhE/qCkP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p28-20020a056a0026dc00b006871e641c8dsi11668442pfw.12.2023.08.16.09.19.32; Wed, 16 Aug 2023 09:19:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="GhE/qCkP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239577AbjHOS6f (ORCPT + 99 others); Tue, 15 Aug 2023 14:58:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239533AbjHOS56 (ORCPT ); Tue, 15 Aug 2023 14:57:58 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 683991BD8 for ; Tue, 15 Aug 2023 11:57:35 -0700 (PDT) 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=ZfJw8YtuAWgIpX4SalJKvaAgHxhkNMLGIJqI30FWQpI=; b=GhE/qCkPtLj71C+38FG7DRj3V7 NSH4orvnQgch6K1r3W2aKuwtdMDN2k4b3ahM09ByiNPb3ett4VCLPPotWiEXQORa+ib2eIFptE/Fw SlanaUEQwQ04BgJHKsrQHBfFY2V69dzPIxWc6GPdR5TZF0h6Ix3TO2TrMpYAV9tK6FjalD5MWqChW IXeFIwSW/D9P4BLMm6DKWrLfF4njGMhF3farNREBPIdYOaANDAPuA/P51XYzYMp9Wt4oNh2Ma6rvk glhiKubS8apVZE1TRULxOh6btrIn/hbthx60guWVe2+W8R9/zF1j2GeO1GK7JJAAKo/jbztakXmGS wczWhf4w==; Received: from [191.193.179.209] (helo=steammachine.lan) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qVzEN-001Ca3-8z; Tue, 15 Aug 2023 20:57:27 +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, wayland-devel@lists.freedesktop.org Cc: kernel-dev@igalia.com, alexander.deucher@amd.com, christian.koenig@amd.com, pierre-eric.pelloux-prayer@amd.com, Simon Ser , Rob Clark , Pekka Paalanen , Daniel Vetter , Daniel Stone , =?utf-8?b?J01hcmVrIE9sxaHDoWsn?= , Dave Airlie , =?utf-8?q?Michel_D=C3=A4nzer?= , Randy Dunlap , hwentlan@amd.com, joshua@froggi.es, ville.syrjala@linux.intel.com, =?utf-8?q?Andr=C3=A9_Almeida?= Subject: [PATCH v6 0/6] drm: Add support for atomic async page-flip Date: Tue, 15 Aug 2023 15:57:04 -0300 Message-ID: <20230815185710.159779-1-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774403236291478058 X-GMAIL-MSGID: 1774403236291478058 Hi, This work from me and Simon adds support for DRM_MODE_PAGE_FLIP_ASYNC through the atomic API. This feature is already available via the legacy API. The use case is to be able to present a new frame immediately (or as soon as possible), even if after missing a vblank. This might result in tearing, but it's useful when a high framerate is desired, such as for gaming. Differently from earlier versions, this one refuses to flip if any prop changes for async flips. The idea is that the fast path of immediate page flips doesn't play well with modeset changes, so only the fb_id can be changed. The exception is for mode_id changes, that might be referring to an identical mode (which would skip a modeset). This is done to make the async API more similar to the normal API. Thanks, André - User-space patch: https://github.com/Plagman/gamescope/pull/595 - IGT tests: https://gitlab.freedesktop.org/andrealmeid/igt-gpu-tools/-/tree/atomic_async_page_flip Changes from v5: - Add note in the docs that not every redundant attribute will result in no-op, some might cause oversynchronization issues. v5: https://lore.kernel.org/dri-devel/20230707224059.305474-1-andrealmeid@igalia.com/ Changes from v4: - Documentation rewrote by Pekka Paalanen v4: https://lore.kernel.org/dri-devel/20230701020917.143394-1-andrealmeid@igalia.com/ Changes from v3: - Add new patch to reject prop changes - Add a documentation clarifying the KMS atomic state set v3: https://lore.kernel.org/dri-devel/20220929184307.258331-1-contact@emersion.fr/ André Almeida (1): drm: Refuse to async flip with atomic prop changes Pekka Paalanen (1): drm/doc: Define KMS atomic state set Simon Ser (4): drm: allow DRM_MODE_PAGE_FLIP_ASYNC for atomic commits drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP drm: introduce drm_mode_config.atomic_async_page_flip_not_supported amd/display: indicate support for atomic async page-flips on DC Documentation/gpu/drm-uapi.rst | 44 ++++++++++ drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 1 + drivers/gpu/drm/drm_atomic_helper.c | 5 ++ drivers/gpu/drm/drm_atomic_uapi.c | 80 +++++++++++++++++-- drivers/gpu/drm/drm_crtc_internal.h | 2 +- drivers/gpu/drm/drm_ioctl.c | 5 ++ drivers/gpu/drm/drm_mode_object.c | 2 +- .../drm/i915/display/intel_display_driver.c | 1 + drivers/gpu/drm/nouveau/nouveau_display.c | 1 + include/drm/drm_mode_config.h | 11 +++ include/uapi/drm/drm.h | 10 ++- include/uapi/drm/drm_mode.h | 9 +++ 12 files changed, 162 insertions(+), 9 deletions(-)