[PATCH xf86-video-ati 4/4] glamor: Handle ihandle == -1 in radeon_glamor_set_shared_pixmap_backing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michel Dänzer <michel.daenzer@xxxxxxx>

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

diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index c733d192d..bffc89ec6 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -402,11 +402,13 @@ radeon_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
 {
 	ScreenPtr screen = pixmap->drawable.pScreen;
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+	int ihandle = (int)(long)handle;
 
 	if (!radeon_set_shared_pixmap_backing(pixmap, handle, NULL))
 		return FALSE;
 
-	if (!radeon_glamor_create_textured_pixmap(pixmap,
+	if (ihandle != -1 &&
+	    !radeon_glamor_create_textured_pixmap(pixmap,
 						  radeon_get_pixmap_bo(pixmap))) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to get PRIME drawable for glamor pixmap.\n");
-- 
2.18.0



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux