summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm/ttm_bo.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2020-07-23 11:58:12 +0300
committerChristian König <christian.koenig@amd.com>2020-07-28 14:54:15 +0300
commitd59bc6324208e427d141826d26408b193d522244 (patch)
tree7bdd9dc48c7fc748eb69c1607c5a187d47f2c257 /drivers/gpu/drm/ttm/ttm_bo.c
parent7427a7a0b3b8f66ea45472a9a37b79689ed8c3b3 (diff)
downloadlinux-d59bc6324208e427d141826d26408b193d522244.tar.xz
drm/ttm: fix pipelined gutting for evictions v2
We can't pipeline that during eviction because the memory needs to be available immediately. v2: fix how we cleanup the BOs resources Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Tested-by: Alex Sierra <alex.sierra@amd.com> Link: https://patchwork.freedesktop.org/patch/379039/
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 0768a054a916..469aa93ea317 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
placement.num_busy_placement = 0;
bdev->driver->evict_flags(bo, &placement);
- if (!placement.num_placement && !placement.num_busy_placement)
- return ttm_bo_pipeline_gutting(bo);
+ if (!placement.num_placement && !placement.num_busy_placement) {
+ ttm_bo_wait(bo, false, false);
+
+ ttm_bo_cleanup_memtype_use(bo);
+ return 0;
+ }
evict_mem = bo->mem;
evict_mem.mm_node = NULL;