radeonsi: move/remove ac_shader_binary helpers
authorMarek Olšák <marek.olsak@amd.com>
Sat, 25 Nov 2017 21:35:27 +0000 (22:35 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Nov 2017 17:21:30 +0000 (18:21 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_binary.c
src/amd/common/ac_binary.h
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_shader.c

index 6ad6046894916600d32bf22053b8e7444d6f8fe9..fabeb15a2048d26c3e98c6137a8b0c7484c4b58b 100644 (file)
@@ -298,3 +298,16 @@ void ac_shader_binary_read_config(struct ac_shader_binary *binary,
                conf->scratch_bytes_per_wave = G_00B860_WAVESIZE(wavesize) * 256 * 4;
        }
 }
+
+void ac_shader_binary_clean(struct ac_shader_binary *b)
+{
+       if (!b)
+               return;
+       FREE(b->code);
+       FREE(b->config);
+       FREE(b->rodata);
+       FREE(b->global_symbol_offsets);
+       FREE(b->relocs);
+       FREE(b->disasm_string);
+       FREE(b->llvm_ir_string);
+}
index 24c9ba5f216ff5c9cad80dc6debbec0f78e41a0e..4bd86b939f1762f6718cca836d28c9bf874128ec 100644 (file)
@@ -96,5 +96,6 @@ void ac_shader_binary_read_config(struct ac_shader_binary *binary,
                                  struct ac_shader_config *conf,
                                  unsigned symbol_offset,
                                  bool supports_spill);
+void ac_shader_binary_clean(struct ac_shader_binary *b);
 
 #endif /* AC_BINARY_H */
index b4e76a39921604cb7fff07aa4eb87b1cbf00980e..a72d2d46e4e21f1e302bc1c631ba8606f2d66914 100644 (file)
 
 #include <llvm-c/TargetMachine.h>
 
-
-/*
- * shader binary helpers.
- */
-void si_radeon_shader_binary_init(struct ac_shader_binary *b)
-{
-       memset(b, 0, sizeof(*b));
-}
-
-void si_radeon_shader_binary_clean(struct ac_shader_binary *b)
-{
-       if (!b)
-               return;
-       FREE(b->code);
-       FREE(b->config);
-       FREE(b->rodata);
-       FREE(b->global_symbol_offsets);
-       FREE(b->relocs);
-       FREE(b->disasm_string);
-       FREE(b->llvm_ir_string);
-}
-
 /*
  * pipe_context
  */
index c052a54eb6779228b9d72667f4f5b2a2815b4fe6..0597af49803ac9588c6caf0d81dbd2e99c03a728 100644 (file)
@@ -127,9 +127,6 @@ struct r600_perfcounters;
 struct tgsi_shader_info;
 struct r600_qbo_state;
 
-void si_radeon_shader_binary_init(struct ac_shader_binary *b);
-void si_radeon_shader_binary_clean(struct ac_shader_binary *b);
-
 /* Only 32-bit buffer allocations are supported, gallium doesn't support more
  * at the moment.
  */
index dfb35ed82eea35b55e43662b7d1270e1734c6c1e..fd09d78b2040136610d93344bbd2452b3ec7cece 100644 (file)
@@ -433,7 +433,7 @@ static void si_destroy_screen(struct pipe_screen* pscreen)
                        struct si_shader_part *part = parts[i];
 
                        parts[i] = part->next;
-                       si_radeon_shader_binary_clean(&part->binary);
+                       ac_shader_binary_clean(&part->binary);
                        FREE(part);
                }
        }
index fc4bab8c9cf0d64f0949a0adb71e2b20bc3bbcf7..0340133a8afc88c34954c830d9b2e36dad4e56de 100644 (file)
@@ -7813,7 +7813,7 @@ void si_shader_destroy(struct si_shader *shader)
        r600_resource_reference(&shader->bo, NULL);
 
        if (!shader->is_binary_shared)
-               si_radeon_shader_binary_clean(&shader->binary);
+               ac_shader_binary_clean(&shader->binary);
 
        free(shader->shader_log);
 }