drm/i915: Hold struct_mutex while unreffing pwrctx object
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 11 Nov 2009 17:19:17 +0000 (12:19 -0500)
committerEric Anholt <eric@anholt.net>
Tue, 1 Dec 2009 00:27:07 +0000 (16:27 -0800)
This also extends the mutex to cover fbc disabling, which is safe.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_display.c

index b6251cdd4ebf74901c635f2ee5f066f67b126397..abd24e2a49328e02ecf6205ef944b996bb7f4865 100644 (file)
@@ -4584,8 +4584,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
        intel_increase_renderclock(dev, false);
        del_timer_sync(&dev_priv->idle_timer);
 
-       mutex_unlock(&dev->struct_mutex);
-
        if (dev_priv->display.disable_fbc)
                dev_priv->display.disable_fbc(dev);
 
@@ -4594,6 +4592,8 @@ void intel_modeset_cleanup(struct drm_device *dev)
                drm_gem_object_unreference(dev_priv->pwrctx);
        }
 
+       mutex_unlock(&dev->struct_mutex);
+
        drm_mode_config_cleanup(dev);
 }