aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Maathuis2010-02-24 16:10:34 -0600
committerMaarten Maathuis2010-03-02 16:25:50 -0600
commitcdc788d6456645072a1610aa9217e4ebae5cfc6b (patch)
tree33f2cc2d2b8312e57e87c5c9798722f3a0bbdc65
parenta1f9ea765ddc5cad45e36c4931663b21992727ee (diff)
downloadlibdrm-cdc788d6456645072a1610aa9217e4ebae5cfc6b.tar.gz
libdrm-cdc788d6456645072a1610aa9217e4ebae5cfc6b.tar.xz
libdrm-cdc788d6456645072a1610aa9217e4ebae5cfc6b.zip
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 <currojerez@riseup.net> Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
-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,
73 return -EINVAL; 73 return -EINVAL;
74 } 74 }
75 75
76 /* We're about to reloc a user buffer, better make sure we don't cause
77 * a double migration.
78 */
79 if (!(nvbo->flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM)))
80 nvbo->flags |= (flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM));
81
76 rpbbo = nouveau_bo_emit_buffer(chan, reloc_bo); 82 rpbbo = nouveau_bo_emit_buffer(chan, reloc_bo);
77 if (!rpbbo) 83 if (!rpbbo)
78 return -ENOMEM; 84 return -ENOMEM;