[PATCH 5/5] drm/ttm: keep original behavior except bo device with flag no_retry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux