Commit bbe4b99f authored by Daniel Vetter's avatar Daniel Vetter

drm/vmwgfx: use drm_modeset_lock_all

Ok, this one here is a bit more complicated, and I can't really claim
to fully understand the locking and lifetime rules of the vmwgfx
driver. So just convert ever mutex_lock call, including the
interruptible one. Since other places (e.g. in the execbuf ioctl) take
the mode_config.mutex without bothering with interruptible handling,
I've figured I should be able to get away with this in a few more
places ...
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b13f5980
...@@ -163,11 +163,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, ...@@ -163,11 +163,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
goto out_no_copy; goto out_no_copy;
} }
ret = mutex_lock_interruptible(&dev->mode_config.mutex); drm_modeset_lock_all(dev);
if (unlikely(ret != 0)) {
ret = -ERESTARTSYS;
goto out_no_mode_mutex;
}
obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB); obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) { if (!obj) {
...@@ -200,8 +196,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, ...@@ -200,8 +196,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
ttm_read_unlock(&vmaster->lock); ttm_read_unlock(&vmaster->lock);
out_no_ttm_lock: out_no_ttm_lock:
out_no_fb: out_no_fb:
mutex_unlock(&dev->mode_config.mutex); drm_modeset_unlock_all(dev);
out_no_mode_mutex:
out_no_copy: out_no_copy:
kfree(clips); kfree(clips);
out_clips: out_clips:
...@@ -251,11 +246,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, ...@@ -251,11 +246,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
goto out_no_copy; goto out_no_copy;
} }
ret = mutex_lock_interruptible(&dev->mode_config.mutex); drm_modeset_lock_all(dev);
if (unlikely(ret != 0)) {
ret = -ERESTARTSYS;
goto out_no_mode_mutex;
}
obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB); obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) { if (!obj) {
...@@ -282,8 +273,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, ...@@ -282,8 +273,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
ttm_read_unlock(&vmaster->lock); ttm_read_unlock(&vmaster->lock);
out_no_ttm_lock: out_no_ttm_lock:
out_no_fb: out_no_fb:
mutex_unlock(&dev->mode_config.mutex); drm_modeset_unlock_all(dev);
out_no_mode_mutex:
out_no_copy: out_no_copy:
kfree(clips); kfree(clips);
out_clips: out_clips:
......
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