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.
This commit is contained in:
Michel Dänzer
2018-08-24 10:56:58 +02:00
committed by Michel Dänzer
parent 3c42bd0480
commit 1799680f7b

View File

@@ -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;