diff options
author | Thierry Reding <treding@nvidia.com> | 2017-02-28 17:46:38 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-02-28 18:14:55 +0300 |
commit | 020a218f95bd3ceff7dd1022ff7ebc0497bc7bf9 (patch) | |
tree | 343a200b9e4373a380dad7d00dd26fb90a8338e1 /drivers/gpu/drm/drm_atomic.c | |
parent | 2135ea7aafa26b6bfbbd304459fdb624e82e021e (diff) | |
download | linux-020a218f95bd3ceff7dd1022ff7ebc0497bc7bf9.tar.xz |
drm: Introduce drm_mode_object_{get,put}()
For consistency with other reference counting APIs in the kernel, add
drm_mode_object_get() and drm_mode_object_put() to reference count DRM
mode objects.
Compatibility aliases are added to keep existing code working. To help
speed up the transition, all the instances of the old functions in the
DRM core are already replaced in this commit.
A semantic patch is provided that can be used to convert all drivers to
the new helpers.
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-3-thierry.reding@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 08d03d4594ee..39e470eb8aea 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -2238,13 +2238,13 @@ retry: } if (!obj->properties) { - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); ret = -ENOENT; goto out; } if (get_user(count_props, count_props_ptr + copied_objs)) { - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); ret = -EFAULT; goto out; } @@ -2257,14 +2257,14 @@ retry: struct drm_property *prop; if (get_user(prop_id, props_ptr + copied_props)) { - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); ret = -EFAULT; goto out; } prop = drm_mode_obj_find_prop_id(obj, prop_id); if (!prop) { - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); ret = -ENOENT; goto out; } @@ -2272,14 +2272,14 @@ retry: if (copy_from_user(&prop_value, prop_values_ptr + copied_props, sizeof(prop_value))) { - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); ret = -EFAULT; goto out; } ret = atomic_set_prop(state, obj, prop, prop_value); if (ret) { - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); goto out; } @@ -2292,7 +2292,7 @@ retry: plane_mask |= (1 << drm_plane_index(plane)); plane->old_fb = plane->fb; } - drm_mode_object_unreference(obj); + drm_mode_object_put(obj); } ret = prepare_crtc_signaling(dev, state, arg, file_priv, &fence_state, |