drm/amdgpu: fix placement flags in amdgpu_ttm_bind
authorChristian König <christian.koenig@amd.com>
Fri, 1 Sep 2017 07:22:56 +0000 (09:22 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 12 Oct 2017 14:34:42 +0000 (10:34 -0400)
Otherwise we lose the NO_EVICT flag and can try to evict pinned BOs.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 7ef6c28a34d991a2bba6f20224284072330c22d1..bc746131987ffda438988f7b11bbb413b4c335c3 100644 (file)
@@ -834,7 +834,7 @@ int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem)
        placement.busy_placement = &placements;
        placements.fpfn = 0;
        placements.lpfn = adev->mc.gart_size >> PAGE_SHIFT;
-       placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
+       placements.flags = bo->mem.placement | TTM_PL_FLAG_TT;
 
        r = ttm_bo_mem_space(bo, &placement, &tmp, true, false);
        if (unlikely(r))