From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <contact@emersion.fr>
Cc: andrealmeid@igalia.com, daniel.vetter@ffwll.ch,
amd-gfx@lists.freedesktop.org,
wayland-devel@lists.freedesktop.org, mwen@igalia.com,
dri-devel@lists.freedesktop.org, alexander.deucher@amd.com,
hwentlan@amd.com, nicholas.kazlauskas@amd.com, joshua@froggi.es
Subject: Re: [PATCH v3 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported
Date: Fri, 30 Sep 2022 16:53:10 +0300 [thread overview]
Message-ID: <Yzb0xhcvwnWg4iY6@intel.com> (raw)
In-Reply-To: <20220929184307.258331-4-contact@emersion.fr>
On Thu, Sep 29, 2022 at 06:43:42PM +0000, Simon Ser wrote:
> 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.
>
> v2: only set the flag on atomic drivers (remove it on amdgpu DCE and
> on radeon)
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Reviewed-by: André Almeida <andrealmeid@igalia.com>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Joshua Ashton <joshua@froggi.es>
> Cc: Melissa Wen <mwen@igalia.com>
> Cc: Harry Wentland <hwentlan@amd.com>
> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> 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 +
> drivers/gpu/drm/vc4/vc4_kms.c | 1 +
> include/drm/drm_mode_config.h | 11 +++++++++++
> 6 files changed, 16 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 44235345fd57..7500e82cf06a 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3808,6 +3808,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;
The flag polarity seems weird. Why opt out and not opt in?
>
> adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index f7e7f4e919c7..ffb3a2fa797f 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 40fbf8a296e2..e025b3499c9d 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -8621,6 +8621,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 a2f5df568ca5..2b5c4f24aedd 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_display.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_display.c
> @@ -699,6 +699,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/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
> index 4419e810103d..3fe59c6b2cf0 100644
> --- a/drivers/gpu/drm/vc4/vc4_kms.c
> +++ b/drivers/gpu/drm/vc4/vc4_kms.c
> @@ -1047,6 +1047,7 @@ int vc4_kms_load(struct drm_device *dev)
> dev->mode_config.helper_private = &vc4_mode_config_helpers;
> dev->mode_config.preferred_depth = 24;
> dev->mode_config.async_page_flip = true;
> + dev->mode_config.atomic_async_page_flip_not_supported = true;
>
> ret = vc4_ctm_obj_init(vc4);
> if (ret)
> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
> index 6b5e01295348..1b535d94f2f4 100644
> --- a/include/drm/drm_mode_config.h
> +++ b/include/drm/drm_mode_config.h
> @@ -917,6 +917,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.37.3
>
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2022-09-30 13:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 18:43 [PATCH v3 0/6] Add support for atomic async page-flips Simon Ser
2022-09-29 18:43 ` [PATCH v3 1/6] drm: document DRM_MODE_PAGE_FLIP_ASYNC Simon Ser
2022-09-29 18:43 ` [PATCH v3 2/6] amd/display: only accept async flips for fast updates Simon Ser
2022-09-29 18:43 ` [PATCH v3 3/6] drm: introduce drm_mode_config.atomic_async_page_flip_not_supported Simon Ser
2022-09-30 13:53 ` Ville Syrjälä [this message]
2022-09-30 13:56 ` Simon Ser
2022-09-30 14:02 ` Ville Syrjälä
2022-09-29 18:43 ` [PATCH v3 4/6] drm: allow DRM_MODE_PAGE_FLIP_ASYNC for atomic commits Simon Ser
2022-09-29 18:43 ` [PATCH v3 5/6] drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP Simon Ser
2022-09-29 18:44 ` [PATCH v3 6/6] amd/display: indicate support for atomic async page-flips on DC Simon Ser
2022-09-30 13:42 ` [PATCH v3 0/6] Add support for atomic async page-flips Harry Wentland
2022-09-30 13:52 ` Ville Syrjälä
2022-09-30 14:19 ` Ville Syrjälä
2022-09-30 15:09 ` Ville Syrjälä
2022-09-30 15:37 ` KMS atomic state sets, full vs. minimal (Re: [PATCH v3 0/6] Add support for atomic async page-flips) Pekka Paalanen
2022-09-30 15:45 ` Ville Syrjälä
2022-09-30 15:58 ` Ville Syrjälä
2022-10-03 8:48 ` Pekka Paalanen
2022-10-03 9:04 ` Ville Syrjälä
2022-10-13 16:02 ` [PATCH v3 0/6] Add support for atomic async page-flips Simon Ser
2022-10-17 14:35 ` André Almeida
2022-10-28 12:36 ` André Almeida
2022-11-17 8:58 ` Simon Ser
2023-01-05 16:01 ` Simon Ser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yzb0xhcvwnWg4iY6@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrealmeid@igalia.com \
--cc=contact@emersion.fr \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hwentlan@amd.com \
--cc=joshua@froggi.es \
--cc=mwen@igalia.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=wayland-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox