Nothing is shared anymore between AGP and drm/i915 driver. Pre-GEN6 still uses AGP, but all necessary info is encapsulated per driver. v2: Conflict resolution from earlier rebase Reviewed-by: Rodrigo Vivi <rodrigo.vivi at gmail.com> Signed-off-by: Ben Widawsky <ben at bwidawsk.net> --- drivers/char/agp/intel-gtt.c | 7 ------- drivers/gpu/drm/i915/i915_gem_gtt.c | 21 +-------------------- include/drm/intel-gtt.h | 3 --- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 773ce8b..53086a2 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -60,7 +60,6 @@ struct intel_gtt_driver { }; static struct _intel_private { - struct intel_gtt base; const struct intel_gtt_driver *driver; struct pci_dev *pcidev; /* device one */ struct pci_dev *bridge_dev; @@ -1372,12 +1371,6 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, } EXPORT_SYMBOL(intel_gmch_probe); -struct intel_gtt *intel_gtt_get(void) -{ - return &intel_private.base; -} -EXPORT_SYMBOL(intel_gtt_get); - void intel_gtt_chipset_flush(void) { if (intel_private.driver->chipset_flush) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 33e7bbc..5354720 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -713,28 +713,10 @@ int i915_gem_gtt_init(struct drm_device *dev) * hostbridge query stuff. Skip it entirely */ if (INTEL_INFO(dev)->gen < 6) { - ret = intel_gmch_probe(dev_priv->bridge_dev, dev->pdev, NULL); - if (!ret) { - DRM_ERROR("failed to set up gmch\n"); - return -EIO; - } - - dev_priv->mm.gtt = intel_gtt_get(); - if (!dev_priv->mm.gtt) { - DRM_ERROR("Failed to initialize GTT\n"); - intel_gmch_remove(); - return -ENODEV; - } - dev_priv->gtt.do_idle_maps = needs_idle_maps(dev); - - return 0; + return intel_gmch_probe(dev_priv->bridge_dev, dev->pdev, NULL); } - dev_priv->mm.gtt = kzalloc(sizeof(*dev_priv->mm.gtt), GFP_KERNEL); - if (!dev_priv->mm.gtt) - return -ENOMEM; - /* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */ gtt_bus_addr = pci_resource_start(dev->pdev, 0) + (2<<20); @@ -791,5 +773,4 @@ void i915_gem_gtt_fini(struct drm_device *dev) teardown_scratch_page(dev); if (INTEL_INFO(dev)->gen < 6) intel_gmch_remove(); - kfree(dev_priv->mm.gtt); } diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index ae55605..8b546ee 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h @@ -3,9 +3,6 @@ #ifndef _DRM_INTEL_GTT_H #define _DRM_INTEL_GTT_H -struct intel_gtt { -} *intel_gtt_get(void); - int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, struct agp_bridge_data *bridge); void intel_gmch_remove(void); -- 1.8.1.1