nv50: use larger tile sizes

This commit is contained in:
Ben Skeggs
2009-06-05 22:04:07 +10:00
parent a471497345
commit d06e380e02
2 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -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;
@@ -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);