Commit graph

32494 commits

Author SHA1 Message Date
Mike Blumenkrantz
cce1f22ef3 zink: isolate gfx stage bits when updating shader modules
ensure that we don't overflow the array here

Fixes: b2247a3724 ("zink: add compute programs and pipelines")

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9798>
2021-03-24 12:22:56 +00:00
Mike Blumenkrantz
12dfba1951 zink: unify gfx and compute batches
now that batches aren't limited and flushing is less costly, there's no
reason to keep these separate

the primary changes here are removing the zink_queue enum and collapsing
related arrays which used it as an index, e.g., zink_batch_usage into single
members

remaining future work here will include removing synchronization flushes which
are no longer necessary and (eventually) removing batch params from a number of
functions since there is now only ever a single batch

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9765>
2021-03-24 03:26:20 +00:00
Mike Blumenkrantz
fcf0eab8a0 zink: call clear() instead of reset() for batch states on context destroy
this avoids (future) issues with desync due to long-lived fences which
may not yet have completed at the time the context is destroyed

upcoming changes will not allow resetting uncompleted batch states, so
this avoids any sort of conflict as such changes are introduced

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9765>
2021-03-24 03:26:20 +00:00
Mike Blumenkrantz
e89f674c83 zink: add wrapper to reset batch state structs
this will be useful in the future when we need additional work to handle
resets of states that aren't detected as being "completed"

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9765>
2021-03-24 03:26:20 +00:00
Jesse Natalie
c022c9603d d3d12: Use ID3D12Device9::CreateCommandQueue1 when available
This lets us provide a creator ID, which lets us tag GLOn12 work
and separate it from other D3D12 work on the same singleton device.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3859
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9776>
2021-03-23 22:11:19 +00:00
Eric Anholt
8120871b8d freedreno/a5xx: Switch to using ir3_cache for looking up our VS/FS
Saves the lock/unlock to get the variants for VS/BS/FS programs, gives us
a place we could hang future linked program state, and gives us safe
constlen handling that fixes a couple of our piglits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Eric Anholt
ce36e60b18 freedreno/a4xx: Switch to using ir3_cache for looking up our VS/FS
Saves the lock/unlock to get the variants for VS/BS/FS programs, and gives
us a place we could hang future linked program state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Eric Anholt
b44d52f62b freedreno/a3xx: Switch to using ir3_cache for looking up our VS/FS.
Saves the lock/unlock to get the variants for VS/BS/FS programs, and gives
us a place we could hang future linked program state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Eric Anholt
6941cd5c98 freedreno: Move the ir3 linked shader cache to the context.
The other ir3 backends would love to have it to reduce lookups and to be
able to cache linked-program state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9698>
2021-03-23 19:55:38 +00:00
Mauro Rossi
cd135b877d android: r600/sfn: fix sfn_nir_algebraic.c gen rules
Changelog:
- Correct typo in generator name which is sfn_nir_algebraic.py
- Rename variables for the gen rules according to meson rules
- Align python command and options according to meson rules

Fixes the following building error:

FAILED: ninja: 'external/mesa/src/gallium/drivers/r600/sfn/r600_nir_algebraic.py',
needed by 'out/target/product/x86_64/gen/STATIC_LIBRARIES/libmesa_pipe_r600_intermediates/sfn_nir_algebraic.c',
missing and no known rule to make it

Fixes: 195952786b ("r600/sfn: Add algebraic lowering for fsin and fcos")
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9766>
2021-03-23 20:29:55 +01:00
Erik Faye-Lund
ccb50f8ad3 zink: emit all interpolation modes
It's not just flat-shading that matters in the case of fragment outputs.
Let's play nicely and emit any interpolation mode instead.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9775>
2021-03-23 17:22:09 +00:00
Erik Faye-Lund
80c3a53927 zink: factor out interpolation to helper
We actually need to set all of these for fragment inputs as well, so
let's make a helper for this that we can reuse.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9775>
2021-03-23 17:22:09 +00:00
Mike Blumenkrantz
277ea7a015 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
116811e963 zink: trigger pending clears during flush
this applies all pending fb clears at the time of flush to handle the scenario
of start -> clear() -> flush() properly

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
6d138b5f92 zink: refactor clears a little to track a bitfield of enabled clears on the context
this makes the state of 'are there clears pending?' more accessible

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
a1d03cd031 zink: simplify some queue-related query code
we can collapse these conditionals now that things are more unified

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
01790bfd45 zink: always flag xfb barrier on gfx flush when appropriate
we need this to be set for internal flushes too

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
e7362a9cbd zink: move zink_flush_compute() users to zink_flush_queue()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
fec07a664e zink: rework public batch flush function to be useful again
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>
2021-03-23 17:14:05 +00:00
Mike Blumenkrantz
67b20bff09 zink: relax unreachable() to debug_printf when waiting on batch
I forgot that this was a reachable case pre-tc, but if there's no longer
a record of a batch_id then that just means it completed in the distant
past

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9772>
2021-03-23 12:50:37 -04:00
Mike Blumenkrantz
e6955d440f zink: ci updates
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9607>
2021-03-23 15:55:20 +00:00
Mike Blumenkrantz
9ea9b852a2 zink: emulate PIPE_FORMAT_R8G8B8X8_UNORM
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9607>
2021-03-23 15:55:20 +00:00
Mike Blumenkrantz
3bb138ce3e zink: handle blitting of color formats with ignored alpha channels
for e.g., R8G8B8X8 -> R8G8B8A8, we have to force a u_blitter call in order to use
a sampler which ignores alpha, otherwise we end up with broken rendering

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9607>
2021-03-23 15:55:20 +00:00
Mike Blumenkrantz
fc23ddc22a zink: force PIPE_SWIZZLE_1 for X channels in samplerviews
this is generic handling for RGBX-type formats

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9607>
2021-03-23 15:55:20 +00:00
Mike Blumenkrantz
62ab64c276 zink: fix multisampled shader image load/store
I didn't ever have a driver to test on which could handle multisampled shader
images while writing this, but need to actually pass the sample id here

Fixes: 9cd2aff1a3 ("zink: add handling for all basic image ops in ntv")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9724>
2021-03-23 15:48:14 +00:00
Mike Blumenkrantz
3adc4c41e1 zink: fix spirv image operand ordering
image operands are ordered by their operand's spirv value, meaning that
the availability operands need to go last here

Fixes: 882ab6afb7 ("zink: add spirv builder functions for image ops")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9724>
2021-03-23 15:48:14 +00:00
Mike Blumenkrantz
e696596f86 zink: move batch-tracked resources to fence object
these are effectively managed by the fence, so it makes sense to store
them there

the set is ralloc-allocated, so explicitly destroying it isn't needed

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9753>
2021-03-23 15:29:42 +00:00
Mike Blumenkrantz
a8d925f52e zink: always reset batch states when finding a new one
this is a bit safer

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9753>
2021-03-23 15:29:42 +00:00
Mike Blumenkrantz
d54688f1e8 zink: make batch usage unsetting function public
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9753>
2021-03-23 15:29:42 +00:00
Mike Blumenkrantz
a315e8ce3e zink: move 'batch_id' and 'is_compute' members to fence
prep for future work, no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9753>
2021-03-23 15:29:42 +00:00
Tomeu Vizoso
75951a44ee Revert "CI: Disable Panfrost T760"
The machines should be stable now.

This reverts commit fc2814417e.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9770>
2021-03-23 15:01:53 +00:00
Tomeu Vizoso
573c8196e4 Revert "ci/panfrost: Disable t860/radeonsi testing while the runners are struggling."
Infrastructure should be more stable now.

This reverts commit 0a1c533c6e.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9770>
2021-03-23 15:01:53 +00:00
Tomeu Vizoso
666966969f Revert "ci/panfrost: disable the rest of these jobs temporarily"
Infrastructure should be more stable now.

This reverts commit 806c612131.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9770>
2021-03-23 15:01:53 +00:00
Mike Blumenkrantz
051460b3c9 softpipe: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9741>
2021-03-23 14:44:48 +00:00
Mike Blumenkrantz
11ea1d1777 zink: unify clear color conversion code
at some point this will get fixed to work for format conversions

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9712>
2021-03-23 14:34:19 +00:00
Mike Blumenkrantz
e4e753333b zink: cache transfer maps
vk spec disallows mapping memory regions more than once, but we always
map the full memory range, so we can just refcount and store the pointer
onto the resource object for reuse to avoid issues here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9725>
2021-03-23 14:23:17 +00:00
Mike Blumenkrantz
230748d614 zink: break out buffer mapping part of zink_transfer_map
no functional changes, but this is going to get much more complex in
the near future

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9725>
2021-03-23 14:23:17 +00:00
Eric Anholt
e4e393a65c freedreno/a6xx: Disable sample averaging on depth/stencil resolves.
From the GLES 3.2 spec:

"If the source formats are integer types or stencil values, a single
sample’s value is selected for each pixel. If the source formats are
floating-point or normalized types, the sample values for each pixel are
resolved in an implementation-dependent manner. If the source formats are
depth values, sample values are resolved in an implementation-dependent
manner where the result will be between the minimum and maximum depth
values in the pixel."

For Z24S8 we were doing an average, which would be invalid for the stencil
data, and apparently the CTS didn't catch that.  For Z32F, our averaging
was technically legal, but given the Vulkan spec's requirement of sample 0
support but not sample average support for depth and stencil resolves, it
suggests that our averaging behavior was unusual.  Let's not spend power
on producing surprising results.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9661>
2021-03-22 19:07:08 +00:00
Eric Anholt
431b0ef9ee freedreno/a6xx: Rename the RB_BLIT_INFO.INTEGER field to SAMPLE_0.
As @samuelig found, this is the field for disabling sample averaging and
using sample 0 instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9661>
2021-03-22 19:07:08 +00:00
Kenneth Graunke
a30d091a10 iris: Delete stale comment in iris_lost_context_state
Hasn't been necessary since b338bb70e0.
Caught by Dave Airlie.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9752>
2021-03-22 18:58:27 +00:00
Connor Abbott
50d5ed1e5e freedreno: Report max_waves in shaderdb output
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9498>
2021-03-22 18:03:16 +00:00
Connor Abbott
2ecb9700e8 freedreno: Use threadsize calculated by ir3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9498>
2021-03-22 18:03:16 +00:00
Ilia Mirkin
cf58debf63 nvc0: fix reported driver queries for Pascal and later GPUs
We haven't added the sm/metric info post-GM200. So make sure we don't
report available queries there. Additionally, fix the group retrieval to
take into account that either driver stats or SM stats may not be
available.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9740>
2021-03-22 15:20:45 +00:00
Ilia Mirkin
8604cc8101 nvc0: ensure sufficient push space for indirect data
There may be up to 3 pushbuf data's submitted in this function, make
sure that we allocate enough room for these.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9740>
2021-03-22 15:20:45 +00:00
Ilia Mirkin
ee3920b215 nv50: add appropriate space check before adding new pushbuffer
nouveau_pushbuf_data does not check that there are available pushes in
the current batch. So add a space check for this. Avoids crashes with
the HUD and glxspheres.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9740>
2021-03-22 15:20:45 +00:00
Ilia Mirkin
3e39d059df nv50,nvc0: remove explicit target argument from view creation
Before texture views were supported, this was needed in some cases.
However with texture views (added eons ago), there is now a target
attribute in the template. Use it and remove the explicit argument.

Should help prevent bugs with inconsistencies between the stored
template target and the one that's used to create the view.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9740>
2021-03-22 15:20:45 +00:00
Ilia Mirkin
38371ff628 nv50: initialize target for blit source surfaces
This target is used to determine whether MS scaling factors are to be
uploaded.

Fixes: 1288ac7632 ("nv50: don't try to upload MSAA settings for BUFFER textures")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9740>
2021-03-22 15:20:45 +00:00
Gert Wollny
5942a0f1ac r60/sfn: don't lower scomp
The backend has the corresponding ops.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9452>
2021-03-22 15:19:46 +01:00
Gert Wollny
ca270207bb r600/sfn: lower find_msb variants to find_msb_rev
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9452>
2021-03-22 15:19:46 +01:00
Gert Wollny
befda5ba1b r600/sfn: optimize comp+csel using fused ops
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9452>
2021-03-22 15:19:46 +01:00