Hold the lock while we save/restore register for suspend/resume.
authorHasso Tepper <hasso@estpak.ee>
Tue, 23 Jun 2009 21:56:43 +0000 (00:56 +0300)
committerHasso Tepper <hasso@estpak.ee>
Wed, 24 Jun 2009 20:04:27 +0000 (23:04 +0300)
Obtained-from: FreeBSD

sys/dev/drm/i915_drv.c

index 11e25ed..1736612 100644 (file)
@@ -49,7 +49,10 @@ static int i915_suspend(device_t kdev)
                return -ENODEV;
        }
 
+       DRM_LOCK();
+       DRM_DEBUG("starting suspend\n");
        i915_save_state(dev);
+       DRM_UNLOCK();
 
        return (bus_generic_suspend(kdev));
 }
@@ -58,7 +61,10 @@ static int i915_resume(device_t kdev)
 {
        struct drm_device *dev = device_get_softc(kdev);
 
+       DRM_LOCK();
        i915_restore_state(dev);
+       DRM_DEBUG("finished resume\n");
+       DRM_UNLOCK();
 
        return (bus_generic_resume(kdev));
 }