summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-08-29 17:34:55 +0200
committerMichel Dänzer <michel@daenzer.net>2018-08-30 09:45:48 +0200
commitb804d7f85d8a07389ba7d3f9b8af8773f852f1c7 (patch)
treedb9f7adcaaf8b0b9c9aea459c70738cf0aa8a4ac /src
parentae2a450cb98707c4cab8a8265a284cf708bcd43d (diff)
glamor: Handle ihandle == -1 in amdgpu_glamor_set_shared_pixmap_backing
(Ported from radeon commit de88ea2755611bdcb18d91d8234d2ab5be8ff2e9) Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_glamor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index 13d68fe..699861f 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -384,6 +384,7 @@ amdgpu_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
{
ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ int ihandle = (int)(long)handle;
struct amdgpu_pixmap *priv;
if (!amdgpu_set_shared_pixmap_backing(pixmap, handle))
@@ -391,7 +392,8 @@ amdgpu_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
priv = amdgpu_get_pixmap_private(pixmap);
- if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo)) {
+ if (ihandle != -1 &&
+ !amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to get PRIME drawable for glamor pixmap.\n");
return FALSE;