From 9cb84bb1cab87a20a442cda21ded9ed8b0adbac9 Mon Sep 17 00:00:00 2001 From: Ben Widawsky Date: Wed, 31 Dec 2014 11:29:44 -0800 Subject: [PATCH] i965/gen7: Make sure streamout buffers are setup This was found by looking at the context state on a HSW GT1 hang. Even though xfb wasn't used, there was garbage data in the buffers Signed-off-by: Ben Widawsky --- src/mesa/drivers/dri/i965/gen7_sol_state.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c index 7e9b285..d113cef 100644 --- a/src/mesa/drivers/dri/i965/gen7_sol_state.c +++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c @@ -71,6 +71,8 @@ upload_3dstate_so_buffers(struct brw_context *brw) } stride = linked_xfb_info->BufferStride[i] * 4; + assert(stride <= 2048); + assert(stride % 4 == 0); start = xfb_obj->Offset[i]; assert(start % 4 == 0); @@ -223,7 +225,7 @@ upload_3dstate_streamout(struct brw_context *brw, bool active, uint32_t dw1 = 0, dw2 = 0; int i; - if (active) { + if (1) { int urb_entry_read_offset = 0; int urb_entry_read_length = (vue_map->num_slots + 1) / 2 - urb_entry_read_offset; @@ -236,7 +238,7 @@ upload_3dstate_streamout(struct brw_context *brw, bool active, dw1 |= SO_REORDER_TRAILING; for (i = 0; i < 4; i++) { - if (xfb_obj->Buffers[i]) { + if (xfb_obj->Buffers[i] && active) { dw1 |= SO_BUFFER_ENABLE(i); } } @@ -272,10 +274,11 @@ upload_sol_state(struct brw_context *brw) /* BRW_NEW_TRANSFORM_FEEDBACK */ bool active = _mesa_is_xfb_active_and_unpaused(ctx); - if (active) { + if (1) { upload_3dstate_so_buffers(brw); /* BRW_NEW_VUE_MAP_GEOM_OUT */ - gen7_upload_3dstate_so_decl_list(brw, &brw->vue_map_geom_out); + if (active) + gen7_upload_3dstate_so_decl_list(brw, &brw->vue_map_geom_out); } /* Finally, set up the SOL stage. This command must always follow updates to -- 2.2.1