diff options
author | Matt Turner <[email protected]> | 2014-11-21 18:04:51 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-12-01 11:32:51 -0800 |
commit | 82811ff17628d978c69dd0c08d4c68069cd482c2 (patch) | |
tree | 1c33a37820109c149ec1eb11c2bea963c95457cf /src/mesa/drivers | |
parent | 9db278d0e2b3bf35b28f00ab7ec3392443aae6b3 (diff) |
i965: Initialize compaction tables once per process.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_eu_compact.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_compact.c b/src/mesa/drivers/dri/i965/brw_eu_compact.c index 7117890197a..8e33bcb0d83 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_compact.c +++ b/src/mesa/drivers/dri/i965/brw_eu_compact.c @@ -75,6 +75,7 @@ #include "brw_context.h" #include "brw_eu.h" #include "intel_asm_annotation.h" +#include "util/u_atomic.h" /* for p_atomic_cmpxchg */ static const uint32_t g45_control_index_table[32] = { 0b00000000000000000, @@ -1247,6 +1248,10 @@ update_gen4_jump_count(struct brw_context *brw, brw_inst *insn, void brw_init_compaction_tables(struct brw_context *brw) { + static bool initialized; + if (initialized || p_atomic_cmpxchg(&initialized, false, true) != false) + return; + assert(g45_control_index_table[ARRAY_SIZE(g45_control_index_table) - 1] != 0); assert(g45_datatype_table[ARRAY_SIZE(g45_datatype_table) - 1] != 0); assert(g45_subreg_table[ARRAY_SIZE(g45_subreg_table) - 1] != 0); |