Commit graph

32494 commits

Author SHA1 Message Date
Mike Blumenkrantz
11926342e3 zink: also check for device lost reset on flush
if there's a reset callback available, call that instead of cycling

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:59 +00:00
Mike Blumenkrantz
dc5d02ca54 zink: break out queue submit into separate functions
to be used with async submission

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:59 +00:00
Mike Blumenkrantz
38c5e154df zink: move VkQueue to batch object
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:59 +00:00
Mike Blumenkrantz
ef538e50c8 zink: remove zink_fence_init()
contents moved to more correct places

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:59 +00:00
Mike Blumenkrantz
95af27f032 zink: make a local screen pointer in zink_flush
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:59 +00:00
Mike Blumenkrantz
3a344174dc zink: store context to batch state
this will be used for post-flush device resets when device is lost

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:59 +00:00
Mike Blumenkrantz
ba6265a1ff zink: rename init_batch_state to get_batch_state
more sensible, no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
f9ee9c4539 zink: assume fence has already completed if a batch state isn't found
we're not going to be waiting on fences from the future, so if we can't
find a fence then it must have completed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
03946bfcdd zink: explicitly reset a couple more batch state members
no functional changes at this time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
f32079efab zink: add locking for fence resources
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
0ebc13564a zink: split fence finish func
one part of this will be used to handle tc mechanics, the other part is for
internal use

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
4a736677af zink: add function for checking whether a batch is done
this is like wait_on_batch, but without the waiting

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
6eaaaaa542 zink: add locking for batch states
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
c452c82b98 zink: manually invoke cpu detection during screen init
ensure this gets populated before using it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
0731861748 zink: add locking for resource maps
vulkan prohibits multiple maps on a resource, so these have to be locked
down

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Mike Blumenkrantz
e7420c7708 zink: add locking for descriptor pools
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
2021-03-30 15:12:58 +00:00
Marcin Ślusarz
1df3a00dcd iris: disable dynamic VAO fastpath on GFX version 9
Enabling this fast path, while making CPU side simpler
(and thus reducing driver's CPU overhead), forces us to
generate multiple VERTEX_BUFFER_STATE packets pointing to
the same buffer, but with slightly shifted BufferStartingAddress.
This is fine on GFX version >= 11 and < 8, but on version
8 and 9, thanks to internal details of the VF cache, vertex
data from each VERTEX_BUFFER_STATE is cached separately
and this results in a lot of cache misses.

Disabling this fast path restores previous performance levels.

On my SKL GT2 machine this improves performance in:
- GLB27 Egypt offscreen by 37%
- GLB27 TRex offscreen by 22%
- gfxbench5 Manhattan offscreen by 1.75%
- gfxbench5 Manhattan31 offscreen by 1.9%
- gfxbench5 Aztec Ruins high by 2.3%

In Intel performance CI on GFX version 9 it improves performance in:
- gfxbench5 Manhattan offscreen by 1.65%
- gfxbench5 Aztec Ruins normal offscreen by 1.33%

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3277
Fixes: 42842306d3 ("mesa,st/mesa: add a fast path for non-static VAOs")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9857>
2021-03-30 07:32:16 +00:00
Mike Blumenkrantz
84ad0feec5 zink: rework memory_barrier hook
this is a bit more sensible all around without being too much hammer
and not enough nail

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9886>
2021-03-30 04:26:28 +00:00
Mike Blumenkrantz
3047c7c77f zink: rework some includes
descriptors.h requires stuff from context.h and vice versa, so there's
a little redefinition here to work around that

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9883>
2021-03-30 04:11:37 +00:00
Mike Blumenkrantz
5c1ce2edb8 zink: use GENERAL layout for sampler images that are also bound as shader images
we can't have the same image with 2 layouts, so just go with the more global one

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9883>
2021-03-30 04:11:37 +00:00
Mike Blumenkrantz
ed0fedf1c2 zink: simplify some descriptor update function parameters
just removing unused params

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9883>
2021-03-30 04:11:37 +00:00
Mike Blumenkrantz
dd29a7e5b0 zink: move descriptor barrier handling to main update function
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9883>
2021-03-30 04:11:37 +00:00
Mike Blumenkrantz
c7f9dc5891 zink: move update_descriptors & related funcs to zink_descriptors.c
keep zink_draw.c for draw stuff

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9883>
2021-03-30 04:11:37 +00:00
Mike Blumenkrantz
812f7ecb13 zink: rework texture_barrier hook
we can be more precise with this and avoid flushing unnecessarily

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9791>
2021-03-30 00:49:43 +00:00
Icecream95
80b90a0f2b panfrost: Implement panfrost_set_global_binding
This is enough OpenCL support to pass the Piglit test
cl-custom-run-simple-kernel with PAN_MESA_DEBUG=deqp.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9380>
2021-03-29 23:15:48 +00:00
Eric Anholt
0fbf453689 freedreno/a5xx: Use VALIDREG/CONDREG like a6xx do.
Fewer magic numbers and less to diff between the two.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9870>
2021-03-29 21:24:16 +00:00
Eric Anholt
99838513ae freedreno/a5xx: Add support for clip distances and use them for userclip.
A little low-stakes RE effort as I unwind from fighting CI all day.  Comes
from diffing dEQP-VK.clipping.user_defined.clip_distance.vert.* on the
blob and comparing to a6xx behavior.  (My blob doesn't do tess, so if
there are equivalent tess fields for some of these, I didn't find them)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9870>
2021-03-29 21:24:16 +00:00
Gert Wollny
c7039575da r600/sfn: allocate number of VS outputs based on max driver_location
It seems that when the linker optimized the IO it might leave gaps
in the driver output locations, therefore set the size of the output
array based on the highest driver location occupied by a store_output.

Fixes #4520

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9879>
2021-03-29 17:49:28 +00:00
Gert Wollny
00a1521529 r600: Don't advertise support for scaled int16 vertex formats
They are not supported by the hardware.
Fixes:
  dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_32_short3_vec4_dynamic_draw_quads_1
  dEQP-GLES2.functional.vertex_arrays.single_attribute.strides.buffer_0_32_short3_vec4_dynamic_draw_quads_256

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9877>
2021-03-29 17:42:12 +00:00
Gert Wollny
acdf1a1234 r600: don't set an index_bias for indirect draw calls
The indirect draw call already encodes the index bias so that no
additional encoding in the hardware is needed in this case.

This fixes a regression with a number of tests from
   dEQP-GLES31.functional.draw_indirect.random.*

Fixes: c6c532faa8
  "gallium/u_vbuf: use updated pipe_draw_start_count while using draw_vbo"

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9877>
2021-03-29 17:42:12 +00:00
Gert Wollny
2440488677 r600: Fix texture buffer offset alignment
It seems that this has to be 4 (radeonsi also sets this value to 4)

Fixes deqp-gles31:
 functional.texture.texture_buffer.modify.bufferdata.offset_1_alignments
 functional.texture.texture_buffer.modify.bufferdata.offset_7_alignments

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9877>
2021-03-29 17:42:12 +00:00
Erik Faye-Lund
ee14bec09a zink: use pre-populated shader-locations
This is the final step of this little journey, which allows us to no
longer deal with the shader-slot mapping inside the NIR to SPIR-V
translation.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9836>
2021-03-29 15:16:17 +00:00
Erik Faye-Lund
6037f535d3 zink: do not depend on shader_slots_reserved for xfb
This will be helpful in ripping this out later on.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9836>
2021-03-29 15:16:17 +00:00
Erik Faye-Lund
2d98efd323 zink: pre-populate locations in variables
These locations should match what we get out of the pre-existing pass,
and are currently unused. They will be used in a later commit in this
series, but is left like this because this code is fairly fragile.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9836>
2021-03-29 15:16:17 +00:00
Erik Faye-Lund
904b5eb2af zink: handle errors in nir_to_spirv
We already have some appropriate error-handling further down here.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9836>
2021-03-29 15:16:17 +00:00
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
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
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
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