[PATCH 1/2] drm/amdgpu: Disable compute partition switch under SRIOV

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not allow the compute partition mode switch from the guest driver.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 82452606ae6c..722c3fef09a5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -1292,6 +1292,9 @@ static ssize_t amdgpu_gfx_set_compute_partition(struct device *dev,
 	enum amdgpu_gfx_partition mode;
 	int ret = 0, num_xcc;
 
+	if (amdgpu_sriov_vf(adev))
+		return -EINVAL;
+
 	num_xcc = NUM_XCC(adev->gfx.xcc_mask);
 	if (num_xcc % 2 != 0)
 		return -EINVAL;
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux