From cdc788d6456645072a1610aa9217e4ebae5cfc6b Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Wed, 24 Feb 2010 23:10:34 +0100 Subject: 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 written to by cpu, then the bo gets moved to gart. Acked-by: Francisco Jerez Signed-off-by: Maarten Maathuis --- nouveau/nouveau_reloc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nouveau/nouveau_reloc.c') diff --git a/nouveau/nouveau_reloc.c b/nouveau/nouveau_reloc.c index 301482b0..332dfa01 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; -- cgit v1.2.3