platform/upstream/mesa.git
14 months agozink: add feedback loop usage for swapchains
Mike Blumenkrantz [Thu, 11 May 2023 14:33:35 +0000 (10:33 -0400)]
zink: add feedback loop usage for swapchains

affects:
GTF-GL46.gtf30.GL3Tests.framebuffer_blit.framebuffer_blit_functionality_linear_filter_color_blit

cc: mesa-stable

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22959>

14 months agovulkan/wsi: add feedback loop usage to swapchain caps if supported
Mike Blumenkrantz [Thu, 11 May 2023 14:42:15 +0000 (10:42 -0400)]
vulkan/wsi: add feedback loop usage to swapchain caps if supported

this is needed by some apps

cc: mesa-stable

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22959>

14 months agopvr: Fix deferred_control_stream_flags
James Glanville [Thu, 11 May 2023 12:29:28 +0000 (13:29 +0100)]
pvr: Fix deferred_control_stream_flags

Signed-off-by: James Glanville <james.glanville@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Fix seg fault on unused ds attachment
James Glanville [Thu, 11 May 2023 12:29:10 +0000 (13:29 +0100)]
pvr: Fix seg fault on unused ds attachment

Fixes:
  dEQP-VK.renderpass.suballocation.formats.r16g16_sint.input
    .dont_care.dont_care.self_dep_clear

Signed-off-by: James Glanville <james.glanville@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer image to buffer dest rect
Oskar Rundgren [Wed, 10 May 2023 10:45:17 +0000 (11:45 +0100)]
pvr: Transfer image to buffer dest rect

In copy to buffer region, set dest rect to region size.
The rectangle must be block size adjusted in case of block compressed
format.

Fix test: dEQP-VK.api.copy_and_blit.core.image_to_buffer.regions

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer optimisation remove unused features from API
Oskar Rundgren [Tue, 9 May 2023 15:21:46 +0000 (16:21 +0100)]
pvr: Transfer optimisation remove unused features from API

The transfer command "struct pvr_transfer_cmd" has support for
features not used by Vulkan: colour key, pattern, rop blit and
alpha blending

The whole "struct pvr_transfer_blit" can be removed. Also all code
related to transfer alpha blending can be removed.

This is an optimisation and doesn't fix any dEQP tests.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer check valid source address mask
Oskar Rundgren [Mon, 8 May 2023 20:14:15 +0000 (21:14 +0100)]
pvr: Transfer check valid source address mask

The mask should be inverted.

Fixes tests in dEQP-VK.api.copy_and_blit.* using the texel unwind workaround.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: fix texel unwind workaround mappings
Oskar Rundgren [Sun, 7 May 2023 11:53:01 +0000 (12:53 +0100)]
pvr: fix texel unwind workaround mappings

Fix the rectangle mappings used with texel unwind workaround (unaligned address).

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer remove byte unwind workaround
Oskar Rundgren [Sun, 7 May 2023 15:48:54 +0000 (16:48 +0100)]
pvr: Transfer remove byte unwind workaround

The byte unwind workaround can be used when source texture virtual
address doesn't meet HW requirements (is unaligned) and the pixel
format can't be changed i.e. destination is compressed. If
destination texture is not compressed the simpler texel extend
workaround can be used.

Currently byte unwind workaround has bugs so removing the
workaround fixes tests in
dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.* when they
instead use texel extend workaround.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer support flipped rectangle mapping
Oskar Rundgren [Sun, 7 May 2023 13:31:13 +0000 (14:31 +0100)]
pvr: Transfer support flipped rectangle mapping

The rectangles in "struct pvr_rect_mapping" are unsigned so a
flipped rectangle mapping isn't possible. Add new struct members
flip_x and flip_y to specify flipped mapping.

Add support for flipped rectangles in transfer copy blit path.
Support for flipped rectangles in the clip blit path is not done
in this change.

The new booleans are false by default because transfer command
"struct pvr_transfer_cmd" is zeroed on allocation in
pvr_transfer_cmd_alloc (pvr_blit.c).

Fixes:
  dEQP test case: dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests
    .mirror_xy.nearest

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer block compressed with 3d twiddled layout
Oskar Rundgren [Sun, 7 May 2023 18:02:54 +0000 (19:02 +0100)]
pvr: Transfer block compressed with 3d twiddled layout

Block compressed formats with 3d twiddled memory layout not supported.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: Transfer ignore non zero stride for twiddled surface
Oskar Rundgren [Sun, 7 May 2023 16:00:11 +0000 (17:00 +0100)]
pvr: Transfer ignore non zero stride for twiddled surface

Twiddled surfaces don't use stride but printing info about ignored
stride is not useful on debug driver.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agopvr: PBE fix mesa pipe swizzle conversion
Oskar Rundgren [Sun, 7 May 2023 20:00:27 +0000 (21:00 +0100)]
pvr: PBE fix mesa pipe swizzle conversion

The swizzle of pipe formats is described in
"struct util_format_description". The struct has array
"unsigned char swizzle[4];". The index of the array is the colour
channel  (in the order R, G, B and A). The value is what position
the colour channel is sourced from.

In PBE register settings (REG_SWIZ_CHAN[0-3]) the register index is
output channel position (and not colour). The colours are in the PBE
source channels - SWIZ_SOURCE_CHAN0 typically red.

The function pvr_get_pbe_hw_swizzle doesn't translate the swizzle
correctly. Remove function and replace with switch for each colour.
This could be done in a for loop, but there is just as much code
in the loop, it involves pointers and it's less readable for humans.
That's why I opted for this implementation.

Fixed test:
  dEQP-VK.api.copy_and_blit.core.image_to_image
    .all_formats.color.2d.r4g4b4a4_unorm_pack16.b4g4r4a4_unorm_pack16
and other with this pixel format.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22958>

14 months agoradv: fix resetting VRS if the graphics pipeline doesn't enable it
Samuel Pitoiset [Tue, 16 May 2023 10:14:24 +0000 (12:14 +0200)]
radv: fix resetting VRS if the graphics pipeline doesn't enable it

Otherwise the VRS state isn't reset and the graphics pipeline might
still use the previous VRS state. The VRS state will only be re-emitted
if it's different when the pipeline is bound.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9005
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23052>

14 months agollvmpipe: only include old Transform includes when needed
Pierre-Eric Pelloux-Prayer [Fri, 12 May 2023 07:58:26 +0000 (09:58 +0200)]
llvmpipe: only include old Transform includes when needed

This fixes building with recent LLVM where these 2 .h files
were removed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8671
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22980>

14 months agoradv: fix emitting VRS state with a null fragment shader
Samuel Pitoiset [Tue, 16 May 2023 09:58:42 +0000 (11:58 +0200)]
radv: fix emitting VRS state with a null fragment shader

Found this while debugging a VRS issue with Valhalla.

Fixes: 87245c6e8e6 ("radv: handle NULL fragment shaders when recording cmdbuf")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23050>

14 months agollvmpipe/cs: refactor cs generator args to use an enum
Dave Airlie [Tue, 16 May 2023 07:36:43 +0000 (17:36 +1000)]
llvmpipe/cs: refactor cs generator args to use an enum

This was horror I should have cleaned up before, clean it up before
mesh shaders make it worse.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agodraw: move to use common sampler/image binding code
Dave Airlie [Thu, 4 May 2023 20:44:55 +0000 (06:44 +1000)]
draw: move to use common sampler/image binding code

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agollvmpipe: move to common sampler/image binding code
Dave Airlie [Thu, 4 May 2023 20:39:44 +0000 (06:39 +1000)]
llvmpipe: move to common sampler/image binding code

This leaves the cache stuff in place, but we should consider trying
to consolidate that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agogallivm: add common code for sample/image tracking.
Dave Airlie [Thu, 4 May 2023 20:36:25 +0000 (06:36 +1000)]
gallivm: add common code for sample/image tracking.

Now that the other code is consoldiated it makes sense to just
consolidate this binding code between the drivers and core

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agogallivm/draw/llvmpipe: consolidate the sampler/image dynamic state fns
Dave Airlie [Sat, 27 Aug 2022 00:01:20 +0000 (10:01 +1000)]
gallivm/draw/llvmpipe: consolidate the sampler/image dynamic state fns

These can all be the same now.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agogallivm: refactor common resources out of contexts
Dave Airlie [Fri, 26 Aug 2022 20:35:43 +0000 (06:35 +1000)]
gallivm: refactor common resources out of contexts

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agollvmpipe: refactor fs/cs jit structure members.
Dave Airlie [Fri, 26 Aug 2022 07:17:34 +0000 (17:17 +1000)]
llvmpipe: refactor fs/cs jit structure members.

This lines them up just like the draw ones.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agodraw: align common members in jit context structs.
Dave Airlie [Fri, 26 Aug 2022 07:06:59 +0000 (17:06 +1000)]
draw: align common members in jit context structs.

this makes all the structs have the same baseline members for
resources and aniso_filter_table.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22788>

14 months agofreedreno: implement GL_ARB_indirect_parameters
Amber [Tue, 28 Feb 2023 13:19:19 +0000 (14:19 +0100)]
freedreno: implement GL_ARB_indirect_parameters

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

14 months agoir3, freedreno: implement GL_ARB_shader_draw_parameters
Amber [Tue, 28 Feb 2023 13:14:35 +0000 (14:14 +0100)]
ir3, freedreno: implement GL_ARB_shader_draw_parameters

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

14 months agonir: Remove legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 15:04:57 +0000 (11:04 -0400)]
nir: Remove legacy atomics

The intrinsics are now totally dead and can be removed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/opt_uniform_atomics: Drop legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 15:15:50 +0000 (11:15 -0400)]
nir/opt_uniform_atomics: Drop legacy atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/opt_load_store_vectorize: Reclaim ATOMIC
Alyssa Rosenzweig [Mon, 15 May 2023 15:07:20 +0000 (11:07 -0400)]
nir/opt_load_store_vectorize: Reclaim ATOMIC

NEW_ATOMIC isn't so new anymore.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/validate: Drop legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:32:20 +0000 (10:32 -0400)]
nir/validate: Drop legacy atomics

We duplicated the validation for unified vs legacy atomics, so drop the unused
latter set.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/lower_task_shader: Drop legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:31:50 +0000 (10:31 -0400)]
nir/lower_task_shader: Drop legacy atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/lower_io: Drop legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:31:11 +0000 (10:31 -0400)]
nir/lower_io: Drop legacy atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir: Drop legacy atomics in simple cases
Alyssa Rosenzweig [Mon, 15 May 2023 14:30:28 +0000 (10:30 -0400)]
nir: Drop legacy atomics in simple cases

This commit drops legacy atomic support from core passes where we can simply
delete switch cases with no other changes. As such it's separated from the
more complex pass-specific commits for ease of review.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agontt: Stop handling legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:20:29 +0000 (10:20 -0400)]
ntt: Stop handling legacy atomics

Not seen.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir: Drop nir_lower_legacy_atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:19:20 +0000 (10:19 -0400)]
nir: Drop nir_lower_legacy_atomics

No more users.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agotreewide: Stop lowering legacy atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:18:18 +0000 (10:18 -0400)]
treewide: Stop lowering legacy atomics

There are no more producers of legacy atomics so these calls are inert.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agoac: Produce unified atomic
Alyssa Rosenzweig [Mon, 15 May 2023 15:22:15 +0000 (11:22 -0400)]
ac: Produce unified atomic

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agointel: Produce unified atomics
Alyssa Rosenzweig [Mon, 15 May 2023 15:19:04 +0000 (11:19 -0400)]
intel: Produce unified atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agovtn: Produce unified atomics
Alyssa Rosenzweig [Mon, 15 May 2023 14:16:12 +0000 (10:16 -0400)]
vtn: Produce unified atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agomesa/st: Produce unified atomics
Alyssa Rosenzweig [Mon, 15 May 2023 15:27:15 +0000 (11:27 -0400)]
mesa/st: Produce unified atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/lower_printf: Produce unified atomic
Alyssa Rosenzweig [Mon, 15 May 2023 15:14:31 +0000 (11:14 -0400)]
nir/lower_printf: Produce unified atomic

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agonir/lower_atomics_to_ssbo: Produce unified atomics
Alyssa Rosenzweig [Fri, 12 May 2023 15:13:46 +0000 (11:13 -0400)]
nir/lower_atomics_to_ssbo: Produce unified atomics

This could be simplified if we unified also atomic counters, but that's out of
scope for this series.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agoglsl/nir: Produce unified atomics
Alyssa Rosenzweig [Fri, 12 May 2023 13:14:30 +0000 (09:14 -0400)]
glsl/nir: Produce unified atomics

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agolavapipe: Lower legacy atomics sooner
Alyssa Rosenzweig [Mon, 15 May 2023 13:05:47 +0000 (09:05 -0400)]
lavapipe: Lower legacy atomics sooner

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agov3dv: Lower legacy atomics earlier
Alyssa Rosenzweig [Mon, 15 May 2023 13:02:57 +0000 (09:02 -0400)]
v3dv: Lower legacy atomics earlier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agotu: Lower legacy atomics earlier
Alyssa Rosenzweig [Mon, 15 May 2023 13:01:12 +0000 (09:01 -0400)]
tu: Lower legacy atomics earlier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agopanvk: Lower legacy atomics earlier
Alyssa Rosenzweig [Mon, 15 May 2023 12:58:45 +0000 (08:58 -0400)]
panvk: Lower legacy atomics earlier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agopan/mdg: Lower legacy atomics earlier
Alyssa Rosenzweig [Mon, 15 May 2023 12:57:44 +0000 (08:57 -0400)]
pan/mdg: Lower legacy atomics earlier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agoagx: Lower legacy atomics sooner
Alyssa Rosenzweig [Mon, 15 May 2023 12:51:12 +0000 (08:51 -0400)]
agx: Lower legacy atomics sooner

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23036>

14 months agovenus: bump ring space to 128K
Yiwei Zhang [Tue, 16 May 2023 17:14:06 +0000 (10:14 -0700)]
venus: bump ring space to 128K

The absolute memory overhead is still trivial enough not worth a
driconfig.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23060>

14 months agoaco: use c++17
Erik Faye-Lund [Tue, 16 May 2023 08:05:03 +0000 (10:05 +0200)]
aco: use c++17

std::map::try_emplace requires C++17, so we need to make sure we're
compiling with C++17 enabled.

Fixes: 8aff7152a0f ("aco: make IDSet sparse")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23047>

14 months agofrontends/va/context: return error if context_id == 0
Thong Thai [Thu, 11 May 2023 19:10:55 +0000 (15:10 -0400)]
frontends/va/context: return error if context_id == 0

When destroying a context, check the context_id, preventing the
handle_table_get function from producing the following error:

handle_table_get: Assertion `handle' failed.

Cc: stable
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22970>

14 months agorusticl/platform: generate extension constants via macro
Karol Herbst [Mon, 15 May 2023 20:12:15 +0000 (22:12 +0200)]
rusticl/platform: generate extension constants via macro

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>

14 months agorusticl: explicitly state supported SPIR-V extensions
Karol Herbst [Mon, 15 May 2023 16:46:47 +0000 (18:46 +0200)]
rusticl: explicitly state supported SPIR-V extensions

We'll need to be explicit about supported extensions.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>

14 months agorusticl/device: split add_ext in fill_extensions
Karol Herbst [Mon, 15 May 2023 14:02:45 +0000 (16:02 +0200)]
rusticl/device: split add_ext in fill_extensions

The initial hope was that we'd get extension and feature pairs more often.
Reality isn't as nice so just split it up.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>

14 months agorusticl/platform: advertise byte_addressable_store
Karol Herbst [Mon, 15 May 2023 13:51:36 +0000 (15:51 +0200)]
rusticl/platform: advertise byte_addressable_store

From the list of extensions we support on all devices it's the only one we
rely on for all devices.

There might be some devices not supporting atomics so keep them out there
for now.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>

14 months agorusticl/device: use PLATFORM_EXTENSIONS as a template for filling extensions
Karol Herbst [Mon, 15 May 2023 13:50:19 +0000 (15:50 +0200)]
rusticl/device: use PLATFORM_EXTENSIONS as a template for filling extensions

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>

14 months agoReviewed-by: Nora Allen <blackcatgames@protonmail.com>rusticl/platform: make the...
Karol Herbst [Mon, 15 May 2023 13:49:46 +0000 (15:49 +0200)]
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>rusticl/platform: make the extension array a static
This way we can use it inside `Device::fill_extensions`

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23031>

14 months agov3d: delay offset/counter values with primitive restart
Juan A. Suarez Romero [Wed, 26 Apr 2023 14:17:27 +0000 (16:17 +0200)]
v3d: delay offset/counter values with primitive restart

Some values like the transform feedback offset or the number of output
vertices in VS can be obtained knowing how many vertices and primitive
type are used in the drawcall.

But when the primitive restart is enabled, doing this is quite more
complex, as we should parse the vertex buffer to know where is the
restart values, and so on.

In this case, delay this computation after the drawcall is executed, by
querying the GPU to know these values.

Similarly, this delay is also applied to compute the transform feedback
buffer offsets when there is a geometry shader, as we don't know
beforehand how many vertices it is going to output.

This fixes `spec@!opengl 3.1@primitive-restart-xfb flush` and
`spec@!opengl 3.1@primitive-restart-xfb generated`.

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

14 months agoaco: emit_wqm on MIMG dst, not operands
Georg Lehmann [Thu, 11 May 2023 09:46:42 +0000 (11:46 +0200)]
aco: emit_wqm on MIMG dst, not operands

Now p_wqm always kills its operand, so no movs will be created for it.
Long term we want to remove p_wqm in favor of a Definition flag,
so this is also a step in that direction.

Foz-DB Navi21:
Totals from 45351 (33.63% of 134864) affected shaders:
VGPRs: 2099552 -> 2116192 (+0.79%); split: -0.14%, +0.93%
CodeSize: 179530772 -> 179072104 (-0.26%); split: -0.29%, +0.03%
MaxWaves: 1054740 -> 1052262 (-0.23%); split: +0.10%, -0.33%
Instrs: 33238535 -> 33188347 (-0.15%); split: -0.17%, +0.02%
Latency: 451000471 -> 450869384 (-0.03%); split: -0.11%, +0.08%
InvThroughput: 86026785 -> 86286288 (+0.30%); split: -0.11%, +0.41%
VClause: 633291 -> 623920 (-1.48%); split: -1.91%, +0.43%
SClause: 1436708 -> 1431395 (-0.37%); split: -0.60%, +0.23%
Copies: 2166563 -> 2122592 (-2.03%); split: -2.29%, +0.26%
Branches: 706846 -> 706838 (-0.00%); split: -0.00%, +0.00%
PreSGPRs: 1976162 -> 1976592 (+0.02%)
PreVGPRs: 1797409 -> 1794704 (-0.15%)

MaxWaves regressions in Detroit: Become Human MaxWaves seem to be due
to the scheduler choosing to schedule more aggressively.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22956>

14 months agointel/devinfo: call intel_device_info_init_was only once
Lionel Landwerlin [Thu, 11 May 2023 07:13:27 +0000 (10:13 +0300)]
intel/devinfo: call intel_device_info_init_was only once

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8958

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22862>

14 months agointel/devinfo: allow -p to take a pci-id in hexa
Lionel Landwerlin [Thu, 11 May 2023 07:17:49 +0000 (10:17 +0300)]
intel/devinfo: allow -p to take a pci-id in hexa

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22862>

14 months agointel/devinfo: printout on stdout
Lionel Landwerlin [Thu, 11 May 2023 07:12:45 +0000 (10:12 +0300)]
intel/devinfo: printout on stdout

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22862>

14 months agonir: Add helpers for lazy var creation.
Emma Anholt [Tue, 2 May 2023 22:40:51 +0000 (15:40 -0700)]
nir: Add helpers for lazy var creation.

This should make writing some lowering/meta code easier.  It also keeps
the num_inputs/outputs updated, when sometimes passes forgot to do so (for
example, nir_lower_input_attachments updated for one of the two vars it
creates).  The names of the variables change in many cases, but it's
probably nicer to see "VERT_ATTRIB_POS" than "in_0" or whatever.

I've only converted mesa core (compiler and GL), not all the driver meta
code.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22809>

14 months agocompiler: Update reference to name_for_stage func.
Emma Anholt [Tue, 2 May 2023 22:57:35 +0000 (15:57 -0700)]
compiler: Update reference to name_for_stage func.

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

14 months agonir/lower_shader_calls: Remat derefs earlier
Konstantin Seurer [Sat, 13 May 2023 17:35:14 +0000 (19:35 +0200)]
nir/lower_shader_calls: Remat derefs earlier

spill_ssa_defs_and_lower_shader_calls can insert phis as well which can
make nir_opt_shrink_stores crash.

Fixes: 200e551c ("nir/lower_shader_calls: Remat derefs before lowering resumes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9003
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23007>

14 months agopvr: Transfer add s8_uint support
Oskar Rundgren [Fri, 5 May 2023 09:50:14 +0000 (10:50 +0100)]
pvr: Transfer add s8_uint support

Replacing pvr_get_transfer_pbe_packmode with pvr_get_pbe_packmode
fixes many depth stencil deqp tests.

Replacing assert "Handle depth stencil format swizzle." with an
actual swizzle fixes tests using S8_UINT.

The swizzle for VK_FORMAT_S8_UINT returned from
pvr_get_format_swizzle (in pvr_image_state_set_codegen_defaults)
isn't correct. Modify the swizzle for format VK_FORMAT_S8_UINT.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Transfer add depth merge support for X8_D24
Oskar Rundgren [Fri, 5 May 2023 09:43:43 +0000 (10:43 +0100)]
pvr: Transfer add depth merge support for X8_D24

Add depth merge support for VK_FORMAT_X8_D24_UNORM_PACK32 as source.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Add PBE packmode for depth stencil formats
Oskar Rundgren [Fri, 5 May 2023 09:40:29 +0000 (10:40 +0100)]
pvr: Add PBE packmode for depth stencil formats

Add PBE packmode for depth stencil formats

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Add back S8_UINT support
Oskar Rundgren [Fri, 5 May 2023 09:16:41 +0000 (10:16 +0100)]
pvr: Add back S8_UINT support

Revert "pvr: Don't advertise S8_UINT support"

Adding back support for S8_UINT format. It's used in many deqp tests.
Example:
  dEQP-VK.api.copy_and_blit.core.image_to_image.all_formats
    .depth_stencil.2d.d24_unorm_s8_uint_d24_unorm_s8_uint.optimal_optimal

This reverts commit ff07610462d5100a1ade101c1960beb4a454e7ce.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Transfer multiple emits clip rectangle
Oskar Rundgren [Fri, 5 May 2023 08:21:05 +0000 (09:21 +0100)]
pvr: Transfer multiple emits clip rectangle

Adjust PBE clip rectangle for second emit.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Transfer fix blit with multiple emits
Oskar Rundgren [Thu, 4 May 2023 17:34:42 +0000 (18:34 +0100)]
pvr: Transfer fix blit with multiple emits

The PBE state words for second emit are at wrong offset. Add new
define ROGUE_NUM_PBESTATE_REG_WORDS_FOR_TRANSFER to fix the offset.
The last word is always 0.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Use original binding numbers instead of reassigning
Karmjit Mahil [Thu, 4 May 2023 14:25:40 +0000 (15:25 +0100)]
pvr: Use original binding numbers instead of reassigning

Previously, in the descriptor set layout, if there were gaps
within the binding numbers, the code would remove the gap and
assign a sequential binding number to each.

This is causes problems when looking up the binding on a
vkUpdateDescriptorSets() as the user would still be providing the
original binding numbers. If gaps were removed and binding
number re-assigned, the binding could either not be found, or a
different binding was found instead of the desired one.

Let's not re-assign binding numbers and just use the original
ones.

This fixes the following assert being hit:
  `pvr_descriptor_set.c:1890: pvr_write_descriptor_set:
   Assertion `binding' failed.`
on dEQP tests such as:
  dEQP-VK.glsl.opaque_type_indexing.ubo.uniform_vertex
  dEQP-VK.glsl.opaque_type_indexing.ubo.uniform_fragment
  ...

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Add missing NULL checks in some vkDestroy...() functions
Karmjit Mahil [Thu, 4 May 2023 15:37:28 +0000 (16:37 +0100)]
pvr: Add missing NULL checks in some vkDestroy...() functions

Seems like `dEQP-VK.api.null_handle.destroy_device` was already
passing but let's add the null check in case of future changes
which might not accept NULL.

Fixes:
  dEQP-VK.api.null_handle.destroy_descriptor_set_layout
  dEQP-VK.api.null_handle.destroy_pipeline_layout
  dEQP-VK.api.null_handle.destroy_query_pool

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Transfer PBE gamma is unset
Oskar Rundgren [Wed, 3 May 2023 18:14:16 +0000 (19:14 +0100)]
pvr: Transfer PBE gamma is unset

PBE gamma is set in pvr_pbe_get_src_format_and_gamma but later
always set to NONE. Should be enabled for SRGB formats.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Transfer PBE source snorm format should be signed
Oskar Rundgren [Wed, 3 May 2023 16:56:13 +0000 (17:56 +0100)]
pvr: Transfer PBE source snorm format should be signed

Wrong shader was picked because snorm formats were treated as unsigned.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Allow block compressed source blit
Oskar Rundgren [Wed, 3 May 2023 13:15:53 +0000 (14:15 +0100)]
pvr: Allow block compressed source blit

Allow blit from block compressed formats to unorm and float formats.

Signed-off-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agopvr: Fix cs corruption in pvr_pack_clear_vdm_state()
Karmjit Mahil [Tue, 2 May 2023 16:23:34 +0000 (17:23 +0100)]
pvr: Fix cs corruption in pvr_pack_clear_vdm_state()

VDMCTRL_INDEX_LIST3 is packed conditionally which can cause the
generation of a corrupted control stream as the function mandated
the provided buffer to be of a fixed size always including the
possibly unpacked word. This would leave a gap in the control
stream when the caller ends up copying the buffer into the control
stream.

Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22918>

14 months agotu: Use common GetPhysicalDeviceFeatures2
Alyssa Rosenzweig [Fri, 12 May 2023 21:47:00 +0000 (17:47 -0400)]
tu: Use common GetPhysicalDeviceFeatures2

Delete the code. This isn't quite as nice as for the C drivers, because we can't
use a designated initializer in C++ without matching the order and this is an
autogenerated struct where it may not necessarily make sense to fix an order.
Not a big deal to workaround though.

Tested by diff'ing vulkaninfo output before/after the patch and confirming no
changes (other than the driverInfo git sha, the pipelineCacheUUID, the
driverUUID, and slight fluctuation in the memory budget).

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

14 months agolvp: Use common GetPhysicalDeviceFeatures2
Alyssa Rosenzweig [Fri, 12 May 2023 20:46:52 +0000 (16:46 -0400)]
lvp: Use common GetPhysicalDeviceFeatures2

This is a big delete-the-code win. Tested by diff'ing vulkaninfo output
before/after the patch and confirming no changes (other than the driverInfo git
sha and the pipelineCacheUUID).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23000>

14 months agoradv/ci: document more flakes for navi21
Martin Roukala (né Peres) [Mon, 15 May 2023 06:35:32 +0000 (09:35 +0300)]
radv/ci: document more flakes for navi21

The following flakes were found in the latest stress run:

 * dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.2_cmdbuffers_resuming
 * dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_primary_cmdbuffers_resuming

Rather than documenting them directly, let's use a broad regular
expression, to match the already-existing `dEQP-VK.dynamic_rendering.basic.*`.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23014>

14 months agozink: Move the workaround before the EDS setting.
MrRobbin [Tue, 16 May 2023 05:54:49 +0000 (13:54 +0800)]
zink: Move the workaround before the EDS setting.

 Then we can guarantee the settings correct, otherwise the  'screen->info.have_EXT_extended_dynamic_state3 = false' and 'screen->info.have_EXT_vertex_input_dynamic_state = false'
 will be enable, but actually we should disable it when 'have_EXT_extended_dynamic_state2 = false'.

Fixes: d5cf6f7d2f9 ("zink: disable dynamic state exts if the previous ones aren't present")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23046>

14 months agocrocus: fix scratch_bos memory leak
Patrick Lerda [Tue, 9 May 2023 18:22:40 +0000 (20:22 +0200)]
crocus: fix scratch_bos memory leak

This change is inspired from iris_destroy_context().

For instance, this issue is triggered with
"piglit/bin/glsl-1.50-gs-max-output -scan 1 20 -auto -fbo":
Direct leak of 320 byte(s) in 2 object(s) allocated from:
    #0 0x7f34fc769987 in calloc (/usr/lib64/libasan.so.6+0xb1987)
    #1 0x7f34f4fa168a in bo_calloc ../src/gallium/drivers/crocus/crocus_bufmgr.c:288
    #2 0x7f34f4fa168a in alloc_fresh_bo ../src/gallium/drivers/crocus/crocus_bufmgr.c:350
    #3 0x7f34f4fa168a in bo_alloc_internal ../src/gallium/drivers/crocus/crocus_bufmgr.c:419
    #4 0x7f34f4fe50a9 in crocus_get_scratch_space ../src/gallium/drivers/crocus/crocus_program.c:2678
    #5 0x7f34f55e8954 in crocus_upload_dirty_render_state ../src/gallium/drivers/crocus/crocus_state.c:6871
    #6 0x7f34f55e8954 in crocus_upload_render_state ../src/gallium/drivers/crocus/crocus_state.c:7812
    #7 0x7f34f5d9f680 in crocus_simple_draw_vbo ../src/gallium/drivers/crocus/crocus_draw.c:332
    #8 0x7f34f5d9f680 in crocus_draw_vbo ../src/gallium/drivers/crocus/crocus_draw.c:438
    #9 0x7f34f1d2eeba in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3735
    #10 0x7f34f1d12e03 in batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:394
    #11 0x7f34f1d12e03 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:445
    #12 0x7f34f1d22c9a in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:680
    #13 0x7f34f1d238f8 in tc_texture_map ../src/gallium/auxiliary/util/u_threaded_context.c:2754
    #14 0x7f34f120b9d9 in pipe_texture_map_3d ../src/gallium/auxiliary/util/u_inlines.h:579
    #15 0x7f34f120b9d9 in st_ReadPixels ../src/mesa/state_tracker/st_cb_readpixels.c:530
    #16 0x7f34f10d7355 in read_pixels ../src/mesa/main/readpix.c:1178
    #17 0x7f34f10d7355 in _mesa_ReadnPixelsARB ../src/mesa/main/readpix.c:1195
    #18 0x7f34f10d7e10 in _mesa_ReadPixels ../src/mesa/main/readpix.c:1210

Fixes: f3630548f1da ("f3630548f1da crocus: initial gallium driver for Intel gfx 4-7")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23019>

14 months agopvr: switch pvr_spm to use pvr_bo_suballoc
Luigi Santivetti [Wed, 10 May 2023 07:29:54 +0000 (08:29 +0100)]
pvr: switch pvr_spm to use pvr_bo_suballoc

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22940>

14 months agopvr: switch pvr_clear to use pvr_bo_suballoc
Luigi Santivetti [Wed, 10 May 2023 07:29:49 +0000 (08:29 +0100)]
pvr: switch pvr_clear to use pvr_bo_suballoc

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22940>

14 months agopvr: switch pvr_descriptor_set_create to use pvr_bo_suballoc
Luigi Santivetti [Wed, 10 May 2023 07:29:46 +0000 (08:29 +0100)]
pvr: switch pvr_descriptor_set_create to use pvr_bo_suballoc

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22940>

14 months agopvr: switch pvr_cmd_buffer_alloc_mem to use pvr_bo_suballoc
Luigi Santivetti [Wed, 10 May 2023 07:29:41 +0000 (08:29 +0100)]
pvr: switch pvr_cmd_buffer_alloc_mem to use pvr_bo_suballoc

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22940>

14 months agopvr: switch pvr_gpu_upload_* to use pvr_bo_suballoc
Luigi Santivetti [Wed, 10 May 2023 07:29:35 +0000 (08:29 +0100)]
pvr: switch pvr_gpu_upload_* to use pvr_bo_suballoc

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22940>

14 months agopvr: introduce suballocator for internal allocations
Luigi Santivetti [Wed, 10 May 2023 07:29:15 +0000 (08:29 +0100)]
pvr: introduce suballocator for internal allocations

Add implementation for a simple sub-allocator in order to save
memory when doing internal driver allocations.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22940>

14 months agoradv: small fix for VkDescriptorSetVariableDescriptorCountLayoutSupport
George Ouzounoudis [Sun, 14 May 2023 07:54:35 +0000 (10:54 +0300)]
radv: small fix for VkDescriptorSetVariableDescriptorCountLayoutSupport

The VkDescriptorSetVariableDescriptorCountLayoutSupport structure should
be in the pNext chain of VkDescriptorSetLayoutSupport.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23009>

14 months agomesa: set a type for depth fallback texture
Tapani Pälli [Mon, 15 May 2023 05:34:35 +0000 (08:34 +0300)]
mesa: set a type for depth fallback texture

Otherwise we will later attempt to figure out format with type GL_NONE
which is not handled by _mesa_format_from_format_and_type.

Fixes: 0c6e56c391a ("mesa: (more) correctly handle incomplete depth textures")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9012
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23013>

14 months agodrm-shim: Use anonymous file for file override
Joshua Watt [Wed, 31 Aug 2022 13:15:29 +0000 (08:15 -0500)]
drm-shim: Use anonymous file for file override

Using a pipe might mean that either the read or write call can block,
most likely deadlocking the calling process. Instead, write the contents
in an anonymous file when the file is opened to be read back.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18341>

14 months agodrm-shim: Set file type in readdir()
Joshua Watt [Wed, 31 Aug 2022 13:04:39 +0000 (08:04 -0500)]
drm-shim: Set file type in readdir()

Some programs (in particular, older QEMU) will check the type of the
rendernode returned in readdir() to see if it is a character device
before opening it.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18341>

14 months agoac/llvm: remove redundant nir_lower_legacy_atomics
Qiang Yu [Mon, 15 May 2023 08:30:52 +0000 (16:30 +0800)]
ac/llvm: remove redundant nir_lower_legacy_atomics

Now both radeonsi and radv call it in driver.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23018>

14 months agoradeonsi: fix aco compile for atomic ops
Qiang Yu [Mon, 15 May 2023 08:03:13 +0000 (16:03 +0800)]
radeonsi: fix aco compile for atomic ops

LLVM path will do this in ac_nir_translate(), ACO path
need driver to handle it.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23018>

14 months agoac/llvm: remove the double frcp special handling
Qiang Yu [Mon, 15 May 2023 03:23:06 +0000 (11:23 +0800)]
ac/llvm: remove the double frcp special handling

KHR-GL45.gpu_shader_fp64.builtin.mod_* relaxed precision
requirement.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23012>

14 months agoci/freedreno: add recent a630 flake
David Heidelberg [Tue, 16 May 2023 00:13:40 +0000 (01:13 +0100)]
ci/freedreno: add recent a630 flake

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23044>

14 months agoci/venus: add recent flakes
David Heidelberg [Tue, 16 May 2023 00:07:37 +0000 (01:07 +0100)]
ci/venus: add recent flakes

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23043>

14 months agoanv: enable the GPL feature based on whether the extension is supported
Iván Briano [Mon, 15 May 2023 22:10:39 +0000 (15:10 -0700)]
anv: enable the GPL feature based on whether the extension is supported

Instead of checking if the very same bit we want to enable is already
enabled, which obviously doesn't work.

Fixes: fbc0e74bdac ("anv: enable graphics pipeline libraries by default")

Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23039>

14 months agozink: flag batch usage on swapchain images
Mike Blumenkrantz [Thu, 11 May 2023 13:29:34 +0000 (09:29 -0400)]
zink: flag batch usage on swapchain images

while swapchains themselves are protected against early deletion
during presentation, there is nothing protecting them from
deletion while they are rendering if a swapchain updates
while rendering but before presentation

to address this, add batch usage to swapchains which can be
checked during pruning to ensure a rendering swapchain isn't
pruned

Fixes: dc8c9d20568 ("zink: prune old swapchains on present")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22962>