aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-02-01 11:13:04 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-02-10 14:17:11 -0500
commit7e471e6fbab8a50bb2f5ea5db419b9499f603206 (patch)
treefe4f840598ff1aec88b784ce8b2d9cab57f5b351 /drivers/gpu/drm/amd/amdgpu
parente74adf2039f98a30865ea7ef98689007c241c995 (diff)
drm/amdgpu: track whether the asic supports SR-IOV
Required to make desicions about certain code pathes. Reviewed-by: Monk Liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h7
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 811353c3f131..f2f9b64d0141 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1898,6 +1898,11 @@ void *amdgpu_cgs_create_device(struct amdgpu_device *adev);
1898void amdgpu_cgs_destroy_device(void *cgs_device); 1898void amdgpu_cgs_destroy_device(void *cgs_device);
1899 1899
1900 1900
1901/* GPU virtualization */
1902struct amdgpu_virtualization {
1903 bool supports_sr_iov;
1904};
1905
1901/* 1906/*
1902 * Core structure, functions and helpers. 1907 * Core structure, functions and helpers.
1903 */ 1908 */
@@ -2071,6 +2076,8 @@ struct amdgpu_device {
2071 2076
2072 /* kernel conext for IB submission */ 2077 /* kernel conext for IB submission */
2073 struct amdgpu_ctx kernel_ctx; 2078 struct amdgpu_ctx kernel_ctx;
2079
2080 struct amdgpu_virtualization virtualization;
2074}; 2081};
2075 2082
2076bool amdgpu_device_is_px(struct drm_device *dev); 2083bool amdgpu_device_is_px(struct drm_device *dev);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 4132e4ef9f83..00f3a16333cc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1500,6 +1500,10 @@ int amdgpu_device_init(struct amdgpu_device *adev,
1500 return r; 1500 return r;
1501 } 1501 }
1502 1502
1503 /* See if the asic supports SR-IOV */
1504 adev->virtualization.supports_sr_iov =
1505 amdgpu_atombios_has_gpu_virtualization_table(adev);
1506
1503 /* Post card if necessary */ 1507 /* Post card if necessary */
1504 if (!amdgpu_card_posted(adev)) { 1508 if (!amdgpu_card_posted(adev)) {
1505 if (!adev->bios) { 1509 if (!adev->bios) {