[PATCH] drm/amdgpu/sriov: omit fbcon error under sriov or passthrough

Jack Zhang Jack.Zhang1 at amd.com
Wed Sep 18 07:24:45 UTC 2019


In virtual machine, there would be a qxl or cirrus
graphics device as the default master fbcon device.

So for PF(passthrough mode) or SRIOV VF, it is reasonable
to unload amdgpu driver. Amdgpu doesn't have to be the
only fbcon device under this condition.

Signed-off-by: Jack Zhang <Jack.Zhang1 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 420888e..ada2b25 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1103,8 +1103,9 @@ static void
 amdgpu_pci_remove(struct pci_dev *pdev)
 {
 	struct drm_device *dev = pci_get_drvdata(pdev);
-
-	DRM_ERROR("Device removal is currently not supported outside of fbcon\n");
+	struct amdgpu_device *adev = dev->dev_private;
+	if (!amdgpu_sriov_vf(adev) && !amdgpu_passthrough(adev))
+		DRM_ERROR("Device removal is currently not supported outside of fbcon\n");
 	drm_dev_unplug(dev);
 	drm_dev_put(dev);
 	pci_disable_device(pdev);
-- 
2.7.4



More information about the amd-gfx mailing list