Commit c3ed1103 authored by Harsha Sharma's avatar Harsha Sharma Committed by Daniel Vetter

drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()

Replace instances of drm_framebuffer_reference/unreference() with
*_get/put() suffixes and drm_dev_unref with *_put() suffix
because get/put is shorter and consistent with the
kernel use of *_get/put suffixes.
Done with following coccinelle semantic patch

@@
expression ex;
@@

(
-drm_framebuffer_unreference(ex);
+drm_framebuffer_put(ex);
|
-drm_dev_unref(ex);
+drm_dev_put(ex);
|
-drm_framebuffer_reference(ex);
+drm_framebuffer_get(ex);
)
Signed-off-by: default avatarHarsha Sharma <harshasharmaiitr@gmail.com>
[danvet: Drop the drm_dev_put change for now, to make the patch apply
with out a backmerge.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171009120643.11953-1-harshasharmaiitr@gmail.com
parent 4d58443d
...@@ -2847,7 +2847,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, ...@@ -2847,7 +2847,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
if (intel_plane_ggtt_offset(state) == plane_config->base) { if (intel_plane_ggtt_offset(state) == plane_config->base) {
fb = c->primary->fb; fb = c->primary->fb;
drm_framebuffer_reference(fb); drm_framebuffer_get(fb);
goto valid_fb; goto valid_fb;
} }
} }
...@@ -2878,7 +2878,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, ...@@ -2878,7 +2878,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
intel_crtc->pipe, PTR_ERR(intel_state->vma)); intel_crtc->pipe, PTR_ERR(intel_state->vma));
intel_state->vma = NULL; intel_state->vma = NULL;
drm_framebuffer_unreference(fb); drm_framebuffer_put(fb);
return; return;
} }
...@@ -2899,7 +2899,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, ...@@ -2899,7 +2899,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
if (i915_gem_object_is_tiled(obj)) if (i915_gem_object_is_tiled(obj))
dev_priv->preserve_bios_swizzle = true; dev_priv->preserve_bios_swizzle = true;
drm_framebuffer_reference(fb); drm_framebuffer_get(fb);
primary->fb = primary->state->fb = fb; primary->fb = primary->state->fb = fb;
primary->crtc = primary->state->crtc = &intel_crtc->base; primary->crtc = primary->state->crtc = &intel_crtc->base;
...@@ -9846,7 +9846,7 @@ mode_fits_in_fbdev(struct drm_device *dev, ...@@ -9846,7 +9846,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
if (obj->base.size < mode->vdisplay * fb->pitches[0]) if (obj->base.size < mode->vdisplay * fb->pitches[0])
return NULL; return NULL;
drm_framebuffer_reference(fb); drm_framebuffer_get(fb);
return fb; return fb;
#else #else
return NULL; return NULL;
...@@ -10027,7 +10027,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, ...@@ -10027,7 +10027,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
if (ret) if (ret)
goto fail; goto fail;
drm_framebuffer_unreference(fb); drm_framebuffer_put(fb);
ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode); ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
if (ret) if (ret)
......
...@@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper, ...@@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
" releasing it\n", " releasing it\n",
intel_fb->base.width, intel_fb->base.height, intel_fb->base.width, intel_fb->base.height,
sizes->fb_width, sizes->fb_height); sizes->fb_width, sizes->fb_height);
drm_framebuffer_unreference(&intel_fb->base); drm_framebuffer_put(&intel_fb->base);
intel_fb = ifbdev->fb = NULL; intel_fb = ifbdev->fb = NULL;
} }
if (!intel_fb || WARN_ON(!intel_fb->obj)) { if (!intel_fb || WARN_ON(!intel_fb->obj)) {
...@@ -627,7 +627,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev, ...@@ -627,7 +627,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8; ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
ifbdev->fb = fb; ifbdev->fb = fb;
drm_framebuffer_reference(&ifbdev->fb->base); drm_framebuffer_get(&ifbdev->fb->base);
/* Final pass to check if any active pipes don't have fbs */ /* Final pass to check if any active pipes don't have fbs */
for_each_crtc(dev, crtc) { for_each_crtc(dev, crtc) {
......
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