]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd: remove _unlocked suffix in drm_gem_object_put_unlocked
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 15 May 2020 09:50:54 +0000 (10:50 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 19 May 2020 21:31:31 +0000 (22:31 +0100)
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Just drop the suffix. It makes the API cleaner.

Done via the following script:

__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
  sed -i  "s/$__from/$__to/g" $__file;
done

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-15-emil.l.velikov@gmail.com
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c

index 85b0515c0fdcf7c0e69558988fdbb534c9efa302..4053597b3af2b6dd24085f3f13ac9897b4bf2322 100644 (file)
@@ -102,7 +102,7 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp,
                }
 
                bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj));
-               drm_gem_object_put_unlocked(gobj);
+               drm_gem_object_put(gobj);
 
                usermm = amdgpu_ttm_tt_get_usermm(bo->tbo.ttm);
                if (usermm) {
index af91627b19b0c5dd42a924fc2169136fd5165934..76ea245f210683c5352ff124a82bac3473076d59 100644 (file)
@@ -57,7 +57,7 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p,
        /* One for TTM and one for the CS job */
        p->uf_entry.tv.num_shared = 2;
 
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
 
        size = amdgpu_bo_size(bo);
        if (size != PAGE_SIZE || (data->offset + 8) > size) {
index 84cee27cd7efb4c4b05b40f099cc2ef117c29ec0..de9b62e2800ae781ef63ff7abc828d87307dd164 100644 (file)
@@ -575,14 +575,14 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
 
        amdgpu_fb = kzalloc(sizeof(*amdgpu_fb), GFP_KERNEL);
        if (amdgpu_fb == NULL) {
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ERR_PTR(-ENOMEM);
        }
 
        ret = amdgpu_display_framebuffer_init(dev, amdgpu_fb, mode_cmd, obj);
        if (ret) {
                kfree(amdgpu_fb);
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ERR_PTR(ret);
        }
 
index 652c57a3b847836be44cca7be9587f08dbd94fe5..43d8ed7dbd0018d66192e43f487f5aadc814fc4c 100644 (file)
@@ -587,7 +587,7 @@ struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev,
        attach = dma_buf_dynamic_attach(dma_buf, dev->dev,
                                        &amdgpu_dma_buf_attach_ops, obj);
        if (IS_ERR(attach)) {
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ERR_CAST(attach);
        }
 
index 9ae7b61f696a244c7182b06843330728ec455e47..ca5dde4ec47d71af6324f2212936d59ff7058c5d 100644 (file)
@@ -114,7 +114,7 @@ static void amdgpufb_destroy_pinned_object(struct drm_gem_object *gobj)
                amdgpu_bo_unpin(abo);
                amdgpu_bo_unreserve(abo);
        }
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
 }
 
 static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
@@ -279,7 +279,7 @@ out:
 
        }
        if (fb && ret) {
-               drm_gem_object_put_unlocked(gobj);
+               drm_gem_object_put(gobj);
                drm_framebuffer_unregister_private(fb);
                drm_framebuffer_cleanup(fb);
                kfree(fb);
index e42608115c99a5c4b574471c1717d992b15376ae..8c0597f306ecb8d562a2e515f7c4222ca0d26caf 100644 (file)
@@ -106,7 +106,7 @@ void amdgpu_gem_force_release(struct amdgpu_device *adev)
                spin_lock(&file->table_lock);
                idr_for_each_entry(&file->object_idr, gobj, handle) {
                        WARN_ONCE(1, "And also active allocations!\n");
-                       drm_gem_object_put_unlocked(gobj);
+                       drm_gem_object_put(gobj);
                }
                idr_destroy(&file->object_idr);
                spin_unlock(&file->table_lock);
@@ -272,7 +272,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 
        r = drm_gem_handle_create(filp, gobj, &handle);
        /* drop reference from allocate - handle holds it now */
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        if (r)
                return r;
 
@@ -356,7 +356,7 @@ user_pages_done:
                amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
 
 release_object:
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
 
        return r;
 }
@@ -375,11 +375,11 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp,
        robj = gem_to_amdgpu_bo(gobj);
        if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm) ||
            (robj->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) {
-               drm_gem_object_put_unlocked(gobj);
+               drm_gem_object_put(gobj);
                return -EPERM;
        }
        *offset_p = amdgpu_bo_mmap_offset(robj);
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        return 0;
 }
 
@@ -449,7 +449,7 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
        } else
                r = ret;
 
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        return r;
 }
 
@@ -492,7 +492,7 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data,
 unreserve:
        amdgpu_bo_unreserve(robj);
 out:
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        return r;
 }
 
@@ -691,7 +691,7 @@ error_backoff:
        ttm_eu_backoff_reservation(&ticket, &list);
 
 error_unref:
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        return r;
 }
 
@@ -767,7 +767,7 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
        }
 
 out:
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        return r;
 }
 
@@ -804,7 +804,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
 
        r = drm_gem_handle_create(file_priv, gobj, &handle);
        /* drop reference from allocate - handle holds it now */
-       drm_gem_object_put_unlocked(gobj);
+       drm_gem_object_put(gobj);
        if (r) {
                return r;
        }
index 2512e7ebfedf2ef00be981a5528b5981dba555ec..47a6e3d0aa9685affb1f14d47cd6536da94146db 100644 (file)
@@ -2404,7 +2404,7 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc,
        aobj = gem_to_amdgpu_bo(obj);
        ret = amdgpu_bo_reserve(aobj, false);
        if (ret != 0) {
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
 
@@ -2412,7 +2412,7 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc,
        amdgpu_bo_unreserve(aobj);
        if (ret) {
                DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
        amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
@@ -2447,7 +2447,7 @@ unpin:
                        amdgpu_bo_unpin(aobj);
                        amdgpu_bo_unreserve(aobj);
                }
-               drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
+               drm_gem_object_put(amdgpu_crtc->cursor_bo);
        }
 
        amdgpu_crtc->cursor_bo = obj;
index 0dde22db9848690f1e50c3be0e819ed03151aece..7d16fb5a948279f0cadefc553176d1ea86b79c31 100644 (file)
@@ -2483,7 +2483,7 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc,
        aobj = gem_to_amdgpu_bo(obj);
        ret = amdgpu_bo_reserve(aobj, false);
        if (ret != 0) {
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
 
@@ -2491,7 +2491,7 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc,
        amdgpu_bo_unreserve(aobj);
        if (ret) {
                DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
        amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
@@ -2526,7 +2526,7 @@ unpin:
                        amdgpu_bo_unpin(aobj);
                        amdgpu_bo_unreserve(aobj);
                }
-               drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
+               drm_gem_object_put(amdgpu_crtc->cursor_bo);
        }
 
        amdgpu_crtc->cursor_bo = obj;
index 84219534bd38c6ac3f73749b977605c7b161b593..1ab33aa3980ec695a8fb5c6d201d601eb87cd683 100644 (file)
@@ -2299,7 +2299,7 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc,
        aobj = gem_to_amdgpu_bo(obj);
        ret = amdgpu_bo_reserve(aobj, false);
        if (ret != 0) {
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
 
@@ -2307,7 +2307,7 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc,
        amdgpu_bo_unreserve(aobj);
        if (ret) {
                DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
        amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
@@ -2342,7 +2342,7 @@ unpin:
                        amdgpu_bo_unpin(aobj);
                        amdgpu_bo_unreserve(aobj);
                }
-               drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
+               drm_gem_object_put(amdgpu_crtc->cursor_bo);
        }
 
        amdgpu_crtc->cursor_bo = obj;
index 3a640702d7d193ad44bb216fe7ace2b0507df236..8a8f1aa4921246fff54b792b232853dc15baa248 100644 (file)
@@ -2305,7 +2305,7 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc,
        aobj = gem_to_amdgpu_bo(obj);
        ret = amdgpu_bo_reserve(aobj, false);
        if (ret != 0) {
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
 
@@ -2313,7 +2313,7 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc,
        amdgpu_bo_unreserve(aobj);
        if (ret) {
                DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
-               drm_gem_object_put_unlocked(obj);
+               drm_gem_object_put(obj);
                return ret;
        }
        amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
@@ -2348,7 +2348,7 @@ unpin:
                        amdgpu_bo_unpin(aobj);
                        amdgpu_bo_unreserve(aobj);
                }
-               drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
+               drm_gem_object_put(amdgpu_crtc->cursor_bo);
        }
 
        amdgpu_crtc->cursor_bo = obj;