]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/vmwgfx: Fix KMS with 3D on HW version 10
authorIan Forbes <ian.forbes@broadcom.com>
Fri, 14 Nov 2025 20:37:03 +0000 (14:37 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:14 +0000 (11:21 +0100)
[ Upstream commit d9186faeae6efb7d0841a5e8eb213ff4c7966614 ]

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: 965544150d1c ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index 54ea1b513950a80f07f11704347c6b3ffae0e623..535d844191e7a6c5fa0827fa8c930df2cff959c6 100644 (file)
@@ -763,13 +763,15 @@ err_out:
                return ERR_PTR(ret);
        }
 
-       ttm_bo_reserve(&bo->tbo, false, false, NULL);
-       ret = vmw_bo_dirty_add(bo);
-       if (!ret && surface && surface->res.func->dirty_alloc) {
-               surface->res.coherent = true;
-               ret = surface->res.func->dirty_alloc(&surface->res);
+       if (bo) {
+               ttm_bo_reserve(&bo->tbo, false, false, NULL);
+               ret = vmw_bo_dirty_add(bo);
+               if (!ret && surface && surface->res.func->dirty_alloc) {
+                       surface->res.coherent = true;
+                       ret = surface->res.func->dirty_alloc(&surface->res);
+               }
+               ttm_bo_unreserve(&bo->tbo);
        }
-       ttm_bo_unreserve(&bo->tbo);
 
        return &vfb->base;
 }