Browse Source

i965: Apply the miptree offset to surface state for renderbuffers

Previously, we were completely ignoring the mt->offset field for
renderbuffers.  While it does have some alignment constraints, it is valid
to use it.  This patch adds the code to each of the 4 surface state setup
functions to handle it.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
tags/10.5-branchpoint
Jason Ekstrand 10 years ago
parent
commit
117a1d69de

+ 2
- 1
src/mesa/drivers/dri/i965/brw_wm_surface_state.c View File

@@ -658,8 +658,9 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
format << BRW_SURFACE_FORMAT_SHIFT);

/* reloc */
assert(mt->offset % mt->cpp == 0);
surf[1] = (intel_renderbuffer_get_tile_offsets(irb, &tile_x, &tile_y) +
mt->bo->offset64);
mt->bo->offset64 + mt->offset);

surf[2] = ((rb->Width - 1) << BRW_SURFACE_WIDTH_SHIFT |
(rb->Height - 1) << BRW_SURFACE_HEIGHT_SHIFT);

+ 2
- 1
src/mesa/drivers/dri/i965/gen6_surface_state.c View File

@@ -97,7 +97,8 @@ gen6_update_renderbuffer_surface(struct brw_context *brw,
SET_FIELD(format, BRW_SURFACE_FORMAT);

/* reloc */
surf[1] = mt->bo->offset64;
assert(mt->offset % mt->cpp == 0);
surf[1] = mt->bo->offset64 + mt->offset;

/* In the gen6 PRM Volume 1 Part 1: Graphics Core, Section 7.18.3.7.1
* (Surface Arrays For all surfaces other than separate stencil buffer):

+ 2
- 1
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c View File

@@ -517,7 +517,8 @@ gen7_update_renderbuffer_surface(struct brw_context *brw,
surf[0] |= GEN7_SURFACE_IS_ARRAY;
}

surf[1] = mt->bo->offset64;
assert(mt->offset % mt->cpp == 0);
surf[1] = mt->bo->offset64 + mt->offset;

assert(brw->has_surface_tile_offset);


+ 2
- 1
src/mesa/drivers/dri/i965/gen8_surface_state.c View File

@@ -432,7 +432,8 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
SET_FIELD(HSW_SCS_BLUE, GEN7_SURFACE_SCS_B) |
SET_FIELD(HSW_SCS_ALPHA, GEN7_SURFACE_SCS_A);

*((uint64_t *) &surf[8]) = mt->bo->offset64; /* reloc */
assert(mt->offset % mt->cpp == 0);
*((uint64_t *) &surf[8]) = mt->bo->offset64 + mt->offset; /* reloc */

if (aux_mt) {
*((uint64_t *) &surf[10]) = aux_mt->bo->offset64;

Loading…
Cancel
Save