summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-10-09 23:26:34 +0200
committerFrancisco Jerez <[email protected]>2010-10-12 04:12:56 +0200
commit70828aa246464d5e1ae0c32a9301c4dccfa54935 (patch)
treea1944fe1f48d498da9a7fcc7810e4f53acd1659d
parent965f69cb0c51ca5a5c332e207cc86367fa31e6b1 (diff)
dri/nouveau: Initialize tile_flags when allocating a render target.
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_surface.c16
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state_fb.c4
2 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_surface.c b/src/mesa/drivers/dri/nouveau/nouveau_surface.c
index 33393970a07..b6b5c641c04 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_surface.c
@@ -34,8 +34,8 @@ nouveau_surface_alloc(GLcontext *ctx, struct nouveau_surface *s,
unsigned flags, unsigned format,
unsigned width, unsigned height)
{
- unsigned tile_mode, cpp = _mesa_get_format_bytes(format);
- int ret;
+ unsigned tile_mode = 0, tile_flags = 0;
+ int ret, cpp = _mesa_get_format_bytes(format);
nouveau_bo_ref(NULL, &s->bo);
@@ -51,13 +51,21 @@ nouveau_surface_alloc(GLcontext *ctx, struct nouveau_surface *s,
if (layout == TILED) {
s->pitch = align(s->pitch, 256);
tile_mode = s->pitch;
+
+ if (cpp == 4)
+ tile_flags = NOUVEAU_BO_TILE_32BPP;
+ else if (cpp == 2)
+ tile_flags = NOUVEAU_BO_TILE_16BPP;
+
+ if (_mesa_get_format_bits(format, GL_DEPTH_BITS))
+ tile_flags |= NOUVEAU_BO_TILE_ZETA;
+
} else {
s->pitch = align(s->pitch, 64);
- tile_mode = 0;
}
ret = nouveau_bo_new_tile(context_dev(ctx), flags, 0, s->pitch * height,
- tile_mode, 0, &s->bo);
+ tile_mode, tile_flags, &s->bo);
assert(!ret);
}
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
index f9f3ebaa8d0..81edbe8172d 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
@@ -64,8 +64,8 @@ setup_lma_buffer(GLcontext *ctx)
if (!nfb->hierz.bo || nfb->hierz.bo->size != size) {
nouveau_bo_ref(NULL, &nfb->hierz.bo);
- nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_VRAM, 0, size,
- &nfb->hierz.bo);
+ nouveau_bo_new_tile(context_dev(ctx), NOUVEAU_BO_VRAM, 0, size,
+ 0, NOUVEAU_BO_TILE_ZETA, &nfb->hierz.bo);
}
nouveau_bo_markl(bctx, celsius, NV17TCL_LMA_DEPTH_BUFFER_OFFSET,