diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 28 | 
1 files changed, 20 insertions, 8 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 6f085f0b4ef3..ffac7413c657 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h @@ -111,11 +111,14 @@ struct amdgpu_mem_stats;  /* Reserve 4MB VRAM for page tables */  #define AMDGPU_VM_RESERVED_VRAM		(8ULL << 20) -/* max number of VMHUB */ -#define AMDGPU_MAX_VMHUBS			3 -#define AMDGPU_GFXHUB_0				0 -#define AMDGPU_MMHUB_0				1 -#define AMDGPU_MMHUB_1				2 +/* + * max number of VMHUB + * layout: max 8 GFXHUB + 4 MMHUB0 + 1 MMHUB1 + */ +#define AMDGPU_MAX_VMHUBS			13 +#define AMDGPU_GFXHUB(x)			(x) +#define AMDGPU_MMHUB0(x)			(8 + x) +#define AMDGPU_MMHUB1(x)			(8 + 4 + x)  /* Reserve 2MB at top/bottom of address space for kernel use */  #define AMDGPU_VA_RESERVED_SIZE			(2ULL << 20) @@ -292,6 +295,9 @@ struct amdgpu_vm {  	atomic64_t		tlb_seq;  	struct dma_fence	*last_tlb_flush; +	/* How many times we had to re-generate the page tables */ +	uint64_t		generation; +  	/* Last unlocked submission to the scheduler entities */  	struct dma_fence	*last_unlocked; @@ -326,6 +332,9 @@ struct amdgpu_vm {  	struct ttm_lru_bulk_move lru_bulk_move;  	/* Flag to indicate if VM is used for compute */  	bool			is_compute_context; + +	/* Memory partition number, -1 means any partition */ +	int8_t			mem_id;  };  struct amdgpu_vm_manager { @@ -383,7 +392,7 @@ int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm,  			u32 pasid);  long amdgpu_vm_wait_idle(struct amdgpu_vm *vm, long timeout); -int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm); +int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, int32_t xcp_id);  int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm);  void amdgpu_vm_release_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm);  void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm); @@ -391,6 +400,7 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm,  			 struct list_head *validated,  			 struct amdgpu_bo_list_entry *entry);  bool amdgpu_vm_ready(struct amdgpu_vm *vm); +uint64_t amdgpu_vm_generation(struct amdgpu_device *adev, struct amdgpu_vm *vm);  int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,  			      int (*callback)(void *p, struct amdgpu_bo *bo),  			      void *param); @@ -452,7 +462,8 @@ void amdgpu_vm_check_compute_bug(struct amdgpu_device *adev);  void amdgpu_vm_get_task_info(struct amdgpu_device *adev, u32 pasid,  			     struct amdgpu_task_info *task_info);  bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid, -			    uint64_t addr, bool write_fault); +			    u32 vmid, u32 node_id, uint64_t addr, +			    bool write_fault);  void amdgpu_vm_set_task_info(struct amdgpu_vm *vm); @@ -464,7 +475,8 @@ void amdgpu_vm_get_memory(struct amdgpu_vm *vm,  int amdgpu_vm_pt_clear(struct amdgpu_device *adev, struct amdgpu_vm *vm,  		       struct amdgpu_bo_vm *vmbo, bool immediate);  int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm, -			int level, bool immediate, struct amdgpu_bo_vm **vmbo); +			int level, bool immediate, struct amdgpu_bo_vm **vmbo, +			int32_t xcp_id);  void amdgpu_vm_pt_free_root(struct amdgpu_device *adev, struct amdgpu_vm *vm);  bool amdgpu_vm_pt_is_root_clean(struct amdgpu_device *adev,  				struct amdgpu_vm *vm); | 
