diff options
| author | Christian König <christian.koenig@amd.com> | 2016-06-22 08:16:28 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2016-07-07 15:02:00 -0400 |
| commit | aff98ba1fdb8150a1a7afe61503772f61b9a2132 (patch) | |
| tree | c9909aeafa98c046ec60c909a1a9bbac6fd702a7 /drivers/gpu/drm/ttm | |
| parent | 9a79588c42bf89cff48fdc6db4aab4aeb9d862b6 (diff) | |
drm/ttm: wait for eviction in ttm_bo_force_list_clean
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>
Diffstat (limited to 'drivers/gpu/drm/ttm')
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 5d931690e0e1..e340d0d66429 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -1287,6 +1287,7 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, | |||
| 1287 | { | 1287 | { |
| 1288 | struct ttm_mem_type_manager *man = &bdev->man[mem_type]; | 1288 | struct ttm_mem_type_manager *man = &bdev->man[mem_type]; |
| 1289 | struct ttm_bo_global *glob = bdev->glob; | 1289 | struct ttm_bo_global *glob = bdev->glob; |
| 1290 | struct fence *fence; | ||
| 1290 | int ret; | 1291 | int ret; |
| 1291 | 1292 | ||
| 1292 | /* | 1293 | /* |
| @@ -1307,6 +1308,23 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev, | |||
| 1307 | spin_lock(&glob->lru_lock); | 1308 | spin_lock(&glob->lru_lock); |
| 1308 | } | 1309 | } |
| 1309 | spin_unlock(&glob->lru_lock); | 1310 | spin_unlock(&glob->lru_lock); |
| 1311 | |||
| 1312 | spin_lock(&man->move_lock); | ||
| 1313 | fence = fence_get(man->move); | ||
| 1314 | spin_unlock(&man->move_lock); | ||
| 1315 | |||
| 1316 | if (fence) { | ||
| 1317 | ret = fence_wait(fence, false); | ||
| 1318 | fence_put(fence); | ||
| 1319 | if (ret) { | ||
| 1320 | if (allow_errors) { | ||
| 1321 | return ret; | ||
| 1322 | } else { | ||
| 1323 | pr_err("Cleanup eviction failed\n"); | ||
| 1324 | } | ||
| 1325 | } | ||
| 1326 | } | ||
| 1327 | |||
| 1310 | return 0; | 1328 | return 0; |
| 1311 | } | 1329 | } |
| 1312 | 1330 | ||
