aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-01 19:48:38 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-20 16:16:52 -0500
commitbbe4b99ff2443e305598768ae8eac6bc3516b7c9 (patch)
tree975c05dfa5ffea97ab592495872173f02c3f527a /drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
parentb13f59804918ad584a97a639064a24d14e2fd740 (diff)
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: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c')
-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: