From patchwork Thu Jul 25 12:08:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 2833363 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D435C0319 for ; Thu, 25 Jul 2013 12:10:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43469201B5 for ; Thu, 25 Jul 2013 12:10:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E8A8C2018C for ; Thu, 25 Jul 2013 12:10:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0B50E6F30 for ; Thu, 25 Jul 2013 05:10:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 54D6EE691B for ; Thu, 25 Jul 2013 05:09:26 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id b57so875627eek.22 for ; Thu, 25 Jul 2013 05:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=oSB7mwf+76XRgQkiywQiNGXiNc0cgYIHm+hnlto7Nmg=; b=u3jqy21G2+SlyEfOgFpj7lwVnZPs8k80h0G3ZuL4l0S2LIdAOs1CofGMhamxuRiPsM P5XL7KFDKP8maVxmVYc2SzikFuAetxE1J43XsEJa7YCIsm3UBzwp+fC74gO/pX6yzjnQ ciiQzxbGsEq1O1ZNu7nhjXKi5xZ/unpoktRsIiG7/pC63ajWQaWfK5jbG197OaF8i82E F/Dshh48iw+3CDuyPLH8P+yEAwejAYw4B3634jVNbYHXdx8TfXsRaCRL0M92uCJpU1xU zT4JF0AN4e88POagp/GA/JnvKmGe8FzpOX2CyAF0wIYepnRQzbg//1fVwImjNz/Y+5xE 8oPg== X-Received: by 10.15.94.11 with SMTP id ba11mr42710635eeb.101.1374754165428; Thu, 25 Jul 2013 05:09:25 -0700 (PDT) Received: from david-mb.localdomain (stgt-5f71ace7.pool.mediaWays.net. [95.113.172.231]) by mx.google.com with ESMTPSA id cg12sm73258266eeb.7.2013.07.25.05.09.22 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 05:09:24 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: inline drm_bo_setup_vm() Date: Thu, 25 Jul 2013 14:08:51 +0200 Message-Id: <1374754131-24104-1-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.8.3.3 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 This helper is used only once and just wraps a call to drm_vma_offset_add(). Remove this unneeded indirection to safe 10 lines of code. Signed-off-by: David Herrmann --- drivers/gpu/drm/ttm/ttm_bo.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 050edfa..f1a857e 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -45,7 +45,6 @@ #define TTM_DEBUG(fmt, arg...) #define TTM_BO_HASH_ORDER 13 -static int ttm_bo_setup_vm(struct ttm_buffer_object *bo); static int ttm_bo_swapout(struct ttm_mem_shrink *shrink); static void ttm_bo_global_kobj_release(struct kobject *kobj); @@ -1134,7 +1133,8 @@ int ttm_bo_init(struct ttm_bo_device *bdev, if (likely(!ret) && (bo->type == ttm_bo_type_device || bo->type == ttm_bo_type_sg)) - ret = ttm_bo_setup_vm(bo); + ret = drm_vma_offset_add(&bdev->vma_manager, &bo->vma_node, + bo->mem.num_pages); locked = ww_mutex_trylock(&bo->resv->lock); WARN_ON(!locked); @@ -1506,24 +1506,6 @@ void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo) EXPORT_SYMBOL(ttm_bo_unmap_virtual); -/** - * ttm_bo_setup_vm: - * - * @bo: the buffer to allocate address space for - * - * Allocate address space in the drm device so that applications - * can mmap the buffer and access the contents. This only - * applies to ttm_bo_type_device objects as others are not - * placed in the drm device address space. - */ - -static int ttm_bo_setup_vm(struct ttm_buffer_object *bo) -{ - struct ttm_bo_device *bdev = bo->bdev; - - return drm_vma_offset_add(&bdev->vma_manager, &bo->vma_node, - bo->mem.num_pages); -} int ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy, bool interruptible, bool no_wait)