From 32a6b7ae09b2b409e3f6f1a82c222c78f9456430 Mon Sep 17 00:00:00 2001 From: Antonino Maniscalco Date: Wed, 25 Jun 2025 20:25:22 +0200 Subject: [PATCH] freedreno/decode: expose lookback as a cli option It is sometimes necessary to exetend the lookback in order to catch `CP_INDIRECT_BUFFER` packets. Expose it as a command line option to facilitate that. Part-of: --- src/freedreno/decode/crashdec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/freedreno/decode/crashdec.c b/src/freedreno/decode/crashdec.c index 7ba5720c206..3b36745cacc 100644 --- a/src/freedreno/decode/crashdec.c +++ b/src/freedreno/decode/crashdec.c @@ -30,6 +30,7 @@ struct rnn *rnn_pipe; static uint64_t fault_iova; static bool has_fault_iova; +static int lookback = 20; struct cffdec_options options = { .draw_filter = -1, @@ -426,7 +427,6 @@ dump_cmdstream(void) * to be less reliable on a4xx and before (pkt0/pkt3), * compared to pkt4/pkt7 with parity bits */ - const int lookback = 20; unsigned rptr = mod_add(rb_rptr, -lookback); for (int idx = 0; idx < lookback; idx++) { @@ -1008,7 +1008,7 @@ main(int argc, char **argv) /* default to read from stdin: */ in = stdin; - while ((c = getopt_long(argc, argv, "acf:hmsv", opts, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "acf:l:hmsv", opts, NULL)) != -1) { switch (c) { case 'a': options.allregs = true; @@ -1019,6 +1019,9 @@ main(int argc, char **argv) case 'f': in = fopen(optarg, "r"); break; + case 'l': + lookback = atoi(optarg); + break; case 'm': options.decode_markers = true; break;