drm/amdgpu: add TOPDOWN flag to the whole vram
authorChunming Zhou <david1.zhou@amd.com>
Wed, 23 Sep 2015 09:22:43 +0000 (17:22 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 8 Oct 2015 03:48:22 +0000 (23:48 -0400)
need to decrease visible vram usage by default.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: monk.liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 1a7708f365f37923e747dda4b37e5bd3f0ceb203..0d524384ff79c3b49d2dbaa1489d8cbff231d80a 100644 (file)
@@ -132,6 +132,8 @@ static void amdgpu_ttm_placement_init(struct amdgpu_device *adev,
                placements[c].fpfn = 0;
                placements[c++].flags = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
                        TTM_PL_FLAG_VRAM;
+               if (!(flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED))
+                       placements[c - 1].flags |= TTM_PL_FLAG_TOPDOWN;
        }
 
        if (domain & AMDGPU_GEM_DOMAIN_GTT) {