aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2010-10-26 15:21:47 -0400
committerDave Airlie <airlied@redhat.com>2010-10-26 21:07:46 -0400
commit135cba0dc399fdd47bd3ae305c1db75fcd77243f (patch)
tree3eedcd7c5701dfe05246aca3479ab7396169f2e7 /drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
parent8f895da57da80b307efa2f94b5d4caf801e959a5 (diff)
vmwgfx: Implement a proper GMR eviction mechanism
Use Ben's new range manager hooks to implement a manager for GMRs that manages ids rather than ranges. This means we can use the standard TTM code for binding, unbinding and eviction. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_fb.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fb.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index e7304188a784..41d9a5b73c03 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -612,7 +612,6 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv,
612{ 612{
613 struct ttm_buffer_object *bo = &vmw_bo->base; 613 struct ttm_buffer_object *bo = &vmw_bo->base;
614 struct ttm_placement ne_placement = vmw_vram_ne_placement; 614 struct ttm_placement ne_placement = vmw_vram_ne_placement;
615 struct drm_mm_node *mm_node;
616 int ret = 0; 615 int ret = 0;
617 616
618 ne_placement.lpfn = bo->num_pages; 617 ne_placement.lpfn = bo->num_pages;
@@ -626,9 +625,9 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv,
626 if (unlikely(ret != 0)) 625 if (unlikely(ret != 0))
627 goto err_unlock; 626 goto err_unlock;
628 627
629 mm_node = bo->mem.mm_node;
630 if (bo->mem.mem_type == TTM_PL_VRAM && 628 if (bo->mem.mem_type == TTM_PL_VRAM &&
631 mm_node->start < bo->num_pages) 629 bo->mem.start < bo->num_pages &&
630 bo->mem.start > 0)
632 (void) ttm_bo_validate(bo, &vmw_sys_placement, false, 631 (void) ttm_bo_validate(bo, &vmw_sys_placement, false,
633 false, false); 632 false, false);
634 633