<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 4, 2017 at 12:33 PM, Chad Versace <span dir="ltr"><<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes crash in piglit<br>
`egl_khr_gl_renderbuffer_<wbr>image-clear-shared-image GL_DEPTH_COMPONENT24`<br>
on Skylake.<br>
<br>
The crash happened because blorp attempted to execute a pending hiz<br>
clear after the hiz buffer was deleted. Deleting the pending hiz ops<br>
when the hiz buffer gets deleted fixes the crash.<br>
<br>
For good measure, this patch also deletes all pending CCS/MCS ops when<br>
the CCS/MCS buffer gets deleted. I'm now aware of any bugs<br>
caused by the dangling ops, but deleting them is clearly the right thing<br>
to do.<br>
<br>
Cc: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=99265" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=99265</a><br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 16 ++++++++++++++++<br>
1 file changed, 16 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index 31fb71e196..f2c94b7a04 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -2337,12 +2337,28 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
drm_intel_bo_unreference(mt-><wbr>mcs_buf->bo);<br>
free(mt->mcs_buf);<br>
mt->mcs_buf = NULL;<br>
+<br>
+ /* Any pending MCS/CCS operations are no longer needed. Trying to<br>
+ * execute any will likely crash due to the missing aux buffer. So let's<br>
+ * delete all pending ops.<br>
+ */<br>
+ exec_list_make_empty(&mt-><wbr>color_resolve_map);<br>
}<br>
<br>
if (mt->hiz_buf) {<br>
intel_miptree_all_slices_<wbr>resolve_depth(brw, mt);<br>
intel_miptree_hiz_buffer_free(<wbr>mt->hiz_buf);<br>
mt->hiz_buf = NULL;<br>
+<br>
+ for (uint32_t l = mt->first_level; l <= mt->last_level; ++l) {<br>
+ mt->level[l].has_hiz = false;<br>
+ }<br>
+<br>
+ /* Any pending HiZ operations are no longer needed. Trying to execute<br>
+ * any will likely crash due to the missing aux buffer. So let's delete<br>
+ * all pending ops.<br>
+ */<br>
+ exec_list_make_empty(&mt->hiz_<wbr>map);<br>
}<br>
<br>
mt->aux_disable = INTEL_AUX_DISABLE_ALL;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>