From patchwork Thu Jun 27 11:48:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2792101 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 184869F245 for ; Thu, 27 Jun 2013 11:59:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A292D2028F for ; Thu, 27 Jun 2013 11:58:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BAB502027A for ; Thu, 27 Jun 2013 11:58:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA342E6556 for ; Thu, 27 Jun 2013 04:58:58 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 7782FE626B for ; Thu, 27 Jun 2013 04:48:55 -0700 (PDT) Received: by mail-wi0-f180.google.com with SMTP id c10so522030wiw.7 for ; Thu, 27 Jun 2013 04:48:54 -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:in-reply-to:references; bh=MZx4zv7o512GLXSI4IEJD4H0JFr/8fzzub52M1oMghw=; b=xVKW3Bys89Mixoqqzvo9y3AhTEs/jLH7GHn1Xnjly6RZzMgQGFkXPhWHP77UjSM351 Dpb24elkBw/9XwjLy8jvl9hNHpcWcRvfpwyU61HIhAi7hsUBaHGcnTIZ4uhPuLXMTEGH u9knYe8vcl0wX27wgpeGMu4FSnxa/x8Z0zeiP92kKGlzTYvI50o3AMMMaO/3TKIJkdif SKeno1KZCvy6TSmNHU79+onngEM4mxRaIxIh0XGLTLOVQMpd8VV666uchI8uR779IP6m NvyKvTkPovBnW4ShbV8IqK1zVfdSVzim0cIpdmFtAPtbtmeMZMgiaUZGpl9yVL0esZcv kgbw== X-Received: by 10.194.123.69 with SMTP id ly5mr6004937wjb.29.1372333734675; Thu, 27 Jun 2013 04:48:54 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id fd3sm16802996wic.10.2013.06.27.04.48.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:48:54 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 27 Jun 2013 13:48:52 +0200 From: Maarten Lankhorst To: Dave Airlie Subject: [PATCH WW 05/13] drm/ast: inline reservations Date: Thu, 27 Jun 2013 13:48:20 +0200 Message-Id: <1372333708-29884-6-git-send-email-maarten.lankhorst@canonical.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1372333708-29884-1-git-send-email-maarten.lankhorst@canonical.com> References: <1372333708-29884-1-git-send-email-maarten.lankhorst@canonical.com> Cc: dri-devel@lists.freedesktop.org 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=-5.4 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 Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/ast/ast_drv.h | 20 ++++++++++++++++++-- drivers/gpu/drm/ast/ast_ttm.c | 18 ------------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index 02e52d5..622d4ae 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -348,8 +348,24 @@ int ast_gem_create(struct drm_device *dev, int ast_bo_pin(struct ast_bo *bo, u32 pl_flag, u64 *gpu_addr); int ast_bo_unpin(struct ast_bo *bo); -int ast_bo_reserve(struct ast_bo *bo, bool no_wait); -void ast_bo_unreserve(struct ast_bo *bo); +static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait) +{ + int ret; + + ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0); + if (ret) { + if (ret != -ERESTARTSYS && ret != -EBUSY) + DRM_ERROR("reserve failed %p\n", bo); + return ret; + } + return 0; +} + +static inline void ast_bo_unreserve(struct ast_bo *bo) +{ + ttm_bo_unreserve(&bo->bo); +} + void ast_ttm_placement(struct ast_bo *bo, int domain); int ast_bo_push_sysram(struct ast_bo *bo); int ast_mmap(struct file *filp, struct vm_area_struct *vma); diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c index a5a1a03..98d6708 100644 --- a/drivers/gpu/drm/ast/ast_ttm.c +++ b/drivers/gpu/drm/ast/ast_ttm.c @@ -303,24 +303,6 @@ void ast_ttm_placement(struct ast_bo *bo, int domain) bo->placement.num_busy_placement = c; } -int ast_bo_reserve(struct ast_bo *bo, bool no_wait) -{ - int ret; - - ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0); - if (ret) { - if (ret != -ERESTARTSYS && ret != -EBUSY) - DRM_ERROR("reserve failed %p\n", bo); - return ret; - } - return 0; -} - -void ast_bo_unreserve(struct ast_bo *bo) -{ - ttm_bo_unreserve(&bo->bo); -} - int ast_bo_create(struct drm_device *dev, int size, int align, uint32_t flags, struct ast_bo **pastbo) {