diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2019-02-06 12:55:08 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2019-06-18 15:19:34 +0200 |
commit | 7a39f35ce43f96ff293cc90f845416d03566b14b (patch) | |
tree | cd864576a32bf016965eb50c1736577779ab10c5 /include/drm | |
parent | drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct (diff) | |
download | linux-7a39f35ce43f96ff293cc90f845416d03566b14b.tar.xz linux-7a39f35ce43f96ff293cc90f845416d03566b14b.zip |
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')
-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, struct ttm_operation_ctx *ctx); void ttm_bo_swapout_all(struct ttm_bo_device *bdev); int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo); + +/* Default number of pre-faulted pages in the TTM fault handler */ +#define TTM_BO_VM_NUM_PREFAULT 16 + +vm_fault_t ttm_bo_vm_reserve(struct ttm_buffer_object *bo, + struct vm_fault *vmf); + +vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf, + pgprot_t prot, + pgoff_t num_prefault); #endif |