platform/upstream/mesa.git
20 months agoclover: Fixes building with mingw-x86
Yonggang Luo [Tue, 8 Nov 2022 11:07:35 +0000 (19:07 +0800)]
clover: Fixes building with mingw-x86

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit f25d483e1bd493fdf6f0f8148259ed085d705617)

20 months agoclover: Rename *OpenCL.def to *OpenCL.def.in
Yonggang Luo [Wed, 9 Nov 2022 02:30:57 +0000 (10:30 +0800)]
clover: Rename *OpenCL.def to *OpenCL.def.in

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit a3b26e2758d7fce890717e2679bd0e25ca1330d2)

20 months agomeson: fixes mingw-clang32 building
Yonggang Luo [Tue, 8 Nov 2022 12:48:30 +0000 (20:48 +0800)]
meson: fixes mingw-clang32 building

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit ab20ec9da76d77ae3942ecf1031366d29a4dff7b)

20 months agomeson: Refactoring shared gen_vs_module_defs_normal_command out
Yonggang Luo [Tue, 8 Nov 2022 12:32:07 +0000 (20:32 +0800)]
meson: Refactoring shared gen_vs_module_defs_normal_command out

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit f03421702cc35059e4ead86839906ddfcf05bdc7)

20 months agoradv: Fixes prototypes
Yonggang Luo [Tue, 8 Nov 2022 12:15:10 +0000 (20:15 +0800)]
radv: Fixes prototypes

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit e5656f07c7a65b1d143684671cd8235af099a84c)

20 months agoutil/glsl2spirv: fix appending extra flags
Dylan Baker [Tue, 1 Nov 2022 19:49:53 +0000 (12:49 -0700)]
util/glsl2spirv: fix appending extra flags

The variable is called `extra`, but what's written is `extra - flags`,
and `flags` is undefined, so if the variable was ever passed there would
be an uncaught exception.

fixes: 9786d9ef2abb45a4e832cf1347581e3ca3aae9f0

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
(cherry picked from commit 4ffa8a9ac010f3db79b1e872f7e664a4470cb981)

20 months agoutil/glsl2spirv: fix type error in argument handling
Dylan Baker [Tue, 1 Nov 2022 19:40:21 +0000 (12:40 -0700)]
util/glsl2spirv: fix type error in argument handling

args.Olib is set to `store_true`, which means it will always be `True`
or `False`, this means that the we always, unconditionally, add
`--keep-uncalled` to the command line.

fixes: 9786d9ef2abb45a4e832cf1347581e3ca3aae9f0

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
(cherry picked from commit 76e3b482be125cc0a2edd75bdeb14d4a6e9232fb)

20 months agoir3/ra: Make sure we don't pick a preferred reg overflowing the file.
Emma Anholt [Wed, 9 Nov 2022 20:23:53 +0000 (12:23 -0800)]
ir3/ra: Make sure we don't pick a preferred reg overflowing the file.

If we're in handle_collect()'s dst allocation and are part of a merge set
near the end of the file, our check for reg_elem_size(reg) would let us
use the preferred reg when that would immediately lead to
allocate_dst_fixed() creating an interval extending thruogh reg_size(reg)
that overflows the file.

Avoids a regression on gfxbench5/gl_5_high_off/17.shader_test in the next
commit.  No change on shader-db.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18946>
(cherry picked from commit a39113b616099a7bcce9e62337731f040c7cad64)

20 months agodocs: fixup broken link syntax
Erik Faye-Lund [Mon, 7 Nov 2022 12:11:13 +0000 (13:11 +0100)]
docs: fixup broken link syntax

Seems I got this slightly wrong when I fixed up the previous syntax
issue. Whoops, let's fix that!

Fixes: 6b3b6333915 ("docs/zink: fix and cleanup rst syntax")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
(cherry picked from commit ef05d28aa276aebbcf48400a5bef11de20e8b1c9)

20 months agoanv: fixup invalid enum for nir environment
Lionel Landwerlin [Thu, 10 Nov 2022 09:34:50 +0000 (11:34 +0200)]
anv: fixup invalid enum for nir environment

Also switching away from PIPE_

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8c4c4c3ee1a2 ("anv: Add softtp64 workaround")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19638>
(cherry picked from commit 68fd9d28294ee91033690b2288c55480c4125577)

20 months agopanfrost: Require 64-byte alignment on imports
Alyssa Rosenzweig [Mon, 7 Nov 2022 18:49:51 +0000 (13:49 -0500)]
panfrost: Require 64-byte alignment on imports

While Panfrost allocates linear images with strides that are a multiple of 64
bytes, other dma-buf producers on the system may not satisfy this requirement.
However, at least on v7 and newer, any image with a regular format must have a
stride that is a multiple of 64 bytes.

This fixes a real bug in an application that created a linear R8_UNORM image
with stride 480 bytes, imported it as an EGL_image, and then tried to texture
from it with the GPU. Previously, the driver allowed this situation but it
resulted in an imprecise fault from the GPU. This patch corrects the driver to
reject the import as invalid due to the unaligned stride, ensuring we never
attempt to texture from such a resource.

To implement, we add some new layout queries to centralize knowledge about the
stride alignment requirements, and we sprinkle in asserts to show how the
invariant is upheld throughout the lifecycle of image creation to texturing.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19620>
(cherry picked from commit 811f8a19469722bea32f3c539b8cf0939fe3b057)

20 months agoglsl: fix buffer texture type
Karol Herbst [Wed, 26 Oct 2022 14:56:41 +0000 (16:56 +0200)]
glsl: fix buffer texture type

Fixes: 3ace6b968b3 ("compiler/types: Add a texture type")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
(cherry picked from commit 87526f79db68a13ebd448cfd6b1be4b25616c801)

20 months agoac/nir: do not convert GS outputs to the expected variable size on GFX11
Samuel Pitoiset [Tue, 1 Nov 2022 09:59:08 +0000 (09:59 +0000)]
ac/nir: do not convert GS outputs to the expected variable size on GFX11

Outputs are always considered 32-bits.
Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19612>
(cherry picked from commit d2563e6600fd74dc000fdb031d17d54971ff67cb)

20 months agomesa: fix typo from adding glGetObjectLabelEXT
Timothy Arceri [Tue, 8 Nov 2022 22:56:14 +0000 (09:56 +1100)]
mesa: fix typo from adding glGetObjectLabelEXT

Fixes:  675bcbb7a1c0 ("mesa: add EXT_debug_label support")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19607>
(cherry picked from commit e295ee778bd6f136bdca67121f8b0fcb50b3e3d4)

20 months ago.pick_status.json: Update to 9bd11f65238ce101bf846f5528f9088630e983f7
Eric Engestrom [Thu, 10 Nov 2022 21:13:08 +0000 (21:13 +0000)]
.pick_status.json: Update to 9bd11f65238ce101bf846f5528f9088630e983f7

20 months agoVERSION: bump for 22.3.0-rc2
Eric Engestrom [Wed, 9 Nov 2022 21:24:41 +0000 (21:24 +0000)]
VERSION: bump for 22.3.0-rc2

20 months agobroadcom/compiler: avoid using ldvary sequence to hide latency of branching
Iago Toral Quiroga [Wed, 9 Nov 2022 12:07:45 +0000 (13:07 +0100)]
broadcom/compiler: avoid using ldvary sequence to hide latency of branching

This can cause us to stomp the contents of r5 before we have a chance to read
it, like this:

0x3d103186bb800000 nop                           ; nop                         ; ldvary.r0
0x3d105686bbf40000 nop                           ; mov rf26, r5                ; ldvary.r1
0x020000ef0000d000 bu.allna  232, r:unif (0x0000001c / 0.000000)
0x3d1096c6bbf40000 nop                           ; mov rf27, r5                ; ldvary.r2

Here, the MOV in the last instruction is supposed to read r5 produced from
ldvary.r0, but because we have inserted the bu instruction in between now
that read happens at the same time that ldvary.r1 updates r5, stomping the
value we were supposed to read.

Fix this by disallowing injection of a branch instruction in between an ldvary
instruction and its write to the r5 register 2 instructions later.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7062
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19616>
(cherry picked from commit 1174f376096ed6ceebb0fb2810456f1501a68df7)

20 months agointel: Don't cross DWORD boundaries with byte scratch load/store
Jason Ekstrand [Mon, 7 Nov 2022 17:05:18 +0000 (11:05 -0600)]
intel: Don't cross DWORD boundaries with byte scratch load/store

The back-end swizzles dwords so that our indirect scratch messages match
the memory layout of spill/fill messages for better cache coherency.
The swizzle happens at a DWORD granularity.  If a read or write crosses
a DWORD boundary, the first bit will get correctly swizzled but whatever
piece lands in the next dword will not because the scatter instructions
assume sequential addresses for all bytes.  For DWORD writes, this is
handled naturally as part of scalarizing.  For smaller writes, we need
to be sure that a single write never escapes a dword.

Fixes: fd04f858b0aa ("intel/nir: Don't try to emit vector load_scratch instructions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7364
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19580>
(cherry picked from commit 25c180b50974b55e007dbbff18be1d831cd06551)

20 months agointel/lower_mem_access_bit_sizes: Compute alignments automatically
Jason Ekstrand [Mon, 7 Nov 2022 16:27:02 +0000 (10:27 -0600)]
intel/lower_mem_access_bit_sizes: Compute alignments automatically

Because dup_mem_intrinsic() retains the SSA offset from the original
intrinsic and only modifies it by adding a constant, we can compute the
alignment based on the original alignment and the constant offset.  This
is both easier and more accurate.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19580>
(cherry picked from commit 85685cf932c25fc53cae5e36b5d75f9d6a79c765)

20 months agovulkan/wsi/display: Reset connector state in vkReleaseDisplay().
Mario Kleiner [Wed, 2 Nov 2022 20:14:02 +0000 (21:14 +0100)]
vulkan/wsi/display: Reset connector state in vkReleaseDisplay().

If an application was transitioning out of fullscreen exclusive
display mode, the wsi_display_connector->active state was not
reset in vkReleaseDisplay() from fullscreen. When the app then
later tried to go to fullscreen display mode again on the same
display output with the same video mode, this caused
_wsi_display_queue_next() to skip a required drmModeSetCrtc()
during the first vkQueuePresent() after entering direct display
mode.

While this often worked by pure luck on a single-display setup,
it goes sideways on a multi-display setup where the viewport
of the associated crtc does not have a (x,y) offset of (0,0).
E.g., XOrg/X11 RandR output leasing of an output whose viewport
starts at x = 1920:

1. X-Server has RandR outputs viewport at x = 1920, in a shared
   framebuffer, shared across all crtc's on a X-Screen.

2. Application leases that output for direct display mode,
   1st vkQueuePresent() triggers drmModeSetCrtc() of output
   to (x,y) = 0,0, as required for Vulkan/wsi/direct framebuffer
   setup.

3. Application does rendering and presenting.

4. Application vkReleaseDisplay() the output, terminates the
   RandR lease. X-Server takes over again.

5. X-Server modesets to reconfigure output back to viewport
   with (x,y) = 1920, 0.

6. Application leases same output again later on, and tries
   vkQueuePresent() again. Because of the bug fixed in this
   commit, the required drmModeSetCrtc() to (x,y) = 0,0 is
   erroneously skipped due to the stale cached connector state.

7. drmModePageflip() fails due to the wrong crtc viewport
   (x,y) = 1920, 0, mismatched for the need of the Vulkan
   framebuffer of (x,y) = 0,0. Kernel returns -ENOSPACE,
   Swapchain goes into permanent VK_ERROR_SURFACE_LOST state.
   Destroying and recreating the swapchain, as recommended
   by the Vulkan spec for error handling won't help. Game over!

Resetting wsi_display_connector->active = false; fixes the
problem of wrong / stale connector state and Vulkan/wsi/display
clients are happy on multi-display setups again, as tested
in various single- and multi-display configurations.

This bug affects all Mesa releases with Vulkan/WSI/Display
support and should therefore be backported.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Fixes: 352d320a0745 ("vulkan: Add EXT_direct_mode_display [v2]")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19484>
(cherry picked from commit 24094ee03d625fbcd2d154e8c2dd5434ba88f166)

20 months agopanfrost: Copy resources when necessary
Alyssa Rosenzweig [Mon, 7 Nov 2022 15:45:08 +0000 (10:45 -0500)]
panfrost: Copy resources when necessary

If the map doesn't set MAP_DISCARD_RANGE, we do have to copy the existing
contents over. MAP_WRITE on its only gives permission to replace the contents,
unfortunately it does not require that the application actually do so.

Closes: #7640
Fixes: 0b26a9f7739 ("panfrost: Don't copy resources if replaced")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Roman Elshin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19576>
(cherry picked from commit cf7a3906b0629b2b6aadd3b18a39eae06b10fd6a)

20 months agopanfrost: Fix build with Perfetto (again)
Alyssa Rosenzweig [Mon, 7 Nov 2022 17:30:09 +0000 (12:30 -0500)]
panfrost: Fix build with Perfetto (again)

Sync UAPI for the upstream fix.

Upstream commit: https://cgit.freedesktop.org/drm-misc/commit/?h=drm-misc-fixes&id=c4299907c09a638c0a30f029338d07941c049d73

Closes: #7195
Fixes: 6a4532cbabf ("panfrost: Sync panfrost_drm.h from drm-misc-next")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19581>
(cherry picked from commit d40af879098bea90176619dc11facbd68c555f32)

20 months agoci: Fixes macos.yml
Yonggang Luo [Wed, 9 Nov 2022 04:03:37 +0000 (12:03 +0800)]
ci: Fixes macos.yml

Stick to macos-11 to prevent accident broken
always install meson with pip to prevent pull new version of python

Cc: mesa-stable
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19615>
(cherry picked from commit 81b4af28494c065c5646e3f61a72afd829d978c6)

20 months agonir: Don't reorder volatile intrinsics
Caio Oliveira [Tue, 1 Nov 2022 06:19:03 +0000 (23:19 -0700)]
nir: Don't reorder volatile intrinsics

Fixes issue with "is helper invocation" that in recent SPIR-V is mapped to
a volatile Load.  The CSE was catching the loads before they were transformed
in the new is_helper_invocation intrinsic (that is not reorderable).

Fixes: 729df14e452 ("nir: Handle volatile semantics for loading HelperInvocation builtin")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19432>
(cherry picked from commit 8ab628ab2e4d4f460e2eabdb11876997c0ab13bc)

20 months agoanv: fix missing VkPhysicalDeviceExtendedDynamicState3PropertiesEXT handling
Lionel Landwerlin [Mon, 7 Nov 2022 14:38:06 +0000 (16:38 +0200)]
anv: fix missing VkPhysicalDeviceExtendedDynamicState3PropertiesEXT handling

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19573>
(cherry picked from commit 97b3dd34c1aa11d98df7e26b4aae50be0bd62cf0)

20 months agointel/fs: Fix constant propagation into 32x16 integer multiplication
Ian Romanick [Tue, 8 Feb 2022 21:26:13 +0000 (13:26 -0800)]
intel/fs: Fix constant propagation into 32x16 integer multiplication

Don't copy propagate the constant in situations like

    mov(8)          g8<1>D          0x7fffffffD
    mul(8)          g16<1>D         g8<8,8,1>D      g15<16,8,2>W

On platforms that only have a 32x16 multiplier, this will result in
lowering the multiply to

    mul(8)          g15<1>D         g14<8,8,1>D     0xffffUW
    mul(8)          g16<1>D         g14<8,8,1>D     0x7fffUW
    add(8)          g15.1<2>UW      g15.1<16,8,2>UW g16<16,8,2>UW

On Gfx8 and Gfx9, which have the full 32x32 multiplier, it results in

    mul(8)          g16<1>D         g15<16,8,2>W    0x7fffffffD

Volume 2a of the Skylake PRM says:

    When multiplying a DW and any lower precision integer, the
    DW operand must on src0.

See also https://gitlab.freedesktop.org/mesa/crucible/-/merge_requests/104.

Previous to INTEL_shader_integer_functions2 (in Vulkan or OpenGL), I
don't think it would be possible to create a situation where this could
occur.  I discovered this via some optimizations that can determine that
the non-constant source must be able to fit in 16-bits.  The case listed
above came from piglit's "ext_transform_feedback-order arrays points"
with those optimizations in place.

No shader-db or fossil-db changes on any Intel platform.

Fixes: de6c0f84879 ("intel/fs: Implement support for NIR opcodes for INTEL_shader_integer_functions2")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
(cherry picked from commit db204121686726c74dd0aba2d1c1790d40e7baba)

20 months agoAndroid.mk: Fix gnu++14 related build failures
Mauro Rossi [Sat, 29 Oct 2022 07:33:19 +0000 (09:33 +0200)]
Android.mk: Fix gnu++14 related build failures

This patch filters-out '-std=gnu++14' from the cflags obtained
from AOSP/KATI dummy target output to avoid the following building errors:

FAILED: src/gallium/drivers/r600/45f68e3@@r600@sta/sfn_sfn_assembler.cpp.o
...
clang++ ... -std=c++17 ... -std=gnu++14
...
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:56: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ~~~~~^~~~~~~~~~~~
                                                       is_base_of
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:1412:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
                            ^
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:51: error: template argument for non-type template parameter must be an expression
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:439:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
               ^
2 errors generated.

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19563>
(cherry picked from commit fd8ec189e575d5220d8b4c30647fa6de57928e07)

20 months agoac/nir,radv: rework and fix NGG queries enables for VS/TES
Samuel Pitoiset [Thu, 3 Nov 2022 08:02:14 +0000 (09:02 +0100)]
ac/nir,radv: rework and fix NGG queries enables for VS/TES

XFB queries need to be enabled with NGG streamout and VS/TES.
Previously, the NGG lowering code relied on has_prim_query for XFB.

This fixes failures with RADV_PERFTEST=ngg_streamout on GFX10.3 with
the vkd3d-proton testsuite. Vulkan CTS is missing TES tests with XFB
queries apparently.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19493>
(cherry picked from commit 505290dc44a5b728dbc6ec9ed038300ab158c323)

20 months agoradv: re-emit the guardband state when restoring meta operations
Samuel Pitoiset [Fri, 4 Nov 2022 09:19:48 +0000 (10:19 +0100)]
radv: re-emit the guardband state when restoring meta operations

Meta operations change dynamic states like viewports and previously,
the guardband state was also always re-emitted because it relied on
dynamic viewport/scissor changes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7577
Fixes: 40d8df72808 ("radv: emit the guardband state separately from the scissor state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19521>
(cherry picked from commit 33d60bda9d385cca56e3d515472ca75fde53e126)

20 months agoetnaviv: Use old set of state registers for PE configuration on GC880
Marek Vasut [Sun, 6 Nov 2022 21:07:36 +0000 (22:07 +0100)]
etnaviv: Use old set of state registers for PE configuration on GC880

While the GC880 is HALTI0, it still uses the old set of state registers
for PE pipe configuration. This is another specialty of the GC880, readd
the missing handling for this GPU otherwise e.g. Qt5 cube example suffers
from rendering corruption with both eglfs and wayland backends.

Fixes: 7c46a488362 ("etnaviv: use new PE pipe address states on >= HALTI0")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19562>
(cherry picked from commit 20984aab0f6717f5fbf79fc21c2c5f442472b605)

20 months agodocs/zink: fix and cleanup rst syntax
Erik Faye-Lund [Wed, 2 Nov 2022 19:39:05 +0000 (20:39 +0100)]
docs/zink: fix and cleanup rst syntax

This new section didn't use the correct RST syntax, and ended up
with a broken section in the rendered docs.

Fix the syntax, and clean things up a bit to avoid overly long lines.

Fixes: be235edfe2b ("zink: add profile documentation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19481>
(cherry picked from commit 6b3b6333915e8ca64c531a4decb79c0256e1e4f2)

20 months agonir/lower_int64: Fix float16 to int64 conversions.
Francisco Jerez [Fri, 28 Oct 2022 23:27:17 +0000 (16:27 -0700)]
nir/lower_int64: Fix float16 to int64 conversions.

Currently float16 to int64 conversions don't work correctly, because
the "div" variable has an infinite value, since 2^32 isn't
representable as a 16-bit float, which causes the result of of rem(x,
div) to be NaN for all inputs, leading to an incorrect result.  Since
no values of magnitude greater than 2^32 are representable as a
float16 we don't actually need to do the fdiv/frem operations, the
conversion is equivalent to f2u32 with the result padded to 64 bits.

Rework:
 * Jordan: Handle f16 in if/else rather than conditional

Fixes: 936c58c8fcc ("nir: Extend nir_lower_int64() to support i2f/f2i lowering")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19391>
(cherry picked from commit e14f85366ebbc57f45d2561e0d3f0804f8adb549)

20 months agoradeonsi/gfx11: fix compute scratch buffer - WAVES is always per SE
Marek Olšák [Wed, 2 Nov 2022 18:34:58 +0000 (14:34 -0400)]
radeonsi/gfx11: fix compute scratch buffer - WAVES is always per SE

Fixes: ba02ed91a60 - ac/gfx11: fix the scratch buffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
(cherry picked from commit bdfacd0a24e023515fb7b7fae4a279cff0fbac4e)

20 months agoradv/rt: Restore prev barycentrics when rejecting hits
Konstantin Seurer [Fri, 4 Nov 2022 19:57:57 +0000 (20:57 +0100)]
radv/rt: Restore prev barycentrics when rejecting hits

Closes: #6348
cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19534>
(cherry picked from commit e5b3efe5825aec5c9163fa0d9b20418d2876fdd2)

20 months agonir: Fix qsort comparator function
Alex Brachet [Tue, 19 Jul 2022 19:54:04 +0000 (19:54 +0000)]
nir: Fix qsort comparator function

`pred` is a pointer, for sufficiently large numbers these
being cast to int were both > 0 regardless of the order
of `data1` and `data2`.

Fixes: 523a28d3fe0d ("nir: add an instruction set API")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19539>
(cherry picked from commit c987a727a76eda1feada07e2eca6a5597dbddd93)

20 months agoradv: invalidate L2 instead of only writeback L2 when using DCC stores
Samuel Pitoiset [Wed, 2 Nov 2022 10:27:13 +0000 (11:27 +0100)]
radv: invalidate L2 instead of only writeback L2 when using DCC stores

It seems INV_L2 is the right thing to do, especially for RDNA2 chips
with non-coherent RBs (NAVI22 is one of these). This fixes DCC
corruption.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6476
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7507
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19516>
(cherry picked from commit 06adf6ad117e92a832c5073326bd83b638b3ca37)

20 months agoradv: make the GDS/GDS OA buffer objects resident
Samuel Pitoiset [Wed, 2 Nov 2022 12:53:58 +0000 (13:53 +0100)]
radv: make the GDS/GDS OA buffer objects resident

GDS is used for NGG queries/streamout (GFX10+ only) and the BOs were
only added to the graphics queue because compute doesn't need them.
Though, the kernel emits a GDS switch when a queue submission doesn't
use GDS. That means that submitting jobs on the compute queue without
GDS can reset the state of the graphics queue and lead to GPU hangs.

The only viable solution for now is to make the GDS BOs resident to
avoid resetting the state between queues. This shouldn't introduce
more syncs between queues because GDS BOs are similar for both.

This fixes a GPU hang with Warhammer Chaosbane during loading time and
possibly some spurious random GPU hangs. Note that this GPU hang was
workarounded on the Steam side with RADV_DEBUG=nongg.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19466>
(cherry picked from commit 26c8fedc1bb12fa8f3d6c646308f4b46756d77c7)

20 months agozink/ci: add another subtest to the list of known failures for radv
Martin Roukala (né Peres) [Fri, 4 Nov 2022 07:02:06 +0000 (09:02 +0200)]
zink/ci: add another subtest to the list of known failures for radv

This test as a whole does not seem to work anywhere, even lavapipe, but
one particular subtest was passing until a recent change
(!19438 - zink: polygon mode fixes?).

After consideration by @kusma, it appears that the subtest was passing
by accident due to zink generating the wrong values. Given that this is
not something that users would ever experience as a regression, we
simply document this new failure along with all the others for this
test.

Fixes: 53721827ea1c ("zink: correct depth-bias enable condition")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19517>
(cherry picked from commit d7ad9e701424e4b100e11f08f2fa416b228b19d3)

20 months agov3dv: use vk_alloc instead of malloc
Iago Toral Quiroga [Fri, 4 Nov 2022 08:17:08 +0000 (09:17 +0100)]
v3dv: use vk_alloc instead of malloc

Fixes: e6884df088 ('v3dv: fix event synchronization')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19518>
(cherry picked from commit 22789d34be0fb6d81012e2e4d53b738384eb98db)

20 months agov3dv: vkCmdWaitEvents2 takes an array of VkDependencyInfo
Iago Toral Quiroga [Fri, 4 Nov 2022 08:01:01 +0000 (09:01 +0100)]
v3dv: vkCmdWaitEvents2 takes an array of VkDependencyInfo

We have been incorrectly assuming there was just one for all the
events, apparently CTS never uses more than one event.

Fixes: e6884df088 ('v3dv: fix event synchronization')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19518>
(cherry picked from commit 36ef75b6eb924cf5ebfb09834067d2519d080ca8)

20 months agozink/ci: mark another test as fixed after the frontend caching series
Martin Roukala (né Peres) [Wed, 2 Nov 2022 13:41:46 +0000 (15:41 +0200)]
zink/ci: mark another test as fixed after the frontend caching series

Just like on Lavapipe, Emma Anholt's !19124 also fixed the
restore-sso-program test on RADV.

Fixes: 4e14da056d62 ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19468>
(cherry picked from commit dc08875415064033ea1e344a522273bc1255a3b8)

20 months agoradv: fix setting MIN_LOD for texture descriptors on GFX11
Samuel Pitoiset [Thu, 3 Nov 2022 02:56:00 +0000 (02:56 +0000)]
radv: fix setting MIN_LOD for texture descriptors on GFX11

Found by inspection because the MIN_LOD bits were moved.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19496>
(cherry picked from commit e891e84f4be6271cf34f62768b085ee99b6db86c)

20 months agohasvk: fix android build and reported API version
Mauro Rossi [Tue, 1 Nov 2022 14:34:22 +0000 (15:34 +0100)]
hasvk: fix android build and reported API version

anv_device.c for vulkan.intel_hasvk requires changes to be compiled
and behave correctly for android target

Fixes the following building error:

FAILED: src/intel/vulkan_hasvk/libanv_hasvk_common.a.p/anv_device.c.o
...
../src/intel/vulkan_hasvk/anv_device.c:143:19: error: use of undeclared identifier 'ANV_API_VERSION_1_3'
   *pApiVersion = ANV_API_VERSION_1_3;
                  ^
../src/intel/vulkan_hasvk/anv_device.c:1822:44: error: use of undeclared identifier 'ANV_API_VERSION_1_3'
      .apiVersion = pdevice->use_softpin ? ANV_API_VERSION_1_3 : ANV_API_VERSION_1_2,
                                           ^
../src/intel/vulkan_hasvk/anv_device.c:1822:66: error: use of undeclared identifier 'ANV_API_VERSION_1_2'
      .apiVersion = pdevice->use_softpin ? ANV_API_VERSION_1_3 : ANV_API_VERSION_1_2,
                                                                 ^
3 errors generated.

Cc: "22.3" mesa-stable
Fixes: 00eefdc ("hasvk: stop advertising Vk 1.3 on non-softpin")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19452>
(cherry picked from commit 814b822fe065ab88409a2833b1c7f331f714b26e)

20 months agoradv: Use spirv1.5 instead of vulkan1.2
Friedrich Vock [Wed, 2 Nov 2022 18:52:09 +0000 (19:52 +0100)]
radv: Use spirv1.5 instead of vulkan1.2

Ubuntu 20.04 ships a glslangValidator that doesn't know about vulkan1.2 yet.

Fixes: 27186537 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19479>
(cherry picked from commit 95ed0330667f726474d24d8c56e478e346622b0b)

20 months agotu: tu: Clear patchControlPoints dirty state with static patchControlPoints
Connor Abbott [Mon, 10 Oct 2022 20:19:39 +0000 (22:19 +0200)]
tu: tu: Clear patchControlPoints dirty state with static patchControlPoints

Noticed by inspection after the previous issue.

Fixes: 68f3c38c801 ("tu: Implement extendedDynamicState2PatchControlPoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
(cherry picked from commit 4466f9aa02dec99c6879e5e357788843c3b573e5)

20 months agov3dv: fix event synchronization
Iago Toral Quiroga [Thu, 3 Nov 2022 08:15:20 +0000 (09:15 +0100)]
v3dv: fix event synchronization

Since we now implement events in the GPU we need to be more careful
and insert barriers to honor the dependencies provided by the API
as well as ensuring we are synchronizing these with the compute
queue, since that is how we implement GPU event functionality.

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit e6884df088a1e172cd87956fe9afdac63069eb2c)

20 months agov3dv: make the helper to emit pipeline barriers public to other files
Iago Toral Quiroga [Thu, 3 Nov 2022 08:14:51 +0000 (09:14 +0100)]
v3dv: make the helper to emit pipeline barriers public to other files

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 8113f973b3946e465d508627a4796d94cec1f1d8)

20 months agov3dv: always check VK_ACCESS_2_MEMORY_READ_BIT for read accesses
Iago Toral Quiroga [Wed, 2 Nov 2022 13:20:29 +0000 (14:20 +0100)]
v3dv: always check VK_ACCESS_2_MEMORY_READ_BIT for read accesses

Fixes: a981ac053964 ('v3dv: skip binning sync if binning shaders don't access external resources')

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 67e82fd1f2c334da2e888553967ebae04c08146a)

20 months agov3dv: increase limit for active event objects
Iago Toral Quiroga [Wed, 2 Nov 2022 09:53:59 +0000 (10:53 +0100)]
v3dv: increase limit for active event objects

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Fixes: dEQP-VK.api.command_buffers.execute_large_primary

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 4c861cf22a63b892cec74bc132313dcd17d77584)

20 months agov3dv: do better cleanup on failure during pipeline cache operation
Iago Toral Quiroga [Thu, 3 Nov 2022 10:28:12 +0000 (11:28 +0100)]
v3dv: do better cleanup on failure during pipeline cache operation

Fixes (with disk cache enabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 5e97150e21a75920c3521717f70f9f92702729b4)

20 months agov3dv: handle allocation failure during pipeline initialization
Iago Toral Quiroga [Wed, 2 Nov 2022 07:53:12 +0000 (08:53 +0100)]
v3dv: handle allocation failure during pipeline initialization

Fixes (with disk cache disabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 1f5966397aa208eb574394a4d0a592b66b776b44)

20 months agov3dv: fix incorrect return type
Iago Toral Quiroga [Wed, 2 Nov 2022 07:51:23 +0000 (08:51 +0100)]
v3dv: fix incorrect return type

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 7f905a8117e9dc85088fe23429594537ee240c1e)

20 months agov3dv: do a better job at cleaning up the device on init failure
Iago Toral Quiroga [Wed, 2 Nov 2022 07:50:24 +0000 (08:50 +0100)]
v3dv: do a better job at cleaning up the device on init failure

These leaks on device creation failure have been there before, but
were only exposed as CTS failures after the recent event refactoring.

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit b78fd50e90c700466213e4b3b40ce10547b1e14e)

20 months agov3dv: avoid freeing already-freed memory
Eric Engestrom [Mon, 31 Oct 2022 18:38:25 +0000 (18:38 +0000)]
v3dv: avoid freeing already-freed memory

Fixes: ecb01d53fdb413121ce2 ("v3dv: refactor events")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit aff368fe83bd4bcb4620a1a19e9b71eb67a05af7)

20 months agov3dv: remove unnecessary check for NULL
Iago Toral Quiroga [Wed, 2 Nov 2022 07:49:37 +0000 (08:49 +0100)]
v3dv: remove unnecessary check for NULL

We are initializing the device, so we know this will be NULL.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit c793d384c12ebaa13487aeee35532e52b888c049)

20 months agovk/runtime: drop incorrect UNUSED annotation
Eric Engestrom [Mon, 31 Oct 2022 18:39:43 +0000 (18:39 +0000)]
vk/runtime: drop incorrect UNUSED annotation

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit c6c5949ff70a47c47795fe9161a7514173b5be24)

20 months agoradv: fix fallback for extreme geometry with tessellation on GFX11
Samuel Pitoiset [Thu, 3 Nov 2022 08:53:40 +0000 (09:53 +0100)]
radv: fix fallback for extreme geometry with tessellation on GFX11

It would assert anyways. Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19495>
(cherry picked from commit fab87b0f4115bd360ed9334aa7a72518613c2014)

20 months agoanv: Reduce RHWO optimization (Wa_1508744258)
Lionel Landwerlin [Mon, 24 Oct 2022 18:29:04 +0000 (21:29 +0300)]
anv: Reduce RHWO optimization (Wa_1508744258)

Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces.

v2: Move stalling to genX(cmd_buffer_apply_pipe_flushes) for clarity (Mark)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19450>
(cherry picked from commit ba0336ab3f69f958e4346c1465c2fe0859d4ac59)

20 months agoradv: Make the compute scratch waves per SE as well.
Bas Nieuwenhuizen [Sun, 30 Oct 2022 22:33:34 +0000 (23:33 +0100)]
radv: Make the compute scratch waves per SE as well.

Fixes: 278e533ec9c ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
(cherry picked from commit d876ddc920f1aaf48219f2060de6cc99c003bc5d)

20 months agoradv: Fix compute scratch buffer emission.
Bas Nieuwenhuizen [Sun, 30 Oct 2022 22:29:53 +0000 (23:29 +0100)]
radv: Fix compute scratch buffer emission.

Copied wrong from radeonsi. The registers following the scratch
buffer address are the shader rsrc1/rsrc2. Not the user SGPR0
containing the ring resource word 1.

Fixes: 278e533ec9c ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
(cherry picked from commit b8865ad04643cd7e8faa8a863d81fedbc1e29231)

20 months agoiris: invalidate sysvals if grid dimension changes
Karol Herbst [Sat, 17 Sep 2022 17:59:56 +0000 (19:59 +0200)]
iris: invalidate sysvals if grid dimension changes

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
(cherry picked from commit 9ccdd86b9040b265893712f4125d30552e0fe1cd)

20 months agoglx: Fixes apple/apple_visual.c that include non-exist util/debug.h
Yonggang Luo [Wed, 2 Nov 2022 21:19:29 +0000 (05:19 +0800)]
glx: Fixes apple/apple_visual.c that include non-exist util/debug.h

Fixes: aa4ac5ff8bb ("utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19486>
(cherry picked from commit 287435134c6685a71f5c247778017c8b66a93627)

20 months agopanfrost: Replace resource shadowing flush
Alyssa Rosenzweig [Sat, 29 Oct 2022 18:42:36 +0000 (14:42 -0400)]
panfrost: Replace resource shadowing flush

The entire point of resource shadowing is to avoid unnecessary flushing.
Flushing readers after shadowing is counterproductive. A refresher on
how resource shadowing is supposed to work:

First, we determine if it's beneficial to shadow resources. If so, we
create a new backing buffer object. We flush the current writer of the
resource, if there is one, so the current contents become known to the
CPU. If we are not discarding the original resource, we then copy the
existing contents of the buffer to the new shadow buffer on the CPU.
Finally, we swap the resource's backing buffer for our shadow. Any batch
that reads the resource will continue to read the old copy of the
resource, and any future draw calls will see the new copy with the
change implemented.

Where did we go wrong?

In 988d5aae74d ("panfrost: Flush resources when shadowing"), we started
flushing all readers. We didn't actually need to flush, we just needed
to avoid dangling references on the batches reading the old copy of the
resource. But that's easily enough avoided: just remove the references.
The batches still hold a reference to the underlying BO, which will be
freed at the right time regardless.

Originally motivated by glmark2 -bbuffer:update-method=subdata, which
has some pathological access paterns.

Firefox is a lot faster anecdotally (now scrolling at 60fps in firefox).

But what actually motivated this is an apitrace from Duckstation's GLES
renderer. With this patch, the in-game portion is improved 3fps to 21fps.

Closes: #4028
Fixes: 988d5aae74d ("panfrost: Flush resources when shadowing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
(cherry picked from commit 2d8f28df731638e1270b0ae273c7bfd2b29b7993)

20 months agopanfrost: Don't copy resources if replaced
Alyssa Rosenzweig [Wed, 2 Nov 2022 17:43:11 +0000 (13:43 -0400)]
panfrost: Don't copy resources if replaced

If a synchronized transfer_map is going to overwrite an entire resource,
there's no need to memcpy in the original contents ahead-of-time. This
memcpy is particularly bad for large buffers where it's copying WC->WC,
although that could be mitigated with threaded_context's cpu_storage in
the future if needed.

Prevents a performance regression in glmark2's buffer scenes from the
next patch, hence the Cc.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
(cherry picked from commit 0b26a9f773956fc00a77b0d4a7aafee5795ce935)

20 months agozink: add missing build_id linker args
Eric Engestrom [Wed, 2 Nov 2022 21:38:53 +0000 (21:38 +0000)]
zink: add missing build_id linker args

Fixes: 4e14da056d623ababf7c ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19485>
(cherry picked from commit dfa8600a2d39aabc88e5a5b87ab86b2b0ea30191)

20 months ago.pick_status.json: Update to 1174f376096ed6ceebb0fb2810456f1501a68df7
Eric Engestrom [Thu, 3 Nov 2022 14:27:09 +0000 (14:27 +0000)]
.pick_status.json: Update to 1174f376096ed6ceebb0fb2810456f1501a68df7

20 months agoVERSION: bump to 22.3.0-rc1
Eric Engestrom [Wed, 2 Nov 2022 19:44:42 +0000 (19:44 +0000)]
VERSION: bump to 22.3.0-rc1

20 months agoRevert "etnaviv: completely turn off MSAA"
Christian Gmeiner [Sat, 2 Jul 2022 11:59:18 +0000 (13:59 +0200)]
Revert "etnaviv: completely turn off MSAA"

This reverts commit 044b238507bb54ff8b6129c9754f1efc0f0834b9 and extends it with
 - putting the comments directly in front of the if's
 - do not support 2x MSAA on SMALL_MSAA hardware
 - checking if blt/rs supports the format

MSAA should work as expected now. Tested with kmscube and qt5.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: blt: Directly call etna_try_blt_blit(..)
Christian Gmeiner [Sat, 13 Aug 2022 18:03:23 +0000 (20:03 +0200)]
etnaviv: blt: Directly call etna_try_blt_blit(..)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: blt: Add color resolve support
Christian Gmeiner [Sat, 13 Aug 2022 17:55:03 +0000 (19:55 +0200)]
etnaviv: blt: Add color resolve support

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: Update headers from rnndb
Christian Gmeiner [Fri, 7 Oct 2022 06:19:27 +0000 (08:19 +0200)]
etnaviv: Update headers from rnndb

Update to rnndb commit fff078b61ceb.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: rs: msaa: Set cache mode for SMALL_MSAA
Christian Gmeiner [Thu, 11 Aug 2022 14:27:30 +0000 (16:27 +0200)]
etnaviv: rs: msaa: Set cache mode for SMALL_MSAA

If the GPU supports SMALL_MSAA and does not support CACHE128B256BPERLINE we
need to set the cache mode to CACHE_MODE_256B.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: rs: Directly call etna_try_rs_blit(..)
Christian Gmeiner [Thu, 14 Jul 2022 19:45:44 +0000 (21:45 +0200)]
etnaviv: rs: Directly call etna_try_rs_blit(..)

Also remove some old comments.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: rs: Color resolve works
Christian Gmeiner [Sun, 17 Nov 2019 19:37:40 +0000 (20:37 +0100)]
etnaviv: rs: Color resolve works

No special treatment is needed and is helps MSAA.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: Create MSAA surfaces with PE compatible tiling
Gert Wollny [Sun, 3 Jul 2022 05:37:06 +0000 (07:37 +0200)]
etnaviv: Create MSAA surfaces with PE compatible tiling

MSAA surfaces are always used for rendering, and only as blit sources,
so the need to be allocated with PE compatible tiling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agoetnaviv: Remove possibility to force MSAA
Christian Gmeiner [Tue, 5 Jul 2022 12:12:57 +0000 (14:12 +0200)]
etnaviv: Remove possibility to force MSAA

st/mesa does not know anything about the forced MSAA and we end with
the following assert:
etna_try_rs_blit: Assertion `(blit_info->src.box.x + blit_info->src.box.width) * msaa_xscale <= src_lev->padded_width' failed

Let the application do its thing regarding MSAA and remove this 'debug'
feature.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19013>

20 months agod3d12: Hook up driver-private interop data
Jesse Natalie [Fri, 21 Oct 2022 22:57:49 +0000 (15:57 -0700)]
d3d12: Hook up driver-private interop data

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agomesa/st: Query driver for interop data
Jesse Natalie [Fri, 21 Oct 2022 22:30:54 +0000 (15:30 -0700)]
mesa/st: Query driver for interop data

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agogallium: Add screen methods for driver-private data on interop interface
Jesse Natalie [Fri, 21 Oct 2022 22:30:25 +0000 (15:30 -0700)]
gallium: Add screen methods for driver-private data on interop interface

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agoinclude: Add driver data to v2 of mesa_glinterop_device_info
Jesse Natalie [Fri, 21 Oct 2022 22:15:30 +0000 (15:15 -0700)]
include: Add driver data to v2 of mesa_glinterop_device_info

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agoegl/wgl: Implement interop methods
Jesse Natalie [Fri, 21 Oct 2022 21:52:41 +0000 (14:52 -0700)]
egl/wgl: Implement interop methods

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agowgl: Implement interop methods
Jesse Natalie [Fri, 21 Oct 2022 21:48:27 +0000 (14:48 -0700)]
wgl: Implement interop methods

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agoegl/dri2: Implement the new flush method
Jesse Natalie [Fri, 21 Oct 2022 21:09:39 +0000 (14:09 -0700)]
egl/dri2: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agoglx: Implement the new flush method
Jesse Natalie [Fri, 21 Oct 2022 21:04:47 +0000 (14:04 -0700)]
glx: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agodri: Implement the new flush method
Jesse Natalie [Fri, 21 Oct 2022 21:28:44 +0000 (14:28 -0700)]
dri: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agomesa/st: Implement the new flush method
Jesse Natalie [Thu, 27 Oct 2022 23:46:26 +0000 (16:46 -0700)]
mesa/st: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agomesa/st: Split interop object lookup from export
Jesse Natalie [Thu, 27 Oct 2022 23:46:10 +0000 (16:46 -0700)]
mesa/st: Split interop object lookup from export

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agomesa: Make fence_sync not static
Jesse Natalie [Fri, 21 Oct 2022 21:25:51 +0000 (14:25 -0700)]
mesa: Make fence_sync not static

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agoinclude: Add a flush interop method
Jesse Natalie [Fri, 21 Oct 2022 22:14:30 +0000 (15:14 -0700)]
include: Add a flush interop method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agomesa, dri2: Move interop helpers from dri2 to state tracker
Jesse Natalie [Fri, 21 Oct 2022 19:02:04 +0000 (12:02 -0700)]
mesa, dri2: Move interop helpers from dri2 to state tracker

They're not at all dri2 specific and we'll want to use them from wgl.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agoinclude: Add WGL version of GL interop extensions
Jesse Natalie [Fri, 21 Oct 2022 19:03:36 +0000 (12:03 -0700)]
include: Add WGL version of GL interop extensions

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

20 months agodocs/new_features: Add Panfrost disk cache
Alyssa Rosenzweig [Wed, 2 Nov 2022 17:10:25 +0000 (13:10 -0400)]
docs/new_features: Add Panfrost disk cache

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19474>

20 months agoradeonsi: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Thu, 13 Oct 2022 17:40:15 +0000 (18:40 +0100)]
radeonsi: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

20 months agoaco/gfx11: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Mon, 26 Sep 2022 16:18:48 +0000 (17:18 +0100)]
aco/gfx11: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

20 months agoac/gpu_info: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Mon, 26 Sep 2022 18:12:41 +0000 (19:12 +0100)]
ac/gpu_info: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

20 months agoradv: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Mon, 26 Sep 2022 18:12:19 +0000 (19:12 +0100)]
radv: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

20 months agopanfrost: Implement a disk cache
Alyssa Rosenzweig [Fri, 14 Oct 2022 16:32:26 +0000 (12:32 -0400)]
panfrost: Implement a disk cache

Wire up the Mesa shader disk cache into Panfrost. Coupled with the
precompiles from the previous patch, this should greatly reduce shader
recompile jank.

This is a bare bones implementation. Obvious future work includes:

- Caching internal (outside of Gallium) shaders
- Implement finalize_nir to reduce on disk size of shaders

That doesn't need to come in this patch.

This patch does shuffle some allocation patterns around to avoid extra
nir_shader_clones, but the result should be pretty clean.

---

Consider dEQP-GLES31.functional.ssbo.layout.basic_unsized_array.* in the CTS.
With a cold cache:

   44.11user 0.66system 0:45.44elapsed 98%CPU (0avgtext+0avgdata 267804maxresident)
   k 0inputs+0outputs (130major+74725minor)pagefaults 0swaps

But with this commit and a warm cache:

   4.07user 0.35system 0:04.56elapsed 96%CPU (0avgtext+0avgdata 211012maxresident)
   k0inputs+0outputs (1major+49489minor)pagefaults 0swaps

That's an 11x improvement!

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

20 months agopanfrost: Precompile shaders
Alyssa Rosenzweig [Fri, 14 Oct 2022 21:14:46 +0000 (17:14 -0400)]
panfrost: Precompile shaders

We have no vertex shader key, and unless legacy GL features are used, the
fragment shader key is known ahead-of-time. That means we can precompile shaders
at CSO create time, hopefully avoiding some draw-time jank.

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

20 months agopanfrost: Precompile transform feedback program
Alyssa Rosenzweig [Fri, 14 Oct 2022 21:03:36 +0000 (17:03 -0400)]
panfrost: Precompile transform feedback program

This avoids the weird compiled_shader pointer inside of compiled_shader. Because
we don't have a nonempty vertex shader key, there will only ever be a single
transform feedback program per CSO.

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

20 months agopanfrost: Make fixed_varying_mask a fragment-only key
Alyssa Rosenzweig [Fri, 14 Oct 2022 20:53:52 +0000 (16:53 -0400)]
panfrost: Make fixed_varying_mask a fragment-only key

This makes it clear that there are no VS variants.

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