Skip to content

Enable Message Signaled Interrupts (MSI) #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
#endif

#define AMDGPU_WAIT_IDLE_TIMEOUT 200
#define pci_enable_msi linux_pci_enable_msi
#define pci_disable_msi linux_pci_disable_msi

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

if (amdgpu_msi_ok(adev)) {
#ifdef __linux__
#if defined(__linux__) || defined(pci_enable_msi)
int ret = pci_enable_msi(adev->pdev);
if (!ret) {
adev->irq.msi_enabled = true;
Expand Down Expand Up @@ -272,7 +270,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
if (adev->irq.installed) {
drm_irq_uninstall(adev->ddev);
adev->irq.installed = false;
#ifdef __linux__
#if defined(__linux__) || defined(pci_disable_msi)
if (adev->irq.msi_enabled)
pci_disable_msi(adev->pdev);
#endif
Expand Down
10 changes: 7 additions & 3 deletions drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
intel_gt_init_workarounds(dev_priv);
i915_gem_load_init_fences(dev_priv);

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

err_msi:
#ifdef __linux__
#if defined(__linux__) || defined(pci_disable_msi)
if (pdev->msi_enabled)
pci_disable_msi(pdev);
#endif
Expand All @@ -1616,11 +1616,15 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
*/
static void i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)
{
#ifdef __linux__
#if defined(__linux__) || defined(pci_disable_msi)
struct pci_dev *pdev = dev_priv->drm.pdev;
#endif

#ifdef CONFIG_I915_PERF
i915_perf_fini(dev_priv);
#endif

#if defined(__linux__) || defined(pci_disable_msi)
if (pdev->msi_enabled)
pci_disable_msi(pdev);
#endif
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/radeon/radeon_irq_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
rdev->msi_enabled = 0;

if (radeon_msi_ok(rdev)) {
#ifdef __linux__
#if defined(__linux__) || defined(pci_enable_msi)
int ret = pci_enable_msi(rdev->pdev);
if (!ret) {
rdev->msi_enabled = 1;
Expand Down Expand Up @@ -335,7 +335,7 @@ void radeon_irq_kms_fini(struct radeon_device *rdev)
if (rdev->irq.installed) {
drm_irq_uninstall(rdev->ddev);
rdev->irq.installed = false;
#ifdef __linux__
#if defined(__linux__) || defined(pci_disable_msi)
if (rdev->msi_enabled)
pci_disable_msi(rdev->pdev);
#endif
Expand Down