Commit Graph

3591 Commits

Author SHA1 Message Date
Emma Anholt 8ffb48c90a tu: Only emit FS output regs for as many MRTs as we have (but at least 1).
This seems to be what the blob does, should save a bit of CP overhead.
zink drawoverhead throughput on test 7 (shader change) +0.234668% +/-
0.148818% (n=25).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17932>
2022-08-22 22:26:29 +00:00
Emma Anholt 374d1ce491 tu: Only emit as many VPC interp/repl regs as will be referenced.
Saves a bit of CP overhead on pipeline switch.  Improves zink drawoverhead
-test 7 (shader program change) throughput by 1.10825% +/- 0.131485%
(n=10).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17932>
2022-08-22 22:26:29 +00:00
Emma Anholt 29d725a8aa tu: Only emit as many bindless regs as we have seen descriptor sets.
Cuts 12 dwords of CS per draw in vk-5-normal's main renderpass.

zink drawoverhead -test 9 (1 texture change) throughput +0.898636% +/-
0.212647% (n=30).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17932>
2022-08-22 22:26:28 +00:00
Chia-I Wu e8bb418b1c turnip: trim down bo size of tu_descriptor_pool
Dynamic descriptors does not take up bo space.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18152>
2022-08-22 21:08:57 +00:00
Chia-I Wu 2da46db9b2 turnip: trim down host size of tu_descriptor_pool
There is no tu_bo array in tu_descriptor_set since bea6290ca0 ("turnip:
device global bo list").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18152>
2022-08-22 21:08:57 +00:00
Chia-I Wu 9fd66f0cae turnip: pCreateInfo->pPoolSizes[i] is wordy
pool_size is shorter.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18152>
2022-08-22 21:08:57 +00:00
Connor Abbott dcfbb60392 ir3/spill: Fix extracting from a vector at the end of a block
If this happens then "after" is NULL, so we can't use it to get the
block, and the instruction is never moved at the end so we have to
create the split instructions before creating the collect to make sure
they are in the right order.

This happens when reloading a complex vector value that has been
coalesced at the end of a basic block, which apparently hasn't happened
until a gfxbench5 shader on zink hit this case. This fixes it.

Closes: #7054
Fixes: 613eaac7b5 ("ir3: Initial support for spilling non-shared registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18082>
2022-08-22 20:48:05 +00:00
Danylo Piliaiev c20139c292 tu: Enable bufferDeviceAddressCaptureReplay
Now that we are able to set iova from userspace we could support
the replay feature of BDA.

In order to prevent address clashing between ordinary allocations
and replayable ones we allocate:
- ordinary allocations - from the lowest address;
- replayable allocations - from the highest address.

Passes: dEQP-VK.binding_model.buffer_device_address.*replay*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15676>
2022-08-22 18:05:46 +03:00
Danylo Piliaiev e23c4fbd9b tu: Switch to userspace iova allocations if kernel supports it
With MSM_INFO_SET_IOVA it's now possible for userspace to manually
set iova instead of relying on kernel.

In preparation to support bufferDeviceAddressCaptureReplay.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15676>
2022-08-22 18:05:46 +03:00
Eric Engestrom 3743ea0fad meson: drop duplicate `lib` in lib name
The default lib prefix is `lib`, so adding `lib` to the lib name just
results in `liblibbroadcom_v3d.a` for instance.

Those are internal, build-temporary static libraries that end up being
linked into the real user-visible libraries, so it doesn't really
matter, but we might as well just clean up their names anyway.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18171>
2022-08-22 08:35:41 +00:00
Danylo Piliaiev 1635ad0322 tu: Assert that if draw state is enabled it has valid iova
GPU faults at draw state loading completely could completely bring
down the board. (Happened on HDK888)

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18149>
2022-08-21 15:42:22 +00:00
David Heidelberg d6b61fcf60 ci: traces: update freedreno and broadcom to brotli compressed traces
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18156>
2022-08-20 09:42:28 +00:00
Matt Turner 67808a69c6 freedreno/ir3: Use nir_opt_idiv_const
Notably reduces the number of instructions in manhattan31/377 by 101:

instructions helped:   shaders/closed/android/gfxbench/manhattan31/377.shader_test CL: 1700 -> 1599 (-5.94%)

total instructions in shared programs: 1713536 -> 1713313 (-0.01%)
instructions in affected programs: 7635 -> 7412 (-2.92%)
helped: 12
HURT: 9

total nops in shared programs: 377253 -> 377188 (-0.02%)
nops in affected programs: 3170 -> 3105 (-2.05%)
helped: 13
HURT: 8

total non-nops in shared programs: 1336283 -> 1336125 (-0.01%)
non-nops in affected programs: 3134 -> 2976 (-5.04%)
helped: 12
HURT: 4

total mov in shared programs: 66642 -> 66641 (<.01%)
mov in affected programs: 145 -> 144 (-0.69%)
helped: 1
HURT: 4

total cov in shared programs: 20215 -> 20223 (0.04%)
cov in affected programs: 64 -> 72 (12.50%)
helped: 0
HURT: 8

total dwords in shared programs: 3650282 -> 3649876 (-0.01%)
dwords in affected programs: 11222 -> 10816 (-3.62%)
helped: 12
HURT: 0

total constlen in shared programs: 246636 -> 246656 (<.01%)
constlen in affected programs: 72 -> 92 (27.78%)
helped: 0
HURT: 5

total cat0 in shared programs: 411874 -> 411809 (-0.02%)
cat0 in affected programs: 3414 -> 3349 (-1.90%)
helped: 13
HURT: 8

total cat1 in shared programs: 87109 -> 87116 (<.01%)
cat1 in affected programs: 398 -> 405 (1.76%)
helped: 1
HURT: 12

total cat2 in shared programs: 797105 -> 797030 (<.01%)
cat2 in affected programs: 1619 -> 1544 (-4.63%)
helped: 12
HURT: 0

total cat3 in shared programs: 348412 -> 348322 (-0.03%)
cat3 in affected programs: 404 -> 314 (-22.28%)
helped: 12
HURT: 0

total sstall in shared programs: 133300 -> 133302 (<.01%)
sstall in affected programs: 73 -> 75 (2.74%)
helped: 0
HURT: 1

total (ss) in shared programs: 36137 -> 36139 (<.01%)
(ss) in affected programs: 54 -> 56 (3.70%)
helped: 0
HURT: 2

total systall in shared programs: 323494 -> 323624 (0.04%)
systall in affected programs: 1591 -> 1721 (8.17%)
helped: 4
HURT: 2

total (sy) in shared programs: 14306 -> 14308 (0.01%)
(sy) in affected programs: 46 -> 48 (4.35%)
helped: 0

HURT: 2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18085>
2022-08-20 00:13:21 +00:00
Matt Turner 75739aced3 freedreno/ir3: Don't use the broken idiv lowering
This hurts, but we really can't tolerate incorrect results.

Notably hurts manhattan31/377 (but half of the damage is handled by the
next commit).

instructions HURT:   shaders/closed/android/gfxbench/manhattan31/377.shader_test CL: 1509 -> 1700 (12.66%)

total instructions in shared programs: 1674990 -> 1713536 (2.30%)
instructions in affected programs: 205016 -> 243562 (18.80%)
helped: 10
HURT: 357

total nops in shared programs: 370499 -> 377253 (1.82%)
nops in affected programs: 54465 -> 61219 (12.40%)
helped: 74
HURT: 289

total non-nops in shared programs: 1304491 -> 1336283 (2.44%)
non-nops in affected programs: 147087 -> 178879 (21.61%)
helped: 5
HURT: 348

total mov in shared programs: 64188 -> 66642 (3.82%)
mov in affected programs: 5667 -> 8121 (43.30%)
helped: 5
HURT: 346

total cov in shared programs: 23603 -> 20215 (-14.35%)
cov in affected programs: 9274 -> 5886 (-36.53%)
helped: 347
HURT: 0

total dwords in shared programs: 3385438 -> 3650282 (7.82%)
dwords in affected programs: 630672 -> 895516 (41.99%)
helped: 0
HURT: 690

total full in shared programs: 93112 -> 93127 (0.02%)
full in affected programs: 390 -> 405 (3.85%)
helped: 10
HURT: 22

total constlen in shared programs: 245400 -> 246636 (0.50%)
constlen in affected programs: 19504 -> 20740 (6.34%)
helped: 0
HURT: 309

total cat0 in shared programs: 405120 -> 411874 (1.67%)
cat0 in affected programs: 57075 -> 63829 (11.83%)
helped: 74
HURT: 289

total cat1 in shared programs: 87987 -> 87109 (-1.00%)
cat1 in affected programs: 13032 -> 12154 (-6.74%)
helped: 282
HURT: 17

total cat2 in shared programs: 775647 -> 797105 (2.77%)
cat2 in affected programs: 106737 -> 128195 (20.10%)
helped: 0
HURT: 347

total cat3 in shared programs: 337200 -> 348412 (3.33%)
cat3 in affected programs: 17551 -> 28763 (63.88%)
helped: 0
HURT: 347

total sstall in shared programs: 133312 -> 133300 (<.01%)
sstall in affected programs: 85 -> 73 (-14.12%)
helped: 1
HURT: 0

total (ss) in shared programs: 36146 -> 36137 (-0.02%)
(ss) in affected programs: 345 -> 336 (-2.61%)
helped: 20
HURT: 11

total systall in shared programs: 323432 -> 323494 (0.02%)
systall in affected programs: 2762 -> 2824 (2.24%)
helped: 11
HURT: 15

total (sy) in shared programs: 14301 -> 14306 (0.03%)
(sy) in affected programs: 54 -> 59 (9.26%)
helped: 0
HURT: 4

Total CPU time (seconds): 0 -> 0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18085>
2022-08-20 00:13:21 +00:00
Chia-I Wu 0c6fbfca0c turnip: lower the queue priority to 1
To match the default priority of the gallium driver.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18093>
2022-08-19 17:51:43 +00:00
Chia-I Wu c625d99403 freedreno/pps: improve interaction with turnip
turnip uses priority 0.  pps should too (actually, it makes sense to do
so regardless of what turnip does).

turnip is not expected to starve pps, but it does with drm-next for
5.20.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18093>
2022-08-19 17:51:43 +00:00
Rob Clark bacb04ef62 freedreno/drm/virtio: Add some atrace
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18111>
2022-08-17 21:17:17 +00:00
Rob Clark 2d0d867935 freedreno/drm: Avoid lock in fd_pipe_del()
If we aren't dropping the last refcnt we don't need the lock.  This
avoids contention between retire-queue against others.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18111>
2022-08-17 21:17:17 +00:00
Mark Collins f649233896 tu: Implement VK_EXT_non_seamless_cube_map
Passes CTS tests: dEQP-VK.texture.*non_seamless_*

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18079>
2022-08-17 16:56:54 +00:00
Danylo Piliaiev c45fded26b tu: Disable LRZ write when alpha-to-coverage is enabled
Alpha-to-coverage acts like discard and happens after FS ends,
so like with discard LRZ write should be disabled.
With discard we don't know at the moment of binning whether
fragment would be not discarded, so we cannot write its depth to LRZ.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6876

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18083>
2022-08-17 05:21:46 +00:00
Yusuf Khan 73931afc60 tu: remove tu_syncobj_to_fd
It isnt used anymore, last used in tu_wsi_display.c which doesnt
exist anymore.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17927>
2022-08-17 02:01:39 +00:00
Emma Anholt 8116839db9 ir3: Suppress disasm of internal shaders unless IR3_SHADER_DEBUG=internal.
When you're debugging some deqp test or app, it's irritating to page
through 8 MRT clear shaders in turnip to get to what you're looking for.
Use the info.internal flag to suppress those shaders.  (but if you want to
IR3_SHADER_DEBUG=internal, then yeah, print them all).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18002>
2022-08-17 00:04:08 +00:00
PixelyIon 5e8916c0bf tu: Make KGSL wait IOCTLs interrupt-safe
`tu_WaitForFences` and `tu_GetFenceStatus` ended up using `ioctl` instead of
`safe_ioctl` and as a result were responsible for handling `EAGAIN`/`EINTR`
but they weren't handled correctly in wait calls which led to dropping the
wait if the thread received a signal without automatic syscall restarting on
release builds and an assertion due to `errorno` being `EINTR` on debug
builds.

This fixes early wait returns which would lead to UB or cause crashes due to
hitting debug assertions in Skyline Emulator.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18031>
2022-08-16 10:06:32 +00:00
Chia-I Wu 4f143a691a turnip: handle fence wrapping in autotune
fence values can be 0 after wrapping.  We should not treat 0 specially.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18040>
2022-08-15 19:44:37 +00:00
Chia-I Wu e40eae2ea9 turnip: remove unused member in tu_submission_data
buffers_count is set but unused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18040>
2022-08-15 19:44:37 +00:00
Chia-I Wu b8a916fd0c turnip: fix a use-after-free in autotune
When removing old histories, check against gpu fence.  Otherwise,
pending_results could have dangling pointers to the removed histories.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7055
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18040>
2022-08-15 19:44:37 +00:00
Mike Blumenkrantz d49586cfae zink: support emulating alpha formats using new border color quirk
this works for texturing only because swizzles can be used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17687>
2022-08-12 14:24:52 +00:00
Konstantin Kharlamov 91362340f3 meson: remove source_root() call in nir compiler path
source_root function is deprecated in Meson version 0.56.0, so let's use
instead a current_source_dir() function, available in all Meson
versions. This also allows to deduplicate some code by declaring
commonly used string at the top meson.build file.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>
2022-08-12 13:11:03 +00:00
Pierre-Eric Pelloux-Prayer 70891edd97 nir: add a nir_opt_if_options enum
And don't enable nir_opt_if_optimize_phi_true_false on radeonsi with
LLVM 14 because it crashes Blender.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6976
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17949>
2022-08-10 12:55:39 +00:00
Emma Anholt 23a2698e75 ci/tu+zink: Re-enable the traces that were asserting about UBWC compatibility.
The tu and zink fixes have made them work now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
2022-08-09 18:15:45 +00:00
Emma Anholt 149d4e4b6d tu: Use the format list to decide whether we can do UBWC with MUTABLE.
The goal here is to allow zink and ANGLE to switch sRGB on and off, but
keep UBWC enabled for most textures.

This doesn't quite work yet for zink on gbm, where zink asks the device if
it supports a UBWC-modifier image with unorm+sRGB mutable formats (yes),
but then doesn't pass the unorm+sRGB format list to vkImageCreate(), which
then asserts because it couldn't make a general
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT UBWC image.

The format list here comes from Danylo's testing in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17278#note_1447812

Reduces frame times in Genshin Impact GLES AoV 2.02063% +/- 0.207575% (n=5)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
2022-08-09 18:15:45 +00:00
Emma Anholt f6bd494cfa tu: Treat viewFormatCount==0 as no format list.
"If viewFormatCount is zero, pViewFormats is ignored and the image is
 created as if the VkImageFormatListCreateInfo structure were not included
 in the pNext chain of VkImageCreateInfo."

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
2022-08-09 18:15:45 +00:00
Emma Anholt 41280ba289 tu: Move the vkCreateImage format list checks to helper functions.
Mixing up the two checks made them both harder to read.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
2022-08-09 18:15:45 +00:00
Rob Clark 2bc1d08c48 freedreno/drm: Add FD_VA_SIZE param
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17947>
2022-08-08 22:10:24 +00:00
Connor Abbott a7e64ab63c tu: Fix sysmem depth attachment clear flushing
We can't invalidate CCU if there is any dirty data that hasn't been
flushed yet. In the case where we clear depth, we know that the depth
attachment itself isn't dirty but there may be dirty data from other
renderpasses. Therefore we need to flush before invalidating depth.

Fixes: 487aa80 ("tu: Rewrite flushing to use barriers")
Closes: #6987
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17940>
2022-08-08 17:30:00 +00:00
Danylo Piliaiev 293298de65 tu: Flush depth on depth img transition from undef layout
Same logic as in tu_subpass_barrier.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17911>
2022-08-08 13:01:28 +00:00
Guilherme Gallo d4338c9df0 ci/freedreno: skqp: run with new tests files
Settings as flakes tests that passed in the exhaustive run, to keep the
same state as it was before

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17835>
2022-08-08 08:51:24 +00:00
Guilherme Gallo d4dcee7a8a ci/skqp: Remove .baremetal-skqp-test in favor of .skqp-test
Both hidden jobs has the same content, let's reuse it.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17835>
2022-08-08 08:51:24 +00:00
Emma Anholt cbbd9f3402 ci: Upgrade deqp-runner to 0.15.0.
This includes the new timeout fixes so that tests that throw lots of debug
don't delay the timeout triggering, and the fraction vs shuffling behavior
change so that "--fraction 2" doesn't just skip every other test as it
appears in the caselist (every vertex shader variant, for example).

The fraction vs shuffling change does mean we see some different fails on
some drivers now.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17876>
2022-08-07 02:11:46 +00:00
Rob Clark 8b3f2a9e5d freedreno/drm: Fix potential bo cache vs export crash
Keep the list head valid (empty) after allocation from bo cache.  Avoids
a potential later crash in lookup_bo in the following sequence:

1. alloc, bo cache hit
2. export
3. re-import

Cc: mesa-stable
Fixes: f3cc0d2747 ("freedreno: import libdrm_freedreno + redesign submit")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6988
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>
2022-08-05 17:31:55 +00:00
Connor Abbott 7c7feab4e1 tu: Implement VK_EXT_vertex_input_dynamic_state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17554>
2022-08-05 03:22:00 +00:00
Connor Abbott c82af0c43b tu: Decouple vertex input state from shader
Emit VFD_DECODE and VFD_DEST separately, similarly to what Gallium does.
This means we emit a few more VFD_DECODE for binning shaders and when
there are unused attributes, but hopefully the overhead won't be too
much. In exchange we lose one draw state, and in the future we can
pre-compute the dynamic vertex state independently of the shader, so
there should be lower CPU overhead with dynamic vertex inputs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17554>
2022-08-05 03:22:00 +00:00
Emma Anholt 126e83d970 ci/zink: Re-enable a630 zink-on-turnip traces job using gbm as the backend.
This is a workaround for #6753, without having to build and install a
custom xlib in our containers.  Maybe some day debian will have a
backport?

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17549>
2022-08-05 00:23:16 +00:00
Chia-I Wu f0558c6f1c turnip: use SPDX-License-Identifier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 8977913a23 turnip: remove headers from libtu_files
meson can work out the dependencies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 381f234ab8 turnip: remove tu_private.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 5f7538f241 turnip: move away from tu_private.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 46baf86414 turnip: update tu_util.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu e99703b515 turnip: add tu_android.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 8e61bee30c turnip: add tu_cmd_buffer.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 6666ec3945 turnip: add tu_device.h
Also drop unused

 - tu_instance_extension_supported
 - tu_physical_device_api_version
 - tu_physical_device_extension_supported
 - tu_device_submit_deferred_locked
 - tu_get_perftest_option_name

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 9d9bf78565 turnip: update tu_autotune.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 4fc31e4af3 turnip: add tu_wsi.h
Also drop unused x11 and wayland type definitions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 543fac108d turnip: add tu_pass.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 3c607309c9 turnip: add tu_lrz.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 79dd12478f turnip: add tu_dynamic_rendering.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 4f759fddba turnip: add tu_clear_blit.h
Also drop unused tu_emit_load_gmem_attachment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 6430efcab7 turnip: add tu_pipeline.h
Also drop unused tu_pipeline_key.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu ec5bc3d8ff turnip: add tu_shader.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu a7fe90434c turnip: update tu_descriptor_set.h
Also drop unused tu_descriptor_range.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 216f19e62f turnip: add tu_formats.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 095dfcae45 turnip: add tu_image.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 65a5fbcb15 turnip: add tu_query.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 51d416a7e4 turnip: update tu_cs.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 2e337f05ab turnip: add tu_suballoc.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 4d9ac3d0df turnip: add tu_drm.h
Also define tu_syncobj_from_handle only when TU_USE_KGSL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 120469efea turnip: remove includes that are already in tu_common.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:12 +00:00
Chia-I Wu 0312157101 turnip: add tu_common.h as the common header
Move most includes and defines in tu_private.h to the new tu_common.h.

tu_common.h is a header that all other files include, mostly indirectly
through tu_private.h.  The only exceptions are tu_perfetto.h and
tu_tracepoints.h, because ir3 headers are not compatible with C++.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
2022-08-04 00:40:11 +00:00
Emma Anholt fcd96ce002 turnip: Use the GMEM CCU space for attachments when the stores won't.
Since the CCU only gets used for unaligned attachment stores or resolves
with the wrong formats, we can use that space for attachments in many
cases.

This gets two more of vk-5-normal's main renderpass's attachments to fit
in the next gmem_pixels increment, leaving 1 to go.  Other renderpasses do
get better gmem_pixels, and a few get better tile sizes as a result, but
the fps increase from those looks to be <.2% at least.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16921>
2022-08-03 16:54:15 +00:00
Emma Anholt b8a334b547 turnip: Split the tiling config into separate layouts based on CCU usage.
We now choose between two (equal as of this commit) layouts based on
whether the renderpass's stores will use the CCU space, and assert that we
always know the chosen layout when we go using the gmem offsets.

This required making vkCmdClearAttachments in a secondary take the 3D path
instead of gmem blits, since secondaries only have to be compatible with
the primary's renderpass, rather than equal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16921>
2022-08-03 16:54:15 +00:00
Emma Anholt a1db4fcab7 ci/freedreno: Update a630 s8 resolve xfails.
These tests are all only run in a full vk run.  These removed ones were
fixed in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17684
and I'm betting the bypass ones were pre-existing (we hadn't updated 630's
full vk run list for these new stencil tests, I belive -- my previous full
run update was just from one of the two jobs).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16921>
2022-08-03 16:54:15 +00:00
Connor Abbott 19418adfba tu: Restore formatting of tu_clear_blit.c
Conflict resolution appears to have gone awry.  Use my previous resolution
of that rebase instead.

Fixes: 89263fde20 ("tu: Use common vk_image struct")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16921>
2022-08-03 16:54:15 +00:00
Danylo Piliaiev e1c89abd86 ir3: Never remove GS_HEADER_IR3 sysval input
Without GS header geometry shader is never invoked which may cause
issues if it has side-effects.

Fixes GL CTS tests running via Zink:
 KHR-GL46.shader_image_load_store.multiple-uniforms
 KHR-GL46.texture_cube_map_array.image_op_geometry_sh

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6940

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17771>
2022-08-03 10:51:58 +00:00
Danylo Piliaiev ed7814def7 ir3/ra: Always insert interval for precolored inputs
insert_dst checked whether dst is unused, however for precolored
inputs we always want to reserve a reg for them. Input could be
unused only if we explicitly want it.

Suggested-by: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17771>
2022-08-03 10:51:58 +00:00
Rob Clark 3f5d84fb37 freedreno/registers/a6xx: Some reg64 conversion
Reduce the spurious delta from a7xx regs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 73ca381d7a freedreno/registers: Move varset to <enum>
De-noisify the enum values that are generation specific.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 0cd8ce6ce3 freedreno/registers: Allow varset to be specified on enum
It gets a bit repetitive to specify the same varset on each value.  The
rnn decode already handles it when specified on the enum, we just need
to relax the schema to allow this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 98b84ef286 freedreno/registers: Whitespace fix for gen_header.py
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark ba85272cb6 freedreno/ci: Update unit test reference decodes
Apparently we aren't running unit tests in CI?

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 7a62f6e3a3 freedreno/drm: Combine upper and lower 32b of OR val
The original reason it was split was because of libdrm ABI.  But that no
longer applies since we pulled it into mesa.

While we are at it, remove the c++ workaround.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 4490387ea8 freedreno/ir3: Remove unneeded forward declaration
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 8e8b7562c6 freedreno: Extract common helper macros
De-duplicate some macros that had been copy/pasta'd around, etc.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Rob Clark 57c03bdf14 freedreno/a6xx: Remove fd6_format.[ch]
Just use the fdl6 version of the one remaining helper.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
2022-08-02 23:46:15 +00:00
Danylo Piliaiev 18573e4058 tu: WFI after PC_TESSFACTOR_ADDR update
Updating PC_TESSFACTOR_ADDR could race with the next draw which uses it.

Fixes GL CTS tests running via Zink:
 KHR-Single-GL46.enhanced_layouts.glsl_contant_values
 KHR-GLES32.core.tessellation_shader.tessellation_shader_point_mode.point_rendering
 KHR-GLES32.core.tessellation_shader.winding.quads_cw
 KHR-GLES32.core.tessellation_shader.winding.triangles_cw

And probably more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6815

Suggested-by: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17833>
2022-08-02 12:34:34 +00:00
Eli Schwartz 5780ea90c4 meson: add various generated header dependencies as order-only deps
https://mesonbuild.com/FAQ.html#how-do-i-tell-meson-that-my-sources-use-generated-headers

A few locations had underspecified deps on the header files, and this
caused builds to fail given sufficient parallelism.

Fixes #6531

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16659>
2022-07-31 18:10:15 +00:00
Chia-I Wu 6929ccedff turnip: shared_consts and push_consts are mutually exclusive
Skip gather_push_constants when shared consts are enabled.  This makes
sure push_consts is only zero-initialized, and reserved_user_consts is
0.  This saves some space in the const file.

This change also adds a few asserts and a comment to
lower_load_push_constant.  Because shared consts share the same range
for all stages, we should not apply per-stage offsets in
lower_load_push_constant.  It worked because nir_lower_explicit_io
always sets base to 0 for nir_var_mem_push_const and
shader->push_consts.lo was always 0 for all stages.

Fixes: 0c787d57e6 ("tu: increase maxPushConstantsSize to 256.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17777>
2022-07-29 16:22:43 +00:00
Chia-I Wu 562e5ba286 turnip: remove shared_consts from tu_compiled_shaders
It is set but unused.  We also don't serialize/deserialize shared_consts
to/from the pipeline cache.

Fixes: e1f2cabc5e ("turnip: Change to use shared consts for PushConstants")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17777>
2022-07-29 16:22:43 +00:00
Eric Engestrom 438d5baa36 turnip: expose support for VK_EXT_acquire_drm_display
Turnip supports VK_EXT_direct_mode_display and can use the common
implementation of AcquireDrmDisplayEXT() & GetDrmDisplayEXT() (which use
wsi->can_present_on_device() that turnip implements).

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17768>
2022-07-29 07:49:47 +00:00
Eric Engestrom 2c67457e5e util/list: rename LIST_ENTRY() to list_entry()
This follows the Linux kernel convention, and avoids collision with
macOS header macro.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6751
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6840
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17772>
2022-07-28 10:10:44 +00:00
Danylo Piliaiev a9ebf55d02 turnip: Simple breadcrumbs implementation to debug hangs
A simple implementations of breadcrumbs tracking of GPU progress
intended to be the last resort when debugging unrecoverable hangs.
For best results use Vulkan traces to have a predictable place of hang.

Requires compilation with TU_BREADCRUMBS_ENABLED=1. See tu_cs_breadcrumbs.c
for details on how to use this feature.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15452>
2022-07-28 08:48:39 +00:00
Connor Abbott 9b844d7c42 tu: Add debug option to use emulated renderpass support
This should be useful for stress-testing dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott b90d628a7d tu: Use common vk_image_view base struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 89263fde20 tu: Use common vk_image struct
This eliminates some boilerplate, and will be necessary to use the
common render pass implementation for debugging purposes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott cb0f414b2a tu: Add support for suspending and resuming renderpasses
This is unfortunately very complicated because we have to stitch
together the state of the suspended passes after the fact, with primary
command buffers at submit time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 3aa20a4409 tu: Split out some state into a separate struct
These bits of state will have to be treated specially when
suspending/resuming a render pass, because they will need to be tracked
across command buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 9689433eee tu: Update more state with secondaries
Some of these are actually bugfixes, some like the drawcall information
are just for autotune so they are just performance fixes. However this
came from an audit into what state is used in CmdEndRenderPass().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 79c7c6e492 tu: Remove has_subpass_predication
The workaround this was used for was removed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott ed125e6cca tu: Initial support for dynamic rendering
Support for suspend/resume will be added later. This just sets up
the internal render pass, and adds support to pipeline creation and
secondary inheritance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott 22be08a21e tu: Remove usage of RenderPassBeginInfo
More preparation for using this with dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00
Connor Abbott cf391db4c6 tu: Move tu_render_pass definition up
So that we can embed one in tu_cmd_buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
2022-07-27 19:40:44 +00:00