summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_clip_state.c
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2007-12-26 15:41:24 -0600
committerDan Nicholson <dbn.lists@gmail.com>2007-12-26 15:41:24 -0600
commit2b440d54617bf0020171ce765708e7a9b48f2185 (patch)
treef125abe7e2c08ccaee721e895c4adf7f3faac4c2 /src/mesa/drivers/dri/i965/brw_clip_state.c
parentab57cbaccccb30fd743ba3283251430e6bc3a071 (diff)
parentb422e5ad3716d32f2434ca38819f4a877c7eeeeb (diff)
Merge branch 'master' into autoconf2
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clip_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_state.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c
index ba2f0edf51..7640a39b45 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_state.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_state.c
@@ -45,7 +45,8 @@ static void upload_clip_unit( struct brw_context *brw )
/* 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;
@@ -79,9 +80,24 @@ static void upload_clip_unit( struct brw_context *brw )
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 = {
@@ -90,5 +106,6 @@ const struct brw_tracked_state brw_clip_unit = {
BRW_NEW_URB_FENCE),
.cache = CACHE_NEW_CLIP_PROG
},
- .update = upload_clip_unit
+ .update = upload_clip_unit,
+ .emit_reloc = emit_reloc_clip_unit,
};