From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org,
Maarten Lankhorst <maarten.lankhorst@canonical.com>
Subject: [RFC PATCH 4/8] nouveau: add nouveau_bo_vma_add_access
Date: Tue, 10 Jul 2012 12:57:47 +0200 [thread overview]
Message-ID: <1341917871-2512-5-git-send-email-m.b.lankhorst@gmail.com> (raw)
In-Reply-To: <1341917871-2512-1-git-send-email-m.b.lankhorst@gmail.com>
From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
This is needed to allow creation of read-only vm mappings
in fence objects.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
---
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 */
--
1.7.9.5
next prev parent reply other threads:[~2012-07-10 10:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-10 10:57 [RFC PATCH 0/8] Dmabuf synchronization Maarten Lankhorst
2012-07-10 10:57 ` [RFC PATCH 1/8] dma-buf-mgr: Try 2 Maarten Lankhorst
2012-07-10 10:57 ` [RFC PATCH 2/8] prime wip: i915 Maarten Lankhorst
2012-07-10 10:57 ` [RFC PATCH 3/8] nouveau: Extend prime code Maarten Lankhorst
2012-07-10 10:57 ` Maarten Lankhorst [this message]
2012-07-10 10:57 ` [RFC PATCH 5/8] nouveau: Add methods preparing for prime fencing Maarten Lankhorst
2012-07-10 10:57 ` [RFC PATCH 6/8] nouveau: nv84 fence prime implementation Maarten Lankhorst
2012-07-10 10:57 ` [RFC PATCH 7/8] nouveau: nvc0 " Maarten Lankhorst
2012-07-10 10:57 ` [RFC PATCH 8/8] nouveau: Prime execbuffer submission synchronization Maarten Lankhorst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341917871-2512-5-git-send-email-m.b.lankhorst@gmail.com \
--to=m.b.lankhorst@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@canonical.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®