mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
glamor: Fix amdgpu_glamor_share_pixmap_backing for priv->bo == NULL
Fixes crash when running a compositor and DRI_PRIME client via DRI2.
Reported-by: Qiang Yu <qiang.yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Qiang Yu <qiang.yu@amd.com>
(Cherry picked from commit b36c77695b)
This commit is contained in:
committed by
Michel Dänzer
parent
0d5b6957ae
commit
0af88ed18a
@@ -278,12 +278,17 @@ static Bool
|
||||
amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave,
|
||||
void **handle_p)
|
||||
{
|
||||
struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap);
|
||||
ScreenPtr screen = pixmap->drawable.pScreen;
|
||||
CARD16 stride;
|
||||
CARD32 size;
|
||||
int fd;
|
||||
|
||||
if (!priv)
|
||||
fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size);
|
||||
if (fd < 0)
|
||||
return FALSE;
|
||||
|
||||
return amdgpu_share_pixmap_backing(priv->bo, handle_p);
|
||||
*handle_p = (void *)(long)fd;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
||||
Reference in New Issue
Block a user