aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2018-01-17 02:07:23 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-26 23:09:34 -0500
commitaa7662b67bf6f56cd0d678da6732e26f1b4bf0ed (patch)
tree4b07e45dd6f1a35d502b67d722df4edc6aadae51
parentd330fca11500bebaf7f25b60b7b087bbe8ad0b7f (diff)
drm/ttm: add bit flag TTM_OPT_FLAG_FORCE_ALLOC
set TTM_OPT_FLAG_FORCE_ALLOC when we are servicing for page fault routine. for ttm_mem_global_reserve if in page fault routine, allow the gtt pages reservation always. because page fault routing already grabbed system memory and the allowance of this exception is harmless. Otherwise, it will trigger OOM killer. will be used later. v2: set the FORCE_ALLOC always v3: minor refine Signed-off-by: Roger He <Hongbo.He@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_vm.c4
-rw-r--r--include/drm/ttm/ttm_bo_api.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index 121f017ac7ca..8eba95b3c737 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -226,7 +226,9 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf)
226 } else { 226 } else {
227 struct ttm_operation_ctx ctx = { 227 struct ttm_operation_ctx ctx = {
228 .interruptible = false, 228 .interruptible = false,
229 .no_wait_gpu = false 229 .no_wait_gpu = false,
230 .flags = TTM_OPT_FLAG_FORCE_ALLOC
231
230 }; 232 };
231 233
232 ttm = bo->ttm; 234 ttm = bo->ttm;
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 872ff6c1d709..21426395820c 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -278,7 +278,9 @@ struct ttm_operation_ctx {
278}; 278};
279 279
280/* Allow eviction of reserved BOs */ 280/* Allow eviction of reserved BOs */
281#define TTM_OPT_FLAG_ALLOW_RES_EVICT 0x1 281#define TTM_OPT_FLAG_ALLOW_RES_EVICT 0x1
282/* when serving page fault or suspend, allow alloc anyway */
283#define TTM_OPT_FLAG_FORCE_ALLOC 0x2
282 284
283/** 285/**
284 * ttm_bo_reference - reference a struct ttm_buffer_object 286 * ttm_bo_reference - reference a struct ttm_buffer_object