From patchwork Sun Oct 8 14:04:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: harsha sharma X-Patchwork-Id: 9991859 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 28D5F60231 for ; Sun, 8 Oct 2017 15:43:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C518285D2 for ; Sun, 8 Oct 2017 15:43:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00F8D285E0; Sun, 8 Oct 2017 15:43:23 +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 A3C25285D2 for ; Sun, 8 Oct 2017 15:43:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D6EA6E2D7; Sun, 8 Oct 2017 15:42:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id D92BA6E0AB; Sun, 8 Oct 2017 14:06:37 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id b11so14890819pgn.0; Sun, 08 Oct 2017 07:06:37 -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=rg43mTR6XSrbfDuk4XdZW9EQXYKs8Lxs/dNWX9ukEYc=; b=hLb7GsaZmsg9vBrBh7w1CrUxZJKeZEti5mvpoPW+QgcCSB4dOFvB/mckOJmm030ogi +qCFAEOXPN35BVA2uHuEyMjHutCoJz3JJNY62LAljP1pPE6WYbRbJW9pnWcWpj8RLWKQ dfA+GqxBRQfwbdrfUHAu6Cf/8s2R2+DEouGVa1Jw9OOa10BbWphsaaPQyghAFF1NUaRx D97Qt+G5ZMZL1UEkuy4+SQ+xlDctJ5GYbS9QPwoFA9wYgb7iJEtJMRgIkXquF4Wcavdv r1RcmoEIhETdODzgC3kEUhfB43UvQjhw3qXsQnS+NDSb5TOQ/+DHuYrVIkOKuVY0rBZH 4ifw== 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=rg43mTR6XSrbfDuk4XdZW9EQXYKs8Lxs/dNWX9ukEYc=; b=I7qUZ4B7HA5yv+flyJ2akZzm5U4Ya3IVa/VbdRbudE5BE0TnzworTubDEO59owCTpc WrlCbC7SOLWvgbJmqa+l8I9U0pEPcOxkTSX3oGTSADuD+EnJ4zPZ9X6L4W+QRXdkdyOe bR8c2pUqwbzQpreF/rBfotxi280qKqq7+X/e+54Rjhe+v/kNSztKVTVdlwO0VQKb9n+y 0qTnmqEbCzfukfDmzG96+PJ1yMjgb487n45cjCxUTQqps9955/p1goqhfhFfD+KdvS7Y +XLRGer5ikO7iJlbtKclgQaZVdYjrPSY20RdfhzCZuQazbwkUNd2L2AgUjclXRCzgygA v2zw== X-Gm-Message-State: AMCzsaUVXLscwV67EgJRtKW5yjklFe36ltutaphUVjTN612HB8KVNWbc nPQNiUgix43GxkT1OW3iHos= X-Google-Smtp-Source: AOwi7QDSsHRL8ADlg8VYTUAmtxKqwiYlOPDTaq7fygFTWFAVInV6Akzke5DTB+wglYwBvtRRWUr4LQ== X-Received: by 10.99.156.26 with SMTP id f26mr6915580pge.433.1507471597279; Sun, 08 Oct 2017 07:06:37 -0700 (PDT) Received: from localhost.localdomain ([103.37.201.122]) by smtp.gmail.com with ESMTPSA id l12sm10351474pgr.10.2017.10.08.07.06.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Oct 2017 07:06:36 -0700 (PDT) From: Harsha Sharma To: daniel.vetter@ffwll.ch, seanpaul@chromium.org, jani.nikula@linux.intel.com Subject: [PATCH v3] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Date: Sun, 8 Oct 2017 19:34:07 +0530 Message-Id: <20171008140407.13927-1-harshasharmaiitr@gmail.com> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Sun, 08 Oct 2017 15:42:41 +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 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 f17275519484..92f83045878f 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..1ff714935c38 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_put(&ifbdev->fb->base); /* Final pass to check if any active pipes don't have fbs */ for_each_crtc(dev, crtc) {