Skip to content

Commit

Permalink
drm/ttm: wait for eviction in ttm_bo_force_list_clean
Browse files Browse the repository at this point in the history
Now that we can pipeline evictions we need to wait for
them to finish when we cleanup a memory domain.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
ChristianKoenigAMD authored and alexdeucher committed Jul 7, 2016
1 parent 9a79588 commit aff98ba
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,7 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
{
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
struct ttm_bo_global *glob = bdev->glob;
struct fence *fence;
int ret;

/*
Expand All @@ -1307,6 +1308,23 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
spin_lock(&glob->lru_lock);
}
spin_unlock(&glob->lru_lock);

spin_lock(&man->move_lock);
fence = fence_get(man->move);
spin_unlock(&man->move_lock);

if (fence) {
ret = fence_wait(fence, false);
fence_put(fence);
if (ret) {
if (allow_errors) {
return ret;
} else {
pr_err("Cleanup eviction failed\n");
}
}
}

return 0;
}

Expand Down

0 comments on commit aff98ba

Please sign in to comment.