[PATCH xf86-video-amdgpu 4/5] glamor: Fix leak of pixmap private when replacing BO

Michel Dänzer michel at daenzer.net
Wed Jun 15 10:00:49 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Reported-by: Qiang Yu <qiang.yu at amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_glamor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index 9785ad7..62831d0 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -303,10 +303,9 @@ amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap)
 		FreeScratchGC(gc);
 	}
 
-	amdgpu_set_pixmap_private(pixmap, NULL);
-
 	/* And redirect the pixmap to the new bo (for 3D). */
 	glamor_egl_exchange_buffers(old, pixmap);
+	amdgpu_set_pixmap_private(pixmap, amdgpu_get_pixmap_private(old));
 	amdgpu_set_pixmap_private(old, priv);
 
 	screen->ModifyPixmapHeader(old,
-- 
2.8.1



More information about the xorg-driver-ati mailing list