composite: Only copy bits from the parent pixmap when absolutely necessary

Since 1e728c3e88 ,
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 <mdaenzer@redhat.com>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2073>
This commit is contained in:
stefan11111 2025-10-05 17:02:51 +03:00
parent 6f31791945
commit 7e6c55cc9f

View file

@ -542,6 +542,9 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
pPixmap->screen_x = x; pPixmap->screen_x = x;
pPixmap->screen_y = y; pPixmap->screen_y = y;
if (pWin->backgroundState != None)
return pPixmap;
if (pParent->drawable.depth == pWin->drawable.depth) { if (pParent->drawable.depth == pWin->drawable.depth) {
GCPtr pGC = GetScratchGC(pWin->drawable.depth, pScreen); GCPtr pGC = GetScratchGC(pWin->drawable.depth, pScreen);