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
@@ -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); |
@@ -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): |
@@ -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); | |||
@@ -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; |