diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 26 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_notifier.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_crtc.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_crtc.c | 4 |
6 files changed, 15 insertions, 39 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index dfc94391d71e..cf1c5c0a0abe 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -39,11 +39,8 @@ nouveau_user_framebuffer_destroy(struct drm_framebuffer *drm_fb) | |||
39 | if (drm_fb->fbdev) | 39 | if (drm_fb->fbdev) |
40 | nouveau_fbcon_remove(dev, drm_fb); | 40 | nouveau_fbcon_remove(dev, drm_fb); |
41 | 41 | ||
42 | if (fb->nvbo) { | 42 | if (fb->nvbo) |
43 | mutex_lock(&dev->struct_mutex); | 43 | drm_gem_object_unreference_unlocked(fb->nvbo->gem); |
44 | drm_gem_object_unreference(fb->nvbo->gem); | ||
45 | mutex_unlock(&dev->struct_mutex); | ||
46 | } | ||
47 | 44 | ||
48 | drm_framebuffer_cleanup(drm_fb); | 45 | drm_framebuffer_cleanup(drm_fb); |
49 | kfree(fb); | 46 | kfree(fb); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index ea879a2efef3..d48c59cdefe4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -401,10 +401,8 @@ nouveau_fbcon_remove(struct drm_device *dev, struct drm_framebuffer *fb) | |||
401 | 401 | ||
402 | unregister_framebuffer(info); | 402 | unregister_framebuffer(info); |
403 | nouveau_bo_unmap(nouveau_fb->nvbo); | 403 | nouveau_bo_unmap(nouveau_fb->nvbo); |
404 | mutex_lock(&dev->struct_mutex); | 404 | drm_gem_object_unreference_unlocked(nouveau_fb->nvbo->gem); |
405 | drm_gem_object_unreference(nouveau_fb->nvbo->gem); | ||
406 | nouveau_fb->nvbo = NULL; | 405 | nouveau_fb->nvbo = NULL; |
407 | mutex_unlock(&dev->struct_mutex); | ||
408 | if (par) | 406 | if (par) |
409 | drm_fb_helper_free(&par->helper); | 407 | drm_fb_helper_free(&par->helper); |
410 | framebuffer_release(info); | 408 | framebuffer_release(info); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 70cc30803e3b..34063c561899 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
@@ -167,12 +167,10 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, | |||
167 | 167 | ||
168 | ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle); | 168 | ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle); |
169 | out: | 169 | out: |
170 | mutex_lock(&dev->struct_mutex); | 170 | drm_gem_object_handle_unreference_unlocked(nvbo->gem); |
171 | drm_gem_object_handle_unreference(nvbo->gem); | ||
172 | mutex_unlock(&dev->struct_mutex); | ||
173 | 171 | ||
174 | if (ret) | 172 | if (ret) |
175 | drm_gem_object_unreference(nvbo->gem); | 173 | drm_gem_object_unreference_unlocked(nvbo->gem); |
176 | return ret; | 174 | return ret; |
177 | } | 175 | } |
178 | 176 | ||
@@ -865,9 +863,7 @@ nouveau_gem_ioctl_pin(struct drm_device *dev, void *data, | |||
865 | req->domain = NOUVEAU_GEM_DOMAIN_VRAM; | 863 | req->domain = NOUVEAU_GEM_DOMAIN_VRAM; |
866 | 864 | ||
867 | out: | 865 | out: |
868 | mutex_lock(&dev->struct_mutex); | 866 | drm_gem_object_unreference_unlocked(gem); |
869 | drm_gem_object_unreference(gem); | ||
870 | mutex_unlock(&dev->struct_mutex); | ||
871 | 867 | ||
872 | return ret; | 868 | return ret; |
873 | } | 869 | } |
@@ -891,9 +887,7 @@ nouveau_gem_ioctl_unpin(struct drm_device *dev, void *data, | |||
891 | 887 | ||
892 | ret = nouveau_bo_unpin(nouveau_gem_object(gem)); | 888 | ret = nouveau_bo_unpin(nouveau_gem_object(gem)); |
893 | 889 | ||
894 | mutex_lock(&dev->struct_mutex); | 890 | drm_gem_object_unreference_unlocked(gem); |
895 | drm_gem_object_unreference(gem); | ||
896 | mutex_unlock(&dev->struct_mutex); | ||
897 | 891 | ||
898 | return ret; | 892 | return ret; |
899 | } | 893 | } |
@@ -935,9 +929,7 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data, | |||
935 | } | 929 | } |
936 | 930 | ||
937 | out: | 931 | out: |
938 | mutex_lock(&dev->struct_mutex); | 932 | drm_gem_object_unreference_unlocked(gem); |
939 | drm_gem_object_unreference(gem); | ||
940 | mutex_unlock(&dev->struct_mutex); | ||
941 | return ret; | 933 | return ret; |
942 | } | 934 | } |
943 | 935 | ||
@@ -965,9 +957,7 @@ nouveau_gem_ioctl_cpu_fini(struct drm_device *dev, void *data, | |||
965 | ret = 0; | 957 | ret = 0; |
966 | 958 | ||
967 | out: | 959 | out: |
968 | mutex_lock(&dev->struct_mutex); | 960 | drm_gem_object_unreference_unlocked(gem); |
969 | drm_gem_object_unreference(gem); | ||
970 | mutex_unlock(&dev->struct_mutex); | ||
971 | return ret; | 961 | return ret; |
972 | } | 962 | } |
973 | 963 | ||
@@ -986,9 +976,7 @@ nouveau_gem_ioctl_info(struct drm_device *dev, void *data, | |||
986 | return -EINVAL; | 976 | return -EINVAL; |
987 | 977 | ||
988 | ret = nouveau_gem_info(gem, req); | 978 | ret = nouveau_gem_info(gem, req); |
989 | mutex_lock(&dev->struct_mutex); | 979 | drm_gem_object_unreference_unlocked(gem); |
990 | drm_gem_object_unreference(gem); | ||
991 | mutex_unlock(&dev->struct_mutex); | ||
992 | return ret; | 980 | return ret; |
993 | } | 981 | } |
994 | 982 | ||
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 | ||
diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/nv04_crtc.c index d2f143ed97c1..a1d1ebb073d9 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/nv04_crtc.c | |||
@@ -926,9 +926,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, | |||
926 | nv_crtc->cursor.set_offset(nv_crtc, nv_crtc->cursor.offset); | 926 | nv_crtc->cursor.set_offset(nv_crtc, nv_crtc->cursor.offset); |
927 | nv_crtc->cursor.show(nv_crtc, true); | 927 | nv_crtc->cursor.show(nv_crtc, true); |
928 | out: | 928 | out: |
929 | mutex_lock(&dev->struct_mutex); | 929 | drm_gem_object_unreference_unlocked(gem); |
930 | drm_gem_object_unreference(gem); | ||
931 | mutex_unlock(&dev->struct_mutex); | ||
932 | return ret; | 930 | return ret; |
933 | } | 931 | } |
934 | 932 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index d1a651e3400c..cfabeb974a56 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c | |||
@@ -358,9 +358,7 @@ nv50_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, | |||
358 | nv_crtc->cursor.show(nv_crtc, true); | 358 | nv_crtc->cursor.show(nv_crtc, true); |
359 | 359 | ||
360 | out: | 360 | out: |
361 | mutex_lock(&dev->struct_mutex); | 361 | drm_gem_object_unreference_unlocked(gem); |
362 | drm_gem_object_unreference(gem); | ||
363 | mutex_unlock(&dev->struct_mutex); | ||
364 | return ret; | 362 | return ret; |
365 | } | 363 | } |
366 | 364 | ||