Skip to content

Commit

Permalink
vmwgfx: Fix fb VRAM pinning failure due to fragmentation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Oct 1, 2010
1 parent f1a28ee commit abb295f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv,
if (unlikely(ret != 0))
goto err_unlock;

if (bo->mem.mem_type == TTM_PL_VRAM &&
bo->mem.mm_node->start < bo->num_pages)
(void) ttm_bo_validate(bo, &vmw_sys_placement, false,
false, false);

ret = ttm_bo_validate(bo, &ne_placement, false, false, false);

/* Could probably bug on */
Expand Down

0 comments on commit abb295f

Please sign in to comment.