Commit graph

137219 commits

Author SHA1 Message Date
Mauro Rossi
f891c78a14 android: panfrost: Use the blend shader cache attached to the device
pan_blend_shaders.{c,h} files are removed from Makefile.sources
in order to avoid the following building error:

FAILED: out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_pipe_panfrost_intermediates/pan_blend_shaders.o
...
clang: error: no such file or directory: 'external/mesa/src/gallium/drivers/panfrost/pan_blend_shaders.c'
clang: error: no input files

Fixes: 7994929e84 ("panfrost: Use the blend shader cache attached to the device")
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9894>
2021-03-29 15:49:25 +02:00
Danylo Piliaiev
2087168a30 turnip,ir3: account for dispatch group offsets
Fixes tests:
 dEQP-VK.compute.device_group.dispatch_base

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9339>
2021-03-29 14:31:44 +03:00
Lionel Landwerlin
68bfb6ca49 etnaviv/drm: only print out fence error on non timeout
While looking at the traces emitted by chromium, I saw a lot of those
errors. But looking at the value of ns, it is 0, so it's probably just
the application checking whether work is done or not. Not much point
in printing out an error.

v2: check ret value (Christian)
    check both timeout codes (Lionel)

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9875>
2021-03-29 11:54:59 +02:00
Dave Airlie
11d2db17c5 util: rework AMD cpu L3 cache affinity code.
This changes how the L3 cache affinity code works out the affinity
masks. It works better with multi-CPU systems and should also be
capable of handling big/little type situations if they appear in
the future.

It now iterates over all CPU cores, gets the core count for each
CPU, and works out the L3_ID from the physical CPU ID, and
the current cores L3 cache. It then tracks how many L3 caches
it has seen and reallocate the affinity masks for each one.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4496
Fixes: d8ea509965 ("util: completely rewrite and do AMD Zen L3 cache pinning correctly")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9782>
2021-03-29 08:31:09 +00:00
Dave Airlie
f7acdb1d1d st/glthread: allow for invalid L3 cache id.
If we get 0xffffffff consider L3 cache info invalid and
don't continue.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4496
Fixes: d8ea509965 ("util: completely rewrite and do AMD Zen L3 cache pinning correctly")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9782>
2021-03-29 08:31:09 +00:00
Dave Airlie
b03cfad77a llvmpipe: fix cube image size query
The 3rd coord wasn't being handled properly

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9746>
2021-03-29 08:04:59 +00:00
Timothee Chabat
b3ff9a02a4 llvmpipe: increase PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE value
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4237
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9750>
2021-03-29 07:53:21 +00:00
Mike Blumenkrantz
c77fc0b6f4 llvmpipe: stop flattening multidraws
these are now handled in the draw module

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
65ef79be7a aux/draw: pass full draw params to draw_pt_arrays()
multidraw depth maximum: loop directly around the llvmpipe call

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
ce0b1f23c3 aux/draw: track increment_draw_id value from draw info
need this in order to accurately update drawid

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
8b9d454cef aux/draw: move draw param sanitization to end of function
this triggers more work if sanitizing no-ops the draw, but the rest of the
time it won't matter

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
33f832e079 aux/draw: pass the full draw params through to draw_pt_arrays_restart()
multidraw depth 1.5: loop in draw_pt_arrays_restart()

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
3ab15f3901 aux/draw: pass the full draw params through to draw_instances()
multidraw depth 1: loop in draw_instances()

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
3abeb0afe0 aux/draw: rewrite PRIM_RESTART_LOOP macro as a function
this was a bit too intense to work with

no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Mike Blumenkrantz
182c7da6b4 aux/draw: stop copying draw params unnecessarily
resolve_draw_info() is only for drawing from streamout, so this check
can be moved forward to avoid overwriting draw params when not necessary

no functional changes at this time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
2021-03-29 07:37:06 +00:00
Boris Brezillon
7994929e84 panfrost: Use the blend shader cache attached to the device
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9831>
2021-03-29 06:53:50 +00:00
Boris Brezillon
bbff09b952 panfrost: Move the blend shader cache at the device level
So we can re-use it in the Vulkan driver.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9831>
2021-03-29 06:53:50 +00:00
Iago Toral Quiroga
c3c251d98f broadcom/compiler: flag TMU reads with a read dependency on last TMU config
We were using a write dependency to ensure ordering since LDTMUs sequences
are ordered, but by using a write dependency with TMU config we were also
preserving ordering with TMU config writes that are not a sequence
terminator, which is not required and reduces scheduling flexibility.
Instead, use a write dependency to ensure strict ordering of TMU reads,
but only a read depdency with TMU config.

With this change we also need to update CS barriers to also have a write
dependency with TMU reads to ensure that we don't move TMU reads around
CS barriers.

total instructions in shared programs: 13602500 -> 13597851 (-0.03%)
instructions in affected programs: 2681428 -> 2676779 (-0.17%)
helped: 6567
HURT: 4960
Instructions are helped.

total max-temps in shared programs: 2317927 -> 2317914 (<.01%)
max-temps in affected programs: 13861 -> 13848 (-0.09%)
helped: 355
HURT: 300
Inconclusive result (value mean confidence interval includes 0).

total sfu-stalls in shared programs: 32074 -> 32247 (0.54%)
sfu-stalls in affected programs: 848 -> 1021 (20.40%)
helped: 160
HURT: 327
Inconclusive result (%-change mean confidence interval includes 0).

total inst-and-stalls in shared programs: 13634574 -> 13630098 (-0.03%)
inst-and-stalls in affected programs: 2703041 -> 2698565 (-0.17%)
helped: 6558
HURT: 5020
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9856>
2021-03-29 06:21:22 +00:00
Iago Toral Quiroga
cbf9a7c3c1 broadcom/compiler: flag TMU read dependencies against last TMU config
Instead of last TMU write. According to the documentation, the entries
in the output FIFO are pushed with the *final* input write for the
lookup, which is the one terminating the sequence. We flag these
with last_tmu_config.

This will allow us to move all TMU register writes for a lookup except
the last one ahead of the LDTMUs for the previous lookup, possibly
allowing us to pair up these writes the wrtmuc instructions for the
same lookup, turning code like this:

nop                  ; nop               ; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[2].p1 | 0x1)
nop                  ; nop               ; ldunif (ubo[2]+0xe0)
fadd  r4, rf33, rf51 ; mov  unifa, r5    ; ldunif (ubo[2]+0x110)
fmax  rf34, 0, r4    ; nop
nop                  ; mov  tmut, rf11
nop                  ; mov  tmus, rf0

into:

nop                  ; mov  tmut, rf11   ; wrtmuc (tex[0].p0 | 0x3)
nop                  ; nop               ; wrtmuc (tex[2].p1 | 0x1)
nop                  ; nop               ; ldunif (ubo[2]+0xe0)
fadd  r4, rf33, rf51 ; mov  unifa, r5    ; ldunif (ubo[2]+0x110)
fmax  rf34, 0, r4    ; nop
nop                  ; mov  tmus, rf0

total instructions in shared programs: 13648140 -> 13602500 (-0.33%)
instructions in affected programs: 3497402 -> 3451762 (-1.30%)
helped: 12044
HURT: 3484
Instructions are helped.

total max-temps in shared programs: 2318687 -> 2317927 (-0.03%)
max-temps in affected programs: 17234 -> 16474 (-4.41%)
helped: 615
HURT: 198
Max-temps are helped.

total sfu-stalls in shared programs: 32354 -> 32074 (-0.87%)
sfu-stalls in affected programs: 1462 -> 1182 (-19.15%)
helped: 461
HURT: 188
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 13680494 -> 13634574 (-0.34%)
inst-and-stalls in affected programs: 3514405 -> 3468485 (-1.31%)
helped: 12062
HURT: 3486
Inst-and-stalls are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9856>
2021-03-29 06:21:22 +00:00
Mike Blumenkrantz
afc82113d1 lavapipe: refactor indexed draw dispatch to handle multidraws
each indexed direct draw cmd now contains n draws (though right now n=1)

indexed draws now also have a flag used to avoid recalculating start index if
a cmdbuf is submitted multiple times

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9843>
2021-03-29 04:01:57 +00:00
Mike Blumenkrantz
e92931f6c4 lavapipe: refactor base draw dispatch to handle multidraws
each direct draw cmd now contains n draws (though right now n=1)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9843>
2021-03-29 04:01:57 +00:00
Mike Blumenkrantz
a42b2f11cb zink: ci updates
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
c962980725 zink: remove explicit fencing for query results
now that the results are automatically being copied to internal buffers,
mapping the buffers will handle any fencing that's required

the only caveat is that the query still needs to be flushed for a result
to be returned

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
726e2eb8f9 zink: reorder availability handling for (user) qbos
if the shortcut method without a staging buffer fails, falling back
to the staging buffer is more sane than silently failing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
3b5f345e9b zink: don't use PARTIAL bit for query results with time queries
this is illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
70b1251587 zink: bump pools up to 5k queries each
50 is very small and triggers constant stalls; this should probably be
tuned more at some point in the future since even this value is small in
some scenarios

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
93190be1b9 zink: rewrite query internals
this adds internal qbos to each query which record the results of queries incrementally,
meaning that any time we want the result of a query we just have to read the
buffer back

in particular this opens up some possibilities for further optimization, specifically with
actual qbos where we can now pass the internal qbo off to a compute shader to
mimic the check_query_results() handling and avoid having to actually sync or
do a cpu read

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
313407672c zink: remove special casing for occlusion qbos
this seems fine now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
2f81d6fbf0 zink: manually handle more bool query types for copying
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
35b899c2a2 zink: remove flush from query buffer copy
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
a9f6e6d606 zink: create result buffers for all query streams
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
5c25ca55f0 zink: clean up query creation failure paths
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9811>
2021-03-29 02:50:53 +00:00
Mike Blumenkrantz
36f4e61403 zink: rework border color handling
we should be matching the format type here to the underlying surface type
for int/float

also we can avoid using a custom border color if the color can be reduced to
a non-custom color

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9793>
2021-03-29 02:37:14 +00:00
Mike Blumenkrantz
4c9b987146 zink: ralloc shader cache and keys
hash table keys (keybox) are allocated, so we can avoid leaking them by
allocating everything on a single ralloc context

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9794>
2021-03-29 02:28:09 +00:00
Mike Blumenkrantz
00dc0036bb zink: flatten out buffer creation usage flags codepath
GL doesn't know what it's doing, so we just need all the flags all the time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
c96b20970f zink: toggle between linear/optimal tiling during image creation
if we would be creating an unusable image, don't

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
aac88f49e5 zink: check image format props before creating image
ensure that these attrs are viable before failing silently later on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
7edc3f50c1 zink: add color output bit and/or use linear tiling for sampled images
these need to have some way to get data onto them

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
0a0fb85fbe zink: incrementally add image usage flags based on device caps
these should be provided, but if not...

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
69cdb6b776 zink: create separate vk image/buffer objects for shader image use
the STORAGE_TEXEL and STORAGE_IMAGE bits can't be accurately applied due
to opengl allowing all resources to be used everywhere, so instead we can
create a separate object on demand which is used only by shaders and gets
extra barriers inferred along with the base object to avoid desync whenever
it is used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
475c1bda8e zink: break out barrier struct initializing into helper funcs
make this and the no-op handling reusable for future extension

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
86e1e1dafd zink: reorder barrier util functions to set up barrier struct before batch
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
7cee75f143 zink: make descriptor state invalidate public
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
d922850e36 zink: break out image/buffer create info structs into helper funcs
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:57 -04:00
Mike Blumenkrantz
cde60ab179 zink: fix format support detection for storage texel buffers and shader images
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
2021-03-28 22:17:56 -04:00
Mike Blumenkrantz
b741e270cd zink: reset all fences when waiting on batch state
at this point we know all the states are available, so we can shortcut
future state-finding

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
2021-03-29 01:38:09 +00:00
Mike Blumenkrantz
34a2f96f59 zink: stall when we start getting a lot of uncompleted batches
temporary oom handling, though it's unrealistic for this to be hit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
2021-03-29 01:38:09 +00:00
Mike Blumenkrantz
c39295a24b zink: use correct surface ref function for context destroy
the regular surface reference function can never be used in the driver
if it is possible that a surface may be destroyed, as this may reference
a previously-destroyed context

Fixes: 92a5ea13fc ("zink: implement a global framebuffer cache")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9787>
2021-03-29 01:38:09 +00:00
Mike Blumenkrantz
cbe9e95a96 zink: only do shader updates when relevant stages are dirty
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9792>
2021-03-29 01:22:53 +00:00
Mike Blumenkrantz
dfe9bfef9b lavapipe: fix array texture region copies
these need to use different struct members for copying array textures

the buffer2image variants are already doing the right thing

Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9761>
2021-03-28 22:32:05 +00:00