Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2243812rda; Tue, 24 Oct 2023 17:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8dVPAEy3lCGuQ9GvsnT7zl9aIDX6ieblJPJ4EMrHxswHqDFOwtDhf3OV8wHOnQ+81KCUH X-Received: by 2002:a25:d88b:0:b0:d9c:7f5d:e202 with SMTP id p133-20020a25d88b000000b00d9c7f5de202mr13220239ybg.36.1698195268173; Tue, 24 Oct 2023 17:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698195268; cv=none; d=google.com; s=arc-20160816; b=mMdPHRZf5YS1mHz1HfPkuLjImHGq8FhtbWR3sxIm+f96eWMpEdxaYVZfUe1olhS4yI JoOjAlFJ2JYGfUdDrROBE3qewSnDVfrVoBgsZ4ijPUy/NN1COdRCBVMy1JULqKMvS5QV i30+HH6sGKbevYHVJarFD1pZbp++IONWrED03WPbKExsOT6BGfnmPVvjPrGi0wZA0Ctc fa3hhoYf2MRt481EVT7iqpZSoi8Md8UrJ+p5yhIytzoVkftiW5g85EYaZpjTHniAZSnP DUiO+SN3Q6jtmGKHfPRKyZ2QX46bJ6Ddflbx5FIbTUGuCIfJcQVZR4dhAJ2PjfPu+mhF +DkA== 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=xE7LTmMZjaRJ+zHlhQbtMeGR5wPTTYaFb8tvKPrpSe4=; fh=oozRrKarZZG8EJ8TWYFtLglEZVoKmF8bWYorcz/JMDw=; b=vbTu6nnfjYsqj7tZEV3IizASTSWzVz3kqj9yaqZTzXK4iGfQALS7K73STcZErBLNAZ YpxR2Xa3XPIXAtOHouc9kQNnVcPvVw2J0N5/Hy4MvhJ4IPOrXJkVBTydSBNYYSVUByow PfLUTaBFjy0LY0R9IN1QCNACEREpjbfb9rKkGNgeygzxo3deftUi3m2GZEEudLscJgP8 6PXd9NWpRk2QsIFJkG5x1CKPdIqhb7nG7JEyejeqgb5Q3Wne/Bu0mrehrag9NhaLmNT3 Jf/2wXTht8BZqaxQB1hSkdX8E1TnUYkmgGlOO7MUAi/0O8UY2nrauiRRgdfaWHq4P9M+ i/rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=MBE40FXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p5-20020a252905000000b00da04f22be85si2055531ybp.146.2023.10.24.17.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 17:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=MBE40FXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 5B0D08023EDE; Tue, 24 Oct 2023 17:54:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbjJYAx5 (ORCPT + 99 others); Tue, 24 Oct 2023 20:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjJYAxr (ORCPT ); Tue, 24 Oct 2023 20:53:47 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2017E5 for ; Tue, 24 Oct 2023 17:53:44 -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=xE7LTmMZjaRJ+zHlhQbtMeGR5wPTTYaFb8tvKPrpSe4=; b=MBE40FXBrYAmSfHUHELm6J+ATg nom51bEDsd2qUTkCyIU1QdaD/YiWjlQgZZGMoJgPQvyYtJMdjC7SIi53JR6NmZPq/Y+L+2O8xUppX 8n5qydU4MiRM/NpHn0NfNoUpPxs1oBGFJw6um4O4vXQ1icyrSBiSXIg5D/xRpgscQ8XG+pFUeXu05 x8jPO1oWSOsN8LKZADJgfXXblDHBmoU5Dk/t5aoZZ1icvt5GEC1eFNzXRFabQyoeq1XdrLAPO6RNW XJJCIupnoLjWWKJHW6+JLvrfmwWbQQNnI0sB3a8GgSLmSLcPo3j4RzYyjsgRqhM/vkz2pgLBX3TiB 6UwZCTvQ==; Received: from [191.193.179.125] (helo=steammachine.lan) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qvS9W-006qog-41; Wed, 25 Oct 2023 02:53:42 +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: 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 , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v8 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported Date: Tue, 24 Oct 2023 21:53:15 -0300 Message-ID: <20231025005318.293690-4-andrealmeid@igalia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231025005318.293690-1-andrealmeid@igalia.com> References: <20231025005318.293690-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 17:54:25 -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 45b8fd61a044..dec6e43e7198 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4003,6 +4003,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