On 6 August 2012 21:20, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 08/05/2012 08:36 AM, Paul Berry wrote:<br>
> Just looking for a quick patch review to make sure I've backported<br>
> these patches to 8.0 correctly (and also confirmation that this<br>
> backport is a good idea).  These patches are intended to apply to the<br>
> 8.0 branch.<br>
><br>
> The issue is that on Gen6 and Gen7, images rendered to depth and<br>
> stencil buffers must be aligned to a multiple of 8 pixels, otherwise<br>
> certain rendering operations produce a GPU hang.  Unfortunately, due<br>
> to the layout of miptrees (and the fact that we render to depth and<br>
> stencil miptrees using coordinate offsets), it would take a lot of<br>
> code rework to both produce correct rendering and guarantee no GPU<br>
> hangs.<br>
><br>
> These patches avoid the GPU hangs by forcing the image offsets to be<br>
> multiples of 8.  As a result, correct rendering to depth and stencil<br>
> miptrees is sacrificed but the GPU doesn't hang.  The sacrifice is<br>
> minor, since it only affects miptree levels that would otherwise be<br>
> unaligned (in practice this is usually just the smallest miplevels),<br>
> and it only matters for (a) rendering to a depth/stencil buffer that<br>
> is later used as a texture, or (b) ping-ponging between miplevels<br>
> while rendering, both of which are fairly rare.  On the master branch,<br>
> we decided that this was a worthwhile compromise.<br>
><br>
> As a result of this sacrifice, this will regress the following piglit<br>
> tests: fbo/fbo-depth-array (Gen6 only),<br>
> spec/ARB_depth_buffer_float/fbo-clear-formats,<br>
> spec/ARB_depth_texture/fbo-clear-formats, and<br>
> spec/EXT_packed_depth_stencil/fbo-clear-formats.  These tests<br>
> currently fail on master for the same reason.<br>
><br>
> For more information see:<br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=50271" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=50271</a><br>
><br>
> [PATCH 1/2] i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.<br>
> [PATCH 2/2] i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.<br>
<br>
</div></div>This trade-off makes sense to me.  Take small amounts of misrendering in<br>
a few piglit tests doing non-real-world cases but avoid nasty GPU hangs.<br>
 I hate to regress Piglit tests on stable, but it's for the best.<br></blockquote><div><br>Ok, cool.  Thanks for the confirmation that this is a good idea.  I hate doing cherry-picks to stable that have merge conflicts anyhow, and in this case the fact that it would cause known regressions made it seem even less certain--but I couldn't think of a better alternative.<br>
<br>I'll plan on pushing it to stable tomorrow.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
For some reason, I thought this needed the more invasive<br>
coarse/fine-grained tile offset patches.<br>
<br>
Have you tested this to confirm it fixes the cases?<br>
</blockquote></div><br>Yes, I tested it on both Sandy Bridge and Ivy Bridge.  (Believe it or not, I brought both with me to SIGGRAPH :))<br>