Signed-off-by: Roger He <Hongbo.He@xxxxxxx> --- drivers/gpu/drm/ttm/ttm_memory.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 875e5b8..25e1ce0 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -503,8 +503,11 @@ static int ttm_mem_global_reserve(struct ttm_mem_global *glob, limit = (capable(CAP_SYS_ADMIN)) ? zone->emer_mem : zone->max_mem; - total_used_mem = zone->used_mem + swap_glob_mem; - limit += glob->max_swap_mem; + total_used_mem = zone->used_mem; + if (glob->bdev && glob->bdev->no_retry) { + total_used_mem += swap_glob_mem; + limit += glob->max_swap_mem; + } if (total_used_mem > limit) goto out_unlock; } -- 2.7.4 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel