platform/upstream/mesa.git
22 months agost/mesa: fix potential use-after-free in draw_bitmap_quad
Marek Olšák [Mon, 25 Jul 2022 00:36:00 +0000 (20:36 -0400)]
st/mesa: fix potential use-after-free in draw_bitmap_quad

This is super unlikely to be freed before use, but let's fix it anyway.

setup_render_state calls set_sampler_views(take_ownership=true), which
means it takes ownership of the sampler view reference and is free to
unreference it, so we can't use sv after setup_render_state.

Fixes: feda6e9c5d101 - st/mesa: set take_ownership = true in set_sampler_views

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17780>

22 months agomesa: create glBitmap textures while creating display lists
Marek Olšák [Mon, 25 Jul 2022 00:47:26 +0000 (20:47 -0400)]
mesa: create glBitmap textures while creating display lists

This makes glCallList just a textured draw, which is blazingly fast.

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

22 months agoRevert "mesa: implement a display list / glBitmap texture atlas"
Marek Olšák [Sun, 24 Jul 2022 23:35:28 +0000 (19:35 -0400)]
Revert "mesa: implement a display list / glBitmap texture atlas"

This reverts commit b26ddda12fe7dbb6a4e6af3b47c1e837cc7ebb03 and
commit 06d3b0a006f35dc232d512d09f45a6cb4f13cfdf.

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

22 months agointel/fs: bump max SIMD size for A64 atomics with LSC
Lionel Landwerlin [Mon, 1 Aug 2022 15:12:45 +0000 (18:12 +0300)]
intel/fs: bump max SIMD size for A64 atomics with LSC

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>.
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>

22 months agointel/fs: port block a64/surface messages to use LSC
Lionel Landwerlin [Sun, 24 Jul 2022 13:17:17 +0000 (16:17 +0300)]
intel/fs: port block a64/surface messages to use LSC

v2: Fixup block load/store on surfaces/shared-memory (Rohan)

v3: drop write specific size_written case (Rohan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>

22 months agointel/fs: switch register allocation spilling to use LSC on Gfx12.5+
Lionel Landwerlin [Mon, 18 Jul 2022 09:27:53 +0000 (12:27 +0300)]
intel/fs: switch register allocation spilling to use LSC on Gfx12.5+

v2: drop the hardcoded inst->mlen=1 (Rohan)

v3: Move back to LOAD/STORE messages (limited to SIMD16 for LSC)

v4: Also use 4 GRFs transpose loads for fills (Curro)

v5: Reduce amount of needed register to build per lane offsets (Curro)
    Drop some now useless SIMD32 code
    Unify unspill code

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>

22 months agointel/fs: fixup SEND validation check on overlapping src0/src1
Lionel Landwerlin [Sun, 24 Jul 2022 10:05:57 +0000 (13:05 +0300)]
intel/fs: fixup SEND validation check on overlapping src0/src1

With the following SEND instruction :

   send(1)         nullUD          nullUD          g0UD            0x4200c504                a0.1<0>UD

This instruction although valid but somewhat nonsensical (SEND message
to write at offset contained in NULL register), triggers an error in
the validator.

The restriction is that we cannot have overlapping sources. The
validator not checking the type of register incorrectly thinks that
the null register (offset 0) is the same as g0.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>

22 months agointel/fs: remove unused opcode
Lionel Landwerlin [Sat, 23 Jul 2022 19:57:12 +0000 (22:57 +0300)]
intel/fs: remove unused opcode

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>

22 months agointel/fs: switch compute push constant loads to LSC
Lionel Landwerlin [Fri, 15 Jul 2022 10:08:23 +0000 (13:08 +0300)]
intel/fs: switch compute push constant loads to LSC

We're now able to load up to 8 GRFs in one send.

v2: Switch to use transpose + vector of up to 64 (Thanks Curro!)

v3: Increase parallelism by not reusing the same register for push
    constant offset (Curro)

v4: Drop dead ADD() instruction (Curro)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>

22 months agotu: fix invalid free on alloc failure
Mike Blumenkrantz [Wed, 24 Aug 2022 12:53:31 +0000 (08:53 -0400)]
tu: fix invalid free on alloc failure

this is not an allocated pointer

cc: mesa-stable

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

22 months agoradv: Fold 16bit image sources.
Georg Lehmann [Mon, 22 Aug 2022 14:45:00 +0000 (16:45 +0200)]
radv: Fold 16bit image sources.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18106>

22 months agoaco: Combine 16bit undef and constants instead of using s_pack.
Georg Lehmann [Thu, 11 Aug 2022 12:12:33 +0000 (14:12 +0200)]
aco: Combine 16bit undef and constants instead of using s_pack.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18106>

22 months agoaco: Implement storage image A16.
Georg Lehmann [Thu, 11 Aug 2022 10:11:25 +0000 (12:11 +0200)]
aco: Implement storage image A16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18106>

22 months agonir/fold_16bit_tex_image: Add an option to fold image sources.
Georg Lehmann [Thu, 11 Aug 2022 10:11:04 +0000 (12:11 +0200)]
nir/fold_16bit_tex_image: Add an option to fold image sources.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18106>

22 months agonir_lower_atomics_to_ssbo: Initialize deref struct
Gert Wollny [Wed, 24 Aug 2022 07:09:10 +0000 (09:09 +0200)]
nir_lower_atomics_to_ssbo: Initialize deref struct

This fixes the use of an uninitialzed value:

Conditional jump or move depends on uninitialised value(s)
  bcmp (vg_replace_strmem.c:1203)
  _mesa_add_sized_state_reference (prog_parameter.c:434)
  st_nir_assign_uniform_locations(gl_context*, gl_program*, nir_shader*) (st_glsl_to_nir.cpp:209)
  st_finalize_nir (st_glsl_to_nir.cpp:1041)
  by 0x58271B9: st_glsl_to_nir_post_opts(st_context*, gl_program*, gl_shader_program*) (st_glsl_to_nir.cpp:571)
  ...
Uninitialised value was created by a heap allocation
  malloc (vg_replace_malloc.c:381)
  ralloc_size (ralloc.c:114)
  ralloc_array_size (ralloc.c:218)
  deref_offset_var (nir_lower_atomics_to_ssbo.c:47)
  lower_instr (nir_lower_atomics_to_ssbo.c:111)
  nir_lower_atomics_to_ssbo (nir_lower_atomics_to_ssbo.c:204)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18227>

22 months agonir: Add nir_ssa_scalar_is_undef.
Georg Lehmann [Mon, 22 Aug 2022 14:32:36 +0000 (16:32 +0200)]
nir: Add nir_ssa_scalar_is_undef.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18183>

22 months agoci: fix leftover tag in image-tags.yml
David Heidelberg [Wed, 24 Aug 2022 12:49:57 +0000 (14:49 +0200)]
ci: fix leftover tag in image-tags.yml

Fixes: eb6ce47d4f75 ("ci: Use mold for x86-64 and AArch64 builds")

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

22 months agoradv: Advertise subgroup ops for rt stages
Konstantin Seurer [Sun, 21 Aug 2022 11:54:14 +0000 (13:54 +0200)]
radv: Advertise subgroup ops for rt stages

Closes: #7098
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18169>

22 months agozink: support PIPE_CAP_FBFETCH_COHERENT
Mike Blumenkrantz [Thu, 18 Aug 2022 16:59:46 +0000 (12:59 -0400)]
zink: support PIPE_CAP_FBFETCH_COHERENT

that's what VK_EXT_rasterization_order_attachment_access is for

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

22 months agovulkan: Update the XML and headers to 1.3.225
Mike Blumenkrantz [Thu, 18 Aug 2022 16:59:33 +0000 (12:59 -0400)]
vulkan: Update the XML and headers to 1.3.225

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

22 months agoradv: merge gather_tess_info() with radv_fill_shader_info()
Samuel Pitoiset [Mon, 22 Aug 2022 13:37:11 +0000 (15:37 +0200)]
radv: merge gather_tess_info() with radv_fill_shader_info()

Shouldn't introduce any functional changes. The dependencies between
stages might be improved with a new helper that will link shader_info.

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 agoradv: remove unused num_tess_patches assignment for VS
Samuel Pitoiset [Mon, 22 Aug 2022 13:22:30 +0000 (15:22 +0200)]
radv: remove unused num_tess_patches assignment for VS

This is never used.

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 agoradv: remove unused tcs_vertices_out assignment for VS
Samuel Pitoiset [Mon, 22 Aug 2022 13:12:49 +0000 (15:12 +0200)]
radv: remove unused tcs_vertices_out assignment for VS

This is never used.

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 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>