Younes Manton
2011-Nov-22 19:58 UTC
[Nouveau] [PATCH] drm/nouveau: Keep RAMIN heap within the channel.
The entire RAMIN is allocated to be 'size', but the heap is specified as 'base' + 'size' inside RAMIN, so it will overflow past RAMIN by 'base' bytes on NV50+ and clobber other allocatons unless it's size is adjusted. Signed-off-by: Younes Manton <younes.m at gmail.com> --- drivers/gpu/drm/nouveau/nouveau_object.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index 02222c5..960c0ae 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c @@ -680,7 +680,7 @@ nouveau_gpuobj_channel_init_pramin(struct nouveau_channel *chan) return ret; } - ret = drm_mm_init(&chan->ramin_heap, base, size); + ret = drm_mm_init(&chan->ramin_heap, base, size - base); if (ret) { NV_ERROR(dev, "Error creating PRAMIN heap: %d\n", ret); nouveau_gpuobj_ref(NULL, &chan->ramin); -- 1.7.7.1
Possibly Parallel Threads
- [Bug 24662] New: [DRM] ramin ioremap fails (no vmalloc space)
- [RFC 07/16] drm/nouveau/bar/nvc0: support chips without BAR3
- [RFC 07/16] drm/nouveau/bar/nvc0: support chips without BAR3
- [PATCH] drm/nouveau: protect vm refcount with mutex
- [PATCH] drm/nv50: synchronize user channel after buffer object move on kernel channel