diff options
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_memory.c')
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_memory.c | 13 | 
1 files changed, 6 insertions, 7 deletions
| diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 89d50f38c0f2..5ed1fc8f2ace 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -30,7 +30,6 @@  #include <drm/ttm/ttm_memory.h>  #include <drm/ttm/ttm_module.h> -#include <drm/ttm/ttm_page_alloc.h>  #include <linux/spinlock.h>  #include <linux/sched.h>  #include <linux/wait.h> @@ -38,6 +37,7 @@  #include <linux/module.h>  #include <linux/slab.h>  #include <linux/swap.h> +#include <drm/ttm/ttm_pool.h>  #define TTM_MEMORY_ALLOC_RETRIES 4 @@ -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)) {  		spin_unlock(&glob->lock); -		ret = ttm_bo_swapout(&ttm_bo_glob, ctx); +		ret = ttm_bo_swapout(ctx);  		spin_lock(&glob->lock);  		if (unlikely(ret != 0))  			break; @@ -451,8 +451,7 @@ int ttm_mem_global_init(struct ttm_mem_global *glob)  		pr_info("Zone %7s: Available graphics memory: %llu KiB\n",  			zone->name, (unsigned long long)zone->max_mem >> 10);  	} -	ttm_page_alloc_init(glob, glob->zone_kernel->max_mem/(2*PAGE_SIZE)); -	ttm_dma_page_alloc_init(glob, glob->zone_kernel->max_mem/(2*PAGE_SIZE)); +	ttm_pool_mgr_init(glob->zone_kernel->max_mem/(2*PAGE_SIZE));  	return 0;  out_no_zone:  	ttm_mem_global_release(glob); @@ -465,8 +464,7 @@ void ttm_mem_global_release(struct ttm_mem_global *glob)  	unsigned int i;  	/* let the page allocator first stop the shrink work. */ -	ttm_page_alloc_fini(); -	ttm_dma_page_alloc_fini(); +	ttm_pool_mgr_fini();  	flush_workqueue(glob->swap_queue);  	destroy_workqueue(glob->swap_queue); @@ -544,7 +542,8 @@ ttm_check_under_lowerlimit(struct ttm_mem_global *glob,  {  	int64_t available; -	if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC) +	/* We allow over commit during suspend */ +	if (ctx->force_alloc)  		return false;  	available = get_nr_swap_pages() + si_mem_available(); | 
