Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/armada: Replace drm_framebuffer_reference/unreference() with _get/put()

This patch replace instances of drm_framebuffer_reference/unreference with
*_get/put() suffixes, because get/put is shorter and consistent with the
kernel use of *_get/put suffixes.
This was done with the following Coccinelle script:

@r1@
expression e;
@@

(
-drm_framebuffer_reference(e);
+drm_framebuffer_get(e);
|
-drm_framebuffer_unreference(e);
+drm_framebuffer_put(e);
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/e1df1b3375faa819029559b11c32e10501c5c5d6.1505932812.git.hamohammed.sa@gmail.com

authored by

Haneen Mohammed and committed by
Sean Paul
a52ff2a5 4c3cf375

+10 -10
+7 -7
drivers/gpu/drm/armada/armada_crtc.c
··· 298 298 299 299 if (force) { 300 300 /* Display is disabled, so just drop the old fb */ 301 - drm_framebuffer_unreference(fb); 301 + drm_framebuffer_put(fb); 302 302 return; 303 303 } 304 304 ··· 321 321 * the best. The worst that will happen is the buffer gets 322 322 * reused before it has finished being displayed. 323 323 */ 324 - drm_framebuffer_unreference(fb); 324 + drm_framebuffer_put(fb); 325 325 } 326 326 327 327 static void armada_drm_vblank_off(struct armada_crtc *dcrtc) ··· 577 577 unsigned i; 578 578 bool interlaced; 579 579 580 - drm_framebuffer_reference(crtc->primary->fb); 580 + drm_framebuffer_get(crtc->primary->fb); 581 581 582 582 interlaced = !!(adj->flags & DRM_MODE_FLAG_INTERLACE); 583 583 ··· 718 718 MAX_SCHEDULE_TIMEOUT); 719 719 720 720 /* Take a reference to the new fb as we're using it */ 721 - drm_framebuffer_reference(crtc->primary->fb); 721 + drm_framebuffer_get(crtc->primary->fb); 722 722 723 723 /* Update the base in the CRTC */ 724 724 armada_drm_crtc_update_regs(dcrtc, regs); ··· 742 742 * primary plane. 743 743 */ 744 744 if (plane->fb) 745 - drm_framebuffer_unreference(plane->fb); 745 + drm_framebuffer_put(plane->fb); 746 746 747 747 /* Power down the Y/U/V FIFOs */ 748 748 sram_para1 = CFG_PDWN16x66 | CFG_PDWN32x66; ··· 1045 1045 * Ensure that we hold a reference on the new framebuffer. 1046 1046 * This has to match the behaviour in mode_set. 1047 1047 */ 1048 - drm_framebuffer_reference(fb); 1048 + drm_framebuffer_get(fb); 1049 1049 1050 1050 ret = armada_drm_crtc_queue_frame_work(dcrtc, work); 1051 1051 if (ret) { 1052 1052 /* Undo our reference above */ 1053 - drm_framebuffer_unreference(fb); 1053 + drm_framebuffer_put(fb); 1054 1054 kfree(work); 1055 1055 return ret; 1056 1056 }
+1 -1
drivers/gpu/drm/armada/armada_drv.c
··· 25 25 struct drm_framebuffer *fb; 26 26 27 27 while (kfifo_get(&priv->fb_unref, &fb)) 28 - drm_framebuffer_unreference(fb); 28 + drm_framebuffer_put(fb); 29 29 } 30 30 31 31 /* Must be called with dev->event_lock held */
+2 -2
drivers/gpu/drm/armada/armada_overlay.c
··· 177 177 * Take a reference on the new framebuffer - we want to 178 178 * hold on to it while the hardware is displaying it. 179 179 */ 180 - drm_framebuffer_reference(fb); 180 + drm_framebuffer_get(fb); 181 181 182 182 if (plane->fb) 183 183 armada_ovl_retire_fb(dplane, plane->fb); ··· 278 278 279 279 fb = xchg(&dplane->old_fb, NULL); 280 280 if (fb) 281 - drm_framebuffer_unreference(fb); 281 + drm_framebuffer_put(fb); 282 282 283 283 return 0; 284 284 }