summaryrefslogtreecommitdiff
path: root/src/freedreno/afuc
AgeCommit message (Collapse)AuthorFilesLines
2021-06-02freedreno/afuc: Print uintptr_t with PRIxPTRMatt Turner1-1/+1
Fixes a compilation error on 32-bit. Fixes: bba61cef38b ("freedreno/afuc: Add emulator mode to afuc-disasm") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11118>
2021-05-31freedreno/afuc: Use emulator to extract jmptblRob Clark1-16/+87
This runs through the SQE bootstrap code to extract the packet-table, rather than relying on heuristics. As a bonus, it can detect the start of the LPAC fw in a660+ fw so that we can properly decode the LPAC fw and packet-table. Note that this decodes the jmptable as normal instructions, which is a change in behavior from the previous heuristic based jmptbl extraction. Not sure if that is a good or bad thing. For a5xx, for now the legacy heuristic based jmptable decoding is preserved, at least until enough control regs are figured out. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Add emulator support to run bootstrapRob Clark3-7/+59
Run until the packet-table is populated, so the disassembler can use this to know the offsets of various pm4 packet handlers without having to rely on heuristics. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Split out helpers to parse labels and packet-tableRob Clark1-13/+30
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Extract full gpu-idRob Clark1-7/+15
Some of the a6xx gens will require some control reg initialization, and go into an infinite loop if they don't see the values they expect, so we'll need to extract the compute gpu-id. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Add emulator mode to afuc-disasmRob Clark10-7/+1829
This is an (at least somewhat complete) logical emulator of the a6xx SQE that lets us step through firmware execution (bootstrap, cmdstream pkt handling, etc). It lets us poke at various fw visible state and run through pm4 packet(s) to better understand what the fw is doing when it handles various packets. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Add pipe reg name decodingRob Clark3-16/+76
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Clean up special regsRob Clark3-23/+62
Allow for different mnemonics depending on whether they are used as source or destination register, to better reflect what they do. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Split out utilsRob Clark5-137/+291
With disasm emulator mode, we'll start wanting some things that are duplicationg what the assembler does, so just split out all the rnndb bits into shared utils. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno/afuc: Split out instruction decode helperRob Clark1-400/+406
Split the giant switch/decode out into a helper function so that we can re-use it for emulator mode. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-05-31freedreno: Move pkt parsing helpers to commonRob Clark2-15/+8
I'll be needing these in afuc as well. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10944>
2021-04-17freedreno/afuc: Re-indentRob Clark4-1305/+1336
clang-format -fallback-style=none --style=file -i src/freedreno/afuc/*.[ch] Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-01-06freedreno/afuc: Replace readfile with os_read_file.Vinson Lee1-32/+5
Tested afuc-disasm produced same output. $ ./builddir/src/freedreno/afuc/afuc-disasm -g 6 src/freedreno/.gitlab-ci/reference/afuc_test.fw > /tmp/afuc_test.asm $ diff ./src/freedreno/.gitlab-ci/reference/afuc_test.asm /tmp/afuc_test.asm $ echo $? 0 Suggested-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Vinson Lee <vlee@freedesktop.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8290>
2020-12-02freedreno/afuc: Fix up some sprintf format security warnings.Eric Anholt1-2/+2
Showed up when I tried enabling asan. Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7695>
2020-11-18freedreno: Fix uninitialized var warning in afuc using unreachable().Eric Anholt3-6/+6
Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7664>
2020-10-20freedreno/tools: Fix compiler warnings about using sz in the error paths.Eric Anholt1-1/+3
If we don't check for a NULL str, then sz might be undefined (as was happening in the match_compatible path, and returning 0 makes us not match as we should). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-08-18freedreno/afuc: Install asm/disasmConnor Abbott1-4/+4
Make the name a bit longer, since when installed it's not tucked away under afuc/ anymore. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18freedreno/afuc: Make 0 a valid numberConnor Abbott1-1/+1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18freedreno/afuc: Handle xmov modifiersConnor Abbott6-2/+67
Although it's kind-of similar to "(rptN)" in the shader ISA, I called it "xmov" to make it clear that it's completely orthogonal to "(rep)", although you certainly can use both modifiers on the same instruction. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18freedreno/afuc: Add iretConnor Abbott5-2/+17
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18freedreno/afuc: Handle setsecure opcodeConnor Abbott5-0/+31
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-18freedreno/afuc: Fix printing preemptleave on a5xxConnor Abbott1-2/+3
This opcode is actually used on a5xx, but I'm not sure what it's for. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6368>
2020-08-01freedreno/afuc: Fix PM4 enum parsingConnor Abbott1-16/+7
We were open-coding it, and getting variant parsing wrong for things like "A4XX-" which don't explicitly include the version being disassembled. Use the rnn function instead. This makes CP_INDIRECT show up again. Also propagate const-ness to users. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6140>
2020-08-01freedreno/afuc: Add missing rnn_prepdb()Connor Abbott2-0/+2
It's totally not obvious, but this runs extra error checking and is necessary for correct variant handling, and variant handling will silently not work if it's not enabled. Add it asm.c even though it's not strictly necessary, to prevent anyone from missing this in the future. Missing this really should be an error. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6140>
2020-07-29freedreno/tools: check rnn parse statusRob Clark2-0/+6
Don't silently ignore issues. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>
2020-07-28freedreno/afuc: warnings cleanupRob Clark2-9/+3
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28freedreno: slurp in afucRob Clark9-0/+2694
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>