* FAILED: patch "[PATCH] drm/vc4: Look up the async page flip fence before committing" failed to apply to 6.6-stable tree
@ 2026-12-02 12:46 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-12-02 12:46 UTC (permalink / raw)
To: mcanal, itoral; +Cc: stable
The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x f9fc6da01a290609428d308033143f1d96ab658f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026120233-outgoing-surfer-edf9@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f9fc6da01a290609428d308033143f1d96ab658f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ADra=20Canal?= <mcanal@igalia.com>
Date: Sat, 14 Nov 2026 16:16:52 -0300
Subject: [PATCH] drm/vc4: Look up the async page flip fence before committing
the flip
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
vc4_async_page_flip_common() ignores dma_resv_get_singleton() failures.
By then the plane state already points at the new framebuffer, so the
flip is never completed. So, its state leaks, the vblank reference is
never dropped and the event is never sent.
Look up the fence before changing any state, so the error can be properly
returned to userspace.
Cc: stable@vger.kernel.org
Fixes: d19e00ee06a9 ("drm/vc4: crtc: Fix out of order frames during asynchronous page flips")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patch.msgid.link/20261114-vc4-async-flip-fixes-v2-3-d33cbe99ed5d@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 177ee27ab6d1..4b6d4a5f7bc9 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -948,33 +948,22 @@ static void vc4_async_page_flip_fence_cb(struct dma_fence *fence,
queue_work(vc4_crtc->async_flip_wq, &flip_state->work);
}
-static int vc4_async_set_fence_cb(struct drm_device *dev,
- struct vc4_async_flip_state *flip_state)
+static void vc4_async_set_fence_cb(struct vc4_async_flip_state *flip_state)
{
- struct drm_framebuffer *fb = flip_state->fb;
- struct drm_gem_dma_object *dma_bo = drm_fb_dma_get_gem_obj(fb, 0);
struct vc4_crtc *vc4_crtc = to_vc4_crtc(flip_state->crtc);
- int ret;
INIT_WORK(&flip_state->work, vc4_async_page_flip_work);
- ret = dma_resv_get_singleton(dma_bo->base.resv, DMA_RESV_USAGE_READ,
- &flip_state->fence);
- if (ret)
- return ret;
-
if (flip_state->fence &&
!dma_fence_add_callback(flip_state->fence, &flip_state->cb,
vc4_async_page_flip_fence_cb))
- return 0;
+ return;
/* No fence or the fence has already signaled. Complete the flip
* immediately, after earlier queued flips.
*/
flush_workqueue(vc4_crtc->async_flip_wq);
vc4_async_page_flip_work(&flip_state->work);
-
- return 0;
}
static int
@@ -983,14 +972,22 @@ vc4_async_page_flip_common(struct drm_crtc *crtc,
struct drm_pending_vblank_event *event,
uint32_t flags)
{
- struct drm_device *dev = crtc->dev;
+ struct drm_gem_dma_object *dma_bo = drm_fb_dma_get_gem_obj(fb, 0);
struct drm_plane *plane = crtc->primary;
struct vc4_async_flip_state *flip_state;
+ int ret;
flip_state = kzalloc_obj(*flip_state);
if (!flip_state)
return -ENOMEM;
+ ret = dma_resv_get_singleton(dma_bo->base.resv, DMA_RESV_USAGE_READ,
+ &flip_state->fence);
+ if (ret) {
+ kfree(flip_state);
+ return ret;
+ }
+
drm_framebuffer_get(fb);
flip_state->fb = fb;
flip_state->crtc = crtc;
@@ -1016,7 +1013,7 @@ vc4_async_page_flip_common(struct drm_crtc *crtc,
*/
drm_atomic_set_fb_for_plane(plane->state, fb);
- vc4_async_set_fence_cb(dev, flip_state);
+ vc4_async_set_fence_cb(flip_state);
/* Driver takes ownership of state on successful async commit. */
return 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-02 14:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 12:46 FAILED: patch "[PATCH] drm/vc4: Look up the async page flip fence before committing" failed to apply to 6.6-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox