diff options
author | Eric Anholt <eric@anholt.net> | 2014-04-25 13:29:41 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-05-01 15:12:27 -0700 |
commit | e16c5c906316c58c0633e9bba02339ef981e5ef3 (patch) | |
tree | 3879fcda354e8877002b430a61ce7dad84398499 /src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | |
parent | e3a9ca4563790f54976a969bf70cd5f45cbc4e13 (diff) | |
download | external_mesa3d-e16c5c906316c58c0633e9bba02339ef981e5ef3.zip external_mesa3d-e16c5c906316c58c0633e9bba02339ef981e5ef3.tar.gz external_mesa3d-e16c5c906316c58c0633e9bba02339ef981e5ef3.tar.bz2 |
i965: Drop use of intel_region from miptrees.
Note: region->width/height used to reflect the total_width/height padding
of separate stencil, though mt->total_width didn't. region->width/height
was being used in EGL images, where the padded value would have been the
wrong one, so I converted them to use rb->Width/Height.
v2: Drop debug printf that slipped in (caught by Ken)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_wm_surface_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c index 1303555..d71a1d1 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c @@ -107,12 +107,12 @@ gen7_set_surface_mcs_info(struct brw_context *brw, * * "The MCS surface must be stored as Tile Y." */ - assert(mcs_mt->region->tiling == I915_TILING_Y); + assert(mcs_mt->tiling == I915_TILING_Y); /* Compute the pitch in units of tiles. To do this we need to divide the * pitch in bytes by 128, since a single Y-tile is 128 bytes wide. */ - unsigned pitch_tiles = mcs_mt->region->pitch / 128; + unsigned pitch_tiles = mcs_mt->pitch / 128; /* The upper 20 bits of surface state DWORD 6 are the upper 20 bits of the * GPU address of the MCS buffer; the lower 12 bits contain other control @@ -120,15 +120,15 @@ gen7_set_surface_mcs_info(struct brw_context *brw, * thus have their lower 12 bits zero), we can use an ordinary reloc to do * the necessary address translation. */ - assert ((mcs_mt->region->bo->offset64 & 0xfff) == 0); + assert ((mcs_mt->bo->offset64 & 0xfff) == 0); surf[6] = GEN7_SURFACE_MCS_ENABLE | SET_FIELD(pitch_tiles - 1, GEN7_SURFACE_MCS_PITCH) | - mcs_mt->region->bo->offset64; + mcs_mt->bo->offset64; drm_intel_bo_emit_reloc(brw->batch.bo, surf_offset + 6 * 4, - mcs_mt->region->bo, + mcs_mt->bo, surf[6] & 0xfff, is_render_target ? I915_GEM_DOMAIN_RENDER : I915_GEM_DOMAIN_SAMPLER, @@ -296,7 +296,7 @@ gen7_update_texture_surface(struct gl_context *ctx, surf[0] = translate_tex_target(tObj->Target) << BRW_SURFACE_TYPE_SHIFT | tex_format << BRW_SURFACE_FORMAT_SHIFT | - gen7_surface_tiling_mode(mt->region->tiling); + gen7_surface_tiling_mode(mt->tiling); /* mask of faces present in cube map; for other surfaces MBZ. */ if (tObj->Target == GL_TEXTURE_CUBE_MAP || tObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY) @@ -319,13 +319,13 @@ gen7_update_texture_surface(struct gl_context *ctx, if (mt->array_spacing_lod0) surf[0] |= GEN7_SURFACE_ARYSPC_LOD0; - surf[1] = mt->region->bo->offset64 + mt->offset; /* reloc */ + surf[1] = mt->bo->offset64 + mt->offset; /* reloc */ surf[2] = SET_FIELD(mt->logical_width0 - 1, GEN7_SURFACE_WIDTH) | SET_FIELD(mt->logical_height0 - 1, GEN7_SURFACE_HEIGHT); surf[3] = SET_FIELD(effective_depth - 1, BRW_SURFACE_DEPTH) | - (mt->region->pitch - 1); + (mt->pitch - 1); surf[4] = gen7_surface_msaa_bits(mt->num_samples, mt->msaa_layout) | SET_FIELD(tObj->MinLayer, GEN7_SURFACE_MIN_ARRAY_ELEMENT) | @@ -366,8 +366,8 @@ gen7_update_texture_surface(struct gl_context *ctx, /* Emit relocation to surface contents */ drm_intel_bo_emit_reloc(brw->batch.bo, *surf_offset + 4, - mt->region->bo, - surf[1] - mt->region->bo->offset64, + mt->bo, + surf[1] - mt->bo->offset64, I915_GEM_DOMAIN_SAMPLER, 0); gen7_check_surface_setup(surf, false /* is_render_target */); @@ -448,7 +448,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw, { struct gl_context *ctx = &brw->ctx; struct intel_renderbuffer *irb = intel_renderbuffer(rb); - struct intel_region *region = irb->mt->region; + struct intel_mipmap_tree *mt = irb->mt; uint32_t format; /* _NEW_BUFFERS */ mesa_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb)); @@ -504,7 +504,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw, format << BRW_SURFACE_FORMAT_SHIFT | (irb->mt->array_spacing_lod0 ? GEN7_SURFACE_ARYSPC_LOD0 : GEN7_SURFACE_ARYSPC_FULL) | - gen7_surface_tiling_mode(region->tiling); + gen7_surface_tiling_mode(mt->tiling); if (irb->mt->align_h == 4) surf[0] |= GEN7_SURFACE_VALIGN_4; @@ -515,7 +515,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw, surf[0] |= GEN7_SURFACE_IS_ARRAY; } - surf[1] = region->bo->offset64; + surf[1] = mt->bo->offset64; assert(brw->has_surface_tile_offset); @@ -526,7 +526,7 @@ gen7_update_renderbuffer_surface(struct brw_context *brw, SET_FIELD(irb->mt->logical_height0 - 1, GEN7_SURFACE_HEIGHT); surf[3] = ((depth - 1) << BRW_SURFACE_DEPTH_SHIFT) | - (region->pitch - 1); + (mt->pitch - 1); surf[4] = gen7_surface_msaa_bits(irb->mt->num_samples, irb->mt->msaa_layout) | min_array_element << GEN7_SURFACE_MIN_ARRAY_ELEMENT_SHIFT | @@ -548,8 +548,8 @@ gen7_update_renderbuffer_surface(struct brw_context *brw, drm_intel_bo_emit_reloc(brw->batch.bo, brw->wm.base.surf_offset[surf_index] + 4, - region->bo, - surf[1] - region->bo->offset64, + mt->bo, + surf[1] - mt->bo->offset64, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER); |