<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On 7 Sep. 2017 6:34 pm, "Nicolai Hähnle" <<a href="mailto:nhaehnle@gmail.com">nhaehnle@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On <a href="tel:07.09.2017%2009" value="+61709201709" target="_blank">07.09.2017 09</a>:58, Bas Nieuwenhuizen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm not really happy with this, what happens if a game actually uses<br>
e.g. indirect count in a secondary cmd buf?<br>
</blockquote>
<br></div>
Note that some packets that require fetching data in the CP cannot be run in secondary command buffers, because the data fetching path overlaps with that used for fetching IB2. I thought this only affects SET_PREDICATION and OCCLUSION_QUERY though.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Can you check it, it may be multi indirect is busted on some firmwares, this seems cik specific.</div><div dir="auto"><br></div><div dir="auto">Also is set predication a problem for all Pred setting types?</div><div dir="auto"><br></div><div dir="auto">Dave.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
That said this patch seems correct, so<br>
<br>
Reviewed-by: Bas Nieuwenhuizen <<a href="mailto:bas@basnieuwenhuizen.nl" target="_blank">bas@basnieuwenhuizen.nl</a>><br>
<br>
You may want to nominate this for stable (and provide a backport<br>
probably..)<br>
<br>
On Thu, Sep 7, 2017, at 05:03, Dave Airlie wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Dave Airlie <<a href="mailto:airlied@redhat.com" target="_blank">airlied@redhat.com</a>><br>
<br>
This fixes some observed hangs on CIK GPUs.<br>
<br>
Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com" target="_blank">airlied@redhat.com</a>><br>
---<br>
src/amd/vulkan/radv_cmd_buffer<wbr>.c | 37<br>
+++++++++++++++++++++++-------<wbr>-------<br>
1 file changed, 23 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_cmd_buff<wbr>er.c<br>
b/src/amd/vulkan/radv_cmd_buff<wbr>er.c<br>
index b372123..bc4aeb3 100644<br>
--- a/src/amd/vulkan/radv_cmd_buff<wbr>er.c<br>
+++ b/src/amd/vulkan/radv_cmd_buff<wbr>er.c<br>
@@ -2834,20 +2834,29 @@ radv_cs_emit_indirect_draw_pac<wbr>ket(struct<br>
radv_cmd_buffer *cmd_buffer,<br>
uint32_t base_reg = cmd_buffer->state.pipeline->gr<wbr>aphics.vtx_base_sgpr;<br>
assert(base_reg);<br>
- radeon_emit(cs, PKT3(indexed ? PKT3_DRAW_INDEX_INDIRECT_MULTI :<br>
- PKT3_DRAW_INDIRECT_MULTI,<br>
- 8, false));<br>
- radeon_emit(cs, 0);<br>
- radeon_emit(cs, (base_reg - SI_SH_REG_OFFSET) >> 2);<br>
- radeon_emit(cs, ((base_reg + 4) - SI_SH_REG_OFFSET) >> 2);<br>
- radeon_emit(cs, (((base_reg + 8) - SI_SH_REG_OFFSET) >> 2) |<br>
- S_2C3_DRAW_INDEX_ENABLE(draw_<wbr>id_enable) |<br>
- S_2C3_COUNT_INDIRECT_ENABLE(!<wbr>!count_va));<br>
- radeon_emit(cs, draw_count); /* count */<br>
- radeon_emit(cs, count_va); /* count_addr */<br>
- radeon_emit(cs, count_va >> 32);<br>
- radeon_emit(cs, stride); /* stride */<br>
- radeon_emit(cs, di_src_sel);<br>
+ if (draw_count == 1 && !count_va && !draw_id_enable) {<br>
+ radeon_emit(cs, PKT3(indexed ? PKT3_DRAW_INDEX_INDIRECT :<br>
+ PKT3_DRAW_INDIRECT, 3, false));<br>
+ radeon_emit(cs, 0);<br>
+ radeon_emit(cs, (base_reg - SI_SH_REG_OFFSET) >> 2);<br>
+ radeon_emit(cs, ((base_reg + 4) - SI_SH_REG_OFFSET) >><br>
2);<br>
+ radeon_emit(cs, di_src_sel);<br>
+ } else {<br>
+ radeon_emit(cs, PKT3(indexed ?<br>
PKT3_DRAW_INDEX_INDIRECT_MULTI :<br>
+ PKT3_DRAW_INDIRECT_MULTI,<br>
+ 8, false));<br>
+ radeon_emit(cs, 0);<br>
+ radeon_emit(cs, (base_reg - SI_SH_REG_OFFSET) >> 2);<br>
+ radeon_emit(cs, ((base_reg + 4) - SI_SH_REG_OFFSET) >><br>
2);<br>
+ radeon_emit(cs, (((base_reg + 8) - SI_SH_REG_OFFSET) >><br>
2) |<br>
+ S_2C3_DRAW_INDEX_ENABLE(draw_<wbr>id_enable) |<br>
+ S_2C3_COUNT_INDIRECT_ENABLE(!<wbr>!count_va));<br>
+ radeon_emit(cs, draw_count); /* count */<br>
+ radeon_emit(cs, count_va); /* count_addr */<br>
+ radeon_emit(cs, count_va >> 32);<br>
+ radeon_emit(cs, stride); /* stride */<br>
+ radeon_emit(cs, di_src_sel);<br>
+ }<br>
}<br>
static void<br>
-- <br>
2.9.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
</blockquote>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
<br>
</blockquote>
<br>
<br></div><font color="#888888">
-- <br>
Lerne, wie die Welt wirklich ist,<br>
Aber vergiss niemals, wie sie sein sollte.</font><div class="elided-text"><br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
</div></blockquote></div><br></div></div></div>