From patchwork Tue Jul 16 07:11:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2827961 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6C53F9F7D6 for ; Tue, 16 Jul 2013 07:24:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B3B62016C for ; Tue, 16 Jul 2013 07:24:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6A8E3200CC for ; Tue, 16 Jul 2013 07:24:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27947E6B1B for ; Tue, 16 Jul 2013 00:24:19 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 09D1BE64B3 for ; Tue, 16 Jul 2013 00:17:04 -0700 (PDT) Received: by mail-ea0-f174.google.com with SMTP id o10so156495eaj.33 for ; Tue, 16 Jul 2013 00:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=K2pR4hwK1FA0Iv+b/luLkkDCeUpuZ2gulfIn6fIp5oQ=; b=YIb3bUZHFwnP6cmAxRAZ1zOMfsEZ3NaZyRf69ozAFq80hO3Yhrz7jBQ4pBKstRPlzO fhlMNGHrccm4y2jSBVBVapQ5jfaTfhYJDxhTLJiRsvDF+MG6rWSpIE1ym/BY2hn/+yXi 3PjOQi7C8VXJtTOEEa5JHFUSIYOn7p6Iof1ao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=K2pR4hwK1FA0Iv+b/luLkkDCeUpuZ2gulfIn6fIp5oQ=; b=YKbN8cklVmkD3DeIsKdelKtRXG0QFXEd2Dijlmz5oqYhTGCzE73j79hF3Ts02t8Jrc XcfoLb84EI+L982sbOZKYTAwiL8kgYJuemwjyPH87U0EJa+P10Nf5DWaVmkp5hsxhDcv OMdSs9GHPHTMNCiL0AMvegHwkC9d1MgRzgbNhAVUqj4dXZO2u0ga8DOkFeDHHeBbFsJc J7f3Fq3NPQtq/KmfiIUojhmK19D8v38jzx2hA3wsfPbFaFbKhGLfp2oHM0df2J/9uX5l 0NtuTiJmVFQDrTkPp3XPPrGZCtRPU6mDzDcOlL3tXZDbAOh8PZqETWthcDUl4kZT5XWR 3I2Q== X-Received: by 10.15.73.197 with SMTP id h45mr57873eey.146.1373959024288; Tue, 16 Jul 2013 00:17:04 -0700 (PDT) Received: from aaron.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id n5sm283897eed.9.2013.07.16.00.17.02 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Jul 2013 00:17:03 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 06/20] drm/gem: inline drm_gem_object_handle_reference Date: Tue, 16 Jul 2013 09:11:57 +0200 Message-Id: <1373958731-4132-7-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1373958731-4132-1-git-send-email-daniel.vetter@ffwll.ch> References: <1373958731-4132-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQmJxJdw9QqgliRxSZhmAD3pwuzohNchCV3xbh13a03oETbfsgkoJjPO7ZhapELE/qtbqOf4 Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only one callsite and since ->handle_count is not a simple reference count (it can resurrect) it's imo better to be explicit about things than hide the refcount dance. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_gem.c | 3 ++- include/drm/drmP.h | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 603f256..7bcd851 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -280,7 +280,8 @@ drm_gem_handle_create(struct drm_file *file_priv, return ret; *handlep = ret; - drm_gem_object_handle_reference(obj); + drm_gem_object_reference(obj); + atomic_inc(&obj->handle_count); if (dev->driver->gem_open_object) { ret = dev->driver->gem_open_object(obj, file_priv); diff --git a/include/drm/drmP.h b/include/drm/drmP.h index f949cb2..114db57 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1664,13 +1664,6 @@ int drm_gem_handle_create(struct drm_file *file_priv, int drm_gem_handle_delete(struct drm_file *filp, u32 handle); static inline void -drm_gem_object_handle_reference(struct drm_gem_object *obj) -{ - drm_gem_object_reference(obj); - atomic_inc(&obj->handle_count); -} - -static inline void drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) { if (obj == NULL)