summaryrefslogtreecommitdiffstats
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)
downloadlinux-7e471e6fbab8a50bb2f5ea5db419b9499f603206.tar.bz2
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);
void amdgpu_cgs_destroy_device(void *cgs_device);
+/* GPU virtualization */
+struct amdgpu_virtualization {
+ bool supports_sr_iov;
+};
+
/*
* Core structure, functions and helpers.
*/
@@ -2071,6 +2076,8 @@ struct amdgpu_device {
/* kernel conext for IB submission */
struct amdgpu_ctx kernel_ctx;
+
+ struct amdgpu_virtualization virtualization;
};
bool 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,
return r;
}
+ /* See if the asic supports SR-IOV */
+ adev->virtualization.supports_sr_iov =
+ amdgpu_atombios_has_gpu_virtualization_table(adev);
+
/* Post card if necessary */
if (!amdgpu_card_posted(adev)) {
if (!adev->bios) {