drm/radeon/kms: only evict to GTT if CP is ready
authorDave Airlie <airlied@redhat.com>
Tue, 12 Jan 2010 23:21:49 +0000 (09:21 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 13 Jan 2010 03:25:14 +0000 (13:25 +1000)
Testing GTT ready might be more correct but cp.ready
works fine and has been tested on irc by 2-3 ppl.

fixes bug k.org 15035 and fd.o 25733

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_ttm.c

index a004507..db820ae 100644 (file)
@@ -215,7 +215,10 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo,
        rbo = container_of(bo, struct radeon_bo, tbo);
        switch (bo->mem.mem_type) {
        case TTM_PL_VRAM:
-               radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT);
+               if (rbo->rdev->cp.ready == false)
+                       radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_CPU);
+               else
+                       radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_GTT);
                break;
        case TTM_PL_TT:
        default: