/* CACHE_NEW_CLIP_PROG */
clip.thread0.grf_reg_count =
ALIGN(brw->clip.prog_data->total_grf, 16) / 16 - 1;
- clip.thread0.kernel_start_pointer = brw->clip.prog_gs_offset >> 6;
+ /* reloc */
+ clip.thread0.kernel_start_pointer = brw->clip.prog_bo->offset >> 6;
clip.thread3.urb_entry_read_length = brw->clip.prog_data->urb_read_length;
clip.thread3.const_urb_entry_read_length = brw->clip.prog_data->curb_read_length;
clip.clip5.clip_mode = brw->clip.prog_data->clip_mode;
clip.viewport_ymin = -1;
clip.viewport_ymax = 1;
- brw->clip.state_gs_offset = brw_cache_data( &brw->cache[BRW_CLIP_UNIT], &clip );
+ brw->clip.thread0_delta = clip.thread0.grf_reg_count << 1;
+
+ dri_bo_unreference(brw->clip.state_bo);
+ brw->clip.state_bo = brw_cache_data( &brw->cache, BRW_CLIP_UNIT, &clip,
+ &brw->clip.prog_bo, 1);
}
+static void emit_reloc_clip_unit(struct brw_context *brw)
+{
+ if (!brw->metaops.active) {
+ /* Emit clip program relocation */
+ dri_emit_reloc(brw->clip.state_bo,
+ DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
+ brw->clip.thread0_delta,
+ offsetof(struct brw_clip_unit_state, thread0),
+ brw->clip.prog_bo);
+ }
+}
const struct brw_tracked_state brw_clip_unit = {
.dirty = {
BRW_NEW_URB_FENCE),
.cache = CACHE_NEW_CLIP_PROG
},
- .update = upload_clip_unit
+ .update = upload_clip_unit,
+ .emit_reloc = emit_reloc_clip_unit,
};