]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/amdgpu: only register VGA devices with the VGA arbiter
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 20 Nov 2020 14:53:55 +0000 (09:53 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Nov 2020 17:04:43 +0000 (12:04 -0500)
We only need to arbitrate VGA access on VGA compatible devices.

Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 5b5ca0e138489bb5dd8d0514063ea319b76d75fe..79dd85f71fabc6d0604e5e5d7808a99f1372d120 100644 (file)
@@ -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;