Skip to content

Commit 130dca4

Browse files
committed
Enable Message Signaled Interrupts (MSI)
This fixes ridiculous interrupt rate on aarch64, was enabled in the legacy in-tree drm port, and is a good idea in general.
1 parent 1d1a81b commit 130dca4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
#endif
6161

6262
#define AMDGPU_WAIT_IDLE_TIMEOUT 200
63-
#define pci_enable_msi linux_pci_enable_msi
64-
#define pci_disable_msi linux_pci_disable_msi
6563

6664
/**
6765
* amdgpu_hotplug_work_func - work handler for display hotplug event
@@ -218,7 +216,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
218216
adev->irq.msi_enabled = false;
219217

220218
if (amdgpu_msi_ok(adev)) {
221-
#ifdef __linux__
219+
#if defined(__linux__) || defined(pci_enable_msi)
222220
int ret = pci_enable_msi(adev->pdev);
223221
if (!ret) {
224222
adev->irq.msi_enabled = true;
@@ -272,7 +270,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
272270
if (adev->irq.installed) {
273271
drm_irq_uninstall(adev->ddev);
274272
adev->irq.installed = false;
275-
#ifdef __linux__
273+
#if defined(__linux__) || defined(pci_disable_msi)
276274
if (adev->irq.msi_enabled)
277275
pci_disable_msi(adev->pdev);
278276
#endif

drivers/gpu/drm/i915/i915_drv.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
15551555
intel_gt_init_workarounds(dev_priv);
15561556
i915_gem_load_init_fences(dev_priv);
15571557

1558-
#ifdef __linux__
1558+
#if defined(__linux__) || defined(pci_enable_msi)
15591559
/* On the 945G/GM, the chipset reports the MSI capability on the
15601560
* integrated graphics even though the support isn't actually there
15611561
* according to the published specs. It doesn't appear to function
@@ -1596,7 +1596,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
15961596
return 0;
15971597

15981598
err_msi:
1599-
#ifdef __linux__
1599+
#if defined(__linux__) || defined(pci_disable_msi)
16001600
if (pdev->msi_enabled)
16011601
pci_disable_msi(pdev);
16021602
#endif
@@ -1616,11 +1616,13 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
16161616
*/
16171617
static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)
16181618
{
1619-
#ifdef __linux__
16201619
struct pci_dev *pdev = dev_priv->drm.pdev;
16211620

1621+
#ifdef CONFIG_I915_PERF
16221622
i915_perf_fini(dev_priv);
1623+
#endif
16231624

1625+
#if defined(__linux__) || defined(pci_disable_msi)
16241626
if (pdev->msi_enabled)
16251627
pci_disable_msi(pdev);
16261628
#endif

drivers/gpu/drm/radeon/radeon_irq_kms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
298298
rdev->msi_enabled = 0;
299299

300300
if (radeon_msi_ok(rdev)) {
301-
#ifdef __linux__
301+
#if defined(__linux__) || defined(pci_enable_msi)
302302
int ret = pci_enable_msi(rdev->pdev);
303303
if (!ret) {
304304
rdev->msi_enabled = 1;
@@ -335,7 +335,7 @@ void radeon_irq_kms_fini(struct radeon_device *rdev)
335335
if (rdev->irq.installed) {
336336
drm_irq_uninstall(rdev->ddev);
337337
rdev->irq.installed = false;
338-
#ifdef __linux__
338+
#if defined(__linux__) || defined(pci_disable_msi)
339339
if (rdev->msi_enabled)
340340
pci_disable_msi(rdev->pdev);
341341
#endif

0 commit comments

Comments
 (0)