From patchwork Wed May 1 08:52:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2507231 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 860903FD85 for ; Wed, 1 May 2013 08:58:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CA82E6211 for ; Wed, 1 May 2013 01:58:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id CC6C1E616F for ; Wed, 1 May 2013 01:53:00 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hi8so1336366wib.10 for ; Wed, 01 May 2013 01:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=q4m/dgyuS5roP0yuN0bCMwqtBSQHTXL0/LlpJDLMNwk=; b=p/gqGmFPB3ZVqUk5tuO0XBtyG4rVF7etW9kJ4Sxm17MpqT9GftKpZOsXRTKWcR3mAj lX8pXIfE6iJF3vWyLY2/gHro39PsrX7cQJW/gm+bdxTfhPZZMrbnhFiz3avYWrQi/DKx UwlhM4dgympL3sA0VKfmvqxH3fjYFa4p0FKY3wl3xLznZOo+wuOHgCXYsawsq5DSIrkt G1ulaxKzQAOV4CCIg4ysouTqRA9FqEIUdwJBJP8u4yxiSFPoZOef67QJlEUSkIFnQXRY YkEMZ0TCeGQAtfc65kU+ovnTX/v2HCEKRk8g0LqcUKNP0OAyyZmizBOlhJSm+UY0xVqa pEfw== X-Received: by 10.194.92.197 with SMTP id co5mr1815939wjb.41.1367398379905; Wed, 01 May 2013 01:52:59 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id dj7sm30824153wib.6.2013.05.01.01.52.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 May 2013 01:52:59 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Wed, 01 May 2013 10:52:57 +0200 From: Maarten Lankhorst To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/7] drm/nouveau: implement prime helper unpin function Date: Wed, 1 May 2013 10:52:41 +0200 Message-Id: <1367398364-28997-4-git-send-email-maarten.lankhorst@canonical.com> X-Mailer: git-send-email 1.8.2.2 In-Reply-To: <1367398364-28997-1-git-send-email-maarten.lankhorst@canonical.com> References: <1367398364-28997-1-git-send-email-maarten.lankhorst@canonical.com> 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 --- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 + drivers/gpu/drm/nouveau/nouveau_gem.h | 1 + drivers/gpu/drm/nouveau/nouveau_prime.c | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index d109936..476f792 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -693,6 +693,7 @@ driver = { .gem_prime_export = drm_gem_prime_export, .gem_prime_import = drm_gem_prime_import, .gem_prime_pin = nouveau_gem_prime_pin, + .gem_prime_unpin = nouveau_gem_prime_unpin, .gem_prime_get_sg_table = nouveau_gem_prime_get_sg_table, .gem_prime_import_sg_table = nouveau_gem_prime_import_sg_table, .gem_prime_vmap = nouveau_gem_prime_vmap, diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.h b/drivers/gpu/drm/nouveau/nouveau_gem.h index 8d7a3f0..502e429 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.h +++ b/drivers/gpu/drm/nouveau/nouveau_gem.h @@ -36,6 +36,7 @@ extern int nouveau_gem_ioctl_info(struct drm_device *, void *, struct drm_file *); extern int nouveau_gem_prime_pin(struct drm_gem_object *); +extern void nouveau_gem_prime_unpin(struct drm_gem_object *); extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *); extern struct drm_gem_object *nouveau_gem_prime_import_sg_table( struct drm_device *, size_t size, struct sg_table *); diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index f53e108..e90468d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -84,7 +84,7 @@ struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev, int nouveau_gem_prime_pin(struct drm_gem_object *obj) { struct nouveau_bo *nvbo = nouveau_gem_object(obj); - int ret = 0; + int ret; /* pin buffer into GTT */ ret = nouveau_bo_pin(nvbo, TTM_PL_FLAG_TT); @@ -93,3 +93,10 @@ int nouveau_gem_prime_pin(struct drm_gem_object *obj) return 0; } + +void nouveau_gem_prime_unpin(struct drm_gem_object *obj) +{ + struct nouveau_bo *nvbo = nouveau_gem_object(obj); + + nouveau_bo_unpin(nvbo); +}