summaryrefslogtreecommitdiff
path: root/src/amdgpu_glamor.c
diff options
context:
space:
mode:
authorjimqu <Jim.Qu@amd.com>2016-01-25 09:47:00 +0800
committerMichel Dänzer <michel@daenzer.net>2016-01-28 18:15:45 +0900
commit2fcb7dadd3c71cd405cbbaafc777697538ca9c29 (patch)
tree3d8110ef752692ab4e1a0b6195a8bc976e7c54a3 /src/amdgpu_glamor.c
parent5269a2228bff6023c1a7f3e8534027e1d7addc25 (diff)
glamor: Return NullPixmap on failure to create shareable pixmap
If we were asked to create a shareable pixmap, it doesn't make sense to return a pixmap which isn't shareable. Doing so caused trouble down the line such as a crash with older versions of glamor when trying to use GLX pixmaps of bpp < 32 via DRI2. Signed-off-by: JimQu <jim.qu@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/amdgpu_glamor.c')
-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 59233d2..efde2b0 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -251,7 +251,9 @@ fallback_glamor:
*/
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"Failed to create textured DRI2/PRIME pixmap.");
- return pixmap;
+
+ amdgpu_glamor_destroy_pixmap(pixmap);
+ return NullPixmap;
}
/* Create textured pixmap failed means glamor failed to
* create a texture from current BO for some reasons. We turn