This patch addresses an issue that's been bugging me for some time.
Some models of radeon hardware are supported by KMS while others are not.
The radeon driver doesn't have any way of determining which adapters to
enable KMS on or not and it just enables or disables it universally.
This patch adds the PCI ID table from the radeonhd X.org driver to the
radeon KMS code to determine on a per-adapter basis which devices should
have KMS enabled on them.
For example, my workstation is a Thinkpad T60p from several years ago that
has: ATI Technologies Inc M56GL [Mobility FireGL V5250]. Neither the
radeon or radeonhd X.org driver work properly with KMS enabled on this
hardware.
Since I presume that the radeon driver works on at least *some* KMS-enabled
adapters, I chose to use a blacklist rather than just turn it off
universally.
This blacklist will need to be updated periodically to reflect the current
state of the X.org drivers associated with a particular release.
Due to the X.org <-> kernel coupling, this patch is not intended (or
appropriate) for inclusion in the mainline kernel.
In particular, I'd like to hear from the X.org guys on whether this is
something that would work for them.
Signed-off-by: Jeff Mahoney <jeffm(a)suse.com>
---
drivers/gpu/drm/radeon/radeon_cp.c | 10 +
drivers/gpu/drm/radeon/radeon_drv.c | 290 +++++++++++++++++++++++++++++++++---
drivers/gpu/drm/radeon/radeon_kms.c | 9 +
3 files changed, 289 insertions(+), 20 deletions(-)
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
@@ -2081,11 +2081,21 @@ int radeon_cp_buffers(struct drm_device
return ret;
}
+extern int radeon_modeset;
+extern const struct pci_device_id nokms_pci_ids[];
int radeon_driver_load(struct drm_device *dev, unsigned long flags)
{
drm_radeon_private_t *dev_priv;
int ret = 0;
+ /* Don't claim devices for which we want KMS */
+ if (radeon_modeset == -1 && !pci_match_id(nokms_pci_ids, dev->pdev))
+ return -ENODEV;
+
+ /* Don't claim devices if KMS is universally enabled */
+ if (radeon_modeset == 1)
+ return -ENODEV;
+
dev_priv = kzalloc(sizeof(drm_radeon_private_t), GFP_KERNEL);
if (dev_priv == NULL)
return -ENOMEM;
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -176,6 +176,247 @@ static struct pci_device_id pciidlist[]
radeon_PCI_IDS
};
+/* Based on xf86-video-radeonhd/tree/src/rhd_id.c */
+struct pci_device_id nokms_pci_ids[] = {
+ {0x1002, 0x7100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1800 */
+ {0x1002, 0x7101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1800 XT */
+ {0x1002, 0x7102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1800 */
+ {0x1002, 0x7103, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility FireGL V7200 */
+ {0x1002, 0x7104, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V7200 */
+ {0x1002, 0x7105, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V5300 */
+ {0x1002, 0x7106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility FireGL V7100 */
+ {0x1002, 0x7108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1800 */
+ {0x1002, 0x7109, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1800 */
+ {0x1002, 0x710A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1800 */
+ {0x1002, 0x710B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1800 */
+ {0x1002, 0x710C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1800 */
+ {0x1002, 0x710E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V7300 */
+ {0x1002, 0x710F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V7350 */
+ {0x1002, 0x7140, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1600/X1550 */
+ {0x1002, 0x7141, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV505 */
+ {0x1002, 0x7142, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300/X1550 */
+ {0x1002, 0x7143, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1550 */
+ {0x1002, 0x7144, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M54-GL */
+ {0x1002, 0x7145, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1400 */
+ {0x1002, 0x7146, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300/X1550 */
+ {0x1002, 0x7147, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1550 64-bit */
+ {0x1002, 0x7149, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1300 */
+ {0x1002, 0x714A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1300 */
+ {0x1002, 0x714B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1300 */
+ {0x1002, 0x714C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1300 */
+ {0x1002, 0x714D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300 */
+ {0x1002, 0x714E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300 */
+ {0x1002, 0x714F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV505 */
+ {0x1002, 0x7151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV505 */
+ {0x1002, 0x7152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V3300 */
+ {0x1002, 0x7153, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V3350 */
+ {0x1002, 0x715E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300 */
+ {0x1002, 0x715F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1550 64-bit */
+ {0x1002, 0x7180, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300/X1550 */
+ {0x1002, 0x7181, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1600 */
+ {0x1002, 0x7183, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300/X1550 */
+ {0x1002, 0x7186, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1450 */
+ {0x1002, 0x7187, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300/X1550 */
+ {0x1002, 0x7188, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X2300 */
+ {0x1002, 0x718A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X2300 */
+ {0x1002, 0x718B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1350 */
+ {0x1002, 0x718C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1350 */
+ {0x1002, 0x718D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1450 */
+ {0x1002, 0x718F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300 */
+ {0x1002, 0x7193, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1550 */
+ {0x1002, 0x7196, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1350 */
+ {0x1002, 0x719B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireMV 2250 */
+ {0x1002, 0x719F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1550 64-bit */
+ {0x1002, 0x71C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1600 */
+ {0x1002, 0x71C1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1650 */
+ {0x1002, 0x71C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1600 */
+ {0x1002, 0x71C3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1600 */
+ {0x1002, 0x71C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility FireGL V5200 */
+ {0x1002, 0x71C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1600 */
+ {0x1002, 0x71C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1650 */
+ {0x1002, 0x71C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1650 */
+ {0x1002, 0x71CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1600 */
+ {0x1002, 0x71CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1300 XT/X1600 Pro */
+ {0x1002, 0x71D2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V3400 */
+ {0x1002, 0x71D4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility FireGL V5250 */
+ {0x1002, 0x71D5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1700 */
+ {0x1002, 0x71D6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1700 XT */
+ {0x1002, 0x71DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V5200 */
+ {0x1002, 0x71DE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1700 */
+ {0x1002, 0x7200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X2300HD */
+ {0x1002, 0x7210, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 2300 */
+ {0x1002, 0x7211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 2300 */
+ {0x1002, 0x7240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1950 */
+ {0x1002, 0x7243, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x7244, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1950 */
+ {0x1002, 0x7245, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x7246, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x7247, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x7248, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x7249, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x724A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x724B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x724C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x724D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x724E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* AMD Stream Processor */
+ {0x1002, 0x724F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1900 */
+ {0x1002, 0x7280, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1950 */
+ {0x1002, 0x7281, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV560 */
+ {0x1002, 0x7283, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV560 */
+ {0x1002, 0x7284, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon X1900 */
+ {0x1002, 0x7287, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV560 */
+ {0x1002, 0x7288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1950 GT */
+ {0x1002, 0x7289, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV570 */
+ {0x1002, 0x728B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV570 */
+ {0x1002, 0x728C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FireGL V7400 */
+ {0x1002, 0x7290, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV560 */
+ {0x1002, 0x7291, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1650 */
+ {0x1002, 0x7293, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1650 */
+ {0x1002, 0x7297, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV560 */
+ {0x1002, 0x791E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1200 */
+ {0x1002, 0x791F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon X1200 */
+ {0x1002, 0x793F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon Xpress 1200 */
+ {0x1002, 0x7941, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon Xpress 1200 */
+ {0x1002, 0x7942, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon Xpress 1200 (M) */
+ {0x1002, 0x796C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RS740 */
+ {0x1002, 0x796D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RS740M */
+ {0x1002, 0x796E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 2100 RS740 */
+ {0x1002, 0x796F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RS740M */
+ {0x1002, 0x9400, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2900 XT */
+ {0x1002, 0x9401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2900 XT */
+ {0x1002, 0x9402, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2900 XT */
+ {0x1002, 0x9403, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2900 Pro */
+ {0x1002, 0x9405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2900 GT */
+ {0x1002, 0x940A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V8650 */
+ {0x1002, 0x940B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V8600 */
+ {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V7600 */
+ {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 4800 Series */
+ {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 4870 X2 */
+ {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 4800 Series */
+ {0x1002, 0x9443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 4850 X2 */
+ {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Everest ATI FirePro Graphics Accelerator */
+ {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* K2 ATI FirePro Graphics Accelerator */
+ {0x1002, 0x9447, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro V8700 Duo */
+ {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI MOBILITY RADEON HD 4850 */
+ {0x1002, 0x944B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI MOBILITY RADEON HD 4850 X2 */
+ {0x1002, 0x944C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 4800 Series */
+ {0x1002, 0x944E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV770 */
+/* {0x1002, 0x944F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, *//* R700 */
+ {0x1002, 0x9450, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* AMD FireStream 9270 */
+ {0x1002, 0x9452, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* AMD FireStream 9250 */
+ {0x1002, 0x9456, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Denali ATI FirePro Graphics Accelerator */
+ {0x1002, 0x945A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI MOBILITY RADEON HD 4870 */
+ {0x1002, 0x945B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M98 */
+ {0x1002, 0x9460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV790 */
+ {0x1002, 0x9462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV790 */
+ {0x1002, 0x946A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M98 */
+ {0x1002, 0x946B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M98 */
+ {0x1002, 0x947A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M98 */
+ {0x1002, 0x947B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M98 */
+ {0x1002, 0x9480, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI MOBILITY RADEON HD 4650 */
+ {0x1002, 0x9487, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV730 */
+ {0x1002, 0x9488, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI MOBILITY RADEON HD 4670 */
+ {0x1002, 0x9489, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* M96M GL */
+ {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV730 */
+ {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 4670 */
+ {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON E4600 */
+ {0x1002, 0x9495, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 4600 Series */
+ {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 4650 */
+ {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro V7750 */
+ {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro V5700 */
+ {0x1002, 0x949F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro V3750 */
+ {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 4830 */
+ {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 4850 */
+ {0x1002, 0x94A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro M7740 */
+ {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV740 */
+ {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 4770 */
+ {0x1002, 0x94B4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 4700 Series */
+ {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 4770 */
+ {0x1002, 0x94B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro M5750 */
+ {0x1002, 0x94C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV610 */
+ {0x1002, 0x94C1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2400 XT */
+ {0x1002, 0x94C3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2400 Pro */
+ {0x1002, 0x94C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 2400 PRO AGP */
+ {0x1002, 0x94C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V4000 */
+ {0x1002, 0x94C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV610 */
+ {0x1002, 0x94C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 2350 */
+ {0x1002, 0x94C8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 2400 XT */
+ {0x1002, 0x94C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 2400 */
+ {0x1002, 0x94CB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON E2400 */
+ {0x1002, 0x94CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 2400 */
+ {0x1002, 0x94CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FireMV 2260 */
+ {0x1002, 0x9500, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV670 */
+ {0x1002, 0x9501, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD3870 */
+ {0x1002, 0x9504, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon HD 3850 */
+ {0x1002, 0x9505, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD3850 */
+ {0x1002, 0x9506, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon HD 3850 X2 */
+ {0x1002, 0x9507, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 3830 */
+ {0x1002, 0x9508, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon HD 3870 */
+ {0x1002, 0x9509, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon HD 3870 X2 */
+ {0x1002, 0x950F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD3870 X2 */
+ {0x1002, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FireGL V7700 */
+ {0x1002, 0x9513, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 3850 X2 */
+ {0x1002, 0x9515, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3850 AGP */
+ {0x1002, 0x9517, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3960 */
+ {0x1002, 0x9519, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireStream 9170 */
+ {0x1002, 0x9540, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 4550 */
+ {0x1002, 0x9541, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* */
+ {0x1002, 0x9542, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* */
+ {0x1002, 0x954E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* */
+ {0x1002, 0x954F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI RADEON HD 4350 */
+ {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 4300 Series */
+ {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 4500 Series */
+ {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon M93 */
+ {0x1002, 0x9557, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FirePro RG220 */
+ {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* RV630 */
+ {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 2600 */
+ {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 2600 XT */
+ {0x1002, 0x9586, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 2600 XT AGP */
+ {0x1002, 0x9587, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 2600 Pro AGP */
+ {0x1002, 0x9588, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2600 XT */
+ {0x1002, 0x9589, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Radeon HD 2600 Pro */
+ {0x1002, 0x958A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Gemini RV630 */
+ {0x1002, 0x958B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Gemini ATI Mobility Radeon HD 2600 XT */
+ {0x1002, 0x958C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V5600 */
+ {0x1002, 0x958D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* FireGL V3600 */
+ {0x1002, 0x958E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 2600 LE */
+ {0x1002, 0x958F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility FireGL Graphics Processor */
+ {0x1002, 0x9590, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3600 Series */
+ {0x1002, 0x9591, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 3650 */
+ {0x1002, 0x9592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* */
+ {0x1002, 0x9593, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 3670 */
+ {0x1002, 0x9595, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility FireGL V5700 */
+ {0x1002, 0x9596, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3650 AGP */
+ {0x1002, 0x9597, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3600 Series */
+ {0x1002, 0x9598, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3670 */
+ {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3600 Series */
+ {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility FireGL V5725 */
+ {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3470 */
+ {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon HD 3430 (M82) */
+ {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Mobility Radeon HD 3400 Series (M82) */
+ {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3450 */
+ {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3450 */
+ {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3430 */
+ {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3450 */
+ {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* Fire PRO Professional Graphics ASIC */
+ {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FireMV 2450 */
+ {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FireMV 2260 */
+ {0x1002, 0x95CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI FireMV 2260 */
+ {0x1002, 0x9610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3200 Graphics */
+ {0x1002, 0x9611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 3100 Graphics */
+ {0x1002, 0x9612, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3200 Graphics */
+ {0x1002, 0x9613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon 3100 Graphics */
+ {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3300 Graphics */
+ {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3200 Graphics */
+ {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD 3000 Graphics */
+ {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon HD Graphics */
+ {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon Graphics */
+ {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon HD Graphics */
+ {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Mobility Radeon Graphics */
+ {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* ATI Radeon Graphics */
+ {},
+};
+
#if defined(CONFIG_DRM_RADEON_KMS)
MODULE_DEVICE_TABLE(pci, pciidlist);
#endif
@@ -268,7 +509,8 @@ radeon_pci_resume(struct pci_dev *pdev)
static struct drm_driver kms_driver = {
.driver_features =
DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG |
- DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM,
+ DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED |
+ DRIVER_GEM | DRIVER_MODESET,
.dev_priv_size = 0,
.load = radeon_driver_load_kms,
.firstopen = radeon_driver_firstopen_kms,
@@ -328,45 +570,53 @@ static struct drm_driver kms_driver = {
.patchlevel = KMS_DRIVER_PATCHLEVEL,
};
-static struct drm_driver *driver;
-
static int __init radeon_init(void)
{
- driver = &driver_old;
- driver->num_ioctls = radeon_max_ioctl;
+ int ret;
+
+ driver_old.num_ioctls = radeon_max_ioctl;
+ kms_driver.num_ioctls = radeon_max_kms_ioctl;
+
+ if (radeon_modeset == 0)
+ DRM_INFO("radeon userspace modesetting enabled.\n");
+
#ifdef CONFIG_VGA_CONSOLE
if (vgacon_text_force() && radeon_modeset == -1) {
DRM_INFO("VGACON disable radeon kernel modesetting.\n");
- driver = &driver_old;
- driver->driver_features &= ~DRIVER_MODESET;
radeon_modeset = 0;
}
#endif
- /* if enabled by default */
+
+ if (radeon_modeset == 0)
+ return drm_init(&driver_old);
+
if (radeon_modeset == -1) {
-#ifdef CONFIG_DRM_RADEON_KMS
- DRM_INFO("radeon defaulting to kernel modesetting.\n");
- radeon_modeset = 1;
-#else
- DRM_INFO("radeon defaulting to userspace modesetting.\n");
- radeon_modeset = 0;
-#endif
+ DRM_INFO("radeon blacklist mode enabled.\n");
+ ret = drm_init(&driver_old);
+ if (ret)
+ return ret;
}
+
if (radeon_modeset == 1) {
DRM_INFO("radeon kernel modesetting enabled.\n");
- driver = &kms_driver;
- driver->driver_features |= DRIVER_MODESET;
- driver->num_ioctls = radeon_max_kms_ioctl;
radeon_register_atpx_handler();
+
}
+
/* if the vga console setting is enabled still
* let modprobe override it */
- return drm_init(driver);
+ ret = drm_init(&kms_driver);
+ if (ret && radeon_modeset == -1)
+ drm_exit(&driver_old);
+ return ret;
}
static void __exit radeon_exit(void)
{
- drm_exit(driver);
+ if (radeon_modeset == -1 || radeon_modeset == 0)
+ drm_exit(&driver_old);
+ if (radeon_modeset == -1 || radeon_modeset == 1)
+ drm_exit(&kms_driver);
radeon_unregister_atpx_handler();
}
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -46,11 +46,20 @@ int radeon_driver_unload_kms(struct drm_
return 0;
}
+extern int radeon_modeset;
+extern const struct pci_device_id nokms_pci_ids[];
int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
{
struct radeon_device *rdev;
int r;
+ /* Don't claim devices for which we don't want KMS */
+ if (radeon_modeset == -1 && pci_match_id(nokms_pci_ids, dev->pdev))
+ return -ENODEV;
+
+ if (radeon_modeset == 0)
+ return -ENODEV;
+
rdev = kzalloc(sizeof(struct radeon_device), GFP_KERNEL);
if (rdev == NULL) {
return -ENOMEM;
--
Jeff Mahoney
SUSE Labs
--
To unsubscribe, e-mail: opensuse-kernel+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-kernel+help(a)opensuse.org