platform/upstream/mesa.git
22 months agoradv: stop setting as_ls for the TCS stage
Samuel Pitoiset [Tue, 23 Aug 2022 13:28:26 +0000 (15:28 +0200)]
radv: stop setting as_ls for the TCS stage

This doesn't make sense and it was assigned because the shader info
stuff was a complete mess. LS is only a thing on GFX6-8, on GFX9+
it's a merged VS+TCS to HS.

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

22 months agoaco: remove unused isel_context::tcs_num_patches
Samuel Pitoiset [Fri, 26 Aug 2022 08:13:20 +0000 (10:13 +0200)]
aco: remove unused isel_context::tcs_num_patches

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

22 months agoradv: fix bogus assertion with RADV_FORCE_VRS
Samuel Pitoiset [Wed, 31 Aug 2022 14:41:21 +0000 (16:41 +0200)]
radv: fix bogus assertion with RADV_FORCE_VRS

It supports VS, TES and GS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18345>

22 months agoradv: Free geometry infos in radv_CmdBuildAccelerationStructuresKHR
Friedrich Vock [Thu, 1 Sep 2022 14:27:50 +0000 (16:27 +0200)]
radv: Free geometry infos in radv_CmdBuildAccelerationStructuresKHR

Fixes: 97ffaea5 ("radv: Add Radeon Raytracing Analyzer capturing layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18370>

22 months agoradv: Use radv_CmdUpdateBuffer instead of radv_update_buffer_cp for geometry info...
Friedrich Vock [Thu, 1 Sep 2022 14:25:58 +0000 (16:25 +0200)]
radv: Use radv_CmdUpdateBuffer instead of radv_update_buffer_cp for geometry info writes

This fixes some hangs and avoids an assert if geometry infos are bigger than 1KB.

Fixes: 97ffaea5 ("radv: Add Radeon Raytracing Analyzer capturing layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18370>

22 months agopanfrost: Route shader-db to debug, not stderr
Alyssa Rosenzweig [Wed, 31 Aug 2022 19:05:21 +0000 (15:05 -0400)]
panfrost: Route shader-db to debug, not stderr

This brings us in line with the rest of Mesa, fixing multithreaded shader-db
reports and the Total CPU Time report at the end.

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

22 months agor300: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 18:30:32 +0000 (14:30 -0400)]
r300: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agoetnaviv: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 18:29:19 +0000 (14:29 -0400)]
etnaviv: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agolima: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:53:40 +0000 (13:53 -0400)]
lima: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agosoftpipe: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:51:14 +0000 (13:51 -0400)]
softpipe: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agovc4: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:49:37 +0000 (13:49 -0400)]
vc4: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agov3d: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 18:25:17 +0000 (14:25 -0400)]
v3d: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agogallium: Add u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:41:26 +0000 (13:41 -0400)]
gallium: Add u_default_set_debug_callback

Drivers that don't use compile queues can use a common implementation. Drivers
that do can tail call into the common implementation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

22 months agodozen: move to use common command buffer result code.
Dave Airlie [Wed, 8 Jun 2022 01:18:24 +0000 (11:18 +1000)]
dozen: move to use common command buffer result code.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

22 months agopanvk: use common command buffer record result.
Dave Airlie [Tue, 7 Jun 2022 20:26:28 +0000 (06:26 +1000)]
panvk: use common command buffer record result.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

22 months agoturnip: use common command record result.
Dave Airlie [Tue, 7 Jun 2022 20:25:18 +0000 (06:25 +1000)]
turnip: use common command record result.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

22 months agoradv: move to using common record_result.
Dave Airlie [Tue, 7 Jun 2022 20:11:19 +0000 (06:11 +1000)]
radv: move to using common record_result.

v2 (Jason Ekstrand):
 - Handle rename to vk_command_buffer_set_error
 - Add more instances, especially in device generated commands

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

22 months agovulkan/cmd_queue: Drop vk_cmd_queue::error
Jason Ekstrand [Wed, 31 Aug 2022 20:00:02 +0000 (15:00 -0500)]
vulkan/cmd_queue: Drop vk_cmd_queue::error

Instead, we return errors from each of the enqueue functions and record
those errors (if any) in vk_command_buffer::record_result.  This also
involves some awkward changes to each of the three drivers that uses
vk_cmd_queue but those are resolved in later commits as we convert those
drivers to the common error tracking.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

22 months agovulkan/cmd_buffer: add record_state to the common command buffer.
Jason Ekstrand [Wed, 31 Aug 2022 20:13:05 +0000 (15:13 -0500)]
vulkan/cmd_buffer: add record_state to the common command buffer.

This pulls the record state out of the cmd queue into the command
buffer. It can be used here by other drivers.

v2: add some get/set api: not set only sets the first error.

v3 (Jason Ekstrand):
 - Rename set_record_result to set_error
 - Automatically log the set error
 - Add a new vk_command_bufer_has_error() helper
 - Split out vk_cmd_queue changes into their own commit

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

22 months agopanfrost/ci: Update G72 xflakes list
Alyssa Rosenzweig [Wed, 31 Aug 2022 15:33:51 +0000 (11:33 -0400)]
panfrost/ci: Update G72 xflakes list

I can't reproduce this locally on Mali-G52 and don't have Mali-G72 hardware.
Unless someone wants to investigate the flakes here in #7149, add a bigger
wildcard to the gathers xflakes list so we don't fail pipelines.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7149
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18348>

22 months agoradv: Proper handling for inactive instance nodes
Konstantin Seurer [Fri, 19 Aug 2022 13:28:04 +0000 (15:28 +0200)]
radv: Proper handling for inactive instance nodes

We only skipped the `accelerationStructureReference == 0` case
which could lead to reading uninitialized memory.
This patch introduces a NULL_NODE_ID constant and uses it
to handle inactive nodes properly.
I do not think, that this case is common in practice.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18141>

22 months agodocs: Add documentation about RADV RRA tracing
Friedrich Vock [Sun, 21 Aug 2022 00:16:49 +0000 (02:16 +0200)]
docs: Add documentation about RADV RRA tracing

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>

22 months agoradv: Enable Radeon Raytracing Analyzer traces
Friedrich Vock [Sat, 20 Aug 2022 21:54:06 +0000 (23:54 +0200)]
radv: Enable Radeon Raytracing Analyzer traces

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>

22 months agoradv: Add Radeon Raytracing Analyzer capturing layer
Friedrich Vock [Sat, 20 Aug 2022 21:53:50 +0000 (23:53 +0200)]
radv: Add Radeon Raytracing Analyzer capturing layer

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>

22 months agoradv: Add Radeon Raytracing Analyzer trace dumping utilities
Friedrich Vock [Sat, 20 Aug 2022 21:50:38 +0000 (23:50 +0200)]
radv: Add Radeon Raytracing Analyzer trace dumping utilities

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>

22 months agoradv: Add metadata to acceleration structures
Friedrich Vock [Mon, 29 Aug 2022 11:33:54 +0000 (13:33 +0200)]
radv: Add metadata to acceleration structures

This metadata is used for dumping RRA traces.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>

22 months agoradv: Generalize instance count in BVH states to leaf node count
Friedrich Vock [Sat, 27 Aug 2022 22:33:16 +0000 (00:33 +0200)]
radv: Generalize instance count in BVH states to leaf node count

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18166>

22 months agoaco/ra: rework fixed operands
Rhys Perry [Fri, 24 Jun 2022 11:36:24 +0000 (12:36 +0100)]
aco/ra: rework fixed operands

This moves all fixed operands at once, so they don't interfere with one
another.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17493>

22 months agoaco/ra: remove bounds parameter from get_regs_for_copies()
Rhys Perry [Thu, 30 Jun 2022 12:44:28 +0000 (13:44 +0100)]
aco/ra: remove bounds parameter from get_regs_for_copies()

I don't think it makes sense for this to be anything but get_reg_bounds(),
and this change makes this function usuable with a mix of SGPRs and VGPRs.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17493>

22 months agoaco/ra: handle empty def_reg interval in get_regs_for_copies
Rhys Perry [Fri, 24 Jun 2022 10:53:18 +0000 (11:53 +0100)]
aco/ra: handle empty def_reg interval in get_regs_for_copies

If def_reg is empty, then def_reg.lo() may be lower than bounds.lo() if
we're moving VGPRs and info.bounds will be invalid.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17493>

22 months agoradv/ci: disable kabini's vkd3d job
Martin Roukala (né Peres) [Wed, 31 Aug 2022 15:02:15 +0000 (18:02 +0300)]
radv/ci: disable kabini's vkd3d job

The vkd3d update increased its RAM usage above the 4GB of RAM the
kabini has... which leads to amdgpu complaining about not having
enough RAM for command submission.

Let's disable the job until we find a way to lower concurrency or
increase the amount of carveout that could be used for command
submission.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18346>

22 months agoradv/ci: disable the POLARIS10 jobs
Martin Roukala (né Peres) [Wed, 31 Aug 2022 14:55:55 +0000 (17:55 +0300)]
radv/ci: disable the POLARIS10 jobs

A kernel bug makes the first-context's creation likely to hang the GPU,
which most times than not end up failing the job despite multiple
retries.

Disable the jobs until the bug gets bisected or worked around
effectively.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18346>

22 months agopvr: Update FWIF compute register structure
Sarah Walker [Tue, 19 Jul 2022 09:27:44 +0000 (10:27 +0100)]
pvr: Update FWIF compute register structure

This matches changes made in FW 1.17.OS@6280047.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17680>

22 months agopvr: remove redundant TODO
Frank Binns [Tue, 30 Aug 2022 18:13:02 +0000 (19:13 +0100)]
pvr: remove redundant TODO

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

22 months agoaco: Fix p_init_scratch for task shaders.
Timur Kristóf [Wed, 31 Aug 2022 13:04:58 +0000 (15:04 +0200)]
aco: Fix p_init_scratch for task shaders.

Fixes: d2d94b62f2a4f8686c17b7c33ae02aa2b2029a27
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18339>

22 months agoetnaviv: rewrite sampler TS check
Lucas Stach [Fri, 12 Aug 2022 16:35:08 +0000 (18:35 +0200)]
etnaviv: rewrite sampler TS check

The current way this check is written is getting hard to read. Make
things a bit more verbose by splitting the checks and putting the
comments directly in front of them.

No functional change, GCC11 generates exactly the same machine code
before and after the change.

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

22 months agoetnaviv: texture-desc: drop superfluous condition
Lucas Stach [Fri, 12 Aug 2022 22:39:32 +0000 (00:39 +0200)]
etnaviv: texture-desc: drop superfluous condition

After ad48411d721e ("etnaviv: fix linear_nearest / nearest_linear filters
on GC7000Lite") the code in both branches of the condition is exactly the
same, so there is no need for the condition at all.

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

22 months agoetnaviv: texture-desc: sample 1D textures using 2D mode
Lucas Stach [Fri, 12 Aug 2022 22:32:02 +0000 (00:32 +0200)]
etnaviv: texture-desc: sample 1D textures using 2D mode

Mipmapping is not working correctly when sampling a 1D texture, likely
due to a bad derivative being used by the hardware for the unused
dimension.
To work around this, do the same trick as already used in texture-state
by upgrading 1D textures to 2D samplers with VWARP mode set to repeat.

Fixes piglit spec@glsl-1.20@execution@tex-miplevel-selection 1d

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

22 months agoetnaviv: don't use TS with multi-layer resources
Lucas Stach [Fri, 12 Aug 2022 22:11:33 +0000 (00:11 +0200)]
etnaviv: don't use TS with multi-layer resources

Clear and render operations can target each layer of a multi-layer resource
separately, which means we would need to track TS valid and clear color
states for each layer separately to make TS work correctly. As multi-layer
resources are very likely not primarily used for rendering, they are unlikely
to profit much from TS, so instead of adding all this state, don't use TS for
such resources at all.

Fixes piglit spec@glsl-1.20@execution@tex-miplevel-selection 3d

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

22 months agoetnaviv: fill alpha channel for DXT1_RGB textures
Lucas Stach [Thu, 11 Aug 2022 13:22:35 +0000 (15:22 +0200)]
etnaviv: fill alpha channel for DXT1_RGB textures

As the HW uses the same decompression scheme for both RGBA and RGB
DXT1 textures, it needs to be told to properly fill the alpha channel
for the plain RGB format.

Fixes piglit spec@ext_texture_compression_s3tc@s3tc-targeted.

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

22 months agor600/sfn: Don't scalarize fdd instructions
Gert Wollny [Wed, 31 Aug 2022 11:38:21 +0000 (13:38 +0200)]
r600/sfn: Don't scalarize fdd instructions

These are handled by a vectorized texture op.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>

22 months agor600/sfn: Override VPM if access in helpers is requested
Gert Wollny [Wed, 31 Aug 2022 10:50:38 +0000 (12:50 +0200)]
r600/sfn: Override VPM if access in helpers is requested

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>

22 months agor600/sfn: more peephole optimization with conditionals
Gert Wollny [Wed, 31 Aug 2022 09:24:17 +0000 (11:24 +0200)]
r600/sfn: more peephole optimization with conditionals

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>

22 months agor600/sfn: ACK all image stores, also at end of loop
Gert Wollny [Wed, 31 Aug 2022 08:24:00 +0000 (10:24 +0200)]
r600/sfn: ACK all image stores, also at end of loop

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>

22 months agor600/sfn: override register ID when it doesn't matter
Gert Wollny [Wed, 31 Aug 2022 06:13:18 +0000 (08:13 +0200)]
r600/sfn: override register ID when it doesn't matter

When a vec4 register only uses constant value of ignore
swizzles then emit zero as register ID.

Optimizing the register use in instructions that support this type
of swizzle may lead to the situation that the RA doesn't see the
register ID, because it is actually irreleant, in this case return
zero as register ID to avoid that the assembler uselessly reports
a high requirement for registers based on a stale register ID.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>

22 months agoradeonsi: avoid a use-after-free
Thomas H.P. Andersen [Wed, 31 Aug 2022 21:06:05 +0000 (23:06 +0200)]
radeonsi: avoid a use-after-free

Use of 'shader' after free was added in ac6fb2467fefa78de12af53490b70ab04e73749a

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

22 months agov3dv: implement VK_KHR_workgroup_memory_explicit_layout
Iago Toral Quiroga [Wed, 31 Aug 2022 10:39:32 +0000 (12:39 +0200)]
v3dv: implement VK_KHR_workgroup_memory_explicit_layout

There is an issue with some Amber tests for this feature using
a larger number of workgroup invocations than supported without
checking the limit. I filed and issue [1] (and a CL with a fix), but
meanwhile we want to flag those as expected crashes for CI.

[1] https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3913

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18337>

22 months agost: Fixes warning [-Wimplicit-fallthrough] in st_texture.c
Yonggang Luo [Tue, 23 Aug 2022 04:56:26 +0000 (12:56 +0800)]
st: Fixes warning [-Wimplicit-fallthrough] in st_texture.c

Warning message:
../src/mesa/state_tracker/st_texture.c:190:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agov3dv: Remove redundant unreachable in v3dvx_pipeline.c
Yonggang Luo [Tue, 23 Aug 2022 05:18:31 +0000 (13:18 +0800)]
v3dv: Remove redundant unreachable in v3dvx_pipeline.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agov3dv: Fixes warning [-Wimplicit-fallthrough] in v3dvx_pipeline.c
Yonggang Luo [Tue, 23 Aug 2022 04:47:51 +0000 (12:47 +0800)]
v3dv: Fixes warning [-Wimplicit-fallthrough] in v3dvx_pipeline.c

Warning message:
../src/broadcom/vulkan/v3dvx_pipeline.c:60:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agovdpau: Fixes warning [-Wimplicit-fallthrough] in vdpau_private.h
Yonggang Luo [Tue, 23 Aug 2022 04:39:28 +0000 (12:39 +0800)]
vdpau: Fixes warning [-Wimplicit-fallthrough] in vdpau_private.h

Warning message:
../src/gallium/frontends/vdpau/vdpau_private.h:149:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-By: Sil Vilerino sivileri@microsoft.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd6_emit.c
Yonggang Luo [Tue, 23 Aug 2022 05:24:31 +0000 (13:24 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd6_emit.c

Warning message:
../src/gallium/drivers/freedreno/a6xx/fd6_emit.c:177:13: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd5_emit.c
Yonggang Luo [Tue, 23 Aug 2022 05:23:39 +0000 (13:23 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd5_emit.c

Warning message:
../src/gallium/drivers/freedreno/a5xx/fd5_emit.c:272:13: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd5_texture.h
Yonggang Luo [Tue, 23 Aug 2022 05:22:39 +0000 (13:22 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd5_texture.h

Warning message:
../src/gallium/drivers/freedreno/a5xx/fd5_texture.h:71:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd3_texture.c
Yonggang Luo [Tue, 23 Aug 2022 05:20:09 +0000 (13:20 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd3_texture.c

Warning message:
../src/gallium/drivers/freedreno/a3xx/fd3_texture.c:132:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd2_texture.c
Yonggang Luo [Tue, 23 Aug 2022 05:12:04 +0000 (13:12 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd2_texture.c

Warning message:
../src/gallium/drivers/freedreno/a2xx/fd2_texture.c:150:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd4_texture.h
Yonggang Luo [Tue, 23 Aug 2022 05:00:31 +0000 (13:00 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd4_texture.h

Warning message:
../src/gallium/drivers/freedreno/a4xx/fd4_texture.h:75:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in freedreno_util.h
Yonggang Luo [Tue, 23 Aug 2022 04:33:25 +0000 (12:33 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in freedreno_util.h

Warning message:
../src/gallium/drivers/freedreno/freedreno_util.h:433:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agoradeonsi: Fixes warning [-Wimplicit-fallthrough] in si_descriptors.c
Yonggang Luo [Tue, 23 Aug 2022 05:08:14 +0000 (13:08 +0800)]
radeonsi: Fixes warning [-Wimplicit-fallthrough] in si_descriptors.c

Warning messages:
../src/gallium/drivers/radeonsi/si_descriptors.c:1475:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
../src/gallium/drivers/radeonsi/si_descriptors.c:1493:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agollvmpipe: Fixes warning [-Wimplicit-fallthrough] in lp_bld_sample_soa.c
Yonggang Luo [Tue, 23 Aug 2022 05:05:53 +0000 (13:05 +0800)]
llvmpipe: Fixes warning [-Wimplicit-fallthrough] in lp_bld_sample_soa.c

Warning message:
../src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c:2676:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agollvmpipe: Fixes warning [-Wimplicit-fallthrough] in lp_bld_swizzle.c
Yonggang Luo [Tue, 23 Aug 2022 05:03:10 +0000 (13:03 +0800)]
llvmpipe: Fixes warning [-Wimplicit-fallthrough] in lp_bld_swizzle.c

../src/gallium/auxiliary/gallivm/lp_bld_swizzle.c:399:13: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

22 months agollvmpipe: finish rendering before flushing frontbuffer resources.
Dave Airlie [Thu, 1 Sep 2022 01:37:27 +0000 (11:37 +1000)]
llvmpipe: finish rendering before flushing frontbuffer resources.

Fixes misrendering on front with mesa demos

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18360>

22 months agovenus: Increase vn_relax sleep time
Renato Pereyra [Wed, 31 Aug 2022 21:14:36 +0000 (14:14 -0700)]
venus: Increase vn_relax sleep time

After the recent Venus changes to fence feedback, the performance drop from
increasing this setting are now negligible while DX games still experience a
sizable decrease in CPU utilization.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18357>

22 months agopanfrost: Add userspace crash dump decoder and analyser
Adrián Larumbe [Thu, 11 Aug 2022 20:35:22 +0000 (21:35 +0100)]
panfrost: Add userspace crash dump decoder and analyser

Introduces a binary dump analyser and BO decoder whose format was partially
borrowed from etnaviv's kernel driver. It leverages the pandecode library
to analyse BO's attached to the GPU job that caused the crash.

Binary dump should be generated by a component of Panfrost's kernel driver.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14034>

22 months agopanfrost: Sync panfrost_drm.h from drm-misc-next
Adrián Larumbe [Thu, 11 Aug 2022 17:07:46 +0000 (18:07 +0100)]
panfrost: Sync panfrost_drm.h from drm-misc-next

Updated from changes in commit 730c2bf4ad39 ("drm/panfrost: Add support for
devcoredump").

From drm-misc/drm-misc-next.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14034>

22 months agopanfrost: Add compiler args option for building usermode tools
Adrián Larumbe [Sat, 26 Mar 2022 02:48:52 +0000 (02:48 +0000)]
panfrost: Add compiler args option for building usermode tools

Binaries built under src/panfrost weren't passed this compiler switch,
so it would trigger pointer arithmetic errors when using
the inlined definitions in the pandecode library.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14034>

22 months agopanfrost: Remove documentation reference to deprecated parameter
Adrián Larumbe [Tue, 10 May 2022 00:03:03 +0000 (01:03 +0100)]
panfrost: Remove documentation reference to deprecated parameter

'bifrost' parameter is no longer used by pandecode.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14034>

22 months agopanfrost: Handle Job VA cycles when decoding a dump file
Adrián Larumbe [Sat, 26 Mar 2022 02:13:16 +0000 (02:13 +0000)]
panfrost: Handle Job VA cycles when decoding a dump file

When a job loop is submitted to the GPU, as in IGT
panfrost_submit@pan-reset, this will trigger a DRM scheduler timeout and
eventually a devcoredump. However, when pandecode traverses the list of
jobs in a submit BO, it will iterate forever.

Fix it by adding already-visited CPU VA's into a mesa pointer set and
checking that the current job's CPU VA hasn't already been handled.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14034>

22 months agonvc0: fix a warning -Wconstant-conversion
Thomas H.P. Andersen [Sun, 26 Dec 2021 00:58:50 +0000 (01:58 +0100)]
nvc0: fix a warning -Wconstant-conversion

I do not understand the code here well enough to tell what the correct
behavior is. prog->num_gprs is a unit8_t, so my guess is that the MIN
is there to make sure we stay within the limit of that. However the
current logic is a bit strange. If info_out.bin.maxGPR + 5 is bellow
256 we use that. If not then we write 256 which converts to 0 in a
uint8_t...

The patch changes the upper value to 255.

Fixes a warning with clang

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

22 months agogallium,glsl: Delete PIPE_CAP_VERTEXID_NOBASE and lower_vertex_id.
Emma Anholt [Tue, 30 Aug 2022 19:14:01 +0000 (12:14 -0700)]
gallium,glsl: Delete PIPE_CAP_VERTEXID_NOBASE and lower_vertex_id.

Every driver uses the nir_lower_system_values path now.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18327>

22 months agofreedreno/ir3: Switch to NIR for a3xx/a4xx's vertex id lowering.
Emma Anholt [Tue, 30 Aug 2022 19:12:54 +0000 (12:12 -0700)]
freedreno/ir3: Switch to NIR for a3xx/a4xx's vertex id lowering.

We already have the compiler pass, just need to set the flag.  We were the
last consumer of glsl's lower_vertex_id.

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

22 months agofreedreno/ir3: Move chip-specific nir compiler options to C code.
Emma Anholt [Tue, 30 Aug 2022 19:02:07 +0000 (12:02 -0700)]
freedreno/ir3: Move chip-specific nir compiler options to C code.

We had a mix of common-macro-and-chip-overrides in static decls and plus
more overrides later in C code.  It's way cleaner to just have a static
decl for the base options and chip overrides in C code.

This moves a few things (lower_cs_local_index_to_id, lower_wpos_pntc,
lower_int64_options) to the common static decl that had been pasted into
both a3xx-a5xx and a6xx.

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

22 months agoturnip: Make sure bandwidth config per pixel starts from 0.
Emma Anholt [Wed, 31 Aug 2022 18:41:01 +0000 (11:41 -0700)]
turnip: Make sure bandwidth config per pixel starts from 0.

We'd keep incrementing the costs in a cmd buffer's dynamic_pass on each
BeginRendering.  This fixes the main renderpass of aztec ruins on zink to
use gmem, taking fps from ~8 to ~10.

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

22 months agovenus/ci: mark a test as flake
Yiwei Zhang [Wed, 31 Aug 2022 21:05:51 +0000 (21:05 +0000)]
venus/ci: mark a test as flake

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

22 months agomeson/panfrost: Add dep_valgrind for libpanfrost_pixel_format to fixes the compiling...
Yonggang Luo [Wed, 31 Aug 2022 17:04:42 +0000 (01:04 +0800)]
meson/panfrost: Add dep_valgrind for libpanfrost_pixel_format to fixes the compiling error:

In file included from src/panfrost/lib/genxml/v9_pack.h:15,
                 from ../../src/panfrost/lib/genxml/gen_macros.h:95,
                 from ../../src/panfrost/lib/pan_format.c:27:
../../src/util/bitpack_helpers.h:34:10: fatal error: valgrind.h: No such file or directory

Fixes: c52d5acf15d ("util,intel: Pull the bit packing helpers from genxml to a common header")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7169

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18350>

22 months agonir_to_tgsi: Add support for bindless textures and images.
Emma Anholt [Wed, 13 Apr 2022 18:31:55 +0000 (11:31 -0700)]
nir_to_tgsi: Add support for bindless textures and images.

Tested on nouveau with the piglit tests.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>

22 months agonir_to_tgsi: Use nir_lower_discard_if for demote_if.
Emma Anholt [Wed, 13 Apr 2022 17:39:05 +0000 (10:39 -0700)]
nir_to_tgsi: Use nir_lower_discard_if for demote_if.

TGSI doesn't have a DEMOTE_IF, so we want to lower it back to IF DEMOTE
ENDIF.  Fixes a regression with nvc0 on nir-to-tgsi.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>

22 months agonir: Make nir_lower_discard_if() handle demotes and terminates, too.
Emma Anholt [Wed, 13 Apr 2022 23:22:47 +0000 (16:22 -0700)]
nir: Make nir_lower_discard_if() handle demotes and terminates, too.

AGX and zink both want all of these lowered, but nir_to_tgsi will want
only demote (and terminate if it was possible from GLSL but it's not)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>

22 months agonir_to_tgsi: Add support for demote, is_helper_invocation, and subgroup ops.
Emma Anholt [Wed, 13 Apr 2022 05:25:14 +0000 (22:25 -0700)]
nir_to_tgsi: Add support for demote, is_helper_invocation, and subgroup ops.

Found to be missing when testing on nvc0.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>

22 months agonir_to_tgsi: Add support for 64-bit fsign/isign.
Emma Anholt [Wed, 13 Apr 2022 04:41:07 +0000 (21:41 -0700)]
nir_to_tgsi: Add support for 64-bit fsign/isign.

Found missing on nouveau.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>

22 months agonir_to_tgsi: Add support for TG4 with explicit offsets.
Emma Anholt [Wed, 13 Apr 2022 04:19:14 +0000 (21:19 -0700)]
nir_to_tgsi: Add support for TG4 with explicit offsets.

Needed for nvidia.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15932>

22 months agoac/llvm: Fix image instructions with lod for 2d on GFX9.
Georg Lehmann [Wed, 17 Aug 2022 18:33:06 +0000 (20:33 +0200)]
ac/llvm: Fix image instructions with lod for 2d on GFX9.

If there's a lod parameter it matter if the image is 3d or 2d because
the hw reads either the fourth or third component as lod. So detect
3d images and place the lod at the third component otherwise.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18114>

22 months agoaco: Fix image instructions with lod when 2d_view_of_3d is enabled on GFX9.
Georg Lehmann [Wed, 17 Aug 2022 17:43:15 +0000 (19:43 +0200)]
aco: Fix image instructions with lod when 2d_view_of_3d is enabled on GFX9.

If there's a lod parameter it matter if the image is 3d or 2d because
the hw reads either the fourth or third component as lod. So detect
3d images and place the lod at the third component otherwise.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18114>

22 months agonir/opt_algebraic: Optimize d3d9 pow with fmulz.
Georg Lehmann [Fri, 19 Aug 2022 15:47:43 +0000 (17:47 +0200)]
nir/opt_algebraic: Optimize d3d9 pow with fmulz.

Foz-DB Navi21:
Totals from 69 (0.05% of 134913) affected shaders:
CodeSize: 255684 -> 253788 (-0.74%); split: -0.74%, +0.00%
Instrs: 46307 -> 46052 (-0.55%); split: -0.55%, +0.00%
Latency: 533255 -> 530742 (-0.47%); split: -0.48%, +0.01%
InvThroughput: 110001 -> 109156 (-0.77%)
VClause: 839 -> 844 (+0.60%); split: -1.19%, +1.79%
SClause: 1411 -> 1395 (-1.13%)
Copies: 1828 -> 1816 (-0.66%); split: -1.09%, +0.44%
PreSGPRs: 2243 -> 2232 (-0.49%)
PreVGPRs: 2213 -> 2192 (-0.95%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18145>

22 months agonir/opt_algebraic: Optimize check for single bit.
Georg Lehmann [Fri, 8 Jul 2022 17:16:48 +0000 (19:16 +0200)]
nir/opt_algebraic: Optimize check for single bit.

Foz-DB Navi21:
Totals from 3239 (2.40% of 134913) affected shaders:
SpillSGPRs: 110 -> 102 (-7.27%)
CodeSize: 17426512 -> 17344808 (-0.47%); split: -0.48%, +0.01%
Instrs: 3194264 -> 3179366 (-0.47%)
Latency: 20498012 -> 20481419 (-0.08%); split: -0.08%, +0.00%
InvThroughput: 3311738 -> 3311282 (-0.01%); split: -0.02%, +0.00%
SClause: 145810 -> 145690 (-0.08%)
Copies: 171748 -> 169009 (-1.59%); split: -1.63%, +0.03%
Branches: 86610 -> 86370 (-0.28%)
PreSGPRs: 138036 -> 137104 (-0.68%)
PreVGPRs: 138540 -> 138545 (+0.00%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17429>

22 months agoutil: Remove the need of _MTX_INITIALIZER_NP in simple_mtx.h
Yonggang Luo [Tue, 16 Aug 2022 17:42:52 +0000 (01:42 +0800)]
util: Remove the need of _MTX_INITIALIZER_NP in simple_mtx.h

The usage of _MTX_INITIALIZER_NP is a problem. Sure, the code builds on
Linux and Windows, and it even usually works, but is problematic.
It means that Windows lock debugging tools cannot be used with that code.
So we remove _MTX_INITIALIZER_NP to gain the following benefit:
  Aligning to the C11 standard threads.h definitions.
  Improving portability of the threading code to better support Windows.
This change removes one of the most prolific uses of _MTX_INITIALIZER_NP by
slightly increasing the cost of simple_mtx_lock when targeting platforms that
don't support futex, but it's cost are far less than the cost of syscall,
so the affect are negligible.

The futex code path are not affected. And Windows 8 and upper also
supports the futex codepath, so it's only affect the Windows version < 8, MacOS
or other platforms that doesn't support for futex.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17122>

22 months agoutil: Add extern "C" guard in simple_mtx.h
Yonggang Luo [Mon, 22 Aug 2022 17:01:48 +0000 (01:01 +0800)]
util: Add extern "C" guard in simple_mtx.h

This is a header that can be accessed both in C/C++,
And when remove the usage of _MTX_INITIALIZER_NP in latter commits, it's need
implement simple_mtx_init in .c file, so for ABI consistence
Add the extern "C" for cpp files

Also add comment for #endif guard for code readability

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17122>

22 months agoutil: Add api util_call_once_with_context
Yonggang Luo [Sat, 18 Jun 2022 15:55:49 +0000 (23:55 +0800)]
util: Add api util_call_once_with_context

This is used to remove the need of _MTX_INITIALIZER_NP in simple_mtx.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17122>

22 months agopvr: Only destroy the physcial device if it exists
Jason Ekstrand [Tue, 30 Aug 2022 19:13:51 +0000 (14:13 -0500)]
pvr: Only destroy the physcial device if it exists

Without this, it segfaults on instance destruction which brings down the
Vulkan app if you have the driver installed on your system, even if you
have no PowerVR hardware.

Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18330>

22 months agopan/mdg: Print 3 sources for CSEL
Alyssa Rosenzweig [Mon, 22 Aug 2022 17:38:16 +0000 (13:38 -0400)]
pan/mdg: Print 3 sources for CSEL

The third source exists logically but not architecturally. We still need to
print it. Caught by the assertion.

Fixes: 0ee24c46e0a ("pan/mdg: Only print 2 sources for ALU")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18338>

22 months agopan/mdg: Always write return address to r1.w
Alyssa Rosenzweig [Mon, 22 Aug 2022 17:27:55 +0000 (13:27 -0400)]
pan/mdg: Always write return address to r1.w

This might not be optimal but it matches our current behaviour and is much more
justified than the "accidental" code before. Caught by the gcc warning:

../src/panfrost/midgard/midgard_schedule.c:1227:48: warning: the comparison will
always evaluate as ‘true’ for the address of ‘writeout_branch’ will never be
NULL [-Waddress]

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18338>

22 months agoradeonsi/sqtt: set stable pstate if possible
Pierre-Eric Pelloux-Prayer [Thu, 11 Aug 2022 13:05:18 +0000 (15:05 +0200)]
radeonsi/sqtt: set stable pstate if possible

This avoids the need to manually change the power profile.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18009>

22 months agowayland: avoid writing interface names as free-form strings
Eric Engestrom [Wed, 31 Aug 2022 09:08:32 +0000 (10:08 +0100)]
wayland: avoid writing interface names as free-form strings

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18335>

22 months agopvr: Change indentation from tab to spaces for xml files.
Karmjit Mahil [Mon, 22 Aug 2022 13:22:32 +0000 (14:22 +0100)]
pvr: Change indentation from tab to spaces for xml files.

This is done to match other drivers and to use spaces for
indentation throughout the whole of the powervr driver.

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

22 months agopvr: Implement vkResetCommandBuffer
Frank Binns [Wed, 20 Jul 2022 22:35:57 +0000 (23:35 +0100)]
pvr: Implement vkResetCommandBuffer

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18317>

22 months agopvr: reset all command buffer state in pvr_cmd_buffer_reset()
Frank Binns [Tue, 26 Jul 2022 23:07:58 +0000 (00:07 +0100)]
pvr: reset all command buffer state in pvr_cmd_buffer_reset()

Command buffers were only being partially reset. Fix this by factoring out the
common parts of pvr_cmd_buffer_reset() and pvr_cmd_buffer_reset() into a common
function, so there's now only a single place to free command buffer state, and
zeroing out parts of the command buffer that were missed.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18317>

22 months agovirgl/ci: remove some flakes
Gert Wollny [Thu, 25 Aug 2022 10:49:18 +0000 (12:49 +0200)]
virgl/ci: remove some flakes

With the better synchronization we can now remove some flakes.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18243>

22 months agovirgl: when reading back wait first, then do the transfer
Gert Wollny [Thu, 25 Aug 2022 06:30:53 +0000 (08:30 +0200)]
virgl: when reading back wait first, then do the transfer

Otherwise the transfer from the host might not be finished
when we try to read the data.

v2: always wait before readback, but also keep the wait after
  a possible readback, Itherwise TF fails in the CI.

Fixes: e87186fc679c146c5d521139bb79c8eafa0a22f0
    virgl: add virgl_resource_transfer_prepare

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18243>

22 months agov3dv: expose VK_KHR_synchronization2
Iago Toral Quiroga [Fri, 26 Aug 2022 07:29:37 +0000 (09:29 +0200)]
v3dv: expose VK_KHR_synchronization2

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18290>

22 months agov3dv: use VkPipelineStageFlagBits2 when checking semaphore wait stage
Iago Toral Quiroga [Fri, 26 Aug 2022 11:09:38 +0000 (13:09 +0200)]
v3dv: use VkPipelineStageFlagBits2 when checking semaphore wait stage

This adds extra stages, some of which involve geometry stages that are
relevant to the check we do to check for binning sync.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18290>