platform/upstream/mesa.git
14 months agoac/surface: print tile_swizzle as well
Chia-I Wu [Fri, 19 May 2023 22:30:33 +0000 (15:30 -0700)]
ac/surface: print tile_swizzle as well

swizzle modes that are *_X or *_T depend on tile_swizzle.

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

14 months agoamd/drm-shim: add raven2
Chia-I Wu [Fri, 19 May 2023 22:29:19 +0000 (15:29 -0700)]
amd/drm-shim: add raven2

It differs from raven in interesting ways (e.g., GB_ADDR_CONFIG).

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

14 months agopanfrost: expose PIPE_CAP_POLYGON_OFFSET_CLAMP
Erik Faye-Lund [Mon, 22 May 2023 11:43:18 +0000 (13:43 +0200)]
panfrost: expose PIPE_CAP_POLYGON_OFFSET_CLAMP

This gives us ARB_polygon_offset_clamp and EXT_polygon_offset_clamp, and
most of the actual state plumbing was already in place.

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

14 months agomesa/st: Set pipe_shader_image::single_layer_view
Alyssa Rosenzweig [Fri, 19 May 2023 21:52:17 +0000 (17:52 -0400)]
mesa/st: Set pipe_shader_image::single_layer_view

Pass it through from the API.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23142>

14 months agogallium: Add pipe_image_view::single_layer_view
Alyssa Rosenzweig [Fri, 19 May 2023 21:46:08 +0000 (17:46 -0400)]
gallium: Add pipe_image_view::single_layer_view

OpenGL has a goofy feature that allows creating an image view of a single layer
of an array texture... in which case that image is treated as non-arrayed in
shader. If you have a 16x16x16 3D texture and bind the third layer, you get a
16x16 2D texture instead of a 16x16x1 3D texture. That distinction matters to
the hardware on AGX, since the texture dimension needs to match between the
shader and the pipe_image_view. If the shader is going to use image2D, we need
to know that the pipe_image_view should be treated as 2D (even though the
underlying resource is 3D).

"But, Alyssa, we already have first_layer and last_layer. Surely you can just
check if first_layer == last_layer?" you ask. The problem is that doesn't
distinguish a 16x16x1 3D texture (accessed as image3D in the shader) from a
16x16 slice (accessed as image2D in the shader) of a 16x16x16 3D texture. To
solve, we add a boolean flag indicating we want to create a view (with a lower
dimension than the underlying resource). This provides an unambiguous way to
communicate this case to drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23142>

14 months agoradv/ci: switch to b2c v0.9.10
Martin Roukala (né Peres) [Mon, 22 May 2023 13:18:57 +0000 (16:18 +0300)]
radv/ci: switch to b2c v0.9.10

This brings a fix for the steam decks which may boot too fast sometimes,
and have the network adapter not being enumerated by the time it tries
to connect to the gateway...

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23170>

14 months agomesa/spirv: Provide more specific error message for glSpecializeShader()
Caio Oliveira [Thu, 11 May 2023 22:36:55 +0000 (15:36 -0700)]
mesa/spirv: Provide more specific error message for glSpecializeShader()

Distinguish between the "entry point not found" and "parsing error"
cases in the error text.  For consistency, identify the unhandled
specialization index case as part of the verification function.

The verification function was renamed to make clearer its scope and
what module it belongs.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22976>

14 months agopan/mdg: Use nir_lower_image_atomics_to_global
Alyssa Rosenzweig [Fri, 19 May 2023 02:59:53 +0000 (22:59 -0400)]
pan/mdg: Use nir_lower_image_atomics_to_global

We were already lowering image atomics to lea_image + global atomic. It's a lot
nicer to make that lowering explicit in the NIR. This is much bigger win than in
the Bifrost compiler since here lea_image is used only for atomics, and here it
wasn't well abstracted in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agopan/bi: Use nir_lower_image_atomics_to_global
Alyssa Rosenzweig [Fri, 19 May 2023 02:44:18 +0000 (22:44 -0400)]
pan/bi: Use nir_lower_image_atomics_to_global

We were already lowering image atomics to lea_attr_tex + global atomic, might as
well make that lowering explicit in the NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agopan/bi: Fix atomic exchange on Valhall
Alyssa Rosenzweig [Fri, 19 May 2023 02:56:11 +0000 (22:56 -0400)]
pan/bi: Fix atomic exchange on Valhall

Copypaste fail when switching to unified atomics, missed becuase I don't have
any Valhall hardware and Valhall isn't in CI. (Good news, that means it probably
didn't affect anyone in the mean time :-p)

Fixes crashes with lots of dEQP-GLES31 tests observed under drm-shim.

Fixes: e258083e072 ("pan/bi: Use unified atomics")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agonir: Add pass to lower image atomics
Alyssa Rosenzweig [Fri, 19 May 2023 03:20:15 +0000 (23:20 -0400)]
nir: Add pass to lower image atomics

Hardware that lacks dedicated image atomics can still implement image atomics
with regular atomics on global memory, as long as there is a way to get the
address of a texel in memory. I've open-coded this lowering in my first 2
compilers, so before I add another crappy vendored version in my 3rd, let's add
a common NIR pass to do the lowering.

Thanks to unified atomics, the pass itself is fairly concise.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agonir: Add image_texel_address intrinsics
Alyssa Rosenzweig [Fri, 19 May 2023 03:16:55 +0000 (23:16 -0400)]
nir: Add image_texel_address intrinsics

Some hardware has an instruction to load the address of a texel in a writeable
image, given the coordinates ("LEA_IMAGE"). This operation is defined only for
uncompressed images, but it is well-defined regardless of the underlying
twiddling. As such, it is not expected to be produced by APIs but is useful for
internal lowering when it is known that images will be uncompressed (e.g.
because image_store does not support compression on the hardware).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agonir: Document extra image source
Alyssa Rosenzweig [Fri, 19 May 2023 01:45:45 +0000 (21:45 -0400)]
nir: Document extra image source

I was scratching my head about this for a few minutes until I found the answer
in spirv_to_nir. Hopefully this saves someone else some head scratching in turn.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agodocs: use meson instead invoking ninja directly
David Heidelberg [Fri, 19 May 2023 10:20:56 +0000 (12:20 +0200)]
docs: use meson instead invoking ninja directly

This approach is available since meson 0.47.0 which we depend on.

Reviewed-by: Sergi Blanch-Torné <sergi.blanch.torne@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23127>

14 months agozink: try update fb resource refs when starting new renderpass
Mike Blumenkrantz [Fri, 19 May 2023 14:27:25 +0000 (10:27 -0400)]
zink: try update fb resource refs when starting new renderpass

in the case where a draw is triggered after a flush, zink_update_descriptor_refs
will be called to set batch tracking for descriptors. this function also
handles refs for fb attachments, and everything is usually fine there

the problem with this approach is that tracking is no longer set on view
objects at renderpass begin, which makes them susceptible to early deletion
if a rp isn't started from a draw call

instead, apply batch tracking to fb attachment resources on renderpass
begin if the BATCH_CHANGED flag is set (need to rename this at some point)
in order to guarantee that the resource (object) lifetime will match the
cmdbuf runtime [since imageviews are now only freed upon batch completion]

fixes #9059

Fixes: f6bbd7875a8 ("zink: remove batch tracking/usage from view types"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23132>

14 months agoanv: fix push descriptor deferred surface state packing
Lionel Landwerlin [Sun, 21 May 2023 12:19:56 +0000 (15:19 +0300)]
anv: fix push descriptor deferred surface state packing

Yuzu is running into a segfault because it writes the push descriptor
twice with 2 different layouts, but without a draw/dispatch in
between.

First vkCmdPushDescriptorSetKHR() writes descriptor 0 & 1 with a
uniform buffer. We toggle the 2 first bits of
anv_descriptor_set::generate_surface_states.

Second vkCmdPushDescriptorSetKHR() writes descriptor 0 with uniform
buffer and descriptor 1 with an image view. The first bit of
anv_descriptor_set::generate_surface_states stays, but the second bit
was already set before and it should now be off.

When we finally flush the push descriptor, we try to generate a
surface state for descriptor 1, but there is no valid buffer view for
it, we access an invalid pointer and segfault.

This fix resets the anv_descriptor_set::generate_surface_states when
the descriptor layout changes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b49b18f0b7 ("anv: reduce BT emissions & surface state writes with push descriptors")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23156>

14 months agor300: workaround GCC 12+ warning, declare NULL value as unreachable
David Heidelberg [Fri, 5 May 2023 19:55:55 +0000 (21:55 +0200)]
r300: workaround GCC 12+ warning, declare NULL value as unreachable

Solution recommended in the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109716#c3

Suggested-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23148>

14 months agobroadcom/compiler: skip jumps in non-uniform if/then when block cost is small
Iago Toral Quiroga [Tue, 16 May 2023 09:34:51 +0000 (11:34 +0200)]
broadcom/compiler: skip jumps in non-uniform if/then when block cost is small

We have an optimization for non-uniform if/else where if all channels meet the
jump condition we emit a branch to jump straight to the ELSE block. Similarly,
if at the end of the THEN block we don't have any channels that would execute
the ELSE block, we emit a branch to jump straight to the AFTER block.

This optimization has a cost though: we need to emit the condition for the
branch and a branch instruction (which also comes with a 3 delay slot), so for
very small blocks (just a couple of ALU for example) emitting the branch
instruction is typically worse. Futher, if the condition for the branch is not
met, we still pay the cost for no benefit at all.

Here is an example:

nop                           ; fmul.ifa rf26, 0x3e800000, rf54
xor.pushz -, rf52, 2          ; nop
bu.alla  32, r:unif (0x00000000 / 0.000000)
nop                           ; nop
nop                           ; nop
nop                           ; nop
xor.pushz -, rf52, 3          ; nop
nop                           ; mov.ifa rf52, 0
nop                           ; mov.pushz -, rf52
nop                           ; mov.ifa rf26, 0x3f800000

The bu instruction here is setup to jump over the following 4 instructions
(the last 4 instructions in there). To do this, we pay the price of the xor
to generate the condition, the bu instruction, and the 3 delay slots right
after it, so we end up paying 6 instructions to skip over 4 which we pay
always, even if the branch is not taken and we still have to execute those
4 instructions. With this change, we produce:

nop                           ; fmul.ifa rf56, 0x3e800000, rf28
xor.pushz -, rf9, 3           ; nop
nop                           ; mov.ifa rf9, 0
nop                           ; mov.pushz -, rf9
nop                           ; mov.ifa rf56, 0x3f800000

Now we don't try to skip the small block, ever. At worse, if all channels
would have met the branch condition, we only pay the cost of the 4
instructions instead of 6, at best, if any channel wouldn't take the
branch, we save ourselves 5 cycles for the branch condition, the branch
instruction and its 3 delay slots.

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

14 months agoradv: fix radv_emit_userdata_vertex for vertex offset -1
Yiwei Zhang [Mon, 22 May 2023 00:54:32 +0000 (00:54 +0000)]
radv: fix radv_emit_userdata_vertex for vertex offset -1

-1 is a legit vertex offset upon vkCmdDrawIndexed and other cmds. This
change fixes to track last_vertex_offset with an additional valid bit.

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

14 months agoradv: enable smoothLines
Samuel Pitoiset [Tue, 28 Feb 2023 08:10:30 +0000 (09:10 +0100)]
radv: enable smoothLines

For Zink.

This marks one piglit test as expected failure because polygon
smoothing can't be implemented properly in Vulkan.

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

14 months agoradv: add support for smooth lines
Samuel Pitoiset [Tue, 28 Feb 2023 08:48:56 +0000 (09:48 +0100)]
radv: add support for smooth lines

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

14 months agoradv: lower nir_intrinsic_load_poly_line_smooth_enabled_amd
Samuel Pitoiset [Tue, 16 May 2023 08:09:26 +0000 (10:09 +0200)]
radv: lower nir_intrinsic_load_poly_line_smooth_enabled_amd

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

14 months agoradv: declare a new user SGPR for the dynamic line rasterization mode
Samuel Pitoiset [Tue, 28 Feb 2023 08:24:51 +0000 (09:24 +0100)]
radv: declare a new user SGPR for the dynamic line rasterization mode

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

14 months agoradv: determine if smooth lines can be used in the pipeline key
Samuel Pitoiset [Tue, 28 Feb 2023 08:42:17 +0000 (09:42 +0100)]
radv: determine if smooth lines can be used in the pipeline key

Really complicated to reduce the scope because everything can be
dynamic and with GPL you can't even know if the pipeline draws lines
when compiling the fragment shader.

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

14 months agoradv: track if the smoothLines features is enabled in the device
Samuel Pitoiset [Tue, 28 Feb 2023 08:40:48 +0000 (09:40 +0100)]
radv: track if the smoothLines features is enabled in the device

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

14 months agonir: lower smooth lines conditionally using the new intrinsic
Samuel Pitoiset [Tue, 28 Feb 2023 08:11:19 +0000 (09:11 +0100)]
nir: lower smooth lines conditionally using the new intrinsic

RADV will enable/disable this based on a dynamic state.

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

14 months agoradeonsi: lower nir_intrinsic_load_poly_line_smooth_enabled_amd
Samuel Pitoiset [Tue, 28 Feb 2023 08:08:20 +0000 (09:08 +0100)]
radeonsi: lower nir_intrinsic_load_poly_line_smooth_enabled_amd

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

14 months agonir: add nir_intrinsic_load_poly_line_smooth_enabled
Samuel Pitoiset [Tue, 28 Feb 2023 08:03:52 +0000 (09:03 +0100)]
nir: add nir_intrinsic_load_poly_line_smooth_enabled

To lower smooth lines conditionally in fragment shaders for RADV
because the line rasterization mode in Vulkan can be dynamic.

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

14 months agoradv: remove useless check about USAGE_STORAGE for TC-compat HTILE
Samuel Pitoiset [Fri, 19 May 2023 07:25:11 +0000 (09:25 +0200)]
radv: remove useless check about USAGE_STORAGE for TC-compat HTILE

This should never happen.

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

14 months agoradv: disable IMAGE_USAGE_STORAGE with depth-only and stencil-only formats
Samuel Pitoiset [Fri, 19 May 2023 07:20:42 +0000 (09:20 +0200)]
radv: disable IMAGE_USAGE_STORAGE with depth-only and stencil-only formats

This shouldn't have been enabled at all. Depth-stencil formats were
accidentally disabled but not depth-only or stencil-only formats.

This doesn't seem allowed by DX12 and both AMD/NVIDIA don't enable it.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23122>

14 months agoradv: bump the global VRS image size to maximum supported FB dimensions
Samuel Pitoiset [Thu, 18 May 2023 13:31:51 +0000 (15:31 +0200)]
radv: bump the global VRS image size to maximum supported FB dimensions

Super sampling on a 4K screen could hit this. 16k seems pretty big
but this image is only created on RDNA2 and on-demand if VRS attachments
are used without depth-stencil attachments, which should be rare
enough to care.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23105>

14 months agoutil: add Pixel Game Maker MV workaround
Timothy Arceri [Thu, 18 May 2023 02:14:50 +0000 (12:14 +1000)]
util: add Pixel Game Maker MV workaround

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8918
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23095>

14 months agoci/v3dv: add often timeouting ssbo.layout.3_level_array.std140.column_major_mat4
David Heidelberg [Sat, 20 May 2023 23:36:28 +0000 (01:36 +0200)]
ci/v3dv: add often timeouting ssbo.layout.3_level_array.std140.column_major_mat4

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

14 months agoci/radv: add another raven flake dEQP-VK.draw.dynamic_rendering.primary_cmd_buff...
David Heidelberg [Sat, 20 May 2023 22:50:22 +0000 (00:50 +0200)]
ci/radv: add another raven flake dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.linear_interpolation

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

14 months agoradv: Clear query dirty flags when flushing them.
Timur Kristóf [Tue, 16 May 2023 11:12:00 +0000 (13:12 +0200)]
radv: Clear query dirty flags when flushing them.

This is just to make their code consistent with other similar
functions.

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

14 months agoradv: Move empty dynamic states check to caller.
Timur Kristóf [Tue, 16 May 2023 11:06:40 +0000 (13:06 +0200)]
radv: Move empty dynamic states check to caller.

Improves the CPU overhead of radv_emit_all_graphics_states.

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

14 months agoradv: Move indirect check from index buffer emission to caller.
Timur Kristóf [Tue, 16 May 2023 11:04:27 +0000 (13:04 +0200)]
radv: Move indirect check from index buffer emission to caller.

This improves the CPU overhead of radv_emit_all_graphics_states.

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

14 months agoradv: Slight refactor to late_scissor_emission.
Timur Kristóf [Wed, 25 Jan 2023 17:57:53 +0000 (18:57 +0100)]
radv: Slight refactor to late_scissor_emission.

There is no need to set context_roll_without_scissor_emitted
when pipeline, rbplus state, or binning state changes,
because radv_need_late_scissor_emission already checks
their dirty flags.

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

14 months agoradv: Set last_index_type in radv_before_draw.
Timur Kristóf [Mon, 15 May 2023 23:40:23 +0000 (01:40 +0200)]
radv: Set last_index_type in radv_before_draw.

This function is always inlined so checking info->indexed can be
constant folded by the compiler. So it is better to set this
in before_draw.

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

14 months agoradv: Move ignore forced VRS code to more optimal place.
Timur Kristóf [Mon, 15 May 2023 23:28:50 +0000 (01:28 +0200)]
radv: Move ignore forced VRS code to more optimal place.

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

14 months agoradv: Compute tess info when emitting patch control points.
Timur Kristóf [Thu, 12 Jan 2023 00:17:08 +0000 (01:17 +0100)]
radv: Compute tess info when emitting patch control points.

Some tess info needs to be calculated in the command buffer when
dynamic patch control points are enabled.

Move this calculation from radv_emit_all_graphics states to where
it actually matters.

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

14 months agoradv: Emit primitive reset index with primitive restart enable.
Timur Kristóf [Mon, 15 May 2023 23:04:04 +0000 (01:04 +0200)]
radv: Emit primitive reset index with primitive restart enable.

The VGT_MULTI_PRIM_IB_RESET_INDX register has no effect when
primitive restart is disabled, so we can move this out of the
hot path.

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

14 months agoasahi: Drop Asahi-as-a-swrast hack
Alyssa Rosenzweig [Fri, 19 May 2023 19:36:04 +0000 (15:36 -0400)]
asahi: Drop Asahi-as-a-swrast hack

Now that we've dropped macOS support in the driver, this is all dead code and
gets garbage collected.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23138>

14 months agogallium: Drop Asahi-as-a-swrast hack
Alyssa Rosenzweig [Fri, 19 May 2023 19:35:30 +0000 (15:35 -0400)]
gallium: Drop Asahi-as-a-swrast hack

Now that we've dropped macOS support, these paths are deadcode.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23138>

14 months agodocs: update crosvm networking options
David Heidelberg [Fri, 19 May 2023 10:23:16 +0000 (12:23 +0200)]
docs: update crosvm networking options

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22892>

14 months agoci/crosvm: update cmdline options
David Heidelberg [Sun, 7 May 2023 13:36:51 +0000 (15:36 +0200)]
ci/crosvm: update cmdline options

```
[WARN  crosvm::crosvm::cmdline] `--host-ip`, `--netmask`, and `--mac` are deprecated;
```

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22892>

14 months agonir: Assert that we don't shrink bit-sizes in nir_lower_bit_size()
Kenneth Graunke [Fri, 19 May 2023 00:15:04 +0000 (17:15 -0700)]
nir: Assert that we don't shrink bit-sizes in nir_lower_bit_size()

The idea of this pass is to promote small bit-sizes to larger, supported
bit-sizes for certain operations.  It doesn't handle emulating large
bit-size operations on smaller bit-sizes; passes like nir_lower_int64
and nir_lower_doubles handle that.

So, assert that we aren't shrinking the bit-size, as this will almost
certainly produce incorrect results.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23123>

14 months agointel/compiler: Fix 64-bit ufind_msb, find_lsb, and bit_count
Kenneth Graunke [Fri, 19 May 2023 00:19:42 +0000 (17:19 -0700)]
intel/compiler: Fix 64-bit ufind_msb, find_lsb, and bit_count

We only support 32-bit versions of ufind_msb, find_lsb, and bit_count,
so we need to lower them via nir_lower_int64.

Previously, we were failing to do so on platforms older than Icelake
and let those operations fall through to nir_lower_bit_size, which
used a callback to determine it should lower them for bit_size != 32.
However, that pass only emulates small bit-size operations by promoting
them to supported, larger bit-sizes (i.e. 16-bit using 32-bit).  It
doesn't support emulating larger operations (i.e. 64-bit using 32-bit).

So nir_lower_bit_size would just u2u32 the 64-bit source, causing us to
flat ignore half of the bits.

Commit 78a195f252d (intel/compiler: Postpone most int64 lowering to
brw_postprocess_nir) provoked this bug on Icelake and later as well,
by moving the nir_lower_int64 handling for ufind_msb until late in
compilation, allowing it to reach nir_lower_bit_size which broke it.

To fix this, we always set int64 lowering for these opcodes, and also
correct the nir_lower_bit_size callback to ignore 64-bit operations.

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23123>

14 months agonir: Add find_lsb lowering to nir_lower_int64.
Kenneth Graunke [Fri, 19 May 2023 10:53:07 +0000 (03:53 -0700)]
nir: Add find_lsb lowering to nir_lower_int64.

Some GPUs can only handle 32-bit find_lsb.

Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23123>

14 months agomicrosoft/compiler: Better and simpler bitcast reduction
Jesse Natalie [Tue, 16 May 2023 19:25:12 +0000 (12:25 -0700)]
microsoft/compiler: Better and simpler bitcast reduction

Using nir_gather_ssa_types works much better. There's 2 differences
compared to what I was doing before:
1. Multiple passes to allow data to propagate forward and backward
   through the whole shader.
2. Allowing a value to have indeterminate types due to having both
   int and float usages.

So this deletes some code and gets better results. Wish I'd known
this existed last week.

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

14 months agoiris: Fix return of xe_batch_submit() when exec fails
José Roberto de Souza [Fri, 19 May 2023 19:31:43 +0000 (12:31 -0700)]
iris: Fix return of xe_batch_submit() when exec fails

When intel_ioctl(DRM_IOCTL_XE_EXEC) fails it returns -1 sets errno
with the fail reason.
This fail reason is than is used to know if engine was banned in
context_or_engine_was_banned().

Not adding a fixes tag because Xe is not enabled by default.

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

14 months agoanv: Nuke ANV_BO_ALLOC_WRITE_COMBINE
José Roberto de Souza [Thu, 27 Apr 2023 16:50:39 +0000 (09:50 -0700)]
anv: Nuke ANV_BO_ALLOC_WRITE_COMBINE

In i915 if the device has local memory it can only mmap bo with
I915_MMAP_OFFSET_FIXED, so all this set of ANV_BO_ALLOC_WRITE_COMBINE
were useless.

In Xe KMD there is no way to change mmap mode for all GPUs types.

So we can nuke bo->map_wc, ANV_BO_ALLOC_WRITE_COMBINE and related
dead code.

No changes in behavior expected here.

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

14 months agoanv: Fix ANV_BO_ALLOC_NO_LOCAL_MEM flag
José Roberto de Souza [Thu, 27 Apr 2023 16:35:38 +0000 (09:35 -0700)]
anv: Fix ANV_BO_ALLOC_NO_LOCAL_MEM flag

VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT is also set in all memory types of
integrated GPUs.
This flag means that memory will be allocated in the most efficient
place for the GPU to access, which is true in integrated GPUs.

However, this was causing ANV_BO_ALLOC_WRITE_COMBINE to be set in
integrated GPUs in the block right below when allocating in the non-cached memory type.
But the comment only talks about lmem, so to still keep the write
combine behavior for iGPUs it was used VkMemoryPropertyFlags in mmap_calc_flags().

Additionally, this was causing anv_bo.has_implicit_ccs to always be
set, which could change the expected behavior of
anv_BindImageMemory2() in MTL.

Fixes: fbd32a04daf8 ("anv: add a third memory type for LLC configuration") added a new heap
Fixes: 582bf4d9f72f ("anv: flag BO for write combine when CPU visible and potentially in lmem")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22483>

14 months agoci/lava: Renable SSH sessions for panfrost jobs
Guilherme Gallo [Fri, 19 May 2023 14:18:00 +0000 (11:18 -0300)]
ci/lava: Renable SSH sessions for panfrost jobs

The devices' IP dictionary for sun50i and vim3 are fixed now.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23137>

14 months agofreedreno: Add some A6/7xx registers
Konrad Dybcio [Mon, 8 May 2023 13:01:37 +0000 (15:01 +0200)]
freedreno: Add some A6/7xx registers

Can be found in recent downstream kernels.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22901>

14 months agoanv: assume context isolation support
Lionel Landwerlin [Wed, 17 May 2023 14:04:19 +0000 (17:04 +0300)]
anv: assume context isolation support

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

14 months agoanv: defer binding table block allocation to when necessary
Lionel Landwerlin [Wed, 17 May 2023 12:48:55 +0000 (15:48 +0300)]
anv: defer binding table block allocation to when necessary

There are cases where we never need a binding table block, for example
compute only command buffers.

This has also the nice effect of not having
dEQP-VK.api.object_management.* tests allocate 1Gb of binding tables
which are staying around forever after you run those tests.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8806
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23079>

14 months agorusticl/types: fix clippy new() not returning Self
norablackcat [Fri, 19 May 2023 16:21:33 +0000 (10:21 -0600)]
rusticl/types: fix clippy new() not returning Self

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

14 months agorusticl/program: fix clippy cast to the same type
norablackcat [Fri, 19 May 2023 16:21:30 +0000 (10:21 -0600)]
rusticl/program: fix clippy cast to the same type

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

14 months agoCODEOWNERS: Update panfrost
Alyssa Rosenzweig [Thu, 18 May 2023 16:54:00 +0000 (12:54 -0400)]
CODEOWNERS: Update panfrost

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23109>

14 months agopan/decode: Use common hexdump
Alyssa Rosenzweig [Wed, 17 May 2023 21:30:33 +0000 (17:30 -0400)]
pan/decode: Use common hexdump

Deduplicate the one I took from asahi.

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

14 months agoasahi: Use common hexdump utility
Alyssa Rosenzweig [Wed, 17 May 2023 21:29:59 +0000 (17:29 -0400)]
asahi: Use common hexdump utility

We just moved it into common.

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

14 months agoutil: Add common hex dump utility
Alyssa Rosenzweig [Wed, 17 May 2023 21:29:44 +0000 (17:29 -0400)]
util: Add common hex dump utility

Useful for debugging.

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

14 months agodzn: Skip a few deqp tests which are prone to timeout
Guilherme Gallo [Fri, 19 May 2023 13:03:08 +0000 (10:03 -0300)]
dzn: Skip a few deqp tests which are prone to timeout

Some dozen-deqp tests have timed out in a different pipeline. You can
find more information at
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/42064254.

It appears that the execution of gstreamer on the same Windows runners
simultaneously is causing those particular tests to exceed their
allotted time and fail.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Force LAVA panfrost jobs to use UART
Guilherme Gallo [Thu, 18 May 2023 15:15:27 +0000 (12:15 -0300)]
ci/lava: Force LAVA panfrost jobs to use UART

To ensure proper SSH functioning, the device IP should be added to the
LAVA device dictionary by setting device_ip. LAVA will then map the
value to lava-target-ip.

meson-g12b-a311d-khadas-vim3-cbg-4 has an IP in the dictionary, while
sun50i-h6-pine-h64-cbg-1 and meson-g12b-a311d-khadas-vim3-cbg-2 do not.

Since some devices are not yet properly configured, and device tag
fixing is not an option here, let's temporarily switch to a job
definition based on UART, until it gets fixed.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Raise the post test metadata gathering retry count
Guilherme Gallo [Thu, 18 May 2023 11:44:25 +0000 (08:44 -0300)]
ci/lava: Raise the post test metadata gathering retry count

In some devices, it takes a few dozens of seconds to LAVA post process
the job and give final metadata related to the job.
It is worth to wait a little more (up to 30 sec) to make structured log
data more accurate.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Tweak http-download timeout in SSH based jobs
Guilherme Gallo [Thu, 18 May 2023 01:14:46 +0000 (22:14 -0300)]
ci/lava: Tweak http-download timeout in SSH based jobs

Found a problem with a radv-raven job [1], which took too long to boot
due to a possibly network problem.
If we set a reasonable timeout in the file download related action and
enable LAVA retries in deploy action, we can retry the job if it times
out without the need of re-queuing it.

[1] https://gitlab.freedesktop.org/gallo/mesa/-/jobs/41942090#L227

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Hide JWT block during YAML dump
Guilherme Gallo [Wed, 17 May 2023 04:12:28 +0000 (01:12 -0300)]
ci/lava: Hide JWT block during YAML dump

Make hide_sensitive_data work in a block fashion, not only hiding the
JWT line, since these tokens are huge, it may break the line when it
extrapolates the YAML dump width.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Only check for the first section marker
Guilherme Gallo [Fri, 28 Apr 2023 06:02:14 +0000 (03:02 -0300)]
ci/lava: Only check for the first section marker

Some LAVA signals have similar log outputs and the regex associated with
the log section may conflict. Use the policy of the first regex as the
chosen one, otherwise one line may produce two Gitlab sections in a row.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Distinguish test suites in DUT vs Docker
Guilherme Gallo [Thu, 27 Apr 2023 21:48:53 +0000 (18:48 -0300)]
ci/lava: Distinguish test suites in DUT vs Docker

Test suite in the dut is just running SSH server and waiting for the
docker container to start the SSH session. So it can take all the test
cases accumulated duration, not just the init-stage1.sh part anymore.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Add bridge function for job definition
Guilherme Gallo [Fri, 5 May 2023 11:57:32 +0000 (08:57 -0300)]
ci/lava: Add bridge function for job definition

To use the supported job definition depending on some Mesa CI job
characteristics.

The strategy here, is to use LAVA with a containerized SSH session to
follow the job output, escaping from dumping data to the UART, which
proves to be error prone in some devices.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Add SSH job definition
Guilherme Gallo [Tue, 25 Apr 2023 02:44:56 +0000 (23:44 -0300)]
ci/lava: Add SSH job definition

Create a separate job definition that runs the job via SSH session.
The DUT test only sets up the SSH server via dropbear, and another
deployed docker runner in LAVA dispatcher access the DUT via SSH with
pseudo-terminal to propagate the logs in real time.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Add SSH support in rootfs
Guilherme Gallo [Tue, 4 Apr 2023 01:05:21 +0000 (22:05 -0300)]
ci/lava: Add SSH support in rootfs

We need SSH servers running inside the DUTs to establish a new channel
of communication between LAVA dispatcher and the DUT, to be able to
workaround UART hanging issue that are occurring in some chromeos
devices.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci: Use absolute paths in init-stage2.sh
Guilherme Gallo [Thu, 27 Apr 2023 21:45:40 +0000 (18:45 -0300)]
ci: Use absolute paths in init-stage2.sh

Add absolute path for:
- zramctl, maybe `/sbin/` is not in the PATH
- intel-gpu-freq.sh, as this script CWD may be run outside `/`

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Fix last section in job submitter
Guilherme Gallo [Thu, 27 Apr 2023 21:47:24 +0000 (18:47 -0300)]
ci/lava: Fix last section in job submitter

It only happens after the LogFollower cleanup (__exit__ method)

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agoci/lava: Bypass arg list to print_log function
Guilherme Gallo [Mon, 15 May 2023 22:39:00 +0000 (19:39 -0300)]
ci/lava: Bypass arg list to print_log function

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22870>

14 months agomesa/program_cache: remove unused shader-cache functions
Erik Faye-Lund [Fri, 28 Apr 2023 09:04:32 +0000 (11:04 +0200)]
mesa/program_cache: remove unused shader-cache functions

These are no longer in use, so let's get rid of them.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agomesa/main: compile ff_fragment_shader as c-code
Erik Faye-Lund [Fri, 28 Apr 2023 09:21:30 +0000 (11:21 +0200)]
mesa/main: compile ff_fragment_shader as c-code

The reason this used to be C++ code, was because it needed ir_builder.
We no longer need that, so let's move this to C-code instead. This makes
some details a bit more straight-forward.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agomesa/main: ff-fragshader to nir
Erik Faye-Lund [Tue, 18 Apr 2023 20:05:28 +0000 (22:05 +0200)]
mesa/main: ff-fragshader to nir

There's little point in emitting GLSL IR for the fixed-function fragment
shaders, when we can emit NIR directly instead.

This simplifies things a bit, and makes the fixed-function vertex and
fragment shaders look a lot more alike.

The reason the old code did the splats, was that TEXENV_SRC_ZERO and
TEXENV_SRC_ONE returned scalars. I decided to keep it vector, and let
the nir optimization passes clean this up instead when needed, as that
keeps the code a bit more straight forward.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agocompiler/nir: move find_state_var to common code
Erik Faye-Lund [Thu, 4 May 2023 06:20:41 +0000 (08:20 +0200)]
compiler/nir: move find_state_var to common code

We're about to need this in another place, so let's move it to common
nir code, and clean up the name a bit.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agomesa/st: allow using nir for ff-fragment shaders
Erik Faye-Lund [Tue, 18 Apr 2023 20:05:28 +0000 (22:05 +0200)]
mesa/st: allow using nir for ff-fragment shaders

This is similar to what we do for ff-vertex shaders.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agomesa/st: refactor st_translate_fragment_program
Erik Faye-Lund [Fri, 28 Apr 2023 10:58:26 +0000 (12:58 +0200)]
mesa/st: refactor st_translate_fragment_program

This makes it look more like st_translate_vertex_program, which is doing
the same thing for vertex-shaders.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agomesa/main: clean up white-space in ff_fragment_shader.cpp
Erik Faye-Lund [Mon, 17 Apr 2023 21:47:23 +0000 (23:47 +0200)]
mesa/main: clean up white-space in ff_fragment_shader.cpp

We're about to change this, so let's clean this up first!

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22755>

14 months agomeson: remove needless c++17-overrides
Erik Faye-Lund [Tue, 16 May 2023 09:15:32 +0000 (11:15 +0200)]
meson: remove needless c++17-overrides

C++17 is the project-wide default since f9057cea517 ("fix(FTBFS):
meson: raise C++ standard to C++17"), so let's drop these local
overrides.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23048>

14 months agopvr: fix array overflow in pvr_device_tile_buffer_ensure_cap()
Frank Binns [Wed, 17 May 2023 14:53:32 +0000 (15:53 +0100)]
pvr: fix array overflow in pvr_device_tile_buffer_ensure_cap()

The function didn't properly handle the case where the requested capacity was
less than the existing capacity. This led to the loop limit being some huge
number and it writing past the end of the 'buffers' array.

Partially fixes:
  dEQP-VK.renderpass.suballocation.multisample_resolve.r16g16b16a16_unorm
    .max_attachments_8_samples_2

The test no longer hangs, but segfaults instead.

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

14 months agoradv: reserve cmdbuf space in radv_flush_gfx2ace_semaphore()
Samuel Pitoiset [Tue, 16 May 2023 12:38:55 +0000 (14:38 +0200)]
radv: reserve cmdbuf space in radv_flush_gfx2ace_semaphore()

Fixes an assertion with test_amplification_shader in vkd3d-proton.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23057>

14 months agoci: rework vkd3d-proton runner and fix detecting failures
Samuel Pitoiset [Tue, 16 May 2023 11:37:41 +0000 (13:37 +0200)]
ci: rework vkd3d-proton runner and fix detecting failures

The script returned 0 (aka succcess) for assertions or segmentation
faults. Found this after introducing a regression that caused a
segfault in vkd3d with vk-cts-image but not with Mesa CI.

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

14 months agoci: stop using the hang-detection tool for vkd3d-proton
Samuel Pitoiset [Tue, 16 May 2023 12:53:19 +0000 (14:53 +0200)]
ci: stop using the hang-detection tool for vkd3d-proton

It's no longer used for deqp-runner as well, and it's not really
useful for us because we can detect GPU hangs differently. It also
prevents returning the error code from vkd3d-proton.

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

14 months agoci,radv: use drm-shim instead of the null winsys for radv-fossils
Samuel Pitoiset [Wed, 17 May 2023 06:39:23 +0000 (08:39 +0200)]
ci,radv: use drm-shim instead of the null winsys for radv-fossils

Only RADV uses fossilize-runner.sh, so hardcoding LD_PRELOAD is fine.

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

14 months agoci: build drm-shim in debian-testing
Samuel Pitoiset [Wed, 17 May 2023 07:30:48 +0000 (09:30 +0200)]
ci: build drm-shim in debian-testing

This will be needed by RADV for using AMDGPU drm-shim.

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

14 months agoamd/drm-shim: update README about which file to modify
Samuel Pitoiset [Wed, 17 May 2023 07:53:48 +0000 (09:53 +0200)]
amd/drm-shim: update README about which file to modify

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

14 months agoamd/drm-shim: add bonaire
Samuel Pitoiset [Wed, 17 May 2023 08:13:14 +0000 (10:13 +0200)]
amd/drm-shim: add bonaire

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

14 months agoamd/drm-shim: add pitcairn
Samuel Pitoiset [Wed, 17 May 2023 08:06:22 +0000 (10:06 +0200)]
amd/drm-shim: add pitcairn

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

14 months agoamd/drm-shim: add navi21
Samuel Pitoiset [Wed, 17 May 2023 07:52:35 +0000 (09:52 +0200)]
amd/drm-shim: add navi21

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

14 months agoanv/ci: Add tests for video formats to the failing tests.
Hyunjun Ko [Tue, 16 May 2023 08:45:03 +0000 (17:45 +0900)]
anv/ci: Add tests for video formats to the failing tests.

This should be removed once the issue is resolved.
(https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/4280)

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22202>

14 months agoanv: enable the video h265 decode extension.
Hyunjun Ko [Thu, 30 Mar 2023 07:42:02 +0000 (16:42 +0900)]
anv: enable the video h265 decode extension.

Currently tested on CometLake(gen9) and AlderLake(gen12)

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22202>

14 months agoanv: support HEVC 10-bit decoding
Hyunjun Ko [Mon, 15 May 2023 08:40:15 +0000 (17:40 +0900)]
anv: support HEVC 10-bit decoding

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22202>

14 months agoanv/image: get width/height for each plane of a surface for video decoding.
Hyunjun Ko [Tue, 11 Apr 2023 01:39:53 +0000 (10:39 +0900)]
anv/image: get width/height for each plane of a surface for video decoding.

This is especially for p010 format, which isn't supported for YCbCr
conversion yet.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22202>

14 months agoanv: support P010 format for video 10-bit hevc decoding
Hyunjun Ko [Fri, 7 Apr 2023 01:26:12 +0000 (10:26 +0900)]
anv: support P010 format for video 10-bit hevc decoding

Only for video 10-bit hevc decoding, so shouldn't enable such as YCbCr
conversion.

v1. Fix to avoid YCbCr CTS tests for this format.
( Lionel Landwerlin <lionel.g.landwerlin@intel.com> )

v2. Add a flag can_video so we could handle supported video formats
neatly.
( Lionel Landwerlin <lionel.g.landwerlin@intel.com> )

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22202>

14 months agoanv: add initial video decode support for h265
Hyunjun Ko [Thu, 30 Mar 2023 06:56:08 +0000 (15:56 +0900)]
anv: add initial video decode support for h265

Tested on CometLake(gen9) and AlderLake(gen12)

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22202>