From fa9ac826bec4125a0e6f54ba4b4a22132b2ed799 Mon Sep 17 00:00:00 2001 From: Karmjit Mahil Date: Mon, 27 Oct 2025 14:18:34 +0000 Subject: [PATCH] freedreno/decode: Add some code to the already present generate-rd Add some code so that people don't get confused when debugging a fault and the fault doesn't appear since they forgot to update the generate-rd. This should also help catch any build issues earlier on. Signed-off-by: Karmjit Mahil Part-of: --- src/freedreno/decode/generate-rd.cc | 10 +++++++++- src/freedreno/decode/meson.build | 3 ++- src/freedreno/decode/rdcompiler-utils.h | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/freedreno/decode/generate-rd.cc b/src/freedreno/decode/generate-rd.cc index 89c144fbe56..0667353f6a1 100644 --- a/src/freedreno/decode/generate-rd.cc +++ b/src/freedreno/decode/generate-rd.cc @@ -1,7 +1,15 @@ /* This is a placeholder file that should be replaced with the contents * generated by the rddecompiler from a trace file. */ +#include "util/macros.h" +#include "decode/rdcompiler-utils.h" int main(int argc, char **argv) { + UNREACHABLE("you forgot to update generate-rd.cc"); + + (void)replay_context_init; + (void)replay_context_finish; + (void)pkt4; + return 1; -} \ No newline at end of file +} diff --git a/src/freedreno/decode/meson.build b/src/freedreno/decode/meson.build index c43058e35b1..b672d43caae 100644 --- a/src/freedreno/decode/meson.build +++ b/src/freedreno/decode/meson.build @@ -141,7 +141,8 @@ if dep_libarchive.found() generate_rd = executable( 'generate_rd', [ - 'generate-rd.cc' + 'generate-rd.cc', + freedreno_xml_header_files, ], include_directories: [ inc_freedreno, diff --git a/src/freedreno/decode/rdcompiler-utils.h b/src/freedreno/decode/rdcompiler-utils.h index 575758f29e0..589327ff212 100644 --- a/src/freedreno/decode/rdcompiler-utils.h +++ b/src/freedreno/decode/rdcompiler-utils.h @@ -16,6 +16,7 @@ #include "util/u_math.h" +#include "freedreno_pm4.h" #include "fd6_hw.h" #include "ir3/ir3_assembler.h" @@ -300,7 +301,7 @@ replay_context_finish(struct replay_context *ctx) fclose(out); } -static void +UNUSED static void upload_shader(struct replay_context *ctx, uint64_t id, const char *source) { FILE *in = fmemopen((void *)source, strlen(source), "r"); @@ -321,7 +322,7 @@ upload_shader(struct replay_context *ctx, uint64_t id, const char *source) _mesa_hash_table_u64_insert(ctx->compiled_shaders, id, shader_iova); } -static void +UNUSED static void emit_shader_iova(struct replay_context *ctx, struct cmdstream *cs, uint64_t id) { uint64_t *shader_iova = (uint64_t *)