diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 103 | 
1 files changed, 18 insertions, 85 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 7dcbac8af9a7..447c4c7a36d6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -73,6 +73,8 @@  #include "amdgpu_virt.h"  #include "amdgpu_gart.h"  #include "amdgpu_debugfs.h" +#include "amdgpu_job.h" +#include "amdgpu_bo_list.h"  /*   * Modules parameters. @@ -105,11 +107,8 @@ extern int amdgpu_vm_fault_stop;  extern int amdgpu_vm_debug;  extern int amdgpu_vm_update_mode;  extern int amdgpu_dc; -extern int amdgpu_dc_log;  extern int amdgpu_sched_jobs;  extern int amdgpu_sched_hw_submission; -extern int amdgpu_no_evict; -extern int amdgpu_direct_gma_size;  extern uint amdgpu_pcie_gen_cap;  extern uint amdgpu_pcie_lane_cap;  extern uint amdgpu_cg_mask; @@ -600,17 +599,6 @@ struct amdgpu_ib {  extern const struct drm_sched_backend_ops amdgpu_sched_ops; -int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, -		     struct amdgpu_job **job, struct amdgpu_vm *vm); -int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size, -			     struct amdgpu_job **job); - -void amdgpu_job_free_resources(struct amdgpu_job *job); -void amdgpu_job_free(struct amdgpu_job *job); -int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, -		      struct drm_sched_entity *entity, void *owner, -		      struct dma_fence **f); -  /*   * Queue manager   */ @@ -684,8 +672,8 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,  int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, unsigned ring_id);  void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr); -void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr);  void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr); +void amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr);  void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr); @@ -703,37 +691,6 @@ struct amdgpu_fpriv {  };  /* - * residency list - */ -struct amdgpu_bo_list_entry { -	struct amdgpu_bo		*robj; -	struct ttm_validate_buffer	tv; -	struct amdgpu_bo_va		*bo_va; -	uint32_t			priority; -	struct page			**user_pages; -	int				user_invalidated; -}; - -struct amdgpu_bo_list { -	struct mutex lock; -	struct rcu_head rhead; -	struct kref refcount; -	struct amdgpu_bo *gds_obj; -	struct amdgpu_bo *gws_obj; -	struct amdgpu_bo *oa_obj; -	unsigned first_userptr; -	unsigned num_entries; -	struct amdgpu_bo_list_entry *array; -}; - -struct amdgpu_bo_list * -amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id); -void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list, -			     struct list_head *validated); -void amdgpu_bo_list_put(struct amdgpu_bo_list *list); -void amdgpu_bo_list_free(struct amdgpu_bo_list *list); - -/*   * GFX stuff   */  #include "clearstate_defs.h" @@ -931,6 +888,11 @@ struct amdgpu_ngg {  	bool			init;  }; +struct sq_work { +	struct work_struct	work; +	unsigned ih_data; +}; +  struct amdgpu_gfx {  	struct mutex			gpu_clock_mutex;  	struct amdgpu_gfx_config	config; @@ -969,6 +931,10 @@ struct amdgpu_gfx {  	struct amdgpu_irq_src		eop_irq;  	struct amdgpu_irq_src		priv_reg_irq;  	struct amdgpu_irq_src		priv_inst_irq; +	struct amdgpu_irq_src		cp_ecc_error_irq; +	struct amdgpu_irq_src		sq_irq; +	struct sq_work			sq_work; +  	/* gfx status */  	uint32_t			gfx_current_status;  	/* ce ram size*/ @@ -1020,6 +986,7 @@ struct amdgpu_cs_parser {  	/* scheduler job object */  	struct amdgpu_job	*job; +	struct amdgpu_ring	*ring;  	/* buffer objects */  	struct ww_acquire_ctx		ticket; @@ -1041,40 +1008,6 @@ struct amdgpu_cs_parser {  	struct drm_syncobj **post_dep_syncobjs;  }; -#define AMDGPU_PREAMBLE_IB_PRESENT          (1 << 0) /* bit set means command submit involves a preamble IB */ -#define AMDGPU_PREAMBLE_IB_PRESENT_FIRST    (1 << 1) /* bit set means preamble IB is first presented in belonging context */ -#define AMDGPU_HAVE_CTX_SWITCH              (1 << 2) /* bit set means context switch occured */ - -struct amdgpu_job { -	struct drm_sched_job    base; -	struct amdgpu_device	*adev; -	struct amdgpu_vm	*vm; -	struct amdgpu_ring	*ring; -	struct amdgpu_sync	sync; -	struct amdgpu_sync	sched_sync; -	struct amdgpu_ib	*ibs; -	struct dma_fence	*fence; /* the hw fence */ -	uint32_t		preamble_status; -	uint32_t		num_ibs; -	void			*owner; -	uint64_t		fence_ctx; /* the fence_context this job uses */ -	bool                    vm_needs_flush; -	uint64_t		vm_pd_addr; -	unsigned		vmid; -	unsigned		pasid; -	uint32_t		gds_base, gds_size; -	uint32_t		gws_base, gws_size; -	uint32_t		oa_base, oa_size; -	uint32_t		vram_lost_counter; - -	/* user fence handling */ -	uint64_t		uf_addr; -	uint64_t		uf_sequence; - -}; -#define to_amdgpu_job(sched_job)		\ -		container_of((sched_job), struct amdgpu_job, base) -  static inline u32 amdgpu_get_ib_value(struct amdgpu_cs_parser *p,  				      uint32_t ib_idx, int idx)  { @@ -1389,6 +1322,7 @@ enum amd_hw_ip_block_type {  	PWR_HWIP,  	NBIF_HWIP,  	THM_HWIP, +	CLK_HWIP,  	MAX_HWIP  }; @@ -1579,9 +1513,9 @@ struct amdgpu_device {  	DECLARE_HASHTABLE(mn_hash, 7);  	/* tracking pinned memory */ -	u64 vram_pin_size; -	u64 invisible_pin_size; -	u64 gart_pin_size; +	atomic64_t vram_pin_size; +	atomic64_t visible_pin_size; +	atomic64_t gart_pin_size;  	/* amdkfd interface */  	struct kfd_dev          *kfd; @@ -1776,6 +1710,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)  #define amdgpu_vm_write_pte(adev, ib, pe, value, count, incr) ((adev)->vm_manager.vm_pte_funcs->write_pte((ib), (pe), (value), (count), (incr)))  #define amdgpu_vm_set_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->set_pte_pde((ib), (pe), (addr), (count), (incr), (flags)))  #define amdgpu_ring_parse_cs(r, p, ib) ((r)->funcs->parse_cs((p), (ib))) +#define amdgpu_ring_patch_cs_in_place(r, p, ib) ((r)->funcs->patch_cs_in_place((p), (ib)))  #define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r))  #define amdgpu_ring_test_ib(r, t) (r)->funcs->test_ib((r), (t))  #define amdgpu_ring_get_rptr(r) (r)->funcs->get_rptr((r)) @@ -1829,8 +1764,6 @@ void amdgpu_display_update_priority(struct amdgpu_device *adev);  void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,  				  u64 num_vis_bytes); -void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain); -bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);  void amdgpu_device_vram_location(struct amdgpu_device *adev,  				 struct amdgpu_gmc *mc, u64 base);  void amdgpu_device_gart_location(struct amdgpu_device *adev, |