drm/radeon/kms: If no placement is supplied fallback to system
authorJerome Glisse <jglisse@redhat.com>
Fri, 11 Dec 2009 14:13:22 +0000 (15:13 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 16 Dec 2009 05:38:54 +0000 (15:38 +1000)
Do as we did before rework, if no placement is supplied at bo
creation time, fallback to allocating bo from system ram. This
will fix most of the creation failed issue report we got since
the rework get merged.

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

index 544e18ffaf22e808b8f899874756aa3114d12040..132130fcd991fa390512a7a3a79ab57d4db5140c 100644 (file)
@@ -71,6 +71,8 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
                rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
        if (domain & RADEON_GEM_DOMAIN_CPU)
                rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+       if (!c)
+               rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
        rbo->placement.num_placement = c;
        rbo->placement.num_busy_placement = c;
 }