diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 34 | 
1 files changed, 30 insertions, 4 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h index aa0c83776ce0..9d11c02a3938 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h @@ -135,6 +135,14 @@ struct amdgpu_gmc_funcs {  	unsigned int (*get_vbios_fb_size)(struct amdgpu_device *adev);  }; +struct amdgpu_xgmi_ras_funcs { +	int (*ras_late_init)(struct amdgpu_device *adev); +	void (*ras_fini)(struct amdgpu_device *adev); +	int (*query_ras_error_count)(struct amdgpu_device *adev, +				     void *ras_error_status); +	void (*reset_ras_error_count)(struct amdgpu_device *adev); +}; +  struct amdgpu_xgmi {  	/* from psp */  	u64 node_id; @@ -149,6 +157,9 @@ struct amdgpu_xgmi {  	struct list_head head;  	bool supported;  	struct ras_common_if *ras_if; +	bool connected_to_cpu; +	bool pending_reset; +	const struct amdgpu_xgmi_ras_funcs *ras_funcs;  };  struct amdgpu_gmc { @@ -189,10 +200,13 @@ struct amdgpu_gmc {  	u64			gart_end;  	/* Frame buffer aperture of this GPU device. Different from  	 * fb_start (see below), this only covers the local GPU device. -	 * Driver get fb_start from MC_VM_FB_LOCATION_BASE (set by vbios) -	 * and calculate vram_start of this local device by adding an -	 * offset inside the XGMI hive. -	 * Under VMID0, logical address == MC address +	 * If driver uses FB aperture to access FB, driver get fb_start from +	 * MC_VM_FB_LOCATION_BASE (set by vbios) and calculate vram_start +	 * of this local device by adding an offset inside the XGMI hive. +	 * If driver uses GART table for VMID0 FB access, driver finds a hole in +	 * VMID0's virtual address space to place the SYSVM aperture inside +	 * which the first part is vram and the second part is gart (covering +	 * system ram).  	 */  	u64			vram_start;  	u64			vram_end; @@ -240,6 +254,12 @@ struct amdgpu_gmc {  	struct amdgpu_xgmi xgmi;  	struct amdgpu_irq_src	ecc_irq;  	int noretry; + +	uint32_t	vmid0_page_table_block_size; +	uint32_t	vmid0_page_table_depth; +	struct amdgpu_bo		*pdb0_bo; +	/* CPU kmapped address of pdb0*/ +	void				*ptr_pdb0;  };  #define amdgpu_gmc_flush_gpu_tlb(adev, vmid, vmhub, type) ((adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid), (vmhub), (type))) @@ -281,6 +301,7 @@ static inline uint64_t amdgpu_gmc_sign_extend(uint64_t addr)  	return addr;  } +int amdgpu_gmc_pdb0_alloc(struct amdgpu_device *adev);  void amdgpu_gmc_get_pde_for_bo(struct amdgpu_bo *bo, int level,  			       uint64_t *addr, uint64_t *flags);  int amdgpu_gmc_set_pte_pde(struct amdgpu_device *adev, void *cpu_pt_addr, @@ -288,6 +309,7 @@ int amdgpu_gmc_set_pte_pde(struct amdgpu_device *adev, void *cpu_pt_addr,  				uint64_t flags);  uint64_t amdgpu_gmc_pd_addr(struct amdgpu_bo *bo);  uint64_t amdgpu_gmc_agp_addr(struct ttm_buffer_object *bo); +void amdgpu_gmc_sysvm_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc);  void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc,  			      u64 base);  void amdgpu_gmc_gart_location(struct amdgpu_device *adev, @@ -309,4 +331,8 @@ amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type,  void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev); +void amdgpu_gmc_init_pdb0(struct amdgpu_device *adev); +uint64_t amdgpu_gmc_vram_mc2pa(struct amdgpu_device *adev, uint64_t mc_addr); +uint64_t amdgpu_gmc_vram_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo); +uint64_t amdgpu_gmc_vram_cpu_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo);  #endif | 
