Commit 4561b366 authored by Christian König's avatar Christian König

drm/ttm: drop glob parameter from ttm_bo_swapout

We can always access the global state.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/393499/
parent 4ce032d6
...@@ -1432,8 +1432,9 @@ EXPORT_SYMBOL(ttm_bo_wait); ...@@ -1432,8 +1432,9 @@ EXPORT_SYMBOL(ttm_bo_wait);
* A buffer object shrink method that tries to swap out the first * A buffer object shrink method that tries to swap out the first
* buffer object on the bo_global::swap_lru list. * buffer object on the bo_global::swap_lru list.
*/ */
int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx) int ttm_bo_swapout(struct ttm_operation_ctx *ctx)
{ {
struct ttm_bo_global *glob = &ttm_bo_glob;
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
int ret = -EBUSY; int ret = -EBUSY;
bool locked; bool locked;
...@@ -1531,7 +1532,7 @@ void ttm_bo_swapout_all(void) ...@@ -1531,7 +1532,7 @@ void ttm_bo_swapout_all(void)
.no_wait_gpu = false .no_wait_gpu = false
}; };
while (ttm_bo_swapout(&ttm_bo_glob, &ctx) == 0); while (ttm_bo_swapout(&ctx) == 0);
} }
EXPORT_SYMBOL(ttm_bo_swapout_all); EXPORT_SYMBOL(ttm_bo_swapout_all);
......
...@@ -275,7 +275,7 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq, ...@@ -275,7 +275,7 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq,
while (ttm_zones_above_swap_target(glob, from_wq, extra)) { while (ttm_zones_above_swap_target(glob, from_wq, extra)) {
spin_unlock(&glob->lock); spin_unlock(&glob->lock);
ret = ttm_bo_swapout(&ttm_bo_glob, ctx); ret = ttm_bo_swapout(ctx);
spin_lock(&glob->lock); spin_lock(&glob->lock);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
break; break;
......
...@@ -541,8 +541,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp, ...@@ -541,8 +541,7 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
const char __user *wbuf, char __user *rbuf, const char __user *wbuf, char __user *rbuf,
size_t count, loff_t *f_pos, bool write); size_t count, loff_t *f_pos, bool write);
int ttm_bo_swapout(struct ttm_bo_global *glob, int ttm_bo_swapout(struct ttm_operation_ctx *ctx);
struct ttm_operation_ctx *ctx);
void ttm_bo_swapout_all(void); void ttm_bo_swapout_all(void);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment