diff options
author | Dave Airlie <airlied@redhat.com> | 2020-08-04 05:55:39 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-08-06 05:16:33 +0300 |
commit | 20784cdf4b8c81359289aff73a89f557c7bc9e76 (patch) | |
tree | ff950470260392f77f3cf10db39664cf2ddd33d4 /drivers/gpu/drm/ttm/ttm_bo.c | |
parent | 46bca88bbdd3046db31b8b7e053a909ae79e285b (diff) | |
download | linux-20784cdf4b8c81359289aff73a89f557c7bc9e76.tar.xz |
drm/ttm: use a helper for unlocked moves to the lru tail
The pattern was repeated a few times, just make an inline for it.
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-7-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 6c02a336a587..c5771a43d8ec 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1101,9 +1101,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, error: if (bo->mem.mem_type == TTM_PL_SYSTEM && !list_empty(&bo->lru)) { - spin_lock(&ttm_bo_glob.lru_lock); - ttm_bo_move_to_lru_tail(bo, NULL); - spin_unlock(&ttm_bo_glob.lru_lock); + ttm_bo_move_to_lru_tail_unlocked(bo); } return ret; @@ -1318,9 +1316,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, return ret; } - spin_lock(&ttm_bo_glob.lru_lock); - ttm_bo_move_to_lru_tail(bo, NULL); - spin_unlock(&ttm_bo_glob.lru_lock); + ttm_bo_move_to_lru_tail_unlocked(bo); return ret; } |