diff options
| author | Dmitry Torokhov <[email protected]> | 2023-02-21 11:19:49 -0800 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-02-21 11:19:49 -0800 | 
| commit | 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18 (patch) | |
| tree | dbdd35328f43569c38c4ce193cefd7d2b6b9fbfd /drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | |
| parent | 9c445d2637c938a800fcc8b5f0b10e60c94460c7 (diff) | |
| parent | 9e69e845ae95227949c400af1037dca023f73038 (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.3 merge window.
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 31 | 
1 files changed, 23 insertions, 8 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c index 846ccb6cf07d..4326078689cd 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c @@ -186,6 +186,10 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,  	/* Use register 17 for GART */  	const unsigned eng = 17;  	unsigned int i; +	unsigned char hub_ip = 0; + +	hub_ip = (vmhub == AMDGPU_GFXHUB_0) ? +		   GC_HWIP : MMHUB_HWIP;  	spin_lock(&adev->gmc.invalidate_lock);  	/* @@ -199,8 +203,8 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,  	if (use_semaphore) {  		for (i = 0; i < adev->usec_timeout; i++) {  			/* a read return value of 1 means semaphore acuqire */ -			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + -					    hub->eng_distance * eng); +			tmp = RREG32_RLC_NO_KIQ(hub->vm_inv_eng0_sem + +					    hub->eng_distance * eng, hub_ip);  			if (tmp & 0x1)  				break;  			udelay(1); @@ -210,12 +214,12 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,  			DRM_ERROR("Timeout waiting for sem acquire in VM flush!\n");  	} -	WREG32_NO_KIQ(hub->vm_inv_eng0_req + hub->eng_distance * eng, inv_req); +	WREG32_RLC_NO_KIQ(hub->vm_inv_eng0_req + hub->eng_distance * eng, inv_req, hub_ip);  	/* Wait for ACK with a delay.*/  	for (i = 0; i < adev->usec_timeout; i++) { -		tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack + -				    hub->eng_distance * eng); +		tmp = RREG32_RLC_NO_KIQ(hub->vm_inv_eng0_ack + +				    hub->eng_distance * eng, hub_ip);  		tmp &= 1 << vmid;  		if (tmp)  			break; @@ -229,8 +233,8 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,  		 * add semaphore release after invalidation,  		 * write with 0 means semaphore release  		 */ -		WREG32_NO_KIQ(hub->vm_inv_eng0_sem + -			      hub->eng_distance * eng, 0); +		WREG32_RLC_NO_KIQ(hub->vm_inv_eng0_sem + +			      hub->eng_distance * eng, 0, hub_ip);  	/* Issue additional private vm invalidation to MMHUB */  	if ((vmhub != AMDGPU_GFXHUB_0) && @@ -499,6 +503,8 @@ static void gmc_v11_0_get_vm_pte(struct amdgpu_device *adev,  				 struct amdgpu_bo_va_mapping *mapping,  				 uint64_t *flags)  { +	struct amdgpu_bo *bo = mapping->bo_va->base.bo; +  	*flags &= ~AMDGPU_PTE_EXECUTABLE;  	*flags |= mapping->flags & AMDGPU_PTE_EXECUTABLE; @@ -515,6 +521,11 @@ static void gmc_v11_0_get_vm_pte(struct amdgpu_device *adev,  		*flags |= AMDGPU_PTE_SYSTEM;  		*flags &= ~AMDGPU_PTE_VALID;  	} + +	if (bo && bo->flags & (AMDGPU_GEM_CREATE_COHERENT | +			       AMDGPU_GEM_CREATE_UNCACHED)) +		*flags = (*flags & ~AMDGPU_PTE_MTYPE_NV10_MASK) | +			 AMDGPU_PTE_MTYPE_NV10(MTYPE_UC);  }  static unsigned gmc_v11_0_get_vbios_fb_size(struct amdgpu_device *adev) @@ -547,7 +558,10 @@ static void gmc_v11_0_set_umc_funcs(struct amdgpu_device *adev)  		adev->umc.node_inst_num = adev->gmc.num_umc;  		adev->umc.max_ras_err_cnt_per_query = UMC_V8_10_TOTAL_CHANNEL_NUM(adev);  		adev->umc.channel_offs = UMC_V8_10_PER_CHANNEL_OFFSET; -		adev->umc.channel_idx_tbl = &umc_v8_10_channel_idx_tbl[0][0][0]; +		if (adev->umc.node_inst_num == 4) +			adev->umc.channel_idx_tbl = &umc_v8_10_channel_idx_tbl_ext0[0][0][0]; +		else +			adev->umc.channel_idx_tbl = &umc_v8_10_channel_idx_tbl[0][0][0];  		adev->umc.ras = &umc_v8_10_ras;  		break;  	case IP_VERSION(8, 11, 0): @@ -745,6 +759,7 @@ static int gmc_v11_0_sw_init(void *handle)  	case IP_VERSION(11, 0, 1):  	case IP_VERSION(11, 0, 2):  	case IP_VERSION(11, 0, 3): +	case IP_VERSION(11, 0, 4):  		adev->num_vmhubs = 2;  		/*  		 * To fulfill 4-level page support, |