From patchwork Mon Oct 9 12:06:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: harsha sharma X-Patchwork-Id: 9995219 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 5938E60216 for ; Tue, 10 Oct 2017 07:38:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AC7A27F89 for ; Tue, 10 Oct 2017 07:38:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FA2B2808F; Tue, 10 Oct 2017 07:38:13 +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=unavailable 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 F08B727F89 for ; Tue, 10 Oct 2017 07:38:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4A006E3B5; Tue, 10 Oct 2017 07:37:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4624F6E30E; Mon, 9 Oct 2017 12:09:08 +0000 (UTC) Received: by mail-pf0-x241.google.com with SMTP id m28so27152995pfi.0; Mon, 09 Oct 2017 05:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KXSPjlrziZmFVrvsjSGtPQdnMBukwPLvP4jdApfyBCE=; b=Tytcv3XQCxXbJ0IwSvukp85SnVpsx2ZXHzifHSHoi5EcBQZMmokHAqENoeZ2HPBFGt ym0ZanjtB4D0cFui8LQqz/9Mk9C7jby3gDm4tziJQddueRdHg3KjP+l4mYTbOngUgU1b 1rOU80tQkzZa52vCZtP1h6WzBbMJ54fpQU41Rh/T27Rw5dEZNhult1teA7zZVz1HO2Z/ aiHYiQBegAym63x0Q7c/EMwB0NRJ6VUzbNqw2qzXxgV0OwE3UcGC7DHc69Zmc+8V1nkf FMx0ImFlRwrj/0whtn2rNp03bRpq3g2Ot/TJohq7MCfXjvIflUicP5r2pRVQjX/vb3hG 7D2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KXSPjlrziZmFVrvsjSGtPQdnMBukwPLvP4jdApfyBCE=; b=pOxfuW5+gkgbDXJV85GnRkGc6DXAA1LXV/JN8b6Bs0IQdnwuz8Za0I8ui2p4cy7dK4 +OoYELyPDksnAxQ9XTMIGmh67gK3ywHX0r15XIMiifjYlYQPv1iUNUPAqCAx1VpquNvS kz9Y2W5MwyPvhc1w8sPZN2T2U8IRleJE22XF0/kuY/Z31fCjgY/g+HA/22ZUXhS/pGO6 /56rWyyrepYhGqlrkUR35E2I/go92ApYrU1z4JrZz5QwYUO4CwmpNSlRzK56/G/o5IiM oR2LjsStXMq1eu4DdLI/G1k/GpM734FGMRVy/pfdosRd0nUA6hnNA5Z4jGlKPk+FWwBQ h8og== X-Gm-Message-State: AMCzsaUF8Ir6nF2sl7VGXI4qSy48ZJD5YmOKG5jkJQwdrWEik/GD2H9Z vLCpsUfY7GG6wg6ekJfWmyY= X-Google-Smtp-Source: AOwi7QAUyGf0MZ5t8DvThlb9UTxHup7q5hNZMtx/YKi/0J6VrTnf21f7WndHwbLhxxG77pYOjyW0iA== X-Received: by 10.99.149.15 with SMTP id p15mr9122215pgd.406.1507550946681; Mon, 09 Oct 2017 05:09:06 -0700 (PDT) Received: from localhost.localdomain ([103.37.201.27]) by smtp.gmail.com with ESMTPSA id e7sm15429278pfi.188.2017.10.09.05.08.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 05:09:06 -0700 (PDT) From: Harsha Sharma To: daniel.vetter@ffwll.ch, seanpaul@chromium.org, jani.nikula@linux.intel.com Subject: [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Date: Mon, 9 Oct 2017 17:36:43 +0530 Message-Id: <20171009120643.11953-1-harshasharmaiitr@gmail.com> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Tue, 10 Oct 2017 07:37:50 +0000 Cc: outreachy-kernel@googlegroups.com, intel-gfx@lists.freedesktop.org, Harsha Sharma , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: Harsha Sharma --- Changes in v4: -change one instance of *_put to *_get Changes in v3: -Removed changes in selftests Changes in v2: -Added cocinelle patch in log message -cc to all driver-specific mailing lists drivers/gpu/drm/i915/i915_pci.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 10 +++++----- drivers/gpu/drm/i915/intel_fbdev.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 09d97e0990b7..2f106cca46b4 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev) struct drm_device *dev = pci_get_drvdata(pdev); i915_driver_unload(dev); - drm_dev_unref(dev); + drm_dev_put(dev); } static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 64f7b51ed97c..cb62f7e5d59a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, if (intel_plane_ggtt_offset(state) == plane_config->base) { fb = c->primary->fb; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); goto valid_fb; } } @@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, intel_crtc->pipe, PTR_ERR(intel_state->vma)); intel_state->vma = NULL; - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); return; } @@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, if (i915_gem_object_is_tiled(obj)) dev_priv->preserve_bios_swizzle = true; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); primary->fb = primary->state->fb = fb; primary->crtc = primary->state->crtc = &intel_crtc->base; @@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev, if (obj->base.size < mode->vdisplay * fb->pitches[0]) return NULL; - drm_framebuffer_reference(fb); + drm_framebuffer_get(fb); return fb; #else return NULL; @@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, if (ret) goto fail; - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode); if (ret) diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index 262e75c00dd2..e34334a1fbf9 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper, " releasing it\n", intel_fb->base.width, intel_fb->base.height, sizes->fb_width, sizes->fb_height); - drm_framebuffer_unreference(&intel_fb->base); + drm_framebuffer_put(&intel_fb->base); intel_fb = ifbdev->fb = NULL; } if (!intel_fb || WARN_ON(!intel_fb->obj)) { @@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev, ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8; 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 */ for_each_crtc(dev, crtc) {