platform/upstream/mesa.git
15 months agoglsl: inline link_varyings()
Timothy Arceri [Wed, 21 Jun 2023 03:02:46 +0000 (13:02 +1000)]
glsl: inline link_varyings()

Most code has already been moved to the NIR linker.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: remove the always_active_io flag from GLSL IR
Timothy Arceri [Wed, 5 Apr 2023 04:05:59 +0000 (14:05 +1000)]
glsl: remove the always_active_io flag from GLSL IR

No longer used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: move disable_varying_optimizations_for_sso() to NIR linker
Timothy Arceri [Wed, 5 Apr 2023 04:01:34 +0000 (14:01 +1000)]
glsl: move disable_varying_optimizations_for_sso() to NIR linker

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agonir/glsl: add nir_var_declared_implicitly enum
Timothy Arceri [Wed, 5 Apr 2023 02:09:19 +0000 (12:09 +1000)]
nir/glsl: add nir_var_declared_implicitly enum

This will be used in the following patch.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: drop the dce of global vars from GLSL IR linker
Timothy Arceri [Wed, 5 Apr 2023 02:30:24 +0000 (12:30 +1000)]
glsl: drop the dce of global vars from GLSL IR linker

All this does is compilcate things such as forcing us to set
var->data.always_active_io in the glsl linker. Just let NIR clean
these up for us instead.

A Zink test hits a new assert but this is not a regression it just
uncovers an existing mesa bug.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: remove unused system vars
Timothy Arceri [Thu, 4 May 2023 02:13:44 +0000 (12:13 +1000)]
glsl: remove unused system vars

System vars are added to the resource list as inputs so remove any
dead ones before building the list.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: remove unused buffer objects with packed layout
Timothy Arceri [Thu, 4 May 2023 01:24:07 +0000 (11:24 +1000)]
glsl: remove unused buffer objects with packed layout

These are currently removed by the GLSL IR DCE pass but we will
drop that in a following patch. Also there are scenarios where these
might not be detected as unused until the NIR optimisations have
been run so we really need to do it here too anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: call assign_attribute_or_color_locations() in NIR linker
Timothy Arceri [Thu, 6 Apr 2023 04:18:44 +0000 (14:18 +1000)]
glsl: call assign_attribute_or_color_locations() in NIR linker

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: port assign location code for VS inputs or FS outputs
Timothy Arceri [Thu, 6 Apr 2023 04:17:12 +0000 (14:17 +1000)]
glsl: port assign location code for VS inputs or FS outputs

Here we port the code to the NIR linker.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: move lowering linker code out of st
Timothy Arceri [Thu, 22 Jun 2023 00:33:41 +0000 (10:33 +1000)]
glsl: move lowering linker code out of st

Move all these lowering calls into the linker where they belong. This
makes future changes to the linker more flexible and is needed to
allow some following patches as we need to call things in a specific
order.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: move some compiler code out of st
Timothy Arceri [Thu, 22 Jun 2023 00:24:05 +0000 (10:24 +1000)]
glsl: move some compiler code out of st

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agomesa: add some new constants
Timothy Arceri [Thu, 22 Jun 2023 00:18:53 +0000 (10:18 +1000)]
mesa: add some new constants

These will be used by the compiler in a following patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agoglsl: add some more c wrappers for string_to_uint_map
Timothy Arceri [Thu, 6 Apr 2023 01:58:16 +0000 (11:58 +1000)]
glsl: add some more c wrappers for string_to_uint_map

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22846>

15 months agobroadcom/compiler: don't leak v3d_compile when finding a new best strategy
Iago Toral Quiroga [Wed, 5 Jul 2023 08:38:07 +0000 (10:38 +0200)]
broadcom/compiler: don't leak v3d_compile when finding a new best strategy

If we had selected a best strategy and find an even better one we need to
make sure we free the previous one.

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

15 months agobroadcom/compiler: free defin and defout arrays if they already exist
Iago Toral Quiroga [Wed, 5 Jul 2023 08:40:34 +0000 (10:40 +0200)]
broadcom/compiler: free defin and defout arrays if they already exist

Just like we do for everything else here, since we are going to realloc
them again right below. Notice this is not exactly a memory leak, since
all these arrays are allocated with ralloc using v3d_compile as context,
so all allocations will be eventually freed when the context is destroyed.

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

15 months agotu: Add missing dbg reg stomping to tu_CmdBeginRendering
Danylo Piliaiev [Tue, 4 Jul 2023 16:07:43 +0000 (18:07 +0200)]
tu: Add missing dbg reg stomping to tu_CmdBeginRendering

Also we shouldn't stomp PC_DRAW_INDX_BASE - we never use it and
stomping it together with some other reg leads to a fault.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23993>

15 months agollvmpipe,lavapipe: Relayout lp_descriptor
Konstantin Seurer [Tue, 4 Jul 2023 19:01:23 +0000 (21:01 +0200)]
llvmpipe,lavapipe: Relayout lp_descriptor

This is more robust in case of a descriptor type mismatch.

Fixes test_null_descriptor_mismatch_type (vkd3d-proton).

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

15 months agollvmpipe: Allocate more dummy sample functions for FORMAT_NONE
Konstantin Seurer [Tue, 4 Jul 2023 17:05:08 +0000 (19:05 +0200)]
llvmpipe: Allocate more dummy sample functions for FORMAT_NONE

When a null texture is sampled with a non-null sampler, having only one
set of sample functions would lead to an OOB read.

Fixes test_null_srv (vkd3d-proton).

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

15 months agollvmpipe: Allow comparison sampling for float formats
Konstantin Seurer [Tue, 4 Jul 2023 16:24:30 +0000 (18:24 +0200)]
llvmpipe: Allow comparison sampling for float formats

Fixes test_gather_c (vkd3d-proton).

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

15 months agolavapipe: Set the descriptor count to what vkd3d-proton requires
Konstantin Seurer [Tue, 4 Jul 2023 16:10:18 +0000 (18:10 +0200)]
lavapipe: Set the descriptor count to what vkd3d-proton requires

vkd3d-proton tries to allocate a maximum size descriptor set. The
previous limits were to high for that to work reliably.

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

15 months agogallivm: Fix atomic_global types
Konstantin Seurer [Tue, 4 Jul 2023 15:48:58 +0000 (17:48 +0200)]
gallivm: Fix atomic_global types

Passes LLVM validation on the test_mesh_shader_rendering vkd3d-proton
test.

cc: mesa-stable

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

15 months agoglsl: Fix yylloc.source propagation in YYLLOC_DEFAULT
Sviatoslav Peleshko [Mon, 3 Jul 2023 06:45:29 +0000 (09:45 +0300)]
glsl: Fix yylloc.source propagation in YYLLOC_DEFAULT

Currently, it's always initialized to 0, but we should take the value from
the grouping passed to the macro. This way parser will have the full
location info, and errors originating from it will show the correct
source file number.

Fixes: a0cfe8c4 ("glsl: Fix missing initialization of yylloc.source")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9229
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23966>

15 months agoradeonsi: fix refcnt imbalance related to util_blitter_save_fragment_constant_buffer_...
Patrick Lerda [Thu, 22 Jun 2023 11:11:07 +0000 (13:11 +0200)]
radeonsi: fix refcnt imbalance related to util_blitter_save_fragment_constant_buffer_slot()

Indeed, util_blitter_clear() requires a call to
util_blitter_save_fragment_constant_buffer_slot(),
but most other blitter functions do not.

For instance, this issue is triggered with:
"piglit/bin/object-namespace-pollution glDrawPixels buffer -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 03bc7503d471 ("radeonsi: save the fs constant buffer to the util blitter context")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23856>

15 months agoclc: llvm 17 requires opaque pointers.
Dave Airlie [Wed, 5 Jul 2023 04:01:05 +0000 (14:01 +1000)]
clc: llvm 17 requires opaque pointers.

You can't turn this off for llvm17+, this at least makes things
run against llvm git now instead of blowing up in clang.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24000>

15 months agor300: assert that every writer has a reader
Pavel Ondračka [Fri, 23 Jun 2023 08:39:16 +0000 (10:39 +0200)]
r300: assert that every writer has a reader

Dead writes can lead to problems with regalloc, so add a safety assert
to catch such cases in the vertex shaders at least in the meantime.

Additionally we could think there are no readers due to some shortcoming
of out dataflow analysis or some other bug which we would also like to
know about.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>

15 months agor300: disable ntt regalloc for vertex shaders
Pavel Ondračka [Thu, 15 Jun 2023 11:57:48 +0000 (13:57 +0200)]
r300: disable ntt regalloc for vertex shaders

We have much better regalloc in the backend, and additionally having
a close to ssa form means some optimizations can be more effective.

RV370:
total instructions in shared programs: 82500 -> 81645 (-1.04%)
instructions in affected programs: 32147 -> 31292 (-2.66%)
helped: 396
HURT: 1
total temps in shared programs: 12355 -> 12465 (0.89%)
temps in affected programs: 368 -> 478 (29.89%)
helped: 5
HURT: 96

GAINED: shaders/trine/vp-237.shader_test VS
GAINED: shaders/trine/vp-79.shader_test VS

RV530:
total instructions in shared programs: 130706 -> 129684 (-0.78%)
instructions in affected programs: 40902 -> 39880 (-2.50%)
helped: 428
HURT: 1
total temps in shared programs: 16811 -> 16920 (0.65%)
temps in affected programs: 421 -> 530 (25.89%)
helped: 7
HURT: 89

The instruction decrease is from the channel merging pass which can be
much more agressive when we have ssa-like form.

The temp regressions are cases where we merge something like
  3: MAD output[1].xy, const[8].xy__, input[1].ww__, temp[0].xy__;
 ....
 12: MOV output[1].zw, none.__00;

We always merge the first instruction into the second one, which means
the liverange for temp[0] will be unnecessarily extended here.
This can be fixed with the following draft MR
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19790
however if we ever get a VS pair scheduling support this will be solved
as well as a consequence, so let it be for now.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7693
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>

15 months agor300: remove most of backend contant folding
Pavel Ondračka [Thu, 15 Jun 2023 11:29:50 +0000 (13:29 +0200)]
r300: remove most of backend contant folding

This is now done in NIR. The remaining one for ADD + 0 to MOV is kept
until we move some remaining part of FS lowering to NIR.

There single regressions is in one d3d->glsl shader from Wine.
Wine sets invariant for glPosition which translates to exact bit for all
calculations leading to it (or the TGSI PRECISE flag). r300 backend
ignores is completelly, so removing the backend optimizations should
even make us more correct in this regards.

RV530:
total instructions in shared programs: 130705 -> 130706 (<.01%)
instructions in affected programs: 16 -> 17 (6.25%)
helped: 0
HURT: 1

RV370: no change

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>

15 months agor300: add some early safe bool lowering
Pavel Ondračka [Thu, 15 Jun 2023 07:27:59 +0000 (09:27 +0200)]
r300: add some early safe bool lowering

This lowers some of the bool-producing comparisons and following bcsels
if the bool comparison results is only used in the bcsel.
This is a temporary solution before we can fork ntt and optimize
the pass sequence there. Right now if we have something like
bcsel(a,b,0.0) we lower it to flrp in nir_lower_bool_to_float. The
flrp goes to backend where it will be lowered to 2 MADs. However in this
case with one of the arguments being a constant one MAD is enough. The
backend can figure this out in the constant folding pass, however this
is actually one of the last things we need it for. So if we do early
translation of the bcsels, than the algebraic pass can clean it up and
we can remove more backend code in the next patch.

no significant change with RV370 shader-db:
total instructions in shared programs: 82497 -> 82496 (<.01%)
instructions in affected programs: 1029 -> 1028 (-0.10%)
helped: 4
HURT: 3
total temps in shared programs: 12351 -> 12355 (0.03%)
temps in affected programs: 10 -> 14 (40.00%)
helped: 0
HURT: 4

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>

15 months agor300: lower undefs to zero
Pavel Ondračka [Fri, 23 Jun 2023 12:30:44 +0000 (14:30 +0200)]
r300: lower undefs to zero

They will get translated to read from random register otherwise, which is
not problematic per se, but they will not be regalloced and if the
initial register index was too high, we can fail the shader compilation
because we think we run out of registers.

Almost no effect with shader-db on RV530:
total instructions in shared programs: 130707 -> 130705 (<.01%)
instructions in affected programs: 1012 -> 1010 (-0.20%)
helped: 2
HURT: 1

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23927>

15 months agoradeonsi: Use ALIGN_POT instead ALIGN_TO
Yonggang Luo [Tue, 4 Jul 2023 08:47:45 +0000 (16:47 +0800)]
radeonsi: Use ALIGN_POT instead ALIGN_TO

ALIGN_POT would be a bit faster as it's have no divide arithmetic

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23987>

15 months agoradv: Re-enable RT pipeline capture/replay handles
Friedrich Vock [Fri, 2 Jun 2023 12:40:12 +0000 (14:40 +0200)]
radv: Re-enable RT pipeline capture/replay handles

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

15 months agoradv/rt: Rework radv_GetRayTracingCaptureReplayShaderGroupHandlesKHR
Friedrich Vock [Wed, 7 Jun 2023 07:54:50 +0000 (09:54 +0200)]
radv/rt: Rework radv_GetRayTracingCaptureReplayShaderGroupHandlesKHR

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

15 months agoradv/rt: Replay shader allocations according to capture/replay handle
Friedrich Vock [Fri, 2 Jun 2023 15:41:58 +0000 (17:41 +0200)]
radv/rt: Replay shader allocations according to capture/replay handle

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

15 months agoradv/rt: Associate capture/replay handles with stages
Friedrich Vock [Fri, 2 Jun 2023 15:38:35 +0000 (17:38 +0200)]
radv/rt: Associate capture/replay handles with stages

For stages where the capture/replay handle is only known after compiling
and uploading the shader, the shader needs to be relocated to the VA
corresponding to the capture/replay address.

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

15 months agoradv/rt: Only compare the non-recursive capture/replay handle
Friedrich Vock [Fri, 2 Jun 2023 15:36:31 +0000 (17:36 +0200)]
radv/rt: Only compare the non-recursive capture/replay handle

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

15 months agoradv: Add radv_rt_capture_replay_handle
Friedrich Vock [Fri, 2 Jun 2023 15:44:12 +0000 (17:44 +0200)]
radv: Add radv_rt_capture_replay_handle

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

15 months agoradv: Add support for creating capture/replay shaders
Friedrich Vock [Fri, 2 Jun 2023 12:39:04 +0000 (14:39 +0200)]
radv: Add support for creating capture/replay shaders

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

15 months agoradv: Split up implementation of radv_shader_create
Friedrich Vock [Fri, 2 Jun 2023 12:37:07 +0000 (14:37 +0200)]
radv: Split up implementation of radv_shader_create

This will make it easy to re-use the split-up parts for creating
replayed shaders.

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

15 months agoradv: Break up radv_shader_nir_to_asm
Friedrich Vock [Wed, 7 Jun 2023 09:12:51 +0000 (11:12 +0200)]
radv: Break up radv_shader_nir_to_asm

radv_shader_nir_to_asm actually had 3 functions: compiling the NIR to
asm, uploading the shaders and generating debug info for them.
This reduces the functionality of radv_shader_nir_to_asm to only compile
NIR to asm. Uploading the shader and generating debug info is split into
separate functions.

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

15 months agoradv: Add radv_shader_reupload
Friedrich Vock [Thu, 1 Jun 2023 20:24:45 +0000 (22:24 +0200)]
radv: Add radv_shader_reupload

Used for relocating RT shaders with capture/replay.

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

15 months agoradv: Add utilities to serialize and deserialize shader allocation info
Friedrich Vock [Fri, 2 Jun 2023 12:42:06 +0000 (14:42 +0200)]
radv: Add utilities to serialize and deserialize shader allocation info

Can be used to capture/replay an arbitrary sequence of shader
allocations while preserving VAs.

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

15 months agoradv: Add option to allocate shaders in replayable VA range
Friedrich Vock [Wed, 7 Jun 2023 07:53:59 +0000 (09:53 +0200)]
radv: Add option to allocate shaders in replayable VA range

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

15 months agoradv: Move shader arena allocation to a separate function
Friedrich Vock [Fri, 2 Jun 2023 12:45:06 +0000 (14:45 +0200)]
radv: Move shader arena allocation to a separate function

The arena size is also needed for capture/replay.

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

15 months agoradv: Add radv_shader_free_list
Friedrich Vock [Wed, 5 Jul 2023 09:55:44 +0000 (11:55 +0200)]
radv: Add radv_shader_free_list

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

15 months agoiris: Convert slab address to canonical
José Roberto de Souza [Tue, 4 Jul 2023 14:25:49 +0000 (07:25 -0700)]
iris: Convert slab address to canonical

This was the only missing case of bo->address that could possibly not
formated as canonical.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23994>

15 months agonir: Fix breaking in nir_foreach_phi(_safe)
Alyssa Rosenzweig [Fri, 30 Jun 2023 21:29:51 +0000 (17:29 -0400)]
nir: Fix breaking in nir_foreach_phi(_safe)

When I reading through some of my older commits I noticed that `break` in
`nir_foreach_phi` is broken because I used the two-loop trick wrong. Rewrite the
macros to fix this, and also to generally be a lot cleaner.

Fixes: 7dc297cc141 ("nir: Add nir_foreach_phi(_safe) macro")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23957>

15 months agokmsro: assert that scanout refcount is larger than 0
Michael Tretter [Tue, 20 Jun 2023 13:14:52 +0000 (15:14 +0200)]
kmsro: assert that scanout refcount is larger than 0

The dumb buffer backing the renderonly_scanout is only destroyed if the
refcount reaches zero. If a driver does not correctly initialize the
refcount, the refcount may be negative and the buffer will never be
freed.

Add an assert to ensure that drivers correctly initialize the refcount.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23743>

15 months agopanfrost: remove BO from cache before closing GEM
Michael Tretter [Mon, 19 Jun 2023 10:19:00 +0000 (12:19 +0200)]
panfrost: remove BO from cache before closing GEM

If the GEM is closed before setting the BO in the sparse array to zero,
a newly allocated GEM may be associated with a stale BO that is left in
the cache reusing an old BO.

Zero the BO before closing the GEM to make sure that the BO is removed
from the cache and won't be associated with a different GEM.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23744>

15 months agowinsys/panfrost: Make sure we reset scanout on error in create_kms_dumb_buffer_for_re...
Boris Brezillon [Fri, 23 Jun 2023 07:18:31 +0000 (09:18 +0200)]
winsys/panfrost: Make sure we reset scanout on error in create_kms_dumb_buffer_for_resource()

If an error occured, make sure we reset the scanout object before
leaving, otherwise the next user of this handle will hit the
refcnt == 0 assert.

Fixes: ad4d7ca83324 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>

15 months agorenderonly: Make sure we reset scanout on error in create_kms_dumb_buffer_for_resource()
Boris Brezillon [Fri, 23 Jun 2023 07:18:21 +0000 (09:18 +0200)]
renderonly: Make sure we reset scanout on error in create_kms_dumb_buffer_for_resource()

If an error occured, make sure we reset the scanout object before
leaving, otherwise the next user of this handle will hit the
refcnt == 0 assert.

Fixes: ad4d7ca83324 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>

15 months agorenderonly: Fix potential NULL deref in the error path
Boris Brezillon [Fri, 23 Jun 2023 07:08:31 +0000 (09:08 +0200)]
renderonly: Fix potential NULL deref in the error path

scanout can be NULL.

Fixes: ad4d7ca83324 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>

15 months agowinsys/panfrost: Fix a scanout resource leak
Robert Beckett [Wed, 26 Apr 2023 12:28:40 +0000 (13:28 +0100)]
winsys/panfrost: Fix a scanout resource leak

Use ro->bo_map to alloc scanout and make sure we initialize the refcnt
to one.

This fixes leaking the scanout object and the underlying dumb-buffer.

Fixes: ad4d7ca83324 ("kmsro: Fix renderonly_scanout BO aliasing")
Cc: mesa-stable
Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23746>

15 months agoaux/trace: fix bindless texture dumping
Mike Blumenkrantz [Mon, 3 Jul 2023 13:34:39 +0000 (09:34 -0400)]
aux/trace: fix bindless texture dumping

cc: mesa-stable

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

15 months agoasahi: Use txf_ms for MSAA background programs
Alyssa Rosenzweig [Tue, 27 Jun 2023 18:19:33 +0000 (14:19 -0400)]
asahi: Use txf_ms for MSAA background programs

Fixes regression in assorted dEQP tests including:

dEQP-EGL.functional.color_clears.multi_context.gles3.rgba8888_window

Fixes: d4424950ace ("asahi: Use txf for background program")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoagx: Don't leak ssa_to_reg_out
Alyssa Rosenzweig [Thu, 29 Jun 2023 00:12:25 +0000 (20:12 -0400)]
agx: Don't leak ssa_to_reg_out

calloc'd in the RA, should be freed in the RA. Identified with valgrind.

Fixes: 6b13616cba2 ("agx: Implement vector live range splitting")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Take ownership of compute shader NIR
Alyssa Rosenzweig [Thu, 29 Jun 2023 00:06:14 +0000 (20:06 -0400)]
asahi: Take ownership of compute shader NIR

Fixes massive leak of compute shader NIR. Identified with valgrind.

Yes, this requires casting away const *.

Yes, Gallium is dumb.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Use ralloc harder
Alyssa Rosenzweig [Thu, 29 Jun 2023 00:05:39 +0000 (20:05 -0400)]
asahi: Use ralloc harder

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Fix scissor_culls_everything check
Alyssa Rosenzweig [Wed, 28 Jun 2023 16:38:48 +0000 (12:38 -0400)]
asahi: Fix scissor_culls_everything check

Account for the possibility that the scissor is outside the render area. Fixes
the usual assertion fail:

   glcts: ../src/gallium/drivers/asahi/agx_state.c:1015:
   agx_upload_viewport_scissor: Assertion `maxx > minx && maxy > miny' failed.

on the following dEQP tests with my conformance build:

  dEQP-GLES3.functional.fragment_ops.scissor.outside_render_line
  dEQP-GLES3.functional.fragment_ops.scissor.outside_render_point
  dEQP-GLES3.functional.fragment_ops.scissor.outside_render_tri

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Assert we don't transition shared resources
Alyssa Rosenzweig [Mon, 26 Jun 2023 20:23:01 +0000 (16:23 -0400)]
asahi: Assert we don't transition shared resources

This is an invariant maintained by all current callers and subtly required for
the BO swapping to work. Assert it to make it obvious.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Arrange VS varyings in the correct order
Asahi Lina [Wed, 28 Jun 2023 10:15:28 +0000 (19:15 +0900)]
asahi: Arrange VS varyings in the correct order

The GPU ABI requires varyings to be grouped as follows:

- Position
- Smooth shaded fp32
- Flat shaded fp32
- Linear shaded fp32
- Smooth shaded fp16
- Flat shaded fp16
- Linear shaded fp16
- Point size

Use the flat shaded mask info we now have in the vertex shader key to
sort things properly, and pass the counts to the hardware.
FP16 is still TODO.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Add flat/linear shaded varyings mask to the VS shader key
Asahi Lina [Wed, 28 Jun 2023 10:12:51 +0000 (19:12 +0900)]
asahi: Add flat/linear shaded varyings mask to the VS shader key

We need this information in order to arrange varyings properly, which
means we need shader variants. Add this to the shader key, taking the
value from the FS input info.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Fix type confusion for fragment shader keys
Asahi Lina [Wed, 28 Jun 2023 10:10:41 +0000 (19:10 +0900)]
asahi: Fix type confusion for fragment shader keys

We can't attempt to access the fs union member if this is not a FS.
That worked so far since there wasn't a VS shader key at all, but we're
about to introduce one.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Gather flat/linear shaded input info from uncompiled FS
Asahi Lina [Wed, 28 Jun 2023 10:07:20 +0000 (19:07 +0900)]
asahi: Gather flat/linear shaded input info from uncompiled FS

We need to propagate shading model metadata from the FS to the VS in
order to correctly lay out the uniforms in the right order. This means
we need VS variants depending on this data.

We could use the existing shader info structure, but that applies to
compiled shaders which would introduce a dependency from the VS compile
to the FS compile. This information does not change with FS variants, so
we can introduce an agx_uncompiled_shader_info structure and gather it
early at precompilation time.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Identify the separate varying count fields
Asahi Lina [Wed, 28 Jun 2023 08:09:19 +0000 (17:09 +0900)]
asahi: Identify the separate varying count fields

Flat/goraud/linear and 32/16 need to be specified separately. This
change identifies the new fields but should be a functional no-op.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoagx: Assert that barriers are not used in the preamble
Alyssa Rosenzweig [Thu, 8 Jun 2023 13:35:30 +0000 (09:35 -0400)]
agx: Assert that barriers are not used in the preamble

It is nonsensical and confuses the hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoagx: Use nir_opt_shrink_vectors
Alyssa Rosenzweig [Thu, 8 Jun 2023 16:05:21 +0000 (12:05 -0400)]
agx: Use nir_opt_shrink_vectors

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoagx: Use nir_opt_shrink_stores
Alyssa Rosenzweig [Sun, 28 May 2023 02:23:11 +0000 (22:23 -0400)]
agx: Use nir_opt_shrink_stores

This especially helps with image stores, where we otherwise insert a bunch of
pointless moves to collect a vector even when we know the format only has a
single channel.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Remove ; in perf_debug_ctx
Alyssa Rosenzweig [Wed, 7 Jun 2023 00:08:09 +0000 (20:08 -0400)]
asahi: Remove ; in perf_debug_ctx

Otherwise `if(x) perf_debug_ctx(); else if (y) ...` doesn't work.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Identify PBE::sRGB flag
Alyssa Rosenzweig [Thu, 15 Jun 2023 18:19:36 +0000 (14:19 -0400)]
asahi: Identify PBE::sRGB flag

Needed to write out sRGB images correctly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Rename 'Render Target' to 'PBE'
Alyssa Rosenzweig [Fri, 19 May 2023 17:05:39 +0000 (13:05 -0400)]
asahi: Rename 'Render Target' to 'PBE'

It's used for all PBE operations, including regular image writes, so use the
more general name. Compare the powervr driver.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: Strip ? in GenXML
Alyssa Rosenzweig [Tue, 6 Jun 2023 22:56:05 +0000 (18:56 -0400)]
asahi: Strip ? in GenXML

Sometimes it's nice to have boolean flags with ? in the name, allow this by
stripping ? when generating the sanitized C name.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoasahi: match_soa: Treat offsets as signed
Asahi Lina [Wed, 28 Jun 2023 11:46:27 +0000 (20:46 +0900)]
asahi: match_soa: Treat offsets as signed

An offset may be negative, indexing backwards from the array base.
When we right shift an offset by the format shift, we need to use a
signed shift to ensure that the resulting offset is still negative.

Fixes Nautilus faults/pink crashes.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoagx: Smarten discard_agx -> sample_mask lowering
Alyssa Rosenzweig [Fri, 16 Jun 2023 12:31:40 +0000 (08:31 -0400)]
agx: Smarten discard_agx -> sample_mask lowering

In 97a1bbeaf26 ("agx: Fix discards"), we made our discard lowering very simple,
since we had just discovered the underlying instruction behaviour and needed a
hotfix for misrendering in the wild. Now that we understand the behaviour, we
can do better. There are two potential performance issues with the lowering in
that commit:

1. It generates extra sample_mask instructions. For a shader that has a single
   discard_if at root level, it would generate two instructions

      sample_mask foo, 0
      sample_mask ~0, ~0

   rather than a single

      sample_mask ~0, ~foo

2. It runs depth/stencil testing/updates at the end of the shader, even when it
   could be run immediately after the discard. This might cause pipeline stalls.

The solution is to insert the "trigger testing" sample_mask instruction as soon
after the "discard" instruction as possible, fusing them if they would be next
to each other. There are two cases:

1. The last discard is executed unconditionally. In this case, we can test
   immediately after, unconditionally, and fuse together.

2. The last discard is executed conditionally. In this case, we test in the
   first unconditional block after the discard. Example shader:

   ...
   loop {
      if .. {
         loop {
            discard_if <-- discard here
            ...
         }
      ..
      }
   ...
   }
   <---- we test here
   ...
   store_output

Together this covers all the usual patterns for single-sampled discard. We could
still do better with multisampling, but whatever.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agoagx: Add algebraic opt to help with discard lowering
Alyssa Rosenzweig [Fri, 16 Jun 2023 12:55:58 +0000 (08:55 -0400)]
agx: Add algebraic opt to help with discard lowering

When lowering discards, it will be convenient to generate the pattern:

   (cond ? 255 : 0) ^ 255

Add rules to optimize that to

   (cond ? 0 : 255)

This is not part of the main algebraic optimizer since this lowering happens
late.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23998>

15 months agozink: don't destroy swapchain on initial CreateSwapchainKHR fail
Mike Blumenkrantz [Mon, 10 Apr 2023 16:40:26 +0000 (12:40 -0400)]
zink: don't destroy swapchain on initial CreateSwapchainKHR fail

this used to be correct at some point but now it no longer is

cc: mesa-stable

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

15 months agogallivm: make block_size use discrete values.
Dave Airlie [Wed, 5 Jul 2023 00:22:06 +0000 (10:22 +1000)]
gallivm: make block_size use discrete values.

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

15 months agogallivm: convert grid_size to discrete values.
Dave Airlie [Wed, 5 Jul 2023 00:19:08 +0000 (10:19 +1000)]
gallivm: convert grid_size to discrete values.

No use in storing this in a vector

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

15 months agogallivm: convert block_id to discrete values.
Dave Airlie [Wed, 5 Jul 2023 00:16:59 +0000 (10:16 +1000)]
gallivm: convert block_id to discrete values.

There is no reason to stick these in a vector

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

15 months agogallivm: store thread id in separate values.
Dave Airlie [Wed, 5 Jul 2023 00:12:47 +0000 (10:12 +1000)]
gallivm: store thread id in separate values.

There is no real advantage to putting this into a vector to take
it back out again.

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

15 months agoanv/video: fix to support HEVC 10bit on some of 9th gens.
Hyunjun Ko [Tue, 4 Jul 2023 06:42:41 +0000 (15:42 +0900)]
anv/video: fix to support HEVC 10bit on some of 9th gens.

From Broxton and Kabylake, it started supporting HEVC 10-bit decoding.

Fixes: 649e12c8973 ("anv_video: reject decoding of unsupported profiles
and formats")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23985>

15 months agoradv: Remove unused pipeline param from radv_generate_pipeline_key
Joshua Ashton [Mon, 3 Jul 2023 21:32:15 +0000 (22:32 +0100)]
radv: Remove unused pipeline param from radv_generate_pipeline_key

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoradv: Advertise VK_EXT_pipeline_robustness
Joshua Ashton [Wed, 28 Jun 2023 17:35:06 +0000 (18:35 +0100)]
radv: Advertise VK_EXT_pipeline_robustness

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoradv: Implement VK_EXT_pipeline_robustness
Joshua Ashton [Wed, 28 Jun 2023 17:34:31 +0000 (18:34 +0100)]
radv: Implement VK_EXT_pipeline_robustness

Funnel the data from the pNext into the new pipeline key members for buffer robustness

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoradv: Rename radv_required_subgroup_info to radv_shader_stage_key
Joshua Ashton [Mon, 3 Jul 2023 19:23:13 +0000 (20:23 +0100)]
radv: Rename radv_required_subgroup_info to radv_shader_stage_key

Additionally, prefix the members that are subgroup related with subgroup_

We will use this structure to store pipeline robustness information.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoradv: Split and move buffer robustness to shader key
Joshua Ashton [Wed, 28 Jun 2023 17:31:51 +0000 (18:31 +0100)]
radv: Split and move buffer robustness to shader key

Will be used by pipeline robustness.

There is also loads of space in the first dword.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoradv: Rename radv_nir_compiler_options::robust_buffer_access to robust_buffer_access_llvm
Joshua Ashton [Wed, 28 Jun 2023 17:28:57 +0000 (18:28 +0100)]
radv: Rename radv_nir_compiler_options::robust_buffer_access to robust_buffer_access_llvm

This is only used by LLVM, make that clearer.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoradv: Refactor buffer robustness to an enum
Joshua Ashton [Wed, 28 Jun 2023 16:34:58 +0000 (17:34 +0100)]
radv: Refactor buffer robustness to an enum

Will be taken advantage of with pipeline robustness.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23912>

15 months agoanv: Drop unnecessary intel_canonical_address() calls around bo->offset
José Roberto de Souza [Mon, 3 Jul 2023 19:33:57 +0000 (12:33 -0700)]
anv: Drop unnecessary intel_canonical_address() calls around bo->offset

bo->offset is set as canonical address no need to do it over again.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23977>

15 months agoanv: Drop unnecessary intel_canonical_address() call around anv_address_physical()
José Roberto de Souza [Mon, 3 Jul 2023 16:48:05 +0000 (09:48 -0700)]
anv: Drop unnecessary intel_canonical_address() call around anv_address_physical()

anv_address_physical() already returns a canonical address.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23977>

15 months agoanv: Fix some mismatches of canonical and regular addresses around anv_bo_vma_alloc_o...
José Roberto de Souza [Mon, 3 Jul 2023 16:38:10 +0000 (09:38 -0700)]
anv: Fix some mismatches of canonical and regular addresses around anv_bo_vma_alloc_or_close()

anv_vma_alloc() returns a canonical address, but explicit_address is a
regular address. This mismatch can potentially cause issues.

So here making bo->offset as always canonical address by converting it
in the explicit case and fixing the only caller that was caling
anv_bo_vma_alloc_or_close() with a canonical address.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23977>

15 months agoRevert "ci/fdno: Pause a660 testing"
Daniel Stone [Tue, 4 Jul 2023 11:17:34 +0000 (12:17 +0100)]
Revert "ci/fdno: Pause a660 testing"

The fastboot/USB/network issue has been resolved.

This reverts commit e207458ad509c6dc670bfdef9e1a3685aa4ee5f4.

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

15 months agoci: restore lima farm
Erico Nunes [Fri, 30 Jun 2023 15:30:23 +0000 (17:30 +0200)]
ci: restore lima farm

The ISP network issues are now resolved.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23951>

15 months agov3dv/device: update conformanceVersion
Alejandro Piñeiro [Mon, 3 Jul 2023 23:05:28 +0000 (01:05 +0200)]
v3dv/device: update conformanceVersion

The Vulkan CTS started generating the list of valid versions the
driver can report as conformant against based on the active branches,
and the branch we were reporting up to now is no longer valid.

Fixes dEQP-VK.api.driver_properties.conformance_version

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

15 months agobroadcom: Switch to use nir_foreach_function_impl
Yonggang Luo [Wed, 28 Jun 2023 10:47:10 +0000 (18:47 +0800)]
broadcom: Switch to use nir_foreach_function_impl

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23988>

15 months agov3d: Switch to use nir_foreach_function_impl
Yonggang Luo [Wed, 28 Jun 2023 10:40:46 +0000 (18:40 +0800)]
v3d: Switch to use nir_foreach_function_impl

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23988>

15 months agovc4: Convert to use nir_foreach_function_impl when possible
Yonggang Luo [Thu, 29 Jun 2023 18:54:48 +0000 (02:54 +0800)]
vc4: Convert to use nir_foreach_function_impl when possible

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23988>

15 months agointel/compiler: simplify reading of gl_NumWorkGroups in task/mesh
Marcin Ślusarz [Wed, 5 Apr 2023 10:16:33 +0000 (12:16 +0200)]
intel/compiler: simplify reading of gl_NumWorkGroups in task/mesh

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22334>

15 months agoanv,intel/compiler: enable shortcut in wg id to wg idx lowering on >= gfx12.5
Marcin Ślusarz [Fri, 31 Mar 2023 10:31:19 +0000 (12:31 +0200)]
anv,intel/compiler: enable shortcut in wg id to wg idx lowering on >= gfx12.5

This speeds up vk_meshlet_cadscene in "VK mesh ext" renderer by 1.4%

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22334>

15 months agonir: add cheap shortcut for wg id to wg idx lowering
Marcin Ślusarz [Fri, 31 Mar 2023 10:19:43 +0000 (12:19 +0200)]
nir: add cheap shortcut for wg id to wg idx lowering

... for platforms where integer division is expensive

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22334>

15 months agointel/compiler: pass num_workgroups from task to mesh shaders
Marcin Ślusarz [Fri, 31 Mar 2023 09:58:24 +0000 (11:58 +0200)]
intel/compiler: pass num_workgroups from task to mesh shaders

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22334>