Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32527737rwd; Fri, 7 Jul 2023 15:56:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlHTHQR83BwOZSmcuQvaKHoPP1RRwogcmdV+2TmKtE2shmN+LwabtIUp9bhhL4PElzdvDqS5 X-Received: by 2002:a05:620a:2402:b0:765:2ea1:d152 with SMTP id d2-20020a05620a240200b007652ea1d152mr6719434qkn.27.1688770568253; Fri, 07 Jul 2023 15:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688770568; cv=none; d=google.com; s=arc-20160816; b=trH0g7syUuSEuePjsO+zgKSHE5c+FCuUs3q++UKGZDxyKZZ84pa17FgG7y6fUxoH3L AN1gHuuoIaY3IJASmqFLbE9D5SAAuejPvhu1B7PVYAULiwOo6Qb/dvefpcJ+nQRxsLbF VydPYXtJ0TeLfnZMH1tO8mHk3OqdxSY7yjPV0SwqSOBCSyfFYl/7e+1xHQX39Ye+uCvx obk7HENvLmUzPRmxtN/UbPzn23kXG0dOFXwOI2tm4pp01/41x8eyKbS2Iry2F67gze0E kKQpDyetlbuLdBwuumRkq4aF1l6fog3c3Csl20uREbsdgyBNmmt37djnhaS43MFWTsAM gztw== 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=qbfaDyBg+GqerSAvcu3kFTx3mMThVk/CBXk9qNOf42k=; b=ytuyj7GYuM5n3qF7jyQpsw0XJOJLflcblUc5N38gJLBduTYPEraXgESYw8IpGD3vz6 +xYP37t/2YNhkOAdiUHpD28GSx0Ofo+O9vd4WLr/6IxBurycRaVw7SS4An3CVg4BWh/8 3Hh0kex2V27+0yJHwG7PjTYiZPYHud6T/kNknz4YTJ8kd9D2oUfSu1I4/xEHlJvvDViu pM2yeRytu67O2Awne1gEG5cCxeUxoN5u5UM4ZcVjSVm142sqwkGxV0tC4xSv8wTeAlo9 JWNDUVOjdB7LZyp02OkiGjDdf/wraDTrnFLHggRhgbgNtnoBlanvM2Ml130tr8m0Nqc2 ShOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=WTX3qzd2; 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 t11-20020a056a00138b00b00665dfbf3b1esi4887615pfg.270.2023.07.07.15.55.55; Fri, 07 Jul 2023 15:56:08 -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=WTX3qzd2; 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 S232088AbjGGWle (ORCPT + 99 others); Fri, 7 Jul 2023 18:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231245AbjGGWlZ (ORCPT ); Fri, 7 Jul 2023 18:41:25 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 067D82127 for ; Fri, 7 Jul 2023 15:41:25 -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=WTX3qzd2WgPiBRfVMnXdnjDkIL Xt0tfRouRdRFvzV9YPftRJk2trpmEsvBPLJ3D9GGBpRcqsdmC3apU+KoZ5BevgZl1busI9l1mz1MX dtEbJ8YtsgDv8dP5mjdbKsYbZwa1kJk+tsOEoQYojXADWMlZ2IGsalDpPFlEjQ+UyeD8VEn0v9y/f 1FYs9V5hbFaNNJESmn9mUNJwKbqoTQIdH4KGiu9u13tEyygtJzkwXu9k4IfYdINwhUT7Z14RheXdD WiZK9OgNzgh2o0/gnmbdoWqgMLK9hsdO9jNq2dgHu1j+lonJ72Y9Wja+HW/W4unSa+/MXqRb8n3lZ ma9X2ryQ==; 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 1qHu8g-00AP6e-Aw; Sat, 08 Jul 2023 00:41:22 +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 v5 2/6] drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP Date: Fri, 7 Jul 2023 19:40:55 -0300 Message-ID: <20230707224059.305474-3-andrealmeid@igalia.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707224059.305474-1-andrealmeid@igalia.com> References: <20230707224059.305474-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