[Mesa-dev] [PATCH 4/6] radeon/ac: make ac_shader_binary_config_start() available externally

Timothy Arceri tarceri at itsqueeze.com
Mon Feb 27 00:49:53 UTC 2017


The read config functions are different for r600 and radeonsi so
we can't just share the one in amd common. So just share this
instead.
---
 src/amd/common/ac_binary.c | 1 -
 src/amd/common/ac_binary.h | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_binary.c b/src/amd/common/ac_binary.c
index 9c66a82..618b5cf 100644
--- a/src/amd/common/ac_binary.c
+++ b/src/amd/common/ac_binary.c
@@ -181,21 +181,20 @@ void ac_elf_read(const char *elf_data, unsigned elf_size,
 	/* Cache the config size per symbol */
 	if (binary->global_symbol_count) {
 		binary->config_size_per_symbol =
 			binary->config_size / binary->global_symbol_count;
 	} else {
 		binary->global_symbol_count = 1;
 		binary->config_size_per_symbol = binary->config_size;
 	}
 }
 
-static
 const unsigned char *ac_shader_binary_config_start(
 	const struct ac_shader_binary *binary,
 	uint64_t symbol_offset)
 {
 	unsigned i;
 	for (i = 0; i < binary->global_symbol_count; ++i) {
 		if (binary->global_symbol_offsets[i] == symbol_offset) {
 			unsigned offset = i * binary->config_size_per_symbol;
 			return binary->config + offset;
 		}
diff --git a/src/amd/common/ac_binary.h b/src/amd/common/ac_binary.h
index df945b2..0ece929 100644
--- a/src/amd/common/ac_binary.h
+++ b/src/amd/common/ac_binary.h
@@ -78,14 +78,22 @@ struct ac_shader_config {
 	unsigned scratch_bytes_per_wave;
 };
 
 /*
  * Parse the elf binary stored in \p elf_data and create a
  * ac_shader_binary object.
  */
 void ac_elf_read(const char *elf_data, unsigned elf_size,
 		 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 *ac_shader_binary_config_start(
+	const struct ac_shader_binary *binary,
+	uint64_t symbol_offset);
+
 void ac_shader_binary_read_config(struct ac_shader_binary *binary,
 				  struct ac_shader_config *conf,
 				  unsigned symbol_offset,
 				  bool supports_spill);
-- 
2.9.3



More information about the mesa-dev mailing list