platform/upstream/mesa.git
22 months agoradv: remove redundant assignment of tcs.tcs_vertices_out
Samuel Pitoiset [Mon, 22 Aug 2022 13:00:50 +0000 (15:00 +0200)]
radv: remove redundant assignment of tcs.tcs_vertices_out

It's already assigned from radv_nir_shader_info_pass() and it's only
used to configure the VGT_TF_PARAM register. Otherwise, we read it
from NIR shader info during compilation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18184>

22 months agoetnaviv: mark instanced draw extensions as supported in docs/features.txt
Lucas Stach [Sun, 14 Aug 2022 13:17:16 +0000 (15:17 +0200)]
etnaviv: mark instanced draw extensions as supported in docs/features.txt

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

22 months agoetnaviv: expose ARB_draw_instanced
Lucas Stach [Thu, 11 Aug 2022 13:21:03 +0000 (15:21 +0200)]
etnaviv: expose ARB_draw_instanced

Just set the pipe cap correctly. The InstanceID support is already
hooked up in the NIR compiler. All enabled piglit tests pass.

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

22 months agozink: Remove duplicate variable zero.
Vinson Lee [Sat, 20 Aug 2022 22:34:57 +0000 (15:34 -0700)]
zink: Remove duplicate variable zero.

Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In zero = zero = nir_imm_zero(b, nir_dest_num_components(intr->dest), nir_dest_bit_size(intr->dest)),
zero is written twice with the same value.

Fixes: 0f97e317e33 ("zink: rewrite all undefined shader reads as 0001 instead of undef")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18164>

22 months agoglsl: fix location for array subscript
Timothy Arceri [Mon, 22 Aug 2022 01:10:19 +0000 (11:10 +1000)]
glsl: fix location for array subscript

xfb_decl_assign_location() assumes that arrays are going to be packed.
But some conditions might prevent packing (e.g: explicit location or
smooth interpolation mode).

Instead of assuming that packing will happen, this commit adds a check to
determine if it'll happen and use the result to compute the proper location.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2214

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

22 months agoglsl: make packed varying helper needs_lowering() external
Timothy Arceri [Mon, 22 Aug 2022 01:08:32 +0000 (11:08 +1000)]
glsl: make packed varying helper needs_lowering() external

We will use this helper to correctly calculate xfb offsets in the
following patch.

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

22 months agoradeonsi: fix tcs_out_lds_offsets arg alignment
Qiang Yu [Sun, 21 Aug 2022 07:25:50 +0000 (15:25 +0800)]
radeonsi: fix tcs_out_lds_offsets arg alignment

tcs_out_lds_offsets is not sure to be 16 byte aligned, it's
calculated like this:

  num_patches * patch_vertices * lshs_vertex_stride

num_patches and patch_vertices are not sure to be any value aligned,
lshs_vertex_stride is added one extra dword, so it's only 4 byte
aligned.

This may cause problem even before we switch to nir tess output
lower when write tess factor before read tail of input. But it's
more likely to cause problem after we switch to nir tess output
lower because the main body won't eliminate the low 4bit offset
but epilog will, so they use different offset to read/write tess
factor.

Fixes: 7598bfd768f ("radeonsi: replace llvm tcs output with nir lower pass")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7083
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/18174>

22 months agointel/compiler: Use fs_reg helpers for GS icp_handle selection
Caio Oliveira [Tue, 23 Aug 2022 05:50:23 +0000 (22:50 -0700)]
intel/compiler: Use fs_reg helpers for GS icp_handle selection

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18221>

22 months agointel/compiler: Use fs_reg helpers for TCS icp_handle selection
Caio Oliveira [Sat, 20 Aug 2022 00:07:44 +0000 (17:07 -0700)]
intel/compiler: Use fs_reg helpers for TCS icp_handle selection

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18221>

22 months agointel/compiler: Rename 8_PATCH to MULTI_PATCH
Caio Oliveira [Tue, 16 Aug 2022 18:02:20 +0000 (11:02 -0700)]
intel/compiler: Rename 8_PATCH to MULTI_PATCH

Make it clearer we are dealing with multiple patches,
works better in constrast with SINGLE_PATCH.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18151>

22 months agointel/compiler: Remove INTEL_DEBUG=tcs8
Caio Oliveira [Fri, 19 Aug 2022 18:40:13 +0000 (11:40 -0700)]
intel/compiler: Remove INTEL_DEBUG=tcs8

For Gen11 and prior, the dispatch mode for TCS was SINGLE_PATCH, and
this debug setting could be used to change it to 8_PATCH (falling back
to SINGLE_PATCH when shader couldn't be in the multi dispatch mode).
However after talking to Ken, seems this debug setting is not really
worth keeping around, so removing it.

For Gen12+ the only option is 8_PATCH, so it was always using that
dispatch mode as before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18151>

22 months agovulkan/wsi: Take max extent into consideration for modifier selection.
Bas Nieuwenhuizen [Fri, 19 Aug 2022 12:17:28 +0000 (14:17 +0200)]
vulkan/wsi: Take max extent into consideration for modifier selection.

For AMD we kinda have some modifiers with a max size ... (Which is
really a compositor/kms issue, but getting them to try kinda falls
into the unsolved  "how to allocate/what pitch to use" bucket, so
we solve it on the allocating side)

Cc: mesa-stable
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18139>

22 months agoci: Use mold for x86-64 and AArch64 builds
Daniel Stone [Wed, 27 Jul 2022 15:38:09 +0000 (16:38 +0100)]
ci: Use mold for x86-64 and AArch64 builds

mold is a fancy new linker that's really fast.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6877
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17992>

22 months agoiris: Drop extra file-descriptor dup in iris_drm_screen_create()
Jordan Justen [Thu, 11 Aug 2022 08:47:09 +0000 (01:47 -0700)]
iris: Drop extra file-descriptor dup in iris_drm_screen_create()

In a99e85db9eb, we added a dup into iris_screen_create(). Apparently
some android code paths must be hitting iris_screen_create() without
calling iris_drm_screen_create(). After a99e85db9eb, the code paths
that do hit iris_drm_screen_create() will now dup the fd twice, but
iris_screen_destroy() will only close 1 of these fds.

Fixes: a99e85db9eb ("iris:Duplicate DRM fd internally instead of reuse.")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18020>

22 months agointel/fs: fixup scratch load/store handling on Gfx12.5+
Lionel Landwerlin [Wed, 8 Jun 2022 08:04:31 +0000 (11:04 +0300)]
intel/fs: fixup scratch load/store handling on Gfx12.5+

We did not handle the operation with data size < 4. It works fine on
all other messages (global/shared). The initial commit was just too
restrictive.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 1e242785c315 ("intel/fs: Implement load/store_scratch on XeHP")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16964>

22 months agointel/fs: fix load_scratch intrinsic
Lionel Landwerlin [Thu, 7 Jul 2022 06:35:38 +0000 (09:35 +0300)]
intel/fs: fix load_scratch intrinsic

The selection of the internal opcode to deal with load_scratch is
incorrect.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c6439792287f ("intel/fs: Choose memory message type based on bit size")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16964>

22 months agointel/compiler: Make component() work for FIXED_GRF/ARF
Caio Oliveira [Fri, 19 Aug 2022 23:53:48 +0000 (16:53 -0700)]
intel/compiler: Make component() work for FIXED_GRF/ARF

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18157>

22 months agointel/fs: Fix horiz_offset() to handle FIXED_GRFs with non-trivial 2D regions.
Francisco Jerez [Mon, 8 Aug 2022 21:04:06 +0000 (14:04 -0700)]
intel/fs: Fix horiz_offset() to handle FIXED_GRFs with non-trivial 2D regions.

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

22 months agoci: update CI to reflect clovers LLVM version bump
Karol Herbst [Mon, 22 Aug 2022 13:05:22 +0000 (15:05 +0200)]
ci: update CI to reflect clovers LLVM version bump

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16047>

22 months agochore(deps): clover: raise the minimum LLVM version to 11.0.0
Kai Wasserbäch [Tue, 19 Apr 2022 18:41:29 +0000 (20:41 +0200)]
chore(deps): clover: raise the minimum LLVM version to 11.0.0

LLVM 11 was released in October 2020. If you want to build against
Mesa's Git version, that seems like enough time to upgrade to at least
LLVM 11 (Debian stable has this too).

It reduces the amount of #if gates we need and more will be incoming
again, given the Opaque Pointer transition.

Additionally radeonsi is already requiring LLVM 11. Therefore the
minimum will have been LLVM 11 for many builds anyway.

Note that clc is kept to LLVM 10 for the time being.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16047>

22 months agoradv: Fix mipmap views on GFX10+
John Brooks [Tue, 9 Aug 2022 21:15:33 +0000 (17:15 -0400)]
radv: Fix mipmap views on GFX10+

As explained in the previous commit, GFX9+ has issues with addressing
mipmaps in block-compressed images. In the case of copy commands, we fix
this by doing an extra copy for the missing blocks.

For GFX10, the mipmap layout in memory allows us to do better than that. We
can change the base level of the descriptor to one level bigger than the
requested level and adjust the extent and address to match. This is done by
ComputeNonBlockCompressedView in addrlib. Thus on GFX10 we can skip the
fixup copy workaround, and this will also fix cases outside of explicit
copy commands.

Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17970>

22 months agoradv: Fix corrupted mipmap copies on GFX9+
John Brooks [Mon, 8 Aug 2022 21:35:56 +0000 (17:35 -0400)]
radv: Fix corrupted mipmap copies on GFX9+

GFX9+ hardware has an issue where mipmap degradations are calculated
incorrectly due to using divide-by-two integer math and certain mipmap
sizes lose blocks.

This issue has been documented before, and we ported a workaround from
AMDVLK to increase the extent that is programmed into the descriptor, so
that the hardware arrives at the correct result. However, this is
insufficient as we cannot safely increase the extent beyond the physical
extent of the image in memory. If we can't increase it enough, the image
will still be missing blocks.

But there is still hope. In cases where RADV is responsible for copying to
or from an image (such as vkCmdCopyBufferToImage/vkCmdCopyImageToBuffer),
we can perform a second copy of the blocks that the hardware excluded so
that the resulting image is complete. This is another workaround from
AMDVLK.

This fixes corrupted textures in Halo: The Master Chief Collection.

v2: Add RADV_CMD_FLAG_INV_L2 | RADV_CMD_FLAG_INV_VCACHE to flush_bits
    just in case (Samuel Pitoiset)

Closes: #3347

Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17970>

22 months agoradv: Only apply mipmap view adjustments to block compressed images
John Brooks [Sat, 13 Aug 2022 15:21:41 +0000 (11:21 -0400)]
radv: Only apply mipmap view adjustments to block compressed images

This workaround need not apply to subsampled formats.

Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17970>

22 months agovulkan: Introduce vk_format_is_block_compressed function
John Brooks [Mon, 15 Aug 2022 14:59:17 +0000 (10:59 -0400)]
vulkan: Introduce vk_format_is_block_compressed function

Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17970>

22 months agoradv: Add get_addrlib function to radv_radeon_winsys
John Brooks [Wed, 17 Aug 2022 01:15:21 +0000 (21:15 -0400)]
radv: Add get_addrlib function to radv_radeon_winsys

Signed-off-by: John Brooks <john@fastquake.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17970>

22 months agoanv: convert assert into unreachable to avoid fallthrough error
Eric Engestrom [Mon, 22 Aug 2022 20:31:52 +0000 (21:31 +0100)]
anv: convert assert into unreachable to avoid fallthrough error

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18192>

22 months agonvc0: limit max global and alloc size
Karol Herbst [Fri, 19 Aug 2022 17:40:12 +0000 (19:40 +0200)]
nvc0: limit max global and alloc size

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50/nir: A group barrier is CTA-level not global-level
Pierre Moreau [Sun, 18 Apr 2021 19:22:34 +0000 (21:22 +0200)]
nv50/nir: A group barrier is CTA-level not global-level

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50/ir: Avoid generating splits of splits
Pierre Moreau [Thu, 28 Jul 2022 08:49:03 +0000 (10:49 +0200)]
nv50/ir: Avoid generating splits of splits

Among others, it would result in the spill offsets being wrong due to
being relative to the parent split and not absolute.

For example when computing a 64-bit multiply on Tesla (which only
supports 16-bit mul in hardware), the sources will first be split into
32-bit values and then a second time down to 16-bit ones. Looking at the
first source, the spill offsets ended being computed as follows:

    { .hihi = +2, .hilo = +0, .lohi = +2, .lolo = +0 }

instead of the expected

    { .hihi = +6, .hilo = +4, .lohi = +2, .lolo = +0 }

This is resolved with this patch.

Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50/ra: Fix the offset computation for compounds
Pierre Moreau [Sat, 24 Apr 2021 21:27:06 +0000 (23:27 +0200)]
nv50/ra: Fix the offset computation for compounds

compMask is expressed in terms of colours, not bytes, where on Tesla we
have 1 colour per 16-bit (whereas it is 1 per 32-bit for later
architectures). By multiplying by units we will get back to a result in
bytes.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50/peephole: Disallow combining sub 4-byte ld/st for now
Pierre Moreau [Mon, 12 Apr 2021 07:26:03 +0000 (09:26 +0200)]
nv50/peephole: Disallow combining sub 4-byte ld/st for now

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50/ir: Handle non-32-bit values when cst folding SPLIT
Pierre Moreau [Mon, 19 Apr 2021 17:04:11 +0000 (19:04 +0200)]
nv50/ir: Handle non-32-bit values when cst folding SPLIT

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50: Mark RESOURCE_FROM_USER_MEMORY_COMPUTE_ONLY as unsupported
Pierre Moreau [Mon, 27 Jul 2020 07:53:08 +0000 (09:53 +0200)]
nv50: Mark RESOURCE_FROM_USER_MEMORY_COMPUTE_ONLY as unsupported

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50: Disallow allocating more than VRAM size
Pierre Moreau [Sat, 16 Jan 2021 20:28:27 +0000 (21:28 +0100)]
nv50: Disallow allocating more than VRAM size

Allocations larger than the amount of VRAM available might be possible,
but has not been tested.

v4: Change it back to just VRAM size
v3: Increase the minimum from 32 MB to 128 MB, as OpenCL 1.x mandated at
    least 128 MB.
v2: Further lower the allocation size.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50: Report actual VRAM size
Pierre Moreau [Sun, 8 Nov 2020 10:55:16 +0000 (11:55 +0100)]
nv50: Report actual VRAM size

v2: handle vram_size == 0 (Karol)

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50: Rename interps to fixups
Pierre Moreau [Sat, 17 Apr 2021 20:36:31 +0000 (22:36 +0200)]
nv50: Rename interps to fixups

This matches the denomination used in nvc0, and finishes the name change
that started in f5fe9030.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50: Rename fixups to relocs
Pierre Moreau [Sat, 17 Apr 2021 20:32:08 +0000 (22:32 +0200)]
nv50: Rename fixups to relocs

This matches the names used on nvc0.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agonv50,nvc0: Do not resize global residents if unnecessary
Pierre Moreau [Thu, 21 May 2020 18:35:35 +0000 (20:35 +0200)]
nv50,nvc0: Do not resize global residents if unnecessary

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10711>

22 months agoradv: Don't assume layout == stencilLayout for stencil-only
Jason Ekstrand [Thu, 2 Jun 2022 18:24:13 +0000 (13:24 -0500)]
radv: Don't assume layout == stencilLayout for stencil-only

This assumption is probably valid with render passes but it won't for
dynamic rendering where we may not have a layout for depth at all.

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

22 months agoradv: Add a image_transition helper for separate depth/stencil layouts
Jason Ekstrand [Thu, 2 Jun 2022 18:18:05 +0000 (13:18 -0500)]
radv: Add a image_transition helper for separate depth/stencil layouts

This just reduces churn a bit when we switch to dynamic rendering.

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

22 months agoradv/meta: Drop redundant depth_view_can_fast_clear
Jason Ekstrand [Wed, 1 Jun 2022 19:17:40 +0000 (14:17 -0500)]
radv/meta: Drop redundant depth_view_can_fast_clear

It's entirely redundant with radv_can_fast_clear_depth except that it's
missing a few checks around view masks and the layer range in the actual
clear rect and assumes you're always clearing the whole image view.
This isn't necessarily true, even for classic Vulkan render passes.

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

22 months agoradv: Drop set/restore_subpass
Jason Ekstrand [Fri, 20 May 2022 21:50:24 +0000 (16:50 -0500)]
radv: Drop set/restore_subpass

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

22 months agoradv/meta: Use Begin/EndRendering for clears
Jason Ekstrand [Fri, 20 May 2022 21:48:25 +0000 (16:48 -0500)]
radv/meta: Use Begin/EndRendering for clears

This is only used in the case of resolve image clears which are going to
go away entirely when we start doing dynamic rendering only.

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

22 months agoradv/meta: s/dest/dst/ in a few functions
Jason Ekstrand [Fri, 20 May 2022 22:41:09 +0000 (17:41 -0500)]
radv/meta: s/dest/dst/ in a few functions

It's all horribly inconsistent.  Using "dst" has the advantage that it's
the same number of characters as "src".

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

22 months agoradv/meta: Use Begin/EndRendering for resolves
Jason Ekstrand [Fri, 20 May 2022 21:39:49 +0000 (16:39 -0500)]
radv/meta: Use Begin/EndRendering for resolves

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

22 months agoradv/meta: Drop subpass_att from radv_fast_clear_color
Jason Ekstrand [Fri, 20 May 2022 23:48:23 +0000 (18:48 -0500)]
radv/meta: Drop subpass_att from radv_fast_clear_color

It's redundant with clear_att->colorAttachment.

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

22 months agoradv/meta: Fix a stack use-after-free with sample locations
Jason Ekstrand [Fri, 20 May 2022 23:05:10 +0000 (18:05 -0500)]
radv/meta: Fix a stack use-after-free with sample locations

As soon as the if ends (or possibly before?) the VkSampleLocationsInfoEXT
goes out of scope.  We need it to stay valid until after the
vkCmdPipelineBarrier completes.

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

22 months agoradv/meta: Respect render area for MSAA resolves
Jason Ekstrand [Fri, 20 May 2022 21:32:19 +0000 (16:32 -0500)]
radv/meta: Respect render area for MSAA resolves

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

22 months agoradv: Use VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT for render loops
Jason Ekstrand [Thu, 12 May 2022 22:57:24 +0000 (17:57 -0500)]
radv: Use VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT for render loops

This commit fixes
dEQP-VK.rasterization.rasterization_order_attachment_access.format on
GFX9 because changing the layout for Vulkan feedback loops will trigger
a fast-clear eliminate.  Though, the root cause is unrelated to that and
it's because the CMASK/FMASK initialization on GFX9 is currently broken
for TC-compatible images (there is a TODO somewhere).

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

22 months agoradv: Use both aspects for depth/stencil blit destinations
Jason Ekstrand [Thu, 2 Jun 2022 16:12:14 +0000 (11:12 -0500)]
radv: Use both aspects for depth/stencil blit destinations

Even with dynamic rendering, you have to bind both aspects of the image
if the image contains both depth and stencil.  One day, we may see this
restriction lifted but that will require deeper driver surgery into the
way we handle depth/stencil layouts.

Fixes: 42db5900061c ("radv: convert the meta blit 2d path to dynamic rendering")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18084>

22 months agovulkan,anv,dozen: Use VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
Jason Ekstrand [Tue, 2 Aug 2022 17:58:46 +0000 (12:58 -0500)]
vulkan,anv,dozen: Use VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT

This has basically identical semantics to the pseudo-ext enum we were
using before.  Also, now that it's in the actual Vulkan enum, we can get
rid of all the #pragma garbage to avoid compiler warnings.

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

22 months agoradeonsi/vcn: add AUD syntax to h264 encoding
Ruijing Dong [Mon, 8 Aug 2022 22:41:01 +0000 (18:41 -0400)]
radeonsi/vcn: add AUD syntax to h264 encoding

Adding AUD syntax to h264 bitstream, for easier locate
frame boundaries.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agoradeonsi/vcn: remove rate control double begin IBs
Ruijing Dong [Mon, 8 Aug 2022 22:35:58 +0000 (18:35 -0400)]
radeonsi/vcn: remove rate control double begin IBs

[why]
when start rate control, two begin IBs have been sent

[how]
merge two begin IBs together

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agoradeonsi/vcn: support VBAQ modes
Ruijing Dong [Mon, 8 Aug 2022 22:33:52 +0000 (18:33 -0400)]
radeonsi/vcn: support VBAQ modes

add VBAQ supports to all vcn versions.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agoradeonsi/vcn: support encoding preset modes
Ruijing Dong [Fri, 19 Aug 2022 23:59:59 +0000 (19:59 -0400)]
radeonsi/vcn: support encoding preset modes

- support preset modes for all vcn versions
- SAO HEVC cannot use SPEED mode from vcn2 and up

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agoradeonsi/vcn: dpb change for supporting pre-encoding
Ruijing Dong [Mon, 8 Aug 2022 22:13:36 +0000 (18:13 -0400)]
radeonsi/vcn: dpb change for supporting pre-encoding

- dpb buffer created while receive the first begin_frame
  moved out from encoder creation.
- dpb buffer name changed from cpb.
- dpb buffer allocation to support pre-encoding
- different vcn version IB package adjustment
- merge reconstructed_picture_v4_0_t to reconstructed_picture_t

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agoradeonsi/vcn: add enc quality bits interface
Ruijing Dong [Mon, 8 Aug 2022 21:47:33 +0000 (17:47 -0400)]
radeonsi/vcn: add enc quality bits interface

- define quality_level interface in mesa
- interprete quality_level to internal modes

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agofrontends/va: improve enc quality interface change
Ruijing Dong [Mon, 8 Aug 2022 15:44:54 +0000 (11:44 -0400)]
frontends/va: improve enc quality interface change

[why]
to enhance va video encoding quality

[how]
use va encoding quality_level interface, and provide
default value and encoding quality adjustment options,
so that users can finetune encoding quality and performance
from va quality interface. (limited to VCNs)

There are 3 settings added:
- preset modes: speed, balance, quality
  they are using different encoding strategies
- vbaq modes:
  vbaq mode is using variance based strategy
  to improve the subjective image quality
- pre-encoding modes:
  Using scaled down input image for pre-encoding to have
  better rate-control reaction and consume more memory
  in the same time. Only preencoding-4x mode is enabled.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17994>

22 months agoci: Remove -Wno-error=deprecated-declarations cpp option from debian-clang
Yonggang Luo [Tue, 23 Aug 2022 04:12:22 +0000 (12:12 +0800)]
ci: Remove -Wno-error=deprecated-declarations cpp option from debian-clang

As all deprecated-declarations warnings are fixed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agoosmesa: Fixes [-Wdeprecated-declarations] in test-render.cpp
Yonggang Luo [Tue, 23 Aug 2022 04:03:07 +0000 (12:03 +0800)]
osmesa: Fixes [-Wdeprecated-declarations] in test-render.cpp

Warning message:
../src/gallium/targets/osmesa/test-render.cpp:150:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agovirgl: Fixes [-Wdeprecated-declarations] in virgl_staging_mgr_test.cpp
Yonggang Luo [Tue, 23 Aug 2022 04:01:22 +0000 (12:01 +0800)]
virgl: Fixes [-Wdeprecated-declarations] in virgl_staging_mgr_test.cpp

Warning message:
../src/gallium/drivers/virgl/tests/virgl_staging_mgr_test.cpp:188:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agointel/compiler: Fixes [-Wdeprecated-declarations] in test_eu_validate.cpp
Yonggang Luo [Tue, 23 Aug 2022 03:57:51 +0000 (11:57 +0800)]
intel/compiler: Fixes [-Wdeprecated-declarations] in test_eu_validate.cpp

Warning message:
../src/intel/compiler/test_eu_validate.cpp:96:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agointel/compiler: Fixes [-Wdeprecated-declarations] in test_eu_compact.cpp
Yonggang Luo [Tue, 23 Aug 2022 03:56:08 +0000 (11:56 +0800)]
intel/compiler: Fixes [-Wdeprecated-declarations] in test_eu_compact.cpp

Warning messages:
../src/intel/compiler/test_eu_compact.cpp:238:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

../src/intel/compiler/test_eu_compact.cpp:256:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agoglsl: Fixes [-Wdeprecated-declarations] in list_iterators.cpp
Yonggang Luo [Tue, 23 Aug 2022 03:53:31 +0000 (11:53 +0800)]
glsl: Fixes [-Wdeprecated-declarations] in list_iterators.cpp

Warning messages:
../src/compiler/glsl/tests/list_iterators.cpp:68:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

../src/compiler/glsl/tests/list_iterators.cpp:187:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agoutil: Fix [-Wdeprecated-declarations] in mesa-sha1_test.cpp
Yonggang Luo [Tue, 23 Aug 2022 03:49:40 +0000 (11:49 +0800)]
util: Fix [-Wdeprecated-declarations] in mesa-sha1_test.cpp

Warning message:
../src/util/tests/mesa-sha1_test.cpp:42:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agonir: Fixes [-Wdeprecated-declarations] in serialize_tests.cpp
Yonggang Luo [Tue, 23 Aug 2022 03:51:39 +0000 (11:51 +0800)]
nir: Fixes [-Wdeprecated-declarations] in serialize_tests.cpp

Warning messages:
../src/compiler/nir/tests/serialize_tests.cpp:113:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

../src/compiler/nir/tests/serialize_tests.cpp:119:1: warning: 'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Wdeprecated-declarations]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18203>

22 months agointel/compiler: Get URB handle in emit_task/mesh_intrinsic functions
Caio Oliveira [Mon, 22 Aug 2022 05:21:37 +0000 (22:21 -0700)]
intel/compiler: Get URB handle in emit_task/mesh_intrinsic functions

This will make convenient later to keep track of the urb
handles directly in a Task thread payload struct (to be part of
fs_visitor).

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18188>

22 months agointel/compiler: Call get_mesh_urb_handle one level up in call-stack
Caio Oliveira [Mon, 22 Aug 2022 05:04:21 +0000 (22:04 -0700)]
intel/compiler: Call get_mesh_urb_handle one level up in call-stack

Call it now from a fs_visitor member functions instead of the static
ones.  This will make convenient later to keep track of the urb
handles directly in a Task thread payload struct (to be part of
fs_visitor).

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18188>

22 months agoamd/compiler: Fixes warning [-Wunused-variable] in test_optimizer_postRA.cpp
Yonggang Luo [Tue, 23 Aug 2022 04:24:03 +0000 (12:24 +0800)]
amd/compiler: Fixes warning [-Wunused-variable] in test_optimizer_postRA.cpp

Warning message:
../src/amd/compiler/tests/test_optimizer_postRA.cpp:137:13: warning: unused variable 'reg_s1' [-Wunused-variable]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18205>

22 months agoamd/compiler: Fixes warning [-Wunused-variable] in test_to_hw_instr.cpp
Yonggang Luo [Tue, 23 Aug 2022 04:23:01 +0000 (12:23 +0800)]
amd/compiler: Fixes warning [-Wunused-variable] in test_to_hw_instr.cpp

Warning message:
../src/amd/compiler/tests/test_to_hw_instr.cpp:793:12: warning: unused variable 'reg_s1' [-Wunused-variable]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18205>

22 months agoanv: fix assert to build with shader cache disabled
sjfricke [Mon, 22 Aug 2022 11:36:53 +0000 (20:36 +0900)]
anv: fix assert to build with shader cache disabled

When setting -Dshader-cache=disabled the build fails due
no member named 'disk_cache' in 'struct anv_physical_device'

Signed-off-by: sjfricke <spencerfricke@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Fixes: 7f1e8230 ("anv: Switch to the new common pipeline cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18181>

22 months agoiris: Always initialize shader compilation queue ready fence
Sviatoslav Peleshko [Mon, 22 Aug 2022 10:48:40 +0000 (13:48 +0300)]
iris: Always initialize shader compilation queue ready fence

We use/delete this fence unconditionally, but it was initialized only
when screen->precompile is set. Move the util_queue_fence_init call
to the iris_create_uncompiled_shader to initialize it always.

Fixes: 42c34e1a ("iris: Enable threaded shader compilation")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7074
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Tested-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18182>

22 months agoanv: remove the LOCAL_MEM allocation bit
Lionel Landwerlin [Tue, 2 Aug 2022 13:17:31 +0000 (16:17 +0300)]
anv: remove the LOCAL_MEM allocation bit

We always want to use local memory if possible, we'll just add the
system memory heap if the buffer needs to be host visible.

v2: Drop some usages of ANV_BO_ALLOC_LOCAL_MEM_CPU_VISIBLE

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17873>

22 months agoanv: prevent trying to mmap non host visible memory
Lionel Landwerlin [Tue, 2 Aug 2022 10:09:44 +0000 (13:09 +0300)]
anv: prevent trying to mmap non host visible memory

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17873>

22 months agoglsl/tests: do not perform eol-conversion on windows
Erik Faye-Lund [Mon, 22 Aug 2022 09:43:52 +0000 (11:43 +0200)]
glsl/tests: do not perform eol-conversion on windows

These tests fail on Windows, because we open the expected files in
text-mode, performing EOL conversion. Instead, let's read them as binary
files, and manually UTF-8 decode them to get the expected result.

This fixes the tests on Windows for me.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18179>

22 months agoanv: fix assert in memory budget code when extension is not supported
Lionel Landwerlin [Fri, 19 Aug 2022 20:31:08 +0000 (23:31 +0300)]
anv: fix assert in memory budget code when extension is not supported

First we should only support the extension if we can support reporting
on all the heaps.

Second we should not run any query code if the extension is not
supported.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: fae88d8791b2 ("anv: make use of the new smallbar uAPI")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18153>

22 months agoanv: fixup assertions on lowered storage formats
Lionel Landwerlin [Sun, 14 Aug 2022 18:41:04 +0000 (21:41 +0300)]
anv: fixup assertions on lowered storage formats

With VK_FORMAT_B10G11R11_UFLOAT_PACK32 in particular, we're seeing
applications create image views with swizzle = R,G,B,0

But since the format has no alpha channel, the swizzle value for it
does not matter for the equivalence we're trying to verify.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a9edc268b9b1 ("anv: validate image view lowered storage formats for storage")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18081>

22 months agotu: Allocate private memory per-device instead of per-pipeline
Mark Collins [Wed, 17 Aug 2022 13:58:48 +0000 (19:28 +0530)]
tu: Allocate private memory per-device instead of per-pipeline

It was discovered that a substantial amount (several GiB) of
private memory was being used by Skyline Emulator as it used a
substantial amount of pipelines with private memory that were
never deleted throughout the lifetime of the application.

These private memory allocations are now pooled into per-device
BOs shared among several pipelines instead of a single BO for
every pipeline, this reduces the memory footprint of private
memory allocations from several GiB to 8 MiB in Skyline Emulator
on certain titles.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7033
Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18073>

22 months agoanv: fix GetPipelineExecutableStatistics for ray tracing pipelines
Lionel Landwerlin [Thu, 11 Aug 2022 13:33:04 +0000 (16:33 +0300)]
anv: fix GetPipelineExecutableStatistics for ray tracing pipelines

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e10455585115d5 ("anv: Compile ray-tracing shaders")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18013>

22 months agoRevert "anv: Do not copy garbage to batch_bo"
Mark Janes [Tue, 23 Aug 2022 00:48:45 +0000 (17:48 -0700)]
Revert "anv: Do not copy garbage to batch_bo"

This reverts commit 87b19c68d8bc33dfc2c61550e50fb6890b47656c.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7109
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18202>

22 months agozink: ignore nir_texop_lod for tex dest matching
Mike Blumenkrantz [Mon, 22 Aug 2022 21:41:21 +0000 (17:41 -0400)]
zink: ignore nir_texop_lod for tex dest matching

this doesn't need fixing

Fixes: 3a475766876 ("zink: add a compiler pass to match up tex op dest types")

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

22 months agozink: handle nir_intrinsic_sparse_residency_code_and mechanics
Mike Blumenkrantz [Tue, 17 May 2022 17:37:10 +0000 (13:37 -0400)]
zink: handle nir_intrinsic_sparse_residency_code_and mechanics

without glsl array lowering, this intrinsic can creep in for tg4 ops,
which complicates everything. instead, rewrite these ops as residency+iand,
and then rewrite the existing residency ops to match

v2 (idr): Add missing size parameter to nir_is_sparse_texels_resident
calls.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16547>

22 months agoglsl: Remove lower_offset_arrays pass
Ian Romanick [Tue, 17 May 2022 17:29:25 +0000 (10:29 -0700)]
glsl: Remove lower_offset_arrays pass

It is no longer used.

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

22 months agoradeonsi: r600: d3d12: st: Use NIR lowering for tg4 offset arrays instead of GLSL...
Ian Romanick [Tue, 17 May 2022 15:18:26 +0000 (08:18 -0700)]
radeonsi: r600: d3d12: st: Use NIR lowering for tg4 offset arrays instead of GLSL lowering

I think I got all the drivers that need updating.  This is only
necessary in drivers that support GLSL 4.00 / GL_ARB_gpu_shader5 and
have PIPE_CAP_TEXTURE_GATHER_OFFSETS = 0.

v2: Don't (accidentally) condition tg4 offsets lowering on tex rect
lowering.  Noticed by Qiang.

v3: Add missing bool() cast.

v4: don't use designated initializers

Fixes: 640f9098621 ("glsl: add _texture related sparse texture builtin functions")
Closes: #6365
Tested-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16547>

22 months agonir: spirv: Allow 32-bit version of nir_intrinsic_is_sparse_texels_resident
Ian Romanick [Tue, 17 May 2022 01:37:17 +0000 (18:37 -0700)]
nir: spirv: Allow 32-bit version of nir_intrinsic_is_sparse_texels_resident

This intrinsic returns a Boolean.  Both 1-bit and 32-bit versions must
be allowed.  Otherwise, size mismatches will occur after lowering
1-bit Booleans to 32-bit.

Fixes: 4cbdf9ec4d4 ("nir,spirv: implement SpvOpImageSparseTexelsResident")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16547>

22 months agosvga: fix invalid component access of domain location
Charmaine Lee [Thu, 18 Aug 2022 19:38:38 +0000 (12:38 -0700)]
svga: fix invalid component access of domain location

Tesscoord is declared as vec3 in the incoming shader but the z component
of a tesscoord should only be referenced in the domain shader if the
tessellator domain is of triangle type.

Fixes vmx crash running GFXBench-Tessellation with MTL Renderer.

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Min-Yu Huang <min-yuhuang@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18185>

22 months agomeson: add svga gallium driver to 'auto' group on arm/aarch64
Martin Krastev [Fri, 19 Aug 2022 07:25:17 +0000 (10:25 +0300)]
meson: add svga gallium driver to 'auto' group on arm/aarch64

svga gallium driver is a good citizen on arm/aarch64 linux targets.
Enable that driver for -Dgallium-drivers=auto builds.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18186>

22 months agofreedreno: Avoid deferred-flush dependency loops
Rob Clark [Mon, 22 Aug 2022 21:55:30 +0000 (14:55 -0700)]
freedreno: Avoid deferred-flush dependency loops

We can't blindly make every other batch a dependency of the current
batch, because it is possible they already have a dependency on the
current batch, which would result in a loop.

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

22 months agofreedreno: Simplify add_dep logic
Rob Clark [Mon, 22 Aug 2022 21:40:48 +0000 (14:40 -0700)]
freedreno: Simplify add_dep logic

These two cases never happen, guaranteed by the logic above that adds
to the batches[] table.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18200>

22 months agofreedreno: Extract helper to check for batch dependency
Rob Clark [Mon, 22 Aug 2022 21:14:14 +0000 (14:14 -0700)]
freedreno: Extract helper to check for batch dependency

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18200>

22 months agotu: Disable userspace iova allocations
Danylo Piliaiev [Mon, 22 Aug 2022 22:19:48 +0000 (01:19 +0300)]
tu: Disable userspace iova allocations

If BO is freed while kernel considers it busy, our VMA state gets
desynchronized from kernel's VMA state because kernel waits
until BO stops being busy. And whether BO is busy kernel decides at
submission granularity.

On the other hand in Vulkan we may free resource as soon as we know
it won't be used.

Not completely reverting the changes in hope that proper resolution
would be found soon.

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

Fixes: e23c4fbd9b6b95537ab00d19a034eaffe5fe86b0
("tu: Switch to userspace iova allocations if kernel supports it")

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

22 months agoaco: drop unused variable
Eric Engestrom [Mon, 22 Aug 2022 20:39:05 +0000 (21:39 +0100)]
aco: drop unused variable

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18193>

22 months agoaco: Use unreachable instead assert(false)
Yonggang Luo [Mon, 22 Aug 2022 20:45:17 +0000 (04:45 +0800)]
aco: Use unreachable instead assert(false)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18194>

22 months agoci/tu: Add another cwe_after_bind fail that appeared in the reshuffle.
Emma Anholt [Mon, 8 Aug 2022 16:46:36 +0000 (09:46 -0700)]
ci/tu: Add another cwe_after_bind fail that appeared in the reshuffle.

gmem is a fractional run of the full caselist, and one of them showed up
crashing on a630_vk_full after the deqp-runner uprev.  Add all of them so
we don't fail on the next reshuffle either.

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

22 months agotu: Emit only as many VBs as we've ever seen bound on the command buffer.
Emma Anholt [Thu, 4 Aug 2022 20:02:57 +0000 (13:02 -0700)]
tu: Emit only as many VBs as we've ever seen bound on the command buffer.

A later CmdBindPipeline would shrink the two draw states' sizes to the
number of VBs the pipeline actually uses, but we can save some CPU
overhead and memory by not emitting all the unused VBs as well.

Improves zink drawoverhead throughput on test 5 (1 VB change) by 38.5178%
+/- 0.48738% (n=18).

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

22 months agotu: Only emit FS output regs for as many MRTs as we have (but at least 1).
Emma Anholt [Wed, 3 Aug 2022 22:17:50 +0000 (15:17 -0700)]
tu: Only emit FS output regs for as many MRTs as we have (but at least 1).

This seems to be what the blob does, should save a bit of CP overhead.
zink drawoverhead throughput on test 7 (shader change) +0.234668% +/-
0.148818% (n=25).

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

22 months agotu: Only emit as many VPC interp/repl regs as will be referenced.
Emma Anholt [Wed, 3 Aug 2022 23:33:28 +0000 (16:33 -0700)]
tu: Only emit as many VPC interp/repl regs as will be referenced.

Saves a bit of CP overhead on pipeline switch.  Improves zink drawoverhead
-test 7 (shader program change) throughput by 1.10825% +/- 0.131485%
(n=10).

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

22 months agotu: Only emit as many bindless regs as we have seen descriptor sets.
Emma Anholt [Wed, 3 Aug 2022 23:08:46 +0000 (16:08 -0700)]
tu: Only emit as many bindless regs as we have seen descriptor sets.

Cuts 12 dwords of CS per draw in vk-5-normal's main renderpass.

zink drawoverhead -test 9 (1 texture change) throughput +0.898636% +/-
0.212647% (n=30).

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

22 months agoanv: Group all context operations during device creation
José Roberto de Souza [Tue, 9 Aug 2022 20:37:13 +0000 (13:37 -0700)]
anv: Group all context operations during device creation

Move all the setup of context to one function making it easier
to read it.
There is no behavior changes here.

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

22 months agoanv: Nuke anv_execbuf_init()
José Roberto de Souza [Wed, 10 Aug 2022 17:15:54 +0000 (10:15 -0700)]
anv: Nuke anv_execbuf_init()

We can do designated initialization to initialize needed values
and set the rest to zero.

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