drm/amdgpu: drop the backing store when DMA-buf imports are evicted
authorChristian König <christian.koenig@amd.com>
Tue, 20 Feb 2018 18:09:56 +0000 (19:09 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Mar 2018 19:38:28 +0000 (14:38 -0500)
Instead of moving this to the SYSTEM domain just drop the backing store
and let the resulting allocation be freed.

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

index 72e533493292e9c47cd8a363b7e00ae34e36a59f..dbb993a2c151f5bb42aab7a0e05b7270e47702a4 100644 (file)
@@ -204,6 +204,12 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
                .flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM
        };
 
+       if (bo->type == ttm_bo_type_sg) {
+               placement->num_placement = 0;
+               placement->num_busy_placement = 0;
+               return;
+       }
+
        if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) {
                placement->placement = &placements;
                placement->busy_placement = &placements;