diff options
| author | Wenhui Sheng <Wenhui.Sheng@amd.com> | 2020-06-23 11:35:05 +0800 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-02 12:02:50 -0400 | 
| commit | c1299461b7d68eed457478ddf3e93bbd89e5c3ca (patch) | |
| tree | 2b260fc0942bff3730c35dcbbaa1b06dedfee17f /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | |
| parent | 81659b2022cbdd7491f9480ab15afd38b91281d5 (diff) | |
drm/amdgpu: request init data in virt detection
Move request init data to virt detection func, so we
can insert request full access between request init data
and set ip blocks.
Signed-off-by: Wenhui Sheng <Wenhui.Sheng@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 28 | 
1 files changed, 28 insertions, 0 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c index da233a9e429d..1203c20491e6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c @@ -27,6 +27,9 @@  #include "amdgpu.h"  #include "amdgpu_ras.h" +#include "vi.h" +#include "soc15.h" +#include "nv.h"  bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev)  { @@ -513,6 +516,31 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)  		if (is_virtual_machine())	/* passthrough mode exclus sriov mod */  			adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;  	} + +	/* we have the ability to check now */ +	if (amdgpu_sriov_vf(adev)) { +		switch (adev->asic_type) { +		case CHIP_TONGA: +		case CHIP_FIJI: +			vi_set_virt_ops(adev); +			break; +		case CHIP_VEGA10: +		case CHIP_VEGA20: +		case CHIP_ARCTURUS: +			soc15_set_virt_ops(adev); +			break; +		case CHIP_NAVI10: +		case CHIP_NAVI12: +		case CHIP_SIENNA_CICHLID: +			nv_set_virt_ops(adev); +			/* try send GPU_INIT_DATA request to host */ +			amdgpu_virt_request_init_data(adev); +			break; +		default: /* other chip doesn't support SRIOV */ +			DRM_ERROR("Unknown asic type: %d!\n", adev->asic_type); +			break; +		} +	}  }  static bool amdgpu_virt_access_debugfs_is_mmio(struct amdgpu_device *adev) | 
