diff options
author | Andres Rodriguez <andres.rodriguez@amd.com> | 2016-06-11 02:51:32 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-06-13 15:25:20 -0400 |
commit | 048765ad5af7c8939603b4c6cb96293ffa05e00d (patch) | |
tree | 5c5218841c6f789c0ae22e67f64dd2182cf2a58c /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | 9ef8537e68941d858924a3eacee5a1945767cbab (diff) |
amdgpu: fix asic initialization for virtualized environments (v2)
When executing in a PCI passthrough based virtuzliation environemnt, the
hypervisor will usually attempt to send a PCIe bus reset signal to the
ASIC when the VM reboots. In this scenario, the card is not correctly
initialized, but we still consider it to be posted. Therefore, in a
passthrough based environemnt we should always post the card to guarantee
it is in a good state for driver initialization.
However, if we are operating in SR-IOV mode it is up to the GIM driver
to manage the asic state, therefore we should not post the card (and
shouldn't be able to do it either).
v2: add missing semi-colon
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Andres Rodriguez <andres.rodriguez@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 01c36b8d6222..70af26d97d28 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1822,6 +1822,8 @@ struct amdgpu_asic_funcs { | |||
1822 | /* MM block clocks */ | 1822 | /* MM block clocks */ |
1823 | int (*set_uvd_clocks)(struct amdgpu_device *adev, u32 vclk, u32 dclk); | 1823 | int (*set_uvd_clocks)(struct amdgpu_device *adev, u32 vclk, u32 dclk); |
1824 | int (*set_vce_clocks)(struct amdgpu_device *adev, u32 evclk, u32 ecclk); | 1824 | int (*set_vce_clocks)(struct amdgpu_device *adev, u32 evclk, u32 ecclk); |
1825 | /* query virtual capabilities */ | ||
1826 | u32 (*get_virtual_caps)(struct amdgpu_device *adev); | ||
1825 | }; | 1827 | }; |
1826 | 1828 | ||
1827 | /* | 1829 | /* |
@@ -1916,8 +1918,12 @@ void amdgpu_cgs_destroy_device(struct cgs_device *cgs_device); | |||
1916 | 1918 | ||
1917 | 1919 | ||
1918 | /* GPU virtualization */ | 1920 | /* GPU virtualization */ |
1921 | #define AMDGPU_VIRT_CAPS_SRIOV_EN (1 << 0) | ||
1922 | #define AMDGPU_VIRT_CAPS_IS_VF (1 << 1) | ||
1919 | struct amdgpu_virtualization { | 1923 | struct amdgpu_virtualization { |
1920 | bool supports_sr_iov; | 1924 | bool supports_sr_iov; |
1925 | bool is_virtual; | ||
1926 | u32 caps; | ||
1921 | }; | 1927 | }; |
1922 | 1928 | ||
1923 | /* | 1929 | /* |
@@ -2206,6 +2212,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring) | |||
2206 | #define amdgpu_asic_get_xclk(adev) (adev)->asic_funcs->get_xclk((adev)) | 2212 | #define amdgpu_asic_get_xclk(adev) (adev)->asic_funcs->get_xclk((adev)) |
2207 | #define amdgpu_asic_set_uvd_clocks(adev, v, d) (adev)->asic_funcs->set_uvd_clocks((adev), (v), (d)) | 2213 | #define amdgpu_asic_set_uvd_clocks(adev, v, d) (adev)->asic_funcs->set_uvd_clocks((adev), (v), (d)) |
2208 | #define amdgpu_asic_set_vce_clocks(adev, ev, ec) (adev)->asic_funcs->set_vce_clocks((adev), (ev), (ec)) | 2214 | #define amdgpu_asic_set_vce_clocks(adev, ev, ec) (adev)->asic_funcs->set_vce_clocks((adev), (ev), (ec)) |
2215 | #define amdgpu_asic_get_virtual_caps(adev) ((adev)->asic_funcs->get_virtual_caps((adev))) | ||
2209 | #define amdgpu_asic_get_gpu_clock_counter(adev) (adev)->asic_funcs->get_gpu_clock_counter((adev)) | 2216 | #define amdgpu_asic_get_gpu_clock_counter(adev) (adev)->asic_funcs->get_gpu_clock_counter((adev)) |
2210 | #define amdgpu_asic_read_disabled_bios(adev) (adev)->asic_funcs->read_disabled_bios((adev)) | 2217 | #define amdgpu_asic_read_disabled_bios(adev) (adev)->asic_funcs->read_disabled_bios((adev)) |
2211 | #define amdgpu_asic_read_bios_from_rom(adev, b, l) (adev)->asic_funcs->read_bios_from_rom((adev), (b), (l)) | 2218 | #define amdgpu_asic_read_bios_from_rom(adev, b, l) (adev)->asic_funcs->read_bios_from_rom((adev), (b), (l)) |