From 1fa32cb612a869e576cae489616b0cc286b93f6c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 23 Apr 2019 09:48:13 +1000 Subject: drm/legacy: move legacy dev reinit into legacy misc This moves the legacy dev reinit into the legacy misc file. Reviewed-by: Daniel Vetter Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_legacy_misc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'drivers/gpu/drm/drm_legacy_misc.c') diff --git a/drivers/gpu/drm/drm_legacy_misc.c b/drivers/gpu/drm/drm_legacy_misc.c index 94973885c913..3616b1691007 100644 --- a/drivers/gpu/drm/drm_legacy_misc.c +++ b/drivers/gpu/drm/drm_legacy_misc.c @@ -50,3 +50,27 @@ void drm_legacy_destroy_members(struct drm_device *dev) { mutex_destroy(&dev->ctxlist_mutex); } + +void drm_legacy_dev_reinit(struct drm_device *dev) +{ + if (dev->irq_enabled) + drm_irq_uninstall(dev); + + mutex_lock(&dev->struct_mutex); + + drm_legacy_agp_clear(dev); + + drm_legacy_sg_cleanup(dev); + drm_legacy_vma_flush(dev); + drm_legacy_dma_takedown(dev); + + mutex_unlock(&dev->struct_mutex); + + dev->sigdata.lock = NULL; + + dev->context_flag = 0; + dev->last_context = 0; + dev->if_version = 0; + + DRM_DEBUG("lastclose completed\n"); +} -- cgit v1.2.3