diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2018-10-12 18:16:39 +0300 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2019-06-18 16:19:34 +0300 |
commit | 32d1f6985ceb6b9099bc9e02dc04e58660f28c16 (patch) | |
tree | 8cca94e37cdc45db8e6ec0fe7261ba8901e911fb /include/drm | |
parent | 4fe51e9e7902b5724b618dadd9527b1bbf2b55cc (diff) | |
download | linux-32d1f6985ceb6b9099bc9e02dc04e58660f28c16.tar.xz |
drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct
Add a pointer to the struct vm_operations_struct in the bo_device, and
assign that pointer to the default value currently used.
The driver can then optionally modify that pointer and the new value
can be used for each new vma created.
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>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index c9b8ba492f24..a2d810a2504d 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -442,6 +442,9 @@ extern struct ttm_bo_global { * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. * @vma_manager: Address space manager + * @vm_ops: Pointer to the struct vm_operations_struct used for this + * device's VM operations. The driver may override this before the first + * mmap() call. * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the @@ -460,6 +463,7 @@ struct ttm_bo_device { struct ttm_bo_global *glob; struct ttm_bo_driver *driver; struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES]; + const struct vm_operations_struct *vm_ops; /* * Protected by internal locks. @@ -488,6 +492,8 @@ struct ttm_bo_device { bool no_retry; }; +extern const struct vm_operations_struct ttm_bo_vm_ops; + /** * struct ttm_lru_bulk_move_pos * |