diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 07:40:51 -0700 | 
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 07:40:51 -0700 | 
| commit | bc71c2df45e5a861818b5ee173702883df07471a (patch) | |
| tree | cd008493efad9dc936d0d2574f26dc6c9c7cb785 /drivers/gpu/drm/amd/amdgpu/vi.c | |
| parent | 76d15c8fba655c9b2d60cf01834858f2c44483dc (diff) | |
| parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) | |
Merge 4.7-rc4 into usb-next
We need the 4.7-rc4 fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vi.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vi.c | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 2c88d0b66cf3..a65c96029476 100644 --- a/drivers/gpu/drm/amd/amdgpu/vi.c +++ b/drivers/gpu/drm/amd/amdgpu/vi.c @@ -421,6 +421,20 @@ static bool vi_read_bios_from_rom(struct amdgpu_device *adev,  	return true;  } +static u32 vi_get_virtual_caps(struct amdgpu_device *adev) +{ +	u32 caps = 0; +	u32 reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER); + +	if (REG_GET_FIELD(reg, BIF_IOV_FUNC_IDENTIFIER, IOV_ENABLE)) +		caps |= AMDGPU_VIRT_CAPS_SRIOV_EN; + +	if (REG_GET_FIELD(reg, BIF_IOV_FUNC_IDENTIFIER, FUNC_IDENTIFIER)) +		caps |= AMDGPU_VIRT_CAPS_IS_VF; + +	return caps; +} +  static const struct amdgpu_allowed_register_entry tonga_allowed_read_registers[] = {  	{mmGB_MACROTILE_MODE7, true},  }; @@ -1118,6 +1132,7 @@ static const struct amdgpu_asic_funcs vi_asic_funcs =  	.get_xclk = &vi_get_xclk,  	.set_uvd_clocks = &vi_set_uvd_clocks,  	.set_vce_clocks = &vi_set_vce_clocks, +	.get_virtual_caps = &vi_get_virtual_caps,  	/* these should be moved to their own ip modules */  	.get_gpu_clock_counter = &gfx_v8_0_get_gpu_clock_counter,  	.wait_for_mc_idle = &gmc_v8_0_mc_wait_for_idle,  | 
