From: Ben Skeggs Date: Fri, 5 Jun 2009 12:04:07 +0000 (+1000) Subject: nv50: use larger tile sizes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d06e380e022d938a61800cbbec0004ec9f1fecfd;p=mesa.git nv50: use larger tile sizes --- diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 2fbedb6779a..6b605ba416c 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 1788f764560..a0106fc3392 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);