From patchwork Tue Aug 15 18:57:06 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: 135734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:3f2:4152:657d with SMTP id x8csp948612vqo; Wed, 16 Aug 2023 01:06:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZHbHLI/hFUh25WDVLMgHt+YIm+I8Cu+wQDg1XUc6J1PVy2KX3H5PoErnwfVPEdOET1uBH X-Received: by 2002:a17:906:8a48:b0:99b:6687:6107 with SMTP id gx8-20020a1709068a4800b0099b66876107mr813190ejc.5.1692173212572; Wed, 16 Aug 2023 01:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692173212; cv=none; d=google.com; s=arc-20160816; b=mMzAh/zVBnEwVWaP6+1MEAxBBh8c7+dqv4jmC0JVV/rPQ6gDVEs4ZuZHJQyf2hyipH tkht5XhhKXhyifxF8g68f+fNvSL0hPGqaDJDs3bF91le3+0YywlPJ2bz5bpUn9rhHDEA C+w500ERQWL7ColRER+G5VoW4/dMuzi+IPcni2TdIs7p3C3KsN3aa/VJ3I21n2jwDrWy q00c+sxHnjmB7zSoybNjqJ2k22f6XdbSCJTiCwYLMJh3bLDHcSfk7pUpLXf1Q/PT0jRb hw3LtPYATIoaeGP9+UB85YcYL8YHvpnGIyp+nfnWxhSLxw4jUXM3OQqnVf4mVnPVInTc UrSw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lm18-20020a170906981200b0099364d9f0e4si10529540ejb.278.2023.08.16.01.06.28; Wed, 16 Aug 2023 01:06:52 -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 S239585AbjHOS6i (ORCPT + 99 others); Tue, 15 Aug 2023 14:58:38 -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_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 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 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: 1774372218482983558 X-GMAIL-MSGID: 1774372218482983558 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 {