diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-08 09:55:40 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-12 16:19:49 -0400 |
commit | 14be93ddff61eb196382aeaa3ac86f4db844aeb0 (patch) | |
tree | 0cfde7c3f444899508e2d07adb4245d4eb33216b /drivers/char/agp/intel-agp.c | |
parent | 7e8f6306fe155d6fc3fe99d666be95b4ed24427d (diff) |
drm/i915 + agp/intel-gtt: prep work for direct setup
To be able to directly set up the intel-gtt code from drm/i915 and
avoid setting up the fake-agp driver we need to prepare a few things:
- pass both the bridge and gpu pci_dev to the probe function and add
code to handle the gpu pdev both being present (for drm/i915) and
not present (fake agp).
- add refcounting to the remove function so that unloading drm/i915
doesn't kill the fake agp driver
v2: Fix up the cleanup and refcount, noticed by Jani Nikula.
Reviewed-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/char/agp/intel-agp.c')
-rw-r--r-- | drivers/char/agp/intel-agp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 764f70c5e690..c98c5689bb0b 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/smp.h> | 12 | #include <asm/smp.h> |
13 | #include "agp.h" | 13 | #include "agp.h" |
14 | #include "intel-agp.h" | 14 | #include "intel-agp.h" |
15 | #include <drm/intel-gtt.h> | ||
15 | 16 | ||
16 | int intel_agp_enabled; | 17 | int intel_agp_enabled; |
17 | EXPORT_SYMBOL(intel_agp_enabled); | 18 | EXPORT_SYMBOL(intel_agp_enabled); |
@@ -747,7 +748,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
747 | 748 | ||
748 | bridge->capndx = cap_ptr; | 749 | bridge->capndx = cap_ptr; |
749 | 750 | ||
750 | if (intel_gmch_probe(pdev, bridge)) | 751 | if (intel_gmch_probe(pdev, NULL, bridge)) |
751 | goto found_gmch; | 752 | goto found_gmch; |
752 | 753 | ||
753 | for (i = 0; intel_agp_chipsets[i].name != NULL; i++) { | 754 | for (i = 0; intel_agp_chipsets[i].name != NULL; i++) { |
@@ -824,7 +825,7 @@ static void __devexit agp_intel_remove(struct pci_dev *pdev) | |||
824 | 825 | ||
825 | agp_remove_bridge(bridge); | 826 | agp_remove_bridge(bridge); |
826 | 827 | ||
827 | intel_gmch_remove(pdev); | 828 | intel_gmch_remove(); |
828 | 829 | ||
829 | agp_put_bridge(bridge); | 830 | agp_put_bridge(bridge); |
830 | } | 831 | } |