From patchwork Thu Aug 3 11:58:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cihangir Akturk X-Patchwork-Id: 9878861 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 2B1E660311 for ; Thu, 3 Aug 2017 12:02:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 223E828541 for ; Thu, 3 Aug 2017 12:02:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16CFB288B1; Thu, 3 Aug 2017 12:02:54 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9831F28541 for ; Thu, 3 Aug 2017 12:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4lClLIuVElQ14hVmVpSGz4qUWu6lSWGDMhf0d5CKCG4=; b=EoDteO/HD2y6TA3N0r+SzkO+rv DJiIxBghpl0mJ2ap+PCMk49IllRQv3YIH4gOKiYXWq8R8LvFmn8HkP8xfu+54slYF7A2E3doOJ0DU h2jGgzm93/aUo1Zx5P+56go0rc3sW2tiWL7CredJefGTI9cYF+n2T9DQ96eija/mVXKyxTOayLDmv kchJi9kn5toXaIWcxLtvIEpqQ53LhFWBMXMn6ReIh2zzTTcvaITl6jHhKMW52NwKLuq0/wKCkwQF2 A76Bfx0W6m42GXPOEHwjAMZHUcszttl47oEhPzyGsC4mwKPpbx56A2KhazhkOUozpi4dX4Yv+9zov fAV8p9qw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ddEq4-0006gk-Fc; Thu, 03 Aug 2017 12:02:52 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ddEph-00066O-1A; Thu, 03 Aug 2017 12:02:32 +0000 Received: by mail-wr0-x243.google.com with SMTP id y67so858155wrb.3; Thu, 03 Aug 2017 05:02: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:in-reply-to:references; bh=CientdJhqed2P/GXHgoIG2xxZdxWdBsLCe2SnA/XD/c=; b=AkgdUrQ3a52s2hrreV+xmNuLEK0Vp8DIx1m80thL/JvrcgXIGvTDUiXVmRs3Cvr5jS gkONKmYKm1Dwkq321LyNIoi4BQzZcJJ7E9Qo/GufV5vGERQJeP4w/Weq1Kjn4dUGkq/W 6uwgEthUhm3UiNiSTYWe2ZqAsPcJI47chGpwIeTrNOtEOsuIRGhKpTA1y/2AnkR/3RfV UxUGZIrPasrOMpmHkZ+S5UY5QDV8J2eSH128fqL7PPSihIyQRMX9vihrEcarJkKQmTzp cqRqNb1TnrB3q/LGBj4v+YO+f3DxOZ6qwq1Ltfe2JplGGaMIr7H6oOwQ3k+6t+SCCMEl lhTg== 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:in-reply-to :references; bh=CientdJhqed2P/GXHgoIG2xxZdxWdBsLCe2SnA/XD/c=; b=EkCCdcRui2jDckHHEQdTxHycAj3gb0POxzSNtTUok++5+QJDivG2elNCDH213oL8uP qjgSLTOWxVJD0oQCF4Mwi46Icyw+MKIIEJuHJYo5m8RodzGZFpQWSzp8H6FekF+J4anw 6AakyU6gTWSKw5v79+n+Dla2hByftG9CwDUNP2FjXDYktshlBnioMjhIgH3AbI/wq8q2 EnRLU6GLmLQJVT0jAdcqkrrUtG/2rDNEc1s5+wA07jbOiEc0tgaC9LUtphPGc1Ev1IXt iVoQU700HC7lIvc2wLQozsvSkwFMftwgkhrJV1nhvO3ceT+UMb5VLrgWsYhihICz+ou8 8kjQ== X-Gm-Message-State: AIVw113J+eJ8Eucl7QwOYlqOe9nz567rDNUp1MFyToFj+Vw7m9Wolnua penZIdY1x7+D+g== X-Received: by 10.223.131.130 with SMTP id 2mr1311423wre.51.1501761727054; Thu, 03 Aug 2017 05:02:07 -0700 (PDT) Received: from localhost.localdomain ([161.9.194.184]) by smtp.gmail.com with ESMTPSA id c141sm1402474wmd.44.2017.08.03.05.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Aug 2017 05:02:06 -0700 (PDT) From: Cihangir Akturk To: Subject: [PATCH 21/29] drm/rockchip: switch to drm_*{get,put} helpers Date: Thu, 3 Aug 2017 14:58:36 +0300 Message-Id: <1501761585-11757-22-git-send-email-cakturk@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501761585-11757-1-git-send-email-cakturk@gmail.com> References: <1501761585-11757-1-git-send-email-cakturk@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170803_050229_230044_49E4AF5E X-CRM114-Status: GOOD ( 11.90 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Cihangir Akturk , linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP drm_*_reference() and drm_*_unreference() functions are just compatibility alias for drm_*_get() and drm_*_put() adn should not be used by new code. So convert all users of compatibility functions to use the new APIs. Signed-off-by: Cihangir Akturk --- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 +++--- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 4 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 81f9548..a933b58 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -48,7 +48,7 @@ static void rockchip_drm_fb_destroy(struct drm_framebuffer *fb) int i; for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++) - drm_gem_object_unreference_unlocked(rockchip_fb->obj[i]); + drm_gem_object_put_unlocked(rockchip_fb->obj[i]); drm_framebuffer_cleanup(fb); kfree(rockchip_fb); @@ -144,7 +144,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, width * drm_format_plane_cpp(mode_cmd->pixel_format, i); if (obj->size < min_size) { - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); ret = -EINVAL; goto err_gem_object_unreference; } @@ -161,7 +161,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, err_gem_object_unreference: for (i--; i >= 0; i--) - drm_gem_object_unreference_unlocked(objs[i]); + drm_gem_object_put_unlocked(objs[i]); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c index ce946b9..724579e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c @@ -173,7 +173,7 @@ void rockchip_drm_fbdev_fini(struct drm_device *dev) drm_fb_helper_unregister_fbi(helper); if (helper->fb) - drm_framebuffer_unreference(helper->fb); + drm_framebuffer_put(helper->fb); drm_fb_helper_fini(helper); } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b74ac71..9f880d0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -383,7 +383,7 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, goto err_handle_create; /* drop reference from allocate - handle holds it now. */ - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return rk_obj; @@ -414,7 +414,7 @@ int rockchip_gem_dumb_map_offset(struct drm_file *file_priv, DRM_DEBUG_KMS("offset = 0x%llx\n", *offset); out: - drm_gem_object_unreference_unlocked(obj); + drm_gem_object_put_unlocked(obj); return 0; } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 5d45033..12e17e6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1065,7 +1065,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, if (old_plane_state->fb == plane->state->fb) continue; - drm_framebuffer_reference(old_plane_state->fb); + drm_framebuffer_get(old_plane_state->fb); drm_flip_work_queue(&vop->fb_unref_work, old_plane_state->fb); set_bit(VOP_PENDING_FB_UNREF, &vop->pending); WARN_ON(drm_crtc_vblank_get(crtc) != 0); @@ -1189,7 +1189,7 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val) struct drm_framebuffer *fb = val; drm_crtc_vblank_put(&vop->crtc); - drm_framebuffer_unreference(fb); + drm_framebuffer_put(fb); } static void vop_handle_vblank(struct vop *vop)