<div dir="ltr"><div><div><div><div>Hi Matt,<br><br></div>This commit seems to have broken make check for me.<br><br></div>In  src/intel/compiler/test_eu_validate.cpp, line 121, I'm getting:<br><br>~/src/mesa/src/intel/compiler/test_eu_validate.cpp:121:41: error: use of undeclared<br>      identifier 'devinfo'<br>   bool ret = brw_validate_instructions(devinfo, p->store, 0,<br>                                        ^<br>1 error generated.<br><br></div>Thanks,<br></div>Aaron<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 1, 2017 at 3:54 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This will allow us to more easily run brw_validate_instructions() on<br>
shader programs we find in GPU hang error states.<br>
---<br>
 src/intel/compiler/brw_eu.h               |  3 ++-<br>
 src/intel/compiler/brw_eu_<wbr>validate.c      | 10 ++++------<br>
 src/intel/compiler/brw_fs_<wbr>generator.cpp   | 10 ++++++++--<br>
 src/intel/compiler/brw_vec4_<wbr>generator.cpp |  8 ++++++--<br>
 src/intel/compiler/test_eu_<wbr>validate.cpp   |  3 ++-<br>
 5 files changed, 22 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h<br>
index f422595..87c69a4 100644<br>
--- a/src/intel/compiler/brw_eu.h<br>
+++ b/src/intel/compiler/brw_eu.h<br>
@@ -548,7 +548,8 @@ void brw_debug_compact_uncompact(<wbr>const struct gen_device_info *devinfo,<br>
                                  brw_inst *orig, brw_inst *uncompacted);<br>
<br>
 /* brw_eu_validate.c */<br>
-bool brw_validate_instructions(<wbr>const struct brw_codegen *p, int start_offset,<br>
+bool brw_validate_instructions(<wbr>const struct gen_device_info *devinfo,<br>
+                               void *assembly, int start_offset, int end_offset,<br>
                                struct annotation_info *annotation);<br>
<br>
 static inline int<br>
diff --git a/src/intel/compiler/brw_eu_<wbr>validate.c b/src/intel/compiler/brw_eu_<wbr>validate.c<br>
index f231ea0..39363e4 100644<br>
--- a/src/intel/compiler/brw_eu_<wbr>validate.c<br>
+++ b/src/intel/compiler/brw_eu_<wbr>validate.c<br>
@@ -1042,17 +1042,15 @@ region_alignment_rules(const struct gen_device_info *devinfo,<br>
 }<br>
<br>
 bool<br>
-brw_validate_instructions(<wbr>const struct brw_codegen *p, int start_offset,<br>
+brw_validate_instructions(<wbr>const struct gen_device_info *devinfo,<br>
+                          void *assembly, int start_offset, int end_offset,<br>
                           struct annotation_info *annotation)<br>
 {<br>
-   const struct gen_device_info *devinfo = p->devinfo;<br>
-   const void *store = p->store;<br>
    bool valid = true;<br>
<br>
-   for (int src_offset = start_offset; src_offset < p->next_insn_offset;<br>
-        src_offset += sizeof(brw_inst)) {<br>
+   for (int src_offset = start_offset; src_offset < end_offset;) {<br>
       struct string error_msg = { .str = NULL, .len = 0 };<br>
-      const brw_inst *inst = store + src_offset;<br>
+      const brw_inst *inst = assembly + src_offset;<br>
<br>
       if (is_unsupported_inst(devinfo, inst)) {<br>
          ERROR("Instruction not supported on this Gen");<br>
diff --git a/src/intel/compiler/brw_fs_<wbr>generator.cpp b/src/intel/compiler/brw_fs_<wbr>generator.cpp<br>
index a7f95cc..2ade486 100644<br>
--- a/src/intel/compiler/brw_fs_<wbr>generator.cpp<br>
+++ b/src/intel/compiler/brw_fs_<wbr>generator.cpp<br>
@@ -2167,10 +2167,16 @@ fs_generator::generate_code(<wbr>const cfg_t *cfg, int dispatch_width)<br>
    annotation_finalize(&<wbr>annotation, p->next_insn_offset);<br>
<br>
 #ifndef NDEBUG<br>
-   bool validated = brw_validate_instructions(p, start_offset, &annotation);<br>
+   bool validated = brw_validate_instructions(<wbr>devinfo, p->store,<br>
+                                              start_offset,<br>
+                                              p->next_insn_offset,<br>
+                                              &annotation);<br>
 #else<br>
    if (unlikely(debug_flag))<br>
-      brw_validate_instructions(p, start_offset, &annotation);<br>
+      brw_validate_instructions(<wbr>devinfo, p->store,<br>
+                                start_offset,<br>
+                                p->next_insn_offset,<br>
+                                &annotation);<br>
 #endif<br>
<br>
    int before_size = p->next_insn_offset - start_offset;<br>
diff --git a/src/intel/compiler/brw_vec4_<wbr>generator.cpp b/src/intel/compiler/brw_vec4_<wbr>generator.cpp<br>
index e786ac6..2a7f9c1 100644<br>
--- a/src/intel/compiler/brw_vec4_<wbr>generator.cpp<br>
+++ b/src/intel/compiler/brw_vec4_<wbr>generator.cpp<br>
@@ -2187,10 +2187,14 @@ generate_code(struct brw_codegen *p,<br>
    annotation_finalize(&<wbr>annotation, p->next_insn_offset);<br>
<br>
 #ifndef NDEBUG<br>
-   bool validated = brw_validate_instructions(p, 0, &annotation);<br>
+   bool validated = brw_validate_instructions(<wbr>devinfo, p->store,<br>
+                                              0, p->next_insn_offset,<br>
+                                              &annotation);<br>
 #else<br>
    if (unlikely(debug_flag))<br>
-      brw_validate_instructions(p, 0, &annotation);<br>
+      brw_validate_instructions(<wbr>devinfo, p->store,<br>
+                                0, p->next_insn_offset,<br>
+                                &annotation);<br>
 #endif<br>
<br>
    int before_size = p->next_insn_offset;<br>
diff --git a/src/intel/compiler/test_eu_<wbr>validate.cpp b/src/intel/compiler/test_eu_<wbr>validate.cpp<br>
index 76652dc..ed67c4d 100644<br>
--- a/src/intel/compiler/test_eu_<wbr>validate.cpp<br>
+++ b/src/intel/compiler/test_eu_<wbr>validate.cpp<br>
@@ -118,7 +118,8 @@ validate(struct brw_codegen *p)<br>
       annotation.ann[annotation.ann_<wbr>count].offset = p->next_insn_offset;<br>
    }<br>
<br>
-   bool ret = brw_validate_instructions(p, 0, &annotation);<br>
+   bool ret = brw_validate_instructions(<wbr>devinfo, p->store, 0,<br>
+                                        p->next_insn_offset, &annotation);<br>
<br>
    if (print) {<br>
       dump_assembly(p->store, annotation.ann_count, annotation.ann, p->devinfo);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.10.2<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>