From: Arun R Murthy <arun.r.murthy@intel.com>
To: 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>,
jani.nikula@intel.com, ville.syrjala@intel.com,
uma.shankar@intel.com, xaver.hugl@kde.org,
andrealmeid@igalia.com, naveen1.kumar@intel.com,
Dmitry Baryshkov <lumag@kernel.org>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
Arun R Murthy <arun.r.murthy@intel.com>
Subject: [PATCH RFC v2 2/2] drm/atomic: Use async_flip plane property for asynchronous flips
Date: Fri, 10 Oct 2025 14:15:59 +0530 [thread overview]
Message-ID: <20251010-async-v2-2-50c6b7a9b654@intel.com> (raw)
In-Reply-To: <20251010-async-v2-0-50c6b7a9b654@intel.com>
In atomic path, the crtc_state->async_flip is being used. Its commented
in drm_crtc.h that async_flip in crtc_state is to be used with the
legacy page_flip ioctl for async flips and not in atomic path. Morever
this limits of enabling async flip only on one plane even though
hardware supports them on all the planes. Retaining the present
implementation, support for using async_flip plane property is added.
Further checks for async flip will be done in the driver specific
atomic_check()
Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
drivers/gpu/drm/drm_atomic_uapi.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 7773e0057302fccb57df8067f417b23a9cb9fcde..111afc8e07aa531d03d237c61cb4b8216d645fb6 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1075,6 +1075,11 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
struct drm_mode_config *config = &plane->dev->mode_config;
const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
+ if (async_flip && plane->async_flip_property) {
+ drm_err(prop->dev, "driver has plane async_flip property, dont use the legacy one\n");
+ return -EINVAL;
+ }
+
plane_state = drm_atomic_get_plane_state(state, plane);
if (IS_ERR(plane_state)) {
ret = PTR_ERR(plane_state);
@@ -1377,9 +1382,22 @@ static void
set_async_flip(struct drm_atomic_state *state)
{
struct drm_crtc *crtc;
+ struct drm_plane *plane;
struct drm_crtc_state *crtc_state;
+ struct drm_plane_state *plane_state;
int i;
+ /*
+ * Async flip is being set with plane async_flip property then bypass
+ * the legacy async path in atomic_ioctl.
+ * TODO: the below legacy path should be removed once all drivers
+ * start using the async_flip plane property.
+ */
+ for_each_new_plane_in_state(state, plane, plane_state, i) {
+ if (plane_state->async_flip)
+ return;
+ }
+
for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
crtc_state->async_flip = true;
}
--
2.25.1
next prev parent reply other threads:[~2025-10-10 8:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 8:45 [PATCH RFC v2 0/2] Async Flip in Atomic ioctl corrections Arun R Murthy
2025-10-10 8:45 ` [PATCH RFC v2 1/2] drm/atomic/plane: Add plane property for async flip Arun R Murthy
2025-10-10 8:45 ` Arun R Murthy [this message]
2025-10-10 13:32 ` [PATCH RFC v2 0/2] Async Flip in Atomic ioctl corrections Ville Syrjälä
2025-10-13 4:19 ` Murthy, Arun R
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=20251010-async-v2-2-50c6b7a9b654@intel.com \
--to=arun.r.murthy@intel.com \
--cc=airlied@gmail.com \
--cc=andrealmeid@igalia.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=naveen1.kumar@intel.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=uma.shankar@intel.com \
--cc=ville.syrjala@intel.com \
--cc=xaver.hugl@kde.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;
as well as URLs for NNTP newsgroup(s).