Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61ede070 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/ttm: wait for BO idle after the move in ttm_bo_swapout



Final part to avoid pre move waits.

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 17d33bc9
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1655,14 +1655,9 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
	ttm_bo_list_ref_sub(bo, put_count, true);

	/**
	 * Wait for GPU, then move to system cached.
	 * Move to system cached
	 */

	ret = ttm_bo_wait(bo, false, false);

	if (unlikely(ret != 0))
		goto out;

	if ((bo->mem.placement & swap_placement) != swap_placement) {
		struct ttm_mem_reg evict_mem;

@@ -1677,6 +1672,14 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
			goto out;
	}

	/**
	 * Make sure BO is idle.
	 */

	ret = ttm_bo_wait(bo, false, false);
	if (unlikely(ret != 0))
		goto out;

	ttm_bo_unmap_virtual(bo);

	/**