diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 48c58ae4bb3a..7873dfa8c0f9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define __AMDGPU_VM_H__ | 25 | #define __AMDGPU_VM_H__ |
26 | 26 | ||
27 | #include <linux/rbtree.h> | 27 | #include <linux/rbtree.h> |
28 | #include <linux/idr.h> | ||
28 | 29 | ||
29 | #include "gpu_scheduler.h" | 30 | #include "gpu_scheduler.h" |
30 | #include "amdgpu_sync.h" | 31 | #include "amdgpu_sync.h" |
@@ -148,8 +149,9 @@ struct amdgpu_vm { | |||
148 | /* Scheduler entity for page table updates */ | 149 | /* Scheduler entity for page table updates */ |
149 | struct amd_sched_entity entity; | 150 | struct amd_sched_entity entity; |
150 | 151 | ||
151 | /* client id */ | 152 | /* client id and PASID (TODO: replace client_id with PASID) */ |
152 | u64 client_id; | 153 | u64 client_id; |
154 | unsigned int pasid; | ||
153 | /* dedicated to vm */ | 155 | /* dedicated to vm */ |
154 | struct amdgpu_vm_id *reserved_vmid[AMDGPU_MAX_VMHUBS]; | 156 | struct amdgpu_vm_id *reserved_vmid[AMDGPU_MAX_VMHUBS]; |
155 | 157 | ||
@@ -220,12 +222,20 @@ struct amdgpu_vm_manager { | |||
220 | * BIT1[= 0] Compute updated by SDMA [= 1] by CPU | 222 | * BIT1[= 0] Compute updated by SDMA [= 1] by CPU |
221 | */ | 223 | */ |
222 | int vm_update_mode; | 224 | int vm_update_mode; |
225 | |||
226 | /* PASID to VM mapping, will be used in interrupt context to | ||
227 | * look up VM of a page fault | ||
228 | */ | ||
229 | struct idr pasid_idr; | ||
230 | spinlock_t pasid_lock; | ||
223 | }; | 231 | }; |
224 | 232 | ||
233 | int amdgpu_vm_alloc_pasid(unsigned int bits); | ||
234 | void amdgpu_vm_free_pasid(unsigned int pasid); | ||
225 | void amdgpu_vm_manager_init(struct amdgpu_device *adev); | 235 | void amdgpu_vm_manager_init(struct amdgpu_device *adev); |
226 | void amdgpu_vm_manager_fini(struct amdgpu_device *adev); | 236 | void amdgpu_vm_manager_fini(struct amdgpu_device *adev); |
227 | int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, | 237 | int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, |
228 | int vm_context); | 238 | int vm_context, unsigned int pasid); |
229 | void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm); | 239 | void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm); |
230 | void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, | 240 | void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, |
231 | struct list_head *validated, | 241 | struct list_head *validated, |