<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 9, 2017 at 4:06 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">... so that we can avoid threading complications or unnecessary<br>
compaction table initializations (which just consists of setting some<br>
pointers based on devinfo->gen).<br>
---<br>
 src/mesa/drivers/dri/i965/brw_<wbr>compiler.c   | 2 ++<br>
 src/mesa/drivers/dri/i965/brw_<wbr>eu.c         | 2 --<br>
 src/mesa/drivers/dri/i965/brw_<wbr>eu_compact.c | 5 -----<br>
 3 files changed, 2 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_compiler.c b/src/mesa/drivers/dri/i965/<wbr>brw_compiler.c<br>
index fcad570..cd9473f 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_compiler.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_compiler.c<br>
@@ -23,6 +23,7 @@<br>
<br>
 #include "brw_compiler.h"<br>
 #include "brw_shader.h"<br>
+#include "brw_eu.h"<br>
 #include "common/gen_debug.h"<br>
 #include "compiler/nir/nir.h"<br>
 #include "main/errors.h"<br>
@@ -107,6 +108,7 @@ brw_compiler_create(void *mem_ctx, const struct gen_device_info *devinfo)<br>
<br>
    brw_fs_alloc_reg_sets(<wbr>compiler);<br>
    brw_vec4_alloc_reg_set(<wbr>compiler);<br>
+   brw_init_compaction_tables(<wbr>devinfo);<br></blockquote><div><br></div><div>Technically, you can call brw_compiler_create arbitrarily many times but that's not really a thing that's going to happen.  It's also not really a problem.  So<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    compiler->precise_trig = env_var_as_boolean("INTEL_<wbr>PRECISE_TRIG", false);<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_eu.c b/src/mesa/drivers/dri/i965/<wbr>brw_eu.c<br>
index 1344f2b..d280ffd 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_eu.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_eu.c<br>
@@ -354,8 +354,6 @@ brw_init_codegen(const struct gen_device_info *devinfo,<br>
    p->loop_stack_array_size = 16;<br>
    p->loop_stack = rzalloc_array(mem_ctx, int, p->loop_stack_array_size);<br>
    p->if_depth_in_loop = rzalloc_array(mem_ctx, int, p->loop_stack_array_size);<br>
-<br>
-   brw_init_compaction_tables(<wbr>devinfo);<br>
 }<br>
<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_eu_compact.c b/src/mesa/drivers/dri/i965/<wbr>brw_eu_compact.c<br>
index 5b8e9b2..b2af76d 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_eu_compact.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_eu_compact.c<br>
@@ -76,7 +76,6 @@<br>
 #include "brw_shader.h"<br>
 #include "intel_asm_annotation.h"<br>
 #include "common/gen_debug.h"<br>
-#include "util/u_atomic.h" /* for p_atomic_cmpxchg */<br>
<br>
 static const uint32_t g45_control_index_table[32] = {<br>
    0b00000000000000000,<br>
@@ -1345,10 +1344,6 @@ update_gen4_jump_count(const struct gen_device_info *devinfo, brw_inst *insn,<br>
 void<br>
 brw_init_compaction_tables(<wbr>const struct gen_device_info *devinfo)<br>
 {<br>
-   static bool initialized;<br>
-   if (initialized || p_atomic_cmpxchg(&initialized, false, true) != false)<br>
-      return;<br>
-<br>
    assert(g45_control_index_<wbr>table[ARRAY_SIZE(g45_control_<wbr>index_table) - 1] != 0);<br>
    assert(g45_datatype_table[<wbr>ARRAY_SIZE(g45_datatype_table) - 1] != 0);<br>
    assert(g45_subreg_table[ARRAY_<wbr>SIZE(g45_subreg_table) - 1] != 0);<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></div>