diff options
author | Timothy Arceri <[email protected]> | 2017-02-27 10:50:29 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-02-28 13:20:31 +1100 |
commit | 69a687189e0381d0ff8c2f079698b8adfbb0a7b1 (patch) | |
tree | 58a4cbd9d508aa5e52c3a46ff9b177f6f4f5d86b /src/gallium/drivers/radeon | |
parent | affc8314cb7580414c6ed72aac40997b952b3694 (diff) |
radeon/ac: switch from radeon_shader_binary to ac_shader_binary
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 43 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_elf_util.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_elf_util.h | 7 |
4 files changed, 15 insertions, 51 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 9a514e34b3f..5a6f9606b71 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -66,12 +66,12 @@ struct r600_multi_fence { /* * shader binary helpers. */ -void radeon_shader_binary_init(struct radeon_shader_binary *b) +void radeon_shader_binary_init(struct ac_shader_binary *b) { memset(b, 0, sizeof(*b)); } -void radeon_shader_binary_clean(struct radeon_shader_binary *b) +void radeon_shader_binary_clean(struct ac_shader_binary *b) { if (!b) return; diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 94cf0fcc055..55d2d0bd5ff 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -34,6 +34,8 @@ #include <stdio.h> +#include "amd/common/ac_binary.h" + #include "radeon/radeon_winsys.h" #include "util/disk_cache.h" @@ -128,45 +130,8 @@ struct r600_perfcounters; struct tgsi_shader_info; struct r600_qbo_state; -struct radeon_shader_reloc { - char name[32]; - uint64_t offset; -}; - -struct radeon_shader_binary { - /** Shader code */ - unsigned char *code; - unsigned code_size; - - /** Config/Context register state that accompanies this shader. - * This is a stream of dword pairs. First dword contains the - * register address, the second dword contains the value.*/ - unsigned char *config; - unsigned config_size; - - /** The number of bytes of config information for each global symbol. - */ - unsigned config_size_per_symbol; - - /** Constant data accessed by the shader. This will be uploaded - * into a constant buffer. */ - unsigned char *rodata; - unsigned rodata_size; - - /** List of symbol offsets for the shader */ - uint64_t *global_symbol_offsets; - unsigned global_symbol_count; - - struct radeon_shader_reloc *relocs; - unsigned reloc_count; - - /** Disassembled shader in a string. */ - char *disasm_string; - char *llvm_ir_string; -}; - -void radeon_shader_binary_init(struct radeon_shader_binary *b); -void radeon_shader_binary_clean(struct radeon_shader_binary *b); +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. diff --git a/src/gallium/drivers/radeon/radeon_elf_util.c b/src/gallium/drivers/radeon/radeon_elf_util.c index 8aaa85d02f6..21a7ed5c87e 100644 --- a/src/gallium/drivers/radeon/radeon_elf_util.c +++ b/src/gallium/drivers/radeon/radeon_elf_util.c @@ -35,7 +35,7 @@ static void parse_symbol_table(Elf_Data *symbol_table_data, const GElf_Shdr *symbol_table_header, - struct radeon_shader_binary *binary) + struct ac_shader_binary *binary) { GElf_Sym symbol; unsigned i = 0; @@ -78,7 +78,7 @@ static void parse_symbol_table(Elf_Data *symbol_table_data, static void parse_relocs(Elf *elf, Elf_Data *relocs, Elf_Data *symbols, unsigned symbol_sh_link, - struct radeon_shader_binary *binary) + struct ac_shader_binary *binary) { unsigned i; @@ -86,12 +86,12 @@ static void parse_relocs(Elf *elf, Elf_Data *relocs, Elf_Data *symbols, return; } binary->relocs = CALLOC(binary->reloc_count, - sizeof(struct radeon_shader_reloc)); + sizeof(struct ac_shader_reloc)); for (i = 0; i < binary->reloc_count; i++) { GElf_Sym symbol; GElf_Rel rel; char *symbol_name; - struct radeon_shader_reloc *reloc = &binary->relocs[i]; + struct ac_shader_reloc *reloc = &binary->relocs[i]; gelf_getrel(relocs, i, &rel); gelf_getsym(symbols, GELF_R_SYM(rel.r_info), &symbol); @@ -104,7 +104,7 @@ static void parse_relocs(Elf *elf, Elf_Data *relocs, Elf_Data *symbols, } void radeon_elf_read(const char *elf_data, unsigned elf_size, - struct radeon_shader_binary *binary) + struct ac_shader_binary *binary) { char *elf_buffer; Elf *elf; @@ -183,7 +183,7 @@ void radeon_elf_read(const char *elf_data, unsigned elf_size, } const unsigned char *radeon_shader_binary_config_start( - const struct radeon_shader_binary *binary, + const struct ac_shader_binary *binary, uint64_t symbol_offset) { unsigned i; diff --git a/src/gallium/drivers/radeon/radeon_elf_util.h b/src/gallium/drivers/radeon/radeon_elf_util.h index c2af9e0dfe0..4d8318c68f3 100644 --- a/src/gallium/drivers/radeon/radeon_elf_util.h +++ b/src/gallium/drivers/radeon/radeon_elf_util.h @@ -29,22 +29,21 @@ #include <stdint.h> -struct radeon_shader_binary; -struct radeon_shader_reloc; +struct ac_shader_binary; /* * Parse the elf binary stored in \p elf_data and create a * radeon_shader_binary object. */ void radeon_elf_read(const char *elf_data, unsigned elf_size, - struct radeon_shader_binary *binary); + struct ac_shader_binary *binary); /** * @returns A pointer to the start of the configuration information for * the function starting at \p symbol_offset of the binary. */ const unsigned char *radeon_shader_binary_config_start( - const struct radeon_shader_binary *binary, + const struct ac_shader_binary *binary, uint64_t symbol_offset); #endif /* RADEON_ELF_UTIL_H */ |