Skip to content

Commit d9186fa

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Fix KMS with 3D on HW version 10
HW version 10 does not have GB Surfaces so there is no backing buffer for surface backed FBs. This would result in a nullptr dereference and crash the driver causing a black screen. Fixes: 9655441 ("drm/vmwgfx: Refactor cursor handling") Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Reviewed-by: Zack Rusin <zack.rusin@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patch.msgid.link/20251114203703.1946616-1-ian.forbes@broadcom.com
1 parent 14adddc commit d9186fa

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -766,13 +766,15 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
766766
return ERR_PTR(ret);
767767
}
768768

769-
ttm_bo_reserve(&bo->tbo, false, false, NULL);
770-
ret = vmw_bo_dirty_add(bo);
771-
if (!ret && surface && surface->res.func->dirty_alloc) {
772-
surface->res.coherent = true;
773-
ret = surface->res.func->dirty_alloc(&surface->res);
769+
if (bo) {
770+
ttm_bo_reserve(&bo->tbo, false, false, NULL);
771+
ret = vmw_bo_dirty_add(bo);
772+
if (!ret && surface && surface->res.func->dirty_alloc) {
773+
surface->res.coherent = true;
774+
ret = surface->res.func->dirty_alloc(&surface->res);
775+
}
776+
ttm_bo_unreserve(&bo->tbo);
774777
}
775-
ttm_bo_unreserve(&bo->tbo);
776778

777779
return &vfb->base;
778780
}

0 commit comments

Comments
 (0)