[PATCH xf86-video-ati 2/4] Handle ihandle == -1 in radeon_set_shared_pixmap_backing

Michel Dänzer michel at daenzer.net
Fri Aug 24 09:02:42 UTC 2018


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

It means to stop using the shared pixmap backing.

Fixes crash when changing PRIME slave output configuration.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_bo_helper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/radeon_bo_helper.c b/src/radeon_bo_helper.c
index 79e8ff1bd..1a6d54b11 100644
--- a/src/radeon_bo_helper.c
+++ b/src/radeon_bo_helper.c
@@ -454,6 +454,9 @@ Bool radeon_set_shared_pixmap_backing(PixmapPtr ppix, void *fd_handle,
     uint32_t size = ppix->devKind * ppix->drawable.height;
     Bool ret = FALSE;
 
+    if (ihandle == -1)
+	return radeon_set_pixmap_bo(ppix, NULL);
+	
     bo = (struct radeon_buffer *)calloc(1, sizeof(struct radeon_buffer));
     if (!bo)
 	goto error;
-- 
2.18.0



More information about the amd-gfx mailing list