summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-06-05 22:04:07 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-06-05 22:53:24 +1000
commitd06e380e022d938a61800cbbec0004ec9f1fecfd (patch)
tree63d7867e5cc63bef5b460cede40c042282ba37d0
parenta471497345bcd3aaaa52d3dc73f68367cb4af6a0 (diff)
nv50: use larger tile sizes
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c11
-rw-r--r--src/gallium/drivers/nv50/nv50_state_validate.c4
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 2fbedb6779..6b605ba416 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -34,7 +34,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
struct pipe_texture *pt = &mt->base;
unsigned width = tmp->width[0], height = tmp->height[0];
unsigned depth = tmp->depth[0];
- uint32_t tile_mode = 0, tile_flags = 0;
+ uint32_t tile_mode, tile_flags, tile_h;
int ret, i, l;
mt->base = *tmp;
@@ -51,6 +51,13 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
break;
}
+ if (pt->height[0] > 32) tile_mode = 4;
+ else if (pt->height[0] > 16) tile_mode = 3;
+ else if (pt->height[0] > 8) tile_mode = 2;
+ else if (pt->height[0] > 4) tile_mode = 1;
+ else tile_mode = 0;
+ tile_h = 1 << (tile_mode + 2);
+
switch (pt->target) {
case PIPE_TEXTURE_3D:
mt->image_nr = pt->depth[0];
@@ -87,7 +94,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
size = align(pt->width[l], 8) * pt->block.size;
size = align(size, 64);
- size *= align(pt->height[l], 8) * pt->block.size;
+ size *= align(pt->height[l], tile_h) * pt->block.size;
lvl->image_offset[i] = mt->total_size;
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
index 1788f76456..a0106fc339 100644
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -66,7 +66,7 @@ nv50_state_validate_fb(struct nv50_context *nv50)
so_data(so, 0xe6);
break;
}
- so_data(so, 0x00000000);
+ so_data(so, bo->tile_mode << 4);
so_data(so, 0x00000000);
so_method(so, tesla, 0x1224, 1);
@@ -104,7 +104,7 @@ nv50_state_validate_fb(struct nv50_context *nv50)
so_data(so, 0x16);
break;
}
- so_data(so, 0x00000000);
+ so_data(so, bo->tile_mode << 4);
so_data(so, 0x00000000);
so_method(so, tesla, 0x1538, 1);