search for: nouveau_gpuobj

Displaying 20 results from an estimated 51 matches for "nouveau_gpuobj".

2012 Aug 19
0
[PATCH 05/10] drm/nouveau: quiet some static-related sparse noise
...changed, 51 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/nouveau/core/core/gpuobj.c b/drivers/gpu/drm/nouveau/core/core/gpuobj.c index e85d940..368d082 100644 --- a/drivers/gpu/drm/nouveau/core/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/core/core/gpuobj.c @@ -136,7 +136,7 @@ struct nouveau_gpuobj_class { u32 flags; }; -int +static int _nouveau_gpuobj_ctor(struct nouveau_object *parent, struct nouveau_object *engine, struct nouveau_oclass *oclass, void *data, u32 size, diff --git a/drivers/gpu/drm/nouveau/core/core/object.c b/drivers/gpu/drm/nouveau/core/core/object.c i...
2012 Oct 11
4
[PATCH] drm/nouveau: fix nouveau_mm/nouveau_mm_node leak
...+ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/core/core/gpuobj.c b/drivers/gpu/drm/nouveau/core/core/gpuobj.c index c2a7608..48121d2 100644 --- a/drivers/gpu/drm/nouveau/core/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/core/core/gpuobj.c @@ -39,8 +39,11 @@ nouveau_gpuobj_destroy(struct nouveau_gpuobj *gpuobj) nv_wo32(gpuobj, i, 0x00000000); } + if (gpuobj->node) + nouveau_mm_free(gpuobj->node_heap, &gpuobj->node); + if (gpuobj->heap.block_size) - nouveau_mm_fini(&gpuobj->heap); + WARN_ON(nouveau_mm_fini(&gpuobj->heap));...
2013 Nov 29
2
Fixing nouveau for >4k PAGE_SIZE
...gt;pgt_bits - bits); - unsigned m, sglen; - u32 end, len; + u32 pte = offset & ((1 << vmm->pgt_bits) - 1); + u32 max = 1 << vmm->pgt_bits; + u32 end, len, cardlen; int i; struct scatterlist *sg; - for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) { - struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; - sglen = sg_dma_len(sg) >> PAGE_SHIFT; + /* We don't handle "big" pages here */ + if (WARN_ON(shift != vmm->spg_shift || shift > PAGE_SHIFT)) + return; - end = pte + sglen; - if (unlikely(end >= max)) - end = max; - len = end -...
2013 Jul 29
0
[PATCH] drm/nouveau: protect vm refcount with mutex
...tex_unlock(&nv_subdev(vmm)->mutex); - nouveau_vm_ref(NULL, &vma->vm, NULL); + vma->vm = NULL; + ref = --vm->refcount; + mutex_unlock(&nv_subdev(vmm)->mutex); + if (!ref) + nouveau_vm_del(vm); } int @@ -429,25 +434,21 @@ nouveau_vm_link(struct nouveau_vm *vm, struct nouveau_gpuobj *pgd) nouveau_gpuobj_ref(pgd, &vpgd->obj); - mutex_lock(&nv_subdev(vmm)->mutex); for (i = vm->fpde; i <= vm->lpde; i++) vmm->map_pgt(pgd, i, vm->pgt[i - vm->fpde].obj); list_add(&vpgd->head, &vm->pgd_list); - mutex_unlock(&nv_subdev(vmm...
2013 Dec 11
0
Fixing nouveau for >4k PAGE_SIZE
...t & ((1 << vmm->pgt_bits) - 1); > + u32 max = 1 << vmm->pgt_bits; > + u32 end, len, cardlen; > int i; > struct scatterlist *sg; > > - for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) { > - struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; > - sglen = sg_dma_len(sg) >> PAGE_SHIFT; > + /* We don't handle "big" pages here */ > + if (WARN_ON(shift != vmm->spg_shift || shift > PAGE_SHIFT)) > + return; > > - e...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...;pgt_bits) - 1)) >> bits; > > u32 max = 1 << (vmm->pgt_bits - bits); > > @@ -98,7 +99,7 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length, > > > > for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) { > > struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; > > - sglen = sg_dma_len(sg) >> PAGE_SHIFT; > > + sglen = sg_dma_len(sg) >> shift; > > > > end = pte + sglen; > > if (unlikely(end >= max)) > Please add a WARN_ON(big); in map_sg and map_sg_table if you do th...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...e; u32 pte = (offset & ((1 << vmm->pgt_bits) - 1)) >> bits; u32 max = 1 << (vmm->pgt_bits - bits); @@ -98,7 +99,7 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length, for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) { struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; - sglen = sg_dma_len(sg) >> PAGE_SHIFT; + sglen = sg_dma_len(sg) >> shift; end = pte + sglen; if (unlikely(end >= max)) @@ -106,7 +107,7 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length, len = end - pte; for...
2012 May 20
16
nouveau_subdev & misc patches
...overflow. Please review and comment --- drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ++- drivers/gpu/drm/nouveau/nouveau_device.c | 26 +++++++++++++++----------- drivers/gpu/drm/nouveau/nouveau_fb.h | 1 - drivers/gpu/drm/nouveau/nouveau_gpio.h | 3 --- drivers/gpu/drm/nouveau/nouveau_gpuobj.c | 12 ++++-------- drivers/gpu/drm/nouveau/nouveau_perf.c | 2 +- drivers/gpu/drm/nouveau/nouveau_pm.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_state.c | 2 ++ drivers/gpu/drm/nouveau/nouveau_therm.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++-------------- dri...
2009 Dec 26
2
[PATCH 1/3] drm/nouveau: Allocate a per-channel instance of NV_SW.
...ma.c index 7035536..f1fd3f2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dma.c +++ b/drivers/gpu/drm/nouveau/nouveau_dma.c @@ -35,6 +35,7 @@ nouveau_dma_init(struct nouveau_channel *chan) struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_gpuobj *m2mf = NULL; + struct nouveau_gpuobj *nvsw = NULL; int ret, i; /* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */ @@ -47,6 +48,15 @@ nouveau_dma_init(struct nouveau_channel *chan) if (ret) return ret; + /* Create an NV_SW object for various sync purposes */ + ret = nouveau_gpuob...
2009 Dec 25
1
[PATCH] drm/nv50: synchronize user channel after buffer object move on kernel channel
...ers/gpu/drm/nouveau/nouveau_dma.c +++ b/drivers/gpu/drm/nouveau/nouveau_dma.c @@ -52,6 +52,23 @@ nouveau_dma_init(struct nouveau_channel *chan) if (ret) return ret; + /* Allocate what we need for (simple) cross channel synchronisation. */ + if (dev_priv->card_type >= NV_50) { + struct nouveau_gpuobj *nvsw = NULL; + + ret = nouveau_gpuobj_sw_new(chan, NV50_NVSW, &nvsw); + if (ret) + return ret; + + ret = nouveau_gpuobj_ref_add(dev, chan, NvSw, nvsw, NULL); + if (ret) + return ret; + + ret = nouveau_notifier_alloc(chan, NvNotify1, 32, &chan->sync_ntfy); + if (ret) + return...
2013 Aug 11
0
Fixing nouveau for >4k PAGE_SIZE
...amp; ((1 << vmm->pgt_bits) - 1)) >> bits; > u32 max = 1 << (vmm->pgt_bits - bits); > @@ -98,7 +99,7 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length, > > for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) { > struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; > - sglen = sg_dma_len(sg) >> PAGE_SHIFT; > + sglen = sg_dma_len(sg) >> shift; > > end = pte + sglen; > if (unlikely(end >= max)) Please add a WARN_ON(big); in map_sg and map_sg_table if you do this. > @@ -106,7 +107,7 @@ n...
2012 Feb 27
1
[PATCH] drm/nv50/vm: Prevent kernel freeze
...file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c index f06f4ad..44fbac9 100644 --- a/drivers/gpu/drm/nouveau/nv50_vm.c +++ b/drivers/gpu/drm/nouveau/nv50_vm.c @@ -85,7 +85,7 @@ nv50_vm_map(struct nouveau_vma *vma, struct nouveau_gpuobj *pgt, target = 3; } - phys = vm_addr(vma, phys, mem->memtype, 0); + phys = vm_addr(vma, phys, mem->memtype, target); pte <<= 3; cnt <<= 3; -- 1.7.9.2
2012 Nov 11
0
[PATCH] drm/nv40: allocate ctxprog with kmalloc
.../engine/graph/ctxnv40.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c index e45035e..7bbb1e1 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv40.c @@ -669,21 +669,27 @@ nv40_grctx_fill(struct nouveau_device *device, struct nouveau_gpuobj *mem) }); } -void +int nv40_grctx_init(struct nouveau_device *device, u32 *size) { - u32 ctxprog[256], i; + u32 *ctxprog = kmalloc(256 * 4, GFP_KERNEL), i; struct nouveau_grctx ctx = { .device = device, .mode = NOUVEAU_GRCTX_PROG, .data = ctxprog, - .ctxprog_max = ARRAY_SIZE...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...nouveau_vm_map_at() > will never be called on these ? Correct. all cards before the nv50 family have no real vm. the BAR used for vram is just an identity mapping, not the entirety of VRAM may be accessible to the system. > - In vm/base.c this construct appears regulary: > > struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; > > Which makes me believe we have separate page tables for small vs. large > pages (in card mmu) (though I assume big is always 0 on nv40 unless > missed something, I want to make sure I'm not breaking everything > else...). > > Thus I assu...
2010 Feb 07
3
[PATCH] drm/nouveau: don't hold spin lock while calling kzalloc with GFP_KERNEL
...= chan) @@ -307,7 +302,7 @@ nouveau_channel_free(struct nouveau_channel *chan) pfifo->reassign(dev, true); - spin_unlock_irqrestore(&dev_priv->engine.lock, flags); + spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); /* Release the channel's resources */ nouveau_gpuobj_ref_del(dev, &chan->pushbuf); diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 64987a9..ea55a41 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -358,7 +358,6 @@ struct nouveau_engine { struct...
2013 Aug 29
0
Fixing nouveau for >4k PAGE_SIZE
...>> > u32 max = 1 << (vmm->pgt_bits - bits); >> > @@ -98,7 +99,7 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length, >> > >> > for_each_sg(mem->sg->sgl, sg, mem->sg->nents, i) { >> > struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; >> > - sglen = sg_dma_len(sg) >> PAGE_SHIFT; >> > + sglen = sg_dma_len(sg) >> shift; >> > >> > end = pte + sglen; >> > if (unlikely(end >= max)) >> Please a...
2009 Dec 27
3
[PATCH 1/2] drm/nv50: align size of buffer object to the right boundaries.
- Depth and stencil buffers are supposed to be large enough in general. Signed-off-by: Maarten Maathuis <madman2003 at gmail.com> --- drivers/gpu/drm/nouveau/nouveau_bo.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index e342a41..9fc4bd6 100644 ---
2012 Oct 07
2
[PATCH] drm/nouveau: fix error handling in core/core object creation functions
..., %s=1 to enable\n", iname); return -ENODEV; diff --git a/drivers/gpu/drm/nouveau/core/core/gpuobj.c b/drivers/gpu/drm/nouveau/core/core/gpuobj.c index c2a7608..6254d52 100644 --- a/drivers/gpu/drm/nouveau/core/core/gpuobj.c +++ b/drivers/gpu/drm/nouveau/core/core/gpuobj.c @@ -40,7 +40,7 @@ nouveau_gpuobj_destroy(struct nouveau_gpuobj *gpuobj) } if (gpuobj->heap.block_size) - nouveau_mm_fini(&gpuobj->heap); + WARN_ON(nouveau_mm_fini(&gpuobj->heap)); nouveau_object_destroy(&gpuobj->base); } @@ -113,7 +113,7 @@ nouveau_gpuobj_create_(struct nouveau_object *parent,...
2010 Jan 30
1
[PATCH] nouveau: move dereferences after null checks
...connector); drm_connector_cleanup(drm_connector); diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index 6c2cf81..e7c100b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c @@ -885,11 +885,12 @@ int nouveau_gpuobj_sw_new(struct nouveau_channel *chan, int class, struct nouveau_gpuobj **gpuobj_ret) { - struct drm_nouveau_private *dev_priv = chan->dev->dev_private; + struct drm_nouveau_private *dev_priv; struct nouveau_gpuobj *gpuobj; if (!chan || !gpuobj_ret || *gpuobj_ret != NULL) ret...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...y are both 12. - vma->node->type indicates the desired page shift for a given vma object we are trying to map. It may or may not match spg_shift. If it doesn't, the 'big' flag gets set in the various vm/base.c functions, which makes them use a different page table via: struct nouveau_gpuobj *pgt = vm->pgt[pde].obj[big]; Question: Can that ever happen on nv41 ? Or rather, can node->type ever be set to something that is neither vmm->spg_shift nor vmm->lpg_shift ? - vma->node->offset is the location in bytes in the card memory space of the nouveau_vma object, right...