Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp921890rdb; Tue, 15 Aug 2023 16:57:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFD5HS2Y2+zJQzycfLqR8/+FS74lA67Ms/IAtJYcDKFXySTod1CpJFMFlMZtrwGsKH3a+1 X-Received: by 2002:ac2:5938:0:b0:4f9:cd02:4aec with SMTP id v24-20020ac25938000000b004f9cd024aecmr246283lfi.29.1692143841588; Tue, 15 Aug 2023 16:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692143841; cv=none; d=google.com; s=arc-20160816; b=kxIoxDZ6MtdtQVSdlZnUYs2Dg70Chl+p0jH8kIz5k+qsvhkjCjOz8EcdtI91UoN0/X hTQynbHc79ee6JFzHYmG9ZyqtPNa+9EhpbDlOgb/kilA4g+lRtJsMcCCr9XGnSqHyMnf 6pc3IO60r0bIoqqANsqsySnAr52zn24Wh/clwhRWffx1qFibYMDBRsNIAcsbJ5eKdN2D t6Fg+5Jtn54yNrRWFV5l/8zIQrPwkxhl3kNRY5gh6mGftcxTele07fYPAoc4V+a09h74 m2whMYpFVNdrVKzdIqZad4720usozqvmqKb6g8n1DJAxfJFs+bhYnMqh1HgwpVIwpbkk UtpA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=12D9YB4XL5iWqebcq+TLGzYuVPhU8QWpBYqiCegu2nk=; fh=qbfaDyBg+GqerSAvcu3kFTx3mMThVk/CBXk9qNOf42k=; b=k5HDkJFq+UY2AqwY22OuXCdrpkZkOYwhpphA6wHOxPzy/Yj74iuK3pLyt8PNd7H16m wzF+o1NJcljO3y7/qxohg2YXZkMtyDrfUtXTFQPxx+d+F9hTh/DzZpDnXYczBHh0Bed4 xaJghAxbgyOF4QiZs3ajxDKPkCnsbz556cWs/1dhzSLFBBSnfqqxGeauGTsmCS+Zst+k crzu7iMcp10+NoFQyU2h7cJnOkOPa2IOqd3KxBjQxilvQOkk7FgbsKYFrGwkxYvkDnAX kymk3L9UGWKqCr1wvedqkcPlxyuaJz/18rDGwBkL0ya2PZPWQN5+lupWdw9TxlyZl84o dA3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=WghJqxe8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020aa7d842000000b005256b2c1de1si3264932eds.325.2023.08.15.16.56.57; Tue, 15 Aug 2023 16:57:21 -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=WghJqxe8; 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 S239582AbjHOS6h (ORCPT + 99 others); Tue, 15 Aug 2023 14:58:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239569AbjHOS6B (ORCPT ); Tue, 15 Aug 2023 14:58:01 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 313F2211C for ; Tue, 15 Aug 2023 11:57:40 -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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=12D9YB4XL5iWqebcq+TLGzYuVPhU8QWpBYqiCegu2nk=; b=WghJqxe8TxHFnK1XYxxq+A7WLQ e62VanIPpX+mcWyG9UiL5FjfzQ4ltV8q/dVjqeNFd0IQf5r7gF1Oqe1vLSmzo3dNgrQMhVzolFTW3 5d8ap0btaEfqv/oQP6XJso9ueDHqOmWTD17IbtfLmQbym2ij+FBQ8Iq3n011Abylf9Z0tNq/IK3VP Ovp7m9CqI3yERWtwWUmeY4ohBkemIZS0gtg0+DVIxBGw7uMprLh+8ShSp776k9nsSvJkuD89uumZF 31T2YnWrWx23mz9VFa/SaZ49C0VMRY3i4yqJG3sAl8Gly8HcCorK++rGGH9HfIH8x5wkhAUydMjr9 JMEPCVnw==; 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 1qVzEX-001Ca3-7J; Tue, 15 Aug 2023 20:57:37 +0200 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= 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?q?=27Marek=20Ol=C5=A1=C3=A1k=27?= , Dave Airlie , =?UTF-8?q?Michel=20D=C3=A4nzer?= , Randy Dunlap , hwentlan@amd.com, joshua@froggi.es, ville.syrjala@linux.intel.com, =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v6 2/6] drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP Date: Tue, 15 Aug 2023 15:57:06 -0300 Message-ID: <20230815185710.159779-3-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230815185710.159779-1-andrealmeid@igalia.com> References: <20230815185710.159779-1-andrealmeid@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Simon Ser This new kernel capability indicates whether async page-flips are supported via the atomic uAPI. DRM clients can use it to check for support before feeding DRM_MODE_PAGE_FLIP_ASYNC to the kernel. Make it clear that DRM_CAP_ASYNC_PAGE_FLIP is for legacy uAPI only. Signed-off-by: Simon Ser Reviewed-by: André Almeida Reviewed-by: Alex Deucher Signed-off-by: André Almeida --- v5: no changes v4: no changes --- drivers/gpu/drm/drm_ioctl.c | 5 +++++ include/uapi/drm/drm.h | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index f03ffbacfe9b..3562b717b74f 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -301,6 +301,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_ case DRM_CAP_CRTC_IN_VBLANK_EVENT: req->value = 1; break; + case DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP: + req->value = drm_core_check_feature(dev, DRIVER_ATOMIC) && + dev->mode_config.async_page_flip && + !dev->mode_config.atomic_async_page_flip_not_supported; + break; default: return -EINVAL; } diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 794c1d857677..58baefe32c23 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -713,7 +713,8 @@ struct drm_gem_open { /** * DRM_CAP_ASYNC_PAGE_FLIP * - * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. + * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for legacy + * page-flips. */ #define DRM_CAP_ASYNC_PAGE_FLIP 0x7 /** @@ -773,6 +774,13 @@ struct drm_gem_open { * :ref:`drm_sync_objects`. */ #define DRM_CAP_SYNCOBJ_TIMELINE 0x14 +/** + * DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP + * + * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for atomic + * commits. + */ +#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15 /* DRM_IOCTL_GET_CAP ioctl argument type */ struct drm_get_cap { -- 2.41.0