summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFlora Cui <flora.cui@amd.com>2020-09-09 17:32:06 +0800
committerFlora Cui <flora.cui@amd.com>2020-09-10 15:20:18 +0800
commit4f9b5a3f06a6dc066b7d4190a381af019a993d9f (patch)
tree7f54b640c1559ae56cc431504a29196f54c9f00f /include
parent91eda1fbd37ed4c1dfb869126adbb8989bef5579 (diff)
drm/amdkcl: refactor test for vm_operations_struct->fault()
Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed-by: shiwu.zhang <shiwu.zhang@amd.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/ttm/ttm_bo_api.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 04cf3a0c27aa..0c3b11062a0e 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -44,7 +44,7 @@
#ifndef HAVE_CONFIG_H
#define HAVE_DRM_GEM_OBJECT_RESV 1
-#define HAVE_VM_FAULT_ADDRESS_VMA 1
+#define HAVE_VM_OPERATIONS_STRUCT_FAULT_1ARG 1
#endif
struct ttm_bo_global;
@@ -741,30 +741,26 @@ static inline bool ttm_bo_uses_embedded_gem_object(struct ttm_buffer_object *bo)
/* Default number of pre-faulted pages in the TTM fault handler */
#define TTM_BO_VM_NUM_PREFAULT 16
-#ifndef HAVE_VM_FAULT_ADDRESS_VMA
+#if defined(HAVE_VM_OPERATIONS_STRUCT_FAULT_1ARG)
vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
- struct vm_fault *vmf,
- struct vm_area_struct *vma);
+ struct vm_fault *vmf);
vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
- struct vm_area_struct *vma,
pgprot_t prot,
pgoff_t num_prefault);
+vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf);
#else
vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo,
- struct vm_fault *vmf);
+ struct vm_fault *vmf,
+ struct vm_area_struct *vma);
vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
+ struct vm_area_struct *vma,
pgprot_t prot,
pgoff_t num_prefault);
-#endif
-
-#if defined(HAVE_VM_OPERATIONS_STRUCT_FAULT_2ARG)
vm_fault_t ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
-#else
-vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf);
#endif
void ttm_bo_vm_open(struct vm_area_struct *vma);