summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_gs.c
diff options
context:
space:
mode:
authorZhenyu Wang <[email protected]>2010-12-06 15:15:55 +0800
committerZhenyu Wang <[email protected]>2010-12-06 15:20:48 +0800
commit2b1469340bbf910469449354eeb5c02a9acfedba (patch)
tree8e49970e6e7ddfc8768d090f2dd81ff456891ddf /src/mesa/drivers/dri/i965/brw_gs.c
parent08be8d64509f60d2cc80112f5b94f43e06e94ff2 (diff)
i965: Fix GS state uploading on Sandybridge
Need to check the required primitive type for GS on Sandybridge, and when GS is disabled, the new state has to be issued too, instead of only updating URB state with no GS entry, that caused hang on Sandybridge. This fixes hang issue during conformance suite testing.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_gs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_gs.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index b0c76f4094d..73b41fdbcef 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -166,6 +166,9 @@ static void populate_key( struct brw_context *brw,
struct brw_gs_prog_key *key )
{
struct gl_context *ctx = &brw->intel.ctx;
+ struct intel_context *intel = &brw->intel;
+ int prim_gs_always;
+
memset(key, 0, sizeof(*key));
/* CACHE_NEW_VS_PROG */
@@ -185,10 +188,14 @@ static void populate_key( struct brw_context *brw,
key->pv_first = GL_TRUE;
}
- key->need_gs_prog = (key->hint_gs_always ||
- brw->primitive == GL_QUADS ||
+ if (intel->gen == 6)
+ prim_gs_always = brw->primitive == GL_LINE_LOOP;
+ else
+ prim_gs_always = brw->primitive == GL_QUADS ||
brw->primitive == GL_QUAD_STRIP ||
- brw->primitive == GL_LINE_LOOP);
+ brw->primitive == GL_LINE_LOOP;
+
+ key->need_gs_prog = (key->hint_gs_always || prim_gs_always);
}
/* Calculate interpolants for triangle and line rasterization.
@@ -205,8 +212,10 @@ static void prepare_gs_prog(struct brw_context *brw)
brw->gs.prog_active = key.need_gs_prog;
}
+ drm_intel_bo_unreference(brw->gs.prog_bo);
+ brw->gs.prog_bo = NULL;
+
if (brw->gs.prog_active) {
- drm_intel_bo_unreference(brw->gs.prog_bo);
brw->gs.prog_bo = brw_search_cache(&brw->cache, BRW_GS_PROG,
&key, sizeof(key),
NULL, 0,