From fac143dfb8571604143fb263008c84157bfb6fc5 Mon Sep 17 00:00:00 2001 From: Yong Zhao Date: Mon, 7 Nov 2016 18:50:43 -0500 Subject: [PATCH] drm/ttm: Workaround memory allocation limits affecting KFD Allow up to 15/16 of system memory to be used. Fix BUG: SWDEV-106528 Change-Id: I5d47bfa49459c62da49bbae6058c940b2d37b3f6 Signed-off-by: Yong Zhao --- drivers/gpu/drm/ttm/ttm_memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 6b41e6aad2227..21fdcee48e184 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -311,9 +311,9 @@ static int ttm_mem_init_kernel_zone(struct ttm_mem_global *glob, zone->name = "kernel"; zone->zone_mem = mem; - zone->max_mem = mem >> 1; - zone->emer_mem = (mem >> 1) + (mem >> 2); - zone->swap_limit = zone->max_mem - (mem >> 3); + zone->max_mem = mem - (mem >> 4); /* 15/16 */ + zone->emer_mem = mem - (mem >> 4); /* 15/16 */ + zone->swap_limit = zone->max_mem; zone->used_mem = 0; zone->glob = glob; glob->zone_kernel = zone;