Francisco Jerez
2010-Feb-19 03:59 UTC
[Nouveau] [PATCH 1/2] drm/nouveau: Unmap pushbuf BOs when we're done with them.
If you're especially unlucky BOs would move around and their kmaps would end up pointing to something else in GART, then ioctl_pushbuf() would use the kmaps again corrupting textures or other pushbufs (the most noticeable symptom was a PFIFO_DMA_PUSHER from time to time). Signed-off-by: Francisco Jerez <currojerez at riseup.net> --- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index fb6d87b..ec6da5c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -243,6 +243,8 @@ validate_fini_list(struct list_head *list, struct nouveau_fence *fence) nouveau_fence_unref((void *)&prev_fence); } + ttm_bo_kunmap(&nvbo->kmap); + list_del(&nvbo->entry); nvbo->reserved_by = NULL; ttm_bo_unreserve(&nvbo->bo); -- 1.6.4.4
Francisco Jerez
2010-Feb-19 03:59 UTC
[Nouveau] [PATCH 2/2] drm/nouveau: Don't reuse the same variable in a nested loop.
Signed-off-by: Francisco Jerez <currojerez at riseup.net> --- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index ec6da5c..173d5e2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -578,7 +578,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, struct nouveau_channel *chan; struct validate_op op; struct nouveau_fence *fence = 0; - int i, ret = 0, do_reloc = 0; + int i, j, ret = 0, do_reloc = 0; NOUVEAU_CHECK_INITIALISED_WITH_RETURN; NOUVEAU_GET_USER_CHANNEL_WITH_RETURN(req->channel, file_priv, chan); @@ -700,7 +700,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, OUT_RING(chan, ((mem->start << PAGE_SHIFT) + push[i].offset) | 0x20000000); OUT_RING(chan, 0); - for (i = 0; i < NOUVEAU_DMA_SKIPS; i++) + for (j = 0; j < NOUVEAU_DMA_SKIPS; j++) OUT_RING(chan, 0); } } -- 1.6.4.4
Ben Skeggs
2010-Feb-19 05:05 UTC
[Nouveau] [PATCH 1/2] drm/nouveau: Unmap pushbuf BOs when we're done with them.
On Fri, 2010-02-19 at 04:59 +0100, Francisco Jerez wrote:> If you're especially unlucky BOs would move around and their kmaps > would end up pointing to something else in GART, then ioctl_pushbuf() > would use the kmaps again corrupting textures or other pushbufs (the > most noticeable symptom was a PFIFO_DMA_PUSHER from time to time).Oops, I actually was doing that at some point. Not sure where it disappeared to :) Thanks, pushed along with 2/2. Ben.> > Signed-off-by: Francisco Jerez <currojerez at riseup.net> > --- > drivers/gpu/drm/nouveau/nouveau_gem.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c > index fb6d87b..ec6da5c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_gem.c > +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c > @@ -243,6 +243,8 @@ validate_fini_list(struct list_head *list, struct nouveau_fence *fence) > nouveau_fence_unref((void *)&prev_fence); > } > > + ttm_bo_kunmap(&nvbo->kmap); > + > list_del(&nvbo->entry); > nvbo->reserved_by = NULL; > ttm_bo_unreserve(&nvbo->bo);
Reasonably Related Threads
- [PATCH 1/4] drm/nouveau: refactor nouveau_dma_wait()
- [PATCH 1/2] drm/nv10: Keep the lower bits of PGRAPH_CTX_USER during context switches.
- [PATCH] drm/nouveau: rewrite nouveau_dma_wait()
- [PATCH 1/6] drm/nouveau: bo read/write wrappers for nv04_crtc.c
- [PATCH 0/6] drm/nouveau: Support sync FDs and sync objects