diff options
author | Roger He <Hongbo.He@amd.com> | 2017-12-18 06:50:08 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-27 11:38:11 -0500 |
commit | a6c26af8a4348a0ba2eb146b08f4d4d908cd9222 (patch) | |
tree | a4c7f906baf50094c998479a974c3127e551b053 /drivers/gpu/drm/ttm/ttm_memory.c | |
parent | 44835a86276ac2c90661267d3a3738aa1fa159ef (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.c | 12 |
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, | |||
214 | uint64_t extra) | 214 | uint64_t extra) |
215 | { | 215 | { |
216 | int ret; | 216 | int ret; |
217 | struct ttm_mem_shrink *shrink; | ||
218 | 217 | ||
219 | spin_lock(&glob->lock); | 218 | spin_lock(&glob->lock); |
220 | if (glob->shrink == NULL) | ||
221 | goto out; | ||
222 | 219 | ||
223 | while (ttm_zones_above_swap_target(glob, from_wq, extra)) { | 220 | while (ttm_zones_above_swap_target(glob, from_wq, extra)) { |
224 | shrink = glob->shrink; | ||
225 | spin_unlock(&glob->lock); | 221 | spin_unlock(&glob->lock); |
226 | ret = shrink->do_shrink(shrink); | 222 | ret = ttm_bo_swapout(glob->bo_glob); |
227 | spin_lock(&glob->lock); | 223 | spin_lock(&glob->lock); |
228 | if (unlikely(ret != 0)) | 224 | if (unlikely(ret != 0)) |
229 | goto out; | 225 | break; |
230 | } | 226 | } |
231 | out: | 227 | |
232 | spin_unlock(&glob->lock); | 228 | spin_unlock(&glob->lock); |
233 | } | 229 | } |
234 | 230 | ||
235 | |||
236 | |||
237 | static void ttm_shrink_work(struct work_struct *work) | 231 | static void ttm_shrink_work(struct work_struct *work) |
238 | { | 232 | { |
239 | struct ttm_mem_global *glob = | 233 | struct ttm_mem_global *glob = |