Commit 6eee6675 authored by Dave Airlie's avatar Dave Airlie
parent 06feb5df
...@@ -996,9 +996,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ...@@ -996,9 +996,9 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
vmw_kms_close(dev_priv); vmw_kms_close(dev_priv);
out_no_kms: out_no_kms:
if (dev_priv->has_mob) if (dev_priv->has_mob)
(void) ttm_bo_clean_mm(&dev_priv->bdev, VMW_PL_MOB); vmw_gmrid_man_fini(dev_priv, VMW_PL_MOB);
if (dev_priv->has_gmr) if (dev_priv->has_gmr)
(void) ttm_bo_clean_mm(&dev_priv->bdev, VMW_PL_GMR); vmw_gmrid_man_fini(dev_priv, VMW_PL_GMR);
vmw_vram_manager_fini(dev_priv); vmw_vram_manager_fini(dev_priv);
out_no_vram: out_no_vram:
(void)ttm_bo_device_release(&dev_priv->bdev); (void)ttm_bo_device_release(&dev_priv->bdev);
...@@ -1047,12 +1047,11 @@ static void vmw_driver_unload(struct drm_device *dev) ...@@ -1047,12 +1047,11 @@ static void vmw_driver_unload(struct drm_device *dev)
vmw_overlay_close(dev_priv); vmw_overlay_close(dev_priv);
if (dev_priv->has_gmr) if (dev_priv->has_gmr)
(void)ttm_bo_clean_mm(&dev_priv->bdev, VMW_PL_GMR); vmw_gmrid_man_fini(dev_priv, VMW_PL_GMR);
(void)ttm_bo_clean_mm(&dev_priv->bdev, TTM_PL_VRAM);
vmw_release_device_early(dev_priv); vmw_release_device_early(dev_priv);
if (dev_priv->has_mob) if (dev_priv->has_mob)
(void) ttm_bo_clean_mm(&dev_priv->bdev, VMW_PL_MOB); vmw_gmrid_man_fini(dev_priv, VMW_PL_MOB);
vmw_vram_manager_fini(dev_priv); vmw_vram_manager_fini(dev_priv);
(void) ttm_bo_device_release(&dev_priv->bdev); (void) ttm_bo_device_release(&dev_priv->bdev);
drm_vma_offset_manager_destroy(&dev_priv->vma_manager); drm_vma_offset_manager_destroy(&dev_priv->vma_manager);
......
...@@ -1222,6 +1222,7 @@ int vmw_overlay_num_free_overlays(struct vmw_private *dev_priv); ...@@ -1222,6 +1222,7 @@ int vmw_overlay_num_free_overlays(struct vmw_private *dev_priv);
*/ */
int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type); int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type);
void vmw_gmrid_man_fini(struct vmw_private *dev_priv, int type);
/** /**
* Prime - vmwgfx_prime.c * Prime - vmwgfx_prime.c
......
...@@ -133,20 +133,25 @@ int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type) ...@@ -133,20 +133,25 @@ int vmw_gmrid_man_init(struct vmw_private *dev_priv, int type)
return 0; return 0;
} }
static int vmw_gmrid_man_takedown(struct ttm_mem_type_manager *man) void vmw_gmrid_man_fini(struct vmw_private *dev_priv, int type)
{ {
struct ttm_mem_type_manager *man = &dev_priv->bdev.man[type];
struct vmwgfx_gmrid_man *gman = struct vmwgfx_gmrid_man *gman =
(struct vmwgfx_gmrid_man *)man->priv; (struct vmwgfx_gmrid_man *)man->priv;
ttm_mem_type_manager_disable(man);
ttm_mem_type_manager_force_list_clean(&dev_priv->bdev, man);
if (gman) { if (gman) {
ida_destroy(&gman->gmr_ida); ida_destroy(&gman->gmr_ida);
kfree(gman); kfree(gman);
} }
return 0;
ttm_mem_type_manager_cleanup(man);
} }
static const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = { static const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
.takedown = vmw_gmrid_man_takedown,
.get_node = vmw_gmrid_man_get_node, .get_node = vmw_gmrid_man_get_node,
.put_node = vmw_gmrid_man_put_node, .put_node = vmw_gmrid_man_put_node,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment