/* Additionally, in the non-mode setting case, we'll tear down the AGP and DMA structures, since the kernel won't be using them, and clea up any GEM state.  */
void i915_driver_lastclose(struct drm_device *dev)
/* Additionally, in the non-mode setting case, we'll tear down the AGP and DMA structures, since the kernel won't be using them, and clea up any GEM state.  */
void i915_driver_lastclose(struct drm_device *dev)
{
	drm_i915_private_t *dev_priv = dev->dev_private;
	if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) {
		drm_fb_helper_restore();
		return;
	}
	i915_gem_lastclose(dev);
	if (dev_priv->agp_heap)
		i915_mem_takedown(&(dev_priv->agp_heap));
	i915_dma_cleanup(dev);
}