drm/radeon/kms: split MSI check into a separate function
Subsystems (2)
PATCH 1/4 drm/radeon/kms: split MSI check into a separate function
From: Alex Deucher <[email protected]>
This makes it easier to add quirks for certain systems.
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_irq_kms.c +23 -6
@@ -108,6 +108,27 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)radeon_irq_set (rdev); } +static bool radeon_msi_ok (struct radeon_device *rdev) +{ +/* RV370/RV380 was first asic with MSI support */ +if (rdev->family <CHIP_RV380 ) +return false; + +/* MSIs don't work on AGP */ +if (rdev->flags &RADEON_IS_AGP ) +return false; + +if (rdev->flags &RADEON_IS_IGP ) { +/* APUs work fine with MSIs */ +if (rdev->family >=CHIP_PALM ) +return true; +/* lots of IGPs have problems with MSIs */ +return false; + } + +return true; +} +int radeon_irq_kms_init (struct radeon_device *rdev) {int i;
@@ -124,12 +145,8 @@ int radeon_irq_kms_init(struct radeon_device *rdev) }/* enable msi */ rdev->msi_enabled =0 ; -/* MSIs don't seem to work reliably on all IGP -* chips. Disable MSI on them for now. -*/ -if ((rdev->family >=CHIP_RV380 ) && - ((!(rdev->flags &RADEON_IS_IGP )) || (rdev->family >=CHIP_PALM )) && - (!(rdev->flags &RADEON_IS_AGP ))) { + +if (radeon_msi_ok (rdev)) {int ret =pci_enable_msi (rdev->pdev);if (!ret) { rdev->msi_enabled =1 ;
Signature · 1 line
1.7.3.4
PATCH 2/4 drm/radeon/kms: Add MSI quirk for HP RS690
From: Alex Deucher <[email protected]>
Some HP laptops only seem to work with MSIs. This looks like a platform/bios bug.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37679
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_irq_kms.c +7 -0
@@ -118,6 +118,13 @@ static bool radeon_msi_ok(struct radeon_device *rdev)if (rdev->flags &RADEON_IS_AGP )return false; +/* Quirks */ +/* HP RS690 only seems to work with MSIs. */ +if ((rdev->pdev->device ==0x791f ) && + (rdev->pdev->subsystem_vendor ==0x103c ) && + (rdev->pdev->subsystem_device ==0x30c2 )) +return true; +if (rdev->flags &RADEON_IS_IGP ) {/* APUs work fine with MSIs */ if (rdev->family >=CHIP_PALM )
Signature · 1 line
1.7.3.4
PATCH 3/4 drm/radeon/kms: Add MSI quirk for Dell RS690
In reply to [email protected]From: Alex Deucher <[email protected]>
Some Dell laptops only seem to work with MSIs. This looks like a platform/bios bug.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37679
--- drivers/gpu/drm/radeon/radeon_irq_kms.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_irq_kms.c +6 -0
@@ -125,6 +125,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev) (rdev->pdev->subsystem_device == 0x30c2))return true; +/* Dell RS690 only seems to work with MSIs. */ +if ((rdev->pdev->device ==0x791f ) && + (rdev->pdev->subsystem_vendor ==0x1028 ) && + (rdev->pdev->subsystem_device ==0x01fd )) +return true; +if (rdev->flags &RADEON_IS_IGP ) {/* APUs work fine with MSIs */ if (rdev->family >=CHIP_PALM )
Signature · 1 line
1.7.3.4
PATCH 4/4 drm/radeon/kms: add MSI module parameter
In reply to [email protected]From: Alex Deucher <[email protected]>
Allow the user to override whether MSIs are enabled or not on supported ASICs. MSIs are disabled by default on IGP chips as they tend not to work. However certain IGP chips only seem to work with MSIs enabled.
I suspect this is a chipset or bios issue, but I'm not sure what the proper fix is. This will at least make diagnosing and working around the problem much easier.
See:
https://bugs.freedesktop.org/show_bug.cgi?id=37679
--- drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_drv.c | 4 ++++ drivers/gpu/drm/radeon/radeon_irq_kms.c | 6 ++++++ 3 files changed, 11 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon.h +1 -0
@@ -93,6 +93,7 @@ extern int radeon_audio;extern int radeon_disp_priority;extern int radeon_hw_i2c;extern int radeon_pcie_gen2; +extern int radeon_msi;/* * Copy from radeon_drv.h so we don't have to include both and have conflicting
drivers/gpu/drm/radeon/radeon_drv.c +4 -0
@@ -118,6 +118,7 @@ int radeon_audio = 0;int radeon_disp_priority =0 ;int radeon_hw_i2c =0 ;int radeon_pcie_gen2 =0 ; +int radeon_msi =-1 ;MODULE_PARM_DESC (no_wb,"Disable AGP writeback for scratch registers" );module_param_named (no_wb, radeon_no_wb, int,0444 );
@@ -164,6 +165,9 @@ module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);MODULE_PARM_DESC (pcie_gen2,"PCIE Gen2 mode (1 = enable)" );module_param_named (pcie_gen2, radeon_pcie_gen2, int,0444 ); +MODULE_PARM_DESC (msi,"MSI support (1 = enable, 0 = disable, -1 = auto)" ); +module_param_named (msi, radeon_msi, int,0444 ); +static int radeon_suspend (struct drm_device *dev,pm_message_t state) {drm_radeon_private_t *dev_priv = dev->dev_private;
drivers/gpu/drm/radeon/radeon_irq_kms.c +6 -0
@@ -118,6 +118,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev)if (rdev->flags &RADEON_IS_AGP )return false; +/* force MSI on */ +if (radeon_msi ==1 ) +return true; +else if (radeon_msi ==0 ) +return false; +/* Quirks */ /* HP RS690 only seems to work with MSIs. */ if ((rdev->pdev->device == 0x791f) &&
Signature · 1 line
1.7.3.4