From: "Christopher Snowhill" <chris@kode54.net>
To: "André Almeida" <andrealmeid@igalia.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>,
dmitry.baryshkov@linaro.org, "Simon Ser" <contact@emersion.fr>,
joshua@froggi.es, "Xaver Hugl" <xaver.hugl@gmail.com>,
"Daniel Stone" <daniel@fooishbar.org>,
ville.syrjala@linux.intel.com
Cc: <kernel-dev@igalia.com>, <dri-devel@lists.freedesktop.org>,
<linux-kernel@vger.kernel.org>, <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH RESEND v9 1/2] drm/atomic: Let drivers decide which planes to async flip
Date: Sat, 02 Nov 2024 23:36:55 -0700 [thread overview]
Message-ID: <D5CC3U00B7CG.IGKCIES8PC2J@kode54.net> (raw)
In-Reply-To: <20241101-tonyk-async_flip-v9-1-681814efbfbe@igalia.com>
On Fri Nov 1, 2024 at 11:23 AM PDT, André Almeida wrote:
> Currently, DRM atomic uAPI allows only primary planes to be flipped
> asynchronously. However, each driver might be able to perform async
> flips in other different plane types. To enable drivers to set their own
> restrictions on which type of plane they can or cannot flip, use the
> existing atomic_async_check() from struct drm_plane_helper_funcs to
> enhance this flexibility, thus allowing different plane types to be able
> to do async flips as well.
>
> In order to prevent regressions and such, we keep the current policy: we
> skip the driver check for the primary plane, because it is always
> allowed to do async flips on it.
>
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
Should I do a R-b too? The changes looked sound enough for me to feel
like testing it as well. Tested Borderlands Game of the Year Enhanced on
my RX 7700 XT at maximum settings at 1080p165, and the tearing support in
labwc allowed it to reach over 700fps. No problems from the hardware
cursor.
Tested-by: Christopher Snowhill <chris@kode54.net>
> ---
> Changes from v8:
> - Rebased on top of 6.12-rc1
> ---
> drivers/gpu/drm/drm_atomic_uapi.c | 39 +++++++++++++++++++++++++++++----------
> 1 file changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index 370dc676e3aa543c9827b50df20df78f02b738c9..a0120df4b63e6b3419b53eb3d3673882559501c6 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -27,8 +27,9 @@
> * Daniel Vetter <daniel.vetter@ffwll.ch>
> */
>
> -#include <drm/drm_atomic_uapi.h>
> #include <drm/drm_atomic.h>
> +#include <drm/drm_atomic_helper.h>
> +#include <drm/drm_atomic_uapi.h>
> #include <drm/drm_framebuffer.h>
> #include <drm/drm_print.h>
> #include <drm/drm_drv.h>
> @@ -1063,6 +1064,7 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
> struct drm_plane *plane = obj_to_plane(obj);
> struct drm_plane_state *plane_state;
> struct drm_mode_config *config = &plane->dev->mode_config;
> + const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
>
> plane_state = drm_atomic_get_plane_state(state, plane);
> if (IS_ERR(plane_state)) {
> @@ -1070,15 +1072,32 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
> break;
> }
>
> - if (async_flip &&
> - (plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY ||
> - (prop != config->prop_fb_id &&
> - prop != config->prop_in_fence_fd &&
> - prop != config->prop_fb_damage_clips))) {
> - ret = drm_atomic_plane_get_property(plane, plane_state,
> - prop, &old_val);
> - ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
> - break;
> + if (async_flip) {
> + /* check if the prop does a nop change */
> + if ((plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY) ||
> + (prop != config->prop_fb_id &&
> + prop != config->prop_in_fence_fd &&
> + prop != config->prop_fb_damage_clips)) {
> + ret = drm_atomic_plane_get_property(plane, plane_state,
> + prop, &old_val);
> + ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
> + break;
> + }
> +
> + /* ask the driver if this non-primary plane is supported */
> + if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
> + ret = -EINVAL;
> +
> + if (plane_funcs && plane_funcs->atomic_async_check)
> + ret = plane_funcs->atomic_async_check(plane, state);
> +
> + if (ret) {
> + drm_dbg_atomic(prop->dev,
> + "[PLANE:%d] does not support async flips\n",
> + obj->id);
> + break;
> + }
> + }
> }
>
> ret = drm_atomic_plane_set_property(plane,
next prev parent reply other threads:[~2024-11-03 6:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 18:23 [PATCH RESEND v9 0/2] drm/atomic: Ease async flip restrictions André Almeida
2024-11-01 18:23 ` [PATCH RESEND v9 1/2] drm/atomic: Let drivers decide which planes to async flip André Almeida
2024-11-03 4:10 ` Dmitry Baryshkov
2024-11-03 6:36 ` Christopher Snowhill [this message]
2024-11-04 20:52 ` André Almeida
2024-11-05 10:15 ` Christopher Snowhill
2024-11-05 10:51 ` Dmitry Baryshkov
2024-11-06 5:04 ` Christopher Snowhill
2024-11-01 18:23 ` [PATCH RESEND v9 2/2] drm/amdgpu: Enable async flip on overlay planes André Almeida
2024-11-11 21:10 ` Harry Wentland
2024-11-12 16:44 ` André Almeida
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=D5CC3U00B7CG.IGKCIES8PC2J@kode54.net \
--to=chris@kode54.net \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrealmeid@igalia.com \
--cc=christian.koenig@amd.com \
--cc=contact@emersion.fr \
--cc=daniel@fooishbar.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=joshua@froggi.es \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=sunpeng.li@amd.com \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
--cc=xaver.hugl@gmail.com \
/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