From 7e6c55cc9f5f26ef8afa74b2e86e883ce2ec1163 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Sun, 5 Oct 2025 17:02:51 +0300 Subject: [PATCH] composite: Only copy bits from the parent pixmap when absolutely necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since https://gitlab.freedesktop.org/xorg/xserver/-/commit/1e728c3e88f6a74b93dc11827c9fcfe7b39ca5a5 , Whenever we allocate a composite pixmap, we perform an expensive CopyArea call from the parent pixmap. This leads to very bad performance when using a framebuffer driver without shadowfb. My guess is that this call ends up reading memory from the framebuffer memory directly, which is very slow. Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1814 Reviewed-by: Michel Dänzer Signed-off-by: stefan11111 Part-of: --- composite/compalloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composite/compalloc.c b/composite/compalloc.c index d1342799b..11d929a0f 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -542,6 +542,9 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; + if (pWin->backgroundState != None) + return pPixmap; + if (pParent->drawable.depth == pWin->drawable.depth) { GCPtr pGC = GetScratchGC(pWin->drawable.depth, pScreen);