From 0b8a7a4783094276bb899d1915578377ac6a5ff0 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Thu, 30 Oct 2025 15:59:39 +0800 Subject: [PATCH] [PR #2193] modesetting: fix PRESENT_FLIP_REASON_BUFFER_FORMAT gets overwritten PR: https://github.com/X11Libre/xserver/pull/2193 --- hw/xfree86/drivers/modesetting/present.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c index 421d70016..a876a031e 100644 --- a/hw/xfree86/drivers/modesetting/present.c +++ b/hw/xfree86/drivers/modesetting/present.c @@ -322,6 +322,9 @@ ms_present_check_flip(RRCrtcPtr crtc, ScrnInfoPtr scrn = xf86ScreenToScrn(screen); modesettingPtr ms = modesettingPTR(scrn); + if (reason) + *reason = PRESENT_FLIP_REASON_UNKNOWN; + if (ms->drmmode.sprites_visible > 0) goto no_flip; @@ -337,7 +340,7 @@ ms_present_check_flip(RRCrtcPtr crtc, no_flip: /* Export some info about TearFree if Present can't flip anyway */ - if (reason) { + if (reason && *reason == PRESENT_FLIP_REASON_UNKNOWN) { xf86CrtcPtr xf86_crtc = crtc->devPrivate; drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; drmmode_tearfree_ptr trf = &drmmode_crtc->tearfree;