From 1799680f7bd84e0618f34f4c7486799521ddaf83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 24 Aug 2018 10:56:58 +0200 Subject: [PATCH] Handle ihandle == -1 in radeon_set_shared_pixmap_backing It means to stop using the shared pixmap backing. Fixes crash when changing PRIME slave output configuration. --- 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 79e8ff1b..da5a484f 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;