From patchwork Tue Jul 10 10:57:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 1176901 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 6B74E40B37 for ; Tue, 10 Jul 2012 11:04:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40B6AA09C8 for ; Tue, 10 Jul 2012 04:04:20 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ey0-f177.google.com (mail-ey0-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F054A09A6 for ; Tue, 10 Jul 2012 03:58:25 -0700 (PDT) Received: by mail-ey0-f177.google.com with SMTP id f11so4612614eaa.36 for ; Tue, 10 Jul 2012 03:58: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:in-reply-to:references; bh=22EHHGp184bfD2fSjh1qg3pD17rxjJJbx+BpoM4nADY=; b=GwP9usktcW3cqwytp6G49bvm091kNYGpsXhEgbHq31+lhMrtG3EonKAhQD1B7LBbBd zKEXVrD0AWcqeq43Wh6lXb03sAXAwnvrkws4MsXgk2EzvlL+e5+Mytl5dpJbya0b30Op V9WQF88//dZ30PsY7cbx0qvfYUS9KQHOqEGPuhv11nQH3usx+U12ChDTHQ2BhGVRzTC9 ho4rEYjrP6LH+Bs5V4xBrIw7ftcDD/3oXo68b/0gjbleuxGCNbTviBi0YA8KbQiJjr9j ms9LPC+mUAa24vJ5dd7ggOgZLZce1fQfKnDLZ23vM+pLKYtiA8LD97Rzno2KsJBdmrIr gv5g== Received: by 10.14.27.136 with SMTP id e8mr1529197eea.156.1341917905245; Tue, 10 Jul 2012 03:58:25 -0700 (PDT) Received: from localhost (5ED48CEF.cm-7-5c.dynamic.ziggo.nl. [94.212.140.239]) by mx.google.com with ESMTPS id x52sm101495270eea.11.2012.07.10.03.58.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Jul 2012 03:58:24 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Tue, 10 Jul 2012 12:58:20 +0200 From: Maarten Lankhorst To: dri-devel@lists.freedesktop.org Subject: [RFC PATCH 4/8] nouveau: add nouveau_bo_vma_add_access Date: Tue, 10 Jul 2012 12:57:47 +0200 Message-Id: <1341917871-2512-5-git-send-email-m.b.lankhorst@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1341917871-2512-1-git-send-email-m.b.lankhorst@gmail.com> References: <1341917871-2512-1-git-send-email-m.b.lankhorst@gmail.com> Cc: linaro-mm-sig@lists.linaro.org, Maarten Lankhorst , linux-kernel@vger.kernel.org, linux-media@vger.kernel.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 From: Maarten Lankhorst This is needed to allow creation of read-only vm mappings in fence objects. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_drv.h | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 7f80ed5..4318320 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1443,15 +1443,15 @@ nouveau_bo_vma_find(struct nouveau_bo *nvbo, struct nouveau_vm *vm) } int -nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm, - struct nouveau_vma *vma) +nouveau_bo_vma_add_access(struct nouveau_bo *nvbo, struct nouveau_vm *vm, + struct nouveau_vma *vma, u32 access) { const u32 size = nvbo->bo.mem.num_pages << PAGE_SHIFT; struct nouveau_mem *node = nvbo->bo.mem.mm_node; int ret; ret = nouveau_vm_get(vm, size, nvbo->page_shift, - NV_MEM_ACCESS_RW, vma); + access, vma); if (ret) return ret; diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 7c52eba..2c17989 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -1350,8 +1350,10 @@ extern int nouveau_bo_validate(struct nouveau_bo *, bool interruptible, extern struct nouveau_vma * nouveau_bo_vma_find(struct nouveau_bo *, struct nouveau_vm *); -extern int nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *, - struct nouveau_vma *); +#define nouveau_bo_vma_add(nvbo, vm, vma) \ + nouveau_bo_vma_add_access((nvbo), (vm), (vma), NV_MEM_ACCESS_RW) +extern int nouveau_bo_vma_add_access(struct nouveau_bo *, struct nouveau_vm *, + struct nouveau_vma *, u32 access); extern void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *); /* nouveau_gem.c */