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: 9923 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8F2A123E57 for ; Tue, 10 Jul 2012 10:58:32 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 48C5EA18773 for ; Tue, 10 Jul 2012 10:58:32 +0000 (UTC) Received: by yenq6 with SMTP id q6so11859368yen.11 for ; Tue, 10 Jul 2012 03:58:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:from:to:date:message-id:x-mailer:in-reply-to :references:cc:subject:x-beenthere:x-mailman-version:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:mime-version:content-type:content-transfer-encoding :sender:errors-to:x-gm-message-state; bh=rq5tez+Zkha/Hbt5vuoMDBWTW3rMCr8g+AuLf0SHRsI=; b=aceXY98KCoFNJPkMFcPTwwXkRqUc33PbWMUvYOP/hQofEKhvvMp3+XXmrJH1mxWhH0 roSLtP1PwvUgn2yTIb5gwJYM5xVQfUHE8TWpmPfVbl39Y93a56yeJ1MlDyXeSGzmqWvz 63u6ReVxse9xoblsPJLCQLYsxhCs6rmJKx+pez4QP59Ml7K9ESeDKMYLYKCYZ5ivRrH5 Smj9oPNvVdBs/9gaByeIEa0LT2F/SR5uJxFEtE9FTa6ZzUoC+ky6bhE51kORKzU1Av2/ dpH4WSM1pS40w5X08BVz6YZgCw+pd5A27Um0Chw6Cj0L8NLSi/OgHjrQiJvL44jJUReN pFNA== Received: by 10.50.203.39 with SMTP id kn7mr10645117igc.53.1341917911556; Tue, 10 Jul 2012 03:58:31 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp47683ibb; Tue, 10 Jul 2012 03:58:30 -0700 (PDT) Received: by 10.180.88.229 with SMTP id bj5mr16948356wib.19.1341917910381; Tue, 10 Jul 2012 03:58:30 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id r6si32440909wiw.0.2012.07.10.03.58.29; Tue, 10 Jul 2012 03:58:30 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SoY9C-0002gK-LP; Tue, 10 Jul 2012 10:58:26 +0000 Received: from mail-ey0-f170.google.com ([209.85.215.170]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SoY9B-0002aX-DT for linaro-mm-sig@lists.linaro.org; Tue, 10 Jul 2012 10:58:25 +0000 Received: by mail-ey0-f170.google.com with SMTP id l12so7970290eaa.1 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 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 Subject: [Linaro-mm-sig] [RFC PATCH 4/8] nouveau: add nouveau_bo_vma_add_access X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQk9NIkSwgOEGvOVG9B6Gkkg+s9fcVj7JEvg2DLpeSlQbbP2ULn4H6M25cqDvjZYTfmPUvsU 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 */