diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-01 19:48:38 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-20 16:16:52 -0500 |
commit | bbe4b99ff2443e305598768ae8eac6bc3516b7c9 (patch) | |
tree | 975c05dfa5ffea97ab592495872173f02c3f527a /drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | |
parent | b13f59804918ad584a97a639064a24d14e2fd740 (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.c | 18 |
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); |
201 | out_no_ttm_lock: | 197 | out_no_ttm_lock: |
202 | out_no_fb: | 198 | out_no_fb: |
203 | mutex_unlock(&dev->mode_config.mutex); | 199 | drm_modeset_unlock_all(dev); |
204 | out_no_mode_mutex: | ||
205 | out_no_copy: | 200 | out_no_copy: |
206 | kfree(clips); | 201 | kfree(clips); |
207 | out_clips: | 202 | out_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); |
283 | out_no_ttm_lock: | 274 | out_no_ttm_lock: |
284 | out_no_fb: | 275 | out_no_fb: |
285 | mutex_unlock(&dev->mode_config.mutex); | 276 | drm_modeset_unlock_all(dev); |
286 | out_no_mode_mutex: | ||
287 | out_no_copy: | 277 | out_no_copy: |
288 | kfree(clips); | 278 | kfree(clips); |
289 | out_clips: | 279 | out_clips: |