Commit 663ab9c4 authored by Daniel Vetter's avatar Daniel Vetter

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: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1448271183-20523-18-git-send-email-daniel.vetter@ffwll.ch
parent d3e376f5
...@@ -349,8 +349,6 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, ...@@ -349,8 +349,6 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
/* If we didn't get a handle then turn the cursor off */ /* If we didn't get a handle then turn the cursor off */
if (!handle) { if (!handle) {
temp = CURSOR_MODE_DISABLE; temp = CURSOR_MODE_DISABLE;
mutex_lock(&dev->struct_mutex);
if (gma_power_begin(dev, false)) { if (gma_power_begin(dev, false)) {
REG_WRITE(control, temp); REG_WRITE(control, temp);
REG_WRITE(base, 0); REG_WRITE(base, 0);
...@@ -362,11 +360,9 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, ...@@ -362,11 +360,9 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
gt = container_of(gma_crtc->cursor_obj, gt = container_of(gma_crtc->cursor_obj,
struct gtt_range, gem); struct gtt_range, gem);
psb_gtt_unpin(gt); psb_gtt_unpin(gt);
drm_gem_object_unreference(gma_crtc->cursor_obj); drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj);
gma_crtc->cursor_obj = NULL; gma_crtc->cursor_obj = NULL;
} }
mutex_unlock(&dev->struct_mutex);
return 0; return 0;
} }
...@@ -376,7 +372,6 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, ...@@ -376,7 +372,6 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
return -EINVAL; return -EINVAL;
} }
mutex_lock(&dev->struct_mutex);
obj = drm_gem_object_lookup(dev, file_priv, handle); obj = drm_gem_object_lookup(dev, file_priv, handle);
if (!obj) { if (!obj) {
ret = -ENOENT; ret = -ENOENT;
...@@ -441,17 +436,15 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, ...@@ -441,17 +436,15 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
if (gma_crtc->cursor_obj) { if (gma_crtc->cursor_obj) {
gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem);
psb_gtt_unpin(gt); psb_gtt_unpin(gt);
drm_gem_object_unreference(gma_crtc->cursor_obj); drm_gem_object_unreference_unlocked(gma_crtc->cursor_obj);
} }
gma_crtc->cursor_obj = obj; gma_crtc->cursor_obj = obj;
unlock: unlock:
mutex_unlock(&dev->struct_mutex);
return ret; return ret;
unref_cursor: unref_cursor:
drm_gem_object_unreference(obj); drm_gem_object_unreference_unlocked(obj);
mutex_unlock(&dev->struct_mutex);
return ret; return ret;
} }
......
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