Commit 25b8a14e authored by Christian König's avatar Christian König
Browse files

drm/amdgpu: use new iterator in amdgpu_ttm_bo_eviction_valuable

parent 930ca2a7
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -1345,10 +1345,9 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
					    const struct ttm_place *place)
{
	unsigned long num_pages = bo->resource->num_pages;
	struct dma_resv_iter resv_cursor;
	struct amdgpu_res_cursor cursor;
	struct dma_resv_list *flist;
	struct dma_fence *f;
	int i;

	/* Swapout? */
	if (bo->resource->mem_type == TTM_PL_SYSTEM)
@@ -1362,15 +1361,10 @@ static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
	 * If true, then return false as any KFD process needs all its BOs to
	 * be resident to run successfully
	 */
	flist = dma_resv_shared_list(bo->base.resv);
	if (flist) {
		for (i = 0; i < flist->shared_count; ++i) {
			f = rcu_dereference_protected(flist->shared[i],
				dma_resv_held(bo->base.resv));
	dma_resv_for_each_fence(&resv_cursor, bo->base.resv, true, f) {
		if (amdkfd_fence_check_mm(f, current->mm))
			return false;
	}
	}

	switch (bo->resource->mem_type) {
	case AMDGPU_PL_PREEMPT: