Commit f7a8cd30 authored by Emil Velikov's avatar Emil Velikov Committed by Emil Velikov

drm/vc4: remove _unlocked suffix in drm_gem_object_put_unlocked

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: Eric Anholt <eric@anholt.net>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-34-emil.l.velikov@gmail.com
parent 2b86189e
...@@ -490,7 +490,7 @@ int vc4_dumb_create(struct drm_file *file_priv, ...@@ -490,7 +490,7 @@ int vc4_dumb_create(struct drm_file *file_priv,
bo->madv = VC4_MADV_WILLNEED; bo->madv = VC4_MADV_WILLNEED;
ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle);
drm_gem_object_put_unlocked(&bo->base.base); drm_gem_object_put(&bo->base.base);
return ret; return ret;
} }
...@@ -834,7 +834,7 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data, ...@@ -834,7 +834,7 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
bo->madv = VC4_MADV_WILLNEED; bo->madv = VC4_MADV_WILLNEED;
ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle);
drm_gem_object_put_unlocked(&bo->base.base); drm_gem_object_put(&bo->base.base);
return ret; return ret;
} }
...@@ -854,7 +854,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, ...@@ -854,7 +854,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data,
/* The mmap offset was set up at BO allocation time. */ /* The mmap offset was set up at BO allocation time. */
args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node); args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node);
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
return 0; return 0;
} }
...@@ -918,7 +918,7 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, ...@@ -918,7 +918,7 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data,
ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle);
fail: fail:
drm_gem_object_put_unlocked(&bo->base.base); drm_gem_object_put(&bo->base.base);
return ret; return ret;
} }
...@@ -965,7 +965,7 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ...@@ -965,7 +965,7 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data,
bo = to_vc4_bo(gem_obj); bo = to_vc4_bo(gem_obj);
bo->t_format = t_format; bo->t_format = t_format;
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
return 0; return 0;
} }
...@@ -1000,7 +1000,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ...@@ -1000,7 +1000,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data,
else else
args->modifier = DRM_FORMAT_MOD_NONE; args->modifier = DRM_FORMAT_MOD_NONE;
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
return 0; return 0;
} }
...@@ -1091,7 +1091,7 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data, ...@@ -1091,7 +1091,7 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data,
ret = -ENOMEM; ret = -ENOMEM;
mutex_unlock(&vc4->bo_lock); mutex_unlock(&vc4->bo_lock);
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
return ret; return ret;
} }
...@@ -58,7 +58,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state) ...@@ -58,7 +58,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state)
unsigned int i; unsigned int i;
for (i = 0; i < state->user_state.bo_count; i++) for (i = 0; i < state->user_state.bo_count; i++)
drm_gem_object_put_unlocked(state->bo[i]); drm_gem_object_put(state->bo[i]);
kfree(state); kfree(state);
} }
...@@ -808,7 +808,7 @@ vc4_cl_lookup_bos(struct drm_device *dev, ...@@ -808,7 +808,7 @@ vc4_cl_lookup_bos(struct drm_device *dev,
fail_put_bo: fail_put_bo:
/* Release any reference to acquired objects. */ /* Release any reference to acquired objects. */
for (i = 0; i < exec->bo_count && exec->bo[i]; i++) for (i = 0; i < exec->bo_count && exec->bo[i]; i++)
drm_gem_object_put_unlocked(&exec->bo[i]->base); drm_gem_object_put(&exec->bo[i]->base);
fail: fail:
kvfree(handles); kvfree(handles);
...@@ -957,7 +957,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) ...@@ -957,7 +957,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
struct vc4_bo *bo = to_vc4_bo(&exec->bo[i]->base); struct vc4_bo *bo = to_vc4_bo(&exec->bo[i]->base);
vc4_bo_dec_usecnt(bo); vc4_bo_dec_usecnt(bo);
drm_gem_object_put_unlocked(&exec->bo[i]->base); drm_gem_object_put(&exec->bo[i]->base);
} }
kvfree(exec->bo); kvfree(exec->bo);
} }
...@@ -966,7 +966,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) ...@@ -966,7 +966,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
struct vc4_bo *bo = list_first_entry(&exec->unref_list, struct vc4_bo *bo = list_first_entry(&exec->unref_list,
struct vc4_bo, unref_head); struct vc4_bo, unref_head);
list_del(&bo->unref_head); list_del(&bo->unref_head);
drm_gem_object_put_unlocked(&bo->base.base); drm_gem_object_put(&bo->base.base);
} }
/* Free up the allocation of any bin slots we used. */ /* Free up the allocation of any bin slots we used. */
...@@ -1107,7 +1107,7 @@ vc4_wait_bo_ioctl(struct drm_device *dev, void *data, ...@@ -1107,7 +1107,7 @@ vc4_wait_bo_ioctl(struct drm_device *dev, void *data,
ret = vc4_wait_for_seqno_ioctl_helper(dev, bo->seqno, ret = vc4_wait_for_seqno_ioctl_helper(dev, bo->seqno,
&args->timeout_ns); &args->timeout_ns);
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
return ret; return ret;
} }
...@@ -1301,7 +1301,7 @@ vc4_gem_destroy(struct drm_device *dev) ...@@ -1301,7 +1301,7 @@ vc4_gem_destroy(struct drm_device *dev)
* the overflow allocation registers. Now free the object. * the overflow allocation registers. Now free the object.
*/ */
if (vc4->bin_bo) { if (vc4->bin_bo) {
drm_gem_object_put_unlocked(&vc4->bin_bo->base.base); drm_gem_object_put(&vc4->bin_bo->base.base);
vc4->bin_bo = NULL; vc4->bin_bo = NULL;
} }
...@@ -1382,7 +1382,7 @@ int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data, ...@@ -1382,7 +1382,7 @@ int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data,
ret = 0; ret = 0;
out_put_gem: out_put_gem:
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
return ret; return ret;
} }
...@@ -330,7 +330,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, ...@@ -330,7 +330,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev,
mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE;
} }
drm_gem_object_put_unlocked(gem_obj); drm_gem_object_put(gem_obj);
mode_cmd = &mode_cmd_local; mode_cmd = &mode_cmd_local;
} }
......
...@@ -308,7 +308,7 @@ static int bin_bo_alloc(struct vc4_dev *vc4) ...@@ -308,7 +308,7 @@ static int bin_bo_alloc(struct vc4_dev *vc4)
struct vc4_bo, unref_head); struct vc4_bo, unref_head);
list_del(&bo->unref_head); list_del(&bo->unref_head);
drm_gem_object_put_unlocked(&bo->base.base); drm_gem_object_put(&bo->base.base);
} }
return ret; return ret;
...@@ -344,7 +344,7 @@ static void bin_bo_release(struct kref *ref) ...@@ -344,7 +344,7 @@ static void bin_bo_release(struct kref *ref)
if (WARN_ON_ONCE(!vc4->bin_bo)) if (WARN_ON_ONCE(!vc4->bin_bo))
return; return;
drm_gem_object_put_unlocked(&vc4->bin_bo->base.base); drm_gem_object_put(&vc4->bin_bo->base.base);
vc4->bin_bo = NULL; vc4->bin_bo = NULL;
} }
......
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