Skip to contentSkip to conversation

vmwgfx: Avoid fb VRAM fragmenting.

PATCH New Thomas Hellstrom 1 participant 1 message Sep 30, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmwgfx: Avoid fb VRAM fragmenting.

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.

---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +5 -0
index cac0db0..b27a9f2 100644
@@ -625,6 +625,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 */
Signature · 1 line
1.6.2.5