Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32528632rwd; Fri, 7 Jul 2023 15:57:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlG9cATtkyLhgdoQmrWEKq8/G7r7cUc3R9aEGub+e9bzCcvvm/p1+LUz8uUoc8rQVoF4npjo X-Received: by 2002:a17:902:d2d1:b0:1b8:c972:606c with SMTP id n17-20020a170902d2d100b001b8c972606cmr5551576plc.57.1688770643756; Fri, 07 Jul 2023 15:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688770643; cv=none; d=google.com; s=arc-20160816; b=UUBHByZ92r6xZCb9ta/YBcJ2lVrJ543qdoR8UDj1pSx79WAFcsdbx35XTl8oG++l14 i1suZOVcrM7VpdRJe4OPBNe38C4D0OdcKH5i0yUtZVI0qs5cspAa1yGqIShqdEFnKNr5 l4mIs+nJIo9fkfzuJBvubaRFmIrnWCyD6sWVHE0tfvyHFKb+i5PTC1ZDCaKLOIqaOZAt pEWpVYh17IqCJeoHwe4Tc/qfBJJAX0tncetREXw9oGBUzFKh1hrGtI/DNfMq2YgaN1An JvmGEiVDGIzkD+h+2c5+23qQkr1H1/bEFS/YeuAvULwrde2jAcT2B/DAgVN41xZKVWsJ FUtg== 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=mFfau7nIYSTNFQZxA6ftp9PAp8q78Z2XWdM3YuMBn/Y=; fh=qbfaDyBg+GqerSAvcu3kFTx3mMThVk/CBXk9qNOf42k=; b=Y8oqp0xmcJznEhWELnOLezAS22UDS5KAtGS/OwpXGf0Rf8Q8P/py+ItdJ0yWMWsXdj H7QzKfYlVmHgLUmnQP0YNIX9Zo/9J6v3AuTuOJRc+LMbK7NC3WwnW7J3vbKNuQVPfqv9 r8s9X/1OYN9w6FBgQF5COB4zdNeqDT/DLxmPPNoKjbjJM9K/6zmv0xRTcxn1IJrEQBwV YvEy067q45e/Dx8vrdW2UQhfcroNkYUVaZ5t9KjuRtZHV0hbHvQmpDOlB29SEEjmvNz1 LhQKU4vQxVIqbEqVtNOJk9o/IP5I0v5dgEnjjUOd/Er18hoiaJBVofTWn71ASicr2NZo gaWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=FIxhstka; 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 q2-20020a170902f34200b001b0450241d1si4211407ple.283.2023.07.07.15.57.09; Fri, 07 Jul 2023 15:57:23 -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=FIxhstka; 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 S232366AbjGGWlh (ORCPT + 99 others); Fri, 7 Jul 2023 18:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbjGGWla (ORCPT ); Fri, 7 Jul 2023 18:41:30 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4285211F for ; Fri, 7 Jul 2023 15:41:29 -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=mFfau7nIYSTNFQZxA6ftp9PAp8q78Z2XWdM3YuMBn/Y=; b=FIxhstkaSARJbAONjxSef/UG+1 LVzJ1Z0c9ikFDoE/jcdWB6ETgq7y6dtXVNzzVuZHhD7tkRabiKD6fZIITaAg5P4hSLmsVMYB5AK9P cZf6D9zCekZ7TGjNVzh1l6WkTtUXDu6jsTlUo/wtNOazW58QWsVSwHsMeaPQZkRCD9szLkFmViP4O iQ0SscA7GC0fViXWGypXjUaJ1q9SnRlY0pAp2lqlm9gYGGp99XLM7pzlc1GN4Lzh251iCpoA4s2p1 qOjcn4CqViJUwg/pqPgBrquIHWhfXDnHxSkpTz2ZuScpf+/Z5A+V4FTEqJlql1WtFPbiNWQoqM1hz bydqMhvg==; 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 1qHu8l-00AP6e-5e; Sat, 08 Jul 2023 00:41:27 +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 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported Date: Fri, 7 Jul 2023 19:40:56 -0300 Message-ID: <20230707224059.305474-4-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 field indicates whether the driver has the necessary logic to support async page-flips via the atomic uAPI. This is leveraged by the next commit to allow user-space to use this functionality. All atomic drivers setting drm_mode_config.async_page_flip are updated to also set drm_mode_config.atomic_async_page_flip_not_supported. We will gradually check and update these drivers to properly handle drm_crtc_state.async_flip in their atomic logic. The goal of this negative flag is the same as fb_modifiers_not_supported: we want to eventually get rid of all drivers missing atomic support for async flips. New drivers should not set this flag, instead they should support atomic async flips (if they support async flips at all). IOW, we don't want more drivers with async flip support for legacy but not atomic. Signed-off-by: Simon Ser Reviewed-by: André Almeida Reviewed-by: Alex Deucher Signed-off-by: André Almeida --- v4: no changes --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 1 + drivers/gpu/drm/i915/display/intel_display.c | 1 + drivers/gpu/drm/nouveau/nouveau_display.c | 1 + include/drm/drm_mode_config.h | 11 +++++++++++ 5 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 7acd73e5004f..258461826140 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3970,6 +3970,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) adev_to_drm(adev)->mode_config.prefer_shadow = 1; /* indicates support for immediate flip */ adev_to_drm(adev)->mode_config.async_page_flip = true; + adev_to_drm(adev)->mode_config.atomic_async_page_flip_not_supported = true; state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 29603561d501..8afb22b1e730 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -639,6 +639,7 @@ static int atmel_hlcdc_dc_modeset_init(struct drm_device *dev) dev->mode_config.max_height = dc->desc->max_height; dev->mode_config.funcs = &mode_config_funcs; dev->mode_config.async_page_flip = true; + dev->mode_config.atomic_async_page_flip_not_supported = true; return 0; } diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 0aae9a1eb3d5..a5c503ca9168 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -8318,6 +8318,7 @@ static void intel_mode_config_init(struct drm_i915_private *i915) mode_config->helper_private = &intel_mode_config_funcs; mode_config->async_page_flip = HAS_ASYNC_FLIPS(i915); + mode_config->atomic_async_page_flip_not_supported = true; /* * Maximum framebuffer dimensions, chosen to match diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index ec3ffff487fc..f497dcd9e22f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -709,6 +709,7 @@ nouveau_display_create(struct drm_device *dev) dev->mode_config.async_page_flip = false; else dev->mode_config.async_page_flip = true; + dev->mode_config.atomic_async_page_flip_not_supported = true; drm_kms_helper_poll_init(dev); drm_kms_helper_poll_disable(dev); diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 973119a9176b..47b005671e6a 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -918,6 +918,17 @@ struct drm_mode_config { */ bool async_page_flip; + /** + * @atomic_async_page_flip_not_supported: + * + * If true, the driver does not support async page-flips with the + * atomic uAPI. This is only used by old drivers which haven't yet + * accomodated for &drm_crtc_state.async_flip in their atomic logic, + * even if they have &drm_mode_config.async_page_flip set to true. + * New drivers shall not set this flag. + */ + bool atomic_async_page_flip_not_supported; + /** * @fb_modifiers_not_supported: * -- 2.41.0