From ca21ba2a08a654b41d0e10712b0f9fc946564007 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Fri, 3 May 2019 19:15:52 +0200 Subject: [PATCH] radeonsi: inline si_shader_binary_read_config into its only caller MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since it can only be used for reading the config of an individual, non-combined shader, it is not very reusable anyway. Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_shader.c | 21 +++++++-------------- src/gallium/drivers/radeonsi/si_shader.h | 2 -- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 04944e8bdab..2beb3f9f2ef 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -5389,19 +5389,6 @@ void si_shader_dump(struct si_screen *sscreen, const struct si_shader *shader, check_debug_option); } -bool si_shader_binary_read_config(struct si_shader_binary *binary, - struct ac_shader_config *conf) -{ - struct ac_rtld_binary rtld; - if (!ac_rtld_open(&rtld, 1, &binary->elf_buffer, &binary->elf_size)) - return false; - - bool ok = ac_rtld_read_config(&rtld, conf); - - ac_rtld_close(&rtld); - return ok; -} - static int si_compile_llvm(struct si_screen *sscreen, struct si_shader_binary *binary, struct ac_shader_config *conf, @@ -5437,7 +5424,13 @@ static int si_compile_llvm(struct si_screen *sscreen, return r; } - if (!si_shader_binary_read_config(binary, conf)) + struct ac_rtld_binary rtld; + if (!ac_rtld_open(&rtld, 1, &binary->elf_buffer, &binary->elf_size)) + return -1; + + bool ok = ac_rtld_read_config(&rtld, conf); + ac_rtld_close(&rtld); + if (!ok) return -1; /* Enable 64-bit and 16-bit denormals, because there is no performance diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 586460e2b4f..e8c769da69f 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -707,8 +707,6 @@ void si_shader_dump_stats_for_shader_db(const struct si_shader *shader, void si_multiwave_lds_size_workaround(struct si_screen *sscreen, unsigned *lds_size); const char *si_get_shader_name(const struct si_shader *shader, unsigned processor); -bool si_shader_binary_read_config(struct si_shader_binary *binary, - struct ac_shader_config *conf); void si_shader_binary_clean(struct si_shader_binary *binary); /* si_shader_nir.c */ -- 2.30.2