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>
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user