Commit Graph

24 Commits

Author SHA1 Message Date
Emma Anholt b40d070ab9 freedreno: Move the headergen2 test to be meson unit tests.
Now all the freedreno build-time testing is just "meson test -C build"

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt ba9e994034 freedreno/rnndec: Avoid making 0-length variable length arrays.
ubsan hates it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Emma Anholt bd8bfe43fa freedreno/rnndec: Fix use of undefined value_orig in the !ti case.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6360>
2021-10-01 23:16:04 +00:00
Rob Clark 3dff0c30cf freedreno/headergen2: Fix compile warnings with CP_DRAW_INDIRECT_MULTI
Using stripes to deal with the different packet layout variants resulted
in redefining "register" offsets with different values, so use "prefix"
to add a suffix to disambiguate.

  drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h:1066: warning: "REG_A6XX_CP_DRAW_INDIRECT_MULTI_INDIRECT" redefined
   1066 | #define REG_A6XX_CP_DRAW_INDIRECT_MULTI_INDIRECT  0x00000006
        |
  drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h:1057: note: this is the location of the previous definition
   1057 | #define REG_A6XX_CP_DRAW_INDIRECT_MULTI_INDIRECT  0x00000003
        |

(Admittedly it isn't really a "prefix" but that was the field in the
schema available to use, and REG_INDEXED_CP_DRAW_INDIRECT_MULTI_STRIDE
sounds somewhat more funny.)

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
Michel Dänzer 2928c21eb7 Convert most remaining free-form fall-through comments to FALLTHROUGH
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is
explicitly disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15 16:01:22 +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 53f7d539cd util: Add helgrind support for simple_mtx
Annoyingly mtypes.h pulls in simple_mtx, which means we end up needing
to sprinkle a lot of idep_mesautil around.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3773
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7644>
2020-11-24 21:03:34 +00:00
Marek Olšák b42c6ff6f6 util: remove util_float_to_half and util_half_to_float wrappers
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6987>
2020-10-06 21:07:07 -04:00
Matt Turner 1aac47db69 Revert F16C series (MR 6774)
This reverts commit 4fb2eddfdf.
This reverts commit 7a1deb16f8.
This reverts commit 2b6a172343.
This reverts commit 5af81393e4.
This reverts commit 87900afe5b.

A couple of problems were discovered after this series was merged that
cause breakage in different configurations:

   (1) It seems that using -mf16c also enables AVX, leading to SIGILL on
   platforms that do not support AVX.
   (2) Since clang only warns about unknown flags, and as I understand
   it Meson's handling in cc.has_argument() is broken, the F16C code is
   wrongly enabled when clang is used, even for example on ARM, leading
   to a compilation error.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3583
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6969>
2020-10-01 21:08:12 +00:00
Marek Olšák 2b6a172343 util: remove util_float_to_half and util_half_to_float wrappers
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Rob Clark 24f55eb6e8 freedreno/rnn: rework RNN_DEF_PATH construction
No need for rnn_path.h, just construct the whole thing in meson and pass
via c_args.  Also move where the path is constructed up one level.  This
will be needed for syncing back to envytools, where the path will be
different.

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 bf425b7e51 freedreno/rnn: also look for .xml.gz
libxml2 can load gzip compressed files, so lets look for these too.
This will be useful for installing the register database so that an
installed cffdump/crashdec can use them.  But it isn't too useful
to be able to edit the installed register database, so we can gzip
them to use less disk space.

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 73241ca53e freedreno/rnn: Make rnn_decode_enum() respect variants
We'll need this for afuc, and we're currently also open-coding the same
thing in rnnutils. It seems this function was added to decode pm4 packet
names, but it currently has no users, so make it useful for what it
was intended to do.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6140>
2020-08-01 17:51:01 +00:00
Rob Clark 20e703b7e6 freedreno/rnn: headergen2 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 aa89693c02 freedreno/rnn: add schema validation
Now that all the schema validation issues are fixed, enable xml
validation according to stylesheet in rnn.

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
Rob Clark 0586238036 freedreno/rnn: fix use-group
The schema describes the attribute as "ref" rather than "name".  Which
makes more sense.

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
Rob Clark 14a7ca577f freedreno/rnn: allow name to be optional in arrays
We are using unnamed arrays to describe repeating portions of a pm4
packet.  So allow the name to be optional.  Instead of just using
the empty-string hack, drop the attribute.

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
Rob Clark 61ae65a73d freedreno/rnn: add relaxed boolean type
In the schema, boolean means strictly "true" or "false".  But rnn
parsing code was looking for "yes"/"1"/"no"/"0".  So split the
difference, and add a relaxed boolean type, and update rnn to also
accept "true" or "false".

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
Rob Clark 5a8d19ca14 freedreno/rnn: add error helper
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
Rob Clark 3a910839ba freedreno/rnn: split out helper to find files
So we can re-use it to locate the schema file.

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 4b940532fb freedreno/rnn: Support stripes in rnndec_decodereg
We'll need this for finding where INDIRECT/STRIDE are in
CP_DRAW_INDIRECT_MULTI, since they are in different locations in each
variant.

This is tricky because we need to bubble up success/failure to the upper
levels, and 0 could be a valid offset if the stripe is inside an array
or in a packet. Hence we refactor tryreg to return success/failure
separately, although I stopped short of modifying rnndec_decodereg
itself.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6104>
2020-07-29 10:51:28 +00:00
Connor Abbott 0f9131d096 freedreno/rnn: Return success when parsing addvariant
This was missed when I initially added addvariant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6070>
2020-07-28 09:45:08 +00:00
Rob Clark cbbaafdf72 freedreno/rnn: 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 7c0bd8429f freedreno: slurp in rnn
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