drm/ttm: use pin_count more extensively

Check the pin_count instead of the lru list is empty here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Link: https://patchwork.freedesktop.org/patch/404617/
This commit is contained in:
Christian König 2020-11-27 12:51:33 +01:00
parent 2200736a0c
commit fde1403eea

View file

@ -938,9 +938,8 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
}
error:
if (bo->mem.mem_type == TTM_PL_SYSTEM && !list_empty(&bo->lru)) {
if (bo->mem.mem_type == TTM_PL_SYSTEM && !bo->pin_count)
ttm_bo_move_to_lru_tail_unlocked(bo);
}
return ret;
}