drm/ttm: Allow system memory as a busy placement.
authorThomas Hellstrom <thellstrom@vmware.com>
Sat, 16 Jan 2010 15:05:04 +0000 (16:05 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 25 Jan 2010 06:04:30 +0000 (16:04 +1000)
This is needed to fix a vmwgfx memory usage bug.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo.c

index 8036b6e189eef5100d8aa0bb52c187e579f19c1b..1a3e909b7bba6e926cd5aa3b90e5a51419b1db03 100644 (file)
@@ -943,6 +943,14 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
                ttm_flag_masked(&cur_flags, placement->busy_placement[i],
                                ~TTM_PL_MASK_MEMTYPE);
 
+
+               if (mem_type == TTM_PL_SYSTEM) {
+                       mem->mem_type = mem_type;
+                       mem->placement = cur_flags;
+                       mem->mm_node = NULL;
+                       return 0;
+               }
+
                ret = ttm_bo_mem_force_space(bo, mem_type, placement, mem,
                                                interruptible, no_wait);
                if (ret == 0 && mem->mm_node) {