From 8e8bc0a1ef33a9e74a475a8f6e6869b53eec87a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 13 Jun 2024 18:43:11 +0200 Subject: [PATCH] xwayland: Try manual redirection for surface window in glamor_check_flip If the surface window already uses automatic redirection, we can upgrade to manual redirection and save some blits with common use cases. This fixes a minor performance regression from a65bb8480af8 ('Revert "xwayland/glamor: Avoid implicit redirection with depth 32 parent windows"') with mutter >= 44. Part-of: --- hw/xwayland/xwayland-glamor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index 69e31b43f..3e62fa7cd 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -93,6 +93,8 @@ xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap) { ScreenPtr screen = pixmap->drawable.pScreen; PixmapPtr backing_pixmap = screen->GetWindowPixmap(present_window); + struct xwl_window *xwl_window = xwl_window_from_window(present_window); + WindowPtr surface_window = xwl_window->surface_window; if (pixmap->drawable.depth != backing_pixmap->drawable.depth) { if (pixmap->drawable.depth == 32) @@ -101,6 +103,10 @@ xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap) return xwl_present_maybe_redirect_window(present_window); } + if (surface_window->redirectDraw == RedirectDrawAutomatic && + surface_window->drawable.depth != 32) + xwl_present_maybe_redirect_window(surface_window); + return TRUE; }