aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-25 09:58:49 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-06-25 15:10:14 -0400
commit01a06850fb45ace55ed67d1d9da2df553a041e40 (patch)
tree54b4ea08d4959c0bd99dfe350e8275eb847f18f1 /drivers/gpu/drm
parent87207ca20eeb519aa0333b754db9cf3c369ea6f7 (diff)
drm/i915: disable drm agp support for !gen3 with kms enabled
This is the quick&dirty way Dave Airlie suggested to workaround the midlayer drm agp brain-damange. Note that i915_probe is only called when the driver has ksm enabled, so no need to check for that. We also need to move the intel_agp_enabled check at the right place. Note that the only thing this does is enforce the correct module load order (by using a symbol from intel-agp.ko) to ensure that the fake agp driver is ready before the drm core tries to set up the agp stuff. v2: Add a comment to explain why gen3 needs all this legacy fake agp stuff - we've shipped an XvMC library with a kms-enabled ddx that requires it (but only on gen3). v3: Make it clear that this is only a gen3 issue in the comment. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index a378c0800304..79be8799ea6c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -930,10 +930,12 @@ int i915_reset(struct drm_device *dev)
930 return 0; 930 return 0;
931} 931}
932 932
933
934static int __devinit 933static int __devinit
935i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 934i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
936{ 935{
936 struct intel_device_info *intel_info =
937 (struct intel_device_info *) ent->driver_data;
938
937 /* Only bind to function 0 of the device. Early generations 939 /* Only bind to function 0 of the device. Early generations
938 * used function 1 as a placeholder for multi-head. This causes 940 * used function 1 as a placeholder for multi-head. This causes
939 * us confusion instead, especially on the systems where both 941 * us confusion instead, especially on the systems where both
@@ -942,6 +944,18 @@ i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
942 if (PCI_FUNC(pdev->devfn)) 944 if (PCI_FUNC(pdev->devfn))
943 return -ENODEV; 945 return -ENODEV;
944 946
947 /* We've managed to ship a kms-enabled ddx that shipped with an XvMC
948 * implementation for gen3 (and only gen3) that used legacy drm maps
949 * (gasp!) to share buffers between X and the client. Hence we need to
950 * keep around the fake agp stuff for gen3, even when kms is enabled. */
951 if (intel_info->gen != 3) {
952 driver.driver_features &=
953 ~(DRIVER_USE_AGP | DRIVER_REQUIRE_AGP);
954 } else if (!intel_agp_enabled) {
955 DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
956 return -ENODEV;
957 }
958
945 return drm_get_pci_dev(pdev, ent, &driver); 959 return drm_get_pci_dev(pdev, ent, &driver);
946} 960}
947 961
@@ -1102,11 +1116,6 @@ static struct pci_driver i915_pci_driver = {
1102 1116
1103static int __init i915_init(void) 1117static int __init i915_init(void)
1104{ 1118{
1105 if (!intel_agp_enabled) {
1106 DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
1107 return -ENODEV;
1108 }
1109
1110 driver.num_ioctls = i915_max_ioctl; 1119 driver.num_ioctls = i915_max_ioctl;
1111 1120
1112 /* 1121 /*