aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_pci.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-07-27 10:37:00 -0400
committerDave Airlie <airlied@redhat.com>2013-08-06 20:14:24 -0400
commit28ec711cd427f8b61f73712a43b8100ba8ca933b (patch)
tree1ceebcff67e41b55b570869984a15d62523aa8a7 /drivers/gpu/drm/drm_pci.c
parent08fcd72b14e440feb748ddc33e7057716116a74a (diff)
drm/agp: move AGP cleanup paths to drm_agpsupport.c
Introduce two new helpers, drm_agp_clear() and drm_agp_destroy() which clear all AGP mappings and destroy the AGP head. This allows to reduce the AGP code in core DRM and move it all to drm_agpsupport.c. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_pci.c')
-rw-r--r--drivers/gpu/drm/drm_pci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index a7b46ff80b0f..0f54ad8a9ced 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -283,6 +283,17 @@ static int drm_pci_agp_init(struct drm_device *dev)
283 return 0; 283 return 0;
284} 284}
285 285
286static void drm_pci_agp_destroy(struct drm_device *dev)
287{
288 if (drm_core_has_AGP(dev) && dev->agp) {
289 if (drm_core_has_MTRR(dev))
290 arch_phys_wc_del(dev->agp->agp_mtrr);
291 drm_agp_clear(dev);
292 drm_agp_destroy(dev->agp);
293 dev->agp = NULL;
294 }
295}
296
286static struct drm_bus drm_pci_bus = { 297static struct drm_bus drm_pci_bus = {
287 .bus_type = DRIVER_BUS_PCI, 298 .bus_type = DRIVER_BUS_PCI,
288 .get_irq = drm_pci_get_irq, 299 .get_irq = drm_pci_get_irq,
@@ -291,6 +302,7 @@ static struct drm_bus drm_pci_bus = {
291 .set_unique = drm_pci_set_unique, 302 .set_unique = drm_pci_set_unique,
292 .irq_by_busid = drm_pci_irq_by_busid, 303 .irq_by_busid = drm_pci_irq_by_busid,
293 .agp_init = drm_pci_agp_init, 304 .agp_init = drm_pci_agp_init,
305 .agp_destroy = drm_pci_agp_destroy,
294}; 306};
295 307
296/** 308/**