aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
index d9fbbe191071..a135498a1298 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -163,11 +163,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
163 goto out_no_copy; 163 goto out_no_copy;
164 } 164 }
165 165
166 ret = mutex_lock_interruptible(&dev->mode_config.mutex); 166 drm_modeset_lock_all(dev);
167 if (unlikely(ret != 0)) {
168 ret = -ERESTARTSYS;
169 goto out_no_mode_mutex;
170 }
171 167
172 obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB); 168 obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB);
173 if (!obj) { 169 if (!obj) {
@@ -200,8 +196,7 @@ out_no_surface:
200 ttm_read_unlock(&vmaster->lock); 196 ttm_read_unlock(&vmaster->lock);
201out_no_ttm_lock: 197out_no_ttm_lock:
202out_no_fb: 198out_no_fb:
203 mutex_unlock(&dev->mode_config.mutex); 199 drm_modeset_unlock_all(dev);
204out_no_mode_mutex:
205out_no_copy: 200out_no_copy:
206 kfree(clips); 201 kfree(clips);
207out_clips: 202out_clips:
@@ -251,11 +246,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
251 goto out_no_copy; 246 goto out_no_copy;
252 } 247 }
253 248
254 ret = mutex_lock_interruptible(&dev->mode_config.mutex); 249 drm_modeset_lock_all(dev);
255 if (unlikely(ret != 0)) {
256 ret = -ERESTARTSYS;
257 goto out_no_mode_mutex;
258 }
259 250
260 obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB); 251 obj = drm_mode_object_find(dev, arg->fb_id, DRM_MODE_OBJECT_FB);
261 if (!obj) { 252 if (!obj) {
@@ -282,8 +273,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
282 ttm_read_unlock(&vmaster->lock); 273 ttm_read_unlock(&vmaster->lock);
283out_no_ttm_lock: 274out_no_ttm_lock:
284out_no_fb: 275out_no_fb:
285 mutex_unlock(&dev->mode_config.mutex); 276 drm_modeset_unlock_all(dev);
286out_no_mode_mutex:
287out_no_copy: 277out_no_copy:
288 kfree(clips); 278 kfree(clips);
289out_clips: 279out_clips: