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>
This commit is contained in:
Michel Dänzer
2020-03-16 17:43:54 +01:00
committed by Michel Dänzer
parent 42a3148ae1
commit e2cd67abb4

View File

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