Commit Graph

50 Commits

Author SHA1 Message Date
Connor Abbott 00be8c4619 freedreno: Replace A6XX_IBO with A6XX_TEX_CONST
Since these were reverse-engineered, it's become clear that IBO
descriptors are just a subset of texture descriptors, and bindless reads
of readonly images actually use isam on the IBO descriptor, further
confirming that the two are always compatible, even if not all of the
texture fields exist for IBOs. It's pointless to have a separate type
for IBOs, and just leads to things getting out-of-sync unnecessarily
which has already happened. Just remove it and use TEX_CONST insted.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15114>
2022-02-28 23:33:22 +00:00
Rob Clark fcb3b87553 freedreno/decode: Handle chip-id
For cmdstream traces from newer devices, we need to identify the gpu
based on chip-id.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14564>
2022-01-14 23:17:03 +00:00
Rob Clark 145b0711fc freedreno/crashdec: Basing GMU log decoding
Looks like each entry is four dwords, with the second dword being a
timestamp.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13937>
2021-12-01 17:53:21 +00:00
Rob Clark 8c654d02a3 freedreno/crashdec: Fallback to chip_id for GPU id
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13937>
2021-12-01 17:53:21 +00:00
Rob Clark f33d5256dd freedreno/crashdec: HFI queue decoding
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13937>
2021-12-01 17:53:21 +00:00
Rob Clark 2133d34b11 freedreno/crashdec: Split out mempool decoding
Before we start adding GMU HFI decoding, lets split the other big
section specific decoding (mempool) out into it's own file.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13937>
2021-12-01 17:53:21 +00:00
Emma Anholt a3717c1496 freedreno/cffdump: Handle the TILE_ALL flag in unit test generation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13733>
2021-11-15 22:25:08 +00:00
Emma Anholt e42450a255 freedreno/cffdump: Fix up formatting of texturator unit test script output.
Now I don't need to re-clang-format as I generate testcases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13733>
2021-11-15 22:25:08 +00:00
Emma Anholt 7a6fc25daa freedreno/fdl: Add support for unit testing 3D texture array strides.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13733>
2021-11-15 22:25:08 +00:00
Emma Anholt 0d7c6eedc7 freedreno/cffdump: Fix 64-bit reg decode in script mode.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13733>
2021-11-15 22:25:08 +00:00
Emma Anholt f63fd3425d freedreno: Fix the texturator unit test script.
We no longer have reg defs for the HI fields, so all we can access from
lua is the low 32 bits.  LUA has only double-precision floats for numbers,
so we can't fix that.  However, the high bits are almost always the same,
so it's not that big of a deal to be ignoring them for this script.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13733>
2021-11-15 22:25:08 +00:00
Emma Anholt 85e428f1e0 freedreno/tools: Fix build failure when cffdump isn't built but tests are.
Can't test the tool if we don't build it.  Move the other test definition
next to the tool, too.

Fixes: 82b5c95265 ("freedreno: Move crashdec/cffdec tests to be meson unit tests.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13183>
2021-10-05 00:06:14 +00:00
Emma Anholt 82b5c95265 freedreno: Move crashdec/cffdec tests to be meson unit tests.
Now they run automatically in parallel with other unit testing, rather
than needing a separate script and environment to run them.

Instead of doing shell script filtering afterwards, I just added a little
flag to suppress printing the path name.  Also dropped the "Parsing
<file>" in addition to "Reading <file>" in the tested script, since it's
redundant and baked the path name into the reference.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Eric Anholt 7438ea55c4 freedreno: Reuse u_math.h instead of open coding uif().
Plus the old version had a comment with what conversion was being done
swapped!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Eric Anholt db95dfe252 freedreno: Reuse u_math.h instead of open coding ALIGN/ARRAY_SIZE.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Eric Anholt 21df8b3e08 freedreno: Fix UBSan failures in cffdec's (uint8_t)x << 24
Types <32 bit get promoted to int32_t when you do expressions on them
(thus why (u8)x << 8 works at all), but shifting into the top bit of the
signed int is undefined behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Rob Clark d889f5f282 freedreno/crashdec: Quiet spammy print in query mode
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12489>
2021-08-20 22:01:49 +00:00
Rob Clark dbea4bb970 freedreno/crashdec: Decode full RB in verbose mode
This is useful to get a better view of previous commands in the
ringbuffer.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12489>
2021-08-20 22:01:49 +00:00
Rob Clark ed8d3095ab freedreno/cffdec: Fix gpuaddr comparision
gpuaddrs are 64b, and they can be more than 2^^32 apart.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12489>
2021-08-20 22:01:49 +00:00
Rob Clark 32f13cb9bc freedreno/cffdec: Fix indentation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12489>
2021-08-20 22:01:49 +00:00
Danylo Piliaiev 7faee1430a freedreno: rename Z_TEST_ENABLE->Z_READ_ENABLE, Z_ENABLE->Z_TEST_ENABLE
This makes their interaction with Z_BOUNDS_ENABLE more understandable.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12407>
2021-08-19 10:25:58 +00:00
Connor Abbott d9c90eee8b freedreno: Decode a650+ CP_START_BIN/CP_END_BIN packets
The blob uses them for GMEM renderpasses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12184>
2021-08-17 16:53:40 +00:00
Connor Abbott 2b134a8c0c freedreno/a6xx: Add new register fields
Also use them in drivers and delete some comments that are now
irrelevant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12340>
2021-08-13 08:58:56 +00:00
Danylo Piliaiev a57bcc4394 freedreno/decode: print estimated crash location without colored output
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12302>
2021-08-11 09:24:19 +00:00
Rob Clark 33b9445a68 freedreno: Move pkt parsing helpers to common
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-05-31 23:34:43 +00:00
Rob Clark 45856c5fbc freedreno/decode: Re-indent
clang-format -fallback-style=none --style=file -i src/freedreno/decode/*.[ch]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Connor Abbott ccd7986f59 freedreno/cffdec: Use rb trees for tracking buffers
Gets rid of the arbitrary size limitation, and should make decoding
faster with many buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8838>
2021-03-08 15:18:47 +00:00
Jonathan Marek b94c652afe freedreno/a6xx: always use reg64 for address registers (no LO/HI)
Reduce noise in a6xx.xml by removing LO/HI versions of address registers.

Also fix type="address" registers in register packing (use bit size instead
of checking for "waddress" to use qword)

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Rob Clark ff61e9b54d freedreno/decode: Fix overflow
CP_SET_DRAW_STATE state-groups count as a 4th level of IB.  Fixes a
crash seen on 32b/arm builds of crashdec.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8842>
2021-02-03 18:35:38 +00:00
Rob Clark 1a8113fdee freedreno/ir3/decode: Switch over to new disasm
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7997>
2021-01-13 18:32:48 +00:00
Eric Anholt 91c5bbc128 freedreno/cffdec: Fix format overflow warning.
../src/freedreno/decode/cffdec.c: In function ‘reg_disasm_gpuaddr’:
../src/freedreno/decode/cffdec.c:404:29: error: ‘sprintf’ writing a
terminating nul past the end of the destination [-Werror=format-overflow=]
  404 |   sprintf(filename, "%04d.%s", n++, ext);
../src/freedreno/decode/cffdec.c:404:3: note: ‘sprintf’ output between
9 and 16 bytes into a destination of size 8
  404 |   sprintf(filename, "%04d.%s", n++, ext);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Jonathan Marek 535fd6d45e freedreno/cffdec: fix decoding of bindless descriptors
Add ADDR suffix so that regbase() doesn't fail and return 0.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6968>
2020-10-02 00:48:59 +00:00
Vinson Lee e607477d7c freedreno: Check file descriptor before write.
Fix defect reported by Coverity Scan.

Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: fd is passed to a parameter that cannot be
negative.

Fixes: 1ea4ef0d3b ("freedreno: slurp in decode tools")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6696>
2020-09-14 22:38:47 +00:00
Eric Anholt 14131ed308 freedreno/cffdec: Add support for texturator's 2DMS layout setup.
We can't initialize our MSAA texture with glTexImage2D(), so we have to do
a draw to get its slice's layout into the cmdstream.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6589>
2020-09-10 00:11:46 +00:00
Eric Anholt 2f39727cc6 freedreno/cffdec: Fix up texturator parsing scripts for XML changes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6589>
2020-09-10 00:11:46 +00:00
Vinson Lee 587969154f freedreno: Fix file descriptor leak.
Fix defects reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle.

Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: fd is passed to a parameter that cannot be negative.

Fixes: 1ea4ef0d3b ("freedreno: slurp in decode tools")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6642>
2020-09-09 21:56:04 +00:00
Rob Clark 4de027d6bf freedreno/cffdump: add arg to filter by process name
Usueful when you have a cmdstream trace which consists of multiple
different processes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6409>
2020-08-20 19:01:52 +00:00
Rob Clark 3d6e4a201a freedreno/decode: try harder to not crash in disasm
Move the handling for catching asserts when we start decoding garbage
into disasm-a3xx.  This way it can also cover other cases where cffdec
tries to disassemble memory, such as SP_xS_OBJ_START.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>
2020-08-11 03:13:42 +00:00
Rob Clark cbfce486f2 freedreno/crashdec: handle section name typos
The fixes tag isn't so much because it was incorrect before, but because
I'm going to send a kernel patch to fix the typo, and that will break
old crashdec.

Fixes: 1ea4ef0d3b ("freedreno: slurp in decode tools")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>
2020-08-11 03:13:42 +00:00
Rob Clark caa107cb8d freedreno/decode: move dependencies up a level
This is mainly for the benefit of automated syncing of changes from mesa
back to envytools, where the same subdir meson.build's are used, but the
toplevel meson.build is different.  In the envytools case, we want these
depenendencies to be required.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6154>
2020-08-03 19:46:49 +00:00
Rob Clark 9c33c53898 freedreno/registers: install gzip'd register database
The decode tools aren't too useful to install without the xml.  But
since libxml2 can read compressed xml, we'll gzip them for installation.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6154>
2020-08-03 19:46:49 +00:00
Connor Abbott 8d0e5e0626 freedreno/cffdec: Stop open-coding enum parsing
Now that rnndec_decode_enum() has been fixed, it does the same thing as
this function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6140>
2020-08-01 17:51:01 +00:00
Rob Clark b9391c1d50 freedreno/decode: cffdec warnings cleanup
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6118>
2020-07-29 19:32:51 +00:00
Rob Clark 751af16e1d freedreno/tools: check rnn parse status
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-29 14:30:35 +00:00
Connor Abbott 85e4305235 freedreno/cffdec: Handle CP_DRAW_INDIRECT_MULTI like other draws
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6104>
2020-07-29 10:51:28 +00:00
Rob Clark 18bc5a81a7 freedreno: deduplicate a2xx disasm
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28 09:45:08 +00:00
Rob Clark f7bd3456d7 freedreno: deduplicate a3xx+ disasm
Merge the extra tracking that is useful for generating stats from asm
(as opposed to ir), and for guestimating things like inputs and outputs
(mostly useful for r/e) into ir3's version and drop cffdec's version.

There is a small change in disasm output for the decode tools, in that
it no longer prints the used consts, but rather just the max accessed
const.  This is the more useful piece of information, and avoids making
the shared regmask type big enough to deal with the const reg file.
Additional error checking for invalid regids causes crashdec to bail
out sooner when decoding memory that *might* hold valid instructions.
Also, crashdec no longer prints stats, because stats aren't very useful
when trying to decode random instruction memory (which might or might
not be valid instructions).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28 09:45:08 +00:00
Rob Clark 6b379a4cb4 freedreno: drop shader_t
When this code was outside of the mesa tree, we needed our own enum.
Now we can use a common one, to simplify deduplicating the disasm
code.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28 09:45:08 +00:00
Rob Clark 5125b4bc69 freedreno/decode: warnings cleanup
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28 09:45:08 +00:00
Rob Clark 1ea4ef0d3b freedreno: slurp in decode tools
cffdump, crashdec, etc

At this point there is some duplication with other files in-tree (ie.
a2xx and a3xx+ disassembly), which will be cleaned up in a later commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28 09:45:08 +00:00