diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-11-23 04:32:50 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-01 04:04:59 -0500 |
commit | 663ab9c4c9b4be8a6aa41d65e3e89194733a5267 (patch) | |
tree | f8647ee32b4fbfb8bab9ef4494699bec6ec39d17 /drivers/gpu/drm/gma500 | |
parent | d3e376f52d095103ca51dbda4d6ff8aaf488f98f (diff) |
drm/gma500: Drop dev->struct_mutex from modeset code
It's either init code or already protected by other means. Note
that psb_gtt_pin/unpin has it's own lock, and that's really the
only piece of driver private state - all the modeset state is
protected with modeset locks already.
The only important bit is to switch all gem_obj_unref calls to the
_unlocked variant.
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1448271183-20523-18-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r-- | drivers/gpu/drm/gma500/gma_display.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index 001b450b27b3..ff17af4cfc64 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c | |||
@@ -349,8 +349,6 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, | |||
349 | /* If we didn't get a handle then turn the cursor off */ | 349 | /* If we didn't get a handle then turn the cursor off */ |
350 | if (!handle) { | 350 | if (!handle) { |
351 | temp = CURSOR_MODE_DISABLE; | 351 | temp = CURSOR_MODE_DISABLE; |
352 | mutex_lock(&dev->struct_mutex); | ||
353 | |||
354 | if (gma_power_begin(dev, false)) { | 352 | if (gma_power_begin(dev, false)) { |
355 | REG_WRITE(control, temp); | 353 | REG_WRITE(control, temp); |
356 | REG_WRITE(base, 0); | 354 | REG_WRITE(base, 0); |
@@ -362,11 +360,9 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, | |||
362 | gt = container_of(gma_crtc->cursor_obj, | 360 | gt = container_of(gma_crtc->cursor_obj, |
363 | struct gtt_range, gem); | 361 | struct gtt_range, gem); |
364 | psb_gtt_unpin(gt); | 362 | psb_gtt_unpin(gt); |
365 | drm_gem_object_unreference(gma_crtc->cursor_obj); | 363 | drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj); |
366 | gma_crtc->cursor_obj = NULL; | 364 | gma_crtc->cursor_obj = NULL; |
367 | } | 365 | } |
368 | |||
369 | mutex_unlock(&dev->struct_mutex); | ||
370 | return 0; | 366 | return 0; |
371 | } | 367 | } |
372 | 368 | ||
@@ -376,7 +372,6 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, | |||
376 | return -EINVAL; | 372 | return -EINVAL; |
377 | } | 373 | } |
378 | 374 | ||
379 | mutex_lock(&dev->struct_mutex); | ||
380 | obj = drm_gem_object_lookup(dev, file_priv, handle); | 375 | obj = drm_gem_object_lookup(dev, file_priv, handle); |
381 | if (!obj) { | 376 | if (!obj) { |
382 | ret = -ENOENT; | 377 | ret = -ENOENT; |
@@ -441,17 +436,15 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, | |||
441 | if (gma_crtc->cursor_obj) { | 436 | if (gma_crtc->cursor_obj) { |
442 | gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); | 437 | gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); |
443 | psb_gtt_unpin(gt); | 438 | psb_gtt_unpin(gt); |
444 | drm_gem_object_unreference(gma_crtc->cursor_obj); | 439 | drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj); |
445 | } | 440 | } |
446 | 441 | ||
447 | gma_crtc->cursor_obj = obj; | 442 | gma_crtc->cursor_obj = obj; |
448 | unlock: | 443 | unlock: |
449 | mutex_unlock(&dev->struct_mutex); | ||
450 | return ret; | 444 | return ret; |
451 | 445 | ||
452 | unref_cursor: | 446 | unref_cursor: |
453 | drm_gem_object_unreference(obj); | 447 | drm_gem_object_unreference_unlocked(obj); |
454 | mutex_unlock(&dev->struct_mutex); | ||
455 | return ret; | 448 | return ret; |
456 | } | 449 | } |
457 | 450 | ||