platform/upstream/mesa.git
11 months agod3d12: Fix multidimensional array ordering
Jesse Natalie [Fri, 24 Nov 2023 20:20:44 +0000 (12:20 -0800)]
d3d12: Fix multidimensional array ordering

Apparently my C multimensional array syntax was rusty.

Fixes: a6740ee7 ("d3d12: Fix indexing of local_reference_state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26362>
(cherry picked from commit 1924cdc2898b0a14a8afd13db3a06dab9e1d032e)

11 months agointel/ci: fix .hasvk-manual-rules
Eric Engestrom [Fri, 17 Nov 2023 16:03:05 +0000 (16:03 +0000)]
intel/ci: fix .hasvk-manual-rules

Fixes: 570acf56554a619ca2bf ("ci: Add a manual full and 1/10th hasvk CTS runs.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26259>
(cherry picked from commit cf510e38a51250702ec90bece7a9d397669ae28f)

11 months agointel/perf: fix regex escaping
Eric Engestrom [Fri, 24 Nov 2023 09:48:35 +0000 (09:48 +0000)]
intel/perf: fix regex escaping

`\$` is interpreted before being passed to `re.search()`, but luckily
for us the escape is also invalid and because of that, python 3.12+
warns us about it.

Use a raw string instead, so that the `\` is passed untouched to
`re.search()`.

Fixes: aa04b47c6e43e6cc3561 ("intel/perf: add support for GtSlice/GtSliceXDualsubsliceY variables")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26355>
(cherry picked from commit 19420731123e850e10c68eb3cd672b00561c48d7)

11 months agonir: fix gathering TESS_LEVEL_INNER/OUTER usage with lowered IO
Marek Olšák [Mon, 13 Nov 2023 05:16:24 +0000 (00:16 -0500)]
nir: fix gathering TESS_LEVEL_INNER/OUTER usage with lowered IO

Those varyings shouldn't flag patch_inputs_read/patch_outputs_written.

Fixes: 10be706778bd670 - nir: gather indirect info from lowered IO intrinsics

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26275>
(cherry picked from commit 7a9b73fcb81126faa92397d82b627db64e1b8e0f)

11 months agoradeonsi: check sctx->tess_rings is valid before using it
Pierre-Eric Pelloux-Prayer [Tue, 14 Nov 2023 12:41:47 +0000 (13:41 +0100)]
radeonsi: check sctx->tess_rings is valid before using it

Fixes: c89ca3b47f1 ("radeonsi: change si_emit_derived_tess_state into a state atom")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10015

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26190>
(cherry picked from commit 945288ffaecac106c978d10cd4d8512fa2992c47)

11 months ago.pick_status.json: Update to f843b14c171299e1696ca6d971ccaa496f60c3ab
Eric Engestrom [Tue, 28 Nov 2023 11:22:43 +0000 (11:22 +0000)]
.pick_status.json: Update to f843b14c171299e1696ca6d971ccaa496f60c3ab

11 months agoVERSION: bump for 23.3.0-rc5
Eric Engestrom [Fri, 24 Nov 2023 19:40:33 +0000 (19:40 +0000)]
VERSION: bump for 23.3.0-rc5

11 months agomesa: restore call to _mesa_set_varying_vp_inputs from set_vertex_processing_mode
Pierre-Eric Pelloux-Prayer [Fri, 10 Nov 2023 13:32:50 +0000 (14:32 +0100)]
mesa: restore call to _mesa_set_varying_vp_inputs from set_vertex_processing_mode

Otherwise ctx->VertexProgram._VaryingInputs might not be up to date.

We can't do this in update_program because this breaks vbo_save_playback_vertex_list_gallium:

  const GLbitfield enabled = node->enabled_attribs[mode];
  _mesa_set_varying_vp_inputs(ctx, enabled);              <-- update _VaryingInputs

  if (ctx->NewState)
     _mesa_update_state(ctx);                             <-- calls update_program, reverting the
                                                              change made above

Fixes: c97961a855a ("mesa: fix 38% decrease in display list performance of Viewperf2020/NX8_StudioAA")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9441
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25956>
(cherry picked from commit 64352ae8e4341d57504478cf2e6315041f13d5e0)

11 months agov3d/resource: Support offset query for multi-planar planes
Robert Mader [Sun, 19 Nov 2023 21:14:16 +0000 (22:14 +0100)]
v3d/resource: Support offset query for multi-planar planes

This is required in order to return the correct value for
`gbm_dri_bo_get_offset()` for e.g. the second plane of a NV12 image.

Use the newly introduced `util_resource` helper and, while on it, also
add support for `gbm_bo_get_plane_count()`.

Cc: mesa-stable
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26283>
(cherry picked from commit 2404483706f4396920e94f7abc80368b7d25a965)

11 months agovc4/resource: Support offset query for multi-planar planes
Robert Mader [Sun, 19 Nov 2023 21:12:36 +0000 (22:12 +0100)]
vc4/resource: Support offset query for multi-planar planes

This is required in order to return the correct value for
`gbm_dri_bo_get_offset()` for e.g. the second plane of a NV12 image.

Use the newly introduced `util_resource` helper and, while on it, also
add support for `gbm_bo_get_plane_count()`.

Cc: mesa-stable
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26283>
(cherry picked from commit cb8cdab928ff2302bef00b341914168c78a89a7c)

11 months agoradv: do not set OREO_MODE to fix rare corruption on GFX11
Samuel Pitoiset [Wed, 22 Nov 2023 16:33:39 +0000 (17:33 +0100)]
radv: do not set OREO_MODE to fix rare corruption on GFX11

Ported from RadeonSI 3f108e7615213051466af4ed688e94ce6ddde065.
Seems to be a recommendation from the AMD hw team.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26333>
(cherry picked from commit ad7efdea6e30c46e1b8b80672cac4f6042956df6)

11 months agoradv: set radv_invariant_geom=true for War Thunder
Samuel Pitoiset [Wed, 22 Nov 2023 17:40:32 +0000 (18:40 +0100)]
radv: set radv_invariant_geom=true for War Thunder

War Thunder has native Vulkan support.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10186
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26334>
(cherry picked from commit d9f312b86aa979e237f2de3dc3f025e367cfe7b6)

11 months agoradv: disable TC-compatible HTILE on Tonga and Iceland
Samuel Pitoiset [Wed, 15 Nov 2023 10:52:12 +0000 (11:52 +0100)]
radv: disable TC-compatible HTILE on Tonga and Iceland

According to RadeonSI, TC-compat HTILE have issues on Tonga/Iceland
(first GFX8 chips) and a bunch of games seem to have issues.

Let's disable it instead of using a feature that is known broken.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7101
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3894
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26204>
(cherry picked from commit ab3460311509fbc3e1ff36647a21cffe7710962a)

11 months agoanv: use the right vertexOffset on CmdDrawMultiIndexed
Iván Briano [Mon, 20 Nov 2023 23:50:00 +0000 (15:50 -0800)]
anv: use the right vertexOffset on CmdDrawMultiIndexed

Fixes: c70ef757e63 ("anv: Use extended parameters on Gen11+")

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

11 months agoutil/rbsp: Fill bits twice if reading more than 16 bits
David Rosca [Sun, 19 Nov 2023 10:27:29 +0000 (11:27 +0100)]
util/rbsp: Fill bits twice if reading more than 16 bits

vl_rbsp_fillbits may fill less than 32 bits if it removes emulation
prevention bytes, but will fill at least 16 bits. We need to call it
twice when reading more than 16 bits.

This fixes parsing H264 SPS packed header in va frontend when emulation
prevention bytes are at position where 32 bit values are read.

Cc: mesa-stable
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26276>
(cherry picked from commit 73d69ef1e6b013f923ec459c789976570baaf447)

11 months ago.pick_status.json: Update to b07a58157d0b110dbc09a42cffe7046c3200dd3b
Eric Engestrom [Fri, 24 Nov 2023 17:15:13 +0000 (17:15 +0000)]
.pick_status.json: Update to b07a58157d0b110dbc09a42cffe7046c3200dd3b

11 months agotu: Fix re-emitting VS param state after it is re-enabled
Connor Abbott [Fri, 10 Nov 2023 17:03:08 +0000 (18:03 +0100)]
tu: Fix re-emitting VS param state after it is re-enabled

We need to always re-emit it if it was disabled. Fixes vertex/instance
offset in a direct draw after an indirect draw.

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

11 months agoaco/sched: treat p_dual_src_export_gfx11 like export
Georg Lehmann [Tue, 21 Nov 2023 14:24:35 +0000 (15:24 +0100)]
aco/sched: treat p_dual_src_export_gfx11 like export

This prevents the scheduler from moving the dual source export above mrtz
export, which caused hangs.

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

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26317>
(cherry picked from commit 0a5d3ac8d2b245e8b3f3589d3ade3de7356fe637)

11 months agodrirc: Set limit_trig_input_range option for Valheim
Tapani Pälli [Mon, 20 Nov 2023 18:42:31 +0000 (20:42 +0200)]
drirc: Set limit_trig_input_range option for Valheim

Fixes ocean rendering in Valheim.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10174
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26295>
(cherry picked from commit aba00ff391b9fe9e63e2a8b6ad807f338ad7a6a6)

11 months agointel/perf: fix querying of configurations
Lionel Landwerlin [Mon, 20 Nov 2023 09:43:24 +0000 (11:43 +0200)]
intel/perf: fix querying of configurations

Using the unsized data field is incorrect. The data is located behind
the entire drm_i915_query_perf_config structure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26285>
(cherry picked from commit f9bab3566bcfbf4d33bcbb9fb8d5e8d416cb5674)

11 months agov3dv: Rework to remove drm authentication for wsi
Erico Nunes [Thu, 16 Nov 2023 16:00:16 +0000 (17:00 +0100)]
v3dv: Rework to remove drm authentication for wsi

For Wayland wsi allocations, v3dv used the wl_drm protocol, which is now
being phased out in favor of dmabuf feedback.
wl_drm is used to figure out the display device (in v3dv assumed to be
vc4) and then to authenticate with the Wayland compositor in order to
allocate scanout-able buffers (in this case, dumb buffers) directly at
the display device.
Recent commit 88c03ddd34 changed the behavior of the wsi code, and
wl_drm is now passing the render device instead, which broke Wayland
wsi.
It turns out that the authentication code is not really needed and since
we would like to remove wl_drm usage and the master device is assumed to
be vc4 anyway, we can just remove some unneeded device-specific wsi code
and get Vulkan Wayland wsi back to work.

Fixes: 88c03ddd345 ("egl/drm: get compatible render-only device fd for kms-only device")

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26200>
(cherry picked from commit 898700ca647b2de0eecff864b6b0a4cbeb935840)

11 months ago.pick_status.json: Update to f39ed0063b4cd3e5a71efad2d43ce31f574c698d
Eric Engestrom [Wed, 22 Nov 2023 08:39:48 +0000 (08:39 +0000)]
.pick_status.json: Update to f39ed0063b4cd3e5a71efad2d43ce31f574c698d

11 months agoutil: Include stdint.h in libdrm.h
Matt Turner [Sat, 18 Nov 2023 00:52:36 +0000 (19:52 -0500)]
util: Include stdint.h in libdrm.h

drmGetDevices2()'s first parameter is a uint32_t.

Fixes: e05abb13455 ("util: Add a simple no-op libdrm shim")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26265>
(cherry picked from commit 5022a26b50ef912835049a32ac3904ea77656e43)

11 months agoegl: ensure a render node is passed to _eglFindDevice()
Simon Ser [Wed, 15 Nov 2023 11:59:40 +0000 (12:59 +0100)]
egl: ensure a render node is passed to _eglFindDevice()

_eglFindDevice() will fail if it's not provided a render node:
the EGLDevice list only contains one entry per render node, plus
the special software device. Passing a primary node for a
display-only device will not work.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10142
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Fixes: 2be404f5571a ("egl: error out if we can't find an EGLDevice in _eglFindDevice()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
(cherry picked from commit 0f978c34410283558afe9de5dab007f63a763c5e)

11 months agoegl: move dri2_setup_device() after dri2_setup_extensions()
Simon Ser [Wed, 15 Nov 2023 11:56:35 +0000 (12:56 +0100)]
egl: move dri2_setup_device() after dri2_setup_extensions()

dri2_setup_device() will depend on the extensions being set up in
the next commit.

None of the code in-between depends on disp->Device AFAIU.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
(cherry picked from commit 9b70096f5e9ab7be23abc9154c3fb83b710ccd6b)

11 months agoegl: extract EGLDevice setup in dedicated function
Simon Ser [Wed, 15 Nov 2023 11:51:57 +0000 (12:51 +0100)]
egl: extract EGLDevice setup in dedicated function

Extract the logic responsible for populating disp->Device via
_eglFindDevice(). This isn't much for now but will grow in a
following commit.

No functional changes.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
(cherry picked from commit b4ec0b51ce47d87d21609444dddd50c91968f26d)

11 months agoegl/dri2: increase NUM_ATTRIBS to fit all the attributes
Eric Engestrom [Thu, 16 Nov 2023 17:44:50 +0000 (17:44 +0000)]
egl/dri2: increase NUM_ATTRIBS to fit all the attributes

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

11 months agoradv: enable radv_disable_trunc_coord for vkd3d-proton/DXVK
Rhys Perry [Wed, 18 Oct 2023 14:35:03 +0000 (15:35 +0100)]
radv: enable radv_disable_trunc_coord for vkd3d-proton/DXVK

This fixes diagonal SSAO artifacts in some games.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9253
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6395
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911>
(cherry picked from commit 9e9eb87dd3a2ffe782ac85998a69623f59306caf)

11 months agoradv: add radv_disable_trunc_coord option
Rhys Perry [Wed, 18 Oct 2023 14:34:45 +0000 (15:34 +0100)]
radv: add radv_disable_trunc_coord option

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911>
(cherry picked from commit 4d2a3b95730c4781234096778043f987234b6a4c)

11 months agoanv: fix dirty state tracking for 3DSTATE_PUSH_CONSTANT_ALLOC
Lionel Landwerlin [Thu, 9 Nov 2023 12:48:26 +0000 (14:48 +0200)]
anv: fix dirty state tracking for 3DSTATE_PUSH_CONSTANT_ALLOC

ANV_CMD_DIRTY_PIPELINE also includes reprogramming of
3DSTATE_PUSH_CONSTANT_ALLOC_* instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
(cherry picked from commit 9689607f10bb150df0a75d189fc02b522410887f)

11 months agoanv: fix CC_VIEWPORT pointer dirty after blorp/simple-shaders
Lionel Landwerlin [Thu, 9 Nov 2023 11:51:38 +0000 (13:51 +0200)]
anv: fix CC_VIEWPORT pointer dirty after blorp/simple-shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
(cherry picked from commit 1257d08bcb9d7068ec24acbcf281a388e7ff015f)

11 months agopanfrost: Flag the right shader when updating images
Boris Brezillon [Thu, 5 Oct 2023 06:49:46 +0000 (08:49 +0200)]
panfrost: Flag the right shader when updating images

Fixes: fab1fabb4f0b ("panfrost: Dirty track fragment images")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
(cherry picked from commit 8ed471a339543072e0683308ac1ee1a4faad41fb)

11 months agointel/nir/rt: fix reportIntersection() hitT handling
Lionel Landwerlin [Sat, 9 Sep 2023 03:30:52 +0000 (06:30 +0300)]
intel/nir/rt: fix reportIntersection() hitT handling

We're currently updating the hitT value in the traversal result with
the hitT value from reportIntersection(), but this is not correct.

First the hitT value of reportIntersection() should update the
gl_RayTmaxEXT value (maps to brw_nir_rt_mem_ray_defs::t_far).

Second the hitT determined by traversal should only be updated if the
reportIntersection() hitT value has updated the gl_RayTmaxEXT and that
the new gl_RayTmaxEXT is smaller than the determined hitT value from
traversal.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Fixes: 303378e1dd ("intel/rt: Add lowering for combined intersection/any-hit shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25146>
(cherry picked from commit 4eb4197d27aed6f5e71195a971145b2945d78330)

11 months agointel/fs: rerun divergence analysis prior to convert_from_ssa
Lionel Landwerlin [Thu, 16 Nov 2023 19:24:31 +0000 (21:24 +0200)]
intel/fs: rerun divergence analysis prior to convert_from_ssa

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9964
Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26235>
(cherry picked from commit 6dbb5f1e07b11be0cc6ac764bf1b51feaa7fa623)

11 months agozink: allow software rendering only if selected
José Expósito [Thu, 16 Nov 2023 11:18:29 +0000 (12:18 +0100)]
zink: allow software rendering only if selected

In environments where 3D acceleration is not available, like in a VM,
the behavior before commit 8cd44b884387 ("egl: add automatic zink
fallback loading between hw and sw drivers") was to fallback to swrast.

This was the output of `eglinfo` in that situation:

    $ eglinfo
    [...]
    Wayland platform:
    EGL driver name: swrast
    OpenGL core profile renderer: llvmpipe (LLVM 17.0.4, 256 bits)

However, after commit 8cd44b884387 ("egl: add automatic zink fallback
loading between hw and sw drivers") Zink support is tested before
falling back to swrast.
Since the system doesn't support 3D acceleration, Zink + software
rendering is used instead of swrast causing issues like the ones
described in #10146.

In this case, `eglinfo` prints:

    $ eglinfo
    [...]
    Wayland platform:
    EGL driver name: zink
    OpenGL core profile renderer: zink Vulkan 1.3(llvmpipe (LLVM 17.0.4,
    256 bits) (MESA_LLVMPIPE))

This patch ensures that Zink + software rendering is used only when the
user opts-in by setting `LIBGL_ALWAYS_SOFTWARE` or `D3D_ALWAYS_SOFTWARE`
and swrast is used otherwise.

After the patch, the output of `eglinfo` is identical to the one before
the regression:

    $ eglinfo
    [...]
    Wayland platform:
    EGL driver name: swrast
    OpenGL core profile renderer: llvmpipe (LLVM 17.0.4, 256 bits)

Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10146
Fixes: 8cd44b884387 ("egl: add automatic zink fallback loading between
hw and sw drivers")

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26220>
(cherry picked from commit 2a71f06f2938678d89d5ed1372cda6a7b55d964d)

11 months agopanfrost: Support parameter queries for main planes
Robert Mader [Tue, 7 Nov 2023 23:18:41 +0000 (00:18 +0100)]
panfrost: Support parameter queries for main planes

In order to return correct offsets, strides and possibly other
parameters. This is relevant for formats like NV12 and P010 where
the second plane, when produced by the V4L2 decoder, uses the
same FD like the first one, but with an offset.

Analogous to 7a7e577d.

Also use the new helper to get the number of planes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10094
Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26109>
(cherry picked from commit 5f4253e096de76651d3bd2bbd447abb1e9cb624f)

11 months agoutil: Add new helpers for pipe resources
Robert Mader [Wed, 8 Nov 2023 14:23:48 +0000 (15:23 +0100)]
util: Add new helpers for pipe resources

They will be handy for drivers supporting multi-planar formats.

Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26109>
(cherry picked from commit d679154dc021feb1333bf7207d8a26d9db75b921)

11 months agozink: Fix waiting for texture commit semaphores.
Tatsuyuki Ishi [Tue, 14 Nov 2023 07:30:24 +0000 (16:30 +0900)]
zink: Fix waiting for texture commit semaphores.

The commit was always being treated as failed...

Fixes: d1456a6b0ad ("zink: add semaphore handling for sparse binds")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26171>
(cherry picked from commit 94e867e4a682305e28efbacafc01551172f5a11a)

11 months agozink: Fix missing sparse buffer bind synchronization.
Tatsuyuki Ishi [Mon, 13 Nov 2023 08:39:20 +0000 (17:39 +0900)]
zink: Fix missing sparse buffer bind synchronization.

goto oopsies.

Fixes: d1456a6b0ad ("zink: add semaphore handling for sparse binds")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26171>
(cherry picked from commit 3ee283e45557066c29fdb2000f7627d8996aeed0)

11 months agozink: fix dereference before NULL check
José Expósito [Fri, 10 Nov 2023 09:01:46 +0000 (10:01 +0100)]
zink: fix dereference before NULL check

The `sv->image_view` pointer is dereference before checking whether it's
NULL or not.
Check for NULL before dereferencing it to avoid a possible crash.

Fixes: 9de455bc4323 ("zink: check for sampler view existence during
zink_rebind_all_images()")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26140>
(cherry picked from commit 83ed419cd0a55fc0ee9f5ccce8f7ac03711bbf71)

11 months agoradv: add a missing async compute workaround for Tonga/Iceland
Samuel Pitoiset [Wed, 15 Nov 2023 14:06:12 +0000 (15:06 +0100)]
radv: add a missing async compute workaround for Tonga/Iceland

After digging into PAL code again, I figured that Tonga/Iceland are
both affected by a hw bug related to async compute dispatches.

The solution is to change the "threadgroup" dimension mode to the
"thread" dimension mode unconditionally.

This should fix a bunch of issues related to RADV_DEBUG=nocompute on
these GPUs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7551
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6334
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4679
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26207>
(cherry picked from commit ec82b4294432aa6da40517655a4f8af2767176a2)

11 months agoradv: fix a descriptor leak with debug names and host base descriptor set
Samuel Pitoiset [Tue, 7 Nov 2023 09:30:43 +0000 (10:30 +0100)]
radv: fix a descriptor leak with debug names and host base descriptor set

vk_object_base_finish() needs to be called on the descriptor set in
order to free the debug names.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10098
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26088>
(cherry picked from commit 4239e13ff658f7e4746779b8b4c4954b9437533c)

11 months agoradv: fix image view extent override for astc
Chia-I Wu [Tue, 7 Nov 2023 21:19:52 +0000 (13:19 -0800)]
radv: fix image view extent override for astc

When doing ASTC decoding, the image has format VK_FORMAT_ASTC_*, the
internal plane 1 has format VK_FORMAT_R8G8B8A8_UNORM, and the view has
format VK_FORMAT_R8G8B8A8_UINT.  It does not need the override for
compressed formats.

Fixes: f97b449e9e3 ("radv: integrate meta astc compute decoder to radv")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26106>
(cherry picked from commit 2533d0a0e29cb85e98aaaf44e665e091bf36d980)

11 months agoanv/drirc: add option to disable FCV optimization
Tapani Pälli [Mon, 13 Nov 2023 07:56:25 +0000 (09:56 +0200)]
anv/drirc: add option to disable FCV optimization

There are rendering issues with FCV on DG2 and Unreal engine 5.1,
patch adds option to disable fcv in drirc.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26169>
(cherry picked from commit 01046cd6add64323a2914ddffa2277f63d92b73e)

11 months ago.pick_status.json: Update to f05688aa3299a27430119b27e45181a6f415bff8
Eric Engestrom [Sat, 18 Nov 2023 21:10:57 +0000 (21:10 +0000)]
.pick_status.json: Update to f05688aa3299a27430119b27e45181a6f415bff8

11 months agoVERSION: bump for 23.3.0-rc4
Eric Engestrom [Wed, 15 Nov 2023 21:36:49 +0000 (21:36 +0000)]
VERSION: bump for 23.3.0-rc4

11 months agoradv/sqtt: Fix tracing acceleration structure commands
Konstantin Seurer [Sun, 12 Nov 2023 15:10:24 +0000 (16:10 +0100)]
radv/sqtt: Fix tracing acceleration structure commands

ApiRayTracingSeparateCompiled can only used by trace commands.

Fixes: bfb55d0 ("ac/sqtt,radv/sqtt: Add and use marker for separate RT compilation")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26158>
(cherry picked from commit b6e09dd5212503ab6369ba7fee9033c416347243)

11 months agoci/traces: drop the freedoom-phase2-gl-high.trace
David Heidelberg [Tue, 14 Nov 2023 22:02:54 +0000 (23:02 +0100)]
ci/traces: drop the freedoom-phase2-gl-high.trace

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/8080#note_2154467

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8080
Cc: mesa-stable
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26199>
(cherry picked from commit 1eff68dd2a6d9fc8acd53078d609e92f693c2556)

11 months agoaco: add missing scc def for SALU quad broadcast
Georg Lehmann [Sun, 12 Nov 2023 18:40:32 +0000 (19:40 +0100)]
aco: add missing scc def for SALU quad broadcast

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
(cherry picked from commit 509ce19643f51555922947e9b8b5f12d6567fb5b)

11 months agoradv: set radv_zero_vram=true for Unreal Engine 4/5
Samuel Pitoiset [Mon, 13 Nov 2023 17:35:29 +0000 (18:35 +0100)]
radv: set radv_zero_vram=true for Unreal Engine 4/5

Unreal Engine seems to rely on uninitialized memory and
RADV_DEBUG=zerovram fixes a bunch of issues.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9025
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9380
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9026
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26188>
(cherry picked from commit bb92c34c2859c2f5b42c9b6ba4f5603d79b72d33)

11 months agoradv: fix registering queues for RGP with compute only
Samuel Pitoiset [Tue, 14 Nov 2023 07:35:58 +0000 (08:35 +0100)]
radv: fix registering queues for RGP with compute only

This crashes if the graphics queue isn't created.

Fixes: 930e77e9036 ("radv/sqtt: add support for queue info")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10136
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26183>
(cherry picked from commit 627d59344381907bd13eeb48a6737bd2561e64d8)

11 months agor600: Add missing dep on git_sha1.h
Matt Turner [Tue, 14 Nov 2023 18:29:47 +0000 (13:29 -0500)]
r600: Add missing dep on git_sha1.h

Bug: https://bugs.gentoo.org/917116
Fixes: 3ab51c7ebd1 ("r600: Add callbacks for get_driver_uuid and get_device_uuid")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26195>
(cherry picked from commit b66b299edac109d2bbfdb886f01ce5945f362289)

11 months agogallium/auxiliary/vl: Scale dst_rect x0/y0 when rendering chroma plane
David Rosca [Thu, 28 Sep 2023 15:23:59 +0000 (17:23 +0200)]
gallium/auxiliary/vl: Scale dst_rect x0/y0 when rendering chroma plane

This fixes incorrect chroma plane position when x0/y0 is not zero.

Fixes: 001358a97cc ("vl/compositor: add a new function for YUV deint")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
(cherry picked from commit 35b0ccd8554e8b46833cb5b57be91e6201754a4f)

11 months agogallium/auxiliary: Fix coordinates clamp in util_compute_blit
David Rosca [Wed, 27 Sep 2023 14:17:51 +0000 (16:17 +0200)]
gallium/auxiliary: Fix coordinates clamp in util_compute_blit

Fixes: 7c8e1596d6e ("gallium/auxiliary: Fix util_compute_blit half texel offset with scaling")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
(cherry picked from commit e9091b1f5c2ef50aba36f5e71fb6cf88ffc31cbb)

11 months agogallium/auxiliary/vl: Fix coordinates clamp in compute shaders
David Rosca [Wed, 27 Sep 2023 12:40:12 +0000 (14:40 +0200)]
gallium/auxiliary/vl: Fix coordinates clamp in compute shaders

Fixes: a6a43963ed0 ("gallium/auxiliary/vl: Clamp coordinates in compute shaders")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
(cherry picked from commit ef0546152fd1aed1d4175097c6361860c42f459e)

11 months agonir_lower_mem_access_bit_sizes: Fix write-mask-constrained 3-byte stores as atomics
Jesse Natalie [Fri, 3 Nov 2023 16:43:45 +0000 (09:43 -0700)]
nir_lower_mem_access_bit_sizes: Fix write-mask-constrained 3-byte stores as atomics

The code here handled stores of actual 3-byte values (8-bit, 3-component), but didn't
correctly handle stores of larger 8-bit vectors that were constrained by write mask to
just 3 bytes. In that case, the pad-to-vec4 step was unnecessary and problematic.

Seen in CL CTS test_basic vector_swizzle test group for char3 with CLOn12.

Fixes: c70d94a8 ("nir_lower_mem_access_bit_sizes: Support unaligned stores via a pair of atomics")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26034>
(cherry picked from commit cd0cff951a5b7c74d704198b5abfdb40b267cbdc)

11 months agodocs: fix RADV_THREAD_TRACE_CACHE_COUNTERS default
Rhys Perry [Tue, 14 Nov 2023 16:03:45 +0000 (16:03 +0000)]
docs: fix RADV_THREAD_TRACE_CACHE_COUNTERS default

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: dbab98d9d63d ("radv: enable RADV_THREAD_TRACE_CACHE_COUNTERS by default")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26193>
(cherry picked from commit c4ee639ca0378f094e63738697812ecfa191bbf1)

11 months agoanv: Flush data cache while clearing depth using HIZ_CCS_WT
Sagar Ghuge [Wed, 5 Jul 2023 02:06:24 +0000 (19:06 -0700)]
anv: Flush data cache while clearing depth using HIZ_CCS_WT

Patch fxes ESO shadow pass ground corruption on Arc A750. In the colour
pass where the rendering corruption first appears, the depth resource
was used as a "PS - Texture".  Immediately afterwards there's a Barrier
where it goes from

VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL =>
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL

immediately following that there's a Clear from vkCmdBeginRendering
which appears to be a HiZ clear.  Things work when using AUX_USAGE_HIZ
but AUX_USAGE_HIZ_CCS_WT (XXX: and AUX_USAGE_HIZ_CCS?) doesn't work.

current thinking is this is related to 14015264727 where we had to add
HDC and DC flushes to CCS and MCS fast clears.  Maybe HiZ clears with
CCS also have similar problems?  The docs don't appear to indicate that
but the docs were also wrong for color clears until recently...

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9277
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9444
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22717>
(cherry picked from commit 648c0c159d865a8a30f0b524b33db6d932e4e234)

11 months agoiris: add data cache flush for pre hiz op
Tapani Pälli [Mon, 31 Jul 2023 07:43:15 +0000 (10:43 +0300)]
iris: add data cache flush for pre hiz op

This fixes various failing Piglit tests on DG2.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22717>
(cherry picked from commit e4db19afa72b3dc2a33acc6435f714176adc6df1)

11 months agoanv: Write timestamp using MI_FLUSH_DW on blitter
Sagar Ghuge [Thu, 9 Nov 2023 01:33:40 +0000 (17:33 -0800)]
anv: Write timestamp using MI_FLUSH_DW on blitter

On Blitter engine, we don't support PIPE_CONTROL, we have to update
memory locations using the MI_FLUSH_DW command.

v2:
- Handle video queue (Lionel)

Fixes: 056b0cb87f2 ("anv: add video engine support in various places")
Fixes: 5112b421462 ("anv: Handle end of pipe with MI_FLUSH_DW on transfer queue")

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26121>
(cherry picked from commit 8c9a7f77303b5acb4555a8c41b897da891fbe2da)

11 months ago.pick_status.json: Mark fcfa68a632e5711cc657b103c9a0384928e9bf49 as denominated
Eric Engestrom [Wed, 15 Nov 2023 16:34:18 +0000 (16:34 +0000)]
.pick_status.json: Mark fcfa68a632e5711cc657b103c9a0384928e9bf49 as denominated

11 months agovulkan: Don't use set_foreach_remove when destroying pipeline caches
Friedrich Vock [Sun, 12 Nov 2023 20:00:04 +0000 (21:00 +0100)]
vulkan: Don't use set_foreach_remove when destroying pipeline caches

set_foreach_remove assumes no entries have been removed. That assumption
only holds if no errors occur, since pipeline cache objects can get
removed if an error occurs during deserialization.

This fixes
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
crashing on RADV.

Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26164>
(cherry picked from commit 8ffdad731cd8d8900c10810b61283afffa142f29)

11 months ago.pick_status.json: Update to 03a7cb261828b350dd9b56bd74850197ca9eba33
Eric Engestrom [Wed, 15 Nov 2023 16:32:14 +0000 (16:32 +0000)]
.pick_status.json: Update to 03a7cb261828b350dd9b56bd74850197ca9eba33

11 months agozink: Check for VK_EXT_extended_dynamic_state3 before setting A2C
Mary Guillemard [Thu, 2 Nov 2023 10:37:31 +0000 (06:37 -0400)]
zink: Check for VK_EXT_extended_dynamic_state3 before setting A2C

Fix crashes for piglit alpha-to-coverage tests when
VK_EXT_extended_dynamic_state3 is not supported (like on Venus)

Fixes: 736577871b9 ("zink: check for cbuf0 writes before setting A2C")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26003>
(cherry picked from commit fe159c85de81a12e895342d003821aa4f25db8d5)

11 months agofreedreno: Always attach bo to submit
Rob Clark [Sun, 12 Nov 2023 19:08:28 +0000 (11:08 -0800)]
freedreno: Always attach bo to submit

Even if app triggers undefined behaviour by using a rsc on multiple
contexts without a flush, we still should attach the bo to the batch.

Fixes: b43e5aec0d2c ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26162>
(cherry picked from commit 4807c1e173e8aef4cba7ba60e6ed38248cb4d7a9)

11 months agoradeonsi/gfx11: don't set OREO_MODE to fix rare corruption
Marek Olšák [Sun, 5 Nov 2023 16:42:33 +0000 (11:42 -0500)]
radeonsi/gfx11: don't set OREO_MODE to fix rare corruption

This is recommended by hw people.

Fixes: 19a59f05a47 - radeonsi/gfx11: program db render control register

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

11 months agovulkan: use instance allocator for `object_name` in some objects
antonino [Mon, 6 Nov 2023 21:52:35 +0000 (22:52 +0100)]
vulkan: use instance allocator for `object_name` in some objects

The allocator passed to VkDevice won't be available once it is destroyed
and thefore it cannot be used to allocate `object_name` for instance
level objects such as `VkInstance` or `VkPhysicalDevice` or else there
would be no way of deallocating it when those objects are destroyed.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26085>
(cherry picked from commit 2d49f834b20d705d901414f6fc2b1fec019689c4)

11 months ago.pick_status.json: Update to 08f851f4361cfbdb211dc70d03cf3ebff331c3ee
Eric Engestrom [Mon, 13 Nov 2023 20:04:53 +0000 (20:04 +0000)]
.pick_status.json: Update to 08f851f4361cfbdb211dc70d03cf3ebff331c3ee

11 months agov3d: Don't implicitly clear the content of the imported buffer
Roman Stratiienko [Thu, 9 Nov 2023 21:27:46 +0000 (23:27 +0200)]
v3d: Don't implicitly clear the content of the imported buffer

v3d driver will implicitly clear the buffer's content on the first write
operation. This clearing operation is helpful for allocated buffers,
initializing them with zeros instead of having memory garbage.

Also, this avoids reading the buffer from the RAM to the GPU cache
before rendering, making the first write operation slightly faster.

The clearing operation should not happen for imported buffers where
the buffer may already contain valuable data and the user may want
to render into the buffer only partially.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26136>
(cherry picked from commit 56451ce773c11094a8c08fdc6b500bb8bdcf37e1)

11 months agoir3/ra: Don't swap killed sources for early-clobber destination
Connor Abbott [Thu, 2 Nov 2023 11:03:35 +0000 (12:03 +0100)]
ir3/ra: Don't swap killed sources for early-clobber destination

We have an optimization to try to swap regular live intervals with
killed sources when evicting them fails in order to make a contiguous
space for the destination to fit in, but this doesn't work when the
destination is early-clobber.

Fixes
dEQP-GLES31.functional.synchronization.inter_invocation.image_atomic_read_write
on a650+.

Fixes: d4b5d2a ("ir3/ra: Use killed sources in register eviction")
Closes: #8886
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26004>
(cherry picked from commit 04ffef15da1903c7f2497e24d96f742e476b3e8d)

11 months agoisl: disable MCS compression on R9G9B9E5
Lionel Landwerlin [Wed, 8 Nov 2023 14:40:49 +0000 (16:40 +0200)]
isl: disable MCS compression on R9G9B9E5

Not supported according to the docs and will trigger an assert
isl_get_render_compression_format().

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26112>
(cherry picked from commit d4499c4cb26b87876f0ee16562a4c5b2bd4f8860)

11 months agovulkan: fix potential memory leak in create_rect_list_pipeline()
Paulo Zanoni [Fri, 8 Sep 2023 22:10:33 +0000 (15:10 -0700)]
vulkan: fix potential memory leak in create_rect_list_pipeline()

I was playing around with possible improvements to STACK_ARRAY(), and
one of my experiments made gcc point us that we were not freeing
'stages'.

Fixes: 514c10344e6f ("vulkan/meta: Add a concept of rect pipelines")
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26041>
(cherry picked from commit 17e135d3d4a4bb1d835aba6ffdf1997e23360843)

11 months ago.pick_status.json: Mark fa7ec4226bdf48bf63438e303af83ecd58ec95f2 as denominated
Eric Engestrom [Fri, 10 Nov 2023 14:45:03 +0000 (14:45 +0000)]
.pick_status.json: Mark fa7ec4226bdf48bf63438e303af83ecd58ec95f2 as denominated

11 months ago.pick_status.json: Update to 56451ce773c11094a8c08fdc6b500bb8bdcf37e1
Eric Engestrom [Fri, 10 Nov 2023 14:42:58 +0000 (14:42 +0000)]
.pick_status.json: Update to 56451ce773c11094a8c08fdc6b500bb8bdcf37e1

11 months agoVERSION: bump for 23.3.0-rc3
Eric Engestrom [Wed, 8 Nov 2023 18:50:58 +0000 (18:50 +0000)]
VERSION: bump for 23.3.0-rc3

11 months ago.pick_status.json: Mark 227300345ed38377190b0eaf08694d5c42ee7e60 as denominated
Eric Engestrom [Wed, 8 Nov 2023 18:20:43 +0000 (18:20 +0000)]
.pick_status.json: Mark 227300345ed38377190b0eaf08694d5c42ee7e60 as denominated

11 months agoanv: Add missing ANV_BO_ALLOC_EXTERNAL flags when calling anv_device_import_bo()
José Roberto de Souza [Thu, 12 Oct 2023 20:38:57 +0000 (13:38 -0700)]
anv: Add missing ANV_BO_ALLOC_EXTERNAL flags when calling anv_device_import_bo()

This flag is required to properly calculate the PAT index of the
imported BO.

Cc: mesa-stable
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
(cherry picked from commit 72ba0677f824d46d0f656eef07b99f5b5ab6ebe5)

11 months agofrontends/va: Remove wrong use of ProfileToPipe
Corentin Noël [Mon, 6 Nov 2023 13:29:56 +0000 (14:29 +0100)]
frontends/va: Remove wrong use of ProfileToPipe

The `context->templat.profile` variable is already of enum pipe_video_profile.

Fixes: 0996ec3fc6e ("frontends/va: Add profile param when querying PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL")

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>
(cherry picked from commit f4ed92a8236f611b5a8be9f542d81c5a5e11578a)

11 months agoradv: disable gs_fast_launch=2 by default
Rhys Perry [Fri, 3 Nov 2023 15:25:48 +0000 (15:25 +0000)]
radv: disable gs_fast_launch=2 by default

This currently causes severe performance problems in Remnant 2 and
Alan Wake 2.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 28ebe62af2cb ("radv: enable mesh shader gs_fast_launch=2 and multi-row export")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10071
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26090>
(cherry picked from commit 2011b678c538b451eef5a1986adee7e25d6ee04f)

11 months agozink: apply can_do_invalid_linear_modifier to Venus
Yiwei Zhang [Mon, 6 Nov 2023 19:41:18 +0000 (11:41 -0800)]
zink: apply can_do_invalid_linear_modifier to Venus

This unblocks Xwayland with zink-on-venus + sommelier wayland proxy.
- For glamor, zink uses linear modifier.
- For Virgl clients, classic 3d resource is used and sommelier fixes
  the modifier and stride infos no matter wl-drm or dma-buf protocol.
- For Venus clients:
  - via the legacy wl-drm protocol, invalid modifier is passed via
    sommelier, and host recovers the tiling in the way dealing with
    modifier unaware clients (e.g. I915_GEM_GET_TILING). For hosts
    unable to recover, they assume linear and venus forces linear on
    legacy path.
  - via the new zwp_linux_dmabuf_feedback_v1 (version 3/4) protocol,
    explicit modifier is used, and zink handles that without issues.

This doesn't deserve a driconfig as zink-on-venus to support xserver
itself already requires special enough integration beyond a config.

Reported-by: Igor Torrente <igor.torrente@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10066
Fixes: 1c3db3e39a7 ("zink: blow up broken xservers more reliably")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26082>
(cherry picked from commit 551f61bdb3fc408809f3b15643f9f399bc19beac)

11 months ago.pick_status.json: Update to a77ea9555aa00cc12f3d1c440252e940ff552500
Eric Engestrom [Wed, 8 Nov 2023 11:56:14 +0000 (11:56 +0000)]
.pick_status.json: Update to a77ea9555aa00cc12f3d1c440252e940ff552500

11 months agonir/loop_analyze: Fix inverted condition handling in iterations calculation
Sviatoslav Peleshko [Fri, 3 Nov 2023 01:13:50 +0000 (03:13 +0200)]
nir/loop_analyze: Fix inverted condition handling in iterations calculation

In the tagged commit, we stopped actually inverting the condition, and
instead relied on the "invert_cond" flag. But we missed a few places
where this flag should've been handled too.

Also, add a few more tests to make sure this won't regress in the future.

Fixes: 99a7a664 ("nir/loop_analyze: Change invert_cond instead of changing the condition")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10012
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26024>
(cherry picked from commit aa33ca0a52591961f8ae01dc253354462ed17c18)

11 months agopanfrost: use perf_debug instead of open-coding
Erik Faye-Lund [Mon, 6 Nov 2023 11:51:48 +0000 (12:51 +0100)]
panfrost: use perf_debug instead of open-coding

We don't need to open-code perf_debug here...

Fixes: bc55d150a91 ("panfrost: Add support for AFBC packing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26063>
(cherry picked from commit 385b81c8c25360a3838958cf6af9b31871a96d29)

11 months agoagx: Fix fragment side effects scheduling
Alyssa Rosenzweig [Thu, 12 Oct 2023 19:45:28 +0000 (15:45 -0400)]
agx: Fix fragment side effects scheduling

We can't move discards across side effects, or the side effect might not happen.

Fixes KHR-GLES31.core.shader_image_load_store.basic-allFormats-load-fs
regression. Sigh.

CI is up next.

Fixes: 119e5b9719a ("agx: Schedule for register pressure")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
(cherry picked from commit 7b92c6310586e3b17eb922b442561b64cb3b1aff)

11 months agovenus: skip bind sparse info when checking for feedback query
Mary Guillemard [Fri, 3 Nov 2023 11:23:25 +0000 (12:23 +0100)]
venus: skip bind sparse info when checking for feedback query

Fix an assertion when using vkQueueBindSparse.

Fixes: 7fbf608f2da ("venus: append query feedback at submission time")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26027>
(cherry picked from commit f71f5cf8562da4d13d5eb9220edecb6dad5b8ccf)

11 months agopvr: Fix VK_EXT_texel_buffer_alignment
Vlad Schiller [Thu, 2 Nov 2023 08:08:01 +0000 (08:08 +0000)]
pvr: Fix VK_EXT_texel_buffer_alignment

In the commit that enabled the extension, I forgot to add the required
properties, which made some tests to fail.

Fixes: 649ebbb0fb7 ("pvr: Implement VK_EXT_texel_buffer_alignment")
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26002>
(cherry picked from commit 1dd1c9d610dbe0fffd8708977afc0aa88d4a457c)

11 months agonir: fix inserting the break instruction for partial loop unrolling
Samuel Pitoiset [Thu, 2 Nov 2023 09:40:00 +0000 (10:40 +0100)]
nir: fix inserting the break instruction for partial loop unrolling

If the break in the original loop isn't in the first top-level if,
this would have re-inserted it in the wrong block.

Fixes this by re-inserting the break block to the corresponding break
block in the new loop by using the remap hashtable.

fossils-db (NAVI21):
Totals from 88 (0.11% of 79330) affected shaders:
Instrs: 109602 -> 109929 (+0.30%); split: -0.10%, +0.40%
CodeSize: 570968 -> 573332 (+0.41%); split: -0.08%, +0.49%
Latency: 1682510 -> 1682505 (-0.00%); split: -0.01%, +0.01%
Copies: 12832 -> 12746 (-0.67%); split: -1.54%, +0.87%
Branches: 2879 -> 2930 (+1.77%)

Deathloop and F1 2023 are affected but I'm not aware of any issues
for these two games.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10001
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26009>
(cherry picked from commit abfd208cb047b24802938576d0f5bd1a7f809eb6)

11 months ago.pick_status.json: Update to aa33ca0a52591961f8ae01dc253354462ed17c18
Eric Engestrom [Tue, 7 Nov 2023 13:27:57 +0000 (13:27 +0000)]
.pick_status.json: Update to aa33ca0a52591961f8ae01dc253354462ed17c18

11 months agorusticl/queue: fix implicit flushing of queue dependencies
Karol Herbst [Sun, 5 Nov 2023 14:01:22 +0000 (15:01 +0100)]
rusticl/queue: fix implicit flushing of queue dependencies

Needed by Davinci Resolve.

There are two parts to this fix:
1. flush dependencies also on flush, not just finish
2. move the dependency checking logic into Queue::flush as otherwise we
   miss required implicit flushes.

Fixes: 8616c0a52c7 ("rusticl/event: flush queues from dependencies")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26053>
(cherry picked from commit 8cbb84dc428ff805abc514d810faebe64bb03cdb)

11 months agorusticl/queue: do not send empty lists of event to worker queue
Karol Herbst [Sun, 5 Nov 2023 18:28:49 +0000 (19:28 +0100)]
rusticl/queue: do not send empty lists of event to worker queue

This saves us a few CPU cycles and makes properly fixing implicit flushes
less expensive.

Fixes: 8616c0a52c7 ("rusticl/event: flush queues from dependencies")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26053>
(cherry picked from commit 52e41d4c97947a1b0c2c86c3b6491958716e998b)

11 months agoradeonsi: Fix offset for linear surfaces on GFX < 9
David Rosca [Tue, 31 Oct 2023 09:13:52 +0000 (10:13 +0100)]
radeonsi: Fix offset for linear surfaces on GFX < 9

Fixes: 86262b6eac0 ("radeonsi,radv: fix usages of surf_pitch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10073

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25970>
(cherry picked from commit bf364cbdb40f044d2a11b6fe5636e8a039fdad81)

11 months agoAndroid.mk: disable android-libbacktrace to build with Android 14
Mauro Rossi [Sat, 14 Oct 2023 19:39:37 +0000 (21:39 +0200)]
Android.mk: disable android-libbacktrace to build with Android 14

Android libbacktrace is not available in Android 14

Fixes the following build error:

FAILED: src/util/libmesa_util.a.p/u_debug_stack_android.cpp.o
...
../src/util/u_debug_stack_android.cpp:28:10: fatal error: 'backtrace/Backtrace.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
(cherry picked from commit 95ad0c750c5891dab3a678f26a74c95edfed87c9)

11 months agoAndroid.mk: filter out cflags to build with Android 14 bundled clang
Mauro Rossi [Sat, 14 Oct 2023 19:51:24 +0000 (21:51 +0200)]
Android.mk: filter out cflags to build with Android 14 bundled clang

Android 14 uses prebuild clang version 17.0.2
By filtering these cflags there are no building errors on previous Android releases.

Fixes the following building errors:

../src/c11/time.h:54:8: error: redefinition of 'timespec'
struct timespec
       ^
/media/bigblissdrive/u-x86/out/soong/.intermediates/bionic/libc/libc/android_vendor.34_x86_x86_64_shared/gen/include/bits/timespec.h:46:8: note: previous definition is here
struct timespec {
       ^
1 error generated.

In file included from ../src/util/disk_cache.c:50:
../src/util/disk_cache.h:86:4: error: use of undeclared identifier 'Dl_info'
   Dl_info info;
   ^
...
./src/util/disk_cache.h:114:30: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
      _mesa_sha1_update(ctx, build_id_data(note), build_id_length(note));
                             ^~~~~~~~~~~~~~~~~~~

10 errors generated.

../src/intel/perf/intel_perf.c:91:10: error: call to undeclared function 'major'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   maj = major(sb.st_rdev);
         ^
../src/intel/perf/intel_perf.c:92:10: error: call to undeclared function 'minor'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   min = minor(sb.st_rdev);
         ^
2 errors generated.

../src/intel/vulkan/anv_allocator.c:295:13: error: call to undeclared function 'futex_wake'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
            futex_wake(&table->state.end, INT_MAX);
            ^
...
../src/intel/vulkan/anv_allocator.c:711:7: error: call to undeclared function 'futex_wait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      futex_wait(&pool->block.end, block.end, NULL);
      ^
6 errors generated.

Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
(cherry picked from commit 520e79a3b5841db034d6d962870432d21fd0989c)

11 months ago.pick_status.json: Update to 7d6f9ccfbeab050c26775d5e03578a01526cbfcb
Eric Engestrom [Mon, 6 Nov 2023 09:37:38 +0000 (09:37 +0000)]
.pick_status.json: Update to 7d6f9ccfbeab050c26775d5e03578a01526cbfcb

11 months agoci: Try really hard to print final result string
Daniel Stone [Fri, 3 Nov 2023 15:50:58 +0000 (15:50 +0000)]
ci: Try really hard to print final result string

a630 has been completing jobs, and then corrupting the very last line of
UART output - the one where we pass the overall result back from the DUT
to the job. The bare-metal monitor will wait for this line to appear,
never see it, and then the job times out.

Since this line is the most critical one of all to get out, just spam
the prints to try to make sure they get through.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26032>
(cherry picked from commit 80b87c18d1630dd622bf58e56f3fb3f39e9fb8ef)

11 months agoanv: remove CS_FLUSH from query regression
Felix DeGrood [Tue, 31 Oct 2023 23:15:37 +0000 (23:15 +0000)]
anv: remove CS_FLUSH from query regression

Fixes performance regression introduced by prior refactoring of
pipe control code that unnecessarily added CS_FLUSH to query start
and end. Issue was diagnosed by Ben L (thank you!)

Confirmed this restores performance on:
* Borderlands3 +2%
* Payday +3%
* Factorio +3%
* HogwartsLegacy +4%
* Ghostrunner +7%

Fixes: 6dc95685 (convert genX_query pipe controls to use pc helper)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25983>
(cherry picked from commit aa23120e4fc674d7da42c4895aa204f300155105)

11 months agozink: Fix crash on zink_create_screen error path
José Expósito [Fri, 3 Nov 2023 13:15:06 +0000 (14:15 +0100)]
zink: Fix crash on zink_create_screen error path

The `zink_internal_create_screen()` function can fail before
`screen->loader_lib` and/or `screen->instance` are initialized.
The `zink_destroy_screen()` doesn't check those cases and crashes.

The error was found by Fedora's CI. The back trace is available at [1].

[1] https://bodhi.fedoraproject.org/updates/FEDORA-2023-c39f82c465

Fixes: 0c2045553fe4 ("zink: use screen destructor for creation fails")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26029>
(cherry picked from commit 8a635e516ebb12411de8055c3405f36be43269b3)

11 months agonvk: Should use alignment instead of align
Yonggang Luo [Wed, 1 Nov 2023 20:43:10 +0000 (04:43 +0800)]
nvk: Should use alignment instead of align

align is a function, don't know why align > 0 is working

Fixes: 87686a22205 ("nvk: Rework side-band data upload")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
(cherry picked from commit 5e9dcffffde8b4ecf78531c0285a0d296e1fc7a9)

11 months ago.pick_status.json: Mark 8dda860f83ac30d042dc6beb4438cc925d1fd130 as denominated
Eric Engestrom [Sat, 4 Nov 2023 14:16:31 +0000 (14:16 +0000)]
.pick_status.json: Mark 8dda860f83ac30d042dc6beb4438cc925d1fd130 as denominated

11 months agofrontends/va: Map decoder and postproc surfaces for reading
David Rosca [Thu, 2 Nov 2023 08:29:25 +0000 (09:29 +0100)]
frontends/va: Map decoder and postproc surfaces for reading

If application requests to map surface that was most recently used
as decoder or postproc target and also doesn't explicitly set the
map flags (vaMapBuffer2) it's very likely the intent is to read from
this surface, so we need to map it as such.

This fixes regression on radeonsi where mapping NV12 surfaces for
reading would fail with applications using vaDeriveImage. The reason
for this is that the VA frontend doesn't allow vaDeriveImage for
interlaced surfaces so the applications would use vaGetImage fallback,
but radeonsi doesn't allocate NV12 surfaces as interlaced anymore.

This also fixes mapping other formats surfaces (P010, RGBx, ...)
for reading, which never worked before.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9935
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10048

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26008>
(cherry picked from commit c638e61ef5e2e7de097a9b5850eff75022330f68)