diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 26 | 
1 files changed, 16 insertions, 10 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index 6bdede8ff12b..43093bffa2cf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -34,6 +34,9 @@  #define AMDGPU_PL_FLAG_GWS		(TTM_PL_FLAG_PRIV << 1)  #define AMDGPU_PL_FLAG_OA		(TTM_PL_FLAG_PRIV << 2) +#define AMDGPU_GTT_MAX_TRANSFER_SIZE	512 +#define AMDGPU_GTT_NUM_TRANSFER_WINDOWS	2 +  struct amdgpu_mman {  	struct ttm_bo_global_ref        bo_global_ref;  	struct drm_global_reference	mem_global_ref; @@ -49,6 +52,8 @@ struct amdgpu_mman {  	/* buffer handling */  	const struct amdgpu_buffer_funcs	*buffer_funcs;  	struct amdgpu_ring			*buffer_funcs_ring; + +	struct mutex				gtt_window_lock;  	/* Scheduler entity for buffer moves */  	struct amd_sched_entity			entity;  }; @@ -56,24 +61,25 @@ struct amdgpu_mman {  extern const struct ttm_mem_type_manager_func amdgpu_gtt_mgr_func;  extern const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func; -int amdgpu_gtt_mgr_alloc(struct ttm_mem_type_manager *man, -			 struct ttm_buffer_object *tbo, -			 const struct ttm_place *place, -			 struct ttm_mem_reg *mem); +bool amdgpu_gtt_mgr_is_allocated(struct ttm_mem_reg *mem); +uint64_t amdgpu_gtt_mgr_usage(struct ttm_mem_type_manager *man); + +uint64_t amdgpu_vram_mgr_usage(struct ttm_mem_type_manager *man); +uint64_t amdgpu_vram_mgr_vis_usage(struct ttm_mem_type_manager *man); -int amdgpu_copy_buffer(struct amdgpu_ring *ring, -		       uint64_t src_offset, -		       uint64_t dst_offset, -		       uint32_t byte_count, +int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset, +		       uint64_t dst_offset, uint32_t byte_count,  		       struct reservation_object *resv, -		       struct dma_fence **fence, bool direct_submit); +		       struct dma_fence **fence, bool direct_submit, +		       bool vm_needs_flush);  int amdgpu_fill_buffer(struct amdgpu_bo *bo, -			uint32_t src_data, +			uint64_t src_data,  			struct reservation_object *resv,  			struct dma_fence **fence);  int amdgpu_mmap(struct file *filp, struct vm_area_struct *vma);  bool amdgpu_ttm_is_bound(struct ttm_tt *ttm);  int amdgpu_ttm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *bo_mem); +int amdgpu_ttm_recover_gart(struct amdgpu_device *adev);  #endif |