aboutsummaryrefslogtreecommitdiff
path: root/nouveau/nouveau_reloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'nouveau/nouveau_reloc.c')
-rw-r--r--nouveau/nouveau_reloc.c6
1 files changed, 6 insertions, 0 deletions
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;