r600, radeon: move radeon_shader_binary_{init,clean} back to radeon
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 16 Jun 2017 19:03:41 +0000 (20:03 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 17 Jun 2017 10:37:58 +0000 (11:37 +0100)
Those are used by r600 and radeonsi, so moving them within the former
was a bad idea.

Fixes: d96a210842b ("r600g,compute: provide local copy of functions
from ac_binary.c")
Cc: Jan Vesely <jan.vesely@rutgers.edu>
Cc: Aaron Watry <awatry@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/r600/evergreen_compute.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_pipe_common.h

index 1f1e08374fbb7b0281b0becf03484df49f3f7911..37cfed4497bcb343932a49ea00a155bbb028a479 100644 (file)
@@ -180,27 +180,6 @@ static void evergreen_cs_set_constant_buffer(struct r600_context *rctx,
 #define R_028850_SQ_PGM_RESOURCES_PS                 0x028850
 
 #ifdef HAVE_OPENCL
-/*
- * shader binary helpers.
- */
-static void r600_shader_binary_init(struct ac_shader_binary *b)
-{
-       memset(b, 0, sizeof(*b));
-}
-
-static void r600_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);
-}
-
 static void parse_symbol_table(Elf_Data *symbol_table_data,
                                const GElf_Shdr *symbol_table_header,
                                struct ac_shader_binary *binary)
@@ -435,7 +414,7 @@ static void *evergreen_create_compute_state(struct pipe_context *ctx,
        COMPUTE_DBG(rctx->screen, "*** evergreen_create_compute_state\n");
        header = cso->prog;
        code = cso->prog + sizeof(struct pipe_llvm_program_header);
-       r600_shader_binary_init(&shader->binary);
+       radeon_shader_binary_init(&shader->binary);
        r600_elf_read(code, header->num_bytes, &shader->binary);
        r600_create_shader(&shader->bc, &shader->binary, &use_kill);
 
@@ -467,7 +446,7 @@ static void evergreen_delete_compute_state(struct pipe_context *ctx, void *state
                return;
 
 #ifdef HAVE_OPENCL
-       r600_shader_binary_clean(&shader->binary);
+       radeon_shader_binary_clean(&shader->binary);
 #endif
        r600_destroy_shader(&shader->bc);
 
index 038627c4aebb293bc126f7c5e7a709098673ef34..1cec6d5ea6809275ab1678c989e2b41d2111e236 100644 (file)
@@ -63,6 +63,27 @@ struct r600_multi_fence {
        } gfx_unflushed;
 };
 
+/*
+ * shader binary helpers.
+ */
+void radeon_shader_binary_init(struct ac_shader_binary *b)
+{
+       memset(b, 0, sizeof(*b));
+}
+
+void 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 8ba5c369a66b5b818883f6b27fd0049ee2d22172..45ed5bab74b57245565cb407e96eabbdc8c45e99 100644 (file)
@@ -34,6 +34,8 @@
 
 #include <stdio.h>
 
+#include "amd/common/ac_binary.h"
+
 #include "radeon/radeon_winsys.h"
 
 #include "util/disk_cache.h"
@@ -132,6 +134,9 @@ struct r600_perfcounters;
 struct tgsi_shader_info;
 struct r600_qbo_state;
 
+void radeon_shader_binary_init(struct ac_shader_binary *b);
+void radeon_shader_binary_clean(struct ac_shader_binary *b);
+
 /* Only 32-bit buffer allocations are supported, gallium doesn't support more
  * at the moment.
  */