summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2020-03-16 17:43:54 +0100
committerMichel Dänzer <michel@daenzer.net>2020-03-16 17:44:36 +0100
commite2cd67abb4aa8b5c942b46dd66dac091b9fad7ad (patch)
tree49d01a437a3b0e8e406546b2106b6fbd346f91ec
parent42a3148ae14c6fd0d2e2e9013971188ca721d8f8 (diff)
Bail from amdgpu_pixmap_get_handle with ShadowFB
There's no pixmap private in that case. The callers handle this gracefully. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_bo_helper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 6f7d6df..3f62214 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -185,13 +185,15 @@ uint64_t amdgpu_pixmap_get_tiling_info(PixmapPtr pixmap)
Bool amdgpu_pixmap_get_handle(PixmapPtr pixmap, uint32_t *handle)
{
-#ifdef USE_GLAMOR
ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
AMDGPUInfoPtr info = AMDGPUPTR(scrn);
-#endif
- struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
+ struct amdgpu_pixmap *priv;
+
+ if (info->shadow_fb)
+ return FALSE;
+ priv = amdgpu_get_pixmap_private(pixmap);
if (!priv) {
priv = calloc(1, sizeof(*priv));
amdgpu_set_pixmap_private(pixmap, priv);