Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23159515rwd; Fri, 30 Jun 2023 19:38:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4k1Kvo7YqU8xNCPmnyjOVcghc21vkZYFdOdPvjguiD9WvWsH1xfuOm2k65eoJk8w9iT1oP X-Received: by 2002:a05:6808:1b23:b0:3a3:6113:ce79 with SMTP id bx35-20020a0568081b2300b003a36113ce79mr4249233oib.40.1688179083388; Fri, 30 Jun 2023 19:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688179083; cv=none; d=google.com; s=arc-20160816; b=pZhacaNjOLF3zJAsvfmbKeqKscEAvY6aSP0m3EB+qgelW83SljoYNM9Q4/U5D9rt+W HnWz66owRL9NUC2POpVrgIcanN2haPVNsEBADR1JOeeTB5jko7xxX3WVgNSmyQzGek3F loz2Ea3JWfSsEiEYV3s3i4Wc0ZXk9/MTuCDM2/sidoJPPhkSKFtZR40LsiPveMACaP1v 6iEv2OWxZlB/dHbdmIxWZqXSclzj1Z0/feoC0I3/MV6atLFMxhgz3FKhwHcRV3wdnVY/ /fpW5QvLm3oSEWlcGmdzqK45iF2W+0DudWjxXSeiF83MUMXdvrv/TQH3Xe/ioxBa+oRG xYpQ== 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=HPO0XUJvL8MHQ9quXzm+tMdaWyxXHw4tFqRhJIQaDP4=; fh=yJKnCMONMPDb5DcRuNlFPqebkFeNCW1ydpZFk0usg5k=; b=T6adt1qJQ+Sv68LVLl78/CPGm0P0AfuApvSDJI0KiIW0uHvhVfIRU9HvR93xbU4jsk nWQ02nWka7EZx9DPaSiwn01vF8zzNIeHl27Ww9glju5S0A1/fglWAYgL3Ll36i0GxJQZ NsZiswbXSeu+mH04abWD3U+dyLf/Yxc1EiGn/yjQCY6CVCCfcqLOvIYU9wn1ed6XDEWW A/OEsGCZlsNwk8h+ZtDjiuFNizQdmBBQ3hwQSWE0nt9v3cqDoE+W101Uf4k3a1EfpcS5 nEprY25npXc6CerXg1krNZLhjRtNdSRx/t92Ckz2iw19cKUrdEcNnrpeIqw9NlNYRC1d 7vcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=G81G6jtz; 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 n66-20020a634045000000b00553836cb761si13742707pga.717.2023.06.30.19.37.41; Fri, 30 Jun 2023 19:38:03 -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=G81G6jtz; 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 S229905AbjGACJo (ORCPT + 99 others); Fri, 30 Jun 2023 22:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbjGACJj (ORCPT ); Fri, 30 Jun 2023 22:09:39 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BC9A1997 for ; Fri, 30 Jun 2023 19:09:38 -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=HPO0XUJvL8MHQ9quXzm+tMdaWyxXHw4tFqRhJIQaDP4=; b=G81G6jtzf5peArDdZPEHo5CFND 9ShevZnQGMgqjIxJa8fJvELfg5qHbJpntuyUtQyljiOgRr00DsNj0pIb9i7kfq5Ar6aFMWsZrpD05 AwlRe/nsLRKLaDUtiEMgPPijGxLzDmpTs/WOpKeUWfXJ65CONWQFUhwxoQQfM2XqO4xLqFb1tux1P oraLfPnC4/2W3gEwfeZSCfxviWGgka8EUWyjkuo5AkzrVG/W4gxVDTaQwBGpUuDn4SZgEcGJ9VCtK 6SMHc7OWFITQUT6bOwQsXMdoYP+c7qg4hoL0Gd8nh6kmYLY/HssVVGJ1uNzftRxSm3Te6PkhEYILP XcKuM40A==; 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 1qFQ3L-006abr-S9; Sat, 01 Jul 2023 04:09:36 +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?= , Italo Nicola , Randy Dunlap , hwentlan@amd.com, joshua@froggi.es, ville.syrjala@linux.intel.com, =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v4 2/6] drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP Date: Fri, 30 Jun 2023 23:09:13 -0300 Message-ID: <20230701020917.143394-3-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230701020917.143394-1-andrealmeid@igalia.com> References: <20230701020917.143394-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,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 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 --- 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 7c9d66ee917d..8f756b99260d 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -302,6 +302,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 a87bbbbca2d4..54c558f81f3c 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -706,7 +706,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 /** @@ -767,6 +768,13 @@ struct drm_gem_open { * Documentation/gpu/drm-mm.rst, section "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