summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm/ttm_memory.c
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2017-12-18 19:50:08 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-12-27 11:38:11 -0500
commita6c26af8a4348a0ba2eb146b08f4d4d908cd9222 (patch)
treea4c7f906baf50094c998479a974c3127e551b053 /drivers/gpu/drm/ttm/ttm_memory.c
parent44835a86276ac2c90661267d3a3738aa1fa159ef (diff)
drm/ttm: call ttm_bo_swapout directly when ttm shrink
remove the extra indirection because we have only one implementation anyway Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Roger He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_memory.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_memory.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index e96374990398..9130bdfb26ad 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -214,26 +214,20 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq,
uint64_t extra)
{
int ret;
- struct ttm_mem_shrink *shrink;
spin_lock(&glob->lock);
- if (glob->shrink == NULL)
- goto out;
while (ttm_zones_above_swap_target(glob, from_wq, extra)) {
- shrink = glob->shrink;
spin_unlock(&glob->lock);
- ret = shrink->do_shrink(shrink);
+ ret = ttm_bo_swapout(glob->bo_glob);
spin_lock(&glob->lock);
if (unlikely(ret != 0))
- goto out;
+ break;
}
-out:
+
spin_unlock(&glob->lock);
}
-
-
static void ttm_shrink_work(struct work_struct *work)
{
struct ttm_mem_global *glob =