Skip to contentSkip to conversation

nouveau: make sure initial kalloc for user bo ends up in the right place

PATCH In review Maarten Maathuis 2 participants 3 messages Mar 1, 2010 – Mar 2, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 nouveau/nouveau_reloc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
nouveau/nouveau_reloc.c +6 -0
index 301482b..332dfa0 100644
@@ -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;
Signature · 1 line
1.7.0

A message that is not in the archive (sent off-list or not yet received): 1267468776-6652-1-git-send-email-madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 15 lines · Maarten Maathuis

- 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.

---
 nouveau/nouveau_reloc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
nouveau/nouveau_reloc.c +0 -0
index 301482b..332dfa0 100644
@@ -73,6 +73,12 @@ nouveau_reloc_emit(struct nouveau_channel *chan, struct nouveau_bo *reloc_bo,
 		return -EINVAL;
 	}

nouveau/nouveau_reloc.c nouveau_reloc_emit(struct nouveau_channel *chan, struct nouveau_bo *reloc_bo, · line 84

Quoted 10 lines
nouveau/nouveau_reloc.c +6 -0
 
+	/* 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:

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): [email protected]