platform/upstream/mesa.git
23 months agoRevert "glx/dri: Fix DRI drawable release at MakeCurrent time"
Martin Roukala (né Peres) [Thu, 24 Nov 2022 09:55:45 +0000 (11:55 +0200)]
Revert "glx/dri: Fix DRI drawable release at MakeCurrent time"

This reverts commit 31b04e420b0eb080084c6323066ea0b83929d59e which
is also breaking KDE in some ways.

Fixes: #7674
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19972>

23 months agoRevert "glx: Fix drawable refcounting for naked Windows"
Martin Roukala (né Peres) [Thu, 24 Nov 2022 06:38:17 +0000 (08:38 +0200)]
Revert "glx: Fix drawable refcounting for naked Windows"

This reverts commit 768238fdc06eed3dce36da3baf811cb70db42b5c which
is not only leading to memory leaks, but also reportedly breaks KDE
pretty badly.

Fixes: #7674, #7435
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19972>

23 months agoetnaviv: rs: fix blits with insufficient alignment for dual pipe operation
Lucas Stach [Thu, 24 Nov 2022 15:54:48 +0000 (16:54 +0100)]
etnaviv: rs: fix blits with insufficient alignment for dual pipe operation

Up-aligning the blit height does not always work, as some blit targets
have a smaller padded height. Fall back to single pipe operation if
increasing the height alignment fails. Still try to do it opportunistically
as it improves performance when resolving MSAA targets.

Fixes: 0ff96aaef3b1 ("etnaviv: rs: fix MSAA alignment adjustment")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19991>

23 months agoetnaviv: always use RS align when GPU has TEXTURE_HALIGN feature
Lucas Stach [Thu, 24 Nov 2022 15:39:35 +0000 (16:39 +0100)]
etnaviv: always use RS align when GPU has TEXTURE_HALIGN feature

Due to a logic bug we didn't always up-align the resource when the GPU
has the TEXTURE_HALIGN feature, which broke the RS blit when we need
to blit into a sampler shadow from a multi-tiled render target.

Fixes: 735718ed33b2 ("etnaviv: move etna_layout_multiple into etnaviv_resource.c")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19991>

23 months agoasahi: Add missing #include
Alyssa Rosenzweig [Fri, 25 Nov 2022 01:40:52 +0000 (20:40 -0500)]
asahi: Add missing #include

Noticed when shuffling headers.

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

23 months agoasahi: Enable framebuffer compression
Alyssa Rosenzweig [Fri, 25 Nov 2022 02:30:33 +0000 (21:30 -0500)]
asahi: Enable framebuffer compression

At 4K, glmark2 -bdesktop from 60fps to 86fps.

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

23 months agoasahi: Fix incorrect debug string
Alyssa Rosenzweig [Thu, 24 Nov 2022 01:35:26 +0000 (20:35 -0500)]
asahi: Fix incorrect debug string

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

23 months agoasahi: Print debug info about unsupported blits
Alyssa Rosenzweig [Thu, 24 Nov 2022 01:05:03 +0000 (20:05 -0500)]
asahi: Print debug info about unsupported blits

Black box for when we're going down.

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

23 months agoasahi: Don't hardcode is_dmabuf_modifier_supported
Alyssa Rosenzweig [Fri, 25 Nov 2022 16:54:50 +0000 (11:54 -0500)]
asahi: Don't hardcode is_dmabuf_modifier_supported

So we can add more modifiers more easily.

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

23 months agoasahi: Hook up compressed Z/S support on macOS
Asahi Lina [Fri, 25 Nov 2022 02:07:10 +0000 (21:07 -0500)]
asahi: Hook up compressed Z/S support on macOS

We still need to handle uncompressed depth on G13X, but that might never
actually happen in practice.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>

23 months agoasahi: Introduce compressed resource support
Asahi Lina [Wed, 23 Nov 2022 15:01:06 +0000 (00:01 +0900)]
asahi: Introduce compressed resource support

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>

23 months agoasahi: Identify compression-related XML
Asahi Lina [Wed, 23 Nov 2022 13:21:18 +0000 (22:21 +0900)]
asahi: Identify compression-related XML

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>

23 months agoail: Add unit tests for compression
Asahi Lina [Fri, 25 Nov 2022 02:16:44 +0000 (21:16 -0500)]
ail: Add unit tests for compression

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>

23 months agoail: Introduce support for compression
Asahi Lina [Wed, 23 Nov 2022 11:38:23 +0000 (20:38 +0900)]
ail: Introduce support for compression

The main buffer is twiddled as before, but there's now also an auxiliary
compression buffer that we need to reserve space for.

With compression, the main buffer is aligned less. The macOS logic seems to be
to align to the page size only if the texture is both 3D and mipmapped, *and*
the layer stride is greater than the page size.

That's gated on compression being enabled. Page alignment seems to be needed for
uncompressed twiddled cube maps.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19999>

23 months agodriconf/intel: Use fake vendor to WA bad detection in Source engine games
Sviatoslav Peleshko [Thu, 17 Nov 2022 20:59:20 +0000 (22:59 +0200)]
driconf/intel: Use fake vendor to WA bad detection in Source engine games

Source engine uses flawed device detection in Linux native OpenGL backend,
which causes it to use bad configurations for Intel devices and thus
not always render correctly. Workaround this by using vendor string that
does not include "Intel" in it.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7725
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19828>

23 months agoasahi: Fix undefined behaviour with samplers
Alyssa Rosenzweig [Thu, 24 Nov 2022 23:26:20 +0000 (18:26 -0500)]
asahi: Fix undefined behaviour with samplers

bind_sampler_states doesn't zero [nr_samplers, PIPE_MAX_SAMPLERS) so can get
non-null garbage samplers leading to a use-after-free (segfault derefencing
sampler) or a buffer overflow (writing samplers[] out).

Fixes crashes in Xonotic.

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

23 months agoasahi: Set GPR count accurately for background/EOT
Alyssa Rosenzweig [Thu, 24 Nov 2022 17:35:22 +0000 (12:35 -0500)]
asahi: Set GPR count accurately for background/EOT

Better occupancy, which is especially important when the background shader
does memory access (for reloads). On my 4K monitor, glmark2 -bdesktop fullscreen
from 95fps to 133fps.

At default settings, glmark2 -bterrain from 63fps to 71fps.

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

23 months agoasahi: Fix UB in union with logic ops
Alyssa Rosenzweig [Thu, 24 Nov 2022 15:55:20 +0000 (10:55 -0500)]
asahi: Fix UB in union with logic ops

Colour mask written.

Fixes: 9dddbfeaef2 ("asahi: Fix logic ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19998>

23 months agoradv/ci: Add coverage for ETC2 emulation.
Bas Nieuwenhuizen [Mon, 21 Nov 2022 23:16:05 +0000 (00:16 +0100)]
radv/ci: Add coverage for ETC2 emulation.

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

23 months agovulkan: Remove asserts that weren't valid for RADV ETC2 emulation.
Bas Nieuwenhuizen [Mon, 21 Nov 2022 23:07:43 +0000 (00:07 +0100)]
vulkan: Remove asserts that weren't valid for RADV ETC2 emulation.

Wasn't caught when radv was modified to use these helpers ...

Tried to move the aspects assert so it still checks application inputs.

Fixes: d9048e31a0d ("radv: Use vk_image_view as the base for radv_image_view")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>

23 months agoradv: Fix sampler types in ETC2 decode.
Bas Nieuwenhuizen [Mon, 21 Nov 2022 22:38:53 +0000 (23:38 +0100)]
radv: Fix sampler types in ETC2 decode.

Otherwise we'd have a type mismatch vs texture fetches, which
is asserted upon these days.

Fixes: 1153db23f58 ("radv: Add ETC2 decode shader.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>

23 months agoradv: Use correct init order for ETC2 image views
Bas Nieuwenhuizen [Mon, 21 Nov 2022 22:33:31 +0000 (23:33 +0100)]
radv: Use correct init order for ETC2 image views

Fixes: d9048e31a0d ("radv: Use vk_image_view as the base for radv_image_view")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>

23 months agoradeonsi: mark glx-multithread-texture as a flake
Erik Faye-Lund [Fri, 25 Nov 2022 10:54:47 +0000 (11:54 +0100)]
radeonsi: mark glx-multithread-texture as a flake

This has apparently been flaking for a while, so let's mark it as such.

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

23 months agopvr: debug: Add PPP sub-buffer support to CSB dumps.
Matt Coster [Tue, 16 Aug 2022 10:23:43 +0000 (11:23 +0100)]
pvr: debug: Add PPP sub-buffer support to CSB dumps.

This patch also includes the infrastructure for dumping sub-buffers in
print_sub_buffer() and new field types for floating and fixed point
decimals.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: csbgen: Remove TEXTURE_WRAP_VARYING-dependent fields
Matt Coster [Thu, 9 Jun 2022 12:51:51 +0000 (13:51 +0100)]
pvr: csbgen: Remove TEXTURE_WRAP_VARYING-dependent fields

This patch removes all fields dependent on the TEXTURE_WRAP_VARYING,
feature which is not currently supported.

It also removes STATE_PPP_CTRL.trp which is conditional on another
unused feature.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: debug: Add option to track pvr_bo allocations
Matt Coster [Mon, 6 Jun 2022 16:48:13 +0000 (17:48 +0100)]
pvr: debug: Add option to track pvr_bo allocations

This functionality should only need to be enabled when required by
other debug options.

While not used directly in this commit, it lays the groundwork for
dumping information from buffers referenced by other buffers.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: debug: Add "cs" debug option to dump control stream on job submit
Matt Coster [Wed, 29 Jun 2022 08:47:33 +0000 (09:47 +0100)]
pvr: debug: Add "cs" debug option to dump control stream on job submit

With PVR_DEBUG=cs, the control stream will be dumped to stderr
immediately prior to every render or compute job submission.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: debug: Add documentation for PVR_DEBUG environment variable
Matt Coster [Thu, 26 May 2022 08:45:28 +0000 (09:45 +0100)]
pvr: debug: Add documentation for PVR_DEBUG environment variable

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: Add pvr_bo_cpu_map_unchanged() helper to load saved vbits on map
Matt Coster [Tue, 16 Aug 2022 10:07:24 +0000 (11:07 +0100)]
pvr: Add pvr_bo_cpu_map_unchanged() helper to load saved vbits on map

When HAVE_VALGRIND is set, vbits of the CPU mapping are stored when
pvr_bo_cpu_unmap() is called. They can be reloaded by calling
pvr_bo_cpu_map_unchanged() instead of pvr_bo_cpu_map(). The vbits are
not loaded by default on every map, since they could easily have been
changed by the device between the unmap/map calls. Only use
pvr_bo_cpu_map_unchanged() when you can safely assume that nothing has
changed in the underlying memory.

When HAVE_VALGRIND is not set, pvr_bo_cpu_map_unchanged() just inlines
to pvr_bo_cpu_map().

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: csbgen: Generate enum-to-string functions for debugging
Matt Coster [Wed, 25 May 2022 12:30:55 +0000 (13:30 +0100)]
pvr: csbgen: Generate enum-to-string functions for debugging

All enums should be unambiguous, so an error is raised when multiple
enum variants with the same value are encountered. When no enum
variants match the provided value, NULL is returned. This allows the
to-string functions to double as validators.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agopvr: util: Add integer digit counting functions
Matt Coster [Mon, 6 Jun 2022 16:06:30 +0000 (17:06 +0100)]
pvr: util: Add integer digit counting functions

These are (reasonably) fast helpers for computing the number of binary,
decimal or hexadecimal digits required to represent a given non-negative
integer.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18948>

23 months agoradv: make sure to mark DCC as compressed on GFX11
Samuel Pitoiset [Fri, 25 Nov 2022 11:00:33 +0000 (12:00 +0100)]
radv: make sure to mark DCC as compressed on GFX11

The bit has moved to FDCC_ENABLE on GFX11.
Found by inspection.

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

23 months agoac/nir: combine shift translation
Rhys Perry [Wed, 23 Nov 2022 20:46:59 +0000 (20:46 +0000)]
ac/nir: combine shift translation

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19966>

23 months agoac/nir: mask shift operands
Rhys Perry [Wed, 23 Nov 2022 20:41:29 +0000 (20:41 +0000)]
ac/nir: mask shift operands

NIR shifts are defined to truncate the shift amount to the number of bits
needed to represent the bit-size of the value shifted. LLVM treats large
shifts as poison. This fix achieves NIR semantics for shifts.

As an example, a|(b << 32), where "a" is 32bits, should produce a|b
according to NIR (because 32&31 == 0).

This caused LLVM to incorrectly optimize "(a >> c) | (b << (32 - c))" to a
u2u32(pack_64_2x32(a, b) >> c) (v_alignbit_b32), when the original NIR
should have returned "a | b" if c==0.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19966>

23 months agovirgl: Fix injection of double from const mov instruction
Gert Wollny [Thu, 24 Nov 2022 09:14:25 +0000 (10:14 +0100)]
virgl: Fix injection of double from const mov instruction

We only copy two components, we have to use the complete original source,
and we should rewrite the new source from scratch to avoid incorrect
dimension and indirect handling.

Fixes: 036d7172c (virgl: Move double operands to a temp to avoid double-swizzling bugs)

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

23 months agoradv: remove useless parenthesis in radv_cmd_buffer_flush_dynamic_state()
Samuel Pitoiset [Fri, 18 Nov 2022 09:13:57 +0000 (10:13 +0100)]
radv: remove useless parenthesis in radv_cmd_buffer_flush_dynamic_state()

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

23 months agoradv: simplify handling logic op when it's not dynamic
Samuel Pitoiset [Fri, 18 Nov 2022 08:59:20 +0000 (09:59 +0100)]
radv: simplify handling logic op when it's not dynamic

The command buffer already emits ROP3_COPY if the logic op is disabled.

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

23 months agoradv: fix and rework DISABLE_DUAL_QUAD setting
Samuel Pitoiset [Fri, 18 Nov 2022 09:41:27 +0000 (10:41 +0100)]
radv: fix and rework DISABLE_DUAL_QUAD setting

This bit can be enabled with various combinations and it looks better
to only emit it from the cmdbuf.

Fixes: 17b9aa92b77 ("radv: add support for dynamic logic op enable")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19843>

23 months agoradv: re-emit dynamic provoking vertex mode if primitive topology changed
Samuel Pitoiset [Fri, 18 Nov 2022 09:10:24 +0000 (10:10 +0100)]
radv: re-emit dynamic provoking vertex mode if primitive topology changed

The vertex shader depends on the primitive topology.

Fixes: 2cce8500de0 ("radv: add support for dynamic provoking vertex mode with NGG")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19843>

23 months agoradv: re-emit dynamic depth clamp enable if depth clip enable changed
Samuel Pitoiset [Fri, 18 Nov 2022 08:50:40 +0000 (09:50 +0100)]
radv: re-emit dynamic depth clamp enable if depth clip enable changed

The depth clamp mode depends on depth clip enable/disable.

Fixes: e48c0fbd8f7 ("radv: add support for dynamic depth clamp enable")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19843>

23 months agoanv: use the anv_state_pool address helper more
Lionel Landwerlin [Wed, 23 Nov 2022 10:02:41 +0000 (12:02 +0200)]
anv: use the anv_state_pool address helper more

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19983>

23 months agov3dv: allocate copy query pipelines lazily
Iago Toral Quiroga [Thu, 24 Nov 2022 12:47:40 +0000 (13:47 +0100)]
v3dv: allocate copy query pipelines lazily

Instead of creating all 8 pipeline combinations when we initialize
the device we create the pipelines when we need to use them. This
is probably better because applications are likely to always use
the same flags for the copy command, which means that only one
pipeline may be required.

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

23 months agoradv: fix memleak with link time optimizations and GPL
Samuel Pitoiset [Thu, 24 Nov 2022 07:20:39 +0000 (08:20 +0100)]
radv: fix memleak with link time optimizations and GPL

Do not clone the NIR when the driver retains NIR shaders because it
exits early, otherwise stage->nir will never be freed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7768
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19973>

23 months agodocs/zink: update query requirements
Erik Faye-Lund [Tue, 15 Nov 2022 15:04:29 +0000 (16:04 +0100)]
docs/zink: update query requirements

These features are no longer required.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>

23 months agomesa: do not require optional queries
Erik Faye-Lund [Tue, 22 Nov 2022 11:43:24 +0000 (12:43 +0100)]
mesa: do not require optional queries

The OpenGL specifications explicitly calls out these queries as allowing
zero bits, so these features aren't actually required to bump the OpenGL
version.

While we could in theory also enable the corresponding extensions
unconditionally, this risks breaking applications that assume that the
presence of the extensions are sufficient to use meaningfully use them,
like is the case with most other OpenGL extensions.

However, blocking more recent GL versions due to this seems like a bit
of an overreaction. So let's allow new OpenGL versions, but not the
extensions themselves.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>

23 months agomesa: support dummy queries for ARB_pipeline_statistics_query
Erik Faye-Lund [Tue, 15 Nov 2022 12:18:16 +0000 (13:18 +0100)]
mesa: support dummy queries for ARB_pipeline_statistics_query

Similar to ARB_occlusion_query / ARB_occlusion_query2, this extension
allows zero bits for the queries, meaning there's no actual hardware
requirements here.

So let's just report zero bits if the driver doesn't support the CAP,
and treat these queries as dummies like we already do for occlusion
queries.

We still don't expose the extension, this is just to make it possible to
allow the core OpenGL functionality without exposing the extension.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>

23 months agomesa: treat unsupported queries as dummies
Erik Faye-Lund [Tue, 15 Nov 2022 14:41:22 +0000 (15:41 +0100)]
mesa: treat unsupported queries as dummies

It's legal in OpenGL to start a query even if the result will have zero
valid bits. It's not enough to just report zero bits, We need to also
prevent calling down into the driver with these invalid queries.

Because ARB_ES3_compatibility adds ANY_SAMPLES_PASSED and
ANY_SAMPLES_PASSED_CONSERVATIVE to the set of queries that support zero
bits, we also need to check for the corresponding indices.

Fixes: 0186e9e1c51 ("mesa: always support occlusion queries")
Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>

23 months agost/vdpau: fix interop with GL
Marek Olšák [Wed, 23 Nov 2022 17:17:17 +0000 (12:17 -0500)]
st/vdpau: fix interop with GL

Fixes: e00bb6cb98b - mesa/st: use tracked samplerview swizzle values
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7751

Tested-By: Veerabadhran.Gopalakrishnan@amd.com
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19961>

23 months agopanfrost: Revert "Require 64-byte alignment on imports"
Alyssa Rosenzweig [Thu, 24 Nov 2022 23:18:42 +0000 (18:18 -0500)]
panfrost: Revert "Require 64-byte alignment on imports"

This reverts commit 811f8a19469722bea32f3c539b8cf0939fe3b057. As Alpine put it
-- this is causing more problems than it's fixing. Hotfix to revert the
offending commit until a more measured fix can be implemented.

Closes: #7731
Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Jan Palus
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19993>

23 months agoagx: Use default SHAREABLE_SHADERS
Alyssa Rosenzweig [Tue, 22 Nov 2022 00:31:37 +0000 (19:31 -0500)]
agx: Use default SHAREABLE_SHADERS

No need to set this explicitly, u_default does it for us.

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

23 months agoagx: Fix signedness issues packing
Alyssa Rosenzweig [Sun, 20 Nov 2022 14:40:15 +0000 (09:40 -0500)]
agx: Fix signedness issues packing

UBSan complains otherwise:

../src/asahi/compiler/agx_pack.c:701:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
../src/asahi/compiler/agx_pack.c:534:18: runtime error: left shift of 8 by 28 places cannot be represented in type 'int'

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

23 months agoagx: Handle vertex shaders that use <= 8 halfregs
Alyssa Rosenzweig [Sat, 19 Nov 2022 22:37:25 +0000 (17:37 -0500)]
agx: Handle vertex shaders that use <= 8 halfregs

r5 and r6 are always getting lowered. Will prevent a regression with VBO
lowering on a shader which has stride=0 and hence gets the vertex ID read
optimized out with NIR:

   dEQP-GLES2.functional.draw.random.50

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

23 months agoagx: Try to align sources of pack_64_2x32_split
Alyssa Rosenzweig [Sat, 19 Nov 2022 21:43:19 +0000 (16:43 -0500)]
agx: Try to align sources of pack_64_2x32_split

Helps with coalescing the pack.

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

23 months agoagx: Implement nir_op_pack_64_2x32_split
Alyssa Rosenzweig [Sat, 19 Nov 2022 20:07:52 +0000 (15:07 -0500)]
agx: Implement nir_op_pack_64_2x32_split

This maps to a collect where the dest size is 64 and the src size is 32.

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

23 months agoasahi: Allocate smaller scissor/zbias arrays
Alyssa Rosenzweig [Mon, 21 Nov 2022 04:06:45 +0000 (23:06 -0500)]
asahi: Allocate smaller scissor/zbias arrays

Don't waste 1MB per batch for descriptors that may be completely unused.
Instead, upload the scissor and depth bias arrays at submit time. This is a
simple solution to a silly problem: we can't grow the scissor/depth bias arrays,
and we don't know how big they will be at draw time. We could...

1. Statically allocate large buffers? Waste lots of memory.
2. Statically allocate small buffers? Forces too much flushing.
3. Dynamically allocate a growable GPU buffer? Requires either reading
   back write-combined memory contents, or maintaining a CPU copy in
   addition to extra GPU copies, or doing complicated MMU shenanigans.
   The first two options are slow and the last is complicated.

Instead, we upload these descriptors to a dynamically allocated CPU-side which
gets copied just once to the GPU at submit-time when the exact size is known,
minimizing wasted memory and copies and avoiding any unnecessary flushing or WC
memory reads.

In addition, this patch makes sure we flush if we would overflow with more than
65535 scissor descriptors in a batch. This is a (minor) bug fix.

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

23 months agoasahi: Allocate/free batch BOs as needed
Alyssa Rosenzweig [Mon, 21 Nov 2022 03:50:35 +0000 (22:50 -0500)]
asahi: Allocate/free batch BOs as needed

Rather than hanging onto them across batches. This lets us free these BOs if the
number of batches shrinks, which is pretty common if all 32 batches are used
during a loading screen for glGenerateMipmap() and then the in-game portion
drops to 1 or 2 batches only. Now that we have the BO cache wired up, this
should not adversely affect performance.

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

23 months agoasahi: Copy panfrost's bo cache
Alyssa Rosenzweig [Fri, 17 Jun 2022 02:27:47 +0000 (22:27 -0400)]
asahi: Copy panfrost's bo cache

Massive performance gains, some fps before/after numbers from glmark2:

   [shading] 1486 -> 2391
   [refract] 87   -> 127
   [terrain] 32   -> 56

...and it's basically for free with enough copy/paste, so thank you to Boris
Brezillon for an excellent Asahi patch, the LRU cache seems to work great on M1
:-p

There are a few minor changes I made from panfrost, notably adjusting the
constants to account for 16KiB pages and switching from pthread_mutex to
simple_mtx to be less weird in Mesa.

For context on the design, the following commits evolved it in Panfrost and
their commit messages may be useful... The logic in this module is the product
of years of mistakes and correcting course :-)

   f06809cdcaf ("panfrost: Evict the BO cache when allocation fails")
   77d04989135 ("panfrost: Fix major flaw in BO cache")
   ee82f9f07e1 ("panfrost: Try to evict unused BOs from the cache")
   2225383af8b ("panfrost: Make sure the BO is 'ready' when picked from the cache")
   9af4aeaaf7c ("panfrost: Don't return imported/exported BOs to the cache")

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

23 months agoasahi: Stop aligning pool allocations to 4KiB
Alyssa Rosenzweig [Mon, 21 Nov 2022 03:02:16 +0000 (22:02 -0500)]
asahi: Stop aligning pool allocations to 4KiB

This defeats the point of specifying alignments and of packing allocations
together with the BO cache. We're a real driver now, let's allocate memory like
one.

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

23 months agoasahi: Label BOs internally
Alyssa Rosenzweig [Sun, 20 Nov 2022 23:35:18 +0000 (18:35 -0500)]
asahi: Label BOs internally

This will help debugging memory usage problems.

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

23 months agoci/alpine: bump to 3.17, new GCC 12 and LLVM 15
David Heidelberg [Tue, 22 Nov 2022 17:56:20 +0000 (18:56 +0100)]
ci/alpine: bump to 3.17, new GCC 12 and LLVM 15

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19959>

23 months agoci/alpine: enable Mold linker
David Heidelberg [Wed, 23 Nov 2022 16:38:49 +0000 (17:38 +0100)]
ci/alpine: enable Mold linker

Alpine has Mold 1.7.1 in the repository.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19959>

23 months agoradv/ci: do not create jobs that will fail outside of mesa's namespace
Martin Roukala (né Peres) [Thu, 24 Nov 2022 13:01:54 +0000 (15:01 +0200)]
radv/ci: do not create jobs that will fail outside of mesa's namespace

Mirror what is done for the freedreno project and do not allow manual
execution of jobs that require restricted access to a CI farm.

This fixes pushing new branches with non-radv-related changes.

Fixes: #7773
Reported-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19984>

23 months agohud: add GALLIUM_HUD_ROTATION option
Italo Nicola [Fri, 18 Nov 2022 17:38:12 +0000 (14:38 -0300)]
hud: add GALLIUM_HUD_ROTATION option

The user can use GALLIUM_HUD_ROTATION={0,90,180,270} to rotate the hud
by the specified amount.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19854>

23 months agoac/nir: Avoid data race with task shader payloads.
Timur Kristóf [Wed, 23 Nov 2022 23:22:37 +0000 (00:22 +0100)]
ac/nir: Avoid data race with task shader payloads.

Device memory scope is necessary because we need to ensure there is
always a waitcnt_vscnt instruction in order to avoid a race condition
between payload stores and their loads after mesh shaders launch.

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

23 months agodocs/zink: add missing required device-feature
Erik Faye-Lund [Wed, 16 Nov 2022 11:49:27 +0000 (12:49 +0100)]
docs/zink: add missing required device-feature

Seems I forgot to add this to the list of required features.

Fixes: eb0195358c4 ("zink: only inspect dual-src limit if feature enabled")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>

23 months agozink: update textureCompressionBC requirement
Erik Faye-Lund [Wed, 16 Nov 2022 11:55:26 +0000 (12:55 +0100)]
zink: update textureCompressionBC requirement

The mesa state-tracker can now emulate all formats indicated by this
feature-flag, so we don't require this for OpenGL 4.2 any more.

It's however a good idea to support for power-usage and performance
reasons, saving on memory bandwidth. So let's move it to the
gl46_optimal block instead.

Fixes: e4ff42684b9 ("mesa/st: enable bptc extension with fallback")
Fixes: 2ea481b2f0a ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>

23 months agozink: fix incorrect requirements
Erik Faye-Lund [Wed, 16 Nov 2022 11:53:57 +0000 (12:53 +0100)]
zink: fix incorrect requirements

These were in the wrong list all along.

Fixes: a466c2a7839 ("zink: check for stores and atomics features")
Fixes: 2644835f039 ("zink: add missing required feature")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>

23 months agozink: remove needless requirements
Erik Faye-Lund [Wed, 16 Nov 2022 11:41:07 +0000 (12:41 +0100)]
zink: remove needless requirements

We never required the uniform texel buffer bit for more than
bufferFeatures for a bunch of these formats.

Similarly, we *don't* need the uniform texel buffer bit for sampled
image access.

For the image-dimensions, the Mesa frontend doesn't validate the max 1D,
3D or Cube sizes, nor the max texture layers. So we'll expose GL 4.1
without these, even if that's not conformant.

Finally, we don't require robustImageAccess2 for OpenGL 4.3 at all. All
we need is the robustBufferAccess feature.

Fixes: 2ea481b2f0a ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>

23 months agozink: fix json-errors in profile-file
Erik Faye-Lund [Wed, 16 Nov 2022 11:23:45 +0000 (12:23 +0100)]
zink: fix json-errors in profile-file

There's some stray commas here, let's get rid of them.

Fixes: 2ea481b2f0a ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>

23 months agov3dv: specialize query copy pipelines
Iago Toral Quiroga [Mon, 21 Nov 2022 07:36:28 +0000 (08:36 +0100)]
v3dv: specialize query copy pipelines

Instead of having one shader that checks the various flags and emits
conditional code, create specialized pipelines for each relevant
combination of flags values so we can produce more optimized
pipelines with less conditional code for each scenario.

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

23 months agov3dv: allocate one BO for both occlusion results and availability
Iago Toral Quiroga [Tue, 15 Nov 2022 12:47:07 +0000 (13:47 +0100)]
v3dv: allocate one BO for both occlusion results and availability

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

23 months agov3dv: reimplement occlusion queries
Iago Toral Quiroga [Fri, 28 Oct 2022 10:07:07 +0000 (12:07 +0200)]
v3dv: reimplement occlusion queries

Our implementation was mostly CPU-based, with things such as query
resets and result copying handled in the CPU, as well as some aspects
of query availability tracking.

This new implementation handles all GPU-side query functions by
dispatching compute shaders to push the work to the GPU. This
involves query availability, reset and result copying.

For now, only occlusion queries are managed this way. Performance
queries can also be implemented in a similar fashion in the future
with some additional work, however, for timestamp queries our only
option to improve this would be to execute the actual timestamp in the
kernel, since we can't take a timestamp from a shader.

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

23 months agov3dv: add a helper to create compute pipelines from nir
Iago Toral Quiroga [Fri, 28 Oct 2022 10:29:06 +0000 (12:29 +0200)]
v3dv: add a helper to create compute pipelines from nir

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

23 months agov3dv: reset pending cpu job state once processed
Iago Toral Quiroga [Tue, 15 Nov 2022 13:20:31 +0000 (14:20 +0100)]
v3dv: reset pending cpu job state once processed

If we have any pending jobs queued in the command buffer state
to be emitted at the end of a given job, make sure we reset
that state once these have been processed.

cc: mesa-table

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

23 months agoApply 1 suggestion(s) to 1 file(s)
Erik Faye-Lund [Thu, 24 Nov 2022 08:55:20 +0000 (08:55 +0000)]
Apply 1 suggestion(s) to 1 file(s)

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

23 months agodocs/perfetto: update section about vulkan app tracing
Lionel Landwerlin [Thu, 24 Nov 2022 08:30:50 +0000 (10:30 +0200)]
docs/perfetto: update section about vulkan app tracing

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 18e820009d6 ("common/utrace: Refactor and combine all envvars into `GPU_TRACES`")
Fixes: 8370a0d6bfc ("common/utrace: Prefix all environment variables with `MESA_`")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19974>

23 months agor300: fix r300_max_vertex_count
Filip Gawin [Sat, 12 Nov 2022 13:33:59 +0000 (14:33 +0100)]
r300: fix r300_max_vertex_count

(seems like we counted size twice)

Helps with:
dEQP-GLES2.functional.draw.draw_elements.points.single_attribute
dEQP-GLES2.functional.draw.draw_elements.points.multiple_attributes

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

23 months agozink/ci: mark the two remaining GLES3 failures as CTS test bug
Samuel Pitoiset [Tue, 22 Nov 2022 16:11:41 +0000 (17:11 +0100)]
zink/ci: mark the two remaining GLES3 failures as CTS test bug

This means Zink/RADV could be conformant against GLES3!

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

23 months agoradv/ci: don't download back the vkd3d-proton.cache files
Martin Roukala (né Peres) [Wed, 23 Nov 2022 11:58:28 +0000 (13:58 +0200)]
radv/ci: don't download back the vkd3d-proton.cache files

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

23 months agoradv/ci: set B2C_JOB_VOLUME_EXCLUSIONS in all jobs
Martin Roukala (né Peres) [Wed, 23 Nov 2022 10:34:59 +0000 (12:34 +0200)]
radv/ci: set B2C_JOB_VOLUME_EXCLUSIONS in all jobs

This will also speed up the execution time of non-vkcts jobs.

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

23 months agoradv/ci: do not sync back the install folder
Martin Roukala (né Peres) [Tue, 22 Nov 2022 14:23:56 +0000 (16:23 +0200)]
radv/ci: do not sync back the install folder

When a job is over, we download back all the files generated by the
job. This however includes the mesa install/ folder which is close
to 1G in size.

This commit adds the install/ folder to the exclusion list for the
volume mirroring.

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

23 months agoradv/ci: run test automatically only for the mesa namespace
Martin Roukala (né Peres) [Tue, 22 Nov 2022 14:41:26 +0000 (16:41 +0200)]
radv/ci: run test automatically only for the mesa namespace

The Valve CI Farm uses allow lists for projects/users to prevent abuse,
so only enable automatic testing when running in the context of Mesa to
prevent failures in forks.

Suggested-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19930>

23 months agoutil: Remove unused WIN32 and MSVC related staff in p_compiler.h
Yonggang Luo [Fri, 18 Nov 2022 19:10:40 +0000 (03:10 +0800)]
util: Remove unused WIN32 and MSVC related staff in p_compiler.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>

23 months agoutil: Rename PIPE_CDECL to UTIL_CDECL and moved into util/macros.h
Yonggang Luo [Fri, 18 Nov 2022 23:37:03 +0000 (07:37 +0800)]
util: Rename PIPE_CDECL to UTIL_CDECL and moved into util/macros.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>

23 months agoutil: Move EXCLUSIVE_CACHELINE and CACHE_LINE_SIZE macros into u_memory.h
Yonggang Luo [Fri, 18 Nov 2022 23:34:59 +0000 (07:34 +0800)]
util: Move EXCLUSIVE_CACHELINE and CACHE_LINE_SIZE macros into u_memory.h

They are coupled with MALLOC_STRUCT_CL,  so  move them into a single place and accessed consistently

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>

23 months agoutil: Remove the latest PIPE_ALIGN_VAR in p_compiler.h
Yonggang Luo [Tue, 22 Nov 2022 05:11:42 +0000 (13:11 +0800)]
util: Remove the latest PIPE_ALIGN_VAR in p_compiler.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19918>

23 months agoclover: Fixes -Wundef in memory.cpp
Yonggang Luo [Tue, 22 Nov 2022 10:24:54 +0000 (18:24 +0800)]
clover: Fixes -Wundef in memory.cpp

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agogallium: Fixes -Wundef in draw_gs.c
Yonggang Luo [Tue, 22 Nov 2022 10:24:26 +0000 (18:24 +0800)]
gallium: Fixes -Wundef in draw_gs.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agoutil: Fixes -Wundef in u_debug_stack_test.cpp
Yonggang Luo [Tue, 22 Nov 2022 10:23:31 +0000 (18:23 +0800)]
util: Fixes -Wundef in u_debug_stack_test.cpp

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agoutil: Fixes -Wundef in u_qsort.h
Yonggang Luo [Tue, 22 Nov 2022 10:23:01 +0000 (18:23 +0800)]
util: Fixes -Wundef in u_qsort.h

Partial of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7680

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agomesa: Fixes -Wundef in arbprogparse.c
Yonggang Luo [Tue, 22 Nov 2022 10:01:23 +0000 (18:01 +0800)]
mesa: Fixes -Wundef in arbprogparse.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agoutil: Fixes -Wundef in util/compiler.h
Yonggang Luo [Tue, 22 Nov 2022 10:01:07 +0000 (18:01 +0800)]
util: Fixes -Wundef in util/compiler.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agogallivm: use valid LLVM_VERSION_MAJOR instead of LLVM_VERSION
Yonggang Luo [Tue, 22 Nov 2022 09:46:12 +0000 (17:46 +0800)]
gallivm: use valid LLVM_VERSION_MAJOR instead of LLVM_VERSION

Partial of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7680
Fixes: 203920d4c69 ("gallivm: add atomic 32-bit float support")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>

23 months agor600: Fixes -Werror,-Wunused-but-set-variable for clang-15
Yonggang Luo [Fri, 4 Nov 2022 07:13:28 +0000 (15:13 +0800)]
r600: Fixes -Werror,-Wunused-but-set-variable for clang-15

one of the error messages:
../../src/gallium/drivers/r600/r600_asm.c:2528:8: error: variable 'o' set but not used [-Werror,-Wunused-but-set-variable]
                        int o = 0;
                            ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>

23 months agoaco: Fixes -Werror,-Wbitwise-instead-of-logical for clang-15 in aco_optimizer.cpp
Yonggang Luo [Fri, 4 Nov 2022 11:30:12 +0000 (19:30 +0800)]
aco: Fixes -Werror,-Wbitwise-instead-of-logical for clang-15 in aco_optimizer.cpp

error message:
error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>

23 months agomesa: fixes -Werror,-Wunused-but-set-variable for clang-15 in program_parse.y
Yonggang Luo [Fri, 4 Nov 2022 12:51:40 +0000 (20:51 +0800)]
mesa: fixes -Werror,-Wunused-but-set-variable for clang-15 in program_parse.y

error message:
src/mesa/program/program_parse.tab.c:1952:9: error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>

23 months agomesa: indent fixes after replace tab with 3 space by find and replace in program...
Yonggang Luo [Tue, 22 Nov 2022 13:00:01 +0000 (21:00 +0800)]
mesa: indent fixes after replace tab with 3 space by find and replace in program/program_parse.y

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>

23 months agomesa: replace tab with 3 space in mesa/program/program_parse.y by tools
Yonggang Luo [Tue, 22 Nov 2022 16:04:14 +0000 (00:04 +0800)]
mesa: replace tab with 3 space in mesa/program/program_parse.y by tools

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19969>

23 months agorusticl: print missing context features
Thomas Debesse [Thu, 3 Nov 2022 10:16:45 +0000 (11:16 +0100)]
rusticl: print missing context features

Signed-off-by: Thomas Debesse <dev@illwieckz.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19498>

23 months agomeson: Don't depend on expat for !use_xmlconfig
Alyssa Rosenzweig [Tue, 15 Nov 2022 19:12:06 +0000 (14:12 -0500)]
meson: Don't depend on expat for !use_xmlconfig

If we don't use xmlconfig, expat becomes an optional dependency on
Linux/BSD, which may be convenient for embedded systems that do not
otherwise need expat. (expat is so ubiquitous that this
probably doesn't matter a ton in practice, but fewer required Mesa deps
is probably nice anyway.)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19626>