platform/upstream/mesa.git
11 months agopanfrost: Add missing inline
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:43:32 +0000 (10:43 -0400)]
panfrost: Add missing inline

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

11 months agopanfrost: Only define pan_blitter_get_blend_shaders for midgard
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:42:03 +0000 (10:42 -0400)]
panfrost: Only define pan_blitter_get_blend_shaders for midgard

Unused otherwise, responds to a -Wunused-function warning.

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

11 months agopanfrost: Drop unused decode_position for samples
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:40:59 +0000 (10:40 -0400)]
panfrost: Drop unused decode_position for samples

There's a Gallium helper for this now.

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

11 months agopan/mdg: Add missing static inline annotation
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:40:32 +0000 (10:40 -0400)]
pan/mdg: Add missing static inline annotation

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

11 months agopan/decode: Drop unused debug function
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:40:23 +0000 (10:40 -0400)]
pan/decode: Drop unused debug function

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

11 months agopanfrost: Add missing static inline annotation
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:40:11 +0000 (10:40 -0400)]
panfrost: Add missing static inline annotation

Quiets -Wunused-function

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

11 months agonir/passthrough_gs: Drop unused array_size_for_prim
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:45:28 +0000 (10:45 -0400)]
nir/passthrough_gs: Drop unused array_size_for_prim

../src/compiler/nir/nir_passthrough_gs.c:96:1: warning: ‘array_size_for_prim’ defined but not used [-Wunused-function]
   96 | array_size_for_prim(enum mesa_prim prim)

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

11 months agonir/loop_analyze: Drop unused inverse_comparison
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:45:12 +0000 (10:45 -0400)]
nir/loop_analyze: Drop unused inverse_comparison

../src/compiler/nir/nir_loop_analyze.c:1134:1: warning: ‘inverse_comparison’ defined but not used [-Wunused-function]
 1134 | inverse_comparison(nir_op alu_op)

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

11 months agogallium/u_transfer_helper: Remove dead forward decl
Alyssa Rosenzweig [Tue, 1 Aug 2023 14:42:54 +0000 (10:42 -0400)]
gallium/u_transfer_helper: Remove dead forward decl

Doesn't point to anything.

../src/gallium/auxiliary/util/u_transfer_helper.c:255:1: warning: ‘u_transfer_helper_deinterleave_transfer_map’ declared ‘static’ but never defined [-Wunused-function]
  255 | u_transfer_helper_deinterleave_transfer_map(struct pipe_context *pctx,

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

11 months agoiris: Sample more texture view fast-clears on gfx11+
Nanley Chery [Tue, 9 May 2023 00:48:22 +0000 (17:48 -0700)]
iris: Sample more texture view fast-clears on gfx11+

On platforms with an indirect clear color BO, the clear color used when
sampling is in the form of a pixel. The sampler can interpret the pixel
correctly regardless of the format, so allow fast clears in more cases
within iris_resource_prepare_texture.

On gfx12, this completely removes partial resolves in a couple game
traces I tested:

   - 72 partial resolves in a 500 frame trace of CS:GO.
   - 1207 partial resolves in a 500 frame trace of Dota 2.

The resolves were triggered when ISL_FORMAT_A8_UNORM surfaces were
sampled as ISL_FORMAT_R8_UNORM.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24323>

11 months agoanv: Return earlier in anv_reloc_list functions
José Roberto de Souza [Mon, 31 Jul 2023 18:29:14 +0000 (11:29 -0700)]
anv: Return earlier in anv_reloc_list functions

Xe KMD don't need relocs, so calling a nop function and avoiding the
CPU cycles and memory waste with reloc.

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

11 months agoanv: Remove VkAllocationCallbacks parameter from reloc functions
José Roberto de Souza [Mon, 31 Jul 2023 18:13:04 +0000 (11:13 -0700)]
anv: Remove VkAllocationCallbacks parameter from reloc functions

Mismatch allocator could cause bad things, so better set the allocator
on anv_reloc_list_init() and use it in every reloc function.

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

11 months agoanv: Nuke unused READ_ONCE() from anv_batch_chain.c
José Roberto de Souza [Mon, 31 Jul 2023 18:53:48 +0000 (11:53 -0700)]
anv: Nuke unused READ_ONCE() from anv_batch_chain.c

Only genX_cmd_buffer.c makes use of READ_ONCE() but that file also
defines it so it can be removed from anv_batch_chain.c.

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

11 months agoci/amd: Skip VAAPI CreateSurfacesWithConfigAttribs/1121 test
David Rosca [Tue, 1 Aug 2023 12:50:20 +0000 (14:50 +0200)]
ci/amd: Skip VAAPI CreateSurfacesWithConfigAttribs/1121 test

It now times out with surfaces being allocated non-interlaced
by default due to a slower path being taken in clear_render_target.

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

11 months agoradeonsi: Don't prefer interlaced for video decode
David Rosca [Fri, 28 Jul 2023 07:40:07 +0000 (09:40 +0200)]
radeonsi: Don't prefer interlaced for video decode

Preferring interlaced results in all surfaces being allocated
as interlaced for H264 decode regardless of whether the decoded
pic is interlaced or progressive, which makes VA postproc
apply deinterlacing even for progressive pics.

Deinterlacing interlaced pics still works because VA frontend
will now reallocate surface as interlaced when decoding interlaced
pics.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>

11 months agofrontends/vdpau: Alloc interlaced surface for interlaced pics
David Rosca [Fri, 28 Jul 2023 16:14:10 +0000 (18:14 +0200)]
frontends/vdpau: Alloc interlaced surface for interlaced pics

When decoding interlaced pics, the output surface should
also be allocated as interlaced to make the deinterlace
postproc filter work correctly.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>

11 months agofrontends/va: Alloc interlaced surface for interlaced pics
David Rosca [Fri, 28 Jul 2023 07:25:00 +0000 (09:25 +0200)]
frontends/va: Alloc interlaced surface for interlaced pics

When decoding interlaced pics, the output surface should
also be allocated as interlaced to make the deinterlace
postproc filter work correctly.

This makes deinterlacing work for drivers that supports, but
not prefers, interlaced surfaces.

Use extra buffer instead of reallocating as non-interlaced
when exporting interlaced surfaces.

v2: Avoid reallocating in vlVaExportSurfaceHandle

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>

11 months agomesa/main: allow readpix/teximage to read from implicitly multisampled fbos
Italo Nicola [Tue, 21 Feb 2023 16:32:03 +0000 (16:32 +0000)]
mesa/main: allow readpix/teximage to read from implicitly multisampled fbos

The GL_EXT_multisampled_render_to_texture spec explicitly allow reading
from these FBOs.

"Similarly, for ReadPixels:
 'An INVALID_OPERATION error is generated if the value of READ_-
FRAMEBUFFER_BINDING (see section 9) is non-zero, the read framebuffer is
framebuffer complete, and the value of SAMPLE_BUFFERS for the read
framebuffer is one.'

 These errors do not apply to textures and renderbuffers that have
associated multisample data specified by the mechanisms described in
this extension, i.e., the above operations are allowed even when
SAMPLE_BUFFERS is non-zero for renderbuffers created via Renderbuffer-
StorageMultisampleEXT or textures attached via FramebufferTexture2D-
MultisampleEXT."

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10747>

11 months agomesa/main: account for RTT samples when updating framebuffer
Italo Nicola [Fri, 14 May 2021 11:25:42 +0000 (11:25 +0000)]
mesa/main: account for RTT samples when updating framebuffer

For EXT_multisampled_render_to_texture, we store the number of samples
in Attachment->NumSamples instead of Renderbuffer->NumSamples. This
meant that the previous code ignored that the framebuffer was
multisampled. Because of this, pipe_rasterizer_state::multisample is set
incorrectly, leading to visual artifacts on drivers that support MS-RTT
extension, such as panfrost.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10747>

11 months agogallium: bump PIPE_MAX_SO_OUTPUTS to 128
Mike Blumenkrantz [Fri, 21 Jul 2023 16:48:19 +0000 (12:48 -0400)]
gallium: bump PIPE_MAX_SO_OUTPUTS to 128

this is the number of components supported for streamout

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

11 months agoir3: bump max xfb output to 128
Mike Blumenkrantz [Fri, 21 Jul 2023 16:48:19 +0000 (12:48 -0400)]
ir3: bump max xfb output to 128

this is the number of components supported for streamout

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24285>

11 months agoradv: bump max xfb output to 128
Mike Blumenkrantz [Fri, 21 Jul 2023 16:48:19 +0000 (12:48 -0400)]
radv: bump max xfb output to 128

this is the number of components supported for streamout

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

11 months agozink: Hash only first 32 bits of zink_gfx_pipeline_state with full DS3
jazzfool [Tue, 1 Aug 2023 15:24:36 +0000 (01:24 +1000)]
zink: Hash only first 32 bits of zink_gfx_pipeline_state with full DS3

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8245
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24430>

11 months agointel/genxml/gen125: Set MI_MATH MOCS field as non-zero
José Roberto de Souza [Mon, 17 Apr 2023 17:10:37 +0000 (10:10 -0700)]
intel/genxml/gen125: Set MI_MATH MOCS field as non-zero

All MOCS tables have 0 as a invalid value, so this will asssert
in case some place misset to set MI_MATH MOCS field.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>

11 months agointel/tests/mi_builder: Set MI_MATH MOCS field
José Roberto de Souza [Mon, 17 Jul 2023 21:15:39 +0000 (14:15 -0700)]
intel/tests/mi_builder: Set MI_MATH MOCS field

MOCS = 0 is a invalid MOCS index on MTL, so it is necessary get a
valid value and set to MI_MATH instructions.

So here the mocs index is set with mi_builder_set_mocs(), it can be
always set but it is required when mi_build will emit MI_MATH
instructions.
The mocs index will only be stored and used in gfx12.5+ platforms
so no changes were are required in crocus or hasvk.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>

11 months agoanv: Set MI_MATH MOCS field
José Roberto de Souza [Mon, 17 Jul 2023 21:14:38 +0000 (14:14 -0700)]
anv: Set MI_MATH MOCS field

MOCS = 0 is a invalid MOCS index, so it is necessary get a valid value
and set to MI_MATH instructions.

So here the mocs index is set with mi_builder_set_mocs(), it can be
always set but it is required when mi_build will emit MI_MATH
instructions.
The mocs index will only be stored and used in gfx12.5+ platforms
so no changes were are required in crocus or hasvk.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>

11 months agoiris: Set MI_MATH MOCS field
José Roberto de Souza [Mon, 17 Jul 2023 21:06:22 +0000 (14:06 -0700)]
iris: Set MI_MATH MOCS field

MOCS = 0 is a invalid MOCS index on MTL, so it is necessary get a
valid value and set to MI_MATH instructions.

So here the mocs index is set with mi_builder_set_mocs(), it can be
always set but it is required when mi_build will emit MI_MATH
instructions.
The mocs index will only be stored and used in gfx12.5+ platforms
so no changes were are required in crocus or hasvk.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>

11 months agointel/genxml/gen125: Add missing fields in MI_MATH
José Roberto de Souza [Fri, 14 Apr 2023 18:03:19 +0000 (11:03 -0700)]
intel/genxml/gen125: Add missing fields in MI_MATH

BSpec: 53415
BSpec: 45737
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>

11 months agoanv: Use the common versions of vkBegin/EndQuery()
Faith Ekstrand [Mon, 31 Jul 2023 16:31:24 +0000 (11:31 -0500)]
anv: Use the common versions of vkBegin/EndQuery()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>

11 months agoanv: Use vk_query_pool
Faith Ekstrand [Mon, 31 Jul 2023 16:30:37 +0000 (11:30 -0500)]
anv: Use vk_query_pool

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>

11 months agovulkan: Add init/finish helpers for vk_query_pool
Faith Ekstrand [Mon, 31 Jul 2023 16:24:03 +0000 (11:24 -0500)]
vulkan: Add init/finish helpers for vk_query_pool

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>

11 months agoanv: Use vk_buffer_view
Faith Ekstrand [Mon, 31 Jul 2023 16:15:29 +0000 (11:15 -0500)]
anv: Use vk_buffer_view

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>

11 months agoanv: Use vk_sampler
Faith Ekstrand [Mon, 31 Jul 2023 16:09:48 +0000 (11:09 -0500)]
anv: Use vk_sampler

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>

11 months agonv/codegen: Implement nir_op_fquantize2f16
M Henning [Fri, 21 Jul 2023 02:54:52 +0000 (22:54 -0400)]
nv/codegen: Implement nir_op_fquantize2f16

Passes most of dEQP-VK.spirv_assembly.instruction.graphics.opquantize.* but
not the too_small_* tests for some reason. (Tested on kepler.)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonv50/ir: Run nir_divergence_analysis before out-of-SSA
Faith Ekstrand [Sat, 15 Jul 2023 05:08:54 +0000 (00:08 -0500)]
nv50/ir: Run nir_divergence_analysis before out-of-SSA

We don't actually use or need this information but it gets generated by
nir_opt_non_uniform_access() and stale divergence information can cause
out-of-SSA to assert in parallel copy lowering.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Add capability to pre-specify tessellation domain
George Ouzounoudis [Mon, 24 Oct 2022 17:02:02 +0000 (20:02 +0300)]
nouveau/codegen: Add capability to pre-specify tessellation domain

In the case of SPIRV tessellation shaders, the execution mode can be
specified in the tessellation control shader. So we need a way to know the domain
when compiling the tessellation evaluation shader.

Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Fix compact patch varyings in case of NIR
George Ouzounoudis [Fri, 14 Apr 2023 12:14:37 +0000 (15:14 +0300)]
nouveau/codegen: Fix compact patch varyings in case of NIR

The code path was not implemented and an assert was reached.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Don't convertSurfaceFormat for unknown formats
Faith Ekstrand [Wed, 3 May 2023 23:13:55 +0000 (18:13 -0500)]
nouveau/codegen: Don't convertSurfaceFormat for unknown formats

Without this and the previous patch, it would see PIPE_FORMAT_NONE as a
zero-component format and delete the whole load.

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

11 months agonouveau/codegen: Use a NULL format for PIPE_FORMAT_NONE for images
Faith Ekstrand [Wed, 3 May 2023 23:10:41 +0000 (18:10 -0500)]
nouveau/codegen: Use a NULL format for PIPE_FORMAT_NONE for images

Get rid of our own FMT_NONE and just use a NULL format in that case.
We're already checking su->tex.format != NULL in a bunch of cases but
none of those NULL checks are doing anything right now execpt detecting
when its an actual texture op and not an image op.  We'd like them to
start also applying for image load/store with an unspecified format.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Handle nir op amul
George Ouzounoudis [Sun, 27 Nov 2022 12:49:04 +0000 (14:49 +0200)]
nouveau/codegen: Handle nir op amul

This came from CTS clipping tests with geometry shaders.  Maybe can be
done as a lowering operation instead.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Support compact clip distances with arrayed_io
George Ouzounoudis [Fri, 6 Jan 2023 00:21:38 +0000 (18:21 -0600)]
nouveau/codegen: Support compact clip distances with arrayed_io

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Set lower_device_index_to_zero
Rebecca Mckeever [Fri, 9 Dec 2022 22:30:45 +0000 (16:30 -0600)]
nouveau/codegen: Set lower_device_index_to_zero

This instructs NIR to lower DeviceIndex to zero, which is needed
for a no-op implementation of VK_KHR_device_group.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Support nir_intrinsic_load_workgroup_id_zero_base
Rebecca Mckeever [Fri, 9 Dec 2022 22:29:18 +0000 (16:29 -0600)]
nouveau/codegen: Support nir_intrinsic_load_workgroup_id_zero_base

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonouveau/codegen: Handle/indirect goes before sample index
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nouveau/codegen: Handle/indirect goes before sample index

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

11 months agonouveau/nir: Implement support for compact arrays
Faith Ekstrand [Tue, 31 Jan 2023 02:11:56 +0000 (20:11 -0600)]
nouveau/nir: Implement support for compact arrays

This is needed for clip and cull distances.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonv/codegen: Call nir_shader_gather_info
M Henning [Sat, 29 Jul 2023 16:25:05 +0000 (12:25 -0400)]
nv/codegen: Call nir_shader_gather_info

We need this info to be up-to-date for slot assignment.

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

11 months agonouveau: Allow GLSL_SAMPLER_DIM_SUBPASS*
Faith Ekstrand [Tue, 31 Jan 2023 02:11:55 +0000 (20:11 -0600)]
nouveau: Allow GLSL_SAMPLER_DIM_SUBPASS*

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agonv50/nir: Lower to scratch AFTER optimization
Faith Ekstrand [Tue, 31 Jan 2023 02:11:53 +0000 (20:11 -0600)]
nv50/nir: Lower to scratch AFTER optimization

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

11 months agolima/gpir: switch to register intrinsics
Erico Nunes [Wed, 19 Jul 2023 23:19:25 +0000 (01:19 +0200)]
lima/gpir: switch to register intrinsics

gp has explicit load and store reg instructions so it can implement
the new nir_intrinsic_{decl,load,store}_reg intrinsics.
The implementation reuses the gpir_node_find and register_node functions
instead of just emitting load and store instructions in order to
preserve the behavior that there will never be a store_reg followed by
a load_reg of the same register in the same block.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>

11 months agolima/ppir: convert to nir_legacy
Erico Nunes [Tue, 18 Jul 2023 19:35:08 +0000 (21:35 +0200)]
lima/ppir: convert to nir_legacy

With the upcoming transition away from nir_register and modifiers in
nir, ppir needs to prepare for those features to be removed.
The most straightforward way for ppir without major reworks at this time
is to use the new nir_legacy helpers so that most of the backend can be
kept untouched (particularly due to use of abs/neg/sat modifiers).
Do this for now to unblock the transition with little impact; ppir can
be optimized at a later moment to have its own passes which will allow
it to drop the nir_legacy use and use just the chasing helpers.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>

11 months agolima/ppir: don't optimize loads with different block successors
Erico Nunes [Sun, 30 Jul 2023 17:12:53 +0000 (19:12 +0200)]
lima/ppir: don't optimize loads with different block successors

Even if loads are initially duplicated for each user, with new
optimizations such as folding modifiers, it may happen that loads
end up with only users in different blocks.
Handle that and don't delete or pipeline those nodes.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>

11 months agoRevert "ci: Disable nouveau CI"
Emma Anholt [Tue, 1 Aug 2023 14:25:29 +0000 (07:25 -0700)]
Revert "ci: Disable nouveau CI"

This reverts commit 1440a0f95bede8c77ba842273cf8264dd2dc6a47.

runner got wedged, it's back up now.

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

11 months agoaco: fix non constant 16bit bitnz/bitz
Georg Lehmann [Tue, 1 Aug 2023 08:21:50 +0000 (10:21 +0200)]
aco: fix non constant 16bit bitnz/bitz

Fixes: 573e98f34ac ("aco: implement nir_op_bitz/bitnz")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24420>

11 months agofrontends/va: Also map VAImageBufferType for reading
David Rosca [Sun, 30 Jul 2023 12:06:11 +0000 (14:06 +0200)]
frontends/va: Also map VAImageBufferType for reading

VAImageBufferType can be used for both reading and writing,
so map it as such.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24390>

11 months agomesa: Implement and advertise GL_MESA_sampler_objects
Adam Jackson [Thu, 14 Nov 2019 17:46:13 +0000 (12:46 -0500)]
mesa: Implement and advertise GL_MESA_sampler_objects

This is the GLES3 sampler object API trivially backported to GLES2,
because it allows for simpler/better support in glamor and mutter.

The only code change we need is adding these to the generated dispatch
tables for ES2 contexts. The interactions with EXT_shadow_samplers,
EXT_texture_filter_anisotropic and EXT_texture_sRGB_decode are already
in place before this change, and OES_texture_border_clamp is always
supported in Mesa.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2440>

11 months agogallium/u_simple_shaders: Optimize out ffloors
Alyssa Rosenzweig [Sat, 29 Jul 2023 22:49:41 +0000 (18:49 -0400)]
gallium/u_simple_shaders: Optimize out ffloors

ffloor(f2i(x)) can't be optimized to f2i(x) due to differing behaviour for
negative x, but u_blitter only uses this with nonnegative x so we can instead
use ftrunc(f2i(x)) which NIR will optimize to f2i(x) for us. This gets rid of
the silly ffloor instructions in blit shaders.

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

11 months agonir/schedule: Assume no old-style registers
Alyssa Rosenzweig [Tue, 25 Jul 2023 16:57:32 +0000 (12:57 -0400)]
nir/schedule: Assume no old-style registers

True for all users. I intentionally didn't add is_ssa asserts because they're
pointless and will be deleted, like, next week and will just make that churn
even more annoying.

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

11 months agorusticl/nir: use the new nir_pass macro
Karol Herbst [Tue, 21 Feb 2023 15:53:15 +0000 (16:53 +0100)]
rusticl/nir: use the new nir_pass macro

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>

11 months agorusticl/nir: add a nir_pass macro
Karol Herbst [Tue, 21 Feb 2023 15:52:44 +0000 (16:52 +0100)]
rusticl/nir: add a nir_pass macro

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>

11 months agorusticl/nir: add helper functions we need for a NIR_PASS macro
Karol Herbst [Tue, 21 Feb 2023 15:52:23 +0000 (16:52 +0100)]
rusticl/nir: add helper functions we need for a NIR_PASS macro

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>

11 months agomeson,ci: bump meson req for rusticl to 1.2
Karol Herbst [Mon, 24 Apr 2023 11:23:05 +0000 (13:23 +0200)]
meson,ci: bump meson req for rusticl to 1.2

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>

11 months agozink: Removes `disable_xcb_surface`
Igor Torrente [Wed, 19 Jul 2023 12:48:04 +0000 (09:48 -0300)]
zink: Removes `disable_xcb_surface`

This dri config is no longer necessary since the case where it was
required is being handled in the previous commit.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24222>

11 months agozink: Fix enumerate devices when running compositor
Igor Torrente [Thu, 6 Jul 2023 20:35:29 +0000 (17:35 -0300)]
zink: Fix enumerate devices when running compositor

When we try to run a compositor on top of Zink, we hit a lockup
when enumerating the Vulkan devices. The vulkan_device_select
tries to reorder the devices and gets stuck waiting for the Xserver.

With this patch, we avoid this issue by detecting when we are running
a compositor and disabling the X and Wayland instance extensions.

And code is added to try to pick the same device as the display.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24222>

11 months agoegl: Always set _EGLDisplay->Device during eglGetPlatformDisplay()
Robert Foss [Mon, 31 Jul 2023 14:45:39 +0000 (16:45 +0200)]
egl: Always set _EGLDisplay->Device during eglGetPlatformDisplay()

Make sure that all platform specific implementations of
eglGetPlatformDisplay() overwrite the Device field.

Fixes: c237539d621 ("egl: Implement EGL_EXT_explicit_device")

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24394>

11 months agoegl: Fix attrib_list[0] == EGL_NONE check
Robert Foss [Mon, 31 Jul 2023 09:40:23 +0000 (11:40 +0200)]
egl: Fix attrib_list[0] == EGL_NONE check

_eglGetSurfacelessDisplay(), _eglGetWaylandDisplay() and
_eglGetGbmDisplay() handle the attrib_list[0] == EGL_NONE
case incorrectly by returning an EGL_BAD_ATTRIBUTE error.

Fix this bug, and switch the functions to use switch/case
in order to have the same structure as the sibling
_eglGetXXXDisplay() functions which support multiple attributes.

Fixes: c237539d621 ("egl: Implement EGL_EXT_explicit_device")

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24394>

11 months agoci: Disable nouveau CI
Daniel Stone [Tue, 1 Aug 2023 10:53:27 +0000 (11:53 +0100)]
ci: Disable nouveau CI

It's offline.

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

11 months agorusticl/kernel: only handle function_temp memory before lowering printf
Karol Herbst [Mon, 31 Jul 2023 10:19:22 +0000 (12:19 +0200)]
rusticl/kernel: only handle function_temp memory before lowering printf

There was no need to handle the other variable modes. This also fixes
double accounting of shared memory.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9058
Fixes: 5795ee0e083 ("rusticl: translate spirv to nir and first steps to kernel arg handling")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24398>

11 months agoturnip: Use common nir_vk_is_not_xfb_output
Danylo Piliaiev [Tue, 25 Jul 2023 15:34:55 +0000 (17:34 +0200)]
turnip: Use common nir_vk_is_not_xfb_output

On a7xx fixes:
 dEQP-VK.rasterization.provoking_vertex.transform_feedback.*

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

11 months agoradv: Use common nir_vk_is_not_xfb_output
Danylo Piliaiev [Tue, 25 Jul 2023 15:33:40 +0000 (17:33 +0200)]
radv: Use common nir_vk_is_not_xfb_output

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

11 months agovulkan/nir: Add common helper to check if output is XFB
Danylo Piliaiev [Tue, 25 Jul 2023 15:10:21 +0000 (17:10 +0200)]
vulkan/nir: Add common helper to check if output is XFB

It was not taken into account that without Offset decoration
the output is not written into XFB.

Aside from eliminating more outputs this change prevents gl_PerVertex
builtins generated by glslang from being kept alive in case when XFB
is enabled. Keeping such outputs alive may upset a driver.

VUID-StandaloneSpirv-Offset-04716:
    "Only variables or block members in the output interface decorated
    with Offset can be captured for transform feedback, and those
    variables or block members must also be decorated with XfbBuffer
    and XfbStride, or inherit XfbBuffer and XfbStride decorations from
    a block containing them"

Additional info about glslang behavior could be found at:
 https://github.com/KhronosGroup/glslang/issues/1526

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

11 months agoradv: fix unused non-xfb shader outputs not being removed
Danylo Piliaiev [Thu, 27 Jul 2023 12:38:43 +0000 (14:38 +0200)]
radv: fix unused non-xfb shader outputs not being removed

It was not taken into account that without Offset decoration
the output is not written into XFB.

Aside from eliminating more outputs this change prevents gl_PerVertex
builtins generated by glslang from being kept alive in case when XFB
is enabled. Keeping such outputs alive may upset a driver.

VUID-StandaloneSpirv-Offset-04716:
    "Only variables or block members in the output interface decorated
    with Offset can be captured for transform feedback, and those
    variables or block members must also be decorated with XfbBuffer
    and XfbStride, or inherit XfbBuffer and XfbStride decorations from
    a block containing them"

Additional info about glslang behavior could be found at:
 https://github.com/KhronosGroup/glslang/issues/1526

Fixes: e95531e101f0ba61d28195fe38414e411bf418b3
("radv: fix gathering XFB info if there is dead outputs")

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

11 months agoaco/gfx11: use v_cmp_class_f16 with opsel for bitnz/bitz
Georg Lehmann [Tue, 25 Jul 2023 18:01:40 +0000 (20:01 +0200)]
aco/gfx11: use v_cmp_class_f16 with opsel for bitnz/bitz

Foz-DB GFX11:
Totals from 1607 (1.21% of 132657) affected shaders:
MaxWaves: 36511 -> 36513 (+0.01%)
Instrs: 2412601 -> 2408770 (-0.16%); split: -0.16%, +0.00%
CodeSize: 12434716 -> 12414536 (-0.16%); split: -0.17%, +0.00%
VGPRs: 108872 -> 108860 (-0.01%)
Latency: 27555570 -> 27541897 (-0.05%); split: -0.05%, +0.00%
InvThroughput: 3144382 -> 3140929 (-0.11%); split: -0.11%, +0.00%
SClause: 65762 -> 65770 (+0.01%)
Copies: 127148 -> 127170 (+0.02%); split: -0.06%, +0.08%
PreVGPRs: 96737 -> 96447 (-0.30%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24380>

11 months agoaco: combine a & ~b to bfi(b, 0, a)
Georg Lehmann [Sat, 29 Jul 2023 16:47:04 +0000 (18:47 +0200)]
aco: combine a & ~b to bfi(b, 0, a)

Foz-DB Navi21:
Totals from 905 (0.68% of 132657) affected shaders:
Instrs: 1223583 -> 1221016 (-0.21%); split: -0.22%, +0.01%
CodeSize: 6567272 -> 6567064 (-0.00%); split: -0.04%, +0.03%
SpillSGPRs: 1231 -> 1223 (-0.65%)
SpillVGPRs: 829 -> 823 (-0.72%); split: -1.45%, +0.72%
Latency: 40952209 -> 40946230 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 9411929 -> 9397932 (-0.15%); split: -0.17%, +0.02%
VClause: 29108 -> 29112 (+0.01%); split: -0.04%, +0.05%
Copies: 105272 -> 105221 (-0.05%); split: -0.28%, +0.23%
Branches: 29330 -> 29329 (-0.00%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24383>

11 months agoclang-format: Ignore original panfrost commit
Alyssa Rosenzweig [Mon, 31 Jul 2023 15:35:05 +0000 (11:35 -0400)]
clang-format: Ignore original panfrost commit

Blame better.

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

11 months agoradv: correctly skip MRT output NaN fixup for meta shaders
Rhys Perry [Thu, 27 Jul 2023 17:07:46 +0000 (18:07 +0100)]
radv: correctly skip MRT output NaN fixup for meta shaders

radv_nir_compiler_options::enable_mrt_output_nan_fixup is only used for
epilogs, these days.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 290c3d360e5a ("aco,radv: lower outputs to exports when nir for monolithic ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9414
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24352>

11 months agovulkan: Add a core vk_sampler struct
Faith Ekstrand [Wed, 26 Jul 2023 16:11:48 +0000 (11:11 -0500)]
vulkan: Add a core vk_sampler struct

Unlike some other core structs, I didn't bother to copy the entire
VkSamplerCreateInfo into the sampler.  There isn't typcially a lot of
pre-processing we can or need to do here and we may as well keep the
struct small for now.  It does, however, handle most things involving
chain-in structs.

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

11 months agovulkan/format: Add the remaining 1-plane YCbCr formats
Faith Ekstrand [Thu, 27 Jul 2023 16:20:13 +0000 (11:20 -0500)]
vulkan/format: Add the remaining 1-plane YCbCr formats

Each of these are just themselves in a single plane.  This is copied
from the 8888 version, these are just the 10, 12, and 16-bit versions.

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

11 months agovulkan: Add common vkCmdBegin/EndQuery wrappers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
vulkan: Add common vkCmdBegin/EndQuery wrappers

These are identical to the IndexedEXT versions with index == 0.

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

11 months agovulkan: Add a vk_query_pool base object
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
vulkan: Add a vk_query_pool base object

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

11 months agovulkan: Add a more direct way to use a NIR shader
Faith Ekstrand [Tue, 31 Jan 2023 02:11:52 +0000 (20:11 -0600)]
vulkan: Add a more direct way to use a NIR shader

This follows the pipeline libraries method of including SPIR-V and lets
you provide the NIR shader without wrapping it in a VkShaderModule.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>

11 months agovulkan: Add a core vk_buffer_view struct
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
vulkan: Add a core vk_buffer_view struct

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>

11 months agoiris: Add support for userptr in Xe KMD
José Roberto de Souza [Tue, 18 Jul 2023 18:56:25 +0000 (11:56 -0700)]
iris: Add support for userptr in Xe KMD

Xe KMD only requires userptr to be bound to VM, so here returning
UINT32_MAX as gem_handle in Xe version of gem_create_userptr() for all
userptr bos.

As no bo is created it was also necessary to add additional handling
to xe_gem_close().

The vm bind side of userptr was already implemented, so it was only
necessary add the special handling and the kmd vm bind call.

This fixes piglit@amd_pinned_memory subtests that makes uses of
userptr.

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

11 months agoiris: Add gem_create_userptr() to KMD backend
José Roberto de Souza [Thu, 22 Jun 2023 21:04:19 +0000 (14:04 -0700)]
iris: Add gem_create_userptr() to KMD backend

Xe support of userptr will be implemented in the next patch,
this is just moving the i915 function to KMD backend.

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

11 months agoiris: Move iris_bufmgr_bo_close() to kmd backend
José Roberto de Souza [Tue, 18 Jul 2023 18:53:46 +0000 (11:53 -0700)]
iris: Move iris_bufmgr_bo_close() to kmd backend

The next patch will need a special handling when closing userptr bos
in Xe KMD, so here moving iris_bufmgr_bo_close() to kmd backend
and changing the gem_handle parameter to iris_bo.

There still one DRM_IOCTL_GEM_CLOSE call left in iris_bufmgr, that
is used to close exported gem handles.
iris_bufmgr_get_for_fd() could be used to get the iris_bufmgr but
we would still have problems with bo_export != iris_bo, so leaving
as is until a better solution is found.

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

11 months agoiris: Move i915_gem_set_domain() call to i915 backend
José Roberto de Souza [Thu, 22 Jun 2023 20:52:27 +0000 (13:52 -0700)]
iris: Move i915_gem_set_domain() call to i915 backend

This was being called from the common code, so it was being executed
for Xe KMD.
Luckily Xe don't have any uAPI at 0x1f offset.

There is still one user of i915_gem_set_domain() in iris_bufmgr.c
so it was duplicated in i915 backend but a future patch in this series
will take to remove it when the userptr code moves to backend.

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

11 months agoanv: partially revert 2e8b1f6d
Rohan Garg [Fri, 28 Jul 2023 10:35:49 +0000 (12:35 +0200)]
anv: partially revert 2e8b1f6d

set_image_compressed_bit checks for the image aux usage whereas
cmd_buffer_mark_image_written checks for the subresource's aux usage.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Fixes: 2e8b1f6d ('anv: drop duplicate checks when setting the compressed bit')
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24363>

11 months agoanv: enable EDS3 ConservativeRasterizationMode
Lionel Landwerlin [Mon, 31 Jul 2023 09:18:55 +0000 (12:18 +0300)]
anv: enable EDS3 ConservativeRasterizationMode

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24395>

11 months agoanv: fix 3DSTATE_RASTER::APIMode field setting
Lionel Landwerlin [Mon, 31 Jul 2023 09:09:13 +0000 (12:09 +0300)]
anv: fix 3DSTATE_RASTER::APIMode field setting

The APIMode field is set in the dynamic part in gfx8_cmd_buffer.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 55951ac28e ("anv: fix emitting dynamic primitive topology")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24395>

11 months agoradv: workaround WWZ exporting index=1 through location=1
Rhys Perry [Thu, 27 Jul 2023 19:06:48 +0000 (20:06 +0100)]
radv: workaround WWZ exporting index=1 through location=1

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 290c3d360e5a ("aco,radv: lower outputs to exports when nir for monolithic ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9232
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24354>

11 months agor600/sfn: Don't try to propagate to vec4 with more than one use
Gert Wollny [Mon, 31 Jul 2023 07:36:18 +0000 (09:36 +0200)]
r600/sfn: Don't try to propagate to vec4 with more than one use

Otherwise we end up with weird dependencies that make the scheduler
choke.

Fixes: 18a8d148d862d4a0f5b83f4385f00cf8a4a71b6d
    r600/sfn: Cleanup copy-prop into vec4 source values

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

11 months agovenus: suppress a false logging
Yiwei Zhang [Sat, 29 Jul 2023 05:35:46 +0000 (22:35 -0700)]
venus: suppress a false logging

Should only log when there's batched query feedbacks in the suspended
render pass instance. Additionally gate behind debug option.

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

11 months agor600: Force CF when emitting a NOP on R600 in gs copy shader
Gert Wollny [Sun, 30 Jul 2023 10:57:30 +0000 (12:57 +0200)]
r600: Force CF when emitting a NOP on R600 in gs copy shader

Fixes: 9d4104d4fb21813b527805cf3b40e133cab4d028
    r600: Explicitly force new CF in gs copy shader

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

11 months agonv50/ir/nir: Fix zero source handling of tex instructions.
Karol Herbst [Fri, 28 Jul 2023 16:42:03 +0000 (18:42 +0200)]
nv50/ir/nir: Fix zero source handling of tex instructions.

For TXQ we know make sure that we at least add one source. If the nir
instruction however didn't had any sources, we inserted a fake 0 source
ending up with two 0s for TXQ.

It's unclear to me if we have other ops where this would be necessary.

Fixes: 85a31fa1fc9 ("nv50/ir/nir: fix txq emission on MS textures")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Acked-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24373>

11 months agointel/compiler: Use nir SUBGROUP_INVOCATION for RT TOPOLOGY_ID
Jordan Justen [Tue, 7 Mar 2023 04:14:53 +0000 (20:14 -0800)]
intel/compiler: Use nir SUBGROUP_INVOCATION for RT TOPOLOGY_ID

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21774>

11 months agointel/isl: Use intel_needs_workaround() for MTL CCS WA
Jordan Justen [Mon, 10 Apr 2023 16:12:53 +0000 (09:12 -0700)]
intel/isl: Use intel_needs_workaround() for MTL CCS WA

Also use parent WA number of 14017240301 instead of 14017353530.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22401>

11 months agolavapipe/ci: use tighter changes: rules
Eric Engestrom [Fri, 28 Jul 2023 16:24:04 +0000 (17:24 +0100)]
lavapipe/ci: use tighter changes: rules

This removes src/{egl,glx,loader,mapi,mesa}/* from the match.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24372>

11 months agonir/builder: Add a nir_txs_deref() helper
Faith Ekstrand [Fri, 28 Jul 2023 15:31:18 +0000 (10:31 -0500)]
nir/builder: Add a nir_txs_deref() helper

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

11 months agonir/builder: Allow tex helpers on image types
Faith Ekstrand [Fri, 28 Jul 2023 15:53:28 +0000 (10:53 -0500)]
nir/builder: Allow tex helpers on image types

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

11 months agofreedreno/afuc: Initial a7xx support
Connor Abbott [Tue, 27 Jun 2023 15:24:35 +0000 (17:24 +0200)]
freedreno/afuc: Initial a7xx support

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

11 months agoafuc: Fix writing $00
Connor Abbott [Tue, 27 Jun 2023 14:22:01 +0000 (16:22 +0200)]
afuc: Fix writing $00

This is valid and should do nothing. Don't make the PC overlap $00 in
the reg file, so that we can print out "writes" to $00 but they're still
discarded.

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