summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/dri/nouveau/nouveau_bo.c
diff options
context:
space:
mode:
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>2008-07-08 16:38:55 +0200
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>2008-07-08 16:38:55 +0200
commit98c1b12ea0117e325b7eaebd92298d8cef7cad15 (patch)
treed6d0a52efcef1e7554f11b3f59803feff7df6394 /src/gallium/winsys/dri/nouveau/nouveau_bo.c
parent28268f7b22905974a2cc3c099b1a842d20a7712a (diff)
parent06d87b44cffef9e335b9a0e70fd2aec61fcd171b (diff)
Merge branch 'gallium-0.1' of git+ssh://marcheu@git.freedesktop.org/git/nouveau/mesa into gallium-0.1
Diffstat (limited to 'src/gallium/winsys/dri/nouveau/nouveau_bo.c')
-rw-r--r--src/gallium/winsys/dri/nouveau/nouveau_bo.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/winsys/dri/nouveau/nouveau_bo.c b/src/gallium/winsys/dri/nouveau/nouveau_bo.c
index 57f5b7d1ae..b5942994d9 100644
--- a/src/gallium/winsys/dri/nouveau/nouveau_bo.c
+++ b/src/gallium/winsys/dri/nouveau/nouveau_bo.c
@@ -182,6 +182,13 @@ nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, int align,
nvbo->drm.alignment = align;
nvbo->refcount = 1;
+ if (flags & NOUVEAU_BO_TILED) {
+ nvbo->tiled = 1;
+ if (flags & NOUVEAU_BO_ZTILE)
+ nvbo->tiled |= 2;
+ flags &= ~NOUVEAU_BO_TILED;
+ }
+
ret = nouveau_bo_set_status(&nvbo->base, flags);
if (ret) {
free(nvbo);
@@ -332,6 +339,12 @@ nouveau_bo_set_status(struct nouveau_bo *bo, uint32_t flags)
else
if (flags & NOUVEAU_BO_GART)
new_flags |= (NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI);
+
+ if (nvbo->tiled && flags) {
+ new_flags |= NOUVEAU_MEM_TILE;
+ if (nvbo->tiled & 2)
+ new_flags |= NOUVEAU_MEM_TILE_ZETA;
+ }
if (new_flags) {
ret = nouveau_mem_alloc(bo->device, bo->size,
@@ -347,9 +360,12 @@ nouveau_bo_set_status(struct nouveau_bo *bo, uint32_t flags)
/* Copy old -> new */
/*XXX: use M2MF */
if (nvbo->sysmem || nvbo->map) {
+ struct nouveau_pushbuf_bo *pbo = nvbo->pending;
+ nvbo->pending = NULL;
nouveau_bo_map(bo, NOUVEAU_BO_RD);
memcpy(new_map, bo->map, bo->size);
nouveau_bo_unmap(bo);
+ nvbo->pending = pbo;
}
/* Free old memory */