Displaying 20 results from an estimated 34 matches for "nouveau_bo_vma_add".
2013 Oct 10
0
[PATCH] drm/nouveau: do not map evicted bo's in nouveau_bo_vma_add
...ankhorst <maarten.lankhorst at canonical.com>
Cc: <stable at vger.kernel.org> # v3.7+
---
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1551,7 +1579,8 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
- else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
+ else if (nvbo->bo.mem.mem_type == TTM_PL_TT &&
+ nvbo->page_shift == vma->vm->...
2013 Nov 12
0
[PATCH 5/7] drm/nouveau: do not map evicted vram buffers in nouveau_bo_vma_add
...au/nouveau_bo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 9ecb874..bb3734d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1549,7 +1549,8 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
- else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
+ else if (nvbo->bo.mem.mem_type == TTM_PL_TT &&
+ nvbo->page_shift == vma->vm->...
2013 Sep 25
1
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
On Wed, Sep 04, 2013 at 08:59:13AM +0200, Maarten Lankhorst wrote:
>
> When looking into this bug I noticed that nouveau_bo_vma_add needs to have a check for nvbo->page_shift == vma->vm->vmm->spg_shift,
> and only if the check is true it should map the page in TTM_PL_TT. Patch below.
> Should probably also be cc'd to stable.
>
How about this patch? Is it ready to go in?
Thanks,
-- Pasi
> ~Maar...
2015 Nov 11
1
[PATCH] instmem/gk20a: fix race conditions
...k20a_instobj_acquire [nouveau]) from
[<bf066358>] (gf100_vm_map_sg+0x58/0x124 [nouveau])
[ 270.557568] [<bf066358>] (gf100_vm_map_sg [nouveau]) from
[<bf0641b0>] (nvkm_vm_map+0x300/0x3bc [nouveau])
[ 270.567333] [<bf0641b0>] (nvkm_vm_map [nouveau]) from [<bf0bcbd4>]
(nouveau_bo_vma_add+0x74/0xa0 [nouveau])
[ 270.577189] [<bf0bcbd4>] (nouveau_bo_vma_add [nouveau]) from
[<bf0bdbd0>] (nouveau_gem_object_open+0x124/0x158 [nouveau])
[ 270.588196] [<bf0bdbd0>] (nouveau_gem_object_open [nouveau]) from
[<c02da62c>] (drm_gem_handle_create_tail+0x104/0x19c)
[ 270...
2013 Sep 04
4
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
On Thu, Aug 22, 2013 at 5:12 PM, Maarten Lankhorst
<maarten.lankhorst at canonical.com> wrote:
> Op 22-08-13 02:10, Ilia Mirkin schreef:
>> The code expects non-VRAM mem nodes to have a pages list. If that's not
>> set, it will do a null deref down the line. Warn on that condition and
>> return an error.
>>
>> See
2014 Sep 22
2
[PATCH] drm/nv84+: fix fence context seqno's
...gt;bo, chan->chid * 16 / 4, fctx->base.sequence);
nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
nouveau_bo_vma_del(priv->bo, &fctx->vma);
nouveau_fence_context_del(&fctx->base);
@@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
}
- nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
-
if (ret)
nv84_fence_context_del(chan);
return ret;
2013 Sep 04
0
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
...bo_move() on attempts to move
> a DMA-BUF backed object into VRAM.
>
> Sound OK?
>
If it has a WARN_ON or something that would be ok, I didn't find any other places that attempt to move buffers to VRAM though, so it's probably harmless.
When looking into this bug I noticed that nouveau_bo_vma_add needs to have a check for nvbo->page_shift == vma->vm->vmm->spg_shift,
and only if the check is true it should map the page in TTM_PL_TT. Patch below.
Should probably also be cc'd to stable.
~Maarten
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouve...
2013 Sep 02
2
[PATCH] drm/nv84-: write fence value on exit, and restore value on init.
...o->chid * 16/4, fctx->base.sequence);
+
for (i = 0; i < dev->mode_config.num_crtc; i++) {
struct nouveau_bo *bo = nv50_display_crtc_sema(dev, i);
nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]);
@@ -168,7 +171,7 @@ nv84_fence_context_new(struct nouveau_channel *chan)
ret = nouveau_bo_vma_add(bo, client->vm, &fctx->dispc_vma[i]);
}
- nouveau_bo_wr32(priv->bo, fifo->chid * 16/4, 0x00000000);
+ fctx->base.sequence = nouveau_bo_rd32(priv->bo, fifo->chid * 16/4);
if (ret)
nv84_fence_context_del(chan);
--
1.8.3.4
2017 Feb 25
2
[Bug 99966] New: Crash of nouveau - cache related?
.../0x30
[nouveau]
[252778.063080] [<ffffffffa0890c2f>] nvkm_instobj_new+0x6f/0x180 [nouveau]
[252778.063587] [<ffffffffa08475c4>] nvkm_memory_new+0x44/0x80 [nouveau]
[252778.064108] [<ffffffffa0895b3f>] nvkm_vm_get+0x15f/0x250 [nouveau]
[252778.064611] [<ffffffffa08f5a52>] nouveau_bo_vma_add+0x32/0xa0 [nouveau]
[252778.065124] [<ffffffffa08f3c2a>] ? nouveau_bo_map+0x7a/0xa0 [nouveau]
[252778.065627] [<ffffffffa0906f52>] nouveau_channel_prep+0x1d2/0x290
[nouveau]
[252778.066136] [<ffffffffa0907067>] nouveau_channel_new+0x57/0x6d0 [nouveau]
[252778.066642] [<ffff...
2013 Aug 28
1
[PATCH 4/6] drm/nouveau: introduce NOUVEAU_GEM_TILE_WCUS
...ement *pl = &nvbo->placement;
> - uint32_t flags = TTM_PL_MASK_CACHING |
> + uint32_t flags = nvbo->valid_caching |
> (nvbo->pin_refcnt ? TTM_PL_FLAG_NO_EVICT : 0);
>
> pl->placement = nvbo->placements;
> @@ -1554,6 +1560,9 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
> if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
> nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
> else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
> + if (!(nvbo->valid_caching & TTM_PL_...
2015 Apr 17
3
[PATCH 4/6] drm: enable big page mapping for small pages when IOMMU is available
...avior like "if the
buffer size of more than 256KB, increase the size of the buffer to the
next multiple of 128K and use big pages" would probably yield better
results.
> }
>
> nouveau_bo_fixup_align(nvbo, flags, &align, &size);
> @@ -1641,6 +1646,10 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nvkm_vm *vm,
> (nvbo->bo.mem.mem_type == TTM_PL_VRAM ||
> nvbo->page_shift != vma->vm->mmu->lpg_shift))
> nvkm_vm_map(vma, nvbo->bo.mem.mm_node);
> + else if (nvbo->bo.mem.mem_type == TTM...
2015 Nov 09
2
[PATCH] instmem/gk20a: fix race conditions
The LRU list used for recycling CPU mappings was handling concurrency
very poorly. For instance, if an instobj was acquired twice before being
released once, it would end up into the LRU list even though there is
still a client accessing it.
This patch fixes this by properly counting how many clients are
currently using a given instobj.
While at it, we also raise errors when inconsistencies are
2012 Oct 12
0
[PATCH 2/3] drm/nouveau: add reservation to nouveau_bo_vma_del
...}
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h
index dec51b1..61b8980 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.h
@@ -84,6 +84,7 @@ nouveau_bo_vma_find(struct nouveau_bo *, struct nouveau_vm *);
int nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *,
struct nouveau_vma *);
void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *);
+void nouveau_bo_vma_del_reserved(struct nouveau_bo *, struct nouveau_vma *);
/* TODO: submit equivalent to TTM generic API upstream? */
static inline void _...
2013 Aug 28
0
[PATCH 4/6] drm/nouveau: introduce NOUVEAU_GEM_TILE_WCUS
...o *nvbo, uint32_t type, uint32_t busy)
{
struct ttm_placement *pl = &nvbo->placement;
- uint32_t flags = TTM_PL_MASK_CACHING |
+ uint32_t flags = nvbo->valid_caching |
(nvbo->pin_refcnt ? TTM_PL_FLAG_NO_EVICT : 0);
pl->placement = nvbo->placements;
@@ -1554,6 +1560,9 @@ nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
+ if (!(nvbo->valid_caching & TTM_PL_FLAG_CACHED))
+ vma->access |= NV_MEM_ACCESS_NOSNOOP;...
2013 Sep 04
0
[PATCH] drm/nv84-: write fence value on exit, and restore value on init.
...i < dev->mode_config.num_crtc; i++) {
> struct nouveau_bo *bo = nv50_display_crtc_sema(dev, i);
> nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]);
> @@ -168,7 +171,7 @@ nv84_fence_context_new(struct nouveau_channel *chan)
> ret = nouveau_bo_vma_add(bo, client->vm, &fctx->dispc_vma[i]);
> }
>
> - nouveau_bo_wr32(priv->bo, fifo->chid * 16/4, 0x00000000);
> + fctx->base.sequence = nouveau_bo_rd32(priv->bo, fifo->chid * 16/4);
>
> if (ret)
> nv84_fence_conte...
2014 Sep 22
0
[PATCH] drm/nv84+: fix fence context seqno's
.../ 4, fctx->base.sequence);
> nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
> nouveau_bo_vma_del(priv->bo, &fctx->vma);
> nouveau_fence_context_del(&fctx->base);
> @@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
> ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
> }
>
> - nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
> -
> if (ret)
> nv84_fence_context_del(chan);
> return ret;
>
This works, thanks :-)
Tested-by: Ted Percival <ted at tedp.id.au>
2014 May 19
0
[PATCH 3/4] drm/nouveau: hook up cache sync functions
...*bdev, uint32_t type,
struct ttm_mem_type_manager *man)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h
index ff17c1f432fc..ead214931223 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.h
@@ -89,6 +89,26 @@ int nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *,
struct nouveau_vma *);
void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *);
+#if IS_ENABLED(CONFIG_ARCH_TEGRA)
+#define NOUVEAU_NEED_CACHE_SYNC
+#endif
+
+#ifdef NOUVEAU_NEED_CACHE_SYNC
+void nouveau_bo_sync_for_cpu(struct nouveau_bo *...
2013 Nov 12
6
[PATCH 1/7] drm/nouveau: fix m2mf copy to tiled gart
From: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Commit de7b7d59d54852c introduced tiled GART, but a linear copy is
still performed. This may result in errors on eviction, fix it by
checking tiling from memtype.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Cc: stable at vger.kernel.org #3.10+
---
drivers/gpu/drm/nouveau/nouveau_bo.c | 33
2014 Sep 23
2
[PATCH] drm/nv84+: fix fence context seqno's
...nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
>> nouveau_bo_vma_del(priv->bo, &fctx->vma);
>> nouveau_fence_context_del(&fctx->base);
>> @@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
>> ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
>> }
>>
>> - nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
>> -
>> if (ret)
>> nv84_fence_context_del(chan);
>> return ret;
>>
>
> This works, tha...
2016 Apr 15
0
[Bug 82714] [G84] nouveau fails to properly initialize GPU
...+0x1d/0x20 [nouveau]
[ 578.943169] [<ffffffffa0637250>] nv50_vm_map_sg+0x100/0x110 [nouveau]
[ 578.943178] [<ffffffffa06355eb>] nvkm_vm_map+0x2fb/0x3b0 [nouveau]
[ 578.943186] [<ffffffffa0635d76>] ? nvkm_vm_get+0x1d6/0x260 [nouveau]
[ 578.943195] [<ffffffffa0692eee>] nouveau_bo_vma_add+0x5e/0x90 [nouveau]
[ 578.943203] [<ffffffffa069345a>] nouveau_gem_object_open+0x15a/0x190
[nouveau]
[ 578.943207] [<ffffffffa04000b9>] drm_gem_handle_create_tail+0xe9/0x1b0
[drm]
[ 578.943210] [<ffffffffa04001b5>] drm_gem_handle_create+0x35/0x40 [drm]
[ 578.943218] [<f...