[PATCH] drm/amdgpu: only register VGA devices with the VGA arbiter

Xu, Feifei Feifei.Xu at amd.com
Fri Nov 20 15:04:53 UTC 2020


[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Feifei Xu <Feifei.Xu at amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Friday, November 20, 2020 10:55 PM
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: [PATCH] drm/amdgpu: only register VGA devices with the VGA arbiter

We only need to arbitrate VGA access on VGA compatible devices.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2f60b7084f4d..2670fb113ba1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3346,7 +3346,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 /* if we have > 1 VGA cards, then disable the amdgpu VGA resources */
 /* this will fail for cards that aren't VGA class devices, just
  * ignore it */
-vga_client_register(adev->pdev, adev, NULL, amdgpu_device_vga_set_decode);
+if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
+vga_client_register(adev->pdev, adev, NULL, amdgpu_device_vga_set_decode);

 if (amdgpu_device_supports_boco(ddev))
 boco = true;
@@ -3605,7 +3606,8 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
 vga_switcheroo_unregister_client(adev->pdev);
 if (amdgpu_device_supports_boco(adev_to_drm(adev)))
 vga_switcheroo_fini_domain_pm_ops(adev->dev);
-vga_client_register(adev->pdev, NULL, NULL, NULL);
+if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
+vga_client_register(adev->pdev, NULL, NULL, NULL);
 if (adev->rio_mem)
 pci_iounmap(adev->pdev, adev->rio_mem);
 adev->rio_mem = NULL;
--
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CFeifei.Xu%40amd.com%7C8eac65802c2841a4016408d88d645737%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637414809390017528%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4YGYTXm%2FY8MAQiqs4QJ1MUIcy2%2F4waucDrIeob63ogk%3D&reserved=0


More information about the amd-gfx mailing list