<div dir="ltr">On 19 May 2016 at 23:17, Rhys Kidd <span dir="ltr"><<a href="mailto:rhyskidd@gmail.com" target="_blank">rhyskidd@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Correct use of qir_dump_inst() within QIR validate pass.<br>
<br>
Reported by the following GCC warning:<br>
<br>
mesa/src/gallium/drivers/vc4/vc4_qir_validate.c: In function 'fail_instr':<br>
mesa/src/gallium/drivers/vc4/vc4_qir_validate.c:31:23: warning: passing argument 1 of 'qir_dump_inst' from incompatible pointer type<br>
qir_dump_inst(stderr, inst);<br>
^<br>
In file included from mesa/src/gallium/drivers/vc4/vc4_qir_validate.c:24:0:<br>
mesa/src/gallium/drivers/vc4/vc4_qir.h:489:6: note: expected 'struct vc4_compile *' but argument is of type 'struct _IO_FILE *'<br>
void qir_dump_inst(struct vc4_compile *c, struct qinst *inst);<br>
^<br>
<br>
Introduced in 8e2d0843c02daf5280184f179ae8ed440ac90d7f.<br>
<br>
Signed-off-by: Rhys Kidd <<a href="mailto:rhyskidd@gmail.com">rhyskidd@gmail.com</a>><br>
---<br>
src/gallium/drivers/vc4/vc4_qir_validate.c | 20 ++++++++++----------<br>
1 file changed, 10 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/vc4/vc4_qir_validate.c b/src/gallium/drivers/vc4/vc4_qir_validate.c<br>
index af2e3ba..da6457c 100644<br>
--- a/src/gallium/drivers/vc4/vc4_qir_validate.c<br>
+++ b/src/gallium/drivers/vc4/vc4_qir_validate.c<br>
@@ -25,10 +25,10 @@<br>
#include "vc4_qpu.h"<br>
<br>
static void<br>
-fail_instr(struct qinst *inst, const char *msg)<br>
+fail_instr(struct vc4_compile *c, struct qinst *inst, const char *msg)<br>
{<br>
fprintf(stderr, "qir_validate: %s: ", msg);<br>
- qir_dump_inst(stderr, inst);<br>
+ qir_dump_inst(c, inst);<br>
fprintf(stderr, "\n");<br>
abort();<br>
}<br>
@@ -50,18 +50,18 @@ void qir_validate(struct vc4_compile *c)<br>
struct qinst *def = c->defs[i];<br>
<br>
if (def && def->cond != QPU_COND_ALWAYS)<br>
- fail_instr(def, "SSA def with condition");<br>
+ fail_instr(c, def, "SSA def with condition");<br>
}<br>
<br>
list_for_each_entry(struct qinst, inst, &c->instructions, link) {<br>
switch (inst->dst.file) {<br>
case QFILE_TEMP:<br>
if (inst->dst.index >= c->num_temps)<br>
- fail_instr(inst, "bad temp index");<br>
+ fail_instr(c, inst, "bad temp index");<br>
<br>
if (c->defs[inst->dst.index] &&<br>
already_assigned[inst->dst.index]) {<br>
- fail_instr(inst, "Re-assignment of SSA value");<br>
+ fail_instr(c, inst, "Re-assignment of SSA value");<br>
}<br>
already_assigned[inst->dst.index] = true;<br>
break;<br>
@@ -81,7 +81,7 @@ void qir_validate(struct vc4_compile *c)<br>
case QFILE_FRAG_REV_FLAG:<br>
case QFILE_SMALL_IMM:<br>
case QFILE_LOAD_IMM:<br>
- fail_instr(inst, "Bad dest file");<br>
+ fail_instr(c, inst, "Bad dest file");<br>
break;<br>
}<br>
<br>
@@ -91,7 +91,7 @@ void qir_validate(struct vc4_compile *c)<br>
switch (src.file) {<br>
case QFILE_TEMP:<br>
if (src.index >= c->num_temps)<br>
- fail_instr(inst, "bad temp index");<br>
+ fail_instr(c, inst, "bad temp index");<br>
break;<br>
<br>
case QFILE_VARY:<br>
@@ -102,14 +102,14 @@ void qir_validate(struct vc4_compile *c)<br>
<br>
case QFILE_SMALL_IMM:<br>
if (qpu_encode_small_immediate(src.index) == ~0)<br>
- fail_instr(inst, "bad small immediate");<br>
+ fail_instr(c, inst, "bad small immediate");<br>
break;<br>
<br>
case QFILE_FRAG_X:<br>
case QFILE_FRAG_Y:<br>
case QFILE_FRAG_REV_FLAG:<br>
if (c->stage != QSTAGE_FRAG)<br>
- fail_instr(inst, "frag access in VS/CS");<br>
+ fail_instr(c, inst, "frag access in VS/CS");<br>
break;<br>
<br>
case QFILE_NULL:<br>
@@ -117,7 +117,7 @@ void qir_validate(struct vc4_compile *c)<br>
case QFILE_TLB_COLOR_WRITE_MS:<br>
case QFILE_TLB_Z_WRITE:<br>
case QFILE_TLB_STENCIL_SETUP:<br>
- fail_instr(inst, "Bad src file");<br>
+ fail_instr(c, inst, "Bad src file");<br>
break;<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">Gentle ping Eric?<br></div></div>