platform/upstream/mesa.git
2 years agodocs: update lavapipe features and relnotes
Mike Blumenkrantz [Mon, 21 Mar 2022 04:22:08 +0000 (00:22 -0400)]
docs: update lavapipe features and relnotes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15463>

2 years agolavapipe 1.3
Mike Blumenkrantz [Fri, 18 Mar 2022 12:51:44 +0000 (08:51 -0400)]
lavapipe 1.3

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15463>

2 years agolavapipe: add a GetPhysicalDeviceToolPropertiesEXT stub
Mike Blumenkrantz [Fri, 18 Mar 2022 17:25:56 +0000 (13:25 -0400)]
lavapipe: add a GetPhysicalDeviceToolPropertiesEXT stub

when no tools are loaded, this will otherwise crash

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15463>

2 years agolavapipe: EXT_subgroup_size_control
Mike Blumenkrantz [Fri, 11 Mar 2022 16:13:57 +0000 (11:13 -0500)]
lavapipe: EXT_subgroup_size_control

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>

2 years agollvmpipe: fix variable naming insanity in cs generator
Mike Blumenkrantz [Fri, 11 Mar 2022 23:08:38 +0000 (18:08 -0500)]
llvmpipe: fix variable naming insanity in cs generator

in the top part of this function, the x/y/z size variables are used to
represent the loop iterator limits

in the bottom part, they change to represent the loop iterator values

my brain.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>

2 years agollvmpipe: fix subgroup id construction
Mike Blumenkrantz [Fri, 11 Mar 2022 22:03:30 +0000 (17:03 -0500)]
llvmpipe: fix subgroup id construction

the coroutine idx is based on the number of x loops, but the subgroup id
is based on the coroutine's total loops

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>

2 years agollvmpipe: fix gl_NumSubgroups
Mike Blumenkrantz [Fri, 11 Mar 2022 16:10:56 +0000 (11:10 -0500)]
llvmpipe: fix gl_NumSubgroups

this is (x * y * z) / subgroup_size, not num_x_loops

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15354>

2 years agolavapipe: EXT_inline_uniform_block
Mike Blumenkrantz [Fri, 18 Mar 2022 14:00:44 +0000 (10:00 -0400)]
lavapipe: EXT_inline_uniform_block

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: implement EXT_inline_uniform_block
Mike Blumenkrantz [Fri, 18 Mar 2022 13:56:31 +0000 (09:56 -0400)]
lavapipe: implement EXT_inline_uniform_block

this is a lot of machinery to propagate the block sizes down from the
descriptor layout to the pipeline layout to the rendering_state

block data is appended to ubo0 immediately following push constant
data (if it exists), which requires that a new buffer be created and
filled any time either type of data changes

shader handling is done by propagating the offset of each block relative
to the start of its descriptor set, then accumulating the sizes of
every uniform block in each preceding descriptor set into the offset,
then adding on the push constant size, and finally adding that on to
the existing load_ubo deref offset

update-after-bind is no longer an issue since each instance of pc+block
data is its own immutable buffer that can never be modified

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: remove unused struct member
Mike Blumenkrantz [Fri, 18 Mar 2022 13:55:06 +0000 (09:55 -0400)]
lavapipe: remove unused struct member

this was used at some point I think?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: use stream uploader for push constant upload
Mike Blumenkrantz [Fri, 18 Mar 2022 13:50:36 +0000 (09:50 -0400)]
lavapipe: use stream uploader for push constant upload

now instead of having static per-stage buffer regions and letting llvmpipe
do the upload, lavapipe creates a new pipe_resource and chucks it away
with take_ownership=true to allow it to be destroyed once it's no longer
in use

this also alters ubo0 mechanics such that the buffer is now sized exactly to
the size of the push constants in the pipeline and push constants are only
updated when the appropriate shader stage is flagged

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: save pipeline stages that push constants are active on
Mike Blumenkrantz [Fri, 18 Mar 2022 13:48:16 +0000 (09:48 -0400)]
lavapipe: save pipeline stages that push constants are active on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: add a stream uploader to rendering_state and queue objects
Mike Blumenkrantz [Fri, 18 Mar 2022 13:47:26 +0000 (09:47 -0400)]
lavapipe: add a stream uploader to rendering_state and queue objects

not currently used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: zalloc pipeline layout structs
Mike Blumenkrantz [Fri, 18 Mar 2022 13:45:56 +0000 (09:45 -0400)]
lavapipe: zalloc pipeline layout structs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: don't emit compute states during draw
Mike Blumenkrantz [Fri, 18 Mar 2022 02:44:16 +0000 (22:44 -0400)]
lavapipe: don't emit compute states during draw

there's a separate function for this

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15457>

2 years agolavapipe: KHR_shader_terminate_invocation
Mike Blumenkrantz [Mon, 14 Mar 2022 20:25:29 +0000 (16:25 -0400)]
lavapipe: KHR_shader_terminate_invocation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>

2 years agolavapipe: extend demote->discard pass to handle terminate
Mike Blumenkrantz [Mon, 14 Mar 2022 20:25:14 +0000 (16:25 -0400)]
lavapipe: extend demote->discard pass to handle terminate

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>

2 years agolavapipe: EXT_shader_demote_to_helper_invocation
Mike Blumenkrantz [Mon, 14 Mar 2022 19:47:53 +0000 (15:47 -0400)]
lavapipe: EXT_shader_demote_to_helper_invocation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>

2 years agolavapipe: run some shader passes for demote handling
Mike Blumenkrantz [Mon, 14 Mar 2022 19:47:03 +0000 (15:47 -0400)]
lavapipe: run some shader passes for demote handling

pipe internals already support discard, so as long as everything is
rewritten to use discard, we don't need any further changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>

2 years agonir/lower_is_helper_invocation: create load_helper_invocation instr with bitsize=1
Mike Blumenkrantz [Mon, 14 Mar 2022 19:45:17 +0000 (15:45 -0400)]
nir/lower_is_helper_invocation: create load_helper_invocation instr with bitsize=1

the specification stipulates that this is a bool value, so don't load it as an int
or else nir_validate explodes

Fixes: f17b41ab4f0 ("nir: add lowering pass for helperInvocationEXT()")

Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15402>

2 years agozink: handle conversion for vertices statistics query with LINE_LOOP draws
Mike Blumenkrantz [Tue, 8 Mar 2022 22:40:22 +0000 (17:40 -0500)]
zink: handle conversion for vertices statistics query with LINE_LOOP draws

the converted number of vertices is 2x that of the "real" number of vertices,
so divide the results by 2

this works nicely since zink performs cpu readback for all queries, and shader
aggregation should be simple in the future as well

fixes:
KHR-GL46.pipeline_statistics_query_tests_ARB.functional_primitives_vertices_submitted_and_clipping_input_output_primitives

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>

2 years agozink: store vertices statistics query to context
Mike Blumenkrantz [Tue, 8 Mar 2022 22:39:40 +0000 (17:39 -0500)]
zink: store vertices statistics query to context

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15401>

2 years agonouveau: Fix out-of-bounds access in AlgebraicOpt
M Henning [Sun, 20 Mar 2022 04:23:46 +0000 (00:23 -0400)]
nouveau: Fix out-of-bounds access in AlgebraicOpt

for cases where we calculate the absolute value of the result
of a unary operation

We can remove this problematic check since it's redundant with
the one several lines down.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15476>

2 years agonouveau: Handle unaligned tlsBase during spills
M Henning [Sun, 7 Nov 2021 01:33:34 +0000 (21:33 -0400)]
nouveau: Handle unaligned tlsBase during spills

Without this, 128-bit or 64-bit register spills can generate unaligned
loads and stores if tlsBase is unaligned.

Fixes glsl-1.50/execution/variable-indexing/gs-input-array-vec3-index-rd
with NV50_PROG_USE_NIR=1 on kepler

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13693>

2 years agoiris: Fix MOCS for copy regions
Kenneth Graunke [Fri, 4 Mar 2022 07:57:13 +0000 (23:57 -0800)]
iris: Fix MOCS for copy regions

These were, unfortunately, backwards.  The source is the texture.
The destination is the render target.

Fixes: d8cb76211c5 ("iris: Fix MOCS for buffer copies")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15473>

2 years agoir3: set local_size for shaders of MESA_SHADER_KERNEL type
Andrey Konovalov [Thu, 3 Feb 2022 19:30:17 +0000 (19:30 +0000)]
ir3: set local_size for shaders of MESA_SHADER_KERNEL type

ir3_compile_shader_nir() should set local_size[] and local_size_variable
fields not only for compute shaders, but for the OpenCL kernels too.

v2: use gl_shader_stage_is_compute() instead of explicit comparison with
    MESA_SHADER_[COMPUTE,KERNEL].

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14863>

2 years agoci/traces: Make sure we have no pre-existing traces-db before starting.
Emma Anholt [Thu, 17 Mar 2022 22:35:56 +0000 (15:35 -0700)]
ci/traces: Make sure we have no pre-existing traces-db before starting.

bare-metal can reboot boards into an existing rootfs on intermittent
device failure, but traces-db doesn't do any sanity-checking of the local
downloads of traces and would proceed to just trying to replay them.

Nuke any existing trace db so that it re-downloads every time, same as
LAVA or docker container tests do.

Fixes: #5585
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15440>

2 years agolavapipe: fix i686 mingw build
Michel Zou [Fri, 18 Mar 2022 19:07:21 +0000 (20:07 +0100)]
lavapipe: fix i686 mingw build

Fixes: 987e8a5a
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15464>

2 years agolavapipe: zalloc lvp_image_view structs
Mike Blumenkrantz [Tue, 22 Feb 2022 20:26:06 +0000 (15:26 -0500)]
lavapipe: zalloc lvp_image_view structs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>

2 years agolavapipe: break out resolves into separate functions
Mike Blumenkrantz [Fri, 18 Feb 2022 16:55:17 +0000 (11:55 -0500)]
lavapipe: break out resolves into separate functions

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>

2 years agolavapipe: store number of immutable samplers to pipeline layout
Mike Blumenkrantz [Tue, 25 Jan 2022 14:27:22 +0000 (09:27 -0500)]
lavapipe: store number of immutable samplers to pipeline layout

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15462>

2 years agospirv: Properly mangle generic pointers
Jason Ekstrand [Fri, 18 Mar 2022 20:47:50 +0000 (15:47 -0500)]
spirv: Properly mangle generic pointers

Fixes: a8e53a772f61 ("spirv: Add generic pointer support")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15470>

2 years agodocs: update calendar and link releases notes for 21.3.8
Eric Engestrom [Fri, 18 Mar 2022 19:28:14 +0000 (19:28 +0000)]
docs: update calendar and link releases notes for 21.3.8

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15466>

2 years agodocs: add release notes for 21.3.8
Eric Engestrom [Fri, 18 Mar 2022 19:26:42 +0000 (19:26 +0000)]
docs: add release notes for 21.3.8

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15466>

2 years agoci/turnip: Increase the hangcheck timer to 2 seconds.
Emma Anholt [Wed, 16 Mar 2022 22:50:00 +0000 (15:50 -0700)]
ci/turnip: Increase the hangcheck timer to 2 seconds.

We get a lot of useful coverage from running graphicsfuzz with spilling
enabled, but it's also pretty slow and can cause intermittent hangcheck
failures.  I thought I'd categorized them when merging !14839 (device loss
on reset), but it looks like not all of them and we're now more likely to
have flakes take out the whole test run when a single flake makes the rest
of the caselist a flake.

This is a little unfortunate in that it means our test environment is not
the same as a stock system you would want to run deqp on to submit
conformance, but I think it's an improvement in the test maintenance work
vs needing to fix things up later.

We have some other tests besides turnip that can trigger hangchecks which
we might also like this increase for (some disabled traces, for example).
However, freedreno GL has a 5-second timeout waiting for idle when
mapping, and a couple of 2-second timeouts in a row can result in spurious
failures in other tests!

Fixes: #6163
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15435>

2 years agopan/bi: Use bi_dontcare for ZS_EMIT
Alyssa Rosenzweig [Sun, 13 Mar 2022 23:59:58 +0000 (19:59 -0400)]
pan/bi: Use bi_dontcare for ZS_EMIT

This is more portable and avoids special casing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Emit arch-specific code for bi_dontcare
Alyssa Rosenzweig [Tue, 21 Dec 2021 21:55:05 +0000 (16:55 -0500)]
pan/bi: Emit arch-specific code for bi_dontcare

We use bi_dontcare() to specify any encoding where we don't care about
the value, with a preference for power-efficient encodings. On Bifrost,
a (possibly nonexistant) FAU read is the best encoding. On Valhall, that
encoding doesn't exist so just use a zero. That should be good enough in
practice.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Model Valhall action on bi_instr
Alyssa Rosenzweig [Thu, 3 Mar 2022 01:49:20 +0000 (20:49 -0500)]
pan/bi: Model Valhall action on bi_instr

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Add Valhall-specific zero builder
Alyssa Rosenzweig [Tue, 21 Dec 2021 22:18:28 +0000 (17:18 -0500)]
pan/bi: Add Valhall-specific zero builder

When emitting code during or after register allocation, we need to be able to
emit constants without running the constant->{LUT, move, uniform} pass running
after. In particular, we need to access the constant 0 to implement spill code.
Add a Valhall-specific zero for this purpose.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Don't analyze helper reqs in !frag shaders
Alyssa Rosenzweig [Sun, 13 Mar 2022 23:43:18 +0000 (19:43 -0400)]
pan/bi: Don't analyze helper reqs in !frag shaders

Waste of time, and possibly invalid too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Print Valhall-specific FAU indices
Alyssa Rosenzweig [Thu, 17 Mar 2022 16:14:55 +0000 (12:14 -0400)]
pan/bi: Print Valhall-specific FAU indices

We'll emit these shortly, prepare the printer.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Use vertex/instance ID helpers
Alyssa Rosenzweig [Sun, 13 Mar 2022 22:54:50 +0000 (18:54 -0400)]
pan/bi: Use vertex/instance ID helpers

Enables portability to Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/bi: Add helpers to get vertex/instance ID
Alyssa Rosenzweig [Sun, 13 Mar 2022 22:53:32 +0000 (18:53 -0400)]
pan/bi: Add helpers to get vertex/instance ID

These are preloaded in different places across Bifrost and Valhall. Abstract
that away so code using the builder isn't littered with "is Valhall?" checks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/va: Fix ST_CVT definitions
Alyssa Rosenzweig [Thu, 17 Mar 2022 20:47:00 +0000 (16:47 -0400)]
pan/va: Fix ST_CVT definitions

They are basicallly just STORE with an extra source and the memory access
modifier in a different place.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/va: Align error messages in disassembler tests
Alyssa Rosenzweig [Thu, 17 Mar 2022 20:46:19 +0000 (16:46 -0400)]
pan/va: Align error messages in disassembler tests

Makes it easier to spot the difference, less eye scanning.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/va: Add missing .auto32 register format
Alyssa Rosenzweig [Thu, 17 Mar 2022 20:24:32 +0000 (16:24 -0400)]
pan/va: Add missing .auto32 register format

Clipped to .auto for consistency with Bifrost (and the existing IR).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/va: Add LEA_ATTR_IMM instruction
Alyssa Rosenzweig [Thu, 17 Mar 2022 20:06:15 +0000 (16:06 -0400)]
pan/va: Add LEA_ATTR_IMM instruction

Encoded like LEA_TEX_IMM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/va: Model LEA_TEX_IMM more accurately
Alyssa Rosenzweig [Thu, 17 Mar 2022 20:03:42 +0000 (16:03 -0400)]
pan/va: Model LEA_TEX_IMM more accurately

The unknown field is a descriptor type, which we model as an opcode2 since it's
a fixed constant. This allows us to disambiguate LEA_TEX_IMM from LEA_ATTR_IMM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/va: Correct definition of ZS_EMIT
Alyssa Rosenzweig [Sun, 13 Mar 2022 23:59:36 +0000 (19:59 -0400)]
pan/va: Correct definition of ZS_EMIT

It's a message instruction, not an ALU one... duh.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopanfrost: Add Tiler Job to v9 XML
Alyssa Rosenzweig [Thu, 17 Mar 2022 17:23:52 +0000 (13:23 -0400)]
panfrost: Add Tiler Job to v9 XML

Legacy tiling job, semantics are the same as on Midgard. Useful for blits and
transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopanfrost: Refactor XML to permit non-IDVS jobs
Alyssa Rosenzweig [Thu, 17 Mar 2022 17:22:10 +0000 (13:22 -0400)]
panfrost: Refactor XML to permit non-IDVS jobs

Tiler jobs look similar, but don't have the Allocations fields. Refactor to make
this possible to express.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopanfrost: Fix definition of DCD on v9
Alyssa Rosenzweig [Thu, 17 Mar 2022 16:56:27 +0000 (12:56 -0400)]
panfrost: Fix definition of DCD on v9

The position and varying shader environment descriptors are additional sections
of the job, rather than part of the (fragment only) DCD. This distinction
matters for non-IDVS jobs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopanfrost: Fix primitive restart with 32-bit indices
Alyssa Rosenzweig [Sun, 13 Mar 2022 22:41:05 +0000 (18:41 -0400)]
panfrost: Fix primitive restart with 32-bit indices

There's an overflow here if index_size = 4. Caught when bringing up Valhall, not
sure why this was never caught before. Yikes.

Fixes: 7a6a5f3fe15 ("panfrost: Handle explicit primitive restart")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopanfrost: Correct ASTC decode mode XML
Alyssa Rosenzweig [Sun, 13 Mar 2022 22:25:30 +0000 (18:25 -0400)]
panfrost: Correct ASTC decode mode XML

The narrow/wide bit was backwards.

Fixes: bfba7533c7a ("panfrost: Add Valhall Plane Descriptor XML")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/decode: Unify tiler job handling
Alyssa Rosenzweig [Thu, 17 Mar 2022 19:34:25 +0000 (15:34 -0400)]
pan/decode: Unify tiler job handling

Instead of adding a third Valhall path, let's use GenXML to unify our paths.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agopan/decode: Handle blend arrays on Valhall
Alyssa Rosenzweig [Mon, 14 Mar 2022 22:46:14 +0000 (18:46 -0400)]
pan/decode: Handle blend arrays on Valhall

Required for MRT.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15461>

2 years agotu: Actually expose VK_EXT_texel_buffer_alignment
Connor Abbott [Fri, 18 Mar 2022 11:32:41 +0000 (12:32 +0100)]
tu: Actually expose VK_EXT_texel_buffer_alignment

Oops...

Fixes: 3d04c435 ("tu: Trivially implement VK_EXT_texel_buffer_alignment")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15451>

2 years agolavapipe: Lift fence check into dedicated function
Omar Akkila [Fri, 18 Mar 2022 04:54:43 +0000 (00:54 -0400)]
lavapipe: Lift fence check into dedicated function

Signed-off-by: Omar Akkila <omar.akkila@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15443>

2 years agoradv: Don't hash ycbcr sampler base object.
Georg Lehmann [Fri, 18 Mar 2022 13:10:21 +0000 (14:10 +0100)]
radv: Don't hash ycbcr sampler base object.

Stops gamescope from recompiling pipelines on every start.

Cc: mesa-stable
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15454>

2 years agopanvk: Hook up emulated secondary command buffers
Jason Ekstrand [Wed, 9 Mar 2022 00:04:54 +0000 (18:04 -0600)]
panvk: Hook up emulated secondary command buffers

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agopanvk: Refcount the descriptor set and pipeline layouts
Boris Brezillon [Wed, 9 Mar 2022 17:49:22 +0000 (18:49 +0100)]
panvk: Refcount the descriptor set and pipeline layouts

Lifetime of descriptor sets and pipeline layouts are odd. Let's refcount
them so we don't end up with use-after-free patterns.

That means we can't use custom allocators for those objects.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agovulkan/runtime: Add emulated secondary command buffer support
Jason Ekstrand [Tue, 8 Mar 2022 23:50:09 +0000 (17:50 -0600)]
vulkan/runtime: Add emulated secondary command buffer support

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agovulkan/cmd_queue: Fix the allocation scope
Boris Brezillon [Thu, 10 Mar 2022 17:22:59 +0000 (18:22 +0100)]
vulkan/cmd_queue: Fix the allocation scope

VK_SYSTEM_ALLOCATION_SCOPE_COMMAND is used for transient allocations that
are not expected to live outside the vkXxx(). Use
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT for cmd_entry allocations.

v2 (Jason Ekstrand):
 - Also fix the manually typed entrypoints in vk_cmd_enqueue.c

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agovulkan/cmd_queue: Track allocation errors in vk_cmd_queue
Boris Brezillon [Wed, 2 Feb 2022 18:05:16 +0000 (19:05 +0100)]
vulkan/cmd_queue: Track allocation errors in vk_cmd_queue

Needed to report allocation failures when vkEndCommandBuffer() is
called.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agovulkan/cmd_queue: Auto-generate more vk_cmd_enqueue_unless_primary_Cmd*
Jason Ekstrand [Thu, 17 Mar 2022 16:00:27 +0000 (11:00 -0500)]
vulkan/cmd_queue: Auto-generate more vk_cmd_enqueue_unless_primary_Cmd*

Instead of one MANUAL_COMMANDS, we now have two deny-lists:
MANUAL_COMMANDS and NO_ENQUEUE_COMMANDS.  The former is for things which
have a manually typed implementation in vk_cmd_enqueue.c and the later
is for things we want to ignore entirely.  This lets us auto-generate
vk_cmd_enqueue_unless_primary_Cmd* entrypoints for the manually typed
vk_cmd_enqueue_Cmd* entrypoints.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agovulkan/cmd_queue: Generate enqueue_if_not_primary entrypoints
Jason Ekstrand [Wed, 9 Mar 2022 20:47:29 +0000 (14:47 -0600)]
vulkan/cmd_queue: Generate enqueue_if_not_primary entrypoints

These check the command buffer level and enqueue the command if it's not
a primary but uses vk_device::command_dispatch_table for primaries.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agovulkan/cmd_queue: Add a vk_cmd_queue_execute() helper
Jason Ekstrand [Tue, 8 Mar 2022 23:13:46 +0000 (17:13 -0600)]
vulkan/cmd_queue: Add a vk_cmd_queue_execute() helper

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>

2 years agoRevert "features: fix some vk extension listings"
Mike Blumenkrantz [Fri, 18 Mar 2022 16:34:58 +0000 (12:34 -0400)]
Revert "features: fix some vk extension listings"

This reverts commit a3e9388953f60d22c188d0e40bb4187be9048800.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15460>

2 years agolavapipe: Drop GetPhysicalDeviceQueueFamilyProperties
Jason Ekstrand [Fri, 18 Mar 2022 14:57:33 +0000 (09:57 -0500)]
lavapipe: Drop GetPhysicalDeviceQueueFamilyProperties

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agolavapipe: Use VK_OUTARRAY for GetPhysicalDeviceQueueFamilyProperties[2]
Jason Ekstrand [Fri, 18 Mar 2022 14:54:37 +0000 (09:54 -0500)]
lavapipe: Use VK_OUTARRAY for GetPhysicalDeviceQueueFamilyProperties[2]

This fixes bugs with lavapipe's hand-rolled pCount handling.  The driver
is supposed to set *pCount to the number of queues actually written in
the case where it's initialized to a value that's too large.  It's also
supposed to handle *pCount being too small.

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agopanvk: Drop GetPhysicalDeviceQueueFamilyProperties
Jason Ekstrand [Fri, 18 Mar 2022 14:53:26 +0000 (09:53 -0500)]
panvk: Drop GetPhysicalDeviceQueueFamilyProperties

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agov3dv: Drop GetPhysicalDeviceQueueFamilyProperties
Jason Ekstrand [Fri, 18 Mar 2022 14:52:51 +0000 (09:52 -0500)]
v3dv: Drop GetPhysicalDeviceQueueFamilyProperties

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agoturnip: Drop tu_legacy.c
Jason Ekstrand [Fri, 18 Mar 2022 14:51:51 +0000 (09:51 -0500)]
turnip: Drop tu_legacy.c

The remaining three helpers all have helpers in the common code.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agoradv: Drop GetPhysicalDeviceQueueFamilyProperties
Jason Ekstrand [Fri, 18 Mar 2022 14:50:07 +0000 (09:50 -0500)]
radv: Drop GetPhysicalDeviceQueueFamilyProperties

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agoanv: Drop GetPhysicalDeviceQueueFamilyProperties
Jason Ekstrand [Fri, 18 Mar 2022 14:49:09 +0000 (09:49 -0500)]
anv: Drop GetPhysicalDeviceQueueFamilyProperties

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agovulkan: Add a 2 wrapper for vkGetPhysicalDeviceQueueFamilyProperties
Jason Ekstrand [Fri, 18 Mar 2022 14:48:41 +0000 (09:48 -0500)]
vulkan: Add a 2 wrapper for vkGetPhysicalDeviceQueueFamilyProperties

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15459>

2 years agofeatures: fix some vk extension listings
Mike Blumenkrantz [Fri, 18 Mar 2022 14:17:46 +0000 (10:17 -0400)]
features: fix some vk extension listings

memory model is 1.3 and descriptor indexing isn't required by anything

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15458>

2 years agoanv: Use layerCount for clears and transitions in BeginRendering
Jason Ekstrand [Thu, 17 Mar 2022 22:35:27 +0000 (17:35 -0500)]
anv: Use layerCount for clears and transitions in BeginRendering

The Vulkan spec was recently clerified to say that transitions only
happen to the bound layers:

    "Automatic layout transitions apply to the entire image subresource
    attached to the framebuffer. If multiview is not enabled and the
    attachment is a view of a 1D or 2D image, the automatic layout
    transitions apply to the number of layers specified by
    VkFramebufferCreateInfo::layers. If multiview is enabled and the
    attachment is a view of a 1D or 2D image, the automatic layout
    transitions apply to the layers corresponding to views which are
    used by some subpass in the render pass, even if that subpass does
    not reference the given attachment."

This is in the context of render passes but it applies to dynamic
rendering because the implicit layout transition stuff is a Mesa pseudo-
extension and inherits those rules.

For clears, the Vulkan spec says:

    "renderArea is the render area that is affected by the render pass
    instance. The effects of attachment load, store and multisample
    resolve operations are restricted to the pixels whose x and y
    coordinates fall within the render area on all attachments. The
    render area extends to all layers of framebuffer."

Again, this is in the context of render passes but the same principals
apply to dynamic rendering where the layerCount and renderArea are
specified as part of the vkCmdBeginRendering() call.

Fixes: 3501a3f9ed92 ("anv: Convert to 100% dynamic rendering")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15441>

2 years agov3dv: support importing external semaphores
Iago Toral Quiroga [Wed, 9 Mar 2022 15:15:22 +0000 (16:15 +0100)]
v3dv: support importing external semaphores

This was waiting for multisync support in our kernel interface so
we can wait on the actual imported payload of a semaphore rather
than the last job we submitted.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: lock around noop job submits
Iago Toral Quiroga [Fri, 18 Mar 2022 07:04:22 +0000 (08:04 +0100)]
v3dv: lock around noop job submits

Any thread we create may end up creating/submitting at least a
noop job, which is a shared object. Before multisync, this was
an issue only for the creation of the job itself, but with
multisync we can also modify parameters of the noop job
every time it is used (for signaling and serialization
configuration).

This change adds a noop mutex that all threads (main, wait and
master) take before submitting a noop job to ensure concurrent
access is not an issue.

Fixes flakyness observed with multisync with the following test:
dEQP-VK.api.command_buffers.secondary_execute_twice

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: fix semaphore wait from CPU job
Iago Toral Quiroga [Fri, 11 Mar 2022 10:01:43 +0000 (11:01 +0100)]
v3dv: fix semaphore wait from CPU job

If a CPU job comes first in a command buffer with a semaphore wait operation
we need to wait on the CPU for the semaphore to be signaled before we process
the job.

We have been doing this with a WaitForIdle operation, but that only works
if the semaphore has been submitted for signaling from the same instance
of the driver. If we have an imported payload from another instance in our
semaphore however, waitForIdle may return too early since the submission
to signal the semaphore may have been submitted by a different instance
of the driver as well, and our wait for idle checks only know about this
instance submissions.

To fix this, we always submit a noop job from our instance that waits on
the semaphores on the GPU and follow up with WaitForIdle to wait for that
to complete.

Fixes test failures and/or assert crashes in:
dEQP-VK.synchronization.cross_instance.*
(when enabling support for semaphore imports)

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: don't signal semaphores/fences from a wait thread
Iago Toral Quiroga [Thu, 10 Mar 2022 15:18:10 +0000 (16:18 +0100)]
v3dv: don't signal semaphores/fences from a wait thread

When we have a wait thread we can't ensure that the last job in the last
command buffer will be the one to signal semaphores because in this case
there is no gurantee that jobs from command buffers in the batch will be
submitted to the GPU in order, as those put in a wait thread will be
submitted later when the event wait operation is completed.

Instead, we need to wait for all outstanding wait threads to complete
and only then we should signal any semaphores or fences.

This also fixes a bug where the wait for events was the last job in
the command buffer. In this case, once the event wait is completed
we have no additional jobs to submit and thus would never try to
signal semaphores or fences.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: fix temporary imports of semaphores and fences with multisync
Iago Toral Quiroga [Thu, 10 Mar 2022 09:51:59 +0000 (10:51 +0100)]
v3dv: fix temporary imports of semaphores and fences with multisync

This is preparatory work to expose support for importing semaphores, which
was waiting on kernel multisync support.

When we implemented user-space multisync support we didn't handle
temporary fence/semaphore payload imports at all, so we fix that here.

Also, we add a has_temp boolean flag to identify the case where we have
a temporary payload in a fence/sempahore instead of just checking if
temp_sync is not 0. This is necessary to support semaphore imports
(for which we are not exposing support yet) because these need to drop
the temporary payload when they are used as wait semaphores in a submit,
but we can't destroy the underlying temp_sync at that point because it
needs to survive at least until the submit is finished, so instead
we use a flag to tell if we have an active temporary payload or not,
and we simply destroy any temp_sync on a semaphore destroy or any new
import on the same semaphore. We only strictly need this flag for
semaphores because fences drop the temporary payload when they are
reset, which happens in the CPU and can only be done if the GPU is not
using the fence, but we add the same flag for the fence for consistency.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: don't expose image load/store features for linear images
Iago Toral Quiroga [Tue, 15 Mar 2022 08:44:27 +0000 (09:44 +0100)]
v3dv: don't expose image load/store features for linear images

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: return early on image to buffer blit copies if image is linear
Iago Toral Quiroga [Tue, 15 Mar 2022 09:56:31 +0000 (10:56 +0100)]
v3dv: return early on image to buffer blit copies if image is linear

This path uses a shader blit to implement the copy which is only
supported for tiled images (except 1D). While blit_shader() already
checks for this, this path does a lot of heavy lifting to prepare for
the blit_shader call so we rather avoid that if possible when we know
blit_shader won't be able to implement the blit.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agov3dv: TFU destination must be UIF
Iago Toral Quiroga [Tue, 15 Mar 2022 07:37:44 +0000 (08:37 +0100)]
v3dv: TFU destination must be UIF

We had some code that considered the possibility that the destination
might be linear when configuring TFU jobs, but we never actually allow
for this to happen since we avoid hitting these paths in that case, as
the TFU always produces UIF results. Instead, add an assert when
producing the TFU packet to ensure we are expecting a UIF result.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>

2 years agozink: add some nice docs for batch usage and tracking
Mike Blumenkrantz [Thu, 17 Mar 2022 15:44:58 +0000 (11:44 -0400)]
zink: add some nice docs for batch usage and tracking

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>

2 years agozink: set vbo resource usage on bind
Mike Blumenkrantz [Thu, 17 Mar 2022 15:30:52 +0000 (11:30 -0400)]
zink: set vbo resource usage on bind

this is how other descriptor binds work, and it makes repeated draws
with the same vbo binds faster since this was a redundant operation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>

2 years agozink: only update usage on buffer rebind if rebinds occurred
Mike Blumenkrantz [Thu, 17 Mar 2022 15:29:30 +0000 (11:29 -0400)]
zink: only update usage on buffer rebind if rebinds occurred

this is a harmless case, but it's still wrong

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>

2 years agozink: force-add usage when adding last-ref tracking
Mike Blumenkrantz [Thu, 17 Mar 2022 15:26:34 +0000 (11:26 -0400)]
zink: force-add usage when adding last-ref tracking

this fixes desync+crash when:
1. usage is added for bs A
2. tracking is added for bs B
3. tracking is removed for bs B
4. context is destroyed
5. usage A is now dangling and will crash if accessed

as seen in glmark2

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15429>

2 years agov3dv/pipeline: use new helper vk_shader_module_to_nir
Alejandro Piñeiro [Thu, 17 Mar 2022 13:34:53 +0000 (14:34 +0100)]
v3dv/pipeline: use new helper vk_shader_module_to_nir

In addition to use the helper, we also remove some of the lowering we
had at preprocess_nir, as they are called now by the helper.

As we are here we also move the call to nir_lower_sysvals_to_varyings,
that for some reason we were calling it before preprocess_nir.

It is worth to note that with this change we lose the ability to debug
the NIR just after spirv_to_nir using V3D_DEBUG, as now this is done
on vk_spirv_to_nir, and as mentioned that includes several lowerings
now. The workaround to that is to use NIR_DEBUG.

We also needed to change how to check the entrypoint on the broadcom
compiler, checking just if it is an entrypoint, instead of assuming
that the name will be "main".

v2: tweak comment, squash v3dv and compiler change (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15449>

2 years agoanv: flush tile cache with query copy command
Lionel Landwerlin [Fri, 14 Jan 2022 08:06:31 +0000 (10:06 +0200)]
anv: flush tile cache with query copy command

This fixes the test_resolve_non_issued_query_data vkd3d-proton test.

This change is required on TGL+ (maybe ICL?) because on all platforms
3D pipeline writes are not coherent with CS. On previous platform we
fixed this by flushing the render cache to make sure data is visble to
CS before it writes to memory. But on more recently platforms,
flushing the render cache leaves the data in the tile cache which is
still not coherent with CS, so we need to flush that one too.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14552>

2 years agoanv: emit timestamp & availability using the same part of CS
Lionel Landwerlin [Fri, 14 Jan 2022 08:04:48 +0000 (10:04 +0200)]
anv: emit timestamp & availability using the same part of CS

We've run into issues before where PIPE_CONTROL races MI_STORE_*
commands. So make sure we emit the availability using the same type of
CS so that memory writes are properly ordered.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14552>

2 years agov3dv: implement VK_EXT_line_rasterization
Juan A. Suarez Romero [Thu, 17 Mar 2022 11:20:41 +0000 (12:20 +0100)]
v3dv: implement VK_EXT_line_rasterization

Allow to choose the line rasterization algorithm. It supports
rectangular and Bresenham-style line rasterization.

v2 (Iago):
 - Update documentation.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15407>

2 years agov3dv: add subpixel precision definition
Juan A. Suarez Romero [Thu, 17 Mar 2022 10:24:49 +0000 (11:24 +0100)]
v3dv: add subpixel precision definition

Move number of bits for subpixel precision in rasterizer to a define.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15407>

2 years agobroadcom: add line rasterization mode to packet definition
Juan A. Suarez Romero [Thu, 17 Mar 2022 10:41:16 +0000 (11:41 +0100)]
broadcom: add line rasterization mode to packet definition

Add the supported line rasterization modes as enums in the XML packet
definition.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15407>

2 years agobroadcom: add on-disk cache debug option
Juan A. Suarez Romero [Mon, 14 Mar 2022 15:39:45 +0000 (16:39 +0100)]
broadcom: add on-disk cache debug option

Add support for`V3D_DEBUG=cache`, which prints on-disk cache events.

v2:
 - Use same debug format for v3d and v3dv (Alejandro)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15380>

2 years agov3d: add support for on-disk shader cache
Juan A. Suarez Romero [Mon, 14 Mar 2022 15:22:58 +0000 (16:22 +0100)]
v3d: add support for on-disk shader cache

It stores the compiled shaders on disk so further executions will load
them from disk instead of compiling, improving the overall performance.

This is noticeable in games where they suddenly get stuck for a while
because they start to compile one or more shaders.

v2:
 - Remove comment (Alejandro)
 - Use malloc() + helper to simplify code (Alejandro)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15380>

2 years agopanvk: Only implement Get*MemoryRequirements2
Jason Ekstrand [Thu, 17 Mar 2022 21:31:02 +0000 (16:31 -0500)]
panvk: Only implement Get*MemoryRequirements2

The runtime code will provide the 1.0 entrypoints for us.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>

2 years agopanvk: Drop QueueBindSparse
Jason Ekstrand [Thu, 17 Mar 2022 21:26:04 +0000 (16:26 -0500)]
panvk: Drop QueueBindSparse

Now that we've switched to the common sync/submit framework, this is
implemented in runtime/vk_queue.c.  We don't need to provide the stub.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15436>