Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3034567rdg; Tue, 17 Oct 2023 02:31:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4SDNwie5VP4ct1w88ZY0LK8G4Y2Z0AzqcCETEpGpvf4RlGw3t5G/KXUs9svtXKS6Ujp8v X-Received: by 2002:a05:6a20:a109:b0:13d:df16:cf29 with SMTP id q9-20020a056a20a10900b0013ddf16cf29mr1492872pzk.15.1697535086755; Tue, 17 Oct 2023 02:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697535086; cv=none; d=google.com; s=arc-20160816; b=PK3skSVaOihd4a9mwc3nYpzJy3hHD7qm8iJBXzxDhW465ibtq3VKLrwTb8Yx34LrWy mdP7uQntPWE59xyzyOFUhrTWhzoPhgTR1TOTjT3caXgkC3/e0+forFkhy2j37NzOJOaa 7ZYiKbU45rGQIdxw6Dnb3frSKEpzJnEfSJhhBtn3belAMlMG+8tqfe1WqQCokln8JRYr M1mb+WkH7f0igLRyvAv6Ckvj5QUkYCF5/OjJBwoqve1J2YOUVeRJDRbxIEjiqtcJcWD1 R0GTlc5k7dES/ER9bKsbMsRBHBfvwttXM8YqjgafFYU2A58geg4YZF0+MlHZuxXM2c9x S0DA== 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=HWrONDqmpBZExl+KmZOR+g0MAZyWOT9PSDRXuOxGP24=; fh=SJQ48KwEv1Wk78SyBTKjV1EcFj2vZ5p6XYIidAE2t8E=; b=o4+B209eixCNl4IMjpJNmMitY8Ux7z1jmL9lHkWkrxXkXKamdGC09kaR6GiQU2HQdE OkGEiQ1puY1NHjZbZjmoJbsUSU0bcSXqprwh6XTUJyb9ruGDlqgXS5sLLODl8b9r7gbd Kh9VKkK+TbvTvMB/v4WZIBlkl6b0QO/kE0d/rDe72sqiRsymuIvRZWtQ23YE6XRzwgPM 3jJjditv0RzmrZoIAtjd39dlXiz8V70PHWdJS1jfCt+gTP8NfftaI+p8x6eJPfb+NgvF VMIXJPGu9I1p9KoKQUsI2Gs51YLpDtzD+4vvwxJmQYe/cDlakykoR+NijhPVvV6htQI2 4Ggg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=bPkNhROf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c15-20020a170903234f00b001ca4ad8635esi1416316plh.240.2023.10.17.02.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 02:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=bPkNhROf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 001FE807F4B0; Tue, 17 Oct 2023 02:30:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234787AbjJQJ3w (ORCPT + 99 others); Tue, 17 Oct 2023 05:29:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234972AbjJQJ3f (ORCPT ); Tue, 17 Oct 2023 05:29:35 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9F18199C for ; Tue, 17 Oct 2023 02:28:52 -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=HWrONDqmpBZExl+KmZOR+g0MAZyWOT9PSDRXuOxGP24=; b=bPkNhROfmAKD1y6riANEgW8V7F IEk4K2R9R0PSlU0hCI7HXdYG44kePjObua4absyN+wizUQdw7F9PnOHlZbxXJcI3VakIPlUIT43fW jm7E1FqaxI0KoZU6SLICu/od3AvF5T3sSH9ixHVFlXx0oe53yjCzLwBngZfdrd0X9zCl7yEWIiNW2 372xGn1cc+yKjdj6se9EGiYdLRX49LbP1csLYr6M0p+t4WzL6bq9iaAv8rEOhtcQYuoMe/+DvFRBb LU2vIJvRq6M99mhDuaeAljWGjrrso7HD7kptlX1Zgb+HKZj5obfAtaNJUvSURzKTihPyacNGSzmmx okMEpbPw==; Received: from 167.red-81-39-185.dynamicip.rima-tde.net ([81.39.185.167] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qsgNd-001ODF-D8; Tue, 17 Oct 2023 11:28:49 +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 Cc: pierre-eric.pelloux-prayer@amd.com, =?UTF-8?q?=27Marek=20Ol=C5=A1=C3=A1k=27?= , =?UTF-8?q?Michel=20D=C3=A4nzer?= , "Randy Dunlap" , "Pekka Paalanen" , hwentlan@amd.com, kernel-dev@igalia.com, alexander.deucher@amd.com, christian.koenig@amd.com, joshua@froggi.es, Simon Ser , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v7 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported Date: Tue, 17 Oct 2023 11:28:34 +0200 Message-ID: <20231017092837.32428-4-andrealmeid@igalia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231017092837.32428-1-andrealmeid@igalia.com> References: <20231017092837.32428-1-andrealmeid@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 17 Oct 2023 02:30:08 -0700 (PDT) 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 --- 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_driver.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 c6fd34bab358..9d5742923aed 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3997,6 +3997,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 84c54e8622d1..f1d9bb1d7c34 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_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c index 44b59ac301e6..6142c83fba06 100644 --- a/drivers/gpu/drm/i915/display/intel_display_driver.c +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c @@ -126,6 +126,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 d8c92521226d..586aa51794e8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -720,6 +720,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.42.0