From patchwork Wed Sep 20 18:57:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haneen Mohammed X-Patchwork-Id: 9962639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B47AD60208 for ; Wed, 20 Sep 2017 21:41:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A564A2925D for ; Wed, 20 Sep 2017 21:41:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A13E2926B; Wed, 20 Sep 2017 21:41:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D7F92925D for ; Wed, 20 Sep 2017 21:41:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 893916E744; Wed, 20 Sep 2017 21:41:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CA266E796 for ; Wed, 20 Sep 2017 18:57:19 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id a7so1523672pfj.5 for ; Wed, 20 Sep 2017 11:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kXAoRyHqA/cA/ZOs5dyd88yoPJCOA+PWTP79T7Sg+ds=; b=a+miB8oZufpNsN4c4h2iW+6DaYmP8cZvMGGIvkCQo2C+eiJAi/W5/yK1M/WYzgqY8m d3scW+nS8Z4EDieAaQcqAytUzEaGaStB5T/DUTTL2jecCahgEjA8Eo5MORitXcJMRv6u VuaxipDWZIcLt673QpZpoqeVKgG1rsEC/EzwF1AW7aWMKK4tG0NQFqrhF4qsLvYL+uGv XfM3tNwcxQRUSpGK9nV02uD/TEDeZW0PTSD6pL5LpJrvColcDxs0z8HKWLyusLWPa5SM UwqAdAn4gakD1wKLgQJjSjdI4Qy5vP21+d+1ori/nas43erMQBlGjcyjDfSxpq28bEBa nzyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kXAoRyHqA/cA/ZOs5dyd88yoPJCOA+PWTP79T7Sg+ds=; b=KzLxy7mnbiA42PfuKti1bKMhwlovO+fheR2Yw+NTLryagBMzDsNvmRdjB8/KVGzQTe bMLbCBYF7d3B0aRDni+UlWz3ULmK9p5oea6fzTpcqSpEFwbnKCdRXoys840J0rnGD2Tn vxkBAZ/YZ7lzHBml22IEiQSO2GzEnXFJ9H1e9BjnIp0+0XjVU+jVMW8WBFhq0rXhYyIQ D1ury1WhiAFunuYrKsTgiCdV1VR72HfN8N5vSE17CZy4oqXRJgsyBVCBwgJ6ot+pYegK N8vlU0wtsf7MxnPPu3qxefumXmFVjI+hU991d4f+oJdOpvfYzjCg8jWCLudCiC/8wkFh e6bA== X-Gm-Message-State: AHPjjUg0GQXG+xEDPobqkaYsfVgFUiPR8dEJTWHFhwUhCyGMhWH8PfMZ t1QfVOE9vllJBdzFP/7kow0= X-Google-Smtp-Source: AOwi7QCcKbXIfy1V4AH6FiFKYU1WtxyMHTknabc3DyiOImd9qooP2Q3UBl8lj+m5hGS/VzCUkb/FIQ== X-Received: by 10.101.72.199 with SMTP id o7mr3212681pgs.450.1505933838894; Wed, 20 Sep 2017 11:57:18 -0700 (PDT) Received: from Haneen ([64.77.242.50]) by smtp.gmail.com with ESMTPSA id a29sm473448pfj.88.2017.09.20.11.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Sep 2017 11:57:18 -0700 (PDT) Date: Wed, 20 Sep 2017 12:57:16 -0600 From: Haneen Mohammed To: outreachy-kernel Subject: [RESEND PATCH 2/2] drm/armada: Replace drm_framebuffer_reference/unreference() with _get/put() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Mailman-Approved-At: Wed, 20 Sep 2017 21:41:09 +0000 Cc: hamohammed.sa@gmail.com, gregkh@linuxfoundation.org, Russell King , dri-devel@lists.freedesktop.org, Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/armada/armada_crtc.c | 14 +++++++------- drivers/gpu/drm/armada/armada_drv.c | 2 +- drivers/gpu/drm/armada/armada_overlay.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 381dfa1..2e065fa 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -298,7 +298,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc, if (force) { /* Display is disabled, so just drop the old fb */ - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); return; } @@ -321,7 +321,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc, * the best. The worst that will happen is the buffer gets * reused before it has finished being displayed. */ - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); } static void armada_drm_vblank_off(struct armada_crtc *dcrtc) @@ -577,7 +577,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc, unsigned i; bool interlaced; - drm_framebuffer_reference(crtc->primary->fb); + drm_framebuffer_get(crtc->primary->fb); interlaced = !!(adj->flags & DRM_MODE_FLAG_INTERLACE); @@ -718,7 +718,7 @@ static int armada_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, MAX_SCHEDULE_TIMEOUT); /* Take a reference to the new fb as we're using it */ - drm_framebuffer_reference(crtc->primary->fb); + drm_framebuffer_get(crtc->primary->fb); /* Update the base in the CRTC */ armada_drm_crtc_update_regs(dcrtc, regs); @@ -742,7 +742,7 @@ void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc, * primary plane. */ if (plane->fb) - drm_framebuffer_unreference(plane->fb); + drm_framebuffer_put(plane->fb); /* Power down the Y/U/V FIFOs */ sram_para1 = CFG_PDWN16x66 | CFG_PDWN32x66; @@ -1045,12 +1045,12 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc, * Ensure that we hold a reference on the new framebuffer. * This has to match the behaviour in mode_set. */ - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); ret = armada_drm_crtc_queue_frame_work(dcrtc, work); if (ret) { /* Undo our reference above */ - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); kfree(work); return ret; } diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 0b3227c..c993bcc 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -26,7 +26,7 @@ static void armada_drm_unref_work(struct work_struct *work) struct drm_framebuffer *fb; while (kfifo_get(&priv->fb_unref, &fb)) - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); } /* Must be called with dev->event_lock held */ diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index edc4491..b411b60 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -177,7 +177,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, * Take a reference on the new framebuffer - we want to * hold on to it while the hardware is displaying it. */ - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); if (plane->fb) armada_ovl_retire_fb(dplane, plane->fb); @@ -278,7 +278,7 @@ static int armada_ovl_plane_disable(struct drm_plane *plane, fb = xchg(&dplane->old_fb, NULL); if (fb) - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); return 0; }