Maarten Maathuis
2010-Mar-01 18:39 UTC
[Nouveau] [PATCH] nouveau: make sure initial kalloc for user bo ends up in the right place
- Currently reloc'ing a user bo to gart will first cause an allocation in vram, which is then cpu written to, then the bo gets moved to gart. Signed-off-by: Maarten Maathuis <madman2003 at gmail.com> --- nouveau/nouveau_reloc.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/nouveau/nouveau_reloc.c b/nouveau/nouveau_reloc.c index 301482b..332dfa0 100644 --- a/nouveau/nouveau_reloc.c +++ b/nouveau/nouveau_reloc.c @@ -73,6 +73,12 @@ nouveau_reloc_emit(struct nouveau_channel *chan, struct nouveau_bo *reloc_bo, return -EINVAL; } + /* We're about to reloc a user buffer, better make sure we don't cause + * a double migration. + */ + if (!(nvbo->flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM))) + nvbo->flags |= (flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM)); + rpbbo = nouveau_bo_emit_buffer(chan, reloc_bo); if (!rpbbo) return -ENOMEM; -- 1.7.0
Francisco Jerez
2010-Mar-01 21:26 UTC
[Nouveau] [PATCH] nouveau: make sure initial kalloc for user bo ends up in the right place
Maarten Maathuis <madman2003 at gmail.com> writes:> - Currently reloc'ing a user bo to gart will first cause an allocation in vram, > which is then cpu written to, then the bo gets moved to gart. > > Signed-off-by: Maarten Maathuis <madman2003 at gmail.com> > --- > nouveau/nouveau_reloc.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/nouveau/nouveau_reloc.c b/nouveau/nouveau_reloc.c > index 301482b..332dfa0 100644 > --- a/nouveau/nouveau_reloc.c > +++ b/nouveau/nouveau_reloc.c > @@ -73,6 +73,12 @@ nouveau_reloc_emit(struct nouveau_channel *chan, struct nouveau_bo *reloc_bo, > return -EINVAL; > } > > + /* We're about to reloc a user buffer, better make sure we don't cause > + * a double migration. > + */ > + if (!(nvbo->flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM))) > + nvbo->flags |= (flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM)); > + > rpbbo = nouveau_bo_emit_buffer(chan, reloc_bo); > if (!rpbbo) > return -ENOMEM;Looks good to me: Acked-by: Francisco Jerez <currojerez at riseup.net> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20100301/0e450679/attachment.pgp>
Reasonably Related Threads
- [PATCH 3/3] libdrm: Move all noninstalled headers to noinst_HEADERS.
- nv vpe video decoder
- [PATCH 1/2] libdrm/nouveau: new optimized libdrm pushbuffer ABI
- [PATCH] nv50: remove vtxbuf stateobject after a referenced vtxbuf is mapped
- [PATCH 1/2] nv50: don't emit reloc markers after a referenced vtxbuf is mapped