From 3b3d26f1a75d517a563995066d617717e0d50d12 Mon Sep 17 00:00:00 2001 From: Kiyoshi Spreclerg Date: Mon, 21 Sep 2026 09:01:57 -0300 Subject: [PATCH] modesetting: don't advertise TearFree for an unchecked pixmap ms_present_check_flip() bails out early when the window and pixmap don't match exactly, landing in no_flip before ms_present_check_unflip() ever runs. At that point the pixmap is unverified, so present_execute() shouldn't be told a TearFree flip is about to start for it: if the fake flip fails to register, it falls back to guessing completion_msc, and two presentations guessing the same MSC collide and stall. Assisted-by: Claude Opus 5 Signed-off-by: Kiyoshi Spreclerg --- hw/xfree86/drivers/video/modesetting/present.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/video/modesetting/present.c b/hw/xfree86/drivers/video/modesetting/present.c index 1b27abd79d..f104acd066 100644 --- a/hw/xfree86/drivers/video/modesetting/present.c +++ b/hw/xfree86/drivers/video/modesetting/present.c @@ -348,7 +348,11 @@ ms_present_check_flip(RRCrtcPtr crtc, window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y || window->drawable.width != pixmap->drawable.width || window->drawable.height != pixmap->drawable.height) { - goto no_flip; + /* + * This skips ms_present_check_unflip(), so the pixmap itself is + * unverified: don't claim a TearFree flip for it below + */ + return FALSE; } if (!ms_present_check_unflip(crtc, window, pixmap, sync_flip, reason)) {