file, line, used);
if (ALWAYS_EMIT_MI_FLUSH) {
- *(GLuint *) (batch->ptr) = ((MI_FLUSH << 16) | BRW_FLUSH_STATE_CACHE);
+ *(GLuint *) (batch->ptr) = MI_FLUSH | BRW_FLUSH_STATE_CACHE;
batch->ptr += 4;
used = batch->ptr - batch->map;
}
if (ret != 0)
return ret;
- /*
- * Using the old buffer offset, write in what the right data would be, in case
- * the buffer doesn't move and we can short-circuit the relocation processing
- * in the kernel
+ /* bo_emit_reloc was resposible for writing a zero into the
+ * batchbuffer if necessary. Just need to update our pointer.
*/
- brw_batchbuffer_emit_dword (batch, buffer->offset[0] + delta);
+ batch->ptr += 4;
+
return 0;
}
cc.cc3 = key->cc3;
/* CACHE_NEW_CC_VP */
- cc.cc4.cc_viewport_state_offset = *(brw->cc.vp_bo->offset) >> 5; /* reloc */
+ cc.cc4.cc_viewport_state_offset = 0;
cc.cc5 = key->cc5;
cc.cc6 = key->cc6;
clip.thread0.grf_reg_count = align(key->total_grf, 16) / 16 - 1;
/* reloc */
- clip.thread0.kernel_start_pointer = *(brw->clip.prog_bo->offset) >> 6;
+ clip.thread0.kernel_start_pointer = 0;
clip.thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754;
clip.thread1.single_program_flow = 1;
memset(&gs, 0, sizeof(gs));
gs.thread0.grf_reg_count = align(key->total_grf, 16) / 16 - 1;
- if (key->prog_active) /* reloc */
- gs.thread0.kernel_start_pointer = brw->gs.prog_bo->offset[0] >> 6;
+ /* reloc */
+ gs.thread0.kernel_start_pointer = 0;
gs.thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754;
gs.thread1.single_program_flow = 1;
/* && bscreen->use_texture_tiling */
/* && bscreen->kernel_exec_fencing */)
{
- if (bscreen->chipset.is_965 &&
- pf_is_depth_or_stencil(templ->format))
+ if (1)
+ tex->tiling = BRW_TILING_NONE;
+ else if (bscreen->chipset.is_965 &&
+ pf_is_depth_or_stencil(templ->format))
tex->tiling = BRW_TILING_Y;
else
tex->tiling = BRW_TILING_X;
/* XXX: what happens when tex->bo->offset changes???
*/
- tex->ss.ss1.base_addr = tex->bo->offset[0]; /* reloc */
+ tex->ss.ss1.base_addr = 0; /* reloc */
tex->ss.ss2.mip_count = tex->base.last_level;
tex->ss.ss2.width = tex->base.width[0] - 1;
tex->ss.ss2.height = tex->base.height[0] - 1;
memset(&sf, 0, sizeof(sf));
sf.thread0.grf_reg_count = align(key->total_grf, 16) / 16 - 1;
- sf.thread0.kernel_start_pointer = brw->sf.prog_bo->offset[0] >> 6; /* reloc */
+ /* reloc */
+ sf.thread0.kernel_start_pointer = 0;
sf.thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754;
sf.thread4.stats_enable = 1;
/* CACHE_NEW_SF_VP */
- sf.sf5.sf_viewport_state_offset = brw->sf.vp_bo->offset[0] >> 5; /* reloc */
+ /* reloc */
+ sf.sf5.sf_viewport_state_offset = 0;
sf.sf5.viewport_transform = 1;
memset(&vs, 0, sizeof(vs));
- vs.thread0.kernel_start_pointer = brw->vs.prog_bo->offset[0] >> 6; /* reloc */
+ vs.thread0.kernel_start_pointer = 0; /* reloc */
vs.thread0.grf_reg_count = align(key->total_grf, 16) / 16 - 1;
vs.thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754;
/* Choosing multiple program flow means that we may get 2-vertex threads,
struct brw_winsys_buffer {
struct pipe_reference reference;
struct brw_winsys_screen *sws;
- unsigned *offset;
unsigned size;
};
entry->ss0 = sampler->ss0;
entry->ss1 = sampler->ss1;
- entry->ss2.default_color_pointer = brw->wm.sdc_bo[i]->offset[0] >> 5; /* reloc */
+ entry->ss2.default_color_pointer = 0; /* reloc */
entry->ss3 = sampler->ss3;
/* Cube-maps on 965 and later must use the same wrap mode for all 3
memset(&wm, 0, sizeof(wm));
wm.thread0.grf_reg_count = align(key->total_grf, 16) / 16 - 1;
- wm.thread0.kernel_start_pointer = brw->wm.prog_bo->offset[0] >> 6; /* reloc */
+ wm.thread0.kernel_start_pointer = 0; /* reloc */
wm.thread1.depth_coef_urb_read_offset = 1;
wm.thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754;
wm.thread1.binding_table_entry_count = key->nr_surfaces;
if (key->total_scratch != 0) {
- wm.thread2.scratch_space_base_pointer =
- brw->wm.scratch_bo->offset[0] >> 10; /* reloc */
+ wm.thread2.scratch_space_base_pointer = 0; /* reloc */
wm.thread2.per_thread_scratch_space = key->total_scratch / 1024 - 1;
} else {
wm.thread2.scratch_space_base_pointer = 0;
else
wm.wm4.sampler_count = (key->sampler_count + 1) / 4;
- if (brw->wm.sampler_bo != NULL) {
- /* reloc */
- wm.wm4.sampler_state_pointer = brw->wm.sampler_bo->offset[0] >> 5;
- } else {
- wm.wm4.sampler_state_pointer = 0;
- }
+ /* reloc */
+ wm.wm4.sampler_state_pointer = 0;
wm.wm5.program_uses_depth = key->uses_depth;
wm.wm5.program_computes_depth = key->computes_depth;
*/
ret = brw->sws->bo_emit_reloc(*bo_out,
BRW_USAGE_RENDER_TARGET,
- ss.ss1.base_addr - surface->bo->offset[0], /* XXX */
+ 0,
offsetof(struct brw_surface_state, ss1),
surface->bo);
if (ret)
bo_out))
return PIPE_OK;
+ /* Upload zero data, will all be overwitten with relocation
+ * offsets:
+ */
for (i = 0; i < brw->wm.nr_surfaces; i++)
- data[i] = brw->wm.surf_bo[i]->offset[0];
+ data[i] = 0;
ret = brw_upload_cache( &brw->surface_cache, BRW_SS_SURF_BIND,
NULL, 0,
buf->offset = align(xbw->used, alignment);
buf->type = type;
buf->virtual = MALLOC(size);
- buf->base.offset = &buf->offset; /* hmm, cheesy */
buf->base.size = size;
buf->base.sws = sws;