Re: [Mesa-dev] [PATCH] i965/gen5, 6: Fix hang when emitting hiz buffer without stencil buffer

2011-06-16 Thread Chad Versace
On Wed, 15 Jun 2011 00:13:51 -0700, Kenneth Graunke kenn...@whitecape.org 
wrote:
 On 06/14/2011 03:28 PM, Chad Versace wrote:
 [snip]
  @@ -355,26 +355,48 @@ static void emit_depthbuffer(struct brw_context *brw)
  ADVANCE_BATCH();
   }
 
  -   /* Emit hiz buffer. */
   if (hiz_region || stencil_irb) {
  -  BEGIN_BATCH(3);
  -  OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER  16) | (3 - 2));
  -  OUT_BATCH(hiz_region-pitch * hiz_region-cpp - 1);
  -  OUT_RELOC(hiz_region-buffer,
  -   I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
  -   0);
  -  ADVANCE_BATCH();
  -   }
  +  /*
  +   * In the 3DSTATE_DEPTH_BUFFER batch emitted above, the 'separate
  +   * stencil enable' and 'hiz enable' bits were set. Therefore we must
  +   * emit 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER. Even if
  +   * there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be 
  emitted;
  +   * failure to do so causes hangs on gen5.
  +   */
 
 Extra indentation here?

Nope. The comment only applies if the if-branch is taken, so I placed
the comment in the if-branch.

 
 Otherwise, yes, please :)
 
 Reviewed-by: Kenneth Graunke kenn...@whitecape.org
 
 [snip]
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965/gen5, 6: Fix hang when emitting hiz buffer without stencil buffer

2011-06-15 Thread Kenneth Graunke

On 06/14/2011 03:28 PM, Chad Versace wrote:
[snip]

@@ -355,26 +355,48 @@ static void emit_depthbuffer(struct brw_context *brw)
ADVANCE_BATCH();
 }

-   /* Emit hiz buffer. */
 if (hiz_region || stencil_irb) {
-  BEGIN_BATCH(3);
-  OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER  16) | (3 - 2));
-  OUT_BATCH(hiz_region-pitch * hiz_region-cpp - 1);
-  OUT_RELOC(hiz_region-buffer,
-   I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
-   0);
-  ADVANCE_BATCH();
-   }
+  /*
+   * In the 3DSTATE_DEPTH_BUFFER batch emitted above, the 'separate
+   * stencil enable' and 'hiz enable' bits were set. Therefore we must
+   * emit 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER. Even if
+   * there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be emitted;
+   * failure to do so causes hangs on gen5.
+   */


Extra indentation here?

Otherwise, yes, please :)

Reviewed-by: Kenneth Graunke kenn...@whitecape.org

[snip]
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev