提交 aa7662b6 编写于 作者: R Roger He 提交者: Alex Deucher

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: NRoger He <Hongbo.He@amd.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 d330fca1
...@@ -226,7 +226,9 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf) ...@@ -226,7 +226,9 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf)
} else { } else {
struct ttm_operation_ctx ctx = { struct ttm_operation_ctx ctx = {
.interruptible = false, .interruptible = false,
.no_wait_gpu = false .no_wait_gpu = false,
.flags = TTM_OPT_FLAG_FORCE_ALLOC
}; };
ttm = bo->ttm; ttm = bo->ttm;
......
...@@ -278,7 +278,9 @@ struct ttm_operation_ctx { ...@@ -278,7 +278,9 @@ struct ttm_operation_ctx {
}; };
/* Allow eviction of reserved BOs */ /* Allow eviction of reserved BOs */
#define TTM_OPT_FLAG_ALLOW_RES_EVICT 0x1 #define TTM_OPT_FLAG_ALLOW_RES_EVICT 0x1
/* when serving page fault or suspend, allow alloc anyway */
#define TTM_OPT_FLAG_FORCE_ALLOC 0x2
/** /**
* ttm_bo_reference - reference a struct ttm_buffer_object * ttm_bo_reference - reference a struct ttm_buffer_object
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册