From d0e2967eab7fe081a615ec54938a8b93c9db5d80 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Sat, 14 Mar 2026 20:20:22 +0200 Subject: [PATCH] modesetting: properly use fb_id of front_bo for reverse PRIME CRTC When doing reverse PRIME, the buffer being scaned out is still the front BO. Properly reuse its fb_id, to prevent adding a FB for the front_bo each time the fb_id is requested. Signed-off-by: Icenowy Zheng Part-of: --- hw/xfree86/drivers/video/modesetting/drmmode_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/video/modesetting/drmmode_display.c b/hw/xfree86/drivers/video/modesetting/drmmode_display.c index 667590c036..5bf2d112d1 100644 --- a/hw/xfree86/drivers/video/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/video/modesetting/drmmode_display.c @@ -667,8 +667,10 @@ drmmode_crtc_get_fb_id(xf86CrtcPtr crtc, uint32_t *fb_id, int *x, int *y) msGetPixmapPriv(drmmode, drmmode_crtc->prime_pixmap); *fb_id = ppriv->fb_id; *x = 0; - } else + } else { + *fb_id = drmmode->fb_id; *x = drmmode_crtc->prime_pixmap_x; + } *y = 0; } else if (trf->buf[trf->back_idx ^ 1].px) {