mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-08 10:19:00 +00:00
backport commits to not crash when accel is disabled
cb27a5b Handle NULL fb_ptr in pixmap_get_fb e2cd67a Bail from amdgpu_pixmap_get_handle with ShadowFB
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -162,7 +162,7 @@ amdgpu_pixmap_get_fb(PixmapPtr pix)
|
||||
handle);
|
||||
}
|
||||
|
||||
return *fb_ptr;
|
||||
return fb_ptr ? *fb_ptr : NULL;
|
||||
}
|
||||
|
||||
enum {
|
||||
|
||||
Reference in New Issue
Block a user