From patchwork Sat Jul 1 02:09:11 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: 11509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp10789595vqr; Fri, 30 Jun 2023 19:38:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlFXzmsDFWh2LyioGX1kvhCrMmQXSOTbQPhqMfTl2UUlff9hVBJwHxzHtKX2G9X10LJsTPzc X-Received: by 2002:a05:6358:e813:b0:134:e5e7:fb0b with SMTP id gi19-20020a056358e81300b00134e5e7fb0bmr4340955rwb.0.1688179082855; Fri, 30 Jun 2023 19:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688179082; cv=none; d=google.com; s=arc-20160816; b=fS/FRIuAmgnW220ppNwVwSufSQXX4Wjj1whNc7i/11nSQid15WU/CjJGXcBhn5Ju9j rq8vT6LLas9LzMb83RiRuReDG4Cux52k49zuOKFm2erQat4Fuw6xdH4mLFshgEGfEhBW M5h4kuSvHbViD7bcZyPfDe5XqJbmSnEASHtkt8yJg1iXCutZvA6I2/CgSuxWFTML8pYh 5u4CmKBZhtsMt/wrCS92Zxj+wNuUvtRNdeQ6mIi/Z5AhhfFBpZWo3dBUBKdDV1q69d72 6r0H9nnd/1xKep42WK2GM1rnHY95F2vOSkZ9vlkQiyEc0BACHnpMjuob/7NrslBU4LvH 3BXw== 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=DTlH1QZL9ONljiaNmWd/MfYuknpYQs+KwTmRxFWAUtk=; fh=yJKnCMONMPDb5DcRuNlFPqebkFeNCW1ydpZFk0usg5k=; b=MFZ8GdPdz3bz1jIS0HmddGM7Feji2JewVaICiBnMJEAywfgKYRNCV2jGnYV2sKDooB c0LAogug2F4BKfqGxGzlcW+memk3hc4yR3j0NzgAP6YiS2qMFBJ7iZTkSp8V3ISDeYz6 ChqCUsTyNgjKPz+qRxSsRAvIc++PL9sBA7AHBTQvoi/Rj1Bwj8ny0utsEk1S3r9DQPKI PhU93S3vzCNb0NBtLAggaR5tC/zut6GW2mBYBecdrBl5P/+XFkpcWWsb3DHNgbC5kESr FZ6YwYe70s5QGlg9jemCGKvFXO6ZgtCeAiAC53KDCaWLgLSmdcbQekmfQbsfjD06bY9B cbCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="E/uEgJcG"; 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 b9-20020a170903228900b001b837b6205fsi2291796plh.148.2023.06.30.19.37.41; Fri, 30 Jun 2023 19:38:02 -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="E/uEgJcG"; 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 S229773AbjGACJh (ORCPT + 99 others); Fri, 30 Jun 2023 22:09:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjGACJg (ORCPT ); Fri, 30 Jun 2023 22:09:36 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB711997 for ; Fri, 30 Jun 2023 19:09:32 -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=DTlH1QZL9ONljiaNmWd/MfYuknpYQs+KwTmRxFWAUtk=; b=E/uEgJcGxY/pqHuXM6OYTeki3A aH2BZhcYQC+waPuCwq8HsR2t6fr9QaPiveu/LOYGgnSZZgasCvu/FOTDzCCGn6o07yklZ89L9Fxwv 2tKFg3eC2UJlbfkuJ00GiLIKpLGWYqgm2XkkWXlX6Q+XHODzgvh3XLl3cukWq0igXytdDrxktj/pi ALHch9yKcpUiG1Qc2JnWDdG2q5b/6BmQhqDMS9nIaenLIWbfV/ZBz4rV7HzRnRuIN5AXPxI1O+gRG 2vlMIIPtJ2AjjXE6LhNLg38ykSZKzTbKQQXknUTQGG+1ABmqWkOQxxE7jy0pJf3TT1kMKiMKq7PwZ sTjf6ZkQ==; Received: from [187.74.70.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 1qFQ3B-006abr-Ka; Sat, 01 Jul 2023 04:09:26 +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?= , Italo Nicola , Randy Dunlap , hwentlan@amd.com, joshua@froggi.es, ville.syrjala@linux.intel.com, =?utf-8?q?Andr=C3=A9_Almeida?= Subject: [PATCH v4 0/6] drm: Add support for atomic async page-flip Date: Fri, 30 Jun 2023 23:09:11 -0300 Message-ID: <20230701020917.143394-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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770184069913437973?= X-GMAIL-MSGID: =?utf-8?q?1770184069913437973?= 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é 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/ - 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 André Almeida (2): drm: Refuse to async flip with atomic prop changes 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 | 19 +++++ 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 +- drivers/gpu/drm/i915/display/intel_display.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, 137 insertions(+), 9 deletions(-)