diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2019-02-06 06:55:08 -0500 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2019-06-18 09:19:34 -0400 |
commit | 7a39f35ce43f96ff293cc90f845416d03566b14b (patch) | |
tree | cd864576a32bf016965eb50c1736577779ab10c5 /include/drm/ttm | |
parent | 32d1f6985ceb6b9099bc9e02dc04e58660f28c16 (diff) |
drm/ttm: TTM fault handler helpers
With the vmwgfx dirty tracking, the default TTM fault handler is not
completely sufficient (vmwgfx need to modify the vma->vm_flags member,
and also needs to restrict the number of prefaults).
We also want to replicate the new ttm_bo_vm_reserve() functionality
So start turning the TTM vm code into helpers: ttm_bo_vm_fault_reserved()
and ttm_bo_vm_reserve(), and provide a default TTM fault handler for other
drivers to use.
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: "Christian König" <christian.koenig@amd.com> #v1
Diffstat (limited to 'include/drm/ttm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 49d9cdfc58f2..435d02f719a8 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -768,4 +768,14 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, | |||
768 | struct ttm_operation_ctx *ctx); | 768 | struct ttm_operation_ctx *ctx); |
769 | void ttm_bo_swapout_all(struct ttm_bo_device *bdev); | 769 | void ttm_bo_swapout_all(struct ttm_bo_device *bdev); |
770 | int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo); | 770 | int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo); |
771 | |||
772 | /* Default number of pre-faulted pages in the TTM fault handler */ | ||
773 | #define TTM_BO_VM_NUM_PREFAULT 16 | ||
774 | |||
775 | vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo, | ||
776 | struct vm_fault *vmf); | ||
777 | |||
778 | vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf, | ||
779 | pgprot_t prot, | ||
780 | pgoff_t num_prefault); | ||
771 | #endif | 781 | #endif |