Skip to content

Commit abb295f

Browse files
thomashvmwairlied
authored andcommitted
vmwgfx: Fix fb VRAM pinning failure due to fragmentation
If the soon-to-be scanout buffer is partly covering the intended VRAM region, move and pin will fail. In that case, just move it out to system before attempting to move it in again. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent f1a28ee commit abb295f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,11 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv,
615615
if (unlikely(ret != 0))
616616
goto err_unlock;
617617

618+
if (bo->mem.mem_type == TTM_PL_VRAM &&
619+
bo->mem.mm_node->start < bo->num_pages)
620+
(void) ttm_bo_validate(bo, &vmw_sys_placement, false,
621+
false, false);
622+
618623
ret = ttm_bo_validate(bo, &ne_placement, false, false, false);
619624

620625
/* Could probably bug on */

0 commit comments

Comments
 (0)