From patchwork Thu Jun 27 11:48:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2792111 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 5FD449F245 for ; Thu, 27 Jun 2013 11:59:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C15A2028F for ; Thu, 27 Jun 2013 11:59:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 17E8B2027A for ; Thu, 27 Jun 2013 11:59:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CD23E6569 for ; Thu, 27 Jun 2013 04:59:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 94F29E5D29 for ; Thu, 27 Jun 2013 04:48:57 -0700 (PDT) Received: by mail-we0-f171.google.com with SMTP id m46so477503wev.16 for ; Thu, 27 Jun 2013 04:48:56 -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=Oh/DDsTfwq7XgIJ7jMdhqNxDzxuOk2gSlVWVqHwZ3RI=; b=wgxRYDMKvexTxnXHuoMKCCMN6rYQlv3cU+USLNezmO5F11QZq6PVrEANcwPrqp87hE gde+VfHMww3/SBUwlXftVd4deVZ4QdjAGm7XsUt9+/V52YbFnFdB5z0+2Os/xBkM9Bv4 Rn+Q04vkcOAaVbRr+eqPWbj9uV6sqxiS7z5LvFVaNC+xIaB+5mcNtoGUr3DeiOLkaLQe wCTQpfTCQ/Mfn6uEnTMeQu61fsnDQNCxCO0vOEOLuMFa5p5ATNxrDgCv16acj9VfFEw5 WSK0N8ChZAwhm5a3LRthUul0elHWxoN3H/vqkoZgMkqtv8U0Q6mObccH5oVoW6f5UWKI AnEQ== X-Received: by 10.180.77.197 with SMTP id u5mr15574513wiw.39.1372333736787; Thu, 27 Jun 2013 04:48:56 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id cw8sm16835727wib.7.2013.06.27.04.48.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:48:56 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 27 Jun 2013 13:48:54 +0200 From: Maarten Lankhorst To: Dave Airlie Subject: [PATCH WW 06/13] drm/cirrus: inline reservations Date: Thu, 27 Jun 2013 13:48:21 +0200 Message-Id: <1372333708-29884-7-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/cirrus/cirrus_drv.h | 21 +++++++++++++++++++-- drivers/gpu/drm/cirrus/cirrus_ttm.c | 18 ------------------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h index 7ca0595..bae5560 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.h +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h @@ -240,8 +240,25 @@ void cirrus_ttm_placement(struct cirrus_bo *bo, int domain); int cirrus_bo_create(struct drm_device *dev, int size, int align, uint32_t flags, struct cirrus_bo **pcirrusbo); int cirrus_mmap(struct file *filp, struct vm_area_struct *vma); -int cirrus_bo_reserve(struct cirrus_bo *bo, bool no_wait); -void cirrus_bo_unreserve(struct cirrus_bo *bo); + +static inline int cirrus_bo_reserve(struct cirrus_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 cirrus_bo_unreserve(struct cirrus_bo *bo) +{ + ttm_bo_unreserve(&bo->bo); +} + int cirrus_bo_push_sysram(struct cirrus_bo *bo); int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr); #endif /* __CIRRUS_DRV_H__ */ diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c index 36b9b0b..0047012 100644 --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c @@ -308,24 +308,6 @@ void cirrus_ttm_placement(struct cirrus_bo *bo, int domain) bo->placement.num_busy_placement = c; } -int cirrus_bo_reserve(struct cirrus_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 cirrus_bo_unreserve(struct cirrus_bo *bo) -{ - ttm_bo_unreserve(&bo->bo); -} - int cirrus_bo_create(struct drm_device *dev, int size, int align, uint32_t flags, struct cirrus_bo **pcirrusbo) {