summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_layout.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-08-17 14:09:43 +0800
committerChia-I Wu <[email protected]>2014-08-19 19:53:37 +0800
commit5b4fc5f156bff72e63e2f528004a48d008d3af6f (patch)
tree0be93f037c30410911c18df16f5f331033648705 /src/gallium/drivers/ilo/ilo_layout.c
parentfb3d506431871fdb04fc84bbcc916d8f9d7c9954 (diff)
ilo: remove layer offsetting
Follow i965 to kill layer offsetting for GEN6.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_layout.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_layout.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/gallium/drivers/ilo/ilo_layout.c b/src/gallium/drivers/ilo/ilo_layout.c
index 6770632ae41..b6e958585a5 100644
--- a/src/gallium/drivers/ilo/ilo_layout.c
+++ b/src/gallium/drivers/ilo/ilo_layout.c
@@ -1396,86 +1396,3 @@ ilo_layout_update_for_imported_bo(struct ilo_layout *layout,
return true;
}
-
-/**
- * Return the offset (in bytes) to a slice within the bo.
- *
- * The returned offset is aligned to tile size. Since slices are not
- * guaranteed to start at tile boundaries, the X and Y offsets (in pixels)
- * from the tile origin to the slice are also returned. X offset is always a
- * multiple of 4 and Y offset is always a multiple of 2.
- */
-unsigned
-ilo_layout_get_slice_tile_offset(const struct ilo_layout *layout,
- unsigned level, unsigned slice,
- unsigned *x_offset, unsigned *y_offset)
-{
- unsigned tile_w, tile_h, tile_size, row_size;
- unsigned tile_offset, x, y;
-
- /* see the Sandy Bridge PRM, volume 1 part 2, page 24 */
-
- switch (layout->tiling) {
- case INTEL_TILING_NONE:
- /* W-tiled */
- if (layout->format == PIPE_FORMAT_S8_UINT) {
- tile_w = 64;
- tile_h = 64;
- }
- else {
- tile_w = 1;
- tile_h = 1;
- }
- break;
- case INTEL_TILING_X:
- tile_w = 512;
- tile_h = 8;
- break;
- case INTEL_TILING_Y:
- tile_w = 128;
- tile_h = 32;
- break;
- default:
- assert(!"unknown tiling");
- tile_w = 1;
- tile_h = 1;
- break;
- }
-
- tile_size = tile_w * tile_h;
- row_size = layout->bo_stride * tile_h;
-
- ilo_layout_get_slice_pos(layout, level, slice, &x, &y);
- /* in bytes */
- ilo_layout_pos_to_mem(layout, x, y, &x, &y);
- tile_offset = row_size * (y / tile_h) + tile_size * (x / tile_w);
-
- /*
- * Since tex->bo_stride is a multiple of tile_w, slice_offset should be
- * aligned at this point.
- */
- assert(tile_offset % tile_size == 0);
-
- /*
- * because of the possible values of align_i and align_j in
- * tex_layout_init_alignments(), x_offset is guaranteed to be a multiple of
- * 4 and y_offset is guaranteed to be a multiple of 2.
- */
- if (x_offset) {
- /* in pixels */
- x = (x % tile_w) / layout->block_size * layout->block_width;
- assert(x % 4 == 0);
-
- *x_offset = x;
- }
-
- if (y_offset) {
- /* in pixels */
- y = (y % tile_h) * layout->block_height;
- assert(y % 2 == 0);
-
- *y_offset = y;
- }
-
- return tile_offset;
-}