aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2011-10-25 14:58:49 -0400
committerDave Airlie <airlied@redhat.com>2011-11-03 13:53:00 -0400
commit8f6c25c59b0c895c68cae59d1b34e9a7b36971bc (patch)
tree74809ff94145fb515cdb07a8c321854a9b6b2311
parentcd2b89e7e8c036903e7fa0c3dceca25e755fe78d (diff)
drm/radeon/kms: split MSI check into a separate function
This makes it easier to add quirks for certain systems. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_irq_kms.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 93da85515cd2..91de37a0fde2 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -108,6 +108,27 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
108 radeon_irq_set(rdev); 108 radeon_irq_set(rdev);
109} 109}
110 110
111static bool radeon_msi_ok(struct radeon_device *rdev)
112{
113 /* RV370/RV380 was first asic with MSI support */
114 if (rdev->family < CHIP_RV380)
115 return false;
116
117 /* MSIs don't work on AGP */
118 if (rdev->flags & RADEON_IS_AGP)
119 return false;
120
121 if (rdev->flags & RADEON_IS_IGP) {
122 /* APUs work fine with MSIs */
123 if (rdev->family >= CHIP_PALM)
124 return true;
125 /* lots of IGPs have problems with MSIs */
126 return false;
127 }
128
129 return true;
130}
131
111int radeon_irq_kms_init(struct radeon_device *rdev) 132int radeon_irq_kms_init(struct radeon_device *rdev)
112{ 133{
113 int i; 134 int i;
@@ -124,12 +145,8 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
124 } 145 }
125 /* enable msi */ 146 /* enable msi */
126 rdev->msi_enabled = 0; 147 rdev->msi_enabled = 0;
127 /* MSIs don't seem to work reliably on all IGP 148
128 * chips. Disable MSI on them for now. 149 if (radeon_msi_ok(rdev)) {
129 */
130 if ((rdev->family >= CHIP_RV380) &&
131 ((!(rdev->flags & RADEON_IS_IGP)) || (rdev->family >= CHIP_PALM)) &&
132 (!(rdev->flags & RADEON_IS_AGP))) {
133 int ret = pci_enable_msi(rdev->pdev); 150 int ret = pci_enable_msi(rdev->pdev);
134 if (!ret) { 151 if (!ret) {
135 rdev->msi_enabled = 1; 152 rdev->msi_enabled = 1;