[PATCH] drm/amdgpu : enable msix for amdgpu driver

Deucher, Alexander Alexander.Deucher at amd.com
Tue Oct 1 20:24:58 UTC 2019


Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Liu, Shaoyun <Shaoyun.Liu at amd.com>
Sent: Tuesday, October 1, 2019 4:03 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Liu, Shaoyun <Shaoyun.Liu at amd.com>
Subject: [PATCH] drm/amdgpu : enable msix for amdgpu driver

We might used out of the msi resources in some cloud project
which have a lot gpu devices(including PF and VF), msix can
provide enough resources from system level view

Change-Id: I9f03762074ac416c07f27b8f00c052ca93c7d6cb
Signed-off-by: shaoyunl <shaoyun.liu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index d1d5e7f..1bd27ea 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -245,8 +245,9 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
         adev->irq.msi_enabled = false;

         if (amdgpu_msi_ok(adev)) {
-               int ret = pci_enable_msi(adev->pdev);
-               if (!ret) {
+               int nvec = pci_alloc_irq_vectors(adev->pdev, 1, pci_msix_vec_count(adev->pdev),
+                                       PCI_IRQ_MSI | PCI_IRQ_MSIX)
+               if (nvec > 0) {
                         adev->irq.msi_enabled = true;
                         dev_dbg(adev->dev, "amdgpu: using MSI.\n");
                 }
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20191001/f886e0d1/attachment.html>


More information about the amd-gfx mailing list