platform/upstream/mesa.git
22 months agowsi/common: Allow present-wait to be unconditionally enabled.
Hans-Kristian Arntzen [Mon, 31 Oct 2022 15:00:04 +0000 (16:00 +0100)]
wsi/common: Allow present-wait to be unconditionally enabled.

If all potentially supported surface types support present wait,
we can expose the extension.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agodriconf: Add DRI configuration for exposing VK_KHR_present_wait.
Hans-Kristian Arntzen [Mon, 24 Oct 2022 11:43:37 +0000 (13:43 +0200)]
driconf: Add DRI configuration for exposing VK_KHR_present_wait.

These extensions are flawed and do not support the concept of
per-surface queries. For the time being we cannot guarantee that we are
able to implement it on all surfaces, but the feature is useful enough
to make available as an opt-in feature for the time being, so hide it
behind an driconf until we have a better mechanism in place.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agowsi/display: Implement VK_KHR_present_wait on KHR_display swapchain.
Hans-Kristian Arntzen [Mon, 24 Oct 2022 14:10:01 +0000 (16:10 +0200)]
wsi/display: Implement VK_KHR_present_wait on KHR_display swapchain.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agowsi/x11: Implement VK_KHR_present_wait on X11.
Hans-Kristian Arntzen [Fri, 21 Oct 2022 13:04:13 +0000 (15:04 +0200)]
wsi/x11: Implement VK_KHR_present_wait on X11.

Based on original implementation by Keith Packard in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12086.

Also fixes the implementation to work on IMMEDIATE and MAILBOX
presentation modes and Xwayland.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agovulkan/wsi: Add mechanism to wait for WSI semaphore unsignal.
Hans-Kristian Arntzen [Mon, 24 Oct 2022 12:47:51 +0000 (14:47 +0200)]
vulkan/wsi: Add mechanism to wait for WSI semaphore unsignal.

When vkWaitForPresentKHR succeeds, we are guaranteed
that any dependent semaphores have been unsignalled.

In an explicit sync world, we are guaranteed this automatically by
having a present complete, since that event must follow a semaphore wait
completion.

However, if the swapchain image is implicitly
synchronized, the semaphore might technically not have been unsignaled
before the present complete event triggers.

Present IDs must be signalled in monotonic order, same as timeline
semaphores.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agovulkan/wsi: Refactor out wsi_init_pthread_cond_monotonic.
Hans-Kristian Arntzen [Fri, 21 Oct 2022 13:00:32 +0000 (15:00 +0200)]
vulkan/wsi: Refactor out wsi_init_pthread_cond_monotonic.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agovulkan/wsi: Add stub interface for VK_KHR_present_wait
Daniel Stone [Wed, 11 May 2022 18:13:48 +0000 (19:13 +0100)]
vulkan/wsi: Add stub interface for VK_KHR_present_wait

Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19279>

22 months agointel/fs: Accept an unsigned int in fs_reg::fs_reg
LingMan [Mon, 31 Oct 2022 17:41:35 +0000 (18:41 +0100)]
intel/fs: Accept an unsigned int in fs_reg::fs_reg

The parameter `nr` is currenlty an `int` but it only gets assigned to an
`unsigned int`. Make it clear in the function signature what's actually
required.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19423>

22 months agointel/fs: Preserve unsignedness in fs_visitor::split_virtual_grfs
LingMan [Mon, 31 Oct 2022 13:22:09 +0000 (14:22 +0100)]
intel/fs: Preserve unsignedness in fs_visitor::split_virtual_grfs

GCC 12.2.0 warns:
../src/intel/compiler/brw_fs.cpp: In member function ‘bool fs_visitor::
split_virtual_grfs()’:
../src/intel/compiler/brw_fs.cpp:2199:10: warning: ‘void* memset(void*, int,
size_t)’ specified size between 18446744071562067968 and 18446744073709551615
exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
 2199 |    memset(vgrf_has_split, 0, num_vars * sizeof(*vgrf_has_split));

`num_vars` is an `int` but gets assigned the value of `this->alloc.count`,
which is an `unsigned int`. Thus, `num_vars` will be negative if
`this->alloc.count` is larger than int max value. Converting that negative
`int` to a `size_t`, which `memset` expects, then blows it up to a huge
positive value.

Simply turning `num_vars` into an `unsigned int` would be enough to fix this
specific problem, but there are many other instances where an `unsigned int`
gets assigned to an `int` for no good reason in this function. Some of which
the compiler warns about now, some of which it doesn't warn about.

This turns all variables in `fs_visitor::split_virtual_grfs`, which should
reasonably be unsigned, into `unsigned int`s. While at it, a few now pointless
casts are removed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19423>

22 months agointel: Disable SSE2 instruction set if building for non x86 architectures
Philippe Lecluse [Tue, 22 Nov 2022 15:27:46 +0000 (07:27 -0800)]
intel: Disable SSE2 instruction set if building for non x86 architectures

Signed-off-by: Philippe Lecluse <philippe.lecluse@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19812>

22 months agointel: Add SUPPORT_INTEL_INTEGRATED_GPUS build argument
Philippe Lecluse [Tue, 22 Nov 2022 15:26:58 +0000 (07:26 -0800)]
intel: Add SUPPORT_INTEL_INTEGRATED_GPUS build argument

This is meant to remove any integrated GPU only code paths that can't
be compiled in CPU architectures different than x86.

Discrete GPUS don't have need_clflush set to true so it was just
matter of remove some code blocks around need_clflush but was left a
check in anv_physical_device_init_heaps() to fail physical device
initialization if it ever became false.

Signed-off-by: Philippe Lecluse <philippe.lecluse@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19812>

22 months agovk/runtime: Fix narrowing of timeline signal and wait value to u32.
Hans-Kristian Arntzen [Wed, 23 Nov 2022 11:40:00 +0000 (12:40 +0100)]
vk/runtime: Fix narrowing of timeline signal and wait value to u32.

They are u64. Fixes deadlock in
dEQP-VK.wsi.xcb.present_id_wait.wait.past_no_timeout.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 9bffd81f1cb7 ("vulkan: Add common implementations of vkQueueSubmit
and vkQueueWaitIdle")

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19951>

22 months agor600/sb: Fix initialization order in sb_shader
Gert Wollny [Wed, 23 Nov 2022 14:41:40 +0000 (15:41 +0100)]
r600/sb: Fix initialization order in sb_shader

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

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

22 months agonir/divergence: add missing btd_shader_type_intel
Lionel Landwerlin [Wed, 23 Nov 2022 08:56:49 +0000 (10:56 +0200)]
nir/divergence: add missing btd_shader_type_intel

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6d9ae6ec1eaa ("intel: add a new intrinsic to get the shader stage from bindless shaders")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19948>

22 months agoanv: generate correct addresses for state pool offsets
Lionel Landwerlin [Wed, 23 Nov 2022 07:21:36 +0000 (09:21 +0200)]
anv: generate correct addresses for state pool offsets

Fixes a number of CTS patterns on DG2 :

   - dEQP-VK.dynamic_rendering.primary_cmd_buff.random*
   - dEQP-VK.draw.*secondary_cmd*
   - dEQP-VK.dynamic_rendering.*secondary_cmd*
   - dEQP-VK.geometry.*secondary_cmd_buffer
   - dEQP-VK.multiview.*secondary_cmd*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9c1c1888d989 ("intel/fs: put scratch surface in the surface state heap")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19946>

22 months agoblorp: support negative offsets in addresses
Lionel Landwerlin [Wed, 23 Nov 2022 07:26:42 +0000 (09:26 +0200)]
blorp: support negative offsets in addresses

Similar to anv_address

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9c1c1888d989 ("intel/fs: put scratch surface in the surface state heap")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19946>

22 months agovulkan/device-select-layer: drop wayland-protocols dep
Simon Ser [Mon, 21 Nov 2022 10:41:47 +0000 (11:41 +0100)]
vulkan/device-select-layer: drop wayland-protocols dep

wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

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

22 months agopanfrost: drop wayland-protocols dep
Simon Ser [Mon, 21 Nov 2022 10:41:26 +0000 (11:41 +0100)]
panfrost: drop wayland-protocols dep

wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

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

22 months agov3dv: drop wayland-protocols dep
Simon Ser [Mon, 21 Nov 2022 10:40:39 +0000 (11:40 +0100)]
v3dv: drop wayland-protocols dep

wayland-protocols is not a library, it just contains a bunch of
XML files. No need to try to link to it.

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

22 months agogallium/draw: do not use trig to compute tangent
Erik Faye-Lund [Tue, 22 Nov 2022 08:40:12 +0000 (09:40 +0100)]
gallium/draw: do not use trig to compute tangent

We've already done the expensive part of computing this without
trigenometry, e.g computing the length. So let's finish it off.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>

22 months agogallium/draw: properly fix short aalines
Erik Faye-Lund [Mon, 21 Nov 2022 12:28:00 +0000 (13:28 +0100)]
gallium/draw: properly fix short aalines

The fix we used to have for short smooth lines were incorrect, and
here's the real fix:

For lines shorter than one pixel, we need to clamp the length-wise
coverage to the line-length. That produces results that are consistent
with our approximation for longer lines.

Because we pass (length / 2) + 0.5 to the fragment shader instead of
the unmodified length, we need to spend a few instructions to
reconstruct the original width.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>

22 months agoaux/draw: vectorize aaline computations
Erik Faye-Lund [Mon, 21 Nov 2022 12:53:04 +0000 (13:53 +0100)]
aux/draw: vectorize aaline computations

This makes it a bit more similar to the TGSI version, which makes
modifying them easier to review.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19899>

22 months agodriconf: disable glthread for FINAL FANTASY XI
Jimi Huotari [Tue, 22 Nov 2022 16:59:14 +0000 (18:59 +0200)]
driconf: disable glthread for FINAL FANTASY XI

Enabling 'glthread' here causes textures to be missing/invisible.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7562
Signed-off-by: Jimi Huotari <chiitoo@gentoo.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19935>

22 months agoradv: fix number of PS samples with VK_AMD_mixed_attachment_samples
Samuel Pitoiset [Mon, 21 Nov 2022 17:40:56 +0000 (18:40 +0100)]
radv: fix number of PS samples with VK_AMD_mixed_attachment_samples

From the Vulkan spec:
    "If the VK_AMD_mixed_attachment_samples extension is enabled and
     the subpass uses color attachments, the samples value used to
     create each color attachment is used instead of
     rasterizationSamples."

Found by inspection, though I don't think this extension is widely
used.

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

22 months agoradv/ci: make use of the new VanGogh runners
Martin Roukala (né Peres) [Tue, 22 Nov 2022 13:38:42 +0000 (15:38 +0200)]
radv/ci: make use of the new VanGogh runners

I just added 3 new Steam Decks at my home CI, bringing the total count
to 5. Let's make use of 2 of these to reduce execution time in Mesa CI
and leave the last one available for DXVK-CI.

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

22 months agogenxml: forbid usage of L1CC_WBP/L1CC_UC for stateless messages
Lionel Landwerlin [Fri, 28 Oct 2022 22:39:04 +0000 (01:39 +0300)]
genxml: forbid usage of L1CC_WBP/L1CC_UC for stateless messages

We want to avoid those settings so that we do not have to emit a tile
fence to implement Wa_22013689345.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>

22 months agointel/fs: improve Wa_22013689345 workaround
Lionel Landwerlin [Tue, 16 Aug 2022 08:08:43 +0000 (08:08 +0000)]
intel/fs: improve Wa_22013689345 workaround

The initial implementation is a pretty big hammer. Implement the HW
recommendation to minimize cases in which we need a fence.

This improves by 10FPS on some of the Sascha Willems RT demos.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6031ad4bf690 ("intel/fs: Add Wa_22013689345")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>

22 months agointel/perf: Fix memory leak.
Vinson Lee [Sun, 20 Nov 2022 21:53:06 +0000 (13:53 -0800)]
intel/perf: Fix memory leak.

Fix defect with Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable pass_array going out of scope leaks the storage it points to.

Fixes: d4cbb665067 ("intel/perf: support more than 64 queries")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19888>

22 months agoanv: Set 3DSTATE_RASTER API mode as recomended
José Roberto de Souza [Tue, 22 Nov 2022 16:04:58 +0000 (08:04 -0800)]
anv: Set 3DSTATE_RASTER API mode as recomended

TGL+ specification ask the API mode to be set to DX10.1 for Vulkan API.

BSpec: 46947
Reference: TGL PRMs, Volume 2d: Command Reference: Structures: 3DSTATE_RASTER_BODY
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19934>

22 months agovenus: enable VK_KHR_push_descriptor
Dawn Han [Wed, 5 Oct 2022 21:46:12 +0000 (21:46 +0000)]
venus: enable VK_KHR_push_descriptor

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agovenus: implement vkCmdPushDescriptorSetWithTemplateKHR
Dawn Han [Mon, 31 Oct 2022 21:19:42 +0000 (21:19 +0000)]
venus: implement vkCmdPushDescriptorSetWithTemplateKHR

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agovenus: extend VkPipelineLayout lifetime for batched VkCmdPushConstants()
Dawn Han [Tue, 22 Nov 2022 20:52:56 +0000 (20:52 +0000)]
venus: extend VkPipelineLayout lifetime for batched VkCmdPushConstants()

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agovenus: extend lifetime of push descriptor set layout
Dawn Han [Mon, 31 Oct 2022 21:15:31 +0000 (21:15 +0000)]
venus: extend lifetime of push descriptor set layout

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>

22 months agoradeonsi/ci: update stoney fail -> flakes
David Heidelberg [Tue, 22 Nov 2022 23:29:53 +0000 (00:29 +0100)]
radeonsi/ci: update stoney fail -> flakes

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19941>

22 months agoci: split arm_test into arm{hf,64}_test
David Heidelberg [Sat, 5 Nov 2022 13:36:43 +0000 (14:36 +0100)]
ci: split arm_test into arm{hf,64}_test

Every barebone arm or aarch64 job depends on these.
When experimenting with CI, this job drags both kernel+rootfs_arm64 and armhf,
even when the latter is not used.

This should speed up development and relieve one instance for about 30 minutes
and overlap between finishing kernel+rootfs_arm64 and armhf jobs per change.

Here are some size stats:
old arm_test   904M (32+64)
new arm64_test 579M (64bit)
new armhf_test 402M (32bit)
---
both     ~ 981M (overhead is 81M overall, but never used together so it's only cost "at rest")

Runtime of the arm*_test jobs is ~ 2 minutes.

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: "Sergi Blanch Torné" <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19550>

22 months agoci/iris: Drop EGL copyteximage2d.12 xfail.
Emma Anholt [Tue, 22 Nov 2022 19:39:24 +0000 (11:39 -0800)]
ci/iris: Drop EGL copyteximage2d.12 xfail.

It is still marked as a flake (along with other copyteximage cases) on all
these boards, so this will reduce the CI IRC channel noise given that we
actually expect a Pass.  I haven't found where exactly in history we went
from generally-fail to generally-pass, but it looks like around Feb 2022.

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

22 months agoci/llvmpipe: Add headless Wayland testing using weston.
Emma Anholt [Fri, 18 Nov 2022 01:16:06 +0000 (17:16 -0800)]
ci/llvmpipe: Add headless Wayland testing using weston.

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

22 months agoci/llvmpipe: Drop NIR stress testing from deqp-egl.
Emma Anholt [Fri, 18 Nov 2022 01:15:31 +0000 (17:15 -0800)]
ci/llvmpipe: Drop NIR stress testing from deqp-egl.

This was a pasteo from deqp-gles31.

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

22 months agoci/vc4,v3d: Add headless wayland testing using weston.
Emma Anholt [Fri, 18 Nov 2022 00:55:34 +0000 (16:55 -0800)]
ci/vc4,v3d: Add headless wayland testing using weston.

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

22 months agoci/iris: Add headless Wayland testing using weston.
Emma Anholt [Fri, 18 Nov 2022 00:53:14 +0000 (16:53 -0800)]
ci/iris: Add headless Wayland testing using weston.

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

22 months agoci/freedreno: Add wayland testing using weston.
Emma Anholt [Thu, 17 Nov 2022 22:53:33 +0000 (14:53 -0800)]
ci/freedreno: Add wayland testing using weston.

Take the old EGL job and make it a suite, stop segregating the reset tests
now that we assign reset blame appropriately, and add a variant using
headless weston.  This catches two failures we weren't covering before.

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

22 months agoci/freedreno: Drop EGL wide_color and create_context flakes.
Emma Anholt [Tue, 22 Nov 2022 18:57:16 +0000 (10:57 -0800)]
ci/freedreno: Drop EGL wide_color and create_context flakes.

Haven't seen them since May 2021, when my current set of IRC logs start.
The color_clears, render, and sharing.gles2 flakes are definitely still
there.

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

22 months agoci/freedreno: Expire an old robustness flake.
Emma Anholt [Tue, 22 Nov 2022 18:55:28 +0000 (10:55 -0800)]
ci/freedreno: Expire an old robustness flake.

Last happened in January, and Rob made great strides in reset stability
since then so I think it's gone.

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

22 months agoci/deqp-runner: Drop dead code for DEQP_CASELIST_FILTER.
Emma Anholt [Fri, 18 Nov 2022 00:46:39 +0000 (16:46 -0800)]
ci/deqp-runner: Drop dead code for DEQP_CASELIST_FILTER.

The last user is now gone.

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

22 months agoci/freedreno: Stop segregating reset tests from non-reset tests in EGL.
Emma Anholt [Fri, 18 Nov 2022 00:43:33 +0000 (16:43 -0800)]
ci/freedreno: Stop segregating reset tests from non-reset tests in EGL.

Now that we assign reset blame appropriately, they're safe to run
together, and no single-threading.  I put these in a .toml because I'm
about to add another window system.

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

22 months agoci: Add weston to our rootfses for wayland testing.
Emma Anholt [Thu, 17 Nov 2022 19:13:42 +0000 (11:13 -0800)]
ci: Add weston to our rootfses for wayland testing.

We want to be able to test the wayland EGL platform code in Mesa, which
has had no coverage yet.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>

22 months agoci/softpipe: Add another blit flake.
Emma Anholt [Tue, 22 Nov 2022 18:41:53 +0000 (10:41 -0800)]
ci/softpipe: Add another blit flake.

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

22 months agoci/llvmpipe: Update some flakes/skips from IRC logs.
Emma Anholt [Fri, 18 Nov 2022 22:58:44 +0000 (14:58 -0800)]
ci/llvmpipe: Update some flakes/skips from IRC logs.

Acked-by: David Heidelberg <david.heidelberg@collabora.com> (prev version)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19912>

22 months agor600/sfn: allow building with clang 6 (Android 9)
Mauro Rossi [Mon, 7 Nov 2022 00:57:02 +0000 (01:57 +0100)]
r600/sfn: allow building with clang 6 (Android 9)

static constexpr const 'value' is replaced by static function
in all type_char template specializations
to avoid the following building errors happening with clang 6

/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::ExportInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::ExportInstr>(std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&, std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
...
/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::RatInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::RatInstr>(std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&, std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19873>

22 months agoaco: fix emitting DEALLOC_VGPRS in the discard block
Samuel Pitoiset [Tue, 22 Nov 2022 15:49:13 +0000 (16:49 +0100)]
aco: fix emitting DEALLOC_VGPRS in the discard block

It should be emitted right before s_endpgm.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19931>

22 months agoradv: fix possible hangs with NGG streamout and secondary cmdbuf
Samuel Pitoiset [Thu, 17 Nov 2022 04:43:33 +0000 (04:43 +0000)]
radv: fix possible hangs with NGG streamout and secondary cmdbuf

This was missing but it might hang if streamout is used only in
secondary command buffers.
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/19801>

22 months agoradv: fix NGG streamout when it's never enabled in runtime
Samuel Pitoiset [Thu, 17 Nov 2022 04:46:43 +0000 (04:46 +0000)]
radv: fix NGG streamout when it's never enabled in runtime

If a shader has XFB outputs but the application never enables
streamout in runtime (no buffers bound and no begin/end pair), we
have to disable it in the shader by emitting buffer size as 0. It's
also still needed to remember that the cmdbuf needs GDS/GDS OA BOs,
so move this at pipeline bind time instead.

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

22 months agoradv: re-mit streamout buffers to unbind them when NGG streamout is disabled
Samuel Pitoiset [Thu, 17 Nov 2022 09:43:21 +0000 (10:43 +0100)]
radv: re-mit streamout buffers to unbind them when NGG streamout is disabled

A buffer size as 0 acts like if streamout is disabled with NGG.

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

22 months agoradv: enable NGG XFB queries only if streamout is enabled
Samuel Pitoiset [Thu, 17 Nov 2022 09:40:01 +0000 (10:40 +0100)]
radv: enable NGG XFB queries only if streamout is enabled

Otherwise, it's possible to increase counters if a shader has XFB but
the application paused it.

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

22 months agoradv: fix computing the pervertex LDS size with NGG streamout
Samuel Pitoiset [Thu, 17 Nov 2022 07:07:25 +0000 (08:07 +0100)]
radv: fix computing the pervertex LDS size with NGG streamout

The NGG streamout lowering pass allocates space for all outputs which
means we have to align our computation. Otherwise, the maximum number
of vertices is incorrect and we end up by reaching the maximum allowed
LDS size. This code could be shared instead of being duplicated but
that's for later.

Fixes some transform feedback tests with Zink and
RADV_PERFTEST=ngg_streamout on GFX10.3.

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

22 months agoradv: stop overallocating LDS for VS/TES when NGG streamout is enabled
Samuel Pitoiset [Thu, 17 Nov 2022 06:53:24 +0000 (07:53 +0100)]
radv: stop overallocating LDS for VS/TES when NGG streamout is enabled

The number of shader outputs should only be considered when the
shader has XFB, otherwise we are overallocating LDS.

fossils-db (GFX1100):
Totals from 16602 (12.31% of 134913) affected shaders:
LDS: 17000448 -> 8500224 (-50.00%)

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

22 months agoadd zink to macos ci
noasakurajin [Fri, 4 Nov 2022 16:39:10 +0000 (16:39 +0000)]
add zink to macos ci

 This commit causes zink to be build in the macos ci on every commit.
 In addition to that meson will now error if there is no moltenvk-dir
 given on macos since the build would fail anyways.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19531>

22 months agoetnaviv: nir: lower extract byte/word
Christian Gmeiner [Tue, 15 Nov 2022 12:14:15 +0000 (13:14 +0100)]
etnaviv: nir: lower extract byte/word

Fixes e.g. 'Unhandled ALU op: extract_u16' seen with deqp on gc7000.

Cc: 22.3 mesa-stable
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>

22 months agoetnaviv: Support negative float inline immediates
Christian Gmeiner [Fri, 11 Nov 2022 18:05:24 +0000 (19:05 +0100)]
etnaviv: Support negative float inline immediates

Closes: #7652
Fixes: 45a111c21c2 ("nir/opt_algebraic: Fuse c - a * b to FMA")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>

22 months agoetnaviv: fix NULL pointer dereference in TS allocation
Lucas Stach [Tue, 22 Nov 2022 09:21:43 +0000 (10:21 +0100)]
etnaviv: fix NULL pointer dereference in TS allocation

Commit c2b06e1a3820 ("etnaviv: add support for sharing the TS buffer")
introduced a problem similar to the one fixed in 3b3cd5128672 ("etnaviv:
fix renderonly check in etna_resource_alloc") in a different code path.
This causes a NULL pointer dereference when the screen is instanciated
on the render node. Fix it in the same way by just checking for a valid
pointer.

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

22 months agoanv: enable sample location enable dynamic state
Lionel Landwerlin [Tue, 22 Nov 2022 10:22:06 +0000 (12:22 +0200)]
anv: enable sample location enable dynamic state

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

22 months agomicrosoft/nir_to_dxil: Avoid emitting SampleCmpLevel prior to SM 6.7 if possible
Pedro J. Estébanez [Mon, 21 Nov 2022 11:56:37 +0000 (12:56 +0100)]
microsoft/nir_to_dxil: Avoid emitting SampleCmpLevel prior to SM 6.7 if possible

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

22 months agorusticl: Emit build-id in libRusticlOpenCL
Tomeu Vizoso [Tue, 22 Nov 2022 11:39:53 +0000 (12:39 +0100)]
rusticl: Emit build-id in libRusticlOpenCL

Drivers may need it for their on-disk shader caches.

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

22 months agov3d: make format/modifier logic easier to read
Eric Engestrom [Mon, 21 Nov 2022 15:37:54 +0000 (15:37 +0000)]
v3d: make format/modifier logic easier to read

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19900>

22 months agonir: convert nir_opt_idiv_const to nir_shader_instructions_pass
Constantine Shablya [Sun, 20 Nov 2022 11:06:17 +0000 (13:06 +0200)]
nir: convert nir_opt_idiv_const to nir_shader_instructions_pass

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

22 months agoetnaviv: remove use of flush_seqno as trigger for texture cache invalidate
Lucas Stach [Wed, 16 Nov 2022 16:15:07 +0000 (17:15 +0100)]
etnaviv: remove use of flush_seqno as trigger for texture cache invalidate

The flush_seqno is only to be used/updated when a dirty tile status has
been written back to the resource. Using it as a marker to trigger a
texture cache invalidation is bogus and not actually needed. When the
texture resource is updated via a mapping or blit the texture cache
invalidation is already triggered by marking the caches as dirty. If the
resource is updated by fragment output, OpenGL explicitly defines the
result of a later texture read as undefined unless a TextureBarrier is
inserted, which also properly triggers the texture cache invalidate.

Also the current check is bogus as it doesn't handle seqno wraparound.

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

22 months agoetnaviv: mark texture caches as dirty when blitting into a sampler resource
Lucas Stach [Wed, 16 Nov 2022 16:27:38 +0000 (17:27 +0100)]
etnaviv: mark texture caches as dirty when blitting into a sampler resource

Same as with resource mappings the blit can target a resource that may be
cached in the texture cache. Mark the cache as dirty to make sure it is
invalidated before the next draw.

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

22 months agoetnaviv: drop useless ts_for_sampler_view pointer check
Lucas Stach [Wed, 16 Nov 2022 15:24:54 +0000 (16:24 +0100)]
etnaviv: drop useless ts_for_sampler_view pointer check

Both state and desc texture implementations set this function pointer,
so there is no point in guarding against its absence.

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

22 months agost/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap
Marek Olšák [Thu, 17 Nov 2022 13:31:33 +0000 (08:31 -0500)]
st/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap

This might fix some window system issues.

Fixes: 3da170faaec - glthread: change when glFlush flushes asynchronously

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19809>

22 months agoutil/glsl2spirv: don't store preprocessed files in source tree
Lionel Landwerlin [Sun, 20 Nov 2022 22:00:22 +0000 (00:00 +0200)]
util/glsl2spirv: don't store preprocessed files in source tree

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19893>

22 months agofreedreno,tu,ir3: DCE ij_pix
Danylo Piliaiev [Thu, 10 Nov 2022 14:40:48 +0000 (15:40 +0100)]
freedreno,tu,ir3: DCE ij_pix

SP_FS_PREFETCH_CNTL.IJ_WRITE_DISABLE allows disabling ij write, so
now we could DCE it.

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

22 months agofreedreno,tu: Update SP_FS_PREFETCH,SP_FS_PREFETCH_CNTL regs definition
Danylo Piliaiev [Thu, 10 Nov 2022 14:38:28 +0000 (15:38 +0100)]
freedreno,tu: Update SP_FS_PREFETCH,SP_FS_PREFETCH_CNTL regs definition

Reverse engineer more fields of these regs.

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

22 months agomesa: add unlikely() and adjust error handling in BindBuffer
Marek Olšák [Fri, 18 Nov 2022 10:13:42 +0000 (05:13 -0500)]
mesa: add unlikely() and adjust error handling in BindBuffer

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>

22 months agomesa: add no_error support into get_buffer_target()
Marek Olšák [Thu, 17 Nov 2022 17:02:16 +0000 (12:02 -0500)]
mesa: add no_error support into get_buffer_target()

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>

22 months agomesa: remove ctx->Extensions.EXT_pixel_buffer_object capability flag
Marek Olšák [Thu, 17 Nov 2022 16:15:56 +0000 (11:15 -0500)]
mesa: remove ctx->Extensions.EXT_pixel_buffer_object capability flag

to get rid of the fail path in get_buffer_target.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19844>

22 months agoetnaviv: fix tile status interaction with write mappings
Lucas Stach [Fri, 18 Nov 2022 11:24:58 +0000 (12:24 +0100)]
etnaviv: fix tile status interaction with write mappings

This fixes a longstanding bug in the interaction between TS and a write
mapping. The write does not update TS regardless of the way the update
is done. Update via etna_copy_resource would just set the target ts_valid
to false without actually writing back any dirty TS to the resource.
Writes via the CPU would update the resource, but keep ts_valid at true
even if the tile status may now not match the actually written tiles of
the resource anymore.

Fix this by writing back a dirty TS to the target resource if needed
before updating the level with the write data. Always invalidate TS,
even when the update is done by the CPU.

Cc: mesa-stable
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/19846>

22 months agoanv: fixup context initialization on DG2
Lionel Landwerlin [Tue, 22 Nov 2022 08:47:58 +0000 (10:47 +0200)]
anv: fixup context initialization on DG2

Fixing a typo :(

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 507a86e131d6 ("anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19922>

22 months agoCODEOWNERS: add MTCoster as an Imagination maintainer
Frank Binns [Thu, 17 Nov 2022 11:36:53 +0000 (11:36 +0000)]
CODEOWNERS: add MTCoster as an Imagination maintainer

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19845>

22 months agoutil: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly
Yonggang Luo [Mon, 21 Nov 2022 11:01:50 +0000 (19:01 +0800)]
util: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly

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

22 months agotree-wide: Fixes multi-line macro width after replace to __func__
Yonggang Luo [Sun, 20 Nov 2022 04:50:41 +0000 (12:50 +0800)]
tree-wide: Fixes multi-line macro width after replace to __func__

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agogallium: __FUNCTION__ now never be used, remove it
Yonggang Luo [Thu, 17 Nov 2022 21:40:21 +0000 (05:40 +0800)]
gallium: __FUNCTION__ now never be used, remove it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agogallium: Replace the usage of __FUNCTION__ with __func__ in all gallium code
Yonggang Luo [Thu, 17 Nov 2022 21:39:49 +0000 (05:39 +0800)]
gallium: Replace the usage of __FUNCTION__ with __func__ in all gallium code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agotree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code
Yonggang Luo [Thu, 17 Nov 2022 21:38:36 +0000 (05:38 +0800)]
tree-wide: Use __func__ instead of __FUNCTION__ in non-gallium code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19861>

22 months agomeson: do not use source_root() when possible
Danylo Piliaiev [Tue, 1 Nov 2022 16:42:08 +0000 (17:42 +0100)]
meson: do not use source_root() when possible

source_root() function is deprecated in Meson version 0.56.0 because
it returns the source root of the parent project if called from a
subproject.

Why would anyone need Mesa as a meson subproject?
It would be used as subproject in a project generated by command buffer
"decompiler" for Freedreno.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19901>

22 months agoac/nir/cull: fix culling for lines
Qiang Yu [Sat, 19 Nov 2022 09:48:22 +0000 (17:48 +0800)]
ac/nir/cull: fix culling for lines

Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19868>

22 months agoac/nir/ngg,radv: use intrinsic base for instance_rate_inputs check
Qiang Yu [Thu, 17 Nov 2022 02:17:21 +0000 (10:17 +0800)]
ac/nir/ngg,radv: use intrinsic base for instance_rate_inputs check

radeonsi use packed location base while radv use un-packed location.
So we adjust instance_rate_inputs in each driver to hide the difference.
Note the attribute slot number is less than 16, so we can shift
instance_rate_inputs in radv by VERT_ATTRIB_GENERIC0 which is 16.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19868>

22 months agovulkan: Add a dummy vk_common_CmdSetColorBlendAdvancedEXT()
Jason Ekstrand [Thu, 17 Nov 2022 16:40:58 +0000 (10:40 -0600)]
vulkan: Add a dummy vk_common_CmdSetColorBlendAdvancedEXT()

The entrypoint needs to exist but we don't need to do anything with it.

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>

22 months agovulkan: Add a common implementation of CmdSetSampleLocationsEnableEXT
Jason Ekstrand [Thu, 17 Nov 2022 16:39:05 +0000 (10:39 -0600)]
vulkan: Add a common implementation of CmdSetSampleLocationsEnableEXT

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>

22 months agovulkan: Add state for extraPrimitiveOverestimationSize
Jason Ekstrand [Thu, 17 Nov 2022 16:35:49 +0000 (10:35 -0600)]
vulkan: Add state for extraPrimitiveOverestimationSize

Fixes: 13c422e1b2ed ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>

22 months agorusticl: advertise conformance on 12th Intel iGPUs
Karol Herbst [Sat, 12 Nov 2022 16:10:59 +0000 (17:10 +0100)]
rusticl: advertise conformance on 12th Intel iGPUs

Submission can be found here:
https://www.khronos.org/conformance/adopters/conformant-products/opencl#submission_405

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Hard-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19699>

22 months agoanv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled
Lionel Landwerlin [Sat, 19 Nov 2022 01:35:27 +0000 (03:35 +0200)]
anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled

We need to set CPS_MODE_NONE when no per coarse pixel dispatch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 231651fd89fb ("anv: implement VK_KHR_fragment_shading_rate")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>

22 months agoanv: fix 3d state initialization
Lionel Landwerlin [Sat, 19 Nov 2022 12:29:43 +0000 (14:29 +0200)]
anv: fix 3d state initialization

We missed a couple of restriction leading to inconsistent 3d pipeline
state. It is mostly noticeable when doing a multiple sample dispatch
as the verify first 3d operation.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7531
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>

22 months agonir/loop_analyze: Fix get_iteration for nir_op_fneu
Ian Romanick [Mon, 9 Aug 2021 22:05:33 +0000 (15:05 -0700)]
nir/loop_analyze: Fix get_iteration for nir_op_fneu

Consider the loop:

    float i = 0.0;
    while (true) {
       if (i != 0.0)
          break;

       i = i + 1.0;
    }

This loop clearly executes exactly one time.

Some trickery is necessary to handle cases where the initial loop value
is very large and the increment is, by comparison, very small.  From the
fenu_once test case,

    float i = -604462909807314587353088.0;
    while (true) {
       if (i != -604462909807314587353088.0)
          break;

       i = i + 36028797018963968.0;
    }

This loop should also execute exactly once, but this is much more
challenging to calculate due to precision issues.

Going towards smaller magnitude (i.e., adding a small positive value to
a large negative value) requires a smaller delta to make a difference
than going towards a larger magnitude. For this reason,
-604462909807314587353088.0 + 36028797018963968.0 !=
-604462909807314587353088.0, but -604462909807314587353088.0 +
-36028797018963968.0 == -604462909807314587353088.0. Math class is
tough.

No changes in shader-db or fossil-db.

v2: Fix major bug in checking result of the eval_const_binop(nir_op_feq,
...) discovered while developing fneu_once_easy unit test. Fix a typo in
the comment just above that. Add fneu_once_easy test.

v3: Skip the iteration count adjustment tests for nir_op_fenu and
nir_op_ine. Since the iteration count is either 1 or unknown, all this
function can do is add numerical error. Add fenu_once tests.

v4: Change the initial value in the fneu_once test from large positive
to large negative. Change check in get_iteration from nir_op_fsub to
nir_op_fadd. Both changes from discussion with M Henning. Also add some
more explanation in fneu_once.

v5: Rename test cases.

Fixes: 6772a17acc8 ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>

22 months agonir/loop_analyze: Fix get_iteration for nir_op_ine
Ian Romanick [Mon, 9 Aug 2021 22:05:33 +0000 (15:05 -0700)]
nir/loop_analyze: Fix get_iteration for nir_op_ine

I discovered this problem because adding an algebraic transformation to
convert some uge and ult to ieq or ine caused a couple loops to stop
unrolling. Consider the loop:

    uint i = 0;
    while (true) {
       if (i >= 1)
          break;

       i++;
    }

This loop clearly executes exactly one time. Note that uge(x, 1) is
equivalent to ine(x, 0). Changing the condition to 'if (i != 0)' will
also execute exactly one time.

In the added test cases, uge_once correctly get an exact loop trip count
of 1. Without the changes to nir_loop_analyze.c, the ine_once case
detects a maximum loop trip count of zero and does not get an exact loop
trip count.

No changes in shader-db or fossil-db.

v2: Move nir_op_fneu changes to a separate commit.

v3: Rename test cases.

Fixes: 6772a17acc8 ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>

22 months agonir/loop_analyze: Add basic unit test framework
Ian Romanick [Tue, 15 Nov 2022 03:07:06 +0000 (19:07 -0800)]
nir/loop_analyze: Add basic unit test framework

This test comes from a comment in the loop analysis code.

The ine_zero test checks that zero iteration loops involving ine are
correctly identified.

v2: Add ine_zero test. Suggested by Tim.

v3: Rename test cases.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>

22 months agorusticl/device: put space at the end of CL_DEVICE_VERSION
Karol Herbst [Sat, 19 Nov 2022 20:44:28 +0000 (21:44 +0100)]
rusticl/device: put space at the end of CL_DEVICE_VERSION

Apparently some software relies on that and the spec kind of says it's
there.

Fixes: 20c90fed5a0 ("rusticl: added")
Reported-by: sobkas
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19872>

22 months agoegl: Fix uninitialized variable warning
Adam Jackson [Mon, 21 Nov 2022 20:46:03 +0000 (15:46 -0500)]
egl: Fix uninitialized variable warning

Fedora's gcc 12.2.1 says:

    ../src/egl/main/eglapi.c: In function ‘eglDupNativeFenceFDANDROID’:
    ../src/egl/main/eglapi.c:2268:11: warning: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
     2268 |    EGLint ret;

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19913>

22 months agor300: don't reuse destination registers when lowering
Pavel Ondračka [Wed, 16 Nov 2022 21:09:50 +0000 (22:09 +0100)]
r300: don't reuse destination registers when lowering

Regalloc can sort it out later. No significant change is shader-db, the
one instruction reduction is likely because some optimize pass can
actually work better when we are closer to ssa-like form.

RV530:
total instructions in shared programs: 133718 -> 133717 (<.01%)
instructions in affected programs: 47 -> 46 (-2.13%)
helped: 1
HURT: 0

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>

22 months agor300: simplify rc_find_free_temporary
Pavel Ondračka [Fri, 7 Oct 2022 20:02:40 +0000 (22:02 +0200)]
r300: simplify rc_find_free_temporary

Back when we had a stupid register allocator we did a lot of tricks to
optimize the register usage. The old version of rc_find_free_temporary
did a full program search each time it was called to find out what
registers and channels are actually used and than used that info to give
us the first free register to use.

Now that we have a proper register allocator both for vertex and
fragment shaders, this is no longer needed. Just scan the program when
called for the first time to find the first unused temporary index and
than increment by one everytime. Regalloc can sort it out later.

No change in shader-db confirms this assumption is sound.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19853>

22 months agofreedreno/a6xx: Remove unneeded MSAA clear fallback
Rob Clark [Tue, 15 Nov 2022 17:19:19 +0000 (09:19 -0800)]
freedreno/a6xx: Remove unneeded MSAA clear fallback

This was added in commit 911ce374caf ("freedreno/a6xx: Fix MSAA clear"),
but the only case that can't handle fast-clear is sysmem blitter clear
path.

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