Move out the code from i915_dma_cleanup to unload to match

existing code.

This needs verifying.
main
Alan Hourihane 2007-06-29 21:04:17 +01:00
parent adff58223f
commit 70fd9351ed
2 changed files with 10 additions and 24 deletions

View File

@ -91,30 +91,6 @@ int i915_dma_cleanup(drm_device_t * dev)
if (dev->irq) if (dev->irq)
drm_irq_uninstall(dev); drm_irq_uninstall(dev);
if (dev->dev_private) {
drm_i915_private_t *dev_priv =
(drm_i915_private_t *) dev->dev_private;
if (dev_priv->ring.virtual_start) {
drm_core_ioremapfree(&dev_priv->ring.map, dev);
}
if (dev_priv->status_page_dmah) {
drm_pci_free(dev, dev_priv->status_page_dmah);
/* Need to rewrite hardware status page */
I915_WRITE(I915REG_HWS_PGA, 0x1ffff000);
}
if (dev_priv->status_gfx_addr) {
dev_priv->status_gfx_addr = 0;
drm_core_ioremapfree(&dev_priv->hws_map, dev);
I915_WRITE(I915REG_HWS_PGA, 0x1ffff000);
}
drm_free(dev->dev_private, sizeof(drm_i915_private_t),
DRM_MEM_DRIVER);
dev->dev_private = NULL;
}
return 0; return 0;
} }

View File

@ -257,6 +257,10 @@ int i915_driver_unload(drm_device_t *dev)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
if (dev_priv->ring.virtual_start) {
drm_core_ioremapfree(&dev_priv->ring.map, dev);
}
if (dev_priv->status_page_dmah) { if (dev_priv->status_page_dmah) {
drm_pci_free(dev, dev_priv->status_page_dmah); drm_pci_free(dev, dev_priv->status_page_dmah);
dev_priv->status_page_dmah = NULL; dev_priv->status_page_dmah = NULL;
@ -266,6 +270,12 @@ int i915_driver_unload(drm_device_t *dev)
I915_WRITE(I915REG_HWS_PGA, 0x1ffff000); I915_WRITE(I915REG_HWS_PGA, 0x1ffff000);
} }
if (dev_priv->status_gfx_addr) {
dev_priv->status_gfx_addr = 0;
drm_core_ioremapfree(&dev_priv->hws_map, dev);
I915_WRITE(I915REG_HWS_PGA, 0x1ffff000);
}
I915_WRITE(LP_RING + RING_LEN, 0); I915_WRITE(LP_RING + RING_LEN, 0);
intel_modeset_cleanup(dev); intel_modeset_cleanup(dev);