i965: Fix null register use in Sandybridge implied move resolution.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 3 Apr 2011 07:57:30 +0000 (00:57 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 3 Apr 2011 07:57:30 +0000 (00:57 -0700)
Fixes regressions caused by commit 9a21bc6401, namely GPU hangs when
running gnome-shell or compiz (Mesa bugs #35820 and #35853).

I incorrectly refactored the case that dealt with ARF_NULL; even in that
case, the source register needs to be changed to the MRF.

NOTE: This is a candidate for the 7.10 branch (if 9a21bc6401 is
cherry-picked, take this one too).

src/mesa/drivers/dri/i965/brw_eu_emit.c

index 32ee37f..57313a5 100644 (file)
@@ -68,15 +68,14 @@ gen6_resolve_implied_move(struct brw_compile *p,
    if (intel->gen != 6)
       return;
 
-   if (src->file == BRW_ARCHITECTURE_REGISTER_FILE && src->nr == BRW_ARF_NULL)
-      return;
-
-   brw_push_insn_state(p);
-   brw_set_mask_control(p, BRW_MASK_DISABLE);
-   brw_set_compression_control(p, BRW_COMPRESSION_NONE);
-   brw_MOV(p, retype(brw_message_reg(msg_reg_nr), BRW_REGISTER_TYPE_UD),
-          retype(*src, BRW_REGISTER_TYPE_UD));
-   brw_pop_insn_state(p);
+   if (src->file != BRW_ARCHITECTURE_REGISTER_FILE || src->nr != BRW_ARF_NULL) {
+      brw_push_insn_state(p);
+      brw_set_mask_control(p, BRW_MASK_DISABLE);
+      brw_set_compression_control(p, BRW_COMPRESSION_NONE);
+      brw_MOV(p, retype(brw_message_reg(msg_reg_nr), BRW_REGISTER_TYPE_UD),
+             retype(*src, BRW_REGISTER_TYPE_UD));
+      brw_pop_insn_state(p);
+   }
    *src = brw_message_reg(msg_reg_nr);
 }