diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-02-09 00:49:12 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-10 23:22:34 -0500 |
commit | bc9025bdc4e2b591734cca17697093845007b63d (patch) | |
tree | a115cc34ee9650d94df7eb9d166ba98eb9d674a7 /drivers/gpu/drm/nouveau/nouveau_notifier.c | |
parent | c3ae90c099bb62387507e86da7cf799850444b08 (diff) |
Use drm_gem_object_[handle_]unreference_unlocked where possible
Mostly obvious simplifications.
The i915 pread/pwrite ioctls, intel_overlay_put_image and
nouveau_gem_new were incorrectly using the locked versions
without locking: this is also fixed in this patch.
Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_notifier.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_notifier.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c index d99dc087f9b1..9537f3e30115 100644 --- a/drivers/gpu/drm/nouveau/nouveau_notifier.c +++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c | |||
@@ -61,11 +61,8 @@ nouveau_notifier_init_channel(struct nouveau_channel *chan) | |||
61 | 61 | ||
62 | chan->notifier_bo = ntfy; | 62 | chan->notifier_bo = ntfy; |
63 | out_err: | 63 | out_err: |
64 | if (ret) { | 64 | if (ret) |
65 | mutex_lock(&dev->struct_mutex); | 65 | drm_gem_object_unreference_unlocked(ntfy->gem); |
66 | drm_gem_object_unreference(ntfy->gem); | ||
67 | mutex_unlock(&dev->struct_mutex); | ||
68 | } | ||
69 | 66 | ||
70 | return ret; | 67 | return ret; |
71 | } | 68 | } |
@@ -81,8 +78,8 @@ nouveau_notifier_takedown_channel(struct nouveau_channel *chan) | |||
81 | nouveau_bo_unmap(chan->notifier_bo); | 78 | nouveau_bo_unmap(chan->notifier_bo); |
82 | mutex_lock(&dev->struct_mutex); | 79 | mutex_lock(&dev->struct_mutex); |
83 | nouveau_bo_unpin(chan->notifier_bo); | 80 | nouveau_bo_unpin(chan->notifier_bo); |
84 | drm_gem_object_unreference(chan->notifier_bo->gem); | ||
85 | mutex_unlock(&dev->struct_mutex); | 81 | mutex_unlock(&dev->struct_mutex); |
82 | drm_gem_object_unreference_unlocked(chan->notifier_bo->gem); | ||
86 | nouveau_mem_takedown(&chan->notifier_heap); | 83 | nouveau_mem_takedown(&chan->notifier_heap); |
87 | } | 84 | } |
88 | 85 | ||