* accessing tiled memory. Using this Message Type to access linear
* (untiled) memory is UNDEFINED."
*/
- if (irb->mt->region->tiling == I915_TILING_NONE)
+ if (irb->mt->tiling == I915_TILING_NONE)
wm_prog_key.use_simd16_replicated_data = false;
/* Constant color writes ignore everyting in blend and color calculator
* name, then drm_intel_bo_flink() is a low-cost getter. It does not
* create a new name.
*/
- drm_intel_bo_flink(last_mt->region->bo, &old_name);
+ drm_intel_bo_flink(last_mt->bo, &old_name);
}
if (old_name == buffer->name)
else
last_mt = rb->singlesample_mt;
- if (last_mt && last_mt->region->bo == buffer->bo)
+ if (last_mt && last_mt->bo == buffer->bo)
return;
intel_update_winsys_renderbuffer_miptree(intel, rb, buffer->bo,
continue;
intel_miptree_all_slices_resolve_depth(brw, tex_obj->mt);
intel_miptree_resolve_color(brw, tex_obj->mt);
- brw_render_cache_set_check_flush(brw, tex_obj->mt->region->bo);
+ brw_render_cache_set_check_flush(brw, tex_obj->mt->bo);
}
}
back_irb->need_downsample = true;
if (depth_irb && ctx->Depth.Mask) {
intel_renderbuffer_att_set_needs_depth_resolve(depth_att);
- brw_render_cache_set_add_bo(brw, depth_irb->mt->region->bo);
+ brw_render_cache_set_add_bo(brw, depth_irb->mt->bo);
}
if (ctx->Extensions.ARB_stencil_texturing &&
stencil_irb && ctx->Stencil._WriteEnabled) {
- brw_render_cache_set_add_bo(brw, stencil_irb->mt->region->bo);
+ brw_render_cache_set_add_bo(brw, stencil_irb->mt->bo);
}
for (int i = 0; i < fb->_NumColorDrawBuffers; i++) {
intel_renderbuffer(fb->_ColorDrawBuffers[i]);
if (irb)
- brw_render_cache_set_add_bo(brw, irb->mt->region->bo);
+ brw_render_cache_set_add_bo(brw, irb->mt->bo);
}
}
* that the region is untiled even though it's W tiled.
*/
brw->depthstencil.stencil_offset =
- (stencil_draw_y & ~tile_mask_y) * stencil_mt->region->pitch +
+ (stencil_draw_y & ~tile_mask_y) * stencil_mt->pitch +
(stencil_draw_x & ~tile_mask_x) * 64;
}
}
/* Prior to Gen7, if using separate stencil, hiz must be enabled. */
assert(brw->gen >= 7 || !separate_stencil || hiz);
- assert(brw->gen < 6 || depth_mt->region->tiling == I915_TILING_Y);
- assert(!hiz || depth_mt->region->tiling == I915_TILING_Y);
+ assert(brw->gen < 6 || depth_mt->tiling == I915_TILING_Y);
+ assert(!hiz || depth_mt->tiling == I915_TILING_Y);
depthbuffer_format = brw_depthbuffer_format(brw);
depth_surface_type = BRW_SURFACE_2D;
}
if (depth_mt)
- brw_render_cache_set_check_flush(brw, depth_mt->region->bo);
+ brw_render_cache_set_check_flush(brw, depth_mt->bo);
if (stencil_mt)
- brw_render_cache_set_check_flush(brw, stencil_mt->region->bo);
+ brw_render_cache_set_check_flush(brw, stencil_mt->bo);
brw->vtbl.emit_depth_stencil_hiz(brw, depth_mt, depth_offset,
depthbuffer_format, depth_surface_type,
BEGIN_BATCH(len);
OUT_BATCH(_3DSTATE_DEPTH_BUFFER << 16 | (len - 2));
- OUT_BATCH((depth_mt ? depth_mt->region->pitch - 1 : 0) |
+ OUT_BATCH((depth_mt ? depth_mt->pitch - 1 : 0) |
(depthbuffer_format << 18) |
((enable_hiz_ss ? 1 : 0) << 21) | /* separate stencil enable */
((enable_hiz_ss ? 1 : 0) << 22) | /* hiz enable */
(BRW_TILEWALK_YMAJOR << 26) |
- ((depth_mt ? depth_mt->region->tiling != I915_TILING_NONE : 1)
+ ((depth_mt ? depth_mt->tiling != I915_TILING_NONE : 1)
<< 27) |
(depth_surface_type << 29));
if (depth_mt) {
- OUT_RELOC(depth_mt->region->bo,
+ OUT_RELOC(depth_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
depth_offset);
} else {
struct intel_mipmap_tree *hiz_mt = depth_mt->hiz_mt;
BEGIN_BATCH(3);
OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
- OUT_BATCH(hiz_mt->region->pitch - 1);
- OUT_RELOC(hiz_mt->region->bo,
+ OUT_BATCH(hiz_mt->pitch - 1);
+ OUT_RELOC(hiz_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
brw->depthstencil.hiz_offset);
ADVANCE_BATCH();
/* Emit stencil buffer. */
if (separate_stencil) {
- struct intel_region *region = stencil_mt->region;
-
BEGIN_BATCH(3);
OUT_BATCH((_3DSTATE_STENCIL_BUFFER << 16) | (3 - 2));
/* The stencil buffer has quirky pitch requirements. From Vol 2a,
* The pitch must be set to 2x the value computed based on width, as
* the stencil buffer is stored with two rows interleaved.
*/
- OUT_BATCH(2 * region->pitch - 1);
- OUT_RELOC(region->bo,
+ OUT_BATCH(2 * stencil_mt->pitch - 1);
+ OUT_RELOC(stencil_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
brw->depthstencil.stencil_offset);
ADVANCE_BATCH();
(void) option;
intel = intel_texture_object(obj);
- if (intel->mt == NULL || intel->mt->region == NULL)
+ if (intel->mt == NULL || intel->mt->bo == NULL)
return GL_RELEASED_APPLE;
- return intel_buffer_purgeable(intel->mt->region->bo);
+ return intel_buffer_purgeable(intel->mt->bo);
}
static GLenum
if (intel->mt == NULL)
return GL_RELEASED_APPLE;
- return intel_buffer_purgeable(intel->mt->region->bo);
+ return intel_buffer_purgeable(intel->mt->bo);
}
static GLenum
(void) option;
intel = intel_texture_object(obj);
- if (intel->mt == NULL || intel->mt->region == NULL)
+ if (intel->mt == NULL || intel->mt->bo == NULL)
return GL_UNDEFINED_APPLE;
- return intel_buffer_unpurgeable(intel->mt->region->bo);
+ return intel_buffer_unpurgeable(intel->mt->bo);
}
static GLenum
if (intel->mt == NULL)
return GL_UNDEFINED_APPLE;
- return intel_buffer_unpurgeable(intel->mt->region->bo);
+ return intel_buffer_unpurgeable(intel->mt->bo);
}
void
BRW_SURFACE_CUBEFACE_ENABLES |
tex_format << BRW_SURFACE_FORMAT_SHIFT);
- surf[1] = mt->region->bo->offset64 + mt->offset; /* reloc */
+ surf[1] = mt->bo->offset64 + mt->offset; /* reloc */
surf[2] = ((intelObj->_MaxLevel - tObj->BaseLevel) << BRW_SURFACE_LOD_SHIFT |
(mt->logical_width0 - 1) << BRW_SURFACE_WIDTH_SHIFT |
(mt->logical_height0 - 1) << BRW_SURFACE_HEIGHT_SHIFT);
- surf[3] = (brw_get_surface_tiling_bits(mt->region->tiling) |
+ surf[3] = (brw_get_surface_tiling_bits(mt->tiling) |
(mt->logical_depth0 - 1) << BRW_SURFACE_DEPTH_SHIFT |
- (mt->region->pitch - 1) <<
- BRW_SURFACE_PITCH_SHIFT);
+ (mt->pitch - 1) << BRW_SURFACE_PITCH_SHIFT);
surf[4] = (brw_get_surface_num_multisamples(mt->num_samples) |
SET_FIELD(tObj->BaseLevel - mt->first_level, BRW_SURFACE_MIN_LOD));
/* 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);
}
struct gl_context *ctx = &brw->ctx;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
struct intel_mipmap_tree *mt = irb->mt;
- struct intel_region *region;
uint32_t *surf;
uint32_t tile_x, tile_y;
uint32_t format = 0;
intel_miptree_used_for_rendering(irb->mt);
- region = irb->mt->region;
-
surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, 6 * 4, 32,
&brw->wm.base.surf_offset[surf_index]);
/* reloc */
surf[1] = (intel_renderbuffer_get_tile_offsets(irb, &tile_x, &tile_y) +
- region->bo->offset64);
+ mt->bo->offset64);
surf[2] = ((rb->Width - 1) << BRW_SURFACE_WIDTH_SHIFT |
(rb->Height - 1) << BRW_SURFACE_HEIGHT_SHIFT);
- surf[3] = (brw_get_surface_tiling_bits(region->tiling) |
- (region->pitch - 1) << BRW_SURFACE_PITCH_SHIFT);
+ surf[3] = (brw_get_surface_tiling_bits(mt->tiling) |
+ (mt->pitch - 1) << BRW_SURFACE_PITCH_SHIFT);
surf[4] = brw_get_surface_num_multisamples(mt->num_samples);
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);
}
width /= 2;
height /= 2;
}
- struct intel_region *region = surface->mt->region;
+ struct intel_mipmap_tree *mt = surface->mt;
uint32_t tile_x, tile_y;
uint32_t *surf = (uint32_t *)
/* reloc */
surf[1] = (surface->compute_tile_offsets(&tile_x, &tile_y) +
- region->bo->offset64);
+ mt->bo->offset64);
surf[2] = (0 << BRW_SURFACE_LOD_SHIFT |
(width - 1) << BRW_SURFACE_WIDTH_SHIFT |
uint32_t tiling = surface->map_stencil_as_y_tiled
? BRW_SURFACE_TILED | BRW_SURFACE_TILED_Y
- : brw_get_surface_tiling_bits(region->tiling);
- uint32_t pitch_bytes = region->pitch;
+ : brw_get_surface_tiling_bits(mt->tiling);
+ uint32_t pitch_bytes = mt->pitch;
if (surface->map_stencil_as_y_tiled)
pitch_bytes *= 2;
surf[3] = (tiling |
/* Emit relocation to surface contents */
drm_intel_bo_emit_reloc(brw->batch.bo,
wm_surf_offset + 4,
- region->bo,
- surf[1] - region->bo->offset64,
+ mt->bo,
+ surf[1] - mt->bo->offset64,
read_domains, write_domain);
return wm_surf_offset;
BEGIN_BATCH(7);
OUT_BATCH(_3DSTATE_DEPTH_BUFFER << 16 | (7 - 2));
- OUT_BATCH((params->depth.mt->region->pitch - 1) |
+ OUT_BATCH((params->depth.mt->pitch - 1) |
params->depth_format << 18 |
1 << 21 | /* separate stencil enable */
1 << 22 | /* hiz enable */
BRW_TILEWALK_YMAJOR << 26 |
1 << 27 | /* y-tiled */
BRW_SURFACE_2D << 29);
- OUT_RELOC(params->depth.mt->region->bo,
+ OUT_RELOC(params->depth.mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
offset);
OUT_BATCH(BRW_SURFACE_MIPMAPLAYOUT_BELOW << 1 |
BEGIN_BATCH(3);
OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
- OUT_BATCH(hiz_mt->region->pitch - 1);
- OUT_RELOC(hiz_mt->region->bo,
+ OUT_BATCH(hiz_mt->pitch - 1);
+ OUT_RELOC(hiz_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
hiz_offset);
ADVANCE_BATCH();
* to divide them by 2 as we do for Gen6 (see
* gen6_blorp_emit_surface_state).
*/
- struct intel_region *region = surface->mt->region;
+ struct intel_mipmap_tree *mt = surface->mt;
uint32_t tile_x, tile_y;
const uint8_t mocs = GEN7_MOCS_L3;
uint32_t tiling = surface->map_stencil_as_y_tiled
- ? I915_TILING_Y : region->tiling;
+ ? I915_TILING_Y : mt->tiling;
uint32_t *surf = (uint32_t *)
brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, 8 * 4, 32, &wm_surf_offset);
/* reloc */
surf[1] =
- surface->compute_tile_offsets(&tile_x, &tile_y) + region->bo->offset64;
+ surface->compute_tile_offsets(&tile_x, &tile_y) + mt->bo->offset64;
/* Note that the low bits of these fields are missing, so
* there's the possibility of getting in trouble.
surf[2] = SET_FIELD(width - 1, GEN7_SURFACE_WIDTH) |
SET_FIELD(height - 1, GEN7_SURFACE_HEIGHT);
- uint32_t pitch_bytes = region->pitch;
+ uint32_t pitch_bytes = mt->pitch;
if (surface->map_stencil_as_y_tiled)
pitch_bytes *= 2;
surf[3] = pitch_bytes - 1;
/* Emit relocation to surface contents */
drm_intel_bo_emit_reloc(brw->batch.bo,
wm_surf_offset + 4,
- region->bo,
- surf[1] - region->bo->offset64,
+ mt->bo,
+ surf[1] - mt->bo->offset64,
read_domains, write_domain);
gen7_check_surface_setup(surf, is_render_target);
BEGIN_BATCH(7);
OUT_BATCH(GEN7_3DSTATE_DEPTH_BUFFER << 16 | (7 - 2));
- OUT_BATCH((params->depth.mt->region->pitch - 1) |
+ OUT_BATCH((params->depth.mt->pitch - 1) |
params->depth_format << 18 |
1 << 22 | /* hiz enable */
1 << 28 | /* depth write */
surftype << 29);
- OUT_RELOC(params->depth.mt->region->bo,
+ OUT_RELOC(params->depth.mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
0);
OUT_BATCH((surfwidth - 1) << 4 |
/* 3DSTATE_HIER_DEPTH_BUFFER */
{
- struct intel_region *hiz_region = params->depth.mt->hiz_mt->region;
+ struct intel_mipmap_tree *hiz_mt = params->depth.mt->hiz_mt;
BEGIN_BATCH(3);
OUT_BATCH((GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
OUT_BATCH((mocs << 25) |
- (hiz_region->pitch - 1));
- OUT_RELOC(hiz_region->bo,
+ (hiz_mt->pitch - 1));
+ OUT_RELOC(hiz_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
0);
ADVANCE_BATCH();
OUT_BATCH(GEN7_3DSTATE_DEPTH_BUFFER << 16 | (7 - 2));
/* 3DSTATE_DEPTH_BUFFER dw1 */
- OUT_BATCH((depth_mt ? depth_mt->region->pitch - 1 : 0) |
+ OUT_BATCH((depth_mt ? depth_mt->pitch - 1 : 0) |
(depthbuffer_format << 18) |
((hiz ? 1 : 0) << 22) |
((stencil_mt != NULL && ctx->Stencil._WriteEnabled) << 27) |
/* 3DSTATE_DEPTH_BUFFER dw2 */
if (depth_mt) {
- OUT_RELOC(depth_mt->region->bo,
+ OUT_RELOC(depth_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
0);
} else {
BEGIN_BATCH(3);
OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16 | (3 - 2));
OUT_BATCH((mocs << 25) |
- (hiz_mt->region->pitch - 1));
- OUT_RELOC(hiz_mt->region->bo,
+ (hiz_mt->pitch - 1));
+ OUT_RELOC(hiz_mt->bo,
I915_GEM_DOMAIN_RENDER,
I915_GEM_DOMAIN_RENDER,
0);
*/
OUT_BATCH(enabled |
mocs << 25 |
- (2 * stencil_mt->region->pitch - 1));
- OUT_RELOC(stencil_mt->region->bo,
+ (2 * stencil_mt->pitch - 1));
+ OUT_RELOC(stencil_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
0);
ADVANCE_BATCH();
*
* "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
* 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,
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)
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) |
/* 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 */);
{
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));
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;
surf[0] |= GEN7_SURFACE_IS_ARRAY;
}
- surf[1] = region->bo->offset64;
+ surf[1] = mt->bo->offset64;
assert(brw->has_surface_tile_offset);
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 |
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);
(stencil_mt != NULL && stencil_writable) << 27 |
(hiz ? 1 : 0) << 22 |
depthbuffer_format << 18 |
- (depth_mt ? depth_mt->region->pitch - 1 : 0));
+ (depth_mt ? depth_mt->pitch - 1 : 0));
if (depth_mt) {
- OUT_RELOC64(depth_mt->region->bo,
+ OUT_RELOC64(depth_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0);
} else {
OUT_BATCH(0);
} else {
BEGIN_BATCH(5);
OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16 | (5 - 2));
- OUT_BATCH((depth_mt->hiz_mt->region->pitch - 1) | BDW_MOCS_WB << 25);
- OUT_RELOC64(depth_mt->hiz_mt->region->bo,
+ OUT_BATCH((depth_mt->hiz_mt->pitch - 1) | BDW_MOCS_WB << 25);
+ OUT_RELOC64(depth_mt->hiz_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0);
OUT_BATCH(depth_mt->hiz_mt->qpitch >> 2);
ADVANCE_BATCH();
* indicate that it does.
*/
OUT_BATCH(HSW_STENCIL_ENABLED | BDW_MOCS_WB << 22 |
- (2 * stencil_mt->region->pitch - 1));
- OUT_RELOC64(stencil_mt->region->bo,
+ (2 * stencil_mt->pitch - 1));
+ OUT_RELOC64(stencil_mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
stencil_offset);
OUT_BATCH(stencil_mt ? stencil_mt->qpitch >> 2 : 0);
ADVANCE_BATCH();
/* Mark this buffer as needing a TC flush, as we've rendered to it. */
- brw_render_cache_set_add_bo(brw, mt->region->bo);
+ brw_render_cache_set_add_bo(brw, mt->bo);
/* We've clobbered all of the depth packets, and the drawing rectangle,
* so we need to ensure those packets are re-emitted before the next
unsigned tiling_mode, pitch;
if (mt->format == MESA_FORMAT_S_UINT8) {
tiling_mode = GEN8_SURFACE_TILING_W;
- pitch = 2 * mt->region->pitch;
+ pitch = 2 * mt->pitch;
} else {
- tiling_mode = surface_tiling_mode(mt->region->tiling);
- pitch = mt->region->pitch;
+ tiling_mode = surface_tiling_mode(mt->tiling);
+ pitch = mt->pitch;
}
uint32_t tex_format = translate_tex_format(brw,
SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 2), false), GEN7_SURFACE_SCS_B) |
SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 3), false), GEN7_SURFACE_SCS_A);
- *((uint64_t *) &surf[8]) = mt->region->bo->offset64 + mt->offset; /* reloc */
+ *((uint64_t *) &surf[8]) = mt->bo->offset64 + mt->offset; /* reloc */
surf[10] = 0;
surf[11] = 0;
/* Emit relocation to surface contents */
drm_intel_bo_emit_reloc(brw->batch.bo,
*surf_offset + 8 * 4,
- mt->region->bo,
+ mt->bo,
mt->offset,
I915_GEM_DOMAIN_SAMPLER, 0);
}
struct gl_context *ctx = &brw->ctx;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
struct intel_mipmap_tree *mt = irb->mt;
- struct intel_region *region = mt->region;
uint32_t format = 0;
uint32_t surf_type;
bool is_array = false;
(format << BRW_SURFACE_FORMAT_SHIFT) |
vertical_alignment(mt) |
horizontal_alignment(mt) |
- surface_tiling_mode(region->tiling);
+ surface_tiling_mode(mt->tiling);
surf[1] = SET_FIELD(BDW_MOCS_WT, GEN8_SURFACE_MOCS) | mt->qpitch >> 2;
SET_FIELD(mt->logical_height0 - 1, GEN7_SURFACE_HEIGHT);
surf[3] = (depth - 1) << BRW_SURFACE_DEPTH_SHIFT |
- (region->pitch - 1); /* Surface Pitch */
+ (mt->pitch - 1); /* Surface Pitch */
surf[4] = gen7_surface_msaa_bits(mt->num_samples, mt->msaa_layout) |
min_array_element << GEN7_SURFACE_MIN_ARRAY_ELEMENT_SHIFT |
SET_FIELD(HSW_SCS_BLUE, GEN7_SURFACE_SCS_B) |
SET_FIELD(HSW_SCS_ALPHA, GEN7_SURFACE_SCS_A);
- *((uint64_t *) &surf[8]) = region->bo->offset64; /* reloc */
+ *((uint64_t *) &surf[8]) = mt->bo->offset64; /* reloc */
/* Nothing of relevance. */
surf[10] = 0;
drm_intel_bo_emit_reloc(brw->batch.bo,
brw->wm.base.surf_offset[surf_index] + 8 * 4,
- region->bo,
+ mt->bo,
0,
I915_GEM_DOMAIN_RENDER,
I915_GEM_DOMAIN_RENDER);
* pitches < 32k.
*
* As a result of these two limitations, we can only use the blitter to do
- * this copy when the region's pitch is less than 32k.
+ * this copy when the miptree's pitch is less than 32k.
*/
- if (src_mt->region->pitch >= 32768 ||
- dst_mt->region->pitch >= 32768) {
+ if (src_mt->pitch >= 32768 ||
+ dst_mt->pitch >= 32768) {
perf_debug("Falling back due to >=32k pitch\n");
return false;
}
if (dst_flip)
dst_y = minify(dst_mt->physical_height0, dst_level - dst_mt->first_level) - dst_y - height;
- int src_pitch = src_mt->region->pitch;
+ int src_pitch = src_mt->pitch;
if (src_flip != dst_flip)
src_pitch = -src_pitch;
if (!intelEmitCopyBlit(brw,
src_mt->cpp,
src_pitch,
- src_mt->region->bo, src_mt->offset,
- src_mt->region->tiling,
- dst_mt->region->pitch,
- dst_mt->region->bo, dst_mt->offset,
- dst_mt->region->tiling,
+ src_mt->bo, src_mt->offset,
+ src_mt->tiling,
+ dst_mt->pitch,
+ dst_mt->bo, dst_mt->offset,
+ dst_mt->tiling,
src_x, src_y,
dst_x, dst_y,
width, height,
struct intel_mipmap_tree *mt,
int x, int y, int width, int height)
{
- struct intel_region *region = mt->region;
uint32_t BR13, CMD;
int pitch, cpp;
drm_intel_bo *aper_array[2];
- pitch = region->pitch;
- cpp = region->cpp;
+ pitch = mt->pitch;
+ cpp = mt->cpp;
DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
- __FUNCTION__, region->bo, pitch, x, y, width, height);
+ __FUNCTION__, mt->bo, pitch, x, y, width, height);
BR13 = br13_for_cpp(cpp) | 0xf0 << 16;
CMD = XY_COLOR_BLT_CMD;
CMD |= XY_BLT_WRITE_ALPHA;
- if (region->tiling != I915_TILING_NONE) {
+ if (mt->tiling != I915_TILING_NONE) {
CMD |= XY_DST_TILED;
pitch /= 4;
}
/* do space check before going any further */
aper_array[0] = brw->batch.bo;
- aper_array[1] = region->bo;
+ aper_array[1] = mt->bo;
if (drm_intel_bufmgr_check_aperture_space(aper_array,
ARRAY_SIZE(aper_array)) != 0) {
}
unsigned length = brw->gen >= 8 ? 7 : 6;
- bool dst_y_tiled = region->tiling == I915_TILING_Y;
+ bool dst_y_tiled = mt->tiling == I915_TILING_Y;
BEGIN_BATCH_BLT_TILED(length, dst_y_tiled, false);
OUT_BATCH(CMD | (length - 2));
OUT_BATCH(SET_FIELD(y, BLT_Y) | SET_FIELD(x, BLT_X));
OUT_BATCH(SET_FIELD(y + height, BLT_Y) | SET_FIELD(x + width, BLT_X));
if (brw->gen >= 8) {
- OUT_RELOC64(region->bo,
+ OUT_RELOC64(mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
0);
} else {
- OUT_RELOC(region->bo,
+ OUT_RELOC(mt->bo,
I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
0);
}
struct intel_mipmap_tree *mt,
unsigned *width_px, unsigned *height)
{
- switch (mt->region->tiling) {
+ switch (mt->tiling) {
default:
assert(!"Non-MSRT MCS requires X or Y tiling");
/* In release builds, fall through */
return false;
}
- if (mt->region->tiling != I915_TILING_X &&
- mt->region->tiling != I915_TILING_Y)
+ if (mt->tiling != I915_TILING_X &&
+ mt->tiling != I915_TILING_Y)
return false;
if (mt->cpp != 4 && mt->cpp != 8 && mt->cpp != 16)
return false;
uint32_t tiling = intel_miptree_choose_tiling(brw, format, width0,
num_samples, requested_tiling,
mt);
- bool y_or_x = tiling == (I915_TILING_Y | I915_TILING_X);
+ bool y_or_x = false;
+ if (tiling == (I915_TILING_Y | I915_TILING_X)) {
+ y_or_x = true;
+ mt->tiling = I915_TILING_Y;
+ } else {
+ mt->tiling = tiling;
+ }
+
+ unsigned long pitch;
mt->etc_format = etc_format;
- mt->region = intel_region_alloc(brw->intelScreen,
- y_or_x ? I915_TILING_Y : tiling,
- mt->cpp,
- total_width,
- total_height,
- expect_accelerated_upload);
-
- /* If the region is too large to fit in the aperture, we need to use the
+ mt->bo = drm_intel_bo_alloc_tiled(brw->bufmgr, "miptree",
+ total_width, total_height, mt->cpp,
+ &mt->tiling, &pitch,
+ (expect_accelerated_upload ?
+ BO_ALLOC_FOR_RENDER : 0));
+ mt->pitch = pitch;
+
+ /* If the BO is too large to fit in the aperture, we need to use the
* BLT engine to support it. The BLT paths can't currently handle Y-tiling,
* so we need to fall back to X.
*/
- if (y_or_x && mt->region->bo->size >= brw->max_gtt_map_object_size) {
+ if (y_or_x && mt->bo->size >= brw->max_gtt_map_object_size) {
perf_debug("%dx%d miptree larger than aperture; falling back to X-tiled\n",
mt->total_width, mt->total_height);
- intel_region_release(&mt->region);
-
- mt->region = intel_region_alloc(brw->intelScreen,
- I915_TILING_X,
- mt->cpp,
- total_width,
- total_height,
- expect_accelerated_upload);
+
+ mt->tiling = I915_TILING_X;
+ drm_intel_bo_unreference(mt->bo);
+ mt->bo = drm_intel_bo_alloc_tiled(brw->bufmgr, "miptree",
+ total_width, total_height, mt->cpp,
+ &mt->tiling, &pitch,
+ (expect_accelerated_upload ?
+ BO_ALLOC_FOR_RENDER : 0));
+ mt->pitch = pitch;
}
mt->offset = 0;
- if (!mt->region) {
+ if (!mt->bo) {
intel_miptree_release(&mt);
return NULL;
}
struct intel_mipmap_tree *mt;
uint32_t tiling, swizzle;
- struct intel_region *region = calloc(1, sizeof(*region));
- if (!region)
- return NULL;
-
drm_intel_bo_get_tiling(bo, &tiling, &swizzle);
/* Nothing will be able to use this miptree with the BO if the offset isn't
width, height, 1,
true, 0 /* num_samples */);
if (!mt) {
- free(region);
+ free(mt);
return mt;
}
- region->cpp = mt->cpp;
- region->width = width;
- region->height = height;
- region->pitch = pitch;
- region->refcount = 1;
drm_intel_bo_reference(bo);
- region->bo = bo;
- region->tiling = tiling;
-
- mt->region = region;
+ mt->bo = bo;
+ mt->pitch = pitch;
mt->offset = offset;
+ mt->tiling = tiling;
return mt;
}
DBG("%s deleting %p\n", __FUNCTION__, *mt);
- intel_region_release(&((*mt)->region));
+ drm_intel_bo_unreference((*mt)->bo);
intel_miptree_release(&(*mt)->stencil_mt);
intel_miptree_release(&(*mt)->hiz_mt);
intel_miptree_release(&(*mt)->mcs_mt);
uint32_t *mask_x, uint32_t *mask_y,
bool map_stencil_as_y_tiled)
{
- int cpp = mt->region->cpp;
- uint32_t tiling = mt->region->tiling;
+ int cpp = mt->cpp;
+ uint32_t tiling = mt->tiling;
if (map_stencil_as_y_tiled)
tiling = I915_TILING_Y;
uint32_t x, uint32_t y,
bool map_stencil_as_y_tiled)
{
- int cpp = mt->region->cpp;
- uint32_t pitch = mt->region->pitch;
- uint32_t tiling = mt->region->tiling;
+ int cpp = mt->cpp;
+ uint32_t pitch = mt->pitch;
+ uint32_t tiling = mt->tiling;
if (map_stencil_as_y_tiled) {
tiling = I915_TILING_Y;
DBG("validate blit mt %s %p %d,%d/%d -> mt %s %p %d,%d/%d (%dx%d)\n",
_mesa_get_format_name(src_mt->format),
- src_mt, src_x, src_y, src_mt->region->pitch,
+ src_mt, src_x, src_y, src_mt->pitch,
_mesa_get_format_name(dst_mt->format),
- dst_mt, dst_x, dst_y, dst_mt->region->pitch,
+ dst_mt, dst_x, dst_y, dst_mt->pitch,
width, height);
if (!intel_miptree_blit(brw,
* Note: the clear value for MCS buffers is all 1's, so we memset to 0xff.
*/
void *data = intel_miptree_map_raw(brw, mt->mcs_mt);
- memset(data, 0xff, mt->mcs_mt->region->height * mt->mcs_mt->region->pitch);
+ memset(data, 0xff, mt->mcs_mt->total_height * mt->mcs_mt->pitch);
intel_miptree_unmap_raw(brw, mt->mcs_mt);
mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_CLEAR;
/**
- * Make it possible to share the region backing the given miptree with another
+ * Make it possible to share the BO backing the given miptree with another
* process or another miptree.
*
* Fast color clears are unsafe with shared buffers, so we need to resolve and
*/
intel_miptree_resolve_color(brw, mt);
- drm_intel_bo *bo = mt->region->bo;
+ drm_intel_bo *bo = mt->bo;
if (drm_intel_bo_references(brw->batch.bo, bo))
intel_batchbuffer_flush(brw);
- if (mt->region->tiling != I915_TILING_NONE)
+ if (mt->tiling != I915_TILING_NONE)
brw_bo_map_gtt(brw, bo, "miptree");
else
brw_bo_map(brw, bo, true, "miptree");
intel_miptree_unmap_raw(struct brw_context *brw,
struct intel_mipmap_tree *mt)
{
- drm_intel_bo_unmap(mt->region->bo);
+ drm_intel_bo_unmap(mt->bo);
}
static void
x += image_x;
y += image_y;
- map->stride = mt->region->pitch;
+ map->stride = mt->pitch;
map->ptr = base + y * map->stride + x * mt->cpp;
}
fprintf(stderr, "Failed to allocate blit temporary\n");
goto fail;
}
- map->stride = map->mt->region->pitch;
+ map->stride = map->mt->pitch;
if (!intel_miptree_blit(brw,
mt, level, slice,
void *src = intel_miptree_map_raw(brw, mt);
if (!src)
return;
- src += image_y * mt->region->pitch;
- src += image_x * mt->region->cpp;
+ src += image_y * mt->pitch;
+ src += image_x * mt->cpp;
/* Due to the pixel offsets for the particular image being mapped, our
* src pointer may not be 16-byte aligned. However, if the pitch is
* divisible by 16, then the amount by which it's misaligned will remain
* consistent from row to row.
*/
- assert((mt->region->pitch % 16) == 0);
+ assert((mt->pitch % 16) == 0);
const int misalignment = ((uintptr_t) src) & 15;
/* Create an untiled temporary buffer for the mapping. */
for (uint32_t y = 0; y < map->h; y++) {
void *dst_ptr = map->ptr + y * map->stride;
- void *src_ptr = src + y * mt->region->pitch;
+ void *src_ptr = src + y * mt->pitch;
_mesa_streaming_load_memcpy(dst_ptr, src_ptr, width_bytes);
}
for (uint32_t y = 0; y < map->h; y++) {
for (uint32_t x = 0; x < map->w; x++) {
- ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
+ ptrdiff_t offset = intel_offset_S8(mt->pitch,
x + image_x + map->x,
y + image_y + map->y,
brw->has_swizzling);
for (uint32_t y = 0; y < map->h; y++) {
for (uint32_t x = 0; x < map->w; x++) {
- ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
+ ptrdiff_t offset = intel_offset_S8(mt->pitch,
x + map->x,
y + map->y,
brw->has_swizzling);
image_y += map->y;
uint8_t *dst = intel_miptree_map_raw(brw, mt)
- + image_y * mt->region->pitch
- + image_x * mt->region->cpp;
+ + image_y * mt->pitch
+ + image_x * mt->cpp;
if (mt->etc_format == MESA_FORMAT_ETC1_RGB8)
- _mesa_etc1_unpack_rgba8888(dst, mt->region->pitch,
+ _mesa_etc1_unpack_rgba8888(dst, mt->pitch,
map->ptr, map->stride,
map->w, map->h);
else
- _mesa_unpack_etc2_format(dst, mt->region->pitch,
+ _mesa_unpack_etc2_format(dst, mt->pitch,
map->ptr, map->stride,
map->w, map->h, mt->etc_format);
for (uint32_t y = 0; y < map->h; y++) {
for (uint32_t x = 0; x < map->w; x++) {
int map_x = map->x + x, map_y = map->y + y;
- ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
+ ptrdiff_t s_offset = intel_offset_S8(s_mt->pitch,
map_x + s_image_x,
map_y + s_image_y,
brw->has_swizzling);
ptrdiff_t z_offset = ((map_y + z_image_y) *
- (z_mt->region->pitch / 4) +
+ (z_mt->pitch / 4) +
(map_x + z_image_x));
uint8_t s = s_map[s_offset];
uint32_t z = z_map[z_offset];
for (uint32_t y = 0; y < map->h; y++) {
for (uint32_t x = 0; x < map->w; x++) {
- ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
+ ptrdiff_t s_offset = intel_offset_S8(s_mt->pitch,
x + s_image_x + map->x,
y + s_image_y + map->y,
brw->has_swizzling);
ptrdiff_t z_offset = ((y + z_image_y) *
- (z_mt->region->pitch / 4) +
+ (z_mt->pitch / 4) +
(x + z_image_x));
if (map_z32f_x24s8) {
if (image_x >= 32768 || image_y >= 32768)
return false;
- if (mt->region->pitch >= 32768)
+ if (mt->pitch >= 32768)
return false;
return true;
else if (brw->has_llc &&
!(mode & GL_MAP_WRITE_BIT) &&
!mt->compressed &&
- (mt->region->tiling == I915_TILING_X ||
- (brw->gen >= 6 && mt->region->tiling == I915_TILING_Y)) &&
+ (mt->tiling == I915_TILING_X ||
+ (brw->gen >= 6 && mt->tiling == I915_TILING_Y)) &&
can_blit_slice(mt, level, slice)) {
intel_miptree_map_blit(brw, mt, map, level, slice);
- } else if (mt->region->tiling != I915_TILING_NONE &&
- mt->region->bo->size >= brw->max_gtt_map_object_size) {
+ } else if (mt->tiling != I915_TILING_NONE &&
+ mt->bo->size >= brw->max_gtt_map_object_size) {
assert(can_blit_slice(mt, level, slice));
intel_miptree_map_blit(brw, mt, map, level, slice);
#ifdef __SSE4_1__
*
**************************************************************************/
+/** @file intel_mipmap_tree.h
+ *
+ * This file defines the structure that wraps a BO and describes how the
+ * mipmap levels and slices of a texture are laid out.
+ *
+ * The hardware has a fixed layout of a texture depending on parameters such
+ * as the target/type (2D, 3D, CUBE), width, height, pitch, and number of
+ * mipmap levels. The individual level/layer slices are each 2D rectangles of
+ * pixels at some x/y offset from the start of the drm_intel_bo.
+ *
+ * Original OpenGL allowed texture miplevels to be specified in arbitrary
+ * order, and a texture may change size over time. Thus, each
+ * intel_texture_image has a reference to a miptree that contains the pixel
+ * data sized appropriately for it, which will later be referenced by/copied
+ * to the intel_texture_object at draw time (intel_finalize_mipmap_tree()) so
+ * that there's a single miptree for the complete texture.
+ */
+
#ifndef INTEL_MIPMAP_TREE_H
#define INTEL_MIPMAP_TREE_H
struct intel_renderbuffer;
-/* A layer on top of the intel_regions code which adds:
- *
- * - Code to size and layout a region to hold a set of mipmaps.
- * - Query to determine if a new image fits in an existing tree.
- * - More refcounting
- * - maybe able to remove refcounting from intel_region?
- * - ?
- *
- * The fixed mipmap layout of intel hardware where one offset
- * specifies the position of all images in a mipmap hierachy
- * complicates the implementation of GL texture image commands,
- * compared to hardware where each image is specified with an
- * independent offset.
- *
- * In an ideal world, each texture object would be associated with a
- * single bufmgr buffer or 2d intel_region, and all the images within
- * the texture object would slot into the tree as they arrive. The
- * reality can be a little messier, as images can arrive from the user
- * with sizes that don't fit in the existing tree, or in an order
- * where the tree layout cannot be guessed immediately.
- *
- * This structure encodes an idealized mipmap tree. The GL image
- * commands build these where possible, otherwise store the images in
- * temporary system buffers.
- */
-
struct intel_resolve_map;
struct intel_texture_image;
};
/**
- * Describes the location of each texture image within a texture region.
+ * Describes the location of each texture image within a miptree.
*/
struct intel_mipmap_level
{
struct intel_mipmap_tree
{
+ /** Buffer object containing the pixel data. */
+ drm_intel_bo *bo;
+
+ uint32_t pitch; /**< pitch in bytes. */
+
+ uint32_t tiling; /**< One of the I915_TILING_* flags */
+
/* Effectively the key:
*/
GLenum target;
*/
GLuint physical_width0, physical_height0, physical_depth0;
- GLuint cpp;
+ GLuint cpp; /**< bytes per pixel */
GLuint num_samples;
bool compressed;
/**
* Level zero image dimensions. These dimensions correspond to the
- * logical width, height, and depth of the region as seen by client code.
+ * logical width, height, and depth of the texture as seen by client code.
* Accordingly, they do not account for the extra width, height, and/or
* depth that must be allocated in order to accommodate multisample
* formats, nor do they account for the extra factor of 6 in depth that
*/
struct intel_mipmap_level level[MAX_TEXTURE_LEVELS];
- /* The data is held here:
- */
- struct intel_region *region;
-
- /* Offset into region bo where miptree starts:
+ /* Offset into bo where miptree starts:
*/
uint32_t offset;
(GLubyte *)stipple,
sz,
color,
- irb->mt->region->pitch,
- irb->mt->region->bo,
+ irb->mt->pitch,
+ irb->mt->bo,
0,
- irb->mt->region->tiling,
+ irb->mt->tiling,
dstx + px,
dsty + py,
w, h,
continue;
}
- assert(irb->mt->region->pitch % irb->mt->region->cpp == 0);
- drm_intel_gem_bo_aub_dump_bmp(irb->mt->region->bo,
+ assert(irb->mt->pitch % irb->mt->cpp == 0);
+ drm_intel_gem_bo_aub_dump_bmp(irb->mt->bo,
irb->draw_x,
irb->draw_y,
irb->Base.Base.Width,
irb->Base.Base.Height,
format,
- irb->mt->region->pitch,
+ irb->mt->pitch,
0);
}
}
image->width = minify(mt->physical_width0, level - mt->first_level);
image->height = minify(mt->physical_height0, level - mt->first_level);
- image->pitch = mt->region->pitch;
+ image->pitch = mt->pitch;
image->offset = intel_miptree_get_tile_offsets(mt, level, zoffset,
&image->tile_x,
&image->tile_y);
drm_intel_bo_unreference(image->bo);
- image->bo = mt->region->bo;
- drm_intel_bo_reference(mt->region->bo);
+ image->bo = mt->bo;
+ drm_intel_bo_reference(mt->bo);
}
static __DRIimage *
image->offset = 0;
image->data = loaderPrivate;
drm_intel_bo_unreference(image->bo);
- image->bo = irb->mt->region->bo;
- drm_intel_bo_reference(irb->mt->region->bo);
- image->width = irb->mt->region->width;
- image->height = irb->mt->region->height;
- image->pitch = irb->mt->region->pitch;
+ image->bo = irb->mt->bo;
+ drm_intel_bo_reference(irb->mt->bo);
+ image->width = rb->Width;
+ image->height = rb->Height;
+ image->pitch = irb->mt->pitch;
image->dri_format = driGLFormatToImageFormat(image->format);
image->has_depthstencil = irb->mt->stencil_mt? true : false;
intel_texobj->needs_validate = true;
intel_image->mt->offset = offset;
- assert(pitch % intel_image->mt->region->cpp == 0);
- intel_image->base.RowStride = pitch / intel_image->mt->region->cpp;
+ assert(pitch % intel_image->mt->cpp == 0);
+ intel_image->base.RowStride = pitch / intel_image->mt->cpp;
/* Immediately validate the image to the object. */
intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
- /* If the region isn't set, then intel_update_renderbuffers was unable
- * to get the buffers for the drawable.
+ /* If the miptree isn't set, then intel_update_renderbuffers was unable
+ * to get the BO for the drawable from the window system.
*/
if (!rb || !rb->mt)
return;
_mesa_lock_texture(&brw->ctx, texObj);
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
intel_miptree_make_shareable(brw, rb->mt);
- intel_set_texture_image_bo(ctx, texImage, rb->mt->region->bo, target,
+ intel_set_texture_image_bo(ctx, texImage, rb->mt->bo, target,
internalFormat, texFormat, 0,
- rb->mt->region->width,
- rb->mt->region->height,
- rb->mt->region->pitch,
+ rb->Base.Base.Width,
+ rb->Base.Base.Height,
+ rb->mt->pitch,
0, 0);
_mesa_unlock_texture(&brw->ctx, texObj);
}
unsigned int validated_first_level;
unsigned int validated_last_level;
- /* On validation any active images held in main memory or in other
- * regions will be copied to this region and the old storage freed.
+ /* The miptree of pixel data for the texture (if !needs_validate). After
+ * validation, the images will also have references to the same mt.
*/
struct intel_mipmap_tree *mt;
return false;
/* Prior to Sandybridge, the blitter can't handle Y tiling */
- if (brw->gen < 6 && intelImage->mt->region->tiling == I915_TILING_Y)
+ if (brw->gen < 6 && intelImage->mt->tiling == I915_TILING_Y)
return false;
if (texImage->TexObject->Target != GL_TEXTURE_2D)
if (brw->gen >= 6)
return false;
- if (!drm_intel_bo_busy(intelImage->mt->region->bo))
+ if (!drm_intel_bo_busy(intelImage->mt->bo))
return false;
DBG("BLT subimage %s target %s level %d offset %d,%d %dx%d\n",
if (!_mesa_texstore(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat,
- temp_mt->region->pitch,
+ temp_mt->pitch,
&dst,
width, height, 1,
format, type, pixels, packing)) {
ctx->Driver.AllocTextureImageBuffer(ctx, texImage);
if (!image->mt ||
- (image->mt->region->tiling != I915_TILING_X &&
- image->mt->region->tiling != I915_TILING_Y)) {
+ (image->mt->tiling != I915_TILING_X &&
+ image->mt->tiling != I915_TILING_Y)) {
/* The algorithm is written only for X- or Y-tiled memory. */
return false;
}
*/
intel_miptree_resolve_color(brw, image->mt);
- bo = image->mt->region->bo;
+ bo = image->mt->bo;
if (drm_intel_bo_references(brw->batch.bo, bo)) {
perf_debug("Flushing before mapping a referenced bo.\n");
"packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d) "
"for_glTexImage=%d\n",
__FUNCTION__, texImage->Level, xoffset, yoffset, width, height,
- format, type, texImage->TexFormat, image->mt->region->tiling,
+ format, type, texImage->TexFormat, image->mt->tiling,
packing->Alignment, packing->RowLength, packing->SkipPixels,
packing->SkipRows, for_glTexImage);
xoffset * cpp, (xoffset + width) * cpp,
yoffset, yoffset + height,
bo->virtual, pixels - yoffset * src_pitch - xoffset * cpp,
- image->mt->region->pitch, src_pitch,
+ image->mt->pitch, src_pitch,
brw->has_swizzling,
- image->mt->region->tiling,
+ image->mt->tiling,
mem_copy
);