Compare commits

..

8992 Commits

Author SHA1 Message Date
Eric Engestrom
2fab92ed9a docs: close the 23.2 cycle
There won't be any more 23.2.x releases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26988>
2024-01-11 10:54:24 +00:00
Samuel Pitoiset
6f6905fc94 radv: move all per-device keys from radv_pipeline_key to radv_device_cache_key
radv_device_cache_key contains everything per-device, while
radv_pipeline_key is more like per-pipeline keys.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948>
2024-01-11 08:37:36 +00:00
Samuel Pitoiset
4d44cea3e0 radv: introduce radv_device_cache_key for per-device cache compiler options
This replaces RADV_HASH_SHADER_xxx by radv_device_cache_key which is
a new struct that contains per-device compiler options. More options
will be moved there.

Blake3 is used to replace sha1.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948>
2024-01-11 08:37:36 +00:00
Samuel Pitoiset
dc857e5c9e radv: initialize radv_device::disable_trunc_coord earlier
The per-device cache key will need to be initialized before compiling
any meta shaders, so this needs to be done earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948>
2024-01-11 08:37:36 +00:00
Samuel Pitoiset
10a25f39df radv: move RADV_HASH_SHADER_KEEP_STATISTICS to radv_pipeline_key
This is more like a per-pipeline option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948>
2024-01-11 08:37:35 +00:00
Samuel Pitoiset
4455c79299 radv: add missing disable_shrink_image_store to the pipeline key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26948>
2024-01-11 08:37:35 +00:00
Samuel Pitoiset
3f655bc47c radv: do not issue SQTT marker with DISPATCH_MESH_INDIRECT_MULTI
According to PAL, only DISPATCH_TASKMESH_GFX is supposed to emit a
SQTT marker as part of the packet, probably because there is also
a packet emitted on ACE for executing task shaders.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10401
Fixes: 312103e0ff ("radv: set THREAD_TRACE_MARKER_ENABLE for mesh/task draws")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26936>
2024-01-11 07:59:40 +00:00
Iago Toral Quiroga
f37bb34d86 v3dv: expose VK_EXT_subgroup_size_control
This is trivial for us since we don't support variable subgroup sizes.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26968>
2024-01-11 07:21:36 +00:00
Yiwei Zhang
0b0c0511b8 venus: allow to retrieve pipeline cache on TLS ring
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26838>
2024-01-11 06:05:01 +00:00
Yiwei Zhang
bec287b2a2 venus: clean up secondary ring
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26838>
2024-01-11 06:05:01 +00:00
Yiwei Zhang
945165acad venus: TLS ring
This change adds a new venus feature: TLS ring
- co-owned by TLS and VkInstance
- initialized in TLS upon requested
- teardown happens upon thread exit or instance destroy
- teardown is split into 2 stages:
  1. one owner locks and destroys the ring and mark destroyed
  2. the other owner locks and frees up the tls ring storage

TLS ring supercedes the prior secondary ring and enables multi-thread
shader compilation and reduces the loading time of ROTTR from ~110s to
~21s (native is ~19s).

TLS ring is in fact a synchronous ring by design, and can be used to
redirect all exisiting synchronous submissions trivially. e.g. upon any
vn_call_*, request a TLS ring, wait for deps and then submit.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26838>
2024-01-11 06:05:01 +00:00
Yiwei Zhang
30316246d0 venus: make tls hint specific to pipeline creation
This is to prepare for a new multi-ring design. A preview is as below:
- primary ring will migrate to be asynchronous only
- synchronous commands will be via thread local rings
- pipeline creations will be synchronous and dispatched to thread local
  rings unless being forced to be async on primary ring
- perf option no_multi_ring is made generic to force a single ring

Pipeline cache retrieval is temporarily moved back to primary ring, but
will be moved to thread local later since it's a synchronous command.
The dependency resolving will follow the same with pipeline create with
detailed rationale later.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26838>
2024-01-11 06:05:01 +00:00
Juston Li
813b1939f6 venus: add LRU cache eviction for image mem reqs cache
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26118>
2024-01-11 01:40:06 +00:00
Juston Li
b51ff22fbe venus: support caching image memory requirements
Similar idea to buffer memory requirements cache but CreateImage has
many more params that may affect the memory requirements.

Instead of a sparse array, generate a SHA1 hash of all the relevant
VkImageCreateInfo params including relevant pNext structures and use
part of the hash as a key to a hash table that stores the cache entries.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26118>
2024-01-11 01:40:06 +00:00
Juston Li
a32d76b545 venus: use vk_format helper for plane count
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26118>
2024-01-11 01:40:06 +00:00
Juston Li
cb12a22264 venus: rename buffer cache to buffer reqs cache
Be more explicit in the name that it caches buffer memory requirements.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26118>
2024-01-11 01:40:06 +00:00
Daniel Stone
f2a593f756 ci: Re-enable Collabora farm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26970>
2024-01-10 22:59:06 +00:00
Roman Stratiienko
4afcd0c6d6 u_gralloc: Add support for gbm_gralloc
Although gbm_gralloc has not been maintained for a long time, it is still
used in android-x86, BlissOS and WayDroid. Let's add support so that
x86 drivers no longer need to request tiling flags from the kernel.

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Tested-by: HMTheBoy154 <buingoc67@gmail.com>  # BlissOS 15 & Mesa 23.3.2
Tested-by: Mauro Rossi <issor.oruam@gmail.com>  # android-x86 for mesa 24.0.0-devel on Skylake GT2
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25380>
2024-01-10 22:26:18 +00:00
Eric Engestrom
b1c8ce172f docs: update calendar for 23.3.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26986>
2024-01-10 22:19:08 +00:00
Eric Engestrom
4895e00d26 docs: add sha256sum for 23.3.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26986>
2024-01-10 22:19:08 +00:00
Eric Engestrom
abf500ec84 docs: add release notes for 23.3.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26986>
2024-01-10 22:19:08 +00:00
Matt Turner
4ed0957ce7 nir/tests: Reenable tests that failed on big-endian
These tests were disabled due to the bug fixed in the previous commit.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26964>
2024-01-10 21:47:30 +00:00
Matt Turner
5997cf7587 nir: Fix cast
We were wrongly telling `nir_const_value_as_uint()` that `iter` had
`bit_size` bits, but in one case it is explicitly i64. This works on
little endian platforms, but caused the nir_loop_unroll_test.fadd{,_rev}
tests to fail on big endian platforms.

Bug: https://bugs.gentoo.org/921297
Fixes: 268ad47c11 ("nir/loop_analyze: Handle bit sizes correctly in calculate_iterations")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26964>
2024-01-10 21:47:30 +00:00
Yiwei Zhang
3923d43908 meson/vulkan/util: allow venus to drop compiler deps
Files to compile: 451 => 232

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26783>
2024-01-10 21:06:35 +00:00
Eric Engestrom
fb93475139 ci/deqp: set default platform to default instead of glx, to also support wayland
In our case (because we have the libs installed),
`-D DEQP_TARGET=default` = `xlib` (what `-D DEQP_TARGET=x11_glx` enables) + `xcb` + `wayland`

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26896>
2024-01-10 20:13:01 +00:00
Eric Engestrom
e1935daa19 ci: convert several find | xargs to find -exec
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26896>
2024-01-10 20:13:01 +00:00
Matt Turner
0ab7ea56b2 symbols-check: Add _GLOBAL_OFFSET_TABLE_
This is exported on hppa/parisc.

See also: https://gitlab.freedesktop.org/glvnd/libglvnd/-/merge_requests/291

Cc: mesa-stable
Bug: https://bugs.gentoo.org/908079
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26978>
2024-01-10 19:25:05 +00:00
Lionel Landwerlin
62c21c240e anv: remove ANV_ENABLE_GENERATED_INDIRECT_DRAWS variable
We have a threshold drirc value & environment variable.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26967>
2024-01-10 18:32:24 +00:00
Samuel Pitoiset
59c05b9cfa Revert "radv/rt: Lower ray payloads to registers"
This causes GPU hangs with vkd3d-proton in CI.

This reverts commit 658ce711d5.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26983>
2024-01-10 18:12:55 +00:00
Alessandro Astone
a077c14f15 zink: Fix resizable BAR detection logic
This was broken in two ways:
* When looking for the MAX biggest_ram it was actually comparing
  a candidate against biggest_vis_ram

* mem_props.memoryTypes[] should be accessed with the memory type
  index as found in heap_map

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10341
Cc: 23.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26979>
2024-01-10 17:53:21 +00:00
Ruijing Dong
9d1e69ca45 radeonsi/vcn: update session_info from vcn3 and up.
session_info needs to be updated to vcn4 and up, since
it is safe to change it from vcn3 to cover all the needed
VCNs, thus this change came from VCN3.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26940>
2024-01-10 17:36:06 +00:00
David Heidelberg
39616c13e0 ci/rootfs: add libdrm also inside the rootfs
Fixes: 4023301010 ("ci: enable ci-deb-repo for libdrm 2.4.119 (and others in the future)")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26971>
2024-01-10 16:39:20 +00:00
Eric Engestrom
0960fd5e8a ci: split & reuse debian version identifier
It was set on non-debian containers, and it was missing on debian-based
rootfs containers.

Fixes: 4023301010 ("ci: enable ci-deb-repo for libdrm 2.4.119 (and others in the future)")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26971>
2024-01-10 16:39:20 +00:00
Samuel Pitoiset
41cbd6f735 radv: rework declaring color arguments for PS epilogs
Rely on the actual FS outputs instead of the spi shader col format,
this is safer and it will help for future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26903>
2024-01-10 16:10:15 +00:00
Max R
75fa621d34 d3d10umd: Fix compilation
Fixes: 4eb4c9bba ("d3d10umd: use cso_context to set vertex buffers and elements")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10054
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26370>
2024-01-10 15:52:52 +00:00
Mike Blumenkrantz
0444d057ae zink: ignore tc buffer replacement info
without tc tracking cross-context buffer usage, this is intensely broken

Fixes: 96cf4531e1 ("Revert "gallium/u_threaded: buffer sharedness tracking"")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26959>
2024-01-10 15:35:12 +00:00
Mike Blumenkrantz
6e4d901a2e zink: fix buffer rebind early-out check
this was accidentally inverted; the rebind attempt is over if the
number of enacted rebinds >= the expected rebinds

Fixes: c32bcb9a8c ("zink: improve handling of buffer rebinds using tc info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26959>
2024-01-10 15:35:12 +00:00
Alyssa Rosenzweig
8ddd89ffa5 nir,zink: Redefine flat_mask in terms of I/O locations
Robust against separable shaders, and still makes sense for lowered I/O drivers,
whereas just counting FS variables and expecting them to match with the VS is...
questionable.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: antonino <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26888>
2024-01-10 14:30:14 +00:00
Roman Stratiienko
efe12ae7ee egl/android: Switch to generic buffer-info code
Switch to a new common buffer-info layer. After this change, the virgl
fallback logic is changed, but it should work as well.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24374>
2024-01-10 14:09:23 +00:00
Martin Roukala (né Peres)
ff82868a60 Revert "ci: disable mupuf's farm"
This reverts commit f5125637c085cd4b9bd6fe07813a2505aa3196cb, now that
the electricity rework is over.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26974>
2024-01-10 13:49:07 +00:00
Alyssa Rosenzweig
bec61b72b1 agx: clang-fmt
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5948e7ec2e agx: unit test split uniform opt
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
ab7fb3d400 asahi: don't canonicalize nans/flush denorms when copying
CL image copies

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5cd7416542 asahi: fallback some resource copies
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
355af1e903 agx: require min alignment for load/store vectorize
fixes test_basic vload_constant

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
96cd467559 agx: add unit test for pcopy lowering bug
hit by test_basic.local_kernel_scope

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5b50040c51 agx: fix 64-bit phis with inlined immediates
test_basic  local_kernel_scope

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
1f0abffdaf agx: expand agx_index
cl kernels can be large.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
51f8bded0e agx: optimize split(64-bit uniform)
Trying to clean up CL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
344ec42587 asahi: add missing tib alignment check
+ unit test replicating issue.

Fixes arb_sample_shading-builtin-gl-sample-mask-mrt-alpha-to-coverage

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
dd42bf84a3 asahi: fix passthrough GS with poly modes
affects wireframe xfb piglits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
10d48979ce asahi: make txf robust properly
KHR-NoContext.gl43.robust_buffer_access_behavior.texel_fetch

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
f6d5832b6c asahi: plumb get_ubo_size
for robustness lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
21aaba5b83 asahi: inline something silly
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
27e3e88f18 asahi: rotate xfb'd tri strips
spec req.

GTF-GL46.gtf30.GL3Tests.transform_feedback.transform_feedback_geometry

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
f70da4e920 asahi: factor out libagx_map_vertex_in_tri_strip
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
9d78e40735 asahi: cl-ify some xfb logic
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
76e8a68249 asahi: link libagx before lowering mem access widths
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
c688db1fd7 asahi: add missing GS line strip (+adj) handling
How did this pass GLES CTS?!

GTF-GL46.gtf31.GL3Tests.primitive_restart.primitive_restart_mode

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
ed05cfb674 asahi: disable fp16 cbuf cap
GTF-GL46.gtf21.GL2Tests.glGetUniform.glGetUniform

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
dd840eb501 asahi: divide by xfb stride for xfb draws
KHR-GL46.transform_feedback.draw_xfb_stream_instanced_test

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
8ce71e5b88 asahi: invert program_point_size
make 0 the default value.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5eae46d9ea asahi: rm agx_vbufs wrapper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
9192d8367b asahi: rm vbuf.count from key
Unused and causing piles of shader variants in STK. Yikes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
13603bedc7 asahi: rm blend->store from shader key
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
3f094e635f asahi: rm nr_cbufs from key
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
d31d0af5c5 asahi: rm logicop enable bit
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
1bdf189393 asahi: rm unused blend enable bit
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
97f9f7ab0a asahi: implement point sprites w/o shader key
we can replace varyings with point sprites, we just need to fix up .zw
appropriately. do that with some bcsels, ALU is cheap.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
ba0f28ad8b asahi: rm layered bit from shader key
Just always use layered, like AGXV. This was a pointless bit of optimization
that only affects render target spilling with neglible impact.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5931862c29 asahi: rm pointless multisample key bit
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
78614653a6 asahi: bump vertex shader outputs
KHR-Single-GL46.enhanced_layouts.xfb_explicit_location

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
a20c693b7f agx: fix xfb of invalid var
KHR-Single-GL44.enhanced_layouts.xfb_capture_struct

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
e0c1776187 agx: fix xfb of invalid comp
KHR-Single-GL44.enhanced_layouts.xfb_capture_inactive_output_component

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
4071baf1b3 agx: const fold after discard lowering
to avoid silly xor op with an unconditional discard.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
1006e27627 asahi: implement xfb overflow queries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
c4fd1abc8b asahi: stub qbo on the cpu
allowed by spec, perf will suck of course.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
6deaaaa46a asahi: rework compute emptiness tracking
from debugging tess.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
33229d4ace agx: handle imm inlining into phis
allows better coalescing

total instructions in shared programs: 1881875 -> 1881745 (<.01%)
instructions in affected programs: 169787 -> 169657 (-0.08%)
helped: 288
HURT: 234
Instructions are helped.

total bytes in shared programs: 12332916 -> 12323788 (-0.07%)
bytes in affected programs: 1958846 -> 1949718 (-0.47%)
helped: 778
HURT: 108
Bytes are helped.

total halfregs in shared programs: 498490 -> 498126 (-0.07%)
halfregs in affected programs: 6960 -> 6596 (-5.23%)
helped: 102
HURT: 28
Halfregs are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
efeed6a6fc agx: prepare for immediates in phis
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
b7585851d0 agx: allow phis with 16bit imms
could do 32-bit too..

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
d8391860d9 agx: use mov imm for pcopies
allows bigger imms. no shaderdb changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
6102c866d1 agx: use custom assert when packing
so it dumps out the context of what we're packing. much friendly for debug.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
b8c80c5e80 agx: mv agx_read/write_regs to validator
since agx_index::channels is now always correct.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
b7da198274 agx: trust in agx_index size
validated.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
75d911f0ee agx: add index size helper
to replace the switches.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
8e938d48f5 agx: rm outdated comment
no more logical ends

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
a65f17bfea agx: rm silly todo
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
7f1ec658e9 agx: validate post-RA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
f0b8d933fc agx: make vec widths explicit in IR
no functional changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Asahi Lina
caee8a3114 agx: Add scoreboarding to stack instructions
These are basically device loads/stores and behave similarly.

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/26963>
2024-01-10 08:44:38 -04:00
Asahi Lina
f5ea767625 agx: Fix packing of stack map/unmap
We got the register indices wrong...

Signed-off-by: Asahi Lina <lina@asahilina.nt>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Alyssa Rosenzweig
5009e48748 agx: skip scoreboard bit in builder for !wait
it's supposed to be set late, not at build-time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:38 -04:00
Asahi Lina
7fff5a128b asahi: Implement BO alignment
The stack/scratch blocks need to be aligned to greater than the page
size in some cases. Add support for allocating BOs with a given
alignment in GPU VA space.

To avoid having to touch all callers, this adds a new function
agx_bo_create_aligned() for this purpose.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Asahi Lina
4dcb0d40d2 asahi: Add .editorconfig for CL files
These are formatted with 3-space indents like our C code, so tell
editors about it.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
i509VCB
d30b0adddb agx: remove internal agx_device queue
The internal queue is unusued by agxv. An earlier commit changed the gallium driver to initialize it's own queue.

Signed-off-by: i509VCB <git@i509.me>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
i509VCB
8f52e72686 asahi: create queue for screen
Signed-off-by: i509VCB <git@i509.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
43fc09a0d8 agx: implement query_levels
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
65789854c5 agx: lower votes to ballots
not optimal but passes the tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c037fa376d agx: wire up some ballots
lots of possibly optimizations but that's for another day

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
93d15c2bd2 agx: optimize fcmp like fcmpsel
total instructions in shared programs: 1810310 -> 1807236 (-0.17%)
instructions in affected programs: 269043 -> 265969 (-1.14%)
helped: 1553
HURT: 17
Instructions are helped.

total bytes in shared programs: 11851492 -> 11834830 (-0.14%)
bytes in affected programs: 1786394 -> 1769732 (-0.93%)
helped: 1540
HURT: 37
Bytes are helped.

total halfregs in shared programs: 474698 -> 474333 (-0.08%)
halfregs in affected programs: 6239 -> 5874 (-5.85%)
helped: 146
HURT: 22
Inconclusive result (%-change mean confidence interval includes 0).

total threads in shared programs: 19012032 -> 19012096 (<.01%)
threads in affected programs: 768 -> 832 (8.33%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
61944b23cf asahi: fix max tex sizes
per https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
4690ecd15f asahi: fix set_sampler_views
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
210c6931ff agx: fix early-z + discard together
don't trigger tests twice.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
eab145e223 agx: use more mem->tex barriers even on g13g
fixes KHR-GLES31.core.texture_buffer.texture_buffer_atomic_functions
with bigger subgroups on g13g.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
2aa82f7fd3 asahi: disable compute-based blitter for now
works great on g13g but hoses g13x. needs investigation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
dd787b7b43 asahi: fix scissor arrays
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
6612532942 asahi: use copy region for decompression
for snorm correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
1b849f8557 asahi: fix snorm staging blits
snorm doesn't roundtrip, use something compatible instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c3ffcc27c1 asahi: implement blit-based resource_copy_region
doesn't handle complex cases, but faster than hitting the cpu!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c9b2bf84e5 asahi: do not stall for writers with invalid mips
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
69e6606bf9 asahi: reduce transfer map flushing with staging blits
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
7c86e6c05c asahi: fix data valid tracking
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
386bd7fb97 asahi: set data_valid on first draw
otherwise we need to flush to read it safely which is ridiculous.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
b46e8fb4fe asahi: drop custom mipmap generate
mipmap gen is now significantly faster with the default :~)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
2feea36b37 asahi: allow multiple compute dispatches in a batch
glmark2 terrain 50% faster. yes, really.

requires setting more barriers to fix flakes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
10e528a495 asahi: fix get_batch with compute batches
we'll be able to switch between compute and gfx queues soon, handle that instead
of assert failing.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
b8f737937f asahi: add and use batch_is_compute helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
9063da53d8 asahi: add compute blitter
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
1c60ced65b asahi: fix image_mask with unbind num trailing
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
54ea408742 asahi: allow compressed image stores in blits
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c54502ebe0 asahi: respect last_block
for blit shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c1636ba56c asahi: implement arrays as 2d for internal images
reduces blit shader variants.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
799f568dcc asahi: don't format convert with staging blits
this is supposed to be a copy

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
c455a27f54 agx: allow bindful arrays if not clamping
for blit shaders mostly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
611fcfc5ca asahi: do not use compression blits for uncompressed levels
pointless, it's much faster to just twiddle on the cpu. use the helpers to
detect compression per-level the right way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
11a180c6e1 ail: add ail_is_level_twiddled_uncompressed
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
8dcdf5040b ail: use is_level_compressed
to get unit testing coverage. identified several bugs!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
67d92e0bb6 ail: add is_level_compressed query
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Alyssa Rosenzweig
2728995f12 asahi: fix eMRT + background load interaction
for when some render targets are spilled only. prevents regression in
KHR-GLES31.core.draw_buffers_indexed.color_masks

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26963>
2024-01-10 08:44:37 -04:00
Pavel Ondračka
0610891c7c r300/ci: add piglit job
Runs the gpu tests, runtime is around 25 minutes. Contrary to dEQP which
is quite stable with the disabled HiZ, piglit flakes a lot more, but
the flakes seems mostly limited to tex-miplevel-selection.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26931>
2024-01-10 12:28:12 +01:00
Samuel Pitoiset
58d2a78dba radv: move dri options to radv_instance::drirc
To make it clearer that such an option is a per-application option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26946>
2024-01-10 10:07:40 +00:00
Samuel Pitoiset
1854d03c20 radv: query drirc options in only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26946>
2024-01-10 10:07:40 +00:00
Pavel Ondračka
67ad1142cf r300/ci: switch to b2c v0.9.11
New version shoudl provide more info about downloads and hopefully
help in debugging some random timeouts.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26966>
2024-01-10 09:50:08 +00:00
Pavel Ondračka
fc89790254 r300/ci: add missing kernel url quotes
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26966>
2024-01-10 09:50:08 +00:00
Eric Engestrom
b3485664f3 egl: only accept APIs that are compiled in
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20839>
2024-01-10 09:16:09 +00:00
Marek Olšák
68418db212 winsys/amdgpu: remove amdgpu_bo_sparse::gpu_address, use amdgpu_va_get_start_addr
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26914>
2024-01-10 08:41:42 +00:00
Marek Olšák
d05e029ff0 winsys/amdgpu: remove amdgpu_bo_real::gpu_address, use amdgpu_va_get_start_addr
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26914>
2024-01-10 08:41:42 +00:00
Marek Olšák
1f5f1ce29d meson: require libdrm_amdgpu 2.4.119
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26914>
2024-01-10 08:41:42 +00:00
Tapani Pälli
29fc135a55 anv: use workaround framework for Wa_22018402687
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26925>
2024-01-10 08:26:41 +00:00
Tapani Pälli
afc7203539 iris: use workaround framework for Wa_22018402687
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26925>
2024-01-10 08:26:41 +00:00
antonino
0fd066a1d7 egl: only check dri3 on X11
When mesa is built without support for X11 Zink will always refuse to
start unless `LIBGL_KOPPER_DRI2` is set.

Only perform this check on X11 where it is relevant.

Fixes: cedb534a17 ("egl/glx: don't load non-sw zink without dri3 support")
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26929>
2024-01-10 08:07:11 +00:00
Tatsuyuki Ishi
71e486d1cf radv: Add layer to skip UnmapMemory for Quantic Dream Engine
Detroit: Become Human has an optimization issue where the same BO is
mapped and unmapped on a per-frame basis, which leads to massive
overhead in the kernel, both creating the mapping and taking page
faults.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26942>
2024-01-10 07:39:58 +00:00
Martin Roukala (né Peres)
dd758d9de9 ci: disable collabora's farm which appears to be down
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26965>
2024-01-10 09:07:07 +02:00
Martin Roukala (né Peres)
b0149a22b2 ci: disable mupuf's farm
The room is receiving electrical work, so let's shut down the system
during the renovation which is expected to last less than a day.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26965>
2024-01-10 09:04:49 +02:00
David Heidelberg
8467b7f44a ci: bump Fedora and Android libdrm2 to 2.4.119
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26814>
2024-01-10 01:38:50 +00:00
David Heidelberg
7d0630d763 ci/alpine: update to latest to get libdrm 2.4.119
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26814>
2024-01-10 01:38:50 +00:00
David Heidelberg
4023301010 ci: enable ci-deb-repo for libdrm 2.4.119 (and others in the future)
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26814>
2024-01-10 01:38:49 +00:00
Roman Stratiienko
436051f8ee u_gralloc: Add QCOM gralloc support
Adds support for legacy QCOM grallocs that are a part of AOSP:
  hardware/qcom/display/*/libgralloc

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: tarsin <yuanqingxiang233@163.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25410>
2024-01-10 00:44:05 +00:00
Roman Stratiienko
3922bd5976 u_gralloc: Extract common code from fallback gralloc
... to reuse it later in QCOM gralloc.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: tarsin <yuanqingxiang233@163.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25410>
2024-01-10 00:44:05 +00:00
Konstantin Seurer
4c363acf94 vtn: Allow for OpCopyLogical with different but compatible types
> Result Type must not equal the type of Operand (see OpCopyObject),
> but Result Type must logically match the Operand type.

Allow for this by setting the expected type and making sure, that both
types match.

cc: mesa-stable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10163
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26252>
2024-01-09 21:53:21 +00:00
Thomas H.P. Andersen
745d7b63eb docs: update features.txt for nvk
Advertise:
VK_EXT_pipeline_creation_cache_control
VK_EXT_pipeline_creation_feedback
VK_EXT_shader_module_identifier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
83ba2498c2 nvk: VK_EXT_shader_module_identifier
dEQP-VK.pipeline.monolithic.shader_module_identifier.*

Test run totals:
  Passed:        530/1292 (41.0%)
  Failed:        0/1292 (0.0%)
  Not supported: 762/1292 (59.0%)
  Warnings:      0/1292 (0.0%)
  Waived:        0/1292 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
057133927b nvk: VK_EXT_pipeline_creation_cache_control
dEQP-VK.pipeline.monolithic.creation_cache_control.*

Test run totals:
  Passed:        16/18 (88.9%)
  Failed:        0/18 (0.0%)
  Not supported: 2/18 (11.1%)
  Warnings:      0/18 (0.0%)
  Waived:        0/18 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
74647ee45a nvk: VK_EXT_pipeline_creation_feedback
dEQP-VK.*creation_feedback*

Test run totals:
  Passed:        13/73 (17.8%)
  Failed:        0/73 (0.0%)
  Not supported: 60/73 (82.2%)
  Warnings:      0/73 (0.0%)
  Waived:        0/73 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
d6a1e29ccd nvk: pipeline shader cache
dEQP-VK.pipeline.monolithic.cache.*

Test run totals:
  Passed:        773/773 (100.0%)
  Failed:        0/773 (0.0%)
  Not supported: 0/773 (0.0%)
  Warnings:      0/773 (0.0%)
  Waived:        0/773 (0.0%)

Timing these test:
Before:
real    0m11,304s
user    0m9,442s
sys     0m0,477s

After:
real    0m3,470s
user    0m1,962s
sys     0m0,504s

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
ad802ae2f9 nvk: allocatable nvk_shaders
This will be needed later when the shader life cycle will be managed
by the pipeline cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Faith Ekstrand
3e4411a1d3 nvk: Free shaders created by codegen
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
3e13d0fcd9 nvk: add hashing for shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Thomas H.P. Andersen
1cb6b4f82d nvk: loop over stages in MESA order
we do this to make the VkPipelineShaderStageCreateInfo available
when we want to calculate the shader hash

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25550>
2024-01-09 20:27:27 +00:00
Friedrich Vock
0b55a3cf64 radv/rt: Acceleration structure updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26729>
2024-01-09 18:47:45 +00:00
Friedrich Vock
62fe4f0b1b radv/rt: Move per-geometry build info into a geometry_data struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26729>
2024-01-09 18:47:45 +00:00
Alyssa Rosenzweig
3da2773316 vtn: fuse OpenCL mad if we can can
clpeak "float" case from 1112 -> 1978 GFLOPS on rusticl on m1.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26932>
2024-01-09 18:04:19 +00:00
Simon Zeni
f6d2df5a75 egl: implement EGL_EXT_query_reset_notification_strategy
`EGL_EXT_query_reset_notification_strategy` complements
`EXT_create_context_robustness` and enables an application or framework to
retrieve an existing context's reset notification strategy in order to create
a compatible shared context.

Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25996>
2024-01-09 17:21:44 +00:00
Simon Zeni
73603c19c5 EGL: sync files with Khronos
Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25996>
2024-01-09 17:21:44 +00:00
Teng, Jin Chung
db5ddf1c2e d3d12: Decode - Adding more supported resolution
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26944>
2024-01-09 17:03:44 +00:00
Samuel Pitoiset
4c7486c9aa radv/winsys: replace '<= GFX6' by '== GFX6'
GFX6 is the first AMD family supported by RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26867>
2024-01-09 16:31:31 +00:00
Samuel Pitoiset
ae4628d3d6 radv: do not program COMPUTE_MAX_WAVE_ID (GDS register) on GFX6
Ported from RadeonSI c2359797.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26867>
2024-01-09 16:31:30 +00:00
Mike Blumenkrantz
ec656e1984 lavapipe: maint6
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26881>
2024-01-09 15:24:12 +00:00
Mike Blumenkrantz
89a7ee7393 lavapipe: maint6 descriptor stuff
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26881>
2024-01-09 15:24:12 +00:00
Mike Blumenkrantz
6c83b9f219 vk/cmd_queue: fix up indentation a little
still kinda fucked

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26881>
2024-01-09 15:24:12 +00:00
Mike Blumenkrantz
e977a2368b vk/cmd_queue: generate maint6 functions
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26881>
2024-01-09 15:24:12 +00:00
Mike Blumenkrantz
2439982eac vk/cmd_queue: stop using explicit casts
this just ends up being broken for complex types anyway

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26881>
2024-01-09 15:24:12 +00:00
José Roberto de Souza
ad158b0bee anv: Call anv_measure_submit() before anv_cmd_buffer_chain_command_buffers()
Otherwise the measurement instructions will be placed after the
MI_BATCH_BUFFER_START calling the next cmd_buffer.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:19 +00:00
José Roberto de Souza
d37414d8a4 anv: Fix anv_measure_start/stop_snapshot() over copy or video engine
Those engines don't have PIPE_CONTROL so we can't do
ANV_TIMESTAMP_CAPTURE_AT_CS_STALL but we can support measurement
by changing the capture type to ANV_TIMESTAMP_CAPTURE_TOP/END_OF_PIPE

Right now this issue is only reproduced in Xe KMD without setting
any special parameters(other than INTEL_MEASURE) because Xe KMD allows
the usage of copy engine while i915 can't due TRTT restrictions.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:19 +00:00
José Roberto de Souza
b8d48ebc93 anv: Add missing anv_measure_submit() calls in Xe KMD backend
Without this intel_measure don't work with Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:19 +00:00
José Roberto de Souza
a0f7820fe8 anv: Simply companion_rcs handling
Here dropping is_companion_rcs_cmd_buffer parameter of a few functions
that don't need this information, it just need the right
anv_cmd_buffer for each case.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:18 +00:00
José Roberto de Souza
428a179865 anv: Drop useless STATIC_ASSERT in anv_physical_device_init_queue_families()
assert(family_count <= ANV_MAX_QUEUE_FAMILIES) already takes care
of STATIC_ASSERT without need of updates.

Suggested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:18 +00:00
José Roberto de Souza
0997766069 anv: Increase ANV_MAX_QUEUE_FAMILIES
If ANV_VIDEO_DECODE, ANV_VIDEO_DECODE and INTEL_COPY_CLASS are enabled
it is possible to have 5 different queues, so here increasing
ANV_MAX_QUEUE_FAMILIES.

Fixes: 17b8b2cffd ("anv: Add support for a transfer queue on Alchemist")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:18 +00:00
José Roberto de Souza
0c42c79edf utils/u_debug: Fix parse of "all,<something else>
If debug string is something like "all,file=..." the all case would
never be executed, this can be fixed by comparing up to strlen("all").

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>
2024-01-09 14:28:18 +00:00
Erik Faye-Lund
a63f3fbdae mesa: check for float-format support
Surprisingly enough, EXT_color_buffer_float doesn't make RGB32F
color-renderable, but EXT_color_buffer_half_float *does* make
RGB16F color-renderable...

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26870>
2024-01-09 13:45:38 +00:00
Erik Faye-Lund
c75b882de4 mesa/main: require EXT_color_buffer_float for ES 3.2
OpenGL ES 3.2 makes FP16 and FP32 textures color-renderable, so this is
effectively a requirement.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26870>
2024-01-09 13:45:38 +00:00
Erik Faye-Lund
782fb8966b mesa: actually check for EXT_color_buffer_float support
EXT_color_buffer_float makes both 16 and 32 bit floating-point texture
formats color-renderable. We can't just unconditionally report that, we
need to check for support.

The RGB formats are a bit special under this extension, because it's not
specified as color-renderable. However, because the RGBA formats *are*
specified as color-renderable, and the state-tracker can emulate the RGB
formats with the RGBA ones, we don't need to test for that here.

While we're at it, move EXT_color_buffer_half_float to its correct
sorted position.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26870>
2024-01-09 13:45:38 +00:00
Erik Faye-Lund
5f995f5e34 mesa/st: do not check for emulated format
The state-tracker can emulate this format with the alpha version, so we
don't actually need the X version in addition...

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26870>
2024-01-09 13:45:38 +00:00
Erik Faye-Lund
ee8ac6a7a2 mesa/st: do not require render-target support for texture-only exts
These extensions only enable texturing support for these formats, so we
don't need to require them to be renderable.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26870>
2024-01-09 13:45:38 +00:00
Iago Toral Quiroga
5c42d6c62f v3dv: implement VK_EXT_shader_demote_to_helper_invocation
Demoting means that we don't execute any writes to memory but
otherwise the invocation continues to execute. Particularly,
subgroup operations and derivatives must work.

Our implementation of discard does exactly this by using
setmsf to prevent writes for the affected invocations, the
only difference for us is that with discard/terminate we
want to be more careful with emitting quad loads for tmu
operations, since the invocations are not supposed to be
running any more and load offsets may not be valid, but with
demote the invocations are not terminated and thus we should
emit memory reads for them to ensure quad operations and
derivatives from invocations that have not been demoted still
work.

Since we use the sample mask to implement demotes we can't tell
whether a particular helper invocation was originally such
(gl_HelperInvocation in GLSL) or was later demoted
(OpIsHelperInvocationEXT added with SPV_EXT_demote_to_helper_invocation),
so we use nir_lower_is_helper_invocation to take care of this.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26949>
2024-01-09 13:22:37 +00:00
Konstantin Seurer
658ce711d5 radv/rt: Lower ray payloads to registers
This should allow for cross stage optimizations and it reduces latency
caused by scratch access.

Totals from 44 (9.69% of 454) affected shaders:
MaxWaves: 432 -> 436 (+0.93%)
Instrs: 2740662 -> 1610327 (-41.24%); split: -41.24%, +0.00%
CodeSize: 14616932 -> 8573620 (-41.34%)
VGPRs: 4880 -> 4816 (-1.31%)
SpillSGPRs: 464 -> 294 (-36.64%)
Latency: 18548886 -> 11465281 (-38.19%); split: -38.19%, +0.00%
InvThroughput: 5195964 -> 3066729 (-40.98%); split: -40.98%, +0.00%
VClause: 99672 -> 55611 (-44.21%)
SClause: 65827 -> 38697 (-41.21%)
Copies: 231231 -> 137676 (-40.46%); split: -40.47%, +0.01%
Branches: 111379 -> 65865 (-40.86%); split: -40.87%, +0.00%
PreSGPRs: 3854 -> 3812 (-1.09%); split: -1.19%, +0.10%
PreVGPRs: 4518 -> 4439 (-1.75%); split: -1.84%, +0.09%

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26431>
2024-01-09 13:02:11 +00:00
Sviatoslav Peleshko
8e6d28f473 intel/tools/tests: Add i965_asm tests for gfx12 and gfx12.5
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
b87fc2125e intel/tools/tests: Unbreak i965_asm tests
Currently it's searching for test cases in the nonexistent folders, and
because there are none, tests always pass. Point the script onto the
correct ones. And while we're at it, add a check to make sure this
situation won't repeat in the future.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
bb2083a57c intel/tools/tests: Fix sends indirect argument in gfx9 test
Currently it's in the wrong format. It was fixed in disasm in
98aab272 ("intel/disasm: Properly disassemble indirect SENDs").
This was accidentally working previously, but isn't accepted after the
changes made to implement send on gfx12.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
98d2461424 intel/tools/i965_asm: Don't set src0 for break and while on gfx12
This effectively implements same changes as were done to codegen in
bafc9515 ("intel/eu/gen12: Codegen control flow instructions correctly.")

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
db4d58fe31 intel/tools/i965_asm: Add dp4a and add3 instructions
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
88fcd305be intel/tools/i965_asm: Implement gfx12 and gfx12.5 send/sendc
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
bc46cc7807 intel/tools/i965_asm: Allow src0 and src2 of ternary instructions to be imm
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
8eaa0db13f intel/tools/i965_asm: Don't override flag reg from cond modifier
Both predication and conditional modifier use the same flag, but in
assembly it's specified only once. If the instruction already has a
flag from predication we should not override it with zeroes.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
f96e08f34d intel/tools/i965_asm: Allow neg and abs modifiers on accumulator register
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
98665e024f intel/tools/i965_asm: Handle sync instruction
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
9dd3a6f86f intel/tools/i965_asm: Handle HF immediates
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
0c41a8f5d6 intel/tools/i965_asm: Add SWSB handling
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
cfb34dc695 intel/eu/validate: Validate that the ExecSize is a factor of chosen ChanOff
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
dbf6f0291a intel/fs: Set group 0 for Wa_14010017096 MOV instruction
We always set exec size to 16 for this MOV, but the execution group remains
from the previous emitted instruction. This can cause emitting a group
which violates PRM restriction for ChanOff: "The execution size (ExecSize)
must be a factor of the chosen offset."

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
173a991405 intel/disasm: Print src1_len correctly depending on ExDesc type
There are two "Src1.Length" with different formats in "send" description
in the PRMs. One is part of ExMsgDesc, is relevant for LSC SFIDs, and
exists if [ExDesc.IsReg]==false. The other is just a 5-bit immediate,
is relevant for other SFIDs too, and exists if ([ExDesc.IsReg]==true)
AND ([ExBSO]==true).

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
b5c0b90402 intel/compiler: Set flag reg to 0 when disabling predication
Having the reg set with predication disabled shouldn't cause any problems
during the execution. But when decompiling such instruction the flag won't
be shown in the output, so the recompiling will cause
functionally-identical but binary-different code. Fixing this makes
disasm/asm testing easier.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
a129e136de intel/disasm: Print half-float values instead of placeholder
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:52 +00:00
Sviatoslav Peleshko
4f41c44df2 intel/compiler: Add variable to dump binaries of all compiled shaders
This can be useful for testing i965_disasm and i965_asm by comparing
bin -> asm -> bin results.

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25657>
2024-01-09 11:35:51 +00:00
Alejandro Piñeiro
54e2e44f99 broadcom/compiler: remove one superfluous call to nir_opt_undef
v3d_optimize_nir is calling nir_opt_undef twice. As it is inside the
usual "do {..} while (progress);" loop, is not needed to call it
twice.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26928>
2024-01-09 12:02:36 +01:00
Italo Nicola
a60c52e5f8 panfrost: expose support for EXT_copy_image
This was held back by the issue fixed in the previous patch. Let's
enable it again!

There's a bunch of failures due to a bug in Piglit, where undefined
behavior gets invoked. Let's just mark them as expected failures for now
and move on.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
2024-01-09 09:21:29 +00:00
Italo Nicola
17a62ff993 panfrost: legalize afbc before blitting
If we legalize AFBC late, we end up in a situation while we might need
to do a blit while inside a previous blit operation, but u_blitter
state isn't saved recursively, and that leads to crashes.

This patch solves this issue by splitting panfrost_blit into two
functions and legalizing AFBC early.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
2024-01-09 09:21:29 +00:00
Italo Nicola
5027b5aa28 gallium: stop calling resource_copy_region for multisampled copy_image
The hook explicitly says it's not supposed to be called for nr_samples > 1.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
2024-01-09 09:21:29 +00:00
Italo Nicola
c6a7d0ead2 panfrost: fix untracked dependency when converting resource modifier
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
2024-01-09 09:21:29 +00:00
Erik Faye-Lund
3e1708ea40 panfrost: document ci failure
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>
2024-01-09 09:21:29 +00:00
Konstantin Seurer
2e4951d3fb radv: Remove the BVH depth heuristics
It only helps Quake II RTX and hurts everything else.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26481>
2024-01-09 09:00:24 +00:00
Konstantin Seurer
719619c477 radv: Use PLOC for TLAS builds
Improves control performance by about 1%.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26481>
2024-01-09 09:00:24 +00:00
Dave Airlie
71bd479a7f radv: don't emit cp dma packets on video rings.
Only emit this on the gfx/ace rings.

Fixes hangs with CTS on video decode with navi3x.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26945>
2024-01-09 07:39:52 +00:00
Sergi Blanch Torne
5cee5578f7 Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 11b707de0e

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26900>
2024-01-09 07:54:30 +01:00
Caio Oliveira
dc2170f32b ci: Add Werror=misleading-indentation to debian-clang
Due to some issues with GCC and this warning in very long files, we
disabled it when compiling NIR.  Unfortunately by design Meson doesn't
allow us to set flags per source file.

The warning is still enabled in clang. but it is less commonly
used during development.  To avoid missing catching those warnings,
add -Werror=misleading-indentation to the GitLab CI debian-clang build.

See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25315 for
more context.  This patch is a transcription of what Eric Engestrom
suggested, except only targetting C flags (since we only disable them
for C in NIR build).

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26938>
2024-01-09 05:56:16 +00:00
Karol Herbst
6024bbed3c rusticl/llvm: do not include spirv-tools/linker.hpp
This was left by mistake as we do not cache the linked output.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10404
Fixes: 299f949775 ("rusticl/meson: generate bindings for LLVM")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26943>
2024-01-09 05:12:53 +00:00
Sergi Blanch Torne
ab6f7170e0 Revert "ac/nir: Export clip distances according to clip_cull_mask"
This reverts commit b38c776690.

This commit seems to offend radeonsi-raven-piglit and radeonsi-stoney-gl.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26941>
2024-01-09 02:36:19 +00:00
Caio Oliveira
e0eea5ea4e nir: Disable -Wmisleading-indentation when compiling with GCC
When a file is too large, -Wmisleading-indentantion will give the warning
below, that we can't prevent from a #pragma:

```
src/compiler/nir/nir_opt_algebraic.c: In function ‘nir_opt_algebraic’:
src/compiler/nir/nir_opt_algebraic.c:1469069: note: ‘-Wmisleading-indentation’ is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
1469069 |    nir_foreach_function_impl(impl, shader) {
        |
src/compiler/nir/nir_opt_algebraic.c:1469069: note: adding ‘-flarge-source-files’ will allow for more column-tracking support, at the expense of compilation time and memory
```

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89549 for details.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25315>
2024-01-09 01:40:22 +00:00
Caio Oliveira
ef88a20d96 intel/compiler: Use INTEL_DEBUG=cs to ask for brw_compiler output
This removes output like

```
CS SIMD16 shader: 2790 inst, 0 loops, 24804 cycles, 166:106 spills:fills, 35 sends,
  scheduled with mode top-down, Promoted 1 constants, compacted 44640 to 41424 bytes.
```

from the default builds.  Like other debug output in intel_clc, they can
re-enabled with INTEL_DEBUG=cs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26939>
2024-01-09 01:26:41 +00:00
Caio Oliveira
c21213b438 anv: Don't print warnings for GRL kernel compilations
Make the build less chatty.  The current warnings are about certain
capabilities not being fully supported, which we don't care for these
particular kernels.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26939>
2024-01-09 01:26:41 +00:00
Marek Olšák
f09384f4c3 gallium/u_threaded: keep it enabled even if the CPU count is 1
radeonsi without TC fails tests.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26584>
2024-01-08 22:56:41 +00:00
Marek Olšák
b448fb8b8f gallium/u_threaded: remove unused param from tc_bind_buffer/add_to_buffer_list
the tc parameter is unused

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26584>
2024-01-08 22:56:41 +00:00
Marek Olšák
6327302ec2 gallium/u_threaded: use a dummy end call to indicate the end of the batch
instead of using the last pointer. This is simpler.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26584>
2024-01-08 22:56:41 +00:00
Marek Olšák
a3a6f6855e mesa,u_threaded_context: add a fast path for glDrawElements calling TC directly
mesa/main/draw.c calls threaded_context to add a draw call, but the caller
fills it manually.

This way we don't have to fill pipe_draw_info in a local variable and later
copy it to tc_batch. tc_batch is filled from draw.c directly.

It also eliminates a few conditional jumps thanks to assumptions we can make
in DrawElements but not tc_draw_vbo.

This decreases the overhead of the GL frontend thread by 1.1%, which has
CPU usage of 26%, so it decreases the overhead for that thread by 4.2%.
(1.1 / 26)

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26584>
2024-01-08 22:56:41 +00:00
Marek Olšák
e04055b90e gallium/u_threaded_context: use function table to jump to different draw impls
Instead of a series of if-else statements, use a function table containing
all the draw variants, which is indexed by:
    [is_indirect * 8 + index_size_and_has_user_indices * 4 +
     is_multi_draw * 2 + non_zero_draw_id]

This decreases the overhead of tc_draw_vbo by 0.7% (from 4% to 3.3%)
for the GL frontend thread in VP2020/Catia1, which has CPU usage of 26%,
so it decreases the overhead for that thread by 2.7%. (0.7 / 26)

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26584>
2024-01-08 22:56:41 +00:00
Mike Blumenkrantz
03f049f497 zink: always force flushes when originating from api frontend
flags=0 is used for e.g., glFenceSync, which apps use to insert sync points
to determine when all prior work has completed. eliding these flushes into no-ops
is fine for all scenarios except when the last op was a present, in which
case the no-op (previous) fence will not sync as expected for the present and
graphical artifacts will result

in the future, this may be changed back to the previous behavior if/when presentation
gains timeline semaphore capabilities by providing the last timeline id
as a fence instead of the last batch

fixes #10386

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26935>
2024-01-08 22:37:10 +00:00
Marek Olšák
4ee32ced41 glthread: add proper helpers for call fences
These wait for a GL call to be processed by the consumer thread.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26916>
2024-01-08 22:04:10 +00:00
Marek Olšák
56b4d199a0 glthread: don't unroll draws using user VBOs with GLES
The unrolling uses glBegin, which is unsupported by GLES and the GL
dispatch fails.

Fixes: 50d791ca73 - glthread: add a vertex upload path that unrolls indices for glDrawElements

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26916>
2024-01-08 22:04:10 +00:00
Sil Vilerino
311d653df9 d3d12: Fix AV1 Encode - log2 rounding for tile_info section
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26853>
2024-01-08 19:47:52 +00:00
Konstantin Seurer
da647e7e42 radv/rt/rmv: Log pipeline library creation
Pipeline libraries own shaders which take up GPU memory.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26668>
2024-01-08 19:29:13 +00:00
Konstantin Seurer
84cc494e51 radv/rmv: Fix tracing ray tracing pipelines
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26668>
2024-01-08 19:29:13 +00:00
Konstantin Seurer
8050b89819 vtn: Handle DepthReplacing correctly
The meaning of DepthReplacing was clarified in
https://gitlab.khronos.org/spirv/SPIR-V/-/issues/342 .
TLDR: It just means that the shader can write to FragDepth.

We should therefore only overwrite depth_layout if it is equal to NONE,
since NONE means "not written" and all other modes mean "written" plus
some additional information.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10344
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26876>
2024-01-08 18:52:50 +00:00
Corentin Noël
0541a57517 virgl: Assert build_id_note before dereferencing it
Fix defect reported by Coverity Scan.

Dereference null return value

If the function actually returns a null value, a null pointer dereference will occur.

CID: 1492763

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26924>
2024-01-08 17:44:42 +00:00
Lionel Landwerlin
4b30b46ffd intel/fs: fix depth compute state for unchanged depth layout
There is no VK CTS exercising this case. If there was we would run
into hangs as noticed in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26876

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26923>
2024-01-08 17:28:12 +00:00
Leo Liu
9eac06521a gallium/vl: match YUYV/UYVY swizzle with change of color channels
Update the sampler views with the color channels, that fixes the issue
caused by: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20815

It fixes the case:
`gst-launch-1.0 -v -v filesrc location=file.jpg ! jpegparse ! vaapijpegdec ! imagefreeze ! vaapisink`

Fixes: dc2119bf3f ("util/format: Fix wrong colors when importing YUYV and UYVY")
Cc: mesa-stable

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26911>
2024-01-08 17:05:57 +00:00
Pavel Ondračka
8b5cdc5fa5 ci: add r300 RV530 dEQP gles2 CI job
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26823>
2024-01-08 16:19:20 +00:00
Pavel Ondračka
6fd41f5416 ci: uprev mesa-trigger container
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26823>
2024-01-08 16:19:20 +00:00
Pavel Ondračka
000a8cbb65 r300: fix memory leaks in compiler tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26823>
2024-01-08 16:19:20 +00:00
Timur Kristóf
55e5c4e089 radv: Expose transfer queues, hidden behind a perftest flag.
This is highly experimental and only recommended
for users who know what they are doing.

To fully support the spec we are going to need
gang submissions which are going to be implemented later.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26913>
2024-01-08 16:00:19 +01:00
Timur Kristóf
bd3f2567cc radv: Implement T2T scanline copy workaround.
The built-in tiled-to-tiled copy packet doesn't support copying
between images that don't meet certain criteria such as alignment,
micro tile format, compression state etc.

To work around this, we copy the image piece by piece to a
temporary buffer that we know is supported,
and then copy it to the intended destination.

The implementation assumes that at least one pixel row of the
image fits into the temporary buffer, and will try to copy as
many rows as fit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26913>
2024-01-08 16:00:15 +01:00
Timur Kristóf
a4b4c9b723 radv: Implement image copies on transfer queues.
When either of the images is linear then the implementation can
use the same packets as used by the buffer/image copies.
However, tiled to tiled image copies use a separate packet.

Several variations of tiled to tiled copies are not supported
by the built-in packet and need a scanline copy as a workaround,
this will be implemented by an upcoming commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26913>
2024-01-08 16:00:10 +01:00
Timur Kristóf
1405f9b68b radv: Correct binding index for transfer buffer-image copies.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26913>
2024-01-08 15:58:37 +01:00
Florian Weimer
0319789331 meson: C type error in strtod_l/strtof_l probe
Future compilers will fail compilation due to the C type error:

…/testfile.c: In function 'main':
…/testfile.c:12:30: error: passing argument 2 of 'strtod_l' from incompatible pointer type
   12 |       double d = strtod_l(s, end, loc);
      |                              ^~~
      |                              |
      |                              char *
/usr/include/stdlib.h:416:43: note: expected 'char ** restrict' but argument is of type 'char *'
  416 |                         char **__restrict __endptr, locale_t __loc)
      |                         ~~~~~~~~~~~~~~~~~~^~~~~~~~
…/testfile.c:13:29: error: passing argument 2 of 'strtof_l' from incompatible pointer type
   13 |       float f = strtof_l(s, end, loc);
      |                             ^~~
      |                             |
      |                             char *
/usr/include/stdlib.h:420:42: note: expected 'char ** restrict' but argument is of type 'char *'
  420 |                        char **__restrict __endptr, locale_t __loc)
      |                        ~~~~~~~~~~~~~~~~~~^~~~~~~~


This means that the probe no longer tests is objective and always
fails.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26927>
2024-01-08 13:46:42 +00:00
Georg Lehmann
fddd866b27 aco: apply fneg/fabs to VOP3P
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26919>
2024-01-08 13:26:19 +00:00
Georg Lehmann
72ac6a5251 aco: clean up fneg/fabs combining
This technically fixes some bugs with fneg(fneg(a)) and fabs(fneg(a)), but
those shouldn't be present in the input NIR.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26919>
2024-01-08 13:26:19 +00:00
Georg Lehmann
a90d154f62 aco: fix applying input modifiers to DPP8
Cc: mesa-stable

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26919>
2024-01-08 13:26:19 +00:00
Georg Lehmann
1d61770dd5 aco: apply packed fneg commutatively
If only one component is negated, isel does not ensure that the constant
operand is in src1 because then the negate was a fmul, not a fneg.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26919>
2024-01-08 13:26:19 +00:00
Helen Koike
2c9fdaa830 ci: fix python-test dependency error on merge requests
Pipeline is unable to run due to the following error:
    'python-test' job needs 'debian/x86_64_build' job, but 'debian/x86_64_build' is not in any previous stage

python-test job has the following rule:
    - changes:
        - bin/ci/**/*
so add it as well to debian/x86_64_build

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26802>
2024-01-08 12:19:29 +00:00
Daniel Schürmann
c1ef6037fd nir/gather_info: fix enumeration of wide subgroup intrinsics
nir_intrinsic_ballot_* are no subgroup operations.
nir_intrinsic_rotate was missing.
nir_intrinsic_mbcnt_amd is not a subgroup operation.
nir_intrinsic_writelane_amd only affects a single invocation.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18249>
2024-01-08 10:01:47 +00:00
Daniel Schürmann
d434a127f9 nir/opt_move_discards_to_top: don't schedule discard/demote across subgroup operations
Fixes: b447f5049b ('nir: Add a discard optimization pass')
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18249>
2024-01-08 10:01:47 +00:00
Daniel Schürmann
dce695b24f aco: refactor and speed-up dead code analysis
Assuming that no loop header phis are dead code,
we can perform the dead code analysis in a single iteration.

Totals from 25 (0.03% of 79330) affected shaders: (GFX11)

MaxWaves: 664 -> 662 (-0.30%)
Instrs: 487618 -> 488822 (+0.25%)
CodeSize: 2451548 -> 2459756 (+0.33%)
VGPRs: 1296 -> 1332 (+2.78%)
Latency: 2337256 -> 2338098 (+0.04%); split: -0.00%, +0.04%
InvThroughput: 560682 -> 576158 (+2.76%)
VClause: 15782 -> 15790 (+0.05%)
Copies: 37905 -> 38731 (+2.18%)
PreVGPRs: 1124 -> 1156 (+2.85%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26901>
2024-01-08 09:43:53 +00:00
Yonggang Luo
a37f43e422 etnaviv/drm: Remove redundant ALIGN macro by #include "util/u_math.h"
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26865>
2024-01-08 08:53:31 +00:00
Konstantin Seurer
b38c776690 ac/nir: Export clip distances according to clip_cull_mask
Avoids a mismatch between PA_CL_VS_OUT_CNTL and what the shader exports.
Outputs that are not written export zero.

Fixes: f823581 ("ac/nir: add ac_nir_export_position")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9187
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26812>
2024-01-08 08:35:35 +00:00
Lionel Landwerlin
f12ffc6b04 isl: implement Wa_22015614752
This workaround requires 64Kb alignment for compression with multiple
engine accesses.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8614
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26890>
2024-01-08 08:21:14 +00:00
Lionel Landwerlin
32450d0901 isl: further restrict alignment constraints
We can limit the AUX-TT requirements to formats supporting CCS.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26890>
2024-01-08 08:21:14 +00:00
Samuel Pitoiset
907afddf97 radv: stop disabling DCC for mutable with 0 formats on GFX11
On GFX11, all formats are DCC compatible, so we can completely ignore
MUTABLE with a missing formats list.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25664>
2024-01-08 08:02:58 +00:00
Samuel Pitoiset
fbe4e16db2 Revert "radv: disable DCC with signedness reinterpretation on GFX11"
This was affecting Cyberpunk and A Plague Tale Requiem but both issues
should be fixed now. The issue with A Plague Tale Requiem was because
of a game bug and vkd3d-proton now has a workaround.

This reverts commit e6735409ee.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25664>
2024-01-08 08:02:58 +00:00
Sergi Blanch Torne
11b707de0e ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:
* Start: 2024-01-08 08:00 UTC
* End: 2024-01-08 14:00 UTC

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26899>
2024-01-08 07:42:31 +00:00
Christian Gmeiner
1c042537e6 pan/mdg: Use nir_builder for load_sampler_lod_parameters_pan
Found by code inspection as I need something similar for etnaviv.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26879>
2024-01-08 07:23:40 +00:00
Konstantin Seurer
4d02543853 vtn: Remove transpose(m0)*m1 fast path
This is broken for games that rely on invariant geometry since the usage
of matrices can affect how gl_Position is computed. The fdot fastpath
relied on if and how fdot is lowered for correctness.

Totals from 6578 (7.73% of 85071) affected shaders:
MaxWaves: 147190 -> 147170 (-0.01%)
Instrs: 4451406 -> 4438140 (-0.30%); split: -0.31%, +0.01%
CodeSize: 23553020 -> 23541772 (-0.05%); split: -0.07%, +0.03%
VGPRs: 302304 -> 302328 (+0.01%)
SpillSGPRs: 1309 -> 1329 (+1.53%)
Latency: 22509985 -> 22177164 (-1.48%); split: -1.48%, +0.00%
InvThroughput: 4862795 -> 4842951 (-0.41%); split: -0.41%, +0.01%
VClause: 85035 -> 84998 (-0.04%); split: -0.06%, +0.02%
SClause: 131008 -> 131055 (+0.04%); split: -0.02%, +0.05%
Copies: 298935 -> 298060 (-0.29%); split: -0.71%, +0.41%
PreSGPRs: 266833 -> 267292 (+0.17%); split: -0.85%, +1.03%
PreVGPRs: 249511 -> 249601 (+0.04%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9562
cc: mesa-stable

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26821>
2024-01-07 22:14:36 +00:00
Konstantin Seurer
ba7b08e324 radv/rt: Repurpose radv_ray_tracing_stage_is_compiled
Replace it with radv_ray_tracing_stage_is_always_inlined and use it inside
radv_rt_compile_shaders.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:28:32 +01:00
Konstantin Seurer
73cc952870 radv/sqtt: Avoid duplicate stage check
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:28:26 +01:00
Konstantin Seurer
77b9a6f9e2 radv/rt: Use radv_shader for compiled shaders
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:28:19 +01:00
Konstantin Seurer
59d490b8aa radv/rt: Remove useless assert
If it's NULL, the code will segfault anyways.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:28:11 +01:00
Konstantin Seurer
8198805e1f radv: Skip compiling chit and miss shaders
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:28:06 +01:00
Konstantin Seurer
0f87d406b5 radv/rt: Skip compiling a traversal shader
If we don't need one, we don't compile one.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:28:02 +01:00
Konstantin Seurer
aaa64217ca radv: Add more ray tracing data to the cache
This makes the cache more flexible when it comes to missing stages. This
will be used to skip compiling unused ray tracing stages.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:27:56 +01:00
Konstantin Seurer
a784477269 radv: Don't store library stack sizes
They are already imported in radv_rt_fill_stage_info.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:27:53 +01:00
Konstantin Seurer
92a951db6a radv: Make pipeline cache object data generic
Pipeline cache objects can hold some generic data. Anything concerning
that should not be handled in "common" code paths.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25224>
2024-01-07 21:27:27 +01:00
Marek Olšák
a84729d368 radeonsi/ci: add gfx11 flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
205646cd77 winsys/amdgpu: simplify code using amdgpu_cs_context::chunk_ib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
44df9517cd winsys/amdgpu: don't use amdgpu_fence::ctx for fence dependencies
The only remaining use of ctx is amdgpu_fence_is_syncobj.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
7ccdcae4b5 winsys/amdgpu: use pipe_reference for amdgpu_ctx refcounting
this is the standard utility for refcounting

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
33980355d4 winsys/amdgpu: implement explicit fence dependencies as sequence numbers
This eliminates redundant fence dependencies if BOs add the same ones.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
6d7a76595d winsys/amdgpu: remove dependency_flags parameter from cs_add_fence_dependency
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
6ac0b4ef05 winsys/amdgpu: rename amdgpu_bo_real::lock to map_lock
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
1e2c02d76b winsys/amdgpu: rename amdgpu_bo_sparse::lock -> commit_lock
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
e1261c77b5 winsys/amdgpu: rename amdgpu_winsys_bo::bo -> bo_handle
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
4d486888ee winsys/amdgpu: rewrite BO fence tracking by adding a new queue fence system
This decreases the time spent in amdgpu_cs_submit_ib from 15.4% to 8.3%
in VP2020/Catia1, which is a decrease of CPU load for that thread by 46%.
Overall, it increases performance by a small number in CPU-bound benchmarks.
The biggest improvement I have seen is VP2020/Catia2, where it increases
FPS by 12%.

It no longer stores pipe_fence_handle references inside amdgpu_winsys_bo.

The idea is to have a global fixed list of queues (only 1 queue per IP
for now) where each queue generates its own sequence numbers (generated
by the winsys, not the kernel). Each queue also has a ring of fences.
The sequence numbers are used as indices into the ring of fences, which
is how sequence numbers are converted to fences.

With that, each BO only has to keep a list of sequence numbers, 1 for each
queue. The maximum number of queues is set to 6. Since the system can
handle integer wraparounds of sequence numbers correctly, we only need
16-bit sequence numbers in BOs to have accurate busyness tracking. Thus,
each BO uses only 12 bytes to represent all its fences for all queues.
There is also a 1-byte bitmask saying which sequence numbers are
initialized.

amdgpu_winsys.h contains the complete description. It has several
limitations that exist to minimize the memory footprint and updating of
BO fences.

Acked-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
b976f8fc1e winsys/amdgpu: compute bo->unique_id at pb_slab_alloc, not at memory allocation
We would compute the unique IDs for 1000 slab entries and then only use
a few, wasting the IDs. Assign the IDs only when we actually need to
return a new buffer.

This decreases the number of collisions we get in amdgpu_lookup_buffer,
and thus the number of times we have to search in the BO list.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
32dae84d43 winsys/amdgpu: allocate 1 amdgpu_bo_slab_entry per cache line
The structure size is exactly 64 bytes, so every entry occupies exactly
1 cache line.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
6d913a2bcc r300,r600,radeonsi: switch to pb_buffer_lean
to remove pb_buffer::vtbl from all buffer structures

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
d2c76c4d77 winsys/radeon: stop using pb_buffer::vtbl
Only the destroy function used it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
6c4ab02674 gallium/pb_cache: remove pb_cache_entry::buffer
The buffer pointer is always at a constant offset from pb_cache_entry,
so just pass the "offsetof" value to pb_cache and use that to get
the pointer.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
20bf2a06fb gallium/pb_cache: remove pb_cache_entry::mgr
We can just pass it via functions.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
d7de372358 gallium/pb_cache: switch to pb_buffer_lean
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
39c1311766 gallium/pb_buffer: define pb_buffer_lean without vtbl, inherit it by pb_buffer
amdgpu doesn't need vtbl.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
eb19f0daa3 winsys/amdgpu: don't use gpu_address to compute slab entry offset in bo_map
use the code we have in amdgpu_bo_get_va

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
a8e98882ea winsys/amdgpu: remove va (gpu_address) from amdgpu_bo_slab_entry
Keep it only in amdgpu_bo_real and amdgpu_bo_sparse. Slab entries can
compute it from the slab BO and adding their entry index.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
3cc2562ac0 winsys/amdgpu: remove now-redundant amdgpu_bo_slab_entry::real
The pb_slab pointer can be used to get the BO pointer because pb_slab is
inside the BO structure now.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
49bf2545fe winsys/amdgpu: add amdgpu_bo_real_reusable slab for the backing buffer
Add contents of amdgpu_bo_slab into it. This will allow removing the "real"
pointer from amdgpu_bo_slab_entry because "(char*)entry.slab" is now
pointing next to it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
cf2dc2d512 winsys/amdgpu: don't layer slabs, use only 1 level of slabs, it improves perf
This increases FPS in VP2020/Catia1 by 10-18%!!!!!!!!!!!!!!!!!!!!!!!

I have no rational explanation for this.

In the most extreme case, 8192 256B slab BOs (smallest size) are now
allocated from a single 2MB slab.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
4a078e693e r300,r600,radeon/winsys: always pass the winsys to radeon_bo_reference
This will allow the removal of pb_cache_entry::mgr.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
643f390de5 radeon_winsys: add struct radeon_winsys* parameter into fence_reference
Since the radeon winsys implements fences as buffers, we need radeon_winsys*
to destroy them. This will enable the removal of pb_cache_entry::mgr.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:30 +00:00
Marek Olšák
e847c6e301 gallium/pb_cache: switch time variables to milliseconds and 32-bit type
to decrease pb_cache_entry by 8 bytes.

Add msecs_base_time to offset time == 0 to the creation of pb_cache.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Marek Olšák
896c8b67cb gallium/pb_cache: remove pb_cache_entry::end to save space
just compute it at each use

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Marek Olšák
523a4f71f2 winsys/amdgpu: stop using pb_buffer::vtbl
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Marek Olšák
7752579202 winsys/amdgpu: rename to amdgpu_bo_slab to amdgpu_bo_slab_entry
It's a slab entry. "Slab" is the whole buffer, which is AMDGPU_BO_REAL
if we want to be precise.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Marek Olšák
b3c64638b4 iris,zink,winsys/amdgpu: remove unused/redundant slab->entry_size
slab->base has the same field.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Marek Olšák
9431c33899 gallium/pb_slab: move group_index and entry_size from pb_slab_entry to pb_slab
This removes 8 bytes from every slab entry, and thus amdgpu_bo_slab.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Marek Olšák
5a3bacc376 winsys/amdgpu: reduce wasted memory due to the size tolerance in pb_cache
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
2024-01-06 20:55:29 +00:00
Daniel Schürmann
023e78b4d7 aco: add new post-RA scheduler for ILP
Totals from 77247 (97.37% of 79330) affected shaders: (GFX11)

Instrs: 44371374 -> 43215723 (-2.60%); split: -2.64%, +0.03%
CodeSize: 227819532 -> 223188224 (-2.03%); split: -2.06%, +0.03%
Latency: 301016823 -> 290147626 (-3.61%); split: -3.70%, +0.09%
InvThroughput: 48551749 -> 47646212 (-1.87%); split: -1.88%, +0.01%
VClause: 870581 -> 834655 (-4.13%); split: -4.13%, +0.00%
SClause: 1487061 -> 1340851 (-9.83%); split: -9.83%, +0.00%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25676>
2024-01-06 11:30:42 +00:00
Daniel Schürmann
72a5c659d4 aco: form clauses for LDS instructions
No fossil-db changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25676>
2024-01-06 11:30:42 +00:00
Daniel Schürmann
8f16745821 aco: fix should_form_clause() for memory instructions without operands
In particular, this applies to s_memtime and s_memrealtime.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25676>
2024-01-06 11:30:41 +00:00
Vinson Lee
568f61787a ac/rgp: Fix single-bit-bitfield-constant-conversion warning
../src/amd/common/ac_rgp.c:119:48: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
  119 |    header->flags.is_semaphore_queue_timing_etw = 1;
      |                                                ^ ~

Fixes: ed0c852243 ("radv: add initial SQTT files generation support")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26839>
2024-01-05 22:42:58 -08:00
Karol Herbst
1e5bc00715 rusticl/program: add LLVM functions to cache timestamp
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24386>
2024-01-06 03:09:48 +00:00
Karol Herbst
299f949775 rusticl/meson: generate bindings for LLVM
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24386>
2024-01-06 03:09:48 +00:00
Karol Herbst
d72544eea6 ci,rusticl: bump meson req to 1.3.1
See https://github.com/mesonbuild/meson/pull/12620

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24386>
2024-01-06 03:09:48 +00:00
Michael Tretter
d9fd4d7c0d egl/wayland: fix formatting and add trailing comma
Commit 659bace01a ("egl: add a few trailing commas") added a few
trailing commas to the last item in a struct to avoid that commit
e85983d772 ("egl: re-format using clang-format") moves the closing
brace into the previous line.

The wl_callback_listener was missing the comma and the brace was moved
to the previous line, which makes it harder to read the code.

Add the comma and fix the formatting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26902>
2024-01-06 02:19:02 +00:00
Yonggang Luo
08b6f786ac nouveau: Use align64 instead of ALIGN for 64 bit value parameter
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26868>
2024-01-06 02:05:09 +00:00
Yonggang Luo
06163884b2 nvk: Avoid use align as variable, replace it with alignment
align is a function and when we want use it, the align variable will shadow it
So replace it with alignment

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26868>
2024-01-06 02:05:09 +00:00
Michael Catanzaro
481e737fe0 util: create parents of disk cache directory if needed
Currently the shader cache is broken when running under flatpak-spawn
because the shader cache's parent directory will not exist. For example,
the shader cache directory might be:

/home/mcatanzaro/.var/app/org.gnome.Epiphany.Devel/cache

If /home/mcatanzaro/.var/app/org.gnome.Epiphany.Devel/ does not already
exist, we fail. Let's create the directories recursively, as if by
'mkdir -p', rather than just fail.

Fixes #8294

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25925>
2024-01-06 01:19:29 +00:00
Eric Engestrom
a0fab95bc0 lvp: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26494>
2024-01-06 00:49:53 +00:00
Mark Janes
2236dc3481 intel/dev: update workaround definitions to latest defect status
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26898>
2024-01-05 22:51:46 +00:00
Mark Janes
590fe58ef6 intel: remove MTL a0 workarounds
Meteorlake shipped with the b0 stepping.  Remove fixes for hardware
bugs that were corrected prior to the platform release.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26898>
2024-01-05 22:51:46 +00:00
Mark Janes
a6a95591aa intel/dev: poison macros for workarounds fixed at a stepping
INTEL_NEEDS_WA macros are valid when a workaround applies to all
platforms which have the GFX_VERx10 versions for the workaround.

Some workarounds were fixed at a stepping after the platform release.
If a workaround applies partially to any platform, then GFX_VERx10
cannot be used to correctly apply the workaround.

This change invalidates INTEL_NEEDS_WA_16014538804 and
INTEL_NEEDS_WA_22014412737, which were fixed for MTL platforms at
stepping b0.  The run-time checks were already present for all uses of
these macros.  Updating the poisoned macros to INTEL_WA_{num}_GFX_VER
compiles out the run-time checks on platforms where they cannot apply.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26898>
2024-01-05 22:51:45 +00:00
Mark Janes
7354d3a947 intel/dev: improve descriptions of workaround macros.
Instructions for INTEL_WA_{num}_GFX_VER macros were confusing and
contradicted itself.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26898>
2024-01-05 22:51:45 +00:00
Yonggang Luo
d6c258d9ee util: Add align_uintptr and use it treewide to replace ALIGN that works on size_t and uintptr_t
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26866>
2024-01-05 21:54:35 +00:00
Yonggang Luo
aa8ea0f1b9 glsl: Fixes glcpp/tests with mingw/gcc
glcpp mingw failing in the following way:
```
49/56 mesa:compiler+glcpp / glcpp test (unix)     FAIL             3.39s   exit status 1
50/56 mesa:compiler+glcpp / glcpp test (oldmac)   FAIL             3.41s   exit status 1
51/56 mesa:compiler+glcpp / glcpp test (bizarro)  FAIL             3.42s   exit status 1
52/56 mesa:compiler+glcpp / glcpp test (windows)  FAIL             3.45s   exit status 1
```

The test failed because on mingw, the stderr will comes after stdout,
but all the expect files, the stderr is coming first,
so we flush(stderr) first to makesure stderr out before stdout

The failing example:

039-func-arg-obj-macro-with-comma: FAIL
---

+++

@@ -1,3 +1,5 @@

+0:12(21): preprocessor error: Error: macro foo invoked with 2 arguments (expected 1)
+

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26778>
2024-01-05 21:15:58 +00:00
Rhys Perry
ae54cbeb3f nir: remove sad_u8x4
All uses of this can be replaced with msad_4x8.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26907>
2024-01-05 18:55:22 +00:00
Rhys Perry
5fd747a502 radv: enable msad_4x8
This helps some FSR3 shaders.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26907>
2024-01-05 18:55:22 +00:00
Rhys Perry
a339699b5c ac/llvm: implement msad_4x8
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26907>
2024-01-05 18:55:22 +00:00
Rhys Perry
1410735a62 aco: implement msad_4x8
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26907>
2024-01-05 18:55:22 +00:00
Rhys Perry
e86ab8173b nir/algebraic: optimize vkd3d-proton's MSAD
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26907>
2024-01-05 18:55:22 +00:00
Rhys Perry
0477421f7d nir: add msad_4x8
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26907>
2024-01-05 18:55:22 +00:00
Konstantin Seurer
c511b8968a radv: Implement VK_KHR_ray_tracing_position_fetch
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26895>
2024-01-05 18:20:20 +00:00
Rhys Perry
24ef827f71 radv: remove radv_shader_info's cs.subgroup_size
This is the same as wave_size.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26894>
2024-01-05 17:35:48 +00:00
Rhys Perry
59dbe633e3 radv: use CS wave selection for task shaders
This uses wave32 for small workgroups and wave64 when certain subgroup
operations are used.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26894>
2024-01-05 17:35:48 +00:00
Rhys Perry
3009dcd102 aco: correctly set min/max_subgroup_size for wave32-as-wave64
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26894>
2024-01-05 17:35:48 +00:00
Friedrich Vock
1e3541728b radv,aco: Convert 1D ray launches to 2D
Because we use unaligned dispatches, 1D launches only use 8 threads per
wave. Converting to 2D and fixing up launch IDs in the prolog
significantly increases occupancy.

Gives ~30% uplift in Ghostwire Tokyo.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26105>
2024-01-05 17:08:05 +00:00
Juan A. Suarez Romero
12563a527f ci/v3d: add support for rpi5
Add full Vulkan CTS testing for the new V3D 7.1 driver, used in the
Raspberry Pi 5.

So far we add it to run nightly; in future will be added to pre-merge
CI.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26705>
2024-01-05 16:10:50 +00:00
Mary Guillemard
b6d828576e zink: Always fill external_only in zink_query_dmabuf_modifiers
Fix piglit.spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers
randomly skipping some tests as external_only content was never initialized.

Cc: mesa-stable

Reviewed-by: default avatarMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26305>
2024-01-05 13:30:45 +00:00
Mary Guillemard
db0f177edd zink: Initialize pQueueFamilyIndices for image query / create
Fixes: d922850e36 ("zink: break out image/buffer create info structs into helper funcs")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26303>
2024-01-05 13:59:49 +01:00
Georg Lehmann
71edf4de5e aco/gfx12: implement broadcast dmask shrink behavior
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26897>
2024-01-05 12:03:54 +00:00
Georg Lehmann
4a6ee2c483 aco: shrink buffer stores with undef/zero components
Buffer stores store 0 like image stores for unspecified components.

Foz-DB Navi21:
Totals from 91 (0.11% of 79330) affected shaders:
Instrs: 63327 -> 63121 (-0.33%)
CodeSize: 315312 -> 314440 (-0.28%); split: -0.28%, +0.00%
VGPRs: 3144 -> 3120 (-0.76%)
Latency: 441424 -> 441300 (-0.03%); split: -0.03%, +0.00%
InvThroughput: 65501 -> 65130 (-0.57%)
Copies: 6197 -> 5999 (-3.20%)
PreVGPRs: 2197 -> 2182 (-0.68%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26897>
2024-01-05 12:03:54 +00:00
Connor Abbott
862df28f6b ir3/legalize: Fix helper propagation with b.any/b.all/getone
We need to set uses_helpers_beginning in order to propagate it to
predecessor blocks.

Fixes: aa322a37fc ("ir3: Implement helper invocation optimization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26564>
2024-01-05 11:37:09 +00:00
Yonggang Luo
91ec3cc7e2 panfrost: Avoid use align as variable, replace it with other names
align is a function and when we want use it, the align variable will shadow it
So replace it with other names

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26885>
2024-01-05 02:42:05 +00:00
Yonggang Luo
b389bccccd util,compiler: Avoid use align as variable, replace it with other names
align is a function and when we want use it, the align variable will shadow it
So replace it with other names

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26885>
2024-01-05 02:42:05 +00:00
Karol Herbst
5ff33f9905 rusticl: use real buffer for cb0 for drivers prefering
At the moment it's radeonsi and zink.

Consequentially this also fixes data races in zink due to driver internal
reasons.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25946>
2024-01-05 01:26:44 +01:00
Karol Herbst
900ce1f4f4 rusticl/queue: release bound constant buffer
This fixes memory leaks in drivers.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25946>
2024-01-05 01:26:44 +01:00
Karol Herbst
5f97ef3d03 rusticl: add QueueContext to track GPU state
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25946>
2024-01-05 01:26:44 +01:00
Karol Herbst
a4f47ba52c rusticl: specify buffer bindings explicitly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25946>
2024-01-05 01:26:44 +01:00
Caio Oliveira
77f4f3112d intel/fs: Use linear allocator in fs_live_variables
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25670>
2024-01-04 23:06:07 +00:00
Caio Oliveira
b5cd91501d intel/fs: Use linear allocator in opt_copy_propagation
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25670>
2024-01-04 23:06:07 +00:00
Caio Oliveira
6d2503e935 intel/fs: Only allocate acp_entry if we are adding one
In practice it seems we are always entering here, haven't looked
in detail whether at this point we could just assert.  But for now
only allocate a new acp_entry if we are going to add it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25670>
2024-01-04 23:06:07 +00:00
Sagar Ghuge
96e0d979a7 intel/fs: Check fs_visitor instance before using it
On Xe2+, we don't build the SIMD8 shader so this check makes sure we
don't execute the uninitialized invocations.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26886>
2024-01-04 22:24:07 +00:00
Dave Airlie
56a72e014f intel/compiler: reemit boolean resolve for inverted if on gen5
Gen5 adds some boolean conversion instructions after nir emits,
but that nir srcs don't line up with them, so reemit the boolean
conversion if we reemit the inot.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 31b5f5a51f ("nir/opt_if: Simplify if's with general conditions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26782>
2024-01-04 21:27:23 +00:00
Karol Herbst
b06f6e00fb zink: fix heap-use-after-free on batch_state with sub-allocated pipe_resources
zink_bo_create can run into a heap-use-after-free when the bo is still
referencing an batch_state from an older destroyed context. In order to
fix this, every context gives back their batch_states to the zink, where
they can be reused from for new contexts.

Cc: mesa-stable
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26889>
2024-01-04 20:56:09 +00:00
Juan A. Suarez Romero
e2a7c877ad ci/vc4/v3d: remove some flakes
Remove some flakes not seen in the last 7 months.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26893>
2024-01-04 15:51:30 +00:00
Friedrich Vock
34cc765172 radv/rt: Free traversal NIR after compilation
Could lead to OOM in games that compile RTPSOs often,
like Ghostwire Tokyo.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26892>
2024-01-04 14:48:28 +00:00
Corentin Noël
b8e06fa48a virgl: Only send the same amount of data than declared in pipe_sampler_state
Adjust the masks to only send the data that we are sure to actually use.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26856>
2024-01-04 11:00:12 +00:00
Samuel Pitoiset
395dee0d89 radv: drop si_ prefix from all functions
Most of these functions were copied from RadeonSI but they should be
prefixed with radv_ instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854>
2024-01-04 08:40:37 +00:00
Samuel Pitoiset
89947eb151 radv: remove radv_write_scissors()
This function is useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854>
2024-01-04 08:40:36 +00:00
Samuel Pitoiset
dd64293104 radv: rename si_make_texture_descriptor() to gfx6_make_texture_descriptor()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854>
2024-01-04 08:40:36 +00:00
Samuel Pitoiset
887ac765bb radv: remove duplicated si_tile_mode_index() function
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26854>
2024-01-04 08:40:36 +00:00
Samuel Pitoiset
aa1eb54b3b radv: constify a variable in radv_emit_depth_control()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26847>
2024-01-04 07:54:41 +00:00
Samuel Pitoiset
8b7b5be98b radv: disable stencil test without a stencil attachment
Implementations are supposed to do that per the Vulkan spec.

This fixes the following new VKCTS tests
dEQP-VK.pipeline.*.stencil.no_stencil_att.*

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26847>
2024-01-04 07:54:40 +00:00
Pavel Ondračka
cc7ce6c01f r300: mark load_ubo_vec4 with ACCESS_CAN_SPECULATE
This is safe to do in all circumstances due to the age of the hardware.
(we don't have UBOs, just constant registers with automatic OOB checks)

R500 hardware doesn't have standard adress register in fragment shaders
and while we have the loop register which we in theory can use for indirect
access, this is currently not possible to wire through NIR. So anytime
there is an indirect uniform array access in a loop, we end with a if
ladder with size depending on the size of the uniform array. The two worst
behaving apps here are glamor and some GTK shaders, both of which are
sometimes ending over the 512 instructions limit. Flattening the if
ladders helps a LOT, so we can get into the instruction limit in most
cases (all glamor shaders are OK now). So just enable the flattening by
setting all load_ubo_vec4 with ACCESS_CAN_SPECULATE.

Shader-db RV530:
total instructions in shared programs: 128762 -> 128440 (-0.25%)
instructions in affected programs: 540 -> 218 (-59.63%)
helped: 3
HURT: 0
total temps in shared programs: 17543 -> 17550 (0.04%)
temps in affected programs: 11 -> 18 (63.64%)
helped: 0
HURT: 3
total cycles in shared programs: 196984 -> 196657 (-0.17%)
cycles in affected programs: 592 -> 265 (-55.24%)
helped: 3
HURT: 0

LOST:   0
GAINED: 7

No changes for R300/R400 because there we don't have control flow
anyway.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6366
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26877>
2024-01-04 08:27:42 +01:00
Pavel Ondračka
f8a5cba3b4 r300: remove backend LRP lowering
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:01 +01:00
Pavel Ondračka
f62a128274 r300: remove backend CMP lowering
Leave assert in place for now though.

No changes in shader-db.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:01 +01:00
Pavel Ondračka
e6e1da8124 r300: lower ftrunc in NIR
and remove the backend TRUNC lowering.

Shader-db RV370:
total instructions in shared programs: 82155 -> 82154 (<.01%)
instructions in affected programs: 38 -> 37 (-2.63%)
helped: 1
HURT: 0
total consts in shared programs: 80719 -> 80733 (0.02%)
consts in affected programs: 2775 -> 2789 (0.50%)
helped: 0
HURT: 14

Shader-db RV530:
total presub in shared programs: 7676 -> 7702 (0.34%)
presub in affected programs: 81 -> 107 (32.10%)
helped: 0
HURT: 26

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:01 +01:00
Pavel Ondračka
77f429e1a5 r300: fcsel_ge lowering from lowered ftrunc
The fcsel lowering for R3xx happens already in the main loop, here we
only do it for the fcsel_ge that comes from the frunc.

No change in shader-db

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:01 +01:00
Pavel Ondračka
6167f6e096 r300: lower flrp in NIR
Shader-db RV370:
total instructions in shared programs: 82071 -> 82155 (0.10%)
instructions in affected programs: 792 -> 876 (10.61%)
helped: 0
HURT: 12
total temps in shared programs: 12775 -> 12778 (0.02%)
temps in affected programs: 27 -> 30 (11.11%)
helped: 0
HURT: 3
total cycles in shared programs: 128403 -> 128499 (0.07%)
cycles in affected programs: 864 -> 960 (11.11%)
helped: 0
HURT: 12

The same regression for the few GTK shaders that happens with the R500
nir fcsel lowering also happens here due to the
nir_move_vec_src_uses_to_dest.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6126
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:00 +01:00
Pavel Ondračka
ddcf29202d r300: add some more early bool lowering
We can't call nir_lower_bool_to_float too early, because some other
passes like nir_opt_peephole_select will blow up, but we can still do
some selected parts to enable some optimiazions at a later point
(like fcsel(a,b,0) into fmul), etc.

No change in shader-db with RV370 or RV530 at this point.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:00 +01:00
Pavel Ondračka
024491f60f r300: nir fcsel/CMP lowering pass for R500
Right now this is done in the backend so move it up to NIR. Doing this
in the backend is easier, as at that time we can have a better idea
about when we hit the hardware limits of three different TMP sources,
however moving this to NIR allows for some optimizations. Specifically,
at this time if we decide we actually have to lower we still have the
info if we have plain fcsel for which we can save the comparison and
emit flrp only. During translation to TGSI all of fcsel, fcsel_gt, and
fcsel_ge translate to CMP so at that point the comparison is always needed.

Shader-db RV530:
total instructions in shared programs: 126057 -> 125823 (-0.19%)
instructions in affected programs: 11359 -> 11125 (-2.06%)
helped: 68
HURT: 12
total temps in shared programs: 17043 -> 17023 (-0.12%)
temps in affected programs: 459 -> 439 (-4.36%)
helped: 32
HURT: 12
total cycles in shared programs: 191604 -> 191294 (-0.16%)
cycles in affected programs: 11834 -> 11524 (-2.62%)
helped: 68
HURT: 12

The hurt shaders are some GTK shaders where there is some bad
interaction with nir_move_vec_src_uses_to_dest. This is known and might
be improved later by thweking the pass more.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:00 +01:00
Pavel Ondračka
75e7790ee5 r300: small adress register load optimization
We do ffloor by default for adress register load so no need to do it
explicitly. This needs to happen after int lowering, otherwise we get
ftrunc by default as a bonus. This is mostly for wined3d.

Shader-db RV370:
total instructions in shared programs: 82147 -> 82071 (-0.09%)
instructions in affected programs: 2772 -> 2696 (-2.74%)
helped: 32
HURT: 0
total cycles in shared programs: 128479 -> 128403 (-0.06%)
cycles in affected programs: 2813 -> 2737 (-2.70%)
helped: 32
HURT: 0

Shader-db RV530:
total instructions in shared programs: 126141 -> 126057 (-0.07%)
instructions in affected programs: 3170 -> 3086 (-2.65%)
helped: 36
HURT: 0
total cycles in shared programs: 191688 -> 191604 (-0.04%)
cycles in affected programs: 3222 -> 3138 (-2.61%)
helped: 36
HURT: 0

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26816>
2024-01-04 08:02:00 +01:00
Dave Airlie
af3cca98a2 lavapipe: bump .maxResourceDescriptorBufferRange
Fail (maxResourceDescriptorBufferRange is less than (((1u << 20) - (1u << 15)) * maxResourceDescriptorSize) at vktBindingDescriptorBufferTests.cpp:5127)

bump this to pass the test now.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
da53d0b6e5 gallivm/lp: move sampler index around to reduce struct
I'm not sure this is 100% correct, but it does reduce the
struct size to 256 which is conformant

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
839045bcc8 gallivm/lp: merge sample info into normal info
multisample textures don't have mipmaps, so store sample_stride
into mipmap offset 15 and store num_samples into last_level

We can't use mipmap_offset0 as arrays might still store some values
into it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
344fa0895e gallivm/lp: reduce image descriptor size.
Reduce the image descriptor size alongside the texture one.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
749a4fff86 gallivm/lp: reduce size of lp_jit_texture.
This is step one in a size reduction plan, this reduces lp_jit_texture
by making all the fields smaller in the struct and upsizing on the llvm
size. It goes from 280->264.

This isn't sufficient to get conformance, but it's a good step one.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
1c68381ead gallivm/sample: make the load_mip helper useful outside this file.
Need this later for some size reduction patches.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
bdde30c131 gallivm/sample: add some num_samples vs level zero only support
This just checks the level zero only is set for multisample stuff.

I tried using asserts, but there are paths due to precompilation
that won't get hit, but do get compiled.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dave Airlie
7d4453b586 gallivm/sample: refactor first/last level handling and use level_zero_only.
This will help later esp for multisample textures which only ever have level 0

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25398>
2024-01-04 03:58:23 +00:00
Dmitry Baryshkov
c8c8c5a3cf freedreno/drm: don't crash in heap allocator when run under valgrind
If Mesa is executed under valgrind, fd_bo_init_common() calls
fd_bo_map() internally. For the heap (sub-block) allocator this causes a
segfault in fd_bo_map(), when this function tries to call the offset()
callback.

To prevent this from happening, preallocate fb->map before calling into
fd_bo_init_common(), stop calling VG_BO_ALLOC() if the memory map is
already initialised and disable the VG_BO_FREE call for the heap
allocator.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26277>
2024-01-04 03:17:46 +00:00
Dmitry Baryshkov
fd6b3bf267 freedreno/drm: notify valgrind about FD_BO_NOMAP maps
If the shader memory has been allocated with the FD_BO_NOMAP and got
later allocated a memory chunk during fd_bo_upload(), this can result in
the valgrind splat when it tries to release the free and/or cache the
BO. To fix this issue, notify valgrind about newly mmaped shader memory.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26277>
2024-01-04 03:17:46 +00:00
Dmitry Baryshkov
60686d4146 ir3/a6xx: fix ldg/stg of ulong2 and ulong4 data
Partially revert the commit f4c9e9329c ("ir3/a6xx: Fix immediate
offset stg/ldg path").

There is no need to multiply the immediate offsets by 4. Doing so
results in loading and/or storing the data at wrong locations.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26817>
2024-01-04 02:28:09 +00:00
Dmitry Baryshkov
3f25a73f17 ir3: fix shift amount for 8-bit shifts
Follow the 16-bit approach and convert shift amount to 8b for 8b shift
instructions.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26817>
2024-01-04 02:28:09 +00:00
Alyssa Rosenzweig
e7f3112eb9 asahi: Implement lod queries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26861>
2024-01-04 01:51:07 +00:00
Alyssa Rosenzweig
d32daa3fb2 nir/validate: allow bias on nir_texop_lod
AGX seems to support it, and it's very convenient for implementing sampler LOD
bias together with a clamped LOD query.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26861>
2024-01-04 01:51:07 +00:00
VladimirTechMan
407fd1e1d7 venus/android: Switch to using u_gralloc
That enables testing and development of the Venus-based Vulkan HAL
on a wider range of Android systems - flavors of "Cuttlefish" are
of particular practical interest. At this point, only two gralloc
variants are supported: CrOS and IMapper v4. The fallback gralloc
and any gralloc adapter modules relying on it (GBM, QCOM) are out
of scope for Android Vulkan HAL now.

Signed-off-by: VladimirTechMan <VladimirTechMan@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26858>
2024-01-04 01:35:13 +00:00
Dave Airlie
c2f79d7fb1 llvmpipe: fix caching for texture shaders.
caching only works if you check the size and store the result,
later the size is always set.

Fixes: f675e4ee82 ("llvmpipe: Pre compile sample functions")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25648>
2024-01-04 01:13:48 +00:00
Dave Airlie
8f73cc802c intel/compiler: revert part of "Move earlier scheduler code that is not mode-specific"
This removed a bunch of calls from the vec4 code that aren't called anywhere else.

Bring back the bits that were removed.

Fixes glxgears on gen5

Fixes: 81594d0db1 ("intel/compiler: Move earlier scheduler code that is not mode-specific")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26862>
2024-01-04 00:38:38 +00:00
Dave Airlie
37366fef68 intel/compiler: fix release build unused variable.
This is only used in an assert.

Fixes: 158ac265df ("intel/fs: Make helpers for saving/restoring instruction order")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26863>
2024-01-03 23:52:11 +00:00
Dave Airlie
b3cfec2fd8 gallivm: handle llvm 16 atexit ordering problems.
This is ported from amd ac_llvm_helper.cpp, thanks to Marek for the pointer.

This is needed to avoid crashes due to atexit ordering between some piglit
tests and mesa internals.

Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26883>
2024-01-03 22:57:17 +00:00
Rob Clark
2c078bfd18 freedreno/drm/virtio: Fix typo
Fixes: b90244776a ("virtio/drm: Split out common virtgpu drm structs")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26884>
2024-01-03 22:28:41 +00:00
Yonggang Luo
19fca131b1 amd: Use align64 instead of ALIGN for 64 bit value parameter
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26869>
2024-01-03 22:02:17 +00:00
Mike Blumenkrantz
49378bc3cd zink: enforce maxTexelBufferElements for texel buffer sizing
according to spec, creating larger texel buffers is legal for apps
but the resulting texel buffer must be clamped to device limits

fixes #10068

backport-to: 23.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26873>
2024-01-03 21:39:59 +00:00
Daniel Schürmann
bf43af984a nir/opt_loop_cf: generalize removal of "trivial" continues
So that is also handles break statements and works in
arbitrarily nested control flow.

Totals from 905 (1.18% of 76636) affected shaders: (RADV, GFX11)
Instrs: 605164 -> 605548 (+0.06%); split: -0.01%, +0.08%
CodeSize: 3162036 -> 3163472 (+0.05%); split: -0.01%, +0.06%
Latency: 2045559 -> 1387622 (-32.16%)
InvThroughput: 352344 -> 231676 (-34.25%)
SClause: 16092 -> 16088 (-0.02%); split: -0.04%, +0.02%
Copies: 41286 -> 41297 (+0.03%); split: -0.02%, +0.05%
Branches: 19949 -> 19929 (-0.10%)
PreSGPRs: 33413 -> 33385 (-0.08%)
PreVGPRs: 19177 -> 19135 (-0.22%)

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24940>
2024-01-03 20:48:05 +00:00
Daniel Schürmann
bdbf873b0f nir: remove redundant passes from nir_opt_if()
These are now covered by nir_opt_loop():
- opt_if_loop_last_continue()
- opt_merge_breaks()
- opt_if_loop_terminator()

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24940>
2024-01-03 20:48:05 +00:00
Daniel Schürmann
5b1b5cd794 nir: remove nir_opt_trivial_continues()
This pass is superseded by nir_opt_loop()

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24940>
2024-01-03 20:48:04 +00:00
Daniel Schürmann
a3ed36da1a treewide: replace calls to nir_opt_trivial_continues() with nir_opt_loop()
Totals from 850 (1.11% of 76636) affected shaders: (RADV, GFX11)
MaxWaves: 18134 -> 18130 (-0.02%)
Instrs: 3011298 -> 3008585 (-0.09%); split: -0.17%, +0.08%
CodeSize: 15836804 -> 15841972 (+0.03%); split: -0.09%, +0.12%
VGPRs: 63580 -> 63604 (+0.04%)
SpillSGPRs: 966 -> 1148 (+18.84%); split: -0.83%, +19.67%
Latency: 36102291 -> 30186144 (-16.39%); split: -16.41%, +0.02%
InvThroughput: 9058100 -> 7011821 (-22.59%); split: -22.61%, +0.02%
VClause: 65369 -> 65364 (-0.01%); split: -0.03%, +0.02%
SClause: 100309 -> 100305 (-0.00%); split: -0.04%, +0.04%
Copies: 335658 -> 336472 (+0.24%); split: -0.70%, +0.94%
Branches: 110806 -> 108945 (-1.68%); split: -1.94%, +0.26%
PreSGPRs: 73476 -> 73934 (+0.62%); split: -0.25%, +0.87%
PreVGPRs: 58809 -> 58840 (+0.05%); split: -0.01%, +0.06%

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24940>
2024-01-03 20:48:04 +00:00
Daniel Schürmann
9808ef0349 nir/opt_loop: move loop control-flow optimizations into separate pass
This new pass aims to simplify loop control-flow by reducing the number
of break and continue statements. It also supersedes nir_opt_trivial_continues().

For this purpose, it implements 3 optimizations:
- opt_loop_terminator(), as previously
- opt_loop_merge_break_continue(), similar to opt_merge_breaks() incl. continues
- opt_loop_last_block(), a generalization of opt_if_loop_last_continue()

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24940>
2024-01-03 20:48:04 +00:00
Christian Gmeiner
0158075b22 nir/opt_peephole_select: handle speculative ubo loads
Some platforms may be able to speculate ubo loads safely.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8299>
2024-01-03 20:02:25 +00:00
Ruijing Dong
6c758000fb frontends/va: remove some TODOs in hevc encoding
Remove some TODOs in va hevc encoding sps parsing.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26770>
2024-01-03 19:23:08 +00:00
Karol Herbst
3ee6339206 clc: remove code supporting pre llvm-10
we require llvm-10+ already anyway, see meson.build:1726

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26871>
2024-01-03 18:30:32 +00:00
Danylo Piliaiev
99c69e624b freedreno: Disable UBWC for D/S images on A690
Mirrors workaround done for Turnip.

A690 seem to have broken UBWC for depth/stencil, it requires
depth flushing where we cannot realistically place it, like between
ordinary draw calls writing read/depth. WSL blob seem to use ubwc
sometimes for depth/stencil.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26226>
2024-01-03 17:35:07 +00:00
Danylo Piliaiev
fbfc1dc09d turnip: Disable UBWC for D/S images on A690
A690 seem to have broken UBWC for depth/stencil, it requires
depth flushing where we cannot realistically place it, like between
ordinary draw calls writing read/depth. WSL blob seem to use ubwc
sometimes for depth/stencil.

Some tests that this fixes:
 dEQP-VK.pipeline.monolithic.stencil.format.d24_unorm_s8_uint.states.fail_repl.pass_decw.dfail_inv.comp_never
 dEQP-VK.api.image_clearing.core.partial_clear_depth_stencil_attachment.single_layer.d32_sfloat_s8_uint_separate_layouts_depth_64x11
 dEQP-VK.api.image_clearing.dedicated_allocation.partial_clear_depth_stencil_attachment.single_layer.d16_unorm_33x128
 dEQP-VK.glsl.builtin_var.fragdepth.point_list_d32_sfloat_s8_uint_no_depth_clamp

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26226>
2024-01-03 17:35:07 +00:00
Danylo Piliaiev
9fcddb761b freedreno/devices: Update a690 magic regs from WSL blob
They don't seem to fix anything, but now that's values from driver
running on actual HW.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26226>
2024-01-03 17:35:07 +00:00
Sil Vilerino
e11605321a Revert "d3d12: Fix screen->winsys leak in d3d12_screen"
This reverts commit 81c8e89ff8.

Fixes: 81c8e89ff8 ("d3d12: Fix screen->winsys leak in d3d12_screen")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26872>
2024-01-03 17:17:30 +00:00
Sil Vilerino
97cc7ea5a5 Revert "d3d12: Only destroy the winsys during screen destruction, not reset"
This reverts commit 325fb6e26b.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10371
Fixes: 325fb6e26b ("d3d12: Only destroy the winsys during screen destruction, not reset")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26872>
2024-01-03 17:17:30 +00:00
daoxianggong
d6f0f46ae4 zink - Fix for blend color change without blend state change
Flag blend color change and make sure vkCmdSetBlendConstants is called.

Signed-off-by: daoxianggong <daoxiang.gong@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26799>
2024-01-03 16:35:51 +00:00
Gert Wollny
53efd35acc zink: Don't pass a blend state when we have full ds3 support
The blend state is considered to be dynamic when no
VkPipelineColorBlendStateCreateInfo  is passed in at pipeline creation.

Fixes:
 VUID-VkGraphicsPipelineCreateInfo-renderPass-06055 when running
  "Quern - Undying thoughts" when the GFX level enables blending.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26718>
2024-01-03 15:34:50 +00:00
Samuel Pitoiset
7ea48145a1 radv: stop clearing CMASK to 0xcc when FMASK is present on GFX9
This is incorrect because clearing CMASK to 0xCC should only happen
for fast clears with DCC and FMASK/CMASK.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26634>
2024-01-03 13:58:06 +00:00
Samuel Pitoiset
1714f7aff4 radv: disable FMASK for MSAA images with layers on GFX9
It seems that FMASK can be interleaved and RADV doesn't support this
properly, so let's disable it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26634>
2024-01-03 13:58:06 +00:00
Rhys Perry
cad2c0915d aco/tests: use more raw strings
Python 3.12 started giving a SyntaxWarning for unrecognized escapes such
as "\w". This might become a SyntaxError in a future python version.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26850>
2024-01-03 13:33:52 +00:00
Yonggang Luo
472b6f5379 intel,crocus,iris: Use align64 instead of ALIGN for 64 bit value parameter
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26864>
2024-01-03 12:46:10 +00:00
Yonggang Luo
5a2aa3ff88 intel: Cleanup duplicate ALIGN macro defines
Use ALIGN function instead

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26864>
2024-01-03 12:46:10 +00:00
Yonggang Luo
8665ce27bc intel: Use ALIGN_POT instead of ALIGN inside macro define
These macro define is compute from literals, so use ALIGN_POT instead of ALIGN function
so that it's can be computed at compile time

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26864>
2024-01-03 12:46:10 +00:00
Yonggang Luo
3a9c569177 intel: Avoid use align as variable, replace it with other names
align is a function and when we want use it, the align variable will shadow it
So replace it with other names

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26864>
2024-01-03 12:46:10 +00:00
Samuel Pitoiset
10ce61e16c radv: advertise VK_KHR_maintenance6
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2024-01-03 11:24:27 +00:00
Samuel Pitoiset
db9816fd66 radv: add support for NULL index buffer
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2024-01-03 11:24:27 +00:00
Samuel Pitoiset
744cb98bc6 radv: add support for version 2 of all descriptor binding commands
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2024-01-03 11:24:27 +00:00
Samuel Pitoiset
5f63624701 radv: rename RADV_GRAPHICS_STAGES to RADV_GRAPHICS_STAGE_BITS
For consistency with RADV_RT_STAGE_BITS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2024-01-03 11:24:27 +00:00
Samuel Pitoiset
17081334ab radv: add support for VkBindMemoryStatusKHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2024-01-03 11:24:27 +00:00
Samuel Pitoiset
845a666e0f radv: move radv_BindImageMemory2() to radv_image.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26757>
2024-01-03 11:24:27 +00:00
Samuel Pitoiset
f30fa9dec8 radv: move radv_rt_{common,shader} files to nir/
These files contains NIR lowering code for RT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26851>
2024-01-03 09:40:29 +00:00
Samuel Pitoiset
02c5365ffa radv: make a couple of NIR RT functions as static
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26851>
2024-01-03 09:40:29 +00:00
Samuel Pitoiset
685c4b6337 radv: move radv_{emulate,enable}_rt() to radv_physical_device.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26851>
2024-01-03 09:40:29 +00:00
Eric Engestrom
c100905796 docs: mention that python package packaging is required on python 3.12+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26857>
2024-01-03 09:28:14 +00:00
Luc Ma
b6d22358e4 loader: Remove a line of unused include
Signed-off-by: Luc Ma <luc@sietium.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26852>
2024-01-03 08:06:01 +00:00
Yiwei Zhang
68a9b3cc6f venus: properly ignore formats in VkPipelineRenderingCreateInfo
also remove a redundant trace point and adjust the position for another
to better tell whether fixes have been applied to the pipeline info

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26751>
2024-01-03 07:16:24 +00:00
Yiwei Zhang
a443d4dbc6 venus: refactor to add pipeline info fixes helpers
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26751>
2024-01-03 07:16:24 +00:00
Yiwei Zhang
c1d8056bbe venus: split up the pipeline fix description into self and pnext
prepare for fixing the pipeline pnext chain

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26751>
2024-01-03 07:16:23 +00:00
Yiwei Zhang
2e1c9b68df venus: clang format fixes
work around vk_outarray_append_typed till a better solution fits

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26751>
2024-01-03 07:16:23 +00:00
Yonggang Luo
18abdb8596 compiler/glsl: Move glsl specific _mesa_glsl_initialize_types out and glsl_symbol_table of glsl_types.h
To make sure C-ABI compat,

struct _mesa_glsl_parse_state;
struct gl_shader_program;
struct gl_builtin_uniform_desc;

are wrapped with extern "C"

And getting _mesa_glsl_initialize_variables c-compat for consistence

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26804>
2024-01-03 06:38:19 +00:00
Mark Janes
188c349e51 intel: remove workaround for preproduction DG2 steppings
DG2_G10 was released with stepping C0.
DG2_G11 was released with stepping B1.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26845>
2024-01-02 16:06:37 -08:00
Iván Briano
56d556f821 anv: enable VK_KHR_maintenance6
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26842>
2024-01-02 22:12:02 +00:00
Iván Briano
b7c4fe54cb anv: move astc_emu to use descriptors2 calls
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26842>
2024-01-02 22:12:02 +00:00
Iván Briano
ce6899d804 anv: add support for Cmd*DescriptorSet*2KHR
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26842>
2024-01-02 22:12:02 +00:00
Iván Briano
40377eed91 anv: handle VkBindMemoryStatusKHR on buffer/image memory bind
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26842>
2024-01-02 22:12:02 +00:00
Iván Briano
abe0cc8aa4 anv: remove no longer valid assert
Maintenance6 allows creating uncompressed views of compressed images
with multiple layers.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26842>
2024-01-02 22:12:02 +00:00
Iván Briano
3b5615500a anv: allow NULL index buffers
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26842>
2024-01-02 22:12:01 +00:00
David Heidelberg
9017852de4 ci/radeonsi: disable VA-API testing on raven
Fails and freezes after Collabora farm outage.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26820>
2024-01-02 21:33:51 +00:00
David Heidelberg
ff6589715a ci/zink: update piano trace
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26820>
2024-01-02 21:33:51 +00:00
Sergi Blanch Torne
eca667b978 Revert "ci: disable collabora farm as it is currently offline"
This reverts commit d75643f400

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26820>
2024-01-02 21:33:51 +00:00
Tapani Pälli
fe5c82e853 isl: implement Wa_14018471104
Set EnableSamplerRouteToLSC in case ResourceMinLOD is 0.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26801>
2024-01-02 21:14:42 +00:00
José Roberto de Souza
70382f7f06 intel/isl/xe2: Enable route of Sampler LD message to LSC
Xe2 allows route of LD messages from Sampler to LSC to improve
performance when some restrictions are met.

BSpec: 57023
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26801>
2024-01-02 21:14:42 +00:00
Zhang, Jianxun
e9b633619c intel/genxml: Add RENDER_SURFACE_STATE for xe2
The indirect BO of clear color is also removed along with clear value
address and its enabling.

Other delta in struct RENDER_SURFACE_STATE are deferred to their
functional enabling changes.

Signed-off-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26801>
2024-01-02 21:14:42 +00:00
Jordan Justen
db5be18862 intel/genxml/gfx125: Move STATE_SURFACE_TYPE to enum
This will allow us to use it in Xe2 genxml.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26801>
2024-01-02 21:14:42 +00:00
Jordan Justen
772ce98a81 intel/genxml/gfx125: Move L1_CACHE_CONTROL to enum
This will allow us to use it in Xe2 genxml.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26801>
2024-01-02 21:14:42 +00:00
Sagar Ghuge
9e97ce59a8 anv: No need to emit PIPELINE_SELECT on Xe2+
On Xe2+, PIPELINE_SELECT is getting deprecated (Bspec 55860), as a
result we don't have to do the stalling flushes while switching between
different pipelines.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26637>
2024-01-02 20:57:33 +00:00
Sagar Ghuge
a22297d2b1 iris: No need to emit PIPELINE_SELECT on Xe2+
On Xe2+, PIPELINE_SELECT is getting deprecated (Bspec 55860), as a
result we don't have to do the stalling flushes while switching between
different pipelines.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26637>
2024-01-02 20:57:33 +00:00
Karol Herbst
208875516c zink: lock screen queue on context_destroy and CreateSwapchain
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25985>
2024-01-02 19:40:15 +00:00
Eric Engestrom
3bff59c567 docs: fix list whitespace
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26855>
2024-01-02 17:18:34 +00:00
Eric Engestrom
ebc2af4e95 docs/backport-mr: fix invalid nested formatting
Sphinx doesn't support that, so it renders verbatim.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26855>
2024-01-02 17:18:34 +00:00
Caio Oliveira
0b5abf2512 spirv: Use value_id_bound to set initial memory allocated
Don't rely on the current default (which is 2048 bytes) buffer size for
blocks -- which ends up being too small for most shaders.  Since we
already rely on value_id_bound to allocate an array of vtn_value, use
that to estimate a better value.

In addition to space for the array, we approximate the extra size of
extra data structures with the size of vtn_ssa_value, and skip it to the
next size (double it) to cover the CFG related allocations.  This
results in only single system allocation necessary to back the temporary
data for the majority of the shaders.

Parsing code was slightly reordered so we can validate and read the
value_id_bound before the temporary allocator is created.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25279>
2024-01-02 16:07:06 +00:00
Caio Oliveira
d5b4b7356e spirv: Use linear_alloc for parsing-only data
All the vtn_* structures and arrays are used only during the lifetime of
spirv_to_nir(); we don't need to free them individually nor steal
them out; and some of them are smaller than the 5-pointer header
required for ralloc allocations.

These properties make them a good candidate for using an
arena-style allocation.

Change the code to create a linear_parent and use that for all the vtn_*
allocation.  Note that NIR data structures still go through ralloc,
since we steal them (through the nir_shader) at the end, i.e. they
outlive the parsing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25279>
2024-01-02 16:07:06 +00:00
Caio Oliveira
89afcc94ea util: Add a way to set the min_buffer_size in linear_alloc
The default value remains 2048, which is also used for rounding up
any user provided size.

The option is useful in cases where there's a better idea of the
amount of data that's going to be used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25279>
2024-01-02 16:07:06 +00:00
Eric Engestrom
39c8cca34f zink/requirements: update feature and property names that have been promoted
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26496>
2024-01-02 15:49:41 +00:00
Eric Engestrom
48e4c68509 zink: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26496>
2024-01-02 15:49:40 +00:00
Mary Guillemard
a5930b4d41 zink: Force 128 fs input components under Venus for Intel
Apply the same workaround as for Intel vk drivers by detecting Intel vendor ID.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26562>
2024-01-02 15:30:14 +00:00
Jonathan Gray
33eecafe75 zink: put sysmacros.h include under #ifdef MAJOR_IN_SYSMACROS
Fixes the build on OpenBSD, where major() is in sys/types and
sys/sysmacros.h does not exist.  Also include sys/mkdev.h if
MAJOR_IN_MKDEV is defined.

Fixes: 6d60115be7 ("zink: Fix enumerate devices when running compositor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26735>
2024-01-02 15:11:41 +00:00
Jesse Natalie
aa81acf9cb zink: Add ASSERTED to vars that are only used for asserts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26762>
2024-01-02 14:54:30 +00:00
Erik Faye-Lund
5024b212b6 zink: use KHR version of maint5 features
This is still not in Vulkan core, so we can't refer to it without the
KHR suffix.

Fixes: f501f9453a ("zink: use maintenance5")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26419>
2024-01-02 14:26:21 +00:00
Erik Faye-Lund
021645ebf5 zink: update profile schema
This is needed for VK_KHR_maintenance5 support.

Fixes: f501f9453a ("zink: use maintenance5")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26419>
2024-01-02 14:26:21 +00:00
Pierre-Eric Pelloux-Prayer
115b61e51f ac/surface: don't oversize surf_size
Yet another iteration on the same YUV surfaces.

The change from 87ecfdfbf0 has 2 odd things:
* it's using MAX2(original value, new value) but the point of updating
  surf_slice_size / surf_size is to make it correct relative to the new
  value of surf_pitch
* it's multiplying surf_pitch (= number of elements per row) by height (ok)
  by surf->bpe (= number of bytes per element) by surf->blk_w (= number of
  "horizontal" pixels in an element) so the end unit doesn't make sense.

Fix this by computing a reasonnable value based on unit: the surf_slice_size
is the number of elements per row (surf_pitch) x number of bytes per element
(bpe) x number of rows.

This makes the expected size correct and thus fixes users of eglCreateImageKHR,
like the issue #6131.

I tested a bunch of gst pipelines and ffmpeg scripts on various files I have
and didn't notice any issues (on gfx10.3 and gfx9).

Fixes: 87ecfdfbf0 ("ac/surface: adapt surf_size when modifying surf_pitch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6131
Acked-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26693>
2024-01-02 14:32:05 +01:00
Georg Lehmann
9ecfd7919b aco: optimize 32bit fsign by using fmulz with Inf
2 instruction fsign with the power of cursed DX9 floating point rules.

Foz-DB Navi31:
Totals from 3803 (4.86% of 78196) affected shaders:
Instrs: 8436366 -> 8412549 (-0.28%); split: -0.29%, +0.00%
CodeSize: 43174284 -> 43114676 (-0.14%); split: -0.14%, +0.01%
SpillSGPRs: 3241 -> 3247 (+0.19%)
Latency: 66333841 -> 66287361 (-0.07%); split: -0.08%, +0.01%
InvThroughput: 10331902 -> 10316916 (-0.15%); split: -0.15%, +0.01%
VClause: 165455 -> 165472 (+0.01%); split: -0.01%, +0.02%
SClause: 242352 -> 242335 (-0.01%); split: -0.02%, +0.01%
Copies: 604086 -> 605781 (+0.28%); split: -0.04%, +0.32%
Branches: 214017 -> 214013 (-0.00%)
PreSGPRs: 209413 -> 209726 (+0.15%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26765>
2024-01-02 13:07:30 +01:00
Mike Blumenkrantz
f60dafb4bd vulkan: add wrappers for descriptor '2' functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26849>
2024-01-02 11:28:07 +00:00
Ganesh Belgur Ramachandra
f119f34742 radeonsi: convert "gfx11_create_sh_query_result_cs" shader to nir
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25972>
2024-01-02 10:53:31 +00:00
Ganesh Belgur Ramachandra
c109c3f95c radeonsi: convert "create_query_result_cs" shader to nir
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25972>
2024-01-02 10:53:31 +00:00
Ganesh Belgur Ramachandra
740a4c3448 radeonsi: add comments for unpack_2x16* utility functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25972>
2024-01-02 10:53:31 +00:00
Ganesh Belgur Ramachandra
d5ef8a0ac0 radeonsi: enable nir pass for 64 bit operations
Enables optimisations for divide-by-constant which are
required in some shaders. e.g. si_create_query_result_cs()

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25972>
2024-01-02 10:53:30 +00:00
Konstantin Seurer
b88ac6b381 nir: Optimize fpow with small constant exponents
They would be turned into exp(log(a)*b) instead, which is slow.

Totals from 2146 (2.52% of 85071) affected shaders:
MaxWaves: 35769 -> 35779 (+0.03%); split: +0.03%, -0.01%
Instrs: 6476835 -> 6465494 (-0.18%); split: -0.18%, +0.00%
CodeSize: 35382288 -> 35347092 (-0.10%); split: -0.10%, +0.00%
SpillSGPRs: 1055 -> 1017 (-3.60%)
Latency: 75211743 -> 75063623 (-0.20%); split: -0.20%, +0.00%
InvThroughput: 17525115 -> 17501745 (-0.13%); split: -0.14%, +0.00%
VClause: 200089 -> 200077 (-0.01%); split: -0.01%, +0.01%
SClause: 293566 -> 293480 (-0.03%); split: -0.03%, +0.00%
Copies: 649631 -> 640516 (-1.40%); split: -1.44%, +0.03%
Branches: 268441 -> 268325 (-0.04%)
PreSGPRs: 146868 -> 146045 (-0.56%)
PreVGPRs: 134125 -> 134128 (+0.00%); split: -0.00%, +0.01%

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26727>
2024-01-02 11:16:14 +01:00
Juan A. Suarez Romero
8b3496df30 ci/v3dv: update results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26846>
2024-01-02 10:23:24 +01:00
Luca Weiss
2e46dd0624 freedreno: Enable A305B
Enable the Adreno 305B that is found on the MSM8226(v2) SoC (Snadragon
400).

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26434>
2024-01-01 20:30:46 +00:00
Mark Collins
80a319c0b4 freedreno/rddecompiler: Add ability to read GPU buffer into file
While running tests, it is be useful to have non-sequenced dumps of
certain buffers to see their contents from changes in the decompiled
CS. This introduces a function gpu_read_into_file(...) for specifying
a file to read a specific GPU buffer into after replaying the CS.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26465>
2024-01-01 18:47:48 +00:00
Mark Collins
3c89b2882f freedreno/rddecompiler: Print pkt values in hex
As most of the pkt values are arbitrarily encoded numbers, they are
less readable as integers and printing them as hex is preferable.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26465>
2024-01-01 18:47:48 +00:00
Mark Collins
84e5b28514 freedreno/rddecompiler: Reset buffers after RD_CMDSTREAM_ADDR
This is necessary to correctly decode certain traces such as those
that use FDM.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26465>
2024-01-01 18:47:48 +00:00
Mark Collins
fa735aacbf freedreno/rddecompiler: Decode ELSE branches using NOPs
In newer traces, in any cases where instructions need to be executed
for both cases of a predicate, such as for GMEM/sysmem. The proprietary
driver emits the TRUE and FALSE body one after another with a NOP at
the end of the TRUE condition body so the CP skips over the FALSE body.

Currently, the NOP skips over all instructions in the ELSE body which
results in them not being decoded whatsoever. This commit checks if
we encounter any NOPs while in a conditional block and appropriately
parses out them out into their own ELSE scope when we do.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26465>
2024-01-01 18:47:48 +00:00
Mark Collins
cfc2a85b89 freedreno/rddecompiler: Emit explicit scope for CP_COND_REG_EXEC
Due to the larger amount of conditional execution in newer traces
the flat view makes it hard to parse what might be conditionally
executed and what might now. This makes it easier to view by adding
a scope for conditionally executed commands which is indented to the
next level.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26465>
2024-01-01 18:47:48 +00:00
Rhys Perry
10e0518a85 nir/loop_analyze: remove invariance analysis
compute_invariance_information() wasn't doing anything. The only variables
not skipped in the list are phis (which are never considered invariant)
and ALU instructions which use the phi as one of it's sources.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23726>
2024-01-01 14:15:39 +00:00
Yonggang Luo
0210b554d6 treewide: Replace the include of nir_types.h with glsl_types.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26753>
2023-12-30 15:08:11 +00:00
Ian Romanick
2e75d71c1f intel/cmat: Generate better code for nir_intrinsic_cmat_insert
When the source destination index is a constant, we can avoid generating
a lot of the intermediate code. At the very least, this makes initial
NIR dumps much easier to read.

v2: Simplify tracking of dst_index. Suggested by Caio.

Suggested-by: Caio
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
c6d44284aa intel/dev: Enable VK_KHR_cooperative_matrix on all Gfx9+ GPUs
Gfx12.5 (DG2) will use DPAS instructions to accelerate the
implementation. Earlier platforms will use equivalent discrete
instructions (basically subgroup operations). Gfx12 (Tigerlake) will use
DP4A for 8-bit integer matrix multiplication. Older platforms, which
lack DP4A, will use a suboptimal instruction sequence. There is plenty
of room for improvement here.

On DG2 (Gfx12.5) gets the following results from the CTS:

Test run totals:
  Passed:        1642/13982 (11.7%)
  Failed:        0/13982 (0.0%)
  Not supported: 12340/13982 (88.3%)
  Warnings:      0/13982 (0.0%)
  Waived:        0/13982 (0.0%)

On DG2 (Gfx12.5) with forced lowering, Raptor Lake (Gfx12) and Ice Lake
(Gfx11):

Test run totals:
  Passed:        1662/13982 (11.9%)
  Failed:        0/13982 (0.0%)
  Not supported: 12320/13982 (88.1%)
  Warnings:      0/13982 (0.0%)
  Waived:        0/13982 (0.0%)

The difference in the number of tests run is due to
saturatingAccumulation not being set on DG2 when DPAS is used. There is
a comment in "intel/dev: Advertise integer configs with
saturatingAccumulation too" that explains how this could be added should
the need arise.

v2: Prefix type names with INTEL_CMAT_. Suggested by Lionel.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
8ea032b78e intel/dev: Advertise integer configs with saturatingAccumulation too
VUID-RuntimeSpirv-saturatingAccumulation-08983 says:

   For OpCooperativeMatrixMulAddKHR, the SaturatingAccumulation
   cooperative matrix operand must be present if and only if
   VkCooperativeMatrixPropertiesKHR::saturatingAccumulation is VK_TRUE.

As a result, we have to advertise integer configs both with and without
this flag set.

v2: Prefix type names with INTEL_CMAT_. Suggested by Lionel.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
f952dd510e anv: Select the SIMD mode very early when cooperative matrices are used
The commit is a little ugly. The definition of anv_fixup_subgroup_size
is moved before the added call site. In addition, the bit starting at
the "Cooperative matrix extension requires..." comment is added.

v2: Dramatic simplification of SIMD selection. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
511f91e307 anv: Lower indirect derefs again after lowering cooperative matrices
The cooperative matrix lowering can generate a lot of indirect array
accesses, and these need to be eliminated.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
b741a9a851 anv: Set PIPELINE_SELECT systolic mode enable flag
Set the flag on compute shaders when the application has enabled the
cooperative matrix feature. We might still want to enable this only when
DPAS is actually used. The current method is based on many suggestions
from Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
7bfbeb79a7 anv: Set COMPUTE_WALKER systolic mode enable flag
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
67739b02de anv: Add anv_physical_device::has_cooperative_matrix
This flag tracks whether or not cooperative matrices are fully enabled
on the physica device (i.e., both the configs exist and the environment
varible is set).  This is mainly to support a later commit "anv: Set
PIPELINE_SELECT systolic mode enable flag."

This could be squashed into "anv: Implement VK_KHR_cooperative_matrix."
I left it separate because we might go back to the previous method.

v3: Don't hide the extension behind an environment variable
(ANV_COOPERATIVE_MATRIX) now the we have a better solution for setting
PIPELINE_SELECT.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Caio Oliveira
0a6f8b40bf anv: Implement VK_KHR_cooperative_matrix
v2: Rebase on moving lowering pass to src/intel/compiler.

v3: Don't hide the extension behind an environment variable
(ANV_COOPERATIVE_MATRIX) now the we have a better solution for setting
PIPELINE_SELECT.

v4: Prefix type names with INTEL_CMAT_. Suggested by Lionel. Also rebase
on f99e43d606 ("anv: switch to use runtime physical device properties
infrastructure").

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Caio Oliveira
ff16458478 intel/dev: Add cooperative matrix configuration information
v2: Prefix type names with INTEL_CMAT_. Suggested by Lionel.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:54 -08:00
Ian Romanick
6b14da33ad intel/fs: nir: Add nir_intrinsic_dpas_intel
v2: Fix parameter order in nir_intrinsic_dpas_intel to DPAS conversion.

v3: Fix float16 destination DPAS on DG2.

v4: Use nir_component_mask(...) instead of 0xffff. Suggested by Caio.

v5: Rebase on !26323.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:28:43 -08:00
Ian Romanick
3756f60558 intel/fs: DPAS lowering
Implements integer dot product lowering both with and without
DP4A. Implements half-float dot product lowering.

There are a couple FINISHME comments describing future optimizations.

v2: Add a brw_compiler::lower_dpas flag to track when the lowering
should be applied.

v3: Use is_null() instead of checking file != ARF. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:27:15 -08:00
Ian Romanick
3cb9625539 intel/fs: Fix scoreboarding for DPAS
v2: Remove all mention of DPASW. Suggested by Curro and Caio.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:27:15 -08:00
Ian Romanick
eb1f19d7bf intel/compiler: Validation for DPAS instructions
v2: s/regiser/register/g in messages. Noticed by Caio. Add more context
to the sub-byte precision error message. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:27:15 -08:00
Ian Romanick
1c92dad5cb intel/disasm: Disassembly support for DPAS
v2: Fix regioning in src[012]_dpas_3src. Noticed by Caio. Treat DPAS as
unordered. Suggested by Curro.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:27:13 -08:00
Ian Romanick
e666872c75 intel/compiler: Initial bits for DPAS instruction
v2: Add brw_ir_performance.cpp and brw_fs_generator.cpp changes. Fix
overlapping register allocation (via has_source_and_destination_hazard). Fix
incorrect destination register file encoding.

v3: Prevent lower_regioning from trying to "fix" DPAS sources.

v4: Add instruction latency information for scheduling and perf
estimates.

v5: Remove all mention of DPASW. Suggested by Curro and Caio. Update
the comment in fs_inst::has_source_and_destination_hazard. Suggested
by Caio.

v6: Add some comments near the src2 calculation in
fs_inst::size_read. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:16 -08:00
Ian Romanick
3a35f8b29b intel/cmat: Lower cmat_load and cmat_store
v2: Add support for non-constant stride.

v3: Explain B matrices (a little bit) in
get_slice_type_from_desc. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:16 -08:00
Ian Romanick
502be565da intel/cmat: Add lowering for cmat_bitcast
v2: Use nir_component_mask(...) instead of 0xffff. Assert that source
and destination are same size. Both suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Ian Romanick
7303315a8b intel/cmat: Enable packed formats for scalar ops
v2: Use nir_pack_bits and nir_unpack_bits to simplify coop_scalar
handling. This saved 13 lines of code.

v3: Allow packing factor 2 and packing factor 1 elements be stored in
16-bit integers.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Ian Romanick
26c4acd8ee intel/cmat: Enable packed formats for binary ops
v2: Use nir_pack_bits and nir_unpack_bits to simplify coop_binary
handling. This saved 13 lines of code.

v3: Allow packing factor 2 and packing factor 1 elements be stored in
16-bit integers.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Ian Romanick
0d314eb3cc intel/cmat: Enable packed formats for unary, length, and construct
With this, a minimum test case passes:

    void main()
    {
        coopmat<float16_t, gl_ScopeSubgroup, M, N, gl_MatrixUseA> matA;
        coopmat<float, gl_ScopeSubgroup, M, N, gl_MatrixUseA> matR;

        matA = coopmat<float16_t, gl_ScopeSubgroup, M, N, gl_MatrixUseA>(2.0);
        matR = coopmat<float, gl_ScopeSubgroup, M, N, gl_MatrixUseA>(matA);

        coopMatStore(matR, result, 0, N, gl_CooperativeMatrixLayoutRowMajor);
    }

v2: Use nir_vec instead of explicit nir_vec{2,4}. Also fixes a typo in
one of the 4x8 cases.

v3: Use nir_pack_bits and nir_unpack_bits to dramatically simplify
coop_unary handling. This saved 67 lines of code.

v4: Allow packing factor 2 and packing factor 1 elements be stored in
16-bit integers.

v5: Massive update to the comment in lower_cooperative_matrix_unary_op
with some suggestions from Caio. Add a comment and assertion around
`nir_def *v[4]`. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Ian Romanick
75388a71c9 intel/cmat: Add lowering for cmat_insert and cmat_extract
v2: Use nir_component_mask(...) instead of 0xffff. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Ian Romanick
a2ded5b26c intel/cmat: Update get_slice_type for packed slices
Also splits off another funciton get_slice_type_from_desc that will be
used in future commits.

v2: Allow packing factor 2 and packing factor 1 elements be stored in
16-bit integers.

v3: Use glsl_base_type_get_bit_size.

v4: Adjust packing so that a single row fills an entire GRF.

v5: Add comment for get_packing_factor and some other cleanups
there. s/cooperative_matrix/cmat/. Tighten the validation of len in
gt_slice_from_desc. All suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Caio Oliveira
dba6451ce8 intel/cmat: Add pass to lower cooperative matrix to subgroup operations
This is just the skeleton of the implementation. Future commits will
fill it all in.

v2: Move to src/intel/compiler

v3 (idr): Use vecN instead of array[N] for slice type.

v4 (idr): Refactor lower_cooperative_matrix_load and
lower_cooperative_matrix_store into a single function.

v5 (idr): Remove old, verbose debug logging. Assert that entry is not
NULL in get_coop_type_for_slice. Use nir_component_mask(...) instead of
0xffff. s/cooperative_matrix/cmat/. All suggested by Caio.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>

I put both R-b on this because, at this point, we've each done equal
parts authoring and reviewing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25994>
2023-12-29 20:24:15 -08:00
Danylo Piliaiev
61c9cf9890 freedreno: Add a644 support
The GPU is same as a660 but for SP_DBG_ECO_CNTL register value.
Checked by comparing cmd streams between them.

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26836>
2023-12-29 09:44:07 +00:00
Nanley Chery
ee524e198b iris: Fix lowered images in get_main_plane_for_plane
This function was recently simplified based on the idea that if a
modifier is not present, then the plane count should not exceed the
plane count of the resource's external format. This seems to be true
except for lowered images. We don't enable compression modifiers on
lowered images, so this case was not handled during the transition.

As an example of the lowering that may occur: PIPE_FORMAT_YVYU is a
single plane, subsampled format that the gallium layer lowers to two
planes/formats (R8G8_UNORM and B8G8R8A8_UNORM) if not natively supported
by the hardware.

Fixes the assert failure when running the piglit test case:

   ext_image_dma_buf_import-sample_yuv -fmt=YVYU -auto

   ext_image_dma_buf_import-sample_yuv:
      ../../src/gallium/drivers/iris/iris_resource.c:1384:
   iris_resource_from_handle:
      Assertion `main_res->aux.surf.row_pitch_B ==
                 plane_res->surf.row_pitch_B' failed.

Also, replaces it with a new one in case this fails again:

   ext_image_dma_buf_import-sample_yuv:
      ../../src/gallium/drivers/iris/iris_resource.c:1381:
   iris_resource_from_handle:
      Assertion `isl_drm_modifier_has_aux(whandle->modifier)' failed.

Fixes: 79222e5884 ("iris: Simplify get_main_plane_for_plane")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26826>
2023-12-29 09:08:57 +00:00
Nanley Chery
94e5b5d049 isl: Handle MOD_INVALID in clear color plane check
In iris, if whandle->modifier is DRM_FORMAT_MOD_INVALID within
iris_resource_from_handle, isl_drm_modifier_plane_is_clear_color will
assert fail on non-existent modifier info. Update that function to
return early instead.

Fixes the assert failure when running the piglit test case:

   ext_image_dma_buf_import-sample_yuv -fmt=YVYU -auto

   ext_image_dma_buf_import-sample_yuv: ../../src/intel/isl/isl.h:2352:
      isl_drm_modifier_plane_is_clear_color: Assertion `mod_info' failed.

Fixes: 81d132d5ea ("iris: Use helpers for generic aux plane importing")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26826>
2023-12-29 09:08:57 +00:00
Rohan Garg
5fff6eac42 intel/compiler: Update disassembly for new LSC cache enums
Rework:
* Caio: Add remaining enum values.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26837>
2023-12-28 15:13:24 -08:00
Francisco Jerez
b91fa057ab intel/compiler/xe2: Don't disassemble non-existent fields.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26837>
2023-12-28 15:13:24 -08:00
Jordan Justen
6495fe3d37 intel/xe2+: Implement brw_wm_state_simd_width_for_ksp() on Xe2+.
The mechanism for selecting dispatch modes has changed from previous
platforms, add a new implementation brw_wm_state_simd_width_for_ksp()
using the new kernel dispatch controls.

[ Francisco Jerez: Split from a larger patch, handle multipolygon
                   dispatch, add additional comments. ]

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
d8ad51ec76 intel/xe2+: Implement fragment shader dispatch state setup.
This sets up the PS dispatch controls to a supported combination of
Kernel0/Kernel1 dispatch modes, initializing the polygon packing
controls to use a multipolygon dispatch mode if one was provided.

Rework:
 * Jordan: Move into intel_update_ps_state()

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
ab0eff4388 intel/fs/xe2+: Attempt to build quad-SIMD8 and dual-SIMD16 FS variants on Xe2+ platforms.
Extend the pre-existing dual-SIMD8 compilation path in
brw_compile_fs() to attempt quad-SIMD8 and dual-SIMD16 compiles.
Instead of building every possible dispatch mode and then picking one
based on cycle-count heuristics, this attempts to only build a single
multipolygon kernel -- The different mulipolygon dispatch modes are
tried in the expected order of decreasing performance (quad-SIMD8,
dual-SIMD16 then dual-SIMD8), the first one that successfully compiles
without spills is taken as a simple heuristic, and no further
multipolygon builds are attempted.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
8cd8d6bccc intel: Add debug flags for enabling Xe2+ multipolygon fragment shader dispatch modes.
Note that the multipolygon PS disptach modes supported by Xe2 aren't
enabled by default yet, but they can be enabled manually via
INTEL_SIMD_DEBUG=fs2x8,fs4x8,fs2x16.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
50d084ec29 intel/fs/xe2+: Lower SIMD width of instructions that access ATTR file from SIMD2x8/4x8 FS.
This is needed because the information stored on the ATTR file for
multipolygon fragment shaders isn't stored as a contiguous sequence in
the GRF, instead the ATTR source may be lowered by assign_urb_setup()
to use a <16;8,0> region, which reads 4 SIMD16 GRFs for a SIMD32
instruction, even though the result of fs_inst::size_read() is
expected to be 2 GRFs.  Special case ATTR sources for multipolygon PS
shaders to calculate the number of physical GRFs that will actually be
read by the instruction after lowering, based on the number of
polygons processed by the instruction.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
0d332d0c49 intel/fs: Plumb shader instead of compiler to get_lowered_simd_width() and friends.
This will allow making lowering decisions based on properties of the
shader, like the multipolygon dispatch mode used.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
bd634bef12 intel/fs/xe2+: Implement layout of mesh shading per-primitive inputs in PS thread payloads.
This is based on a previous patch by Marcin Ślusarz addressing the
same issue, though it's largely rewritten, simplified and includes
additional fixes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
4cebfaadf7 intel/fs/xe2+: Implement support for multi-polygon vertex setup data in PS payload.
This fixes a number of assumptions made by the multipolygon input
attribute handling code from assign_urb_setup() so it also works on
Xe2+, which has additional multipolygon dispatch modes (like SIMD4x8
and SIMD2x16) and uses a different more compact representation of the
plane parameters.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 14:12:59 -08:00
Francisco Jerez
702eabaaae intel/fs/xe2+: Update for new layout of vertex setup data in PS payload.
The interpolation deltas of PS inputs now show up as a 12B vec3 (A0,
A1-A0, A2-A0) in the ATTR file, instead of the previously used 16B
format with an unused component.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
d622e19f00 intel/fs/xe2+: Enable new format of barycentrics in PS payload.
The X and Y barycentric vectors are no longer interleaved in SIMD8
chunks (yay), so this is mostly a matter of disabling the
lower_barycentrics() pass and switching to a simpler implementation of
fetch_barycentric_reg() that simply calls fetch_payload_reg() instead
of the SIMD8 shuffling we had to do in previous generations.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
49a867f67e intel/fs: Add support for vector payload values to fetch_payload_reg().
This extends fetch_payload_reg() to support fetching vector registers
like barycentrics stored on the payload as a contiguous sequence of
SIMD-wide vectors.  In the SIMD32 case, both halves of the SIMD16
vector registers specified as regs[0] and regs[1] are zipped to
construct a single SIMD32-wide vector.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
f295494cee intel/fs/xe2+: Update poly info PS payload for new multi-polygon dispatch format.
This includes the render target array index, viewport index, and
front/back facing fields, which are now replicated per pair of
subspans in order to support fixed-layout multi-polygon PS dispatch.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
4cc9c37bba intel/fs/xe2+: Update location of sample ID fields in PS payload.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
a0ae3c0dba intel/fs/xe2+: Update uses of pixel/sample mask from PS thread payload.
Note from Caio: proper handling of brw_sample_mask_reg
will appear in later patches.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
6dae56cc57 intel/fs/xe2+: Fix for new layout of X/Y pixel coordinates in PS payload.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
ef6ef7aa8e intel/fs/xe2+: Implement PS thread payload register offset setup.
The PS thread payload format has changed enough in Xe2 that it
probably doesn't make sense to share code with gfx6.  See BSpec page
"PS Thread Payload for Normal Dispatch - 512 bit GRF" for the new
format.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Francisco Jerez
24e8709d8b intel/eu/xe2+: Add helpers for constructing registers in 512b units.
These are new variants of the existing brw_reg GRF constructors that
take registers numbers in the new 512b units.  Mainly useful for
thread payload setup code to use register numbers in a format that
matches the BSpec.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26606>
2023-12-28 11:07:03 -08:00
Eric Engestrom
0ffb828513 Revert "meson: add wrap for libdrm"
This reverts commit 40b87cde2a.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26835>
2023-12-28 15:44:25 +00:00
Eric Engestrom
666f27d228 ci/containers: use build-libdrm.sh in debian/android
The extra complexity is not worth saving the 3x 468 KB of bandwidth
wasted every time we rebuild this container because we delete the
tarball inside the script.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26825>
2023-12-28 14:13:39 +00:00
Eric Engestrom
753056fb94 meson: use allow_fallback instead of manually listing the deps and what they provide
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26834>
2023-12-28 13:17:25 +00:00
Eric Engestrom
eb24e070bf meson: update zlib wrap
Output of `meson wrap update zlib`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26834>
2023-12-28 13:17:25 +00:00
Eric Engestrom
05500ba4eb meson: update libxml2 wrap
Output of `meson wrap update libxml2`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26834>
2023-12-28 13:17:25 +00:00
Eric Engestrom
14f8dd4236 meson: update libarchive wrap
Output of `meson wrap update libarchive`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26834>
2023-12-28 13:17:25 +00:00
Eric Engestrom
d55c655794 meson: update expat wrap
Output of `meson wrap update expat`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26834>
2023-12-28 13:17:25 +00:00
Dylan Baker
40b87cde2a meson: add wrap for libdrm
Sometimes as a developer when a new version of libdrm is required, it's
nice to not have to install it somewhere and set up pkg-confing, and
just let Meson do it for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10364>
2023-12-28 11:35:04 +00:00
Eric Engestrom
ebee672ef8 docs: update calendar for 23.3.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26824>
2023-12-27 22:34:32 +00:00
Eric Engestrom
b8215b5442 docs: add sha256sum for 23.3.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26824>
2023-12-27 22:34:24 +00:00
Eric Engestrom
0cf1ee35f7 docs: add release notes for 23.3.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26824>
2023-12-27 22:26:56 +00:00
José Roberto de Souza
3465e9f352 anv: Assume that imported bos already have flat CCS requirements satisfied
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10291
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26711>
2023-12-27 18:05:04 +00:00
José Roberto de Souza
8d0e70f628 anv: Replace anv_bo.vram_only by anv_bo.alloc_flags check
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10291
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26711>
2023-12-27 18:05:04 +00:00
José Roberto de Souza
060439bdf0 anv: Add ANV_BO_ALLOC_IMPORTED
The next patch will replace anv_bo.is_vram by a anv_bo.alloc_flags
check but to that actually work we can't use ANV_BO_ALLOC_NO_LOCAL_MEM
for imported bos, so here adding it.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10291
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26711>
2023-12-27 18:05:04 +00:00
Felix DeGrood
5683c54d8f driconf: add Witcher3 to Intel XeSS workaround
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26818>
2023-12-27 17:10:19 +00:00
Felix DeGrood
b77b67064e driconf: add Dying Light 2 to Intel XeSS workaround
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26818>
2023-12-27 17:10:19 +00:00
Kenneth Graunke
55c262898a iris: Skip mi_builder init for indirect draws
We only need it for indirect draws.

Improves performance on an i7-12700 and A770:

- Piglit's drawoverhead base case +150.639% +/- 2.86933% (n=15).
- gfxbench5 gl_driver2_off +19.7219% +/- 1.13778% (n=15)
- SPECviewperf2020 catiav5test1 +1.6831% +/- 0.552052% (n=10).

Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26806>
2023-12-27 01:25:04 -08:00
Kenneth Graunke
d55b5d4af5 iris: Don't search the exec list if BOs have never been added to one
Whenever we use a BO in a batch, we need to find its corresponding exec
list entry, either to a) record that it's been used, b) update whether
it's being written, c) check for cross-batch implicit dependencies.

bo->index exists to accelerate these lookups.  If a BO is used multiple
times by a batch, bo->index is its location in the list.  Because the
field is global, and a BO can in theory be used concurrently by multiple
contexts, we need to double-check whether it's still there.  If not, we
fall back to a linear search of all BOs in the list, looking to see if
our index was simply wrong (but presumably right for another context).

However, there's one glaringly obvious case that we missed here.  If
bo->index is -1, then it's wrong for /all/ contexts, and in fact implies
that said BO has never been added to any exec list, ever.  This is quite
common in fact: a new BO, never been used before, say from the BO cache,
or streaming uploaders, gets used for the first time.

In this case we can simply conclude that it's not in the list and skip
the linear walk through all buffers referenced by the batch.

Improves performance on an i7-12700 and A770:

- SPECviewperf2020 catiav5test1: 72.9214% +/- 0.312735% (n=45)

Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26806>
2023-12-27 01:25:00 -08:00
Kenneth Graunke
d178334d5c iris: Initialize bo->index to -1 when importing buffers
A value of -1 means that the buffer has never been used in an execbuf
buffer list in any of our contexts.  While setting this isn't critical,
doing so will allow us to short-circuit some looping in the next patch.

Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26806>
2023-12-27 01:24:35 -08:00
Nanley Chery
bd32badbb7 iris: Delay main and aux resource creation on import
Follow the pattern for initializing aux resource addresses.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
2023-12-26 18:40:38 +00:00
Nanley Chery
5f93f97892 iris: Use common res fields for imported planes
Instead of putting the aux plane info in the aux fields, just use the
same iris_resource fields for all planes.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
2023-12-26 18:40:38 +00:00
Nanley Chery
a0f3c0a246 iris: Inline import_aux_info
This function is only used once. By inlining it, we can more easily
compare the CCS plane import code with the clear color plane import
code.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
2023-12-26 18:40:38 +00:00
Nanley Chery
81d132d5ea iris: Use helpers for generic aux plane importing
Inline iris_resource_finish_aux_import and reimplement it with the
helper functions for managing resource planes. Provides more testing for
the helper functions and simplifies the code.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
2023-12-26 18:40:38 +00:00
Nanley Chery
733607cc37 iris: Simplify a plane count check in from_handle
Instead of checking the plane count in order to finish importing the aux
info, just check the plane index. Planes are added in reverse, so we'll
have the complete number of planes once we reach plane zero.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
2023-12-26 18:40:38 +00:00
Nanley Chery
79222e5884 iris: Simplify get_main_plane_for_plane
Dropping the mod_info parameter simplifies a future commit.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
2023-12-26 18:40:38 +00:00
Chia-I Wu
d9ba75e2e1 Revert "vk/util: ignore unsupported feature structs"
This reverts commit eb5bb5c784.  The
commit broke drivers which do not initialize
vk_physical_device::properties.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26813>
2023-12-25 20:36:34 +00:00
Karol Herbst
bc9fe6637b ci: merge debian-rusticl-testing into debian-testing
There is really no point anymore having it split out.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26807>
2023-12-25 16:18:41 +00:00
Yonggang Luo
6d4577799c ci/microsoft: Update the image-tag and image-path for msvc2019/msvc2022
Update the image-path from x64 to x86_64 for consistence with other platform

This is also cause the python to be updated to python3.12

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
cb50d0cabf ci/msvc: Split the install of rust and d3d out of mesa_deps_test.ps1
There is no need repeatedly downloading rust and d3d when building the docker locally

Download glext.h from github

Remove src directory and .git directory once compiling finished

Split piglit and depq compiling out

Clean middle files of piglit and depq
ci/msvc: Improve fetch source of spirv_samples_source

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
6e8c3a585a ci/msvc: Stick VK-GL-CTS to specific version 56114106d860c121cd6ff0c3b926ddc50c4c11fd
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
85bbc1a753 ci/msvc: Stick deqp-runner to version v0.16.1
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
5109790cf9 ci/msvc: Install both msvc2019 and msvc2022
Currently only msvc2019 are used

This is did intentionally, so we have a history script install msvc2019 only within vs2022

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
14e624bf43 ci/msvc: Install msvc2019 only from vs2022
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
24c40cafc4 ci/msvc: Upgrade to vs2022 build tools
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
25a560b622 ci/msvc: Remove &windows_msvc_image_tag
This is hard to understand and complicated

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
c0ad42fe34 ci/msvc: Improve msvc init
Now when choose different version of msvc, there is no need rebuild windows-msvc docker

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
a2595dbf3b ci/msvc: Rename vs to msvc for consistence
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
4d6d0a24ed ci/msvc: Rename vs2019 to msvc
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
543e872d90 ci/msvc: Split install vulkan sdk out of choco
packaging are installed because python 3.12 need it

Install of vulkan-sdk improved so that it's can be running in non-docker environment

Now vulkan-sdk have separate script so that it can be updated without update MSVC

THe choco installed packages is almost freeze to update, so split install of vulkan sdk
out of it for avoid update it when update VULKAN_SDK_VERSION on local computer

--params="/InstallDir:C:\python3" won't take effect, drop it for not misleading

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
9e89e7a7c2 ci/msvc: Install graphics tools(DirectX debug layer) easy to stuck, place it at the beginning
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Yonggang Luo
09ca7b3d9e ci/msvc: update flex and bison to winflexbison3
winflexbison3 is from github and faster, other than that, bison in winflexbison is too old(year 2007)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00
Eric Engestrom
7e8db6aedf meson: always define {,DRAW_}LLVM_AVAILABLE one way or the other
With the usual benefits of `#if` instead of `#ifdef` (mostly the fact
that typos can be build failures instead of silently being interpreted
as if 0).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3863>
2023-12-24 10:01:39 +00:00
Eric Engestrom
ac5a27917d ci: fix farm restore pipelines
A few lines above, we disable pipelines for farm disables, but we were
missing a condition to run the container & build jobs when re-enabling
a farm, leading to invalid pipelines where test jobs for that farm are
created but the container & build jobs are missing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26809>
2023-12-24 09:30:52 +00:00
Eric Engestrom
d75643f400 ci: disable collabora farm as it is currently offline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26810>
2023-12-24 09:27:15 +00:00
Juan A. Suarez Romero
c05261a7d8 ci/v3dv: add new failures
These failures started with eb5bb5c784 ("vk/util: ignore unsupported
feature structs").

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26808>
2023-12-24 00:48:10 +01:00
Samuel Pitoiset
551924aa87 ci: apply two bugfixes for VKCTS
These are needed for RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26798>
2023-12-22 20:12:39 +00:00
Rohan Garg
3e46ee61d5 intel/fs/xe2+: Lift CPS dispatch width restrictions on Xe2+.
These restrictions don't seem to be applicable anymore, and limiting
to SIMD8 wouldn't work since we're no longer building shaders with
that dispatch width.

[ Francisco: This one-liner change was squashed by Rohan Garg into a
  previous version of my patch "Stop building SIMD8 programs", but it
  makes more sense as a separate commit -- Formatted as a separate
  patch. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26605>
2023-12-22 10:37:00 -08:00
Ian Romanick
84b53e1a54 intel/fs/xe2+: Pass correct dispatch_width to fs_generator for geometry-processing stages.
Instead of hard-coding a dispatch_width value which is no longer
correct on Xe2+.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26605>
2023-12-22 10:37:00 -08:00
Francisco Jerez
3f92dde55e intel/fs/xe2+: Stop building SIMD8 shaders for geometry stages (VS/TCS/TES/GS).
They are no longer suppored by the fixed-function hardware.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26605>
2023-12-22 10:37:00 -08:00
Francisco Jerez
6877916155 intel/fs/xe2+: Stop building SIMD8 fragment shaders.
They are no longer suppored by the fixed-function hardware.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26605>
2023-12-22 10:37:00 -08:00
Francisco Jerez
7397ba61c2 intel/fs/xe2+: Stop building SIMD8 compute-like shaders (CS/BS/TS/MS).
SIMD8 kernels are no longer able to utilize the ALUs efficiently,
since they have twice the vector width as previous platforms.  However
even though there aren't many reasons to use it, SIMD8 is still
supported by the instruction set technically, and it will still be
used for some SIMD-lowering sequences.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26605>
2023-12-22 10:37:00 -08:00
Francisco Jerez
69cc72e50a anv/gfx12: Hook up dual-SIMD8 fragment shader dispatch.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
4ec54e84da iris/gfx12: Hook up dual-SIMD8 fragment shader dispatch.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
ccb5795938 intel/gfx12: Enable SIMD8 dispatch in 3DSTATE_PS for FS multipolygon dispatch.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
4868408e6e intel/genxml: Add 3DSTATE_PS definitions needed for dual-SIMD8 dispatch on Gfx12+.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
1f2c44dc21 intel/compiler: Attempt to build dual-SIMD8 variant of fragment shaders on gfx12+ platforms.
Similar to other FS dispatch modes, attempt to build a dual-SIMD8
program if the regular SIMD8 program didn't spill and doubling the
amount of space for varyings doesn't cause us to go over the thread
payload limit.  Dual-SIMD8 builds in combination with coarse pixel
shading are currently not handled.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
261d07f398 intel: Add debug flag for enabling dual-SIMD8 fragment shader dispatch.
Note that this option isn't enabled by default yet pending additional
performance evaluation.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
28aec45eed intel/fs/gfx12: Implement multi-polygon format of render target array index in PS payload.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
5b1ab77423 intel/fs/gfx12: Implement multi-polygon format of back/front-facing flag in PS payload.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
4672fcbc76 intel/fs: Fix PS thread payload setup for depth_w_coef_reg.
It's not replicated per SIMD16 half of a SIMD32 thread on the PS
payload.  Make fs_visitor::payload::depth_w_coef_reg a scalar rather
than an array.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
09ea840987 intel/fs: No need to copy null destinations in lower_simd_width.
The copy would be discarded immediately.  Until now we were relying on
DCE to eliminate these, but it seems like in some cases MOVs into the
null register emitted by lower_simd_width() are never eliminated,
likely because a lower_simd_width() call has been introduced close to
the bottom of optimize() which isn't follow by any additional DCE
passes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
5e0760a993 intel/fs/gfx12: Don't consider multipolygon PS to have packed dispatch.
This fixes a number of regressions and hangs in multipolygon fragment
shaders that have FIND_LIVE_CHANNEL sequences which would otherwise
lead to access of a dead channel.  Note that the failures don't seem
to be reproducible in simulation.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
8f92baa5d3 intel/fs/gfx12+: Don't set nir_divergence_single_prim_per_subgroup option for fragment shaders.
Flat-shaded inputs and other per-primitive values can no longer be
considered to be uniform across fragment shader subgroups due to
multipolygon dispatch.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
6bf99e6a45 intel/compiler: Don't change types for copies from ATTR file.
Since the <8;8,0> regions they use in multipolygon mode could violate
regioning restrictions in some cases, depending on the execution type
of the instruction.  Note that the assertion is removed from
try_copy_propagate() since a more accurate check is used within that
function than what fs_inst::can_change_types() can do.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
2ed36050fb intel/fs: Don't copy-propagate ATTR registers in multi-polygon FS shaders when invalid.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Jordan Justen
3f89fa63e6 intel/compiler: Pass max_polygons to copy-prop from fs_visitor.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
b62ad4e028 intel/fs: Rework layout of FS vertex setup data in ATTR file to support multi-polygon dispatch.
The updated layout includes one copy of each plane parameter per
channel of the SIMD thread, in order to allow channels to process
different polygons.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
a844c0b185 intel/fs: Fix fs_reg::component_size() to handle two-dimensional register regions.
Add code to calculate the size in bytes of arbitrary two-dimensional
regions for FIXED_GRF and ARF registers.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:31 +00:00
Francisco Jerez
83a0252e8d intel/fs: Pass builder to per_primitive_reg().
Matches prototype of interp_reg(), will be useful in a subsequent commit.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
8e9f09dbe5 intel/fs: Provide component index explicitly to interp_reg().
Main motivation is that for multipolygon PS shaders the i-th plane
parameter for the j-th input attribute will no longer necessarily be a
scalar, since different channels may be processing different polygons
with different input plane parameters, so simply taking a component()
of the result of interp_reg() will no longer work.  Instead of
duplicating the multipolygon handling logic in every caller of
interp_reg(), fold the component() call into interp_reg() so we can
replace it with multipolygon-correct code more easily.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
742a575bd6 intel/fs: Consider ATTR registers with different fs_reg::nr as belonging to disjoint register spaces.
Instead of treating fs_reg::nr as an offset for ATTR registers simply
consider different indices as denoting disjoint spaces that can never
be accessed simultaneously by a single region.  From now on geometry
stages will just use ATTR #0 for everything and select specific
attributes via offset() with the native dispatch width of the program,
which should work on current platforms as well as on Xe2+.  See
"intel/fs: Map all GS input attributes to ATTR register number 0." for
the rationale.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
2d26ed6688 intel/fs: Assert fs_reg::nr is always zero for ATTR registers in geometry stages.
Instead of treating fs_reg::nr as an offset for ATTR registers simply
consider different indices as denoting disjoint spaces that can never
be accessed simultaneously by a single region.  From now on geometry
stages will just use ATTR #0 for everything and select specific
attributes via offset() with the native dispatch width of the program,
which should work on current platforms as well as on Xe2+.  See
"intel/fs: Map all GS input attributes to ATTR register number 0." for
the rationale.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
b26cf8b189 intel/fs: Map all TES input attributes to ATTR register number 0.
Instead of treating fs_reg::nr as an offset for ATTR registers simply
consider different indices as denoting disjoint spaces that can never
be accessed simultaneously by a single region.  From now on geometry
stages will just use ATTR #0 for everything and select specific
attributes via offset() with the native dispatch width of the program,
which should work on current platforms as well as on Xe2+.  See
"intel/fs: Map all GS input attributes to ATTR register number 0." for
the rationale.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
ef12565a37 intel/fs: Map all VS input attributes to ATTR register number 0.
Instead of treating fs_reg::nr as an offset for ATTR registers simply
consider different indices as denoting disjoint spaces that can never
be accessed simultaneously by a single region.  From now on geometry
stages will just use ATTR #0 for everything and select specific
attributes via offset() with the native dispatch width of the program,
which should work on current platforms as well as on Xe2+.  See
"intel/fs: Map all GS input attributes to ATTR register number 0." for
the rationale.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
1d22721b5a intel/fs: Map all GS input attributes to ATTR register number 0.
The fs_reg::nr field currently has a somewhat inconsistent meaning for
ATTR registers depending on the shader stage.  In geometry stages it
has a similar effect as fs_reg::offset except it's expressed in 32B
units instead of B units.  In the PS however it's expressed in units
of logical scalar attributes (16B on present platforms), which isn't
currently handled correctly throughout the back-end since some places
assume 32B units in all cases.

The different format of the PS setup data in multi-polygon dispatch
modes would make its behavior even more irregular, which would be
worsened further (for both geometry and pixel stages) by the register
size changes coming up on Xe2, particularly in brw_ir_fs.h helpers
where neither the devinfo struct nor the shader stage are available.

Instead of treating it as an offset simply consider different
fs_reg::nr indices as denoting disjoint spaces that can never be
accessed simultaneously by a single region.  From now on geometry
stages will just use ATTR #0 for everything and select specific
attributes via offset() with the native dispatch width of the program,
which should work on current platforms as well as on Xe2+.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
e4aca2ebaa intel/fs: Add separate constructor of fs_visitor for fragment shaders.
To allow specifying the number of polygons that will be processed per
SIMD thread.

Rework:
 * Jordan: Add needs_register_pressure following
   09cdb77a92 ("intel/fs: report max register pressure in shader stats")

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
1eff2fcb62 intel/compiler: Add polygon count statistic to brw_compile_stats.
And use it in ANV in order to return a "SIMDNxM" name from
vkGetPipelineExecutablePropertiesKHR.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
ccf9174655 intel/compiler: Add multipolygon dispatch fields to brw_wm_prog_data.
Add fields that track the number of polygons processed per PS SIMD
thread (note that this might be lower than the value that was
specified to the compiler via brw_compile_fs_params if compilation at
the desired polygon count wasn't possible), and the dispatch width of
the multi-polygon PS kernel.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Francisco Jerez
e7b1993376 intel/compiler: Add max_polygons FS compilation parameter.
Add a brw_compile_fs_params parameter that specifies to the compiler
the maximum number of polygons that may be processed in parallel per
PS SIMD thread.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26585>
2023-12-22 18:05:30 +00:00
Caio Oliveira
6fccacda1e compiler/types: Use a typedef for glsl_type
Most of the code now will see `const glsl_type *` instead of
`const struct glsl_type *`.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26708>
2023-12-22 07:53:25 -08:00
Caio Oliveira
550fdc2026 compiler/types: Remove glsl_type C++ helpers
All code now use the C functions.  Remove glsl_type_impl.h that
contained the inline C++ wrappers around those.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:51:01 -08:00
Caio Oliveira
d06f0305f6 glsl: Use glsl_type C helpers
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:51:01 -08:00
Caio Oliveira
db5f73dc9f compiler/types: Add a few more glsl_type C helpers
These will be used once the C++ ones are removed.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Caio Oliveira
6af93b1801 lima: Use glsl_type C helpers
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Caio Oliveira
7d0d4a494e mesa: Use glsl_type C helpers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Caio Oliveira
582c20c431 nir: Use glsl_type C helpers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Caio Oliveira
cc809d4de9 nouveau: Use glsl_type C helpers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Caio Oliveira
2cbc318193 r600/sfn: Use glsl_type C helpers
In one case, just used glsl_without_array instead of checking if its
an array to decide to use.  Using that helper with a non-array type
just returns the type.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Caio Oliveira
55cde229d5 intel/compiler: Use glsl_type C helpers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26707>
2023-12-22 06:44:23 -08:00
Yonggang Luo
1e6fcd6a61 dzn: Remove #if D3D12_SDK_VERSION blocks now that 611 is required
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26794>
2023-12-22 13:35:35 +00:00
Rob Clark
8023ede00a ci: Remove per-driver wayland-dEQP-EGL xfails
Since these are not driver specific and have been added to
all-skips.txt, remove them from per-driver CI expectations.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26779>
2023-12-22 11:13:23 +00:00
Rob Clark
c2bb95653b ci: Add wayland-dEQP-EGL.functional.render.* skips
These appear to be failing in the same way as the color_clears tests.
Same results on llvmpipe and freedreno (as with the color_clears tests)
so it does not appear to be a driver specific issue.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26779>
2023-12-22 11:13:23 +00:00
Rob Clark
4261621a7e ci: List specific color_clears skips
No need to throw the baby out with the bathwater.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26779>
2023-12-22 11:13:23 +00:00
Rob Clark
dbe5b8b5a4 ci: More context for color_clear skips for Wayland
Add some more notes, so context isn't lost to time when someone gets
around to digging deeper.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26779>
2023-12-22 11:13:23 +00:00
Dmitry Baryshkov
f49624fc97 freedreno/drm: fallback to default BO allocation if heap alloc fails
Allow fd_bo_heap_alloc() to return NULL if the heap is exausted (or
fragmented) instead of segfaulting. Then handle the error properly in
bo_new().

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26787>
2023-12-22 10:48:53 +00:00
Tapani Pälli
9e88c711a3 drirc/anv: disable FCV optimization for Baldur's Gate 3
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26754>
2023-12-22 09:47:19 +00:00
Vinson Lee
f5d08bdf4e etnaviv: Remove duplicate initializers
Fix initializer-overrides warnings.

../src/gallium/drivers/etnaviv/etnaviv_compiler.c:62:29: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
   62 |       .lower_extract_byte = true,
      |                             ^~~~
../src/gallium/drivers/etnaviv/etnaviv_compiler.c:63:29: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
   63 |       .lower_extract_word = true,
      |                             ^~~~

Fixes: 9dc4ee9121 ("etnaviv: lower (un)pack_{2x16,2x32}_split and extract_{byte,word}")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26773>
2023-12-22 06:22:51 +00:00
Matt Turner
184fc71aa1 iris: Only initialize batch decoder if necessary
This avoids a lot of overhead in context creation if some other
`INTEL_DEBUG` flag is set.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10333
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26790>
2023-12-22 04:40:58 +00:00
Rob Clark
68c53ec2c2 freedreno: Add layout metadata support
Add support to use layout metadata to communicate modifier between
exporter and importer.  This is required because EXT_external_objects
does not have modifier support, so when importing a memobj we must use
a back-channel to communicate the modifier with the exporter.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25945>
2023-12-22 04:01:12 +00:00
Rob Clark
32fa9bed12 freedreno/drm: Add BO metadata support
This will be used as a back-channel between vk and gallium to
communicate image layout metadata.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25945>
2023-12-22 04:01:12 +00:00
Rob Clark
b8df7069d3 tu: Add metadata support for dedicated allocations
In the case of a dedicated image allocation, stash the layout metadata
on the backing GEM object, so that when imported the metadata can be
retrieved in order to properly interpret the imported memobj.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25945>
2023-12-22 04:01:12 +00:00
Rob Clark
0105c2e2eb freedreno/layout: Add layout metadata
Add a struct for communicating layout metadata between turnip and
gallium driver.  For now, all that is needed is the modifier, but we
can extend it in the future if needed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25945>
2023-12-22 04:01:12 +00:00
Rob Clark
96aba6e8e3 drm-uapi: Sync drm-uapi
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25945>
2023-12-22 04:01:12 +00:00
Matt Turner
f2c97440f2 intel: Only validate inst compaction if debugging a shader stage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26791>
2023-12-22 03:16:32 +00:00
David Heidelberg
2309451c4f ci/google: re-enable farm
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26792>
2023-12-22 01:36:48 +00:00
Jesse Natalie
555955fc9f dzn: Fix 3D to 2D image copies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26795>
2023-12-22 00:29:22 +00:00
Tapani Pälli
629b15f446 mesa: fix enum support for EXT_clip_cull_distance
Extension was enabled but required enums not.

Fixes: 979bcb9f42 ("glsl: add EXT_clip_cull_distance support based on ARB_cull_distance")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26688>
2023-12-21 21:10:52 +00:00
Eric Engestrom
423f9d1bb0 ci: add nvk to the clang build
Would have prevented
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26772

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26781>
2023-12-21 20:35:53 +00:00
Vignesh Raman
2763655571 ci/freedreno: add FARM variable
Add the `FARM: google` variable to the .google-freedreno-test job,
which is extended by devices managed by the Google farm. Add the
`FARM: collabora` variable to sc7180-trogdor-kingoftown,
sc7180-trogdor-lazor-limozeen and sm8350-hdk device types which
are available in Collabora farm.

This commit also adds DEVICE_TYPE variable for the .a306-test,
.a530-test and .a630-test jobs.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25807>
2023-12-21 19:54:44 +00:00
Vignesh Raman
dc66de3029 ci: bare-metal: cros-servo: Create strutured logs for a630
Use the CustomLogger class and CLI tool to create strutured
logs for cros-servo scripts. Below is an example for a630.

{
  "_timestamp": "2023-10-18T18:14:16.114117",
  "dut_job_type": "sdm845-cheza-r3",
  "farm": "google",
  "dut_jobs": [
    {
      "status": "pass",
      "submitter_start_time": "2023-10-18T18:14:16.255163",
      "dut_start_time": "2023-10-18T18:14:16.328396",
      "dut_submit_time": "2023-10-18T18:14:16.330469",
      "dut_end_time": "2023-10-18T18:33:47.034774",
      "dut_name": "google-freedreno-cheza-18",
      "dut_state": "finished",
      "dut_job_phases": [
        {
          "name": "boot",
          "start_time": "2023-10-18T18:14:16.329576",
          "end_time": "2023-10-18T18:14:24.495826"
        },
        {
          "name": "test",
          "start_time": "2023-10-18T18:14:24.495855",
          "end_time": "2023-10-18T18:33:47.136979"
        }
      ],
      "submitter_end_time": "2023-10-18T18:33:47.207702"
    }
  ],
  "job_combined_status": "pass",
  "dut_attempt_counter": 1
}

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25807>
2023-12-21 19:54:44 +00:00
Marek Olšák
dc69d797ba mesa: enable GL_SELECT and GL_FEEDBACK modes for indirect draws
This enables the correct GL_SELECT/GL_FEEDBACK codepaths for indirect
draws.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26786>
2023-12-21 19:02:28 +00:00
Marek Olšák
1b09fbd9aa mesa: add a pipe_draw_indirect_info* parameter into the DrawGallium callback
We need this to enable GL_SELECT and GL_FEEDBACK modes for indirect draws.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26786>
2023-12-21 19:02:28 +00:00
Marek Olšák
3ad1c3eb7c st/mesa: restore pipe_draw_info::mode at the end of st_hw_select_draw_gallium
This fixes possible incorrect rendering with lowered multi draws because
the first draw would override the prim type and the next draws would use
the overriden (incorrect) prim type.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26786>
2023-12-21 19:02:28 +00:00
Marek Olšák
e40f5a7cb3 mesa: micro-improvements in draw.c
- use ctx->pipe instead of ctx->st->pipe
- call st_prepare_draw outside the loop
- don't call DrawGallium is draw.count == 0

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26786>
2023-12-21 19:02:28 +00:00
Marek Olšák
5a4eddc298 glthread: add a missing end-of-batch marker
Unmarshal calls that "look ahead" in the batch use it. They expect
the next call ID to be equal to a specific GL call. NUM_DISPATCH_CMD
is not equal to any GL call (it's last_call_id + 1).

This was missed in the referenced commit, causing assertion failures.

Fixes: c3b95d1507 - glthread: add a marker at the end of batches indicating the end

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26786>
2023-12-21 19:02:28 +00:00
Karol Herbst
9643671dae rusticl: check rustc version for flags requiring newer rustc/clippy
Fixes: 7e74ee07e3 ("rusticl: silence clippy::arc-with-non-send-sync for now")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26780>
2023-12-21 18:06:26 +00:00
Chia-I Wu
eb5bb5c784 vk/util: ignore unsupported feature structs
vk_physical_device_check_device_features should ignore unsupported
feature structs:

  Any component of the implementation (the loader, any enabled layers,
  and drivers) must skip over, without processing (other than reading
  the sType and pNext members) any extending structures in the chain not
  defined by core versions or extensions supported by that component.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10177
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26767>
2023-12-21 17:22:17 +00:00
Marek Olšák
2816db0182 ci: disable the google/freedreno farm because it's down
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26789>
2023-12-21 17:19:24 +00:00
Jonathan Gray
fbb9ce0140 intel/common: add directory prefix to intel_gem.h include
Otherwise common/intel_gem.h may get included instead of
common/i915/intel_gem.h when building in a different directory.

Fixes: e050a00b9f ("intel/common: Move i915 files to i915 folder")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26784>
2023-12-21 16:37:04 +00:00
Eric Engestrom
91e4428dc4 radv/ci: add flake on raven
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/53017453

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26788>
2023-12-21 13:26:21 +00:00
Friedrich Vock
b2067001d4 radv/rt: bsearch inlined shaders
When there are lots of inlined shaders, going over each one and checking
if the call index matches becomes expensive. Instead, use a
binary-search-like selection to skip most of the checks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26380>
2023-12-21 12:39:06 +00:00
Joshua Ashton
6b1fafe716 nvk: Enable KHR_present_id and KHR_present_wait
This is needed for DXVK and VKD3D-Proton in order to implement
DXGI frame latency and frame latency waitable objects.

Gamescope also requires this to keep in-step with the host.

Using the same enablement system as RADV, etc to be safe.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26752>
2023-12-21 05:38:47 +00:00
Joshua Ashton
edb5229538 nvk: Hook up driconf for nvk_instance
We will use this in the future to enable present_id + present_wait like
in RADV.

This also enables the common WSI driconf entries for image count, etc
overrides to work by default, fixing some games.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26752>
2023-12-21 05:38:47 +00:00
Vinson Lee
2464cd81d3 nvk: Fix tautological-overlap-compare warning
../src/nouveau/vulkan/nvk_nir_lower_descriptors.c:145:55: warning: overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]
  145 |    if (desc_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER &&
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  146 |        desc_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC)
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: f1c909edd5 ("nvk/nir: Add cbuf analysis to nvi_nir_lower_descriptors()")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26772>
2023-12-20 21:16:17 +00:00
Roland Scheidegger
e61fae6eb8 lavapipe: bump image alignment up to 64 bytes
We can't query the actually required alignment from llvmpipe, but 16
bytes is insufficient. In particular, llvmpipe's pixel backend code for
depth/stencil will load/store 4 values at a time, which crashes
with d32s8x24 format if alignment is only 16 bytes (the color backend
does similar things but will use unaligned loads if alignment exceeds
16 bytes at least for now).
32 bytes would be enough, however the "ordinary" llvmpipe resource
layout code currently always aligns to at least 64 bytes, so use
this value as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26724>
2023-12-20 16:36:01 +00:00
Timur Kristóf
4d93aac74d radv: Use correct plane and binding index with SDMA.
This lets us support multi-planar images properly on transfer queues.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Timur Kristóf
ab4720691c radv: Clean up SDMA chunked copy info struct.
Remove redundant fields.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Timur Kristóf
7fe899a3b6 radv: Use SDMA surface structs for determining unaligned buffer copies.
This removes a bunch of redundant calculations, thus making the code
less error-prone.

Also move the row pitch calculation to a separate function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Timur Kristóf
dab4863396 radv: Pass radv_sdma_surf from copy functions to SDMA.
This makes it possible to gather the surface information
only once and pass it to the various SDMA functions, therefore
the code can be less error-prone.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Timur Kristóf
85fa749c63 radv: Refactor and simplify SDMA surface info functions.
This makes it possible to call the function just once instead
of calling different functions repeatedly.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Timur Kristóf
a21cba6799 radv: Unify SDMA surface struct for linear and tiled images.
Using just one struct for both types of images (and buffers)
will simplify a lot of code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Timur Kristóf
65dfdd3fff radv: Move SDMA function and struct declarations to a new header.
Very few parts of RADV actually need the SDMA functions, so
moving them to a separate header makes the driver cleaner and
also improves compilation time when SDMA functions change.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26353>
2023-12-20 13:22:26 +00:00
Samuel Pitoiset
2ce0ea8e7c radv/ci: update CI lists for NAVI10,NAVI31 and RENOIR
These dynamic rendering failures/flakes are a known issue that will
be resolved soon as part of VKCTS. Until that, make sure CI is green.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26734>
2023-12-20 13:06:41 +00:00
Lang Yu
27c46dd207 radeonsi: emit SQ_NON_EVENT for GFX11_5
Signed-off-by: Lang Yu <lang.yu@amd.com>
Acked-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:28 +00:00
Pierre-Eric Pelloux-Prayer
981fbafa18 radeonsi: fix extra_md handling with fmask
Setting metadata on textures with fmask isn't allowed.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:28 +00:00
Pierre-Eric Pelloux-Prayer
5371fca829 radeonsi/sqtt: handle COMPUTE queues as well
Use cs_get_ip_type to support both type of queues instead
of restricting ourselves to GFX.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
2efd1baa64 radeonsi/sqtt: fix capturing RGP on RDNA3 with more than one Shader Engine
Based on radv 2cc981a0cd.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
e0507ec50b radeonsi/sqtt: fix emitting SQTT userdata when CAM is needed
Based on radv 6caae898dd.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
a2cfd4186f radeonsi/winsys: add cs_get_ip_type function
Will be used in the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
c1f08608b8 radeonsi/sqtt: fix capturing indirect dispatches with SQTT
Ported from radv 083e7d3a92.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
5139441c96 radeonsi/sqtt: reformat with clang-format
To fix the 2-space indentation used in this file.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
af8e6c9347 radeonsi/sqtt: use calloc instead of malloc
This makes sure the record is fully initialized and
fixes RGP crashes or missing shaders.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
b55a2065e0 radeonsi/sqtt: rework pm4.reg_va_low_idx
The initial logic was to remember the place were SPI_SHADER_PGM_LO_*
are written, then assume that we can get the register offset because
the sequence would always be:

   PKT3_SET_SH_REG
   SPI_SHADER_PGM_LO_* register offset
   VA low 32 bits value <- reg_va_low_idx

The problem is that this sequence isn't guaranteed, for instance we
can get this instead:

   0   c0067600 |
   1   00000046 |
   2   003ffffd | SPI_SHADER_PGM_RSRC3_VS
   3   00000020 | SPI_SHADER_LATE_ALLOC_VS
   4 * 00002080 | SPI_SHADER_PGM_LO_VS
   5   00000080 | SPI_SHADER_PGM_HI_VS

So the assert in si_state_draw.cpp would fail as well as the VA
update logic.

So instead remember which the SPI_SHADER_PGM_LO_* offset, and the low
32 bits of the VA in si_update_shaders.

Fixes: 8034a71430 ("radeonsi/sqtt: re-export shaders in a single bo")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
e4d537fb84 radeonsi/sqtt: clear record_counts variable
This avoids hitting the asserts in ac_sqtt_finish.

Fixes: 94ce6540d8 ("ac/sqtt: add helpers for initializing ac_thread_trace_data")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Pierre-Eric Pelloux-Prayer
77098ec467 radeonsi/sqtt: fix RGP pm4 state emit function
It was missing in c3129b2b83.

Fixes: c3129b2b83 ("radeonsi: add a simple version of si_pm4_emit_state for non-shader states")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
2023-12-20 12:23:27 +00:00
Karol Herbst
63e08bd61d rusticl/nir: add missing nir include
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26764>
2023-12-20 11:31:31 +00:00
Karol Herbst
c4d8f257ce rusticl: fix constant and printf buffer size
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26764>
2023-12-20 11:31:31 +00:00
Karol Herbst
7e74ee07e3 rusticl: silence clippy::arc-with-non-send-sync for now
Allows compilation with newer clippy

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26764>
2023-12-20 11:31:30 +00:00
Karol Herbst
382718e0e1 rusticl: do not warn on empty RUSTICL_DEBUG or RUSTICL_FEATURES
Fixes: b90d1cfbfe ("rusticl/platform: add RUSTICL_FEATURES boilerplate")
Fixes: ca1e9917a9 ("rusticl/program: allow dumping compilation logs through RUSTICL_DEBUG")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26764>
2023-12-20 11:31:30 +00:00
Karol Herbst
f8afd41667 clc: add workaround for clang always defining __IMAGE_SUPPORT_ and __opencl_c_int64
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26764>
2023-12-20 11:31:30 +00:00
Bas Nieuwenhuizen
07ad6fd34a radv: Use correct writemask for cooperative matrix ordering.
Not expecting this to actually fix anything externally visible,
but reduces some invalid usage when the resulting vector is
not 16 elements long (e.g. the C/result matrix).

Fixes: 9df4703fbb ("radv: Add cooperative matrix lowering.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26768>
2023-12-20 11:02:30 +00:00
David Heidelberg
16af090908 ci/lava: separate HW definitions from SW
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26722>
2023-12-20 10:15:44 +00:00
Bas Nieuwenhuizen
d04ee07712 radeonsi: Add support to clear LDS at the end of a shader.
No hash updates as I didn't find a facility to do it in radeonsi
(even though there are flags like forcing fma32).

Note that we do this very late to avoid any optimizations that
might remove the dead stores. (Checked that LLVM doesn't remove
them, but it is admittedly potentially brittle)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26679>
2023-12-20 09:15:45 +00:00
Bas Nieuwenhuizen
eaf61adea5 radv: Add option to clear LDS at the end of a shader.
Only shaders which explicitly allow shared memory are included for
now. The pass is very late to avoid optimizations removing the stores
and to ensure the clear gets added after MS outputs get loaded from LDS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26679>
2023-12-20 09:15:45 +00:00
Bas Nieuwenhuizen
da6a5e1f63 nir: Add pass for clearing memory at the end of a shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26679>
2023-12-20 09:15:45 +00:00
Bas Nieuwenhuizen
bc99b73d70 nir: Add nir_static_workgroup_size helper.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26679>
2023-12-20 09:15:45 +00:00
Qiang Yu
21d569b081 radeonsi: unify elf and raw shader binary upload
RAW shader did not have dma shader upload, this commit share
the pre/post upload code with ELF, so RAW and ELF can have same
upload mechanism.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26750>
2023-12-20 06:51:07 +00:00
Faith Ekstrand
f11b4d1ebe nvk: Advertise shaderFloat64
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9661
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
4a4815b855 nak/nir: Lower a bunch of fp64
All we have are add, mul, ffma, and comparisons.  Everything else has to
be lowered.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
3e042173e4 nir/lower_doubles: Add lowering for fmin/fmax/fsat
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
e1fecd83ed nak/sm50: Add DMnMx and use it for fp64 fmin/fmax
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
1a7e83c87f nak/sm50: Properly legalize OpSel and drop an assert
While we're here, update sm70 to be a bit more modern.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
7f5c6642d8 nak/sm50: Fix encoding of iadd with imm32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Daniel Almeida
0ac6a81ab5 nak: sm50: fix ineg legalization
There is nothing to be done, as we lower this op unconditionally.

We need to add an arm in the match to not panic, though.

Fixes a panic in
dEQP-VK.binding_model.shader_access.primary_cmd_buf.sampler_immutable.vertex_fragment.multiple_contiguous_descriptors.2d

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
73a1acef18 nak/sm50: Fix encoding of f20 immediates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
17d2b2f2cc nak/sm50: Add encoding and legalization for dadd/dfma/dmul/dsetp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
1f5623c557 nak: Implement 64-bit nir_op_fsign
There is NIR lowering for this but this implementation is more
efficient.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:25 +00:00
Faith Ekstrand
d03cbac05a nak: Fix encoding of dsetp with RZ on SM70+
The `as_reg().is_some()` check returns false when src[1].src_ref is
Zero but we want to handle that as a register case.  Replace it with a
match instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26587>
2023-12-20 02:40:24 +00:00
Timothy Arceri
52dbf44d2e glsl: add support for inout params to glsl_to_nir()
Supporting these means we don't have to depend on calling the GLSL
IR optimisation loop for shaders that contain these parameter types.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26755>
2023-12-20 01:47:27 +00:00
Timothy Arceri
3d3ba9f428 glsl: move glsl ir lowering out of glsl_to_nir()
The main motivation for doing this is that some tests and even the
st tracker linking code dump out the GLSL IR for debugging before
glsl_to_nir() is called expecting it to already be in its final
form. Moving these to the linker makes those assumptions true.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26755>
2023-12-20 01:47:27 +00:00
Timothy Arceri
bb1873faad glsl: add additional lower mediump test
There were tests for inputs and inout, but no test for out which turned
out to not be behaving correctly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26755>
2023-12-20 01:47:27 +00:00
Timothy Arceri
d42f9d94af glsl: copy precision val of function output params
We need to copy the precision to our temp values when converting
to nir or this information will be lost. This change fixes the new
test introduced in the following patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26755>
2023-12-20 01:47:27 +00:00
Sil Vilerino
e3c26889ac d3d12: Report support for PIPE_VIDEO_CAP_ENC_ROI for Delta QP
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26766>
2023-12-20 00:28:15 +00:00
Sil Vilerino
917044db98 d3d12: Implement Delta QP ROI In h264, hevc and av1 video encode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26766>
2023-12-20 00:28:15 +00:00
Timothy Arceri
37e83a93d7 glsl: remove some unused linker code
These were missed when removing code in 72ad0db505.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26747>
2023-12-19 23:45:30 +00:00
Timothy Arceri
4584acca6b glsl: tidy up validation loop in linker
There is no need to have a separate loop to determine the first stage in
the shader program. Previously there were other users of this but since
this is the last remain user this patch changes the code to simply detect
the first stage directly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26747>
2023-12-19 23:45:30 +00:00
Yonggang Luo
670a799ebf meson: Support for both packaging and distutils
distutils was deprecated and is now gone on modern systems.
so the default behavior is to use the supported thing, which is packaging.version, and when on an old system, fallback to the old distutils.version.

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

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/26746>
2023-12-19 21:36:58 +00:00
Dave Airlie
b4cde1b2a6 vulkan/video: drop encode beta checks and rename EXT->KHR
The latest headers move encode support out of beta, so clean up the tree.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26763>
2023-12-19 20:48:59 +00:00
Christian Gmeiner
4fdb381d02 mesa: Drop not used program_written_to_cache
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26740>
2023-12-19 19:25:14 +00:00
David Heidelberg
ba0d39fb69 ci: skip EGL functional color_clears tests for Wayland
A majority of the tests introduced in CTS 1.3.7.0 are experiencing failures and flakes.
Disable these tests until someone with a more deeper understanding of EGL examines them.

Acked-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26760>
2023-12-19 18:18:31 +01:00
Samuel Pitoiset
7afd7299bf vulkan: drop VK_ENABLE_BETA_EXTENSIONS for video encode layouts
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26756>
2023-12-19 14:44:07 +00:00
Mike Blumenkrantz
49759101a1 vk/cmd_queue: exempt more descriptor functions from autogeneration
void* sizeof

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26756>
2023-12-19 14:44:07 +00:00
Samuel Pitoiset
cfa944635c vulkan: bump headers/registry to 1.3.274
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26756>
2023-12-19 14:44:07 +00:00
Jianxun Zhang
1b8a07095d intel/isl: Add Gfx 12.x RC_CCS_CC into modifier scores
Add RC_CCS_CC drm modifiers of TGL, DG2 and MTL into
the list with a higher score than RC_CCS modifiers.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
ed45f95b51 intel/vulkan: Add COMPRESSED_CLEAR state in layout translation
The added state is for RC_CCS_CC modifiers that support fast
clear.

Fix:
vkcube: ../src/intel/vulkan/anv_image.c:2686: anv_layout_to_aux_state:
Assertion `!"" "unexpected isl_aux_state"' failed.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
24b4f9c3ba intel/vulkan: Update comment of a workaround of modifiers
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
12f0715787 intel/vulkan: Correct a comment about an offset in fast clear
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
9c5a28d919 intel/vulkan: Use the last 2 dwords of clear color struct
Refer to the comments added in the code, we now take the
last 2 dwords in the clear color struct to store the fast
clear type and the first compression state.

Suggested by Nanley Chery <nanley.g.chery@intel.com>

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
82f47acb16 intel/vulkan: Remove private binding on fast clear region
To support modifiers with fast clear color, the region
should be able to export along with main surface, so we
remove the private binding in such case.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
91a10251b9 intel/vulkan: Import aux state tracking buffer
Pass down the offset of aux state tracking buffer
of an imported image from the layout provided from
the application.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
1d5326b30e intel/vulkan: Specify offset when creating aux state tracker
Allow aux state tracking buffer created with different offsets,
in order to support importing images with drm modifiers. We
will always need to calculate the size of an imported fast
clear region because Vulkan spec defines:
VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-size-02267
For each element of pPlaneLayouts, size must be 0

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
a26d62df6b intel/vulkan: Allow modifiers supporting fast clear
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
ab6f1b1d57 intel/vulkan: Report clear color in subresource layout
To support drm modifiers with fast clear features, this
change reports the layout of the region back to application.
Because it tracks all levels and layers in that plane, the
whole region is reported back regardless the level and
layer are being queried.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
f280b6e8d5 intel: Move mod_plane_is_clear_color() into isl
We are going to reuse this helper in anv driver and
also rename it.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Jianxun Zhang
3b885926e9 intel/isl: Add a debug option to override modifer list
Developers can limit supported modifers to a single
modifier provided in INTEL_MODIFIER_OVERRIDE environment
variable for debug purposes. For example, setting it
makes Vulkan CTS only run modifier tests against the
specified modifier instead of all modifiers in production
code.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>
2023-12-19 13:57:16 +00:00
Sviatoslav Peleshko
8f8cde4c60 intel/fs: Don't optimize DW*1 MUL if it stores value to the accumulator
Fixes: a8b86459 ("i965/fs: Optimize a * 1.0 -> a.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9570
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25710>
2023-12-19 13:32:23 +00:00
Sviatoslav Peleshko
a6459e0f7b nir/loop_analyze: Don't test non-positive iterations count
Testing negative iterations count makes no sense, and can cause issues
when the unsigned type is used.
Testing 0 iterations is already covered with
will_break_on_first_iteration, so it can be skipped too.

Fixes: 6772a17a ("nir: Add a loop analysis pass")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9913
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26173>
2023-12-19 12:53:52 +00:00
David Heidelberg
dd144962c2 ci/broadcom: separate HW definition from SW
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26720>
2023-12-19 12:34:09 +00:00
Juan A. Suarez Romero
ef4f33b661 ci/v3d/vc4: remove explicit modules to load
These are now loaded through the initramfs image.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26720>
2023-12-19 12:34:09 +00:00
José Expósito
d913927fe9 egl/glx: fallback to software when Zink is forced and fails
When `MESA_LOADER_DRIVER_OVERRIDE` is set to `zink` and the display
initialization fails, fallback to software rendering.

The error was reported in #10123 and it can be reproduced with:

    $ MESA_LOADER_DRIVER_OVERRIDE=zink eglinfo

`eglinfo` would crash in `dri2_display_release()` because of
`assert(dri2_dpy->ref_count > 0)`.

After bisecting the error to commit 8cd44b8843 ("egl/glx: add
autoloading for zink"), I found out that, before this change, the
display was set to initialized even when `_eglDriver.Initialize(disp)`
failed:

    disp->Options.Zink = env && !strcmp(env, "zink");
    // disp->Options.Zink is true

    if (!_eglDriver.Initialize(disp)) {
       [...]
       // Zink initialization has failed at this point
       // However, success is set to true:
       bool success = disp->Options.Zink;
       if (!disp->Options.Zink && !getenv("GALLIUM_DRIVER")) {
          [...]
       }
       // Software initialization is ignored because success is true
       if (!success) {
          [...]
       }
    }

    // The display is set as initialized even though it shouldn't
    disp->Initialized = EGL_TRUE;

Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10123
Fixes: 8cd44b8843 ("egl/glx: add autoloading for zink")
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26184>
2023-12-19 11:59:49 +00:00
Kenneth Graunke
49b8ccbcdc intel/fs: Drop opt_register_renaming()
In the past, multiple writes to a single register were pretty common,
but since we've transitioned to NIR, and leave the IR in SSA form for
everything not captured in a phi-web, the pattern of generating new
temporary registers at each step is a lot more common.

This pass isn't nearly as useful now.  Across fossil-db on Alchemist,
this affects only 0.55% of shaders, which fall into two cases:

- Coarse pixel shading pixel-X/Y setup.  There are a few cases where
  we write a partial calculation into a register, then have a second
  instruction read that as a source and overwrite it as a destination.
  While we could use a temporary here, it doesn't actually help with
  register pressure at all, since there's the same amount of values
  live at both instructions regardless.  So while this pass kicks in,
  it doesn't do anything useful.

- Geometry shader control data bits (5 shaders total).  We track masks
  for handling EndPrimitive in a single register across the program,
  and apparently in some cases can split the live range.  However, it's
  a single register...only in geometry shaders...which use EndPrimitive.
  None of them appear to be in danger of spilling, either.  So this tiny
  benefit doesn't seem to justify the cost of running the pass.

So, just throw it out.  It's not worth keeping.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26343>
2023-12-19 11:07:18 +00:00
Kenneth Graunke
866205d4d7 intel/fs: Allow omitting the destination of A64 untyped atomics
This works exactly the same as the other atomics and the missing
destination is already handled in lower_logical_sends().

Only affects 2 shaders in fossil-db (in Cyberpunk 2077), but the
cycle count drops by 4.23%.  Nice to have in place at any rate.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26343>
2023-12-19 11:07:18 +00:00
Vignesh Raman
2487e18d4e ci: bare-metal: poe: Create strutured logs
Use the CustomLogger class and CLI tool to create strutured logs
for poe scripts which are used by broadcom and nouveau jobs.
Renamed stage lint to code-validation and added python-test job
which runs the tests for structured and customer logger to ci.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25179>
2023-12-19 10:09:35 +00:00
Vignesh Raman
2a530cb188 ci: copy logging script to install
Copy structured_logger.py and custom_logger.py to install,
so that the ci jobs can use these scripts for logging.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25179>
2023-12-19 10:09:35 +00:00
Vignesh Raman
aa0c4078de ci: Add CustomLogger class and CLI tool
This commit introduces the CustomLogger class, which provides methods
for updating, creating, and managing dut jobs and phases in a structured
log in below json format.
{
  "_timestamp": "2023-10-05T06:16:42.603921",
  "dut_job_type": "rpi3",
  "farm": "igalia",
  "dut_jobs": [
    {
      "status": "pass",
      "submitter_start_time": "2023-10-05T06:16:42.745862",
      "dut_start_time": "2023-10-05T06:16:42.819964",
      "dut_submit_time": "2023-10-05T06:16:45.866096",
      "dut_end_time": "2023-10-05T06:24:13.533394",
      "dut_name": "igalia-ci01-rpi3-1gb",
      "dut_state": "finished",
      "dut_job_phases": [
        {
          "name": "boot",
          "start_time": "2023-10-05T06:16:45.865863",
          "end_time": "2023-10-05T06:17:14.801002"
        },
        {
          "name": "test",
          "start_time": "2023-10-05T06:17:14.801009",
          "end_time": "2023-10-05T06:24:13.610296"
        }
      ],
      "submitter_end_time": "2023-10-05T06:24:13.680729"
    }
  ],
  "job_combined_status": "pass",
  "dut_attempt_counter": 1
}

This class uses the existing StructuredLogger module,
which provides a robust and flexible logging utility supporting multiple
formats. It also includes a command-line tool for updating, creating,
and modifying dut jobs and phases through command-line arguments.
This can be used in ci job scripts to update information in structured logs.
Unit tests also have been added for the new class.

Currently, only LAVA jobs create structured log files, and this will be
extended for other jobs using this tool.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25179>
2023-12-19 10:09:35 +00:00
Samuel Pitoiset
b5153693cc radv: move image view related code to radv_image_view.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:35 +00:00
Samuel Pitoiset
1db86d93f2 radv: move buffer view related code to radv_buffer_view.c
More code isolation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:35 +00:00
Samuel Pitoiset
02282fe482 radv: move SI_GS_PER_ES to radv_constants.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:35 +00:00
Samuel Pitoiset
d057cfc8f6 radv: move more shader related declarations to radv_shader.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:35 +00:00
Samuel Pitoiset
0481723cf0 radv: move radv_depth_clamp_mode to radv_cmd_buffer.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:35 +00:00
Samuel Pitoiset
c0d7ef1e58 radv: move more descriptor related declarations to radv_descriptor_set.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:34 +00:00
Samuel Pitoiset
a080390c3c radv: move radv_image_is_renderable() to radv_image.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:34 +00:00
Samuel Pitoiset
8a5106f91a radv: move RADV_HASH_SHADER_xxx flags to radv_pipeline.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:34 +00:00
Samuel Pitoiset
9d15390635 radv: move meta declarations to radv_meta.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:34 +00:00
Samuel Pitoiset
939936a328 radv: remove radv_get_tess_output_topology() declaration
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26713>
2023-12-19 09:48:34 +00:00
Jesse Natalie
51bf1b26d0 libgl-gdi: Update wgl test to set debug flags needed for tests
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26744>
2023-12-18 23:49:28 +00:00
Jesse Natalie
8c88cc8630 libgl-gdi: Update wgl test to use a 32bit framebuffer
Otherwise, the d3d12 driver doesn't use a DXGI swapchain

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26744>
2023-12-18 23:49:28 +00:00
Jesse Natalie
325fb6e26b d3d12: Only destroy the winsys during screen destruction, not reset
Fixes: 81c8e89f ("d3d12: Fix screen->winsys leak in d3d12_screen")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26744>
2023-12-18 23:49:28 +00:00
Jesse Natalie
ff9868c569 d3d12: Add a debug flag to opt out of singleton behavior
For testing, it can be useful to observe behaviors on the singleton
device by just having the test also just use D3D12CreateDevice

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26744>
2023-12-18 23:49:28 +00:00
Jesse Natalie
bed69133cd util: Re-implement getenv for Windows
On Windows, the C runtime maintains an environment variable cache for
getenv. But apps and drivers are free to statically link the C runtime,
so you might get different environment variable caches between components.
Specifically, a test trying to putenv to update the environment won't have
its update reflected by the driver if the CRT is statically linked, unless
we go to the Win32 API directly.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26744>
2023-12-18 23:49:28 +00:00
Yonggang Luo
a0b7ae859f osmesa: Fixes building osmesa.c on windows
Fixes: 5bf68ab701 ("osmesa: Make osmesa.h compatible with Windows SDK's GL.h")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Ack-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26674>
2023-12-18 23:35:17 +00:00
Erico Nunes
601b826a5e ci: lima farm is down
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26748>
2023-12-18 23:32:07 +00:00
Ruijing Dong
8bcf33cdc1 radeonsi/vcn: ROI capability value initialization.
It needs to initialize the cap value to
avoid causing confusion.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26741>
2023-12-18 23:07:25 +00:00
David Heidelberg
148230db05 ci/freedreno: downgrade whole Adreno 6xx series, incl. zink-a618 jobs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26745>
2023-12-18 21:32:48 +01:00
Konstantin Seurer
662f86c533 radv/bvh: Stop emitting leaf nodes inside the encoder
Avoids unnecessary copies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26725>
2023-12-18 19:17:21 +00:00
Konstantin Seurer
8fca54a754 radv: Add more offsets acceleration_structure_layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26725>
2023-12-18 19:17:21 +00:00
Faith Ekstrand
a2a0cef9f4 meson: Update our rust dependencies
These are the package versions currently shipped by Fedora. This allows
using system packages by setting

    export MESON_PACKAGE_CACHE_DIR=/usr/share/cargo/registry/

Of course, other distros may place it somewhere else.

Ubuntu matches versions on syn and unicode-ident but is a tiny bit off
on quote and proc-macro2. However, given how far I was able to bump the
versions with only a tiny meson tweak to syn, I think it should work
with the Ubuntu versions as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26726>
2023-12-18 18:33:53 +00:00
Michel Dänzer
f0594915e6 glx: Handle IGNORE_GLX_SWAP_METHOD_OML regardless of GLX_USE_APPLEGL
Avoids tons of

 WARNING: unknown fbconfig attribute from server: tag 0x8060 value 0x8063

messages with LIBGL_DEBUG=verbose.

Fixes: e64ab3e4a9 ("glx: Delete support for GLX_OML_swap_method.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26685>
2023-12-18 17:52:09 +00:00
Michel Dänzer
9548f969bd gallium/dri: Return __DRI_ATTRIB_SWAP_UNDEFINED for _SWAP_METHOD
In contrast to __DRI_ATTRIB_SWAP_EXCHANGE, this is compatible with Mesa
< 23.3 on the client side.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10080
Fixes: e64ab3e4a9 ("glx: Delete support for GLX_OML_swap_method.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26685>
2023-12-18 17:52:09 +00:00
Faith Ekstrand
290d958c63 nak/nir: Set nir_lower_io_lower_64bit_to_32 for varyings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:29 +00:00
Faith Ekstrand
a9fb7b0280 nak: Implement b2f64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:29 +00:00
Faith Ekstrand
26d649f120 nak: Fix nir_op_f2f64
We were only allocating one register

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:29 +00:00
Faith Ekstrand
7ced1d3648 nak: Wire up 64-bit nir_op_fadd/ffma/fmul and comparisons
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
995eea8d04 nak: Split fmul/ffma handling from fmulz/ffmaz
They're enough of a special case that things are going to get confusing
when we start adding bit sizes to fmul/ffma.  Let's make them a special
case so they can assert all their things.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
1236c5d4f1 nak: Add the rest of the double-precision ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
2f899f44eb nak: Rework encoding of ALU instructions on SM70+
The main change here is that we match on src2 first and then src1.  This
lets make some of the src2 code common because src2 never moves around
if it's a register.  This change also has another subtle effect: None
sources now work everywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
c53f562d1a nak: OpDAdd doesn't have saturate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
ada338bfcc nak/sm70: Allow src2 of 3src ops to be an immediate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
8b2232906e nak: Pass SrcTypes around instead of RegFile in legalize
We need to be able to tell the difference between `F64` and other GPR
source types.  In order for this to work, we also have to tighten up
some of the requirements round GPR and SSA sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
d24eb539c5 nak: Make OpAtom::cmpr a GPR source
We set it to Zero for atomics other than CmpExch.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
3b6e6e985e nak: Copy propagate and constant fold OpPrmt
This comes up fairly frequently in int64 and fp64 use-cases.  In
particular, we see a lot of `prmt rZ 0x4444 rZ` which is just zero.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
9ad5b544d8 nak: Fix copy-prop for fp64
For propagating OpDAdd, we need to check for negative zero because
negative zero is the no-op, not add with zero.  We were also propagating
the upper and lower halves of fp64 sources wrong.  While we're here, use
`let ... else` instead of an `if let` pattern a couple places.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Faith Ekstrand
d41b0a2bf5 nak: Move the copy detection part of opt_copy_prop to a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
2023-12-18 17:35:28 +00:00
Connor Abbott
0b2e48f432 freedreno/afuc: Fix gen autodetection for a7xx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
ae9604c29e freedreno/afuc: README updates for a7xx
Mention the introduction of LPAC/BR/BV, and explain the shared control
reg space.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
5ca347e727 freedreno: Update more control/pipe registers for a7xx
Copy over control registers that are mostly the same from a6xx and add a
definition of the EVENT_CMD pipe register, which is updated for a7xx
events.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
d01be55340 freedreno/afuc: Decode (sdsN) modifier
This removes the last unknown flag from read/write instructions.

Because we now handle the write in CP_SET_DRAW_STATE more correctly when
emulating, we also have to update the control register definitions and
draw state emulation code to adjust.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
55985b7301 freedreno/afuc: Add syntax for pre-increment addressing
This is inspired by the ARM syntax.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
579227e028 freedreno/afuc: Use SQE registers for call stack
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
da3cf26564 freedreno/afuc: Add separate "SQE registers"
It seems like starting with a6xx, the SQE has a special register space
for reading/writing the state of the processor itself, mainly used for
saving/restoring its state in preemption. Add support for disassembling
it, removing one of the unknown flags bits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Connor Abbott
7c919f0406 freedreno/afuc: Handle store instruction on a5xx
Turns out a5xx already had store, although not load. It was using the
high bit of the unknown flags for this.

Note that a6xx does use the high bit, and we fall back to not decoding
it at all here before properly decoding it in the next commit. Splitting
up the commits seems worth this small breakage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26691>
2023-12-18 17:01:35 +00:00
Dudemanguy
cef345129f vulkan/wsi/wayland: fix wl_event_queue memory leak
When creating the swapchain, this queue is created, but it was never
freed in wsi_wl_swapchain_free along with the rest of the resources.

Signed-off-by: Dudemanguy <random342@airmail.cc>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26052>
2023-12-18 16:28:53 +00:00
Jordan Justen
30faa7a483 anv, iris, intel/genxml: Update 3DSTATE_HS for xe2
Update 3DSTATE_HS programming for xe2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:31 +00:00
Jordan Justen
8ba9988858 anv, iris, intel/genxml: Update 3DSTATE_GS for xe2
Update 3DSTATE_GS programming for xe2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:31 +00:00
Jordan Justen
1bc7c966f4 intel/batch_decoder: Update 3DSTATE_PS decoding for xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:31 +00:00
Jordan Justen
a659b1f0c0 anv, blorp, iris, intel/genxml: Update 3DSTATE_PS_EXTRA for xe2
Update 3DSTATE_PS_EXTRA programming for xe2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:31 +00:00
Jordan Justen
5548e6a478 anv, blorp, iris, intel/genxml: Update 3DSTATE_VS for xe2
Update 3DSTATE_VS programming for xe2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:31 +00:00
Jordan Justen
f170995e66 anv, blorp, iris: Update 3DSTATE_PS programming for xe2
Rework:
 * Jordan: Move code into intel_update_ps_state()

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Zhang, Jianxun
80d9294d2d intel/isl: update 3DSTATE_STENCIL_BUFFER (xe2)
Update xml file and adjust driver code to compile.

Signed-off-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Zhang, Jianxun
2a49a598ce intel/genxml: update 3DSTATE_DEPTH_BUFFER instruction (xe2)
Signed-off-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Jordan Justen
99eadc2ecb intel/genxml: Add UNIFIED_COMPRESSION_FORMAT enum for xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Zhang, Jianxun
2c41811808 intel/genxml: update 3DSTATE_WM_HZ_OP instruction (xe2)
The depth clear value is provided from 3DSTATE_WM_HZ_OP now.

Signed-off-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Zhang, Jianxun
5d4a995294 intel/genxml: Remove 3DSTATE_CLEAR_PARAMS instruction (xe2)
Signed-off-by: Zhang, Jianxun <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Rohan Garg
9512f61cd8 iris,isl: Adjust driver for several commands of clear color (xe2)
The xe2 xml will be updated in following commits. Commit message
has been updated by Jianxun.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26600>
2023-12-18 15:41:30 +00:00
Job Noorman
2d273c520c ir3: lower 64b registers before creating preamble
ir3_nir_lower_preamble cannot handle 64b @load/store_preamble so we have
to make sure ir3_nir_opt_preamble will never produce them. Up to now,
nir_lower_locals_to_regs was run after preamble lowering so 64b locals
could still be around when lowering the preamble. This patch moves
running this pass, as well as ir3_nir_lower_64b_regs, to before the
preamble lowering.

Fixed Piglit tests:
- spec@arb_gpu_shader_fp64@execution@fs-indirect-temp-double-dst
- spec@arb_gpu_shader_fp64@execution@built-in-functions@fs-frexp-dvec4-variable-index

This patch has no impact on shader-db.

Note: a few cleanup passes used to be run after nir_lower_locals_to_regs
(nir_opt_algebraic, nir_opt_constant_folding) and after
ir3_nir_lower_64b_regs (nir_lower_alu_to_scalar, nir_copy_prop). As far
as I can tell, these are not necessary anymore when running the register
lowering earlier so this patch removes them.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26737>
2023-12-18 14:52:02 +00:00
Job Noorman
6cad2fc230 nir: add helper to create cursor after all @decl_regs
@decl_reg intrinsics must be in the first block so it's convenient to be
able to create an insertion point after all @decl_regs when the first
block needs to be split.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26737>
2023-12-18 14:52:02 +00:00
Tatsuyuki Ishi
533ec9843e radv: Precompute shader max_waves.
Doing it at bind-time causes a 1.4% overhead (among all driver calls) in
Overwatch 2. !24502 mentions that it can be precomputed in case overhead
is a concern, so do it here.

max_waves is stored directly in the radv_shader struct, because
ac_shader_config conforms to LLVM ABI and we cannot add anything custom,
and radv_shader_info needs to be determined from NIR only.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26692>
2023-12-18 14:31:25 +00:00
Tatsuyuki Ishi
1161f22c27 radv: Move up radv_get_max_waves, radv_get_max_scratch_waves.
To avoid forward declaration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26692>
2023-12-18 14:31:25 +00:00
Tatsuyuki Ishi
e444908d65 radv: Simplify shader config assignment.
We don't hash this struct so direct assignment here is OK.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26692>
2023-12-18 14:31:24 +00:00
Samuel Pitoiset
4353b0ad72 radv: move emitting the fb mip tail workaround when rendering begins
It doesn't have to be emitted in the draw path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26589>
2023-12-18 13:06:29 +00:00
Samuel Pitoiset
7dd7e551b1 radv: stop checking FMASK for the fb mip tail workaround
Vulkan doesn't allow mipmaps with MSAA images, so checking for FMASK
shouldn't have any effect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26589>
2023-12-18 13:06:29 +00:00
Samuel Pitoiset
57efe44f43 radv: add missing HTILE support for fb mip tail workaround
PAL also applies to depth/stencil images with HTILE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26589>
2023-12-18 13:06:29 +00:00
Tapani Pälli
82553774e2 iris: use intel_needs_workaround with 14015055625
This was missing from the FS stage primitive-id check. Also add usage
of macro to avoid running any extra code on platforms where this WA
would not apply.

Fixes: 0f14724039 ("iris: Implement Wa_14015297576")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26709>
2023-12-18 11:14:11 +00:00
Martin Roukala (né Peres)
240d11eb8d Revert "ci: disable the valve-kws farm until it can be rebooted"
This reverts commit 299cd1af82 as I
managed to reboot it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26733>
2023-12-18 07:53:42 +00:00
Dave Airlie
f76f4be301 intel/compiler: move gen5 final pass to actually be final pass
This got broken by the register conversion, this pass needs to be
after all the others.

Fixes: ce75c3c3fe ("intel: Switch to intrinsic-based registers")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26731>
2023-12-18 07:24:37 +00:00
Martin Roukala (né Peres)
299cd1af82 ci: disable the valve-kws farm until it can be rebooted
We are having some issues related to serial consoles and I can't seem
to connect to the VPN to reboot the gateway.

So let's disable the farm until I get to it.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26730>
2023-12-18 08:27:54 +02:00
Eric Engestrom
377c6b2d45 ci/build: drop redundant meson/build.sh from jobs that already inherit from .meson-build
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26714>
2023-12-17 17:03:08 +00:00
Yiwei Zhang
ddf2ca4faf vulkan/wsi/wayland: ensure drm modifiers stored in chain are immutable
Chain stored modifiers point to the mapping of the current feedback
shmem of the surface. The surface tracked feedback mapping will be gone
and replaced with new mapping during surface_dmabuf_feedback_done. There
are two issues here:
1. One issue is that the existing mapping is closed before been used to
   compare against new modifiers in sets_of_modifiers_are_the_same.
2. The other issue is that when the chain is still optimal, the chain
   persists while the mapping is still replaced with the one from the
   new format table shmem.

This change makes a deep copy of the modifiers to store in the chain to
ensure the modifiers used for the current chain are immutable through
the chain lifecycle.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26618>
2023-12-16 18:26:38 +00:00
David Heidelberg
33e8f22d84 ci/austriancoder: separate HW definition from SW
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26721>
2023-12-16 16:03:08 +01:00
Christian Gmeiner
64caf90632 etnaviv: disassembler: Switch to isaspec
Use the power of isaspec for our integrated disassembler.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20144>
2023-12-16 14:34:18 +00:00
Christian Gmeiner
fa0ff0849c etnaviv: Add isaspec support
This commit adds etnaviv.xml which describes the used ISA. Quite some
time was spend to to get it into that shape by creating a big collection
of shader asm generated by the binary blob. These shaders are used as basis
for test driven development for this ISA specification.

The xml has some black spots but the internal disasm is used by
developers so that should be no problem. Some refinement will happen
during normal development.

This commit adds only disasm support.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20144>
2023-12-16 14:34:18 +00:00
Christian Gmeiner
a8a33ac5ae isaspec: Add bool_inv type to print inverted bools
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20144>
2023-12-16 14:34:18 +00:00
M Henning
586c34b19c nak: Optimize jumps to fall-through if possible
This saves 15 instructions on the compute shader in Sascha Willems'
computecloth example.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26473>
2023-12-16 06:10:23 +00:00
M Henning
b2420fae4b nak: Add a jump threading pass
This saves 16 instructions on the compute shader in Sascha Willems'
computecloth example.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26473>
2023-12-16 06:10:23 +00:00
M Henning
786bf749bc nak: Print out an instruction count
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26473>
2023-12-16 06:10:23 +00:00
George Ouzounoudis
55c8f5e288 nvk: Support extended dynamic state for tessellation domain origin
The tessellation domain origin, type, prims and spacing are all pushed
together in SET_TESSELLATION_PARAMETERS. So to support domain origin as
dynamic we need to push all these together when the state is dynamically
changed or when a new tessellation shader is bound.
This is also needed for EXT_shader_object.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:51 -06:00
George Ouzounoudis
1319cfb40d nvk: Remove pipeline state setting functions
We do not need these functions for graphics pipelines anymore as all the
required state is now dynamic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:51 -06:00
George Ouzounoudis
453c50bef9 nvk: Support extended dynamic state for rasterization stream
This is needed for EXT_shader_object. Move to dynamic state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:51 -06:00
George Ouzounoudis
d8945dd51e vulkan: Fix dynamic graphics state enum usage
Simply replace the correct rasterization stream enum

Fixes: 9d0ed9cbcc ("vulkan: Add more dynamic rasterizer state")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:51 -06:00
George Ouzounoudis
8b178f9ce4 nvk: Support extended dynamic state for alpha to coverage/one
This is needed for EXT_shader_object. Move to dynamic state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:51 -06:00
Faith Ekstrand
b42fae61bb nvk: Support extendedDynamicState3ColorWriteMask
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:50 -06:00
George Ouzounoudis
c7135e94cb nvk: Support extendedDynamicState3SampleMask
This is needed for EXT_shader_object. Move to dynamic state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:33 -06:00
George Ouzounoudis
88e661db99 nvk: Support extendedDynamicState3ColorBlendEquation
This is needed for EXT_shader_object. Move state to dynamic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:33 -06:00
George Ouzounoudis
e27b4855f7 nvk: Support extendedDynamicState3ColorBlendEnable
This is needed for EXT_shader_object. Move state to dynamic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:28:33 -06:00
Faith Ekstrand
b24cbb0b29 nvk: Use render->color_att_count for color write enables
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 22:26:07 -06:00
George Ouzounoudis
4325efd2cf nvk: Move SET_BLEND_STATE_PER_TARGET to graphics state initialization
We never change this state so it needs to be set only once at state init.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24872>
2023-12-15 18:02:19 -06:00
Faith Ekstrand
5d937f09b2 nvk: Advertise VK_KHR_vulkan_memory_model
Now that the NAK barrier bugs seem fixed and we're passing all the
tests, we can turn this on.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9608
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26716>
2023-12-15 22:38:45 +00:00
Faith Ekstrand
629bef2a4c nak: Handle minimum execution latencies in the dep tracker
Some instructions have a minimum latency before another instruction can
execute.  It's a little unclear exactly what the details on these are.
For things like OpBar it's probably something to do with when stuff
actually convergres.  For MemBar, maybe we only need to wait before we
do something that also touches memory?  Unclear and the few docs seem to
imply that it's a straight-up stall.  For now, we model it as an
execution latency where nothing is allowed to happen until then.

The blob also inserts a NOP with a delay of 2 in these cases.  It's not
entirely clear why but it's probably best we do the same.  Theses
instructions tend to be pretty heavy-weight anyway so 2 cycles isn't
really going to cost much compared to the chances that we're missing
some subtle HW issues somewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26716>
2023-12-15 22:38:45 +00:00
Faith Ekstrand
26c2566606 nak: Plumb shader model into instruction latency queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26716>
2023-12-15 22:38:45 +00:00
Faith Ekstrand
8c1daae469 nak: Switch to //-style comments
Some time ago I dropped the C-style `/* */` for `//` which seems to be
more idiomatic in Rust.  Let's get rid of the rest of the C-style ones
and make the codebase consistent.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26716>
2023-12-15 22:38:45 +00:00
Nanley Chery
45d7764a06 iris: Don't memset the clear color BO during aux init
The clear color BO is sometimes getting unnecessarily zeroed. For
example, if the resource will be fast-cleared, the app may pick a
non-zero color, causing the initial memset to be unneeded.  So, skip the
memset and mark the clear color as unknown if it has not been freshly
allocated. For now, we leave the memsets on imported dmabufs alone for
simplicity.

On non-small BAR ACM systems, this also allows internal resources using
compression to be created without executing an IOCTL for memory mapping.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26675>
2023-12-15 21:58:16 +00:00
Nanley Chery
68d56b15d7 iris: Zero the clear color before FCV_CCS_E rendering
On small-BAR ACM systems, we don't initialize the clear color at
resource creation time. This could cause an issue with FCV_CCS_E.

Because the rendering and sampling fields may not be in agreement, FCV
may generate fast-cleared blocks during rendering and the sampler may
interpret them with the wrong values.

Thankfully, the register bit which enables FCV on ACM is disabled by
default, so there is not an actually issue today. Regardless, this patch
implements the fix for this issue now. The next patch will actually skip
explicit clear color initialization at resource creation time. So, this
fix will be useful for other systems that do have FCV enabled today.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26675>
2023-12-15 21:58:16 +00:00
Nanley Chery
6064de1d53 iris: Optimize BO_ALLOC_ZEROED for suballocations
Fresh suballocations from fresh allocations have already been zeroed by
the kernel. So, make BO_ALLOC_ZEROED a no-op for them.

This introduces a new field, iris_bo::zeroed, which will be reused for
similar optimizations in the future.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26675>
2023-12-15 21:58:16 +00:00
José Roberto de Souza
ba6faeb974 anv: Remove libdrm usage from Xe KMD backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26699>
2023-12-15 20:40:49 +00:00
José Roberto de Souza
dea6c82437 intel: Sync xe_drm.h final part
Sync xe_drm.h with commit a8ff56e160bb ("drm/xe/uapi: Remove reset uevent for now").

This is the last xe_drm.h uAPI break.

The only relevant change for ANV and Iris is that now VM bind uAPI
is asynchronous only so I had to bring back the syncobj creation, wait
and destruction.

Is still in the Xe port TODO list to make VM binds truly asynchronous.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26699>
2023-12-15 20:40:49 +00:00
Sagar Ghuge
2ac78b5096 anv: Enable blitter engine unconditionally on ACM+
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26703>
2023-12-15 20:10:53 +00:00
Eric Engestrom
8043e8c4a6 vulkan/wsi: fix build when platform headers are installed in non-standard locations
Anything that uses the platform defines in `vulkan_wsi_list` will need
to be able to resole the includes they trigger, which are provided by
`vulkan_wsi_deps`.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10304
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26715>
2023-12-15 18:35:54 +00:00
Friedrich Vock
f9a394b753 radv/rt: Initialize unused children in PLOC early-exit
Bad things happen when these aren't initialized.

Fixes GPU hangs when loading Avatar: Frontiers of Pandora savegames.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26712>
2023-12-15 17:52:00 +00:00
Job Noorman
286caa5080 ir3: lower 64b registers
After all int64/double lowerings, there might still be 64b registers
left which ir3 currently doesn't handle. This only happens in a small
number of Piglit tests where those registers (or the variables they come
from) did not get DCE'd.

This patch handles 64b registers in ir3 by adding a NIR pass that does
the following:
 - @decl_reg -> split in two 32b ones
 - @store_reg -> unpack_64_2x32_split_x/y and two separate stores
 - @load_reg -> two separate loads and pack_64_2x32_split

After this pass, the 64b vecs used for the original loads/stores are
still present and are also not handled yet by ir3. This patch removes
them by running nir_lower_alu_to_scalar and nir_copy_prop.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26175>
2023-12-15 17:19:28 +00:00
Job Noorman
6e7a61df4c nir: add _safe variants of nir_foreach_reg_load/store
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26175>
2023-12-15 17:19:28 +00:00
Iago Toral Quiroga
5057eb90a1 v3dv: implement VK_KHR_shader_terminate_invocation
The semantics for this matches those of discard.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26683>
2023-12-15 16:35:50 +00:00
Iago Toral Quiroga
d0f75fdeab broadcom: lower null pointers
We only support the variablePointersStorageBuffer feature of variable pointers,
which basically ensures that pointers may only target one buffer. This means
that a particular pointer may change where it points within a given buffer but
it cannot change its value to point to some other buffer. This is a requirement
from us since we expect buffer indices on buffer loads and stores to be
constant, so we can't have a buffer load come through a pointer that may
be assigned to different buffers, since in that case the buffer index
would need to come from bcsel.

There is, however, a small complication: the spec still allows pointers to
be null, and NIR defines null pointers to use 0xffffffff for both the buffer
index and the offset, which will cause a problem in a scenario like this:

int *b = ...
if (cond) {
   b = null;
   discard;
}
ubo_load(b);

Here the buffer index for the ubo load may come from a bcsel choosing between
the null pointer (0xffffffff) and the valid address (let's say 0), so we don't
have a constant and we assert fail.

This change detects this scenario and upon finding it will rewrite the buffer
index on the null pointer branch of the bcsel to match that of the valid
branch so that later optimizations passes can remove the bcsel and we end up
with a constant index. This is fine because a null pointer dereference is
undefined behavior and it is not something we should see in valid applications.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26683>
2023-12-15 16:35:50 +00:00
Iago Toral Quiroga
716847a77d broadcom: disable perquad tmu loads after discards
Otherwise we may emit a load from an invalid offset from
a lane that was discarded.

This fixes an simulator assert from triggering when
executing:
dEQP-VK.spirv_assembly.instruction.terminate_invocation.terminate.no_null_pointer_load

That test emits a conditional kill and then a buffer load
which would have invalid offsets for the lines killed. Since
the buffer load is in uniform control flow we were incorrectly
emitting a full quad load, including disabled lanes which would
prompt the simulator to assert on invalid offsets being loaded
coming from the lanes that had been killed in the shader.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26683>
2023-12-15 16:35:50 +00:00
Sil Vilerino
2b04fb410f d3d12: Fix warning C4065 switch statement contains default but no case labels
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26710>
2023-12-15 16:17:50 +00:00
Ruijing Dong
8bbdde2d9a radeonsi/vcn: enable ROI feature in vcn.
Enable ROI feature.

Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26659>
2023-12-15 14:06:34 +00:00
Ruijing Dong
9c07a2e10d radeonsi/vcn: ROI feature implementation
Implemented ROI feature in VCN generations.

Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26659>
2023-12-15 14:06:34 +00:00
Ruijing Dong
d6da63071e frontends/va: add ROI feature
ROI (region of interest) feature implementation
in va.

It does not support ROI priority, and supports
qp delta, and the maximum number of supported
region is defined as 32, the region sequence implies
the priority, the lower the sequence number, the higher
the region priority, when region overlapping happened,
the higher priority region overwrites the lower
priority one.

And specifically for AV1, the adjust step will be
rounded by 5 when rate control is used, for example,
if qp_delta (q index) is 6, it will use 5, if
qp_delta is 8, it will use 10.

For AVC/HEVC (RC/CQP) and AV1 CQP mode, the
qp_delta granularity is 1.

Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26659>
2023-12-15 14:06:34 +00:00
Ruijing Dong
434a53ebbe radesonsi/vcn add qp_map definition
This is for enabling ROI (region of interest)
feature in VAAPI interface. It will support
both CQP and rate control mode.

Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26659>
2023-12-15 14:06:34 +00:00
Eric Engestrom
05fb2e21f9 docs: document how to build the docs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26701>
2023-12-15 13:33:45 +00:00
Boris Brezillon
0463a951ad panfrost: Flag BO shareable when appropriate
Let the kmod backend know when we might end up exporting a BO. This
doesn't change anything for the Panfrost kmod backend, but will be
needed for Panthor.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
30d6dfb861 panvk: Pass PAN_BO_SHAREABLE when relevant
Check VkExportMemoryAllocateInfo to know if we might export the BO
object at some point.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
aa6176ee1e panfrost: Introduce a PAN_BO_SHAREABLE flag
This flag reflects the ability to share a BO. This lets the kmod
backend optimize the case where the BO stays private to a specific
VM.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
5089a758df panfrost: Back panfrost_bo with pan_kmod_bo object
We keep the existing implementation unchanged but use pan_kmod for
all interactions with the kernel driver.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:27 +00:00
Boris Brezillon
7a9c471009 panfrost: Add a VM to panfrost_device
The current code assumes the logical device comes with a VM, so let's
explicitly create this default VM so we can map BOs with the kmod API.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
91fe8a0d28 panfrost: Back panfrost_device with pan_kmod_dev object
Back panfrost_device with pan_kmod_dev object and query all props using
the pan_kmod_dev_query_props().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
70bcdbee6c panfrost: Avoid direct accesses to some panfrost_bo fields
We are about to delegate some BO-related operations to the pan_kmod
layer, but before we can do that, we need to hide panfrost_bo
internals so we can redirect such accesses to pan_kmod.

Provide panfrost_bo_{size,handle}() accessors and start using them.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
d47e01a3c3 panfrost: Avoid direct accesses to some panfrost_device fields
We are about to delegate some device-related operations to the pan_kmod
layer, but before we can do that, we need to hide panfrost_device
internals so we can redirect such accesses to pan_kmod.

Provide a few panfrost_device_xxx() accessors and start using them.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
93178999f6 pan/kmod: Add a backend for the panfrost kernel driver
Just a few implementation details that are worth mentioning:

- Panfrost doesn't support explicit VM management. This means
  panfrost_kmod_vm_create() must always be created with
  PAN_KMOD_VM_FLAG_AUTO_VA and panfrost_kmod_vm_bind(op=map) must
  always be passed PAN_KMOD_VM_MAP_AUTO_VA. The actual VA is assigned
  at BO creation time, and returned through
  drm_panfrost_create_bo.offset, or can be queried through
  DRM_IOCTL_PANFROST_GET_BO_OFFSET for imported BOs.

- Evictability is hooked up to DRM_IOCTL_PANFROST_MADVISE.

- BO wait is natively supported through DRM_IOCTL_PANFROST_WAIT_BO.

The rest is just a straightforward translation between the kmod API and
the existing panfrost ioctls.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Boris Brezillon
d95ec56f8c panfrost: Abstract kernel driver operations
We have generic BO management and device management layers that
directly call kernel driver-specific ioctls. The introduction of
Panthor (the new kernel driver supporting CSF hardware) forces us to
abstract some low-level operations. This could be done directly in
pan_{bo,device,props}.{c,h}, but having the abstraction clearly defined
and separated from the rest of the code makes for a cleaner
implementation.

This is also a good way to get a low-level KMD abstraction that
we can use without pulling all sort of gallium-related details in,
which will be important for some refactoring we plan to do in panvk.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26357>
2023-12-15 11:33:26 +00:00
Samuel Pitoiset
768c737273 radv: remove some declared but unused functions/macros
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26682>
2023-12-15 08:40:24 +00:00
Samuel Pitoiset
2f79ed1831 radv: stop asserting some image create info fields
Vulkan Validation Layers already check that and these assertions never
caught anything.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26682>
2023-12-15 08:40:23 +00:00
Colin Marc
a26119e124 vulkan video: correctly set SPS VUI bits
According to the spec section E.1 flags such as overscan_info_present_flag are
independent of aspect_ratio_info_present_flag.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26669>
2023-12-15 07:13:13 +00:00
Tapani Pälli
07f8db02ff iris: cleanup, use intel_needs_workaround instead of is_dg2
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26666>
2023-12-15 06:13:41 +00:00
Tapani Pälli
2f25679b3f anv: cleanup, use intel_needs_workaround instead of is_dg2
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26666>
2023-12-15 06:13:41 +00:00
Tapani Pälli
012b6fbe63 drirc: setup anv_assume_full_subgroups=16 for UnrealEngine5.1
We set max subgroup size as 16 for 'UnrealEngine5.1', this improves a
customer benchmark by 50% on A750.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26385>
2023-12-15 05:28:51 +00:00
Tapani Pälli
7ff8f79a88 anv/hasvk/drirc: change anv_assume_full_subgroups to have subgroup size
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26385>
2023-12-15 05:28:51 +00:00
Faith Ekstrand
1cf1b9d741 nir: Scalarize bounds checked loads and stores
Fixes: 39da1deb49 ("nir/lower_io: Add a bounds-checked 64-bit global address format")
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26526>
2023-12-15 03:53:54 +00:00
Caio Oliveira
81e3b28f78 compiler: Remove C++ static member pointers to builtin types
When we moved the bulk of glsl_type to C, these globals were
kept to avoid changes to compiler/glsl code in the MR.  Now that
landed, change the code to use the actual bultins directly.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26658>
2023-12-15 03:09:19 +00:00
Caio Oliveira
bfc953add7 intel/compiler: Use C helpers to access builtin types
Remove usage of C++ static members as they are going to be removed.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26658>
2023-12-15 03:09:19 +00:00
Caio Oliveira
90e364edb0 compiler/types: Add a few more helpers to get builtin types
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26658>
2023-12-15 03:09:19 +00:00
Faith Ekstrand
22b99f15b9 nvk: Use ENUM_PACKED for enums instead of PACKED
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:59 +00:00
Faith Ekstrand
45f320e97f nvk: Enable cbufs
Just in case this breaks and blows up the universe, we'll add a NO_CBUFS
debug flag as a back-door.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:59 +00:00
Faith Ekstrand
d41fe63d99 nvk: Add debug flags to the physical device
These should probably go on the instance but everything is tangled up
too badly right now.  This at least moves them to some place where we
have them without a nouveau_ws_device.  It's fine to do this because
debug flags are an environment variable and won't change across a run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:59 +00:00
Faith Ekstrand
ee29a8d1cd nvk: Upload cbufs based on the cbuf_map
For draw, this requires that we use a macro to read descriptors out of
the descriptor buffer because we may not have that information easily
available on the CPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
e6cd4b177a nvk: Don't flush descriptors in BeginConditionalRendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
869f5fc680 nvk: Set MME_DATA_FIFO_CONFIG on device init
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
951d96a1a2 nvk: Rework push_indirect to take an address
The only reason we took a buffer bevore was to support the old kernel
API.  We can simplify the function now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
af3e7ba105 nvk: Stash descriptor set sizes
To save space in the root descriptor table, we put these in the CPU-only
descriptor structure instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
107a09e7dd nvk: Add a cbuf_bind_map to nvk_shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
bdec097bb8 nvk/nir: Lower UBO loads to load_ubo when we have a cbuf
This will make it go through the cbuf path in NAK.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
f1c909edd5 nvk/nir: Add cbuf analysis to nvi_nir_lower_descriptors()
This builds a list of the 15 most commonly used UBOs or descriptor
buffers and places them in a new nvk_cbuf_map data structure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
952e06672f nak/sm50: Add legalization and encoding for OpLdc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
2199eea31b nak/sm50: Fix legalization of OpIAdd
Most of them specified bits 20..40 which is wrong because it's actually
19 bits with the sign bit off in bit 56 for some reason.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
e697280ebf nak/sm50: Fix immediate encodings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
eabd8cd470 nak: Handle negative cbuf offset immediates
This can happen with indirect UBO pulls because we just try go find an
iadd in NIR and one side may be negative.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
7bfb7a2b81 nak: Rework the dependency pass
This breaks the dependency pass in two.  The first pass builds a
dependency graph, including first-wait information for each barrier.
The second applies uses the newly constructed dependencies to place
barriers.  This fixes at least two known bugs:

 1. We were placing redundant write barriers.  In the case where we did
    a load, for example, we would add read barriers for the address and
    write barriers for the result.  In the fairly common case where the
    result is used before someone tries to overwrite the address, we
    don't actually need both barriers because a wait on the result
    implies a wait on the sources.

 2. There were a bunch of WaR cases which weren't being handled
    correctly.  In particular, when a variable-latency instruction read
    a register and then a fixed fixed-latency instruction read it, the
    fixed-latency read would replace the variable latency read.  When we
    then wrote that value with a fixed-latency instruction, we wouldn't
    see the hazard.  This commit fixes it by replacing the single last
    use per reg with a Vec of uses in the case of reads.

This fixes all known 1.1 memory model fails.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Faith Ekstrand
8006f271d4 nak: Add a delay of 2 cycles for barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26615>
2023-12-15 02:17:58 +00:00
Sil Vilerino
0739927080 d3d12: Remove D3D12_SDK_VERSION checks after bumping directx-headers dependency to v611
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26556>
2023-12-14 20:06:53 -05:00
Sil Vilerino
90b49f16f7 d3d12: Bump directx-headers dependency to v611.0 for latest video codecs and features
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26556>
2023-12-14 20:06:52 -05:00
Jesse Natalie
2ea04ef69b vulkan/wsi: Convert bit tests to bool with != 0
Otherwise the bool result could be some value other than 0 or 1.

Fixes: d7938de8 ("vulkan/wsi: don't support present with queues where blit is unsupported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
2023-12-15 00:39:10 +00:00
Jesse Natalie
19175e474b microsoft: Whitespace change to trigger CI
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
2023-12-15 00:39:10 +00:00
Jordan Petridis
62c797f5f3 Revert "ci: take microsoft farm offline"
Infrastructure issues [1] have been solved, sort of! Let's give
it a go again!

This reverts commit 0957b01a06.

[1]: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/37270

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
2023-12-15 00:39:10 +00:00
GKraats
4fe9a6053a i915G: show correct number of needed ALU instructions at errmess
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26340>
2023-12-14 23:24:32 +00:00
Daniel Stone
752b23547a panfrost/ci: Skip broken image copy tests
Any kind of image copy with a conversion (between channel
size/order/content, or between tiling mode) seems liable to failure.
Since this seems like a general problem, just skip the entire battery of
tests until it can be systematically fixed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26449>
2023-12-14 22:53:40 +00:00
Daniel Stone
f51d99def6 panfrost/ci: Add environment variable to suppress warnings
Without it, our test log fills up with warnings that crawling index
buffers from the CPU isn't valid. We know that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26449>
2023-12-14 22:53:39 +00:00
Daniel Stone
ac613b9e44 panfrost/ci: Remove Vulkan expectations from G57
panvk doesn't yet support G57.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26449>
2023-12-14 22:53:39 +00:00
Thomas H.P. Andersen
487837c0bf docs: update features.txt for nvk
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26676>
2023-12-14 22:41:37 +00:00
Eric Engestrom
871ea3bb88 radv/ci: add flake
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52773139

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26704>
2023-12-14 22:13:45 +00:00
Eric Engestrom
64c2a0489d docs: drop : in title
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26702>
2023-12-14 22:07:08 +00:00
Eric Engestrom
b557362b3a ci: run every test when changing the build
Changing meson options, checks or dependencies can affect drivers, so
they should be tested.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26625>
2023-12-14 20:58:16 +00:00
Eric Engestrom
9041084dd5 ci: fix indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26625>
2023-12-14 20:58:16 +00:00
Eric Engestrom
efa331a589 v3d/ci: add flake
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52760914

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26695>
2023-12-14 20:37:52 +00:00
Daniel Schürmann
42e9ba1c70 aco: remove VCCZ and EXECZ register handling
We don't use these registers and since RDNA3 removed the explicit usage,
it is unlikely that we will properly support them in the future.
Removing the registers from the ACO IR prevents accidentally using them
without proper support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26664>
2023-12-14 20:08:28 +00:00
Daniel Stone
8085145db0 ci: Fix trivial typo in ARTIFACTS_BASE_URL
Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26690>
2023-12-14 19:24:35 +00:00
Maíra Canal
3b715fb99d v3dv: enable CPU jobs in the simulator
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:14 +00:00
Maíra Canal
f11a458a50 v3d/v3dv: move V3D_CSD definitions to a separate file
Both OpenGL and Vulkan drivers share the same V3D_CSD definitions.

Therefore, move it to a common place instead of duplicating.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
35b4dcb2f2 v3dv: use the copy performance query results user extension
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
8913c134e4 drm-uapi: extend interface for copy performance query CPU job
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
43258ad44b v3dv: use the reset performance query user extension
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
b2db2e3f33 v3dv: don't start iterating performance queries at zero
Currently, the function handle_reset_query_cpu_job() starts to iterate
between the performance queries in the zero-index. This is not correct,
as we should start iterating the performance queries at first, which
is a index indicated by info->first.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
6089982a82 drm-uapi: extend interface for the reset performance query CPU job
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
4a9da29016 v3dv: use the copy timestamp query results user extension
The copy timestamp query user extension allows the creation of a CPU job
that copies the results of a timestamp query to a BO with the possibility
to indicate the timestamp availability with a availability bit.

By using the copy timestamp query user extension, it will be possible to
use the multisync user extension to synchronize this type of job, which
currently possible with the user space implementation without stalling.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
a990defab3 drm-uapi: extend interface for copy timestamp results CPU job
Extend the UAPI to support the copy timestamp results user extension for the
CPU job. This user extension will allow the creation of a CPU job that
copies the results of a timestamp query to a BO with the possibility to
indicate the timestamp availability with a availability bit.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
d1d52ebdc9 v3dv: use the reset timestamp user extension
The reset timestamp user extension allows the creation of a CPU job that
resets a timestamp query by updating its value in the timestamp BO and
resetting the availability syncobj.

Using the reset timestamp user extension, it will be possible to use the
multisync user extension to synchronize this type of job, which is not
currently possible with the user space implementation without stalling.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
7af9b47471 drm-uapi: extend interface for reset timestamp CPU job
Extend the UAPI to support the reset timestamp user extension for the
CPU job. This user extension will allow the creation of a CPU job that
resets a timestamp query by updating the timestamp BO and reseting the
timestamp's availability syncobj.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
17e03ebacd v3dv: use the timestamp query user extension
The timestamp query user extension allows the creation of a CPU job that
calculates the timestamp by updating its values in a BO with the appropriate
offsets and signalling the availability syncobjs.

The CPU job should be serialized so it only executes after all previously
submitted work has completed. This is accomplished by setting job->serialize
to V3DV_BARRIER_ALL before setting the multi-sync extension.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
d48aaa4773 drm-uapi: extend interface for timestamp query CPU job
Extend the UAPI to support the timestamp query user extension for the
CPU job. This user extension will allow the creation of a CPU job that
calculates the query timestamp by updating a timestamp BO with its value
and signaling the availability syncobj.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
2e32644e35 v3dv: occlusion queries aren't handled with a CPU job
A CPU job of type V3DV_JOB_TYPE_CPU_RESET_QUERIES is only created for
performance and timestamp queries. Occlusion queries are handled with a
compute job. Therefore, there is no need to handle occlusion queries in
the CPU job.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Iago Toral Quiroga
2a0d196abf v3dv: switch timestamp queries to using BO memory
Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
e404ccba5b v3dv: use the indirect CSD user extension
The indirect CSD user extension allows the creation of a CSD
job linked to a CPU job. When we submit the CPU job, the CPU job
will run when the indirect CSD dependency is completed, map the
indirect buffer to read the CSD dispatch parameters and reconfigure
the CSD job accordingly.

Using the indirect CSD user extension, allows us to use the multisync
user extension to synchronize this type of job, which is not currently
possible from user-space without stalling.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
b1134775e0 v3dv: create a CPU queue type
We will be introducing a new type of queue, a CPU queue. This queue will
be responsible for handling the CPU jobs, such as timestamp queries and
indirect CSD dispatch.

Therefore, add a CPU queue to the enum v3dv_queue_type and its
respective barrier.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
e162308298 v3dv: check CPU queue availability
Include a check to assure that the kernel driver supports the CPU queue.
Also, indicate that, currently, the simulator doesn't have support for
the CPU queue.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
2589998e05 drm-uapi: extend interface for indirect CSD CPU job
Extend the UAPI to support CPU job in the kernel space using an user
extension design and also add support for the indirect CSD job
extension. This user extension will allow the creation of a CSD
job linked to a CPU job. The CPU job will wait for the indirect CSD job
dependencies and, once they are signaled, it will update the CSD job
parameters.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
d2a6383c64 v3dv: allow set_multisync() to accept more wait syncobjs
Currently, set_multisync() doesn't allow using external syncobjs as
in_syncs objects in the multisync extension. Add the possibility to use
external syncobjs as in_syncs. This will ease the synchronization of CPU
jobs, as they sometimes depend on external syncobjs, such as
query availability syncobjs.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
f01d702d4a v3dv: allow different in/out sync queues
Allow in syncs and out syncs to be configured based on different queues.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
Maíra Canal
3a3acac8c5 v3dv: move multisync functions to the beginning of the file
With the support of CPU jobs by the kernelspace, now the CPU job
functions will also use the multisync extension. Therefore, move the
multisync functions to the beginning of the file to allow the CPU job
functions to call them.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
2023-12-14 16:43:13 +00:00
David Heidelberg
14267d9739 ci/freedreno: more issues showed up on a618, let's use 6.4
Until resolved, switch to 6.4 kernel.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26689>
2023-12-14 14:05:06 +00:00
Martin Roukala (né Peres)
a0f350429b ci/b2c: fix the cmdline_extra variable name
The variable name should have been named `kernel_cmdline_extra`, so
let's rename it to match the expectations of the rest of Mesa.

Fixes: 4362d5913f ("ci/b2c: import all variables starting with `B2C_`")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26686>
2023-12-14 13:27:40 +00:00
Samuel Pitoiset
1ef5feac5e radv: fix binding partial depth/stencil views with dynamic rendering
With dynamic rendering, it's allowed to begin rendering with depth or
stencil only but still with a depth/stencil format. The test below
checks that unbound part of ds isn't modified, if depth is bound and
stencil not and vice versa.

This fixes a recent CTS
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.partial_binding_depth_stencil.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25350>
2023-12-14 12:54:23 +00:00
Eric Engestrom
759b68bf66 bin/gitlab_gql: print merged yaml as yaml instead of a python dict
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26074>
2023-12-14 12:06:39 +00:00
Eric Engestrom
db6541a41a bin/gitlab_gql: fix --print-merged-yaml when --rev != HEAD
Reading the local root config file and then asking gitlab to evaluate it
in the context of some other version will cause issues if they are not
identical.

Instead, the local document should be a simple include of whatever is
the root config file at that commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26074>
2023-12-14 12:06:39 +00:00
Lionel Landwerlin
6a92af158d anv: wait for CS write completion before executing secondary
Got a error state on DG2 with a jump to secondary. The secondary is
empty and padded with MI_NOOPs to workaround the CS prefetching.
According to the error state, the return jump address from the
secondary to the primary is 0x0. The ACTHD register value is 0x10, so
it seems that the command streamer indeed jumped to 0x0 and hanged on
a few dwords after that.

The return address should have been set edited by a previous
MI_STORE_DATA_IMM instruction. So it appears it did not complete in
time for the command stream to catch it. On Gfx12+ this can happend if
we do not set ForceWriteCompletionCheck.

This change also takes the opportunity to remove the padding MI_NOOPs
at the end of secondaries on Gfx12+ by using disabling the prefetching
just before jumping into secondaries and reenabling it at the
beginning of each secondary.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26665>
2023-12-14 11:28:31 +02:00
Samuel Pitoiset
98ea540158 radv: add support for MRT compaction with PS epilogs
Now that PS epilogs are always compiled during cmdbuf recording, we
have all information to enable MRT compaction, for optimal performance.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26667>
2023-12-14 09:51:26 +01:00
Samuel Pitoiset
8760b7fab7 radv: cleanup radv_pipeline_generate_ps_epilog_key()
This has no effects because key->spi_shader_col_format isn't used when
the graphics pipeline needs to compile a PS epilog.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26663>
2023-12-14 08:18:46 +00:00
Samuel Pitoiset
60e6e3f8e6 radv: cleanup gathering PS info with/without PS epilogs
To make it clear that some fields aren't used with PS epilogs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26663>
2023-12-14 08:18:46 +00:00
Samuel Pitoiset
a39c3920fb radv: cleanup ac_nir_lower_ps options
To make it clear that some fields aren't used with PS epilogs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26663>
2023-12-14 08:18:46 +00:00
Samuel Pitoiset
78e45221bd radv: emit the task shader in radv_emit_graphics_pipeline()
It's a better place to do so.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26414>
2023-12-14 07:57:32 +00:00
Sagar Ghuge
8375609235 docs: Document INTEL_COPY_CLASS
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26409>
2023-12-14 00:53:15 +00:00
Sagar Ghuge
135a7d5031 iris: Handle aux map init for copy engine
We don't setup any state for the copy engine but platforms that supports
aux map, we need to init the aux map at context creation in order to
support compression.

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

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26409>
2023-12-14 00:53:15 +00:00
Sagar Ghuge
46f5359238 anv: Invalidate aux map for copy/video engine
Make sure to invalidate the aux map table for copy/video engines on
platforms that has the aux map.

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

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26409>
2023-12-14 00:53:15 +00:00
Sagar Ghuge
108f880986 anv: Handle video/copy engine queue initialization
We don't need to setup any state for video/copy usually but platform
that supports the aux map, we need to init the aux map by programming
equivalent registers.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26409>
2023-12-14 00:53:15 +00:00
Sagar Ghuge
2aea09c8de intel/genxml: Add BCS/VD0 aux table base address register
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26409>
2023-12-14 00:53:15 +00:00
Robert Foss
e46e9ee46c egl/surfaceless: Don't overwrire disp->Device if using EGL_DEVICE_EXT
Make sure that disp->Device is never overwritten during probe
function calls.

If EGL_DEVICE_EXT is provided, the probing should rather fail
than switch the device being used.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26131>
2023-12-13 23:15:17 +00:00
Robert Foss
208894c94f egl: Add _eglHasAttrib() function
Provide a simple function for checking if an EGLDisplay
is using a specific EGLAttrib.

This can be useful when trying to inhibit platform behavior
depending on the EGLAttribs provided.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26131>
2023-12-13 23:15:17 +00:00
Robert Foss
cda9980f96 egl/surfaceless: Fix EGL_DEVICE_EXT implementation
The native_display checks are incorrect and partially never
executed due to native_display always being NULL.

Fixes: 1efaa85889 ("egl: Fix attrib_list[0] == EGL_NONE check")
Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26131>
2023-12-13 23:15:17 +00:00
Daniel Stone
59a7fc2054 ci/radeonsi: Occlusion queries are flaky on stoney
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26678>
2023-12-13 22:51:52 +00:00
Eric Engestrom
e46702f7ae ci: deduplicate constructing the ARTIFACTS_BASE_URL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26670>
2023-12-13 21:12:22 +00:00
Eric Engestrom
d024da3900 docs: update calendar for 23.3.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26673>
2023-12-13 21:03:25 +00:00
Eric Engestrom
efa24268ce docs: add sha256sum for 23.3.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26673>
2023-12-13 21:03:25 +00:00
Eric Engestrom
d5bf161706 docs: add release notes for 23.3.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26673>
2023-12-13 21:03:25 +00:00
Chris Spencer
342dba5102 vulkan/android: Only limit advertised extensions in strict mode
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Chris Spencer
3c618d23d1 vn/android: Only limit advertised Vulkan version in strict mode
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Chris Spencer
30788edbcc v3dv/android: Only limit advertised Vulkan version in strict mode
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Chris Spencer
9385f1d4e2 radv/android: Only limit advertised Vulkan version in strict mode
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Chris Spencer
ebc3032245 anv/android: Only limit advertised Vulkan version in strict mode
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Chris Spencer
257ecaca88 android.mk: Add option to pass arbitrary parameters to meson
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Chris Spencer
50458703fa meson: Add option to ignore artificial Android limitations
Some capabilities are artificially disabled on Android to avoid running
afoul of the CTS. Make this behaviour opt-out so devices that don't need
strict conformance can take advantage of the full capabilities of the
driver.

Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25101>
2023-12-13 20:09:37 +00:00
Caio Oliveira
6a4156f812 clover: Remove usage of glsl_type C++ helpers
Preparation for removing the C++ helpers from glsl_type.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26671>
2023-12-13 19:52:24 +00:00
Sagar Ghuge
a4947f7bd8 intel/fs: Adjust destination size for load ubo on Xe2+
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26639>
2023-12-13 19:06:21 +00:00
Sagar Ghuge
e0ce94318b intel/fs: Adjust destination size for global load constant on Xe2+
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26639>
2023-12-13 19:06:21 +00:00
Sagar Ghuge
11fea46bdc intel/fs: Adjust destination size for image size intrinsic
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26639>
2023-12-13 19:06:21 +00:00
Sagar Ghuge
c426553658 intel/compiler: Adjust assertion in lower_get_buffer_size() for Xe2
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26639>
2023-12-13 19:06:21 +00:00
Eric Engestrom
f8e583d537 ci/b2c: identify dut by its id instead of its tags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
b93d836e47 ci/b2c: rename B2C_TEST_SCRIPT to B2C_CONTAINER_CMD to match the automatic import
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
4362d5913f ci/b2c: import all variables starting with B2C_
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
ef0e8bae0d ci/b2c: use envvars directly instead of converting them back and forth into cli args
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
e157d67d39 ci/b2c: export B2C_TEST_SCRIPT
Next commit will use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
b2e78a9775 ci/b2c: use with:write instead of manually doing open;write;close
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
50da22812d ci/b2c: always define cmdline_extras
Just make it an empty string when undefined

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
86ee903b38 ci/b2c: always define job_volume_exclusions
The template doesn't do anything if the list is empty, so simplify the code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
14f59188f6 ci/b2c: drop unused --volume and --mount-volume
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
5142ae2d4f ci/b2c: drop support for harbor.freedesktop.org
It's dead, Jim.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
8eabe3d913 ci/b2c: tags are mandatory
Jobs without tags are not accepted, so there is no point in having
support for creating them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
850d3e28e5 ci/b2c: drop unused B2C_EXTRA_VOLUME_ARGS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
a10bd6fcb0 ci/b2c: fix indentation of comment and after_script: list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
918199a154 ci/b2c: stop ignoring errors in before_script
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Eric Engestrom
6cc6ebde3a ci/b2c: drop passthrough of unset CI_JOB_JWT
Fixes: dabc068e6c ("ci: Use ci-fairy minio login via token file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26653>
2023-12-13 18:29:23 +00:00
Lionel Landwerlin
d761871761 isl: drop AUX-TT CCS alignment with INTEL_DEBUG=noccs
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26644>
2023-12-13 17:40:38 +00:00
Boris Brezillon
db5166718d util/hash_table: Don't leak hash_key_u64 objects when the u64 hash table is destroyed
Allocate a ralloc sub-context which takes the u64 hash table as a parent
and attach a destructor to it so we can free the hash_key_u64 objects
that were allocated by _mesa_hash_table_u64_insert().

The order of creation of this sub-context is crucial: it needs to happen
after the _mesa_hash_table_create() call to guarantee that the
destructor is called before ht->table and its children are freed,
otherwise the _mesa_hash_table_u64_clear() call in the destructor leads
to a use-after-free situation.

Fixes: ff494361be ("util: rzalloc and free hash_table_u64")
Cc: stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26423>
2023-12-13 17:02:02 +00:00
Boris Brezillon
5a60fd7b14 util/hash_table: Don't leak hash_u64_key objects when the entry exists
When an entry exists, _mesa_hash_table_insert() updates the entry with
the new data/key pair, which causes a leak if the key has previously
been dynamically allocated, like is the case for hash_u64_key keys.

One solution to solve that is to do the insertion in two steps: first
_mesa_hash_table_search_pre_hashed(), and if the entry doesn't exist
_mesa_hash_table_insert_pre_hashed(). But approach forces us to do the
double-hashing twice.

Another approach is to extract the logic in hash_table_insert() that's
responsible for the searching and entry allocation into a separate helper
called hash_table_get_entry(), and keep the entry::{key,data} assignment
in hash_table_insert().

This way we can re-use hash_table_get_entry() from
_mesa_hash_table_u64_insert(), and lake sure we free the allocated
key if the entry was already present.

Fixes: 6649b840c3 ("mesa/util: add a hash table wrapper which support 64-bit keys")
Cc: stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26423>
2023-12-13 17:02:02 +00:00
Boris Brezillon
977cc3157d util/hash_table: Use FREE() to be consistent with the CALLOC_STRUCT() call
CALLOC_STRUCT() calls the OS abstraction layer to do the allocation.
Call FREE() to free the corresponding objects so we keep things
consistent and have proper debug traces when memory-debugging
is enabled.

Fixes: 6649b840c3 ("mesa/util: add a hash table wrapper which support 64-bit keys")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26423>
2023-12-13 17:02:02 +00:00
Marek Olšák
165d27abfc winsys/amdgpu: document BO structures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
68f7e497fe winsys/amdgpu: fix amdgpu_cs_has_user_fence for VPE
invert the condition to prevent this in the future.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
f5a3874ad1 winsys/amdgpu: clean up the rest of the code for cs->buffer_lists
This just changes how we iterate over the buffer lists.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
af0d2fe4fc winsys/amdgpu: pass amdgpu_buffer_list* to amdgpu_add_bo_fences_to_dependencies
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
378984b994 winsys/amdgpu: return amdgpu_cs_buffer* from add/lookup_buffer instead of index
because we only use the index to get amdgpu_cs_buffer.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
05ba3c9cc5 winsys/amdgpu: clean up duplicated code around amdgpu_lookup/add_buffer
The function for real, slab, and sparse buffers can be unified, mostly.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
2afe6cea4c winsys/amdgpu: change amdgpu_lookup_buffer to take struct amdgpu_buffer_list
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
9cf35b601a winsys/amdgpu: change real/slab/sparse_buffers to buffer_lists[3]
The next commits will simplify it.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
32eb4a54dc winsys/amdgpu: don't count memory usage because it's unused
Acked-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
bbd64747e2 winsys/amdgpu: move lock from amdgpu_winsys_bo into sparse and real BOs
The slab BO doesn't use it.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
6803868498 winsys/amdgpu: use inheritance for the slab BO
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
86481c461e winsys/amdgpu: use inheritance for the sparse BO
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
e9c416ac9a winsys/amdgpu: use inheritance for the real BO
add struct amdgpu_bo_real

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
d1e70db89a winsys/amdgpu: use inheritance for the cache_entry BO field
Add struct amdgpu_bo_real_reusable for it. This is the beginning
of changing amdgpu_winsys_bo to use inheritance instead of a union.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
943a3329c7 winsys/amdgpu: inline amdgpu_add_fence_dependencies_bo_lists
and rename the other one

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
5cf57986d2 winsys/amdgpu: cosmetic changes in amdgpu_cs_add_buffer
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
c902b9e1d9 winsys/amdgpu: don't return a value from cs_add_buffer
It's unused. The return value is only used with the radeon winsys.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
390f26eefb ac,radeonsi: require DRM 3.27+ (kernel 4.20+) same as RADV
The only major change is the code removal of the legacy BO list path
in the winsys, which required switching "debug_all_bos" to the new path.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Marek Olšák
5cfd659276 ac/llvm: remove code for converting txd from 1D to 2D because NIR does it
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26547>
2023-12-13 16:26:17 +00:00
Caio Oliveira
f17e23e116 compiler/glsl: Reduce scope of is_anonymous
This a GLSL parser specific detail, so move it there.  Also
add a comment pointing to where #anon prefix is used.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26656>
2023-12-13 15:44:40 +00:00
Ganesh Belgur Ramachandra
8458cd49e0 asahi: fixes prevailing '-Werror=maybe-uninitialized' issue
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26206>
2023-12-13 15:29:43 +00:00
Sathishkumar S
cd8ccba814 frontends/va: use va interface for jpeg partial decode
add support to check jpeg crop decode cap and to set the crop
rectangle. the interface is avialble on libva 1.21.0 and higher.

v2: (Ruijing)
enclose the entire case block within VA_CHECK_VERSION
if attr unsupported set the return value to VA_ATTRIB_NOT_SUPPORTED

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26588>
2023-12-13 14:18:05 +00:00
Christian Gmeiner
2f205caea4 etnaviv: Add static_assert(..) to catch memory corruption
When we start to support GPUs with more then 16 varyings the code base
tells us that there is some work to do.

Cc: mesa-stable

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26662>
2023-12-13 12:56:47 +00:00
Christian Gmeiner
11ffb20b70 etnaviv: Update headers from rnndb
Update to rnndb commit 071f5a60dcb8.

This updates VIVS_PA_SHADER_ATTRIBUTES__LEN define from 10 to 16 and
fixes memory corruption if more then 10 varyings are used. The current
upper limit for varyings is 16.

Cc: mesa-stable

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26662>
2023-12-13 12:56:47 +00:00
Karol Herbst
de3190d36d radeonsi: fix reg_saved_mask for non graphics contexts
The old code used to clear the bits, the new one set it. It should have
used `BITSET_CLEAR_RANGE` instead.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10286
Fixes: 17e01a9a9b ("radeonsi: merge context_reg_saved_mask and other_reg_saved_mask into a BITSET")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26657>
2023-12-13 12:25:38 +00:00
Tatsuyuki Ishi
c3c3a8926a radv/amdgpu: Separate the concept of residency from use_global_list.
A BO can be always resident by two ways:
1. Through kernel bookkeeping. The BO is created with
   AMDGPU_GEM_CREATE_VM_ALWAYS_VALID and bo->is_local gets set to true.
2. Through the driver global BO list. On every submission, the global
   BO list is added to the CS's BO list.

Until now, use_global_list reflected either 1. or 2. . This commit
changes it to reflect 2. only, and update callsites that checks for
residency to use a new helper.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26591>
2023-12-13 12:03:20 +00:00
Tatsuyuki Ishi
63120a55b8 radv/amdgpu: Remove virtual bo dump logic.
Virtual BOs cannot go into the global bo list. Accessing bo_handle is
also invalid for virtual BOs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26592>
2023-12-13 11:42:35 +00:00
Rohan Garg
40c6e54ce7 anv: rename anv_create_companion_rcs_command_buffer to anv_cmd_buffer_ensure_rcs_companion
We can now drop any checks for companion_rcs_cmd_buffer before calling
anv_create_companion_rcs_command_buffer.

Ensure that anv_cmd_buffer_ensure_rcs_companion callee's have the proper
error handling.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26648>
2023-12-13 11:19:07 +00:00
Timothy Arceri
bed1b8b90d radeonsi: fix divide by zero in si_get_small_prim_cull_info()
This fixes a crash on startup with the game
"Ty the Tasmanian Tiger 3"

Fixes: f8a0aa6852 ("radeonsi: fix view culling for wide lines")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26661>
2023-12-13 10:06:41 +00:00
Lionel Landwerlin
d376d8c5ea anv: promote EXT_calibrated_timestamps to KHR
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/26632>
2023-12-13 09:39:08 +00:00
Lionel Landwerlin
4eb1eb0db1 anv: promote EXT_vertex_attribute_divisor to KHR
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/26632>
2023-12-13 09:39:08 +00:00
Lionel Landwerlin
f99e43d606 anv: switch to use runtime physical device properties infrastructure
Prevents us to have that big switch case for each extension's
properties.

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/26632>
2023-12-13 09:39:08 +00:00
Lionel Landwerlin
dc858202a9 anv: get features after initializing drm
We'll want to capture properties like features, just once at
initialization.

In order to do this we need the DRM stuff to be initialized as some of
that can be reported in properties.

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/26632>
2023-12-13 09:39:08 +00:00
Lionel Landwerlin
a1dcf943ab isl: constify isl_device_get_sample_counts()
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/26632>
2023-12-13 09:39:08 +00:00
Tapani Pälli
2336058bbb iris: use slow clear for small surfaces with Wa_18020603990
Described in Wa_18020603990, we need to use slow clear or add an
partial resolve after fast clear for surfaces where bpp <= 32 and
dim <= 256x256.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26629>
2023-12-13 09:12:19 +00:00
Tapani Pälli
25a32433b1 anv: use slow clear for small surfaces with Wa_18020603990
Described in Wa_18020603990, we need to use slow clear or add an
partial resolve after fast clear for surfaces where bpp <= 32 and
dim <= 256x256.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26629>
2023-12-13 09:12:19 +00:00
Samuel Pitoiset
ca8d9f850b radv/ci: remove dEQP-VK.mesh_shader.ext.query.* from the lists
meshShaderQueries has been recently disabled because it causes random
GPU hangs in CI, I'm still investigating it. But let's clean the CI
lists to avoid any confusion, I will re-introduce them if needed but
this issue can also be reproduced without mesh shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26651>
2023-12-13 08:33:24 +00:00
Samuel Pitoiset
f576ce3340 radv: advertise VK_KHR_vertex_attribute_divisor
This is a promotion from the EXT, except the new property
supportsNonZeroFirstInstance which should already be supported.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26595>
2023-12-13 08:08:21 +00:00
Samuel Pitoiset
24c755316b vulkan/runtime: promote VK_EXT_vertex_attribute_divisor to KHR
Just rename existing structs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26595>
2023-12-13 08:08:21 +00:00
Samuel Pitoiset
0605631094 radv: stop clearing FMASK_COMPRESS_1FRAG_ONLY for TC-compat CMASK images
TC-compat CMASK means Fmask decompression isn't needed because the hw
can read it directly from shaders, so this shouldn't have any effects.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26575>
2023-12-13 07:48:51 +00:00
Samuel Pitoiset
c70c269b16 radv: remove useless check for TC-compat CMASK images during fb emission
The FMASK decompression only happens for images with FMASK and without
TC-compat CMASK, so both can never be TRUE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26575>
2023-12-13 07:48:51 +00:00
Iago Toral Quiroga
205938cd39 v3dv: disallow image stores on VK_KHR_DISPLAY surfaces
Display surfaces must be linear and V3D can only do linear TMU access
for 1D images. This would also restrict sampling usages, however, we
can currently work around those in the driver at a performance penalty.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10268
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26647>
2023-12-13 06:17:15 +00:00
Faith Ekstrand
f6437f4388 nvk: Implement VK_EXT_multi_draw
Zink uses this to let it skip a bunch of the per-draw validation and, in
the case of NVK, redundant root descriptor uploads.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9642
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26660>
2023-12-13 03:18:04 +00:00
Thomas H.P. Andersen
afbaeee358 nvk: VK_EXT_color_write_enable
A write mask based on the pipeline creation input is stored in scratch. Another
similar mask is also stored for the dynamic color_write_enable. These can then
be updated individually, and will be combined in MME macro before use.

Each attachment has a mask for rgba. The max number of attachments in 8 so
we can fit the write mask in a single 32bit scratch.

color_write_enable is a single bit per attachment. To make it easier to combine
in with the write mask it is stored in scratch with a separate rgba bits.

The layout of the both scratch values are:
Attachment index 88887777666655554444333322221111
Component        abgrabgrabgrabgrabgrabgrabgrabgr

dEQP-VK.pipeline.monolithic.color_write_enable.*

Test run totals:
  Passed:        576/576 (100.0%)
  Failed:        0/576 (0.0%)
  Not supported: 0/576 (0.0%)
  Warnings:      0/576 (0.0%)
  Waived:        0/576 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26211>
2023-12-13 00:48:54 +00:00
Alyssa Rosenzweig
f217d267d3 gallium: add PIPE_IMAGE_ACCESS_DRIVER_INTERNAL
for e.g. driver internal blits that can use special paths wrt comporession.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26613>
2023-12-12 19:44:41 -04:00
Alyssa Rosenzweig
15b5437f8f gallium: fix util_clamp_color type confusion
fixes arb_color_buffer_float-clear GL_RGBA8_SNORM.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26613>
2023-12-12 19:44:35 -04:00
Karol Herbst
d136583c82 rusticl/kernel: explicitly set rounding modes
Since dbbf566588 ("aco,ac/llvm,radeonsi: lower f2f16 to f2f16_rtz in nir")
radeonsi behavior changed and some of the core fp16 ops broke as a result.

We should explicitly specify the rounding mode until we add an gallium API
for drivers to advertize what they prefer.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26655>
2023-12-12 23:02:11 +00:00
David Heidelberg
53b01459fd rusticl: add freedreno alias for RUSTICL_ENABLE
`RUSTICL_ENABLE=msm` isn't first thought usually,
let's support the `freedreno` alias.

Suggested-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26642>
2023-12-12 21:56:59 +00:00
Friedrich Vock
f1817ab7e0 radv,vtn,driconf: Add and use radv_rt_ssbo_non_uniform workaround for Crysis 2/3 Remastered
Crysis 2 and 3 Remastered's RT shaders non-uniformly index into SSBO
descriptor arrays without specifying the NonUniformEXT qualifier on the
relevant access chains/load ops. This leads to artifacts around objects.

To add insult to injury, the game fails to provide a meaningful
applicationName/engineName in the Vulkan part of the DX11-Vulkan interop
solution used for RT. Both of these fields are set to "nvpro-sample"
(perhaps the code has been copied from NVIDIA's sample applications).
Therefore, fall back to executable name matching.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9883
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26391>
2023-12-12 21:16:39 +00:00
Faith Ekstrand
63e2bba592 nak: Don't set both FTZ and DNZ at the same time
Fixes: 3955e596df ("nak: Implement fmulz and ffmaz")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26654>
2023-12-12 20:29:53 +00:00
Rhys Perry
dcbf31dce2 vulkan/wsi: always create command buffer for special blit queues
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: d7938de8fe ("vulkan/wsi: don't support present with queues where blit is unsupported")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10283
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26635>
2023-12-12 20:02:43 +00:00
Caio Oliveira
a8b2426419 intel/compiler: Use reference instead of pointer for fs_visitor
Per Ian suggestion.  Also clear up a few unnecessary casts around the code and
use `s` for fs_visitor ("shader").  Note to include a reference in ntf we need
to set it during initialization, so create an explicit mem_ctx for it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
77ab74ccc2 intel/compiler: Use reference instead of pointer for nir_to_brw_state
Per Ian suggestion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
4e5fcccd01 intel/compiler: Create and use nir_to_brw() function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
38a42e5aa1 intel/compiler: Add ctor to fs_builder that just takes the shader
Uses the dispatch_width from the shader (fs_visitor).  This was not
possible before because the dispatch_width was not part of
backend_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
cf730adc58 intel/compiler: Make fs_builder include fs_visitor and not the other way
This will allow fs_builder have a reference to an fs_visitor (a
"fs_shader" really), instead of a reference to a backend_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
f5032c4d52 intel/compiler: Make fs_visitor not depend on fs_builder
At this point this is more a header dependency due to inline functions,
so shuffle them around.  The end goal is to allow fs_builder have a
reference to a fs_visitor (really a fs_shader).

Note the header is still included, a later patch will move the includes
to the call-sites.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
4f991dec00 intel/compiler: Remove fs_visitor::bld
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
5b8ec015f2 intel/compiler: Don't use fs_visitor::bld in remaining places
The remaining users can simply create a new builder at_end() if needed.
In many places a new builder object is already being constructed, so
just give more specific instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:14 +00:00
Caio Oliveira
c73c1aa496 intel/compiler: Annotate and use nir_to_brw_state::bld
Use the "current bld" in nir_to_brw_state more widely, and also replace it
with an annotated version when applicable (to associate it with a NIR
instruction being lowered).  After filling a block we reset it back to
the original value.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
34c28680b1 intel/compiler: Stop using fs_visitor::bld field in NIR conversion
Provide its own builder in nir_to_brw_state.  Will allow eventually remove
the one in fs_visitor.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
79735fa783 intel/compiler: Move remaining NIR conversion fields to nir_to_brw_state
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
5cb189636d intel/compiler: Move nir_ssa_value into a local structure
Create a nir_to_brw_state struct that is valid only during the
NIR to backend translation and use it for nir_ssa_values array.

This removes some NIR specific handling out of the fs_visitor -- nowadays
effectively an fs_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
afe75d65be intel/compiler: Make NIR resources helpers static
Remove get_nir_src_block() since it is not used anywhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
a7a27ee95e intel/compiler: Make NIR atomic conversion functions static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
5777943381 intel/compiler: Make non-intrinsic NIR conversion functions static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
2385d6087a intel/compiler: Make setup functions of NIR emission static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
3899e6b1d8 intel/compiler: Make functions for NIR control flow conversion static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
860ec33f9a intel/compiler: Make more functions in NIR conversion static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
acca9dbf6b intel/compiler: Make a NIR intrinsic emission functions static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
c12460b01e intel/compiler: Move NIR emission code to brw_fs_nir.cpp
This is a preparation to reorganize NIR emission code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Caio Oliveira
1ef6415d22 intel/compiler: Remove unused headers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26323>
2023-12-12 19:36:13 +00:00
Faith Ekstrand
3e308903eb nvk: Enable NAK by default for Volta
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26214>
2023-12-12 18:48:11 +00:00
Karol Herbst
69454a8abd nak: move nir_lower_subgroups into nak_postprocess_nir
Fixes a bunch of `dEQP-VK.descriptor_indexing` tests.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26214>
2023-12-12 18:48:11 +00:00
Karol Herbst
cedb101d3f nak: add algebraic lowering pass
Lowering and file copied from bifrost_nir_algebraic.py

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26214>
2023-12-12 18:48:11 +00:00
Karol Herbst
8c73b1eb90 nir/algebraic: add support for custom arguments
Those are passed as an optional argument and are declared as a list of
(type, name) tuples.

At the moment this can only be used for conditions.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26214>
2023-12-12 18:48:11 +00:00
Karol Herbst
2701e634c1 nak: fix some sm checks for volta
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26214>
2023-12-12 18:48:11 +00:00
Jordan Justen
7be8bc2c97 isl: Add mocs for xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26593>
2023-12-12 17:54:38 +00:00
David Heidelberg
c2558a2df8 ci/freedreno: fail introduced by ARB_post_depth_coverage
Fixes: fd00e99444 ("freedreno/a6xx: ARB_post_depth_coverage")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:55 +00:00
David Heidelberg
55d6430bd7 ci/freedreno: downgrade a618_piglit to 6.4 kernel
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:55 +00:00
David Heidelberg
5527c090f4 ci/freedreno: timestamp-get no longer fails on Adreno
Fixes: 659e557676 ("freedreno: Fix timestamp conversion")
Cc: mesa-stable #23.3

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:55 +00:00
David Heidelberg
4d78d63552 ci/freedreno: re-enable two Adreno 618 tests
9 limozeen-nots-r5 machines are available. Also correct piglit job name,
it has nothing common with gles2.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:55 +00:00
David Heidelberg
d98ab19a95 ci/freedreno: extend timeout for full runs
Current two jobs getting around 4 hours with 1.3.7.0 CTS suite.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:55 +00:00
David Heidelberg
7db3d6415f ci/tu: add another failing pipeline strip draw
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:55 +00:00
David Heidelberg
32bb80ee12 ci/freedreno: increase fraction for Vulkan testing
Reduce runtime from 18 minutes below 15m.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:54 +00:00
David Heidelberg
0fc4665bd3 ci/freedreno: switch Adreno 630 boards back to 6.4 kernel
Until gets figured out why 6.6 kernel is ~ 1 ‒ 5 minutes slower per run.

Acked-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:54 +00:00
David Heidelberg
1498577436 ci/freedreno: mark unvanquished-lowest trace as flaky and skip
Acked-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26611>
2023-12-12 17:28:54 +00:00
Echo J
9342635903 vulkan: Remove nonexistent output in vk_synchronization_helpers target
I noticed that my NVK build was always LTOing the library twice
(I managed to trace it to the vk_synchronization_helpers change)

This change fixes the double compilation/LTO issue (which should
definitely cut packaging times a bit) 🐸

Fixes: fe12c1c29e ("vulkan: Add some auto-generated synchronization helpers")
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26630>
2023-12-12 17:01:00 +00:00
Erico Nunes
09ae669fc5 panvk: Support modifiers for Wayland WSI
If we don't send modifiers, Wayland compositors end up with
DRM_FORMAT_MOD_INVALID which may prevent them from e.g. assigning an
overlay plane to an application.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26568>
2023-12-12 16:19:36 +00:00
Erico Nunes
a51a44a169 Revert "ci: disable lima farm as it appears to be down"
This reverts commit cca5a4191d.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26649>
2023-12-12 15:45:35 +00:00
Erico Nunes
b88f3cafd8 lima/ci: update piglit ci expectations
These tests started to fail during the last CI downtime.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26649>
2023-12-12 15:45:35 +00:00
Karol Herbst
c674db05e8 clc: use addMacroDef/Undef instead of -D/-U flags
It always felt weird having the extension management in two different
places. Later once we require LLVM-14 we might even be able to clean it up
a little more.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26641>
2023-12-12 14:24:48 +00:00
Iago Toral Quiroga
6b89c71c90 broadcom: fix scheduling dependencies for SETMSF instruction
We use SETMSF to implement discard, so we need to ensure that any
TMU writes after a SETMSF don't actually execute. We emit a TMU flush
before a discard but we also need to ensure that the QPU scheduler
honors this.

Fixes some tests in dEQP-VK.spirv_assembly.instruction.terminate_invocation.*
when we expose the extension that would otherwise fail because the
QPU scheduler would incorrectly move some image writes emitted after a SETMSF
before the SETMSF instruction.

Also fixes spec@arb_shader_atomic_counters@fragment-discard

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26631>
2023-12-12 12:58:42 +00:00
Frank Binns
4add1273f5 pvr: alloc WSI memory via GPU when there isn't a valid display FD
This isn't currently causing any issues as the driver only supports the
VK_KHR_display extension for now, so there will always be a valid display FD
when a WSI allocation is requested. However, checking that we have a valid
display FD when attempting to allocate via the display driver is more correct
and, when we come to support VK_KHR_wayland_surface, will avoid
vkAllocateMemory() unnecessarily failing.

This addresses a comment made here:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507#note_2188052

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26516>
2023-12-12 12:41:13 +00:00
Samuel Pitoiset
86ab29a4d4 docs: update features.txt for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26646>
2023-12-12 12:34:03 +00:00
Lionel Landwerlin
aa8c88f96c anv: fix incorrect queue_family access on command buffer
The queue_family field is not an array, but a pointer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9866c4e32b ("anv: Skip layout transition on the compute queue")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26645>
2023-12-12 12:11:29 +00:00
Lionel Landwerlin
f53748c481 nir: fixup nir_printf intrinsic description
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
dc3e69af1a nir/serialize: untangle printf serialization from a particular stage
This allows any stage to carry printf instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
4e4a3820ab nir/divergence: handle printf intrinsic
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
f7ae92b868 nir: include printfs from linked shaders
Once lowered low enough, it's not always possible to tell what strings
are used. So include them all when linking another shader.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
81b3dea993 nir/clone: fix missing printf_info clone
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
603f039708 nir: make printf_info (de)serializer available
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
751e919c33 util/u_printf: add a u_printf_ptr() variant
Taking an array of pointer to u_printf_info.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Thomas Devoogdt
3ef5149824 util: os_same_file_description: fix unknown linux < 3.5 syscall SYS_kcmp
https://man7.org/linux/man-pages/man2/kcmp.2.html

The kcmp() system call first appeared in Linux 3.5.

But was probably also not supported by all major platforms
at that time. So fallback to the check that is done for windows.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18517>
2023-12-12 10:28:17 +00:00
Yonggang Luo
8fa16452ba broadcom/compiler: remove include of gallium headers from meson.build
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26579>
2023-12-12 10:03:11 +00:00
Yonggang Luo
238a9ef5ff broadcom/(compiler,common): avoid include of gallium headers in header files
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26579>
2023-12-12 10:03:10 +00:00
Pavel Asyutchenko
a921a69010 mesa/main: allow S3TC for 3D textures
This is allowed by D3D, RADV, ANV and Nvidia GL drivers
at least, so it should work on any hardware with S3TC.

Confirmed to work in OpenXRay on radeonsi.

Signed-off-by: Pavel Asyutchenko <svenpavel@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26389>
2023-12-12 06:53:00 +00:00
Yogesh Mohan Marimuthu
a9064837f8 winsys/radeon: remove unused gpu_address variable from struct radeon_cmdbuf
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
9a258bd5b3 winsys/amdgpu: rename big_ib_buffer,ib_mapped variables in struct amdgpu_ib
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
65cd94c8f0 winsys/amdgpu: rename ptr_ib_size_inside_ib to is_chained_ib
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
50ad5845cb winsys/amdgpu: rename requested_size_dw to projected_size_dw
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
e240cda128 winsys/amdgpu: move 125% comment to correct line of code
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
c7d004d029 winsys/amdgpu: remove rcs variable from struct amdgpu_ib
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
52aca8542f winsys/amdgpu: rename ib variable name to chunk_ib
rename struct drm_amdgpu_cs_chunk_ib ib variable name to chunk_ib for
improving code readability.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
34fba64cf6 winsys/amdgpu: rename struct amdgpu_ib main variable as main_ib everywhere
In amdgpu_cs.c, struct amdgpu_ib variable is named as ib which creates
confusion since struct drm_amdgpu_cs_chunk_ib is also called as ib in
some places.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:22 +00:00
Yogesh Mohan Marimuthu
4d6089bfd1 winsys/amdgpu: remove ib_type variable from struct amdgpu_ib
preamble ib is created using amdgpu_cs_setup_preemption()
function. only IB_MAIN memory is allocated from struct amdgpu_ib.
Hence remove ib_type variable from struct amdgpu_ib.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:22 +00:00
Yogesh Mohan Marimuthu
0f117efe39 winsys/amdgpu: add _dw to max_ib_size variable for code readability
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:22 +00:00
Timothy Arceri
5147e9a26e glsl: combine shader stage loops in linker
The gs validation that was run between these loops can be run after
merging them without any issue.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Timothy Arceri
5d98592e04 mesa/st: drop additional validate_ir_tree() call
This is not needed. validate_ir_tree() is called at the end of the
glsl ir linker and the IR is not modified again after so we can
drop this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Timothy Arceri
fe44414662 glsl/st: move remaining glsl ir lowering to linker
This is a tidy up but also allows us to drop an additional
validate_ir_tree() call.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Timothy Arceri
f4a8aa653d glsl/st: move has_half_float_packing flag to consts struct
Moving this out of the state tracker will allow us to move its user
directly to the glsl linker in the folowing patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Karol Herbst
8af15359e3 rusticl: use rust.proc_macro for proc macros
Should fix a few issues in regards to cross compilation and maybe other
things. This requires meson-1.3.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26636>
2023-12-12 00:21:40 +00:00
Karol Herbst
280dde8c23 rusticl: bump meson req
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26636>
2023-12-12 00:21:40 +00:00
Karol Herbst
2d80240220 ci/fedora: bump to meson 1.3.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26636>
2023-12-12 00:21:40 +00:00
Rob Clark
1188b218c6 freedreno: Implement PIPE_CAP_TIMER_RESOLUTION
Perhaps it should use div_round_up() unlike normal timestamp conversion,
but this is close enough and it makes the connection to the 19.2MHz RBBM
counter more obvious.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
2023-12-11 23:46:26 +00:00
Rob Clark
659e557676 freedreno: Fix timestamp conversion
The kernel returns the 19.2MHz RBBM counter, same as what is used for
timestamp queries.  So it needs to be converted the same way.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
2023-12-11 23:46:26 +00:00
Rob Clark
2284d1c42f freedreno: De-duplicate 19.2MHz RBBM tick conversion
The 19.2MHz always-on counter is universal across generations, so
de-duplicate.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
2023-12-11 23:46:26 +00:00
Karol Herbst
e6249f97f1 rusticl: implement cl_khr_subgroup_shuffle and shuffle_relative
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Karol Herbst
7e78802028 clc: add support for cl_khr_subgroup_shuffle and shuffle_relative
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Karol Herbst
a217eb111c radeonsi: lower 64bit subgroup shuffle to 32 bit
This option only affects 64 bit values and is needed by OpenCL.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Karol Herbst
9fbcc7987f radeonsi: lower relative shuffle subgroup ops
This will be needed by rusticl to support the relevant CL extensions.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Sil Vilerino
83624659c5 meson: Only build WGL for Windows platform when opengl option is active
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26638>
2023-12-11 22:32:08 +00:00
Eric Engestrom
c51e40dd8b spirv: add missing build dependency
Fixes: 59a72570b6 ("compiler: Move spirv into a module of its own")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10277
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26624>
2023-12-11 21:47:37 +00:00
Yiwei Zhang
88c5affacf driconfig: add a workaround for Hades (Vulkan backend)
Vulkan backend of Hades can only handle at most 3 swapchain images.

It affects all drivers after below commit:
04d654a5d0

and then only affects specific driver backend which enables
extra_xwayland_image in wsi device options after below commit:
c1a62476ac

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Renato Pereyra <renatopereyra@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26607>
2023-12-11 19:40:09 +00:00
Ian Romanick
7fce0a5598 nir: Handle divergence for decl_reg
Once decl_reg is handled, src[0].ssa->divergent will be properly set, so
load_reg and load_reg_indirect do not need special treatment.

shader-db can run to completion on HSW, IVB, and SNB now. No other
testing was done.

v2: Refactor nir_intrinsic_load_reg and nir_intrinsic_load_reg_indirect
handling. Suggested by Daniel Schürmann.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 4fd257d20f ("nir: Properly handle divergence for load_reg")
Fixes: 6dbb5f1e07 ("intel/fs: rerun divergence analysis prior to convert_from_ssa")
Closes: #10233
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26436>
2023-12-11 17:10:51 +00:00
Jesse Natalie
7cd0553572 microsoft/clc: Flip on capabilities to prevent warning spew
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26582>
2023-12-11 16:28:29 +00:00
Jesse Natalie
37c0e8beda compiler/clc: Don't fail to parse SPIR-V if there's no kernels
It's valid to have library SPIR-V being parsed that has no entrypoints.
We still want to get spec constant info for them.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26582>
2023-12-11 16:28:28 +00:00
Faith Ekstrand
3955e596df nak: Implement fmulz and ffmaz
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10261
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26569>
2023-12-11 15:29:17 +00:00
Faith Ekstrand
ce8d966085 nak: Set .ftz on f32 ops by default
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26569>
2023-12-11 15:29:17 +00:00
Faith Ekstrand
aac1e3f595 nir: Add a new has_fmulz_no_denorms flag
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26569>
2023-12-11 15:29:17 +00:00
Erik Faye-Lund
a8b68badd5 mesa/st: use _mesa_is_zero_size_texture-helper
No need to repeat the logic.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
3123e4ffeb mesa/main: remove unused function
Let's just remove it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
b84117b272 mesa/main: use _mesa_is_zero_size_texture-helper
No need to repeat this logic.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
9e69dfbfed mesa/main: remove unused ClassID
This was probably useful in the past when we had DRI drivers, but it's
only ever written now. Let's get rid of it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
c67e6ea4c1 mesa/main: remove unused Log2 variants of width/height/depth
These are unused, and the comments about the relationships between it an
the other variants seems to be seriously outdated. Let's get rid of it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
David Heidelberg
81be60a233 docs: drop unused manual optimizations override
Fixes: ed4fd1d90e ("util: cleanup cpuinfo.* and it's related files")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26620>
2023-12-11 12:05:03 +00:00
Daniel Schürmann
dd7b6898e6 radv: fix number of physical SGPRs on GFX10+
This change has no effect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26521>
2023-12-11 10:39:51 +00:00
Daniel Schürmann
5ebba87772 aco: rename max_wave64_per_simd -> max_waves_per_simd
and update usage. Changes are because the scheduler targets
a different number of waves.

Totals from 195 (0.25% of 79330) affected shaders: (GFX11)

MaxWaves: 3120 -> 3108 (-0.38%)
Instrs: 71202 -> 71070 (-0.19%); split: -0.27%, +0.09%
CodeSize: 383272 -> 382828 (-0.12%); split: -0.21%, +0.10%
VGPRs: 7392 -> 7752 (+4.87%)
Latency: 2280141 -> 2262487 (-0.77%); split: -0.79%, +0.02%
InvThroughput: 4759022 -> 5725442 (+20.31%); split: -0.01%, +20.32%
VClause: 1737 -> 1741 (+0.23%); split: -3.11%, +3.34%
SClause: 2385 -> 2376 (-0.38%); split: -0.80%, +0.42%
Copies: 5257 -> 5274 (+0.32%); split: -0.25%, +0.57%
Branches: 1213 -> 1212 (-0.08%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26521>
2023-12-11 10:39:50 +00:00
Daniel Schürmann
f5bdc46a57 amd: rename max_wave64_per_simd -> max_waves_per_simd
These are hard limits and don't depend on wave size.
Accordingly, also update the usage in order to avoid
reporting unreasonable occupancy.

Totals from 192 (0.24% of 79330) affected shaders:

MaxWaves: 5814 -> 3072 (-47.16%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26521>
2023-12-11 10:39:50 +00:00
Samuel Pitoiset
ac20c70e9d radv: promote EXT_calibrated_timestamps to KHR
All functionality are similar.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26596>
2023-12-11 08:26:20 +01:00
Samuel Pitoiset
c9e1758462 vulkan: bump headers/registry to 1.3.273
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26596>
2023-12-11 08:26:02 +01:00
M Henning
9d162de9a0 nak: Enable loop unrolling.
This brings The Talos Principle from 9 to 18 fps on my machine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26626>
2023-12-11 01:40:55 +00:00
M Henning
e87cca7717 nak: Clamp negative texture array indices to zero
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26626>
2023-12-11 01:40:55 +00:00
Faith Ekstrand
888f09eca8 nvk: Rework the way we set up memory heaps/types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26627>
2023-12-10 18:31:31 -06:00
Faith Ekstrand
18ae2d1878 nvk: Throw Tegra behind NVK_I_WANT_A_BROKEN_VULKAN_DRIVER
It's recieved very little testing and what testing it has recieved
indicates that synchronization is pretty badly broken.  Let's turn it
off for users by default right now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26627>
2023-12-10 18:27:43 -06:00
Echo J
9ca9b67446 nvk: Set HOST_CACHED_BIT for the GTT type
vkd3d-proton requires this memory bit in various cases (adding
it to the GTT memory type significantly reduces failures in the
vkd3d-proton test suite) 🐸

I'm not sure if Tegra supports this bit though so I'm not adding it
to the VRAM-less path (hopefully someone can provide an actual answer)

The next step would be adding HOST_VISIBLE bit to the VRAM type (this
will likely require more work and maybe even some KMD changes) which
would make gamescope work (Faith said that DXVK benefits from it too)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26621>
2023-12-10 17:57:38 +02:00
Marek Olšák
9ab59574ef gallium: add typedef pipe_draw_func matching the draw_vbo signature and use it
We've copied the signature too many times already. This will also be used
more.

It intentionally deviates from the name by not including the "_vbo" part.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:14 +00:00
Marek Olšák
7f11272d29 mesa: execute an error path sooner in _mesa_validated_drawrangeelements
Also don't print the warning in release builds.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
4f766426b2 cso: inline cso_get_pipe_context
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
7da5b8dac0 cso: do cso_context inheritance how we do it elsewhere
Currently, we have:
- cso_context_base is the base class, but cso_context is passed to functions
- cso_context is the derived class

Change:
- cso_context to become the base class, and is passed to functions
- cso_context_priv to become the derived class.

mesa/main will need to access the base class directly.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
3b16541a8f mesa: move index bounds code (st_prepare_indexed_draw) into draw.c
there is no other user

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
c6281a6f26 st/mesa: no need to check index_size in st_prepare_indexed_draw anymore
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
4cd585ab50 mesa: call st_prepare_(indexed_)draw before Driver.DrawGallium(MultiMode)
This is refactoring for future work. Also, it unifies the st_draw_feedback
path with the normal path and the "indexed" version doesn't have to be called
in many places.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
8cbab48403 mesa: inline st_draw_transform_feedback
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
b14e26b198 st/mesa: make prepare_(indexed_)draw non-static
for later use

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
cf951bace2 mesa: remove non-relevant 16-year-old comment
The comment has nothing to do with the code around it and all uploads
are handled by u_vbuf today.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
360166c6f4 mesa: remove more DrawArrays/Elements duplication
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
2b8d764a76 mesa: remove some DrawElementsInstanced duplication
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Marek Olšák
23227954bc mesa: remove some DrawTransformFeedback duplication
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26619>
2023-12-10 06:20:13 +00:00
Faith Ekstrand
df62471fef nvk: CBuf alignment reduces to 64B on Turing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
289149ebcb nvk: Simplify alignment limit plumbing
We dont't need this whole function just for advertising alignment
requirements.  We now have enough #defines and helpers that they map
pretty cleanly to those.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
08222146ac nak: Reduce minStorageBufferAlignment
The only real requirement here is that we can load an entire vec4 at a
time without getting a misaligned address.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
35a40b4c6a nvk: Add an NVK_MIN_TEXEL_BUFFER_ALIGNMENT #define
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
b7f8a9e648 nvk: Add a nvk_min_cbuf_alignment() helper and use it
We want to be able to use cbufs for UBOs and descriptor buffers going
forward.  This also cleans up alignments all over the code-base where
just kinda did whatever seemed like a good idea at the time.  The result
is a lot more flexible and accurate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
bc236acff5 nvk: Plumb a physical device into descriptor_stride_align_for_type
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
c7de8afbe0 nvk: s/device/dev in nvk_descriptor_set_layout.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Faith Ekstrand
700d5c56d1 nvk: Make NVK_DEBUG=push an alias for push_dump
This has been bothering me for a while.  I can never remember whether
it's push_dump or dump_push.  Let's just get rid of the confusion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26617>
2023-12-10 03:06:01 +00:00
Alyssa Rosenzweig
d11c9f9836 asahi: clamp draw count for mdi
spec req. KHR-GL43.indirect_parameters_tests.MultiDrawArraysIndirectCount

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
fdec9dcf05 asahi: wire up hardware gl_PrimitiveID
when FS reads but no GS in the pipeline, the hw supplies for us. fixes

KHR-GL43.shader_image_size.basic-*-fs-*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
1e2de134ad asahi: respect render condition for compute
KHR-GL43.compute_shader.conditional-dispatching

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
1a39d1c73a asahi: allow more format reinterpretation
This seems to be the hw rule... would like to confirm with perf counters
though...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
e69a0f830e asahi: fix size calculation for 2d msaa arrays
otherwise the hw can overprefetch. fixes KHR-GL42.shader_image_load_store.basic-allTargets-load-ms

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
982e644d18 agx: don't produce split of immediate
can't be consumed, affects KHR-GL42.shader_image_load_store.basic-allTargets-load-ms

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6e2c71dc3b agx: Lower 64-bit I/O to 32-bit
Fixes KHR-GL42.vertex_attrib_64bit.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
d6474be46b agx: fix fp64 lowering options
we have no fp64 whatsoever.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
8d451fe9f2 asahi: fix integer RT clamping
fixes the rest of KHR-GL33.packed_pixels.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
01d0fb1cde asahi: fix pbe swizzling
fixes cases in KHR-GL33.packed_pixels.rectangle.*. matches what the powervr
driver does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6d05bf8761 asahi: fix dupe rgb65 formats
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
b68caa13e4 asahi: add more BGR formats
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
c89f0becf7 asahi: Implement ARB_cull_distance
Passes KHR-GL33.cull_distance.* and the piglits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
ba077d899e asahi: handle compact clip/cull in gs component gather
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
f02190b688 asahi: prepare gs copy shaders for compact clip/cull
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
0dc004888c asahi: handle some components/offsets in GS lowering
occurs for compact clip/cull xfb. not hard to deal with, do so instead of
getting caught up in assertions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
17f348f73a asahi: Implement ARB_viewport_array
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
af9241ce92 asahi: add XML for multiple viewports
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
3435ccb49a asahi: allow empty scissor box
we can't cull on the cpu when we have a scissor array, so don't try.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
bb59c787ec agx: report if we have a nonzero viewport
so driver can optimize.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
bc7afbf23d agx: allocate varying slot if writing viewport only
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
643acacd1b agx: note that sample_mask runs occlusion queries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
79e58e1d77 agx: handle force early-z + discard
fixes ./arb_shader_image_load_store-early-z. experimentally, an opaque pass type
works too but better match what the blob does.

also, I now have proof that sample_mask triggers occlusion query updates because
if you run it multiple times, you get >1 hits per fragment in a counting query
:p

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
3987c8a35f agx: remove spurious z/s writes in force early-z shaders
fixes crash in arb_shader_image_load_store-early-z

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
c43c90a5fa asahi: rewrite pointsize handling
In the wise words of Mike Blumenkrantz, "I hate gl_PointSize and so can you".

The mesa/st lowering won't mesh well with vertex shader epilogues, and it falls
over in various circumstances. I am too tired to go against the grain, so let's
just pretend to be a normal gallium driver and trust in the rasterizer CSO,
lowering point size internally. This properly handles transform feedback without
any hacks, both GL and GLES behaviours, etc.

Fixes:

   KHR-GL31.transform_feedback.capture_vertex_separate_test
   gl-2.0-large-point-fs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
aa1849a541 asahi: assert hw invariant
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
23f216d6e7 asahi: Lower edge flags
With the common geometry shader based lowering added for zink. Fixes edge flag
related piglits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
f4a648c607 asahi: Unroll GS/XFB primitive restart on the GPU
..and fix bugs versus the CPU unroll while we're at it. CPU based unrolling is
invalid in Vulkan, but this slow-as-dogs GPU unroll is ok.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
15957219ad agx: rework libagx linking a bit
for correctness with generic ptrs, avoids splat with the next patch.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
4a4c6d1bc6 agx: Avoid scratch mem with tri strip w/ adjacency
with restart unroll kernel where nir fails to optimize this away without a
little help from us.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
7f9ef5b176 agx: fix VARYING_SLOT_COL0 getting flatshaded
it's a bit mask.

didn't fix the piglit i was debugging :-(

but did fix the shadow glitching out in neverball.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6437578435 asahi: add xml for flatshading fans
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
403a20a9f2 asahi: rework cf binding xml
for flat shading of fans.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
2fec6bf951 asahi: fix tri fan enum
from tracing macos. fixes piglits:

 spec@!opengl 1.1@gl-1.1-drawarrays-vertex-count 100000 varray gl_triangle_fan
 spec@!opengl 1.1@gl-1.1-drawarrays-vertex-count 100000 vbo gl_triangle_fan
 spec@!opengl 1.4@triangle-rasterization-overdraw

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
6ae72a2f2a asahi: Support L/A/I formats for texture buffers
mesa/st doesn't know how to emulate them. Fixes
arb_texture_buffer_object-formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
5b33c74626 agxdecode: fix stack smash with border colour
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
a8857028bb asahi: add static assert
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
2be37d1c96 asahi: double depth bias
fixes gl-1.4-polygon-offset, other drivers do this too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
3af825ed96 asahi: move heap alloc to first use
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
0fa7252d8a asahi: Implement multidraw indirect
GS only for now (inserting a passthru GS if needed). This should be optimized
later, but it's ~correct.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
5987e47a29 asahi: rework GS input assembly
in prep for tessellation (which will share the IA lowering), and for multidraw
indirect (which greatly complicates IA lowering with geom/tess).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
a816350d95 asahi: force GS for indirect prim gen query
removes one more indirect cpu fallback (invalid in vulkan)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
0805fef082 asahi: make UB easier to see
would've saved us

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
a12d2689d8 asahi: rm unnecessary uniform upload for GS
already done in launch gs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
2220044ca2 asahi: remove dead declarations
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
9c66ae9b36 asahi: use agx_push
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
4d48574bd7 asahi: collapse unreachable condition
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
09e46aa168 asahi: add agx_push macro
Thanks, Ella!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
31b1bdb475 asahi: fix destroy_query leaving dangling references
this was fixed for occlusion queries already, but other queries have equivalent
issues.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
2d8a714f9c asahi: choose staging bind better
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
5257283941 asahi: use correct target packing PBE
harmless, but more correct.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Alyssa Rosenzweig
a3ae9e1a59 asahi: fix layout transitions with arrays
don't minify the layer count for non-3D!

Affects: dEQP-GLES31.functional.copy_image.*array

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 12:08:39 -04:00
Asahi Lina
25d185a501 ail: Fix tile size & strides for compressed textures
Compressed textures have two additional quirks that affect the tiling
code (but not the mip offsets): they get extra stride padding in some
cases for the large miptree, and the tile size is based on the POT size
and not the real size for the small miptree.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Asahi Lina
be3890a898 ail: Add explicit specification of mip level strides
For compressed textures, mip levels > 0 can have additional stride
padding. This (in some cases) affects the tile stride calculation, so it
cannot be implicitly represented with the existing members.

Add an explicit array containing the stride, in elements, of each
miptree level. The tiling code uses this instead of the minified and
element-aligned width when computing tile addressing.

This commit should be a functional no-op.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Asahi Lina
2221eb6cec ail: Fix miptree offset generation for compressed textures
For compressed textures, the POT miptree starting size is calculated
backwards (POT then minify instead of minify then POT).

In addition, the existing POT miptree start level code does not work for
compressed textures. Due to the extra block alignment requirement each
step of the way, we can no longer get away with nice log-based O(1)
math. Switch to a loop. This should be equivalent for uncompressed
textures, but yields different results with compression (element size >
1x1).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Alyssa Rosenzweig
5382f57e81 asahi: advertise ARB_shader_texture_image_samples
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Alyssa Rosenzweig
bc6b2d087b agx: wire up texture_samples/image_samplers
CL makes this too easy, lmao

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:45 -04:00
Karol Herbst
6979a1aa07 nir/opt_preamble: make load_workgroup_size handling optional
not all drivers support it being in the preamble, e.g. asahi.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
i509VCB
3ddb07c36b asahi,docs: add PBE to hardware glossary
Signed-off-by: i509VCB <git@i509.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
47337e7918 asahi: Implement draw parameters
This is the easy part, passes the piglits.

---

N.b.: this also includes a bug fix for ARB_base_instance that would be
nontrivial to extract out, so I'm backporting the whole feature for release. How
terrible, more features :-P

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
31f1ef0a79 asahi: Early out for GS + rast discard
Reduces overhead for XFB.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
2129fe30bc asahi: use GS for first-provoking fans
workaround hw bug / missing feature, in a vk compliant way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
e10e21120b asahi: Rotate tri fans based on provoking vtx
I don't have a spec citation for the rotation but it's implied by the GL and VK
specs taken together with piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
5bae4bfc8c asahi: defeature quads
fixes xfb piglits. i am not paid enough to care.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
decd134c0c asahi: fix xfb of pointsize when not drawing points
stupid case.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
9d1a0f11e2 agx: Fix flatshading of matrices
Fixes dEQP-VK.glsl.conversions.scalar_to_matrix.float_to_mat4_vertex

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
9fc23df0d5 asahi: flush before resource transition
otherwise data_valid is not valid! fixes arb_shader_image_load_store-bitcast
and who knows what else.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
e637ccff36 asahi: blit with the old format when transitioning
dest is uncompressed, it can take it. but src is compressed so we don't want to
view. bugfix by inspection

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
9031f04642 asahi: minify when blitting for transition
asahi version of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26077/diffs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
a0485292af asahi: bump glsl version
should work and fixes a buggy test falling over due to missing gpu_shader5

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:37 -04:00
Alyssa Rosenzweig
2ad5bcc41e asahi: fix output to non-rast streams
fixes arb_gpu_shader5-emitstreamvertex_nodraw

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
79e37f7581 asahi: implement xfb stream queries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
0099315edf asahi: fix meta usc builder allocation
otherwise can usc overflow (caught by the usc builder validation :) )

fixes clearbuffer-mixed-format

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
f82264fec0 asahi: return GL_OOM for excessive image sizes
fixes piglit max-texture-size

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
fd91d46487 ail: handle >4GiB textures
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
7a7a3b8847 asahi: defer texture packing to draw-time
needed for correctness with layout transitions.

fixes arb_shader_image_load_store-host-mem-barrier

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
b74d2dcd57 asahi: use 2D descriptors for cubes
fixes arb_shader_image_load_store-invalid case imageLoad/address bounds test/imageCube/rgba32f

this is also better codegen since it avoids the wacko division by 6. although it
creates a div by 6 in imageSize, that's better because that one is much more
likely to hoist to the preamble. probably should've done this from the start.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
86c4a72767 asahi: rm compact image atomic descriptors
these cause robustness problems -- since the target type might not match the
shader for invalid apps -- and are a dubious microoptimization. can revisit
later. for now, fixes imageAtomic*/target mismatch test.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
b13e3adb04 asahi: fix imageSize of null image
Fixes faulting in imageAtomicAdd/unbound image test.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
0cd032e4bb asahi: Be robust with arrays of images
fixes imageLoad/index bounds test subcase.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
b0f4b0a9ef asahi: handle null PBE
fixes some subcases of arb_shader_image_load_store-invalid

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
c73d7d042c asahi: fix dirty tracking fail with point sprites
fixes arb_point_sprite-checkerboard

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
683dac24b2 asahi: be robust about null xfb
fixes arb_enhanced_layouts-transform-feedback-layout-qualifiers tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
3ac44d8c5e asahi: remove bogus assertion
replace with optional debug flag for retaining debugability but getting
conformant behaviour by default. fixes piles of piglit crashes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
e3c528068f asahi: bump limits
fixes gl-3.3-minmax.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
84a8324c55 asahi: handle self blits
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
de6336381b asahi: clamp clear colours
fixes arb_texture_view-rendering-formats_gles3

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
acd095f03d asahi: init clear colour between batches
should be a noop, but safer

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Janne Grunau
2cceacdb8e asahi: Fix typo in arch check in agx_get_gpu_timestamp
Signed-off-by: Janne Grunau <janne-fdr@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
4ff78407f7 asahi: Sync heap size
Hot fix... gpu alloc needs bigger reworks but that's probably not going to
happen until tess is done & we can see the whole picture.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
afb60d7707 asahi: fix index bias with GS/XFB
noticed when bringing up mdi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
45ef977481 asahi: Add extra barrier for texture atomics on G13X
Found experimentally. Fixes
KHR-GLES31.core.texture_buffer.texture_buffer_atomic_functions on G13D.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
376c2697dc asahi: Add more memory barrier opcodes
These are used by the helper program, and at least one experimentally
fixes texture atomics on G13X.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
c507f4a330 asahi: Identify bicubic filtering mode
Officially undocumented but supported by MSL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
58d6374b4c asahi: Identify Primitive ID frag input
With a name from powervr :)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
0cb6a993a8 asahi: Add XML for hw tessellation
AFAICT, there's no way to use this with...

* transform feedback
* geometry shaders
* isolines
* points mode

...so it's not terribly useful to us. But worth knowing it exists.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
2c328f4f8a asahi: Add half float type to genxml
Used with the tessellator.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
3da3b18d0c asahi: Quiet clang warning
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
033bb91468 asahi/decode: Decode multiple macOS commands
We get a CDM+VDM pair for OpenGL tess, decode them all for better r/e.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
1b1a0e0ce7 asahi: Move USC cache flush to agx_batch_init_state
This shouldn't make a difference, but it's cleaner to do it here, since
then we don't have to check whether we have any draws.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
5a9136a0ef asahi: Add extra CDM barrier bit for G13X
I don't know if we need the other bits yet. I'm assuming the logic here
is the same as we used to use for VDM...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Asahi Lina
c20210c643 asahi: Fix CDM Launch/Barrier naming
"Launch" is actually just a barrier, and it seems likely to use the same
bit assignments as in VDM...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Alyssa Rosenzweig
412922ed73 agx: Hotfix for stack_adjust in GS
Spurious, turn this off for now, it's inert rn anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26614>
2023-12-09 10:56:17 -04:00
Rhys Perry
33f4e947d8 vulkan/wsi: fix win32 compilation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Fixes: d7938de8fe ("vulkan/wsi: don't support present with queues where blit is unsupported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26610>
2023-12-09 11:56:32 +00:00
Eric Engestrom
48b410731d freedreno/ci: move hang-y a630 jobs from pre-merge to nightly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26609>
2023-12-09 09:49:56 +00:00
Eric Engestrom
40bdb757af a630/ci: add another flake
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52554248

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26602>
2023-12-09 09:13:23 +00:00
Rhys Perry
d7938de8fe vulkan/wsi: don't support present with queues where blit is unsupported
Since we might have to perform a copy, video and sparse queues cannot be
used to present.

Attempting to create a command buffer on RADV for the sparse binding queue
causes a crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 748b7f80ef ("radv: Move sparse binding into a dedicated queue.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26523>
2023-12-09 07:37:44 +00:00
Qiang Yu
43d83cfcf9 radeonsi: fix legacy merged LS/ES workgroup size for aco compilation
This is for ACO handling of nir_load_local_invocation_index, which will not
add (wave_id * wave_size) if workgroup size <= wave size. So merged shader
LS/ES need to set workgroup size too.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26560>
2023-12-09 06:19:49 +00:00
Marek Olšák
e6b723ccce mesa: fix _mesa_matrix_is_identity
Fixes: d321b1500b - mesa: optimize _mesa_matrix_is_identity

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26599>
2023-12-09 02:08:18 +00:00
Timur Kristóf
8e77da1f21 radv: Implement vkCmdUpdateBuffer on transfer queues.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-09 01:49:13 +00:00
Timur Kristóf
635c81f723 radv: Implement buffer copies on transfer queues.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-09 01:49:13 +00:00
Timur Kristóf
a632024700 radv: Implement vkCmdWriteBufferMarker2AMD on transfer queues.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-09 01:49:13 +00:00
Timur Kristóf
7a4f535145 radv: Implement vkCmdWriteTimestamp2 on transfer queues.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-09 01:49:13 +00:00
Timur Kristóf
32dd77ea2d radv: Implement vkCmdFillBuffer on transfer queues.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-09 01:49:13 +00:00
Timur Kristóf
23590a4e98 radv: Implement barriers for transfer queues.
The current flush flags in RADV don't really match the SDMA HW,
so just always emit a NOP packet, for now.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26580>
2023-12-09 01:49:13 +00:00
Juston Li
4f2b4b81d1 venus: fix query feedback copy sanitize off by 1
Copy sanitization incorrectly included +1 range of the reset.

Eg Reset Query=0 QueryCount=5 is [0,5) exclusive, not [0,5] inclusive.

Fixes: 5b24ab91e4 ("venus: switch to unconditionally deferred query feedback")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26603>
2023-12-09 01:32:05 +00:00
Marek Olšák
57e658d041 radeonsi: rework how guardband registers are updated to decrease overhead
See the code comments.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:28 +00:00
Pierre-Eric Pelloux-Prayer
2e50b6677b radeonsi: update guardband if vs_disables_clipping_viewport changes
Because the guardband state depends on this value.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:28 +00:00
Marek Olšák
2f281b39ab ac/gpu_info: fix printing radeon_info after adding VPE
Fixes: 3ec397819e - amd: add new hardware ip for vpe

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:28 +00:00
Marek Olšák
11fcd58957 radeonsi: convert rasterizer state to tracked registers
Most of these registers don't change, so we should not set them when they
don't. This reworks the rasterizer state to use a custom emit function and
eliminate redundant register changes. This required merging the poly_offset
state into the rasterizer state and change how the poly offset state is
updated.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
cabf927765 radeonsi: convert depth-stencil-alpha state to tracked registers
Some of these registers don't change, so we should not set them when they
don't. This reworks the DSA state to use a custom emit function and
eliminate redundant register changes.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
17e01a9a9b radeonsi: merge context_reg_saved_mask and other_reg_saved_mask into a BITSET
There will be more than 64 context registers that we'll need to track,
so use BITSET for all of them.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
fb994f44d9 util: make BITSET_TEST_RANGE_INSIDE_WORD take a value to compare with
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
6d2a7f53ac radeonsi: decrease NUM_INTERP if export formats/colormask eliminated PS inputs
This adds a pass that removes output stores. It's called before NIR
optimizations that are before PS lowering, which will cause it to remove
PS inputs from register settings.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
bd700bace5 radeonsi: update comments about uniform inlining
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
dbea0f51a3 radeonsi: decrease NUM_INTERP if uniform inlining eliminated PS inputs
This should improve performance when that happens.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
1d4402b02a radeonsi: don't include the PARAM_GEN input in si_shader_info
It's only produced by lowering point smoothing.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
197af03698 radeonsi: add PS input info into si_shader_binary_info
It will be modified to reflect PS inputs after uniform inlining.
For now, it's just a copy of selector->info.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
3faa9ba06b radeonsi: gather lowered color inputs for monolithic PS
This also adds missing io_semantics to the input loads that the gathering
expects.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
94e0a1267e radeonsi: change the signature of si_nir_lower_ps_color_input
This will be needed later.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
7d2faa88ab nir,radeonsi: add FLAGS into load_vector_arg_amd to record color input usage
This will be needed for gathering color usage from lowered PS.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
00dd4d400e ac,radeonsi: rename pos_inputs -> fragcoord_components
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
4f2b794e98 radeonsi: track NIR progress properly for optimizations in si_get_nir_shader
Just a small code size decrease in 12 shaders.

TOTALS FROM AFFECTED SHADERS (12/58918)
  SGPRS: 600.00 -> 600.00 (0.00 %)
  VGPRS: 528.00 -> 520.00 (-1.52 %)
  Spilled SGPRs: 0.00 -> 0.00 (0.00 %)
  Spilled VGPRs: 0.00 -> 0.00 (0.00 %)
  Private memory VGPRs: 0.00 -> 0.00 (0.00 %)
  Scratch size: 0.00 -> 0.00 (0.00 %) dwords per thread
  Code Size: 39772.00 -> 39688.00 (-0.21 %) bytes
  Max Waves: 180.00 -> 180.00 (0.00 %)
  Outputs: 0.00 -> 0.00 (0.00 %)
  Patch Outputs: 0.00 -> 0.00 (0.00 %)

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
e1e35112c8 winsys/amdgpu: bypass GL2 for command buffers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
c77bcf00a3 radeonsi/gfx11: prefer Wave64 for VS/TCS/TES/GS because it's slightly faster
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
257f07f499 radeonsi: clean up how debug flags and shader profiles determine the wave size
- remove DBG_W32_PS_DISCARD
- just return the wave size instead of setting local variables dbg_wave_size
  and profile_wave_size

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
716b521515 radeonsi/gfx11: disable the shader profile for Medical that disables binning
GFX11 performs better with the default behavior.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
f85488824e radeonsi/gfx11: disable the shader profile for Medical that forces Wave64
GFX10 should keep using it, but not GFX11.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
65b3b0b355 radeonsi/gfx11: prefer Wave64 for PS without inputs for better VALU perf
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
48ce5fbaa1 radeonsi: group most vertex element fields
fix_fetch and vertex_buffer_index can't be grouped because we do
memcmp on those arrays

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
7fa0ee15df radeonsi: set OOB_SELECT for VBOs in si_create_vertex_elements
we can do this since the stride is in the CSO now

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
55d81214c9 radeonsi: replace gl_FrontFacing with a constant if one side is always culled
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
1afe6f3321 radeonsi: don't print the preamble state separately for GALLIUM_DDEBUG
because it's always printed as part of command buffers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
9e76459616 radeonsi: execute streamout_begin after cache flushes
so that si_emit_streamout_begin can assume that cache flushes have
finished.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
2022854360 radeonsi/gfx11: skip si_set_streamout_enable because it has no effect
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
bf7debee82 radeonsi: in bind_{blend,rs}_state, only call 1 update function per if
Also don't use "key.ps.part.prolog.color_two_side" during updates
because it would depend on the order the update functions are called,
which is not a problem now, but it's a trap for the future.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
53aa36772a radeonsi: rewrite si_get_total_colormask as si_any_colorbuffer_written
The result is only used as bool.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
e2b817b948 radeonsi: rewrite how shader key bits dependent on current_rast_prim are updated
Don't set do_update_shaders every time current_rast_prim changes, which can
be EVERY DRAW. Instead, just update the shader key bits and set
do_update_shaders only if any bits are different.

When we bind a new rasterizer state, do the same.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
4ab5374ec3 radeonsi: clean up setting poly/line/stipple shader key bits
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
f9c4ac3477 radeonsi: update shaders for rasterizer state only if the shader key changed
Check if any key bit changed before setting do_update_shaders.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
613ea16aab radeonsi: update shaders for blend state only if the shader key changed
Check if any key bit or state changed before setting do_update_shaders.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
c8411ddf17 radeonsi: change the low-priority compiler queue to normal priority
I'm guessing that low priority could cause us to get optimized shaders later
than we need.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
98e7a7123b radeonsi: don't set non-existent VGT_GS_MAX_PRIMS_PER_SUBGROUP on gfx10
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Marek Olšák
f51b960af1 radeonsi/gfx11: fix unaligned SET_CONTEXT_PAIRS_PACKED
It set an invalid register. Luckily it didn't cause any issues.

Fixes: 2ac6816b70 - radeonsi/gfx11: use SET_CONTEXT_REG_PAIRS_PACKED for other states

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26307>
2023-12-09 00:05:27 +00:00
Paulo Zanoni
af65af8267 intel/tools: fix compilation of intel_hang_viewer on 32 bits
Because gcc was complaining:

../../src/intel/tools/intel_hang_viewer.cpp: In function ‘void display_hang_stats()’:
../../src/intel/tools/intel_hang_viewer.cpp:365:31: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘std::vector<hang_bo>::size_type’ {aka ‘unsigned int’} [-Werror=format=]
  365 |    ImGui::Text("BOs:        %lu", context.bos.size());
      |                             ~~^   ~~~~~~~~~~~~~~~~~~
      |                               |                   |
      |                               long unsigned int   std::vector<hang_bo>::size_type {aka unsigned int}
      |                             %u
../../src/intel/tools/intel_hang_viewer.cpp:366:31: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘std::vector<hang_exec>::size_type’ {aka ‘unsigned int’} [-Werror=format=]
  366 |    ImGui::Text("Execs       %lu", context.execs.size());
      |                             ~~^   ~~~~~~~~~~~~~~~~~~~~
      |                               |                     |
      |                               long unsigned int     std::vector<hang_exec>::size_type {aka unsigned int}
      |                             %u
../../src/intel/tools/intel_hang_viewer.cpp:367:31: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘std::vector<hang_map>::size_type’ {aka ‘unsigned int’} [-Werror=format=]
  367 |    ImGui::Text("Maps:       %lu", context.maps.size());
      |                             ~~^   ~~~~~~~~~~~~~~~~~~~
      |                               |                    |
      |                               long unsigned int    std::vector<hang_map>::size_type {aka unsigned int}
      |                             %u
cc1plus: some warnings being treated as errors

I'm not sure if STL's size_type is defined by the spec to be anything
specific, but for the platforms we care about it seems to be size_t,
so change it to %z.

Fixes: 33fd93f3b1 ("intel/tools: hang viewer/editor")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26581>
2023-12-08 22:53:03 +00:00
Eric Engestrom
b0ad9995d6 v3dv/ci: only trigger on relevant changes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26597>
2023-12-08 22:19:50 +00:00
Matt Turner
6d2be84672 ci/lava: Add firmware-misc-nonfree on amd64
Hopefully this provides the GuC firmware files we need for testing on
Intel ADL+ boards.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9841
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25792>
2023-12-08 21:25:12 +00:00
Rob Clark
2132f95de0 freedreno/a6xx: Fix NV12+UBWC import
Treat R8_G8B8_420_UNORM and NV12 the same, because dri2 frontend doesn't
understand or care about the difference from the sampler PoV.

Fixes: 1e820ac128 ("freedreno: Rework supported-modifiers handling")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26601>
2023-12-08 21:06:05 +00:00
Sagar Ghuge
708d4f59f8 anv: Use RCS cmd buffer if blit src/dest has 3 components
The Blitter engine lacks support for 3 components color format so we can
just fallback to RCS companion command buffer for the blit operation.

Even though blitter supports 96-bit support it only supports linear
tiling. We can support other types of tiling by falling back to the RCS
companion command buffer.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26300>
2023-12-08 20:44:03 +00:00
Ian Romanick
87cdcbd7d7 intel/compiler: Verify that DO is alone in the block
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26439>
2023-12-08 20:21:28 +00:00
Ian Romanick
65237f8bbc intel/fs: Don't add MOV instructions to DO blocks in combine constants
There was a subtle bug related to CFG tracking. Namely, some branch
instructions may point *only* to the block after the DO instruction
for the loop. If the MOV instructions are in the DO block, the may not
have liveness properly tracked.

Like in !25132, having the MOV instructions in blocks that might
contain other instructions helps scheduling.

shader-db:

All Broadwell and newer Intel GPUs had similar results (Ice Lake shown)
total cycles in shared programs: 848577248 -> 848557268 (<.01%)
cycles in affected programs: 78256396 -> 78236416 (-0.03%)
helped: 361 / HURT: 18

fossil-db:

All Skylake and newer Intel GPUs had similar results (Ice Lake shown)
Totals:
Cycles: 15021501924 -> 15021372904 (-0.00%); split: -0.00%, +0.00%

Totals from 735 (0.11% of 656080) affected shaders:
Cycles: 676429502 -> 676300482 (-0.02%); split: -0.02%, +0.00%

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26439>
2023-12-08 20:21:28 +00:00
Sil Vilerino
23f07f4942 d3d12: Check video encode codec cap before checking encode profile/level cap
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26598>
2023-12-08 20:04:49 +00:00
Timur Kristóf
1c8c3e5a7a radv: Don't retile DCC on transfer queues.
Instead, the retile will be executed on another queue type
when the image is transitioned to another queue.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25834>
2023-12-08 14:46:17 +00:00
Timur Kristóf
5c30d462b9 radv: Disable HTILE on exclusive images with transfer queues when SDMA doesn't support it.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25834>
2023-12-08 14:46:17 +00:00
Timur Kristóf
1764259ba8 radv: Disable DCC on exclusive images with transfer queue when SDMA doesn't support it.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25834>
2023-12-08 14:46:17 +00:00
Timur Kristóf
89a6b08cba radv: disable HTILE/DCC for concurrent images with transfer queue if unsupported.
DCC and HTILE are only supported by SDMA on GFX10+ (unless disabled by a workaround).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25834>
2023-12-08 14:46:16 +00:00
Chia-I Wu
ad6b6673be radv: convert a check in radv_get_memory_fd to assert
VUID-VkBindImageMemoryInfo-memory-02628 and
VUID-VkBindImageMemoryInfo-memory-02629 make sure the memory offset is 0
for dedicated allocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25964>
2023-12-08 14:21:42 +00:00
Chia-I Wu
8aa62ba240 radv: fix asserts for radv_init_metadata
radv_init_metadata hits several assert failures when the image is
multi-planar.  Make sure we use plane 0.

This change should make no difference in practice.  Also, this is done
only to follow radeonsi.  Since the opaque metadata is mainly for
validations and DCC, and we don't enable DCC for multi-planar images, we
probably don't need to call radv_query_opaque_metadata at all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25964>
2023-12-08 14:21:42 +00:00
Chia-I Wu
035cf7ab97 radv: fix a typo in radv_image_view_make_descriptor
Only GFX8 and before have legacy_surf_level.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25964>
2023-12-08 14:21:42 +00:00
Chia-I Wu
07f575a8a6 radv: fix VkSubresourceLayout2KHR for multi-planar formats with modifiers
Memory planes and format planes are equivalent for multi-planar formats
with modifiers.  Do not return the DCC info of plane 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25964>
2023-12-08 14:21:42 +00:00
Chia-I Wu
8f60ccf969 radv: fix VkDrmFormatModifierProperties2EXT for multi-planar formats
Do not report DCC modifiers for multi-planar formats.  We don't support
DCC for them and drmFormatModifierPlaneCount had incorrect values.

Fix vkGetImageSubresourceLayout for multi-planar images with modifiers.
In that case, memory planes and format planes are equivalent.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25964>
2023-12-08 14:21:42 +00:00
Samuel Pitoiset
90dda31901 radv: simplify disabling MRT compaction for PS epilogs
If the fragment shader isn't compiled, the PS epilog key isn't used
at all with GPL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26563>
2023-12-08 13:52:40 +00:00
Samuel Pitoiset
0cf00390c5 ci: uprev vkd3d-proton to a0ccc383937903f4ca0997ce53e41ccce7f2f2ec
To cover DGC mesh shaders which are only tested as part of vkd3d-proton.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26590>
2023-12-08 11:14:22 +00:00
Yonggang Luo
5bf68ab701 osmesa: Make osmesa.h compatible with Windows SDK's GL.h
For glext.h and glcorearb.h, it's already use 'APIENTRY', so for the osmesa.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26561>
2023-12-08 09:55:54 +00:00
Dave Airlie
10db6948da nvk/nak: fix regression with shf changes on sm70
This commit nak: implement SHL and SHR on SM50 caused a regression on
KHR-GL45.gpu_shader_fp64.* using zink.

This fixes the regression, by setting the wrap fields.

Fixes: 00be041ffc ("nak: implement SHL and SHR on SM50")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26586>
2023-12-08 05:30:09 +00:00
Marek Olšák
64b769a102 glthread: add a string table of function names
for printing glthread batches

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
adfab9794e mesa: deduplicate glVertexPointer and glNormalPointer vs DSA error checking
Regular and direct state access functions did the same thing. The new
functions will be used later.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
3a74cdcd91 glthread: pass struct marshal_cmd_DrawElementsUserBuf into Draw directly
Pass the whole structure directly instead of as separate parameters.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
98e42c6efb glapi: only allow deprecated="" on non-aliased functions
Merging deprecated="" of aliased and real functions isn't completely
predictable. The function (real or aliased) that's defined last overwrites
attributes of its alias defined before it.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
61e19c53e7 glthread: don't do "if (COMPAT)" if the function is not in the GL core profile
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
a3992379cb glapi: only expose GL_EXT_direct_state_access functions to GL compatibility
The extension is only exposed in GL compatibility.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
666d53214a glthread: rework type reduction and reduce vertex stride params to 16 bits
- add get_marshal_type(), which reduces type sizes
- rework all places to use the result of get_marshal_type()

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
162c890614 glthread: use autogenerated marshal structures for custom functions
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
e9d08bb043 glapi: rename primcount -> instance_count in a few Draw functions
In order to match the marshal structures we already have in the tree.
The next commit will depend on this.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
a02ed8a95f glthread: add option to put autogenerated marshal structures in the header file
This is used when we want to be able to read the calls of autogenerated
functions, or when we want to use the default structure for our custom
marshal functions.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:52 +00:00
Marek Olšák
bdb771b27c glthread: eliminate push/pop calls in PushMatrix+Draw/MultMatrixf+PopMatrix
Viewperf benefits. This implements glPushMatrix marshalling manually and
looks ahead in the unmarshal function what the following calls are.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:51 +00:00
Marek Olšák
c3b95d1507 glthread: add a marker at the end of batches indicating the end
Unmarshal calls that "look ahead" in the batch will use it.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:51 +00:00
Marek Olšák
5af047d40a mesa: optimize setting the identity matrix
instead of memcpy from a static mutable place ("const" doesn't help
anything here), just set the values directly

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:51 +00:00
Marek Olšák
5fb106c253 mesa: skip checking for identity matrix in glMultMatrixf with glthread
glMultMatrixf was doing it. glMatrixMultfEXT is the other user of
matrix_mult that needs to do it before we can skip it here.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:51 +00:00
Marek Olšák
d321b1500b mesa: optimize _mesa_matrix_is_identity
+5% performance in VP13/Sw/teslaTower_shaded

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26548>
2023-12-08 04:25:51 +00:00
Yiwei Zhang
d17ddcc847 venus: dispatch background shader tasks to secondary ring
Summary:
- Add a perf option to force primary ring submission
- Let device own secondary ring(s) for ad-hoc spawn
- For threads where swapchain and command pool are created, track with
  TLS to instruct ring dispatch.
- If the pipeline creation or cache retrieval happens on the background
  threads not on the hot paths, force synchronous and dispatch to the
  secondary ring after waiting for primary ring becoming current.
- If the pipeline creation or cache retrieval happens on the hot paths
  threads, dispatch to the primary ring to avoid being blocked by those
  tasks on the secondary ring.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
5b26bebcf4 venus: add vn_gettid helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
b170c1a391 venus: switch to vn_ring as the protocol interface - part 3
Sync protocol and fix all the interfaces, otherwise we have to generate
two sets of headers with both interfaces to separate protocol sync and
the driver side adaptation.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
5943f70c7a venus: switch to vn_ring as the protocol interface - part 2
Use instance ring as the primary ring of a logical device.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
d28ebf7b99 venus: switch to vn_ring as the protocol interface - part 1
No functional change but just preparations for switching instance
to ring to interface with the venus protocol headers.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
a0ef347a82 venus: add vn_ring_get_id and hide vn_ring internals entirely
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
9e38c74139 venus: move the actual ring creation into ring as well
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
c779fc9fb1 venus: move ring submission into ring
At first, no behavior change in this CL.

The instance level helper for normal command submission is left to work
with the current venus protocol. Meanwhile, we leave the helper to
submit recorded command buffer inside instance to it can later redirect
to the primary ring.

We've internalized a few ring helpers that no longer need to be exposed.
Besides, indirect submission decision is on per-ring basis since the
ring buffer can vary later.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
9229c13a2c venus: move the rest ring belongings into ring
This change only moves the fields without changing the accessors. It's
better to let ring own its own upload cs encoder (which is backed by
shmem array) to avoid lock contention between indirect submissions
across rings.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
d1e29b7557 venus: move ring shmem into vn_ring
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
3e122014cf venus: relax ring mutex
Now we are able to break up the original lock to allow shmem alloc to be
outside the ring mutex, as long as the reply shmem set is still coupled
with ring submission.

Add and expose vn_instance_reply_shmem_alloc helper which will be used
by rings separately later.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
b98d850efd venus: remove command_dropped tracking
The encoder must not be empty by then so switch to an assert. Failing to
get a reply shmem would end up with VK_ERROR_OUT_OF_HOST_MEMORY, thus
there's no need to track either.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
90e64564b8 venus: make vn_renderer_shmem_pool thread-safe
This can be thread-safe only because we have dropped seeking command
stream offset, which requires comparing pool shmem to decide conditional
set stream.

This is to prepare for later sharing reply shmem pool across rings.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
0273c9cc03 venus: always set reply command stream to avoid seek
More considerations and details here:
- The seek is a bit lighter than set, since it assumes renderer side
  resource being immutable. It does affect perf when Venus is still
  making verbose synchronous calls at runtime (e.g. descriptor set,
  buffer, device memory, etc).
- Seek still requires lock protection as the reply shmem must be
  immutable before the seek and the followed cmd are committed to the
  ring.
- Removing seek without doing set requires renderer change to always
  bump the encoder end position according to what the original request
  is instead of being ad-hoc upon what the host driver tells to write.
  The overhead and extra complexity there isn't negligible.
- Further, removing seek requires each ring to track the prior reply
  pool shmem in the multi-ring scenario. While the additional host side
  resource lookup isn't costy as the number of resources is must less
  than the vk object table.
- The nice thing is that we can make shmem pool thead safe to be more
  easily shared across rings.

So we just drop it.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
70e8d1397e venus: further cleanup vn_relax_init to take instance instead of ring
For multi-ring, later we can just check primary ring alive status.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
f6adc60822 venus: refactor to add vn_watchdog
Summary:
- cleanup redundant report_period_us check post 1.0 release
- add vn_watchdog and its accessors
  - vn_watchdog_init
  - vn_watchdog_fini
  - vn_watchdog_acquire
  - vn_watchdog_release
  - vn_watchdog_timeout

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
d8b059b01b venus: move ring monitor to instance for sharing across rings
Later we will base off just the primary ring alive status.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
22b5c9c65f venus: refactor instance creation failure path
Make fail path more precise and slightly adjust cs_shmem to sit together
with reply shmem pool.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
26e20eb12c venus: add vn_instance_fini_ring helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
2cdab2c25d venus: use instance allocator for indirect cs storage alloc
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
ec131c6e55 venus: use instance allocator for ring allocs
and some nice to have refactors

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
15c7e7743e venus: add ring helper to avoid redundant ring wait requests
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
891d3fb2db venus: enable renderer shmem cache dump for cache debug
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
34c9864318 venus: use STACK_ARRAY to prepare for indirect submission
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
60e0af9661 venus: reduce ring idle timeout from 50ms to 5ms
The ring wake up is no longer costy as the other notifies followed by
the initial call won't be blocked by ring cmd execution anymore
(without vkr side big context lock). Reducing the timeout can help cpu
bound scenarios.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
9c9e097585 venus: add missing shmem pool fini for cs_shmem pool
This is missed from the fail path. No need to backport since there's
nothing leaked from this yet.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
8ac7d78bf3 venus: properly initialize ring monitor initial alive status
This avoids a potential race condition if two threads are competing for
the monitor with the initial states, and the losing one may run into
alive status being false and abort.

Fixes: 4a4b05869a ("venus: check and configure new ringMonitoring feature")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reported-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:37 +00:00
Yiwei Zhang
aed4c4d04e venus: fix async compute pipeline creation
Fixes: a771efdefe ("venus: Enable VK_EXT_pipeline_creation_cache_control")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
2023-12-08 04:06:36 +00:00
Dave Airlie
55e0aced28 nvk: drop unneeded shader type conversion function
This is both pointless now and not used anywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26583>
2023-12-08 12:27:18 +10:00
Kenneth Graunke
a7b054c974 anv: Don't report more memory available than the heap size
When calculating the system memory heap size, we report only 3/4 of
the total RAM size (or 1/2 for systems with less than 4GB of RAM).

In the memory budget extension query, we were reporting 90% of the
available system memory.  If most of the memory in the system is free,
this could result in the total heap size being 3/4 of RAM, but the
memory available being 9/10 of RAM.  But if the application tried to
allocate the memory reported as "available", it would exceed the heap
size.  This can confuse some applications.

This patch makes the memory budget query clamp the available RAM to
the heap size, so it will never report more available than the heap
can provide.  Unfortunately, this means that we'll report only 67.5%
of system memory as available (3/4 * 9/10).  We may want to adjust
this estimate in the future.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26553>
2023-12-07 15:12:38 -08:00
Kenneth Graunke
029b1d3f26 anv: Drop 3/4 of PPGTT size restriction for sys heap size calculation
This was mainly useful for older Gen7.x GPUs with 32-bit PPGTT, which
are now supported by hasvk rather than anv.  The remaining platforms
which anv supports have 36, 47, or 48-bit PPGTT, which imposes a 3/4
limit of 48GB, 96TB, and 192TB of memory.

The GPUs with 36-bit PPGTT are Elkhart Lake and Jasper Lake, which
appear to be Atom CPUs that have a maximum supported memory
configuration of 32GB or less, so this limit should not matter there.
Nor is a multi-TB limit likely to matter on our other parts.

Drop this check to simplify the heap and memory budget calculations.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26553>
2023-12-07 15:12:35 -08:00
Faith Ekstrand
3bb4c14c75 nak: Rework barrier handling a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26577>
2023-12-07 22:44:36 +00:00
Thomas H.P. Andersen
eafc8f58c6 nouveau: drop unused #includes of tgsi_parse.h
The use of these includes was dropped. No need to keep these around

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26339>
2023-12-07 22:29:09 +00:00
David Heidelberg
0ea6e17130 ci: bump kernel to 6.6.4
Let's move to current LTS kernel.

Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26551>
2023-12-07 21:35:53 +00:00
Konstantin Seurer
4ac8d16006 nvk: Do not preserve metadata after lower_load_global_constant_offset_instr
The pass inserts control flow.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Konstantin Seurer
99fdd98b3f drm-shim/nouveau: Stub mitting ioctls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Konstantin Seurer
17bfaeac15 drm-shim/nouveau: Expose the 2D engine on NV50+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Konstantin Seurer
3b0c34075c drm-shim/nouveau: Set nv_device_info_v0::platform
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26366>
2023-12-07 21:20:21 +00:00
Dave Airlie
45eaf6c002 nvk/nak/xfb: handle skipping properly when setting xfb_attr.
The code treated 0x00 and 0xff the same, but they aren't,
port over the codegen code.

Fixes GTF-GL45.gtf40.GL3Tests.transform_feedback3.transform_feedback3_skip_components
with zink on nvk

v2: drop padding to 0, tests still pass.

Fixes: 30f01c47c2 ("nak: Translate XFB info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26559>
2023-12-07 21:05:12 +00:00
Faith Ekstrand
6b1f3884c3 nak: Clean up instruction printing a bit
When we can do it in one line I like the little if else pattern for
single-bit modifiers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
f5869d1c5b nak: Audit sm50 for FTZ/DNZ bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
22aab2ccba nak: Audit remaining FTZ/DNZ bits on sm70+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
5bfb46a735 nak: Add dnz bits to OpFMul and OpFFma
Also, while we're here, clean up the from_nir code a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
97a59ded43 nak: Plumb through float controls for frnd[p]
Fixes: 1c84c8183c ("nak: Plumb through float controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Faith Ekstrand
e179a90356 nak: Plumb through float controls for fset[p]
Fixes: 1c84c8183c ("nak: Plumb through float controls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26572>
2023-12-07 20:49:40 +00:00
Dave Airlie
1b27a6be20 nvk: fix transform feedback with multiple saved counters.
The SET_STREAM_OUT_BUFFER_LOAD_WRITE_POINTER registers have an
8 dword stride, but the code is only adding one dword between them
then the MME is calling an illegal method.

This is the simple fix, otherwise I think we'd have to multiply
somehow in the MME which seems pointless.

Fixes KHR-GL45.transform_feedback* on zink on nvk.

Fixes: 5fd7df4aa2 ("nvk: Support for vertex shader transform feedback")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26558>
2023-12-07 20:17:13 +00:00
Eric Engestrom
40c82b5f67 vk/update-aliases.py: only apply renames for the vulkan api (not vulkansc)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
1b3fca1708 vk/update-aliases.py: enforce correct list order
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
2cf22af0a7 vk/update-aliases.py: handle more concatenated prefixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
04517193c5 vk/update-aliases.py: simplify addition of other concatenated prefixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
3fe90f2957 vk/update-aliases.py: sort files when informing the user of the matches
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
d8b38ec4a3 vk/update-aliases.py: handle "no match" grep call
This was not necessary before because there was always at least the
vk.xml file itself in the `src/` search path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:00 +00:00
Eric Engestrom
c6ebf9d643 vk/update-aliases.py: allow specifying the files we want to update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:00 +00:00
Eric Engestrom
e988b1975b vk/update-aliases.py: drop dead --check-only
This was introduced for when it was intended for this script to run as
part of the build tests, but that was dropped, and so should this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:00 +00:00
Juston Li
dc7c1d989b radv: enable stippledBresenhamLines on GFX9 chips
This isn't supposed to work nor does it match radeonsi but setting
AUTO_RESET_CNTL=0 by default for GFX9 chips is what gets it passing
linestrip CTS tests:

dEQP-VK.rasterization.primitives.dynamic_stipple.bresenham_line_strip
dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip
dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip_wide
dEQP-VK.rasterization.primitives.static_stipple.bresenham_line_strip

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24623>
2023-12-07 19:10:15 +00:00
Eric Engestrom
7301327f9c broadcom/ci: avoid running the rpi4 jobs when changing the rpi3 expectations, and vice-versa
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26256>
2023-12-07 18:44:03 +00:00
Eric Engestrom
fa36b087c7 etnaviv/ci: run only the relevant jobs when changing the ci expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26281>
2023-12-07 18:26:35 +00:00
Eric Engestrom
6df0968ff4 etnaviv/ci: expand first level of files in src/etnaviv/
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26281>
2023-12-07 18:26:35 +00:00
Eric Engestrom
185315590e etnaviv/ci: fix yaml indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26281>
2023-12-07 18:26:35 +00:00
Sil Vilerino
fc69d65a4e frontends/va: Parse enc_constraint_set_flags from packed SPS
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>

(Reviewed in PR !26556 as well)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26573>
2023-12-07 17:55:16 +00:00
Sil Vilerino
32667f78ab d3d12: Use enc_constraint_set_flags for H264 NALU writing
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26573>
2023-12-07 17:55:16 +00:00
Sil Vilerino
bfad3617a9 d3d12: Fix typos in d3d12_video_encoder_bitstream_builder_h264
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26573>
2023-12-07 17:55:16 +00:00
Sil Vilerino
096e17b578 d3d12: Fix AV1 video encode 32 bits build
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26573>
2023-12-07 17:55:16 +00:00
Yonggang Luo
e5ebd59dd5 broadcom: remove unused headers include
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26571>
2023-12-07 17:22:47 +00:00
Yonggang Luo
35133551e1 broadcom/compiler: remove unused blend in v3d_fs_key
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26571>
2023-12-07 17:22:47 +00:00
Sil Vilerino
65ab022499 d3d12: Fix usage of H264/HEVC specific classes when VIDEO_CODEC_H26XENC not set
Fixes: 8af080cec4 ("d3d12: Implement d3d12_video_encoder_get_encode_headers for out of band VPS, SPS, PPS")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26566>
2023-12-07 17:05:37 +00:00
Yonggang Luo
575c4f6802 broadcom/compiler: Use correct type pipe_logicop for logicop_func in struct v3d_fs_key
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26570>
2023-12-07 16:36:50 +00:00
Yonggang Luo
0eaf200974 v3dv: Use correct type VkStencilOp in function translate_stencil_op
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26570>
2023-12-07 16:36:50 +00:00
Faith Ekstrand
61dd82ccab nvk: Advertise VK_KHR_shader_float_controls
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9605
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26557>
2023-12-07 16:21:14 +00:00
Faith Ekstrand
1c84c8183c nak: Plumb through float controls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26557>
2023-12-07 16:21:14 +00:00
Faith Ekstrand
29bfdcd7c1 nak: Add an ftz bit to a bunch of float ops
Specifically, OpFAdd, FFma, FMnMx, FMul, and FSwzAdd

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26557>
2023-12-07 16:21:14 +00:00
Faith Ekstrand
6881ff4c99 nak: Drop the fmnmx from Builder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26557>
2023-12-07 16:21:14 +00:00
Faith Ekstrand
00b2564163 nak/nvfuzz: Add an SM parameter
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26557>
2023-12-07 16:21:14 +00:00
Dave Airlie
884da2622c nvk/nil: allow storage on VK_FORMAT_A2B10G10R10_UINT_PACK32
Fixes:
KHR-GL45.shader_image_load_store.basic-allFormats*
with zink

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26536>
2023-12-07 15:35:14 +00:00
Rohan Garg
db6aaa691d intel/compiler: infer the number of operands using lsc_op_num_data_values
nir_emit_global_atomic should utilize lsc_op_num_data_values to
infer the number of operands for global atomic ops, following the same
pattern as nir_emit_surface_atomic

Fixes: 90a2137 ('intel/compiler: Use LSC opcode enum rather than legacy BRW_AOPs')
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26432>
2023-12-07 14:40:24 +00:00
Rohan Garg
46d98a71ef intel/compiler: use the proper enum type to store the op
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26432>
2023-12-07 14:40:24 +00:00
José Roberto de Souza
6d42333b16 intel/genxml/xe2: Update PIPELINE_SELECT
'Media Sampler DOP Clock Gate Enable' and 'Force Media Awake' don't
exist anymore.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26403>
2023-12-07 14:16:18 +00:00
José Roberto de Souza
9898c719a2 intel/genxml/xe2: Update PIPE_CONTROL
'Tile Cache Flush Enable' and 'Generic Media State Clear' are now
reserved bits in gfx20+.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26403>
2023-12-07 14:16:18 +00:00
Tapani Pälli
8e57ba092d mesa: lower EXT_render_snorm version requirement
Requirement was lowered in the extension spec:
https://github.com/KhronosGroup/OpenGL-Registry/pull/596

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26500>
2023-12-07 13:37:11 +00:00
Yonggang Luo
8913cf6f7d docs: Generate document with utf8 encoding
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26515>
2023-12-07 12:41:07 +00:00
Yonggang Luo
e499253966 zink: Generate source file with utf-8 encoding from mako template
Make them generated in consistent way

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26515>
2023-12-07 12:41:07 +00:00
Yonggang Luo
36480b4d02 intel: Generate source file with utf-8 encoding from mako template
Make them generated in consistent way

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26515>
2023-12-07 12:41:07 +00:00
Yonggang Luo
e7c614bd20 util,vulkan,mesa,compiler: Generate source files with utf8 encoding from mako template
This is for fixes the following error:
FAILED: src/vulkan/runtime/vk_synchronization_helpers.c src/vulkan/runtime/vk_synchronization_helpers.h
"C:\CI-Tools\msys64\mingw64\bin/python3.EXE" "../../src/vulkan/util/vk_synchronization_helpers_gen.py" "--xml" "../../src/vulkan/registry/vk.xml" "--out-c" "src/vulkan/runtime/vk_synchronization_helpers.c" "--beta" "false"

Traceback (most recent call last):
  File "C:/work/xemu/mesa/src/vulkan/util/vk_synchronization_helpers_gen.py", line 213, in main
    f.write(TEMPLATE_C.render(**environment))
UnicodeEncodeError: 'gbk' codec can't encode character '\xa9' in position 15: illegal multibyte sequence

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26515>
2023-12-07 12:41:07 +00:00
Tatsuyuki Ishi
9b2b790ea3 radv: Enable radv_legacy_sparse_binding for DOOM Eternal.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10234
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26464>
2023-12-07 11:40:38 +00:00
Tatsuyuki Ishi
b2e8095d6d radv: Add workaround to allow sparse binding on gfx queues.
For working around improper usage of sparse in DOOM Eternal.

When fully explicit sync sparse binding is implemented, this path will
remain implicit sync to also deal with the improper semaphore usage.
radv_queue_submit_bind_sparse_memory will likely get a bool parameter to
control explicit / implicit sync in that case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26464>
2023-12-07 11:40:38 +00:00
Eric Engestrom
c1229db1a8 docs/calendar: add 24.0 branchpoint and release schedule
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26406>
2023-12-07 10:31:54 +00:00
Eric Engestrom
adc44bbb20 intel/ci: run only the relevant jobs when changing the ci expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26279>
2023-12-07 09:59:39 +00:00
Eric Engestrom
c56237e477 intel/ci: hasvk changes should only trigger hasvk jobs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26279>
2023-12-07 09:59:39 +00:00
Eric Engestrom
fb5294717c intel/ci: anv changes should only trigger anv jobs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26279>
2023-12-07 09:59:39 +00:00
Eric Engestrom
0963d0b135 intel/ci: expand first level of common intel files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26279>
2023-12-07 09:59:39 +00:00
Eric Engestrom
a3077cdcba intel/ci: deduplicate common intel files rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26279>
2023-12-07 09:59:39 +00:00
Eric Engestrom
5ccc898276 intel/ci: fix yaml indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26279>
2023-12-07 09:59:39 +00:00
Eric Engestrom
dc69c5b323 freedreno/ci: run only the relevant jobs when changing the ci expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26280>
2023-12-07 09:37:25 +00:00
Eric Engestrom
60df7b6768 freedreno/ci: fix yaml indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26280>
2023-12-07 09:37:25 +00:00
Eric Engestrom
e8193956e2 panfrost/ci: run only the relevant jobs when changing the ci expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26257>
2023-12-07 09:21:11 +00:00
Eric Engestrom
fad164a06e panfrost/ci: fix yaml indendation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26257>
2023-12-07 09:21:10 +00:00
Pierre-Eric Pelloux-Prayer
1a99f50c7f radeonsi: use a compute shader to convert unsupported indices format
This commit replace the CPU-conversion of ubyte to ushort by a compute shader.
The benefits are:
* we don't need to sync anymore
* we can allocate the index buffer in VRAM (no need to CPU map it)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10195
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26416>
2023-12-07 08:42:19 +00:00
Eric Engestrom
5bdb42b1a2 zink/ci: run only the relevant jobs when changing the ci expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26258>
2023-12-07 07:55:13 +00:00
Eric Engestrom
428ca69ba9 zink/ci: expand first (and only) level of folders in the list of files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26258>
2023-12-07 07:55:13 +00:00
Eric Engestrom
e39785f6c6 zink/ci: use variable to avoid repeating the list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26258>
2023-12-07 07:55:13 +00:00
Eric Engestrom
b36338a3f4 zink/ci: fix yaml indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26258>
2023-12-07 07:55:12 +00:00
Eric Engestrom
d971e3ba45 ci: fix rules for formatting checks
Fixes: 70eff58767 ("ci: allow hw jobs even if lint jobs fail for non-Marge pipelines")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26511>
2023-12-07 07:27:11 +00:00
Timothy Arceri
72ad0db505 glsl: remove now unused GLSL IR block linker
This is now done in the NIR linker instead.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26534>
2023-12-07 03:05:10 +00:00
Timothy Arceri
32f274768e glsl: use new nir based block linker
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26534>
2023-12-07 03:05:10 +00:00
Timothy Arceri
0c6272f97f glsl: support glsl linking in nir block linker
This added support for names and some extra validation that the
spirv linker does not require.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26534>
2023-12-07 03:05:10 +00:00
Timothy Arceri
c468aa6059 nir: add nir_fixup_deref_types()
This will be used to fix up types after arrays have been resized.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26534>
2023-12-07 03:05:09 +00:00
Yonggang Luo
72e30c8853 treewide: Avoid use align as variable, replace it with other names
align is a function and when we want use it, the align variable will shadow it
So replace it with other names

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25997>
2023-12-07 02:30:53 +00:00
Yonggang Luo
adf81143a1 clover: Rename function align to align_vector to avoid conflict with global align
align is a global function, do not conflict with it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25997>
2023-12-07 02:30:53 +00:00
Yonggang Luo
0f5688eb2c intel: Remove unused ALIGN macro
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25997>
2023-12-07 02:30:53 +00:00
Yonggang Luo
ff306c5f8c meson/win32: There is no need install OpenGL headers on win32
The libraries that use OpenGL already handling the non-exist of OpenGL headers for both
MSVC and MINGW, so there is no need install them

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14019>
2023-12-07 00:58:25 +00:00
Faith Ekstrand
112900075b nak: Add barriers on Volta
The warp barriers go back to SM70, not SM75.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
186baba000 nak: Clean up compiler warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
ad89613dc4 nak: implement VOTE on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
8fd7ee2a4f nak: implement SHFL on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
2d63f3dad6 nak: encode Dst::None as RZ on SM50
This case came up when testing VOTE, but likely occurs elsewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
ebfd651361 nak: implement IMUL for SM50
IMAD64 does not exist on SM50, so we're using IMUL instead for
nir_op_{i,u}mul_high and nir_op{i,u}mul_2x32_64. Longer-term we may want
to replace this with XMAD for better perf.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
00be041ffc nak: implement SHL and SHR on SM50
SHF.{L,R} is supported, but it seems to always write 0 to dst when the
shift value is a register. The only case in nak_from_nir that actually
uses the 64-bit shift is nir_op_isign, which has an immediate shift
value.

This also avoids the SHF.I32 issue, since the only usage is now SHF.I64.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
286b832f74 nak: make as_imm_not_{i,f}20 helper methods public
These are useful for SM50 legalize, which is in a different module.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Mary Guillemard
cb3263560f nak: sm50: Implement FFMA
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
f02b2866bc nak/sm50: Drop src_mod_has* in favor of core helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
89f727b1bd nak/sm50: remove *fmod* calls from iabs
I see no mention of NOT and ABS in codegen's encoding for I2I

Also, this is an integer instruction, so calling into the float
helpers seem wrong.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
546edfde83 nak/sm50: remove ALUSrc and friends
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
592d8fa436 nak: sm50: remove encode_alu() and friends
This method was too complex. Remove it as we have now rewritten all other
methods not to rely on it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
f32c560e82 nak: sm50: rewrite encode_prmt to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
63c85c9cf7 nak: sm50: rewrite encode_popc to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
78efdf9755 nak: convert encode_imad to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
04d4f1b512 nak: sm50: rewrite encode_f2f to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
cb9318b8ef nak: sm50: convert i2f to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
bfb091e227 nak: sm50: convert sel to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
2adf5a3437 nak: sm50: rewrite iabs to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
9f34a3c61d nak: sm50: rewrite fset to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
3ab0cea646 nak: sm50: rewrite fmul to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
b7bc6cebaa nak: sm50: Rewrite fmnmx to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
01c7f16755 nak: sm50: rewrite fsetp to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
4b8a8b2a28 nak: use carry register file for IADD2
This allows detecting dependencies between IADD.X and IADD.CC, which is
necessary for SM50 sched and DCE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
9d6c487a75 nak: move iadd64 construction to a builder method
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
6323cae9f9 nak: add carry register file
There is only one carry-register, so representing it as a register file
is a little weird, but it makes calculating instruction deps simpler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
1ae43d2606 nak/sm50: Stop using ALUSrc for IADD2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
998c470f58 nak/sm50: Add better helpers for encoding sources with modifiers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
43160df14e nak/sm50: rewrite encode_iadd2 to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
e5d70d303f nak: Drop the SM50 encoding of BREV
We should add an OpBfe instead of this mess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
a1af8129a6 nak/sm50: Rewrite the encoding for OpMov
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
0adb7c52f8 nak: Implement FS input interpolation on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
bdf0c300e1 nak/sm50: Rewrite the encoding for OpIMnMx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
20176035f6 nak: Rewrite the SM50 encoding of OpF2I
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
426b27ef04 nak/sm50: Wire up tex ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
bb41f2815f nak/nv50: Rewrite the encoding of OpShf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
08ac17789b nak: Rework nvfuzz for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
899c58606d nak: Only split texture destinations on Volta+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
c57bf36c0a nak: Add SM50 encodings for ALD and AST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
08cab9a57e nak: add ATOM{G,S} encoding for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
cd7ac4b0c5 nak: implement ST* and LD* on SM50
LDG was previously encoded, but the opcode and field offsets were incorrect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
8a82f426a2 nak: add IADD instruction for SM50
For now, we're just using this in place of IAdd3x for 64-bit adds. IADD3
with carry flags is supported on SM50, but it works completely
differently from SM75. Longer-term we'll probably want to emit this in
all of the places that we're currently using IADD3.

Also need to hook the carry register up to calc_deps, but for now I'm
just using NAK_DEBUG=serial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
588cfcaec7 nak: Legalize a bunch of instructions for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
bbd2de34c5 nak: Rework the SM50 encoding of isetp
Drop the ALU stuff and hand-encode it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
e404877a02 nak: Use OpLop2 and OpPSetP pre-SM70
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
36e80caac9 nak: Rename LogicOp to LogicOp3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
93b6c43725 nak: Rewrite SM50 encode_fadd to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
4ab2d5c4ff nak: Rework set_src_imm20 in nak_encode_sm50
Rename it to set_src_i20 and fix the assert to allow negative signed
values.  Also, add a new set_src_f20 helper with the correct semantics
for float immediates.  Finally, get rid of some bogus shifting in the
ALU code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
a80ce982d4 nak: Initial WIP SM50 backend
Only encode some instructions.

some TODO:
- SM50 specific legalizer
- Cleaner ALU encoding (there is multiple form of encoding depending of
  the instruction)

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
9af7639e4b nak: make sm available in builders
This is needed for the 'sel' builder method, which should emit different
instrs on SM50 versus SM75.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
40127e881f nak: Split legalize into per-SM functions
We still have common code to handle the multiple vector source case
because that's required for RA correctness but everything else is
pretty much per-SM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Juan A. Suarez Romero
d0ae58f413 ci: do not mount already mounted directories
In some cases we are using an initramfs image that pre-mounts some of
the directories, so let's skip them in the next stage.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26552>
2023-12-07 00:05:25 +00:00
Juan A. Suarez Romero
f97e065c4f ci/baremetal: make BM_BOOTCONFIG optional
In some cases we can have the config.txt boot file already available in
the tftp folder.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26552>
2023-12-07 00:05:25 +00:00
Jesse Natalie
d157cd7442 microsoft/clc: One more image lowering fix
Bindings are not necessarily globally unique, and even the location
where we were trying to read the binding value out of is a union, so
we could be trying to compare binding values against data for other
arg types.

Instead, use the arg metadata offset, which is globally unique and
outside of the union.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26555>
2023-12-06 23:46:42 +00:00
Faith Ekstrand
03ae261183 nvk: Advertise KHR_shader_integer_dot_product
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
eb633b4978 nak: Wire up DP4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
fcf31d9c25 nak: Rework printing of int/float types and rounding modes
Make the . part of the enum's print like for other things.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
adafcacf15 microsoft: Stop claiming dot_4x8_sat support
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
d2ffcb6092 nir: Lower [su]dot_4x8_[ui]add_sat to [su]dot_4x8_[ui]add
Since nir_opt_algebraic runs on its own results, if the driver doesn't
have [su]dot_4x8_[ui]add then the [su]dot_4x8_[ui]add lowering rules
will kick in and lower that to what we had originally.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
09fc5e1c4d nir: Split has_[su]dot_4x8 bits into regular and _sat versions
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26533>
2023-12-06 23:15:33 +00:00
Faith Ekstrand
fde43e44e9 ci: Also rustfmt binaries
The standard name for an executable is main.rs.  Also fix the rusticl
docs while we're at it.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>
2023-12-06 22:41:47 +00:00
Faith Ekstrand
03f1b99f50 nak: Restructure for better module separation
With this commit, NAK now takes on a more Cargo-like structure with
things split better into crates:

 - bitview/
    - lib.rs // Formerly bitview.rs
 - nak/
    - lib.rs // Only pulls stuff into the module
    - api.rs // Formerly nak.rs
    - ...
 - nvfuzz/
    - main.rs // Formerly nvfuzz.rs

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>
2023-12-06 22:41:47 +00:00
Faith Ekstrand
97cd55d065 nak: rustfmt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26546>
2023-12-06 22:41:47 +00:00
José Roberto de Souza
5560835fbe anv: Avoid unnecessary intel_flush calls
Batch bos are always allocated with ANV_BO_ALLOC_HOST_CACHED_COHERENT
so there is no need to do cflush calls.
But if we ever decide to change that anv_bo_needs_host_cache_flush()
will make sure cflush is called.

Outside of batch bos, this patch is also removing the
intel_flush_range() call from anv_QueuePresentKHR because
device->debug_frame_desc is offset of workaround_bo that is also
allocated as ANV_BO_ALLOC_HOST_COHERENT.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
José Roberto de Souza
9aea879342 anv: Promote bos to host_cached+host_coherent in platforms with LLC
In platforms with LLC we can promote all bos to cached+coherent
without any performance penality.
On the up side CPU reads can hit cache this way.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
José Roberto de Souza
a65e982b44 anv: Split ANV_BO_ALLOC_HOST_CACHED_COHERENT into two actual flags
As suggested by Lionel, here adding ANV_BO_ALLOC_HOST_COHERENT
and with that ANV_BO_ALLOC_HOST_CACHED_COHERENT is now defined by
(ANV_BO_ALLOC_HOST_COHERENT | ANV_BO_ALLOC_HOST_CACHED).

In some callers of anv_device_alloc_bo() was necessary to add
ANV_BO_ALLOC_HOST_COHERENT as no other flag was set and that
was the default behavior up to now.

A change that could look not related is the removal of the
intel_flush_range() in anv_device_init_trivial_batch(), that was done
because trivial_batch_bo is HOST_COHERENT so no flush is necessary.
And it did not made sense to make it ANV_BO_ALLOC_HOST_CACHED_COHERENT
as it was never read in CPU.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
José Roberto de Souza
0eac6298f2 anv: Fix handling of host_cached_coherent bos in gen9 lp in older kernels
Kernel versions without DRM_I915_QUERY_MEMORY_REGIONS support will
take a different code path in i915_gem_create() that lacks the
i915_gem_set_caching() call to make cached bos in gen9 lp 1 way
coherent.

Fixes: fc0acf6d90 ("anv: Move i915 specific gem_set_caching to backend")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26457>
2023-12-06 22:18:26 +00:00
Sil Vilerino
d0c3556011 meson: Add all, all_free (default) options for video-codecs option.
- Adds new 'all' value to the video-codecs option
- Adds 'all_free' value to video-codecs and sets
   it as default value for non patent-encumbered
   codecs, restoring the behavior for these codecs
   before existing as options in commit 7b22dd8bfd

Fixes: 7b22dd8bfd ("meson: add vp9 and av1 codec support options")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26320>
2023-12-06 21:49:27 +00:00
Samuel Pitoiset
e126e82c79 zink/ci: stop running zink-radv-navi31-valve sequentially
Skipping the tests that OOM seems to fix this.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26544>
2023-12-06 20:31:24 +00:00
Samuel Pitoiset
bec2928cc2 zink/ci: update list of failures for NAVI31
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26544>
2023-12-06 20:31:24 +00:00
Samuel Pitoiset
f6dc3429e6 zink/ci: skip more tests that run OOM on NAVI31
These have been skipped recently, but not for NAVI31 for some reasons.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26544>
2023-12-06 20:31:24 +00:00
José Roberto de Souza
969af605fe intel/isl: Set mocs.blitter_dst/src for MTL
This fields are required to be set because those are used by
XY_FAST_COLOR_BLT instruction.
Right now it is not set causing applications to abort because
DestinationMOCS is required to be non-zero.

This fixes at least piglit@ext_external_objects-vk-image-display on MTL.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26502>
2023-12-06 20:09:04 +00:00
Lionel Landwerlin
4ff1b0f751 anv/video: only report matching memory types for protected sessions
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 794b0496e9 ("anv: enable protected memory")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26519>
2023-12-06 19:17:17 +00:00
Lionel Landwerlin
e8a96e6ba0 vulkan/runtime: retain video session creation flags
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26519>
2023-12-06 19:17:17 +00:00
Faith Ekstrand
22c60ea384 nir: Respect variable alignments in lower_vars_to_explicit_types
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26522>
2023-12-06 18:37:36 +00:00
Faith Ekstrand
629af540ca spirv: Plumb variable alignments through to NIR
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26522>
2023-12-06 18:37:36 +00:00
Juan A. Suarez Romero
47b825c6c5 v3d: include the revision in the device name
To match what the Vulkan driver does.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26520>
2023-12-06 18:19:08 +00:00
José Roberto de Souza
1f0a9f853c intel: Sync xe_drm.h take 2 part 3
Sync xe_drm.h with commit ac7b89571d80 ("drm/xe/uapi: Kill exec_queue_set_property").

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26360>
2023-12-06 17:35:23 +00:00
Rohan Garg
d1109f67bb iris: Emit EXECUTE_INDIRECT_DRAW when available
On newer platforms (Arrowlake and above) we can issue a
EXECUTE_INDIRECT_DRAW that allows us to:
  * Skip issuing mi load/store instructions for indirect parameters
  * Skip doing the indirect draw unroll on the CPU side when the
    appropriate stride is passed

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26178>
2023-12-06 17:09:58 +00:00
Faith Ekstrand
e5b7e16f3b nvk: Implement VK_EXT_texel_buffer_alignment
These values are taken from the blob.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9618
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26545>
2023-12-06 16:54:57 +00:00
Samuel Pitoiset
47f666b64b radv: enable extendedDynamicState3AlphaToCoverageEnable on GFX11
This is now supported and this allows Zink to enable full ds3 mode for
even less stuttering. DXVK also uses dynamic alpha to coverage
sometimes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26250>
2023-12-06 16:36:16 +00:00
Samuel Pitoiset
bca4ebc3c4 radv: export MRTZ via PS epilogs when alpha to coverage is dynamic on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26250>
2023-12-06 16:36:16 +00:00
Rhys Perry
0cbe0d2968 nir/loop_analyze: support loops with min/max and non-add incrementation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26225>
2023-12-06 15:58:36 +00:00
Rhys Perry
fc1ebc67b1 nir/loop_analyze: support umin and {u,i,f}max
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26225>
2023-12-06 15:58:36 +00:00
Rhys Perry
9591c36666 nir/loop_analyze: check min compatibility with comparison
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26225>
2023-12-06 15:58:36 +00:00
Rhys Perry
b6c2a5d48d nir/loop_analyze: fix vector basis/limit/comparison
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26225>
2023-12-06 15:58:36 +00:00
Rhys Perry
2f46773819 nir/loop_analyze: scalarize try_eval_const_alu
This is simpler, and users of this function expected scalar anyway.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26225>
2023-12-06 15:58:36 +00:00
Rhys Perry
7960588413 nir/loop_analyze: skip if basis/limit/comparison is vector
Replacement in try_eval_const_alu() doesn't work because the replacements
are always scalar. The callers also always give a scalar dest.

This is encountered when compiling a Redout shader under ASan.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Fixes: bc170e895f ("nir/loop_analyze: Use try_eval_const_alu and induction variable basis info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26225>
2023-12-06 15:58:36 +00:00
Eric Engestrom
0957b01a06 ci: take microsoft farm offline
It has been in a rough few days for that farm and it doesn't seem to be
able to handle the load.

Unfortunately we need to consider it down so that it stops blocking
merges.
2023-12-06 15:36:41 +00:00
Samuel Pitoiset
13e9e73974 zink/ci: remove skipped tests from the list of expected failures for NAVI31
These are skipped.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26539>
2023-12-06 12:28:17 +00:00
Samuel Pitoiset
79cf2b6824 radv: determine and emit SPI_SHADER_Z_FORMAT for PS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26413>
2023-12-06 11:49:31 +00:00
Samuel Pitoiset
4248d0b03a radv,aco: declare PS epilog VGPR arguments for depth/stencil/samplemask
Depth/stencil/samplemask inputs are first to match
create_fs_jump_to_epilog().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26413>
2023-12-06 11:49:31 +00:00
Samuel Pitoiset
8b87c985b0 radv: prepare the PS epilog key for exporting MRTZ on RDNA3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26413>
2023-12-06 11:49:31 +00:00
Samuel Pitoiset
5b01285cfb radv: determine if MRTZ needs to be exported via PS epilogs
For GFX11 only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26413>
2023-12-06 11:49:31 +00:00
Samuel Pitoiset
b2a37b4304 ac/nir: add an option to skip MRTZ exports in ac_nir_lower_ps()
On RDNA3, alpha to coverage needs to be exported through MRTZ when
depth, stencil or samplemask are also exported. This option will allow
us to export MRTZ from PS epilogs instead of the main FS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26413>
2023-12-06 11:49:31 +00:00
Samuel Pitoiset
81eeb157f8 aco: export depth/stencil/samplemask in create_fs_jump_to_epilog()
This currently has no effects because the store_output instructions
are removed earlier (in ac_nir_lower_ps). Though, this will be needed
for exporting MRTZ from PS epilogs for alpha to coverage on RDNA3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26413>
2023-12-06 11:49:31 +00:00
Eric Engestrom
680f249c9f ci: improve comments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
b6fa242fb0 ci: make sure pre-merge pipelines have the same jobs as merge pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
22d9c17c66 ci: clean up pre-merge and fork pipelines rules
We've already handled all the Marge-bot possibilities above, so drop the
redundant `marge-bot` check, which also makes it obvious the last line
was dead code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
f3264c2ea0 ci: give an explicit priority to the scheduled nightly pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
2ecb550418 ci: add pipeline for direct pushes to main
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
90a77f55de ci: drop containers, builds, and tests from post-merge pipeline
All these jobs are redundant and a waste of resources:
- the containers have already been built & pushed in the merge pipeline
- the mesa build variants have already all passed
- the driver tests have already all passed

None of these jobs are doing anything useful in this pipeline, but it
costs a factor of 2x to our infrastructure, so let's remove them.

In other words, the only job left in the post-merge pipeline is the
`pages` job that deploys the update to the website.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
b976b9cd8d ci: rename is-pre-merge-for-marge to is-merge-attempt to be clearer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
7f05f52f2d ci: identify merge request pipelines using $CI_PIPELINE_SOURCE == merge_request_event instead of $CI_COMMIT_BRANCH being missing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
5b51b7ba41 ci: turn comment into code in sanity job rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Eric Engestrom
60dcc4744f ci: explain what we mean by the various types of pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Samuel Pitoiset
a3b3a7d36a radv: remove unused code for compiling PS epilogs as part of pipelines
Since we switched to the "on-demand" path for GPL, this is dead code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26398>
2023-12-06 08:01:46 +00:00
Samuel Pitoiset
725fc0ec03 radv: switch to on-demand PS epilogs for GPL
RADV currently has two paths for PS epilogs:
- the first one is mostly used by GPL to compile fragment shader epilogs
  as part of the graphics pipeline. It's supposed to be optimal because
  fragment shader epilogs are compiled in the pipeline and eventually
  cached.
- the second one (the "on-demand" path) is required when some dynamic
  states are used because otherwise it's just impossible to compile the
  fragment shader. These epilogs are compiled during cmdbuf recording
  when all needed info are known, they are also cached in memory. This
  is the main path for Zink.

Having two different paths isn't ideal for maintenance but there is
another problem. On RDNA3, alpha to coverage needs to be exported as
part of MRTZ when either depth/stencil/samplemask are exported. The
problem being that with GPL, the PSO multisample state can be NULL when
the frag shader lib is created, which means that we can't know if atc
needs to be exported or not, even if it's static. The solution seems to
to always use on-demand fragment shader epilogs for GPL on RDNA3.

So far, I think that switching to on-demand PS epilogs unconditionally
for GPL shouldn't hurt performance and that will simplify a lot of
things.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26398>
2023-12-06 08:01:45 +00:00
Eric Engestrom
267f86a8a3 util/blob: fix trivial typo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26499>
2023-12-06 07:22:02 +00:00
Faith Ekstrand
2c427d7c20 nak: Implement usub_sat
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535>
2023-12-06 06:10:30 +00:00
Faith Ekstrand
99bbfbf7b2 nak: Implement uadd_sat
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535>
2023-12-06 06:10:30 +00:00
Faith Ekstrand
85462f7455 nak: Legalize immediates with source modifiers
We can just apply the source modifier to the immediate.  Also, make
IAdd3X have I32 sources.  They do get a bit odd in the high form but

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535>
2023-12-06 06:10:30 +00:00
Faith Ekstrand
5335a59bff nak/legalize: Handle the src0/1 source mod condition for OpIAdd3X
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535>
2023-12-06 06:10:30 +00:00
Faith Ekstrand
b736cdcb83 nak: Rework the OpIAdd3/OpIAdd3X split
This lets us use the correct source types on OpIAdd3X

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535>
2023-12-06 06:10:30 +00:00
Faith Ekstrand
48917600fb nak: Add a B32 source type
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535>
2023-12-06 06:10:30 +00:00
Dave Airlie
fab508da38 nvk/xfb: set correct counter buffer for writing stream out counters.
nvc0 does nvc0_hw_query_get(push, q, 0x00, 0x0d005002 | (q->index << 5));
which corresponds to sub report.

Just noticed in code review, don't know of any tests that will notice yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26513>
2023-12-06 05:55:54 +00:00
Qiang Yu
7656251294 aco: fix set_wqm segfault when ps prolog
ps prolog does not have nir shader.

Fixes: 3b10547e67 ("aco: enable helper lanes if shader->info.fs.require_full_quads")
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26512>
2023-12-06 05:34:30 +00:00
Faith Ekstrand
3bbd5357e9 nak: Advertise subgroupBroadcastDynamicId
This doesn't do anything yet because it's a Vulkan 1.2 core feature and
not in any extension but it will apply when we enable Vulkan 1.2 in the
future or if someone uses MESA_VK_VERSION_OVERRIDE=1.2/1.3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26530>
2023-12-06 05:18:30 +00:00
Faith Ekstrand
a3159bab98 nvk: Advertise VK_EXT_scalar_block_layout
https://gitlab.freedesktop.org/mesa/mesa/-/issues/9653

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26530>
2023-12-06 05:18:30 +00:00
Sagar Ghuge
b223d33141 blorp: Handle stencil buffer compression on blitter engine
XY_BLOCK_COPY_BLT and XY_FAST_COLOR_BLT instruction supports AUX_CCS
surface mode. Stencil buffer compression is stencil data with CCS so we
can easily support that on blitter engine.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26167>
2023-12-06 04:39:09 +00:00
Sil Vilerino
28ad562a16 d3d12: Video Encoder: Support reporting non contiguous NALU, offsets for frontend extraction
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
bed54fc9b0 d3d12: Video Encoder - When setting rate control dirty flags take into account rolled back optional configs
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
960d86ef9a d3d12: Fix max reference frames reporting when HW does not support B frame
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
d010364841 d3d12: d3d12_create_fence_win32 - Fix double refcount bump
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
81c8e89ff8 d3d12: Fix screen->winsys leak in d3d12_screen
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
7bd6a42d1f d3d12: Fix d3d12_tcs_variant_cache_destroy leak in d3d12_context
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
ba85ca3721 d3d12: Improve error detection and reporting for video encoder
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
0233cdd00d d3d12: Detect imported resource buffer unknown format
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
bf73d5551a d3d12: Implement PIPE_VIDEO_CAP_ENC_H264_SUPPORTS_CABAC_ENCODE
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
bee68059cb d3d12: Autodetect d3d12_video_buffer imported handle/resource format and dimensions when not passed
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
3f43b2eae5 d3d12: Implement PIPE_VIDEO_FEEDBACK_METADATA_TYPE_AVERAGE_FRAME_QP
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
364cc5d51d d3d12: Fix max slice size and max frame size metadata reporting
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
25e2a7544b d3d12: max_frame_poc workaround for infinite GOPs
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
c89766f416 d3d12: Use new pipe h264 encode ip_period param
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
8af080cec4 d3d12: Implement d3d12_video_encoder_get_encode_headers for out of band VPS, SPS, PPS
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
829e821aab d3d12: Only pass texture dimensions to d3d12_video_encoder_update_current_encoder_config_state
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
05fe740374 d3d12: Implement fence_get_win32_handle to get HANDLE from d3d12_fence
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
942791b937 d3d12: Implement get_feedback_fence for encode async waiting on pipe_feedback_fence
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
0cc0220cce d3d12: H264 encode - Allow CONSTRAINED_BASELINE profile to be written in headers
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
c80b35274f d3d12: Do not increase active_seq_parameter_set_id on new SPS. Force PPS on new SPS
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
1032fc07b5 d3d12: Implement inserting optional new headers on each H264/HEVC IDR frame
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
9a927f21fb vl_winsys_win32: call winsys->destroy(winsys) in error conditions
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
88f25f35e4 frontend/va: Use p_video_codec.get_feedback_fence to report errors on frame submission
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
e0345bff94 frontend/va: Add VACodedBufferSegment Average QP metadata
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
0c1ff82bc8 frontend/va: Add h264 encode ip_period param
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
413b466aea pipe: Add PIPE_H264_MAX_REFERENCES
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
92b73aeb16 pipe: Add PIPE_VIDEO_CAP_ENC_H264_SUPPORTS_CABAC_ENCODE
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
c954830132 pipe: Add PIPE_VIDEO_FEEDBACK_METADATA_TYPE_AVERAGE_FRAME_QP
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
3f07c8c321 pipe: Add p_video_codec.get_encode_headers for out of band VPS, SPS, PPS
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:53 +00:00
Sil Vilerino
34d45cf7ed pipe: Add fence_get_win32_handle to get HANDLE from pipe_fence_handle
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:52 +00:00
Sil Vilerino
d9bbae6a0c pipe: Add get_feedback_fence for encode async waiting on pipe_feedback_fence
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:52 +00:00
Sil Vilerino
3ab25d6fb3 pipe: Support inserting new headers on each H264/HEVC IDR frame
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
2023-12-06 03:58:52 +00:00
jphuang
02a873fa2a dzn: Change dst image layout according to aspect
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26532>
2023-12-06 03:36:07 +00:00
Eric Engestrom
cb6422765c turnip: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26493>
2023-12-06 02:21:04 +00:00
Eric Engestrom
df8ea977be radeonsi/ci: track changes to vpelib
According to `src/amd/meson.build`, radeonsi uses vpelib, so we should
track changes to it as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26479>
2023-12-06 01:58:41 +00:00
Eric Engestrom
3a8da0b8bf v3d: drop leftover from "move v3d_tiling to common"
Fixes: d198e26a1e ("broadcom/common: move v3d_tiling to common")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26525>
2023-12-06 01:44:14 +00:00
Eric Engestrom
4dd8030b25 freedreno/ci: add more a630 flakes
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52405040 and passed
in the auto-retry https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52405437

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26531>
2023-12-06 01:22:30 +00:00
Jesse Natalie
d7f038e8de microsoft/clc: Add a test which sinks image derefs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26529>
2023-12-06 01:07:24 +00:00
Jesse Natalie
c8895a4b85 microsoft/clc: Fix images with multiple derefs for real
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26529>
2023-12-06 01:07:24 +00:00
Paulo Zanoni
bf0f261c1e anv/sparse: document USAGE_2D_3D_COMPATIBLE as non-standard too
The standard block shapes (and by extension, the tiling formats they
require) are simply incompatible with getting a 2D view of a 3D image.
I couldn't find in the Vulkan spec anything related to what are the
expectations when trying to use both at the same time.

So here we "document" that this case is known non-standard. Please
notice that since we report residencyStandard3DBlockShape as true we
were actually supposed to support this case, but I can't see how this
would be possible, so set is_known_nonstandard_format to true so we
can avoid the assert() that comes right after.

Fixes the following when using Zink:
  KHR-GL46.sparse_texture_tests.SparseTextureAllocation

Also "moves forward" the following test on Zink, so it now hits a
different assertion:
  KHR-GL46.sparse_texture_tests.SparseTextureCommitment

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Paulo Zanoni
819b94176a anv/sparse: check if the non-sparse version is supported first
During vkGetPhysicalDeviceSparseImageFormatProperties(), check first
if the non-sparse version of the image is supported, and return in
case it's not.

On TGL, if we don't do that, we may hit the following assertion:
  deqp-vk: ../../src/intel/isl/isl.c:2584: isl_surf_init_s: Assertion `!(info->usage & ISL_SURF_USAGE_CPB_BIT) || dev->info->has_coarse_pixel_primitive_and_cb' failed.

My TGL doesn't has_coarse_pixel_primitive_and_cb.

Fixes the following on TGL:
  dEQP-VK.api.maintenance5.flags.sparse_image_format_props
  dEQP-VK.api.maintenance5.flags.sparse_image_format_props2

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Paulo Zanoni
181aa83027 anv/tr-tt: assert the bind size is a multiple of the granularity
If the size here is not a multiple of the granularity (64kb) then
we'll miss our "pages" estimation by 1. We could fix this with
DIV_ROUND_UP() or by simply putting a "+1" there, but the upper layers
should now be preventing this case so let's just put the assertion
here.

Previously it was possible to hit this case with Zink by running
under certain conditions piglit/arb_sparse_buffer-basic.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Paulo Zanoni
c87f7c13fa anv/sparse: reject binds that are not a multiple of the granularity
From the spec:

  "Resources can be bound at some defined (sparse block) granularity."

  "The sparse block size in bytes for sparse buffers and
   fully-resident images is reported as
   VkMemoryRequirements::alignment. alignment represents both the
   memory alignment requirement and the binding granularity (in bytes)
   for sparse resources."

Not only the upper layer (the Spec) doesn't allow this, the lower
layers (both the vm_bind ioctl and TR-TT) also work on a granularity.
Just check for this case and return an error.

Before this check, what would happen was:
  - for the vm_bind backend, the vm_bind ioctl would fail
  - for the TR-TT backend, we'd understimate l1_binds_capacity and
    fail an assertion, or we'd just silently bind 64kb instead of the
    original size

Currently, some Zink tests such as piglit/arb_sparse_buffer-basic can
trigger this behavior, but we're working to fix Zink for this case
(and that commit may be merged before this one).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26454>
2023-12-06 00:29:58 +00:00
Ryan Neph
a495d437b7 venus: add dri option to enable multi-plane wsi modifiers
Adds a venus dri option to advertise support for multi-plane format
modifiers to Vulkan's common WSI. Otherwise, Venus will only support
modifiers with planeCount == 1 to ensure compatibility with Xwayland's
virgl-backed Glamor backend.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
035730f26e venus: reject multi-plane modifiers for tiled wsi images
Force the use of single-plane modifiers for tiled wsi images as long as
Venus is integrated with Virgl, which does not support non-format
compression metadata planes (e.g. Intel's CCS or AMD's DCC modifiers).

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
833d228f53 venus: strip ALIAS_BIT for WSI image creation on ANV
For compositors that advertise modifier support, Vulkan common WSI
modifier support queries still fail in Venus on the Intel ANV driver.

This is due to the presence of VK_CREATE_IMAGE_ALIAS_BIT, without
accompanying wsi_image_create_info struct, which is implicitly excluded
from serialized messages over the venus-protocol.

By removing ALIAS_BIT, modifier queries begin to pass when the host
supports them.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
9bde89591e venus: add VN_PERF=no_tiled_wsi_image
Force DRM_FORMAT_MOD_LINEAR for wsi image creation, even for winsys that
supports non-linear modifiers.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
aa15f52bf5 virgl: implemement resource_get_param() for modifier query
Without such, Xwayland gets back the implicit modifier token (INVALID)
when calling gbm_bo_get_modifier() for a dmabuf shared by the WSI layer.
Then mistakenly sends INVALID upon wl_buffer creation, rather than the
explicit modifier sent by WSI.

The logic of Xwayland's Glamor gbm backend is a bit circuitous, since
the modifier is sent by WSI alongside the dmabuf fd. Rather than use
that modifier directly when creating wl_buffer (via
zwp_linux_dmabuf_v1), Glamor first imports the dmabuf+modifier with
gbm_bo_import(), then uses the result of later gbm_bo_get_modifier().

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Faith Ekstrand
95c0447ad6 radeonsi: Drop an unnecessary cast
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
2a28338aa8 compiler: Fix a comment
We're not using GL enums here anymore

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
06257514c1 nir: Return a mesa_prim from gs_in_prim_for_topology
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
e3ff5a3b0e intel/vec4: Use MESA_PRIM_* instead of GL_*
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
b97003e49a glsl: Properly remap GL_* to MESA_PRIM
Instead of blatantly assuming with no assert that they're the same, add
a remap function.  Also, be more careful about which enum we use where.
In the AST, we use GLenum and GL_FOO because we also need GL_ISOLINES.
When we translate to shader info, GS gets translated into mesa_prim
and tessellation gets translated into tess_primitive_mode which has
ISOLINES as a valid primitive value.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand
a41d65cfba dxil: Use mesa_prim consistently
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Karol Herbst
65de9bc81a clc: add dump_llvm debug options
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26524>
2023-12-05 22:45:53 +00:00
Karol Herbst
d9d398e652 clc: allow debug flag to be read from other files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26524>
2023-12-05 22:45:53 +00:00
Samuel Pitoiset
3678482f1e radv: set combinedImageSamplerDescriptorCount to 1 for multi-planar formats
RADV compacts all descriptors for multi-planar images into one
combined image sampler, so it should be 96, and not eg. 192 for a two
planes format.

Fixes new CTS
dEQP-VK.binding_model.descriptor_buffer.ycbcr_sampler.*array.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26498>
2023-12-05 22:27:19 +00:00
Alyssa Rosenzweig
65e431e61a nir/lower_idiv: Optimize idiv sign calculation
Save a comparison, and move out the comparison to be more backend friendly.
Saves 2 instrs on AGX (as the remaining comparison now fuses with bcsel).

Results on AGX, all affected shaders in asphalt9.

   total instructions in shared programs: 1813003 -> 1812611 (-0.02%)
   instructions in affected programs: 119646 -> 119254 (-0.33%)
   helped: 333
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 11870344 -> 11867208 (-0.03%)
   bytes in affected programs: 820888 -> 817752 (-0.38%)
   helped: 333
   HURT: 0
   Bytes are helped.

and on Mali-G57:

   total instructions in shared programs: 2677538 -> 2677205 (-0.01%)
   instructions in affected programs: 206923 -> 206590 (-0.16%)
   helped: 333
   HURT: 0
   Instructions are helped.

   total cvt in shared programs: 14667.50 -> 14662.30 (-0.04%)
   cvt in affected programs: 1953.64 -> 1948.44 (-0.27%)
   helped: 333
   HURT: 0
   Cvt are helped.

   total quadwords in shared programs: 1450664 -> 1450544 (<.01%)
   quadwords in affected programs: 5064 -> 4944 (-2.37%)
   helped: 15
   HURT: 0
   Quadwords are helped.

   total threads in shared programs: 53282 -> 53309 (0.05%)
   threads in affected programs: 27 -> 54 (100.00%)
   helped: 27
   HURT: 0
   Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26489>
2023-12-05 21:46:26 +00:00
Eric Engestrom
910000f30f freedreno/ci: add more flakes seen on a630
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52365773 and its
automatic retry https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52365892
have two distinct sets of failures; add all of them as flakes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26517>
2023-12-05 21:21:07 +00:00
Eric Engestrom
21b0445d05 freedreno/ci: add flake seen on a630
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52372985 and
passed in the retry https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52374333

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26517>
2023-12-05 21:21:07 +00:00
Rhys Perry
e110eac171 aco: insert p_end_wqm before p_jump_to_epilog
Otherwise, we can transition to exact before p_jump_to_epilog, then
transition to WQM again and then back to exact:
p_jump_to_epilog //transitions to exact
p_logical_end //transitions to wqm
p_end_wqm //transitions to exact

We rely on ssa elimination to clean most of this up.

fossil-db (navi21):
Totals from 1 (0.00% of 79330) affected shaders:
Instrs: 111 -> 110 (-0.90%)
CodeSize: 572 -> 568 (-0.70%)
Copies: 16 -> 15 (-6.25%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25440>
2023-12-05 21:02:04 +00:00
Connor Abbott
24527b3d28 tu: Move shader linking to tu_shader.cc
This creates a function that can be used by both pipelines and shaders.

Note that we cannot yet call tu_CreateShadersEXT directly inside the
pipeline due to things like pipeline feedback, multiview, and so on, but
further extensions will hopefully bring us closer to that ideal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:28 +00:00
Connor Abbott
ca03e6ab3f tu: Make filling out tu_program_state not depend on the pipeline
We will need to fill it out at draw time for shader objects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:28 +00:00
Connor Abbott
88db736472 tu: Rework dynamic offset handling
With shader objects, we won't have the pipeline layout available. This
means that the current way we implement dynamic offset descriptors in
combination with fast-linking and independent descriptor sets, where we
use the pipeline layout when fast-linking that has pre-computed offsets
for each descriptor set, won't work. Instead we need to piece together
the sizes of the descriptors in each descriptor set from the shaders.
This is already effectively what we do when we stitch together the
pipeline layout when fast-linking, but we need to make it work with just
the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:28 +00:00
Connor Abbott
af691ec8e4 tu: Don't use pipeline layout to emit shared const enable
It won't exist when we emit this at draw time for shader objects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:27 +00:00
Faith Ekstrand
785290836b nak: Add a barrier propagation pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
a595535074 nak: Force RA to allocate bar_in/out to the same register
OpBreak and OpBSsy aren't very SSA friendly as they require bar_in and
bar_out to be assigned the same register.  We need to encure that RA
knows about this restriction.  For now, we just special-case these two
instructions.  In the future we may want a more generic mechanism for
this but it's not worth it for just two instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
eda940c855 nak: Make barriers SSA-friendly
The NIR intrinsics now take and return a barrier whenever one is
modified instead of modifying in-place.  In NAK, we give the internal
instructions the same treatment and convert everything to use barrier
SSA values and RegRefs.  In nak_from_nir, we move all barriers to/from
GPRs.  We'll clean up the massive pile of OpBMov later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
71813afa7a nak: Take num_barriers from RA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
dca65f62c8 nak: Add support for spilling barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
7cd9680554 nak: Add back OpBMov with better semantics
It now takes a regular Src and Dst and we handle both GPR -> Bar vs.
Bar -> GPR forms in the emit code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
40c96ff6ea nak: Add a barrier register file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
618723428a nak: Fix scheduling for control barriers
OpBar and OpBSync both stall the thread until other threads get to that
point.  These instructions must have .yld set.  Also, warp barrier ops
don't support the usual instruction barrier mechanism so they should be
marked as having a fixed latency.  It's unclear if the barrier file is
internally scoreboarded or if warp barrier ops just stall the whole
thread.  In either case, this seems necessary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
45686ec0ba nak: Replace OpBMov with OpBClear
This is all we're using it for right now and an op that simply clears
has far more obvious semantics than something which reads from and then
clears its source.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand
3348446422 nak: Simplify Src::is_predicate()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Samuel Pitoiset
13dcbdcdf3 radv: make sure to reset the stipple line state when it's disabled
In a scenario like:
CmdBindPipeline(stipple line enabled)
CmdDraw()
CmdBindPipeline(stipple line disabled)
CmdDraw()

The second draw wasn't resetting the stipple line state and this might
have caused issues, though it's uncovered by VK CTS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26429>
2023-12-05 18:29:30 +00:00
Samuel Pitoiset
e88973fd02 radv: change the reset stipple pattern mode for adjacent lines
Ported from RadeonSI. This isn't covered by VK CTS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26429>
2023-12-05 18:29:29 +00:00
Samuel Pitoiset
16d5ffc3ee radv: update the reset stipple pattern mode
PAL recently changed the mode. This doesn't fix anything known.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26429>
2023-12-05 18:29:29 +00:00
Samuel Pitoiset
949fdc9a73 radv: advertise VK_EXT_depth_clamp_zero_one
RADV already implements this behavior, so enabling this extension is
a no-op.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26443>
2023-12-05 18:10:31 +00:00
Lionel Landwerlin
8d6c059bd2 intel/tools: 32bit compile fixes
Fixes: 03712579b0 ("intel/tools: add hang_replay tool")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26514>
2023-12-05 17:45:18 +00:00
Rhys Perry
7a37a39fe0 aco: simplify v_mul_* labelling slightly
This was from before VALU_instruction existed.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry
468ee8b80c aco: implement 16-bit fsat on GFX8
GFX8 doesn't have v_med3_f16.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry
de51a21e26 aco: implement 16-bit derivatives
These are used by radeonsi.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry
997a0884a5 aco: implement 16-bit fsign on GFX8
GFX8 doesn't have v_med3_i16.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry
b7725b072b aco: flush denormals for 16-bit fmin/fmax on GFX8
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26445>
2023-12-05 16:56:57 +00:00
Yonggang Luo
a9a2eabea8 glsl: move glsl_get_gl_type into glsl/linker_util.h
glsl_get_gl_type only accessed in src/compiler/glsl files, do not expose it
in libcompiler

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25879>
2023-12-05 16:16:55 +00:00
Boris Brezillon
1d4583759a panfrost: Restrict job descriptor emission to JM hardware
CSF hardware issue jobs through command stream instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon
54e0086abe panfrost: Restrict job chain helpers to JM hardware
Jobs are issued through command stream instructions on CSF hardware.
Don't expose the job chain helpers in that case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon
1481883a6e panfrost: Make pan_afbc_compression_mode() per-gen
With the introduction of v10, we need this function to have a
per-gen name to avoid duplicates. While at it, move it to pan_texture.c
since the prototype is already defined in pan_texture.h.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon
e144347140 panfrost: Rename pan_cs.{c,h} into pan_desc.{c,h}
Pre v10 Mali GPU were describing GPU jobs as a chain of job descriptors,
but new generations moved to a command stream based approach. The
pan_cs.{h,c} name was chosen based on the assumption this job chain
would replace the command stream we have on other GPUs, things will
become a lot more confusing now that we have a real command stream.

Let's rename these files before it happens. Given all the helpers in
there are either emitting descriptors, and calculating values to be
put in such descriptors, pan_desc.{c,h} sounds like an acceptable
name.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon
dc087a3184 panfrost: s/pan_scoreboard/pan_jc/
What pan_scoreboard manipulates is a job chain, how dependencies
between jobs is implemented is an implementation detail, and shouldn't
leak through the name.

Let's rename pan_scoreboard.h pan_jc.h, and prefix the functions
accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon
692a4b1804 panfrost: Don't leak NIR compute shaders
We never steal the NIR program or free it explicitly, and the state
tracker expects drivers to take ownership of the program object. Since
panfrost doesn't need to keep the original NIR shader around for
compute, let's just free it before returning.

Fixes: 40372bd720 ("panfrost: Implement a disk cache")
Cc: stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26424>
2023-12-05 15:29:28 +00:00
Karol Herbst
b470bd7359 rusticl/gl: make GLX support optional
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26394>
2023-12-05 14:44:52 +00:00
Karol Herbst
494fd5d068 rusticl: add x11 dependency
This is needed by `glx.h` pulling in `X11/Xlib.h`

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10221
Fixes: df0623e51a ("rusticl, meson: Add gl/egl/glx bindings")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26394>
2023-12-05 14:44:52 +00:00
Samuel Pitoiset
338319741c radv: add DGC support for mesh shader only
This only implements mesh shaders with DGC because task shaders are
really tricky. I will address them later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Samuel Pitoiset
eb3e1bdfe6 radv: only initialize the VTX base SGPR if non-zero with DGC
Otherwise, its value is incorrect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Samuel Pitoiset
1deedc70db radv: only initialize the VBO reg if VBOs are bound with DGC
With mesh shader there is no VBO at all.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Samuel Pitoiset
400cfa0eba radv: remove never used binds_state for DGC
This has been removed a while ago.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Mario Kleiner
1700c6af6f v3d: add B10G10R10[X2/A2]_UNORM to format table.
Enables 10 bpc / color depth 30 bit support under XOrg
with X11/GLX/OpenGL.

Successfully tested with RaspberryPi OS 11,
running X-Server 1.20, and also with Weston,
on a RaspberryPi 400 on top of current Mesa 24.0-devel.

Alejandro Piñeiro also performed a GLES CTS run
with successful result, citing him:
"Full GLES 31 CTS finished with 0 failres. So all ok"

Note that this commit was originally developed and
successfully tested by myself against Mesa 23.1-devel
from February 2023, and therefore should apply and work
cleanly against recent Mesa stable branches. One could
see this commit as a trivial compatibility fix against
X-Server 1.20 / modesetting-ddx 1.20, which is why I'm
also nominating this commit for the current 23.3 stable
branch, and also the 23.2 stable branch, so it may make
it into RaspberryPi OS 12. Thanks for the consideration.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.2
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26472>
2023-12-05 13:56:23 +00:00
Eric Engestrom
48324e3734 radeonsi/ci: update vangogh piglit expectations
Looking good there, Vangogh!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26466>
2023-12-05 13:34:32 +00:00
Martin Roukala (né Peres)
91076fd390 amd/ci: reduce Renoir's concurrency to 16
It seems like when we increased the number of tests per shard, we
started overcommitting the Renoir runner, leading to load averages
higher than the 16 CPU threads could handle, while also running at
75-96% memory usage.

By dropping the concurrency to 16, we should be able to reduce this
memory usage while also reducing the execution time.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26501>
2023-12-05 12:45:44 +00:00
Caio Oliveira
d9565a0e66 intel/compiler: Remove the linking step in intel_clc
A previous patch already removed individual compilation of the inputs,
by simply concatenating the files. This patch removes the linking of
the remaining single object that's compiled.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26458>
2023-12-05 11:48:25 +00:00
Caio Oliveira
d9e49ce194 intel/compiler: Fix memory leaks in intel_clc
Avoids failures when using Address Sanitizer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26458>
2023-12-05 11:48:25 +00:00
Caio Oliveira
db9111bb87 intel/compiler: Use single variable instead of dynarray
A previous change concatenated multiple SPIR-V inputs to be
compiled together, so we have a single clc_binary to work on.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26458>
2023-12-05 11:48:25 +00:00
Caio Oliveira
73276c1ece intel/compiler: Refactor program exit in intel_clc
Move the clean up code (at the moment just ralloc_ctx) into
a single place at the end.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26458>
2023-12-05 11:48:25 +00:00
Faith Ekstrand
1d10de539c nvk: Implement VK_EXT_shader_image_atomic_int64
The compiler work is done but we still need to advertise formats and
deal with clears.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9647
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
0ad77cbf98 nvk: Don't disable non-texturable formats
We're about to add int64 formats and those aren't texturable but you can
use them as storage images.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
7f1dc665ef nil: Add R64_SINT and R64_UINT formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
c190c54c30 nak: Handle 64-bit image atomics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
62ff051139 nak: Lower 64-bit image load/store
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
1e2f9ab771 nak/nir: Trim image load/stores based on format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
9b60a1c00e nvk: Advertise VK_KHR_shader_atomic_int64
Everything should be mostly wired up. Shared atomics don't seem to work,
though, for some reason.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9603
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
c05ad7904f nvk: Advertise KHR_shader_subgroup_extended_types
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9607
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
a975c51d5b nak/nir: Handle non-32-bit data in lower_scan_reduce
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
2655607983 nvk: Advertise VK_EXT_shader_subgroup_ballot/vote
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
3bded00831 nvk: Advertise shaderInt64
We enable the lowering so everything should work.  If there's bugs,
we'll fix them.  There's more work to do to implement it efficiently, of
course, but it should work.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9662
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
56a6486599 nak/nir: Don't lower 64-bit conversions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
39db9cf0a7 nak: Implement b2i64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
943eae018b nak: Fix encoding of 64-bit F2I, I2F, and F2F
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
16e55dc7d5 nak: Use the right source types for I2F, F2I, and F2F
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
d621f2ccfd nak: Don't ask NIR to lower [iu]mul64_2x32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
d2cec80768 nak: Implement 64-bit comparisons
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
8747a25d65 nak: Rework printing of comparisons
As with the memory modifiers, put the . on the modifier rather than
having to do it as part of the print itself.  Also, add printing of
accumulators but only if it's not a trivial accumulation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
9c1eade3eb nak: Lower isign in NIR
The NIR lowering just clamps to [-1, 1] which should turn into two IMnMx
as opposed to the 4 instructions we're emitting now.  We can maybe do
better than the NIR lowering for 64-bit but that seems unnecessary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
12acb2ef62 nak: Natively implement 64-bit shifts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
a52e46406b nak: Implement 64-bit ineg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:51 +00:00
Faith Ekstrand
7db3cc7502 nak/nir: Don't use nir_lower_bit_size on 64-bit values
It works by casting values to a larger type and doing the operation
there so it makes no sense to use it for 64-bit values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:50 +00:00
Faith Ekstrand
af94989085 nak: Set .64/.32 on CSSR as needed
Fixes: 46d489fa4d ("nak: Implement shader clock")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:50 +00:00
Faith Ekstrand
ee386c0c58 nak: Fix integer roll-over when we have a u64vec4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:50 +00:00
Faith Ekstrand
add1119671 nak: Run rustfmt again
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26246>
2023-12-05 11:24:50 +00:00
Yonggang Luo
83a5fb9faf util: Fixes note: the alignment of ‘_Atomic long long int’ fields changed in GCC 11.
This is a improve of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23961>
2023-12-05 09:26:08 +00:00
Eric Engestrom
81ec1fa0b5 nvk: use || instead of | between bools
We have to split each call into its own variable, because simply
replacing `|` with `||` would short-circuit the right side when the left
side succeeds.

Fixes: dadf9d59e6 ("nvk: Add support for variable pointers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26509>
2023-12-05 08:07:48 +00:00
Eric Engestrom
3115e6e211 amd/ci: reuse .radeonsi-rules in .radeonsi-vaapi-rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26480>
2023-12-05 06:55:21 +00:00
Lionel Landwerlin
344a4948b7 intel/hang_replay: fix compile race with generated files
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 03712579b0 ("intel/tools: add hang_replay tool")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26510>
2023-12-05 06:09:52 +00:00
Faith Ekstrand
dcf2f25169 nouveau: Move headers/classes to headers/nvidia/classes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26507>
2023-12-05 03:53:01 +00:00
Faith Ekstrand
ec345567ad nouveau: Rename nvidia-headers to headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26507>
2023-12-05 03:53:01 +00:00
Yonggang Luo
e568ef122a d3d12,dzn: Simplify the usage of #include <wsl/winadapter.h>
Now wsl/winadapter.h are platform independent

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26508>
2023-12-05 03:24:30 +00:00
Yonggang Luo
767aa00230 dzn: Fixes -Werror=incompatible-pointer-type
Error message:

../../src/microsoft/vulkan/dzn_device.c:3840:108: error: passing argument 5 of 'device->dev13->lpVtbl->OpenExistingHeapFromAddress1' from incompatible pointer type [-Werror=incompatible-pointer-types]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26508>
2023-12-05 03:24:30 +00:00
Rob Clark
f2e3285d8e freedreno/drm: Fix zombie BO import harder
Fixes: 6ac133c646 ("freedreno/drm: Fix race in zombie import")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26506>
2023-12-05 03:03:12 +00:00
Mohamed Ahmed
3c10b70ee8 nvk: Enable linear images for texturing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26365>
2023-12-05 02:47:18 +00:00
Mohamed Ahmed
03492b5532 nvk: Wire up rendering to linear
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26365>
2023-12-05 02:47:18 +00:00
Mohamed Ahmed
6ab7753042 nil: Add support for linear images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26365>
2023-12-05 02:47:18 +00:00
Mohamed Ahmed
b1737856ad nvk: Fix GetImageSubResourceLayout for non-disjoint images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26365>
2023-12-05 02:47:18 +00:00
Faith Ekstrand
db1ec1c67a nil: Add support for filling out linear texture headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26365>
2023-12-05 02:47:18 +00:00
Faith Ekstrand
bd667acb35 nvk: Advertise VK_EXT_subgroup_size_control
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9617
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26503>
2023-12-05 02:32:00 +00:00
Dmitry Baryshkov
579ea57db9 freedreno/regs: add mdp_fetch_mode enum
Basing on the DPU driver, add the mdp_fetch_mode enum. It describes the
SSPP fetching mode: linear, UBWC or tiled.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26471>
2023-12-05 01:19:50 +00:00
Dmitry Baryshkov
10cca7ac49 freedreno/regs/mdp_common: fix BPC comments
Fix comments for the BPC5 and BPC4A entries, so that they mention proper
bit width corresponding to this enum value.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26471>
2023-12-05 01:19:50 +00:00
Dmitry Baryshkov
80816f210d freedreno/regs/mdp_common: change BPC1 -> BPC4
This enum value corresponds to 4-bits colour instead of 1-bit colour.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26471>
2023-12-05 01:19:50 +00:00
Rob Clark
d05e81fa7f isaspec: Sort labels with same output
In order to get stable results from qsort() across different versions of
libc, toolchain, etc., sort labels with the same offset alphabetically.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10217
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26399>
2023-12-05 00:42:09 +00:00
Boris Brezillon
93e9bfcfd5 panfrost: Fix multiplanar YUV texture descriptor emission on v9+
Multiplanar YUV textures require two surface descriptors, and the
base address calculation should be moved inside the for loop,
otherwise we always take the base address of the first plane.

Fixes: 144f9324a3 ("panfrost: prepare v9+ to support YUV sampling")
Cc: stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26425>
2023-12-05 00:26:20 +00:00
Eric Engestrom
dafd6e776e venus: fix typo in comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26495>
2023-12-05 00:03:56 +00:00
Eric Engestrom
64a827a8e6 venus: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26495>
2023-12-05 00:03:56 +00:00
Eric Engestrom
f5297208d0 vk/overlay-layer: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Eric Engestrom
d0df3834b4 vk/util: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Eric Engestrom
d6144ba88f vk/wsi: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Eric Engestrom
84c27ea42c vk/runtime: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Lionel Landwerlin
7c76125db2 anv: use 2 different buffers for surfaces/samplers in descriptor sets
We had the unfortunate finding on a recent platform to learn that the
bindless sampler heap is not functioning as expected.

Nowhere in the documentation is the size of the heap written down. So
most people assumed that's the max number that we can program (4Gb).

The reality is that it's only 64Mb.

Though it is appearing like it's working properly for the whole 4Gb
range for most apps, this is only because the HW bounds checking
applied is broken. Instead of clamping anything beyong 64Mb, it's only
clamping the last 4Kb of each 64Mb region.

So this heap is useless for us to make a 4Gb region of both sampler &
surface states...

This change essentially turns off the bindless sampler heap on DG2+.

The only location where we can put SAMPLER_STATE elements is the
dynamic state heap. Unfortunately we cannot align the dynamic state
heap with the bindless surface state heap. So the solution is to
allocate sampler & surface states separately, each from the own heap
in the descriptor pool.

We now have to provide 2 sets of offsets for surfaces & samplers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>
2023-12-04 23:06:05 +00:00
Lionel Landwerlin
09a3a93372 anv: set layout printer
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>
2023-12-04 23:06:05 +00:00
Lionel Landwerlin
4608de6645 anv: add missing push descriptor flush on ray tracing pipelines
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>
2023-12-04 23:06:05 +00:00
Lionel Landwerlin
f26e83b6a4 anv: make a couple of descriptor function private
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>
2023-12-04 23:06:05 +00:00
Lionel Landwerlin
1cdadbcdf6 anv: move descriptor set type selection to earlier
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>
2023-12-04 23:06:05 +00:00
Lionel Landwerlin
18a1234541 anv: add a sampler state pool
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25897>
2023-12-04 23:06:05 +00:00
Eric Engestrom
ddc6bd11df nvk: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26492>
2023-12-04 22:50:26 +00:00
Sviatoslav Peleshko
5cb20b5edc anv: Fix MI_ARB_CHECK calls in generated indirect draws optimization
According to PRMs, to use self-modifying code correctly we have to
disable preparser before jumping to the generated commands, and re-enable
it with a first command in that buffer.

Old implementation did it wrong: for both inplace and inring generation
it disabled preparser before running the generation shader, had it
disabled during generation, and re-enabled it just before jumping to
the generated commands.

This usually didn't cause any trouble, because the generation shader and
generated draws are in different BOs, and the jump distance is greater than
the command FIFO depth. But we allocate them from the same pool,
so there are rare cases where the end of the BO with generation commands,
and the beginning of the BO with generated draws are adjacent. In such
cases, the wrong commands might be fetched.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10162
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/26427>
2023-12-04 22:02:59 +00:00
Sil Vilerino
936dd81ed9 ci: Build d3d12 gallium driver in debian-x86_32
Adding d3d12 to this ci build will prevent issues such
as #6708 or fixes like !26363 from happening again in the future.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26447>
2023-12-04 21:06:16 +00:00
Eric Engestrom
ebaede788e amd/ci: limit radv jobs to radv + aco files changes
Otherwise, any change in src/amd/ would always trigger all the radv
jobs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26460>
2023-12-04 20:43:53 +00:00
Eric Engestrom
03d8ea9912 amd/ci: split common amd files list from radeonsi files list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26460>
2023-12-04 20:43:53 +00:00
Eric Engestrom
98f0800c94 amd/ci: fix yaml indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26460>
2023-12-04 20:43:53 +00:00
Eric Engestrom
fc96bc9b58 hasvk: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26491>
2023-12-04 18:06:57 +00:00
Eric Engestrom
680d5fdaf3 anv: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26491>
2023-12-04 18:06:57 +00:00
José Roberto de Souza
7b2a0b6778 iris: Fix the mmap mode for IRIS_HEAP_DEVICE_LOCAL_PREFERRED
bos allocated into IRIS_HEAP_DEVICE_LOCAL_PREFERRED can always be
mmaped because it is also backed to smem which is not the case for
IRIS_HEAP_DEVICE_LOCAL.

This fixes issues with small PCIe bar systems.

Fixes: 21170a58d8 ("iris: Split system memory heap into cached-coherent and uncached heaps")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26455>
2023-12-04 16:35:15 +00:00
Alyssa Rosenzweig
d7f0804a47 nir/format_convert: handle clamping smaller bit sizes
asahi will pass in 16bits, works fine if we convert before clamping. note we
don't try to be clever and make a smaller immediate because it would require
extra logic for negatives to make sure we don't have garbage in upper bits
(nir_validate checks that). do the simple, obviously correct thing.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26440>
2023-12-04 15:41:19 +00:00
Lionel Landwerlin
33fd93f3b1 intel/tools: hang viewer/editor
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21167>
2023-12-04 14:51:29 +00:00
Lionel Landwerlin
1e17c2219a intel/error_decode: map i915 gfx12.5 register names to our names
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21167>
2023-12-04 14:51:29 +00:00
Lionel Landwerlin
a2a2624a8f intel/aubinator_error_decode: bump max buffers to 1024
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21167>
2023-12-04 14:51:29 +00:00
Lionel Landwerlin
df77e6da82 intel: add error2hangdump tool
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21167>
2023-12-04 14:51:29 +00:00
Lionel Landwerlin
a496abf177 intel/hang_replay: add the ability to pass the context image to sim-drm
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21167>
2023-12-04 14:51:29 +00:00
Lionel Landwerlin
03712579b0 intel/tools: add hang_replay tool
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21167>
2023-12-04 14:51:29 +00:00
Sergi Blanch Torne
008f56ec5a Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 3816e5dae7

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26313>
2023-12-04 13:15:36 +00:00
David Heidelberg
2143e2abbb Revert "ci/freedreno: disable a660 as it's down now"
Fixed.

This reverts commit 5161af7df70001ac1bb71f332c7bac180c3e25d1.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26497>
2023-12-04 12:52:48 +00:00
Friedrich Vock
d6d68ceda1 radv: Enable compute dispatch tunneling
Compute tunneling can considerably lower the latency of high-priority
compute work. Enabling it is beneficial in cases where high-priority
work is dispatched while the GPU is already busy with other work (e.g.
rendering on GFX). This is the case in VR compositors that dispatch
latency-sensitive compositing work to ACE while GFX is busy rendering
the next frame.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26462>
2023-12-04 12:32:47 +00:00
Eric Engestrom
b3ab233ff7 pvr: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26486>
2023-12-04 12:16:06 +00:00
Erik Faye-Lund
d8d49ad034 meson: work around meson 0.62 issue
Ubuntu 22.04 LTS has Meson 0.62, but recent versions of mesa fails to
build there due to an issue with using wayland-protocols from wrapdb,
that wasn't fixed until Meson 0.63. Luckily the problem is easy to
work around, so let's just do that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10232
Fixes: 5fe5c3e223 ("meson: add wayland-protocols from meson wrapdb")
Tested-by: Eero Tamminen <eero.t.tamminen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26446>
2023-12-04 11:41:37 +00:00
Pierre-Eric Pelloux-Prayer
5119e0adc3 egl/wayland: set the correct modifier for the linear_copy image
linear_copy_display_gpu_image is created using DRM_FORMAT_MOD_LINEAR,
so use createImageFromDmaBufs3 to be able to pass the modifier when
importing it on the render GPU.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9282
Reviewed-by: Simon Ser <contact@emersion.fr>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26337>
2023-12-04 11:03:41 +00:00
Eric Engestrom
778000ec7f radv: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26490>
2023-12-04 10:45:48 +00:00
Felix bridault
059391b631 radv: use 32bit va range for sparse descriptor buffers
Fixes: 5c5735fd68 ("radv: advertise VK_EXT_descriptor_buffer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26482>
2023-12-04 09:59:29 +00:00
Samuel Pitoiset
9027c6d8ca radv: adjust assertions for multi-layer resolves with the HW/FS paths
Only compute supports layers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26316>
2023-12-04 08:12:16 +00:00
Samuel Pitoiset
70556739e0 radv: only re-initialize DCC for one level for the HW resolve path
The source image can only have one level, so only level in the
destination image needs to be re-initialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26316>
2023-12-04 08:12:16 +00:00
Samuel Pitoiset
91aaf0c663 radv: remove unused layers support for the HW/FS resolve paths
The driver always fallbacks to the compute resolve path when either
the source or destination images have layers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26316>
2023-12-04 08:12:16 +00:00
Samuel Pitoiset
aae2595390 radv: stop performing redundant resolves with the HW resolve path
This path was quadratic...
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26316>
2023-12-04 08:12:16 +00:00
Samuel Pitoiset
e425f92f3e radv: simplify creating image views for src resolve images
The Vulkan spec says:

"If samples is not VK_SAMPLE_COUNT_1_BIT, then imageType must be
 VK_IMAGE_TYPE_2D, flags must not contain
 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, mipLevels must be equal to 1..."

So, the source image is always 2D with no mipmaps.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26316>
2023-12-04 08:12:16 +00:00
Sergi Blanch Torne
3816e5dae7 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

* Start: 2023-12-04 08:00 UTC
* End: 2023-12-04 12:00 UTC

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26312>
2023-12-04 07:16:55 +01:00
Eric Engestrom
38ce0c1747 v3dv: drop duplicate flag
`VK_PIPELINE_STAGE_2_TRANSFER_BIT` is the old name for
`VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT` which is already on the next
line; drop the duplicate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26485>
2023-12-04 04:13:39 +00:00
Eric Engestrom
1e03ac324f v3dv: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26485>
2023-12-04 04:13:39 +00:00
David Heidelberg
78bb77e41b ci/freedreno: disable a660 as it's down now
Let's prevent unpleasant morning workday surprises.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26488>
2023-12-03 22:19:19 +01:00
Eric Engestrom
2cdebf51fd amd/ci: radeonsi is gl, not vk
Fixes: cf323446e7 ("amd/ci: run gl(es) cts & piglit on radeonsi on vangogh")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26478>
2023-12-03 13:57:38 +00:00
Eric Engestrom
76be39ca6d ci_run_n_monitor: allow picking a pipeline by its MR
It picks the latest pipeline from the MR; if you want another pipeline,
use `--pipeline-url`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26381>
2023-12-03 11:28:49 +00:00
Eric Engestrom
ed53147a7f turnip: fix typo in comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26477>
2023-12-03 09:19:13 +00:00
Dylan Baker
10a0f87857 docs: Add sha256 sum for 23.2.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26476>
2023-12-03 08:12:37 +00:00
Dylan Baker
71655f33cf docs: add release notes for 23.2.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26476>
2023-12-03 08:12:36 +00:00
Eric Engestrom
cb923b3b4e docs: fix release date for 23.3.0
I forgot to generate the relnotes when I did the release, and when
I generated it a couple days later the script picked `today()` instead
of the date on the tag (because it's supposed to be run _before_ tagging
the release), and I didn't notice right away.

Fixes: cad37be6c9 ("docs: add release notes for 23.3.0")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26475>
2023-12-03 07:45:54 +00:00
M Henning
0e1bee73eb nak: Call nir_opt_shrink_vectors
This can shrink loads and stores in some cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
M Henning
d2657dbd21 nak: Call nir_opt_combine_barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
M Henning
1a1c81987d nak: Call nir_opt_load_store_vectorize
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
M Henning
b6c949917d nak: Provide robustness info to postprocess_nir
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
M Henning
7adb40cfaa nvk: Fix descriptor alignment offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
M Henning
b565b42991 nak: Use nir_combined_align
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
M Henning
6797b6ba45 nak: Request alignment that matches the load width
Previously, this callback could try to set the requested alignment to
NIR_ALIGN_MUL_MAX, which would then overflow the u16 value in the
struct. We don't actually need that much alignment though, and this
value only really matters if we needed to increase alignment anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26347>
2023-12-03 04:15:39 +00:00
Eric Engestrom
b7517aec9e docs: add sha256sum for 23.3.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26470>
2023-12-02 12:01:54 +00:00
Eric Engestrom
cad37be6c9 docs: add release notes for 23.3.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26470>
2023-12-02 12:01:54 +00:00
Eric Engestrom
2765b8aea4 bin/gen_release_notes: include removed 'new_features.txt' in commit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26469>
2023-12-02 11:55:26 +00:00
Eric Engestrom
f548d84a35 bin/python-venv: fix venv folder check
My last refactor before merging !26354 was incorrect and broke the
script when use for the first time (or after deleting the venv folder).

Fixes: 69ec13b303 ("bin/python-venv: detect python version change")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26453>
2023-12-02 11:48:35 +00:00
Eric Engestrom
2a6d750a53 bin/gen_release_notes: fix regex raw string
Fixes: ba6336ce3e ("docs: use version-number as toctree-title for relnotes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26468>
2023-12-02 11:44:45 +00:00
Eric Engestrom
402210034b radv/ci: add navi21-aco flake
Failed once in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52219125
but passed in the automatic retry.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26467>
2023-12-02 09:33:46 +00:00
Faith Ekstrand
6e2a7689b3 nak: Drop a bunch of SET_REFERENCE from the pre-Turing paths
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26408>
2023-12-02 03:05:09 +00:00
Faith Ekstrand
e0c2244ea9 nvk: Drop MME_DMA_SYSMEMBAR before indirect draw/dispatch
This reverts commit 3d3641e446.  We're now
doing this as part of CmdWaitEvents and CmdPipelineBarrier().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26408>
2023-12-02 03:05:09 +00:00
Faith Ekstrand
3a38526ff8 nvk: Drop unnecessary per-draw/dispatch cache maintenance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26408>
2023-12-02 03:05:09 +00:00
Faith Ekstrand
e1c1cdbd5f nvk: Implement vkCmdPipelineBarrier2 for real
We also need to plumb all the same logic into event handling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26408>
2023-12-02 03:05:09 +00:00
Faith Ekstrand
e962430e6f nvk: Rework transform feedback stalling
Instead of doing a compute shader invalidate, use SET_REFERENCE to force
a command streamer stall.  Also, emit a SYSMEMBAR before reading XFB
offsets through the MME.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26408>
2023-12-02 03:05:08 +00:00
Faith Ekstrand
ee22aa27b5 nvk: Move Begin/EndTransformFeedback to nvk_cmd_draw.c
There's nothing generic about this so it should go in the 3D-specific
file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26408>
2023-12-02 03:05:08 +00:00
Caio Oliveira
d96705e4b8 iris/xe2+: Use Region-based Tessellation redistribution
Update to recommended value from BSpec for xe2.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26438>
2023-12-02 02:22:07 +00:00
Caio Oliveira
f5d15d6a06 anv/xe2+: Use Region-based Tessellation redistribution
Update to recommended value from BSpec for xe2.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26438>
2023-12-02 02:22:07 +00:00
Jordan Justen
05632fc9eb intel/genxml: Update 3DSTATE_TE for xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26438>
2023-12-02 02:22:07 +00:00
Marcin Ślusarz
878ca75335 anv: fix minSubgroupSize for xe2
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26437>
2023-12-02 01:55:26 +00:00
Faith Ekstrand
00e88584af vulkan: Add helpers for access flags
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:51 +00:00
Faith Ekstrand
44add595af vulkan: Add helpers for pipeline stage flags
This adds hand-written helpers for detecting if a set of stage flags
contains shaders as well as expand helpers that properly handle
TOP/BOTTOM_OF_PIPE_BIT.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:51 +00:00
Faith Ekstrand
fe12c1c29e vulkan: Add some auto-generated synchronization helpers
These are helpful for drivers to implement synchronization rules

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:51 +00:00
Faith Ekstrand
9ad51980de vulkan: Move vk_synchronization2 to vk_synchronization
I'm about to add more stuff that isn't really for sync2 so it makes
sense to give it a slightly more generic name.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:50 +00:00
Faith Ekstrand
2538354850 nvk: Stop initializing the 2D engine
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26441>
2023-12-01 17:10:29 +00:00
Faith Ekstrand
85fd85f950 nvk: Use the copy engine for NVK_DEBUG=zero_memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26441>
2023-12-01 17:10:29 +00:00
Faith Ekstrand
74b083ef75 nvk: Use the copy engine for CmdFillBuffer
The copy engine is a lot simpler than the 2D engine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26441>
2023-12-01 17:10:29 +00:00
Mary Guillemard
771bf5aaa3 nak: Fix NAK_ATTR_CLIP_CULL_DIST_7 wrong value
Fixes: d4d7f26151 ("nak: Add enums for sysvals and attributes")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26452>
2023-12-01 16:40:24 +00:00
Samuel Pitoiset
bd54592487 radv: remove radv_pipeline_key::dynamic_color_write_mask
When this state is dynamic, the common runtime code sets the write mask
to 0xf which prevents color exports to be removed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26400>
2023-12-01 15:50:04 +00:00
Martin Roukala (né Peres)
a6f22aa182 radv: disable meshShaderQueries on gfx10.3
They have been causing hangs intermitently in CI for the past week,
until it finally caught my attention and forced me spend a couple of
hours bisecting the issue.

We'll re-introduce support for it when the issue is fixed.

Fixes: b975d4e800 ("radv: enable meshShaderQueries on GFX10.3")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26450>
2023-12-01 15:17:48 +00:00
Rohan Garg
8cfae77439 anv: enable VK_EXT_depth_range_unrestricted
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26426>
2023-12-01 13:23:54 +00:00
Rohan Garg
80cafa3571 anv: ensure that we clamp only when EXT_depth_range_unrestricted is not enabled
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26426>
2023-12-01 13:23:54 +00:00
Rohan Garg
2e72917923 blorp: set min/max viewport depths to -FLT_MAX/FLT_MAX when EXT_depth_range_unrestricted is enabled
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26426>
2023-12-01 13:23:54 +00:00
Samuel Pitoiset
ced313eec8 radv: make sure to prefetch the compute shader for DGC
It was never prefetched. These two helpers should be refactored with
radv_dispatch() though.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26417>
2023-12-01 12:25:46 +00:00
Samuel Pitoiset
ab6cf1592f radv: fix bogus interaction between DGC and RT with descriptor bindings
pipeline_is_dirty was never TRUE because it's emitted in the before
helper. This might fix bad interactions between DGC and RT because
they both use compute shaders and descriptor bindings need to be
re-emitted.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26417>
2023-12-01 12:25:46 +00:00
Frank Binns
b6f3b55b88 pvr: Add powervr winsys implementation
Co-authored-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Co-authored-by: Sarah Walker <sarah.walker@imgtec.com>
Co-authored-by: Matt Coster <matt.coster@imgtec.com>
Co-authored-by: Donald Robson <donald.robson@imgtec.com>
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Donald Robson <donald.robson@imgtec.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507>
2023-12-01 10:41:24 +00:00
Sarah Walker
be82fe7ab9 pvr: Add command stream and static context state layout to rogue_kmd_stream.xml
Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507>
2023-12-01 10:41:24 +00:00
Sarah Walker
90916c955b pvr: csbgen: Add dummy implementation of stream type
This is enough of an implementation to allow stream layout to be added to
rogue_kmd_stream.xml.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507>
2023-12-01 10:41:24 +00:00
Frank Binns
d9132b63d9 include/drm-uapi: add pvr_drm.h
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507>
2023-12-01 10:41:24 +00:00
Erik Faye-Lund
3a46181fe0 zink: do not handle PIPE_SWIZZLE_NONE
This is not a valid value for texture-views, whic is what we currently
use it for... And it's not the same as an identity swizzle anyway, in
the case we'd want to use it for something else in the future.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
2023-12-01 07:53:58 +00:00
Erik Faye-Lund
d7e067823b d3d12: do not handle PIPE_SWIZZLE_NONE from sampler-view
This shouldn't be possible, so not need to handle it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
2023-12-01 07:53:58 +00:00
Erik Faye-Lund
a5970c1a01 panfrost: do not handle NONE-swizzle
Neigher PIPE_SWIZZLE_NONE nor PIPE_SWIZZLE_MAX are legal here, so let's
not even try to handle it. If we ever get either here, we're triggering
a bug anyway.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
2023-12-01 07:53:58 +00:00
Erik Faye-Lund
e233eee492 lavapipe: do not use NONE-swizzle
The NONE-swizzle isn't supported for texture views in LLVMpipe, because
it's not meant for this purpose in the first place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
2023-12-01 07:53:58 +00:00
Erik Faye-Lund
1fbec9f532 util/format: document NONE swizzle
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
2023-12-01 07:53:58 +00:00
ratatouillegamer
5f7aa0e012 hasvk: Enable hasvk override Vulkan API Version for Brawlhalla
Brawlhalla runs good with DXVK 2.0+, it can be enable as default
avoiding to use OpenGL Brawlhalla renderer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26433>
2023-12-01 07:18:10 +00:00
ratatouillegamer
9de6928746 hasvk: Add Vulkan API version override
This allows to use a driconf to override the API version and expose Vulkan 1.3.
That can be used in conjunction with certain games like for example Brawlhalla
which benefits from some DXVK +2.0 features.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26433>
2023-12-01 07:18:10 +00:00
Gert Wollny
c13de0509c r600/sfn: Don't try to re-use iterators when the set is made empty
It seems with libc++ the iterators are invalidated when the set
is emptied during iterating over it.

Fixes: 05fab97 (r600/sfn: Don't try to re-use the iterator when uses is updated)

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26420>
2023-12-01 06:37:30 +00:00
Qiang Yu
b16017d080 nir: fix load layer id system_values_read info gather
Otherwise radeons+ACO compilation fail.

Fixes: 32ee6376ad ("nir: add lowering from FS LAYER input to LAYER_ID sysval")
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26422>
2023-12-01 03:17:57 +00:00
Rohan Garg
a499be0ee3 intel/genxml: Update IDD for new fields
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Rohan Garg
c916038b89 intel/genxml: Update COMPUTE_WALKER_BODY for xe2
Reworks:
 * Caio: Change patch to only add COMPUTE_WALKER_BODY and
   EXECUTE_INDIRECT_DISPATCH (that uses it).

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Rohan Garg
cc2dce82bc intel: Set a preferred SLM size for LNL
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
16483cd4bc iris: xe2 doesn't have INTERFACE_DESCRIPTOR_DATA::BarrierEnable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Rohan Garg
ef1c1ca821 intel/genxml: Add the preferred slm size enum for xe2
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
1e9972991c anv, iris: Update INTERFACE_DESCRIPTOR_DATA programming for xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
bdb9c70f84 intel/genxml: Update INTERFACE_DESCRIPTOR_DATA for xe2
Reworks:
 * Caio: Remove "Mask Stack Exception Enable", not present in BSpec.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
d95bbf35c9 anv: Set COMPUTE_WALKER Message SIMD field
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
59dc9b1df6 iris: Set COMPUTE_WALKER Message SIMD field
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
aafdf59dfe intel/genxml: Update COMPUTE_WALKER for xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Jordan Justen
064bdecb36 intel/compiler: Define XE2 compiler enum
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26390>
2023-12-01 02:36:12 +00:00
Tatsuyuki Ishi
eb0419a1aa radv: Remove aspect mask "expansion" for copy_image.
The Vulkan spec says multi-planar images can only be copied on a
per-plane basis. The COLOR_BIT to "all planes" expansion applies to
image memory barriers which is completely unrelated.

Remove the expansion logic to simplify the code. Add assertions to
clearly describe the invariant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26364>
2023-12-01 01:52:04 +00:00
Marek Olšák
7ffb65f935 ac: add an IB parser that gathers context rolls
This is an important performance bottleneck analysis tool.

Try it with radeonsi: AMD_ROLLS=filename app

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26349>
2023-12-01 01:15:55 +00:00
Marek Olšák
f0cb8852a4 ac: move the IB parsers into ac_parse_ib.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26349>
2023-12-01 01:15:55 +00:00
Marek Olšák
c5fe2780e6 ac: rename ac_parse_ib.c -> ac_ib_parser.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26349>
2023-12-01 01:15:55 +00:00
Peyton Lee
95c933c8b7 winsys, amdgpu, drm: add VPE submission handle
Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00
Peyton Lee
a212e9bdbf amd, radeonsi: supports post processing entrypoint
create a new decoder for handling post processing

Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00
Peyton Lee
ed176e2c71 amd, radeonsi: add si_vpe.c with helper functions of VPE lib
Signed-off-by: Peyton Lee <peytolee@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00
Peyton Lee
3ec397819e amd: add new hardware ip for vpe
Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00
Peyton Lee
17c20ceda7 amd,radeonsi: add libvpe
Signed-off-by: Peyton Lee <peytolee@amd.com>
Signed-off-by: Alan Liu <haoping.liu@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00
Peyton Lee
6b441ef6ab frontends, va: add new parameters of post processor
Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
2023-12-01 00:23:38 +00:00
Jesse Natalie
be05c9458a microsoft/clc: Fix image lowering pass to only erase variables at the end
Otherwise, if a variable has multiple derefs in a shader, we'll crash
trying to remove it a second time. No idea how that can happen though,
seems derefs got sunk by opt_dead_cf.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26435>
2023-11-30 23:32:08 +00:00
Lynne
aff59c63eb radv: change queue family order in radv_get_physical_device_queue_family_properties
Fixes: 748b7f80ef ("radv: Move sparse binding into a dedicated queue.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26428>
2023-11-30 22:45:49 +00:00
José Roberto de Souza
42dd48e933 anv: Fix vm bind of DRM_XE_VM_BIND_FLAG_NULL
In this case bo is NULL so application was crashing when it was trying
to get the alloc_flags of bo to get the intel_device_info_pat_entry.

Fixes: 1a0d3504d5 ("anv: Fill PAT fields in Xe KMD gem_create and vm_bind uAPIs")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26430>
2023-11-30 22:22:41 +00:00
Rhys Perry
5bc27e80c9 ac/nir: fix 32-bit offset global access optimization
Since 38cff03e58 ("radv: use nir_lower_conv64"), u2u64(a) is replaced
with pack_64_2x32_split(a, 0).

fossil-db (navi31):
Totals from 1203 (1.52% of 79330) affected shaders:
MaxWaves: 33685 -> 33813 (+0.38%)
Instrs: 1407031 -> 1374689 (-2.30%); split: -2.32%, +0.02%
CodeSize: 7088652 -> 6917320 (-2.42%); split: -2.43%, +0.01%
VGPRs: 69276 -> 68988 (-0.42%); split: -0.43%, +0.02%
SpillSGPRs: 982 -> 977 (-0.51%); split: -0.92%, +0.41%
Latency: 12536511 -> 12451605 (-0.68%); split: -0.94%, +0.27%
InvThroughput: 2456803 -> 2431241 (-1.04%); split: -1.09%, +0.05%
VClause: 27624 -> 27832 (+0.75%); split: -1.88%, +2.64%
SClause: 31757 -> 32702 (+2.98%); split: -0.53%, +3.51%
Copies: 90923 -> 91238 (+0.35%); split: -1.47%, +1.81%
Branches: 25127 -> 25128 (+0.00%); split: -0.00%, +0.01%
PreSGPRs: 46025 -> 46068 (+0.09%); split: -0.53%, +0.62%
PreVGPRs: 53944 -> 53488 (-0.85%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26402>
2023-11-30 21:50:21 +00:00
Rhys Perry
10ba06960f ac/nir: ignore 8/16-bit global access offset
This was found by inspection, I'm not sure it can even happen.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26402>
2023-11-30 21:50:21 +00:00
Caio Oliveira
bbb12dbbf9 intel/compiler: Add a few tests to opt_predicated_break
v2 (idr): Fix expectations BottomBreakWithContinue. opt_predicated_break
will remove the IF and make the CONTINUE predicated.

v3 (idr): Temporarily disable the one test that fails.

v4 (idr): Free strings allocated by open_memstream. Fixes gitlab CI
failures in debian-testing-asan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Caio Oliveira
0b072c5351 intel/compiler: Sort lists of succs and preds in CFG dump output
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Caio Oliveira
47c5656f0e intel/compiler: Allow dumping CFG to a specific FILE*
Add optional argument for both cfg and block dump() function to pass
a FILE*.  Default behavior remains dumping to stderr.

v2 (idr): Don't add the new test framework in this commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Caio Oliveira
21cf9323f0 intel/compiler: Add a few more helpers to fs_builder
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
c0ecc0d70b intel/compiler: Don't promote CFG link types when removing a block
Imagine 3 blocks A, B, and C. A has a physical link to B, and B has a
logical link to C. Previous to this commit, if B were removed, A would
get a logical link to C. This is not correct.

This was specifically observed to occur when block A was a DO block and
B was the WHILE block. The DO block would have two logical successors,
and that is completely invalid.

v2: Assert that the links from A-to-B and B-back-to-A are the same
kind. Suggested by Caio.

v3: Assume the successor and predecessor lists are well formed. Use this
to simplify the logic. Suggested by Caio. Add checks to cfg_t::validate
to ensure the lists are well formed.

v4: Remove (now unused) bblock_link_invalid. Suggested by Curro.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
77c0c1ce54 intel/compiler: Don't create extra CFG links when deleting a block
The previous is_successor_of and is_predecessor_of checks prevented
creating a physical link when a logical link already existed. However, a
logical link could be added when a physical link already existed. This
change causes an existing physical link to be "promoted" to a logical
link.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
7e842a75ac intel/compiler: Don't create extra CFG links in opt_predicated_break
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
bbd7729993 intel/compiler: Delete bidirectional block links in opt_predicated_break
Previously when earlier_block->children.make_empty() was called, the
child blocks would still have links back to earlier_block.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
5842829380 intel/compiler: Limit scope of cur_endif variable
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
02f9bbf6f3 intel/compiler: Add basic CFG validation
v2: Use _mesa_shader_stage_to_abbrev(stage) instead of
stage_abbrev. Noticed by Caio and GCC. That's what I get for not
recompiling after rebasing. Wrap cfg_t::validate in NDEBUG
magic. Suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Ian Romanick
19db6f1cd9 intel/vec4: Don't emit an empty ELSE
This matches the behavior of fs_visitor::nir_emit_if.

This is not technically wrong, but the cfg_t generates some invalid
parent / child links in this case.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
2023-11-30 20:58:05 +00:00
Rohan Garg
f3d99e3535 anv: introduce ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH
In order to rewrite timestamps for indirect dispatch's, instroduce a
ANV_TIMESTAMP_REWRITE_INDIRECT_DISPATCH that repacks the PostSync field
for a EXECUTE_INDIRECT_DISPATCH.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:45 +00:00
Rohan Garg
9dd49e7a63 anv: memcpy the thread dimentions only when they're on the CPU
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:45 +00:00
Rohan Garg
d161e3c2e2 iris: Emit a EXECUTE_INDIRECT_DISPATCH when available
On newer platforms (Arrowlake and above) we can issue a
EXECUTE_INDIRECT_DISPATCH that allows us to:

  * Skip issuing mi load/store instructions for indirect parameters

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:45 +00:00
Rohan Garg
580728564e anv: Emit a EXECUTE_INDIRECT_DISPATCH when available
On newer platforms (Arrowlake and above) we can issue a
EXECUTE_INDIRECT_DISPATCH that allows us to:
  * Skip issuing mi load/store instructions for indirect parameters

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:45 +00:00
Rohan Garg
6d4f43f0d6 anv: Emit EXECUTE_INDIRECT_DRAW when available
On newer platforms (Arrowlake and above) we can issue a
EXECUTE_INDIRECT_DRAW that allows us to:
  * Skip issuing mi load/store instructions for indirect parameters
  * Skip doing the indirect draw unroll on the CPU side when the
    appropriate stride is passed

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:45 +00:00
Rohan Garg
7a9e82e82f genxml/12.5: Add the EXECUTE_INDIRECT_DISPATCH instruction
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:45 +00:00
Rohan Garg
4229757309 genxml/12.5: Add the EXECUTE_INDIRECT_DRAW instruction
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:44 +00:00
Rohan Garg
6e060d99ba intel/dev: Add a bit for when the HW can do a indirect draw/dispatch unroll
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:44 +00:00
Rohan Garg
fa350862e9 anv: refactor kernel dispatch to use new common functions
Refactor the function to use the new common functions introduced for
indirect dispatch previously.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:44 +00:00
Rohan Garg
51d2d9a665 anv: Refactor loading indirect parameters and filling IDD
Refactor out loading the indirect parameters and filling the interface
descriptor data.

Reworks:
 * Jordan: Change anv to use get_interface_descriptor_data which
   returns the IDD struct rather than filling it.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26421>
2023-11-30 17:01:44 +00:00
Gert Wollny
ac4b8aab21 r600/sfn: Fix usage of std::string constructor
Fixes: f718ac6268 (r600/sfn: Add a basic nir shader backend)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26415>
2023-11-30 16:42:43 +00:00
Gert Wollny
eb25c7a4e2 r600/sfn: keep workgroup and invocation ID registers for whole shader
For some reason one must not overwrite these values "too early", so
pin them for the whole shader.

Fixes: 79ca45 (r600/sfn: rewrite NIR backend)
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10004

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25846>
2023-11-30 16:04:05 +00:00
Gert Wollny
5de814171b r600/sfn: Allow skipping backend shader optimization for a subset of shaders
This comes in handy when debugging problems with the backend optimizer

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25846>
2023-11-30 16:04:05 +00:00
Erik Faye-Lund
777c25255b panfrost: minify dimensions when converting modifiers
When blitting resources, we need to specify the boxes in mip-level sized
coordinates. For the X and Y coordinates, missing this makes things
behave correctly, but only because we end up clipping away the excess
area.

However, for the Z coordinate of 3D textures, this will make us read
outside of the mip-chain during blitting, making us stumble and crash.

But let's fix what we do for all dimensions. And while we're at it,
rewrite the code a bit, so we don't end up computing any needless
values.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26077>
2023-11-30 15:43:59 +00:00
José Roberto de Souza
b27ca68143 intel/dev: Adjust prefetch_size values for Xe2 engines
Xe2 follows MTL and has different prefetch sizes for different
types of engines.

BSpec: 60223
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26396>
2023-11-30 14:54:04 +00:00
Boyuan Zhang
046cc51223 radeonsi/vcn: add new logic for hevc multi slices reflist
For multi slices hevc decoding, use the newly defined buffer to handle
the case for multi slices ref pic list.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26081>
2023-11-30 08:39:34 -05:00
Boyuan Zhang
d07517d19f radeonsi: add new interface to handle multi slice reflist
Add new flag and buffer to handle multi slice reflist case for hevc.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26081>
2023-11-30 08:39:31 -05:00
Boyuan Zhang
ffdc83e9dd frontend/va: add support for multi slices reflist
According to codec spec, hevc supports different reference picture lists
for multi slices case. For example, each slice can have it's own ref pic
list. Add this support to pipe, and modify both frontend/va and radeonsi
accordingly.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26081>
2023-11-30 08:39:28 -05:00
Boyuan Zhang
26237b9807 gallium/pipe: define hevc max slices number
No logic change, just use define instead of hardcoded number to make
it more clear.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26081>
2023-11-30 08:39:25 -05:00
Eric Engestrom
02fe92c908 ci: disable opengl & gles in debian-vulkan build
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26369>
2023-11-30 08:47:07 +00:00
Eric Engestrom
69ec13b303 bin/python-venv: detect python version change
The venv only works for a specific python version; when updating python,
the venv needs to be regenerated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26354>
2023-11-30 08:39:17 +00:00
Faith Ekstrand
01d15d8a38 nak: Revert "nak: Handle non-DW-aligned UBO loads"
This reverts commit 70c9fc66ffab8cb85b37c74b507201097e16da85.  We're now
handling non-DW-aligned UBO loads in NIR where we can handle it a bit
more completely, we don't need to carry the nak_from_nir code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26412>
2023-11-30 05:05:00 +00:00
Faith Ekstrand
67e6ca1924 nak/nir: Handle CBuf alignment rules
The NIR lowering is more complete and lets us properly handle 16-bit
loads which, weirdly, require a 4B alignment.

Fixes: bda208665f ("nak: Handle non-DW-aligned UBO loads")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26412>
2023-11-30 05:05:00 +00:00
Timothy Arceri
57acffbba8 glsl: remove GLSL IR lower_named_interface_blocks()
We now use a NIR based lowering pass instead.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26001>
2023-11-30 03:45:08 +00:00
Timothy Arceri
cdf0ed8960 glsl: use the nir based lower_named_interface_blocks()
Because we are now doing the lowering in NIR we need to move the code
that sets the compact flag on some builtin vars out of the glsl to nir
pass.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26001>
2023-11-30 03:45:07 +00:00
Timothy Arceri
bedf504d38 glsl: add nir based lower_named_interface_blocks()
This will be used in the following patch to replace the GLSL IR
version of this pass.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26001>
2023-11-30 03:45:07 +00:00
Faith Ekstrand
5311d8713d nak: Implement scan/reduce on booleans
We could use the lowering in nir_lower_subgroups for this but it's a lot
more complicated than we need and uses quad_any/all which we don't have.

Fixes: cca40086c6 ("nak: Lower scan/reduce in NIR")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26411>
2023-11-30 02:50:25 +00:00
Eric Engestrom
fc30a29bd6 docs/calendar: add 23.3.x releases
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26405>
2023-11-29 21:05:45 +00:00
Eric Engestrom
e2cd0ece86 docs: update calendar for 23.3.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26405>
2023-11-29 21:05:45 +00:00
Yiwei Zhang
3475c8cc41 venus: scrub msaa sample mask only with valid msaa state
No crash in dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics

Fixes: 417437c715 ("venus: pipeline fixes for VK_EXT_extended_dynamic_state3")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26404>
2023-11-29 20:49:29 +00:00
Pierre-Eric Pelloux-Prayer
b9f4e3c39b Revert "radeonsi: decrease PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS to 1024"
This reverts commit 03353bd752.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10222
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26401>
2023-11-29 19:33:48 +00:00
Sagar Ghuge
4ebad93c9c anv,hasvk: Use uint32_t for queue family indices
Vulkan API uses uint32_t for the queue family indices.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26387>
2023-11-29 19:07:17 +00:00
Bas Nieuwenhuizen
748b7f80ef radv: Move sparse binding into a dedicated queue.
1) This better reflects the reality that we only have one timeline
   of sparse binding changes.

2) Allows making it a threaded queue from the start in prep of
   explicit sync stuff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16935>
2023-11-29 17:37:37 +00:00
Bas Nieuwenhuizen
00faefa08e radv: Remove the sparse binding queue from coherent images.
Never access the image on the queue family, so no need.

(Technically not sure if this is needed for Vulkan, somewhat of
 a backstop in case apps do it)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16935>
2023-11-29 17:37:37 +00:00
Bas Nieuwenhuizen
6ff98f9313 radv: Add implementation of cmd buffers for a sparse binding queue.
None of the commands are allowed on these ...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16935>
2023-11-29 17:37:37 +00:00
Alessandro Astone
4f48a140ac asahi: Use the compat version of qsort_r
Not all platforms define qsort_r, util_qsort_r takes care of that.

CC: mesa-stable
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25553>
2023-11-29 17:01:09 +00:00
José Roberto de Souza
c9e41f25a1 anv: Add heaps for Xe KMD in platforms without LLC
As Xe KMD don't support WB + 0 way coherency, so this are the only two
memory types possible for integrated GPUs without LLC in Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
1a0d3504d5 anv: Fill PAT fields in Xe KMD gem_create and vm_bind uAPIs
Unlike i915, Xe KMD needs the cache parameter in gem_create
then during vm bind it request the PAT index that matches previous
parameter.
The PAT index selected could have more memory caracteristics that KMD
don't need to know.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
99ae565af2 anv: Prepare anv_device_get_pat_entry() for discrete GPUs
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
eb18a92ef9 iris: Fill PAT fields in Xe KMD gem_create and vm_bind uAPIs
Unlike i915, Xe KMD needs the cache parameter in gem_create
then during vm bind it request the PAT index that matches previous
parameter.
The PAT index selected could have more memory caracteristics that KMD
don't need to know.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
d26bd29ab4 iris: Prepare iris_heap_to_pat_entry() for discrete GPUs
Xe KMD requires PAT information for discrete GPUs as well.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
05b3967ddc intel: Enable has_set_pat_uapi for Xe
Xe KMD requires that all platforms supported by it set PAT information.
This will be implemented in Iris and ANV in the next patches.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
183fd14143 intel: Sync xe_drm.h
Sync xe_drm.h with commit ebe27e42c0a2 ("drm/xe/uapi: support pat_index selection with vm_bind").

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
500e037661 intel: Add PAT entries for gfx12 and newer
Xe KMD requires PAT for all platforms so here adding PAT entries to
all platforms supported by Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
d491742d19 anv: Add support all possible cached and coherent memory types
This changes allow us to support HOST_COHERENT, HOST_CACHED and
HOST_COHERENT + HOST_CACHED memory types for platforms that has
the PAT uAPI.

Be aware that Xe KMD will not be able to support cached only memory
types, anv_xe_physical_device_init_memory_types() will reflect that
but internal usage should not allocate
VK_MEMORY_PROPERTY_HOST_CACHED_BIT only memory, hence the assert
added.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
José Roberto de Souza
3baab9bb38 anv: Rename ANV_BO_ALLOC_SNOOPED to ANV_BO_ALLOC_HOST_CACHED_COHERENT
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25462>
2023-11-29 14:57:42 +00:00
Alyssa Rosenzweig
d50d9eccad ac,radv,radeonsi: use common 1D texture lowering
It was pulled from ac.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26397>
2023-11-29 14:04:15 +00:00
Erik Faye-Lund
ba2bbe21b4 ci: opt-out panfrost from clang-format
In 0e481bf463 ("ci: Opt out asahi from clang-format"), Alyssa
recommended other drivers to follow suit. Since Panfrost originates from
Alyssa, and I doubt any other of the developers particularly cares too
much about this, let's follow her recommendation.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26062>
2023-11-29 13:01:08 +00:00
Jan Beich
112093f9e2 intel: make CLOCK_BOOTTIME optional for non-Linux
src/intel/common/xe/intel_gem.c:71:9: error: use of undeclared identifier 'CLOCK_BOOTTIME'
   case CLOCK_BOOTTIME:
        ^

Fixes: ae0df368a8 ("intel/common: Add intel_gem_read_correlate_cpu_gpu_timestamp()")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26392>
2023-11-29 10:14:01 +00:00
Jan Beich
5c32c41f65 intel: make CLOCK_TAI optional for non-Linux
src/intel/common/xe/intel_gem.c:72:9: error: use of undeclared identifier 'CLOCK_TAI'
   case CLOCK_TAI:
        ^

Fixes: ae0df368a8 ("intel/common: Add intel_gem_read_correlate_cpu_gpu_timestamp()")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26392>
2023-11-29 10:14:01 +00:00
Tapani Pälli
ec43c20182 anv: implement dummy blit for Wa_16018063123
Insert a dummy blit prior to MI_ARB_CHECK, MI_SEMAPHORE_WAIT,
MI_FLUSH_DW submitted on the copy engine.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26209>
2023-11-29 08:09:06 +00:00
Tapani Pälli
889d16a43a iris: implement dummy blit for Wa_16018063123
Insert a dummy blit prior to MI_ARB_CHECK, MI_SEMAPHORE_WAIT,
MI_FLUSH_DW submitted on the copy engine.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26209>
2023-11-29 08:09:06 +00:00
Konstantin Seurer
827b0fa1ef nir/lower_vars_to_scratch: Remove all unused derefs
If the shader passed to nir_lower_vars_to_scratch contains some unused
derefs to a variable that will be lowered, validation will fail because
the variable is not part of the shader after the pass.

cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26271>
2023-11-29 06:49:48 +00:00
Faith Ekstrand
f9c7f33613 nvk: Enable 8 and 16-bit integer types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
bda208665f nak: Handle non-DW-aligned UBO loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
ed535c9d98 nak: Implement integer conversions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
3b3f251471 nak: Implement more int/float conversions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
9e84e9e44b nak: Add base support for 8 and 16-bit types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
082c986614 nak: Fix int8/16 lowering
Move it into nak_postprocess_nir, after lower_mem_access_bit_sizes.
Also, fix the callback for comparison and conversion ops.

For conversion ops, we don't want to lower any of them right now. We'll
need to lower some 64-bit conversions eventually but we'll figure out
those details when we get to implementing real 64-bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
dc5cc847dd nak: Implement nir_op_extract_*
This should make a lot of bit twiddling more efficient since NIR can
optimize certain shifts patterns to extract and we can implement it with
a single PRMT instruction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
c0d0ce4c6b nak: Rework OpPrmt a bit
This renames `selection` to `sel`, adds a source type for sel, adds the
PrmtMode for selecting permute mode, and adds proper legalization.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
7b6103ccc8 nak: Add a builder helper for OpPrmt
The builder also has some extra smarts in it for avoiding the PRMT when
the operation happens to exactly select one of the two sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Faith Ekstrand
d5693a590e nak: Drop the PrmtSelection stuff
It's just a very fancy and verbose way to build an immediate.  I don't
think it's really gaining us all that much, especially when the
semantics are documented in the PTX docs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26348>
2023-11-29 02:01:35 +00:00
Lionel Landwerlin
7dff232c09 intel/ds: add trace of buffer markers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14924>
2023-11-29 01:16:22 +00:00
Kenneth Graunke
c8e122a738 anv: Implement rudimentary VK_AMD_buffer_marker support
This provides a basic implementation of VK_AMD_buffer_marker: we can
write the 32-bit markers from within a command buffer.  Unfortunately,
our hardware has several limitations that make this difficult to
implement well:

   1. We don't have insight into when specific stages finish (i.e.
      all geometry shaders are done, but pixel rasterization may
      still be occurring).

   2. We cannot perform pipelined writes of 32-bit values to arbitrary
      memory locations.  PIPE_CONTROL::Write Immediate Value would be
      the obvious way to implement this, but it only supports 64-bit
      values, and the extension doesn't allow us to do that.  We instead
      use MI_STORE_DATA_IMM to write 32-bit values, but this requires
      hard stalls.

Despite those limitations, the extension may still be useful for tools
to debug GPU hangs.  We hope to offer another extension in the future
which offers similar functionality but is more efficient on our GPUs.

v2: Updated by Lionel Landwerlin to fix a number of flushing and
    cache coherency issues with these writes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14924>
2023-11-29 01:16:22 +00:00
Juston Li
746da376e4 venus: implement vkGet[Device]ImageSparseMemoryRequirements
These were left unimplemented despite sparse support being added back to
venus in a55d26b5 ("venus: add back sparse binding support")

Same as vn_GetPhysicalDeviceSparseImageFormatProperties2, venus sparse
support requires queues that also support transfer so any sparse-only
queues are filtered out. If a device only supports sparse with
sparse-only queues, sparse features are disabled and these functions
return count of 0.

Fixes: a55d26b566 ("venus: add back sparse binding support")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26297>
2023-11-29 00:22:26 +00:00
Faith Ekstrand
a0355dfcfb nvk: Advertise Vulkan 1.1 on Turing+
We actually trigger on whether or not NAK is used for everything.  If
so, we claim 1.1, otherwise claim 1.0.  We need NAK for subgroup ops and
other advanced shader features in later Vulkan versions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26383>
2023-11-28 23:52:27 +00:00
Faith Ekstrand
93acce99f3 vulkan: Default override patch version to VK_HEADER_VERSION
The patch version shouldn't matter but, on the off chance it does, we
don't want to be advertising non-existent versions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26383>
2023-11-28 23:52:27 +00:00
Konstantin Seurer
11897376c7 radv/rt: Skip null checks for small case counts
The individual cases make sure the sbt_idx is not null implicitly
because the handles are always != 0.

Totals from 60 (22.56% of 266) affected shaders:
Instrs: 47841 -> 47655 (-0.39%)
CodeSize: 255028 -> 253460 (-0.61%)
Latency: 1179658 -> 1225311 (+3.87%); split: -0.02%, +3.89%
InvThroughput: 224122 -> 232851 (+3.89%); split: -0.02%, +3.92%
Copies: 12049 -> 12043 (-0.05%); split: -0.37%, +0.32%
Branches: 3312 -> 3290 (-0.66%)
PreSGPRs: 3494 -> 3472 (-0.63%)

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25089>
2023-11-28 22:58:35 +00:00
Konstantin Seurer
fe674f67b1 radv/rt: Use a helper for inlining non-recursive stages
So we don't have to write the same logic multiple times.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25089>
2023-11-28 22:58:35 +00:00
Sagar Ghuge
3f747fcbfc iris: Init aux map state for compute engine
We need to write the aux map address during the batch initialization for
compute engine as well otherwise we would run into gpu hang with
compression enabled.

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

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26342>
2023-11-28 21:27:59 +00:00
Alyssa Rosenzweig
d5e0901fd5 agx: fix 1D texture sampling
fixes texwrap 1d bordercolor cases.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26377>
2023-11-28 20:32:03 +00:00
Alyssa Rosenzweig
e14633fa7d nir/lower_tex: Add 1D lowering
From amd/common.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26377>
2023-11-28 20:32:03 +00:00
Caio Oliveira
5de5a0d475 intel/compiler: Don't use fs_visitor::bld in thread payload classes
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26301>
2023-11-28 19:53:51 +00:00
Caio Oliveira
2d6240ab14 intel/compiler: Don't use fs_visitor::bld in fs_reg_alloc
Just set up the builder without relying on the pre-existing one.  Moves
one step close to remove bld from fs_visitor.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26301>
2023-11-28 19:53:51 +00:00
Caio Oliveira
f55867b56c intel/compiler: Don't use fs_visitor::bld in tests
Tests create their own fs_builder now.  Moves one step closer to remove
bld from fs_visitor.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26301>
2023-11-28 19:53:51 +00:00
Caio Oliveira
9540259e1c intel/compiler: Prefer ctor/dtors in some Google Tests
Per Google Test FAQ recommendation, prefer consutrctors and destructors
unless there's a need to use SetUp/TearDown.

We will take advantage of this later to initialize an fs_builder.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26301>
2023-11-28 19:53:51 +00:00
José Roberto de Souza
d0db92b52d iris: Check for maximum allowed priority in Xe KMD
Previous code was settting whatever priority was requested even if
Xe KMD would not allow it causing warnings in dmesg:

xe 0000:00:02.0: [drm:exec_queue_set_priority [xe]] Ioctl argument check failed at drivers/gpu/drm/xe/xe_exec_queue.c:235: value > xe_exec_queue_device_get_max_priority(xe)
xe 0000:00:02.0: [drm:xe_exec_queue_set_property_ioctl [xe]] Ioctl argument check failed at drivers/gpu/drm/xe/xe_exec_queue.c:912: ret

Now it will query the maximum allowed priority and set the priority
closed to what application requested.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26325>
2023-11-28 18:17:45 +00:00
José Roberto de Souza
6a245e4eea intel: Share function to do device query in Xe KMD
A "dance" is required with this uAPI, first we need to ask KMD what is
the size of the giving query id, then memory needs to be allocated to
match that size and then query again with the memory address set and
at this time Xe KMD will copy the query data to memory.

This dance was being duplicated in xe_engine_get_info() and
anv_xe_physical_device_get_parameters() and the next patch will also
use it in Iris, so here adding it common/xe and re-using as much
as possible.

There is one more implementation of this function in intel/dev but
due to how libs are linked intel/dev can't depend on to intel/common.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26325>
2023-11-28 18:17:45 +00:00
Marek Olšák
c5e37e7c39 radeonsi: only expose GL_AMD_performance_monitor on gfx7-10.3
It's only implemented for those generations.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26262>
2023-11-28 17:34:26 +00:00
Marek Olšák
c7729effa6 radeonsi: group equal CAP cases
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26262>
2023-11-28 17:34:26 +00:00
Marek Olšák
7a7285bc69 gallium: add PIPE_CAP_PERFORMANCE_MONITOR for GL_AMD_performance_monitor
Use a CAP instead of guessing it. radeonsi won't expose it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26262>
2023-11-28 17:34:26 +00:00
Marek Olšák
6073a149b9 gallium/docs: make CAP doc order match definition order
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26262>
2023-11-28 17:34:26 +00:00
Christian Gmeiner
0d6803feb0 docs: Update etnaviv extensions
Next round of feature updates.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26189>
2023-11-28 16:55:51 +00:00
Raphaël Gallais-Pou
5c92ef9116 gallium: add sti DRM entry point
stih418-b2264 implements an ARM Mali 400 GPU[1]. Add an entry point for sti
DRM vendor, so mesa can be used with it.

[1]: https://lore.kernel.org/lkml/20230727215141.53910-14-avolmat@me.com

Signed-off-by: Raphaël Gallais-Pou <rgallaispou@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26189>
2023-11-28 16:55:51 +00:00
Lionel Landwerlin
b18006397b anv: remove heuristic preferring dedicated allocations
This heuristic doesn't show much difference when you have a beafy
processor but on lower end skus, it increase the number of buffers in
the execbuffer ioctl, adding significant overhead in i915.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4cdd3178fb ("anv: Meet CCS alignment reqs with dedicated allocs")
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26335>
2023-11-28 16:13:11 +00:00
Lionel Landwerlin
7b87e1afbc anv: track & unbind image aux-tt binding
This solves a problem when you have a big memory chunk of which some
regions are bound to images. If the image is destroyed, currently the
aux-tt mapping stays and prevent any new image aux-tt mapping within
that region, until the memory is freed.

This maps & unmaps the aux-tt region at respectively bind & destroy
time, so that the memory chunks can be map through aux-tt.

If there is aliasing of memory to 2 different images, then the first
one "wins" the aux mapping and gets compression support. The second
one doesn´t.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ee6e2bc4a3 ("anv: Place images into the aux-map when safe to do so")
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26335>
2023-11-28 16:13:11 +00:00
Lionel Landwerlin
b09db9d823 anv: use main image address to determine ccs compatibility
The BO address is not really a good criteria since we can bind an
image at an offset inside a BO.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ee6e2bc4a3 ("anv: Place images into the aux-map when safe to do so")
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26335>
2023-11-28 16:13:11 +00:00
Lionel Landwerlin
7c6faa1efe intel/aux_map: introduce ref count of L1 entries
To implement this feature, we need to do CPU side tracking of all
L3/L2/L1 entries. This does add a little bit of CPU allocations, but
the advantage is that the traversal of the page table tree is faster.
No more need for the linear seach of find_buffer().

With this feature, we can have multiple VkImage bind to the same main
memory address, as long as they share exact same mapping parameters.
The AUX mapping will be removed when the last VkImage is destroyed.

As previously, if the L1 mapping entry parameters don't match, the
mapping fails. Anv handles this nicely by just disabling AUX on the
image.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26335>
2023-11-28 16:13:11 +00:00
Samuel Pitoiset
02ef01fa95 radv: enable DGC preprocessing for IBO
This seems to improve performance for Starfield by +1% and Halo Infinite
by +15%!

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10025
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26172>
2023-11-28 14:07:37 +00:00
Samuel Pitoiset
e59a16bbb8 radv: use an indirect draw when IBO isn't updated as part of DGC
To remove the dependency on the cmd buffer state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26172>
2023-11-28 14:07:37 +00:00
Samuel Pitoiset
2807e27231 radv: set the stream VA for DGC graphics
This will be used to emit indirect draws when needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26172>
2023-11-28 14:07:37 +00:00
Samuel Pitoiset
88bbdfd23e radv: remove useless NIR instructions when emitting IBO with DGC
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26172>
2023-11-28 14:07:37 +00:00
Lionel Landwerlin
e22e88f8ce intel/fs: reuse set_predicate()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26306>
2023-11-28 13:40:07 +00:00
Lionel Landwerlin
83a1657b6c intel/fs: fix incorrect register flag interaction with dynamic interpolator mode
Once NIR code is lowered and a few optimization passes have run, there
might be flag register interactions between instructions quite far
away from one another.

In the following case :

   f0 = and r0, r1
   ...
   fs_interpolate r2, r3
   ...
   if f0
      ...
   endif

If we lower fs_inteporlate while using the f0 register, we completely
garble the value meant for the if block.

To fix this, emit the predication for fs_interpolate in brw_fs_nir.cpp
when doing the NIR translation to the backend IR. This will guarantee
that the flag register interactions are visible to the optimization
passes, avoiding the problem above.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 68027bd38e ("intel/fs: implement dynamic interpolation mode for dynamic persample shaders")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9757
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26306>
2023-11-28 13:40:07 +00:00
Georg Lehmann
4b9618ceec aco: add test for post-ra DPP clobbered in linear cfg
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26373>
2023-11-28 12:48:56 +00:00
Georg Lehmann
576afa8540 aco: don't optimize DPP across more than one block
Register write tracking doesn't work for inactive lanes, so this was unsafe.

Foz-DB Navi31:
Totals from 8 (0.01% of 78196) affected shaders:
Instrs: 11513 -> 11515 (+0.02%)
CodeSize: 61056 -> 61064 (+0.01%)

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10197
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26373>
2023-11-28 12:48:56 +00:00
Samuel Pitoiset
06c9e69f44 radv/ci: add new flakes for VEGA10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26384>
2023-11-28 09:04:08 +01:00
Jesse Natalie
f843b14c17 d3d12: Fix hevc encoder 32-bit build (uint64_t -> size_t)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26363>
2023-11-27 21:15:24 +00:00
Jesse Natalie
ae62fc01fa d3d12: Fix h264 encoder 32-bit build (uint64_t -> size_t)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26363>
2023-11-27 21:15:24 +00:00
Faith Ekstrand
500955b6cb nak: Only insert barriers around ifs if they actually re-converge
We don't care about patterns like

    loop {
        ...
        if (...) {
            break;
        } else {
            ...
        }
        ...
    }

In that case, we don't need to sync after the if because there's nothing
to re-converge.  Every path except one will end up breaking out of it
anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26382>
2023-11-27 20:59:34 +00:00
Faith Ekstrand
804201a3d7 nak: Run rustfmt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26382>
2023-11-27 20:59:34 +00:00
Faith Ekstrand
e93935dd04 nvk: Limit shader stages to supported stages
Fixes: c7c73d6d17 ("nvk: Enable subgroups features")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26382>
2023-11-27 20:59:34 +00:00
Iván Briano
6f9be9a2a0 hasvk: ensure we reapply always pipeline dynamic state in runtime state
Backport of 24631d308c

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26341>
2023-11-27 20:36:07 +00:00
Rhys Perry
2d98236dd5 ac/nir: fix partial mesh shader output writes on GFX11
Fixes dEQP-VK.mesh_shader.ext.smoke.monolithic.mesh_shader_triangle with
nir_opt_combine_stores disabled.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 240e16fc8e ("ac/nir/ngg: Use attribute ring for mesh shader params.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25530>
2023-11-27 20:11:03 +00:00
Mary Guillemard
f59665bb62 venus: Do not submit batch manually when no feedback is required
This fixes hangs with Zink on piglit spec@arb_sparse_buffer tests caused by the double submission.

Fixes: a55d26b566 ("venus: add back sparse binding support")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26375>
2023-11-27 19:53:09 +00:00
Jesse Natalie
1924cdc289 d3d12: Fix multidimensional array ordering
Apparently my C multimensional array syntax was rusty.

Fixes: a6740ee7 ("d3d12: Fix indexing of local_reference_state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26362>
2023-11-27 19:36:16 +00:00
Samuel Pitoiset
da3f3a46b1 ci: uprev vkd3d-proton to 2.11
This contains many new tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26376>
2023-11-27 15:18:19 +00:00
Eric Engestrom
cf510e38a5 intel/ci: fix .hasvk-manual-rules
Fixes: 570acf5655 ("ci: Add a manual full and 1/10th hasvk CTS runs.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26259>
2023-11-27 12:55:18 +00:00
Eric Engestrom
1942073112 intel/perf: fix regex escaping
`\$` is interpreted before being passed to `re.search()`, but luckily
for us the escape is also invalid and because of that, python 3.12+
warns us about it.

Use a raw string instead, so that the `\` is passed untouched to
`re.search()`.

Fixes: aa04b47c6e ("intel/perf: add support for GtSlice/GtSliceXDualsubsliceY variables")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26355>
2023-11-27 11:58:03 +00:00
Eric Engestrom
1492d24f89 lp: make sure 0xff is unsigned before shifting it past signed int range
src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:2446:82: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26368>
2023-11-27 09:51:01 +00:00
Christian Gmeiner
023fa0aa5d etnaviv: Mark etna_rs_gen_clear_surface(..) private
There are no users outside of etnaviv_rs.c.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Tested-by: Marek Vasut <marex@denx.de>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26096>
2023-11-27 06:59:05 +00:00
Christian Gmeiner
9342544ca5 etnaviv: rs: Call etna_rs_gen_clear_surface(..) when needed
Calling etna_rs_gen_clear_surface(..) during surface creation could end
in the following assert:
   etna_rs_gen_clear_surface: Assertion `!"" "bpp not supported for clear by RS"'

Lets call etna_rs_gen_clear_surface(..) only when it is needed.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Tested-by: Marek Vasut <marex@denx.de>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26096>
2023-11-27 06:59:05 +00:00
Pierre-Eric Pelloux-Prayer
945288ffae radeonsi: check sctx->tess_rings is valid before using it
Fixes: c89ca3b47f ("radeonsi: change si_emit_derived_tess_state into a state atom")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10015

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26190>
2023-11-25 15:33:03 +00:00
Marek Olšák
b6e98677c3 nir/print: print PATCH0 and VARn_16BIT names instead of numbers for TCS and TES
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26275>
2023-11-25 09:50:19 -05:00
Marek Olšák
5c8730ebe8 nir: don't declare illegal varyings in nir_create_passthrough_tcs
I called it accidentally with LAYER.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26275>
2023-11-25 09:50:19 -05:00
Marek Olšák
7a9b73fcb8 nir: fix gathering TESS_LEVEL_INNER/OUTER usage with lowered IO
Those varyings shouldn't flag patch_inputs_read/patch_outputs_written.

Fixes: 10be706778 - nir: gather indirect info from lowered IO intrinsics

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26275>
2023-11-25 09:50:19 -05:00
Eric Engestrom
827bbe4829 ci: use released version of meson
This was needed before 1.3.0 was released, but now we can use 1.3.0 :)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26289>
2023-11-24 20:45:45 +00:00
Jesse Natalie
698344b93c d3d12/driconf: Force on ARB_texture_view for Blender
Reviewed-by: Anthony Roberts <anthony.roberts@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26326>
2023-11-24 20:03:22 +00:00
Eric Engestrom
9feecda201 docs: add another -rc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26361>
2023-11-24 19:51:01 +00:00
Eric Engestrom
69d1e29dc3 docs: update calendar for 23.0.0-rc5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26361>
2023-11-24 19:51:01 +00:00
Faith Ekstrand
28ae3210e1 nvk: Wire up MESA_VK_VERSION_OVERRIDE
We'll probably drop this once we have Vulkan 1.3 but this makes it a bit
easier to test stuff right now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26359>
2023-11-24 19:33:15 +00:00
Marek Olšák
b07a58157d radeonsi: remove the LAYER output if the framebuffer state has only 1 layer
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
3a0a3a5c35 radeonsi: implement gl_Layer in FS as a system value
This replaces the vec4 FS input with the Ancillary VGPR input.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
130428e758 radeonsi: don't allocate output space for LAYER/VIEWPORT before TES and GS
The outputs are ignored according GL_ARB_shader_viewport_layer_array.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
0cd3d58227 radeonsi: clean up si_nir_kill_outputs
Use a switch statement for sysval outputs and simplify code.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
17c38eb9a5 st/mesa: set pipe_framebuffer_state::layers for PBO blits
It only worked with drivers that ignored it.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
e0a24c7fe0 ac/nir: add kill_layer flag to VS/GS/NGG lowering
When the framebuffer state has only 1 layer, the output has no effect.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
27a9ddad28 nir: return progress from nir_remove_sysval_output
Changing IO semantics doesn't affect the SSA structure.

Same as nir_remove_varying.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Marek Olšák
32ee6376ad nir: add lowering from FS LAYER input to LAYER_ID sysval
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>
2023-11-24 15:37:24 +00:00
Juan A. Suarez Romero
a181c86e73 broadcom/ci: separate hiden jobs to -inc.yml files
make it easier to re-use the hidden jobs by other project (e.g. linux)
without enabling the executable jobs.

Inspired on 9442571664 ("ci: separate hiden jobs to -inc.yml files").

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26350>
2023-11-24 15:09:30 +00:00
Kai Wasserbäch
bc7e363f8e fix: ac/llvm: LLVM 18: remove useless passes, partially removed upstream
Upstream removed llvm::createLoopSinkPass() in commit
<b9975cec0e>
and there is no useful alternative except moving to the new pass
manager.

On top of that, the usage of this optimisation pass and
PromoteMemoryToRegisterPass were just useless, according to the
upstream developer of the commit named above. Therefore the easiest
solution is, as him, Marek and Dave suggested, to just remove these two
passes from the pipeline for now.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10192
Reference: https://github.com/llvm/llvm-project/pull/72811
Reference: b9975cec0e
Suggested-by: Dave Airlie <airlied@redhat.com>
Suggested-by: Aiden Grossman <agrossman154@yahoo.com>
Suggested-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26336>
2023-11-24 14:11:09 +00:00
José Expósito
fff3fc45a0 zink: initialize drm_fd to -1
The `zink_internal_create_screen()` function initializes
`screen->drm_fd` to 0, a valid file descriptor value, via `rzalloc`.

If an error is found during initialization, the `zink_destroy_screen()`
function is invoked in the `fail` label and the `screen->drm_fd` is
closed because its value is 0 and `screen->drm_fd != -1` is checked.

Initialize `screen->drm_fd` to -1 to avoid this issue.

Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10191
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26332>
2023-11-24 13:45:25 +00:00
David Heidelberg
268ab0cead ci: disable Anholt farm
Currently farm proxy seems to be down.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26351>
2023-11-24 11:59:15 +00:00
Robert Mader
2404483706 v3d/resource: Support offset query for multi-planar planes
This is required in order to return the correct value for
`gbm_dri_bo_get_offset()` for e.g. the second plane of a NV12 image.

Use the newly introduced `util_resource` helper and, while on it, also
add support for `gbm_bo_get_plane_count()`.

Cc: mesa-stable
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26283>
2023-11-24 08:37:00 +00:00
Robert Mader
cb8cdab928 vc4/resource: Support offset query for multi-planar planes
This is required in order to return the correct value for
`gbm_dri_bo_get_offset()` for e.g. the second plane of a NV12 image.

Use the newly introduced `util_resource` helper and, while on it, also
add support for `gbm_bo_get_plane_count()`.

Cc: mesa-stable
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26283>
2023-11-24 08:37:00 +00:00
Kenneth Graunke
b5bcb658b4 iris: Ensure virtual addresses are aligned to 2MB for 2MB+ blocks
When allocating 2MB chunks of memory, the kernel can use 64K pages if
both the virtual and physical addresses are aligned to 2MB.  While we
can't control the physical allocation, we can ensure the virtual address
we use with softpin meets the requirements.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:19 +00:00
Kenneth Graunke
0b6693a3a1 iris: Align fresh BO allocations to 2MB in size
This should allow us to use 64K pages in more cases, and since the
suballocator is typically used for BOs smaller than 2MB, it probably
isn't going to waste a horrendous amount of memory.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
Kenneth Graunke
6932827a47 iris: Use 64K BOs for the shader uploader
16K was apparently a little unrealistic - Unigine Superposition has
individual shaders that are larger than 16K.  Yikes.  Moving to 64K
also puts shaders into the same cache bucket as other allocations.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
Kenneth Graunke
21170a58d8 iris: Split system memory heap into cached-coherent and uncached heaps
On non-LLC systems, most system memory isn't coherent between the CPU
and GPU by default.  However, we can enable snooping or 1-way coherency
at a performance cost.  In the old days, we maintained one set of cache
buckets and toggled coherency as needed via I915_GEM_SET_CACHING.  But
in the modern uAPI (GEM_CREATE_EXT_SET_PAT) we have to select coherency
up front at BO creation time.  So this doesn't work out well anymore.

This patch splits system memory into two distinct heaps:

   - IRIS_HEAP_SYSTEM_MEMORY_CACHED_COHERENT
   - IRIS_HEAP_SYSTEM_MEMORY_UNCACHED

The flags_to_heap() function will select a heap for a given allocation
based on the coherency/scanout requirements, as well as the hardware
configuration (LLC integrated, non-LLC integrated, or discrete card).

Once a heap is selected, it completely determines the cacheability and
coherency settings.  A given heap will always have the same mmap mode
and PAT index.  This enables us to simplify a lot of code.

Because each heap also has its own bucket cache, we no longer have to
disable bucket caching based on flags, cacheability, coherency, mmap
modes, or so on, as all BOs in each cache have matching settings.
This effectively enables bucket-caching for non-LLC systems.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
Kenneth Graunke
81ebb6a10a iris: Rename heap_flags -> heap in i915_gem_create
The heap is not a bitfield of flags, it's an enum of exclusive choices.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
Kenneth Graunke
7a67ea0a6e iris: Make an iris_heap_is_device_local() helper
We're going to have two system memory heaps and two device local heaps
shortly.  Make a helper to avoid having to check for both every time.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
Kenneth Graunke
e27e5ee55c iris: Make an iris_bucket_cache structure and array per heap
Originally we only had a single bucket cache, and it was the main
allocation mechanism.  Later on, we added one for device-local memory,
and then a third one for device-local-preferred.  Each time, we just
copy and pasted the fields, keeping them all as direct members of the
bufmgr struct.  This is getting a bit unwieldy.

This patch introduces an iris_bucket_cache structure to contain the
list of buckets and the number of buckets.  It then replaces the three
inline copies with a bufmgr->bucket_cache[heap] array.  This lets us
drop a bunch of copy and pasted code in favor of a loop over heaps.

This will also make it easier to add more heaps.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
José Roberto de Souza
7046a9e280 intel: Rename PAT entries
Here renaming the PAT entries to a name that better express each
entry.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
José Roberto de Souza
76aad457a1 iris: Change default PAT entry to WC
Iris doesn't make any call to intel_flush_range*() functions so all BOs
created without BO_ALLOC_COHERENT are not coherent between CPU writes
and GPU reads.

A lot of places don't set BO_ALLOC_COHERENT not even command buffers
have it.
And this incoherency is causing most of tests to fail after
the patch that extracted("iris: Calculate iris_mmap_mode using
intel_device_info_pat_entry when possible") the mmap mode from the PAT
entry.

Before that patch MTL was creating BO with a WB PAT index but then
mmaping as WC.

So to fix this for now making the default PAT entry for Iris a WC one.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>
2023-11-23 21:19:18 +00:00
Pavel Ondračka
f1c9e90146 r300: add late vectorization after nir_move_vec_src_uses_to_dest
Turns out that besides the benefits from nir_move_vec_src_uses_to_dest
itself, it also creates new opportunities for vectorization. Enable it
for vertex shaders, there is a clear instruction win and the only
downside is some increased register presure. However this is mostly
concerning few Unigine Tropics and Sanctiary shaders where we go
11->14 or 10->13 used registers. According to the docs, the increased
register usage would only lower vertex processing concurency if we go
over 15 (R300) or 25 (R500) registers, so we should be safe here.

Fragment shaders are a mixed bag so leave them be for now.

Shader-db RV530
total instructions in shared programs: 129303 -> 128762 (-0.42%)
instructions in affected programs: 13887 -> 13346 (-3.90%)
helped: 99
HURT: 0
total temps in shared programs: 17355 -> 17543 (1.08%)
temps in affected programs: 730 -> 918 (25.75%)
helped: 4
HURT: 66
total cycles in shared programs: 197190 -> 196984 (-0.10%)
cycles in affected programs: 9998 -> 9792 (-2.06%)
helped: 65
HURT: 0

Shader-db RV370:
total instructions in shared programs: 84807 -> 84225 (-0.69%)
instructions in affected programs: 10203 -> 9621 (-5.70%)
helped: 92
HURT: 0
total temps in shared programs: 13036 -> 13231 (1.50%)
temps in affected programs: 787 -> 982 (24.78%)
helped: 4
HURT: 73
total cycles in shared programs: 133178 -> 132946 (-0.17%)
cycles in affected programs: 5911 -> 5679 (-3.92%)
helped: 58

HURT: 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25417>
2023-11-23 18:14:56 +00:00
Samuel Pitoiset
ad7efdea6e radv: do not set OREO_MODE to fix rare corruption on GFX11
Ported from RadeonSI 3f108e7615.
Seems to be a recommendation from the AMD hw team.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26333>
2023-11-23 17:22:04 +00:00
Samuel Pitoiset
d9f312b86a radv: set radv_invariant_geom=true for War Thunder
War Thunder has native Vulkan support.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10186
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26334>
2023-11-23 16:50:39 +00:00
Samuel Pitoiset
46cc7ffb79 radv: add missing FDCC_CONTROL bits for GFX1103 R2
Ported from RadeonSI.
Found by inspection, untested.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26318>
2023-11-23 13:56:53 +00:00
Samuel Pitoiset
ab34603115 radv: disable TC-compatible HTILE on Tonga and Iceland
According to RadeonSI, TC-compat HTILE have issues on Tonga/Iceland
(first GFX8 chips) and a bunch of games seem to have issues.

Let's disable it instead of using a feature that is known broken.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7101
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3894
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26204>
2023-11-23 12:55:47 +00:00
Timothy Arceri
1b7107efe4 glsl: drop ir_binop_ubo_load
This was missed in e566b54a59

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26330>
2023-11-22 22:17:17 +00:00
Sil Vilerino
9528d050a4 d3d12: fix usage of GetAdapterLuid() in mingw/GCC using ABI helper
Fixes: e7204d0224 ("d3d12: Allow creating d3d12_dxcore_screen from existing ID3D12Device")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26338>
2023-11-22 21:41:52 +00:00
Iván Briano
43cb4cb6dd anv: use the right vertexOffset on CmdDrawMultiIndexed
Fixes: c70ef757e6 ("anv: Use extended parameters on Gen11+")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26327>
2023-11-22 13:11:34 -08:00
Alexander von Gluck IV
bb0ad6f0f5 egl/haiku: Remove some dead cleanup code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26322>
2023-11-22 19:38:59 +00:00
Alexander von Gluck IV
c9e33f3545 hgl: Redefine visual options in hgl_context.h
* For now, move the visual mask flags into hgl_context.h
* This removes an un-needed dependency on GLView.h from glvnd
* Eventually, these need converted into normal EGL parameters

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26322>
2023-11-22 19:38:59 +00:00
Alexander von Gluck IV
af90199fd8 egl/haiku: Cleanup includes; minor build fix
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26322>
2023-11-22 19:38:59 +00:00
Marek Olšák
2f0ed0680c glsl/nir: return failure from link_varyings if there is a linker error
Some linker errors are set very deep inside link_varyings. Don't return
a success if we can't continue.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26310>
2023-11-22 18:49:52 +00:00
Marek Olšák
a141b52641 st/mesa: disable light_twoside if back faces are culled
This potentially improves performance.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26308>
2023-11-22 18:18:29 +00:00
Sagar Ghuge
2d3f0a834a anv: Add comment to copy image code block
Anybody will be tempted to factor out the if-else block code since it
looks like duplication but else block actually handles the ycbcr images
where the aspect masks are compatible but don't need to be the same.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26294>
2023-11-22 17:42:43 +00:00
David Rosca
73d69ef1e6 util/rbsp: Fill bits twice if reading more than 16 bits
vl_rbsp_fillbits may fill less than 32 bits if it removes emulation
prevention bytes, but will fill at least 16 bits. We need to call it
twice when reading more than 16 bits.

This fixes parsing H264 SPS packed header in va frontend when emulation
prevention bytes are at position where 32 bit values are read.

Cc: mesa-stable

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26276>
2023-11-22 13:04:06 +00:00
Zhang Ning
db208af967 lima: Support parameter queries for PIPE_RESOURCE_PARAM_NPLANES
use helper to get lima_resource
and support PIPE_RESOURCE_PARAM_NPLANES

Signed-off-by: Zhang Ning <zhangn1985@outlook.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26311>
2023-11-22 12:42:16 +00:00
Daniel Schürmann
3b10547e67 aco: enable helper lanes if shader->info.fs.require_full_quads
This enables helper invocations also for lowered quad group operations.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026>
2023-11-22 11:32:53 +01:00
Daniel Schürmann
f1110576d9 nir: add info.fs.require_full_quads
This flag indicates the requirement of helper invocations
in fragment shaders, independent from any present instructions.
This fixes the lowering of OpGroupNonUniformQuad* instructions.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026>
2023-11-22 11:31:52 +01:00
Daniel Schürmann
2db0507b5d nir/gather_info: add missing wide subgroup operations
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026>
2023-11-22 11:31:46 +01:00
Daniel Schürmann
1179d83a89 nir: remove info.fs.needs_all_helper_invocations
Use info.uses_wide_subgroup_intrinsics instead.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026>
2023-11-22 11:31:11 +01:00
Samuel Pitoiset
f39ed0063b radv/ci: add missing expected failures for mesh queries on VANGOGH
Forgot to add them.

Fixes: b975d4e800 ("radv: enable meshShaderQueries on GFX10.3")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26331>
2023-11-22 08:35:54 +01:00
Tapani Pälli
d3e3c30d36 anv: implement Wa_18020335297
Set some state and implement dummy draws whenever viewport pointer
is being reprogrammed.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25987>
2023-11-22 05:23:12 +00:00
Tapani Pälli
418299c120 anv: refactor state emission
Add a helper that only emits hw_state, this makes it easier to modify
dirty state and call helper to emit only wanted state.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25987>
2023-11-22 05:23:12 +00:00
Tapani Pälli
4031443a4a iris: implement Wa_18020335297
Set some state and implement dummy draws whenever viewport pointer
is being reprogrammed.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25987>
2023-11-22 05:23:12 +00:00
Thomas H.P. Andersen
73317bb706 nvk: use nvk_pipeline_zalloc
3b3b157961 removed setting the pipeline type
assuming that it was already set by nvk_pipeline_zalloc. That helper was
not actually being used, so this patch updates it to do so.

This does not fix anything as the NVK_PIPELINE_GRAPHICS = 0 anyway, so it
is just a code cleanup.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26329>
2023-11-22 04:19:35 +00:00
Qiang Yu
90dc83fc9f radeonsi: add missing args in spi_ps_input_ena when fbfetch output
Fixes dEQP tests which uses fbfetch output when using ACO.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26298>
2023-11-22 02:55:37 +00:00
Mary Guillemard
5b45304624 nvk: Implement VK_EXT_primitives_generated_query
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26324>
2023-11-21 23:50:41 +00:00
Mary Guillemard
7bda83bdfc nvk: Disable flush on each queries and flush at the end
VTG_PRIMITIVES_OUT (VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT) seems to
always require a FLUSH_PENDING_WRITES.

This changes the behavior of every queries to ensure that we only flush
during end query.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26324>
2023-11-21 23:50:41 +00:00
Sylvain Munaut
0fa85b983f mesa/st, dri2, wgl, glx: Restore flush_objects interop backward compat
In commit 1396dc1c a new output field was added as a parameter, but this
is a problem since the signature of the function are not versionned.

The flush function didn't have a versionned output struct. So what I'm
proposing here is that if the version of the input argument is new enough
(bumped to 2 here), then we re-use the existing argument, which until now
was directly a pointer to GLsync, and instead use it as a pointer to a
versioned struct.

We're just changing one pointer type to another, so in C, this should
be fine AFAIK.

Fixes: 1396dc1c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26315>
2023-11-21 23:15:32 +00:00
Alyssa Rosenzweig
76b751c3b1 mesa/st: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:36 +00:00
Alyssa Rosenzweig
0abf4af443 mesa/st: collapse tgsi deadcode
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
301f57a17c gallium: drop pipe_shader_state_from_nir
It is a bad api and now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
2e56be8e34 panfrost: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
e84302f763 nouveau: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
de1245417a zink: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
8d6f4427d2 vc4: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
4698eb3875 asahi: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
f205406264 v3d: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
dfa60b70e6 radeonsi: use pipe_shader_from_nir
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Alyssa Rosenzweig
645ba24e7b gallium: add pipe_shader_from_nir helper
useful for nir-based gallium meta, we have a tgsi equivalent already.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26272>
2023-11-21 20:14:35 +00:00
Thomas H.P. Andersen
5ec6dcce5f docs: update nvk extensions
I compared the output of vulkaninfo with this list. These are enabled in
the driver but missing here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26319>
2023-11-21 19:55:52 +00:00
Jesse Natalie
ea5925461b microsoft/compiler: Fix lower_mem_access_bit_size callback result
When given (e.g.) 3x 16-bit components to store on a device that
isn't  using native 16-bit loads and stores, we should be lowering
that into one 32-bit store and one masked store. Instead, the logic
here ends up returning that the best we can do is one 8-byte store,
which is clearly wrong. Stores should round down, loads should
round up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26293>
2023-11-21 19:11:40 +00:00
Jesse Natalie
c69ca8c5c1 nir_lower_mem_access_bit_sizes: Fix assert (bit -> byte size)
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26293>
2023-11-21 19:11:40 +00:00
Faith Ekstrand
81387ed131 nvk/codegen: Fragment shader builtins are noperspective
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26321>
2023-11-21 18:55:25 +00:00
Faith Ekstrand
354cf99869 nak: gl_FragCoord and gl_PointCoord are screen-space interpolated
This matches what the NVIDIA proprietary driver does.  It also fixes
rendering corruptions in Grand Theft Auto 3.

Fixes: c47488341e ("nak: Use load_interpolated_input for frag_coord")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10156
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26321>
2023-11-21 18:55:25 +00:00
Caio Oliveira
e8220b9319 intel/compiler: Simplify allocation of NIR related arrays
Those are not reused, so this will be the first and only allocation, so
no need to use the "realloc" variants.

For the fs_reg arrays, there's currently no particular reason to keep
them uninitialized, so zero-initialize them too -- not ideal but better
than random values.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26302>
2023-11-21 18:31:05 +00:00
Georg Lehmann
0a5d3ac8d2 aco/sched: treat p_dual_src_export_gfx11 like export
This prevents the scheduler from moving the dual source export above mrtz
export, which caused hangs.

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

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26317>
2023-11-21 18:11:45 +00:00
Samuel Pitoiset
b975d4e800 radv: enable meshShaderQueries on GFX10.3
GFX11 support will come later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
6c7265338d radv: add support for task shader invocations queries on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
623b7033c5 radv: make some gang functions non-static
They will be used to create a gang CS when beginning a query if not
already present.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
1b3efecd56 radv: rework gfx10_copy_gds_query() slightly
To prepare for the same function with ACE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
b7d668a819 radv: add support for mesh shader invocations queries on GFX10.3
Also emulated with a GDS atomic counter in shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
48aabaf225 radv: do not harcode the pipeline stats mask for query resolves
Otherwise, mesh/task shader invocations would be ignored.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
272ad65397 radv: bump the pipeline state query size to 14 on GFX10.3
GFX10.3 doesn't natively support mesh/task shader invocations query
and they need to be emulated in shaders. In order to share more code
between GFX10.3 and GFX11, it's easier to use the same size as GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
7b13500a99 radv: define new pipeline statistics indices for mesh/task on GFX11
GFX11 uses pipeline statistics for mesh/task queries but on GFX10.3
they need to be emulated. Though the number of mesh/task shader
invocations would be copied to the pipeline statistics range to
simplify the implementation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:49 +00:00
Samuel Pitoiset
2b93e9a02b radv: add support for mesh primitives queries on GFX10.3
This query is emulated using a GDS atomic counter in shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:48 +00:00
Samuel Pitoiset
bc6d29b0ca radv: add radv_physical_device::emulate_mesh_shader_queries for GFX10.3
GFX11 supports them natively but not GFX10.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25950>
2023-11-21 15:24:48 +00:00
Martin Roukala (né Peres)
a1609d76ee Revert "ci/deqp-runner: turn paths in errors into links"
This reverts commit d173584b6e, which
inexplicably-but-reliably broke execution of `zink-radv-navi31-valve`[1].

Rather than experimenting for days on how to fix this, let's revert the
commit as it really isn't a critical thing to have. We'll rework it as
time permits.

[1] https://gitlab.freedesktop.org/mesa/mesa/-/jobs/51870356

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26314>
2023-11-21 15:54:25 +02:00
Connor Abbott
6be6b4ca71 tu: Fix re-emitting VS param state after it is re-enabled
We need to always re-emit it if it was disabled. Fixes vertex/instance
offset in a direct draw after an indirect draw.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26148>
2023-11-21 12:42:02 +00:00
Tapani Pälli
aba00ff391 drirc: Set limit_trig_input_range option for Valheim
Fixes ocean rendering in Valheim.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10174
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26295>
2023-11-21 09:08:26 +00:00
Samuel Pitoiset
7d1cc5ec3d radv: rename ps_epilog_inputs to colors for PS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26231>
2023-11-21 08:47:50 +00:00
Samuel Pitoiset
e1345c5295 aco: rename color_exports to exports in create_fs_jump_to_epilog()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26231>
2023-11-21 08:47:50 +00:00
Faith Ekstrand
12f6279c39 nak: Two more print fixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26299>
2023-11-20 21:57:01 -06:00
Danylo Piliaiev
eb75be66e9 freedreno,tu: Add env vars to modify fd_dev_info
We now have a lot of feature toggles in fd_dev_info. Generate
env var options for all of them to quickly test whether feature
misbehaves or test its impact on the performance.

FD_DEV_FEATURES=%feature_name%=%value%:%feature_name%=%value%:...
e.g.
FD_DEV_FEATURES=has_fs_tex_prefetch=0:max_sets=4

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25939>
2023-11-21 01:33:01 +00:00
Danylo Piliaiev
17827ef24c freedreno,tu,ir3: Pass fd_dev_info into ir3_compiler_create
We want to modify fd_dev_info with debug options, so we must
have a single source of fd_dev_info.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25939>
2023-11-21 01:33:01 +00:00
Danylo Piliaiev
e6bfe42b6e freedreno/devices: Separate device definition into base + gen features
After introduction of A7XX it doesn't make sense to define base GPU
properties in A6xxGPUInfo. Now we move to a more clean definition:
- a6xx_base + a6xx_genX - for A6XX
- a7xx_base + a7xx_xxx - for A7XX, there is no sub-gens clearly
                         identifiable at the moment.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25939>
2023-11-21 01:33:01 +00:00
Timothy Arceri
4382bd8a34 nir: simplify nir_build_write_masked_store()
Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25860>
2023-11-21 00:45:21 +00:00
Timothy Arceri
0470f8f737 glsl: remove now unused lower distance pass
This has been replaced with a NIR based pass.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25860>
2023-11-21 00:45:21 +00:00
Timothy Arceri
33c2b64aa3 glsl: switch to NIR distance lowering pass
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25860>
2023-11-21 00:45:21 +00:00
Timothy Arceri
110887de2b glsl/nir: implement a nir based lower distance pass
This is based off the original GLSL IR pass but it is much much
simpler as it doesn't need to do all of the hackery required in
GLSL IR to achieve the lowering.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25860>
2023-11-21 00:45:21 +00:00
Timothy Arceri
95da0a9c96 nir: move build_write_masked_stores() to nir builder
We will reused this in the following patch.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25860>
2023-11-21 00:45:21 +00:00
Francisco Jerez
6a810b0ba8 intel: Improve N-way pixel hashing computation to handle pixel pipes with asymmetric processing power.
This reworks the intel_compute_pixel_hash_table_nway() pixel pipe
hashing table computation helper to handle cases where some pixel
pipes have processing power different from the others, this is helpful
for Gfx12.7+ platforms where there are pixel pipes with 1 DSS as well
as pixel pipes with 2 DSSes, which currently can lead to a serious
performance bottleneck in the pixel pipes with lower processing power.

In order to avoid such a load imbalance the
intel_compute_pixel_hash_table_nway() function will now take two pixel
pipe bitsets instead of one: Pixel pipes enabled on both bitsets will
appear with twice the frequency on the table as pixel pipes which only
appear on one bitset.  See the comments below for more details on the
algorithm used to construct a pixel hashing table with the desired
properties.

With this change rendering performance improves by about 25% on a
fused MTL platform -- The list of specific configs this is expected to
show an improvement on is not included here since the list is rather
long and some of the configs may still be embargoed or may never be
productized, but in order to find out whether your Gfx12.7+ device
could be affected by this you can check the output of the
intel_dev_info tool from the Mesa tree and see if there are multiple
"pixel pipe" entries with different DSS count.  That isn't expected to
occur on any DG2 configuration, only on MTL+ platforms, so this change
should have no effect at all on DG2 (it's easy to convince oneself
that it won't since for DG2 mask1 should equal mask2 so mask2 will be
set to zero at the beginning of intel_compute_pixel_hash_table_nway()
and the new swzx[] permutation will be set to the identity).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26266>
2023-11-20 23:48:34 +00:00
Faith Ekstrand
9033df070e nak: Rework printing of texture and image dims
They're now printed as part of the op for textures and we've changed the
names to follow the PTX convention.  For buffers and cube maps, I had to
come up with my own thing but I think the result is okay.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:04 +00:00
Faith Ekstrand
3a20beab03 nak: Display memory type at the end for load/store ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:04 +00:00
Faith Ekstrand
6f76f4db9f nak: Make MemAddrType a part of MemSpace
This is similar to what we did with scopes and ordering.  Shared and
local memory can only have an A32 address type.  The only times we can
get A64 is for global or generic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:04 +00:00
Faith Ekstrand
6c861c3cc2 nak: Display memory access bits with the "." prefix
This just moves the "." from the caller to the Display implementation on
the actual enum type.  This makes it easier to properly handle defaults.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
3d2104dd5d nak: Align instructions when printing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
32d6720bb0 nak: Only write deps.delay when set
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
3f027f7dcc nak: Default InstrDeps::delay to 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
58c8391f97 nak: Implement DisplayOp on Op instead of Display
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
9d1afb7533 nak: Rework opcode printing to use a new trait
The new trait has separate fmt functions for dsts and the rest of the
op.  There's a generic implementation of Display built on top of it
which just prints `{dsts} = {op}`.  The new trait also has a default
implementation of fmt_dsts() which just walks the dsts using
dsts_as_slice() and auto-formats them all.  This should be what we want
for 95% of cases and we can hand-implement the rest.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
503c4b1d5d nak: Make most Display stuff lower-case
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
Faith Ekstrand
2897b9dcee nak: Rework reg and SSA value printing
This makes everything lower-case, unifies on better prefixes, and makes
us take less whitespace for SSA vectors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26291>
2023-11-20 21:36:03 +00:00
llyyr
2e3027e7d1 docs: document AMD_DEBUG=noefc and useaco
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25930>
2023-11-20 20:43:33 +00:00
Chia-I Wu
16a270f646 radv: disable TC-compat htile on GFX9 in some cases
Similar to commit a38de4c011 ("radv: disable tc_compatible_cmask on
GFX9 in some cases"), GFX9 seems to have issues with TC-compat htile as
well.

I've only seen this with D16 and sample count 4.  But I am not sure
about the exact condition.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10161
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26263>
2023-11-20 20:09:44 +00:00
Eric Engestrom
d173584b6e ci/deqp-runner: turn paths in errors into links
Suggested-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26177>
2023-11-20 19:26:53 +00:00
Eric Engestrom
1ff4687e86 ci: uprev deqp-runner from 0.16.1 to 0.18.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26270>
2023-11-20 18:37:18 +00:00
Eric Engestrom
5efa4d56e2 ci: fix kdl commit fetch
Doing a `clone --depth 1` of the default branch then checking out
a commit that might not be the latest of that branch cannot work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26270>
2023-11-20 18:37:18 +00:00
José Roberto de Souza
205c5874d4 intel: Sync xe_drm.h
Sync xe_drm.h with commit 3b8183b7efad ("drm/xe/uapi: Be more specific
about the vm_bind prefetch region").

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26238>
2023-11-20 17:57:34 +00:00
Sil Vilerino
e4ffb2473b d3d12: Implement get_feedback with additional metadata
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
8c1ba75f68 d3d12: Support PIPE_VIDEO_CAP_ENC_H264_DISABLE_DBK_FILTER_MODES_SUPPORTED
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
c81967fa89 d3d12: Implement Intra Refresh for H264, HEVC, AV1
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
a560706648 d3d12: Implement HEVC VUI Writer
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
fdc8b7cdc4 d3d12: Implement H264 VUI Writer
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
cf8cbf0647 d3d12: Disable codecs according to meson video-codecs option
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Brian King ((MEDIA))
84c0448b36 d3d12: Add constraint_set1_flag support
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
d6bb4ddc63 d3d12: Video Encode - Remove PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE as not supported
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
151ebf8ec3 d3d12: Use log2_max_frame_num_minus4 and log2_max_pic_order_cnt_lsb_minus4 from pipe_pic_params_h264
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
34961b1118 d3d12: Plumb pipe_h264_enc_picture_desc.dbk.disable_deblocking_filter_idc
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
527def0171 gallium/vl: Check for VP9 and AV1 meson option support flags
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
7b22dd8bfd meson: add vp9 and av1 codec support options
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
870570ee66 frontend/va: Support VAEncMiscParameterMaxSliceSize
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
ec4021b3c2 frontend/va: Parse VUI HEVC parameters
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:19:00 +00:00
Sil Vilerino
4637f1db48 frontend/va: Parse VUI H264 parameters
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
bee4a3683c frontend/va: Add log2_max_frame_num_minus4 and log2_max_pic_order_cnt_lsb_minus4 for h264enc
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
9ce17de1fd pipe: Add max_slice_bytes for H264, HEVC encoding
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
6b4010b906 pipe: Add HEVC VUI encode params
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
0c312c5c59 pipe: Add H264 VUI encode params
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
10eb9296fe pipe: Add PIPE_VIDEO_CAP_ENC_INTRA_REFRESH_MAX_DURATION
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
44a3bfcc67 pipe: Add PIPE_VIDEO_CAP_ENC_H264_DISABLE_DBK_FILTER_MODES_SUPPORTED
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
be4287c3aa pipe: Extend get_feedback with additional metadata
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
e6d754f183 gallium/auxiliary: Fix pb_bufmgr_slab.c leak
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
695201fe94 vl/win32: Add vl_win32_screen_create_from_d3d12_device
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Sil Vilerino
e7204d0224 d3d12: Allow creating d3d12_dxcore_screen from existing ID3D12Device
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26223>
2023-11-20 17:18:59 +00:00
Zhang Ning
9657ef95b4 iris: use helper util_resource_at_index
Signed-off-by: Zhang Ning <zhangn1985@outlook.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26243>
2023-11-20 16:57:59 +00:00
Boris Brezillon
bc3bec76c0 panfrost: Add a JOBX() macro to simplify job-frontend selection
Common code will soon call job-frontend specific helpers for anything
that's not common to CSF/JM. Let's provide a JOBX() macro that does
the correct prefixing based on the PAN_ARCH value.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
9dd4c5b4e6 panfrost: Move JM helpers to their own source file
Before we start adding CSF support, let's move every JM-specific bits
out of pan_cmdstream.c.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
5e5a766a81 panfrost: Prepare things for the common/JM cmdstream split
In order to be able to split the code into separate files, we need to
share some common definitions. Create a pan_cmdstream.h file containing
some structs and helpers.

This file is meant to be included from per-gen source files.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
635385a807 panfrost: s/init_batch/jm_init_batch/
We will have a CSF-specific implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
a0b38c4827 panfrost: s/preload/jm_preload_fb/
We'll have a specific version for CSF.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
2558a12633 panfrost: Rename JM-specific batch submission helpers
Prefix them with jm_ so we can easily specialize things for CSF.
panfrost_batch_submit_ioctl is renamed into jm_submit_jc() which
reflects the fact the ioctl() submits one job chain at a time, and
panfrost_batch_submit_jobs() is renamed jm_submit_batch() because it's
shorter and is descriptive enough.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
1dfc9ca3cf panfrost: s/panfrost_emit_primitive/jm_emit_primitive/
This function is JM-specific, let's prefix it accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
fb2d2410bd panfrost: s/panfrost_emit_shader/jm_emit_shader_env/
Prefix with jm_ so we know this is JM-specific, and emit_shader_env()
to make it clear this is the shader environment descriptor we
emit here.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
50898556e0 panfrost: Rename panfrost_batch_get_bifrost_tiler()
Tiler descriptor emission will be different on CSF, so let's just
prefix the function with jm_, and pick a shorter name without bifrost
in it (the function is already conditionally defined if PAN_ARCH >= 6,
which means bifrost or later).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
5225eeb4b1 panfrost: Drop the vertex_count argument passed to panfrost_batch_get_bifrost_tiler()
We always pass a non-zero vertex_count. Let's get rid of this argument
and unconditionally emit the heap descriptor.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
e44dae6cdb panfrost: Move JM specific bits out of panfrost_launch_xfb()
Create a jm_launch_xfb() helper that's called from panfrost_launch_xfb()
so we can later specialize things for CSF.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
6ed0968d3d panfrost: Move JM-specific bits out of panfrost_launch_grid_on_batch()
Create a jm_luanch_grid() helper that's called from
panfrost_launch_grid_on_batch() so we can later specialize things for
CSF.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
0e168f2def panfrost: Use batch->tls.gpu to store the compute TLS descriptor
This seems a bit silly, but is needed if we want to move JM/CSF job
emission to their own file without having to pull the
panfrost_emit_shared_memory() function there. It also allows us to
get rid of the thread_storage argument passed to panfrost_emit_shader().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
9592b61883 panfrost: Move all JM-specific bits out of panfrost_direct_draw()
Add a jm_launch_draw() helper taking care of the JM descriptor emission,
and call it from panfrost_direct_draw().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
691d9747e5 panfrost: Re-order things in panfrost_direct_draw()
Re-order things in panfrost_direct_draw() so we have all non-HW specific
stuff done first, and then the descriptor emission.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
172d4bccd2 panfrost: Factor out the vertex count logic
Makes panfrost_direct_draw() shorter and thus easier to read.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
f167e2facf panfrost: Factor out the point-sprite shader update logic
Not strictly needed for CSF, but anything we can do to make
panfrost_direct_draw() shorter is good to take.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
782dc11791 panfrost: Rename several job emission helpers
First of all, we want to prefix those with jm_, so we can later add
CSF-specific job emission helpers. We also take this as an opportunity
to clarify what these helpers emit exactly: the draw section of a job
descriptor (suffixed with _draw) or the job descriptor itself (suffixed
with _job).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
e25b8d07b8 panfrost: Move the JM-specific bits out of emit_fragment_job()
Add a jm_emit_fragment_job() helper that does the fragment job emission
so we can re-use the rest of emit_fragment_job() for CSF too.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
04f4c39a4e panfrost: s/panfrost_emit_vertex_tiler_jobs/jm_push_vertex_tiler_jobs/
Prefix the function with jm_, so it's clear its JM-specific helper.
While at it, replace emit by push, since the descriptor emission
happens before that, all this function does is pushing jobs to the
job chain.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Boris Brezillon
44bd7067b7 panfrost: Move JM specific fields to their own struct
In preparation of CSF support addition, we move any JM related bits out
of panfrost_batch into a panfrost_jm_batch struct that's embedded in
panfrost_batch inside an anonymous union. This way, we can easily
specialize things for CSF without polluting the panfrost_batch object
with CSF-specific fields.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:09 +00:00
Alyssa Rosenzweig
9de3ff9a78 panfrost: Add panfrost_get_{position,varying}_shader() helpers
We will use those when adding CSF support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Alyssa Rosenzweig
f53c37892a panfrost: Factor out vertex attribute stride calculation
We will use the new panfrost_vertex_attribute_stride() when adding CSF
support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Alyssa Rosenzweig
ea72a0bec6 panfrost: Add an allow_rotating_primitives() helper
Factor out the logic so we can use the helper when adding CSF support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
e81f99134e panfrost: Use u_reduced_prim() to do the is_line check
Suggested-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
a183b8c495 panfrost: Store varying related fields in panfrost_batch
Store varying pointers in panfrost_batch. This will make the
job-frontend split easier by reducing the number of arguments we pass
to functions.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
19d5963c57 panfrost: Stop passing vertex attribute arrays around
They are accessible through
batch->{attribs,attrib_bufs}[PIPE_SHADER_VERTEX], which is updated in
panfrost_update_state_3d(), if needed.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
a0d0e07036 panfrost: Store the index pointer in panfrost_batch
So we can later use it from job-frontend specific hooks without having
to pass the pointer around.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
d618a46590 panfrost: Add a submit_batch() hook to panfrost_vtable
This per-arch method will take care of preparing the batch for submission
and submitting it.

This allows us to get rid of a bunch of methods in panfrost_vtable, and
turn some indirect function calls into direct calls.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
46fc7d2dc9 panfrost: Get rid of unused fb parameter passed to panfrost_batch_submit_jobs()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
070bdd14ba panfrost: Get rid of the out_sync parameter in panfrost_batch_submit_jobs()
We always pass ctx->syncobj, which can be extracted from the batch
passed to panfrost_batch_submit_jobs(), so let's just kill this
argument.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
34512fabb4 panfrost: Get rid of unused in_sync parameter in panfrost_batch_submit[_ioctl]()
in_sync is always zero, so let's just get rid of the parameter.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
7b6e959b73 panfrost: Move the panfrost_emit_tile_map() call around
Move the panfrost_emit_tile_map() call before any of the per-gen
calls in panfrost_batch_submit(). This is in preparation of moving
the per-gen batch submission logic to a single hook instead of
having multiple indirect calls, and given the tile map doesn't
depend on any of the states modified by the per-gen calls, moving
it before them shouldn't be an issue.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
037e7a530c panfrost: Emit the fragment job from panfrost_batch_submit()
Now that emit_fragment_job() stores the fragment job GPU pointer
in panfrost_batch, we can move this step in panfrost_batch_submit(),
which will help with v10/CSF support.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
a4f037bd6d panfrost: Store the fragment job descriptor address in the batch
In preparation of v10 support, where the fragment job is not passed
as a descriptor, but issued directly on the command stream, we make
->emit_fragment_job() a void method, and store the fragment job
descriptor in the batch.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
d3b7b8c807 panfrost: Stop using the scoreboard to check the presence of draws/compute
Now that we count draws and compute jobs, we can change some of the
tests to be HW-agnostic, so they can be re-used when we introduce
support for CSF hardware.

Anything that's related to job submission keeps using the scoreboard
information, because this code will stay JM-specific.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
9b2e78b003 panfrost: Make panfrost_has_fragment_job() public
We want to move the kernel driver specific submission logic to
pan_cmdstream.c where we can define per-gen functions. In order to
do that, we need panfrost_has_fragment_job() to be public.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
ab18d0709a panfrost: Count the number of compute jobs at the batch level
We will use this information to make some helpers HW-agnostic so they can
work on CSF hardware.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
f16312c01b panfrost: Express the per-batch limit in term of draws
We turn the 10000 jobs limit into a 10000 draw limit because:

- on HW supporting IDVS a draw is just a single job, and having a common
  limit for all HW is simpler
- draw_count < 10000 fits in the max jobs limit if we assume the worst
  case scenario (3 jobs per draw)
- CI seems to be happy (no spurious timeouts after this change)

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
539e5e435c panfrost: Count draws at the batch level
This way we have a HW-agnostic way to know how many draws were issued,
instead of looking into the job chain builder guts.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
948062ee84 panfrost: Inline pan_emit_tiler_ctx()
Tiler context emission will differ on v10. Given pan_emit_tiler_ctx()
was only used in the gallium driver, and its implementation is
relatively simple, inline the code in panfrost_batch_get_bifrost_tiler().
This way we will avoid the churn caused by the function prototype change.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
b378cfbc48 panfrost: Inline pan_emit_tiler_heap()
Tiler heap emission will differ on v10. Since pan_emit_tiler_heap()
is only used by the gallium driver, and it's simple enough to be
inlined, move the code to panfrost_batch_get_bifrost_tiler().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Boris Brezillon
708a3a33a8 panfrost: Rename panfrost_vtable::context_init
We are about to add arch-specific context initialization/cleanup hooks.
Rename the existing context_init hook to avoid confusion (this hook
was just populating the pipe_context vtable).

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Erik Faye-Lund
9a53cca85a panfrost: do not open-code panfrost_has_fragment_job()
panfrost_batch_submit() already has an has_fragment_job() at the
beginning of the function. Store the result in a local has_frag variable
and replace the open-coded test by an 'if (has_frag)'.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26249>
2023-11-20 16:38:08 +00:00
Lionel Landwerlin
f9bab3566b intel/perf: fix querying of configurations
Using the unsized data field is incorrect. The data is located behind
the entire drm_i915_query_perf_config structure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26285>
2023-11-20 16:00:05 +00:00
Eric Engestrom
46c9128117 amd/ci: track changes to the traces config file as well
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26278>
2023-11-20 15:23:40 +00:00
Eric Engestrom
4de3ce1f2c ci/piglit: specify only the traces file in the job config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26278>
2023-11-20 15:23:40 +00:00
Dennis Bonke
653405ee08 mesa: add managarm support
Co-authored-by: Alexander Richards <electrodeyt@gmail.com>
Signed-off-by: Alexander Richards <electrodeyt@gmail.com>
Signed-off-by: Dennis Bonke <dennis@managarm.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25818>
2023-11-20 13:35:19 +00:00
Tapani Pälli
0e68dd1a52 drirc: use fake_sparse for Armored Core 6
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9808
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25217>
2023-11-20 13:06:24 +00:00
Helen Koike
2999091287 ci/ci_run_n_monitor: abort when target gets skipped
when a target receives skipped state it is because some of the
dependencies failed, abort the script and print the reason

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26155>
2023-11-20 13:03:09 +00:00
Eric Engestrom
3d53022e68 asahi: use util_resource_num() instead of open-coding it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26287>
2023-11-20 11:58:59 +00:00
Alejandro Piñeiro
8191acd41e broadcom/compiler: update image store lowering to use v71 new packing/conversion instructions
Vulkan shaderdb stats with pattern dEQP-VK.image.*.with_format.*.*:
   total instructions in shared programs: 35993 -> 33245 (-7.63%)
   instructions in affected programs: 21153 -> 18405 (-12.99%)
   helped: 394
   HURT: 1
   Instructions are helped.

   total uniforms in shared programs: 8550 -> 7418 (-13.24%)
   uniforms in affected programs: 5136 -> 4004 (-22.04%)
   helped: 399
   HURT: 0
   Uniforms are helped.

   total max-temps in shared programs: 6014 -> 5905 (-1.81%)
   max-temps in affected programs: 473 -> 364 (-23.04%)
   helped: 58
   HURT: 0
   Max-temps are helped.

   total nops in shared programs: 1515 -> 1504 (-0.73%)
   nops in affected programs: 46 -> 35 (-23.91%)
   helped: 14
   HURT: 2
   Inconclusive result (%-change mean confidence interval includes 0).

FWIW, that one HURT on the instructions count is for just one
instruction.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25726>
2023-11-20 08:20:31 +00:00
Alejandro Piñeiro
c0cfa4f53b nir: add new opcodes to map new v71 packing/conversion instructions
Since v71, broadcom hw include specific packing/conversion
instructions, so this commit adds opcodes to be able to make use of
them, specially for image stores:

   * pack_2x16_to_unorm_2x8 (on backend vftounorm8/vftosnorm8):
     2x16-bit floating point to 2x8-bit unorm/snorm

   * f2unorm_16/f2snorm_16 (on backend ftounorm16/ftosnorm16):
     floating point to 16-bit unorm/snorm

   * pack_2x16_to_unorm_2x10/pack_2x16_to_unorm_10_2 (on backend
     vftounorm10lo/vftounorm10hi): used to convert a floating point to
     a r10g10b10a2 unorm

   * pack_32_to_r11g11b10 (on backend v11fpack): packs 2 2x16 FP into
     R11G11B10.

   * pack_uint_32_to_r10g10b10a2 (on backend v10pack): pack 2 2x16
     integer into R10G10B10A2

   * pack_4x16_to_4x8 (on backend v8pack): packs 2 2x16 bit integer
     into 4x8 bits.

   * pack_2x32_to_2x16 (on backend vpack): 2x32 bit to 2x16 integer
     pack

For the latter, it can be easly confused with the existing
pack_32_2x16_split. But note that this one receives two 16bit integer,
and packs them on a 32bit integer. But broadcom opcode takes two 32bit
integer, takes the lower halfword, and packs them as 2x16 on a 32bit
integer.

Interestingly broadcom also defines a similar one that packs the
higher halfword. Not used yet.

Note that at this point we use agnostic names, even if we add a _v3d
suffix as they are only available for broadcom, in order to follow
current NIR conventions.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25726>
2023-11-20 08:20:31 +00:00
Samuel Pitoiset
fc044928b2 radv: re-enable sparseResidencyImage3D on POLARIS10+
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7214
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26260>
2023-11-20 08:30:05 +01:00
Samuel Pitoiset
e02a1f0a44 ac/surface: change tile mode for 3D PRT surfaces with bpp < 64 on GFX6-8
This is loosely based on PAL. This seems to fix 3D PRT support with
RADV on Polaris10. THIN means the tile is a 2D slice. THICK means the
tile is a 3D box.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26260>
2023-11-20 08:29:19 +01:00
Vinson Lee
e3afbd5c28 nir: Fix decomposed_prmcnt copy-paste error
Fix defect reported by Coverity Scan.

Copy-paste error (COPY_PASTE_ERROR)
copy_paste_error: prmcnt in prmcnt = -1 looks like a copy-paste error.

Fixes: cc3f20ca6c ("nir: Also gather decomposed primitive count")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26159>
2023-11-20 03:27:26 +00:00
Qiang Yu
1fabf535fa aco: handle GL_TEXTURE_RECTANGLE in tg4_integer_workarounds
Ported from LLVM side lower_gather4_integer().

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26244>
2023-11-20 02:59:23 +00:00
Qiang Yu
695fc67baa aco: set MIMG unrm for GL_TEXTURE_RECTANGLE
This fixes VDPAU compositor shaders compiled by ACO.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26244>
2023-11-20 02:59:23 +00:00
Qiang Yu
dbbf566588 aco,ac/llvm,radeonsi: lower f2f16 to f2f16_rtz in nir
No need to handle f2f16 specially for OpenGL, and we can vectorize
f2f16 when using ACO.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25990>
2023-11-20 02:20:17 +00:00
Qiang Yu
7e4aac46ad nir: add force_f2f16_rtz option to lower f2f16 to f2f16_rtz
Used by OpenGL driver like radeonsi which has undefined rounding mode.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25990>
2023-11-20 02:20:17 +00:00
Qiang Yu
5696790420 ac/llvm: remove nir_op_*2*mp ops handling
They have been lowered to *2*16 in nir.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25990>
2023-11-20 02:20:17 +00:00
Qiang Yu
909895ae2a radeonsi: only vectorize nir ops that aco support
To fix si_compute_blit created nir code compilation with ACO.
Two 16bit vector ops are used in it:
  con 16x2  %11 = u2u16 %10.xy
  con 16x2  %25 = f2f16 %22.xy
which is not supported by ACO yet.

PS. now ACO supports vec2 f2f16.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25990>
2023-11-20 02:20:17 +00:00
Qiang Yu
5932990e08 aco,radv: add aco_is_nir_op_support_packed_math_16bit
To be shared by radeonsi and radv.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25990>
2023-11-20 02:20:17 +00:00
Lucas Fryzek
10367618da gallivm/nir: Load all inputs into indirect inputs array
The code in `emit_load_var` that will attempt to read indirect inputs
expects the entire array of inputs to be there. Additionally the code
that populates `bld->inputs_array` will populate the array using the count
of `inputs_read`, without ensuring the inputs it copies are the ones read.

This change populates `bld->inputs_array` with the entire contents of bld->inputs
so indirect reads will always match up.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26153>
2023-11-20 01:54:41 +00:00
Erico Nunes
898700ca64 v3dv: Rework to remove drm authentication for wsi
For Wayland wsi allocations, v3dv used the wl_drm protocol, which is now
being phased out in favor of dmabuf feedback.
wl_drm is used to figure out the display device (in v3dv assumed to be
vc4) and then to authenticate with the Wayland compositor in order to
allocate scanout-able buffers (in this case, dumb buffers) directly at
the display device.
Recent commit 88c03ddd34 changed the behavior of the wsi code, and
wl_drm is now passing the render device instead, which broke Wayland
wsi.
It turns out that the authentication code is not really needed and since
we would like to remove wl_drm usage and the master device is assumed to
be vc4 anyway, we can just remove some unneeded device-specific wsi code
and get Vulkan Wayland wsi back to work.

Fixes: 88c03ddd34 ("egl/drm: get compatible render-only device fd for kms-only device")

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26200>
2023-11-19 17:00:49 +00:00
Janne Grunau
2091515a70 gallium: Do not create pipe-loader version scripts for disabled drivers
They are not going to be used without shared library to build.

Fixes: 667de678a0 ("gallium: Fix undefined symbols in version scripts")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26273>
2023-11-19 09:34:59 +01:00
Janne Grunau
b2da38413f gallium: Fix i915 pipe-loader build
'i915' was missing from the list of drivers for the 'driver_descriptor'
descriptor symbol. Rather than maintaining a second list of drivers add
the 'driver_descriptor' symbol for all drivers except swrast.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10171
Fixes: 667de678a0 ("gallium: Fix undefined symbols in version scripts")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26273>
2023-11-19 09:22:43 +01:00
Matt Turner
f05688aa32 util: Provide DRM_DEVICE_GET_PCI_REVISION definition
This allows src/intel/dev/intel_device_info.c to build with libdrm
stubbed out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26265>
2023-11-18 17:01:24 +00:00
Matt Turner
5022a26b50 util: Include stdint.h in libdrm.h
drmGetDevices2()'s first parameter is a uint32_t.

Fixes: e05abb1345 ("util: Add a simple no-op libdrm shim")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26265>
2023-11-18 17:01:24 +00:00
Timur Kristóf
d487d9d05b radv: Use SDMA version instead of gfx_level where possible.
The SDMA IP is independent from the GFX IP, so it is technically
wrong to program it based on the GFX level.

This patch changes the RADV SDMA code to use SDMA IP versions
where possible.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:18 +01:00
Timur Kristóf
24022d5680 radv: Use GPU info for determining SDMA metadata support.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:15 +01:00
Timur Kristóf
fd3cdf28ac ac: Add sdma_version enum and use it for SDMA features.
The SDMA IP is independent from the GFX IP, so it is technically
wrong to program it based on the GFX level.

This patch adds a new enum for SDMA IP version and uses that
to determine functionality such as compression and sparse
support.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:11 +01:00
Timur Kristóf
d09ad16fd4 ac: Remove CIK prefix from SDMA opcodes.
The vast majority of AMD GPUs (except the very first GCN) have
the same SDMA packet format, so let's just call it SDMA instead
of CIK_SDMA.

(And leave the oldest GPUs with SI_SDMA as they are now.)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:11:00 +01:00
Timur Kristóf
6413b860c4 ac: Rename SDMA max copy size macros to reflect SDMA version.
This naming is more accurate and closer to the HW.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>
2023-11-18 17:10:56 +01:00
Janne Grunau
be9953ac2c gallium: Avoid empty version scripts in pipe-loader
Meson produces version scripts with an empty global node for disabled
drivers. This is reported as syntax error by the linker.
The root cause of the problem is that the version scripts are
accumulated in the out of foreach `pipe_loader_link_args` variable
although they should be only used once for their driver specific loader
library.
Fixes build errors when some of the drivers are disabled like on arm64
which disables i915 due to missing dependencies.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10166
Fixes: 667de678a0 ("gallium: Fix undefined symbols in version scripts")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26268>
2023-11-18 13:05:48 +00:00
Simon Ser
0f978c3441 egl: ensure a render node is passed to _eglFindDevice()
_eglFindDevice() will fail if it's not provided a render node:
the EGLDevice list only contains one entry per render node, plus
the special software device. Passing a primary node for a
display-only device will not work.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10142
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Fixes: 2be404f557 ("egl: error out if we can't find an EGLDevice in _eglFindDevice()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
2023-11-18 13:19:53 +01:00
Simon Ser
9b70096f5e egl: move dri2_setup_device() after dri2_setup_extensions()
dri2_setup_device() will depend on the extensions being set up in
the next commit.

None of the code in-between depends on disp->Device AFAIU.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
2023-11-18 13:19:05 +01:00
Simon Ser
b4ec0b51ce egl: extract EGLDevice setup in dedicated function
Extract the logic responsible for populating disp->Device via
_eglFindDevice(). This isn't much for now but will grow in a
following commit.

No functional changes.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Tested-by: Iago Toral Quiroga <itoral@igalia.com>
Tested-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26205>
2023-11-18 13:19:04 +01:00
Shuicheng Lin
dddab9fa77 intel/xe: Correct DRM_XE_EXEC_QUEUE_SET_PROPERTY's ioctl
DRM_XE_EXEC_QUEUE_SET_PROPERTY is the offset,
while DRM_IOCTL_XE_EXEC_QUEUE_SET_PROPERTY is the real number.

Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26253>
2023-11-18 10:17:45 +00:00
Mary Guillemard
275afe73f7 nvk: Implement VK_KHR_fragment_shader_barycentric
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9619

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26224>
2023-11-18 02:46:47 +00:00
Mary Guillemard
7fb91f22d5 nak: Add more bits discovered in SPH
This adds barycentric related bits and various others.

We still need to figure out the bits between 640..672, 800..1024 and checks
some "reserved" bits. (especially around the GS passthrough bit)

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26224>
2023-11-18 02:46:47 +00:00
Mary Guillemard
60544cae07 nir: Add a ldtram_nv intrinsic
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26224>
2023-11-18 02:46:47 +00:00
Faith Ekstrand
62006c2f96 nvk: Advertise the rest of the subgroup ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
1bc865ca8a nak: Implement quad ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
cca40086c6 nak: Lower scan/reduce in NIR
We can probably do slightly better than this if we take advantage of the
predicate destination in SHFL but not by much.  All of the insanity is
still required (nvidia basically emits this), we just might be able to
save ourslves a few comparison ops.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
11bcce9461 nak: Use c == 0x0 for shuffle_up
The bounds check on SHFL.UP is from below, so we actually want
maxLane == 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
8c79d616bd nak: Add builder helpers for a few ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
c874db9381 nak: Add the predicate destination to OpShfl
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Faith Ekstrand
3cc389f3da nvk: Set the right API version in the ICD json files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26264>
2023-11-18 01:09:33 +00:00
Eric Engestrom
f011410c1c egl/dri2: increase NUM_ATTRIBS to fit all the attributes
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26234>
2023-11-17 22:54:28 +00:00
Ganesh Belgur Ramachandra
4dd287308f radeonsi: "get_blitter_vs" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25782>
2023-11-17 22:19:39 +00:00
Ganesh Belgur Ramachandra
4a3cebaffc radeonsi: "create_fmask_expand_cs" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25782>
2023-11-17 22:19:39 +00:00
Ganesh Belgur Ramachandra
6584088cd5 radeonsi: "create_dma_compute" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25782>
2023-11-17 22:19:39 +00:00
Juston Li
d54c140eb6 venus: disable unsupported ExtendedDynamicState3Features
Fixes: 49e5b583 ("venus: enable VK_EXT_extended_dynamic_state3")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26261>
2023-11-17 22:00:27 +00:00
Ian Romanick
52ee4cf229 nir/builder: Teach nir_pack_bits and nir_unpack_bits about 32_4x8
Also teach it how to pack and unpack 32-bits to or from 32-bits.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24741>
2023-11-17 21:00:59 +00:00
Ian Romanick
25743209c4 nir/lower_packing: Add lowering for nir_op_unpack_32_4x8
Nothing should currently hit this path.

The next commit adds code to nir_pack_bits and nir_unpack_bits that can
lead to this path being hit.

v2: Change nir_u2uN(..., 8) to nir_u2u8(...). Suggested by Alyssa.

v3: Don't generate nir_extract_u8 if the driver has set
lower_extract_byte. These instructions were causing some problems for
dozen.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> [v2]
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> [v2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24741>
2023-11-17 21:00:59 +00:00
Ian Romanick
7a1a9fb287 nir/lower_packing: Don't generate nir_pack_32_4x8_split on drivers that can't handle it
It should not be possible for this to happen now as the nir_pack_32_4x8
instruction that is being lowered shouldn't exist. A later commit will
change this.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24741>
2023-11-17 21:00:59 +00:00
Anthony Roberts
a76cb87602 glsl: Use unsigned instead of enum type in ir_variable_data
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26254>
2023-11-17 20:08:49 +00:00
Jesse Natalie
cb019ff926 d3d12: GL4.6
This enables pipeline stats and SO overflow queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Jesse Natalie
b0ba671446 d3d12: Enable some 4.6 extensions that were already implemented
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Jesse Natalie
eac2ce6e3b d3d12: Fixes for QBO shaders
Output offset for resolves was wrong, and we can't use a double for the
timestamp multiplier, because doubles might be emulated, and that emulation
is only handled by shaders that go through the GL frontend.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Jesse Natalie
df4fc66649 nir: Add a flag to opt_if to prevent fighting with splitting 64bit phis
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26210>
2023-11-17 19:19:11 +00:00
Andrew Gazizov
bafc27583c venus: Make sure that guest allocated blobs from hostmem are mappable
For guest-based blob allocations from hostmem (Host visible memory),
to make sure that virtio-gpu driver will send to the host the address
(offset in the region) of the allocated blob using RESOURCE_MAP_BLOB
command a flag VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT must be set.

Otherwise, if the upper layers didn't set it, host can't import memory
and guest allocation from Host visible memory region makes no sense.

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Andrew Gazizov
8929889563 venus: Tighten the conditions for guest_vram device memory alloc
In addition to the platform requirement (use_guest_vram), device memory
allocations from dedicated heap (guest_vram) are necessary only when:

1. VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is set and it indicates that
memory is host visible and assumed to be accessed by CPU (vkMapMemory).
2. One of external memory handle types is set, that indicates memory
can be exported with external handle.

In other cases it's not necessary to create virtgpu_bo object in the
guest and enough just perform vkAllocateMemory on host side without
memory import from dedicated heap.

Reported-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Andrew Gazizov
816f66cdfd venus: Use vk_object_id as blob_id for guest_vram device memory alloc
blob_id == 0 does not refer to an existing VkDeviceMemory and implies
a shmem allocation. So for guest_vram device memory allocations, 0 is
not a valid blob id and must be greater than 0.

Therefore, set vk_object_id as blob_id for guest_vram device memory
allocations. Considering that vk_object_id made from valid pointer, it
will be always greater than 0.

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Paulo Zanoni
c853e259ab anv+zink/ci: document new sparse failures
Now that we have sparse resources on Anv these tests are finally
running, but they're failing. We'll eventually fix them, but let's not
make Zink gatekeep the entirety of sparse resource on Anv.

v2: KHR-GL46.sparse_buffer_tests.BufferStorageTest was initially
reported as Crash by Mesa CI. On my second run in Mesa CI it gave me a
Timeout. On my machine it passes but takes about 4 minutes to finish,
so skip it entirely.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
563678f310 anv/sparse: don't support YCBCR 2x1 compressed formats
Regarding supporting these formats, the spec says:

  "A sparse image created using VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT
   supports all non-compressed color formats with power-of-two element
   size that non-sparse usage supports. Additional formats may also be
   supported and can be queried via
   vkGetPhysicalDeviceSparseImageFormatProperties.
   VK_IMAGE_TILING_LINEAR tiling is not supported."

Regarding the formats themselves, the spec says:
  "VK_FORMAT_B8G8R8G8_422_UNORM specifies a four-component, 32-bit
   format containing a pair of G components, an R component, and a B
   component, collectively encoding a 2×1 rectangle of unsigned
   normalized RGB texel data. One G value is present at each i
   coordinate, with the B and R values shared across both G values and
   thus recorded at half the horizontal resolution of the image. This
   format has an 8-bit B component in byte 0, an 8-bit G component for
   the even i coordinate in byte 1, an 8-bit R component in byte 2,
   and an 8-bit G component for the odd i coordinate in byte 3. This
   format only supports images with a width that is a multiple of two.
   For the purposes of the constraints on copy extents, this format is
   treated as a compressed format with a 2×1 compressed texel block."

Since these formats are to be considered compressed 2x1 blocks and we
don't necessarily have to support non-compressed formats that
non-sparse support, we can claim them as not supported with sparse.

In addition to all of that, if you look at isl_gfx125_filter_tiling()
you'll see that we don't even support Tile64 for these formats, so
sparse residency (i.e., non-opaque image binds) doesn't really make
sense for them yet.

The Vulkan spec defines 4 other YCBCR "2x1 compressed" formats like
the ones we have in this commit, but we don't support them even
without sparse, so there's no reason to check them here.

A recent change in VK-GL-CTS made tests that use these formats go from
unsupported to failures:
  7ecc7716a983 ("Do not use and check for STORAGE image support, when
  it is not used in the test")

This commit "fixes" the following VK-GL-CTS failures (by making them
return NotSupported):
  dEQP-VK.sparse_resources.image_block_shapes.2d.b8g8r8g8_422_unorm.samples_1
  dEQP-VK.sparse_resources.image_block_shapes.2d.g8b8g8r8_422_unorm.samples_1
  dEQP-VK.sparse_resources.image_block_shapes.2d_array.b8g8r8g8_422_unorm.samples_1
  dEQP-VK.sparse_resources.image_block_shapes.2d_array.g8b8g8r8_422_unorm.samples_1

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
a0559768db anv: enable sparse by default on i915.ko
On i915.ko we don't have the vm_bind ioctl, so sparse requires TR-TT.
Unfortunately, on gfx < 20 TR-TT is not compatible with non-render
queues, so we have to disable those when sparse is enabled. Notice
that although we don't have TR-TT for non-render queues on gfx >= 20,
vm_bind is the default, and it doesn't have this restriction.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
fda5163f34 anv/trtt: properly handle the lifetime of TR-TT batch BOs
We need to wait for the batches to complete before we return the BOs
to the pool. We were previously doing this completely synchronously,
which made the code unnecessarily wait. Now we have a timeline syncobj
that signals completion of the previous BOs, so sometimes we check
where we are in the timeline and then return the BOs that we know are
unused.

This, in addition to the previous patch that made us wait for the
other syncobjs through the execbuf ioctl instead of through the CPU,
makes TR-TT batches at least an order of magnitude faster. Still, I
don't think we'll notice any changes in games's FPS as they don't bind
sparse resources that often.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
0f21836272 anv/trtt: add support for queue->sync to the TR-TT batches
At this moment this patch won't buy us anything since we're already
being completely synchronous, but the next patch is going to change
this and so queue->sync will start making sense.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
1534ee46b8 anv/trtt: add struct anv_trtt_batch_bo and pass it around
For now it just wraps the bo and size, so there's really no value to
having it. In the next commit we'll add more elements to the struct.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:29 +00:00
Paulo Zanoni
18bd00c024 anv/trtt: don't wait/signal syncobjs using the CPU anymore
Pass them as part of the TR-TT batch. This is what a lot of the
previous commits were building up to.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
f2206a0eb1 anv/xe: allow passing extra syncs to xe_exec_process_syncs()
We're going to use this in two different patches.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
4b435d6983 anv/i915: extract setup_execbuf_fence_params()
I'm about to add a 3rd caller for it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
d797d9233d anv/sparse: process image binds before opaque image binds
When sparse images are being used, applications normally use
non-opaque binds and leave opaque binds just for the miptail part.

Since miptails are always at the end of the array layers, processing
the opaque binds after processing the non-opaque binds increases the
chance that anv_sparse_submission_add() will join the miptail bind
operation with the last non-opaque opreration, especially if the user
is trying to bind the last few non-miptail levels and the miptail in
the same vkQueueBindSparse opration.

In the real world this case does happen, so we're able to save a bind
operation every once in a while in Steam games.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
040063c156 anv/sparse: move waiting/signaling syncobjs to the backends
Move waiting/signaling to the backends so we can fix each backend
separately.

As I write this patch the vm_bind backend is back to using synchronous
vm_binds so we can't pass syncobjs to the synchronous vm_bind ioctl
anymore. We'll need more discussions and possibly some rework before
we go back to asynchronous vm_binds. This commit should allow us to
fix the TR-TT backend in the next commit and leave vm_bind for later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
cbf09b4254 anv/trtt: use 'queue' from anv_sparse_submission in the backend
Don't pass it as a parameter when it's also part of a struct. Have to
touch 9 files just for that...

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
f6d28bec6d anv/sparse: add 'queue' to anv_sparse_submission
If we're going to move syncobj waiting/signaling down to the backend
we're going to need a queue to signal as lost in case those operations
fail.

In some places of the stack we don't have a queue available, such as
when we're creating or destroying resources. For those, for vm_bind
cases we don't use the queue for anything so passing it as NULL is
fine. For TR-TT we are already using device->trtt.queue.

For TR-TT specifically this also means we're going to start using the
actual queues from the call stack instead of trtt->queue, but that
shouldn't make any difference since we only ever have one queue.
Still, this is more technigally correct.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
576275907a anv/sparse: pass anv_sparse_submission to the backend functions
Our ultimate goal is to have the backend functions deal with the wait
and signal syncobjs instead of waiting for them on the CPU inside
anv_queue_submit_sparse_bind_locked(). For that, we'll need waits and
signals parameters to be passed all the way to the backend functions
that actually make the submission, and this is what this patch does,
through struct anv_sparse_submission.

This patch just deals with passing the parameters to the functions,
nothing is using the new variables yet. There should be no functional
changes here. The goal here is to make code review easier.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
6c7753ee0b anv/sparse: join all submissions into a single anv_sparse_bind() call
Currently, a single vkQueueBindSparse() call may lead to multiple bind
calls in the backend (either a vm_bind ioctl or a command submission
that updates the TR-TT page tables). These operations can be quite
slow so it's better for us if we try to emit as few of them as
possible.

On top of that, this gives our "just extend the last operation's size
if possible" code a little more chance to act and save us real time.

Our ultimate goal here is to also pass submit->waits and
submit->signals to the backend so we can avoid doing CPU waits, so
having a single call to the backend helps simplify things a little
too, and we just created the structure to carry these extra pointers
forward.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
11e9a700f6 anv/sparse: drop anv_sparse_binding_data from dump_anv_vm_bind()
Having it helped us printing the resource offset, which made debugging
some situations easier. The problem is that we want to rework the code
a little bit and we won't have a 'sparse' struct anymore to pass
around. Since it's all debug code drop it for now so it doesn't get in
the way of the rework. If we need it later we can find a way to add it
back, or we find another way to print the value.

Drive-by drop the DEBUG_SPARSE check that's already in the caller.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
b4fef9a745 anv/trtt: also join the L3/L2 writes into a single MI_STORE_DATA_IMM
Same as the L1 case, but this one deals with 64bit entry addresses and
pte addresses.

Consecutive L3/L2 writes are much rarer than L1 writes since they
require some pretty big buffers, but we can still those cases in the
wild. I just don't think any change will be noticeable though.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
31f720fd6e anv/trtt: join L1 writes into a single MI_STORE_DATA_IMM when possible
If the addresses are sequential, we can emit only a single
MI_STORE_DATA_IMM instruction. This is a very common case, it should
save us some space: 4 bytes per extra_write.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
ccb30ae0cd anv/sparse: fix limits.sparseAddressSpaceSize when using vm_bind
When using vm_bind (not TR-TT), in practice sparse addresses will be
allocated from the high_heap, so narrow down the available
sparseAddressSpaceSize from the whole address space to the part we can
actually allocate things from.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Paulo Zanoni
04bfe828db anv/sparse: allow sparse resouces to use TR-TT as its backend
TR-TT is a hardware feature supported by both i915.ko and xe.ko, which
means we can now finally have Sparse Resources on i915.ko and we also
have 2 options for xe.ko (and whatever is the best should be the
default).

In this patch we use batch commands to write the page tables and
forever keep them in device memory. We maintain a mirror of both the
L3 and and L2 tables because that helps us never having to read the
tables that are in device memory.

We still have some things to improve, but with this commit, workloads
that didn't work at all due to the lack of sparse resources should
at least run.

This is still all disabled by default in i915.ko, you can turn it on
by exporting ANV_SPARSE=1 before launching the applications. For
xe.ko, switch the default with ANV_SPARSE_USE_TRTT=1.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25512>
2023-11-17 17:58:28 +00:00
Rhys Perry
a279767424 ac/gpu_info: update conformant_trunc_coord comment
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911>
2023-11-17 15:15:28 +00:00
Rhys Perry
9e9eb87dd3 radv: enable radv_disable_trunc_coord for vkd3d-proton/DXVK
This fixes diagonal SSAO artifacts in some games.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9253
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6395
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911>
2023-11-17 15:15:28 +00:00
Rhys Perry
4d2a3b9573 radv: add radv_disable_trunc_coord option
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25911>
2023-11-17 15:15:27 +00:00
Eric Engestrom
1b18ca83fa amd/ci: avoid re-running all the test jobs when changing the expectations for only one of them
Previously, any change to any job would trigger every job.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26127>
2023-11-17 14:22:46 +00:00
Alyssa Rosenzweig
0f0f6c6227 nir/validate: Specialize if source validation
Yet another bit of branchiness we should tame. 99% of the time, sources are not
for if's, so we shouldn't need to do the extra checking to handle that 1%.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
88d0fd03d6 nir/validate: Split out validate_sized_src
We don't check the sizes for ALU srcs, which is the hot path here, so split out
that simplified version for ALU instructions to use, while deriving a sized
version for other kinds of instructions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
bfcc323954 nir/validate: Inline validate_ssa_src
There's no more nir_register.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
bfdb2862d6 nir/validate: Drop stale todo
We have dominance validation elsewhere in the file.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
9f341cefbb nir/validate: Don't check dimensions in validate_def
Instead, check it at the call sites when actually required (basically just
intrinsics), reducing the branching required when not (ALU validation, the
hottest of hot paths for CI).

IMHO this is more obvious too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
d2b1e6bed0 nir/validate: Use unlikely for validate_assert
No apparent performance difference, but documents the intention.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
e9d185dccf nir/validate: Don't validate out-of-bounds channels
Nothing should ever be reading them, they logically do not exist. So there's no
point validating them, especially when the validation in question is so useless
(just checking the bit width, without any semantic awareness). Yet now that we
support vec16, this loop is quite hot even on scalar ISAs, and rather
pointlessly so. Just remove it and bring the ALU src validation complexity to
O(# of channels in source) instead of O(max # of channels in NIR).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
8d5a1e5a77 nir/validate: Don't spam nir_alu_instr_channels
It doesn't inline and so is about 1% of M1 CTS time. Expand out the definition
and simplify the logic. Honestly, I think this is clearer too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
1786032029 nir/validate: Optimize ssa_srcs set
Profiling showed that maintaining this ssa_srcs set consumes ~3% of CTS time
with a debugoptimized build. Unfortunately, we really do benefit from getting
this coverage in CI. So rather than remove the validation, let's optimize the
data structure used so we can keep the coverage at a fraction of the cost.

The expensive piece is the pointer set, which is backed by a relatively
expensive hash table. It would be much cheaper to use an invasive set instead,
with a single "present" bit. We don't want to bloat nir_src for this, however
there's an easy solution: use a tagged pointer to steal a bit in the nir_src for
the job. We untag everything at the end of validation (and this meta-invariant
is asserted with an auxiliary counter), so while we mutate the IR while
validating, the mutations do not escape nir_validate.

We tag the parent pointer and not the def pointer, because it is dramatically
less used and therefore has far fewer disrupted call sites.

The M1 job is improved from 3:03 to 2:55 of deqp-runner reported time, which is
excellent.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Alyssa Rosenzweig
6d73f62e42 nir: Simplify nir_alu_instr_channel_used definition
Deduplicates the "get # of channels" logic which was the same between the
helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>
2023-11-17 09:36:08 -04:00
Violet Purcell
667de678a0 gallium: Fix undefined symbols in version scripts
Currently, multiple version scripts unconditionally use symbols from gallium
drivers that may not be enabled, which causes linking to fail with
--no-undefined-version (as is default in LLD 17), and can cause issues
with LTO. This commit adds logic to generate version scripts based on the
enabled gallium drivers, ensuring only defined symbols are used.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8003
Signed-off-by: Violet Purcell <vimproved@inventati.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25551>
2023-11-17 12:35:24 +00:00
Lionel Landwerlin
c76cb19b01 anv/blorp: move helper function about BTI changes to blorp
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
1b6fe35ec8 anv: get rid of the duplicate pipeline fields in command buffer state
This can be error prone if you forget to update one.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
ec3f8c0d42 intel/blorp: move Wa_18019816803 out of blorp code
The driver already need to track this WA for blorp. We can completely
remove any blorp code dealing with this and instead have the flush
required by the workaround be combined with potential other flushes
the driver already has to insert before blorp operations.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
6e85fa8a80 intel/decoder: handle 3DPRIMITIVE_EXTENDED in accumulated prints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
9689607f10 anv: fix dirty state tracking for 3DSTATE_PUSH_CONSTANT_ALLOC
ANV_CMD_DIRTY_PIPELINE also includes reprogramming of
3DSTATE_PUSH_CONSTANT_ALLOC_* instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
1257d08bcb anv: fix CC_VIEWPORT pointer dirty after blorp/simple-shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
e517b1e095 anv: fix missing naming for dirty bit
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Lionel Landwerlin
1a1747712c anv: fix source_hash propagation with libraries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26247>
2023-11-17 10:17:51 +00:00
Daniel Schürmann
f2bb7b185d aco: delete instruction selection for boolean subgroup operations
These are now lowered in NIR.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Daniel Schürmann
88afbbba11 nir: optimize open-coded quadVote* directly to new nir_quad intrinsics
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Connor Abbott
0d186d356c amd: Enable boolean subgroup lowering
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Connor Abbott
1dab2c5bd2 nir/subgroups: Add option to lower Boolean subgroup reductions
This will be useful for AMD, and probably Intel as well.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Connor Abbott
387e698bde amd: Implement quad_vote intrinsics
Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Connor Abbott
1cfb0ae92c nir: Add quad vote intrinsics
Both Intel and AMD have special hardware support for these.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Daniel Schürmann
27734c52eb nir/lower_subgroups: optimize reductions with cluster_size == 1
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/218>
2023-11-17 09:45:40 +00:00
Boris Brezillon
9ac3117e3e panfrost: Emit image attribs for compute in panfrost_update_shader_state()
This will make the job-frontend split easier, and it also makes sense
to update image attributes here for compute.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:11 +00:00
Boris Brezillon
3db963a135 panfrost: Emit attribs in panfrost_update_state_3d() on bifrost/midgard
The dirty state tracking should allow us to conditionally re-emit the
vertex attribute and attribute buffer arrays if something relevant
changed.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
ac486a0115 panfrost: Kill unused panfrost_batch::polygon_list field
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
8ed471a339 panfrost: Flag the right shader when updating images
Fixes: fab1fabb4f ("panfrost: Dirty track fragment images")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
1d4fa05b78 pan/decode: Fix the pan_unpack() call for JUMP instruction unpacking
We are unpacking a CALL instead of JUMP instruction. It doesn't
make a difference because the instruction layout is the same,
but let's fix that for the sake of correctness.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
238f9a4498 pan/decode: Make CSF decoding more robust to NULL pointers
Some staging registers might be NULL, either because some arguments are
optional, or because the command stream is malformed. In any case, being
robust to such situations it probably a good thing.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
7dd610f908 pan/decode: Print the resource table label
Useful to quickly spot which stage of the pipeline is using a resource
table.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
408b3f3ced pan/genxml: Fix 'Shader Program' descriptor definition on v9 and v10
Bit 8 in the descriptor is not encoding the primary/secondary shader
information. It's a per shader-type field.

For fragment shader descriptors, it describes what the coverage bitmask
contains for per-sample execution:
- DX-style: bits for all covered samples are set
- GL-style: only the bit for the sample the shader is executed on is set

For vertex shader, it encodes the warp limit we want to apply to the
shader execution.

Patch the existing code to match the new semantics.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
790d4422b2 pan/bo: Make sure we catch refcnt underflows
Recently had to debug an unbalanced ref/unref situation in some
code I added, and having an assert(refcnt > 0) in
panfrost_bo_unreference() would have made this simpler, so let's
add one.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
46d2748a93 panfrost: Fix format_minimum_alignment() for v6-
Alignment should be power of two, so I suspect we meant 64 not 63.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Boris Brezillon
6e166af59e pan/genxml: Fix "{Last,First} Heap Chunk" field position
Those two fields were swapped.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
2023-11-17 09:29:10 +00:00
Samuel Pitoiset
c5e6edcddf radv: check earlier if a graphics pipeline can force VRS per vertex
When a graphics pipeline already enables VRS, forcing VRS isn't
possible, check this earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26248>
2023-11-17 08:39:48 +00:00
Samuel Pitoiset
61c3796a95 radv: remove redundant check when forcing VRS rates
If force_vrs_per_vertex is TRUE, the primitive shading rate varying is
always written.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26248>
2023-11-17 08:39:48 +00:00
Samuel Pitoiset
d679d12359 aco: remove useless nir_intrinsic_load_force_vrs_rates_amd
It's lowered earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26248>
2023-11-17 08:39:48 +00:00
Samuel Pitoiset
d01b7b0fd4 zink/ci: add a manual job on radv-navi31
The run is sequential for now because otherwise a lot of AMDGPU errors
are reported.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25459>
2023-11-17 08:14:59 +00:00
Eric Engestrom
a5e20a5c31 ci_run_n_monitor: require user to add an explicit .* at the end if jobs like *-full are wanted
Most of the time, these jobs are not wanted, so let's make this a full
match instead of prefix match so that users only get what they ask for.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26066>
2023-11-17 08:12:31 +00:00
Eric Engestrom
ce7cda417f intel/dev: use libdrm.h wrapper to support builds without libdrm
Fixes part of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10159

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26236>
2023-11-17 07:38:33 +00:00
Lionel Landwerlin
4eb4197d27 intel/nir/rt: fix reportIntersection() hitT handling
We're currently updating the hitT value in the traversal result with
the hitT value from reportIntersection(), but this is not correct.

First the hitT value of reportIntersection() should update the
gl_RayTmaxEXT value (maps to brw_nir_rt_mem_ray_defs::t_far).

Second the hitT determined by traversal should only be updated if the
reportIntersection() hitT value has updated the gl_RayTmaxEXT and that
the new gl_RayTmaxEXT is smaller than the determined hitT value from
traversal.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Fixes: 303378e1dd ("intel/rt: Add lowering for combined intersection/any-hit shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25146>
2023-11-17 07:06:30 +00:00
Lionel Landwerlin
6dbb5f1e07 intel/fs: rerun divergence analysis prior to convert_from_ssa
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9964
Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26235>
2023-11-17 06:40:49 +00:00
Faith Ekstrand
cd543c94fd nvk: Advertise VK_KHR_synchronization2
We've already got everything, we just need to turn it on.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9657
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26245>
2023-11-17 05:32:55 +00:00
Faith Ekstrand
7f6d3b82c8 nvk: Implement bufferDeviceAddressCaptureReplay
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10158
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26242>
2023-11-17 03:07:02 +00:00
Faith Ekstrand
b4cfac64c8 nvk: Add a separate VMA heap for BDA capture/replay
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26242>
2023-11-17 03:07:02 +00:00
Faith Ekstrand
78eee47471 nvk: Handle VMA allocation failure
The chances of these happening is slim to none right now but, the moment
we throw VK_KHR_buffer_device_address into the mix, failure becomes much
more of a real possibility.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26242>
2023-11-17 03:07:02 +00:00
Faith Ekstrand
0052f1a6fe nvk: Rework error handling in nouveau_ws_bo_new() and from_dma_buf()
Add static _locked versions of both functions which can do the usual
goto cascade for error handling and wrap them in exported functions
which take a lock, call _locked, drop the lock, and return.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26242>
2023-11-17 03:07:02 +00:00
Faith Ekstrand
ce1cccea98 nvk: Drop nouveau_ws_bo_new_tiled()
It's no longer used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26242>
2023-11-17 03:07:02 +00:00
Hyunjun Ko
fbc9811241 vulkan/video: fix a typo
Fixes: d46162981a ("vulkan/video: add h264 headers encode")
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26139>
2023-11-17 00:45:55 +00:00
Faith Ekstrand
7e00380445 nvk: Implement VK_KHR_pipeline_executable_properties
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9621
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26241>
2023-11-17 00:12:36 +00:00
Faith Ekstrand
3b3b157961 nvk: Don't set pipeline->base.type manually
It's already set by nvk_pipeline_zalloc().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26241>
2023-11-17 00:12:36 +00:00
Faith Ekstrand
faadac57d5 nak: Support dumping shader assembly as part of compile
This dumps it to a string that gets attached to the nak_shader_bin.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26241>
2023-11-17 00:12:36 +00:00
Mary Guillemard
ae17145882 nak: Rewrite nir_intrinsic_load_sample_pos and implement nir_intrinsic_load_barycentric_at_sample
nir_intrinsic_load_sample_pos was causing failures on barycentric CTS tests.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26239>
2023-11-16 22:12:29 +00:00
Mary Guillemard
8d8d93fab9 nak: Pass offset to load_frag_w
This fix IPA.OFFSET getting an undef for the offset and restore previous
behavior.

Fixes: 618bdb8571 ("nak: Rework FS input interpolation")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26239>
2023-11-16 22:12:29 +00:00
Faith Ekstrand
1f582bad0a nak: Stop passing undefs to ipa_nv
The undefs get ignored so they technically don't hurt anything. This
mostly just lets them CSE better

Fixes: 618bdb8571 ("nak: Rework FS input interpolation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26239>
2023-11-16 22:12:29 +00:00
Eric Engestrom
5499e857a3 intel/ci: fix gl/vk dependencies in hsw jobs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26237>
2023-11-16 21:01:50 +00:00
Erik Faye-Lund
a08d33abff docs: apply permanent redirect
The HTTP URL now redirects to the HTTPS URL, so let's update our link.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26222>
2023-11-16 20:30:08 +00:00
José Roberto de Souza
014e51251e intel: Sync xe_drm.h
Sync xe_drm.h with commit 6253cfa4c324 ("drm/xe/pmu: Drop interrupt pmu event").
No changes in code need, it is just removing uAPIs that are not used
by any UMD but it still breaks the uAPIs as uAPI numbers changed.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26151>
2023-11-16 19:54:44 +00:00
Tatsuyuki Ishi
e1cf75b411 zink: Remove now unused dead_framebuffers.
These were deleted in fe8212791f ("zink: delete all non-imageless
framebuffer code").

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26168>
2023-11-16 17:40:14 +00:00
José Expósito
2a71f06f29 zink: allow software rendering only if selected
In environments where 3D acceleration is not available, like in a VM,
the behavior before commit 8cd44b8843 ("egl: add automatic zink
fallback loading between hw and sw drivers") was to fallback to swrast.

This was the output of `eglinfo` in that situation:

    $ eglinfo
    [...]
    Wayland platform:
    EGL driver name: swrast
    OpenGL core profile renderer: llvmpipe (LLVM 17.0.4, 256 bits)

However, after commit 8cd44b8843 ("egl: add automatic zink fallback
loading between hw and sw drivers") Zink support is tested before
falling back to swrast.
Since the system doesn't support 3D acceleration, Zink + software
rendering is used instead of swrast causing issues like the ones
described in #10146.

In this case, `eglinfo` prints:

    $ eglinfo
    [...]
    Wayland platform:
    EGL driver name: zink
    OpenGL core profile renderer: zink Vulkan 1.3(llvmpipe (LLVM 17.0.4,
    256 bits) (MESA_LLVMPIPE))

This patch ensures that Zink + software rendering is used only when the
user opts-in by setting `LIBGL_ALWAYS_SOFTWARE` or `D3D_ALWAYS_SOFTWARE`
and swrast is used otherwise.

After the patch, the output of `eglinfo` is identical to the one before
the regression:

    $ eglinfo
    [...]
    Wayland platform:
    EGL driver name: swrast
    OpenGL core profile renderer: llvmpipe (LLVM 17.0.4, 256 bits)

Resolves: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10146
Fixes: 8cd44b8843 ("egl: add automatic zink fallback loading between
hw and sw drivers")

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26220>
2023-11-16 17:18:34 +00:00
Eric Engestrom
99fed1f9b3 lima: drop unused lima_get_absolute_timeout()
If someone wants that functionality in the future, use
`os_time_get_absolute_timeout()` instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26229>
2023-11-16 16:52:10 +00:00
Eric Engestrom
9c62aee027 util/xmlconfig: drop default SYSCONFDIR & DATADIR values
The only build system left is meson, which always defines these.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26228>
2023-11-16 15:55:02 +00:00
Robert Mader
5f4253e096 panfrost: Support parameter queries for main planes
In order to return correct offsets, strides and possibly other
parameters. This is relevant for formats like NV12 and P010 where
the second plane, when produced by the V4L2 decoder, uses the
same FD like the first one, but with an offset.

Analogous to 7a7e577d.

Also use the new helper to get the number of planes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10094
Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26109>
2023-11-16 14:28:45 +00:00
Robert Mader
d679154dc0 util: Add new helpers for pipe resources
They will be handy for drivers supporting multi-planar formats.

Cc: mesa-stable
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26109>
2023-11-16 14:28:45 +00:00
Tatsuyuki Ishi
94e867e4a6 zink: Fix waiting for texture commit semaphores.
The commit was always being treated as failed...

Fixes: d1456a6b0a ("zink: add semaphore handling for sparse binds")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26171>
2023-11-16 13:38:07 +00:00
Tatsuyuki Ishi
729ce08815 zink: Defer freeing sparse backing buffers.
Sparse backing buffers were destroyed immediately after issuing the
unbind call, which was against the Vulkan spec which requires the
destroy call to not happen before the unbind semaphore was signaled.

To tackle this, keep a reference against buffers we are unbinding within
the batch. This will keep the backing buffer long enough to not cause
use-after-free. As described in comments, we don't need to reference
every backing page used in the batch, as the resource usually keeps
references to them until they are unbound, which is now correctly
handled.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26171>
2023-11-16 13:38:06 +00:00
Tatsuyuki Ishi
3ee283e455 zink: Fix missing sparse buffer bind synchronization.
goto oopsies.

Fixes: d1456a6b0a ("zink: add semaphore handling for sparse binds")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26171>
2023-11-16 13:38:06 +00:00
Lionel Landwerlin
8b36d230bb anv: workaround XeSS for Satisfactory
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10152
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26217>
2023-11-16 13:08:01 +00:00
José Expósito
83ed419cd0 zink: fix dereference before NULL check
The `sv->image_view` pointer is dereference before checking whether it's
NULL or not.
Check for NULL before dereferencing it to avoid a possible crash.

Fixes: 9de455bc43 ("zink: check for sampler view existence during
zink_rebind_all_images()")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26140>
2023-11-16 12:22:14 +00:00
Samuel Pitoiset
ec82b42944 radv: add a missing async compute workaround for Tonga/Iceland
After digging into PAL code again, I figured that Tonga/Iceland are
both affected by a hw bug related to async compute dispatches.

The solution is to change the "threadgroup" dimension mode to the
"thread" dimension mode unconditionally.

This should fix a bunch of issues related to RADV_DEBUG=nocompute on
these GPUs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7551
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6334
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4679
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26207>
2023-11-16 11:37:43 +00:00
Rhys Perry
f695a9fed2 intel/compiler: use nir_lower_fp16_casts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25566>
2023-11-16 11:02:31 +00:00
Rhys Perry
ae30edd2a7 aco: remove f16<->f64 conversions
radeonsi and RADV now use nir_lower_fp16_casts.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25566>
2023-11-16 11:02:31 +00:00
Rhys Perry
a31c928c4f radv: use nir_lower_fp16_casts
This correctly implements RTNE f64->f16.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25566>
2023-11-16 11:02:30 +00:00
Rhys Perry
0e1e6c244b radeonsi: use nir_lower_fp16_casts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25566>
2023-11-16 11:02:30 +00:00
Rhys Perry
288e9db053 nir/lower_fp16_casts: add option to split fp64 casts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25566>
2023-11-16 11:02:30 +00:00
Rhys Perry
fce434818a nir/lower_fp16_casts: correctly round RTNE f64->f16 casts
Based on brw_nir_lower_conversions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25566>
2023-11-16 11:02:30 +00:00
Samuel Pitoiset
4239e13ff6 radv: fix a descriptor leak with debug names and host base descriptor set
vk_object_base_finish() needs to be called on the descriptor set in
order to free the debug names.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10098
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26088>
2023-11-16 09:11:06 +00:00
Vinson Lee
904015ae85 ac/surface/tests: Remove duplicate variable block_size_bits
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In block_size_bits = block_size_bits = ((surf.u.gfx9.swizzle_mode >= ADDR_SW_256KB_Z_X) ? 18 : 16),
block_size_bits is written twice with the same value.

Fixes: 44eaf50a34 ("ac/surface/tests: cosmetic changes")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26160>
2023-11-15 19:22:06 -08:00
Juston Li
49e5b58315 venus: enable VK_EXT_extended_dynamic_state3
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25921>
2023-11-15 23:30:14 +00:00
Juston Li
417437c715 venus: pipeline fixes for VK_EXT_extended_dynamic_state3
- pMultisampleState->pSampleMask should be ignored when
VK_DYNAMIC_STATE_SAMPLE_MASK_EXT is used.
- pRasterizationState can be null now

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25921>
2023-11-15 23:30:14 +00:00
Juston Li
e3de4a9852 venus: sync protocol for VK_EXT_extended_dynamic_state3
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25921>
2023-11-15 23:30:14 +00:00
Eric Engestrom
d5efa3f204 docs: update calendar for 23.3.0-rc{2,3,4} and add another release candidate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26215>
2023-11-15 21:40:21 +00:00
Chia-I Wu
c905aeb4e4 ac: be careful with stencil_offset override
Check surf->has_stencil first to avoid trashing surf->u.gfx9.color.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26106>
2023-11-15 20:29:03 +00:00
Chia-I Wu
7718bad474 radv: minor clean up to image view extent override
Use the correct image plane consistently.  Compressed formats are
single-planar unless emulated.  This makes no difference in either case
but makes the code more concise.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26106>
2023-11-15 20:29:03 +00:00
Chia-I Wu
2533d0a0e2 radv: fix image view extent override for astc
When doing ASTC decoding, the image has format VK_FORMAT_ASTC_*, the
internal plane 1 has format VK_FORMAT_R8G8B8A8_UNORM, and the view has
format VK_FORMAT_R8G8B8A8_UINT.  It does not need the override for
compressed formats.

Fixes: f97b449e9e ("radv: integrate meta astc compute decoder to radv")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26106>
2023-11-15 20:29:03 +00:00
Lionel Landwerlin
295734bf88 intel/fs: fix residency handling on Xe2
We're missing a few reg_unit() scaling when dealing with residency data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26208>
2023-11-15 20:06:12 +00:00
Faith Ekstrand
0bd23d6263 nak: Enable SM70 for Volta
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26212>
2023-11-15 13:38:04 -06:00
Tapani Pälli
01046cd6ad anv/drirc: add option to disable FCV optimization
There are rendering issues with FCV on DG2 and Unreal engine 5.1,
patch adds option to disable fcv in drirc.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26169>
2023-11-15 18:16:56 +00:00
M Henning
aedf9113c4 nak: Set "evict first" from ACCESS_NON_TEMPORAL
This matches the way ptxas sets this hint.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26201>
2023-11-15 17:48:29 +00:00
M Henning
adc3fd4c99 nak: Add encodings for cache eviction priorities
We were previously setting "evict first" everywhere, which could
possibly be a perf issue on machines that are also running shaders
compiled with codegen, which sets "evict normal" on everything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26201>
2023-11-15 17:48:29 +00:00
David Rosca
df9a95a813 gallium/auxiliary/vl: NIR compute shaders
Remove drawn area check and instead adjust grid layout so that this check
is not needed.
Change crop_x/crop_y from int to float to avoid converting it in shaders,
also all shaders now supports cropping.

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25562>
2023-11-15 16:06:38 +00:00
David Rosca
848811f98a gallium/auxiliary: NIR blit_compute_shader
Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25562>
2023-11-15 16:06:37 +00:00
Friedrich Vock
03a7cb2618 ac/gpu_info: Manually compute L3 size for Navi33
The firmware reports no MALL cache being present, which is wrong. We
later depend on correct L3 cache size values for choosing the attribute
ring size, so fall back to manually computing the size.

Fixes: 355242f055 ("ac/gpu_info: adjust attribute ring size for gfx11")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26147>
2023-11-15 14:09:50 +00:00
Konstantin Seurer
90f8cf0f36 radv/sqtt: Handle monolithic RT pipelines
This marks them as Unified in the RGP UI and shows the compute shader
view.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26158>
2023-11-15 13:46:50 +00:00
Konstantin Seurer
b6e09dd521 radv/sqtt: Fix tracing acceleration structure commands
ApiRayTracingSeparateCompiled can only used by trace commands.

Fixes: bfb55d0 ("ac/sqtt,radv/sqtt: Add and use marker for separate RT compilation")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26158>
2023-11-15 13:46:50 +00:00
Mark Collins
fa0476fa6e meson: Update lua wrap to 5.4.6-4
This version of the lua wrap fixes installation of the library which
was previously causing liblua SOs to be missing when Mesa was installed
using `meson install`.

Signed-off-by: Mark Collins <pixelyion@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26185>
2023-11-15 13:29:20 +00:00
David Heidelberg
1eff68dd2a ci/traces: drop the freedoom-phase2-gl-high.trace
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/8080#note_2154467

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8080
Cc: mesa-stable
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26199>
2023-11-15 12:56:01 +00:00
Georg Lehmann
b12d7f10d4 aco: validate ALU operands and defs
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
91539713bb aco: add src/def count and size for all ALU opcodes
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
d9c3ba3b90 aco: use correct operand size for int tg4 wa
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
1d167d187e aco/gfx10+: don't use v_cmpx with VCC def
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
509ce19643 aco: add missing scc def for SALU quad broadcast
Cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
18f6c2328f aco: use lm for carry out in vsub32
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
9acd9c0100 aco/tests: use correct operand size for some 64bit ops
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
6a136b4e05 aco/tests: add some missing scc defs
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
2f4e53b22a aco: fix detecting sgprs read by SMEM hazard
s_waitcnt_lgkmcnt is SOPK, not SOPP and there are other SOPK instructions
that don't mitigate the hazard.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Georg Lehmann
e49c413a86 aco: use null operand for SOPK s_waitcnt
Both null def and op result in the same correct encoding, but these
instructions optionally read a sgpr, so it makes more sense to use an operand.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26163>
2023-11-15 12:35:32 +00:00
Job Noorman
bcf0425f7f ir3: correctly set bit size for 64b constant @load_ubo
When lowering @load_constant to @load_ubo, the bit size is currently
hard-coded to 32. This causes validation errors when lowering a constant
with a 64b bit size.

This patch fixes this by setting the @load_ubo bit size correctly for
64b constants. This 64b load is later lowered to a 32b load by
ir3_nir_lower_64b_intrinsics.

Fixes Piglit test:
- spec@arb_gpu_shader_fp64@execution@fs-indirect-temp-double-src

This patch has no impact on shader-db.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26191>
2023-11-15 11:58:22 +00:00
Samuel Pitoiset
bb92c34c28 radv: set radv_zero_vram=true for Unreal Engine 4/5
Unreal Engine seems to rely on uninitialized memory and
RADV_DEBUG=zerovram fixes a bunch of issues.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9025
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9380
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9026
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26188>
2023-11-15 11:24:31 +00:00
Samuel Pitoiset
627d593443 radv: fix registering queues for RGP with compute only
This crashes if the graphics queue isn't created.

Fixes: 930e77e903 ("radv/sqtt: add support for queue info")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10136
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26183>
2023-11-15 10:41:50 +00:00
Matt Turner
b66b299eda r600: Add missing dep on git_sha1.h
Bug: https://bugs.gentoo.org/917116
Fixes: 3ab51c7ebd ("r600: Add callbacks for get_driver_uuid and get_device_uuid")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26195>
2023-11-15 10:17:05 +00:00
Karol Herbst
3916ee05b0 rusticl/api: workaround DPCPP fetching clSetProgramSpecializationConstant
Nobody has to advertize it as an extension, but here we are.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25701>
2023-11-15 08:34:57 +00:00
Karol Herbst
924c8e7bcd vtn: add hack for system values placed in CrossWorkgroup memory
Upstream bug: https://github.com/intel/llvm/issues/6703

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25701>
2023-11-15 08:34:57 +00:00
Karol Herbst
41f814df6f nir: allow vec derefs on system values
There is no real reason to prevent this as far as I know. And some of the
SPIR-V generated by DPCPP is running into this.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25701>
2023-11-15 08:34:57 +00:00
Faith Ekstrand
23e1f3c373 nvk: Use nak_shader_info natively
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:13 +00:00
Faith Ekstrand
c074ea6215 nak: Handle the num_gpr offsetting inside nak
This makes the thing in the nak_shader_info exactly the thing that gets
plugged into the hardware.  Makes the driver a bit simpler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:13 +00:00
Faith Ekstrand
d8551cd328 nak: Add a writes_layer bit to nak_shader_info::vtg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
a232050204 nak: Move clip, cull, and XFB into a nak_shader_info.vtg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
440adf7970 nak: Properly prefix nak_xfb_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
4e6e814f5e nak: Rename TLS to SLM
Shader Local Memory is what NVIDIA calls it in the shader header docs as
well as the command stream headers.  Better to be consistent even if it
gets my Intel brain confused.  (Intel uses SLM for shared memory.)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
a946071546 nvk: Use nak_fs_key instead of rolling our own
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
0f086401e3 nvk: Move even more lowering into nvk_codegen.c
At this point, we're fully trusting NAK to do its own lowering and we
only lower stuff in nvk_shader.c if it's relevant for Vulkan.  This also
assumes that NAK is already doing the right thing everywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
67bb8e8165 nvk: Move the guts of nvk_compile_nir() to nvk_codegen.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
0405f494e8 nvk: Move the optimization loop to the nvk_codegen.c
We also call it from nak_preprocess_nir and lower var copies there.  NAK
should already be doing this for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
7f8fbacb8a nvk: Move a bunch of codegen-specific lowering to helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
c3a44f6264 nvk: Add a codegen helper for nir_shader_compiler_options
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
845e7d2911 nvk: Only lower outputs to temporaries
Also, move it up to right after we parse the SPIR-V and remove some now
unnecessary clean-up passes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
26bb5f4972 nak/nir: Lower indirect FS inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
e507d70333 nvk: Handle load_first_vertex in nvk_nir_lower_descriptors()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
82061b1b9d nvk: Only advertise VK_KHR_shader_terminate_invocation if using NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
David Rosca
fcfa68a632 Revert "frontends/va: Alloc interlaced surface for interlaced pics"
This reverts commit 578e10e157.

The only reason for reallocating surfaces as interlaced (on drivers
that supports both progressive and interlaced) was deinterlacing
with postproc filter, but that now also supports interleaved surfaces.

With this change interlaced surfaces are no longer used on radeonsi.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26174>
2023-11-15 01:44:29 +00:00
David Rosca
eafeff6302 gallium/auxiliary/vl: Support interleaved input in deinterlace filter
This adds support for deinterlacing interleaved surfaces (both fields
interleaved together instead of as separate layers).

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26174>
2023-11-15 01:44:29 +00:00
David Rosca
35b0ccd855 gallium/auxiliary/vl: Scale dst_rect x0/y0 when rendering chroma plane
This fixes incorrect chroma plane position when x0/y0 is not zero.

Fixes: 001358a97c ("vl/compositor: add a new function for YUV deint")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
2023-11-15 01:12:01 +00:00
David Rosca
e9091b1f5c gallium/auxiliary: Fix coordinates clamp in util_compute_blit
Fixes: 7c8e1596d6 ("gallium/auxiliary: Fix util_compute_blit half texel offset with scaling")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
2023-11-15 01:12:01 +00:00
David Rosca
ef0546152f gallium/auxiliary/vl: Fix coordinates clamp in compute shaders
Fixes: a6a43963ed ("gallium/auxiliary/vl: Clamp coordinates in compute shaders")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
2023-11-15 01:12:01 +00:00
Jesse Natalie
cd0cff951a nir_lower_mem_access_bit_sizes: Fix write-mask-constrained 3-byte stores as atomics
The code here handled stores of actual 3-byte values (8-bit, 3-component), but didn't
correctly handle stores of larger 8-bit vectors that were constrained by write mask to
just 3 bytes. In that case, the pad-to-vec4 step was unnecessary and problematic.

Seen in CL CTS test_basic vector_swizzle test group for char3 with CLOn12.

Fixes: c70d94a8 ("nir_lower_mem_access_bit_sizes: Support unaligned stores via a pair of atomics")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26034>
2023-11-14 21:10:30 +00:00
Helen Koike
bff7e4b69d ci/zink: add spec@ext_timer_query@time-elapsed to flakes
Add the following flake to zink-anv-tgl-flakes.txt

spec@ext_timer_query@time-elapsed

See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25861#note_2140498

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25885>
2023-11-14 17:29:30 +00:00
Faith Ekstrand
618bdb8571 nak: Rework FS input interpolation
This gives FS I/O the same treatment as we did for vertex attributes in
that we now have a NIR intrinsic which pretty closely matches the
hardware and we lower to that before going into NAK.  This gives us a
bit more control in the NIR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:03 +00:00
Faith Ekstrand
d3c5688cf5 nak: Plumb the nak_compiler through to lower_fs_input_intrin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
f5ba0751e2 nak: Make encode_sm75 a method of Shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
a6376705e4 nak: Make ALD/AST.PHYS a boolean
The generic flags field was originally copied from codegen but a boolean
makes way more sense.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
8e00ee6fe8 nak: Drop OpAtomCas in favor of OpAtom with atom_op == CmpExch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
ea453b373d nak: Fix copy-prop for OpPLop3 sources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
a65518b625 nvk: Free NAK shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Rhys Perry
c4ee639ca0 docs: fix RADV_THREAD_TRACE_CACHE_COUNTERS default
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: dbab98d9d6 ("radv: enable RADV_THREAD_TRACE_CACHE_COUNTERS by default")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26193>
2023-11-14 16:24:11 +00:00
Jesse Natalie
2f1cb79968 d3d12: GL4.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Jesse Natalie
5a5178d5a4 d3d12: Fix MSAA-disabling pass; sample mask should be 0 for helper lanes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Jesse Natalie
ba06542c7b d3d12: Handle cull distance as an XFB target
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Jesse Natalie
263b56051d d3d12: PRIMITIVES_GENERATED for stream > 0 should only be an SO query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Tatsuyuki Ishi
538ca7801a radv: Use shader part caching helpers for VS prolog and PS/TCS epilog.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26028>
2023-11-14 13:45:22 +00:00
Tatsuyuki Ishi
611545fbfe radv: Implement helpers for shader part caching.
Currently, shader part caching logic is duplicated between VS prolog and
PS/TCS epilogs. This commit introduces a common abstraction to
deduplicate the code.

Additionally, there are a few design decisions that diverts from the
current implementation:
1. A simple mutex is used instead of reader-writer lock. Prolog/epilog
   constructions are serialized, removing the need to free duplicate
   objects in case of a race.
2. A CS-local cache is used to quickly lookup an entry without holding a
   lock. This eliminates locking in over 99% of cases.
3. A set is used to reduce number of allocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26028>
2023-11-14 13:45:22 +00:00
Danylo Piliaiev
3cd6bb3e5d tu: Add a725 workaround dispatch at the start of each cmdbuf
Blob executes a special compute dispatch at the start of each
command buffers. We copy this dispatch as is. At this point
we don't know what this workaround is for.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
Danylo Piliaiev
37f11ff1d4 freedreno/devices: Support Adreno 725
For 0x07030002 chip id different names are returned on different
phones: Adreno730v3 or Adreno725v1. Settle on 725 to disambiguate
them.

The only difference from base 730 is that it has conditional
execution of compute shader at the start of every command buffer.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
Danylo Piliaiev
28f187b9a7 tu: Return error when GPU is unsupported
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
Danylo Piliaiev
a669147689 tu: Always print startup failure messages
If we encounter an error during the startup we always want to have
it in the logs to quickly diagnose an issue from user attached logs.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
LingMan
76996e2a94 rusticl: Use the from_raw_parts wrappers
Deduplicates some safety checks and ensures we didn't forget one.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
LingMan
471d89c4fd rusticl/api: Add checking wrappers around slice::from_raw_parts{_mut}
They check for null, alignment, excessive size, and address space wrapping. If any of the checks
fails, `Err(CL_INVALID_VALUE)` is returned.

The caller still has to uphold the other requirements of the `from_raw_parts` fns.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
LingMan
572a96aa59 rusticl: Turn pointers in enqueue_svm_memcpy_impl into slices
Allows the closure to implement `Send` and `Sync`, which we want for `EventSig`.
Includes detailed documentation on the casts and unsafe operations.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
LingMan
7dd5a22735 rusticl: Turn pointers in enqueue_svm_mem_fill_impl into proper Rust types
Raw pointers have bad ergonomics and by using them we opt out of a lot of Rust safety guarantees.
The closure we create modifies the memory behind `svm_ptr`. Make that clear to the compiler by
representing it as slice. `pattern` could also be represented by a slice but then we'd create
overly generic code not exploiting the guarantees given to us be the OpenCL spec.
Namely that there's only a few possible sizes - all of them a power of two - and that `svm_ptr` is
aligned to that size.

Thus, represent `pattern` as one struct per possible size and have the compiler generate optimized
code paths for filling the buffer with each of them. There's one unsafe operation less and the
remaining ones as well as the casts have been documented in detail.

Based on that additional checks of the provided `size` have been added. While it's unlikely that
any application will ever run into them, the old pointer arithmetic already silently relied on
these properties.

Furthermore, since raw pointers are neither `Send` or `Sync` but the Rust types we now use are the
closure can now implement `Send` and `Sync`. That's one step toward marking `EventSig` `Send`.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
Eric Engestrom
fdbb5d5898 ci/valve-infra: ensure the correct farm picks up the job
Until now, any farm that has a DUT that matches could have picked up the
job.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25821>
2023-11-14 10:25:24 +00:00
Pierre-Eric Pelloux-Prayer
898ccf7711 radeonsi/ci: update failures
Remove GTF-GL46.gtf21.GLCoverage.CoverageGL21 from failing tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25956>
2023-11-14 09:28:00 +00:00
Pierre-Eric Pelloux-Prayer
64352ae8e4 mesa: restore call to _mesa_set_varying_vp_inputs from set_vertex_processing_mode
Otherwise ctx->VertexProgram._VaryingInputs might not be up to date.

We can't do this in update_program because this breaks vbo_save_playback_vertex_list_gallium:

  const GLbitfield enabled = node->enabled_attribs[mode];
  _mesa_set_varying_vp_inputs(ctx, enabled);              <-- update _VaryingInputs

  if (ctx->NewState)
     _mesa_update_state(ctx);                             <-- calls update_program, reverting the
                                                              change made above

Fixes: c97961a855 ("mesa: fix 38% decrease in display list performance of Viewperf2020/NX8_StudioAA")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9441
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25956>
2023-11-14 09:28:00 +00:00
Samuel Pitoiset
dfc125d423 radv: fix VRS subpass attachment when HTILE can't be enabled on GFX10.3
On GFX10.3, VRS rates need to be copied to the HTILE buffer but in some
situations, like for mips, it's not always possible to enable HTILE.
In this case, we can fallback to our internal HTILE buffer and tweak
the depth/stencil registers to use this HTILE buffer.

This fixes a bunch of VRS crashes on GFX10.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26025>
2023-11-14 09:02:46 +00:00
Sagar Ghuge
648c0c159d anv: Flush data cache while clearing depth using HIZ_CCS_WT
Patch fxes ESO shadow pass ground corruption on Arc A750. In the colour
pass where the rendering corruption first appears, the depth resource
was used as a "PS - Texture".  Immediately afterwards there's a Barrier
where it goes from

	VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL =>
	VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL

immediately following that there's a Clear from vkCmdBeginRendering
which appears to be a HiZ clear.  Things work when using AUX_USAGE_HIZ
but AUX_USAGE_HIZ_CCS_WT (XXX: and AUX_USAGE_HIZ_CCS?) doesn't work.

current thinking is this is related to 14015264727 where we had to add
HDC and DC flushes to CCS and MCS fast clears.  Maybe HiZ clears with
CCS also have similar problems?  The docs don't appear to indicate that
but the docs were also wrong for color clears until recently...

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9277
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9444
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22717>
2023-11-14 08:30:59 +00:00
Tapani Pälli
e4db19afa7 iris: add data cache flush for pre hiz op
This fixes various failing Piglit tests on DG2.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22717>
2023-11-14 08:30:59 +00:00
Maíra Canal
4d95b4861e v3dv: implement VK_EXT_multi_draw
Implement the Vulkan extension VK_EXT_multi_draw. It was tested with
deqp-vk -n dEQP-VK.draw.*multi_draw*.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26138>
2023-11-14 06:20:21 +00:00
Lionel Landwerlin
794b0496e9 anv: enable protected memory
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>
2023-11-14 05:55:54 +00:00
Lionel Landwerlin
fd40134487 anv: allow protected GEM context creation
v2: Update new anv_gem_create_context_engines()

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>
2023-11-14 05:55:54 +00:00
Lionel Landwerlin
be201008ca anv: Emit protection + session ID on protected command buffers
v2: Add the missing PIPE_CONTROL enable/disable bits

v3: Use new I915_PROTECTED_CONTENT_DEFAULT_SESSION

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>
2023-11-14 05:55:54 +00:00
Lionel Landwerlin
be327b1452 anv: allow creation of protected queues
v2: Add helper for getting queue properties

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>
2023-11-14 05:55:54 +00:00
Lionel Landwerlin
5f2c77a10a anv: handle protected memory allocation
v2: Add assert on VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT in vkMapMemory

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>
2023-11-14 05:55:54 +00:00
Lionel Landwerlin
5ef8587b1e intel: fix PXP status check
Current check doesn't work on older kernels.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8064>
2023-11-14 05:55:54 +00:00
Faith Ekstrand
ade73d2e7f nvk: Stop asserting 11-bit storage image handles
Now that NAK is the default for Turing+, we can just chalk any storage
image descriptor handle overruns up to codegen bugs.  We could plumb
shader stages all the way through to here and only assert when codegen
is in use but that's a lot of work just for an assert.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
92cb4cc7f6 nvk: Default to NAK on Turing+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
M Henning
f2495f47a7 nvk: Use load_global_constant for ubo loads
and support load_global_constant in nak

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
M Henning
1d7e051a7f nak: Add MemOrder::Constant
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
M Henning
2a02a0d0b3 nak: Bind nir_intrinsic_access
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
M Henning
dfb6260483 nak: Specify MemScope on MemOrder::Strong
The scope isn't relevant on MemOrder::Weak. In fact, ptxas refuses
any input that specifies a scope on weak loads. So, don't make those
combinations representable in our IR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
94ea8a5883 ci: Update the python env for ci_run_n_monitor.py
Without this, it blows up on Fedora 39 because of changes introduced by
Python 3.12 which break a a couple of our dependencies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
6b8cdf84f0 ci: Add syn to --force-fallback-for
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
07e860d3a2 ci: Bump container images for NAK dependencies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
f54b1f1e77 meson: Set build.rust_std
This is needed because meson currently makes rust_std part of the build
environment and therefore per-arch.  This is a bit nonsense but it's not
too hard to work around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
e43e8f3f78 nak: Require meson 1.3.0 and clean up a couple bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
7feba721c5 nak: Rely on Rust 1.73 for next_multiple_of() and div_ceil()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
c7c73d6d17 nvk: Enable subgroups features
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
4bd9c99ca0 nak: Document a bit in encode_lds()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
0177373e2d nak: Insert an OpNop after OpBar
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
e111bfdb5c nak: Emit MemBar before Bar
This is what NVIDIA does. I'm not sure why this order but it seems
necessary to pass some of the 1.1 memory model tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
bc58620e1e nak: Use the simplified BAR.SYNC encoding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
4f2f9c6ab3 nak: Use strong ordering for Image load/store
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
ec2c866a77 nak: Emit CCtl in barriers with acq/rel semantics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
8781acba18 nak: Allow 1-component image load/store
We get these when we get an atomic image load/store

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
ee11b473b5 nak: Implement read_invocation and shuffle_*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
edf015eb7f nak: Fix the encoding of OpShfl
We weren't handling Zero.  Also, we need to mask immediates or else the
encoder blows up.  The hardware automatically masks them when they come
in as sources but when we get immediates, they're not guaranteed to fit
in the bitfield.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
5dd7a76c8b nak: Implement vote and ballot
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
3df9065296 nak/nir: Zero-pad subgroup masks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
37de14e2e2 nak/nir: Allow boolean vote_ieq
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
143d88dcc3 nak: Lower subgroup_id and num_subgroups
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
42a305416a nak: Use nir_shader_intrinsics_pass for system values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
ce40d81d46 nak: Call nir_lower_subgroups()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
bf8642e984 nak: Remove unnecessary control barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
3468f70ca1 nak: Use barriers for re-convergence
Now that we're getting total re-convergence through barriers, we can
drop our OpWarpSyncs in front of barriers and derivatives

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
22468439ff nak: Handle control-flow barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
95f368a105 nak: Add OpBreak
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:15 +00:00
Faith Ekstrand
3957124492 nak/nir: Add a pass for adding convergence barriers
This should give us maximum re-convergence

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
eb0d9a1b88 nir: Add nvidia barrier intrinsics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
4ec66f3e5c nak: Don't print a range for one register
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
f29b714ec9 nak: Drop the final calc_max_live() after GPR spilling
It's dead code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
ea27d57882 nak: Get rid of warnings in nak_sph.rs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
bf04914315 nak: Get rid of dead code warnings in RegFileSet
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
9166b3354c nak: Drop some unused helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
d0b724aaac nak: Add some #[allow(dead_code)]
All this is either enums where we want all of them for the sake of
documentation or where I'm pretty sure we want them in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
eb8f907855 nak: Upgrade to more modern meson
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Mary Guillemard
f757508d65 nak: Move nir_lower_int64 after I/O lowering
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Mary Guillemard
09d3871267 nak: Implement VK_KHR_shader_terminate_invocation
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
c32b73fdf2 nak: A quick rustfmt fix
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
2b4621b9d8 nak: Use Src::From<u32> and Src::From<bool>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
0616003de9 nak: Rename lower_vec_split() to lower_ineg()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
a43e6addca nak: Fix fneg to do fadd(-0, x)
Thanks to floating point sillyness, fadd(0, x) isn't a no-op but
fadd(-0, x) is.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
2c1cc06d03 nak: Support encoding -Zero
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Mary Guillemard
a0b517ba3f nak: Ensure we allocate one barrier when using BAR.SYNC
Fix "Illegal Instruction Parameter" when using barrier() on compute
shaders.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
29804bfd26 nak/nir: Don't lower 1-bit phis
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
8d802553a2 nak: Fix to_cssa()
I somehow got the dominance check backwards so it's not actually
inserting parallel copies most of the places it should.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
ed187b6e51 nak: Fix parallel copy handling in spilling
Only consider copies with the right file.  Otherwise, the spill chooser
will blow up looking for the next use.  Also, we were marking
destinations as spilled when I ment to mark them as being in W.  This
was a right mess.  God thing to_cssa() was also broken so it wasn't
inserting nearly as many parallel copies as it was supposed to. 🙃

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
2ff6a36e2a nak: Fix repair_ssa() for back-edges
In the presence of nested loops, there is no guarantee that we can
handle back-edges in a single pass.  Instead, use a bitset as a worlist
and repair until we're out of missing sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
5839be3c4d nak/sph: Round tls_size up to a multiple of 16
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
009ae6e7f5 nak/bitset: Fix next_set()
It was resetting mask to 0 instead of u32::MAX.  This is a copy+paste
error from when I copied it from next_unset() and tweaked it to find set
bits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
2cc51639ab nak/bitset: Add an is_empty() helepr
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
0f6d8640e1 nak/bitset: Improve set_words()
Only set the bits requested and don't clobber other bits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
5b355ff25a nak: Fix opt_out
It was converting instructions to/from Op which throws away predicates.
This meant that any instruction immediately after an OUT.EMIT would
loose its predicate (if any).  If an OUT.EMIT comes right before a BRA,
this results in the branch always getting taken.

While reworking things, I also totally reformatted the pass to make it
more readable IMO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Mary Guillemard
950db58132 nak: Add geometry shader support
Tested on SM75 and SM86.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
c87693a700 nak: Fix a bunch of warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
M Henning
09d78e8572 nak: Memory order/scope encodings for Ampere
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
M Henning
ad0743c948 nak: Remove MemScope::Cluster
because
 * ptxas refuses inputs with .cluster before sm90
 * on sm90 ptxas encodes .cluster as .gpu
 * nvdisasm calls this encoding on sm75 .SM
so I don't think we have an actual .cluster on any released gpus

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
M Henning
93f83a948f nak: Fix a warn(unused_must_use) by calling drop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Daniel Almeida
590133b28d nak: add support for atomic cmpxcgh on images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
f85069ed57 nak: Use nak_nir_lower_vtg_io
This massively simplifies nak_from_nir.rs because it lets us do all the
annoying NIR fiddling in NIR and not in the back-end.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
7ece220f96 nak/nir: Lower systm values before lowering I/O
This way I/O lowering can lower the stuff we generate in
lower_system_values().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
abe9c1fea2 nak: Add NIR lowering for attribute I/O
This adds 4 NIR intrinsics for attribute I/O which match the Turing
hardware instructions as well as a lowering pass to lower
load/store[_per_vertex]_input/output to thewe intrinsics.  This greatly
simplifies nak_to_nir.rs.  Also, this pass is able to handle a bunch of
cases that the current code in nak_from_nir.rs can't:

 - Misaligned access (i.e., a vec3 load at 0x0f4)

 - Write masks on store[_per_vertex]_output

 - Indirect load/store where we need to use AL2P to get physical
   addresses, including scalarizing those cases

It also handles the casses where we need to use ISBERD on vertex indices
in the same pass.  When we switch to this, we'll rip out the dedicated
per_vertex lowering pass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
c1ffdb3ee9 nak/nir: Use count_vec4_slots instead of count_attribute_slots
This will give us the correct behavior in for doubles when the time
comes.  The count_attribute_slots() helper is for GL attributes where a
dvec4 countes as one slot.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
498afcdb88 HACK: Only emit OpBar in compute shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
611fe837bb nak: Fix lowering for patch_vertices_in
We have to grab the 2nd byte of the sysval for some reason.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
efbbc3ed93 nak: Implement load_tess_coord
We could lower this to load_per_vertex_output in NIR but then it
confuses all sorts of NIR passes which assume load_*output only
happens in control shaders.  We could also add a magic NIR intrinsic
but it's probably easier to just special-case this one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
b5cb508523 nak,nvk: Plumb through tessellation info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
bd90031b5b nak/nir: Lower load_primitive_id
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
c2768736c9 nak: Implement more attribute I/O
This commits implement load/store_per_vertex* and load_output which are
required for tessellation shaders.  Because things are getting a bit
complicated, it's easier to combine all the attribute load/store ops in
a single case in the match.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
091410c708 nak: Add lowering for per-vertex I/O
NVIDIA hardware doesn't take a vertex index for per-vertex I/O.
Instead, it takes an offset into the primitive.  This has to be fetched
using a combination of SR_INVOCATION_INFO and the ISBERD instruction.
To keep things simple and allow for maximum CSE, we do the lowering in
NIR and patch the load/store_per_vertex_input/output intrinsic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
aa76c86042 nak: Handle location_frac for FS outputs in nak_from_nir.rs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
1251bb7588 nak: Set per patch attribute count both places in the SPH
This is what codegen does and it seems to be required.  Maybe it's an
SPH version thing?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
f097303a99 nak: Rework OpALd and OpASt a bit
Replace the out_load flag with an output flag which we now require to be
set for OpASt.  Also, improve printing so we add .O and .P qualifiers as
needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:14 +00:00
Faith Ekstrand
f5805dadab nak: NVIDIA calls them tessellation init shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
dfbc03fa88 spirv: Fix locations for per-patch varyings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
c6c2c1b2b2 nak/nir: Lower tessellation and geometry I/O
We also need to call nir_lower_indirect_derefs.  Even though we're not
lowering anything away, we need to call it so that it will lower clip
distance arrays.  The pass always lowers compact array derfs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
93db2c1254 nak: Plumb clip/cull enables through nak
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
d4d7f26151 nak: Add enums for sysvals and attributes
It's much nicer to have a canonical place for all these things to live
which gives them actual names.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
a4c1ec3892 nak: Implement From for SrcRef for more types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
0d725cccbd nak: Implement NIR control barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
5e6dd0412b nak/builder: Return the instruction from push_*()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
9b6a4aab8d nak: Add barrier instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
2514058c82 nak: Allow encoding Dst::None
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
cc6f26b005 nak: Break indirect offset encoding into a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
2a61e59bba nak: Add OpNop which can have a label
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
e3fa6f3557 nak: Add a Label struct for branch targets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
f2e07cbab9 nvk: Plumb through XFB info from NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
30f01c47c2 nak: Translate XFB info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
62ac73d5e3 nouveau/parser: Dump SET_STREAM_OUT_CONTROL_* properly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
c2c010055a nak: Handle non-constant I/O offsets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
827dba398d nak: Don't allocate bitsets in liveness data-flow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
04658a2a11 nak/bitset: Add a helper for modifying in-place
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
19e0c52837 nak: Run simple liveness data-flow bottom-up
Rookie mistake... The liveness algorithm propagates information from
later blocks to earlier blocks so if you run bottom-up it's exactly two
passes when there aren't loops.  If you run top-down, it's quadratic in
the number of blocks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
046a2d5004 nvk: Set clip/cull_enable for NAK shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
a4ff5a9fc6 nak: Simplify I/O gathering
This adds mark_attrs_(read|written)() helpers to VtgIoInfo which take a
range of attribute addresses and mark the range as-needed.  It adds a
similar mark_attr_read() helper to FragmentIoInfo which only marks a
single address and takes a PixelImap.  This gets us down to only needing
to duplicate the address range if ladder twice.  For VTG I/O, having it
take ranges will be more ergonamic when it comes time to handle non-
constant I/O offsets.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
32910d3016 nak: rustfmt fixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
40ec7efa07 nak: Move NIR enum translation out of nak_sph.rs
Better to keep all the NIR stuff together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
145213fd2c nak: Restructure ShaderInfo
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
267a4f07d0 nak: Remove encode_hdr_for_nir
Now unused as nak_sph::encode_header handles it.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
a926c67335 nak: Collect information to create SPH
This should cover everything except tesselation.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
8d07d033ae nak: Add a complete wrapper around SPH
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
97c249a353 nak: Fix printing of OpASt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
a7eb42119a nak: Take component into account in store_output
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
330f3e6fa8 nvk: Lower more draw system values
In codegen, these are handled by the backend by passing in cbuf numbers
and offsets.  NAK expects us to lower these in the driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
263dfd4838 nvk: Add a helper for lowering system values to root table loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
1a2bed819d nak: Fix ALD/AST encoding for vtx and offset
The bit offsets were inverted compared to gv100 codegen.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
66c9c40f68 nak: Handle modifiers in dedup_srcs() in opt_lop()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
1b6962eb7e nak: Provide more detail when printing IR after passes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
5654366a55 nak: Fold source modifiers in legalize
We were smashing them to None later but didn't actually take them into
account in fold_lop_src() to ensure the smash was valid.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
6da06bf7d7 nak/nir: Return one sample for gl_SampleMaskIn[0] when sample shading
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
0e393f0d58 nak/nir: Interpolate gl_PointCoord
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
062735c1cc nak/nir: Add a load_frag_w helper
Also, rework things a bit.  The one functional change is that we now put
1/w in gl_FragCoord.w which should fix a CTS test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
8ec753749a nak/nir: Fix sample vs. pixel input interpolation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
1ab35afc26 nak/nir: Move frag_coord/sample_pos lowering to FS input lowering
It monkeys about with interpolation so it makes more sense to keep all
that stuff together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
460a0d8a4c nak/nir: Plumb the FS key into lower_fs_input_intrin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
580b98f353 nak: Gather global memory usage for ShaderInfo
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
0afc6fa880 nak: Add for_each_instr in Shader
Allows to visit each instructions without remapping every functions.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
e9bad677af nak: Plumb uses_kill through from nak_from_nir
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
274d521c22 nak: Take components into account in load_*input
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
543eebb272 nak: Handle interpolate_at_offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
f5c41151f2 nak/nir: Use nir_shader_intrinsics_pass for FS inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Mary Guillemard
04911df940 nak: Add support for fddx and fddy
This uses SHFL in combination with FSWZADD.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
e174fc9ab3 nak/nir: Fix helper invocations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:13 +00:00
Faith Ekstrand
4e14cefa70 nak: Add support for gl_FrontFace
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
2c91587ac5 nak: Saturate depth writes
Otherwise, they get may clipped away.  This seems wrong in light of
unrestricted depth but it fixes a bunch of CTS tests for now so let's go
with it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
6abbef04b0 nvk/nak: Translate our new FS flags from NAK to nvk_shader
Eventually, we want to drop all this garbage from nvk_shader and just
use nak_shader_info directly but, for now, it's less disruptive to just
translate from new to old.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
34cc225070 nak: Plumb more FS info through to the C API
These are needed for state setup, not the shader header so we have to
plumb them all the way through to the driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
0ec283083c nak: Re-plumb compute shader info
Put the stuff in nak_shader_info in nak.h into a union so we can have
other stage info exported as well.  Then plumb local_size and smem_size
through ShaderInfo like we do for a bunch of the FS things.  While we're
shuffling things around, pull nak_shader_info::cs into a union.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
9eeda9dd6d nak: Rework FS outputs again
This time we map them to a consistent output address space like we do
for all other I/O and system values and do the remap in nak_from_nir.
This lets us know very precise usage information and more robustly build
the OMask in the shader header.  We also handle location_frac now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
7ce8470bd4 nak: Stash a ShaderInfo in ShaderFromNir
We're going to want to gather data into this struct as we go.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
3cdc26c157 nak: Pull sm, num_gprs, and tls_size into a ShaderInfo struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
141137ad14 nak: Use count_attribute_slots for FS input var sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
64168e58cd nvk,nak: Plumb through the zs_self_dep key bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
c54f622a93 nak: Set TLS size properly in the shader header
We were only accounting for load/store_scratch before, not spilling.
Pull the value from the Shader, that one's accurate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
cbb05f0e6b nak: Implement discard and demote
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
24c2728ca5 nak: Implement load_sample_id and load_sample_mask_in
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
595f03957c nak/nir: Several FS output fixes
1. Lower arrays to elements
 2. Multiply locations by 4 to get GPR numbers
 3. Fix dual-src blend
 4. Sample mask and depth both consume slots if either is used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
ea750f1ffd nak: Handle empty OpFSOut
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
ecf5c4c13b nak: Properly handle OpFSOut in RA and liveness
That one's a bit magic because it exists to ensure that each output GPR
ends up in the right register at the end of the shader.  We tried to
handle it as a simple lowering before but it's easier and safer to
handle it directly in RA and liveness.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
c47488341e nak: Use load_interpolated_input for frag_coord
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Dave Airlie
0e327167a2 nak: do perspective divide for interp none as well
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
ab80e1189f nak: Add support for centroid and sample interp modes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Dave Airlie
850668c942 nak: make ipa encoding match the order in codegen gv100
78 has interp mode
76 has sample mode

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
dadc79d96f nak: Handle flat FS inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
ea6057deb4 nvk: Use sysvals for fragcoord etc. with NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
073b2257dd nak: Emit FS_OUT before EXIT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
a07aa29f61 nak: Re-work Instr::get_latency()
We re-order and re-arrange the whole thing by instruction type.  Also,
instead of returning an Option<u32>, have a has_fixed_latench() method
to check the instruction and then get_dst_latench() to get the latency
from instruction launch to the given destination index being available.
This lets us handle predicates properly which have a different number of
cycles for some reason.  Oh, it's now just as correct as the estimates
in nv50_ir_target_gm107.cpp.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
3ad3f1376c nak: Rework calc_delay.rs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
2288b33a48 nak: Rework the barrier insert pass
This is mostly a refactor but it does tuck in a three functional
changes:

 1. We no lonter insert read barriers for sources that we immediately
    overwrite in the instruction.

 2. We track read and write barriers separately so we don't wait for
    read-after-read hazards but do for write-after-read.

 3. Wait on all barriers in branch instructions

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
91ea23103a nak: Use the right number of predicates in RegTracker
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
57dde7f217 nak: Implement Index[Mut] for RegTracker
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Mary Guillemard
405a9ccca8 nak: Make PRMT selection a Src
On SM50, because of immediate form limitations to 20 bits, we need to
use a register to use PRMT.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Mary Guillemard
c38c456270 nak: sm75: Fix panic when encoding MUFU with SQRT and TANH
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
1b869d2db5 nak: Rename OpBFind to OpFlo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
eb10a778fd nak: Fix instruction ordering in nak_ir.rs
I'm trying to stick to the ordering in the NVIDIA docs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
3e8344a4c8 nak: Remap GLSL_SAMPLER_DIM_SUBPASS and SUBPASS_MS to 2D and MS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
80230731ec nak: IMAD also has a destination predicate
Also use set_pred_dst(.., Dst::None) for IMAD64

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
ab7a4b531d nak: Disable lower_image_size_to_txs for NAK
We don't need it for NAK and it actually screws up cubes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
86c7bcc9e3 nak/legalize: Fix too many IADD3 source modifiers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
0222107699 nak: Move all the IADD3 insanity to a new OpIAdd3X opcode
Because of its crazy behavior around overflow, we don't want the full
IADD3 opcode to support any sort of source modifier propagation.  This
makes us a new OpIAdd3X opcode which contains all the crazy and lets
IAdd3 remain the usual 32-bit integer thing everyone knows and loves.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
c5b9d42ac2 nak: Add an alloc_vec() to SSAValueAllocator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
52acb12f75 nak: Document spilling and RA
This isn't full documentation but it at least sprinkles paper citations
all over as well as descriptions of where we diverge from said papers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
a0bf406057 nak/spill: Tweak the construction of S sets
Instead of just taking live-in \ W, consider anything previously spilled
to be spilled.  This lets us avoid a bunch of redundant spills because
we now allow spills to persist across blocks even if the value is in W.
In the loop header case, however, we still need to add in live-in \ W or
else we can end up in cases where a value is neither in W nor S.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
ea0ae395a9 nak/ra: Improve coalescing
We now delete OpParCopy src/dst pairs when they get coalesced.  We
can also coalesce OpCopy which is potentially useful given they are
generated by spilling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
46d489fa4d nak: Implement shader clock
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
84d1765690 nak: Add a debug flag to test spilling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
07b9465b5d nak: Spill registers before RA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
aa93578915 nak: Use the correct number of GPRs on Turing+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
bcad2add47 nak: Add a spilling pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
a502a994e8 nak: Add more NextUseLiveness helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
72a4721412 nak: Add a RegFileSet filter to NextUseLiveness::for_function()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
002ee9e40e nak: Expose LiveSet for incremental liveness tracking
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:12 +00:00
Faith Ekstrand
8c04737a6a nak/ra: Don't free killed for OpPhiSrcs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
efee3264b2 nak/ra: Handle parallel copies as a special case
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
4d5bf265b0 nak/ra: Drop the pointless AssignRegs struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
57a7932bb5 nak: Union find
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
4a08105922 nak: Add an SSA repair pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
214b7e4b88 nak: Add a to-CSSA pass
Conventional SSA (also called CSSA) requires phi nodes be isolated by
parallel copies such that there is no interference between SSA values.
This is required for many out-of-SSA algorithms and, in our case, a
prerequisite for spilling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
d574d29102 nak: Add helpers to BasicBlock to get phis
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
2f9565e725 nak: Add a dominance check to CFG
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
bef6c1095e nak: Add interference helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
0fd3510166 nak: Restructure liveness construction
Drop the for_block() stuff and instead have the parent add defs and uses
one at a time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
2c3eb239f8 nak: Allow DCE on functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
002022a0b1 nak: Handle RegFile::Mem in parallel copy lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
4f05308ad9 nak: Add a Mem register file
For spilling, we want to be able to treat TLS as if it were a register
file.  It unifies and makes everything easier.  Also add support to
OpCopy to for copying between GPR and Mem.  We cannot, however copy
directly from Mem to Mem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
fe7ac83a94 nak: Use more OpCopy
Instead of using OpMov or OpParCopy, use OpCopy directly.  This reserves
OpParCopy for RA type things and OpMOv for actual codegen.  We can also
drop OpMov from copy propagation now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
8185f3064e nak: Use OpCopy in legalize
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
fc35dd6aba nak: Use the builder for the legalize pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
4c798afb25 nak: Add a new OpCopy instruction for parallel copy lowering
This is different from OpMov because OpMov is an actual hardware
instruction and we want OpCopy to be able to do magic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
b78ccebf4b nak: Rework map_instrs()
Consume a FnMut so that we can pass in mutable references to things.  If
we don't want mutable references, we can also pass a whole closure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
72f4cd3300 nak: Use u32 for register indices
This increases the size of RegRef to 32 bits but that's fine given that
it's usually in a union with SSARef which is 128 bits.  The real
advantage is that it allows us to start treating memory as a register
type which will come in really useful for spilling.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
5c3e7bf0b7 nak: Refactor nak_assign_regs a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
e6b0c3e220 nak: Add a phi allocator
We need to be able to add phis later.  If we want phi numbers to be
unique, we need to be able to allocate them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
741f7067f1 nak: Add loop detection to the CFG
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
a560356b71 nak: Base liveness on CFG indices
This gets rid of most of the per-block hash maps and replaces them all
with vectors.  This is both simpler and should be quite a bit more
efficient (though block lookup isn't common).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
ea9390cd21 nak: Store the blocks in the CFG
This renames CFG to CFG2 and moves to storing the blocks in a CFG
instead of a Vec.  This should let us make a bunch of other data
structures drop to a vec instead of a hash map now that we can rely on
the CFG instead of BasicBlock::id.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
7ce3dfa43b nak: Add a more awesome CFG data structure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
c1b62f1d15 nak: Emit if branches in the predecessor block
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
0143f4566f nak/nir: Add more helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
756d0c0ba3 nak: Add a new VecPair type
This is a pair of vectors but it acts a bit like a vector of a pair.
Everything is inserted, removed, iterated, etc. in tandem to ensure that
we never mismatch between the two vectors.  However, because they're two
separate vectors, we ensure that it can be used to store Src and Dst and
keep everything contiguous.

Of particular interest is the new retain() method which is equivalent to
Vec::retain() which allows filtering a VecPair.  This tricky operation
is performed three different times by DCE and will be needed in spilling
as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
67c13aea9e nak: Add more SSA iterator options
This should make things like liveness a bit more reliable as it ensures
we won't accidentally miss anything.  It also makes them a bit simpler
to iterate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
dc26c826b9 nak: Add a RegFileSet struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
2fd0a2e207 nak: Accurately set num_gprs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
e25bbc9b7b nak: Add mum_gprs and tls_size to Shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
8e9f5416bb nak: Bring back bitset-based liveness
This one is much faster to compute because we can use bitops for the
fixed-point data-flow algorithm rather than the clumsy walking of hash
sets. The faster version is sufficient for RA and checking for register
pressure. We only need to fall back to the slower version for spilling.
Thanks to traits, we can get some of the same behavior with both.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
26748d6fbf nak: Make calc_max_live a function of the Liveness trait
If we rework things a bit to compute live-out hash sets internally to
the pass we can make it work with just the information provided by the
trait.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
80d58b3521 nak: Handle dead destinations in RA
It's possible for a destination component to be killed immediately if
it's never used.  To handle this, we need to track killed destinations
as well as killed sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
865d6c303f nak: Require Rust 1.70.0
This is when std::sync::OnceLock gets stabilized which we require for
parsing debug options.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
71c5bbc5a8 nak: Break guts of liveness into traits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
f1cb99d06b nak: Separate the CFG from liveness
One could argue that this should go in the function and not be an
on-demand analysis pass but we can do that later.  For now, we just
break it out into a separate data structure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
497046412e nak: Allocate the minimum number of GPRs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
d9c606fb08 nak/ra: Pass a PerRegFile num_regs into the allocator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
7b3d62e51a nak: Print to stderr
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Dave Airlie
2a7df0a03e nak: fix backtrace crash running computeheadless
Doesn't fix the example, but stops the crash.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
d7d330754b nak: add support for nir_op_unpack_half_2x16_split_{x|y}
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
59c05e16e4 nak: add support for packhalf2x16_split
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
1f10cdbbbe nak: add support for findmsb,findlsb
These all map into OpBFind, which is sourced from PTX and NV50.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
e887c4d07a nak: add support for nir_op_bitfield_reverse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
d27e271ba5 nak: Add support for nir_op_bitcount
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
d133603c7d nak: add support for nir_op_isign
Fixes dEQP-VK.glsl.builtin.function.common.sign.*

Notice that ISel support appears not to be wired up in the old compiler, so
ISetP + Sel was chosen.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
22b4d1c559 nak: change ishl data type to I32
This matches NV50 as getDType always returns nv50_ir::TYPE_S32 for
nir_op_ishl

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
30824fa6a5 nak: more lowerings
Add more lowerings based on nv50.

Fixes
dEQP-VK.glsl.builtin.precision.ldexp.highp.scalar

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Faith Ekstrand
e03cc1f542 nak: Add some documentation for SSA values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:11 +00:00
Daniel Almeida
11ca78f923 nak: run nir_lower_frexp and nir_opt_algebraic_late
These two are needed to get dEQP-VK.glsl.builtin.precision.frexp.* to pass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Daniel Almeida
394bd770bc nak: add support for floor, ceil and trunc
These instructions are not supported and this shows when running the CTS.

Add support for them.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
4dd277e233 nak: Rework RA a bit
Instead of tracking pinned things in the register allocator, we split
the register allocator into RegAllocator and PinnedRegAllocator.  The
RegAllocator struct only allows for very simple single-SSA allocations
and frees. It tracks locations of everything, what's used, etc. but
otherwise knows nothing about pinning or vectors.

The new PinnedRegAllocator struct wraps a RegAllocator by taking a
mutable reference to it.  It provides support for pinning and all the
vector stuff.  To destroy a PinnedRegAllocator, finish() is called which
re-places any evicted SSA values and populates an OpParCopy with any
needed copies.  Because PinnedRegAllocator owns a mutable reference to
the RegAllocator, it's impossible to mix uses of PinnedRegAllocator and
RegAllocator.  This ensures that, for as long as the pinned version
exists, nothing can be allocated which migh escape the pinning.

This fixes a bunch of corner cases when register pressure gets tight.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
c9a6073754 nak: Use pcopy.push() in RA
This version guarantees that the source and destination vector stay in
sync.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
c0e6d80063 nak: Use num_regs instead of max_reg in RA
Since the top value is always the default register, we don't need to
worry about overflowing a u8.  What we do need to worry about is
register files with zero registers which is a thing pre-Turing for
uniform register files.  Use num instead of max so we don't end up
subtracting 1 from 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
19806cc9e4 nak: Initialize RA with only live registers
While coping the entire RA struct from the predecessor is probably
faster, it may contain values which are not live in the current block.
We could purge those but the iteration gets tricky with Rust.  It's far
clearer and more rust-friendly to deal with it as an initialization
problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
ec47843cca nak: Record register pressure in liveness
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
7c98dd8bfd nak: Add a PerRegFile helper struct
Sometimes it's useful to have something that's per-register-file like we
do for register allocation.  Since this is generally useful, add a
struct for it.  In future, it might be neat to pull in the enum_map
crate which basically does this generically.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
b661279e6e nak: Rework liveness to add next-use information
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
f67fecf196 nak: Compute liveness in reverse block order
If we walk the blocks forwards, we end up having a minimum O(n^2)
algorithm because everything has to propagate bottom to top.  Looping
over the blocks bacwards ensures that all the liveness information is
propgated in the first pass in the absence of back edges.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
82f0c6cf77 nak: Use the builder in some lowering passes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
2d69a2c1d7 nak: Add a builder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
063c9f41fa nak: Work in terms of bits for type sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
ced6b44ba6 nak: Follow memcpy semantics with OpParCopy
Destination first followed by source.  Otherwise, we'll screw ourselves
up endlessly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Daniel Almeida
831d1ee2d6 nak: Do not allocate vectors needlessly in optimization passes
All passes allocate a Vec per Instr during map(). This is wasteful,
because most instances of map()  produce a single instruction (by
mapping one instruction to another instruction) or no instructions at
all.

In such cases, they return an empty Vec, or a Vec with a single entry.

Rework the signatures so that a Vec is only when mapping one instruction
into many.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Daniel Almeida
5014b4697d nak: Heap-allocate Instrs
Heap-allocate Instrs to avoid copying them around whenever they are
mutated by a pass. This lowers the amount of copies in detriment of
cache-locality.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
fa0891d37c nak: Implement nir_op_b2b1 and nir_op_b2b32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
3bf0882ea8 nak: Implement indirect UBO loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
0ff7fbf093 nak: Rework cbufs a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
86684fa9aa nak: Legalize everything
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
9fcc0eaa8a nak: Fix multisampled textureing
Needed to handle txf_ms a few places and force LOD_MODE_ZERO

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
cc88a1c78e nak: Add a Pred struct move the enum to PredRef
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
38c9d6dfbb nak: Add accum predicates to Op[FI]Setp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
c6edf43f70 nak: Delete unused imports and dead code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
d48bea6638 nak: Fold fsat into FAdd/FFma/FMul
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
4c3a5b16e9 nak: Rework source modifiers instructions a bit
Instead of I/D/FMov instructions, just use [DF]Add instead. For ineg, we
add a new INeg instruction which we can lower to IADD3 later.  The
reason for this is that IAdd3 is complicated and makes detecting an ineg
rather annoying.  Also, if we ever bring NAK up on older hardware, not
all hardware has IAdd3 and INeg will be lowerable everywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
8ba1429216 nak: DCE things with constant false predicates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
818ec3242b nak: Optimize OpLop3 and OpPLop3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
59f6d657f3 nak: Fix the 2nd predicate on LOP3
I put it in the wrong spot.  Also, it's a source so we should use
set_pred_src() for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
4367e0786b nak: Implement image atomics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
82e5b0dd93 nak: Implement global/shared_atomic_comp_swap
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
d359c64b2a nak: Implement nir_intrinsic_shared_atomic_*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
d1c56b12b9 nak: Implement nir_intrinsic_global_atomic_*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
18a11aa449 nak: Rework copy-prop to use soruce type decorations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
9bc2bdd78f nak: Add a Src::supports_src_type() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
42d31b4bfd nak: Rework source modifiers a bit
They now carry some type informaiton so FNeg and INeg are different
modifiers.  Since only INeg exists in hardware, we don't need IAbs or
INegAbs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
a2390fdbc1 nak: Only divide FS inputs by .w for smooth interpolation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
7398a262da nak: Decorate sources with types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
4def64545a nak: Add a mechanism for decorating sources with types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
3207f29a09 nak: Integers don't have abs() source modifiers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
2a2103d73b nak: Implement load/store_shared
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
73976c3f31 nvk: Plumb num_barriers through from NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
4c2ce288f9 nak: Implement barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
53a372ec3d nak: Add F2F and implement fquantize16
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
dc3b2c7d10 nak: sin() and cos() require we divide by 2pi
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
a6e1167a83 nak: Don't allow r255 in texture or surface ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Daniel Almeida
b70d998180 nak: compiler: replace Instr::new(..) with OpFoo {}.into()
As Instr now implements From<T: Into<Op>>, replace
Instr::new(Op::Foo(OpFoo {})) with OpFoo {}.into() to improve
readability.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Daniel Almeida
ab9cf27c02 nak: compiler: add From<T:Into<Op>> for Instr
Adding this From implementation makes it possible to clean up
the code in the next commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
e8f220f7a1 nak: Legalize Op[FI]Setp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
3bd42dd254 nak: Improve [FI]SETP encoding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
3ac03b043e nak/nir: Lower image size and samples to txq
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:10 +00:00
Faith Ekstrand
6750d21e65 nak: Legalize more stuff
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
854b4c0817 nak: Only put actually live SSA values in the ra.live_in sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
49f8fb0c03 nak: Legalize OpShf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
4e4548afc9 nak: Improve RA failure messages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
3c7a837c51 nak: Add a smarter new_lop2 helper
The new helper automatically detects whether you're working with
predicates or GPRs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
a36a614583 nak: Implement nir_intrinsic_load/store_scratch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
a4ea83777b nak: Wire up OpLd and OpSt for local and shared
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
840c0281ce nak: Implement image load/store
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
9d2b81e71d nak: Implement undef instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
2387dfdf6b nak: Implement nir_op_ixor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
6ab0d7ee23 Revert "HACK: nak: Lower iadd64 again"
This reverts commit 88b14e4ab9e272bfb33bea4057aacbdd5a16ae5b.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
6e5c960434 nak: Implement nir_op[iu]mul_2x32_64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
392d3791a8 nak: Much more believable try_find_unused_reg_range()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
f3e1379bdf nak: Add a use tracker to RA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
10deb1d62b nak: Legalize vector sources
It is possible for a single scalar to show up in any number of vector
components, including twice in the same vector.  Add a bit to the
legalization pass to deal with this possibility.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
9ef47c8921 nak: Rework vector handling
Previously, we handled vectors by giving each SSAValue a number of
components which we assume matches in all uses.  To deal with swizzles
and component selection, we had OpVec and OpSplit instructions to
convert vectors to/from scalars as-needed.  This is fine as an SSA
representation but it leads to a lot of redundant values when it comes
time for assigning registers.  There are strategies for dealing with
this such as ensuring that splits always kill the whole vector and then
re-combining into a new vector for later uses.  It's possible by doing
this to ensure that each component only ever exists exactly once at the
cost of a LOT of vec/split instructions.

Another possible solution is to naievely emit vec/split but teach
liveness analysis and RA bout the duplicated values.  Instead of RA
working on individual SSA values, it can work on equivalence classes of
components.

This takes a different (and currently novel to Mesa) approach of making
each SSAValue a single component but having an SSARef type which can
reference up to 4 SSAValues as a vector.  Register allocation then works
on individual components and only ensures that the components of a
vector are contiguous when it's used as a vector.  This isn't very
different from how it worked before.  If anything, it's a bit more
straightforward now because the component/vector split uses the same
types as the rest of the IR and the SSAComp is gone.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
a9e79994a7 nak: Add a debug flag to assign worst-case instruction deps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
e3222b2227 nvk: Pass NAK flags through to shader cache UUIDs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
a41ab7535e nvk: Drop printing of NAK shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
9daa595ee3 nak: Add a NAK_DEBUG environment variable
Also, hide printing behind it and clean up the print code a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
4c81f87670 HACK: spirv: Add a MESA_SPIRV_DUMP_PATH environment variable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
145f43a9a1 nak: Simplify the (Srcs|Dsts)AsSlice proc macro
Instead of building a token stream for the size, just parse it as a
usize.  This is way simpler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Daniel Almeida
09216cd9f4 nak: make Instr::new() generic
The previous signature for Instr::new() was too restrictive in that it
would create a new Instr from Op, but not from T: Into<Op>.

Fix that by introducing a generic version instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
b448151925 nak: Simplify the FromVariants proc macro
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Daniel Almeida
fc3ef0a251 nak: derive From<OpFoo> for Op through a proc macro
Derive From<OpFoo> for Op through a proc macro. This is much less
verbose than adding a manual impl From {..} for all Ops in the
NAK IR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
a70423944b nak: Wire up texture ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
9d7e1d515f nak: Use more core NIR texture lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
ad01fbdda0 nak: Add a NIR texture lowering pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
31ecffa3a3 nak: Enable nir_lower_idiv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
c21550e596 nak: Implement nir_op_[iu]mul[_high]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
1825f54d79 nak: Implement right-shifts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
90a05b5591 nak: Add more legalization
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
b6596b0a53 nak: Wire up ffma
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
c2f72a5782 nak: Implement f2[iu]32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
0943da1a37 nak: Implement OpFSOut with an OpParCopy
This prevents ordering issues among the sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
d6912622f5 nak: Use immediage offsets for load/store_global
In order to facilitate this, we add a little helper in C which uses
nir_ssa_scalar chasing to find an iadd of a thing and an immediate.
This should be reliable as long as we're not lowering iadd64.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
871bd62fe5 nak: Handle multiple vector destinations in RA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
8c358ce105 nak: Implement input interpolation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
6595abc1e0 nak: Move nak_sysval_attr_addr/sysval_idx higher in the file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
88f7056d09 nak: Implement MuFu and a bunch of float unops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
f9f9399773 nak: Implement nir_op_vecN
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:09 +00:00
Faith Ekstrand
0c23df7da2 nak: Implement nir_op_u2f
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
3acb1f80b8 nak: Implement nir_op_(fmin|fmax)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
d86e75e507 nak: Implement nir_op_fmul
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
f2a7cda75a nak: Implement nir_op_[iu](min|max)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
63dcc7c75a nak: Predicates default to true
The one exception to this is IADD3 where the carry bit default to false
when the default reg (P7) is provided.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
0cbab15de5 nak: Fold [P]Lop3 sources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
ed42571e83 nak: Implement nir_op_i(eq|ne) for booleans
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
3fd47a68a1 nak: Handle token re-use in dep tracking
When we run out of tokens, instead of panicing, grab the oldest token
and re-use it, adding it to the wait list for the instruction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
991fa18f6e nak: Improve the dependency tracker
Break the bar/dep allocator out into a helper struct for better
encapsulation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
af752f73dc nak: Add a non-trivial register allocator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
40fbf6bed2 nak: Add a liveness analysis pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
3b39778fdd nak: Add a space to the end of vec and split arg lists
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
8004416e38 nak: Rework phis
Have a single phi src/dest instruction per block which handles all the
phis at one go.  This makes phis very similar to parallel copies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
15a4b620b9 nak: Rework dead-code
It can now handle loops and parallel copies are handled one copy at a
time instead of being handled as a whole instruction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
ef45379bfa nak: Add an SSAComp struct
This is useful in RA for referring to a single component of an SSA
value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
552faf2864 nak: Add a BitSet struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
d10ff2bdcd nak: Rename BitSetView to BitView
We're about to add a BitSet struct which is like a HashSet and it's an
entirely different concept.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
e1be53e266 nak: Get rid of the BitSet and BitSetMut traits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
dadf34c620 nak: Use OpParCopy for OpVec and OpSplit lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
df11e232d6 nak: Add a parallel copy in struction with lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
90c098e286 HACK: nak: Lower iadd64 again
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
c68989e49c nak: Don't emit MOVs for overlapping vec and split src/dst
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
b142347797 nak: Drop the special cases for single-component vec/split
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
3fee98d290 nak: Support both destinations in PLOP3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
9261de6927 nak: Handle phis with non-SSA sources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
548cb292cf nak: Add separate True and False source types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
29ecb7acf1 nak: Rename Imm to Imm32
It's always 32-bit as far as I can tell.  We'll do something else for
booleans.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
43e2f1080e WIP: nak: Add a legalization pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
63707b37d6 nak: Handle fadd funnyness in the emit code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
df07dd4996 nak: Pass an SSAValueAllocator through to map methods
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
9704772021 nak: Add an SSAValueAllocator struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
2b3a883e97 WIP: nak: Rework the barrier assignment pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
d0e0e02db7 nak: Implement unpack_64_2x32_split_*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
2bd71dd0f0 nak: Print names of missing instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
cb50296e3d nak: Lower global access to scalars as needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
10efdb47a7 nak: Add a union-find implementation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
020a7ba8f5 nak: Implement phis
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
520ad0f4a7 nak: Implement iadd64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
cf533663c1 nak: Implement b2i32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
05ba3f8144 nvk: Pull the NIR options from NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
0e4480d8b3 nak: Add a nir_shader_compiler_options to nak_compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
5a86cf2b80 nak: Move nak_compiler to nak_private.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
2bf9cafbe7 nak: Implement basic control-flow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:08 +00:00
Faith Ekstrand
1b3382b861 nak: Add modifier propagation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
495b64be2b nak: Make Dst its own type
Instead of having Src::src_ref and Dst share a type, make them separate
enums.  We're not really getting any benefit from them being the same
enum type anymore and this means we avoid things like immediates in
destinations.  We can't make the type system do all our work for us but
this seems tractable.

While we're reworking things we also implement From<> for stuff instead
of having quite as many new_*() constructor variants.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
ea2c6c8ebe nak: Implement Display for SSAValue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
f26228fca3 nak: One of the predicates in IADD3 is a destination
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
9541036507 nak: Rework source modifiers
Just put modifiers on every source.  It's too complicated to try and
make the type system work for us here.  When the time comes that we
write a validator, we'll just validate them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
fa8782733d nak: Rework ALUSrc in emit code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
f4c0ea24e5 nak: Implement fsign
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5ad06de4d3 nak: Allow iadd3 to take an immediate in srcs[2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
811ccc6917 nak: Implement unary float and integer ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
4c057423e8 nak: Implement nir_op_b2f32
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
708d928fbf nak: Implement float comparisons
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
d11c8268a2 nak: Rework integer compare ops
Rename to IntCmpOp and make it trivially copyable.  While we're at it,
rename and rework set_int_cmp_op() in the emit code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
3a17c943da nak: Implement fadd
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5935c62d4e nak: Implement i2f
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
8adeae1dc2 nak: Handle zeroes at emit time
Rework our helpers to take Src and Dst and handle zeros inside the
helpers.  This is better because, at emit time, we actually have the
information about which register file to use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
1730600943 nak: Use Src::Zero for load_const(0)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
b41b4bd7f5 nak: Use a different inner struct type for each opcode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
e994acdb36 nak: Add a SrcModsAsSlice trait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
6e5f6476e3 nak: Add SrcAsSlice and DstAsSlice traits
We also add a proc macro which auto-derives these traits for structs for
which all sources/destinations are contiguous.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5a80c2e89a meson: Pull in syn from crates.io
We don't have real crates.io support yet so this uses a hack where it
pulls wraps from my personal github.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
384f4448e1 nak: Get rid of meta instructions
They're mostly in the way at this point. Instead, make map_instrs return
a Vec<Instr>.  We can reaplace that with a None, One, Some enum type
later if we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
438c67c1cb nak: Use Instr::num_srcs/dsts() less
Instead use Iterator::enumerate() and is_empty().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
fafb72e2be HACK: Support old meson
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
44243c4741 nak: Lower 8 and 16-bit types
We can do some of these on some hardware but we'll lower them all for
now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
8f121036ea nak: Implement boolean logic ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
871bb59875 nak: Rework instruction encoding
Use a struct to store the temporary data and the SM number and over-all
reduce the amount of stuff we have to pass around.  Also, rename
everything from tu102 to sm75 which is a more apt description.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5207d9e3a0 nak: Encode load/store correctly on SM80
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
5daff0876f nak: Plumb the SM through to nak::Shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
611ed96557 nvk: Pass an actual nak_compiler to nak_compile_shader()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
bf72e78e0a nak: Add nak_compiler_create/destroy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
c10aa56efb nak/meson: Use bindgen dependencies
These are new in meson 1.0 and lets us avoid all that manual include
directory mangling which was going to break one of these days anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
e69a30cecb nak: Rework ALU instruction encode
Instead of pulling sources from fixed locations in the instruction, take
a bunch of Option<&Ref> and let the individual encode func take care of
it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
0e755f9964 nak: Implement bcsel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
b3d6dafc7d nak: Implement integer comparisons
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
ac2a56f56f nak: Add support for instruction predicates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
de073a10e6 nak: Implement 32-bit logic ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
8cf12d6a3f nak: Add a pass for computing instruction dependencies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
93eb2f884a nak: Implement iadd and ishl
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
241caaf5ff nak: Add an instruction fuzzing tool
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
90d3fd10e1 nak: Zero out the .w component of descriptors
This saves us from having to constantly add it in as we compute
addresses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
c212506771 nak: Implement load/store_global
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
c76331fb51 nak: Implement load_ubo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
62f5e65c80 nak: Implement load_sysval_nv as S2R
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
fb96aaf3fa nak: Lower system values to a new load_sysval_nak intrinsic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
481a29a912 nak: Header stuff
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:07 +00:00
Faith Ekstrand
80376146ed nak: Encode program headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
50b1deefa7 nak: Add encoding for a few instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
83f8d6e2a7 nak: Add bitset infrastructure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
812255fc79 nak: Add a lowering pass for ZERO sources and destinations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
f694f1f8a8 nak: Add a lowering pass for VEC and SPLIT instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
d44b31f3bf nak: Add a trivial register allocator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
08eb906111 nak: Add a util library
Currently, all we do here is implement div_ceil() and next_multiple_of()
because these helpers are super useful but currently an experimental
Rust feature.  This should be a drop-in for the feature so we can delete
it once the feature stabilizes with little to no effect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
4e95cb908f nak: Add a dead-code pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
9769f19c7e nak: Add a copy-prop pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
5585f57c5c nak: Add initial translation from NIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
a4a5fe2270 nak: Add Rust bindings for NIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
771d9c8856 nak: Add the core IR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
62695614d7 nvk: Run shaders through NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
79ff2d9a33 nak: Add initial stubs for rust code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
c778d39fa4 nak: Add a bunch of shader lowering code in NIR
The nifty thing about the way NVIDIA hardware does inputs and outputs is
that it maps really well to how we do them in NIR.  We can make the
driver_locations match exactly to the attribute address space.  For
fragment shader outputs, we make them register numbers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
1b70f39ef6 nak: Copy the optimization loop from Intel
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Faith Ekstrand
40f9327c8a nouveau: Add initial headers and meson for the new compoiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
2023-11-14 00:48:06 +00:00
Jesse Natalie
9ef621ec2e d3d12: ARB_query_buffer_object and GL4.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
6384ccd1cd d3d12: Reference count queries in a batch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
9caea4c3e9 d3d12: Enable ARB_enhanced_layouts and ARB_texture_mirror_clamp_to_edge
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
707cdac7e7 d3d12: Fix GS variant I/O slot counts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
9fe88dd9b9 d3d12: Support enhanced layouts for VS inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
72341747f4 d3d12: Split dvec3 interpolatns into devc2 and double
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
1aa56d486c d3d12: Fix location_frac_mask bitfield size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
c77f8b4db0 microsoft/compiler: Stop lowering all I/O to temps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:53 +00:00
Jesse Natalie
d6dea13231 microsoft/compiler: When packing fractional inputs, find a row with space for it
Enables vertex attributes to overlap (as GL requires) when using
enhanced layouts with explicit component packing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:52 +00:00
Jesse Natalie
d7bc277726 microsoft/compiler: Don't use 64-bit types for signature entries
HLSL can't declare these, and the DXIL accesses them as i32 anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:52 +00:00
Jesse Natalie
2334ff67b7 microsoft/compiler: Don't declare PS output registers split across variables
DXIL doesn't support that. Color targets need to be float4s.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:52 +00:00
Jesse Natalie
adc7caa3ec microsoft/compiler: Bump signature limits for 32 rows of 4 components
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26156>
2023-11-14 00:18:52 +00:00
Sagar Ghuge
ee48b12a8f anv: Avoid emitting PIPE_CONTROL command for copy/video queue
Avoid emitting PIPE_CONTROL instruction since Copy/Video doesn't support
it.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26121>
2023-11-13 23:43:27 +00:00
Sagar Ghuge
8c9a7f7730 anv: Write timestamp using MI_FLUSH_DW on blitter
On Blitter engine, we don't support PIPE_CONTROL, we have to update
memory locations using the MI_FLUSH_DW command.

v2:
- Handle video queue (Lionel)

Fixes: 056b0cb87f ("anv: add video engine support in various places")
Fixes: 5112b42146 ("anv: Handle end of pipe with MI_FLUSH_DW on transfer queue")

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26121>
2023-11-13 23:43:27 +00:00
Caio Oliveira
dcb68de656 intel/compiler: Clear up block instructions before re-adding them
Avoids fixing up list pointers that we don't care about anymore -- since
all the instructions will be re-added in a different order anyway.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
a9f95bf687 intel/compiler: Reuse same scheduler for all pre-RA scheduling modes
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
0dd5378ffe intel/compiler: Make scheduler classes take an external mem_ctx
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
04aa2df461 intel/compiler: Separate schedule_node temporary data
Some fields in schedule_node will need to be reset each time they are
used.  The `cand_generation` needs to be back to zero, and both
`unblocked_time` and `parent_count` need to be back to their initial
values, which were pre-calculated.

Rename the initial data fields and add new ones for the temporary data.

Note the helper function is `per node` to allow it "tag along" with an
existing loops.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
81594d0db1 intel/compiler: Move earlier scheduler code that is not mode-specific
This will be useful later on when we reuse the same scheduler for
multiple modes.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
73d4e4118a intel/compiler: Tidy up code in scheduler related to reads_remaining
- Just assert in functions we expect it to exist
- Predicate usage with `!post_reg_alloc` to avoid suggest there are more
  combinations.
- Reuse an existing loop to call the count function.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
4f246cf4e7 intel/compiler: Merge child/latency arrays in schedule_node
Values are used together, saves one pointer in schedule_node,
reduces amount of reallocations when children count grows.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
e59a054203 intel/compiler: Move FS specific fields to fs_instruction_scheduler
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
a6297d05ca intel/compiler: Remove virtual calls from scheduler
Pull run() and schedule_instructions() for fs, and pull a very
simplified version of those into a run() for vec4.  Because of the
previous patches the duplication is small.

Since we are touching these, change run() implementations to use the
cfg from the existing reference to the visitor/shader instead of taking
one as argument.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
d76d58cf50 intel/compiler: Cache issue_time information
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
ecd7ffcf78 intel/compiler: Extract scheduling related basic functions
Those will be used in multiple places later.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
8a8dd2db0c intel/compiler: Add only available instructions to scheduling list
The list was used for iterating through all instructions and then
later also to track the available ones.  Now that the array iteration
is used, change how we fill it and rename it to reflect its only job.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
ddff6428c5 intel/compiler: Use array to iterate the scheduler nodes
For all the preparation data collection before the scheduling
actually happens, it is possible to walk the schedule nodes
in order by iterating on the range of the array dedicated to
a given block.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
fe6ac5a184 intel/compiler: Allocate all schedule_nodes at once
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
be012055da intel/compiler: Remove reference to brw_isa_info from schedule_node
It is always the same for all nodes, so use the one available in the
scheduler itself.

Also, per Matt's suggestion, collect is_haswell from devinfo instead of
from a function argument.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Caio Oliveira
6987571737 intel/compiler: Use linear allocator in parts of brw_schedule_instructions
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25841>
2023-11-13 23:05:47 +00:00
Friedrich Vock
61203f6078 radv/ci: Update skips comments
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
doesn't fail anymore, but it takes nearly 5 minutes to run, so keep
skipping it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26164>
2023-11-13 20:09:31 +00:00
Friedrich Vock
8ffdad731c vulkan: Don't use set_foreach_remove when destroying pipeline caches
set_foreach_remove assumes no entries have been removed. That assumption
only holds if no errors occur, since pipeline cache objects can get
removed if an error occurs during deserialization.

This fixes
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
crashing on RADV.

Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26164>
2023-11-13 20:09:31 +00:00
Eric Engestrom
1cb3c349ff bin/gitlab_gql: give a better name to the --print-job-manifest argument value than PRINT_JOB_MANIFEST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26143>
2023-11-13 20:03:44 +00:00
Eric Engestrom
22961fc45a bin/gitlab_gql: deduplicate fetch_merged_yaml() logic between print branches
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26143>
2023-11-13 20:03:44 +00:00
Eric Engestrom
ef63cc6017 bin/gitlab_gql: rename get_job_final_definition() to print_...() since that's what it actually does
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26143>
2023-11-13 20:03:44 +00:00
Eric Engestrom
c6ef161bc1 bin/gitlab_gql: only allow a single --print-* argument per invocation
Printing multiple things as the same time is not really usable, so let's
be explicit and only allow one at a time, which allows a few cleanups in
the code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26143>
2023-11-13 20:03:44 +00:00
José Roberto de Souza
08f851f436 anv: Bring back the non optimized version of build_load_render_surface_state_address()
Commit 50c29e1ffa ("anv: simplify buffer address+size loads from descriptor buffer")
is making use of AuxiliarySurfaceBaseAddress field to store buffer
lenght as it was not used but a LNL workaround will make use of it
so we need to bring back this non optimized version of
build_load_render_surface_state_address().

There is some conflicts so a simple revert do not works.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26152>
2023-11-13 18:11:39 +00:00
Eric Engestrom
c5ccd55a8e v3d/ci: add new failures
Possibly a regression from 56451ce773 ("v3d: Don't implicitly
clear the content of the imported buffer"), but not bisected to confirm.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26176>
2023-11-13 16:10:41 +00:00
Ruijing Dong
8e03c18914 frontends/va: add intra-refresh in VAAPI interface
Row and column modes are enabled, not the mixed mode,
application should have a logic of sending a period
of intra-refresh sequence to complete the intra-refresh
cycle.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26133>
2023-11-13 14:29:40 +00:00
Ruijing Dong
7fae1c46ad radonesi/vcn: enable intra-refresh in vcn encoders
Enable intra-fresh in vcn encoders and support avc/hevc/av1 codecs.
Just if B frames is enabled or the number of temporal layers is
larger than 1, intra-refresh will be disabled, because it doesn't
support intra-refresh on B frames, and on sub-temporal layers.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26133>
2023-11-13 14:29:40 +00:00
Ruijing Dong
5524faa22c radeonsi/vcn: change intra-ref name
1. change structure name from intra-ref to intra-refresh
2. add need_sequence_header variable
3. add intra-refresh cap enum

Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26133>
2023-11-13 14:29:40 +00:00
Ruijing Dong
66c75b0ca2 radeonsi/vcn: preparation for enc intra-refresh
This is a prepration for adding intra-refresh
in vcn encoders. Intra-refresh is a feature for
smoothing out fluctuation in bitrate by replacing
a whole intra frame by several intra strips distributed
in several continous frames, it is also used in
suppressing error propagation situation.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26133>
2023-11-13 14:29:40 +00:00
Hans-Kristian Arntzen
f69863fd5a radv/radeonsi: Forward correct GPU instance to umr.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24578>
2023-11-13 13:37:27 +00:00
Rhys Perry
fd80140723 radv: set prolog as_ls if has_ls_vgpr_init_bug=true
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26111>
2023-11-13 12:09:55 +00:00
Rhys Perry
b70c235e4a aco: skip LS VGPR initialization bug workaround if the prolog exists
Otherwise, we would do this twice.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26111>
2023-11-13 12:09:55 +00:00
Rhys Perry
967c52097e aco: workaround LS VGPR initialization bug in RADV prologs
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26111>
2023-11-13 12:09:53 +00:00
Tatsuyuki Ishi
ad4b82e192 radv: Pre-mask misaligned_mask for VS prolog.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26023>
2023-11-13 11:47:42 +00:00
Tatsuyuki Ishi
55d21f2f12 radv, aco: Inline struct aco_vs_input_state.
Now that we no longer use the radv_vs_input_state pointer, we can simply
inline all the state-related fields.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26023>
2023-11-13 11:47:42 +00:00
Tatsuyuki Ishi
3fc3a94bce radv, aco: Rework VS prolog key handling.
The main change is to use struct radv_vs_prolog_key directly instead of
the compressed representation to simplify an upcoming rework in prolog /
epilog caching. In doing so the state struct pointer was replaced with
an inline struct.

Care was also taken to pre-mask all the states with the active attribute
mask and other masks when it makes sense; this ensures that we don't
accidentally use information not hashed into the key during compilation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26023>
2023-11-13 11:47:42 +00:00
Tatsuyuki Ishi
5cc7f54f15 radv: Remove last VS prolog reuse logic.
This was broken as the field was never assigned to. This will also be
dropped from the upcoming prolog/epilog lookup rework, as it adds to
code complexity while the benefit of saving one hash table memory access
seems questionable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26023>
2023-11-13 11:47:41 +00:00
Tatsuyuki Ishi
d8a5b76307 aco: Replace aco_vs_input_state.divisors with bitfields.
Instead of concrete divisor value, we only pass down the information
whether the divisor is zero or nontrivial (>1).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26023>
2023-11-13 11:47:41 +00:00
Samuel Pitoiset
9b840df9f6 radv: add drirc options to force re-compilation of shaders when needed
On Steam Deck, shaders are pre-compiled for better performance (less
stuttering, less CPU usage, etc). But when a compiler fix needs to be
backported, there is currently no way to handle this properly.

This introduces 3 drirc options
radv_override_{graphics,compute,ray_tracing}_shader_version in order to
force the driver to re-compile pipelines when needed. By default, the
shader version is 0 for all pipelines.

When one drirc is set for a specific game, RADV will re-compile all
pipelines only once with the compiler fix included (because the
pipeline key would be different).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26094>
2023-11-13 10:47:26 +00:00
Mary Guillemard
fe159c85de zink: Check for VK_EXT_extended_dynamic_state3 before setting A2C
Fix crashes for piglit alpha-to-coverage tests when
VK_EXT_extended_dynamic_state3 is not supported (like on Venus)

Fixes: 736577871b ("zink: check for cbuf0 writes before setting A2C")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26003>
2023-11-13 10:18:54 +00:00
Samuel Pitoiset
88cbe32048 radv: add support for RGP queue events
This can be used for analysing queue submissions.

This is still experimental and it can be disabled with
RADV_THREAD_TRACE_QUEUE_EVENT=false if you have issues with it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22779>
2023-11-13 08:53:10 +00:00
Samuel Pitoiset
33f4307796 radv: add radv_write_timestamp() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22779>
2023-11-13 08:53:10 +00:00
Samuel Pitoiset
aa75538674 ac/rgp: update dumping queue event records to the capture
GPU timestamps are emitted by the GPU to a BO with CPU-access which
means the driver needs to read them back when the submission is done.

Fix this by passing a pointer to that BO, like some other records.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22779>
2023-11-13 08:53:09 +00:00
Samuel Pitoiset
661d28cfec radv: restore sampling CPU/GPU clocks before starting SQTT trace
This was removed by mistake in "radv/rgp: Use common trace trigger"
and it introduced a regression with RGP queue events.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22779>
2023-11-13 08:53:09 +00:00
Samuel Pitoiset
55e48d7e0f radv: enable DGC preprocessing when all push constants are inlined
It's not possible when they aren't all inlined because they need to be
copied to the upload BO and the DGC shader also copies the ones that
come from the indirect layout.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25935>
2023-11-13 08:28:53 +00:00
Samuel Pitoiset
d067413a72 radv: optimize emitting inlined push constants with DGC
With DGC, push constants can be set from the cmdbuf (CmdPushConstants())
or from the indirect layout. Instead of always emitting inlined push
constants from the DGC shader, just update the ones that come from the
indirect layout and rely on cmdbuf updates for the other ones.

With that, it should be possible to preprocess push constants with
graphics when all can be inlined in shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25935>
2023-11-13 08:28:53 +00:00
Samuel Pitoiset
c8140e4c0e radv: emit individual SET_SH_REG for inlined push constants with DGC
This should allow to preprocess if everything is inlined.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25935>
2023-11-13 08:28:53 +00:00
Samuel Pitoiset
0112a245f5 radv: add a helper to determine if it's possible to preprocess DGC
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25935>
2023-11-13 08:28:53 +00:00
Iago Toral Quiroga
d04538653b v3d: implement support for PIPE_CAP_NATIVE_FENCE_FD
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20602>
2023-11-13 06:55:23 +01:00
Mart Raudsepp
a8d6f250d1 docs: Fix typo in OpenGL 3.3 support on Asahi
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26166>
2023-11-12 23:42:50 +00:00
Rob Clark
4807c1e173 freedreno: Always attach bo to submit
Even if app triggers undefined behaviour by using a rsc on multiple
contexts without a flush, we still should attach the bo to the batch.

Fixes: b43e5aec0d ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26162>
2023-11-12 23:06:27 +00:00
Rob Clark
3ca5f3bf00 freedreno/drm: Fix mmap leak
In the fd_bo_upload() path, we don't want to trigger duplicate mmap's.

Fixes: 53ccb421a2 ("freedreno/drm: Simplify backend mmap impl")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26162>
2023-11-12 23:06:27 +00:00
Rob Clark
3f3fa5ee0c freedreno/a6xx: Rework wave input size
Rework to match tu.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7464
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26149>
2023-11-12 19:53:01 +00:00
Rob Clark
a07705def6 freedreno/a6xx: Don't set patch_vertices if no tess
Don't pollute the cache key with unused fields to avoid potentially
generating pointless shader variants.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26149>
2023-11-12 19:53:01 +00:00
antonino
0976dfeca2 nir/zink: drop NIH helper in favor of mesa_vertices_per_prim
`lower_pv_mode_vertices_for_prim` and `decomposed_primitive_size` return
the same values as `mesa_vertices_per_prim` for the primitives that can
be used as output in geometry shaders.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26117>
2023-11-11 10:27:21 +00:00
Eric Engestrom
f4f4d80096 bin/gitlab_gql: only get the pipeline when a pipeline is needed
Otherwise, options like --print-merged-yaml are broken when their
commit's push didn't create a pipeline.

Fixes: b87e092489 ("ci/bin: Fix gitlab_gql methods that uses needs DAG")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26142>
2023-11-11 06:19:44 +00:00
Tatsuyuki Ishi
325d650c6e radv: Use sizeof(flags) instead of hardcoded size in radv_hash_shaders.
For consistency.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26145>
2023-11-11 05:26:27 +00:00
Tatsuyuki Ishi
ef414a8231 radv: Fix mis-sizing of pipeline_flags in radv_hash_rt_shaders.
pipeline_flags was 64-bit yet only the first 4 bytes were hashed.
Luckily, the mask included no flag above the 32nd bit, so this was
technically working fine. Still, it's better to use explicit sizeof
constructs to be more resilient to accidental type changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26145>
2023-11-11 05:26:26 +00:00
Qiang Yu
768c5934d0 radeonsi: fix piglit image coherency test when use aco
spec@arb_shader_image_load_store@coherency will write to coherent
image in tess shader and read it in fragmant shader. There is a
geometry shader in between.

When lower ngg for the geometry shader, it will wait memory writes
before pos0 export if there's no param output to prevent fragment
shader start early and read any previous memory writes.

We need to update the memory writes info of GS with ES ones because
ES and GS is merged into one shader but when nir they are separated.
LLVM does not have this problem because it will add memory write
wait at the beginning of GS automatically.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26122>
2023-11-11 03:55:22 +00:00
Phillip Pearson
7dcca9d0ef radeonsi: use PRIu64 instead of %lu for uint64_t formatting
This unbreaks 32-bit builds (i386 and armhf).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26083>
2023-11-11 00:07:43 +00:00
Marek Olšák
aff7df717d radeonsi/ci: update failures for gfx103
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25941>
2023-11-10 18:03:57 -05:00
Marek Olšák
09c513a31a radeonsi: don't dma-upload shaders on APUs
We don't have VRAM on APUs, so it's useless.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25941>
2023-11-10 18:03:57 -05:00
Marek Olšák
3f108e7615 radeonsi/gfx11: don't set OREO_MODE to fix rare corruption
This is recommended by hw people.

Fixes: 19a59f05a4 - radeonsi/gfx11: program db render control register

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25941>
2023-11-10 18:03:57 -05:00
Marek Olšák
2ac6816b70 radeonsi/gfx11: use SET_CONTEXT_REG_PAIRS_PACKED for other states
It's used where registers are non-contiguous.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25941>
2023-11-10 18:03:57 -05:00
Marek Olšák
9579503bef radeonsi: adjust the total viewport area
I think these are the correct numbers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25941>
2023-11-10 18:03:57 -05:00
Faith Ekstrand
3af5af429e nir: Optimize boolean ieq/ine with an immediate
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26120>
2023-11-10 21:46:55 +00:00
antonino
2d49f834b2 vulkan: use instance allocator for object_name in some objects
The allocator passed to VkDevice won't be available once it is destroyed
and thefore it cannot be used to allocate `object_name` for instance
level objects such as `VkInstance` or `VkPhysicalDevice` or else there
would be no way of deallocating it when those objects are destroyed.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26085>
2023-11-10 20:57:19 +00:00
Caio Oliveira
fcd025c1ce intel/compiler: Remove is_tex()
The current name doesn't cover all the tex related instructions and
in all usages, we already have a switch statement to dispatch
per instruction type, so is more natural to list the instructions we
care there.

In fs::is_send_from_grf() we can simply ignore them since the
instructions are either lowered directly to SEND (Gfx7+) or use
MRF (Gfx6-).

With this change, the fs_inst::size_read() generated code gets
simplified (the "tex" entries get added to the switch jump table
in gcc) and the default case loses the conditional handling tex.

This reduces shader compilation time, as illustrated by replaying
fossils (tested on my TGL laptop):

```
// Rise of the Tomb Raider (N=13)
Difference at 95.0% confidence
	-1.32231 +/- 0.0170138
	-4.37605% +/- 0.0563054%
	(Student's t, pooled s = 0.0210159)

// Cyberpunk 2077 (N=7)
Difference at 95.0% confidence
	-3.64 +/- 0.114993
	-2.95188% +/- 0.0932544%
	(Student's t, pooled s = 0.09873)
```

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25721>
2023-11-10 15:43:31 +00:00
Molly Sophia
424df6a68d tu: Fix KHR_present_id and KHR_present_wait being used without initialization
KHR_present_id and KHR_present_wait were set in get_device_extensions() but uninitialized
in tu_get_features(). This causes presentId and presentWait to be false at all times. Fix it.

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
Co-Authored-By: Xilin Wu <wuxilin123@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26097>
2023-11-10 14:13:06 +00:00
Roman Stratiienko
56451ce773 v3d: Don't implicitly clear the content of the imported buffer
v3d driver will implicitly clear the buffer's content on the first write
operation. This clearing operation is helpful for allocated buffers,
initializing them with zeros instead of having memory garbage.

Also, this avoids reading the buffer from the RAM to the GPU cache
before rendering, making the first write operation slightly faster.

The clearing operation should not happen for imported buffers where
the buffer may already contain valuable data and the user may want
to render into the buffer only partially.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26136>
2023-11-10 11:16:53 +00:00
Eric Engestrom
656afd8ede bin/gitlab_gql: fix command in example
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26141>
2023-11-10 10:37:07 +00:00
Eric Engestrom
2cf031155b gitlab_gql: make --rev optional, defaulting to HEAD
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26073>
2023-11-10 10:05:46 +00:00
Eric Engestrom
cc37af8fbc bin/gitlab_gql: resolve sha locally to be able to use things like HEAD
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26073>
2023-11-10 10:05:46 +00:00
Martin Roukala (né Peres)
781e1a34cf radv/ci: fix vkcts-navi21-valve execution
Fixes: 5e44cee47d ("ci: inject gfx-ci/linux S3 artifacts without rebuilding containers")
Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26134>
2023-11-10 04:37:56 +00:00
Mauro Rossi
05fb6b9c7d Android.mk: be able to build radeonsi without llvm
Android.mk rules for radeonsi are updated according to commit
0a56417 "meson: be able to build radeonsi without llvm"

cflag -DFORCE_BUILD_AMDGPU is required when building radeonsi with llvm support
based on android-x86 downstream LLVM fork that follows the AOSP llvm build rules.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26049>
2023-11-10 01:28:16 +01:00
Connor Abbott
04ffef15da ir3/ra: Don't swap killed sources for early-clobber destination
We have an optimization to try to swap regular live intervals with
killed sources when evicting them fails in order to make a contiguous
space for the destination to fit in, but this doesn't work when the
destination is early-clobber.

Fixes
dEQP-GLES31.functional.synchronization.inter_invocation.image_atomic_read_write
on a650+.

Fixes: d4b5d2a ("ir3/ra: Use killed sources in register eviction")
Closes: #8886
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26004>
2023-11-09 21:27:10 +00:00
Eric Engestrom
aba837ef71 radv+zink/ci: add navi10 flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26135>
2023-11-09 20:59:36 +00:00
Eric Engestrom
5819e0a527 radv+zink/ci: add polaris10 flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26135>
2023-11-09 20:59:36 +00:00
Eric Engestrom
37c7ffb958 radv/ci: add polaris10 flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26135>
2023-11-09 20:59:36 +00:00
Eric Engestrom
3af19432e9 radv/ci: add vega10 flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26135>
2023-11-09 20:59:36 +00:00
Eric Engestrom
d42d2ee3a5 radv/ci: add navi21 flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26135>
2023-11-09 20:59:36 +00:00
Lionel Landwerlin
d4499c4cb2 isl: disable MCS compression on R9G9B9E5
Not supported according to the docs and will trigger an assert
isl_get_render_compression_format().

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26112>
2023-11-09 20:20:43 +00:00
Tele42
631dc5b5e6 drirc: enable vk_wsi_force_swapchain_to_current_extent for "The Talos Principle VR"
The Talos Principle VR shares the same engine quirk as its non-VR counterpart.

Backport-to: 23.2
Backport-to: 23.3

Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26047>
2023-11-09 19:42:07 +00:00
Connor Abbott
29400a56d5 tu: Fix getting VkDescriptorSetVariableDescriptorCountLayoutSupport
Fix the same mistake that 882fd3c5 fixed which we inherited from radv.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26069>
2023-11-09 19:06:04 +00:00
Paulo Zanoni
17e135d3d4 vulkan: fix potential memory leak in create_rect_list_pipeline()
I was playing around with possible improvements to STACK_ARRAY(), and
one of my experiments made gcc point us that we were not freeing
'stages'.

Fixes: 514c10344e ("vulkan/meta: Add a concept of rect pipelines")
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26041>
2023-11-09 18:22:36 +00:00
David Heidelberg
7d85656fa7 ci: tag sanity, rustfmt and clang-format job as a "placeholder" job
There is close to zero work needed to execute this job.

Should speed up the initial process of entering into pipeline tree
and also provide an opportunity for `aarch64` runners to engage sooner,
even when x86_64 machines are loaded.

Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26125>
2023-11-09 17:30:07 +00:00
David Heidelberg
b89467b1a5 gitlab: make commit more commit-like formatted
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26125>
2023-11-09 17:30:07 +00:00
Dave Stevenson
4b9e80a925 gallium: Add udl (DisplayLink) to the list of kmsro drivers
The udl is a simple render only driver, so configure it
appropriately in gallium.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26129>
2023-11-09 16:57:08 +00:00
Dave Stevenson
720c829341 gallium: Add more TinyDRM drivers to the list of kmsro drivers
As a follow-up to
8cfc17bdda ("kmsro: Add the rest of the current set of tinydrm drivers.")
and
0a42d5b98b ("kmsro: add _dri.so to two of the kmsro drivers.")
add even more TinyDRM drivers that have been added to the kernel but not
to gallium.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26129>
2023-11-09 16:57:08 +00:00
Connor Abbott
b380363938 tu: Make sure copies to half-float formats are bit exact
We previously used the 2d path for single-sampled copies which seems to
canonicalize NaNs when the source format is a 16-bit floating point
format, likely because it implicitly converts to 32 bits. The current 3d
path also implicitly converts and has the same problem. Add a new shader
variant for half-float copies and switch to using it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26042>
2023-11-09 16:24:45 +00:00
Danylo Piliaiev
3d3176aa17 tu/a7xx: Fix occlusion queries on pre-A740 GPUs
CP_EVENT_WRITE7::WRITE_SAMPLE_COUNT is supported only starting from
a740, previous GPUs use RB_SAMPLE_COUNT_ADDR.

See: https://github.com/yuzu-emu/yuzu/issues/11958

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26124>
2023-11-09 15:36:37 +00:00
Eric Engestrom
cca5a4191d ci: disable lima farm as it appears to be down
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26132>
2023-11-09 15:32:32 +00:00
Connor Abbott
8e7df505fc tu: Fix order of rasterizer_discard check
Don't check the rasterization state if it might be NULL.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26076>
2023-11-09 15:41:32 +01:00
Connor Abbott
40e74ed5d3 tu: Assume no raster-order attachment access with NULL DS/blend state
The spec isn't explicit on this point, but I believe the intent is that
if the state is NULL then we're supposed to behave as-if the flags field
is 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26076>
2023-11-09 15:41:32 +01:00
José Roberto de Souza
236da520f4 intel/common/xe: Re implement xe_gem_read_render_timestamp() with xe_gem_read_correlate_cpu_gpu_timestamp()
With the removal of DRM_IOCTL_XE_MMIO xe_gem_read_render_timestamp()
was always returning false but with DRM_XE_DEVICE_QUERY_ENGINE_CYCLES
it can be re implemented making use of
xe_gem_read_correlate_cpu_gpu_timestamp().

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
2023-11-09 13:22:49 +00:00
Lionel Landwerlin
feae70f608 intel/ds: use improved timestamp correlation if available
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
2023-11-09 13:22:49 +00:00
Lionel Landwerlin
b2bf141b6a perfetto/pps-producer: add optimized cpu/gpu timestamp correlation support
The Intel Xe driver added the ability to do cpu/gpu timestamp
correlation giving a much better alignment of timestamps (we use to
have ~20us delta between the 2 samples, just because of the ioctl
barrier potentially sneaking in some work).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
2023-11-09 13:22:48 +00:00
José Roberto de Souza
fdec724bd1 anv: Make use of intel_gem_read_correlate_cpu_gpu_timestamp()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
2023-11-09 13:22:48 +00:00
José Roberto de Souza
01aafa14d4 anv: Reduce ifdefs in anv_GetCalibratedTimestampsEXT()
Add anv_get_default_cpu_clock_id() to return the default cpu clock
id to be used in the begin and end time captures of
anv_GetCalibratedTimestampsEXT().

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
2023-11-09 13:22:48 +00:00
José Roberto de Souza
ae0df368a8 intel/common: Add intel_gem_read_correlate_cpu_gpu_timestamp()
This function will make use of Xe DRM_XE_DEVICE_QUERY_ENGINE_CYCLES by
returning correlate CPU ang GPU timestamp to be used by Intel drives.
This correlate timestamps gives us more accuracy.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24591>
2023-11-09 13:22:48 +00:00
Eric Engestrom
b6dbbd3ff7 radeonsi/ci: document new failures and flakes
These seem to have appeared between cd0a01522f and 106acbbed9

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26126>
2023-11-09 11:14:14 +00:00
Friedrich Vock
02942d6e7e aco: Update printed block kinds
Two were missing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26103>
2023-11-09 09:58:28 +00:00
Francisco Jerez
073b876539 intel/fs/xe2+: Don't special case SEL_EXEC in inferred_exec_pipe().
This is lowered to 32-bit integer execution type by the regioning
lowering pass now, so the existing special casing is redudant for
Gfx12 and buggy for Xe2+, since SEL_EXEC is now emitted without
lowering for 64-bit integers.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25514>
2023-11-08 23:17:42 -08:00
Francisco Jerez
23e14a6c27 intel/eu/xe2+: Add definition for size of GRF space on Xe2.
And use it in various places in the compiler that require knowledge
about the size of the register file.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25514>
2023-11-08 23:17:24 -08:00
Francisco Jerez
ff3814abdd intel/fs/xe2+: Handle extended math instructions as in-order in SWSB pass.
Extended math instructions are now synchronized as in-order
instructions like other ALU operations, which is more efficient than
the out-of-order tracking we had to do in previous generations, and
avoids false dependencies introduced due to SBID aliasing.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25514>
2023-11-08 23:17:12 -08:00
Francisco Jerez
5fb6760f11 intel/fs/xe2+: Teach SWSB pass about the behavior of double precision instructions.
Xe2 hardware has a "long" EU pipeline specifically for FP64
instructions, so these are handled as in-order instructions which
require RegDist synchronization.  64-bit integer instructions are now
handled by the normal integer pipeline, so the existing special-casing
inherited from ATS needs to be disabled.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25514>
2023-11-08 23:17:03 -08:00
Francisco Jerez
9e446c9282 intel/fs/xe2+: Add comment reminding us to take advantage of the 32 SBID tokens.
The additional SBID tokens will be useful when large GRF mode is implemented.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25514>
2023-11-08 23:16:54 -08:00
Francisco Jerez
15d6c6ab11 intel/eu/xe2+: Add support for 10-bit SWSB representation on Xe2+ platforms.
This implements the extended 10-bit encoding of the software
scoreboard information used by Xe2 platforms.  The new encoding is
different enough that there are few opportunities for sharing code
during translation to machine code, but the high-level tgl_swsb
representation remains roughly the same.

Among other changes the 10-bit SWSB format provides 5 bits worth of
SBID tokens (though they're only usable in large GRF mode) instead of
4 bits, the extended math pipeline is handled as an in-order (RegDist)
pipeline instead of as an out-of-order one, and the dual-argument
encodings support additional combinations of RegDist and SBID
synchronization modes.  A new encoding is introduced for preventing
the accumulator hardware scoreboard from being updated, but this is
currently not needed.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25514>
2023-11-08 23:12:32 -08:00
Caio Oliveira
40416850f1 intel/compiler: Re-enable opt_zero_samples() in many cases for Gfx12.5
The workaround applies specifically to Cube and Cube Arrays, so we can
still apply the optimization for the others.

Ideally we would like to pull opt_zero_samples logic into the lowering
sends -- to avoid adding a bit to communicate between passes.  However
the texture coordinates for the LOGICAL backend instructions, which
are a common target for the optimization, are combined into offsets over
a single VGRF, so we can't easily identify the constant cases.  The
copy-prop pass make this more visible for opt_zero_samples.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25742>
2023-11-09 03:56:28 +00:00
Caio Oliveira
daeab51a62 intel/compiler: Re-enable opt_zero_samples() for Gfx7+
Inadvertently, because of a sequence of changes elsewhere, this pass
ended up not having any effect:

- Before Gfx5 the optimization is not applicable.

- On Gfx5-6 it doesn't apply because it sampler operations don't
  currently use LOAD_PAYLOAD, but write the MOVs directly.  Not clear to
  me whether they ever did.

- On Gfx7+ it doesn't apply anymore because now the logical sampler
  operations are now lowered directly to SENDs, and the is_tex() check
  would skip them.

Since the LOAD_PAYLOAD implementation applies for Gfx7+ only, rework the
pass to work again by handling SEND instructions.  To make the pass
easier, the optimization will happen before opt_split_sends() so only
one LOAD_PAYLOAD needs to be cared for.

Update the code to accept BAD_FILE sources in addition to zeros, these
are added in some cases as padding and effectively are don't care
values, so we can assume them zeros.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25742>
2023-11-09 03:56:28 +00:00
Caio Oliveira
ef8553082e intel/compiler: Rework opt_split_sends to not rely/modify LOAD_PAYLOAD
This is a preparation to (re-)enable opt_zero_samples(), which will reduce
a SEND mlen before we split it.  When that happen, opt_split_sends()
won't be able to rely on the fact that mlen covers the entire
LOAD_PAYLOAD.

Since we are changing that, take the opportunity to also not modify the
existing LOAD_PAYLOAD, just create two new ones with the exact set of
sources.  This allows the pass to be further simplified by iterating
forward and not require live_variables analysis.

The helper function was added so can be used later for
opt_zero_samples().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25742>
2023-11-09 03:56:28 +00:00
Caio Oliveira
e017bcae59 intel/compiler: Clarify the asserts in nir_load_workgroup_id lowering
For Task/Mesh WorkgroupID is now lowered to WorkgroupIndex by the
generic NIR pass, so we shouldn't hit this.  We can now simplify the
asserting code in emit_work_group_id_setup().

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25977>
2023-11-08 17:18:36 -08:00
David Heidelberg
534323f2af ci/zink: disable nheko trace, as it sometimes crashes
See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10099

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26119>
2023-11-09 00:28:59 +01:00
Rob Clark
fa7ec4226b Revert "ci/freedreno: disable antichambers trace"
This reverts commit f562e37c93.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26086>
2023-11-08 22:27:00 +00:00
Rob Clark
b1fc5390c6 freedreno/a6xx: Fix antichamber trace replay assert
This app is generating viewports with scale[0]==0, so that is not a good
condition for testing viewport validity.  It would result in skipping
the only viewport, and ending up with gb x/y being ~0.  Triggering an
assert in the register builder.

The main reason this was done previously was to avoid an assert in
fd_calc_guardband().  Lets just flip it around and return 0x1ff on
errors instead of asserting.  This also makes it more consistent with
the other error cases.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7628
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26086>
2023-11-08 22:27:00 +00:00
Georg Lehmann
b33aa7b01a aco: don't CSE v_permlane across exec
With bc=1 and fi=0 it needs to return 0 for inactive lanes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26045>
2023-11-08 22:02:20 +00:00
Rob Clark
a9bdf58c36 freedreno/a6xx: Assume MOD_INVALID imports are linear
Without !25945 we must assume imports with invalid modifier are linear.
When both sides support metadata, we can promote the modifier.

Fixes: 33de58154f ("freedreno: Handle DRM_FORMAT_MOD_QCOM_TILED3 import")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26115>
2023-11-08 19:12:47 +00:00
Caio Oliveira
f4601d82c1 intel/compiler: Remove unused parameter from brw_nir_analyze_ubo_ranges()
This parameter was used by i965 driver that is now gone.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25986>
2023-11-08 18:10:31 +00:00
Caio Oliveira
d2125dac85 intel/compiler: Take more precise params in brw_nir_optimize()
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25986>
2023-11-08 18:10:31 +00:00
Caio Oliveira
c4be90b4ba intel/compiler: Remove unused parameter from brw_nir_adjust_payload()
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25986>
2023-11-08 18:10:31 +00:00
Rohan Garg
a77ea9555a blorp: WA 16014538804 for DG2, MTL A0
Send empty/dummy PIPE_CONTROL after every third 3DPRIMITIVE command.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039>
2023-11-08 11:00:55 +00:00
Rohan Garg
de6653dc5d anv: WA 16014538804 for DG2, MTL A0
Send empty/dummy PIPE_CONTROL after every third 3DPRIMITIVE command.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039>
2023-11-08 11:00:55 +00:00
Rohan Garg
1da1bcd038 iris: pull WA 22014412737 into emit_3dprimitive_was
Consolidate 3DPRIMITIVE WA's into a single function for iris

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039>
2023-11-08 11:00:55 +00:00
Rohan Garg
8ce3b99bc1 iris: Wa 16014538804 for DG2, MTL A0
Send empty/dummy PIPE_CONTROL after every third 3DPRIMITIVE command.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039>
2023-11-08 11:00:55 +00:00
Rohan Garg
1b03acb26b blorp,anv,iris: refactor blorp functions into something more generic
Refactor some of the blorp code into something more generic that we can
reuse for functionality needed post 3DPRIMITIVE emission.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039>
2023-11-08 11:00:54 +00:00
Rhys Perry
09eb6e3106 aco/tests: fix tests with LLVM 18
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26092>
2023-11-08 10:40:17 +00:00
Rhys Perry
e4d9f6fb50 aco/tests: fix tests with LLVM 17
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10106
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26092>
2023-11-08 10:40:17 +00:00
Tatsuyuki Ishi
9f7e57ce98 fast_urem_by_const: #ifdef DEBUG an assertion.
util_fast_urem32 is used in the hot path of hashmap lookups and this
asserts causes noticeable overhead. The correctness of this code should
be well exercised both from testing and mathematical proofs, so gate
this assertion behind #ifdef DEBUG.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14168>
2023-11-08 07:41:00 +00:00
Samuel Pitoiset
c2e6569b46 ci: re-apply two mesh/task query fixes for VKCTS
These are needed by RADV to enable mesh/task shader queries.

My last attempt was broken, for obscur reasons I used invalid hashes
and the dEQP build script didn't reject them. Hopefully now it should
fail if a hash is invalid.

The dEQP list changes introduced even more failures with some drivers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26079>
2023-11-08 07:02:27 +00:00
Guilherme Gallo
f8b8352022 ci/bin: Print a summary list of dependency and target jobs
We already print all the detected target jobs from regex and its
dependencies. But for more complex regexes the list can be cumbersome,
and an aggregate list of dependencies and targets can be more value, so
add these prints as well.

This is what looks like:

```
Running 10 dependency jobs:
 alpine/x86_64_lava_ssh_client, clang-format, debian-arm64,
 debian-testing, debian/arm64_build, debian/x86_64_build,
 debian/x86_64_build-base, kernel+rootfs_arm64, kernel+rootfs_x86_64,
 rustfmt

Running 15 target jobs:
 a618_gl 1/4, a660_gl 1/2, intel-tgl-skqp, iris-amly-egl, iris-apl-deqp
 1/3, iris-cml-deqp 1/4, iris-glk-deqp 1/2, iris-kbl-deqp 1/3,
 lima-mali450-deqp:arm64, lima-mali450-piglit:arm64 1/2,
 panfrost-g52-gl:arm64 1/3, panfrost-g72-gl:arm64 1/3,
 panfrost-t720-gles2:arm64, panfrost-t860-egl:arm64, zink-anv-tgl
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
e74238af42 ci/bin: Fix mypy errors in gitlab_gql.py
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
b87e092489 ci/bin: Fix gitlab_gql methods that uses needs DAG
Some gitlab_gql.py features like `--print-dag` were affected by recent
changes. Update those functions with the refactored data.

Fixes: c7b67d8619
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
278fc1c22a ci/bin: gql: Improve queries for jobs/stages retrieval
Modify the GraphQL query used to fetch all jobs within a pipeline,
transitioning from fetching data via stage nodes to a direct job
retrieval approach.

The prior method was not paginated, potentially overloading the server
and complicating result parsing due to the structure of stage nodes. The
new approach simplifies data interpretation and handles job lists
exceeding 100 elements by implementing pagination with helper functions
to concatenate paginated results.

- Transitioned from extracting jobs from stage nodes to a direct query
  for all jobs in the pipeline, improving data readability and server
  performance.
- With the enhanced data clarity from the updated query, removed the
  Dag+JobMetadata tuple as it's now redundant. The refined query
  provides a more comprehensive job data including job name, stage, and
  dependencies.
- The previous graph query relied on a graph node that will (or should)
  be paginated anyway.

Closes: #10050
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
664e6addea ci/bin: gql: Implement pagination
Make query support pagination by supplying the paginated key.

In the following toy example, the paginated key is:
["levels", "cars"]

```graphql
query vehicle_store($location: ID!) {
  levels {
     cars {
        pageInfo {
          hasNextPage
          endCursor
        }
     ...
     }
  }
}
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
c4b8c03012 ci/bin: gql: Log the caching errors
When using cache and it fails, log the errors, clear the cache and retry
the query bypassing the cache

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
aa2586b315 ci/bin: gql: make the query cache optional
Make the caching optional, as it can fail in some complex queries where
the transport middleware uses non-pickle-able objects.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
609b4bfef8 ci/bin: Replace AIOHTTPTransport with RequestsHTTPTransport
For some reason AIOHTTPTransport started to use MultiDict after doing
some adjustments in the GraphQL query, which made `filecache` fail
because MultiDict object are not pickle-able.

Changing the transport strategy from AIOHTTPTransport to
RequestsHTTPTransport, which dropped one requirement. We aren't doing
async anyway, all the calls were sync before.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
Guilherme Gallo
46b033a9bf ci/bin: Fix find_dependency function calls
`find_dependency` signature changed, so we need to update their callings
correctly.

Fixes: 94655ff811

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
2023-11-08 02:18:17 +00:00
José Roberto de Souza
533082f384 iris: Add iris_bufmgr_get_pat_entry_for_bo_flags()
Next patches will make of intel_device_info_pat_entry parameters other
than index, so here adding a function to return it.

While at it also renaming and adjusting parameter of
iris_pat_index_for_bo_flags() to match other functions in
iris_bufmgr.c/h.

No changes in behavior expected here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
f25043feb4 anv: Remove anv_bo flags that can be inferred from alloc_flags
Now that alloc_flags is stored in anv_bo we can get rid of is_external,
has_fixed_address and has_client_visible_address flags that can
be inferred from alloc_flags.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
7bdfabb641 anv: Calculate mmap mode based on alloc_flags
When anv_device_map_bo() is called from anv_device_alloc_bo() it gets
VkMemoryPropertyFlags set to 0 so it ends up with a write-combine
caching for integrated platforms with LLC, see 'if (!(property_flags &
VK_MEMORY_PROPERTY_HOST_CACHED_BIT)))'.

Current approach also has issues when mapping with anv_MapMemory2KHR()
as it would not have information to know that BO is a scanout.

It was also not properly calculating mmap mode for platforms with PAT
uAPI before "anv: Change default PAT entry to WC".

So here storing alloc_flags to anv_bo so there is no mismatches
between different code paths then using it to properly
calculate the mmap mode.

alloc_flags in anv_bo will also be used to calculate PAT index in
future patches.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
58301c00da anv: Change default PAT entry to WC
i915 mmap_calc_flags() is calculating WC caching for all MTL memory
types.
It will be fixed in the next patch but doing so causes tests to
fail due to incoherency in BOs not allocated with
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.

So here switching the default/non-coherent BO allocation to a WC
PAT entry.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
ccde1dc18e anv: Move PAT entry selection to common code
PAT entry will be needed to calculate mmap mode and also will be
used during BO creating in Xe KMD when PAT uAPi lands.

So here moving the PAT entry selection to common code.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
66dce74d74 anv: Honor memory coherency of the memory type selected
Integrated GPUs almost always works with write-back caching(only
scanout and external bos works in write-combine) but in platforms
without LLC the coherency is broken if not explict asked to KMD.

vkFlushMappedMemoryRanges and vkInvalidateMappedMemoryRanges()
don't do any flushing or invalidate for memory allocated with
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.

So if an application asked for a memory coherent, the
ANV_BO_ALLOC_SNOOPED flag needs to be set in alloc_flags and that
will be passed to KMD backends to properly ask to KMD for coherent
buffer.

The other chunk here removes the assert(alloc_flags & ANV_BO_ALLOC_MAPPED),
that is needed otherwise application can't ask for a coherent and
mapped memory.
Tried to find a reason for that assert in git history but did not
found what was the reasoning of this assert.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
740e596c62 intel: Add a write combining PAT entry
Iris and ANV will need to switch to this PAT entry for BOs without
special needs.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
0d668f50dc intel: Update MTL scanout PAT entry
Previous integrated platforms had GT and Display caches not coherent
and there is nothing proven that it changed in MTL, so here
changing the PAT entry for scanout bos.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
29d4d26406 intel: Add more information about the PAT entry used
mmap mode information will be used to properly calculate the mmap flags
in the i915 mmap uAPI and also will be used for BO creation when the
PAT uAPI lands in Xe KMD.
Xe KMD will also require the coherency mode during the BO creation.

So to avoid information duplication, adding this information to
intel_device_info platform entries.

No changes in behavior here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
José Roberto de Souza
72ba0677f8 anv: Add missing ANV_BO_ALLOC_EXTERNAL flags when calling anv_device_import_bo()
This flag is required to properly calculate the PAT index of the
imported BO.

Cc: mesa-stable
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26099>
2023-11-08 01:20:42 +00:00
Corentin Noël
f4ed92a823 frontends/va: Remove wrong use of ProfileToPipe
The `context->templat.profile` variable is already of enum pipe_video_profile.

Fixes: 0996ec3fc6 ("frontends/va: Add profile param when querying PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL")

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>
2023-11-08 00:14:11 +00:00
Corentin Noël
8e196214a0 mesa: Use a switch for state_iter and be more precise about its type
Even if this technically won't change anything, it prevents a false-positive of
uninitialized use of variables with clang.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>
2023-11-08 00:14:11 +00:00
Corentin Noël
9c78a3f5ae gallivm/lp_bld_nir_aos: Use TGSI instead of PIPE enum
Use the value from the correct enumeration.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>
2023-11-08 00:14:11 +00:00
Corentin Noël
91761006f6 gallivm: Initialize indir_index to NULL before use
In the case `if (var)` is false, the value will still be used but uninitialized.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>
2023-11-08 00:14:11 +00:00
Corentin Noël
5f2f75aa67 mesa/ffvs: Use gl_state_index16 in helpers directly
register_state_var will have to convert everything to gl_state_index16 and the
values given to it are already either gl_state_index or any short integer which
are covered by the gl_state_index16 type.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>
2023-11-08 00:14:11 +00:00
Jesse Natalie
e61287888d d3d12: GL4.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26108>
2023-11-07 23:56:23 +00:00
Sagar Ghuge
2a9f8a256a isl: Enable MCS compression on ACM platform
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26043>
2023-11-07 23:00:18 +00:00
Sagar Ghuge
4de0264010 iris: Disable CCS compression on top of MSAA compression on ACM
We need to manually resolve the CCS surface when it's available along
with the MSAA compression, currently we don't handle that so disable the
CCS compression for now.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26043>
2023-11-07 23:00:18 +00:00
Sagar Ghuge
e71a9e14f7 iris: Disable auxiliary buffer if MSRT is bound as texture
This change introduce the full resolve of MCS data by copying compressed
surface to uncompressed surface and also disables the auxiliary buffer
if MSRT is bound as texture on ACM platform.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26043>
2023-11-07 23:00:18 +00:00
Jesse Natalie
ba5c4da5da d3d12: Use format casting for shader images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
438be4f9a0 d3d12: Support ARB_texture_view
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
56589cb02c d3d12: Change memory barrier implementation
Normally, we insert barriers automatically based on bind points. If
a resource is bound as both a shader image/SSBO (UAV) and other read-only
bind points, we'll choose the UAV state. This behavior is modified by
the memory barrier API - if the memory barrier indicates that a read
is desired, previously, we would've just not put any barriers to UAV
states. Now, we just use that state to disambiguate between read states
vs write states for a resource that's bound as both.

This turns out to be problematic in some circumstances, e.g.:
* PBO download, which does a memory barrier afterwards, since it uses
  shader images to write, and those might be accessed immediately as
  a texture afterwards.
* A user-issued draw that writes to a SSBO. This should indicate in the
  state tracker that the SSBO is in the UAV state.
* Some other op, like a copy, that writes to the SSBO.

Before, the "pending memory barrier" state would cause the user draw to
not be put in the UAV state, which means that the copy wouldn't issue a
barrier *out* of the UAV state, resulting in the copy being unsynchronized.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
3e36be7afe d3d12: Binding buffers as SSBO/storage image needs to add buffer ranges
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
a3899c4530 d3d12: Add a fallback for int clears where value can't be cast to float
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
a07bdf0152 d3d12: Initialize shader key swizzle for non-int textures
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
8d04efcc67 d3d12: Disable common state promotion for non-simultaneous-access textures
Work around a debug layer crash when mixing enhanced barrier layout with
non-enhanced barrier states.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:20 +00:00
Jesse Natalie
405dead1b7 microsoft/compiler: Set src/dest nir types on image intrinsics when deducing format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26104>
2023-11-07 22:31:19 +00:00
Rhys Perry
2011b678c5 radv: disable gs_fast_launch=2 by default
This currently causes severe performance problems in Remnant 2 and
Alan Wake 2.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 28ebe62af2 ("radv: enable mesh shader gs_fast_launch=2 and multi-row export")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10071
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26090>
2023-11-07 19:54:47 +00:00
Marek Olšák
6a31c7a841 radeonsi: move SPI_SHADER_IDX_FORMAT into the preamble (it's immutable)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
15293217e2 radeonsi: remove num_params variable from gfx10_shader_ngg
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
8edb0c7038 radeonsi: move emitting VGT_TF_PARAM into gfx10_emit_shader_ngg
so that it's next to other registers instead of separated

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
870568b512 radeonsi: prettify code around PA_SC_LINE_STIPPLE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
02f52bbca0 radeonsi: cosmetic changes in si_emit_db_render_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
34b68c9017 radeonsi: don't check DCC compatibility on chips where it's no-op
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
ba6595e41f radeonsi: don't call nir_lower_compute_system_values too many times
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
6725edbd2a radeonsi/gfx11: use PKT3_SET_CONTEXT_REG_PAIRS_PACKED for PM4 states
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
308d3ad5c2 radeonsi: restructure blocks in si_emit_graphics_{shader,compute}_pointers
Make "if (sctx->screen->info.has_set_sh_pairs_packed) {" the outermost
condition instead of the innermost.

si_emit_consecutive_shader_pointers is split into:
- si_emit_consecutive_shader_pointers
- gfx11_push_consecutive_shader_pointers

si_emit_global_shader_pointers is split into:
- si_emit_global_shader_pointers
- gfx11_push_global_shader_pointers

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
7ead9c4bb1 radeonsi: restructure blocks in si_setup_nir_user_data
From:

if (sel->info.uses_grid_size) {
   if (sctx->screen->info.has_set_sh_pairs_packed) ...
   ... else ...
}
if (sel->info.uses_variable_block_size) {
   if (sctx->screen->info.has_set_sh_pairs_packed) ...
   ... else ...
}
if (sel->info.base.cs.user_data_components_amd) {
   if (sctx->screen->info.has_set_sh_pairs_packed) ...
   ... else ...
}

To:

if (sctx->screen->info.has_set_sh_pairs_packed) {
   if (sel->info.uses_grid_size) ...
   if (sel->info.uses_variable_block_size) ...
   if (sel->info.base.cs.user_data_components_amd) ...
} else {
   if (sel->info.uses_grid_size) ...
   if (sel->info.uses_variable_block_size) ...
   if (sel->info.base.cs.user_data_components_amd) ...
}

si_cp_copy_data is moved to the beginning because it's shared.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
d26568a675 radeonsi: rewrite gfx11_*push*_sh_reg helpers
to allow reusing the macros for context registers later.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
ac22440859 radeonsi: rename radeon_*push_*_sh_reg -> gfx11_*push_*_sh_reg
Those will only be used by gfx11.x.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
4659d0dcc2 radeonsi: rename HAS_PAIRS -> HAS_SH_PAIRS_PACKED
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
626e1a01b0 radeonsi: move buffered_xx_regs into a substructure
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
df87c593f8 radeonsi: rewrite PM4 packet building helpers with less duplication
First, the following universal helpers are defined:
- radeon_set_reg_seq
- radeon_set_reg
- radeon_opt_set_reg
- radeon_opt_set_reg2
- radeon_opt_set_reg3
- radeon_opt_set_reg4
- radeon_opt_set_reg5
- radeon_opt_set_regn
- gfx11_push_sh_reg
- gfx11_opt_push_sh_reg

Then the config, context, sh, uconfig, push_gfx and push_compute helpers
are implemented calling the above.

A lot of macros were receiving sctx via a parameter, which is changed to
use sctx directly in the macro (and the parameter is renamed to "_unused").

The only functional change is that the perfctr registers that incorrectly
set the predicate bit now correctly set the RESET_FILTER_CAM bit.

The helpers no longer check info.uses_kernel_cu_mask.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
65753fa2f9 radeonsi: upload shaders using a compute queue instead of gfx
Use the original context flags when we re-create the aux contexts.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
0c773325bb radeonsi: clean up si_set_streamout_targets
Merge the branches and reorder code.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:44 +00:00
Marek Olšák
e7c8d32bfc ac/gpu_info,llvm: trivial cosmetic changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:43 +00:00
Marek Olšák
b74d849a29 ac/gpu_info: split has_set_pairs_packets into context and sh flags
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26095>
2023-11-07 19:27:43 +00:00
Yiwei Zhang
551f61bdb3 zink: apply can_do_invalid_linear_modifier to Venus
This unblocks Xwayland with zink-on-venus + sommelier wayland proxy.
- For glamor, zink uses linear modifier.
- For Virgl clients, classic 3d resource is used and sommelier fixes
  the modifier and stride infos no matter wl-drm or dma-buf protocol.
- For Venus clients:
  - via the legacy wl-drm protocol, invalid modifier is passed via
    sommelier, and host recovers the tiling in the way dealing with
    modifier unaware clients (e.g. I915_GEM_GET_TILING). For hosts
    unable to recover, they assume linear and venus forces linear on
    legacy path.
  - via the new zwp_linux_dmabuf_feedback_v1 (version 3/4) protocol,
    explicit modifier is used, and zink handles that without issues.

This doesn't deserve a driconfig as zink-on-venus to support xserver
itself already requires special enough integration beyond a config.

Reported-by: Igor Torrente <igor.torrente@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10066
Fixes: 1c3db3e39a ("zink: blow up broken xservers more reliably")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26082>
2023-11-07 19:00:40 +00:00
Mark Collins
a97cc64c44 meson: Only link libvdrm to Turnip with virtio KMD
`libvdrm` is unconditionally linked to `libvulkan_freedreno` which isn't available without the `virtio` subdirectory being included. It has been gated behind the `virtio` KMD to prevent linking errors in other cases as it's not necessary.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26100>
2023-11-07 18:22:56 +00:00
Mark Collins
cede4e7ac3 meson: Only include virtio when DRM available
The unconditional inclusion of the `virtio` subdirectory introduced by !24733 causes a full dependency on DRM, it breaks any systems that have `system_has_kms_drm = false`, including Turnip with just the KGSL KMD. A temporary solution to this is gating the inclusion when `system_has_kms_drm` isn't set but this should be replaced with more specific gating in the future.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26100>
2023-11-07 18:22:56 +00:00
Lionel Landwerlin
2dc452ec7c anv: dynamically allocate utrace batch buffers
Estimating the batch space required can be tricky because of all the
workarounds. So implement chaining of batches like we do for command
buffers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26087>
2023-11-07 17:48:11 +00:00
Tapani Pälli
9ebb7721b5 anv: skip engine initialization if vm control not supported
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10113
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26091>
2023-11-07 19:20:28 +02:00
Eric Engestrom
282ba9a467 v3d/ci: run manual jobs in daily pipeline
Fixes: f2dfb0f6ee ("broadcom: use `.never-post-merge-rules` for all rpi tests")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26093>
2023-11-07 16:58:36 +00:00
Erik Faye-Lund
15291cdefa mesa/ffvs: use unreachable instead of assert
Otherwise I trigger a compiler warning here about a potentially
unwritten variable. Let's just make it clear to the compiler what's
going on.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26064>
2023-11-07 14:35:53 +00:00
Christian Gmeiner
3626d07d66 ci/etnaviv: Update ci expectation
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26072>
2023-11-07 13:34:54 +00:00
David Heidelberg
5e44cee47d ci: inject gfx-ci/linux S3 artifacts without rebuilding containers
We need update kernel often. We need test kernel changes often.

Introduced `KERNEL_EXTERNAL_TAG` to differ between `KERNEL_TAG` which is
also used to rebuild the containers. We don't need rebuild containers
for the external kernel, so this way we don't have to.

Updating kernel goes wruuuuuum.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23563>
2023-11-07 12:22:09 +00:00
David Heidelberg
b23423ce2e ci/nouveau: define a kernel and dtb, so we can fetch it from external sources
Acked-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/23563>
2023-11-07 12:22:09 +00:00
Sviatoslav Peleshko
aa33ca0a52 nir/loop_analyze: Fix inverted condition handling in iterations calculation
In the tagged commit, we stopped actually inverting the condition, and
instead relied on the "invert_cond" flag. But we missed a few places
where this flag should've been handled too.

Also, add a few more tests to make sure this won't regress in the future.

Fixes: 99a7a664 ("nir/loop_analyze: Change invert_cond instead of changing the condition")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10012
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26024>
2023-11-07 11:44:45 +00:00
Erik Faye-Lund
385b81c8c2 panfrost: use perf_debug instead of open-coding
We don't need to open-code perf_debug here...

Fixes: bc55d150a9 ("panfrost: Add support for AFBC packing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26063>
2023-11-07 11:07:18 +00:00
Vitaliy Triang3l Kuzmin
054188bff8 vulkan: Fix pipeline layout allocation scope
The lifetime of Mesa's vk_pipeline_layout may exceed that of the
VkPipelineLayout object as other objects on the device may hold references
to it. In other places in vk_pipeline_layout and vk_descriptor_set_layout,
the device allocation scope is used with this pattern, but there was an
inconsistency in vk_pipeline_layout_zalloc, which is fixed by this commit.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24794>
2023-11-07 10:09:52 +00:00
Vitaliy Triang3l Kuzmin
fd08d90d2a nir: Don't skip lower_alu if only bit_count needs lowering
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26048>
2023-11-07 08:52:52 +00:00
Lucas Stach
02bd6bea03 etnaviv: drm: don't update cmdstream timestamp when skipping submit
When we skip the submit when there is no GPU work queued we must not
update the cmdstream timestamp with the fence from the submit request
as it will never be filled in by the kernel, effectively replacing
the cmdstream timestamp with 0. This causes following fence waits
to fail.

Fixes: 148658638e7f ("etnaviv: drm: Be able to mark end of context init")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26078>
2023-11-07 08:26:05 +00:00
Jordan Justen
abf8b47e02 intel/dev: Rename mtl-p to mtl-h
Ref: bspec 55414
Suggested-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25857>
2023-11-07 06:37:00 +00:00
Jordan Justen
e04e491cc7 intel/dev: Rename mtl-m to mtl-u
Ref: bspec 55414
Suggested-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25857>
2023-11-07 06:37:00 +00:00
Jordan Justen
f81c84f080 intel/dev/wa: Raise error if mesa_defs.json contains unknown platforms
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25857>
2023-11-07 06:37:00 +00:00
Eric Engestrom
ba4f6e87c7 ci/gitlab_gql: stop re-compiling regex now that all users pre-compile it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26070>
2023-11-07 06:08:44 +00:00
Eric Engestrom
94655ff811 ci_run_n_monitor: compile target_jobs_regex only once
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26070>
2023-11-07 06:08:44 +00:00
Eric Engestrom
a5cb331c64 gitlab_gql: strip newline at the end of the token file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26075>
2023-11-07 06:06:22 +00:00
Alyssa Rosenzweig
ea6502d7cc asahi: Implement ARB_base_instance
Now that load_base_instance is wired up (as part of the indirect GS
implementation), this is really easy. Validated with Piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
643428bd7f agx: Emit stack_adjust in the entrypoint
Allocate space to fit scratch space.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
a5cdc86da0 agx: Add stack adjust opcode
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
588fd6dfd6 agx: Implement scratch load/store
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
c15115de6b agx: Add stack load and store opcodes
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
67d0f035ae docs: Mark timer queries as done on asahi
Strictly needs uapi support that's not upstream, but so does the rest of the
driver (-:

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
49225db140 asahi: Implement timer queries
Everything but the uapi piece.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
bc8232c4a2 asahi: clc: Handle doorbell and stack mapping intrinsics
Also move nir_interleave_agx definition to libagx.h

Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
514d432e50 agx: Handle doorbell and stack mapping intrinsics
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
ee0e7b8347 agx: Add doorbell and stack mapping opcodes
Signed-off-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Mary Guillemard
0aa4148978 nir: Add AGX-specific doorbell and stack mapping opcodes
Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
5d279ecd04 asahi: Advertise ARB_clip_control
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
c5dddd1d53 asahi: Plumb clip_halfz bit from RS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
fdb995c204 asahi: Don't use OpenGL clip bit
This lets us implement clip control.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
695aef7f5a asahi: rm unused deqp debug flag
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
3270556eaa asahi: Advertise geometry shaders
and cube arrays.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
c6a118b654 asahi: Wire up geometry shaders
- Compile GS with linked VS and auxiliary programs
- Dispatch GS as compute programs + an indirect draw with the GS copy program
- Use passthrough GS to implement XFB, replacing old XFB impl.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
fe7650bcf7 asahi: Add GS lowering pass
The big monster.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
43e134b106 asahi: Add helpers for lowering GS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
6a67e220b8 asahi: Add data structures for geometry shaders
Shared between GPU and CPU.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
0b96b62348 asahi: Make encoder_allocate public
In order to enqueue CDM and VDM to the same queue.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
c9dd59fef3 asahi: Factor out agx_launch
For launching compute kernels on particular batches without dirtying state.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
212f71734e asahi: Refactor encoder data structure
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
82e3eb4b74 asahi: Don't hazard track fake resources
Convenient for meta, which we use for implementing GS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
949741d4c3 asahi: Upload tex/samplers properly with merged shaders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
21d3c1e0af asahi: Use the sampler heap
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
dc44619c62 asahi: Add sampler heap data structure
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
9c575eb18a asahi: Handle load_sampler_handle
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
df2c145c91 agx: Handle bindless samplers
Unified encoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
ca42562c7f agx: Lower LOD bias earlier
To make the extra descriptor accesses explicit for drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
972f289740 asahi: Lower samplers to bindless if needed
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
111e526f19 agx: Allow drivers to lower texture handles
Rather than hardcoding u0_u1, this lets drivers map texture handles in whatever
way is convenient. In particular, this makes textures work properly with merged
shader stages (provided one of the stages is forced to use bindless access), by
giving each stage an independent texture heap.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
b69ab37bdc asahi: Pack non-border colour sampler desc
Apparently custom border colours don't work properly with bindless. Needs
investigation. Patch this out so we don't fault.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
a74fbb3840 agx: Translate simple subgroup ops
We'll use these for optimizing parallel prefix sums.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
77bb446e90 agx: Add scaffolding for subgroup ops
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
5b754410da agx: Require 32-bit alignment for EOT offset
Fixes piles of brokenness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
7d7f5013f8 agx: Cleanup 8-bit math before lowering
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
3b84f371a8 docs/features: Mark ARB_mdi done on asahi
Sync with reality.

I think all gallium drivers support, it's a cpu-only thing unlike gl4.6's
indirect multidraws or the similarly named vk feature.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
b18181d924 agx: Check for spilling in release builds
Don't smash stack -- explain to the user what happened.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Alyssa Rosenzweig
7b92c63105 agx: Fix fragment side effects scheduling
We can't move discards across side effects, or the side effect might not happen.

Fixes KHR-GLES31.core.shader_image_load_store.basic-allFormats-load-fs
regression. Sigh.

CI is up next.

Fixes: 119e5b9719 ("agx: Schedule for register pressure")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:55 +00:00
Christian Gmeiner
e928f45735 agx: Re-index nir defs to reduce memory usage
nir_index_ssa_defs(..) will re-index the function impl and will
update ssa_alloc. In almost all cases this will result in a lower
ctx->alloc number which reduces memory usage in compiler passes
that are using ctx-alloc to allocate memory.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
b6b01aa1f2 agx: Legalize image MS index
Fix 2D MSAA Array tests in arb_shader_image_load_store-max-size

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
019a52fff0 asahi: Clamp 8-bit integer RTs
Fixes gl-3.0-render-integer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
8d9d9d0207 nir/print: handle adjacency
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
d0a4a8cda0 nir: Add intrinsics for lowering bindless textures/samplers
Needed for merged stages to work properly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
33e80918de nir: Add intrinsics for lowering GS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
cc3f20ca6c nir: Also gather decomposed primitive count
Simple extension.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
b65636ca40 nir/lower_gs_intrinsics: Count decomposed primitives too
We need both: decomposed primitives for transform feedback and regular
primitives for the sizing the index buffer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
0a35aa3a2b nir/lower_gs_intrinsics: Append EndPrimitive
This is simpler for generic GS lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
f157a3de4e nir/lower_gs_intrinsics: Include primitive counts
Generic GS lowering needs this, we already calculate it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
a147801f9b compiler: Make u_decomposed_prims_for_vertices available to CL
For indirect geometry shader setup.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
64f7b70763 compiler: Inline mesa_vertices_per_prim
Makes it more easily consumable from the gpu.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Alyssa Rosenzweig
7cfe2ecb33 compiler: Make shader_enums.h CL-safe
macros.h is not safe for CL for a bunch of reasons but shader_enums.h barely
uses its functionality. Stub out the minimum for CL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
2023-11-07 00:05:54 +00:00
Karol Herbst
1519ff7ebd rusticl/memory: fix new clippy::needless-borrow warning
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26051>
2023-11-06 23:47:18 +00:00
Karol Herbst
98df65a875 rusticl: only support the matching device for gl_sharing
Cross vendor is bogus because of modifier screw ups. We could allow it on
all devices from the same vendor, but for that we have to check if the
supported modifiers match.

Also verify the device in questions actually supports gl_sharing.

Fixes: 57dfc013a6 ("rusticl: Add functions to create CL ctxs from GL, and also to query them")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Antonio Gomes <antoniospg100@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26051>
2023-11-06 23:47:18 +00:00
Georg Lehmann
6cd78281f6 aco: deduplicate Format definition
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25943>
2023-11-06 23:16:38 +00:00
Georg Lehmann
6e0bf33a89 aco: deduplicate instr_class definition
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25943>
2023-11-06 23:16:38 +00:00
Georg Lehmann
bdd81c6be7 aco: namespace aco_opcode
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25943>
2023-11-06 23:16:38 +00:00
Georg Lehmann
1b9a3b7466 aco: stop using cstdint
We use stdint.h everywhere else.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25943>
2023-11-06 23:16:38 +00:00
Georg Lehmann
04956d54ce aco: force uniform result for LDS load with uniform address if it can be non uniform
Because a LDS load is 2 separate loads on gfx10+ with wave64, a different wave
can write LDS in between and cause a non uniform result. Use v_readfirst_lane
instead of p_as_uniform because it cannot be copy propagated.

Fixes a OpenCL CTS test with zink+rusticl.

Totals from 136 (0.17% of 78196) affected shaders:
MaxWaves: 3236 -> 3244 (+0.25%)
Instrs: 130069 -> 131221 (+0.89%)
CodeSize: 698048 -> 703436 (+0.77%)
VGPRs: 5464 -> 5440 (-0.44%)
SpillSGPRs: 94 -> 96 (+2.13%)
Latency: 5361017 -> 5363781 (+0.05%); split: -0.00%, +0.05%
InvThroughput: 883010 -> 884100 (+0.12%)
SClause: 3822 -> 3821 (-0.03%); split: -0.05%, +0.03%
Copies: 14220 -> 14314 (+0.66%); split: -0.01%, +0.68%
Branches: 4549 -> 4551 (+0.04%)
PreSGPRs: 4934 -> 4940 (+0.12%)
PreVGPRs: 4666 -> 4655 (-0.24%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25973>
2023-11-06 22:43:33 +00:00
Eric Engestrom
a4597777fe ci: restore sanity (aka. Revert "ci: don't run sanity in Marge pipelines")
This reverts commit fac60c140b.

Turns out there are pipelines that do not create any other jobs, and
Marge requires a pipeline to pass, which means a pipeline needs to
exist, which means a job needs to always exist.

There is no reason `sanity` would be the one, but it's there so let's
just use it instead of making another one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26080>
2023-11-06 21:49:44 +00:00
Georg Lehmann
ab87831ae8 aco, radv: vectorize f2f16 if rounding mode is rtz
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25952>
2023-11-06 21:05:34 +00:00
Eric Engestrom
b781bd478c zink+radv/ci: ensure renderer is "zink on radv"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26065>
2023-11-06 18:54:37 +00:00
Eric Engestrom
cd600868b4 zink+radv/ci: simplify deqp config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26065>
2023-11-06 18:54:37 +00:00
Andrew Gazizov
d1009481c8 venus: Add use_guest_vram capset to enable guest-based blob alloc
For hypervisors that do not support host memory injection into the
guest address space, it's necessary to have guest-based blob alloc.
Therefore, use a new 'use_guest_vram' virgl capset to decide on
performing guest blob allocations from dedicated heap (Host visible
memory).

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25889>
2023-11-06 18:33:15 +00:00
Mary Guillemard
f71f5cf856 venus: skip bind sparse info when checking for feedback query
Fix an assertion when using vkQueueBindSparse.

Fixes: 7fbf608f2d ("venus: append query feedback at submission time")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26027>
2023-11-06 18:15:03 +00:00
Vitaliy Triang3l Kuzmin
bae7538a02 r600/sfn: Remove unused sampler reference in emit_tex_lod
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26068>
2023-11-06 16:47:29 +00:00
Vitaliy Triang3l Kuzmin
4f86353f4f r600/sfn: Change sampler_index to texture_index in buffer txs
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26068>
2023-11-06 16:47:29 +00:00
Connor Abbott
2e83aed8b3 vk/graphics_state: Add vk_pipeline_flags_feedback_loops helper
This will be useful for combining dynamic and static feedback loop
state.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
a02d1cfa9e vk/graphics_state: Support VK_EXT_attachment_feedback_loop_dynamic_state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
55f3f952aa vk/graphics_state, tu: Rewrite renderpass flags handling
Before this, the render pass code or the driver combined the pipeline
create flags and the implicit flags from the render pass, but the
pipeline create flags will need to be sanitized when they are dynamic
state, so we need to do it in vk_graphics_state where we know that
information.

We also weren't combining pipeline flags correctly when linking, which
on turnip was being hidden by the lack of sanitizing for driver-provided
flags. We can't combine them correctly if they're part of the render
pass state, so they need to be pulled out into the overall pipeline
state.

For drivers using emulated renderpasses or tracking feedback loop
information themselves, this won't make a difference, but we have to
adapt turnip to not pass pipeline flags. This also means that we can
drop all handling of feedback_loop_input_only in turnip and just set it
in the runtime.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
2b62d90158 vk/graphics_state: Support VK_KHR_maintenance5
Switch to using VkPipelineCreateFlags2KHR, and use the new common helper
to get the right flags.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
e6f5d7222c vk,lvp,tu,radv,anv: Add common vk_*_pipeline_create_flags() helper
And replace the various homegrown or copy-pasted helpers in drivers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Erik Faye-Lund
cac194ff38 panfrost: look at correct blendable format version
We're currently looking at a mixture of v7 only and v6 and v7 versions
of the blendable formats. Let's use the one we have stored, so we always
use the most recent definition.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968>
2023-11-06 14:30:34 +01:00
Erik Faye-Lund
f277124544 panfrost: store blendable_formats in panfrost_device
This way, we don't need to look at the generation to find the right
version. It's also less code to update when we're adding new hardware
generations.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968>
2023-11-06 14:30:31 +01:00
Erik Faye-Lund
40656b6fa0 panfrost: pass blendable formats to pan_pack_color
This allows us to specify the correct array later on, while still being
able to use the function as-is from call-sites that doesn't have a
panfrost_device.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968>
2023-11-06 14:30:28 +01:00
Erik Faye-Lund
f69b573dfc panfrost: bypass format-table for null-textures
We directly look up in the format arrays here to save indirections. But
do you know what's even faster than a single indirection? Assigning a
compile-time constant!

So let's use the newly available pack-helper to pack directly what we
want here.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968>
2023-11-06 14:30:20 +01:00
Erik Faye-Lund
7d3ef1a057 panfrost: allow packing formats outside of pan_format.c
This is useful when we want to avoid looking up a format in the format
table.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968>
2023-11-06 14:30:14 +01:00
Eric Engestrom
ac342f6851 rpi4/ci: skip more timing out tests in the dEQP-VK.ssbo.layout.* group
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:50 +00:00
Eric Engestrom
208f94f7ec vc4/ci: add piglit "full run" variant of vc4-rpi3-gl:arm32 as a manual job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:50 +00:00
Eric Engestrom
4c00cff2d2 v3dv/ci: add "full run" variant of v3dv-rpi4-vk:arm64 as a manual job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:50 +00:00
Eric Engestrom
725a4338fc v3d/ci: add "full run" variant of v3d-rpi4-gl:arm64 as a manual job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:50 +00:00
Eric Engestrom
85ecf9d487 v3dv/ci: add manual variant of .v3dv-rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:49 +00:00
Eric Engestrom
8ca683fb12 vc4/ci: add manual variant of .vc4-rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:49 +00:00
Eric Engestrom
8803d6d9d9 broadcom/ci: split broadcom-common manual rules to .broadcom-common-manual-rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:49 +00:00
Eric Engestrom
692b779f67 broadcom/ci: fix list indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25975>
2023-11-06 12:45:49 +00:00
Sergi Blanch Torne
be1eb0f6d2 Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 7d6f9ccfbe

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26060>
2023-11-06 12:03:20 +00:00
Eric Engestrom
9349b7d2fb broadcom/ci: merge gl test lists to use a single deqp instance
This makes the config file easier to read, and also shaves 5-10 seconds
of deqp-run per job, but that's cancelled out by all the random network
delays of everything else in the job so we'll never actually notice the
difference.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26039>
2023-11-06 11:13:10 +00:00
Samuel Pitoiset
790fabd38e radv: advertise VK_EXT_device_fault
This is only exposed if the kernel supports GPUVM fault query.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25875>
2023-11-06 10:35:05 +00:00
Samuel Pitoiset
8097becc7f radv: add initial VK_EXT_device_fault support
This implementation only returns VM faults information for now, but
vendor crash dumps will be adder later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25875>
2023-11-06 10:35:05 +00:00
Vlad Schiller
1dd1c9d610 pvr: Fix VK_EXT_texel_buffer_alignment
In the commit that enabled the extension, I forgot to add the required
properties, which made some tests to fail.

Fixes: 649ebbb0fb ("pvr: Implement VK_EXT_texel_buffer_alignment")
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26002>
2023-11-06 09:58:07 +00:00
Samuel Pitoiset
abfd208cb0 nir: fix inserting the break instruction for partial loop unrolling
If the break in the original loop isn't in the first top-level if,
this would have re-inserted it in the wrong block.

Fixes this by re-inserting the break block to the corresponding break
block in the new loop by using the remap hashtable.

fossils-db (NAVI21):
Totals from 88 (0.11% of 79330) affected shaders:
Instrs: 109602 -> 109929 (+0.30%); split: -0.10%, +0.40%
CodeSize: 570968 -> 573332 (+0.41%); split: -0.08%, +0.49%
Latency: 1682510 -> 1682505 (-0.00%); split: -0.01%, +0.01%
Copies: 12832 -> 12746 (-0.67%); split: -1.54%, +0.87%
Branches: 2879 -> 2930 (+1.77%)

Deathloop and F1 2023 are affected but I'm not aware of any issues
for these two games.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10001
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/26009>
2023-11-06 09:18:09 +00:00
Sergi Blanch Torne
7d6f9ccfbe ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-11-06 08:00 GMT (UTC+0)
    End: 2023-11-06 12:00 GMT (UTC+0)

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26059>
2023-11-06 09:11:37 +01:00
LingMan
106acbbed9 rusticl: Avoid repeatedly creating Vecs during Platform initialization
Creates a Vec once instead of four times.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26050>
2023-11-06 00:08:52 +00:00
LingMan
b4d052e4cb rusticl: Only put an Arc around PipeScreen where needed
This only delays moving the PipeSceen into the Arc, but makes is clearer where the Arc's properties are needed.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26050>
2023-11-06 00:08:52 +00:00
LingMan
8103be7faa rusticl: Directly pass a &Device to Mem::map_image and Mem::map_buffer
Until now they took a `&Arc<Queue>` but only ever used it to accessed the `Device`.
Makes it clearer what these methods actually require.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26050>
2023-11-06 00:08:52 +00:00
Karol Herbst
8cbb84dc42 rusticl/queue: fix implicit flushing of queue dependencies
Needed by Davinci Resolve.

There are two parts to this fix:
1. flush dependencies also on flush, not just finish
2. move the dependency checking logic into Queue::flush as otherwise we
   miss required implicit flushes.

Fixes: 8616c0a52c ("rusticl/event: flush queues from dependencies")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26053>
2023-11-05 23:53:20 +00:00
Karol Herbst
52e41d4c97 rusticl/queue: do not send empty lists of event to worker queue
This saves us a few CPU cycles and makes properly fixing implicit flushes
less expensive.

Fixes: 8616c0a52c ("rusticl/event: flush queues from dependencies")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26053>
2023-11-05 23:53:20 +00:00
David Rosca
bf364cbdb4 radeonsi: Fix offset for linear surfaces on GFX < 9
Fixes: 86262b6eac ("radeonsi,radv: fix usages of surf_pitch")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10073

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25970>
2023-11-05 19:36:48 +00:00
Marek Olšák
d2a025ab2b radeonsi: move setting registers at the end of si_emit_cb_render_state
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 14:06:56 -05:00
Marek Olšák
c21bcfd34f radeonsi: cosmetic changes in si_state_binning.c, si_state_msaa.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 14:06:56 -05:00
Marek Olšák
6455aaab07 radeonsi: cosmetic changes in si_state_viewport.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 14:06:56 -05:00
Marek Olšák
43cdb51402 radeonsi: move max_dist for MSAA into si_state_msaa.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 14:06:56 -05:00
Marek Olšák
12c239f829 radeonsi: various isolated cosmetic changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 14:06:56 -05:00
Marek Olšák
ca1d37e1db radeonsi: adjust setting PA_SC_EDGERULE once more
based on PAL.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 14:06:52 -05:00
Marek Olšák
4dfff0f1b7 radeonsi: use si_shader_uses_streamout properly
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:43:11 -05:00
Marek Olšák
2a83532ed6 radeonsi: split setting num_threads in si_emit_dispatch_packets
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:42:52 -05:00
Marek Olšák
5a38757fcf radeonsi: cosmetic changes in si_pm4.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:42:33 -05:00
Marek Olšák
03353bd752 radeonsi: decrease PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS to 1024
to match PAL-based drivers. This is also the OpenGL minimum.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:41:57 -05:00
Marek Olšák
6708ccd3bf radeonsi: remove and inline si_shader::ngg::prim_amp_factor
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
e98a4f3820 radeonsi: rename ctx -> sctx in si_emit_guardband
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
a61d74ed27 radeonsi: remove AMD_DEBUG=nogfx
it doesn't work - it uses the CDNA codepath for preamble, which surely
hangs on non-CDNA

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
00b716cb83 radeonsi: remove redundant VS_PARTIAL_FLUSH for streamout
si_emit_streamout_end does this already.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
17de5dd1c4 radeonsi: inline si_screen_clear_buffer
it has only one use

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
738babc67a radeonsi: inline si_allocate_gds and si_add_gds_to_buffer_list
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
f841a5b991 radeonsi: don't use nir_optimization_barrier_vgpr_amd with ACO
It's unimplemented.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
44eaf50a34 ac/surface/tests: cosmetic changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
dfcc7f83a4 ac/surface: cosmetic changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:39:42 -05:00
Marek Olšák
355242f055 ac/gpu_info: adjust attribute ring size for gfx11
these are better numbers

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:36:52 -05:00
Marek Olšák
bd57630885 ac: add missing gfx11.5 bits
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26055>
2023-11-05 12:34:55 -05:00
Alyssa Rosenzweig
cd0a01522f ttn: Set sample shading for sample ID reads
Fixes on asahi arb_stencil_texturing-blit_corrupts_state -auto
GL_TEXTURE_2D_MULTISAMPLE.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26011>
2023-11-05 00:31:22 +00:00
Mauro Rossi
95ad0c750c Android.mk: disable android-libbacktrace to build with Android 14
Android libbacktrace is not available in Android 14

Fixes the following build error:

FAILED: src/util/libmesa_util.a.p/u_debug_stack_android.cpp.o
...
../src/util/u_debug_stack_android.cpp:28:10: fatal error: 'backtrace/Backtrace.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
2023-11-04 21:37:24 +01:00
Mauro Rossi
520e79a3b5 Android.mk: filter out cflags to build with Android 14 bundled clang
Android 14 uses prebuild clang version 17.0.2
By filtering these cflags there are no building errors on previous Android releases.

Fixes the following building errors:

../src/c11/time.h:54:8: error: redefinition of 'timespec'
struct timespec
       ^
/media/bigblissdrive/u-x86/out/soong/.intermediates/bionic/libc/libc/android_vendor.34_x86_x86_64_shared/gen/include/bits/timespec.h:46:8: note: previous definition is here
struct timespec {
       ^
1 error generated.

In file included from ../src/util/disk_cache.c:50:
../src/util/disk_cache.h:86:4: error: use of undeclared identifier 'Dl_info'
   Dl_info info;
   ^
...
./src/util/disk_cache.h:114:30: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
      _mesa_sha1_update(ctx, build_id_data(note), build_id_length(note));
                             ^~~~~~~~~~~~~~~~~~~

10 errors generated.

../src/intel/perf/intel_perf.c:91:10: error: call to undeclared function 'major'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   maj = major(sb.st_rdev);
         ^
../src/intel/perf/intel_perf.c:92:10: error: call to undeclared function 'minor'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   min = minor(sb.st_rdev);
         ^
2 errors generated.

../src/intel/vulkan/anv_allocator.c:295:13: error: call to undeclared function 'futex_wake'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
            futex_wake(&table->state.end, INT_MAX);
            ^
...
../src/intel/vulkan/anv_allocator.c:711:7: error: call to undeclared function 'futex_wait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      futex_wait(&pool->block.end, block.end, NULL);
      ^
6 errors generated.

Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
2023-11-04 21:36:55 +01:00
Alyssa Rosenzweig
0e481bf463 ci: Opt out asahi from clang-format
I'm still 100% a believer in clang-format enforcement, but given the difficult
constraints upstream CI has, I no longer believe it is productive or fair to do
this enforcement upstream. Instead, it can be (and effectively is) enforced much
more inexpensively in the Asahi tree. It is far better for me to insert a
"reformat asahi" commit once in a while when I rebase the Asahi tree, than to
shoot down an unrelated upstream MR because someone forgot to ninja
clang-format.

I regret adding the clang-format lint to CI. To those who have lost merges over
it, I am sorry. I'm learning from my mistakes and trying to do better.

I would encourage other drivers in the clang-format include to follow suit, but
doing this effectively requires a driver/hardware tree to do the enforcement. (I
would also encourage that, as it is much friendlier to upstream CI, but that's a
different discussion.)

For now, let's opt out asahi at the least.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26030>
2023-11-04 14:13:09 +00:00
LingMan
1f1ec1c6bc rusticl: Show an error message if the version of bindgen can't be detected
bindgen 0.69.0 broke the `--version` switch, resulting in misleading errors about requiring at
least bindgen 0.62 or about unexpected arguments.

Ideally the build system would fetch the correct bindgen version automatically like cargo does.
Until then, provide a hopefully more helpful error message to the user.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26046>
2023-11-04 13:47:49 +00:00
Eric Engestrom
e9f725c741 ci/rules: add missing clang-format files to what needs containers to build
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:37 +00:00
Eric Engestrom
5be1972f61 ci: bump image tags to rebuild deqp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:37 +00:00
Eric Engestrom
37970fa703 ci/build-deqp: print more detailed information about what deqp version is running
`git describe` tells you that you have N patches on top of tag T, but
not what these patches are, and the commit hash is useless as it is only
valid during the container build.

Replace this with:
- the tag that we are checking out
- the list of patches applied on top of it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:36 +00:00
Eric Engestrom
124b4097f3 ci/build-deqp: move mkdir earlier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:36 +00:00
Eric Engestrom
a61dcdd4b1 ci/build-deqp: split deqp version into a variable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:36 +00:00
Eric Engestrom
22f4ca2cf3 ci/build-deqp: stop ignoring failures while fetching patches
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:36 +00:00
Eric Engestrom
be18be9deb Revert "ci: backport two mesh/task query fixes for VKCTS"
This reverts commit dcc4e1b4d7.

The hashes added there are incorrect, and fixing them regresses a bunch
of drivers, so let's just revert for now, and the next commit fixes the
bug that allowed incorrect backports to go in undetected.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26013>
2023-11-04 12:44:36 +00:00
Karol Herbst
655cbf203d docs/features: mark rusticl gl_sharing as done
It seems at the moment only iris and radeonsi expose other drivers aren't
fulfilling all prerequisites.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26044>
2023-11-04 10:30:56 +01:00
Rob Clark
d67d501af4 tu/drm/virtio: Switch to vdrm helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
0e3584df44 freedreno/drm/virtio: Switch to vdrm helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
06e57e3231 virtio: Add vdrm native-context helper
Add a helper to de-duplicate some of the virtgpu native-context support
between turnip and freedreno.  This should make things easier for other
drivers adding virtgpu support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-intel
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
53ccb421a2 freedreno/drm: Simplify backend mmap impl
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Lucas Fryzek
6f467fc6a3 freedreno/drm: Add more APIs to per backend API
Add bo_map, bo_from_dmabuf, and bo_close_handle to the per backend
APIs for freedreno/drm. These changes are required to implement
a KGSL backend as part of freedreno/drm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
b90244776a virtio/drm: Split out common virtgpu drm structs
Since these all ended up the same with (not yet merged) intel and amd
implementation of drm native context, split these out so they can be
shared.  This will also make it easier to extract out a shared helper
that can be re-used across native-context drivers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-intel
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Juan A. Suarez Romero
9bdee8cd39 vc4/ci: comment why piglit is disabled
We disabled piglit testsuite some time ago because it is causing GPU
hangs from time to time, and we didn't find out yet what are the tests
causing such issue.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26021>
2023-11-04 02:41:21 +00:00
Paulo Zanoni
c2db19f496 anv: setup the TR-TT vma heap
"16TB ought to be enough for anybody."
      - Probably some Intel graphics hardware engineer

TR-TT addresses are fixed regardless of the platform's gtt_size.
Unconditionally reserve this space for it: our total 48bit address
space is 256tb and TR-TT takes 16tb out of it (1/16th).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:53 +00:00
Paulo Zanoni
0a120edfb8 anv/sparse: extract anv_sparse_bind()
This function will be able to transparently handle sparse binding
regardless of the backend: vm_bind ioctls or TR-TT. For now we only
support the vm_bind ioctls, but soon we'll have anv_sparse_bind_trtt()
as an option.

It is important to notice that even backends that support the vm_bind
ioctl may choose to do Sparse binding via TR-TT, that's why we're
adding the indirection at this specific point.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:53 +00:00
Paulo Zanoni
544c5c006c intel/genxml: add the Gen12+ TR-TT registers
These are the registers we're going to use for now.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
1af1426542 anv/sparse: also print bind->address at dump_anv_vm_bind
This helped tracking down xe.ko bug #746.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
b94d7dbe66 anv/sparse: join multiple NULL binds when possible
When it's a NULL bind we always set the bo_offset (aka memory offset)
to zero, so we have to avoid the "bind.offset == prev.offset + size"
check.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
2fc0bbe814 anv/sparse: join multiple bind operations when possible
If the next bind is just an extension of the previous one, join both
in the same bind operation. Due to how mip levels are laid in memory,
this can only happen for mip level 0.

As of today xe.ko doesn't try to join contiguous operations for us.
Due to how rebinds happen each additional rebind operation may end up
resulting in many extra things done, so these simple checks end up
saving us a lot of cycles the Kernel would otherwise waste. This will
be true even after we issue all binds in a single ioctl.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
2883c6ddaa anv: alloc client visible addresses at the bottom of vma_hi
Kill vma_cva and just toggle heap->alloc_high instead. This way,
client visible addresses will remain isolated in their own little
corner, except we have one less vma to deal with.

For TR-TT we'll need a special vma, and if we don't use the trick
above we'll need yet another trtt_cva_vma, increasing complexity even
more.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:52 +00:00
Paulo Zanoni
e1b50074fe anv: don't forget to destroy device->vma_mutex
This actually doesn't fix any bugs or leaks, because according to the
man page:

  "In the LinuxThreads implementation, no resources are associated
   with mutex objects, thus pthread_mutex_destroy actually does
   nothing except checking that the mutex is unlocked.

still, it's better to have it than not to have it, especially since
other implementations may do something.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
2023-11-04 02:06:52 +00:00
Karol Herbst
0a072bb31c rusticl/context: fix importing gl cube maps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:43 +00:00
Karol Herbst
06a2258b4b radeonsi: hack for importing 3D textures
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:43 +00:00
Karol Herbst
56f934103d radeonsi: support importing arbitrary resources
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:43 +00:00
Antonio Gomes
7e031078dd rusticl: Advertise cl_khr_gl_sharing extension
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
59287a1223 rusticl: Flush objects just before importing them
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
1c3dde7ba6 rusticl: Add support for cube maps
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
2645003bdc rusticl: Create CL mem objects from GL
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
0bafe8be2c rusticl/format: Add conversion table for GL->CL
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
57dfc013a6 rusticl: Add functions to create CL ctxs from GL, and also to query them
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
425d7acd4a rusticl/device: Enable gl_sharing only if create_fence_fd is implemented
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
7bb131964b rusticl/device: Function to check for gl interop support
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
c4c58aa26f rusticl: Add xplat helpers to dynamic link interop functions
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
1396dc1c38 mesa/st, dri2, wgl, glx: Modify flush_objects interop func to export a fence_fd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
663cef26d0 mesa/st: Add new data to mesa_glinterop
* Version 3 of mesa_glinterop_device_info
* Export device uuid
* Version 2 of mesa_glinterop_export_out
* Export texture sizes
* Export whandle.modifier
* Export whandle.stride
* Add PIPE_HANDLE_USAGE_EXPLICIT_FLUSH in interop_export_objects

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
d52f35fa1a iris: Fixups in resource_get_handle and resource_from_handle
* Add support for PIPE_BUFFER in resource_from_handle.
* Flush batches after reallocate_resource_inplace:
  If we're dealing with a PIPE_BUFFER, iris_flush_resource doesn't
  flush the batch and we export the resource with pending commands.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
df0623e51a rusticl, meson: Add gl/egl/glx bindings
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Antonio Gomes
bcd7538d03 rusticl, meson: Move libc functions to their own crate
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-04 01:28:42 +00:00
Yonggang Luo
84db4d5698 micosoft: decouple microsoft vulkan driver and compiler from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Yonggang Luo
8bcb996a88 micosoft: define enum dxil_tex_wrap to avoid the usage of enum pipe_tex_wrap
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Yonggang Luo
a36ad49e0e microsoft/clc: Use 128 instead of PIPE_MAX_SHADER_SAMPLER_VIEWS
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Yonggang Luo
1181c2509d microsoft/clc: Using sampler_id instead PIPE_MAX_SHADER_SAMPLER_VIEWS for dxil_lower_sample_to_txf_for_integer_tex
Because sampler_id is the real number of samples.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24440>
2023-11-04 00:02:59 +00:00
Jesse Natalie
e51acb65ac dzn: Fix memory type sorting
For a dGPU, we should have:
1. RAM
2. RAM + write-combined CPU access
3. RAM + cached CPU access
4. VRAM

Eventually there'll be VRAM + write-combined CPU access after 4, using "GPU upload heaps"

For an iGPU, we should have:
1. RAM (declared as device-local)
2. RAM + write-combined CPU access (declared as device-local)
3. RAM + cached CPU access (declared as device-local)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26037>
2023-11-03 23:33:02 +00:00
Dave Airlie
c8e39683da vulkan/video: add h265 header encoders.
Vulkan video has parameter overrides, where the	driver can override the
driver provided	parameters with	an encoded bitstream where it has made
changes.

This is	the support code to encode the bitstream headers for h265
from parameters	(vps/sps/pps).

Acked-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
d46162981a vulkan/video: add h264 headers encode
Vulkan video has parameter overrides, where the driver can override the
driver provided parameters with an encoded bitstream where it has made
changes.

This is the support code to encode the bitstream headers for h264
from parameters (sps/pps).

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
8243145f02 vulkan/video: add a h265 level translator.
This just converts the protocol level to the spec level encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
5542b51aff vulkan/video: add h264 level idc convertor utility
This converts vulkan level to the bitstream encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
1782ab4d8b util: add a bitstream encoder for video stream headers.
This is based on the d3d12 code, and is mostly a rewrite in C,
these are just some helpers to use for writing h264 and h265
headers for vulkan encode.

Acked-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
72f52329cd vulkan/video: add a nal_unit lookup for hevc
This is needed to by drivers to get a nal unit type
for the picture type.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
fee258de27 vulkan/video: add h264 nal enum
This will be used later for header encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
8dd97080d8 vulkan/video: add h265 encode support
This just adds the session and parameter handling for h265 encode.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
5cb46f1ce7 vulkan/video: add support for h264 encode to common code
This adds support for the h264 encode session and parameter storage.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
b84c58d727 vulkan: update video headers
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
José Expósito
8a635e516e zink: Fix crash on zink_create_screen error path
The `zink_internal_create_screen()` function can fail before
`screen->loader_lib` and/or `screen->instance` are initialized.
The `zink_destroy_screen()` doesn't check those cases and crashes.

The error was found by Fedora's CI. The back trace is available at [1].

[1] https://bodhi.fedoraproject.org/updates/FEDORA-2023-c39f82c465

Fixes: 0c2045553f ("zink: use screen destructor for creation fails")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26029>
2023-11-03 22:37:43 +00:00
Faith Ekstrand
5a85f67fa4 nvk: Assert no storage images on Kepler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Faith Ekstrand
d5753a89a6 nvk: Drop a bogus assert
We've supported storageImageReadWithoutFormat for a while.  Also, thanks
to the fact that the assert assumed image_deref_load and happened after
nir_rewrite_image_intrinsic, it would never trigger.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Faith Ekstrand
0ce49d4347 nvk: Fix nvk_heap_free() for contiguous heaps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Faith Ekstrand
57d6722d79 nvk: Force all mappable BOs into GART pre-Maxwell
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Yonggang Luo
5e9dcffffd nvk: Should use alignment instead of align
align is a function, don't know why align > 0 is working

Fixes: 87686a2220 ("nvk: Rework side-band data upload")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26035>
2023-11-03 21:53:33 +00:00
Daniel Stone
80b87c18d1 ci: Try really hard to print final result string
a630 has been completing jobs, and then corrupting the very last line of
UART output - the one where we pass the overall result back from the DUT
to the job. The bare-metal monitor will wait for this line to appear,
never see it, and then the job times out.

Since this line is the most critical one of all to get out, just spam
the prints to try to make sure they get through.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26032>
2023-11-03 21:17:42 +00:00
Eric Engestrom
c826f70c37 rpi4/ci: remove spec@!opengl 1.1@depthstencil-default_fb-drawpixels-32f_24_8_rev samples=2 from fails as it's a flaky test and already marked as such
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25974>
2023-11-03 20:57:31 +00:00
Eric Engestrom
ed90430027 rpi4/ci: move spec@!opengl 1.1@depthstencil-default_fb-drawpixels-24_8 samples=2 from fails for flakes after an UnexpectedPass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25974>
2023-11-03 20:57:31 +00:00
Eric Engestrom
9f281899dc rpi4/ci: add more known dEQP-EGL.functional.*.*_context.gles*.other failures
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25974>
2023-11-03 20:57:31 +00:00
Jesse Natalie
67df2f29eb vulkan: Support loader interface v7
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Jesse Natalie
228329f4da vulkan: Consolidate common ICD methods
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Jesse Natalie
32f0034ec9 vulkan: Remove no-longer-needed prototypes for ICD entrypoints
The comment around these is no longer true, vk_icd.h does in fact
have prototypes for these functions.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
David Rosca
af2980e5b9 radeonsi/uvd_enc: Add VUI parameters in output bitstream
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:01 +00:00
David Rosca
72fadf5faf radeonsi/vce: Add VUI parameters in output bitstream
This enables VUI parameters and sets aspect ratio, video format,
video full range, colour description and chroma location.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:01 +00:00
David Rosca
5f70379e0d radeonsi/vce: Tweak motion estimation params for better quality
This gives better video quality while not slowing down the encoding
speed too much (less than 10% slower).

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:01 +00:00
David Rosca
8dda860f83 Revert "radeon/radeon_vce: fix out of target bitrate in CBR mode (H.264)"
This reverts commit f7e7cf637e.

It is now possible to change the buffer size from VA frontend, so this
is no longer needed and instead it's up to applications to set
appropriate value.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
bf95000d74 radeonsi/uvd_enc: Fix leaking session info buffer
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
9feff3d695 radeonsi/uvd_enc: Implement destroy_fence vfunc
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
007ff4ea00 radeonsi/uvd: Implement destroy_fence vfunc
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
David Rosca
fdc8da6eb4 radeonsi/vce: Implement destroy_fence vfunc
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991>
2023-11-03 19:35:00 +00:00
Juan A. Suarez Romero
8f621174da v3d: use kmsro to create drm screen on real hw
When using `MESA_LOADER_DRIVER_OVERRIDE=v3d` in real hw, use kmsro to
create the drm screen, which is actually what happens when not exporting
such variable.

This avoids confusions when using the envvar in real hardware and starts
to fail.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26007>
2023-11-03 18:50:37 +00:00
Chia-I Wu
ef724ab695 vulkan, tu, pvr: remove vk_render_pass_state::render_pass
The spec says

  A VkRenderPass or VkPipelineLayout object passed as a parameter to
  create another object is not further accessed by that object after the
  duration of the command it is passed into.

The object could have been destroyed if we get the pointer from a
pipeline library.  Since it has no user now, let's remove it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26000>
2023-11-03 17:23:30 +00:00
Chia-I Wu
227300345e radv: stop using vk_render_pass_state::render_pass
vk_render_pass_state::pipeline_flags is derived from
vk_get_pipeline_rendering_flags and has the info we need.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10074
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26000>
2023-11-03 17:23:30 +00:00
David Rosca
c638e61ef5 frontends/va: Map decoder and postproc surfaces for reading
If application requests to map surface that was most recently used
as decoder or postproc target and also doesn't explicitly set the
map flags (vaMapBuffer2) it's very likely the intent is to read from
this surface, so we need to map it as such.

This fixes regression on radeonsi where mapping NV12 surfaces for
reading would fail with applications using vaDeriveImage. The reason
for this is that the VA frontend doesn't allow vaDeriveImage for
interlaced surfaces so the applications would use vaGetImage fallback,
but radeonsi doesn't allocate NV12 surfaces as interlaced anymore.

This also fixes mapping other formats surfaces (P010, RGBx, ...)
for reading, which never worked before.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9935
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10048

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26008>
2023-11-03 17:04:00 +00:00
Rob Clark
33de58154f freedreno: Handle DRM_FORMAT_MOD_QCOM_TILED3 import
This is something that we could allocate and export.  So we must import
them as well.

Fixes import failures in spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
2023-11-03 15:43:09 +00:00
Rob Clark
a95ea2b6d6 freedreno: Fix modifier determination
Now that we have TILED2 and TILED3 modifiers, we should handle those
cases.

Fixes assert that modifier != INVALID in
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
2023-11-03 15:43:09 +00:00
Rob Clark
6ac133c646 freedreno/drm: Fix race in zombie import
The check for the zombie case (racing with final unref of the bo vs
removal from table) must be atomic.

Fixes spec@ext_image_dma_buf_import@ext_image_dma_buf_import-refcount-multithread

Fixes: a192923f99 ("freedreno/drm: Restart import on zombie race")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
2023-11-03 15:43:08 +00:00
antonino
4a627af0e3 nir: don't take the derivative of the array index in nir_lower_tex
Previosuly when lowering to txd for sampler array the index would be
derived as well, therefore the resulting derivative would have been a
vec with one more component than what the txd instruction expects.

This patch truncates the coordinate vector in this case to make sure the
index is not derived.

Fixes: b154a4154b ("nir/lower_tex: rewrite tex/txb -> txd/txl before saturating srcs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26012>
2023-11-03 12:53:11 +00:00
Gert Wollny
28b79b2ea5 r600/sfn: Fixup component count only if intrinsic has it
Fixes: 33d878e
   r600/sfn: Handle load_global in 64 to vec2 lowering

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
2023-11-03 12:25:39 +00:00
Gert Wollny
1662897294 r600: Link with libgalliumvl, when enabling rusticl this is needed
Fixes: 33673bcc2a
    rusticl: stop linking with libgalliumvl

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
2023-11-03 12:25:39 +00:00
Gert Wollny
022850ed05 r600: Add experimental get_compute_state_info
This callback is needed for rusticl, but the values that are returned
may be completely off.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7420

v2: use r600_wavefront_size value

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24229>
2023-11-03 12:25:39 +00:00
Karol Herbst
7b41921504 nvc0: implement PIPE_CAP_TIMER_RESOLUTION
This allows rusticl to create profiling queues.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10042
Fixes: 660f2eabe1 ("gallium: add PIPE_CAP_TIMER_RESOLUTION")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26016>
2023-11-03 11:13:44 +00:00
duncan.hopkins
1039da1400 vulkan: added build dependencies for systems using non-standard prefixed X11 libs.
To get MacOS to build, some extra dependencies need to be added to a couple of build targets.
This mainly shows up when not installing the dependencies in the default prefix locations.
On MacOS, this happens when using a custom build of brew to install the dependencies to 'odd' locations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26022>
2023-11-03 10:46:27 +00:00
Eric Engestrom
47398c65ee ci/radeonsi: add another flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26020>
2023-11-03 09:20:32 +00:00
Samuel Pitoiset
fc9bab73a9 radv/ci: document one more flake test
This test consistently fails on some GPUs (already documented) but on
some others it's a flake. It's a known issue that should be fixed soon
in RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26019>
2023-11-03 09:16:54 +01:00
Jesse Natalie
5550c1daf4 dzn: Use vk_properties helper
Addresses part of https://gitlab.freedesktop.org/mesa/mesa/-/issues/9521
Required for https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998
to actually work correctly for Dozen

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26014>
2023-11-03 00:00:13 +00:00
Alyssa Rosenzweig
0038f95b66 asahi: Fix tools=all builds
don't need clc here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26017>
2023-11-02 18:51:57 -04:00
Connor Abbott
2313a517d2 v3d/ci: Remove minetest trace
For the same reason as the previous commit. For examples of commits
causing spurious changes see 8019a1b9 and d89ca14e.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25864>
2023-11-02 21:46:55 +00:00
Connor Abbott
16214710ca freedreno/ci: Remove minetest trace
I've repeatedly seen minor pixel changes due to changes that only affect
RA decisions, most recently in !22072. We changed the trace to hopefully
remove a use of texture() in control flow, but it seems there are more,
or the problem is something slightly different like reading
uninitialized values. On the other hand minetest has never actually
caught an issue for me that some other trace hasn't also caught. Just
remove it.

Cc: mesa-stable
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25864>
2023-11-02 21:46:55 +00:00
Connor Abbott
e8b3006bfd util/rb_tree: Add augmented trees and interval trees
An "augmented tree" is a tree with extra data attached which flows from
the leaves to the root. An "interval tree" is a datastructure of
(potentially-overlapping) intervals where, in addition to inserting and
removing intervals, we can quickly lookup all the intervals which
overlap a given interval.

After describing red-black trees, CLRS explains how it's possible to
implement an interval tree using an augmented red-black tree where the
nodes are ordered by interval start and each node also stores the
maximum interval end for its entire subtree.

Implement the interval tree extension described by CLRS. Iterating over
all overlapping intervals is actually an exercise, so we have to solve
the exercise. The recursive solution has been re-written to use the
parent pointers to avoid needing a stack, similarly to rb_tree_first()
and rb_node_next().

For now, we only implement unsigned intervals, but the core algorithms
are all abstracted to allow other types. There's still some boilerplate,
but it's the best that can be done in C.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22071>
2023-11-02 21:03:46 +00:00
Connor Abbott
767e68972e util/rb_tree: Fix editorconfig
rb_tree has 4 space tabs, unlike everything else in util. We should
probably retab it, but for now add an editorconfig so that at least
people's editors aren't messed up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22071>
2023-11-02 21:03:46 +00:00
Faith Ekstrand
1793adbd3a nir/validate: Allow array derefs on vectors on function/shader_temp
This is required by OpenCL.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
0b3b4da82a nir: Handle array-deref-of-vec in var split passes
The changes are pretty straightforward.  For vector splitting, we just
ignore those vectors for now.  We could potentially handle array derefs
with a constant index (and probably should) but that's left for later.
For now, I'm mostly concerned with correctness of the pass.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
6bc8567bb9 nir: Handle array-deref-of-vec in vars_to_ssa
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7746
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
68c54c994a nir/types: Support vectors in glsl_get_length()
This makes it consistent with glsl_get_array_element() which returns the
scalar type for vectors, column type for matrices, and array element
type for arrays.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
1e1c450659 nir/lower_io_to_vector: Only call glsl_get_length() on arrays
We assumed that calling it on vectors would return 0 and then did a
MAX2(length, 1) to get 1 for vectors.  Instead, use a ternary so we
don't make assumptions about non-sensical values.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Karol Herbst
5db458eb2d ir2: Stop assuming glsl_get_length() returns 0 for vectors
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
2db20af82e v3d: Stop assuming glsl_get_length() returns 0 for vectors
Checking for whether or not it's a plain vector is actually what we want
anyway. There's no point in handling arays of length 1.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
ed79690196 vc4: Stop assuming glsl_get_length() returns 0 for vectors
Instead, check if it's a vector or scalar and use 1 explicitly.  In FS
output case where we were only using it assert we don't have any arrays,
assert that directly.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Karol Herbst
d17dc3e9cd nir: Stop assuming glsl_get_length() returns 0 for vectors
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
a1f3c5eea7 nir: Add asserts to nir_phi_builder_value_set_block_def
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
5adb335507 nir: Use nir_builder to insert movs
Also, leave a big comment about why we're inserting movs and not just
propagating SSA values directly.  Hopefully this will prevent idiots
like me from getting clever and thinking they can delete that mov. 😅

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Faith Ekstrand
15ab4d397f nir: Handle wildcards with casts in copy_prop_vars
If we're propagating a copy from a cast where the copy copies an entire
array, we end up with something like &((S *)ssa_N)->f[*] in the source
where a wildcard has a cast in its parent chain.  If we then try to
propagate the read into a non-wildcard array load, we have to specialize
the wildcard.  This breaks because nir_build_deref_follower() doesn't
handle casts.  Since we know a priori that, because wildcards are only
generated by copy_deref on arrays, we cannot have a cast with a wildcard
parent so simply chasing the source deref to the first wildcard will
ensure that any casts in the deref are handled properly.

Fixes: ba2bd20f87 ("nir: Rework opt_copy_prop_vars to use deref instructions")
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
2023-11-02 20:28:46 +00:00
Yiwei Zhang
ae3b022fa0 venus: fix query feedback batch leak and race upon submission
Summary:
- fixed the combined query batches leak
- fixed the race condition of accessing feedback cmd pool
- very scoped code refactor

Cc: 23.3 <mesa-stable>
Fixes: 5b24ab91e4 ("venus: switch to unconditionally deferred query feedback")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25988>
2023-11-02 17:46:32 +00:00
Jesse Natalie
d9fada16b9 d3d12: Don't support displaytargets that can't be supported by GDI/DXGI
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25979>
2023-11-02 17:11:33 +00:00
Jesse Natalie
d4ed1ea31e winsys/gdi: Update is_displaytarget_format_supported to reflect reality
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25979>
2023-11-02 17:11:33 +00:00
Jesse Natalie
823d40db4a winsys/gdi: Handle 4444 and 1010102 texture formats
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25979>
2023-11-02 17:11:33 +00:00
Jesse Natalie
87c5589605 wgl: Take pixelformat color channels into account for choosing a PFD
Otherwise there's no way to target PIPE_FORMAT_B4G4R4A4_UNORM instead
of the B5G6R5 or B5G5R5A1 if those are supported. This gets the behavior
closer to the Windows PFD selection.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25979>
2023-11-02 17:11:33 +00:00
Rohan Garg
2444a3cd46 intel/compiler: migrate WA 14013672992 to use WA framework
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26006>
2023-11-02 16:39:25 +00:00
Konstantin Seurer
11282598e6 radv: Add radv_nir_lower_hit_attrib_derefs_tests
Tests hit attrib lowering for various variable/type configurations.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24271>
2023-11-02 15:48:36 +00:00
Konstantin Seurer
f51227d253 radv/clang-format: Do not indent C++ modifiers
Turns

class asd {
 private:
};

into

class asd {
private:
};

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24271>
2023-11-02 15:48:36 +00:00
Konstantin Seurer
ba8d3afa56 radv/nir: Handle boolean hit attribs
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24271>
2023-11-02 15:48:36 +00:00
Konstantin Seurer
3a69424e09 radv/nir: Add radv_nir_lower_hit_attrib_derefs
Move out the pass so it can be unit tested.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24271>
2023-11-02 15:48:36 +00:00
Konstantin Seurer
b7c582e5c7 radv: Add RADV_MAX_HIT_ATTRIB_DWORDS
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24271>
2023-11-02 15:48:36 +00:00
duncan.hopkins
4ef573735e glx: fix automatic zink fallback loading between hw and sw drivers on MacOS
The combination of defines used when compile the code on MacOS is hiding variables.
Patch allows basic MacOS build to compile and run.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25992>
2023-11-02 15:08:17 +00:00
duncan.hopkins
c8b64452c0 dri: added build dependencies for systems using non-standard prefixed X11 libs.
To get MacOS to build, some extra dependencies need to be added to a couple of build targets.
This mainly shows up when not installing the dependencies in the default prefix locations.
On MacOS, this happens when using a custom build of brew to install the dependencies to 'odd' locations.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25992>
2023-11-02 15:08:17 +00:00
duncan.hopkins
96d55d784c util: Update util/libdrm.h stubs to allow loader.c to compile on MacOS.
MacOS does not have the libdrm libraries so is missing xf86drm.h.
util/libdrm.h already has a collection of stubs for systems that do not support the libraries.

A compile on MacOS will fail with the source that uses newer drm functions and structures.
Update adds in missing items that MacOS code needs to compile and run.
New code is copied from the public repository: https://gitlab.freedesktop.org/mesa/drm/-/blob/main/xf86drm.h

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25992>
2023-11-02 15:08:17 +00:00
Rob Clark
ceeab44fd1 tu/virtio: Fix timeline semaphore support
Fixes: f17c5297d7 ("tu: Add virtgpu support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25981>
2023-11-02 14:32:36 +00:00
Rob Clark
79b907f941 tu/msm: Fix timeline semaphore support
Fixes: daefc6e2a4 ("turnip: prep work for timeline semaphore support")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25981>
2023-11-02 14:32:36 +00:00
Corentin Noël
685fef1876 virgl/texture: Align destination box to block depth
In the case of a 3D texture, make sure to align to the block depth.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26005>
2023-11-02 13:07:24 +00:00
Corentin Noël
b280ea863d virgl: fill the array_size value when using PIPE_TEXTURE_CUBE
The cube texture type also requires array sizes.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26005>
2023-11-02 13:07:24 +00:00
Rhys Perry
0a418561da radv: skip radv_remove_varyings for mesh shaders
Fixes compilation of a Talos Principle 2 shader.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 9fa9782c17 ("radv: stop compiling a noop FS when the application doesn't provide a FS")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25659>
2023-11-02 12:44:43 +00:00
Rhys Perry
ed12be533e radv: call lower_array_deref_of_vec before lower_io_arrays_to_elements
nir_lower_io_arrays_to_elements does not support array derefs of vectors,
even when nir_deref_instr_is_known_out_of_bounds is fixed.

They can occur with mesh shaders.

Found by inspection.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25659>
2023-11-02 12:44:43 +00:00
Alyssa Rosenzweig
570ed11303 asahi: Remove placeholder shader
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
2c54372760 agx: Use CL for texture lowerings
To demonstrate everything working, and the value of this approach.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
8ef7eec246 asahi: Add software-defined field to texture desc
We use this for buffer textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
eecd8390d0 asahi,agx: Plumb libagx
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
0be124b77e asahi: Deserialize libagx when opening device
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
75fe90dab0 asahi: Pass valid memctx to open_device
Currently the argument is unused but that's about to change.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
cde7ca1683 asahi: Add asahi_clc infrastructure
Based on intel_clc, tuned for libraries. Targets serialized NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
a02e463484 asahi: Add folder for internal shaders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
103e300e7f asahi: Reexpress genxml pack macro
To let NIR unroll it. Workaround NIR bug.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
ed1b2f40fc asahi: Unpack at 32-bit granularity
The way we already do for packs. This is more efficient.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
0df82f76c4 asahi: Make GenXML compatible with OpenCL
Adapt gen_pack.py to generate an OpenCL compatible header, capable of both
packing and unpacking but not printing (due to no known use case and no fprintf
in CL). This is useful as a building block for manipulating descriptors from
shader code, for example in texture lowering or device-generated commands.

To accomplish this, we need to inline in some CL-compatible variants of mesa
util functions (no doubles, etc), avoid FILE * use in the CL path, and use
__constant pointers where applicable for performance. Otherwise, there are
surprisingly few changes required, thanks mainly to CL 2.0 generic pointers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:47 +00:00
Alyssa Rosenzweig
59499d8dbc asahi: Fix agx_pack unrolling
The loop is supposed to execute exactly once, but the previous logic
inadvertently executes 0 or 1 times depending on whether dst is NULL (it never
is). Reexpress the loop to execute exactly once, eliminating the unnecessary
branch in this hot path. Noticed when reading the NIR of generated pack code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
7193849f30 agx: Fuse ubitfield_extract
Similarly, let's get the win everywhere.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
5500e02a61 agx: Fuse (unmasked) extr_agx
This will clean up genxml unpack code and is needed for parity with the assembly
we write by hand. This way we get the win for all shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
0cde7b794c agx: Vectorize load/stores
This helps CL shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
7f27f2e314 agx: Fix lower regular texture metadata
for buffer textures, we insert new blocks which invalidates dominance and
block index info... leads to end-to-end fails when shuffling pass order.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
a6afa48e86 clc: Add missing idep_vtn
From the libclc linking code. This should probably be split out but that seems
like potentially a task for another day. Avoids a linker error in the next
commit the easy way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
f164edfe71 vtn: Add spirv_library_to_nir_builder feature
This new entrypoint takes in a SPIR-V blob and generates a header containing
a static inline nir_builder-family function for each function in the SPIR-V
library. The generated function will look for the function in the shader and, if
not found, insert a new nir_function with the appropriate signature -- to be
linked with the library later. Then, it will call the function, with the
appropriate gymnastics to handle return values as necessary.

This makes it super convenient to wrap CL libraries for use in a NIR pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
a2d3c74094 meson: Require clc for asahi
By the end of the series, this will become a hard dependency for the driver.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
01d0d94319 meson: Simplify clc expression
To make it easier to add more clc users later.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
b192f3c458 nir/builder: Add nir_call helper
This adds an idiomatic way to insert NIR function calls with the builder. Since
functions have variable numbers of arguments, this is a variadic function.

v2: Define with a variadic macro instead, for safety with the argument count.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
23bea25207 nir: Add nir_remove_non_exported
For libraries.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
6014f745d5 nir,vtn: Add exported bool to nir_function
For optimizing libraries.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alyssa Rosenzweig
103d20e657 gitlab: Highlight .cl as C
It is close enough, and a lot better than the defaults when gitlab doesn't
recognize the file format as currently happens for .cl

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
2023-11-02 11:37:46 +00:00
Alejandro Piñeiro
b509446c2c docs/v3d: update v3d documentation
In order to include a reference to the Raspberry Pi 5, and that the
support for 3.3 and 4.1 got dropped.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25851>
2023-11-02 11:59:08 +01:00
Alejandro Piñeiro
87a673cac4 broadcom/cle: rename xml files
This has been confusing for some time, as from a xml file with the
suffix v33 (so suggesting just one version) we were generating the
headers for v33, v40, v41 and v71.

So now there is a header for the vc4 driver, and one header for the
v3d/v3dv (so v3d "platform") drivers.

FWIW, this means that now the name of the original xml and the header
files generated doesn't maintain a so similar pattern, but again the
equivalence were not there anyway.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25851>
2023-11-02 11:59:08 +01:00
Alejandro Piñeiro
9c4829473a broadcom/cle: remove v33 and v41 from xml definition
For the case of v41 is mostly update to v42.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25851>
2023-11-02 11:59:08 +01:00
Alejandro Piñeiro
e9fa6c0bc6 broadcom/compiler: set properly lod query
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25851>
2023-11-02 11:59:08 +01:00
Alejandro Piñeiro
85f26828fe broadcom: only support v42 and v71
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25851>
2023-11-02 11:59:08 +01:00
Samuel Pitoiset
dcc4e1b4d7 ci: backport two mesh/task query fixes for VKCTS
RADV would need these fixes to avoid skipping a ton of tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25953>
2023-11-02 08:22:26 +01:00
Guilherme Gallo
60cd0af06c ci/lava: Add unit tests covering job definition
Add two unit tests related to the LAVA job definition.

test_generate_lava_job_definition_sanity checks for the most important
fields, deploy actions, namespaces etc.

test_lava_job_definition compares the generated definition with static
skeleton YAML files committed inside tests/data folder.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:50 +00:00
Guilherme Gallo
fdd51ef584 ci/lava: Enable SSH by default in fastboot devices
It is only applied in Collabora farm, since we still haven't seen many
UART hangs in Lima farm.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:50 +00:00
Guilherme Gallo
654f7f783f ci/lava: Make SSH definition wrap the UART one
Simplify both UART and SSH job definitions module to share common
building blocks themselves.

- generate_lava_yaml_payload is now a LAVAJobDefinition method, so
  dropped the Strategy pattern between both modules
- if SSH is supported and UART is not enforced, default to SSH
- when SSH is enabled, wrap the last deploy action to run the SSH server
  and rewrite the test actions, which should not change due to the boot
  method
- create a constants module to load environment variables

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:50 +00:00
Guilherme Gallo
76922f8404 ci/lava: Create LAVAJobDefinition
To absorb complexity from the building blocks to generate job
definitions for each mode:
- fastboot-uart
- uboot-uart
- uboot-ssh

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:50 +00:00
Guilherme Gallo
77c3091fdd ci/lava: Refactor UART definition building blocks
Break it to smaller pieces with variable size (fastboot has 3 deploy
actions and uboot only one) to build the base definition nicely in the
end.

Extract kernel/dtb attachment and init_stage1 extraction into functions
to be later reused by SSH job definition.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:50 +00:00
Guilherme Gallo
af9273eb4f ci/lava: Fix imports formatting
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:50 +00:00
Guilherme Gallo
f7f2d26e3b ci/lava: Use project_name instead of hardcoded mesa
The LAVA job submitter is being used by other fd.o projects, such as
`drm/ci`, so let's make it generate more generic job definitions and
test cases.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25912>
2023-11-02 03:31:49 +00:00
Mark Janes
a1e6879021 anv: make shader cache content deterministic
Pointer values in shader cache data generate binary differences for
functionally identical shader content.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25923>
2023-11-02 02:53:41 +00:00
Mark Janes
f0f0bce314 iris: make shader cache content deterministic
Pointer values in shader cache data generate binary differences for
functionally identical shader content.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25923>
2023-11-02 02:53:41 +00:00
Felix DeGrood
aa23120e4f anv: remove CS_FLUSH from query regression
Fixes performance regression introduced by prior refactoring of
pipe control code that unnecessarily added CS_FLUSH to query start
and end. Issue was diagnosed by Ben L (thank you!)

Confirmed this restores performance on:
* Borderlands3 +2%
* Payday +3%
* Factorio +3%
* HogwartsLegacy +4%
* Ghostrunner +7%

Fixes: 6dc95685 (convert genX_query pipe controls to use pc helper)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25983>
2023-11-02 02:28:02 +00:00
David Heidelberg
4ddfc4503d ci: fixup section names
Copy-paste typo + missed section_end update.

Fixes: 2815e5c94d ("ci: hide Mesa install phase")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25982>
2023-11-02 00:32:49 +00:00
David Heidelberg
ab6ef87720 ci/zink: restore full premerge testing on Adreno 618
Partial revert of: 68e8e40163 ("ci/zink: reduce premerge testing on a618 to ~ 12 minutes")

Weston is kept, and reduction to the 2 devices, because we have only 9
at maximum capacity available (with 3 parallel jobs we would need at least 10).

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25982>
2023-11-02 00:32:49 +00:00
Faith Ekstrand
6388896985 nir: add deref follower builder for casts.
This fixes intel_clc builds with llvm 17 on gfx125_bvh_build_DFS_DFS
where it dies in the lower indirect derefs pass.

Co-authored-by: Dave Airlie <airlied@redhat.com>
Fixes: 4a4e175738 ("nir: Support deref instructions in lower_var_copies")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25536>
2023-11-01 22:35:23 +00:00
Jesse Natalie
8f9888fd75 dzn: Implement VK_MSFT_layered_driver
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25993>
2023-11-01 22:17:16 +00:00
Max R
fdb58f5b6c ci: Uprev virglrenderer
Include the latest virglrenderer version.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25947>
2023-11-01 20:33:01 +00:00
Max R
75f7910850 virgl: Implement clear_render_target and clear_depth_stencil
This functions are required by d3d10umd frontend.
To implement both clear_render_target and clear_depth_stencil
common virgl command VIRGL_CCMD_CLEAR_SURFACE is introduced.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25947>
2023-11-01 20:33:01 +00:00
Chia-I Wu
796cba9bda radv: fix vkCmdCopyImage2 for emulated etc2/astc
When the image copy is between size-compatible formats with different
block sizes, we need to fix up the extent.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25984>
2023-11-01 20:02:14 +00:00
Rhys Perry
b18f0dec41 aco: collect Pre-Sched SGPRs/VGPRs before spilling
The usage after spilling is usually either the same as before or the
maximum.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25559>
2023-11-01 19:41:30 +00:00
Rhys Perry
d200916ca2 aco: add VALU/SALU/VMEM/SMEM statistics
This lets us measure optimizations without interference of waitcnt
instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25559>
2023-11-01 19:41:30 +00:00
Jesse Natalie
0756324ca4 d3d12: Only set draw params root parameter index for actual draw params
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25980>
2023-11-01 17:25:25 +00:00
Gert Wollny
3ab51c7ebd r600: Add callbacks for get_driver_uuid and get_device_uuid
v2: Evaluate driver ID dynamically (Adam Jackson)
v3: Align the stars (Triang3l)
v4: include "r600" in driver ID for UUID evaluation (Triang3l)
v5: remove unused local variable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10040
CC: mesa-stable

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25895>
2023-11-01 16:36:42 +00:00
Rhys Perry
7de34ad3ef radv: use NIR_LOOP_PASS helpers
A somewhat random collection of fossils:
    N           Min           Max        Median           Avg        Stddev
x   6         16.59         16.61        16.605     16.603333  0.0081649658
+   6         15.99            16            16     15.998333  0.0040824829
Difference at 95.0% confidence
	-0.605 +/- 0.00830327
	-3.64385% +/- 0.0485573%
	(Student's t, pooled s = 0.00645497)

I'm not sure if nir_opt_if and nir_opt_loop_unroll are actually idempotent
or not.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24197>
2023-11-01 14:16:37 +00:00
Rhys Perry
debddca134 nir: add helpers to skip idempotent passes
For example, in the loop:
while (more_late_algebraic) {
   more_late_algebraic = false;
   NIR_PASS(more_late_algebraic, nir, nir_opt_algebraic_late);
   NIR_PASS(_, nir, nir_opt_constant_folding);
   NIR_PASS(_, nir, nir_copy_prop);
   NIR_PASS(_, nir, nir_opt_dce);
   NIR_PASS(_, nir, nir_opt_cse);
}
if nir_opt_algebraic_late makes no progress, later passes might be
skippable depending on which ones made progress in the previous iteration.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24197>
2023-11-01 14:16:37 +00:00
Tapani Pälli
faed5d647f iris: handle tile case where cso width, height is zero
Patch adds a fallback to calculate_tile_dimensions if such case is hit,
this happened when running CTS tests on simulation.

Fixes: d13c81a2c3 ("iris/xehp: Implement TBIMR tile pass setup and pipeline bandwidth estimation.")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25989>
2023-11-01 13:48:59 +00:00
Timur Kristóf
a19e46f5d0 radv: Implement workaround for unaligned buffer/image copies.
When the pitch or slice pitch isn't properly aligned,
the SDMA HW is unable to copy between tiled images and buffers.

To work around this, we process the image chunk by chunk,
copying the data to a temporary buffer which uses supported
pitches, and then copy it to the intended destination.

The implementation assumes that at least one pixel row of the
image will fit into the temporary buffer, and will try to copy
as many rows at once as possible. Sadly, this still results in
a lot of packets being generated for large images.

A possibe future improvement is to copy the image slice by slice
when only the slice pitch is misaligned. However, that is out
of scope for this commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25831>
2023-11-01 13:21:01 +00:00
Timur Kristóf
ec0605ff72 radv: Add temporary BO for transfer queues.
Some copy operations are poorly supported by the SDMA hardware,
meaning that the built-in packets don't support them, so we will
need to work around that by copying to and from a temporary BO.

The size of the temporary buffer was chosen so that it can fit
at least one full pixel row of the largest possible image.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25831>
2023-11-01 13:21:01 +00:00
Timur Kristóf
8156c923ee radv: Implement buffer/image copies on transfer queues.
Previously, RADV only had a simple implementation of
image to buffer copies using the SDMA for the PRIME copy.

This commit replaces that with a full-featured implementation
that includes buffer to image and image to buffer copies and
removes the assumptions that the PRIME copy had, as well as
adds new helper functions which will be shared with other copy
functions in upcoming commits.

Unaligned buffer/image copies require a workaround, which
will be implemented by a future commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25831>
2023-11-01 13:21:01 +00:00
Timur Kristóf
ed21f1c962 radv: Expose radv_get_dcc_max_uncompressed_block_size function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25831>
2023-11-01 13:21:01 +00:00
Timur Kristóf
848f2f2b99 radv: Remove always false tmz variables from SDMA functions.
We can re-add them later as-needed.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25831>
2023-11-01 13:21:00 +00:00
Samuel Pitoiset
17daa08dff radv: emit COMPUTE_PIPELINESTAT_ENABLE for CS invocations on ACE
This register seems needed to enable compute shader shader invocations
on GFX7. On GFX8+ it's working fine without emitting this register but
I think it doesn't hurt.

This fixes dEQP-VK.query_pool.statistics_query.*_cq on GFX7.

Fixes: a9945216ba ("radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25957>
2023-11-01 12:46:17 +00:00
Samuel Pitoiset
9a0a77cb53 radv: fix compute shader invocations query on compute queue on GFX6
Looks like GFX6 always writes the number of compute shader invocations
at offset 0 when used on compute queue.

This fixes dEQP-VK.query_pool.statistics_query.*_cq on GFX6.

Fixes: a9945216ba ("radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25957>
2023-11-01 12:46:17 +00:00
Samuel Pitoiset
46dc02354a radv: adjust binning settings to improve performance on GFX9
This partially reverts 74ab940156 which
was a fix for random GPU hangs with binning on GFX10+. Though,
according to RadeonSI, only GFX10+ is affected and this reduced perf
on GFX9 chips.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25951>
2023-11-01 12:24:45 +00:00
Samuel Pitoiset
e4a1bc70dd radv: bind the non-dynamic graphics state from the pipeline unconditionally
The following sequence is valid (although weird) but many other drivers
(including RADV) were broken:
    - bind pipeline with some static state
    - set state command for that static state (to a bad value)
    - bind the same pipeline again
    - draw

Fixes new dEQP-VK.dynamic_state.*.double_static_bind.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25954>
2023-11-01 09:44:13 +00:00
Sarah Walker
4e912c972b pvr: Update AM62 DSS compatible string to match upstream
Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25978>
2023-11-01 09:23:25 +00:00
Samuel Pitoiset
024dab650e radv/ci: enable RADV_DEBUG=nomeshshader for vkcts-navi31-valve
To make VKCTS on NAVI31 stable until the task shader issue is
resolved.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25969>
2023-11-01 08:50:06 +01:00
Samuel Pitoiset
a97160cad8 radv: add RADV_DEBUG=nomeshshader
This option will be used to disable VK_EXT_mesh_shader in Mesa CI
for GFX11 because running task shader tests in parallel can hang the
GPU.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10051
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25969>
2023-11-01 08:49:35 +01:00
Samuel Pitoiset
15f92c3b2c radv/ci: update list of expected failures/flakes for NAVI31
Let's clean the flakes list, it might be needed to re-add some of them
but we will track those.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25969>
2023-11-01 08:49:35 +01:00
Bas Nieuwenhuizen
da7e6f303b radv: Add some initial graphics DGC preprocessing support.
Just the bits that obviously need no adjustment in the DGC
preprocessing code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25835>
2023-11-01 00:06:10 +00:00
Bas Nieuwenhuizen
c4fb827441 radv: Add compute DGC preprocessing support.
This should reduce the overhead due to reduced syncs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25835>
2023-11-01 00:06:10 +00:00
Bas Nieuwenhuizen
108227a84e radv: Add DGC preprocessing barrier support.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25835>
2023-11-01 00:06:09 +00:00
Karol Herbst
f7830240ac rusticl/mesa/screen: do not derefence the entire pipe_screen struct
Apparently the dereferences made tsan report data races on the pipe_screen
object.

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25944>
2023-10-31 22:09:56 +00:00
Casey Bowman
71064879d1 anv: Override vendorID for Diablo IV
Another case of a game assuming XeSS is available since an
Intel ARC GPU is discovered by the game's executable binary.

With this, a warning will appear that GPU is unstable/not supported,
but a warning is preferable over the game crashing.

No other issues observed upon starting & playing the game.

Signed-off-by: Casey Bowman <casey.g.bowman@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25965>
2023-10-31 21:32:48 +00:00
Vitaliy Triang3l Kuzmin
03705f37bf r600: Replace TGSI I/O semantics with shader_enums
Removes the link-time dependency on tgsi_get_gl_varying_semantic from
Gallium auxiliary.

ps_prim_id_input linkage removed due to redundancy - the SPI SID is
calculated for VARYING_SLOT_PRIMITIVE_ID on both sides.

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
29c544abc0 r600: Fix outputs typo in print_pipe_info
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
5419f52967 r600/sfn: Split r600_shader_from_nir into common and Gallium parts
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
c78aa6a417 r600/sfn: Make r600 header include paths relative
Fixes building SFN without the R600 Gallium driver in the #include paths

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
03d102f576 r600: Split r600_shader.h into common and Gallium parts
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
bcb34884c2 r600: Remove Gallium dependencies in r600_asm
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
b7e5a8b5ca r600: Replace R600_ERR with R600_ASM_ERR in shader code
Doesn't depend on r600_pipe, thus usable outside Gallium

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
10ef3b7fe3 r600: Remove Gallium dependencies in r600_isa
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Vitaliy Triang3l Kuzmin
564b972196 r600: Move r600_create_vertex_fetch_shader to r600_shader.c
For r600_asm to be usable outside Gallium

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
2023-10-31 21:15:27 +00:00
Rob Clark
5521840cbc ci: Only strip debug symbols
Hopefully this will get us more useful backtraces in CI (for ex, with
traces replay) while maintaining _most_ of the artifact size benefits of
stripping:

  -rwxr-xr-x 1 robclark robclark  50M Oct 30 11:47 msm_dri.so.strip-debug
  -rwxr-xr-x 1 robclark robclark  40M Oct 30 11:47 msm_dri.so.strip
  -rwxr-xr-x 1 robclark robclark 129M Oct 30 11:47 msm_dri.so.orig

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25962>
2023-10-31 20:13:30 +00:00
Giancarlo Devich
7d0ae38ef7 nir: Workaround MSVC internal compiler error in ARM64 build
Changes a variable type from `nir_component_mask_t` to `uint32_t`. The
variable's name suggests it may have been meant to be a 32-bit integer
anyway.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25691>
2023-10-31 19:33:40 +00:00
Jesse Natalie
97553affc6 microsoft: Disable post-merge CI for Windows
Addresses part of https://gitlab.freedesktop.org/mesa/mesa/-/issues/10072

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25976>
2023-10-31 19:10:30 +00:00
Frank Binns
122ed7cd80 pvr: rename some more instances of 'reserved' to 'carveout' for consistency
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25910>
2023-10-31 15:50:27 +00:00
Eric Engestrom
f2dfb0f6ee broadcom: use .never-post-merge-rules for all rpi tests
We never want to re-run these tests after merging an MR; this is
entirely unnecessary and a 2x waste of resources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25960>
2023-10-31 14:42:54 +00:00
Eric Engestrom
163c6fe4c4 ci: add .never-post-merge-rules to avoid re-running pre-merge jobs after merging
This is entirely unnecessary and a 2x waste of resources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25960>
2023-10-31 14:42:54 +00:00
Gert Wollny
4cdd094ae1 virgl: Use host reported limits for max outputs
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24136>
2023-10-31 13:03:29 +00:00
Alejandro Piñeiro
c24a635d1c broadcom/compiler: add v3d_pack_unnormalized_coordinates helper
So far we were packing by hand unnormalized coordinates at the
V3D41_TMU_CONFIG_PARAMETER_1 pack structure. To get this working we
hardcoded V3D_VERSION to 41 at v3dv_uniforms, that works for v71
because the structure are the same. But that is somewhat ugly, and
will not work if a new hw generation have a different structure.

Additionally, we found that for v3d this will be also needed.

So this commit adds a helper on the compiler. For now, and to simplify
it also use just one method for both generations. This solves the
problem of the same code needed on both v3d and v3dv.

But the idea is that in the future we need a similar need, but the
structure different on each generation, it would have used a similar
approach to other generation dependent function calls (like
v3d40_vir_emit_tex), having the implementation on a source file that
can safely include the hw generation headers.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25544>
2023-10-31 13:00:34 +01:00
David Heidelberg
5e4ba9b166 ci/lava: add wine into the amd64 ephemeral container packages
We don't have to install DXVK in chroot.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
81aaeb80f7 Revert "ci/wine: move wine configuration into rootfs where is wine available"
This reverts commit 63b42e4007fec8746f7a3848b3816d36124dcbfd.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
1e13c7ca46 ci/wine: move wine configuration into rootfs where is wine available
As we removed wine from builds, we need to use the one installed in rootfs.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
35c7b5e159 ci/alpine: do not store apk cache
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
3669ca159f ci/venus: reduce pre-merge to fit under 15 min
Currently the run takes ~ 35 minutes, which is too much.

Reported-by: default avatarDaniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
f6dd808d68 ci/panfrost: run T860 traces as intended (nightly job)
Also split extends from the HW definitions.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
17d6baff82 ci: drop debootstrap, unused
Most likely was historically used there, but not recently.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
e4d6da5ba3 ci: bashify scripts, use arrays
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
e678483ecd ci: always cleanup pip and cargo leftovers
This is leftovers from the compilation/installation phase.

In the build containers this took around ~ 400 MB.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
c6928a4e6e ci: drop mingw and wine from the x86_64 build container
MinGW is currently disabled and new implementation will handle things
differently anyway.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
ef217a9221 ci: simplify debian-rusticl-testing definition
This was originally split due testing both rusticl and clover.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
1f2b50fbc2 ci: drop clover from release builds and remove rusticl build
Let's hope we don't see Clover in next release.

For rusticl, drop debian-rusticl and keep the debian-rusticl-testing.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
2815e5c94d ci: hide Mesa install phase
So far we show installation part together with meson tests.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
68e8e40163 ci/zink: reduce premerge testing on a618 to ~ 12 minutes
Currently is run around 20 minutes.

Except this, also use Weston (more likely use for zink+a618)
as an effort to stop testing X11 bugs instead of Mesa.

Rest will get covered by nightly job.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
David Heidelberg
fa7ca1f70a ci: bump tags
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
Kenneth Graunke
fddad4d5f9 intel/compiler: Assert that FS_OPCODE_[REP_]FB_WRITE is for pre-Gfx7
We use SHADER_OPCODE_SEND directly instead of FS_OPCODE_FB_WRITE (for a
while now) and FS_OPCODE_REP_FB_WRITE (since the previous commit).

Assert that it isn't used on Gfx7+.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>
2023-10-30 23:03:23 +00:00
Kenneth Graunke
48f60f4c4b intel/compiler: Convert the repclear shader to use send-from-GRF
Sandybridge uses this code and needs MRFs, but all other platforms send
from GRFs.  Do that directly rather than relying on the MRF hack.

Ivybridge and later also use SHADER_OPCODE_SEND directly rather than
a virtual opcode that's handled in the generator, so we follow suit.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>
2023-10-30 23:03:23 +00:00
Kenneth Graunke
ef7d1b5f44 intel/compiler: Drop unused saturate handling in repclear shader
We never set key->clamp_fragment_color when compiling the BLORP fast
clear shaders.  Besides, we were setting saturate on an FB write opcode,
which...isn't even a thing.  We would need it on the MOV, and weren't
setting it there.  So it wouldn't have even worked.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>
2023-10-30 23:03:23 +00:00
Kenneth Graunke
e6d9267d4f intel/compiler: Delete repclear shader's special case for 1 color target
This is basically just once through the loop but copy and pasted.  One
difference is that the single render target case used a headerless
message, and the multiple render target case always used headers.

Now we use headerless messages for the first render target, even in the
multiple render target case.  While we already have it set up for the
other RTs, it's still 2 fewer registers to send.  Minor improvement.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>
2023-10-30 23:03:23 +00:00
Kenneth Graunke
e6460fe66b intel/compiler: Delete unused repclear shader uniform handling
A long time ago, we used a uniform for the clear color.  Back in 2014,
we added support for using a flat input instead, as this was easier for
Vulkan, but we left the option of using a uniform for OpenGL.

Eventually nobody used the uniform approach anymore, but the compiler
code to handle it remained.  Drop the dead code.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>
2023-10-30 23:03:23 +00:00
Kenneth Graunke
b35f1fc910 intel/compiler: Delete unused emit_dummy_fs()
This code is compiled out, but has been left in place in case we wanted
to use it for debugging something.  In the olden days, we'd use it for
platform enabling.  I can't think of the last time we did that, though.

I also used to use it for debugging.  If something was misrendering, I'd
iterate through shaders 0..N, replacing them with "draw hot pink" until
whatever shader was drawing the bad stuff was brightly illuminated.
Once it was identified, I'd start investigating that shader.

These days, we have frameretrace and renderdoc which are like, actual
tools that let you highlight draws and replace shaders.  So we don't
need to resort iterative driver hacks anymore.  Again, I can't think of
the last time I actually did that.

So, this code is basically just dead.  And it's using legacy MRF paths,
which we could update...or we could just delete it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>
2023-10-30 23:03:23 +00:00
Juston Li
5b24ab91e4 venus: switch to unconditionally deferred query feedback
All commands that make queries available have feedback cmds batched
and stored during recording. At submission time, for each batch
(SubmitInfo) these feedback cmds are recorded in a cmd buffer that is
appended after the last original cmd buffer (but before
semaphore/fence feedback).

Query reset cmds are deferred as well and also remove any prior feedback
cmds for queries its resetting within the batch.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
7fbf608f2d venus: append query feedback at submission time
Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
d2a626787e venus: track/recycle appended query feedback cmds
Link the query feedback cmd lifecycle to a cmd in the batch so that when
that last cmd gets reset/freed, we assert its safe to reset the query
feedback cmd. The cmd is then placed on the free list for reuse.

Some edge cases if the the last cmd is simultaneous or gets resubmitted.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
6dcf033dc3 venus: support deferred query feedback recording
Add function to alloc a cmd buffer and record all the deferred query
feedback cmds into it at submission time.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
99807b3db6 venus: refactor out common cmd feedback functions
defered query feedback cmds have similaries with timeline semaphore
feedback so refactor out some common functions for reuse

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
2ea6f935ce venus: add helper function to get cmd handle
rename previous vn_get_cmd_handle as that was getting cmd
handles from the temp storage cmd_handle buffer.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
David Heidelberg
180cb30986 ci/docs: add coreutils
Needed for correct GitLab CI `date` variable parsing.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10041
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25917>
2023-10-30 19:16:19 +00:00
Lionel Landwerlin
cdca0b2ce4 anv: fix corner case of mutable descriptor pool creation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 63e91148b7 ("anv: Enable VK_VALVE_mutable_descriptor_type")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10065
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25958>
2023-10-30 18:29:46 +00:00
Eric Engestrom
fac60c140b ci: don't run sanity in Marge pipelines
This check is intended for the MR author; for everyone else, there's
nothing they can do if the job fails so it's pointless to run it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25920>
2023-10-30 17:50:56 +00:00
Eric Engestrom
49395b4aa4 docs/ci: allow sanity job to be missing
The rules of both jobs never matched, so there was always the potential
for the job to be missing, but it's about to get worse with the next
commit, so fix that now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25920>
2023-10-30 17:50:56 +00:00
Eric Engestrom
3f64b12c1e ci: drop confusing fake rules, if and when on the list of rules strings
These are not real rules, they are just strings that have an anchor that
can be referenced elsewhere in this file.

Having these fake bits in here is confusing, as revealed by the
reactions from the first version of this commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25920>
2023-10-30 17:50:55 +00:00
Eric Engestrom
9669334b41 ci/zink+radv: add another flake on polaris
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25959>
2023-10-30 17:19:26 +00:00
Lionel Landwerlin
e64a97694a anv: use anv_state_pool_state_address for blorp vertex buffer address
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
Lionel Landwerlin
8d813a90d6 anv: fail pool allocation when over the maximal size
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
Lionel Landwerlin
8fc42d83be anv: make sure pools can handle more than 2Gb
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
Lionel Landwerlin
cc67bd48d9 anv: add max_size argument for block & state pools
Not enforced yet.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
Lionel Landwerlin
b30428416a anv: deal with state stream allocation failures
In case we run out of space, all the parts of the driver that rely on
this should deal with failure. The helpers will set the batch in error
state so that it cannot be submitted by the application.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
Lionel Landwerlin
ed83d1415c anv: rename internal heaps
Some of the names are a bit confusing. The main change is to introduce
the "indirect_" prefix.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
Lionel Landwerlin
f9753488ec blorp: handle binding table & surface state allocation failures
The embedding driver could be failing the allocation for whatever
reason, in which case we should skip the surface state writes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25955>
2023-10-30 14:47:18 +00:00
LingMan
1cc26e8b66 rusticl: Show an error message if the build is attempted with an outdated bindgen version
Ideally the build system would fetch the correct bindgen version automatically like cargo does.
Until then, provide an error message that is hopefully more helpful than whatever cryptic error the
build runs into otherwise.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9457
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10029
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25859>
2023-10-30 13:12:51 +00:00
Erik Faye-Lund
e350193eb5 util: remove unused lut
This was added in 153c714f2a ("util: add softfloat functions to
operate with doubles and floats"), but never used. Let's just drop it.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25746>
2023-10-30 12:35:07 +00:00
Tapani Pälli
2833d1ade1 intel/dev: fix intel_device_info_is_adln check
We cannot compare pointer, patch adds is_adl_n to devinfo for detection.

Fixes: 3cf71ddfac ("intel/dev: provide intel_device_info_is_adln helper")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25934>
2023-10-30 11:20:41 +00:00
Jordan Justen
9bd47aabaf anv: Add more space for init_render_queue_state() batch (MTL regression)
It may be some MTL specific code paths, but 7cdacaf493 is triggering
anvil to run out of space when initializing the render batch.

Fixes: 7cdacaf493 ("intel/xehp: Adjust TBIMR performance chicken bits.")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25949>
2023-10-30 10:05:10 +00:00
Danylo Piliaiev
117f81585e tu/a6xx: Exclude REG_A6XX_TPL1_UNKNOWN_B602 from reg stomping
Not used on A6XX but causes failures when set

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25918>
2023-10-30 09:39:21 +00:00
Danylo Piliaiev
069797c708 tu/a7xx: Zero out A7XX_VPC_PRIMITIVE_CNTL_0 in 3d blits
Same as we are doing with A6XX_PC_PRIMITIVE_CNTL_0.
No issues were seen but it should be a right thing to do.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25918>
2023-10-30 09:39:21 +00:00
Danylo Piliaiev
cdbb8b5412 tu: Fix reading of stale (V)PC_PRIMITIVE_CNTL_0
PC_PRIMITIVE_CNTL_0 is not set in a draw state and may be changed
by 3d blits, so we have to re-emit it a the start of a renderpass.

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

Fixes: 7be8d0f7f4
("tu: Use common dirty tracking for PC_PRIMITIVE_CNTL_0")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25918>
2023-10-30 09:39:21 +00:00
Samuel Pitoiset
0477346c0b aco: remove dead code in nir_intrinsic_xfb_counter_{add,sub}_amd
This code path is only used by GFX11 now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25903>
2023-10-30 08:51:51 +00:00
Samuel Pitoiset
d390cd7c5d ac/nir: remove dead code in nir_intrinsic_xfb_counter_{add,sub}_amd
This code path is only used by GFX11 now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25903>
2023-10-30 08:51:51 +00:00
Samuel Pitoiset
5176f75e0d radv: remove unnecessary VS_PARTIAL_FLUSH for NGG streamout
This used to be a PS_PARTIAL_FLUSH to fix synchronization issues with
NGG streamout on RDNA2 but it's no longer needed for RDNA3. It's
already synchronized in CmdEndTransformFeedbackEXT().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25903>
2023-10-30 08:51:51 +00:00
Samuel Pitoiset
eb47e07782 radv: remove NGG streamout support for RDNA1-2
This was useful for experimenting it on RDNA2 and during RNDA3 bringup,
but now the support is rock solid on RDNA3 and it's useless to keep the
RADV_PERFTEST=ngg_streamout option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25903>
2023-10-30 08:51:51 +00:00
Samuel Pitoiset
7beddd4f5c radv: use the GPUVM fault protection status helper
To print more useful information when a fault happens.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25855>
2023-10-30 08:10:23 +00:00
Samuel Pitoiset
e18c4bca31 ac/debug: add a helper to print GPUVM fault protection status
This basically prints the same info as dmesg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25855>
2023-10-30 08:10:22 +00:00
Samuel Pitoiset
bc09932ec3 ac/registers: allow to parse GCVM_L2_PROTECTION_FAULT_STATUS
To have defined bitfields for this register.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25855>
2023-10-30 08:10:22 +00:00
Samuel Pitoiset
7d96fe853e radv: fix a synchronization issue with primitives generated query on RDNA1-2
Only RDNA1-2 are affected because RADV needs to handle the legacy vs
NGG path for this query, and the NGG results are stored with 2 extra
64-bit values.

Fixes flakes with
dEQP-VK.transform_feedback.primitives_generated_query.* since VKCTS
1.3.7.0.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25862>
2023-10-30 07:33:06 +00:00
Iago Toral Quiroga
82bef62c17 v3d,v3dv: fix MMU error from hardware prefetch after ldunifa
ldunifa works exactly the same as ldunif: the hw will prefetch the
next 4 bytes after a read, so if a buffer is exactly a multiple of
a page size and a shader uses ldunifa to read exactly the last 4 bytes
the prefetch will read out of bounds and spam the error on the kernel
log. Avoid that by allocating extra bytes in this scenario.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25752>
2023-10-30 08:14:05 +01:00
Etaash Mathamsetty
830018abfa driconf: add a workaround for Rainbow Six Siege
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25734>
2023-10-30 06:05:17 +00:00
Julia Zhang
78edaa2a9a radeonsi: modify binning settings to improve performance
Existing binning settings which are required for gfx10.3 and newer cause
performance drop. Keep existing settings for gfx10.3 and newer version
and follow previous rules to set values for gfx9 to improve performance
of gfx9.

Signed-off-by: Julia Zhang <julia.zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25933>
2023-10-30 12:02:53 +08:00
Karol Herbst
4f892ecc1e zink: emit MemoryAccess flags for coherent global load/stores
Makes global load/stores coherent on a device level if requested by the
shader.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:55 +02:00
Karol Herbst
2f34a1db58 zink: deallocate global_bindings array
Fixes: a6e9e0f0d7 ("zink: add set_global_binding")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:55 +02:00
Karol Herbst
6afa1b3bad zink: handle denorm preserve execution modes
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:55 +02:00
Karol Herbst
049af04341 zink: validate pointer alignment in resource_from_user_memory
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:55 +02:00
Karol Herbst
5e3b7bef1e rusticl: handle failed maps gracefully
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:55 +02:00
Karol Herbst
7f08036abc rusticl/mesa: pass PIPE_BIND_LINEAR in resource_create_texture_from_user
Host pointer allocations are all linear laid out, so just tell the drivers
in case they don't assume this implicitly.

Fixes: 71a9af4910 ("rusticl/mem: support read/write/copy ops for images")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:28 +02:00
Karol Herbst
398fadf1cf rusticl/device: restrict const max size to 1 << 26 bytes
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25937>
2023-10-28 14:38:25 +02:00
Yiwei Zhang
38deb97d10 venus: use vk_device_memory tracked memory_type_index
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
99b716c64d venus: use vk_device_memory tracked size
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
73267e38c9 venus: use vk_device_memory tracked export and import handle types
Meanwhile, we merge the export and non-external allocate paths since
export alloc will be rejected by vn_device_memory_should_suballocate.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
a47992734a venus: use common AHB management and export impl
vk_device_memory_create handles AHB export alloc and import tracking.
Also use common GetMemoryAndroidHardwareBufferANDROID impl.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
6418a93510 venus: use common vk_device_memory as vn_device_memory base
This change only updates the handle object creation to use common vk
device memory.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
35a3a6338f venus: use common vk_image as vn_image base
This change only switches the object base, and is to prepare for using
vk_alloc_ahardware_buffer. Large refactor via leveraging existing common
vk_image state tracking will be followed.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
a8b2cfe877 venus: avoid modifier prop query in vn_android_get_image_builder
AHB prop query would check the memory plane count match instead. This
reduces vn_android_get_image_builder overhead and simplifies the AHB
import api to prepare for later common vk ahb adoption.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
7b76e1f62c venus: tiny refactor of device memory report interface
Pass type and handle directly instead of vn_object_base to prepare for
device level objects using corresponding common vk objects.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
bf0a5ebca8 venus: use common vk_image_usage_to_ahb_usage helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
1547cf137e venus: use common vk_image_format_to_ahb_format helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Marek Olšák
276b9b13cf radeonsi: initialize perfetto in the right place
Compute contexts don't execute the second half of the function.

Fixes: a164e147e9 - radeonsi: Add perfetto support in radeonsi
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10043

Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25873>
2023-10-27 23:03:04 +00:00
Francisco Jerez
57decad976 intel/xehp: Enable TBIMR by default.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:50:42 -07:00
Francisco Jerez
ed9886321c intel/xehp+: Use TBIMR tile box check in order to avoid performance regressions.
This allows the hardware to behave as if TBIMR was disabled until a
polygon is processed which spans at least one tile.  This is a rather
heavy-handed heuristic meant to prevent regressions in heavily
geometry-bound workloads that render large numbers of tiny primitives
much smaller than a TBIMR tile.

A particularly bad example of this was observed in SoTR, where certain
draw calls with a long-running VS and a mostly trivial PS render more
triangles than pixels, filling up the URB and TBIMR batch pretty
quickly, which causes EU utilization to tank (since once the URB has
filled up the parallelism of the VS is limited by the number of
polygons that fit in a TBIMR batch at the completion of each tile
walk, which isn't a lot in relation to the total EU count of a DG2),
and causes the bottleneck to be the rate at which the tile sequencer
performs additional tile passes, each one processing a small number
(<1024 polygons) of the hundreds of thousands of triangles of the
draw call.

Enabling this heuristic seems effective at avoiding that scenario in
SoTR among other titles (e.g. Total War Warhammer 3), but it's a bit
of a compromise since one could imagine cases where TBIMR is helpful
even if the geometry doesn't pass the box check, so a better heuristic
or a driconf rule may be useful in the future.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:50:42 -07:00
Francisco Jerez
f0d24b155b intel/xehp+: Adjust TBIMR batch size based on slice count.
This programs a TBIMR batch size equal to 128 polygons per slice in
order to match the hardware spec recommendation (BSpec 68436).  This
has been confirmed to improve performance slightly relative to the
hardware default batch size of 256 polygons.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:50:42 -07:00
Francisco Jerez
7cdacaf493 intel/xehp: Adjust TBIMR performance chicken bits.
This enables a couple of TBIMR performance tunables in
CHICKEN_RASTER_2 that default to disabled.  TBIMR fast clip appears to
help slightly with some geometry-bound workloads.  TBIMR open batch
allows the rasterizer to start working immediately on the first tile
of the framebuffer, even before the batch has been closed, which helps
reduce the latency cost of the tile walk.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:50:42 -07:00
Francisco Jerez
08fd259b5b anv/xehp+: Enable TBIMR in generated draw calls.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:50:42 -07:00
Francisco Jerez
65bbe58b25 anv/xehp: Implement TBIMR tile pass setup and pipeline bandwidth estimation.
This sets up the basic parameters needed for tiled rendering based on
a back-of-the-envelope estimate of the amount of memory used by the
pixel pipeline during the tile pass.  The actual cache footprint of a
tile can vary wildly based on runtime factors which aren't easily
predictable based on static analysis, so this is only intended to
provide a rough approximation within the right order of magnitude.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:50:42 -07:00
Francisco Jerez
d13c81a2c3 iris/xehp: Implement TBIMR tile pass setup and pipeline bandwidth estimation.
This sets up the basic parameters needed for tiled rendering based on
a back-of-the-envelope estimate of the amount of memory used by the
pixel pipeline during the tile pass.  The actual cache footprint of a
tile can vary wildly based on runtime factors which aren't easily
predictable based on static analysis, so this is only intended to
provide a rough approximation within the right order of magnitude.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:29 -07:00
Francisco Jerez
694d64188b intel/xehp+: Define driconf option for selectively disabling TBIMR.
This may help debugging performance problems in the possible case that
TBIMR negatively impacts the performance of some application.  It could
also allow applying application-specific band-aid fixes in the XML file
until a more general workaround is implemented.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:29 -07:00
Francisco Jerez
da28582eec intel/xehp+: Add dynamic state flags controlling whether TBIMR is enabled during 3D primitives.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:29 -07:00
Francisco Jerez
622c2498d4 intel/xehp+: Import algorithm for TBIMR tiling parameter calculation.
This implements a minimalistic algorithm that can be used to obtain an
approximate solution for the integer programming problem of finding
the optimal tile dimensions based on an estimate of the tile cache
consumption per pixel of the current graphics pipeline -- Including
the TC footprint of render targets, depth and stencil buffers and
their auxiliary surfaces.  Considering other (less local) memory
accesses performed by the pipeline (like texturing and shader storage)
would be useful (and could be considered by this algorithm with little
modification), but it would be pretty difficult to estimate the L3
cache consumption per pixel of such accesses based on static analysis
of the pipeline state alone without some sort of dynamic feedback.

The present algorithm returns a config with tile area large enough to
utilize a target fraction of the L3, which can be adjusted to obtain
greater/lower utilization of the L3 at the cost of higher/lower risk
of L3 cache thrashing respectively.  The aspect ratio of the tile
layout returned attempts to minimize the number of poorly utilized
tiles around the boundaries of the framebuffer (due to partial
coverage), since having the tile sequencer process additional tiles
comes at a cost due to the latency of the additional passes, even if
they're mostly empty.  Finally, among the solutions with satisfactory
cache footprint and tile count, the tile aspect ratio closest to 1 is
returned where possible, since tiles with very high aspect ratios can
have a negative impact on cache locality.

The algorithm is primarily intended for TBIMR, but it could be used
for PTBR as well with little modifications, since the TBIMR-specific
assumptions are few and noted in comments below.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:29 -07:00
Francisco Jerez
cec5541b02 intel/xehp+: Add TBIMR-related genxml definitions.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:29 -07:00
Francisco Jerez
3e3fd921ac intel/mtl: Import L3 cache configurations.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Francisco Jerez
468904e833 intel/dg2: Import L3 cache configurations.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Jordan Justen
524996106c intel/l3: Use devinfo->urb.size when cfg urb-size is 0.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Anuj Phogat
ed5ff8f297 intel/l3: Adjust URB weight calculation for gfx12.5+.
Gfx12.5+ devices use special-purpose memory for the URB instead of
requiring a portion of the L3 to be carved out.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Francisco Jerez
6b9583734b intel/l3: Set up L3FullWayAllocationEnable config if ALL partition has over 126 ways.
L3 configurations with an ALL partition of 128 ways per bank or more
cannot be represented with the normal L3ALLOC partitioning mechanism
since the "All L3 client pool" field would overflow, instead the
L3FullWayAllocationEnable bit has to be set, which causes the whole L3
to be used in a unified cache configuration.

That's precisely the configuration we're currently using on recent
platforms, but previously we were relying on the L3 config tables
being empty and the selected L3 configuration being a NULL pointer to
detect this condition.  This is about change, the L3 configuration
structure will be defined for gfx12.5+ platforms since they provide
useful information about the cache hierarchy to the drivers.  Instead
of checking whether the pointer is NULL in order to apply a unified L3
cache configuration, use it when there is a single ALL partition
larger than can be represented via L3ALLOC.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Francisco Jerez
f36027f389 intel/l3: Define helper for obtaining the size of an L3 partition in KB.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Francisco Jerez
19e62e8fba intel/l3/gfx11+: Add tile cache partition to intel_l3_config struct.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>
2023-10-27 14:48:28 -07:00
Caio Oliveira
9d73bfc9cd anv: Fix leak when compiling internal kernels
Cc: mesa-stable
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25928>
2023-10-27 18:01:24 +00:00
Mike Blumenkrantz
736577871b zink: check for cbuf0 writes before setting A2C
VUID-vkCmdDrawMultiIndexedEXT-alphaToCoverageEnable-08919 requires
a cbuf0 write for A2C to be active

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25938>
2023-10-27 17:33:31 +00:00
Mike Blumenkrantz
d2abb4f975 zink: make (some) vk allocation commands more robust against vram depletion
as has recently been exposed by ci, there are some cases where running
lots of tests simultaneously can temporarily result in depleted vram,
which torpedos everything

as this scenario is transient (vram will very soon become available again),
it makes more sense to add some retries at fixed intervals to try soldiering
onward instead of exploding and probably blocking a merge

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25938>
2023-10-27 17:33:31 +00:00
Mike Blumenkrantz
c4283e32e3 radv: correctly return oom from the device when failing to create a cs
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25927>
2023-10-27 15:29:32 +00:00
Mike Blumenkrantz
f8909e7d55 zink: add more locking for compute pipelines
if multiple contexts are accessing this all at once then this needs
more locking to avoid unsynchronized cache access

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25929>
2023-10-27 15:06:13 +00:00
Karol Herbst
9a3af6e1d8 rusticl/queue: Only take a weak ref to the last Event
This resolves a memory leak when the application drops its last reference
to the queue, but never waits explicitly.

The problem was, that the queue was refed by QueueState::last and that ref
only gets dropped on a blocking wait. This is problematic as non user
Event objects also hold a ref on the Queue they are created on, therefore
causing a cyclic ref relation.

In order to resolve it, just use a weak reference. A failure of upgrading
the Weak ref is not an issue as in this case we'd only wait on an already
destroyed or processed event. The worker thread already makes sure
everything stays in sync.

Fixes: 5b3ff7e3f3 ("rusticl/queue: overhaul of the queue+event handling")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25926>
2023-10-27 14:47:23 +00:00
Samuel Pitoiset
7ec2544a9b radv: dump the pipeline hash to the gpu hang report
It can be useful to verify that a specific pipeline causes a hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25908>
2023-10-27 12:10:51 +00:00
Alejandro Piñeiro
5cb00f7e77 broadcom/qpu: use back BITFIELD64_RANGE for ANYOPMASK
This is the original definition for ANYOPMASK, until we found that
clang raised a warning using the option shift-count-overflow, so we
used an alternative.

That warning was fixed with commit 6e2bb716b0, so let's restore
previous version.

Note that other good thing of that warning being fixed is that now we
can use without warning OP_RANGE with bit 63 (in the case that any
broadcom opcode used that bit)

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25776>
2023-10-27 11:45:09 +00:00
Karol Herbst
1c619b668d radv: fix buffers in vkGetDescriptorEXT with size not aligned to 4
The range alignment didn't happen through GetDescriptorEXT as it called
write_buffer_descriptor directly. So simply move the align
from write_buffer_descriptor_impl into write_buffer_descriptor.

Fixes: 46e0c77582 ("radv: implement VK_EXT_descriptor_buffer")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
01b6ccccc6 zink: lower fisnormal as it requires the Kernel Cap
I didn't check if it's a valid vulkan SPIR-V opcode and turns out it isn't

Fixes: 82eed326f4 ("zink: support more nir opcodes")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
e3a0df6468 zink: emit float controls
This is required by OpenCL who relies on flushing behavior to match the
runtimes advertized feature, but also later once rusticl does support
denorms, to flush them if applications whish to do so.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
700a2dc648 zink: alias nir scratch memory by lowering to common bit_size
This aliases each access as required by OpenCL. It's up to the vulkan
driver to vectorize to wider loads/stores if possible.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
ab065d9daa zink: support CLAMP_TO_BORDER with unnormalized coords
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
abd8ef84ff rusticl/mem: properly set pipe_image_view::access
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:55 +00:00
Karol Herbst
694001eef7 rusticl/device: restrict param_max_size further
It's kinda pointless to have it too big, it also causes weird shaders to
be generated and causes stack overflows in `nir_opt_gcm`.

Nothing needs big values here anyway.

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:54 +00:00
Karol Herbst
9b6ac56d72 rusticl/device: restrict image_buffer_size
It's pointless to advertise more than CL_DEVICE_MAX_MEM_ALLOC_SIZE and
also the CTS tests against this.

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:54 +00:00
Karol Herbst
d6a48ff402 vtn/opencl: always lower to libclc fmod
The nir/spirv variant is simply not precise enough and almost everybody
lowers it anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25837>
2023-10-27 10:52:54 +00:00
Lionel Landwerlin
7cff4cc9c8 intel/fs: Xe2 fix for ExBSO on UGM
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
BSpec: 56890
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25506>
2023-10-27 10:58:12 +03:00
Juan A. Suarez Romero
b6fbc4e4dd v3d/ci: run V3D GL tests in 64-bits
The recommended OS flavour for RPI4 and onwards is 64 bits, and just
keep the 32 bits for RPI3 and below.

This makes all the V3D testing to be done with 64 bits.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25904>
2023-10-27 06:33:04 +00:00
Yonggang Luo
ce5475366e compiler,vulkan,drm-shim: Remove unused include directories from meson.build
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24462>
2023-10-27 01:35:10 +00:00
Yonggang Luo
73b639ec5c nir: #include "util/macros.h" for BITFIELD64_MASK in nir.c
There is no neeed #include "main/menums.h" in nir.c,
as it's belongs to gallium code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24462>
2023-10-27 01:35:10 +00:00
Mike Blumenkrantz
ee1039877c mesa/st/texture: match width+height for texture downloads of cube textures
some drivers require this

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
df74ea7717 zink: unset explicit_xfb_buffer for non-xfb shaders
this catches duplicated xfb when generated geometry shaders are used

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
87e3720b66 aux/u_transfer_helper: set rendertarget bind for msaa staging resource
this matches other resources created with staging blit-like mechanics

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
694ebe8c72 zink: only emit xfb execution mode for last vertex stage
this is otherwise illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
e8b2680045 zink: clamp resolve extents to src/dst geometry
exceeding src/dst extents is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
009d4a5fda zink: always set VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT for usermem
required by spec

backport-to: 23.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
7035b5a8e8 zink: emit SpvCapabilitySampleRateShading with SampleId
required by spec

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Mike Blumenkrantz
f2fb2df6a3 ci: bump VVL to 1.3.269
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>
2023-10-27 00:44:49 +00:00
Guilherme Gallo
969ede4521 ci/bin: Refactor create_job_needs_dag
The function is getting too big, let's add comments, docstrings to the
most important function, new type hints and extract methods from it to
make it easier to read.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25858>
2023-10-27 00:36:48 +00:00
Guilherme Gallo
4e4743ec0a ci/bin: Do not forget to add early-stage dependencies
In Mesa MR pipelines, we have the sanity job. This job is not an
explicit need for any one job, because only jobs with `- needs: []`
ignores previous jobs. If no `needs` is specified, the job will wait
until all the jobs of earlier stages are finished before starting.

See additional details section at:
https://docs.gitlab.com/ee/ci/yaml/index.html#stage-post

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10032
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25858>
2023-10-27 00:36:48 +00:00
Guilherme Gallo
c7b67d8619 ci/bin: Use iid instead of SHA in gitlab_gql
We were using sha to fetch the pipeline from GraphQL, but that leads to
wrong results when MR and branch pipelines exist. For example,
using pipeline-url as the MR pipeline:
- https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/1017182
This would lead into the branch pipeline:
- https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/1013189

Also simplify the GQL query, it had lots of unused data.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25858>
2023-10-27 00:36:48 +00:00
Faith Ekstrand
49b3118302 nir/lower_bit_size: Use b2b for boolean subgroup ops
Without this, we replace vote_ieq(b) with vote_ieq(u2u32(b)) which is
wonky because we're doing a u2u on a 1-bit type. With this, we now
replace it with vote_ieq(b2b32(b)).  For other subgroup ops, we replace
things like *scan[op](b) with *scan[op](b2b32(b)).  For scan ops, this
assumes that b2b1(op(b1b32(x), b2b32(y))) = op(x, y) for all of the ops
iand, ior, and ixor.  This is true on all the back-ends I'm aware of.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
5014759133 nir: Return b2b ops from nir_type_conversion_op()
Without this, nir_type_conversion_op(bool, bool32, RND) will return
u2u32 instead of b2b32 which is pretty unexpected behavior.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
d5c310899a nir: Split nir_lower_subgroup_options::lower_vote_eq into two bits
On NVIDIA, we can do a vote_ieq on bool in one hardware op so we don't
want that lowered.  We do want to lower vote_feq and other vote_ieq,
though.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
f10d768a88 nir/lower_bit_size: Use u_intN_min/max()
May as well clean it up while we're here.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
5465e5b157 nir/lower_bit_size: Handle vote_feq/ieq separately
They're different enough from all the other subgroup ops so it's best to
handle them as their own case.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
5979e74177 nir/lower_bit_size: Fix subgroup lowering for floats
Using u2u is always correct for integers, including signed integers,
because we're doing a down-cast.  It's wrong for floats, though.

Fixes: f95665cfeb ("nir/lower_bit_size: Add support for lowering subgroup ops")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
16664b74a2 nir: Add a lower_read_first_invocation option to lower_subgroups
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Faith Ekstrand
3d027cca1e nir: Add a lower_first_invocation_to_ballot option to lower_subgroups
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25894>
2023-10-26 23:05:44 +00:00
Mike Blumenkrantz
d1d29d4f40 ci: skip zink vram test
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
9a98d6714d zink: enable unsynchronized texture uploads using staging buffers
by not returning busy for non-HIC unsynchronized texture uploads,
the GL frontend will fall through to directly access the unsynchronized
cmdbuf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
846a5ea224 zink: add locking for batch refs
this is needed to handle unsynchronized access

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
cd08b070a3 zink: add flag to restrict unsynchronized texture access
this is unset any time a texture is accessed and must be explicitly
re-set to preserve unsynchronized access

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
8ee0d6dd71 zink: add a third cmdbuf for unsynchronized (not reordered) ops
this provides functionality for unsynchronized texture uploads without
HIC support by adding a cmdbuf which can only be accessed directly by
the frontend thread

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
8d0eaf97db zink: rework cmdbuf submission to be more extensible
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:26 +00:00
Mike Blumenkrantz
7d0dbdeca2 zink: assert that transfer_dst is available before doing buf2img
the blitter path here was just wishful thinking anyway

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
0b11b41fff zink: barrier_cmdbuf -> reordered_cmdbuf
this is more consistent with the current usage of the cmdbuf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
00206e01a4 zink: handle unsynchronized image maps from tc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
9cc06f817c tc: allow unsynchronized texture_subdata calls where possible
if a texture is provably idle, either by never having been used or
by exhaustively checking usage data, a texture subdata can occur
without any synchronization

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
815ed12e3b tc: use strong refs for fb attachment tracking
this is necessary for unsynchronized texture upload tracking

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
b385fa85db tc: add batch usage tagging to threaded_resource
this allows the tc recorder thread to tag resources to determine if
a resource has been previously seen by the current batch

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
39de1ce660 tc: always track fb attachments
this should have no measurable impact on perf

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
6d236917a9 tc: add non-definitive tracking for batch completion
this is useful as a hint for opportunistic optimizations

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25624>
2023-10-26 22:31:25 +00:00
Mike Blumenkrantz
782481c429 zink: add copy box locking
this can technically be accessed by multiple threads, so ensure
access is serialized

backport-to: 23.3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25924>
2023-10-26 21:13:01 +00:00
Ruijing Dong
09a8cc0d6d radeonsi/vcn: vcn4 encoding interface dummy update
Due to some updates in vcn4 interface, add dummy members for further
development.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25898>
2023-10-26 20:25:01 +00:00
Alyssa Rosenzweig
ef4aa24a15 meson: Add gallium-drivers=all option
Again, useful to lint common code changes and for our macbook-wielding rel
manager <3

Omits i915g due to dependency hell, everything else builds on fedora asahi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
2023-10-26 19:48:20 +00:00
Alyssa Rosenzweig
b70e948886 meson: Add vulkan-drivers=all option
To build-test everything, helpful to check common code changes before pounding
CI.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
2023-10-26 19:48:19 +00:00
Alyssa Rosenzweig
2552ac360d crocus: Support building on non-Intel
Ditto.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
2023-10-26 19:48:19 +00:00
Alyssa Rosenzweig
c8192c1c93 hasvk: Support builiding on non-Intel
Should help Eric build test releases on their MacBook :-)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25882>
2023-10-26 19:48:19 +00:00
Sil Vilerino
dfb9516026 d3d12: d3d12_video_buffer_create_impl - Fix resource importing
Only align resource dimensions on creation, not when importing existing D3D resource object.
Otherwise importing the resource fails since the resource descriptor does not match the aligned
dimensions passed in the template.

Fixes: 62fded5e4f ("d3d12: Allocate d3d12_video_buffer with higher alignment for compatibility")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25913>
2023-10-26 19:25:16 +00:00
Ian Romanick
18d8a96a00 nir/split_vars: Don't split arrays of cooperative matrix types
glsl_type_is_vector_or_scalar would more accruately be called "can be an
r-value that isn't an array, structure, or matrix. This optimization
pass really shouldn't do anything to cooperative matrices. These
matrices will eventually be lowered to something else (dependent on the
backend), and that thing may (or may not) be handled by this or another
pass.

Fixes: 2d0f4f2c17 ("compiler/types: Add support for Cooperative Matrix types")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25871>
2023-10-26 18:45:29 +00:00
Lionel Landwerlin
24631d308c anv: ensure we reapply always pipeline dynamic state in runtime state
Doing something like this is allowed :

vkCreateGraphicsPipeline(.., scissorState, &pipeline);

vkCmdBindPipeline(pipeline);
vkCmdSetScissor(...)
vkCmdBindPipeline(pipeline)

If we don't reapply the pipeline dynamic state, the command buffer
runtime state will keep the dynamic state set in between the 2 binds.

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/25915>
2023-10-26 18:02:53 +00:00
Martin Roukala (né Peres)
c580d604fb ci/b2c: fix artifact collection
It seems like gitlab puts symlinks in artifacts rather than following
them. Let's fix this by copying the results folder from the job_folder
in an after script.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25902>
2023-10-26 17:02:39 +00:00
Erik Faye-Lund
ac16f00352 docs: improve readability of c-signatures
This does two things:

1. It increases the contrast of the signatures
2. It ensures that there's some spacing when there's two signature
   elements back-to-back (which happens when documenting structs, for
   instance), making it easier to tell things apart.

Reviewed-by: Jani Nikula <jani@nikula.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Erik Faye-Lund
bbd6ef4d34 docs: remove breathe/doxygen stuff
Reviewed-by: Jani Nikula <jani@nikula.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Jani Nikula
ae74d486ad docs/isl: use hawkmoth instead of doxygen
Use the hawkmoth c:auto* directives to incorporate isl documentation.

Convert @param style parameter descriptions to rst info field lists.
Add static stubs for generated headers. Fix a lot of references, in
particular the symbols are now in the Sphinx C domain, not C++
domain. Tweak syntax here and there.

Based on the earlier work by Erik Faye-Lund <kusmabite@gmail.com>

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Jani Nikula
eabd93bba8 docs/nir: use hawkmoth instead of doxygen
Use the hawkmoth c:auto* directives to incorporate nir documentation.

Convert @param style parameter descriptions to rst info field lists.
Add static stubs for generated headers. Fix a lot of references, in
particular the symbols are now in the Sphinx C domain, not C++
domain. Tweak syntax here and there.

Based on the earlier work by Erik Faye-Lund <kusmabite@gmail.com>

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Jani Nikula
082e7d23e7 docs/vulkan: use hawkmoth instead of doxygen
Use the hawkmoth c:auto* directives to incorporate vulkan documentation.

Convert @param style parameter descriptions to rst info field lists.
Add static stubs for generated headers. Fix a lot of references, in
particular the symbols are now in the Sphinx C domain, not C++
domain. Tweak syntax here and there.

Based on the earlier work by Erik Faye-Lund <kusmabite@gmail.com>

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Jani Nikula
91587326ae docs: Add docs/header-stubs/README.rst
Mesa generates a number of headers during build. To make Clang based
documentation parsing work without depending on the generated headers,
start a directory hierarchy under docs/header-stubs/ for static mock
headers.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Erik Faye-Lund
67485efd65 docs: prepare for hawkmoth
Hawkmoth is a Sphinx-extension that uses Clang to directly parse C code
for automatic documentation of C/C++ code, similar to what Doxygen does.

However, Doxygen is rather clunky to integrate into the build process,
so let's start switching over to Hawkmoth instead.

As Sphinx does not have syntax for describing parameter direction, add
an rst_prolog with rst replacements for them.

Reviewed-by: Jani Nikula <jani@nikula.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:25 +00:00
Jani Nikula
0ed5b8af01 isl: drop **< style documentation comments
Prepare for using Hawkmoth.

Hawkmoth does not support trailing comments using /**< ... */
syntax. Replace with regular documentation comments.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:25 +00:00
Jani Nikula
d407cd8216 nir: drop **< style documentation comments
Prepare for using Hawkmoth.

Hawkmoth does not support trailing comments using /**< ... */
syntax. Replace with regular documentation comments.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:25 +00:00
Jani Nikula
4024d0c196 nir: add names to some typedef'd structs/enums
In order to document "typedef struct { ... } T;" as a struct in
hawkmoth, the structs need to have names. Similar for enums.

Note: This is no longer required with Hawkmoth 0.16.0+ and Clang 16 and
later. With the next Hawkmoth release, this should be fixed also for
Clang 15 and earlier.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:25 +00:00
Ganesh Belgur Ramachandra
2f7bc06643 radeonsi: Fix clear-render-target shader for 1darrays in NIR
There are no GL CTS tests for 1darrays, relying on OpenCL CTS instead.
This patch should fix the `clEnqueueFillImage` tests in OpenCL CTS.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25630>
2023-10-26 15:33:18 +00:00
Eric Engestrom
63923d5d43 ci/rpi4: add spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvyu to the list of known failures
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25906>
2023-10-26 14:56:25 +00:00
Eric Engestrom
e6b4346eee ci/rpi4: group all spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_* together
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25906>
2023-10-26 14:56:25 +00:00
Corentin Noël
e95c9b0515 mesa/bufferobj: ensure that very large width+offset are always rejected
In the case width+offset is triggering an integer overflow, the checks in place
are not working as the comparison will fail.

Cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25909>
2023-10-26 14:18:55 +00:00
Samuel Pitoiset
4f8a225387 ac/gpu_info: remove bogus assertion about number of COMPUTE/SDMA queues
For example, my polaris10 GPU now returns 3 compute queues.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25876>
2023-10-26 13:44:21 +00:00
Samuel Pitoiset
fb64f7c676 radv: advertise VK_EXT_image_compression_control
This will be used by vkd3d-proton to disable eg. DCC per image in order
to workaround game bugs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25681>
2023-10-26 13:04:08 +00:00
Samuel Pitoiset
8a25a9f4dd radv: implement VK_EXT_image_compression_control
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25681>
2023-10-26 13:04:08 +00:00
Samuel Pitoiset
8ec0a4c89c radv: move RADV_DEBUG_NO_HIZ check in radv_use_htile_for_image()
To match radv_use_dcc_for_image().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25681>
2023-10-26 13:04:08 +00:00
Lionel Landwerlin
ce5472137f anv/meson: add missing dependency on the interface header
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: db335d9b73 ("anv: factor out host/gpu internal shaders interfaces")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25905>
2023-10-26 12:26:05 +00:00
Tapani Pälli
c945e0777d anv: add required PC for Wa_14014966230
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25671>
2023-10-26 11:51:47 +00:00
Tapani Pälli
2254eaa3ae anv: add current_pipeline for batch_emit_pipe_control
This way we can implemented workarounds depending on the pipeline.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25671>
2023-10-26 11:51:47 +00:00
Tapani Pälli
8ffc4bd31c iris: add required PC for Wa_14014966230
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25671>
2023-10-26 11:51:47 +00:00
Tapani Pälli
3cf71ddfac intel/dev: provide intel_device_info_is_adln helper
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25671>
2023-10-26 11:51:47 +00:00
Yonggang Luo
ffa458ee8f nir: remove redundant include of gallium headers
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25880>
2023-10-26 09:35:04 +00:00
Yonggang Luo
43715516fc treewide: Merge num_mesh_vertices_per_primitive and u_vertices_per_prim into mesa_vertices_per_prim
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25880>
2023-10-26 09:35:04 +00:00
Yonggang Luo
be431e0dc7 compiler: Implement num_mesh_vertices_per_primitive to match u_vertices_per_prim
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25880>
2023-10-26 09:35:04 +00:00
Mike Blumenkrantz
d446ccfc81 draw: fix uninit variable false positive
In function ‘generate_clipmask’,
    inlined from ‘draw_llvm_generate’ at ../src/gallium/auxiliary/draw/draw_llvm.c:1975:24:
../src/gallium/auxiliary/draw/draw_llvm.c:1302:25: warning: ‘sum’ may be used uninitialized [-Wmaybe-uninitialized]
 1302 |                   sum = lp_build_fmuladd(builder, planes,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1303 |                                          (LLVMValueRef[]){cv_x, cv_y, cv_z, cv_w}[i], sum);
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/auxiliary/draw/draw_llvm.c: In function ‘draw_llvm_generate’:
../src/gallium/auxiliary/draw/draw_llvm.c:1149:44: note: ‘sum’ was declared here
 1149 |    LLVMValueRef plane1, planes, plane_ptr, sum;
      |                                            ^~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25884>
2023-10-26 03:20:18 +00:00
Qiang Yu
0a564171f6 meson: be able to build radeonsi without llvm
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
bc59bbd43b radeonsi: selectively build llvm files
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
cc8e4b321b radeonsi: change compiler name for aco
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
9db67311cf radeonsi: does not call llvm init when no llvm available
It's still needed when aco asm print.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
ed2e2038de radeonsi: disk cache remove llvm dependancy when use aco
This re-enable disk cache when use aco.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
bad8fbe7f8 radeonsi: include ac_llvm_util.h when llvm available
Remove unused include.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
c2e2a78c72 radeonsi: set use_aco when no llvm available
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
18e19a53e9 radeonsi: selectively build llvm compile
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
a5fc880495 radeonsi: selectively build si llvm compiler create/destroy
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
b511edc0d5 radeonsi: move llvm internal header to si_shader_llvm.h
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
032c592619 radeonsi: stop llvm context creation when use aco
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
5bae345fb7 radeonsi: move llvm compiler alloc/free into create/destroy funcntion
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
79009811a2 radeonsi: move use_aco to si_screen
It's not per shader any more.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
18f79f4636 radeonsi: enable aco compilation for merged shader parts
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
0f23af5c0a radeonsi: fill aco shader info for part mode merged shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
8cbd52f001 radeonsi: add vs prolog args needed by aco ls vgpr fix
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
2023-10-26 10:27:55 +08:00
Qiang Yu
23cb6768cb aco: add aco_is_gpu_supported
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25631>
2023-10-26 02:01:49 +00:00
Qiang Yu
9c63138ae3 aco: stop emit s_endpgm for first stage of merged shader
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25631>
2023-10-26 02:01:49 +00:00
Qiang Yu
14022a3a0e aco: move end program handling to select_shader
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25631>
2023-10-26 02:01:49 +00:00
Qiang Yu
f3f2311d69 aco: extend max operands in a instruction to 128
We get more than 64 operands in p_end_with_regs when radeonsi.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25631>
2023-10-26 02:01:49 +00:00
Qiang Yu
e2af0b0b3f aco: add create_end_for_merged_shader
For radeonsi merged shader LS/ES part to pass args to next
stage.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25631>
2023-10-26 02:01:49 +00:00
Qiang Yu
71fd3c2a35 aco: do not fix_exports when separately compiled ngg vs or es
For radeonsi not abort when this case, as it does not jump at
last.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25631>
2023-10-26 02:01:49 +00:00
Mike Blumenkrantz
895c85ca8f vulkan/wsi: unify all the image usage flag caps
these should be the same for all wsi backends, so make a single
entrypoint to return the flags so it can be modified in a single place

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25291>
2023-10-26 00:08:57 +00:00
Mike Blumenkrantz
ac6139ad73 zink: don't block large vram allocations
I think this was masking some other problem that has long since been fixed

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25893>
2023-10-25 23:47:29 +00:00
Neha Bhende
8cfb46e27d ntt: lower indirect tesslevels in ntt
Tessellation shader which are using indirect
addressing for tesslevels e.g
  gl_TessLevelOuter[gl_InvocationID] = tessLevelOuter;
are crashing because gl_TessLevelOuter is now a
compact array variable and nir expects a constant
array index into the compact array variable.

This patch handles such cases.

This fixes MR 21940
Fixes: 84006587d7 ("glsl: Delete the lower_tess_level pass.")

Tested with glretrace

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25773>
2023-10-25 22:42:38 +00:00
Eric Engestrom
6505f5aade docs: update calendar for 23.3.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25896>
2023-10-25 22:30:52 +00:00
Martin Roukala (né Peres)
2a65bb292d zink/ci: drop the concurrency of the zink-radv-vangogh-valve job
We seem to be hitting the BAR0 size limit which triggers an amdgpu bug.
Let's drop the concurrency from 8 to 6 to alleviate pressure on BAR0,
and hopefully work around this kernel bug.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25883>
2023-10-25 21:46:45 +00:00
Lionel Landwerlin
439b0e8688 intel/fs: fix dynamic interpolation mode selection
We can end up in situation where we are dispatched with a multisample
framebuffer but not at per-sample. In this case we would request the
at_sample value with the wrong message configuration.

Relying on the BRW_WM_MSAA_FLAG_MULTISAMPLE_FBO flag superseeds
BRW_WM_MSAA_FLAG_PERSAMPLE_DISPATCH.

Fixes piglit tests :

spec@arb_gpu_shader5@arb_gpu_shader5-interpolateatsample*

With Zink on Anv

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 68027bd38e ("intel/fs: implement dynamic interpolation mode for dynamic persample shaders")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25854>
2023-10-25 21:15:48 +00:00
Eric Engestrom
0757ac6527 docs: reset new_features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25892>
2023-10-25 19:56:42 +00:00
Eric Engestrom
ed8abf1e2d VERSION: bump to 24.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25892>
2023-10-25 19:56:42 +00:00
Lionel Landwerlin
a97065adab anv: fix uninitialized use of compute initialization batch
We sometimes fail initialization.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 09d12e6727 ("anv: Add support for I915_ENGINE_CLASS_COMPUTE in init_device_state()")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25891>
2023-10-25 19:27:23 +00:00
Iago Toral Quiroga
84001ea425 v3dv: fix confusing nomenclature about DRM nodes
We have been using drm_render_device to refer to the render device and
drm_primary_device to refer to the display device, but that is confusing
because the render device also has a primary node (for legacy reasons),
so don't use primary to refer to the display device.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25748>
2023-10-25 19:11:37 +00:00
Mike Blumenkrantz
d0f775e54d ci: skip implicit modifier piglits for zink
these may work coincidentally but not uniformly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>
2023-10-25 18:23:17 +00:00
Mike Blumenkrantz
99ff88cb5e zink: delete some dead modifier handling
this is no longer hit

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>
2023-10-25 18:23:16 +00:00
Mike Blumenkrantz
1c3db3e39a zink: blow up broken xservers more reliably
only certain drivers can successfully run an xserver with implicit modifier
handling, and the rest will have broken rendering

until such time that a vk extension emerges to handle this more widely,
break this interop for drivers where it's already broken

fixes #9819

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>
2023-10-25 18:23:16 +00:00
Mike Blumenkrantz
ff093f522a zink: use weston for anv ci
gotta get those juicy modifiers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>
2023-10-25 18:23:16 +00:00
Rhys Perry
477b310dfd util: skip zero-sized SHA1Update
Fixes UBSan error:
src/util/sha1/sha1.c:140:8: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>
2023-10-25 17:27:47 +00:00
Rhys Perry
1afd0878e9 nir/lower_shader_calls: skip zero-sized qsort
Fixes UBSan:
src/compiler/nir/nir_lower_shader_calls.c:1681:7: runtime error: null pointer passed as argument 1, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>
2023-10-25 17:27:47 +00:00
Rhys Perry
f9289dfd02 nir/serialize: fix signed integer overflow
Fixes UBSan error:
src/compiler/nir/nir_serialize.c:1277:70: runtime error: left shift of 524287 by 13 places cannot be represented in type 'int'

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>
2023-10-25 17:27:47 +00:00
Alyssa Rosenzweig
9a6c20e64f nir/trivialize_registers: Handle obscure load hazard
Somebody less tired than me would add a unit test for this. Offending snippet:

        32    %58 = @load_reg (%55) (base=0, legacy_fabs=0, legacy_fneg=0)
        32    %57 = @load_reg (%55) (base=0, legacy_fabs=0, legacy_fneg=0)
        32    %21 = iadd %57, %15 (0x1)
                    @store_reg (%21, %55) (base=0, wrmask=x, legacy_fsat=0)
        32    %56 = @load_reg (%55) (base=0, legacy_fabs=0, legacy_fneg=0)
        32    %22 = i2f32 %56
        32    %23 = load_const (0x41000000 = 8.000000)
        32    %24 = fdiv %22, %23 (8.000000)
        32    %90 = mov %24
                    @store_reg_indirect (%90, %78, %58) (base=0, wrmask=x, legacy_fsat=0)

Closes: #10031
Fixes: d313eba94e ("nir: Add pass for trivializing register access")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25865>
2023-10-25 16:34:47 +00:00
Karol Herbst
6aef22af77 docs/features: remove empty lines confusing mesamatrix
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25886>
2023-10-25 16:23:55 +00:00
Samuel Pitoiset
1febb6f762 radv: report the last GPUVM fault when a device lost is detected
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:23 +00:00
Samuel Pitoiset
5a6208ad72 radv: query and report the last GPUVM fault with RADV_DEBUG=hang
Tested with a small use-after-free Vulkan test. It's pretty basic
for now but I think I will add status decoding support to report
more useful information.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:22 +00:00
Samuel Pitoiset
5eb8b3e9b1 radv/amdgpu: add support quering the last GPUVM fault
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:22 +00:00
Samuel Pitoiset
bdc62108be amd: add has_gpuvm_fault_query
Whether the kernel allows to query the last GPUVM fault.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:22 +00:00
Samuel Pitoiset
37462ce72d amd: update amdgpu_drm.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:22 +00:00
Samuel Pitoiset
1b0fbcbe1c radv: remove outdated RADV_DEBUG=vmfaults support
It's been a very long time since this was useless because dmesg
required sudo access for a while.

This will be replaced by the new GPUVM fault interface which allows
to query from the kernel directly instead of trying to parse dmesg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238>
2023-10-25 15:29:22 +00:00
Seppo Yli-Olli
6bbbdd5ceb zink: Fix SyntaxWarning in zink_extensions script
Fix regex pattern in zink_extensions to use proper escaping. While the original
code works, it relies on Python ignoring incorrect syntax and fallbacking to
passing through the escape. Current behaviour results in SyntaxWarning
whenever the code is used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25881>
2023-10-25 15:03:43 +00:00
Louis-Francis Ratté-Boulianne
5a928f7563 panfrost: Add env variable for max AFBC packing ratio
Add `PAN_MAX_AFBC_PACKING_RATIO` variable. If the ratio (size of the
packed resource) / (size of the sparse resource) * 100 is above that
value, we don't care about packing it.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
888d7c8ee6 panfrost: Add some debug utility methods for resources
Add a method to dump a specific superblock given its index (header
and few first bytes from the body) and a method to dump a resource
to a ppm file.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
33b48a5585 panfrost: Add debug flag to force packing of AFBC textures on upload
Add `forcepack` flag that will force conversion to AFBC-packed right
after a texture is uploaded when possible. We only pack 2D resources
larger than 32x32 as of now.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
bc91af8021 panfrost: Don't force constant modifier after converting
After converting a texture from one modifier to another, there is
no reason to force the modifier to stay constant afterwards. Set
back `modifier_constant` to false because it is changed by
`resource_setup` as it is causing issues when implementing AFBC
packing.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
e9d523bb92 panfrost: Legalize resource when attaching to a batch
Make sure we don't convert the texture for nothing by only
legalizing when creating a batch instead of on surface creation.
Also, to avoid recursive blit, we need to legalize the destination
resource before blitting.

Finally, make sure the resource has a sparse memory layout if
AFBC compressed. The GPU doesn't support rendering to a AFBC-packed
texture.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
bc55d150a9 panfrost: Add support for AFBC packing
When the GPU is converting a texture from linear/tiled to compressed
AFBC, it uses a sparse memory layout. That means that the
superblocks are stored starting at intervals equal to the size of an
uncompressed superblock. When memory usage needs to be optimized, it
is possible to pack the resource by trimming each superblock as much
as possible. The GPU will still be able to read from these packed
textures, but won't be able to write directly to them. If the
layout is AFBC-tiled, the packing process will also de-tile as
tiled+packed is not supported by Mali GPUs.

No new modifier flag has been added as the absence of the
`AFBC_FORMAT_MOD_SPARSE` flag means the resource will be packed.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
32fbd38889 panfrost: Add method to get size of AFBC superblocks valid data
The compute shader is going through all the AFBC header blocks and
calculating the size of valid data by summing up the subblock
sizes (and taking into account solid color, uncompressed mode and
copy blocks). The result is written into the given buffer (array
of `pan_afbc_block_info`).

The size is rounded up to the alignment parameter directly in the
shader.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
ae3fb3089f panfrost: Add infrastructure for internal AFBC compute shaders
A few compute shaders are needed to support AFBC-packing. Here is
just the boilerplate to create, compile and retrieve the shaders.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
c1429a3120 panfrost: Split out internal of panfrost_launch_grid
For an upcoming feature (AFBC packing), we're gonna run internal
compute shaders on resources. This commit just split the internal
of `panfrost_launch_grid` so we can run the shader on a given
batch.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
91514e7091 panfrost: Make panfrost_resource_create_with_modifier public
It allows creating a resource when we already know which modifier
we're gonna use.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
542c44ffde panfrost: Add panfrost_batch_write_bo
Needed when writing to a BO from a compute shader when the BO isn't
assigned to a resource yet.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
113d88f94d panfrost: Precalculate stride and nr of blocks for AFBC layouts
For AFBC packing, we will need to have the stride of the resource
in terms of superblocks and the total number of blocks. It is
easier to pre-calculate once when initializing the resource layout.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:31 +00:00
Louis-Francis Ratté-Boulianne
9f3a79a6a3 panfrost: Add method to get size of AFBC subblocks
Each AFBC superblock is subdivised into subblocks that are
compressed individually. For all formats that we currently support,
the subblocks are 4x4 pixels.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:30 +00:00
Louis-Francis Ratté-Boulianne
39efd7c245 panfrost: Add methods to determine slice and body alignment
Those methods are needed to have the same alignment everywhere
without hard-coding the values

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:30 +00:00
Louis-Francis Ratté-Boulianne
6012bde0fc panfrost: Fix error in comment
"linear" -> "tiled"

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
2023-10-25 14:25:30 +00:00
Tapani Pälli
c7e522a9f3 egl: fix leaking drmDevicePtr in _eglFindDevice
Fixes: 3a9e1014e1 ("egl: Rename _eglAddDevice() to _eglFindDevice()")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25524>
2023-10-25 12:37:30 +00:00
Lionel Landwerlin
3de5da7a5d anv: fixup 32bit build of internal shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 11b4c23d19 ("anv: add ring buffer mode to generated draw optimization")
Fixes: db335d9b73 ("anv: factor out host/gpu internal shaders interfaces")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10037
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25870>
2023-10-25 11:47:40 +00:00
Christian Gmeiner
471942e06b etnaviv: Don't leak disk_cache
Fixes: 77af1ca690 ("etnaviv: add disk cache")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25877>
2023-10-25 09:46:37 +00:00
Christian Gmeiner
a53a394d30 ci: Bump PyYAML to 6.0.1
Fixes an issue I am seeing on Fedora 39. For more details
about the upstream fix see https://github.com/yaml/pyyaml/pull/702

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25878>
2023-10-25 10:35:47 +02:00
Tapani Pälli
d52c39a6cd intel/dev: expand existing fix for all gfx12 with small EU count
Commit 7db1b94e07 added a fix for ADL-N but this issue has been
reproduced also on RPL-S and is likely common with all gfx12 variants
with a small EU count.

cc: mesa-stable

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25861>
2023-10-25 05:15:47 +00:00
Caio Oliveira
67450674c0 compiler/types: Move comments and reorganize declarations
Move comments from C++ member functions to the C functions.  In
some cases just delete comments or consolidate them together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
dfcca13800 compiler/types: Remove warnings about potential fallthrough
None of those cases are expected to fallthrough, but should be unreachable.
Just break them so they get to the unreachable entry at the end.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
9e32cc3d0b compiler/types: Rename glsl_types.cpp to glsl_types.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
c45276c665 compiler/types: Annotate extern "C" only once in glsl_types.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
cecdc686e4 compiler/types: Remove usages of C++ members in glsl_types.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
94bdf351dc compiler/types: Use C instead of C++ constants for builtin types
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
07ee4bd69f compiler/types: Add remaining type extraction functions and use them in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
ada6183d60 compiler/types: Add glsl_simple_explicit_type() and simplify glsl_simple_type()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
e17adf51db compiler/types: Implement glsl_type::field_type() in terms of existing functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
9e514b89a0 compiler/types: Add glsl_get_explicit_*() functions and use them in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
d2a804a25b compiler/types: Add glsl_get_std430_array_stride() and use it in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
7b42fe62a1 compiler/types: Add glsl_type_uniform_locations() and use it in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
e98ba3b53f compiler/types: Add glsl_type_compare_no_precision() and use it in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
3ce4d5e033 compiler/types: Add glsl_get_mul_type() and use it in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
795bf4244c compiler/types: Add more glsl_contains_*() functions and use them in C++
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
2d4a250d21 rusticl: Add bindings for glsl_vector_type()
This is going to become inline functions, so add the corresponding
Rust bindings for it first.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
68f80e6fc1 compiler/types: Move remaining code from nir_types to glsl_types
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
b2407d7859 compiler/types: Flip wrapping of numeric type conversion functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
8bebd40d5c compiler/types: Flip wrapping of remaining small data getters
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
922fe24739 compiler/types: Flip wrapping of remaining non-trivial type getters
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
a5e6e5b6d3 compiler/types: Flip wrapping of get row/column type helpers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
beaac525e8 compiler/types: Flip wrapping of various get instance functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
5c91cf9288 compiler/types: Flip wrapping of texture/sampler/image get instance functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
87b3812f10 compiler/types: Flip wrapping of get_instance()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
2117158619 compiler/types: Flip wrapping of record_compare
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
e486384540 compiler/types: Flip wrapping of layout related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
a4cfeea850 compiler/types: Flip wrapping of interface related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
ad092fcab5 compiler/types: Flip wrapping of struct related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
421a04f5ba compiler/types: Flip wrapping of size related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
418e3be14c compiler/types: Flip wrapping of CL related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:12 +00:00
Caio Oliveira
d78110d356 compiler/types: Flip wrapping of cmat related functions
Also add a missing `struct` related to cmat.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:11 +00:00
Caio Oliveira
67210f90ad compiler/types: Flip wrapping of array related functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:11 +00:00
Caio Oliveira
3bf500af7b compiler/types: Flip wrapping of "type contains?" predicate functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25129>
2023-10-25 01:51:11 +00:00
Eric Anholt
74315051a9 ci_run_n_monitor: Always resolve --rev arguments for looking up pipelines.
Otherwise you'd loop forever never finding it with --rev <paste from
gitlab UI> or --rev <branch name>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25824>
2023-10-25 01:48:18 +00:00
David Rosca
9b4fccf4b3 radeonsi/vcn: Add encode support for H264 B-frames
Tested with ffmpeg and gstreamer vah264enc.

References to B-frames (b_depth/b-pyramid) not supported.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25565>
2023-10-25 01:03:58 +00:00
David Rosca
3c5d82142d frontends/va: Fix parsing packed headers without emulation bytes
Don't try to handle emulation bytes and only parse first NAL unit
if the packed header has no emulation bytes.

This fixes parsing packed headers from gstreamer.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25565>
2023-10-25 01:03:58 +00:00
David Rosca
081f972eba util/vl: Fix vl_rbsp parser with bitstreams without emulation bytes
This is used for parsing VA packed headers and those can be without
emulation prevention bytes.
Add emulation_bytes argument to vl_rbsp_init and skip all emulation
bytes handling when set.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25565>
2023-10-25 01:03:58 +00:00
David Rosca
9e82c5d864 frontends/va: Parse H264 SPS for max_num_reorder_frames
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25565>
2023-10-25 01:03:58 +00:00
Chia-I Wu
b653669fc5 anv: add gen9 astc workaround
gen9 does not handle denorms in void extent blocks correctly.  We need
to flush them to zero.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25800>
2023-10-25 00:06:04 +00:00
Chia-I Wu
c42b1a5a74 anv: prep for gen9 astc workaround
We will reuse astc emu for gen9 astc workaround.  This commit contains
minor cleanups and has no functional change.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25800>
2023-10-25 00:06:04 +00:00
Timur Kristóf
9a79c5f1e5 radv: Support SDMA in si_cs_emit_write_event_eop.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25833>
2023-10-24 23:12:45 +00:00
Timur Kristóf
b442de86c1 radv: Support SDMA in radv_cp_wait_mem.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25833>
2023-10-24 23:12:45 +00:00
Timur Kristóf
04a3ed8a92 radv: Support SDMA in radv_cs_write_data_head.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25833>
2023-10-24 23:12:45 +00:00
Mary Guillemard
5308378a35 nir: Add NVIDIA-specific geometry shader opcodes
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:18 +00:00
Faith Ekstrand
1fa7c37a36 nir: Add NVIDIA-specific I/O intrinsics
NVIDIA hardware doesn't take a vertex index for per-vertex I/O.
Instead, it takes an offset into the primitive.  This has to be fetched
using a combination of SR_INVOCATION_INFO and the ISBERD instruction.
To keep things simple and allow for maximum CSE, we do the lowering in
NIR and patch the load/store_per_vertex_input/output intrinsic.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:18 +00:00
Faith Ekstrand
8188842fdc nir: Add a range to most I/O intrinsics
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:18 +00:00
Faith Ekstrand
a2b799c53c nir: Add an load_barycentric_at_offset_nv intrinsic
NVIDIA hardware takes the offset as two 4.12 fixed-point values packed
into a single 32-bit value.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:18 +00:00
Faith Ekstrand
1a2e8290ab nir: Add NV-specific texture opcodes
These are for implementing various texture queries.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:18 +00:00
Faith Ekstrand
5984265d45 nir: Add a load_sysval_nv intrinsic
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:18 +00:00
Faith Ekstrand
abf3175161 nir/lower_tex: Add a lower_txd_clamp option
Some of us want to lower all TXD with min_lod regardless of whether or
not it's shadow or cube or whatever.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:17 +00:00
Faith Ekstrand
d3d5122f7c nir: Add convert_alu_types to divergence analysis
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:17 +00:00
Faith Ekstrand
0680330cf7 nir: Add a nir_ssa_def_all_uses_are_fsat() helper
Extracted from nir_lower_to_source_mods, this is useful for back-ends
which don't want to rely on NIR source and destination modifiers.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25000>
2023-10-24 22:21:17 +00:00
Rhys Perry
28ebe62af2 radv: enable mesh shader gs_fast_launch=2 and multi-row export
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:07 +00:00
Rhys Perry
3531136949 radv: implement mesh shader multi-row export
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:07 +00:00
Rhys Perry
773d35d25e ac/nir: implement mesh shader multi-row export
Unlike AMDVLK, this has separate loops for attribute stores and exports,
so that the stores from different rows can overlap.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:07 +00:00
Rhys Perry
c29d8a9e68 ac/nir,radv: pass workgroup size to ac_nir_lower_ngg_ms
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
c300a496ea ac/nir: add emit_ms_outputs helper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
23cb0b00db radv: implement mesh shader gs_fast_launch=2
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
c63ac28014 ac/nir: optimize mesh shader local_invocation_index
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
cddbe9a4c2 ac/nir: implement mesh shader gs_fast_launch=2
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
75bc2e7149 ac/nir: refactor mesh vertex/primitive export
To prepare for row export, move them into helpers with index and row
parameters.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
24431419ce ac/nir: remove dead code
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
6ec72806b7 ac/nir: add row parameter to helpers
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
4c3677094e aco,nir: add export_row_amd intrinsic
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Rhys Perry
4bd4ff5d9b nir: improve ms_cross_invocation_output_access with local_invocation_id
Since GFX11, RADV doesn't need to lower local_invocation_id.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25040>
2023-10-24 21:36:06 +00:00
Caio Oliveira
b91ed68fa0 intel/compiler: Don't emit calls to validate() in release build
While the fs_visitor::validate() implementation is empty in release
build, we still emit calls to it since it is defined in a separate
compilation unit than its callers.  To fix this, just expose an inline
empty function in the header for the release mode.

Fossil run time differences in TGL laptop (difference at 95.0% confidence):

```
Rise of The Tomb Rider (Native) [n=7]
        -0.482857 +/- 0.010932
        -1.60608% +/- 0.0363621%

Cyberpunk 2077 (DXVK) [n=7]
        -0.987143 +/- 0.0904516
        -0.82996% +/- 0.076049%

Batman Arkham City (DXVK) [n=7]
        -7.74857 +/- 0.329561
        -1.46298% +/- 0.0622231%
```

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25847>
2023-10-24 21:10:35 +00:00
Samuel Pitoiset
13cac671fd ac/gpu_info: fix querying the maximum number of IBs per ring
The kernel uses 32-bit and Mesa was using 8-bit...

Fixes: 96345ae2ed ("ac/gpu_info: query the maximum number of IBs per submit from the kernel")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25867>
2023-10-24 19:53:08 +00:00
Rohan Garg
3bf1b7deba anv: selectively enable FCV optimization for DG2
Enabling FCV on MTL breaks a number of games and benchmarks. Let's
disable it for now till we can root cause the issue.

Closes: #9987
Fixes: 26c2c9 ('anv: enable FCV for Gen12.5')
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25863>
2023-10-24 19:27:14 +00:00
Rohan Garg
25a232238f anv: turn off non zero fast clears for CCS_E
This helps fix a performance regression on games such as F1 22 and RDR2.
Turning on non zero fast clears causes additional partial resolves for
these games that degrades performance. Let's turn off non zero fast
clears till we can eliminate the partial resolves.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25863>
2023-10-24 19:27:14 +00:00
Boyuan Zhang
2179cd129f radeonsi/vcn: disable tmz ctx buffer for VCN_2_2_0
VCN_2_2_0 should not use tmz context buffer.

Fixes: ffbbf23e
A minor fix for above commit to use the original comparison logic "<"
instead of "<="

Cc: mesa-stable

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25856>
2023-10-24 18:48:45 +00:00
Juan A. Suarez Romero
209376f01a v3d/vc4/ci: add new fails/timeout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25868>
2023-10-24 18:27:34 +00:00
Timur Kristóf
eff4db3718 radv: Add gang follower semaphore functions.
These functions implement the possibility to have the
gang leader wait for its follower.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25796>
2023-10-24 17:58:12 +00:00
Timur Kristóf
b5e0a04d4e radv: Slightly refactor gang semaphore functions.
This is in preparation for adding some new ones.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25796>
2023-10-24 17:58:12 +00:00
Timur Kristóf
cbbb85c907 radv: Allow gang submit use cases other than task shaders.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25796>
2023-10-24 17:58:12 +00:00
Timur Kristóf
67ce3f11e8 radv: Simplify gang CS and semaphore initialization.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25796>
2023-10-24 17:58:12 +00:00
Samuel Pitoiset
56a05b9251 radv: fix missing predicate bit for WRITE_DATA helper
Fixes: 12a753f8d2 ("radv: Use new WRITE_DATA helper in more places.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25850>
2023-10-24 14:53:04 +00:00
Samuel Pitoiset
f9cc2c5ba4 Revert "radv: fix finding shaders by PC"
Shaders are no longer allocated contiguously in memory and the next
pointer is now the shader.

This fixes using the trap handler on GFX8.

This reverts commit 2dcd12f38b.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25852>
2023-10-24 14:19:13 +00:00
Bas Nieuwenhuizen
653bcbcb09 radv: Expose VK_KHR_cooperative_matrix.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
2023-10-24 13:24:18 +00:00
Bas Nieuwenhuizen
9df4703fbb radv: Add cooperative matrix lowering.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
2023-10-24 13:24:18 +00:00
Bas Nieuwenhuizen
31863aa48c radv: Don't transparently use wave32 with cooperative matrices.
The instruction has different regsizes for wave32 vs. wave64.

To ensure cases with cooperative matrix load/store without any
actual wmma instructions get handled correctly, also require
full subgroups if subgroup invocation/id are used. Not sure
those could be transparently changed anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
2023-10-24 13:24:18 +00:00
Bas Nieuwenhuizen
d8458c0559 aco: Make RA understand WMMA instructions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
2023-10-24 13:24:18 +00:00
Bas Nieuwenhuizen
5e7c828c0e aco: Add WMMA instructions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
2023-10-24 13:24:18 +00:00
Bas Nieuwenhuizen
a29cd20d17 nir: Add AMD cooperative matrix intrinsics.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
2023-10-24 13:24:18 +00:00
Helen Koike
663ad191ca ci/ci_run_n_monitor: print job duration time
If the job is running, it prints the elapsed time so far, if it finished
already, it prints the time it took.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25822>
2023-10-24 12:57:14 +00:00
Helen Koike
69012e355e ci/marge_queue: add pretty_dutation()
Add pretty_duration() function that prints time in format 6m23s and use
it for marge_queue.

Signed-of-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25822>
2023-10-24 12:57:14 +00:00
Samuel Pitoiset
96345ae2ed ac/gpu_info: query the maximum number of IBs per submit from the kernel
When the query fails (unsupported by the current kernel), we fallback
to some rough estimate.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10014
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25803>
2023-10-24 11:05:26 +00:00
Rohan Garg
f85d8d908c anv: cleanup includes
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25766>
2023-10-24 10:33:57 +00:00
Rhys Perry
fc342c897f Revert "radv: pre-init surface info"
This reverts commit e15a4e6e1a.

The change wasn't thread safe.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9955
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10021
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25830>
2023-10-24 10:11:34 +00:00
Samuel Pitoiset
aba815c041 radv: initialize video decoder for GFX11.5
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25304>
2023-10-24 08:20:47 +02:00
Samuel Pitoiset
50845f6fa4 radv: set ENABLE_PING_PONG_BIN_ORDER for GFX11.5
Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25304>
2023-10-24 08:20:47 +02:00
Yogesh Mohan Marimuthu
62a2ed8602 radeonsi: add radeonsi to GL_RENDERER string
adding driver name to GL_RENDERER string will help to quickly
identify the driver being used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25148>
2023-10-24 04:46:27 +00:00
Yogesh Mohan Marimuthu
6cf58bc862 radeonsi: In gfx6_init_gfx_preamble_state() use gfx_level only from sctx
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25148>
2023-10-24 04:46:27 +00:00
Yogesh Mohan Marimuthu
b1111f35c6 radeonsi: correct old comment in si_emit_framebuffer_state()
si_init_cs_preamble_state() function does not exist anymore and
PA_SC_WINDOW_SCISSOR_TL is set to 0,0. Update the comments with
this information.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25148>
2023-10-24 04:46:27 +00:00
Yogesh Mohan Marimuthu
e373b7c07e docs: remove document for unused variable dfsm from AMD_DEBUG
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25148>
2023-10-24 04:46:26 +00:00
Yogesh Mohan Marimuthu
cd2e3fc59a radeonsi: add more documentation for dpbb debug env variable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25148>
2023-10-24 04:46:26 +00:00
Mike Blumenkrantz
9de455bc43 zink: check for sampler view existence during zink_rebind_all_images()
views with mutable formats do not get created immediately, which means
access of them must be checked first

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25829>
2023-10-24 02:24:15 +00:00
Mike Blumenkrantz
12fc8cf4df zink: only increment image_rebind_counter on image export if binds exist
rebinding all images on all contexts is only relevant for images which
have bindings, otherwise it's just pointless churn

fixes #10016

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25829>
2023-10-24 02:24:15 +00:00
Lang Yu
a65aab411f amd/radeonsi: add missing stuff for gfx11.5
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25836>
2023-10-24 01:07:12 +00:00
Lang Yu
f9629fa729 amd/common: add missing stuff for gfx11.5
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25836>
2023-10-24 01:07:12 +00:00
Eric Anholt
aed6a39c10 glsl: Retire dround lowering.
We have competent lowering in NIR already available.

Drivers exposing CAP_DOUBLES but not SHADER_CAP_DROUND:
- d3d12 (NIR lowers ~0 if the underlying impl doesn't do floats)
- svga (Now sets the NIR lowering options)
- softpipe (Doesn't do GL4 so you can't use doubles anyway)
- llvmpipe (Lowers dround_even in NIR and passees the rest through
            successfully)
- zink (NIR lowers ~0 if the underlying impl doesn't do floats,
        otherwise passes things through successfully, except needed
        dround_even lowering to avoid lavapipe regression with
        native doubles)
- r600 (sets NIR rounding lowering flags, and lowers all fsign)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25777>
2023-10-24 00:16:30 +00:00
Eric Anholt
b416248cb5 nir: Add nir_lower_dsign as 64-bit fsign lowering.
Right now some drivers are doing dsign lowering in GLSL and haven't had to
have a NIR path due to there not being a corresponding vulkan driver.  We
want this in NIR now so that we can retire that batch of GLSL lowering
code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25777>
2023-10-24 00:16:30 +00:00
Eric Anholt
4c61de56c5 llvmpipe: Set nir_lower_dround_even.
Avoids a regression when disabling GLSL-level lowering of the dround class
of ops, while passing through doubles to llvm for the other rounding ops.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25777>
2023-10-24 00:16:30 +00:00
Eric Anholt
b1b0ebba1e glsl: Remove int64 div/mod lowering.
Most drivers that can expose GL4 were claiming the cap anyway (llvmpipe,
softpipe, zink, iris, nvc0, radeonsi, r600, freedreno, d3d12), and just
doing lowering in NIR if nessary.

crocus was only claiming the cap for gen8, but the backend compiler
enables NIR lowering regardless.

svga is the only other GL4 driver that didn't set it, and we can just set
the NIR lowering flag.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25777>
2023-10-24 00:16:30 +00:00
José Roberto de Souza
bd546f9e54 anv: Switch Xe KMD vm bind to sync
It was never actually async as it was doing a DRM_IOCTL_SYNCOBJ_WAIT
right after DRM_IOCTL_XE_VM_BIND but it was required to allow the
partial binds required by sparse.
But it is now fixed and we can switch back to sync vm bind.

In future we will switch back to async vm bind to improve performance
but this time it will be properly implemented.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25300>
2023-10-23 23:24:26 +00:00
José Roberto de Souza
531605accf intel: Sync xe_drm.h
Sync xe_drm.h with commit xxxxx ("drm/xe/uapi: Fix naming of XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY").

One not so straght forward change is that sync VM binds now don't
require a syncobj anymore, the uAPI will return as soon the VM bind
operations are done.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25300>
2023-10-23 23:24:26 +00:00
Caio Oliveira
9dcc74e557 spirv: Let spirv2nir find out the shader to use
Previous behavior was to default to "main"/fs, this wasn't nice
when the SPIR-V module had a single shader that didn't match that spec.

New behavior is to look at the available shaders:

- if there's only one, use just use it
- if multiple, narrow down using --stage and --entry as criteria
- if still multiple after narrowing down, print the list and fail

Note you can use just one --stage or --entry if that already narrows
down to a single match.  Note that in SPIR-V it is valid to have a
shader module with two shaders sharing the same entry-point name but
different stages.  Because of that in rare cases both --stage and
--entry will be needed.

This patch should remove the need of using --stage and --entry for most
of the uses of spirv2nir.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25461>
2023-10-23 22:42:45 +00:00
Caio Oliveira
c4734714ce spirv: List entry-points in spirv2nir when unsure what to use
When there's ambiguity about what shader to use, list the shaders.
Conveniently print in the command line argument for, so can be copied
pasted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25461>
2023-10-23 22:42:45 +00:00
Caio Oliveira
45df1fd239 spirv: Change spirv2nir to use the shorter shader name abbreviations
This are the abbreviations we use elsewhere in Mesa.  For convenience we
make them case insensitive.  Old names still work for compatibility.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25461>
2023-10-23 22:42:45 +00:00
Caio Oliveira
4d3703c12d spirv: Expose stage enum conversion in vtn_private.h
Refactor it to not fail, just return MESA_SHADER_NONE.  Caller
takes care of handling error.  Exposed so can be used by spirv2nir
program.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25461>
2023-10-23 22:42:45 +00:00
Rhys Perry
9e3b014d4f radv: fix signed integer overflow
Fixes UBSan error:
src/amd/vulkan/radv_shader_info.c:78:41: runtime error: left shift of 15 by 28 places cannot be represented in type 'int'

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25432>
2023-10-23 22:16:27 +00:00
Rhys Perry
f440e82679 ac/nir: fix out-of-bounds access in ac_nir_export_position
These accesses (and similar) in ac_nir_exprot_position were out-of-bounds:
if (!outputs[VARYING_SLOT_PSIZ][0])
   outputs_written &= ~VARYING_BIT_PSIZ;

I don't think this caused any real issue, but this silences ASan:
==40091==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f8ffa6b1cb8 at pc 0x7f900da99068 bp 0x7f8ffb8871d0 sp 0x7f8ffb8871c8

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25432>
2023-10-23 22:16:26 +00:00
Rhys Perry
99214f0481 radv: skip zero-sized memcpy
Fixes UBSan:
src/amd/vulkan/radv_pipeline.c:1181:4: runtime error: null pointer passed as argument 2, which is declared to never be null
src/amd/vulkan/radv_shader.c:2243:4: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25432>
2023-10-23 22:16:26 +00:00
Nanley Chery
d57611fe25 intel/isl: Add scores for GEN12_RC_CCS and MTL_RC_CCS
Now that these CCS-enabled modifiers have non-zero scores, anv is
enabled to use them.

We found this to improve the performance of Borderlands 3 by 18.73%.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6701
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Tested-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
9e402e93d2 anv: Delete implicit CCS code
Stop allocating CCS at the end of some BOs. Anv no longer uses that
memory range.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
4cdd3178fb anv: Meet CCS alignment reqs with dedicated allocs
At image bind time, we require BOs to meet aux-map alignment
requirements in order to enable CCS on images. This is a heuristic
controlled by anv_bo_allows_aux_map().

To improve the chances of getting a properly aligned BO, we make use of
the dedicated allocation extension. Firstly, we report to applications a
preference for dedicated memory if an image would like to use the aux
map. Secondly, we align the VMA for dedicated allocations to meet
aux-map requirements.

To make enabling modifiers much easier on integrated gfx12, report
dedicated allocations as a requirement for modifiers which specify CCS.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
2cbec81041 anv: Loosen anv_bo_allows_aux_map
Instead of requiring that a BO has the has_implicit_ccs flag set, simply
require that the BO is aligned according to aux-map requirements.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
ee6e2bc4a3 anv: Place images into the aux-map when safe to do so
At image bind time, if an image's addresses can be placed into the
aux-map without causing conflicts with a pre-existing mapping, do so.
The code aux management code in the binding function operates on a
per-plane basis. So, use the per-plane CCS memory range from the image
rather than the CCS memory region for the entire BO.

Another way to avoid aux-map conflicts is to rely solely on having a
dedicated allocation for an image. Unfortunately, not all workloads
change their behavior when drivers report a preference for dedicated
allocations. In particular, 3DMark Wild Life Extreme does not make more
dedicated allocations and such a solution was measured to perform ~16%
worse than this solution. With this solution, I did not measure a loss
of CCS on that benchmark.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6304
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
207db22117 anv: Refactor CCS disabling at image bind time
Split out the discrete and integrated implicit CCS cases. We'll do more
work in the integrated case in a future commit.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
d31c62f384 anv: Wrap aux surface image binding queries
Add and use anv_image_get_aux_memory_range.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
cd12eec496 anv: Allocate space for aux-map CCS in image bindings
This makes images a bit larger by reserving space to store the
compression control surface when the device uses an aux-map.

This space is not used currently because anv still maps main surface
addresses to space at the end of the anv_bo.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
5e07255148 anv: Move scope of CCS binding determination
Move the determination of the image binding for CCS to a larger scope,
so that it can be reused for other aux usages in
add_aux_surface_if_supported().

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Nanley Chery
b1a14fe923 intel: Return a bool from intel_aux_map_add_mapping
Make intel_aux_map_add_mapping return false if a mapping is attempted
that would conflict with an existing one. If this function doesn't
return false, it will either fail to return or return true.

The Vulkan driver will make use of this feature to opportunistically
enable CCS if a BO's VMA range has not been already mapped.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003>
2023-10-23 21:37:24 +00:00
Friedrich Vock
16e1163651 radv/rmv: Recognize LPDDR memory
Fixes: 8d0e6c02 ("radv: Add RMV tracing utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25845>
2023-10-23 18:08:02 +00:00
Friedrich Vock
5e734a7cbf radv/rra: Recognize LPDDR memory
Also move away from using unnamed constants for memory types.

Fixes: aef7ea868f ("ac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25845>
2023-10-23 18:08:02 +00:00
Eric Anholt
7a3fb60ac8 docs/ci: Add some links in the CI docs to how to track job flakes
and also figuring out how many boards are available for sharding
management.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25806>
2023-10-23 17:59:55 +00:00
Eric Anholt
553070f993 docs/ci: Drop old instructions for farm disabling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25806>
2023-10-23 17:59:55 +00:00
Corentin Noël
2ef0e6be17 util: Remove MESA_TRACE_BEGIN/END
There are no user of these macros anymore, simplify the cpu_trace header.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
d64765c200 util/perf: Remove the tracing categories
The slow category remains unused in Mesa currently, readd it once we have
a use for it.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
b7a4e78071 util: Avoid the use of MESA_TRACE_BEGIN/END
Switch the last occurrences of it to the MESA_TRACE_SCOPE macro which is
easier to use.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
bf1a68833b venus: Change the only occurrence of VN_TRACE_BEGIN/END to VN_TRACE_SCOPE
This is the only part of venus using this macro, let's replace it with the scope
one.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
c637901392 aux/tc: Use MESA_TRACE_SCOPE instead of _BEGIN/_END
The MESA_TRACE_SCOPE macro is an exact replacement for this.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
57c6e79db5 tu: Use MESA_TRACE_SCOPE instead of _BEGIN/_END
The MESA_TRACE_SCOPE macro is an exact replacement for this.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
f60a9d89c1 freedreno/drm/virtio: Use MESA_TRACE_SCOPE instead of _BEGIN/_END
The MESA_TRACE_SCOPE macro is an exact replacement for this.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Karol Herbst
e0301659f1 zink: fix zink_destroy_screen for early screen creation fails
Fixes crashes on at least my system with multiple GPUs.

Fixes: 0c2045553f ("zink: use screen destructor for creation fails")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25844>
2023-10-23 16:52:15 +00:00
Christian Gmeiner
90cd5f3799 etnaviv: Skip 'empty' cmd streams
Make use of etna_cmd_stream_mark_end_of_context_init(..) to mark the
end of context init states. If the cmd stream is untouched until
etna_cmd_stream_flush(..) gets called the drm layer will downgrade this
specific cmd stream to a noop.

This safes us from calling into the kernel with an 'empty' cmd stream.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25849>
2023-10-23 14:56:48 +00:00
Christian Gmeiner
4c8fad4fd8 etnaviv: drm: Be able to mark end of context init
Add etna_cmd_stream_mark_end_of_context_init(..) which stores the current
offset of the cmd stream as offset_end_of_context_init. This information
will be used to downgrade a cmd stream flush to a noop.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25849>
2023-10-23 14:56:48 +00:00
Karmjit Mahil
2c62fdc8a7 pvr: Only setup the bgobj to load if we have a load_op
We only need to setup the background object if we have a load_op,
to perform the loads/clears.

This fixes segfaults for cases where we don't have a load_op.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25703>
2023-10-23 08:18:33 +00:00
Eric Engestrom
fc62df19b7 ci/b2c: change artifacts path to match baremetal and LAVA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25815>
2023-10-22 21:23:01 +00:00
Helen Koike
9f4f52f4f3 ci/ci_run_n_monitor: keep monitoring if a job is still running
When running multiple targets, the script was returning if any of the
targets failed.
But sometimes some of the targets are still running and we want to
monitor it until it finishes, even if some of the targets failed.

So check if any targeted jobs are in pending or running before deciding
to finish.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25826>
2023-10-22 09:30:56 +00:00
David Heidelberg
59ee87b606 ci/freedreno: disable Adreno 660 Vulkan pre-merge
No need to move it to manual/nightly - we already run full runs there.

Revert when Adreno 660 gets stable again!

Reported-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25839>
2023-10-22 10:49:10 +02:00
Saroj Kumar
db5fc29116 radeonsi: fixes compilaton error when perfetto is disabled
Signed-off-by: Saroj Kumar <saroj.kumar@amd.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25827>
2023-10-22 05:43:59 +00:00
David Heidelberg
5d87cd4e51 ci/freedreno: fix copy paste causing a618_gl being run only in manual pipeline
Fixes: 9d442b459a ("ci/freedreno: handle disabling farm properly for each FD/Collabora farm")
Closes: #9992

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25816>
2023-10-21 15:36:16 +02:00
Maaz Mombasawala
f4e7aefe07 svga: Unify gmr and mob surface pool managers
The svga driver contains several buffer managers with gmr* and mob* prefixes,
but they are of similar functionality. The underlying vmwgfx kernel driver
allocates memory of one type - mobs if supported by the virtual hardware,
and gmrs otherwise - and returns an opaque pointer to userspace, so several
managers are reduntant.

This patch reduces the number of buffer managers by unifying similar managers
and performing refactors where necessary.

Signed-off-by: Maaz Mombasawala <mombasawalam@vmware.com>

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25832>
2023-10-20 22:01:04 +00:00
Maaz Mombasawala
354f0b5b02 svga: Make surfaces shareable at creation.
There is no need to have a separate shareable pool of surfaces, we can make
all surfaces shareable.
This change makes all surfaces shareable when creating them.

Signed-off-by: Maaz Mombasawala <mombasawalam@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25832>
2023-10-20 22:01:04 +00:00
Yiwei Zhang
b0100d23fb ci/venus: mark more flaky tests after recent cts uprev
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25799>
2023-10-20 21:33:22 +00:00
Helen Koike
46fc9decad ci/marge_queue: add missing python-dateutils to requirements.txt
marge_queue.py requires python-dateutils to run, so add it.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25828>
2023-10-20 18:27:44 +00:00
Lucas Stach
f8753a542b mesa: add GL_APPLE_sync support
This extension is a backport of GL_ARB_sync to GLES 1.1 and 2.0
and reuses token IDs and entry point prototypes from that extension,
so adding support is pretty trivial.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25789>
2023-10-20 17:20:11 +00:00
Karol Herbst
c3516861e8 zink: properly alias shared memory
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25763>
2023-10-20 18:49:47 +02:00
Karol Herbst
389b0ce604 zink: wrap shared memory blocks in a struct
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25763>
2023-10-20 18:49:38 +02:00
David Rosca
2c1dff3851 frontends/va: Fix locking in vlVaBeginPicture
The assert in vlVaSetSurfaceContext would very rarely fail because
the mutex was already unlocked when calling this function from
vlVaBeginPicture.

Keep the lock until returning from vlVaBeginPicture, as that's what
other functions are already doing.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25823>
2023-10-20 15:14:41 +00:00
Vlad Schiller
c70687afe7 pvr: Implement VK_EXT_host_query_reset
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25783>
2023-10-20 14:58:12 +00:00
Vlad Schiller
649ebbb0fb pvr: Implement VK_EXT_texel_buffer_alignment
This commit will implement the VK_EXT_texel_buffer_alignment
extension and add the texture_baseaddress_byte_aligned feature.

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25781>
2023-10-20 14:42:05 +00:00
Vlad Schiller
ea59d61294 pvr: Enable VK_KHR_bind_memory2 extension
The two functions 'vkBindBufferMemory2' and 'vkBindImageMemory2' are aleady
implemented, and it seems that the flag does not need to be enabled for the
tests to pass.

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25779>
2023-10-20 14:26:36 +00:00
Vlad Schiller
1f056f229a pvr: Implement VK_KHR_external_semaphore
In order for the tests to pass, this commit also enables
the VK_KHR_external_semaphore_fd extension.

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25784>
2023-10-20 13:58:07 +00:00
Vlad Schiller
89f9724b1a pvr: Implement VK_KHR_external_fence
In order for the tests to pass, this commit also enables
the VK_KHR_external_fence_fd extension.

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25784>
2023-10-20 13:58:06 +00:00
Lionel Landwerlin
6f3dfba803 anv: document the draw indirect optimization ring mode
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
454870dd5f anv: merge gfx9/11 indirect draw generation shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
11b4c23d19 anv: add ring buffer mode to generated draw optimization
When the number of draw calls is very large, instead of allocating
large amounts of batch buffer space for the draws, use a ring buffer
and process the draw calls by batches.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8645
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
718e77eee5 anv: index indirect data buffer with absolute offset
This will help for a follow up change where we will respawn the shader
multiple times in a loop and the base offset will be edited by the
shader itself.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
db335d9b73 anv: factor out host/gpu internal shaders interfaces
This will prevent host/gpu structure definitions to go out of sync.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
da1e39faa4 util/glsl2spirv: add ability to pass defines
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
c700d47c56 anv: move generation batch fields to a sub-struct
Just tyding things a bit since we're about to add more.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
2e0ff4c551 anv: avoid MI commands to copy draw indirect count
We can just make the address of the count available to the generation
shader.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
1af1085d76 anv: identify internal shader in NIR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
d5aec0ca4b anv: extract out draw call generation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
8ab3c03a32 anv: fix generated draws gl_DrawID with more than 8192 indirect draws
This applies only to Gfx9.

We're writting out of bounds to a wrong location.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 1d9cf8f381 ("anv: add gfx9 generated draw support")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lionel Landwerlin
8aadd4745c anv: move generation shader return instruction to last draw lane
If we dispatch exactly a multiple of 8192 items, there is additional
lane left to generate the jump instruction.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25361>
2023-10-20 13:07:53 +00:00
Lucas Stach
6fc76eb280 Revert "etnaviv: use correct blit box sizes when copying resource"
Revert commit b4c24d5978, as it causes a regression in
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_rgb
and some other testcases. Needs further investigation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10007
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25825>
2023-10-20 13:16:37 +02:00
Emma Anholt
edfbf74df1 dri: Drop a duplicate mesa vs pipe format table.
mesa_format is a typedef of enum pipe_format, and the nice mesa format
names are a subset of the available pipe formats.  No need to keep a
duplicate table here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25650>
2023-10-20 10:03:43 +00:00
Emma Anholt
06fd469110 ci: drop skip for glx-swap-copy.
This will always be a skip now that we dropped GLX_OML_swap_method.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25650>
2023-10-20 10:03:43 +00:00
Emma Anholt
e64ab3e4a9 glx: Delete support for GLX_OML_swap_method.
This was an ill-advised extension.  While we advertised SWAP_COPY support,
we might implement it with a back-copy from the front buffer.  And we
never advertised EXCHANGE because we couldn't guarantee it.  So, if you
actually used this extension to try to reduce app redraws of the back
buffer, you might actually increase the bandwidth you used.  Whoops.

Instead, GLX_EXT_buffer_age and the similar EGL extension give you
feedback on what's left in your back buffer, letting you do minimum
redraws.

This reduces our GLX visual+fbconfig count from 1410 to 940 on an llvmpipe
X server.  Reducing visual counts will improve test runtime for
visual-iterating tests like piglit's glx-visuals-*.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25650>
2023-10-20 10:03:43 +00:00
Eric Anholt
fb95f1d55c ci_run_n_monitor: Poll mesa/mesa and user/mesa for pipelines at the same time.
Now you don't fail if you're trying to test a mesa/mesa MR pipeline and
gitlab takes more than 10s to create it.  And you don't have to wait 10
seconds to get things started (aka see if your regex was right) if you're
testing a user/mesa fork pipeline.

Fixes: 941d92408e ("bin/ci_run_n_monitor: automatically pick MR pipelines when they exist")
Closes: #9894
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25810>
2023-10-20 08:23:24 +00:00
Saleemkhan Jamadar
5f19452b8c radeonsi/vcn: set jpeg reg version for gfx 1150
select appropriate jpeg register version for gfx1150

Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Reviewed-by: Leo Liu <Leo.Liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25278>
2023-10-20 07:32:35 +00:00
Marek Olšák
6835257246 amd/common: update DCC for gfx11.5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25278>
2023-10-20 07:32:34 +00:00
Pierre-Eric Pelloux-Prayer
74978fd8e9 amd, radeonsi: Add code to enable gfx11.5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25278>
2023-10-20 07:32:34 +00:00
Pierre-Eric Pelloux-Prayer
eabd2232e8 ac/nir: extract must_wait_attr_ring helper
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25278>
2023-10-20 07:32:34 +00:00
Pierre-Eric Pelloux-Prayer
b44a886b84 amd/common: add registers for gfx11.5
Built from amd-staging-drm-next c5a7d38c2c7fc + Alex D
"drm/amdgpu: update to the latest GC 11.5 header" patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25278>
2023-10-20 07:32:34 +00:00
Pierre-Eric Pelloux-Prayer
3b4424a4a6 amd/common: update addrlib for gfx11.5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25278>
2023-10-20 07:32:34 +00:00
Sil Vilerino
62fded5e4f d3d12: Allocate d3d12_video_buffer with higher alignment for compatibility
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:33 +00:00
Sil Vilerino
2c828e880f d3d12: Add support for PIPE_VIDEO_CAP_ENC_MAX_TILE_ROWS/COLS
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:33 +00:00
Sil Vilerino
dad77ef235 frontend/va: Add support for VAConfigAttribEncMaxTileRows/Cols
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:33 +00:00
Sil Vilerino
1d5b5bb9e1 d3d12: AV1 Encode - Fix VAConfigAttribEncMaxRefFrames reporting
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:33 +00:00
Sil Vilerino
0f7b7149a8 d3d12: AV1 encode - add fallback for app passing unsupported pic_params.InterpolationFilter
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:33 +00:00
Sil Vilerino
c0e0c82979 d3d12: AV1 encode - Add lower resolution fallback check for uniform tile support
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:32 +00:00
Sil Vilerino
1c1b890be3 d3d12: Do not destroy codec when destroying video buffer
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:32 +00:00
Sil Vilerino
d38fff5907 d3d12: Video Decode - Wait for GPU completion before destroying decoder in-flight objects
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:32 +00:00
Sil Vilerino
09b36aea56 d3d12: Fixes AV1 tx_mode_support reporting and unsupported tx_mode overriding
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:32 +00:00
Sil Vilerino
48172cfa22 d3d12: Upgrade to D3D12 Agility SDK 1.611 Video interface
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:32 +00:00
Sil Vilerino
0996ec3fc6 frontends/va: Add profile param when querying PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL
Pass the specific profile as drivers may only support
quality levels for specific codecs or profiles.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25819>
2023-10-20 01:00:32 +00:00
Juston Li
cd08d331f3 venus: set lvp queries as saturate on overflow
Test case 'dEQP-VK.pipeline.monolithic.timestamp.misc_tests.consistent_results'..
  Fail (Results are inconsistent: B32=0xffffffff B64=0x10103ba2cdd4e G32=0xba2cdd4e G64=0x10103ba2cdd4e)

Fixes: e6cffa1f0e ("venus: use feedback for vkGetQueryPoolResults")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25820>
2023-10-19 23:28:01 +00:00
Lina Versace
904f31edff venus: Fix -Wmaybe-uninitialized
src/virtio/vulkan/vn_ring.c: In function ‘vn_ring_submit’:
  src/virtio/vulkan/vn_ring.c:259:4: warning: ‘cur_seqno’ may be used uninitialized [-Wmaybe-uninitialized]
    259 |    vn_ring_retire_submits(ring, cur_seqno);
        |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25797>
2023-10-19 22:19:00 +00:00
Charmaine Lee
a5ac29d85f svga: ignore sampler view resource if not used by shaders
Currently bound sampler view resources are relevant only if the
currently bound shaders also access them. So when checking for shader
resource collision, we only need to check those shader resources that
are actively used by the shaders.

This fixes a regression with manhattan on SVGA device when only the
active state changes are sent to the driver and a no longer relevant
shader resource is included in the shader resource collision check.
This causes a backing resource to be unnecessarily created and the content
never propagated to the original resource.

Fixes: aaa4b0e618 ("st/mesa: move check_program_state code into _mesa_update_state")
Reviewed-by: Neha Bhenden <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25801>
2023-10-19 22:00:24 +00:00
Mike Blumenkrantz
e36e9bd392 egl/wayland: only add more registry listeners for hardware devices
these extensions shouldn't be exposed for pure software drivers

fixes #9948

Fixes: 1b4e877def ("egl/wayland: use more registry listeners to better handle device init")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25817>
2023-10-19 21:10:43 +00:00
Mike Blumenkrantz
6e73b1c5b2 ci: don't set GALLIUM_DRIVER for zink
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19 17:41:42 +00:00
Mike Blumenkrantz
7d9ea77b45 glx: add automatic zink fallback loading between hw and sw drivers
if loading the default hardware driver fails, implicitly loading zink
should now be preferable to hitting the software fallback now that zink
has all the same capabilities

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19 17:41:42 +00:00
Mike Blumenkrantz
8cd44b8843 egl: add automatic zink fallback loading between hw and sw drivers
if loading the default hardware driver fails, implicitly loading zink
should now be preferable to hitting the software fallback now that zink
has all the same capabilities

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19 17:41:42 +00:00
Mike Blumenkrantz
cedb534a17 egl/glx: don't load non-sw zink without dri3 support
this is going to be broken, so don't bother trying

also add LIBGL_KOPPER_DRI2 so people can continue to footgun if they
really really want to

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19 17:41:42 +00:00
Mike Blumenkrantz
ee04799d82 egl: init dri3 version info during screen creation
no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19 17:41:42 +00:00
Mike Blumenkrantz
1d149575ea egl: unify dri2_egl_display creation
this is the same for all platforms

no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19 17:41:42 +00:00
Saroj Kumar
05206f314c radeonsi: Add tracepoints in radeonsi driver
Add initialization code for u_trace and tracepoints in the
driver code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23664>
2023-10-19 16:16:16 +00:00
Saroj Kumar
7ccdf4f59b radeonsi: Add u_trace init code in radeonsi
Add u_trace initialization and callbacks in new files si_utrace.h/c

Change si_context in si_pipe.h to add si_ds_queue and u_trace to
collect traces.

Add si_record_ts function in si_gfx_cs.c to add timestamp in command
stream.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23664>
2023-10-19 16:16:15 +00:00
Saroj Kumar
a164e147e9 radeonsi: Add perfetto support in radeonsi
Add perfetto code in new files si_perfetto.h/cc which add tracepoint
begin and end event and calls to the generated code from python
si_tracepoints.py

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23664>
2023-10-19 16:16:15 +00:00
Timur Kristóf
4752b188dc radv: Wait for bottom of pipe in ACE gang wait postamble.
This makes sure that the semaphore is only written when all work
on the compute queue is finished.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
ff6c585121 radv: Add queue family argument to some functions.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
12a753f8d2 radv: Use new WRITE_DATA helper in more places.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
107473162e radv: Refactor WRITE_DATA helper function.
Create a version of this function that takes a CS and queue family.
move it to radv_cs.h so it can be called from multiple other files.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
1b988af0ad radv: Move radv_cp_wait_mem to radv_cs.h and add queue family argument.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
cd41d9e96d radv: Only call si_cp_dma_wait_for_idle on GFX and ACE queues.
This command is only supported on GFX and ACE.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
614bb47cbf radv: Use const on vi_alpha_is_on_msb arguments.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
ff39212e28 radv: Use const device argument in radv_sdma_copy_buffer.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Timur Kristóf
320e20db68 radv: Rename SDMA file to radv_sdma.c
It already contains more than just the buffer image copies.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25770>
2023-10-19 14:35:00 +00:00
Faith Ekstrand
baa8487c28 nvk: Implement VK_EXT_dynamic_rendering_unused_attachments
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9632
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25813>
2023-10-19 14:06:07 +00:00
Faith Ekstrand
131d05da7b nvk: Enable descriptorIndexing
This is the Vulkan 1.2 equivalent of VK_EXT_descriptor_indexing
extension enable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25812>
2023-10-19 13:13:54 +00:00
Faith Ekstrand
075219e58f nvk: Advertise shaderOutputLayer and shaderOutputViewportIndex
We already advertise the extension but it's moved into feature bits in
Vulkan 1.2 and we didn't have those turned on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25812>
2023-10-19 13:13:54 +00:00
Faith Ekstrand
18af014f7c nvk: Re-arrange Vulkan 1.2 features to match the header
Also, conditional render ended up in the Vulkan 1.2 section which is
wrong.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25812>
2023-10-19 13:13:54 +00:00
Faith Ekstrand
b80575a38a features: Mark VK_EXT_attachment_feedback_loop_layout done for NVK
Fixes: c93b30daa3 ("nvk: Advertise VK_EXT_attachment_feedback_loop_layout")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25812>
2023-10-19 13:13:53 +00:00
Faith Ekstrand
c93b30daa3 nvk: Advertise VK_EXT_attachment_feedback_loop_layout
We don't need to do anything with the layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25808>
2023-10-19 10:11:36 +00:00
Lionel Landwerlin
5d76b03a3e anv: uninitialize queues before utrace
We need to shut down the runtime queue threads before tearing down
anything else.

Gets rid of helgrind errors like this :

==212772== Possible data race during write of size 4 at 0xADCBFB0 by thread #1
==212772== Locks held: 1, at address 0x6B8F260
==212772==    at 0x8AC3EFF: simple_mtx_destroy (simple_mtx.h:97)
==212772==    by 0x8ACB24D: intel_ds_device_fini (intel_driver_ds.cc:603)
==212772==    by 0x6CBD4D4: anv_device_utrace_finish (anv_utrace.c:471)
==212772==    by 0x6C71577: anv_DestroyDevice (anv_device.c:3679)
==212772==    by 0x6B2F1E2: loader_layer_destroy_device (loader.c:4358)
==212772==    by 0x6B3F10B: vkDestroyDevice (trampoline.c:983)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: cc5843a573 ("anv: implement u_trace support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10010
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25805>
2023-10-19 09:45:36 +00:00
Eric Anholt
0603ac7b00 ci/freedreno: Generalize the implicit_unmap timeouts.
dedicated_alloc.image caused a job flake today.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25804>
2023-10-19 09:18:01 +00:00
Lionel Landwerlin
9bea6e02b8 anv: don't uninitialize bvh_bo_pool is not initialized
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3e8d2617e1 ("anv: use buffer pools for BVH build buffers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10009
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25802>
2023-10-19 08:40:22 +00:00
Eric Anholt
42f53a2155 ci/zink: Cut zink-lvp coverage in half.
It's taking 23 minutes of deqp-runner time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:16 +00:00
Eric Anholt
b1eef3094f ci/freedreno: Move skqp testing to a618.
The limozeen runners are quite under-committed, while we had 10 jobs
running for our 9 cheza runners, causing an unnecessary wait even when the
farms were idle.

I've removed the old 630 skqp bits, so we can just track what's being
tested on 618.  618 had skqp toml and xfails laying around alreaady.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:16 +00:00
Eric Anholt
a4110026ea ci/freedreno: Fold a630_egl into a630_gl.
The GL job was only taking 5 minutes in deqp, and egl is 2 minutes.  Saves
a boot, and gets us closer to starting all a630 jobs at the same time if
the farm was idle.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:16 +00:00
Eric Anholt
20284af29b ci/iris: Drop parallel on kbl piglit to 2.
We have only 6 of these boards since one died in May, and 7 jobs allocated
to them.  So you ended up with a 5 minute delay on each pipeline with an
otherwise-idle farm while you waited for the first batch of jobs to
complete so you could get the last one started.  It turns out that piglit
was taking 3 minutes of runtime each, so we can just shard piglit 2 ways,
stay under runtime, and not over-allocate the farm

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:16 +00:00
Eric Anholt
40be79dc9f ci/bare-metal: Default our boards to a 20-minute timeout for the whole job.
If the test time is 10 minutes, and boot is 1.5 minutes, that gives you
8.5 minutes of slop for intermittent costs like container download.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:15 +00:00
Eric Anholt
97b2afa16a ci/bare-metal: Drop the 2 vs 1 exit code from poe_run.
This exit code was used for the intra-job retries on the other bare-metal
run scripts, but poe_run doesn't do that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:15 +00:00
Eric Anholt
e2e3e4cbf3 ci: Stop doing internal retries in bare-metal.
We have job-level retry on failure now, and will continue to need to in
order to work around fd.o infrastructure flakes.  If we stop doing retry
inside the job, then we can crank down the gitlab-level timeouts on test
jobs to be closer to our CI guidelines and avoid blocking a runner for an
hour when things go wrong (for example, cheza #16 failing to boot in a
recognized way and continuously looping due to the intra-job retry).
Plus, the job logs will be more readable when you don't have two boots in
one job, and we'll get the flakes surfaced in our monitoring dashboards.

If internal retries were really doing useful work we may see an increase
in flakes as a result of this.  I'm committing to turning off boards or
reducing coverage as necessary to handle this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:15 +00:00
Eric Anholt
cf8f60fc64 ci/zink: Only test half of piglit pre-merge on anv.
Unfortunately we're at 16 minutes of runtime for this job, which is much
too far past our guidelines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25790>
2023-10-19 07:42:15 +00:00
Mike Blumenkrantz
0d2923dfbb zink: fix legacy depth texture rewriting for single component reads
if only a single component is read, this instruction can (and must) be
rewritten to use that component since depth sampling in vulkan is single-component

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25795>
2023-10-19 00:09:59 +00:00
Mike Blumenkrantz
b3e864b326 zink: update pointer for GPL pipeline cache entry formats
this otherwise points to ctx->gfx_pipeline_state.rendering_formats,
which is broken for background compiles

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25795>
2023-10-19 00:09:59 +00:00
Mike Blumenkrantz
ad72772d93 nir/lower_fragcolor: preserve location_frac
this otherwise breaks component-based outputs

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25794>
2023-10-18 23:02:45 +00:00
Lina Versace
71599a1a20 venus: Enable VK_EXT_graphics_pipeline_library behind debug flag
Until the performance issues get resolved, enable the extension
if `VN_DEBUG=gpl`.

Also enable the required (and trivial) VK_KHR_pipeline_library.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
a65ac274ac venus: Do pipeline fixes for VK_EXT_graphics_pipeline_library
Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
258f04a426 venus: Refactor pipeline fixup into two stages
Function vn_fix_graphics_pipeline_create_infos() had two interleaved
phases: discovery of needed fixes, and application of those fixes.
Move the discovery phase into new function
vn_find_graphics_pipeline_create_info_fixes(). The two-phase approach
will be simplify the implementation of VK_EXT_graphics_pipeline_library.

No intended change in behavior.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
732c8aa2b7 venus: Renames for VkGraphicsPipelineCreateInfo fixes
Use a more consistent naming scheme for everything. Follow-up patches
will implement VK_EXT_graphics_pipeline_library, which will make the
code significantly more complex, in which better names will make the
code more readable.

Except for replacing `any_fix` with `erase.mask`, this patch does modify
any procedural code. It merely renames structs and fields.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
197f485757 venus: Add enum vn_pipeline_type
No change in behavior.  Prepares for storing more state in graphics
libraries for VK_EXT_graphics_pipeline_library.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
1d4822d894 venus: Use VkImageAspectFlags in vn_subpass
No intended change in behavior. This little improvement will help
vn_pipeline track its graphics state more accurately.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
8b0b1f5d39 venus: Drop incorrectly-used always-true pipeline vars
When writing vn_fix_graphics_pipeline_create_info() long ago, I defined
some always-true dummy vars that represented some
VkGraphicsPipelineLibraryFlagsEXT. In the conditions that decide which
state to fixup, I used the dummy vars.

My intent was that this would ease the implementation of
VK_EXT_graphics_pipeline_library, because some of the GPL fixup logic
would already be present.  I was wrong. After I studied GPL more,
I discovered that the conditions were using the dummy vars incorrectly.
The incorrect usage produced no bugs, because the vars are always true.

Delete the dummy vars.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
b0530d2c94 venus: Fix subpass attachments
We must check for VK_ATTACHMENT_UNUSED.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
904df222ef venus: Fix crash when VkGraphicsPipelineCreateInfo::layout is missing
With VK_EXT_graphics_pipeline_library, the layout may be omitted or
ignored in incomplete pipelines.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:16 -07:00
Lina Versace
11f31f137c venus: Erase pViewports and pScissors in fewer cases
We should avoid erasing VkGraphicsPipelineCreateInfo when possible
because the erasure add cpu overhead. Do not erase pViewports if
viewportCount is 0. Do not erase pScissors if scissorCount is 0.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:16 -07:00
Lina Versace
9a93ed7b56 venus: Sync protocol for VK_EXT_graphics_pipeline_library
Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:16 -07:00
Karol Herbst
74ef0d4f93 asahi: flush denorms on exact fmin/fmax
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25788>
2023-10-18 17:10:02 +00:00
Timur Kristóf
d7f5ff402a ac: Add rudimentary implementation of printing SDMA IBs.
This isn't meant to be exhaustive and only prints the packets
and fields which were interesting to me during debugging the
RADV transfer queue implementation.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>
2023-10-18 16:29:01 +00:00
Timur Kristóf
90455ac864 ac: Print IP type for IBs.
This makes it clearer what is what when reading IBs
for debugging purposes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>
2023-10-18 16:29:01 +00:00
Timur Kristóf
05d74265dc ac: Rename ac_do_parse_ib to parse_pkt3_ib.
This function only parses PKT3 packets, not other types.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>
2023-10-18 16:29:01 +00:00
Timur Kristóf
dfcb8d4784 ac: Add amd_ip_type argument to ac_parse_ib and ac_parse_ib_chunk.
The current parser only supports PKT3 packets, but not all HW IP
types use this format. This makes it possible to support more
than one format depending on the IP type.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>
2023-10-18 16:29:01 +00:00
Timur Kristóf
b44a616253 ac: Clarify SDMA opcode defines.
Make the naming of these defines consistent with others.
And add a few new opcodes and related definitions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>
2023-10-18 16:29:01 +00:00
Timur Kristóf
375a14234f ac/gpu_info: Add some SDMA related information.
SDMA only supports sparse resources on GFX9+.
SDMA only supports DCC and HTILE on GFX10+.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>
2023-10-18 16:29:01 +00:00
David Rosca
37996c757f frontends/va: Implement vaMapBuffer2
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25620>
2023-10-18 16:07:19 +00:00
Vlad Schiller
12e4fa19df pvr: Enable VK_KHR_uniform_buffer_standard_layout
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25708>
2023-10-18 15:51:56 +00:00
Vlad Schiller
a2e0701428 pvr: Enable KHR_image_format_list
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25707>
2023-10-18 15:35:28 +00:00
Vlad Schiller
2adaa765ba pvr: Enable VK_EXT_scalar_block_layout
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25706>
2023-10-18 15:20:24 +00:00
Marek Olšák
10a2fbd42b radeonsi/ci: update failures and flakes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25774>
2023-10-18 14:26:37 +00:00
Marek Olšák
e1a1150142 radeonsi/ci: enable GLES CTS in the runner
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25774>
2023-10-18 14:26:37 +00:00
Marek Olšák
eb79a3bb98 radeonsi/ci: enable GTF tests in the runner
These are closed-source CTS tests we have always been building.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25774>
2023-10-18 14:26:37 +00:00
Marek Olšák
ff9e883246 radeonsi/ci: update the runner for new build scripts
Needed for the new build scripts at:
  https://github.com/marekolsak/marek-build
which is needed for:
- updating deqp to main
- updating glcts to opengl-cts-4.6.3

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25774>
2023-10-18 14:26:37 +00:00
Mike Blumenkrantz
084e22cfd8 zink: ignore unacquired swapchain images during end-of-frame flush
> Use of a presentable image must: occur only after the image is returned by flink:vkAcquireNextImageKHR, and before it is released by flink:vkQueuePresentKHR.
> This includes transitioning the image layout and rendering commands.

fixes #10005

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25787>
2023-10-18 13:51:57 +00:00
Samuel Pitoiset
6cfb40a338 ci: bump DEQP_FRACTION for some jobs
Otherwise it can't complete in a reasonable amount of time.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25476>
2023-10-18 12:52:37 +00:00
Samuel Pitoiset
8f63419733 ci: bump the number of tests per group from 500 to 5000 for Vulkan drivers
Except for lvp which already forces 1.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25476>
2023-10-18 12:52:37 +00:00
Samuel Pitoiset
ef0997baf1 ci: update CTS to vulkan-cts-1.3.7.0
This contains many new tests, especially shader object tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25476>
2023-10-18 12:52:37 +00:00
Faith Ekstrand
c924f6908f nvk: Advertise VK_EXT_primitive_topology_list_restart
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9645
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25786>
2023-10-18 12:33:51 +00:00
Faith Ekstrand
1d5270bf39 nvk: Implement VK_EXT_image_sliced_view_of_3d
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9637
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25785>
2023-10-18 12:19:40 +00:00
Lionel Landwerlin
53a4738eb1 anv: track render targets & render area changes separately
The following instructions :
   - 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP
   - 3DSTATE_VIEWPORT_STATE_POINTERS_CC
   - 3DSTATE_SCISSOR_STATE_POINTERS

do not care about the content/format/count of the render targets, only
the size of the render area and count of viewport/scissor.

By tracking render targets & render area we can reduce the emission of
those instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25778>
2023-10-18 13:43:51 +03:00
Lionel Landwerlin
c0b6ce0aac anv: reuse local variable for gfx state
No functional change.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25778>
2023-10-18 13:43:48 +03:00
Faith Ekstrand
d3edbf6935 nvk: Advertise VK_KHR_workgroup_memory_explicit_layout
It's all done for us in NIR.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9623
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25780>
2023-10-18 09:13:41 +00:00
David Rosca
6ababdcd10 radeonsi: Fix plane size in si_copy_multi_plane_texture
Size was wrong and also need to scale sbox xy.

Fixes: 4f047c9583 ("radeonsi: Copy all planes with multi-plane staging textures")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25737>
2023-10-18 08:44:22 +00:00
Konstantin Seurer
b2cdbfc2ef radv/rt: Use nir_shader_instructions_pass for lower_rt_instructions
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25187>
2023-10-18 08:18:50 +00:00
Sid Pranjale
459f18b866 nvk: Enable VK_EXT_load_store_op_none
VK_ATTACHMENT_STORE_OP_NONE_EXT is already supported via VK_KHR_dynamic_rendering, logic dictates it shouldn't need much else for VK_ATTACHMENT_LOAD_OP_NONE_EXT.
CTS is passing with the following results on dEQP-VK.renderpass*.load_store_op_none.* tests
Test run totals:
  Passed:        78/110 (70.9%)
  Failed:        0/110 (0.0%)
  Not supported: 32/110 (29.1%)
  Warnings:      0/110 (0.0%)
  Waived:        0/110 (0.0%)

Requires !24596 to achieve parity with proprietary driver

Closes #9638

Signed-off-by: Sid Pranjale <sidpranjale127@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25771>
2023-10-18 07:51:04 +00:00
Konstantin Seurer
f2ae21758f llvmpipe: Compile a nop texture function for unsupported configurations
Fixes a crash in Quake II RTX. Maybe the texture sample codegen will be
more robust in the future so we do not need to work around its
limitations here.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25617>
2023-10-18 09:14:30 +02:00
Chia-I Wu
6e2bb716b0 util: improve BITFIELD_MASK and BITFIELD64_MASK on clang
gcc is able to optimize away either the modulo or the logical and.  This
makes no difference to gcc.

clang is only able to optimize away the logical and.  This allows clang
to generate faster code for BITFIELD_MASK.

As for BITFIELD64_MASK, this also makes no difference to clang except it
fixes a compile error for BITFIELD64_MASK(64):

  error: shift count >= width of type [-Werror,-Wshift-count-overflow]

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9989
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25757>
2023-10-18 03:20:24 +00:00
Marek Olšák
35ae5dce39 mesa: don't pass Infs to the shader via gl_Fog.scale
This is for GLSL versions where Infs are undefined.

It also helps piglit/glsl-fs-fogscale that breaks when we move the fragment
shader code into the vertex shader across interpolation.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Jesse Natalie on IRC
Acked-by: Erico Nunes on Gitlab
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25391>
2023-10-18 02:15:15 +00:00
Emma Anholt
91da6be8ce glsl: Remove lower_discard().
Replaced by the new NIR pass.

i915g results:
total instructions in shared programs: 510678 -> 510714 (<.01%)
total temps in shared programs: 30429 -> 30426 (<.01%)

rv370 results:
total instructions in shared programs: 737649 -> 737656 (<.01%)
instructions in affected programs: 82 -> 89 (8.54%)
total temps in shared programs: 112093 -> 112094 (<.01%)
temps in affected programs: 6 -> 7 (16.67%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24763>
2023-10-18 01:27:04 +00:00
Emma Anholt
c5712410ec nir: Flatten ifs with discards in nir_opt_peephole_select for HW without CF.
i915g and r300-r400 don't have if statements, and discards are all
nir_intrinsic_discard_if.  We can flatten those discards here, saving a
separate GLSL pass to try to do so.

i915g:
GAINED: shaders/closed/xcom-enemy-unknown/413.shader_test FS

rv370:
GAINED: shaders/closed/xcom-enemy-unknown/12.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/122.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/132.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/145.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/146.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/19.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/413.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/415.shader_test FS

Closes: #9918
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24763>
2023-10-18 01:27:04 +00:00
Emma Anholt
2c4d5c6aec i915: Make I915_DEBUG=fs log shaders that fail to link due to CF.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24763>
2023-10-18 01:27:04 +00:00
Mike Blumenkrantz
9a8956bb77 lavapipe: VK_EXT_nested_command_buffer
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25615>
2023-10-17 23:37:31 +00:00
Mike Blumenkrantz
10c2180a92 zink: add automatic swapchain readback using heuristics
in cases where apps (stupidly) do swapbuffers->blitframebuffer, there's
no functional way to (legitimately) perform readback on the just-presented
vk image, which leads to the existing acquire+present loop dance

this adds a counter threshold which, when exceeded, begins copying the
scanout image for swapchains to provide local readback on images without
the massive perf penalty of roundtrips

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25754>
2023-10-17 23:10:56 +00:00
Mike Blumenkrantz
5f16f52dfa zink: fix readback_present locking
queue needs to always be locked and presentation fence should be waited on

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25754>
2023-10-17 23:10:55 +00:00
Mike Blumenkrantz
0c2045553f zink: use screen destructor for creation fails
this should be more robust

fixes https://github.com/pal1000/mesa-dist-win/issues/155

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663>
2023-10-17 22:43:54 +00:00
Mike Blumenkrantz
9bb404317e zink: reorder glsl_type_singleton_init_or_ref call
this enables the screen destructor to be used on failure cases

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663>
2023-10-17 22:43:54 +00:00
Mike Blumenkrantz
fcf3f7d28f zink: don't destroy uninitialized disk cache thread
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663>
2023-10-17 22:43:54 +00:00
Mike Blumenkrantz
dfd6a2d878 zink: don't destroy any simple_mtx_t objects during screen destroy
these don't allocate anything on init, but they assert if destroy is
called without an init, which is annoying for error handling

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663>
2023-10-17 22:43:54 +00:00
Mike Blumenkrantz
01f2aa846e zink: add some checks to determine whether queue is init on screen destroy
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663>
2023-10-17 22:43:53 +00:00
Robert Mader
7a7e577d8e iris: Support parameter queries for main planes
In order to return correct offsets, strides and possibly other
parameters. This is relevant for formats like NV12 and P010 where
the second plane, when produced by the Intel VAAPI decoder, uses the
same FD like the first one, but with an offset.

Right now there are only two modifiers with well defined indices
of auxiliary planes for semi-planar formats according to the local
copy of drm_fourcc.h, `I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS` and
`I915_FORMAT_MOD_4_TILED_MTL_MC_CCS`, sharing the same layout.
Assume that future `MC_CCS` modifiers will get defined accordingly
for now.

Cc: mesa-stable
Tested-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9952
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25603>
2023-10-17 22:16:22 +00:00
Leandro Ribeiro
2be404f557 egl: error out if we can't find an EGLDevice in _eglFindDevice()
Follow up of "egl/drm: get compatible render-only device fd for kms-only
device". Now we can properly error out when we don't find the EGLDevice
in _eglFindDevice().

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
88c03ddd34 egl/drm: get compatible render-only device fd for kms-only device
Things have been working by accident for split display/render SoCs when
using the GBM platform.

The device fd given to the GBM platform may be associated with a
KMS-only device, so _eglFindDevice() should find nothing (because the
global EGLDevice list only has render-capable devices). The only thing
making it work is that we don't error out when we go through the
EGLDevice list and can't find the device we are looking for. We simply
return the last EGLDevice from the list.

This patch fixes that. Now we look for a compatible render-only device
for the KMS-only in the GBM platform.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
e10d8cd5dd loader: add loader_is_device_render_capable()
Add helper function to check if a device is render-capable.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
9ec9849c85 kmsro: try to use only compatible render-capable devices
Since commit "pipe-loader: add
pipe_loader_get_compatible_render_capable_device_fd()", we have a
function to query a render-only driver that is available and is
compatible with the KMS-only device.

So start to use it, instead of selecting whatever render-only driver is
available to use.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
4d953efc28 dri: add queryCompatibleRenderOnlyDeviceFd() to __DRI_MESA extension
With this change we are able to query the render node fd of a
render-only device compatible with a given KMS-only device (at the
egl/dri2 level).

It uses pipe_loader_get_compatible_render_capable_device_fd(), which was
added in commit "pipe-loader: add
pipe_loader_get_compatible_render_capable_device_fd()".

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
2b6a421915 pipe-loader: add pipe_loader_get_compatible_render_capable_device_fd()
pipe_loader_get_compatible_render_capable_device_fd() receives the fd of
a KMS-only platform device, find a compatible render-only device that is
available and returns the fd of its DRM render node.

This function will be helpful to fix a long standing issue that is
preventing us to add support for EGL_EXT_device_drm_render_node for
split display/render SoCs. And it will also help KMSRO to select a
render-only driver that we are sure that is compatible, because
currently KMSRO uses whatever render-only driver is available.

In sort, in the EGL GBM platform case, the GBM device may be created
with a KMS-only device. The information of what render driver will be
selected by KMSRO is not available before creating the EGLDevice global
list. Without this information we don't have a render node to use in the
EGL_EXT_device_drm_render_node query. We've tried to fix this before,
but failed. See [1-2].

For the moment, this function only works for platform KMS-only devices.
For other types of KMS-only devices, we'll need to add more heuristics.

[1] Detailed explanation of the issue:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5591

[2] Previous attempt to fix:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12796

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
3c977f55f5 loader: add driver list as parameter in loader_open_render_node_platform_device()
In a later commit in this series, we'll need to open the first supported
render-only platform device that we can find.

In order to avoid calling loader_open_render_node_platform_device()
multiple times (what is quite expensive), change this function to take a
driver list (instead of a single driver name) as parameter.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Leandro Ribeiro
cd2854ccfb loader: rename loader_open_render_node() to loader_open_render_node_platform_device()
This function ignore devices that are not on the platform bus. So rename
it to better reflect that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>
2023-10-17 20:31:13 +00:00
Yiwei Zhang
3fdea1567d venus: properly expose KHR_external_fence/sempahore_fd
Summary:
1. hide those extensions for vtest since there's no export support
2. do block waiting upon export without implicit fencing support

Fixes: 68a478870d ("venus: expose KHR_external_fence/sempahore_fd extensions")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25633>
2023-10-17 20:12:07 +00:00
Faith Ekstrand
4591c525ea nvk: Implement VK_EXT_depth_bias_control
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9628
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25765>
2023-10-17 18:35:03 +00:00
Faith Ekstrand
8639c311bd nvk: Re-sort device features
Vulkan versions, then KHR, then EXT, then vendor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25765>
2023-10-17 18:35:03 +00:00
Faith Ekstrand
c6509ffcea nvk: Add a nvk_cmd_buffer_dirty_render_pass() helper
This makes the dirtying work properly in the case where dynamic
rendering is being used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25765>
2023-10-17 18:35:03 +00:00
Felix DeGrood
b561bcd78c anv: set ComputeMode.PixelAsyncComputeThreadLimit = 4
Heuristic-based optimization throttling CCS work (async compute).
Without throttling, background compute work consumes all threads,
deminishing performance gains by running dispatch in parallel with
3D work.

Optimization is heuristics based, meaning a workload might slow
down when using async compute.

Best value: PixelAsyncComputeThreadLimit = 4. On DG2, this
equates to a max CCS thread occupancy of 37.5%.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25508>
2023-10-17 18:09:29 +00:00
Marek Olšák
8ff4847b64 nir/algebraic: use only signed_zero_preserve_* for addition by 0 patterns, etc.
Some GLSL versions will set inf_preserve but not the other flags.
Additions by 0 only affect signed zeros.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25392>
2023-10-17 17:27:12 +00:00
Marek Olšák
f3886e9c02 nir: split FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP* flags
GLSL doesn't preserve NaNs, but it optionally preserves Infs.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25392>
2023-10-17 17:27:12 +00:00
Rohan Garg
b94b784492 anv: fix debug string for PC flush
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Fixes: fc5cb54 ('anv: Add debug messages for DEBUG_PIPE_CONTROL')
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25690>
2023-10-17 14:31:16 +00:00
Lucas Stach
336799481d etnaviv: zero shared TS metadata block
Make sure to zero the shared TS metadata memory. Without this invalid
TS data may be mistaken as being valid, causing GPU hangs.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25751>
2023-10-17 13:34:19 +00:00
Lucas Stach
b4c24d5978 etnaviv: use correct blit box sizes when copying resource
The padded width/height is stored in samples, while the blit box
dimensions need to be specified in pixels. Use the unpadded
width/height of the resource levels to generate the blit box
dimensions used to copy a resource. The blit code already extends
those sizes to the padded sizes when necessary and possible.
Fixes crashes in some piglit tests with MSAA active.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25751>
2023-10-17 13:34:19 +00:00
Vinson Lee
5612f9a704 broadcom/qpu: Remove duplicate variable opcode
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In opcode = opcode = desc->opcode_first, opcode is
written twice with the same value.

Fixes: 3b20208f03 ("broadcom/qpu: add pack/unpack support for v71")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25735>
2023-10-17 12:31:33 +00:00
Lionel Landwerlin
b207608995 intel/ds: provide names for different events of a timeline's row
Previously all items on a timeline row would have the same name. This
change uses the tracepoint names to put into the timeline instead.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25730>
2023-10-17 11:19:13 +00:00
Lionel Landwerlin
6499c43cc7 u_trace: generate tracepoint name array in perfetto header
The driver glue doesn't have access to that information in a
centralized place. If you want to generate perfetto iid, you need
access to all names.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25730>
2023-10-17 11:19:13 +00:00
Lionel Landwerlin
1afc876afd u_trace: generate tracepoint index parameter in perfetto callbacks
Useful to figure out what's the tracepoint name you're implementing.
We'll use this in the intel perfetto integration glue to index into an
array of perfetto iid.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Felix DeGrood <felix.j.degrood@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25730>
2023-10-17 11:19:13 +00:00
Hyunjun Ko
960441d5a3 anv: don't flush_llc on gen9
Fixes: 3d993e63bb ("anv: Enable barrier handling on video engines ")
Closes: mesa/mesa#9988

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25762>
2023-10-17 12:28:06 +02:00
Gert Wollny
e891c78af1 virgl: Fix logic for reporting PIPE_MIRROR_CLAMP
Fixes: 9efe50c83 (virgl: report MIRROR_CLAMP features better)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25755>
2023-10-17 08:55:29 +00:00
Dave Airlie
d6613deed9 intel-clc: avoid using spirv-linker.
There is not real need to use the spirv-linker here at all,
we can just read all the CL C files into one buffer, then compile
that buffer in a single pass.

This worksaround an issue seen with llvm17 and opaque pointers
and the spirv linker.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25759>
2023-10-17 13:53:52 +10:00
Marek Olšák
843f2eb3c8 radeonsi/ci: update gfx1100 results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25484>
2023-10-17 00:31:07 +00:00
Marek Olšák
8211635c44 winsys/amdgpu: don't send CP_GFX_SHADOW chunk if shadow address is not set
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25484>
2023-10-17 00:31:07 +00:00
Marek Olšák
6224630e43 radeonsi: disable register shadowing without SR-IOV to fix bad performance
Fixes: f71607c8d3 - radeonsi/gfx11: enable register shadowing by default

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25484>
2023-10-17 00:31:07 +00:00
Marek Olšák
865cab6a1c ac/gpu_info: don't allow register shadowing with SR-IOV due to bad performance
This is only for gfx11.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25484>
2023-10-17 00:31:07 +00:00
Adam Jackson
6e20f820c6 docs: Mention 'meson devenv' in the pre-install test instructions
Also immunize ourselves against section renumbering.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25686>
2023-10-17 00:08:44 +00:00
Iván Briano
abf5eb5753 anv: advertise VK_KHR_global_priority_queue
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25758>
2023-10-16 23:39:58 +00:00
Friedrich Vock
f8eec4c4e3 radv/rt: Reject hits within 10ULP of previous hits in emulated RT
This is an alternative workaround that fixes double hits on shared edges
failing some watertightness CTS tests.

Fixes: e034ba1c44 ("radv/rt: Miss rays that hit the triangle's v edge")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24093>
2023-10-16 23:10:20 +00:00
Lionel Landwerlin
f900b763b1 anv: workaround Gfx11 with optimized state emission
No real explanation so far.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9781
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25750>
2023-10-16 19:48:28 +00:00
Marek Olšák
d8a41a27b9 winsys/amdgpu: pad gfx and compute IBs with only 1 NOP
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
87e9fafaa8 winsys/amdgpu: correctly pad noop IBs for RADEON_NOOP=1
We need to use ib_pad_dw_mask, not ib_alignment.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
e6d4552b67 winsys/amdgpu: properly pad the IB in amdgpu_submit_gfx_nop
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
5a5629f766 ac/gpu_info: set gfx and compute IB padding to only 8 dwords
This is what the kernel reports and what PAL seems to be doing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
395b7ce364 ac/gpu_info: conservatively decrease IB alignment and padding to 256B
This should be large enough for all engines.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
42aedd627e ac/gpu_info: drop the hack unifying all IB alignments
We overalign it anyway, so there is no change in behavior.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
5edc0da8ec ac/gpu_info: move ib_pad_dw_mask into ip[]
No change in behavior.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:34 +00:00
Marek Olšák
e0813c5477 ac/gpu_info: split ib_alignment as ip[type].ib_alignment
No change in behavior. The previous overalignment is preserved.

It sets ib_pad_dw_mask sooner.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25578>
2023-10-16 16:16:33 +00:00
Thong Thai
cba898a530 frontends/va/config: report max width and height for encoding/decoding
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25716>
2023-10-16 15:14:48 +00:00
Gert Wollny
3fae614286 r600/sfn: When simplifying src vec4 pinnings, also check all uses
If a value would be used e.g. as Rn.x___ and also as Rn.xy__, in two
different instructions , then the first use was removing the group
property if Rn.x, which then broke the use in the second case, because
RA didn't see anymore, that Rn.x and Rn.y must be allocated with the
same register ID "n".

Fixes: c23604324b (r600/sfn: copy-propagate single source texture values)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9998

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25741>
2023-10-16 14:21:01 +00:00
Gert Wollny
e9c21952aa r600/sfn: Don't override a chgr pinning during copy propagation
Fixes: c0b6c59e0 (r600/sfn: Copy propagate into TEX source)
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9998

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25741>
2023-10-16 14:21:01 +00:00
Faith Ekstrand
7fb561eff2 vulkan/wsi: Allow for larger linear images
For images of size 32768 × 32768 (which NVK allows), the linear image
ends up being 4GB which overflows the uint32_t size as well as some of
our alignment calculations.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25729>
2023-10-16 13:02:14 +00:00
Faith Ekstrand
7a83109835 nvk: Clean up the disk cache on physical device create fail path
Fixes: a4f8fd9dd5 ("nvk: Hook up the disk cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25749>
2023-10-16 05:58:58 -05:00
Faith Ekstrand
922e6e5423 nvk: Handle unbinding images and buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25747>
2023-10-16 09:40:59 +00:00
Faith Ekstrand
0c84c55972 nvk: Add an nvk_shader_finish() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25747>
2023-10-16 09:40:59 +00:00
Faith Ekstrand
112be1901b nvk: Free the disk cache
Fixes: a4f8fd9dd5 ("nvk: Hook up the disk cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25747>
2023-10-16 09:40:59 +00:00
Faith Ekstrand
16725e4d70 nvk: Use nouveau_ws_bo_unmap() instead of munmap()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25747>
2023-10-16 09:40:59 +00:00
Hannes Mann
7881874847 vulkan/wsi/wayland: Fix detection of tearing control protocol
Fixes: 5ceba97c2e ("vulkan/wsi/wayland: add support for IMMEDIATE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25689>
2023-10-16 09:06:24 +00:00
Erik Faye-Lund
a4845e9c43 bin/gen_release_notes: escape at-symbols
If we don't do this, we end up with email-alike strings to be turned
into mailto links. This is not what we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25712>
2023-10-16 08:59:07 +00:00
Erik Faye-Lund
9a3bd255b6 docs/relnotes: escape some at-symbols
These are not e-mail addresses, and shouldn't have mailto links...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25712>
2023-10-16 08:59:07 +00:00
Erik Faye-Lund
42a1940a9f docs/ci: escape at-symbols
These aren't email addresses, so let's not format them as if they were.

Fixes: 9314950726 ("ci: Add docs for Linux Kernel uprevs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25712>
2023-10-16 08:59:06 +00:00
Erik Faye-Lund
570306e7b9 docs/relnotes: remove cruft from end of lines
We don't include the full commit message here, so let's drop all of this
cruft. Not sure how this happened in the first place.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25712>
2023-10-16 08:59:06 +00:00
Eric Engestrom
042d256c1e util/xmlconfig: inline datadir
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21808>
2023-10-16 07:59:38 +00:00
Eric Engestrom
44b0764930 util/xmlconfig: drop driInjectDataDir() now that DRIRC_CONFIGDIR is always supported
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21808>
2023-10-16 07:59:38 +00:00
Erik Faye-Lund
128c2bdf73 meson: add src/util to the drirc search path
With this, we pick up new in-tree defaults for driconfig variables
when using meson devenv. This is useful for testing new config
variables.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21808>
2023-10-16 07:59:38 +00:00
Erik Faye-Lund
6c5a9ede64 util/xmlconfig: add an env-var for overriding drirc search dir
This adds an environment variable that can be used to override the
global drirc serach directory. This can be useful for debugging, and
meson devenv, as used in the following commit.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21808>
2023-10-16 07:59:38 +00:00
Karol Herbst
ccdea7bbeb rusticl/format: disable all sRGB formats
Fixes: 714e11fe04 ("rusticl/format: enable all trivial to support optional image formats")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25739>
2023-10-15 21:28:15 +00:00
Karol Herbst
bdd255bd04 rusticl/memory: use PIPE_BUFFER for IMAGE1D_BUFFER images
Fixes samplerless 1Dbuffer tests with Zink.

Fixes: 20c90fed5a ("rusticl: added")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25739>
2023-10-15 21:28:15 +00:00
Karol Herbst
e79d9a9cc8 rusticl/device: restrict 1Dbuffer images for RGB and RGBx
Fixes: 20c90fed5a ("rusticl: added")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25739>
2023-10-15 21:28:15 +00:00
Karol Herbst
832efd097c nir/lower_mem_access_bit_sizes: fix invalid shift bit_size
Shifts always need 32 bit for their second source.

Fixes: c70d94a889 ("nir_lower_mem_access_bit_sizes: Support unaligned stores via a pair of atomics")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25740>
2023-10-15 16:19:36 +00:00
Danylo Piliaiev
b3043434d9 freedreno: Fix field size of A6XX_TEX_CONST[3].ARRAY_PITCH
We silently dropped higher bits of layer size, which was not
caught by CTS because it requires image to be big.

Fixes rendering in shadowmappingcascade Vulkan demo.

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25717>
2023-10-15 13:58:50 +00:00
Karol Herbst
3fb822dbab zink: properly emit PhysicalStorageBufferAddresses cap
The PhysicalStorageBuffer64 addressing model requires this cap. Fixes
vulkan validation error.

Fixes: ddc5c30489 ("zink: handle global and scratch vars")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25736>
2023-10-15 12:19:05 +00:00
Karol Herbst
74363973ff zink: implement load_global_constant
This is just like load_global, just that the memory pointed to won't
change.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25736>
2023-10-15 12:19:05 +00:00
Lucas Stach
04260c3654 mesa: enable NV_texture_barrier in GLES2+ (again)
This re-enables NV_texture_barrier in GL ES2+ contexts. This had
previously been tried, but caused CI issues and thus had been
reverted.

c7da969f8f ("mesa: Enable NV_texture_barrier in GLES2+") was
buggy, as it added the es2 annotation to the category instead of
the function in the XML, which lead to the extension being
advertised, but calling glTextureBarrierNV in a GLES context
only yielded a GL_INVALID_OPERATION instead of the desired
barrier operation.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25728>
2023-10-15 10:33:47 +00:00
LingMan
8b6b405a01 rusticl/core: don't take a lock while dropping Context
We have exclusive access in Drop, so we can use `get_mut` instead of having to `lock`.

Since that borrows `self` mutably but `call` also needs to borrow `self`, we `take` the Vec with
callbacks out of `self` so the mutable borrow can end before running `call`.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:11 +00:00
LingMan
54c74164a8 rusticl: drop an #[allow(dead_code)] marker
These aliases are all in use.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:11 +00:00
LingMan
b10e750199 rusticl: mark the fields of callback structs private
These details are supposed to be inaccessbile and were only made pub during the initial
implementation phase.

Add an `#[allow(dead_code)]` marker since the CreateContextCB isn't hooked up yet which would cause
a warning about unused fields otherwise.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:11 +00:00
Karol Herbst
503d084d01 rusticl/api: remove cl_closure macro
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:11 +00:00
LingMan
cda52a04e3 rusticl/api: drop a few include paths
`c_void` is already imported at the top of the file.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
0b9c926dd2 rusticl: add a safe abstraction to execute a ProgramCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
b1b0ca1acb rusticl: add a safe abstraction to execute a CreateContextCB
Since running CreateContextCBs isn't implemented yet, it's unused for now.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
6e2ba679ff rusticl: add a safe abstraction to execute an SVMFreeCb
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
8b1d73ff23 rusticl: add a safe abstraction to execute a MemCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
241d16c9e8 rusticl: add a safe abstraction to execute an EventCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
d9e2463ef3 rusticl: add a safe abstraction to execute a DeleteContextCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
16383332a9 rusticl: Make EventSig take ownership of its environment
Needed because some events may consume their inputs. E.g. it will shortly be needed for the SVMFreeCb.
SVMMemFill will also soon require mutable access.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
bef50d164f rusticl: use SVMFreeCb
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
b8171ab372 rusticl: use ProgramCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
07ca0df72e rusticl: use MemCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
c5c4cc4137 rusticl: use EventCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
250f6e9b2e rusticl: use DeleteContextCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
f34ff1daa5 rusticl: use CreateContextCB
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
e461944060 rusticl: add structs to hold the C callbacks
Keeps function pointers and their provided user data together. Since these callbacks are guaranteed
to be thread-safe by the OpenCL spec, they are marked Send and Sync.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
LingMan
157c743a27 rusticl: Rename XyzCB aliases to FuncXyzCB
This happens so the XyzCB names can be used for structs containing both the function pointer and
the provided user data. Since these aliases represent raw unsafe function pointers the `Func`
prefix was chosen over `Fn`, which is generally used for safe functions.

Unfortunately it is not possible to concatinate identifiers to create new ones without a proc macro.
Thus, specify the new alias manually instead of generating them from the existing XyzCB names.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25669>
2023-10-15 00:17:10 +00:00
Yiwei Zhang
5df194e2ae zink: sync queue access for vkQueueWaitIdle
Ensure VkQueue external sync between flush_queue and TC.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25733>
2023-10-14 23:43:36 +00:00
Karol Herbst
d2e1bc33b0 zink: implement PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS
We have to return at least 1.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25731>
2023-10-14 22:14:34 +00:00
Rob Clark
d97427f41c radeonsi: Add PIPE_CAP_HAS_CONST_BW support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-10-14 17:28:29 +00:00
Rob Clark
01f0cce003 iris: Add PIPE_CAP_HAS_CONST_BW support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-10-14 17:28:28 +00:00
Rob Clark
1fe201f7a3 panfrost: Add PIPE_CAP_HAS_CONST_BW support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-10-14 17:28:28 +00:00
Rob Clark
c1968e54d9 freedreno: Add PIPE_CAP_HAS_CONST_BW support
Allow for tiled layouts rather than having mesa/st force us back to
linear.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-10-14 17:28:28 +00:00
Rob Clark
5cccd6d689 mesa: Implement MESA_texture_const_bandwidth
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9891
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-10-14 17:28:28 +00:00
Rob Clark
d0c81e12f3 mesa: Introduce MESA_texture_const_bandwidth
A simple extension that builds on EXT_memory_object to allow the
application to request that constant bandwidth (non-data-dependent)
tiling layouts be used for a specified texture.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25464>
2023-10-14 17:28:28 +00:00
Kai Wasserbäch
2320ad1da6 fix: clover: warning: ignoring return value of ‘int posix_memalign(…)’ [-Wunused-result]
During builds GCC 13.2 issues the following warning:
src/gallium/frontends/clover/api/memory.cpp:612:21: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  612 |       posix_memalign(&ptr, alignment, size);
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

Fix this by checking the returned value is actually 0 and if not we now
report a nullptr.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25724>
2023-10-14 17:12:37 +00:00
Karol Herbst
10e3de37bf rusticl/memory: use get_mut instead of lock in drop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25727>
2023-10-14 15:32:14 +00:00
David Heidelberg
0b31cda678 ci: ci_marge_queue.py
Show currently assigned jobs to Marge and return 0 when it's free.

Useful for combination with ci_run_n_monitor.py .

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20347>
2023-10-14 11:28:56 +00:00
Karol Herbst
3083b854e0 rusticl/kernel: get rid of Arcs in KernelDevStateVariant
We only used Arcs as we wanted to deal with either getting a reference or
having an owned temporary. But we can also just use a local variable for
temporary storage.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
d3d94818ed rusticl/queue: make it Sync
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
57bafe51d2 rusticl/queue: get rid of pointless Option around our worker thread handle
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
aa1d746a8e rusticl/cl: mark _cl_image_desc as Send and Sync
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
e994935c1f rusticl/mesa: mark PipeTransfer as Send
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
5492046240 rusticl/mesa: mark PipeResource as Send and Sync
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
dde84568ad rusticl/mesa/nir: Mark NirShader and NirPrintfInfo as Send and Sync
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
6189b3fe43 rusticl/mesa/nir: mark more methods as mut
Those actually change the nir and are not thread-safe anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Karol Herbst
02c433dd87 rusticl: bump rustc version to 1.66
This adds a few goodies I care about:
- bool::then_some (1.62)
- let-else statements (1.65)

FireFox ESR is at 1.66 so this bump is according to the Rust updated
policy.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24062>
2023-10-14 09:34:56 +00:00
Faith Ekstrand
70806cc840 nvk: Always set pixel_min/max_Z to CLAMP
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25723>
2023-10-14 05:23:45 +00:00
Chia-I Wu
29e2e9290b anv: add support for vk_require_astc driconf
When vk_require_astc is true and there is no native ASTC LDR support,
enable ASTC LDR emulation.

vk_require_astc defaults to true on Android 14+.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
b30d5a4794 anv: advertise emulated formats
Advertise required features for emulated formats.

v2: no sparse residency support

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
8352b61ffa anv: fix up blit src for emulated formats
When the blit src has an emulated format, redirect to the hidden plane.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
7b84c8d6ea anv: fix up image views for emulated formats
When the view format is the same as the image format, and the format is
emulated, change the format to the decompressed format.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
a73e0e9a04 anv: decompress on upload for emulated formats
Add anv_astc_emu_decompress to decompress the raw texel data to the
hidden plane.  Call anv_astc_emu_decompress from anv_CmdCopyImage2 and
anv_CmdCopyBufferToImage2.

v2: support transfer queue and add missing flushes (Lionel)

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
61e480cb54 anv: add a hidden plane for emulated formats
When an image is created with an emulated format, add a hidden plane to
the image.  The hidden plane will be used for decompressed data.

v2: assert no sparse residency

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
9ffe8b9235 anv: add anv_is_format_emulated
anv_is_format_emulated returns true when a format is emulated.  It will
be used for ASTC LDR emulation, but it always return false at the
moment.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
94192418f8 anv: add anv_cmd_buffer_{save,restore}_state
They can be used to save/restore a subset of the current compute state.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
710c14f20b anv: add anv_descriptor_set_write
Add anv_descriptor_set_write as a helper for both
anv_UpdateDescriptorSets and anv_CmdPushDescriptorSetKHR.

v2: rename push_set to the more generic set_override

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
7a4903626b anv: support alternative push descriptor sets
Do not assume anv_cmd_pipeline_state::push_descriptor is the currently
bound push descriptor set.  With this and anv_push_descriptor_set_init,
it is possible to initialize a temporary push descriptor set on stack
for internal use.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
a86a4e5fcf anv: add anv_push_descriptor_set_{init,finish}
Refactor anv_cmd_buffer_alloc_push_descriptor_set and add
anv_push_descriptor_set_{init,finish}.  Note that
anv_push_descriptor_set_init still supports re-initialization.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
d5841dce60 anv: support image views with surface state stream
Add optional anv_state_stream to anv_image_view_init.  This is useful
for internal image views whose lifetimes are tied to the lifetime of a
command buffer.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
815b568ed5 anv: add anv_image_view_{init,finish}
This is a minor refactor.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:40 +00:00
Chia-I Wu
b16e803571 anv: remove unused field from anv_image_view
image_plane is unused.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:39 +00:00
Chia-I Wu
567c32b55c radv, drirc: rename radv_require_{etc2,astc}
Rename them to vk_require_{etc2,astc}.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467>
2023-10-14 02:36:39 +00:00
Lionel Landwerlin
cfdc57d120 anv: update batch chaining to Gfx9 commands
I don't know this fixes anything but I noticed the generated draws
jump into addresses slightly different from CPU generated jumps.

After checking the genxml, I noticed MI_BATCH_BUFFER_START "Batch
Buffer Start Address" fields have different sizes in Gfx8 & Gfx9+.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25705>
2023-10-14 01:47:42 +00:00
Karol Herbst
6c268cdf05 pipe-loader: allow to load multiple zink devices
Rusticl needs to be able to create a zink_screen on all renderer nodes.
This adds the infrastructure of doing so.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
65848d445c rusticl: enable zink
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
e0bf698d46 rusticl/mesa/screen,device: add driver_name
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Mike Blumenkrantz
25d348d040 zink: eliminate samplers from no-sampler CL texops
samplers aren't guaranteed to be provided by no-sampler ops in CL,
so flagging them as extant may read from a null sampler and explode

instead just pass the image through directly in the spirv

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
764851a24c zink: fix load/store scratch offsets
The offset is originally in bytes, so we have to handle it just like
shared load/stores.

Fixes: ddc5c30489 ("zink: handle global and scratch vars")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
e36c49b69a zink: fix RA textures
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
a5ef1067be zink: implement remaining pack ops via bitcast
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
a10828f886 zink: support samplers with unnormalized_coords
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Mike Blumenkrantz
a6e9e0f0d7 zink: add set_global_binding
This requires VK_KHR_buffer_device_address which is the only sane way of
implementing CL global memory.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
bec1955446 zink: make spirv_builder_emit_*op compatible with spec constants
This way we can use those builder functions to emit spec constant
operations.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
82eed326f4 zink: support more nir opcodes
There are sadly no SPIRV variants for hadd or iadd_sat we can use, so
lower those.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
c5abb7c8d1 zink: variable shared mem support
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
566112fdf8 zink: refactor spec constant handling
This makes it simpler to add more spec constants

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
6e0bb08116 zink: pass entire pipe_grid_info into zink_program_update_compute_pipeline_state
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:16 +00:00
Karol Herbst
a3214e8976 zink: copy has_variable_shared_mem cs property
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:15 +00:00
Karol Herbst
ef018b2373 zink: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:15 +00:00
Mike Blumenkrantz
487b9f7727 zink: always clamp shader stage in descriptor handling
otherwise KERNEL leaks through and explodes

cc: mesa-stable

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24839>
2023-10-14 01:01:15 +00:00
Karol Herbst
3510575655 ci: add half-life 2 freedreno flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25722>
2023-10-14 00:02:12 +00:00
Alejandro Piñeiro
bd674bf628 doc/features: update after last v3d changes
V3D v71 supports new hw features, like 8 draw buffers.

As we are here, we also update some features that have been working
for some time now, even on v41.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Iago Toral Quiroga
3b9aaf25a0 v3dv: expose scalarBlockLayout on V3D 7.x
This version of V3D doesn't have the restriction that vector accesses
must not cross 16-byte boundaries.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Iago Toral Quiroga
dff60b9ee5 v3dv: expose depthClamp in V3D 7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Iago Toral Quiroga
2212ee82b7 v3dv: expose fullDrawIndexUint32 in V3D 7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Juan A. Suarez Romero
7999326f07 broadcom/simulator: add per-hw version calls
Add a wrapper to allow calling the right simulator function based on
the hardware under simulation.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Juan A. Suarez Romero
314c8965a6 broadcom: add performance counters for V3D 7.x
Some of the counters need to be defined correctly.

v2: Remove references to extended performance counters. The hw does
    not support them.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Iago Toral Quiroga
d25aec0d38 v3d,v3dv: fix compute for V3D 7.1.6+
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Iago Toral Quiroga
8a69888803 v3d,v3dv: fix depth bias for v3d 7.x
In v3d 7.x we don't need to scale up depth bias for D16 buffers.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:44 +00:00
Iago Toral Quiroga
cd8afef9f1 v3dv: fix color write mask for v3d 7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
147112cfb1 v3dv: use new texture shader state rb_swap and reverse fields in v3d 7.x
In v3d 4.x we handle formats that are reversed or R/B swapped by
applying a format swizzle. This doesn't work on border colors though,
and for that there is a specific bit to reverse the border color in
the texture shader state.

In v3d 7.x we have new reverse and swap R/B bits and we no longer have
a bit to reverse the border color because the new reverse bit applies
to border texels too. Because of this, we absolutely need to use these
new bits in order to get correct border colors in all cases with these
formats.

When we enable the reverse and/or swap R/B bits, we are effectively
applying the format swizzle through them, so in these cases we need to
make sure the swizzle we program in the texture shader state is the
view swizzle provided by the API and not the composition of the format
swizzle with the view swizzle like we do in 4.x for all formats. The
same applies to custom border colors: we must not apply the format
swizzle to them for formats that are reversed or R/B swapped, because
again, this format swizzle is already applied through these new bits.

While we are doing this, we also fully adopt the texture shader state
spec from v3d 7.1.5 for v3d 7.x instead of using a description from
7.1.2 which is incompatible and required the driver to manually pack
some of the bits.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
6fe85136ef v3d,v3dv: propagate NaNs bits in shader state records are reserved in v7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
a5f0305804 v3dv: implement depthBounds support for v71
Just for for v71, as that feature is not supported by older hw.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
cb9d079739 v3d,v3dv: don't use max internal bpp for tile sizing in V3D 7.x
We can use the actual bpp of each color attachment to compute real
tile memory requirements, which may allow us to choose a larger tile
size configuration than in V3D 4.2 in certain scenarios.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
9e90d95508 v3d,v3dv: support up to 8 render targets in v7.1+
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
904519d245 v3d/v3dv: fix texture state array stride packing for V3D 7.1.5
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
30920c5de4 v3d: add support for TFU blit in v71
TFU has changed on v71, specially on which registers to use, so that
means that support code change across versions. So as part of this
commit TFU copying is moved to a v3dx file.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
e54fbc197c v3d: handle Z clipping in v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
6eb063c66e v3d: don't convert floating point border colors in v71
The TMU does this for us now.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
610799cb4f v3d: GFX-1461 does not affect V3D 7.x
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
e743d41756 v3d: setup render pass color clears for any format bpp in v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
9be4d4def6 v3d: handle new TEXTURE_SHADER_STATE v71 YCbCr fields
There are some new fields for YCbCr with pointers for the various
planes in multi-planar formats. These need to match the base address
pointer in the texture state, or the hardware will assume this is a
multi-planar texture.

Notice we don't use an address type for these fields in the XML
description. This is because the addresses are 64-bit aligned (even
though the PRM doesn't say it) which means the 6 LSB bits are
implicitly 0, but the fields are encoded before the 6th bit of their
starting byte, so we can't use the usual trick we do with address
types where the first 6 bits in the byte are implicitly overwritten by
other fields and we have to encode this manually as a uint field. This
would mean that if we had an actual BO we would also need to add it
manually to the job's list, but since we don't have one, we don't have
to do anything about it.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
80923c889a v3d: handle new texture state transfer functions in v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
b09f915666 v3d/uniforms: update VIEWPORT_X/Y_SCALE uniforms for v71
As the packet CLIPPER_XY scaling, this needs to be computed on 1/64ths
of pixel, instead of 1/256ths of pixels.

As this is the usual values that we get from macros, we add manually a
v42 and v71 macro, and define a new helper to get those.

Those granularity values are the same for Vulkan and OpenGL, so
perhaps we should move them to a common place.

As with v3dv, V3D_X macro name is somewhat confusing. It is
specifically created to ask for define values that depends on the
version. But I also felt that V3D_DEFINE_X was too long.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
2908b2782a v3d: default vertex attributes values are not needed for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
b833243348 v3d: no specific separate_segments flag for V3D 7.1
On V3D 7.1 there is not a flag on the Shader State Record to specify
if we are using shared or separate segments. This is done by setting
the vpm input size to 0 (so we need to ensure that the output would be
the max needed for input/output).

We were already doing the latter on the prog_data_vs, so we just need
to use those values, instead of assigning default values.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
12e968046c v3d: emit CLIPPER_XY_SCALING for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
6561f58b0d v3d: just don't fill up early-z fields for CFG_BITS for v71
v71 doesn't include early_z_enable/early_z_updates_enable. They are
configured with packet 121.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
22817f4f89 v3d: emit CLEAR_RENDER_TARGETS for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
68b3b7c851 v3d: TILE_RENDERING_MODE_CFG_RENDER_TARGET_PART1
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
da11be4bdf v3d: emit TILE_BINNING_MODE_CFG and TILE_RENDERING_MODE_CFG_COMMON for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
4dfe17a762 v3d: add v71 hw generation
Starting point for v71 version inclusion:
 * Adds as one of the versions to be compiled on meson
 * Updated the v3d_X and v3dX macros to include version 71
 * Update the code enough to get it building when using v71.

Any real v71 support will be implemented on following commits.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
48383668a7 v3dv: fix depth clipping then Z scale is too small in V3D 7.x
When the Z scale is too small guardband clipping may not clip
correctly, so disable it, which is a new option in V3D 7.x.

This fixes this test in V3D 7.x without needing any workarounds:
dEQP-VK.draw.renderpass.inverted_depth_ranges.nodepthclamp_deltazero

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
662d6e296e v3dv: make v3dv_viewport_compute_xform depend on the V3D version
For 4.x we have a workaround for too small Z scale values that is not
required for V3D 7.x.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
146ceadcf4 v3dv: add support for TFU jobs in v71
This includes update the simulator.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
8f2704a28d v3dv: handle Z clipping in v71
Fixes the following tests:

dEQP-VK.clipping.clip_volume.*
dEQP-VK.draw.inverted_depth_ranges.nodepthclamp_* (except deltazero)

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
acd99e08b4 v3dv: don't convert floating point border colors in v71
The TMU does this for us now.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
452421dfe5 v3dv: no specific separate_segments flag for V3D 7.1
On V3D 7.1 there is not a flag on the Shader State Record to specify
if we are using shared or separate segments. This is done by setting
the vpm input size to 0 (so we need to ensure that the output would be
the max needed for input/output).

We were already doing the latter on the prog_data_vs, so we just need
to use those values, instead of assigning default values.

As we are here, we also add some comments on the compiler part.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
ef60f6db0d v3dv: handle RTs with no color targets in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
f4fa1c8586 v3dv: handle early Z/S clears for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
8c191d1103 broadcom/compiler: update thread end restrictions validation for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
f7b16f91e1 v3dv: GFX-1461 does not affect V3D 7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
84ca72ace2 v3dv: handle render pass global clear for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
76a019f8cc v3dv: implement noop job for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
5ad415c0e6 v3dv: handle new texture state transfer functions in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
fe6594c4c1 v3dv: fix up texture shader state for v71
There are some new fields for YCbCr with pointers for the various
planes in multi-planar formats. These need to match the base address
pointer in the texture state, or the hardware will assume this is a
multi-planar texture.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
f514ad5dd2 v3dv: setup TLB clear color for meta operations in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Iago Toral Quiroga
b5e3322d93 v3dv: setup render pass color clears for any format bpp in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
9c92a758cc v3dv/pipeline: handle GL_SHADER_STATE_RECORD changed size on v71
It is likely that we would need more changes, as this packet changed,
but this is enough to get basic tests running. Any additional support
will be handled with new commits.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:43 +00:00
Alejandro Piñeiro
5750926d0e v3dv/pipeline: default vertex attributes values are not needed for v71
There are not part of the shader state record.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
53773f3ea7 v3dv: default vertex attribute values are gen dependant
Content, structure and size would depend on the generation. Even if it
is needed at all.

So let's move it to the v3dvx files.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
0abf7c1407 v3dv/cmd_buffer: just don't fill up early-z fields for CFG_BITS for v71
For v71 early_z_enable/early_z_updates_enable is configured with
packet 121.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
1a822ba3e6 v3dv/uniforms: update VIEWPORT_X/Y_SCALE uniforms for v71
As the packet CLIPPER_XY scaling, this needs to be computed on 1/64ths
of pixel, instead of 1/256ths of pixels.

As this is the usual values that we get from macros, we add manually a
v42 and v71 macro, and define a new helper (V3DV_X) to get the value
for the current hw version.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
0fdd9ea9bc v3dv/cmd_buffer: emit CLIPPER_XY_SCALING for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
e2eed3fff6 v3dvx/cmd_buffer: emit CLEAR_RENDER_TARGETS for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
33886d5f26 v3dv/cmd_buffer: emit TILE_RENDERING_MODE_CFG_RENDER_TARGET_PART1 for v71
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
5cc035a750 v3dv: emit TILE_BINNING_MODE_CFG and TILE_RENDERING_MODE_CFG_COMMON for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
6f8d331188 v3dv/device: handle new rpi5 device (bcm2712)
This includes both master and primary devices.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
15a0ad216a v3dv: expose V3D revision number in device name
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
4606904215 v3dv/meson: add v71 hw generation
Starting point for v71 version inclusion.

This just adds it as one of the versions to be compiled (on meson),
updates the v3dX/v3dv_X macros, and update the code enough to get it
compiling when building using the two versions. For any packet not
available on v71 we just provide a generic asserted placeholder of
generation not supported.

Any real v71 support will be implemented on following commits.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
1f5a3391bb broadcom/compiler: only assign rf0 as last resort in V3D 7.x
So we can use it for ldunif(a) and avoid generating ldunif(a)rf which
can't be paired with conditional instructions.

shader-db (pi5):

total instructions in shared programs: 11357802 -> 11338883 (-0.17%)
instructions in affected programs: 7117889 -> 7098970 (-0.27%)
helped: 24264
HURT: 17574
Instructions are helped.

total uniforms in shared programs: 3857808 -> 3857815 (<.01%)
uniforms in affected programs: 92 -> 99 (7.61%)
helped: 0
HURT: 1

total max-temps in shared programs: 2230904 -> 2230199 (-0.03%)
max-temps in affected programs: 52309 -> 51604 (-1.35%)
helped: 1219
HURT: 725
Max-temps are helped.

total sfu-stalls in shared programs: 15021 -> 15236 (1.43%)
sfu-stalls in affected programs: 6848 -> 7063 (3.14%)
helped: 1866
HURT: 1704
Inconclusive result

total inst-and-stalls in shared programs: 11372823 -> 11354119 (-0.16%)
inst-and-stalls in affected programs: 7149177 -> 7130473 (-0.26%)
helped: 24315
HURT: 17561
Inst-and-stalls are helped.

total nops in shared programs: 273624 -> 273711 (0.03%)
nops in affected programs: 31562 -> 31649 (0.28%)
helped: 1619
HURT: 1854
Inconclusive result (value mean confidence interval includes 0).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
c8e4ee8ecb broadcom/compiler: don't assign registers to unused nodes/temps
In programs with a lot of unused temps, if we don't do this, we may
end up recycling previously used rfs more often, which can be
detrimental to instruction pairing.

total instructions in shared programs: 11464335 -> 11444136 (-0.18%)
instructions in affected programs: 8976743 -> 8956544 (-0.23%)
helped: 33196
HURT: 33778
Inconclusive result

total max-temps in shared programs: 2230150 -> 2229445 (-0.03%)
max-temps in affected programs: 86413 -> 85708 (-0.82%)
helped: 2217
HURT: 1523
Max-temps are helped.

total sfu-stalls in shared programs: 18077 -> 17104 (-5.38%)
sfu-stalls in affected programs: 8669 -> 7696 (-11.22%)
helped: 2657
HURT: 2182
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 11482412 -> 11461240 (-0.18%)
inst-and-stalls in affected programs: 8995697 -> 8974525 (-0.24%)
helped: 33319
HURT: 33708
Inconclusive result

total nops in shared programs: 298140 -> 296185 (-0.66%)
nops in affected programs: 52805 -> 50850 (-3.70%)
helped: 3797
HURT: 2662
Inconclusive result

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
ce13aa4ee7 broadcom/compiler: improve allocation for final program instructions
The last 3 instructions can't use specific registers so flag all the
nodes for temps used in the last program instructions and try to
avoid assigning any of these. This may help us avoid injecting nops
for the last thread switch instruction.

Because regisster allocation needs to happen before QPU scheduling
and instruction merging we can't tell exactly what the last 3
instructions will be, so we do this for a few more instructions than
just 3.

We only do this for fragment shaders because other shader stages
always end with VPM store instructions that take an small immediate
and therefore will never allow us to merge the final thread switch
earlier, so limiting allocation for these shaders will never improve
anything and might instead be detrimental.

total instructions in shared programs: 11471389 -> 11464335 (-0.06%)
instructions in affected programs: 582908 -> 575854 (-1.21%)
helped: 4669
HURT: 578
Instructions are helped.

total max-temps in shared programs: 2230497 -> 2230150 (-0.02%)
max-temps in affected programs: 5662 -> 5315 (-6.13%)
helped: 344
HURT: 44
Max-temps are helped.

total sfu-stalls in shared programs: 18068 -> 18077 (0.05%)
sfu-stalls in affected programs: 264 -> 273 (3.41%)
helped: 37
HURT: 48
Inconclusive result (value mean confidence interval includes 0).

total inst-and-stalls in shared programs: 11489457 -> 11482412 (-0.06%)
inst-and-stalls in affected programs: 585180 -> 578135 (-1.20%)
helped: 4659
HURT: 588
Inst-and-stalls are helped.

total nops in shared programs: 301738 -> 298140 (-1.19%)
nops in affected programs: 14680 -> 11082 (-24.51%)
helped: 3252
HURT: 108
Nops are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
818fc41e7e broadcom/compiler: don't allocate spill base to rf0 in V3D 7.x
Otherwise it can be stomped by instructions doing implicit rf0 writes.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
dc6ed98aae broadcom/qpu: new packing/conversion v71 instructions
This commits adds the qpu definitions for several new v71
instructions.

Packing:
  * vpack does a 2x32 to 2x16 bit integer pack
  * v8pack: Pack 2 x 2x16 bit integers into 4x8 bits
  * v10pack packs parts of 2 2x16 bit integer into r10g10b10a2.
  * v11fpack packs parts of 2 2x16 bit float into r11g11b10 rounding
    to nearest

Conversion to unorm/snorm:
  * vftounorm8/vftosnorm8: converts from 2x16-bit floating point
    to 2x8 bit unorm/snorm.
  * ftounorm16/ftosnorm16: converts floating point to 16-bit
    unorm/snorm
  * vftounorm10lo: Convert 2x16-bit floating point to 2x10-bit unorm
  * vftounorm10hi: Convert 2x16-bit floating point to one 2-bit and one 10-bit unorm

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
84c912c1d4 broadcom/compiler: fix up copy propagation for v71
Update rules for unsafe copy propagations to match v7.x.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
1e85be415a broadcom/compiler: lift restriction on vpmwt in last instruction for V3D 7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
2774601780 broadcom/compiler: validate restrictions after TLB Z write
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
d4285d7f2a broadcom/compiler: start allocating from RF 4 in V7.x
In V3D 4.x we start at RF3 so that we allocate RF0-2 only if there
aren't any other RFs available. This is useful with small shaders to
ensure that our TLB writes don't use these registers because these are
the last instructions we emit in fragment shaders and the last
instructions in a program can't write to these registers, so if we do,
we need to emit NOPs.

In V3D 7.x the registers affected by this restriction are RF2-3, so we
choose to start at RF4.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
2b39bb35c5 broadcom/compiler: lift restriction for branch + msfign after setmsf for v7.x
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
5e9b405aa7 broadcom/compiler: update ldvary thread switch delay slot restriction for v7.x
In V3D 7.x we don't have accumulators which would not survive a thread
switch, so the only restriction is that ldvary can't be placed in the
second delay slot of a thread switch.

shader-db results for UnrealEngine4 shaders:

total instructions in shared programs: 446458 -> 446401 (-0.01%)
instructions in affected programs: 13492 -> 13435 (-0.42%)
helped: 58
HURT: 3
Instructions are helped.

total nops in shared programs: 19571 -> 19541 (-0.15%)
nops in affected programs: 161 -> 131 (-18.63%)
helped: 30
HURT: 0
Nops are helped.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
526c1889e5 broadcom/compiler: update thread end restrictions for v7.x
In 4.x it is not allowed to write to the register file in the last 3
instructions, but in 7.x we only have this restriction in the thread
end instruction itself, and only if the write comes from the ALU
ports.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
ced83e7803 broadcom/compiler: implement small immediates for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
e4d30600a4 broadcom/compiler: convert mul to add when needed to allow merge
V3D 7.x added 'mov' opcodes to the ADD alu, so now it is possible to
move these to the ADD alu to facilitate merging them with other MUL
instructions.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
cbedf14687 broadcom/compiler: don't assign rf0 to temps that conflict with ldvary
ldvary writes to rf0 implicitly, so we don't want to allocate rf0 to
any temps that are live across ldvary's rf0 live ranges.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
3a36a618d7 broadcom/compiler: try to use ldunif(a) instead of ldunif(a)rf in v71
The rf variants need to encode the destination in the cond bits, which
prevents these to be merged with any other instruction that need them.

In 4.x, ldunif(a) write to r5 which is a special register that only
ldunif(a) and ldvary can write so we have a special register class for
it and only allow it for them. Then when we need to choose a register
for a node, if this register is available we always use it.

In 7.x these instructions write to rf0, which can be used by any
instruction, so instead of restricting rf0, we track the temps that
are used as ldunif(a) destinations and use that information to favor
rf0 for them.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
d8a25bdb07 broadcom/compiler: enable ldvary pipelining on v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
a8014be2b0 broadcom/compiler: handle rf0 flops storage restriction in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
852274d00a broadcom/qpu: add packing for fmov on ADD alu
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
d1281d857f broadcom/compiler: update peripheral access restrictions for v71
In V3D 4.x only a couple of simultaneous accesses where allowed, but
V3D 7.x is a bit more flexible, so rather than trying to check for all
the allowed combinations it is easier to check if we are one of the
disallows.

Shader-db (pi5):

total instructions in shared programs: 11338883 -> 11307386 (-0.28%)
instructions in affected programs: 2727201 -> 2695704 (-1.15%)
helped: 12555
HURT: 289
Instructions are helped.

total max-temps in shared programs: 2230199 -> 2229260 (-0.04%)
max-temps in affected programs: 20508 -> 19569 (-4.58%)
helped: 608
HURT: 4
Max-temps are helped.

total sfu-stalls in shared programs: 15236 -> 15293 (0.37%)
sfu-stalls in affected programs: 148 -> 205 (38.51%)
helped: 38
HURT: 64
Inconclusive result (%-change mean confidence interval includes 0).

total inst-and-stalls in shared programs: 11354119 -> 11322679 (-0.28%)
inst-and-stalls in affected programs: 2732262 -> 2700822 (-1.15%)
helped: 12550
HURT: 304
Inst-and-stalls are helped.

total nops in shared programs: 273711 -> 274095 (0.14%)
nops in affected programs: 9626 -> 10010 (3.99%)
helped: 186
HURT: 397
Nops are HURT.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
ce66c9aead broadcom/compiler: update payload registers handling when computing live intervals
As for v71 the payload registers are not the same. Specifically now
rf3 is used as payload register, so this is needed to avoid rf3 being
selected as a instruction dst by the register allocator, overwriting
the payload value that could be still used.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
d72e57fe30 broadcom/compiler: update ldunif/ldvary comment for v71
For v42 and below ldunif/ldvary write both on r5, but with a different
delay, so we need to take that into account when scheduling both.

For v71 the register used is rf0, but the behaviour is the same. So
the scheduling code can be the same, but the comment needs update.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Alejandro Piñeiro
a3aba3f352 broadcom/compiler: update one TMUWT restriction for v71
TMUWT not allowed in the final instruction restriction doesn't apply
for v71.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
c9fcd5d786 broadcom/compiler: v71 isn't affected by double-rounding of viewport X,Y coords
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
5c7224b81f broadcom/compiler: generalize check for shaders using pixel center W
V3D 4.x has pixel center W in rf0 and V3D 7.x has it in rf3. We already
account for this when we setup the c->payload_w, so use that.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
ff86147f91 broadcom/qpu: fail packing on unhandled mul pack/unpack
We are doing this for the ADD alu already and it may be helpful to
identify cases where we have QPU code with pack/unpack modifiers on
MUL opcodes that we then are not packing into the actual QPU
instructions.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
5fc2b565a4 broadcom/qpu: add MOV integer packing/unpacking variants
These are new in v71 and cover MOV on both the ADD and the MUL alus.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
b4e0c9bac4 broadcom/compiler: allow instruction merges in v71
In v3d 4.x there were restrictions based on the number of raddrs used
by the combined instructions, but we don't have these restrictions in
v3d 7.x.

It should be noted that while there are no restrictions on the number
of raddrs addressed, a QPU instruction can only address a single small
immediate, so we should be careful about that when we add support for
small immediates.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
28631a5550 broadcom/compiler: don't schedule rf0 writes right after ldvary
ldvary writes rf0 implicitly on the next cycle so they would clash.
This case is not handled correctly by our normal dependency tracking,
which doesn't know anything about delayed writes from instructions
and thinks the rf0 write happens on the same cycle ldvary is emitted.

Fixes (v71):
dEQP-VK.glsl.conversions.matrix_to_matrix.mat2x3_to_mat4x2_fragment

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
42b70f624b broadcom/compiler: CS payload registers have changed in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
2b15df963e broadcom/compiler: don't assign rf0 to temps across implicit rf0 writes
In platforms that don't have accumulators and have implicit writes to
the register file we need to be careful and avoid assigning a physical
register to a temp that lives across an implicit write to that same
physical register.

For now, we have the case of implicit writes to rf0 from various
signals, but it should be easy to extend this to include additional
registers if needed.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:42 +00:00
Iago Toral Quiroga
03594b3dca broadcom/compiler: only handle accumulator classes if present
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
b1548b18d3 broadcom/compiler: rename vir_writes_rX to vir_writes_rX_implicitly
Since that represents more accurately what they check..

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
20b37b273f broadcom/compiler: make vir_write_rX return false on platforms without accums
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
310dec3ec9 broadcom/qpu: implement switch rules for fmin/fmax fadd/faddnf for v71
They use the same opcodes, and switch between one and the other based
on raddr.

Note that the rule includes also if small_imm_a/b are used. That is
still not in place so that part is hardcoded. Would be updated later
when small immediates support for v71 gets implemented.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
4ef31ba460 broadcom/qpu: fix packing/unpacking of fmov variants for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
e9b44ae0c8 broadcom/qpu: add new ADD opcodes for FMOV/MOV in v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
caf28e5681 broadcom/compiler: prevent rf2-3 usage in thread end delay slots for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
28bb1b3ff6 broadcom/compiler: add a v3d71_qpu_writes_waddr_explicitly helper
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
572fba0bf4 broadcom/compiler: implement read stall check for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
4e26d2c156 broadcom/compiler: implement "reads/writes too soon" checks for v71
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
083d082d8e broadcom/compiler: update register classes to not include accumulators on v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
d12eb68d3a broadcom/qpu_schedule: update write deps for v71
We just need to add a write dep if rf0 is written implicitly.

Note that we don't need to check if we have accumulators when checking
for r3/r4/r5, as v3d_qpu_writes_rX would return false for hw version
that doesn't have accumulators.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
5a035af931 broadcom/compiler: payload_w is loaded on rf3 for v71
And in general rf0 is now used for other needs.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
edfc36817a broadcom/compiler: add support for varyings on nir to vir generation for v71
Needs update as v71 doesn't have accumulators anymore, and ldvary uses
now rf0 to return the value.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
68526423fb broadcom/qpu: return false on qpu_writes_accumulatorXX helpers for v71
As for v71 doesn't have accumulators (devinfo->has_accumulators set to
false), those methods would always return false.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
d7b15c2b42 broadcom/qpu: update disasm_raddr for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
a766cc3a5a broadcom/qpu_schedule: add process_raddr_deps
On v71 we don't have muxes, but more raddr. Adding a equivalent add
deps function.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
dad6917d5e broadcom/compiler: update vir_to_qpu::set_src for v71
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
136d934c80 broadcom/vir: implement is_no_op_mov for v71
Did some refactoring/splitting.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
d00f7ef23e broadcom/compiler: don't favor/select accum registers for hw not supporting it
Note that what we do is to just return false on the favor/select accum
methods. We could just avoid to call them, but as the select is called
more than once, it is just easier this way.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
1260b202be broadcom/compiler: phys index depends on hw version
For 7.1 there are not accumulators. So we replace the macro with a
function call.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
63d633ca7a broadcom/compiler: update node/temp translation for v71
As the offset applied needs to take into account if we have
accumulators or not.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
3b20208f03 broadcom/qpu: add pack/unpack support for v71
Note that we provide new v71 alu pack/unpack methods. As there are a
lot that it is equivalent, initially we tried to use existing methods
as template and add version checks on the existing methods. At some
early point that become just really unreadable, so it become better to
just provide new methods, even if v42 and v71 methods have a really
similar structure.

Note that we have splitted the op tables, and created a two (add/mul)
for v71. As the description struct include versioning info, we could
have just used one table. But, specially with the add table, there are
a lot of differences with v71. So it is slightly tidier this
way. Also, taking into account that we do a linear search on the
tables, this can be even justified by performance.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
c07eb1bae5 broadcom/qpu: add qpu_writes_rf0_implicitly helper
On v71 rf0 replaces r5 as the register that gets updated implicitly
with uniform loads, and gets the C coefficient with ldvary. This
helper return if rf0 gets implicitly updated.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
3e42b9ff47 broadcom/commmon: add has_accumulators field on v3d_device_info
Even if we can just check for the version on the code, checking for
this field makes several places more readable. So for example, on the
register allocate code we doesn't assign an accumulator because we
don't have accumulators on that hw, instead of because hw version is a
given one.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
ef75d07b87 broadcom/qpu: defining shift/mask for raddr_c/d
On V3D 7.x it replaces mul_a/b and add_a/b

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
a5c4634c9e broadcom/qpu: add raddr on v3d_qpu_input
On V3D 7.x mux are not used, and raddr_a/b/c/d are used instead

This is not perfect, as for v71, the raddr_a/b defined at qpu_instr
became superfluous. But the alternative would be to define two
different structs, or even having them defined based on version
ifdefs, so this is a reasonable compromise.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
347065525f broadcom/qpu: define v3d_qpu_input, use on v3d_qpu_alu_instr
At this point it just tidy up a little the alu_instr structure.

But also serves to prepare the structure for new changes, as 7.x uses
raddr instead of mux, and it is just easier to add the raddr to the
new input structure.

Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
2247934914 broadcom/qpu: add v71 signal map
Compared with v41, the differences are:
   * 14, 15, 29 and 30 are now about immediate a, b, c, d respectively
   * 23 is now reserved. On v42 this was for rotate signals, that are
     gone on v71.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
3d0c3667dd broadcom/compiler: add small_imm a/c/d on v3d_qpu_sig
small_imm_a, small_imm_c and small_imm_d added on top of the already
existing small_imm_b, as V3D 7.1 defines 4 small immediates, tied to
the 4 raddr. Note that this is only the definition, and just a inst
validation rule to check that are not used before v71. Any real use is
still pending.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
e5011e19c7 broadcom/compiler: rename small_imm to small_imm_b
Current small_imm is associated with the "B" read address.

We do this change in advance for v71 support, where we will have 4
different small_imm (a/b/c/d), so we start with a renaming.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
f9bcefa964 broadcom/qpu: set V3D 7.x names for some waddr aliasing
V3D 7.x got rid of the accumulator, but still uses the values for
WADDR_R5 and WADDR_R5REP, so let's return a proper name and add some
aliases.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
e1c19d55ea broadcom/qpu: add comments on waddr not used on V3D 7.x
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
453b817cfd broadcom/common: add some common v71 helpers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
04f16574e6 broadcom/common: retrieve V3D revision number
The subrev field from the hub ident3 register is bumped with every
hardware revision doing backwards incompatible changes so we want to
keep track of this.

Instead of modifying the 'ver' field info to acommodate subrev info,
which would require a lot of changes, simply add a new 'rev' field in
devinfo that we can use when we need to make changes based on the
revision number of a hardware release.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
52942aac0e broadcom/cle: update the packet definitions for new generation v71
Using as reference the spec for 7.1.5. This include totally new
packets, and redefine some that already existed on v42.

Full list:
 * Add Depth Bounds Test Limits
 * Redefine Tile Binning Mode Cfg
 * Redefine Cfg Bits. There are some changes on the fields:
   * Line Rasterization is now 1 bit size
   * Depth Bounds Enable (that takes one of the bits of Line Rasterization)
   * Early-Z/Early-Z updates enable bits (16-17) figure now as reserved.
   * New Z-Clipping mode field
 * Redefine Tile Rendering Mode Cfg (Common). Changes with respect to v42:
   * New log2 tile height/width fields starting at bit 52/55
   * Due those two news, end pad is smaller
   * sub-id has now a size of 3. Bit 4 is reserved.
   * Number of render targets: this field max value is now 7 (not
     reflected on the xml).
   * Maximum BPP is removed on v71 (now bits 40-41 are reserved)
   * Depth Buffer disable: on bit 44
 * Update Store Tile Buffer General
 * Adding Cfg Render Target Part1/2/3 packets: they replace v4X "Tile
   Rendering Mode Cfg (Color)" (real name "Rendering Configuration
   (Render Targets Config)"), "Tile Rendering Mode Cfg (Clear Colors
   Part1)", "Tile Rendering Mode Cfg (Clear Colors Part2)", and "Tile
   Rendering Mode Cfg (Clear Colors Part3)". On those old versions,
   the first packet is used to configure 4 render targets. Now that 8
   are supported, invididual per-render-target are used.
 * Update ZS clear values packet.
 * Add new v71 output formats
 * Define Clear Render Targets (Replaces Clear Tile Buffers from v42)
 * Redefine GL Shader State Record. Changes copared with v42:
   * Fields removed:
     * "Coordinate shader has separate input and output VPM blocks"
       (reserved bit now)
     * "Vertex shader has separate input and output VPM blocks"
       (reserved bit now)
     * "Address of table of default attribute Values." (we needed to
       change the start position for all the following fields)
   * New field:
     * "Never defer FEP depth writes to fragment shader auto Z writes
        on scoreboard conflict"
 * Redefine clipper xy scaling: Now it uses 1/64ths of pixels, instead
   of 1/256ths
 * Update texture shader state.
   * Notice we don't use an address type for these fields in the XML
     description. This is because the addresses are 64-bit aligned
     (even though the PRM doesn't say it) which means the 6 LSB bits
     are implicitly 0, but the fields are encoded before the 6th bit
     of their starting byte, so we can't use the usual trick we do
     with address types where the first 6 bits in the byte are
     implicitly overwritten by other fields and we have to encode this
     manually as a uint field. This would mean that if we had an
     actual BO we would also need to add it manually to the job's
     list, but since we don't have one, we don't have to do anything
     about it.
   * Add new RB_Swap field for texture shader state
   * Document Cb/Cr addresses as uint fields in texture shader state
 * Fixup Blend Config description: we now support 8 RTs.
 * TMU config parameter 2 has new fields
 * Add new clipper Z without guardband packet in v71
 * Add enums for the Z clip modes accepted in v71
 * Fix texture state array stride packing for V3D 7.1.5

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Iago Toral Quiroga
8b26549498 broadcom/simulator: reset CFG7 for compute dispatch in v71
This register is new in 7.x, it doesn't seem that we need to
do anything specific for now, but let's make sure it is reset
every time.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Alejandro Piñeiro
d858332201 broadcom(cle,clif,common,simulator): add 7.1 version on the list of versions to build
This adds 7.1 to the list of available V3D_VERSION, and first changes
on the simulator needed to get it working.

Note that we needed to touch all those 4 codebases because it is
needed if we want to use V3D_DEBUG=clif with the simulator, that it is
the easier way to see which packets a vulkan program is using.

About the simulator, this commit only handle the rename of some
registers. Any additional changes needed to get a proper support for
v71 will be handled them on following commits.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25450>
2023-10-13 22:37:41 +00:00
Sagar Ghuge
470bb614e0 blorp: Use the correct miptail start LOD for surfaces
Use the correct miptail start LOD for the surfaces involved in the
XY_BLOCK_COPY_BLT/XY_FAST_COLOR_BLT instructions.

Thanks to Lionel for pointing out the issue.

Fixes: 46f45d62d1 ("intel/isl: Start using miptails")

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25688>
2023-10-13 21:58:59 +00:00
LingMan
d9abc07151 rusticl/memory: fix potential use-after-free in clEnqueueSVMFree
Fixes: bfee3a8563 ("rusticl: add support for fine-grained system SVM")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25719>
2023-10-13 21:43:17 +00:00
Christian Gmeiner
5ee883a23b docs: update etnaviv extensions
Next round of feature updates.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25700>
2023-10-13 19:42:01 +00:00
Eric Engestrom
d3e96aa02e ci_run_n_monitor: dependency jobs must always be started
Fixes: 6b49b477ac ("ci/ci_run_n_monitor: simplify enable/cancel logic in monitor_pipeline()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25715>
2023-10-13 18:37:56 +00:00
Samuel Pitoiset
0cbaf6cc8d zink/ci: remove expected failures that are skipped for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25711>
2023-10-13 17:02:30 +00:00
Erik Faye-Lund
5fe5c3e223 meson: add wayland-protocols from meson wrapdb
Sometimes, users don't have a recent enough version of wayland-protocols
to build Mesa. But these days, Meson's WrapDB has a wrap that's more
than new enough for our needs.

If we add the wrap-file to the subprojects folder, we'll download a more
recent wrap if the installed version is too old (or doesn't exist at
all).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25683>
2023-10-13 16:44:31 +00:00
Gert Wollny
7953e14878 r600: drop egcm_load_index_reg
This is now handled in SFN.
v2: remove obsolte comments (Vitaliy Kuzmin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25475>
2023-10-13 16:28:11 +00:00
Gert Wollny
76993af858 r600/sfn: don't remove texture sources by using the enum value
We have to query the index first, otherwise we remove the wrong value.

Fixes: 02bb506c54
    r600/sfn: Lower tex,txl,txb and txf to backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25475>
2023-10-13 16:28:11 +00:00
Martin Roukala (né Peres)
d6c6599a49 zink/ci: tighten the zink-radv-vangogh timeouts
The jobs should never take longer than 30 minutes, so let's enforce it!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25704>
2023-10-13 15:59:18 +00:00
Martin Roukala (né Peres)
f5cf90fbea radv/ci: tighten the vkcts-navi21 timeouts
The jobs should never take longer than 30 minutes, so let's enforce it!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25704>
2023-10-13 15:59:18 +00:00
Erik Faye-Lund
a740a9f1dc ci/etnaviv: move failure to flake
Turns out, this passes sometimes... So let's mark it as a flake
instead.

Fixes: 7368a89752 ("ci/etnaviv: update ci expectation")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25699>
2023-10-13 15:41:20 +00:00
Matt Coster
1f112abd7f pvr: Use common physical device properties
Make use of the common vulkan properties code introduced in [1].

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24575

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/25326>
2023-10-13 12:21:18 +00:00
Matt Coster
989e5e4c70 pvr: Minor refactor of pvr_device.c
Moving a few functions further up here to prepare for the next commit;
should make the diffs a lot nicer. No (intentional) functional changes.

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/25326>
2023-10-13 12:21:18 +00:00
Matt Coster
6046f735b9 pvr: Don't pass pvr_physical_device when only device info is needed
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/25326>
2023-10-13 12:21:18 +00:00
Erico Nunes
eb34a86b3b Revert "ci/lima: farm is down, disable for now"
This reverts commit c7806daf43.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25702>
2023-10-13 11:52:42 +00:00
cheyang
cf22954973 isaspec : fix isaspec build error in aosp
in Android 12 build have error "ninja:
'external/mesa/src/compiler/isaspec/README.rst', needed by
'out/target/product/s/obj/MESON_MESA3D_GEN/.timestamp', missing and
no known rule to make it" because commit:
d48d8aefdf  (docs: Move isaspec out of
drivers/freedreno) modify isaspec.rst Location.

Signed-off-by: cheyang <cheyang@bytedance.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25697>
2023-10-13 11:09:40 +00:00
Karol Herbst
65b663cc9d rusticl/kernel: Fix creation from programs not built for every device
OpenCL does not require that a kernel is created for every device. So we
shouldn't assume there is a build for every device.

API validation around launching kernels already takes this possibility
into account.

I did not verify if the commit below is actually the culprit and whether
this bug existed before that, but a fix for older code also would have to
look differently anyway.

Fixes: 323dcbb4b5 ("rusticl: Move NirKernelBuild to ProgramDevBuild")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9968
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25696>
2023-10-13 08:51:30 +00:00
Danylo Piliaiev
734bbe33cf freedreno/rddecompiler: Decompile repeated IBs
Otherwise we don't reconstruct the whole cmdstream.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25677>
2023-10-13 08:34:41 +00:00
Danylo Piliaiev
0338b14657 freedreno/rddecompiler: Use fd_dev_gen to pass gpu_id to ir3 disasm
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25677>
2023-10-13 08:34:41 +00:00
Eric Engestrom
e41bc40571 include/dri_interface.h: restore define mistakenly removed in !25587
This file is a public API used by Xserver; removing something from it
means Xserver can't build anymore, and even if we fix Xserver, old
versions are still around and we want to keep them working to allow for
bisecting issues.

Fixes: 7301914755 ("dri: Remove __driDriverExtensions leftovers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9976
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25692>
2023-10-13 06:11:02 +00:00
Lionel Landwerlin
3f973a4f45 Revert "intel/fs: limit register flag interaction of FIND_*LIVE_CHANNEL"
This reverts commit c9739e8912.

We don't have a full understanding of what is going on but reverting
definitely fixes a hang.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c9739e8912 ("intel/fs: limit register flag interaction of FIND_*LIVE_CHANNEL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9868
Tested-By: Valentin Geyer <trayshar@t-online.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25563>
2023-10-13 08:37:28 +03:00
José Roberto de Souza
07eede0970 intel: Prepare implementation of Wa_18019816803 and Wa_16013994831 for future platforms
Those workarounds are temporary for newer platforms so we can't use
INTEL_NEEDS_WA_*, luckly those already had runtime checks.
INTEL_NEEDS_WA_* was only used because it was accessing instructions
or fields of the instructions that only exists in gfx12 or gfx125.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25685>
2023-10-13 03:54:50 +00:00
Alyssa Rosenzweig
be0ab37bac nir/opt_algebraic: Optimize LLVM booleans
Helps OpenCL kernels.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25687>
2023-10-13 02:55:48 +00:00
Jordan Justen
c74a578c54 intel/dev: Add 0x56ba-0x56bd DG2 PCI IDs
Cc: mesa-stable
Ref: https://lists.freedesktop.org/archives/intel-gfx/2023-October/337287.html
Ref: BSpec 44477
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25673>
2023-10-13 02:16:11 +00:00
Jordan Justen
ee482ad660 anv/batch: Assert that extend_cb is non-NULL if the batch is out of space
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25672>
2023-10-13 01:46:58 +00:00
Jordan Justen
ef8dcb0aa4 anv/batch: Check if batch already has an error in anv_queue_submit_simple_batch()
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25672>
2023-10-13 01:46:58 +00:00
Emma Anholt
534511935d ci/radeonsi: Drop an xfail for vangogh.
It's passed in the last 3 nightly runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25693>
2023-10-13 01:12:59 +00:00
Emma Anholt
01a1975fce ci/zink: Add a TGL flake that's showed up in nightlies recently.
I don't know how recently, since the nightlies were timing out for a long
time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25693>
2023-10-13 01:12:59 +00:00
Emma Anholt
40f22f8ecd nir/print: Decode system values in the variable declarations.
decl_var system INTERP_MODE_NONE none vec4 #0
decl_var system INTERP_MODE_FLAT none mediump uint #1

turns into:

decl_var system INTERP_MODE_NONE none vec4 #0 (SYSTEM_VALUE_FRAG_COORD)
decl_var system INTERP_MODE_FLAT none mediump uint #1 (SYSTEM_VALUE_SUBGROUP_INVOCATION)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25647>
2023-10-12 22:52:42 +00:00
Mike Blumenkrantz
0d652c0c8d zink: shrink vectors during optimization
this avoids a number of cases where a shader was reading more components
from an input than an output was providing. functionally there was never
any issue as these read components were subsequently rewritten to use
constant data, but the read itself is a spec violation

shrinking can't be done in finalize, however, as that enables the frontend
to optimize vertex states, which seems like a good thing but ends up being
a bad thing since it may or may not be consistent across frontends and I
don't wanna deal with having to reorder i/o locations in unintuitive ways

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25433>
2023-10-12 22:01:44 +00:00
Alyssa Rosenzweig
8df8d1e2f2 nir/opt_algebraic: Reduce int64
If we just want the bottom 32-bits we don't need a full 64-bit operation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
2023-10-12 21:03:31 +00:00
Alyssa Rosenzweig
8b5b362be6 nir/lower_io: Use load_global_constant for OpenCL
Map __constant with a 64-bit address format to load_global_constant instead of
load_global. This notably allows nir_opt_preamble to hoist the load.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
2023-10-12 21:03:31 +00:00
Alyssa Rosenzweig
569d44eff4 nir/print: Handle KERNEL
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
2023-10-12 21:03:31 +00:00
Alyssa Rosenzweig
6d0efa8701 nir/legalize_16bit_sampler_srcs: Use instr_pass
Fixes the pass with multiple functions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
2023-10-12 21:03:31 +00:00
Alyssa Rosenzweig
b1b7616418 nir/opt_phi_precision: Work with libraries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
2023-10-12 21:03:31 +00:00
Alyssa Rosenzweig
cd1ba21958 r600/sfn: Handle load_global_constant
as an alias of load_global, for CL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Suggested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25625>
2023-10-12 21:03:31 +00:00
Corentin Noël
aef37305a1 ci: Uprev virglrenderer
Include the latest virglrenderer version.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25561>
2023-10-12 19:22:33 +00:00
Lionel Landwerlin
fe05e6610b anv: fixup spirv cap for ImageReadWithoutFormat on Gfx12.5
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2e2491b76c ("anv: enable shaderStorageImageReadWithoutFormat on Gfx12.5+")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25573>
2023-10-12 18:57:55 +00:00
Mike Blumenkrantz
80d837cf40 ci: add a630 trace flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25684>
2023-10-12 17:59:28 +00:00
Sagar Ghuge
bed0542b2f anv: Enable transfer queue only on ACM+ platforms
On older platforms, we have the blitter engine, but it lacks compression
handling and other features we need, unfortunately, so enable the
transfer queue only on ACM+ platforms.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25667>
2023-10-12 17:24:06 +00:00
Samuel Pitoiset
1f77f52bbe radv: skip GDS allocation for NGG streamout on GFX11
Only GDS OA is needed on GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25284>
2023-10-12 16:58:22 +00:00
Samuel Pitoiset
2cc3288089 radv: mark GDS as needed for XFB queries with NGG streamout on GFX11
This doesn't fix anything because gds_needed should already be TRUE
because it's initialized at pipeline bind time, but this will be needed
for skipping GDS allocation on GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25284>
2023-10-12 16:58:22 +00:00
Samuel Pitoiset
f0abdaea9f amd/llvm,aco,radv: implement NGG streamout with GDS_STRMOUT registers on GFX11
According to RadeonSI, this is required for preemption, user queues,
and we only have to wait for VS after streamout which should be more
performant.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25284>
2023-10-12 16:58:22 +00:00
Samuel Pitoiset
7a3981b9a7 radv: enable radv_disable_aniso_single_level=true for Zink too
This seems the default OpenGL behavior as well as DX.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25642>
2023-10-12 12:54:16 +00:00
Karmjit Mahil
f1c9efc52e pvr: Don't merge subpasses on framebuffer-global dependancy
When we have a framebuffer-local dependency we cannot merge
subpasses.

dEQP tests fixed:
  dEQP-VK.renderpass.suballocation.attachment_allocation
    .input_output.{15,23,35,61,80,93}
  dEQP-VK.renderpass.suballocation.attachment_allocation
    .roll.{13,31,42,47,55,59,61,98}

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25612>
2023-10-12 09:30:07 +00:00
Karmjit Mahil
1c35e495d9 tu: Use common vk_subpass_dependency_is_fb_local()
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25612>
2023-10-12 09:30:07 +00:00
Karmjit Mahil
9b7d437653 vulkan: Add vk_subpass_dependency_is_fb_local() helper
Some tilers check for framebuffer local dependancy to determine if
they can rearrange or merge some sub-passes without breaking
their dependencies. Adding a helper for that.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25612>
2023-10-12 09:30:07 +00:00
Samuel Pitoiset
7397502a1f radv: disable primitive restart for non-indexed draws on GFX11
Primitive restart is also applied to non-indexed draws on AMD GPUs. On
GFX11, DISABLE_FOR_AUTO_INDEX can be set but we will need a different
solution for older GPUs.

This fixes all line related flakes in CI (at least).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25639>
2023-10-12 06:33:40 +00:00
Tapani Pälli
f33d937608 mesa/st: ignore StencilSampling if stencil not part of the format
This avoids hitting assert in debug builds and incorrect rendering
on release in case GL_DEPTH_STENCIL_TEXTURE_MODE has been set to
GL_STENCIL_INDEX with a texture that does not have stencil.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25610>
2023-10-12 03:52:26 +00:00
Yiwei Zhang
ed2cac0f1e venus: enable Vulkan 1.3 for Android 13 and above
Now that ndk translation support is ready for both Intel and AMD, we can
advertise Vulkan 1.3 on Android 13.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25666>
2023-10-11 22:29:46 +00:00
Helen Koike
51521e1f9d ci/ci_run_n_monitor: limit repetitions on --stress
--stress options now receives the number of repetitions or -1 to behave
as before.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:58 +00:00
Helen Koike
57fa35f19c ci/ci_run_n_monitor: allow <user>/<project> in --project
Allow to monitor pipelines in any <user>/<project> on gitlab.fdo.

If developers want to monitor MR pipelines, they can run with
--project mesa/mesa to force it to be picked from mesa username.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:58 +00:00
Helen Koike
6b49b477ac ci/ci_run_n_monitor: simplify enable/cancel logic in monitor_pipeline()
leave to enable_job() and cancel_job() to do the right thing according
to the job status.

let target canceled jobs to be re-runned.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:58 +00:00
Helen Koike
17843ad7c6 ci/ci_run_n_monitor: merge enable_job with retry_job
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:58 +00:00
Helen Koike
90da4a6845 ci/ci_run_n_monitor: make --target mandatory
There is no point running without a target, just make it mandatory and
simplify the script.

Use ".*" to run all targets.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:58 +00:00
Helen Koike
633c08688b ci/ci_run_n_monitor: merge print_job_status_change with print_job_status
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:57 +00:00
Helen Koike
7f6c339740 ci/ci_run_n_monitor: simplify with defaultdict
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:57 +00:00
Helen Koike
f838499901 ci/ci_run_n_monitor: print stress test results per job
Since we can monitor multiple jobs, print the result of the stress test
per job name.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
2023-10-11 21:50:57 +00:00
David Heidelberg
f93b11822a ci/traces: always export piglit EXTRA_ARGS
When a job doesn't define them, it won't get passed to piglit otherwise.

Fixes: 5ab60581da ("ci/traces: keep images for every job except the performance testing")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25654>
2023-10-11 21:18:13 +00:00
Lionel Landwerlin
ebb68d506d anv: simplify push descriptors
There can only be one push descriptor amongst all descriptor sets.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25598>
2023-10-11 20:45:03 +00:00
Danylo Piliaiev
5ad78e61d0 tu: Count a whole push consts range in constlen for PREAMBLE push consts
Either none push consts are loaded via preamble or all of them even if
shader uses a single push const.

Fixes misrenderings with Zink. Zink unconditionally declares push
consts, regardless of whether they are actually used in the shader.

Fixes: a5f0f7d4b1
("turnip,ir3: Implement A7XX push consts load via preamble")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25638>
2023-10-11 20:06:38 +00:00
Yogesh Mohan Marimuthu
f97b449e9e radv: integrate meta astc compute decoder to radv
this patch calls the init and finish functions of the vk
runtime astc decoder. initializes emulate_astc flag. sets
up the additional plane to store decoded texture.

v2: fix _tex_dataformat() and _tex_numformat() (Chia-I Wu)
    use correct function for bufferToImage (Chia-I Wu)
v3: add radv_is_layout_emulated() (Chia-I Wu)
    avoid repeated pattern (Chia-I Wu)
v4: not create all pipelines on_demand (Chia-I Wu)
v5: current code does not support astc hdr (Chia-I Wu)
v6: keep luts in staging buffer only (Chia-I Wu)
v7: use 2DArray for both input and output
v8: document todo to use fp16 (Chia-I Wu)
    not required to move meta init anymore (Chia-I Wu)
    move astc_emulation_format to vk_texcompress_astc.h (Chia-I Wu)
v9: remove LAYOUT check (Chia-I Wu)
    check on iview->vk.view_format
    move setting tiled flags for astc (Chia-I Wu)
    remove is format emulated check in radv_is_storage_image* (Chia-I Wu)
    use LAYOUT_ASTC for if check (Chia-I Wu)
    no 1D support (Chia-I Wu)
    calculate start end offset in 2x blk size
v10: remove old wrong code (Chia-I Wu)
v11: use existing defined local format variable (Chia-I Wu)
     dst image layout is always VK_IMAGE_LAYOUT_GENERAL (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00
Yogesh Mohan Marimuthu
09b574aa6c vulkan add 3D texture support for compute astc decoder
v2: use correct 2D/3D for view type (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00
Yogesh Mohan Marimuthu
ff4d658fd5 vulkan/runtime: add compute astc decoder helper functions
The astc compute decode and lut creation code is copied
from https://github.com/Themaister/Granite/

Always set DECODE_8BIT idea is copied from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19886

v2: use astc glsl shader code (Chia-I Wu)
v3: fix 32bit compilation error (Christopher Snowhill)
v4: use pitch to copy in vk_create_fill_image_visible_mem() function
    pass correct layer to decode_astc()
v5: use existing ASTCLutHolder (Chia-I Wu)
v6: use only staging buffer (Chia-I Wu)
    use texel buffer for partition table (Chia-I Wu)
v7: use 2DArray for input and output
v8: check for == mem_property (Chia-I Wu)
    do not use vk_common* functions (Chia-I Wu)
    squash single buffer patch (Chia-I Wu)
    fix for minTexelBufferOffsetAlignment (Chia-I Wu)
    avoid wasting 4 slots (Chia-I Wu)
    remove partition_tbl_mask (Chia-I Wu)
    remove wrong bindings count (Chia-I Wu)
    use binding names from glsl code (Chia-I Wu)
    use ARRAY_SIZE (Chia-I Wu)
    use VkFormat for getting partition table index (Chia-I Wu)
    fix mutex lock (Chia-I Wu)
    image layout should be based on function call (Chia-I Wu)
    VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE is wrong (Chia-I Wu)
    add vk_texcompress_astc tag to helpder functions (Chia-I Wu)
    remove write_desc_set_count (Chia-I Wu)
    use desc_i++ (Chia-I Wu)
    add assert for desc_i count at end (Chia-I Wu)
    remove unused vk_create_map_texel_buffer() function (Chia-I Wu)
    dynamically create the lut offset (Chia-I Wu)
    offset not to pass as push contant (Chia-I Wu)
v9: use correct stoage and sampled flags (Chia-I Wu)
    always pass single_buf_size (Chia-I Wu)
    query drivers for minTexelBufferOffsetAlignment (Chia-I Wu)
    remove blank lines (Chia-I Wu)
    remove unnecessary if check in destroy (Chia-I Wu)
    name label as unlock instead of fail and pass (Chia-I Wu)
    use prog_glslang.found() (Chia-I Wu)
    add offset,extent check to astc shader (Chia-I Wu)
v10: prog_glslang can be undefined in meson.build (Chia-I Wu)
v11: remove with_texcompress_astc and use required in find_program (Chia-I Wu)
v12: offset are aligned to blk size (Chia-I Wu)
v13: texel_blk_start should be under vulkan if check (Chia-I Wu)
     dst image layout is always VK_IMAGE_LAYOUT_GENERAL (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00
Yogesh Mohan Marimuthu
bcc0e1e2af vulkan/formats,zink: move vk_format_from_pipe_format() function
rename zink_pipe_format_to_vk_format() to vk_format_from_pipe_format()
and put it in common code.

v2: reorder vk_format.h (Chia-I Wu)
    rename to vk_format_from_pipe_format (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00
Yogesh Mohan Marimuthu
8da85d2475 util: move ASTCLutHolder from mesa/main to util
v2: remove extra u_formats.h header addition (Chia-I Wu)
    use stddef.h and not unistd.h (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00
Chia-I Wu
0236b7f18a mesa: make astc_decoder.glsl vk-compatible
glslangValidator -V -S comp astc_decoder.glsl

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:39 +00:00
Yogesh Mohan Marimuthu
718b85a1f2 ac/surface: add astc block size to bpe_to_format() function
v2: remove old comment (Chia-I Wu)
v3: add comment on matching BC3 and ASTC4x4 (Chia-I Wu)

Acked-by: : Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:39 +00:00
David Rosca
ff36024576 radeonsi/vcn: Add High Quality encoding preset for AV1
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25564>
2023-10-11 19:07:28 +00:00
David Rosca
75fe0ad8e7 frontends/va: Add High Quality preset mode
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25564>
2023-10-11 19:07:28 +00:00
Danylo Piliaiev
94af08421b ir3: Fix values of #wrmask not being compatible with ir3 parser
IR3 parser expects wrmask values to be in xyzw order.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25661>
2023-10-11 18:35:32 +00:00
Christian Gmeiner
fe0965afa6 spirv: Don't use libclc for rotate
We have a nir lowering for drivers that do not support urol.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25660>
2023-10-11 17:39:08 +00:00
Samuel Pitoiset
70de5d098b radv/ci: update list of flakes for STONEY
These should have been fixed couple of weeks ago.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25656>
2023-10-11 15:39:11 +00:00
Samuel Pitoiset
129d58e813 radv/ci: update list of flakes for VANGOGH
This one is already skipped in radv-skips.txt.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25656>
2023-10-11 15:39:11 +00:00
Samuel Pitoiset
ede0502b4a radv/ci: update list of expected failures on RAVEN
These have been fixed a while ago but I think only a subset of CTS
is used on RAVEN.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25656>
2023-10-11 15:39:11 +00:00
Rhys Perry
15a3515d0b aco/tests: test that hazards are resolved at the end of shader parts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25374>
2023-10-11 15:14:04 +00:00
Rhys Perry
690cb0b211 aco: resolve all possible hazards at the end of shader parts
fossil-db (vega10):
Totals from 1266 (2.01% of 63055) affected shaders:
Instrs: 707116 -> 708382 (+0.18%)
CodeSize: 3512452 -> 3517516 (+0.14%)
Latency: 6661724 -> 6666788 (+0.08%)
InvThroughput: 4393626 -> 4393904 (+0.01%); split: -0.00%, +0.01%

fossil-db (navi10):
Totals from 1305 (2.07% of 63015) affected shaders:
Instrs: 719699 -> 722009 (+0.32%)
CodeSize: 3650836 -> 3660076 (+0.25%)
Latency: 5691633 -> 5693933 (+0.04%)
InvThroughput: 1532010 -> 1532024 (+0.00%); split: -0.00%, +0.00%

fossil-db (navi31):
Totals from 1580 (1.99% of 79332) affected shaders:
Instrs: 1678242 -> 1679879 (+0.10%)
CodeSize: 8463464 -> 8470168 (+0.08%)
Latency: 14273661 -> 14275298 (+0.01%)
InvThroughput: 3668049 -> 3668080 (+0.00%); split: -0.00%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25374>
2023-10-11 15:14:04 +00:00
Rhys Perry
e4842c0270 aco: consider exec_hi in reads_exec()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25374>
2023-10-11 15:14:04 +00:00
Rhys Perry
ed3ca5b781 aco: fix s_setreg hazards
s_setreg doesn't have any definitions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25374>
2023-10-11 15:14:04 +00:00
Rhys Perry
ce27875f09 aco: only mitigate VcmpxExecWARHazard when necessary
fossil-db (navi10):
Totals from 5059 (8.03% of 63015) affected shaders:
Instrs: 7384947 -> 7351196 (-0.46%)
CodeSize: 39393180 -> 39299196 (-0.24%); split: -0.28%, +0.04%
Latency: 119683018 -> 119585224 (-0.08%); split: -0.08%, +0.00%
InvThroughput: 29647188 -> 29623895 (-0.08%); split: -0.08%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25374>
2023-10-11 15:14:04 +00:00
Rhys Perry
a73f76750b aco: fix LdsDirectVMEMHazard WaW with the wrong waitcnt
Seems we missed this case.

fossil-db (navi31):
Totals from 24 (0.03% of 79332) affected shaders:
Instrs: 3562 -> 3538 (-0.67%)
CodeSize: 18740 -> 18644 (-0.51%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 2cdb3e4b6b ("aco: add VMEMtoScalarWriteHazard tests")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25374>
2023-10-11 15:14:04 +00:00
Rohan Garg
26c2c96d62 anv: enable FCV for Gen12.5
Now that we have proper handling of FCV_CCS_E everywhere, we can turn
this on for Gen12.5.

This helps fix a performance regression where enabling fast
clears to non-zero values with CCS_E caused additional partial resolves,
regressing performance on certain games. Performance is helped on the
following games:
  - F1'22: +45%
  - RDR2: +6%

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25589>
2023-10-11 12:18:15 +00:00
Rohan Garg
8688a3b8f7 anv: ensure that FCV_CCS_E fast clears are properly tracked
Surfaces with FCV_CCS_E aux usage should be marked as fast cleared when
being rendered to, to ensure proper fast clear state tracking. We also
need to ensure that we're not trying to partially resolve surfaces with
level > 0 and layer > 0 since we don't track fast clear states for
those.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25589>
2023-10-11 12:18:15 +00:00
Rohan Garg
300c98dbb2 intel/genxml: fix 3DSTATE_3D_MODE length to align with BSpec
Closes: #8632
Fixes: 569afd37f1 ('intel/genxml: Copy gen12.xml to gen125.xml')
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25589>
2023-10-11 12:18:15 +00:00
Lionel Landwerlin
29352b304b anv: add support for VK_EXT_nested_command_buffer
Our implementation of secondary command buffers already jumps into
them and edits the end of the secondary command buffer to jump back
into the primary.

That implementation can work just the same with any levels of
secondary. The only possible issue would happen with a secondary
calling itself, but that's not possible.

We also cannot support simultaneous execution with self-modifying
command buffers. That's actually not a problem at the moment because
we don't have multiple queues of the same family but we choose to
reflect that in the feature bits.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25600>
2023-10-11 11:32:47 +00:00
Lionel Landwerlin
8a12286214 anv: rename primary in container in ExecuteCommands()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25600>
2023-10-11 11:32:47 +00:00
Lionel Landwerlin
798130b8aa vulkan: bump headers/registry to 1.3.267
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25600>
2023-10-11 11:32:47 +00:00
Lucas Stach
1e80011bc7 Revert "ci/etnaviv: allow failure on failing test"
This reverts commit 2ac2268ce7, as the issue causing the
test to fail has been resolved.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25646>
2023-10-11 11:17:28 +00:00
Lucas Stach
aeb6584ecd etnaviv: fix read staging buffer leak
Currently we only free a potentially allocated staging buffer
when the mapping is a write mapping, but staging buffers can
also be allocated for read mappings. Fix the read staging
buffer leaks by always freeing the staging buffer.

Closes #9967

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25646>
2023-10-11 11:17:28 +00:00
Matt Coster
c619d9c1b6 pvr: Clean up & fix sampler border color support
Take advantage of some vk_sampler goodness and migrate all pvr
tex_formats to map to pipe_formats in pvr_formats.c. This allows us to
get rid of all the nasty manual packing functions.

This cleanup incidentally fixes some bad swizzling that was happening
in the manual handling.

Fixes: 4a2e6284 pvr: Add support for sampler border colors
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/25270>
2023-10-11 10:58:34 +00:00
Matt Coster
efb9b03637 pvr: Use vk_sampler base
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/25270>
2023-10-11 10:58:33 +00:00
Matt Coster
a92d536cd7 pvr: Switch to common pipeline cache implementation
We don't currently make use of pipeline caching, but the common
implementation handles the boilerplate we had in pvr_pipeline_cache.c
for us.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25422>
2023-10-11 10:41:43 +00:00
Danylo Piliaiev
2717499c91 tu: Disable preamble push consts when they are not used
It's a common case for Zink which has to declare push consts in
pipeline layout, even if they are not actually used in shaders, due
to the compatibility rules.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25641>
2023-10-11 09:40:21 +00:00
Karmjit Mahil
8f59274e22 pvr: Fix PPP_SCREEN sizes
The `- 1` was accidentally removed.

Fixes: aae23fe68d ("pvr: HWRT creation simplifications.")
Reported-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
df57840dd0 pvr: Fix SPM load shader sample rate
Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
41a9af4819 pvr: Refactor subpass ds and sample count setup
Now we first check the sample count from the ds attachment as well
as setting it up.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
e07cff4ac5 pvr: Fix subpass sample count on ds attachment only
When no color attachments were used in a subpass, the sample count
was left unchanged to `1` while we should instead have picked it
up from the ds attachment if there was one.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
bfcb88ea99 pvr: Order tile buffer EOT emits to be last
Tile buffer emits required a load from the tile buffer into the
output regs, so they must be placed at the end of the EOT program
as to not corrupt the output register emits.

This commit orders the emit state to place output register emits
first, and tile buffer emits last.

dEQP test fixed:
  dEQP-VK.renderpass.suballocation.attachment.4.422
  ... and others from the dEQP-VK.renderpass.suballocation.*

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
9d1fc4de72 pvr: Fix OOB access of pbe_{cs,reg}_words
`hw_render->eot_surface_count` also includes surface which don't
need an emit. Using `i` was leading to OOB access when there were
surfaces that didn't need emits, and in total there were
`> PVR_MAX_COLOR_ATTACHMENTS` surfaces.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
e5feea3826 pvr: Fix pbe_emit assert
The `eot_surface_count` also includes surfaces which don't need an
emit. Surfaces with PVR_RESOLVE_TYPE_TRANSFER don't need an emit
since they'll be resolved through a transfer op, but they still count
against the total, thus the assert was incorrect.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Karmjit Mahil
e6c1e0e518 pvr: Fix MRT index in PBE state
The same MRT index was incorrectly being set for all render
targets, in the PBE state.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
2023-10-11 08:19:30 +00:00
Faith Ekstrand
65f12fde44 nvk: Improve address space and buffer size limits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:57:10 -05:00
Faith Ekstrand
b0d0c2d765 nvk: Always emit at least one color attachment
Without this, alpha to coverage doesn't work because the hardware
ignores the output of the first color from the shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:56:58 -05:00
Faith Ekstrand
e9747eb91f nvk: Disable depth or stencil tests when unbound
Dynamic rendering requires that the client be able to bind just one
aspect of a depth/stencil image.  Because we only have interleaved
depth/stencil on NVIDIA and no actual disable bits, this means we need
to implicitly AND any enables with a vk_format != UNDEFINED check.  In
future, we might want to do that with a macro but we'll keep it simple
for today.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:56:38 -05:00
Faith Ekstrand
6ab969ff4a nil/format: Advertise R10G10B10A2_UINT texture buffer support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:56:28 -05:00
Faith Ekstrand
7bedd0c2fc nil/format: Use A for alpha blend
This lets us reserve B for buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:56:21 -05:00
Faith Ekstrand
1c4d5135a6 nvk: Reset descriptor pool allocator when all sets are destroyed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:56:14 -05:00
Faith Ekstrand
9a51185d45 nvk: Set max descriptors to 2^20 for most descriptor types
Dynamic is the exception here.  Those have much stricter limits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:56:04 -05:00
Faith Ekstrand
3d3641e446 nvk: Emit MME_DMA_SYSMEMBAR before indirect draw/dispatch
This fixes issues where we may read stale data from other parts of the
GPU when we go to do an indirect draw fetch.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:55:56 -05:00
Faith Ekstrand
160bf37bc4 nvk: Advertise more inline uniform block limits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25653>
2023-10-11 02:55:44 -05:00
Eric Engestrom
9c2b523c53 ci/b2c: use latest mesa-trigger image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25643>
2023-10-11 06:37:20 +00:00
Eric Engestrom
298f2db76d ci/b2c: move to the shiny new gfx-ci/ci-tron repo
We've successfully moved the repo to its new location now that the
project is ready for general use.

Update the config to use the new paths.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25643>
2023-10-11 06:37:19 +00:00
Karol Herbst
7afdbd5f6d nir/load_libclc: fix libclc memory leak
Fixes: ef453f5439 ("spirv: Add a shared libclc loader")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25649>
2023-10-11 03:05:23 +00:00
Qiang Yu
a59a66e111 radeonsi: disable disk cache when use aco
This is a temp fix. Currently we mix use llvm and aco to compile
shaders when AMD_DEBUG=useaco, but disk cache need function
identifier when creation, aco compiled shader should not use llvm
function identifier, so we have to disable disk cache when use
aco for now.

After aco is able to compile all shaders, we can re-enable disk
cache by removing the llvm function identifier when aco.

Fixes: d1dd36a74e ("radeonsi: be able to use aco compiler for mono ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9673
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25607>
2023-10-11 02:36:29 +00:00
Mike Blumenkrantz
e8a76adde8 lavapipe: don't block begin/end cmdbuf pipeline barriers
these are now useful

fixes #9972

Fixes: 3b547a9b58 ("lavapipe: Switch to the common sync framework")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25652>
2023-10-11 01:34:42 +00:00
Mike Blumenkrantz
7078cd3652 zink: set ZINK_DEBUG=quiet for polaris jobs
modifiers aren't supported here, so this will otherwise spam infinitely

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25645>
2023-10-10 23:12:17 +00:00
Mike Blumenkrantz
eb94d235fb zink: apply ZINK_DEBUG=quiet to all missing feature warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25645>
2023-10-10 23:12:17 +00:00
Dave Airlie
833f04d261 lavapipe + docs: update ycbcr extension enables.
This passes all the dEQP-VK.ycbcr* tests and updates the docs.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25628>
2023-10-11 05:54:14 +10:00
Karol Herbst
119c213087 rusticl/memory: fix potential use-after-free in clEnqueueSVMMemFill
Fixes: bfee3a8563 ("rusticl: add support for fine-grained system SVM")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reported-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25637>
2023-10-10 18:41:48 +00:00
Frank Binns
a157ab7b33 pvr: emit PPP state when vis_test dirty bit is set
Unlike other dirty bits, the vis_test dirty bit wasn't being taken into
consideration when determining whether PPP state needed to be emitted as part
of a draw call.

Fixes a large number of tests in dEQP-VK.query_pool.occlusion_query.*.

Fixes: 2b1992a000 ("pvr: Implement vkCmdBeginQuery API.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25491>
2023-10-10 18:27:01 +00:00
Frank Binns
a44ec36684 pvr: fix setup of load op unresolved msaa mask
Bits were being assigned rather than ORed into the mask during setup. Noticed
through code inspection.

Fixes: e089166776 ("pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25487>
2023-10-10 18:10:52 +00:00
Frank Binns
ae277edc3a pvr: change a few places to use PVR_DW_TO_BYTES()
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25489>
2023-10-10 17:54:14 +00:00
Frank Binns
6417a65f28 pvr: fix allocation size of clear colour consts shared regs buffer
The number of const shared registers was being used for the allocation size
rather than the number of bytes. In practice this doesn't make a difference as
the max allocation size is 24 bytes, which then gets rounded up to 64 bytes by
the buffer allocation function. However, we might as well make the allocation
size correct to avoid any future confusion. Noticed through code inspection.

Fixes: 7509e259f8 ("pvr: Implement color/depth/depth+stencil attachment clear.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25489>
2023-10-10 17:54:14 +00:00
Frank Binns
e8f6d7b0d4 pvr: fix attachments segfault in pvr_is_stencil_store_load_needed()
pvr_is_stencil_store_load_needed() may be called on secondary command buffers,
which don't have any attachments. This wasn't being taken into account, meaning
a segfault could occur.

Fixes a segfault seen in:
dEQP-VK.renderpass.suballocation.attachment_allocation.input_output.39

Fixes: 54876512a1 ("pvr: Add mid fragment pipeline barrier if needed.")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25486>
2023-10-10 17:40:10 +00:00
Martin Roukala (né Peres)
852d004637 zink/ci: remove 42 tests from the zink-radv-polaris10-fails list
Not sure which MR fixed them, but I'll take these fixes!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25629>
2023-10-10 17:11:19 +00:00
Roman Stratiienko
7301914755 dri: Remove __driDriverExtensions leftovers
Android-14/clang-17 throws an error with it:

ld.lld: error: version script assignment of 'global' to symbol
   '__driDriverExtensions' failed: symbol not defined

Fixes: d43e6a9a49 ("dri: Remove the megadriver compat stub")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25587>
2023-10-10 16:39:27 +00:00
Erik Faye-Lund
3485744087 zink: fix wording of warning
The string-argument for this function is the name of the feature, not
the entire message.

Fixes: ea0e22da44 ("zink: use warn_missing_feature for missing modifier support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25644>
2023-10-10 16:11:05 +00:00
Samuel Pitoiset
052d12492d ac/nir: only consider overflow for valid feedback buffers
Otherwise the ordered operation above (ie. a GDS atomic return) might
return non-zero offsets for invalid buffers.

Fixes: f7076d129d ("amd: add nir_intrinsic_xfb_counter_sub_amd and fix overflowed streamout offsets")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25613>
2023-10-10 15:47:54 +00:00
Samuel Pitoiset
bbf135db3d radv: allocate only 1 GDS OA counter for gfx10 NGG streamout
It works with just one counter.

This mitigates https://gitlab.freedesktop.org/drm/amd/-/issues/2902
quite a lot when you run dEQP-VK.transform_feedback.* in parallel on
more than 16 threads with RDNA3.

For example, on my GPU the kernel reports 16 GDS OA counters which means
that if you run VKCTS with 16 threads (ie. 16 Vulkan devices are
created) it's fine. Otherwise, the kernel might report ENOMEM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25619>
2023-10-10 15:12:26 +00:00
Samuel Pitoiset
7c7684c656 radv: fix destroying GDS/OA BOs
Otherwise, we have dangling BO pointers in the global BO list. Not
quite sure why this hasn't been triggered before.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25623>
2023-10-10 14:31:01 +00:00
Alyssa Rosenzweig
731e682cc0 freedreno/ci: Minetest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
b3da29ae58 nir/opt_preamble: Respect ACCESS_CAN_SPECULATE
In general, it is unsafe to speculatively hoist conditionally executed loads
into the preamble. For example, if the shader does:

   if (ptr is valid) {
      foo(*ptr)
   }

we cannot dereference ptr in the preamble without knowing that the pointer is
valid (which may not be determinable, since it might not be uniform).
nir_opt_preamble needs to stop speculating in this case, or otherwise using
preambles can cause faults on legal shaders.

However, some platforms may be able to speculate loads safely. For example,
Apple hardware is able to suppress MMU faults, making speculation safe.  This is
controlled global register to control this behaviour, set at boot-time by the
kernel.  (macOS suppresses these faults unconditionally, this feature may be
used in their implementation of sparse textures. Currently Linux does not
suppress any faults but this may change later.)

Since nir_opt_preamble should work soundly and optimally on a variety of
platforms, we need to respect the ACCESS flag.

Thanks to the if-else hoisting implemented earlier in the series, this isn't too
terrible of a band-aid on Asahi:

    total instructions in shared programs: 1499674 -> 1507699 (0.54%)
    instructions in affected programs: 78865 -> 86890 (10.18%)
    helped: 0
    HURT: 337
    Instructions are HURT.

    total bytes in shared programs: 10238284 -> 10279308 (0.40%)
    bytes in affected programs: 554504 -> 595528 (7.40%)
    helped: 3
    HURT: 334
    Bytes are HURT.

    total halfregs in shared programs: 452049 -> 454015 (0.43%)
    halfregs in affected programs: 7569 -> 9535 (25.97%)
    helped: 7
    HURT: 150
    Halfregs are HURT.

There are no shader-db changes on ir3 as expected, since ir3 can safely
speculate all instructions in my shader-db.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
8d037d943d nir/opt_preamble: Move phis for movable if's
Add infrastructure to reconstruct if's. Later in the series, this will let us
hoist loads from inside uniform if's without speculating. For now, it lets us
handle phi's in nir_opt_preamble in a straightforward way.

Results on AGX are good:

   total instructions in shared programs: 1504730 -> 1499674 (-0.34%)
   instructions in affected programs: 153673 -> 148617 (-3.29%)
   helped: 496
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 10287768 -> 10238284 (-0.48%)
   bytes in affected programs: 1113724 -> 1064240 (-4.44%)
   helped: 496
   HURT: 0
   Bytes are helped.

   total halfregs in shared programs: 452669 -> 452049 (-0.14%)
   halfregs in affected programs: 14825 -> 14205 (-4.18%)
   helped: 152
   HURT: 99
   Halfregs are helped.

   total threads in shared programs: 16469504 -> 16470784 (<.01%)
   threads in affected programs: 8960 -> 10240 (14.29%)
   helped: 10
   HURT: 0
   Threads are helped.

Results on ir3 is a bit more of a wash but still should be a win overall: The
regression in moves seems scary, but the cost model already accounts for them as
evidenced by instruction count coming out ahead.

   total instructions in shared programs: 3108750 -> 3105993 (-0.09%)
   instructions in affected programs: 317367 -> 314610 (-0.87%)
   helped: 675
   HURT: 242
   Instructions are helped.

   total nops in shared programs: 673152 -> 675048 (0.28%)
   nops in affected programs: 74551 -> 76447 (2.54%)
   helped: 353
   HURT: 347
   Inconclusive result (%-change mean confidence interval includes 0).

   total non-nops in shared programs: 2435598 -> 2430945 (-0.19%)
   non-nops in affected programs: 232664 -> 228011 (-2.00%)
   helped: 816
   HURT: 38
   Non-nops are helped.

   total mov in shared programs: 78201 -> 84011 (7.43%)
   mov in affected programs: 10726 -> 16536 (54.17%)
   helped: 60
   HURT: 781
   Mov are HURT.

   total cov in shared programs: 74964 -> 74906 (-0.08%)
   cov in affected programs: 273 -> 215 (-21.25%)
   helped: 17
   HURT: 0
   Cov are helped.

   total dwords in shared programs: 6716814 -> 6748726 (0.48%)
   dwords in affected programs: 879778 -> 911690 (3.63%)
   helped: 12
   HURT: 948
   Dwords are HURT.

   total full in shared programs: 193210 -> 193212 (<.01%)
   full in affected programs: 278 -> 280 (0.72%)
   helped: 12
   HURT: 22
   Inconclusive result (value mean confidence interval includes 0).

   total constlen in shared programs: 493632 -> 494816 (0.24%)
   constlen in affected programs: 19904 -> 21088 (5.95%)
   helped: 9
   HURT: 306
   Constlen are HURT.

   total cat0 in shared programs: 742476 -> 745046 (0.35%)
   cat0 in affected programs: 84455 -> 87025 (3.04%)
   helped: 277
   HURT: 489
   Cat0 are HURT.

   total cat1 in shared programs: 153303 -> 159059 (3.75%)
   cat1 in affected programs: 17810 -> 23566 (32.32%)
   helped: 69
   HURT: 780
   Cat1 are HURT.

   total cat2 in shared programs: 1144508 -> 1140731 (-0.33%)
   cat2 in affected programs: 121284 -> 117507 (-3.11%)
   helped: 841
   HURT: 0
   Cat2 are helped.

   total cat3 in shared programs: 942098 -> 934804 (-0.77%)
   cat3 in affected programs: 87140 -> 79846 (-8.37%)
   helped: 855
   HURT: 1
   Cat3 are helped.

   total cat4 in shared programs: 65261 -> 65249 (-0.02%)
   cat4 in affected programs: 42 -> 30 (-28.57%)
   helped: 12
   HURT: 0
   Cat4 are helped.

   total sstall in shared programs: 237311 -> 241281 (1.67%)
   sstall in affected programs: 33755 -> 37725 (11.76%)
   helped: 179
   HURT: 493
   Sstall are HURT.

   total (ss) in shared programs: 58166 -> 58795 (1.08%)
   (ss) in affected programs: 4535 -> 5164 (13.87%)
   helped: 35
   HURT: 664
   (ss) are HURT.

   total systall in shared programs: 503784 -> 503805 (<.01%)
   systall in affected programs: 3170 -> 3191 (0.66%)
   helped: 16
   HURT: 13
   Inconclusive result (value mean confidence interval includes 0).

   total (sy) in shared programs: 27261 -> 27259 (<.01%)
   (sy) in affected programs: 76 -> 74 (-2.63%)
   helped: 8
   HURT: 5
   Inconclusive result (value mean confidence interval includes 0).

   total waves in shared programs: 439848 -> 439872 (<.01%)
   waves in affected programs: 160 -> 184 (15.00%)
   helped: 12
   HURT: 0
   Waves are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
802fb8f7f3 nir/opt_preamble: Unify foreach_use logic
Deduplication in prep for reconstructing if's.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
3fda1d9691 nir/opt_preamble: Preserve IR when replacing phis
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
e065983dce nir/opt_preamble: Walk cf_list manually
The way backends walk NIR when translating. This will make it easy to filter
can_move based on the parent control flow.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
6576add3dc ir3: Model cost of phi nodes for opt_preamble
It can be beneficial to move phi nodes, even though they can often be coalesced.
Model this cost so nir_opt_preamble can make good decisions about hoisting phi
nodes (and by extension, if-statements) into the preamble.

At this point in the series, this has no effect, but it will avoid certain
shader-db regressions associated with the nir_opt_preamble changes later in the
series.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
bfb3eacad3 ir3: Set CAN_SPECULATE before opt_preamble
Speculating these loads is safe, but nir_opt_preamble doesn't know that. Set the
ACCESS bits appropriately to let it know.

This will avoid any code gen regression from the nir_opt_preamble change.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Alyssa Rosenzweig
3325b4778a nir: Add ACCESS_CAN_SPECULATE
Determining whether it is safe to hoist a load instruction out of control flow
depends on complex hardware and driver details. Rather than encoding this as
knobs in every NIR pass that wants to do so (notably nir_opt_preamble and
nir_opt_peephole_select), add a per-load ACCESS flag for backends to set.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
2023-10-10 13:51:00 +00:00
Jani Nikula
01e7ac328f docs/vulkan: fixup some typos
The type is called vk_object_base, not vk_vk_objet_base... This should
fix the cross-referencing of this type.

Fixes: f6d4641433 ("vulkan,docs: Document vk_instance")
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25634>
2023-10-10 13:42:37 +00:00
David Heidelberg
9786ab7ecd ci/traces: rename upload function to reflect it works with S3
Cosmetic change.

Acked-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/25606>
2023-10-10 12:46:51 +00:00
David Heidelberg
5ab60581da ci/traces: keep images for every job except the performance testing
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8354

Acked-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/25606>
2023-10-10 12:46:51 +00:00
David Heidelberg
82cfed9758 ci/traces: upload only missing trace images
Right now, S3 always returns something, so we need to check
the content-type .

Acked-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/25606>
2023-10-10 12:46:51 +00:00
Samuel Pitoiset
ea0e22da44 zink: use warn_missing_feature for missing modifier support
To avoid spamming VKCTS output.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25636>
2023-10-10 11:44:12 +00:00
Erik Faye-Lund
2ac2268ce7 ci/etnaviv: allow failure on failing test
This test has been failing every nightly pipeline on the CI for a long,
long time. It seems nobody is currently interested in fixing it, so
let's just allow the failure for now.

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/9967

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25635>
2023-10-10 11:28:52 +00:00
Erik Faye-Lund
7368a89752 ci/etnaviv: update ci expectation
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25635>
2023-10-10 11:28:52 +00:00
Danylo Piliaiev
8fe599ed1c tu: Zero init tu_render_pass and tu_subpass for dynamic rendering
The way we init render pass related structures is dangerous with when
structs are not zero initialized - too easy to miss a field. There
were already at least two issues with it.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25592>
2023-10-10 09:42:15 +00:00
Danylo Piliaiev
964a27aa39 tu: Fix stale tu_render_pass_attachment::store_stencil with dyn rendering
Attachment initialization helpers expect zeroed memory by default.

Fixes a hang when running Subnautica with TU_DEBUG="gmem".
See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8702#note_1932003

Fixes: ed125e6cca
("tu: Initial support for dynamic rendering")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25592>
2023-10-10 09:42:15 +00:00
Alyssa Rosenzweig
335cf5f22f nir: Use a tagged pointer for nir_src parents
This allows us to pack the is_if boolean into the bottom bit of the parent
pointer, eliminating the boolean and hence shrinking the nir_src by 8 bytes (due
to the extra 63 bits of padding incurred in the old layout).

Because all access is forced through helpers now, this is a local change.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
2023-10-10 04:58:05 -04:00
Alyssa Rosenzweig
316af8c965 nir: Assert the nir_src union is used safely
It is undefined behaviour in C to read a different member of a union than was
written. Nothing in-tree should be using this behaviour with the nir_src union:
nir_if should never be read as nir_instr and vice versa. Assert this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
2023-10-10 04:58:05 -04:00
Alyssa Rosenzweig
c39896b17b nir: Use getters for nir_src::parent_*
First, we need to give the parent_instr field a unique name to be able to
replace with a helper.  We have parent_instr fields for both nir_src and
nir_def, so let's rename nir_src::parent_instr in preparation for rework.

This was done with a combination of sed and manual fix-ups.

Then we use semantic patches plus manual fixups:

    @@
    expression s;
    @@

    -s->renamed_parent_instr
    +nir_src_parent_instr(s)

    @@
    expression s;
    @@

    -s.renamed_parent_instr
    +nir_src_parent_instr(&s)

    @@
    expression s;
    @@

    -s->parent_if
    +nir_src_parent_if(s)

    @@
    expression s;
    @@

    -s.renamed_parent_if
    +nir_src_parent_if(&s)

    @@
    expression s;
    @@

    -s->is_if
    +nir_src_is_if(s)

    @@
    expression s;
    @@

    -s.is_if
    +nir_src_is_if(&s)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
2023-10-10 04:58:05 -04:00
Alyssa Rosenzweig
ad619da3bc nir: Use set_parent_instr internally
This properly clears is_if.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
2023-10-10 04:58:04 -04:00
Alyssa Rosenzweig
19f8e0e3aa nir: Add trivial nir_src_* getters
These will become nontrivial later in the series. For now these have no smarts
in them, in order to make the conversion completely mechanical.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
2023-10-10 04:58:04 -04:00
Alyssa Rosenzweig
4753ce7d72 lima/pp: Do not use union undefined behaviour
It is invalid to read parent_instr for an if-use (or parent_if for a
non-if-use). Make sure we read the right one when handling if-uses.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
2023-10-10 04:58:04 -04:00
Samuel Pitoiset
e1622dcca1 radv: fix IB alignment
This re-introduces "radv: fix alignment of DGC command buffers" and
"radv/amdgpu: fix alignment of command buffers" which were valid
changes.

IBs need to be aligned to the IB size requirement, not the number of
padded NOPs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25588>
2023-10-10 06:26:59 +00:00
Dave Airlie
af062126ae lavapipe: expose planar ycbcr formats and new ycbcr features
This enables some extensions and a bunch of formats for ycbcr
support.

dEQP-VK.api.info.format_properties.g8_b8_r8_3plane_420_unorm,Fail
dEQP-VK.api.info.format_properties.g8_b8r8_2plane_420_unorm,Fail

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
e6ae51014d lavapipe: handle planes in texture lowering.
This uses the descriptor set info to lower the texture/sampler
handlers properly using the stride.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
a13a07d166 lavapipe: add descriptor sets bindings for planar images
This adds strided descriptor bindings that are used to handle
planar image/samplers.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
cfdad158a1 lavapipe: handle planes in get image sub resource
image sub resources need to take planes into account in the calculations.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
64cf0d47b0 lavapipe: handle planes in copies
This adds plane support to the various copy paths.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
d2671d3c17 lavapipe: allocate image and image view planes.
This allocate planes and handles disjoint.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
a368e3f8d5 lavapipe: start introducing planes structure.
this just introduces a single plane and refactors code to use it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
9bbb21eecd lavapipe: cleanup copy code to use a local region variable.
This should make no functional difference, except cleanup the code.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:07 +00:00
Dave Airlie
b52261cb9c lavapipe: convert sampler to use vk base class.
This just makes things a bit cleaner, and reuses the common code.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Dave Airlie
66c118495e llvmpipe: don't support planar formats for buffers.
This stops lavapipe exposing incorrect support.

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Dave Airlie
d1622204b5 lavapipe: don't emit blit src/dst for subsampled formats.
Fixes dEQP-VK.api.info.format_properties.b8g8r8g8_422_unorm

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Dave Airlie
b66afc2a54 llvmpipe: don't create texture functions for planar textures.
Since we can't sample from these directly, just don't create the
functions.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Dave Airlie
f9e7997ac8 lavapipe: support host image copying on compressed texture formats
dEQP-VK.image.host_image_copy.query.linear.bc5_snorm_block,Fail
dEQP-VK.image.host_image_copy.query.linear.bc7_unorm_block,Fail
dEQP-VK.image.host_image_copy.query.optimal.bc5_snorm_block,Fail
dEQP-VK.image.host_image_copy.query.optimal.bc7_unorm_block,Fail

Fixes: 9e9d90c6c3 ("lavapipe: VK_EXT_host_image_copy")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Dave Airlie
21a79acaa7 lavapipe: fix subresource layers asserts
dEQP-VK.api.copy_and_blit.copy_commands2.blit_image.simple_tests.array.all_remaining_layers

Fixes: 35c02f79c9 ("lavapipe: add some asserts for blit region extents")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Dave Airlie
05047ceced lavapipe: fix some whitespace in advance of other changes.
This is just some tab and trailing whitespace removal.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25609>
2023-10-10 04:37:06 +00:00
Qiang Yu
0e97568aed radeonsi: enable aco compile for part mode ps
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:41 +08:00
Qiang Yu
333d6f007a radeonsi: add ps epilog shader part build
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:36 +08:00
Qiang Yu
42907365f8 radeonsi: fill aco shader info for ps part
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:32 +08:00
Qiang Yu
a994db1d8f radeonsi: extract si_get_ps_epilog_args to be shared with aco
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:28 +08:00
Qiang Yu
e41833a6a2 radeonsi: add ps prolog shader part build
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:24 +08:00
Qiang Yu
5263a9e364 ac,radeonsi: remove unused ps prolog key fields
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:20 +08:00
Qiang Yu
1728111c29 radeonsi: extract si_get_ps_prolog_args to be shared with aco
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:16 +08:00
Qiang Yu
9594a579b2 radeonsi: extract si_prolog_get_internal_binding_slot
To be shared with ps prolog.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:11 +08:00
Qiang Yu
c4643477cd radeonsi: init spi_ps_input_addr for part mode ps
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:10:07 +08:00
Qiang Yu
c77a57b981 radeonsi: reduce sgpr count for scratch_offset when aco
aco add scratch_offset to shader args explicitly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24989>
2023-10-10 11:09:48 +08:00
Qiang Yu
5ef7c54829 aco: wait memory ops done before go to next shader part
Next part don't know whether p_end_with_regs args are loaded from
memory ops or not, need to wait it's done here.

Other memory load needs to be waited too like:
  a = load_mem()
  b = ...
  if (...) {
    wait_mem(a)
    store_mem(a)
  }
  p_end_with_regs(b)

"a" still needs to be waited, otherwise next shader part regs may
be overwritten by unfinished memory loads.

Memory stores are waited too. When >=gfx10 and last VGT has no
parameter export, we need to wait all memeory stores done before
pos export (see ac_nir_export_position). So when merged shader
(ES+GS or VS+GS) is partially built, first stage needs to wait
all memory stores done, otherwise second stage don't know if
any memory stores pending before.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signe-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
5ba68f92b4 aco: create exit block for p_end_with_regs to branch to
To handle ps discard in radeonsi part mode shader.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
bf25a7f59b aco: fix assertion fail when program contains empty block
radeonsi may generate empty main shader or an empty exit block
for p_end_with_regs to jump to.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
6eb0910d45 aco: do not fix_exports when program has epilog
PS with epilog does not need to fix_exports. And radeonsi use
p_end_with_regs so does not have jump instruction at last.

radeonsi may also have exec restore instruction, so may break
before reach to p_end_with_regs.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
f97a701d89 aco,radv,radeonsi: pass spi ps input ena and addr
radeonsi may pass different ena and addr when part mode shader.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
c9c18d3da5 aco: compact ps expilog color export for radeonsi
radeonsi need to compact color export for ps epilog while radv does not.
radv will fill empty color slot, so won't affected by this change.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
1517aa7a8a aco,radv: add radeonsi spec ps epilog code
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
9972a385fb aco: simplify export_fs_mrt_color
It's now used by ps epilog only.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
77d5966661 aco,radv: rename ps epilog info inputs to colors
Will add other mrtz args for radeonsi.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
d8fa106c17 aco,radv: remove unused ps epilog info fields
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:34 +00:00
Qiang Yu
57b0f19582 aco: add create_fs_end_for_epilog for radeonsi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:33 +00:00
Qiang Yu
90c901a987 aco: handle ps outputs from radeonsi
radeonsi will keep outputs <FRAG_RESULT_DATA0.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:33 +00:00
Qiang Yu
49250f9fc5 aco: add ps prolog generation for radeonsi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:33 +00:00
Qiang Yu
67244fc88a aco: remove p_end_with_regs from needs_exact()
ps needs to handle wqm:
1. main part may compute with args from prolog in wqm mode, so
   prolog need to compute these args in wqm mode too.
2. prolog and main part need to end with exact exec, so next
   shader part which inherit previous shader part's exec won't
   do valid job for helper threads

1 need p_end_with_regs to operate in wqm mode and itself can't
be exact, otherwise some move instruction added by it won't be
in wqm mode so helper threads' compute result is not passed to
next shader part as args.

2 is done by p_end_wqm added by finish_program automatically
after p_end_with_regs.

Piglit tests can trigger the problem:

1. gl-2.1-polygon-stipple-fs
  a. ps prolog call discard_if
  b. ps main pass wqm exec to epilog
  c. ps epilog export color for discarded pixel

2. fs-fwidth-color.shader_test
  a. ps prolog need to pass args computed in wqm mode
  b. set p_end_with_regs to exact will end wqm mode before
     the move instructions, so helper threads's result is not
     passed to next shader part

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:33 +00:00
Qiang Yu
80728a2e71 aco: do not eliminate final exec write when p_end_with_regs block
p_end_with_regs just partially end the program, next part need
exec mask to be set correctly. For example p_end_wqm will generate
a exec restore from WQM mode after p_end_with_regs.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:33 +00:00
Qiang Yu
38530b808e ac,radeonsi: move ps arg pos_fixed_pt to ac_shader_args
It's a HW init reg, not driver spec user sgpr. radv just
doesn't use it. Move it to amd common for aco ps prolog
usage.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
2023-10-10 02:36:33 +00:00
Yiwei Zhang
72cb85b778 venus: make device memory alloc async
Add a new perf option NO_ASYNC_MEM_ALLOC. Track the ring seqno of the
memory alloc command, and do async ring wait to ensure:
- memory allocation is before resource creation
- memory import is before resource destroy

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25611>
2023-10-10 01:59:34 +00:00
Yiwei Zhang
95d90cdf3d venus: refactor vn_device_memory to prepare for async alloc
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25611>
2023-10-10 01:59:34 +00:00
Yiwei Zhang
123f37c803 venus: track VkPhysicalDeviceMemoryProperties instead
For code simplicity.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25611>
2023-10-10 01:59:34 +00:00
Yiwei Zhang
1db03e42bd venus: remove redundant bo roundtrip and add more docs
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25611>
2023-10-10 01:59:34 +00:00
Emma Anholt
47024f22fe ci/crocus: Disable flaky unvanquished-ultra trace
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25626>
2023-10-10 01:24:47 +00:00
Emma Anholt
e25f5875bd ci/zink: Skip dmat[34] op tests in general, as well
More "make full-run zink CI take less time".  You still get dmat2 to see
if double matrices work at all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25626>
2023-10-10 01:24:47 +00:00
Emma Anholt
7d6d63e554 ci/zink: Skip 3-minute-long glx-visuals timeouts.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25626>
2023-10-10 01:24:47 +00:00
Emma Anholt
9aec599678 ci/crocus: Generalize the drawarrays-vertex-count flakes.
We just got it for triangle fan as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25626>
2023-10-10 01:24:47 +00:00
Iván Briano
987749430d nir: round f2f16{_rtne/_rtz} correctly for constant expressions
As noted in the previous commit, the intermediate cast to float from
double can produce wrong results.

Fixes upcoming Vulkan CTS tests:
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.rounding_rte_sconst_conv_from_fp64_up
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.rounding_rte_sconst_conv_from_fp64_up_nostorage
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_sconst_conv_from_fp64_up_vert
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_sconst_conv_from_fp64_up_nostorage_vert
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_sconst_conv_from_fp64_up_frag
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_sconst_conv_from_fp64_up_nostorage_frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25281>
2023-10-09 23:37:52 +00:00
Iván Briano
8382ee6e23 util: add double_to_float16 helpers
We convert from doubles to half by going through float in between, but
as noted in the comment in this commit, that can give wrong results in
some cases.

Add some helpers to ensure correct results based on rounding mode that
will be used in the next commit.

v2: Use fi/di from u_math.h (Ian)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25281>
2023-10-09 23:37:52 +00:00
Iván Briano
54498937c5 intel/compiler: round f2f16 correctly for RTNE case
v2: bcsel -> b2i32 (Ian)

Fixes upcoming Vulkan CTS tests:
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.rounding_rte_conv_from_fp64_up
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.rounding_rte_conv_from_fp64_up_nostorage
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp64_up_vert
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp64_up_nostorage_vert
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp64_up_frag
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp64_up_nostorage_frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25281>
2023-10-09 23:37:52 +00:00
Iván Briano
c8a8b09c15 nir/lower_int64: respect rounding mode when casting to float
Appendix A: Vulkan environemtn for SPIR-V says:
  Operations described as “correctly rounded” will return the infinitely
  precise result, x, rounded so as to be representable in
  floating-point. The rounding mode is not specified, unless the entry
  point is declared with the RoundingModeRTE or the RoundingModeRTZ
  Execution Mode.

Conversion between types are classified as correctly rounded, so let's
do rounding correctly.

v2: check rounding mode for destination bit size (Georg)

Fixes upcoming Vulkan CTS tests:
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp32.input_args.rounding_rtz_conv_from_uint64_up
dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp32.input_args.rounding_rtz_conv_from_int64_up
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.rounding_rtz_conv_from_uint64_up_vert
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.rounding_rtz_conv_from_int64_up_vert
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.rounding_rtz_conv_from_uint64_up_frag
dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp32.input_args.rounding_rtz_conv_from_int64_up_frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25281>
2023-10-09 23:37:52 +00:00
Iván Briano
919f5468eb vulkan/runtime: add internal parameter to vk_spirv_to_nir
If used to compile internal shaders, it will lack the flag while running
through all the optimization passes it does.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25281>
2023-10-09 23:37:51 +00:00
José Roberto de Souza
c8c1109bc6 iris: Nuke useless flags from iris_fine_fence_new()
Only IRIS_FENCE_TOP_OF_PIPE was changing the PIPE_CONTROL flags but it
was not set in any caller.
So we can remove IRIS_FENCE_* and flags from iris_fine_fence struct.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25571>
2023-10-09 21:12:56 +00:00
José Roberto de Souza
2641b8d1e0 iris: Lock bufmgr->lock before call vma_free() in error path
vma_free() requires that bufmgr->lock is held.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25571>
2023-10-09 21:12:55 +00:00
Mike Blumenkrantz
3438304c00 gbm: delete some zink handling
this has never been functional and may never be

Fixes: d760a9151b ("gallium: Learn about kopper")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25526>
2023-10-09 18:43:09 +00:00
Mike Blumenkrantz
c8f4cfd641 zink: error at handle export on missing EXT_image_drm_format_modifier
this doesn't work anyway

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25526>
2023-10-09 18:43:09 +00:00
Mike Blumenkrantz
78f3db760d egl: don't set ForceSoftware for all zink loading
sometimes this is desired, other times it isn't

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25526>
2023-10-09 18:43:09 +00:00
antonino
a2e96a86e1 nir: fix several crashes in nir_lower_tex
This patch fixes the following issues that lead to crashes in some cases:

* an instruction is inserted to get texture lod that depends on a
  texture instruction that hasn't been inserted yet.
* this code tries to read channel 1 of the lod, but lod is scalar
* the code assumed there would only be 2 srcs, this isn't the case when
  bindless is used.

Fixes: b154a4154b ("nir/lower_tex: rewrite tex/txb -> txd/txl before saturating srcs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25621>
2023-10-09 17:31:34 +00:00
Emma Anholt
e9e6a67600 i915: Use nir_group_loads() to reduce texture indirection phases.
total instructions in shared programs: 467049 -> 467040 (<.01%)
instructions in affected programs: 573 -> 564 (-1.57%)

total tex_indirect in shared programs: 14133 -> 14019 (-0.81%)
tex_indirect in affected programs: 491 -> 377 (-23.22%)

total temps in shared programs: 28543 -> 29178 (2.22%)
temps in affected programs: 3307 -> 3942 (19.20%)

LOST:   0
GAINED: 65
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:10 +00:00
Emma Anholt
af823b5d58 i915: Make exceeding tex indirect count fatal.
The HW should fail to run shaders that have too many phases, so do this so
that we get link failures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:10 +00:00
Emma Anholt
4f78c27330 i915: Do a test compile at glLinkShader() time.
This lets us throw errors back to the app for shaders that are too
complex.  The X server would really like to have this instead of guessing
based on renderer strings when shaders might be too complicated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:10 +00:00
Emma Anholt
2432f14d00 i915: Save fragment program compile error messages in the fragment shader.
We'll want this for doing linking failure messages for shaders that are
too long.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:10 +00:00
Emma Anholt
8e81aff4bb i915: Don't log I915_DEBUG=fs output for blit shaders.
Unless you have NIR_DEBUG=print_internal, the rest of the shader debug
pipeline is also hidden.  Cleans up output when looking at shader-db
compiles.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:09 +00:00
Emma Anholt
9c7d94c57e i915: Print the relevant counts vs limits when throwing errors.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:09 +00:00
Emma Anholt
0e284876ca i915: Re-clang-format and enforce it in CI.
I want to be able to mash the format button at any point when hacking on
this thing instead of doing bespoke whitespace.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25533>
2023-10-09 17:14:09 +00:00
Karmjit Mahil
4518c3a50c pvr: Adjust EOT PBE state to account for the iview's base array layer
Fixes various dEQP array tests.
E.g.
  dEQP-VK.pipeline.monolithic.framebuffer_attachment
    .1d_array_32_64_4

Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25348>
2023-10-09 16:58:05 +00:00
Karmjit Mahil
7f510fe39f pvr: Use the render passes' attachments array to setup ISP state
`pvr_setup_isp_faces_and_control()` can be called from a secondary
command buffer. The render pass info's `attachments` array is only
populated in the primary command buffer on which the render pass
was started, thus the `ds_aspect` being used always ended up being
`0` leading to incorrect ISP state being setup.

This commit changes the function to use the `attachments` array
from the render pass struct instead of the one from the recording
state.

dEQP tests fixed:
  dEQP-VK.renderpass.suballocation.attachment
    .{1.13, 1.65, 1.74, 3.219, 3.236, 3.314, 3.385, 4.426}

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25351>
2023-10-09 16:43:46 +00:00
Lionel Landwerlin
c8556a8f2e anv: flag 3DSTATE_RASTER as dirty after simple shader primitive
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9899
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25618>
2023-10-09 16:09:48 +00:00
Lionel Landwerlin
d924b568ef anv: fix a couple of missing input for 3DSTATE_RASTER programming
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25618>
2023-10-09 16:09:48 +00:00
Lionel Landwerlin
0985548204 anv: add missing workaround handling in simple shader
It's not going to make any real difference because of the type of
primitive used, but it feels safer to have this everywhere after a
3DPRIMITIVE.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25618>
2023-10-09 16:09:48 +00:00
Lionel Landwerlin
6bfa8850ab anv: implement INTEL_DEBUG=reemit
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25618>
2023-10-09 16:09:48 +00:00
Karmjit Mahil
2a3aa6da50 pvr: Fix cubemap layer stride
The hw calculates the layer stride with the assumption of a full
mip chain being there even though certain levels might never be
used.

Fix the `layer_size` by accounting for any missing mip levels.

Fixes: 8991e6464 ("pvr: Add a Vulkan driver for Imagination Technologies PowerVR Rogue GPUs")
Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25344>
2023-10-09 13:35:56 +00:00
SoroushIMG
3808cb0696 pvr: fix mipmap size calculation for bc formats
The block size given by vk_format_get_blocksize is in blocks, not
texels.

dEQP tests affected:
  dEQP-VK.pipeline.monolithic.image_view.view_type*
    .format.eac*lod_base_mip_level

Fixes: 8991e6464 ("pvr: Add a Vulkan driver for Imagination Technologies PowerVR Rogue GPUs")
Signed-off-by: SoroushIMG <soroush.kashani@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25344>
2023-10-09 13:35:56 +00:00
Erik Faye-Lund
e037761a2f docs: use html_static_path for static files
I'm not sure why I picked html_extra_path instead, as it's meant for
slightly less directly related files than what html_static_path is for.

So let's switch. It shouldn't make much of a real-world difference, but
should make it a bit easier to understand what this is about.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
527e17a0c4 docs: only link to old docs from html
Only the HTML builder knows about these files, so we can't really link
to them when using other builders. This only matter to the link-checker
right now, because that's the only other builder we use.

It's a bit sad that we can't linkcheck files like these, but it doesn't
work either way. Another way of making it work could be to use the
download-role for these files. I'm not sure I think that's any better,
as that makes the code read a bit more confusingly to me; the intent
isn't to *download* the files, but to view them as raw-text.

I could go either way here, though. Neither is fantastic IMO, but
neither is a disaster either.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
d01ca323dd docs: mark some redirects as allowed
These redirects are all fine. I don't think we want to apply them,
because they are more about implementation details on the target site.

So let's just mark them as OK. They cause no harm.

There's also some redirects that are all about authentication. We also
don't want to apply these, because they would break the links.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
dacaaa0b90 docs: keep up with intels ever-moving documentation
No location is ever good enough for Intel. Let's catch up with their
latests churns in documentation URLs...

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
209e282b92 docs: use doc-role when linking to lists article
This makes the link-checker see the target.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
ca42706dba docs: apply some trivial redirects
These were found by using the linkcheck builder.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
830597a884 docs: link to upstream etnaviv
The Wiki in this repo has been removed, and the about section mentions
that this is laanwj's personal fork, and not the upstream. So let's
update the link to the upstream repo instead.

There's no wiki there either, but the main repo itself contains a readme
file with some docs. Most of this is pretty stale, but it seems better
than nothing.

In the longer run, we should probably create a page about etnaviv in the
drivers directory of these docs, and try to keep that up to date.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
d4416216c6 docs: update link to git-wiki
The Git Wiki has been long deprecated, and is now partially removed. The
article we pointed to here seems to not have been backed up.

However, there's a new place that documents installing on Windows in the
Git Docs instead. So let's send users there instead.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:12 +00:00
Erik Faye-Lund
6f9904923a docs: update anchor for link
GitLab has renamed "specific" runners to "project"-runners. And
additionally, they currently document two ways of creating them.

Let's update the link to point to the new, non-deprecated way.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:11 +00:00
Erik Faye-Lund
8e3e39b2f4 docs: update a few links to https
These links forward to the HTTPS version now, let's save the users a
redirect.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:11 +00:00
Erik Faye-Lund
d5c2139ce4 docs: fix linkcheck
When running with the linkcheck builder,
app.builder.default_translator_class is None, making us throw an
exception and give up.

We don't need the bootstrap extension in this case, so just do nothing
instead.

Fixes: f72033bb70 ("docs: add bootstrap extension")
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25585>
2023-10-09 11:54:11 +00:00
Yonggang Luo
00f9e41251 util: Deduplicate macros between u_math.h and macros.h
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24484>
2023-10-09 16:25:34 +08:00
Vinson Lee
16fa4621b8 anv: Fix transfer type assert
Fix defect reported by Coverity Scan.

Constant expression result (CONSTANT_EXPRESSION_RESULT)
always_true_or: The or condition
type != ANV_TIMESTAMP_CAPTURE_AT_CS_STALL || type != ANV_TIMESTAMP_REWRITE_COMPUTE_WALKER
will always be true because type cannot be equal to two different values
at the same time, so it must be not equal to at least one of them.

Fixes: 5112b42146 ("anv: Handle end of pipe with MI_FLUSH_DW on transfer queue")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25605>
2023-10-08 22:39:41 -07:00
Rob Clark
1e820ac128 freedreno: Rework supported-modifiers handling
We should be taking into account the format while deciding if we support
a given modifier or not.  So a simple array of supported modifiers does
not do the trick.

While we are at it, also handle QCOM_TILED3.  (We really only use
QCOM_TILED2 in GMEM so it isn't user visible.)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9938
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25575>
2023-10-08 18:07:37 +00:00
David Heidelberg
e6f7fa0211 ci/freedreno: re-enable Cheza (Adreno 630) runners
Problems we're resolved.

This reverts commit 1f3446499f.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25376>
2023-10-08 07:04:34 +00:00
Caio Oliveira
c005b5a16f util: Avoid waste space when linear alloc'ing large sizes
In the linear allocator, when a size larger than the minimum
buffer size is allocated, we currently create the new buffer
to fit exactly the requested size.

In that case, don't bother updating the `latest` pointer, since
this newly created buffer is already full.  In the worst case,
the current `latest` is full and it would be the same; in the
best case, there's still room for small allocations, so we avoid
wasting space if the next allocations would fit.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25517>
2023-10-08 00:55:20 +00:00
Thomas H.P. Andersen
52721cfbe8 nvk: set optimization level to 3
The refactor in a4f8fd9dd5 changed NV50_PROG_OPTIMIZE
from 3 to 0.

Running with NV50_PROG_OPTIMIZE=0 causes some shaders to not compile. One example is
dEQP-VK.pipeline.monolithic.creation_cache_control.compute_pipelines.duplicate_single_recreate_explicit_caching
which fails with:
"Assertion `insn->src(src0 & FA_SRC_MASK).getFile() == FILE_GPR' failed"
A similar error also happen when testing Serious Sam Fusion 2017

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25601>
2023-10-07 23:39:32 +00:00
Eric Engestrom
6387c17504 ci: print deqp version in the job log
This allows to easily verify which version was actually running in some
job, to notice if an image tag wasn't properly bumped, for instance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21850>
2023-10-07 21:38:02 +00:00
Eric Engestrom
8b9677a4f4 v3d/ci: move traces job to wayland
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24094>
2023-10-07 21:04:40 +00:00
David Heidelberg
45c234700f ci: do not report failed job when flakes reporting fails
It's not critical for the job itself.

Suggested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25604>
2023-10-07 20:15:51 +00:00
Eric Engestrom
e42c5b86d0 pick-ui: add Backport-to: XX.Y nomination
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13664>
2023-10-07 19:00:17 +00:00
Eric Engestrom
2d274a2553 pick-ui: use more expressive variable names
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13664>
2023-10-07 19:00:17 +00:00
Eric Engestrom
36c3c3d9a4 pick-ui: use assignment expressions
Python 3.8 is 2 years old by now, I think it's time to allow using its
features, especially for a script that's only used by the release
maintainers.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13664>
2023-10-07 19:00:17 +00:00
Mark Collins
273feeb643 tu,util/driconf: Add option to not reserve descriptor set
A descriptor set is internally reserved for descriptor set dynamic
offset which might not be used by an applications which otherwise
requires an extra descriptor set. This driconf option allows making
that trade-off by dropping support for dynamic offsets in exchange
for an extra descriptor set which means 5 usable descriptor sets on
A6XX and 8 on A7XX.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25534>
2023-10-07 18:15:02 +00:00
Mark Collins
5fe64837cd tu: Support higher descriptor set count for A7XX
Allows for the descriptor set count to vary at runtime depending on
the specific GPU to allow for 7 usable descriptor sets on A7XX with
one reserved for dynamic offsets.

Passing VK-CTS: dEQP-VK.binding_model.*

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25534>
2023-10-07 18:15:02 +00:00
Mark Collins
62921cf026 freedreno/common: Add max_sets property to A6xxGPUInfo
A7XX increases the maximum amount of descriptor sets from 5 to 8,
the amount of descriptor sets was added as a property of the
A6xxGPUInfo to accommodate it changing across GPUs.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25534>
2023-10-07 18:15:02 +00:00
Lionel Landwerlin
d091609d81 anv: fix index buffer size programming
This is a merge issue due to 2 MRs touching the same code.

Fixes a few maintence5 tests like : dEQP-VK.robustness.bind_index_buffer2.offset_0.draw_indexed.oo_size

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25599>
2023-10-07 17:30:17 +00:00
Marek Olšák
348eee9c97 nir: handle nir_var_mem_ubo in nir_clone_uniform_variable
for UBOs

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Marek Olšák
b47b8d16d9 nir: expose reusable linking helpers for cloning uniform loads
for the new varying optimizer

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Marek Olšák
b1bbe4e190 nir: gather dual slot input information
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Marek Olšák
cb66fddd81 nir: take dual slot input info into account when computing IO driver locations
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Marek Olšák
0f2491cbdd nir: add dual-slot input information into load_input intrinsics
This is necessary to allow optimizing VS inputs after nir_lower_io, which
is currently impossible because the loss of dual-slot information in NIR
would break VS inputs. With this, driver locations can be recomputed by
calling nir_recompute_io_bases. It's a prerequisite for optimizing varyings
with lowered IO.

When this is used, we will be able to eliminate unused dual-slot VS inputs
as well as unused low and high halves of dual-slot VS inputs for the first
time, which can happen due to optimizations of varyings. Without this,
st/mesa binds vertex buffers for dual-slot inputs that are fully or
partially unused in the shader.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Marek Olšák
97f3fdadca nir: recompute IO bases after DCE in nir_lower_io_passes
otherwise the IO bases can be incorrect due to non-DCE'd input loads

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Marek Olšák
f37e32b78b nir: sort variables by location in nir_lower_io_passes to work around a bug
I don't know why this is necessary, but it unblocks the work on varying
optimizations.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25394>
2023-10-07 11:18:40 +00:00
Gert Wollny
3c1020724e virgl: Use common clear_texture if host doesn't support the feature
v2: Fix include (osy)

Fixes: a1eabeff (gallium: remove PIPE_CAP_CLEAR_TEXTURE)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9944

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25580>
2023-10-07 09:20:57 +00:00
Vignesh Raman
a65ba65108 ci: Uprev crosvm
Recent commit in linux kernel 6.6 rc3 broke booting
in crosvm. Latest crosvm contains a fix for this issue.
So bump the crosvm version to latest.

https://issuetracker.google.com/issues/303128596
https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4906858

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25582>
2023-10-07 08:24:04 +00:00
David Heidelberg
c7806daf43 ci/lima: farm is down, disable for now
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25596>
2023-10-07 10:17:57 +02:00
Martin Roukala (né Peres)
0c10cbff55 ci/b2c: switch containers to a back-up ahead of valve-infra renaming
We are about to rename mupuf/valve-infra into gfx-ci/ci-tron.

While most resources will transparently be redirected, gitlab does
not allow us to keep our containers during the migration.

To work around that, I uploaded the current containers to Eric's fork
of valve-infra. Let's use these containers until the migration is over!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25593>
2023-10-07 04:42:03 +00:00
Faith Ekstrand
1929c0d954 nvk: Invalidate SKED caches at the top of command buffers
This is the cache that caches QMDs.  We need to invalidate it or else we
can end up with cache collisions and end up running the wrong shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25595>
2023-10-07 04:23:50 +00:00
Faith Ekstrand
f450f3f256 nvk: Invalidate sampler/texture header caches in BeginCommandBuffer()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25595>
2023-10-07 04:23:50 +00:00
Faith Ekstrand
cff7bfde72 nvk: Add a nvk_cmd_buffer_compute_cls() helper
We have one of these for 3D and it's more ergonamic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25595>
2023-10-07 04:23:50 +00:00
Faith Ekstrand
6e051cb2d8 nouveau: Generate headers for Maxwell B compute
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25595>
2023-10-07 04:23:50 +00:00
Ian Romanick
bac10ef4aa intel/fs: Add DP4A to get_lowered_simd_width
While working on cooperative matrix support, I noticed some invalid
DP4A instructions being generated.

    dp4a(32)    g33<1>UD    g21<8,8,1>UD    g1.0<0,1,0>UD   g9<1,1,1>UD

This violates the constraint that the destination or a source can only
access two consecutive GRFs.

I'm a little surprised that validation didn't catch this. Perhaps
because it's a 3 source instruction? Either way, it seems like a bigger
project to fix that.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 0f809dbf40 ("intel/compiler: Basic support for DP4A instruction")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25554>
2023-10-07 02:27:53 +00:00
Caio Oliveira
7b5b164281 util: Add function print information about a ralloc tree
In release mode print the ralloc tree header pointers.  In debug mode,
will look at the child allocations recursively checking for the canary
values.  In most cases this should work and give us extra information
about the type of the subtree (GC, Linear) and the allocation sizes.

For example, calling it at the end of spirv_to_nir() will output the
following tree with a summary at the end (lines elided to focus on the
general structure of the output)

```
0xca8d00 (472 bytes)
  0xdf2c60 (32 bytes)
  0xdf2c00 (32 bytes)
  0xdf2ba0 (32 bytes)
  0xdf2b40 (32 bytes)
  (...)
  0xcde8b0 (64 bytes)
  0xcde760 (72 bytes)
    0xd2de40 (168 bytes)
  0xcce660 (64 bytes)
  0xcce510 (72 bytes)
    0xcce5a0 (120 bytes)
  0xcce490 (64 bytes)
  (...)
  0xcbc450 (456 bytes)
    0xdf55c0 (160 bytes)
      0xdf5730 (72 bytes)
        0xdf57c0 (80 bytes)
      0xdf5530 (72 bytes)
        0xdf56a0 (80 bytes)
    (...)
    0xcbe840 (128 bytes)
      0xcc4310 (4 bytes)
    0xcbc660 (536 bytes) (gc context)
      0xde6b40 (32576 bytes) (gc slab or large block)
      0xddb160 (32704 bytes) (gc slab or large block)
      0xdc8d50 (32704 bytes) (gc slab or large block)
      (...)
      0xcde9a0 (32704 bytes) (gc slab or large block)
      0xcd6720 (32704 bytes) (gc slab or large block)
      0xcce6e0 (32768 bytes) (gc slab or large block)
  0xcbc330 (72 bytes)
    0xd680a0 (208 bytes)
  0xca9010 (78560 bytes)
  0xca8f20 (176 bytes)

==== RALLOC INFO ptr=0xca8d30 info=0xca8d00
ralloc allocations    = 4714
  - linear            = 0
  - gc                = 23
  - other             = 4691
content bytes         = 1055139
ralloc metadata bytes = 226272
linear metadata bytes = 0
====
```

There's a flag to pass so only the summary at the end is printed.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25482>
2023-10-07 01:34:13 +00:00
Caio Oliveira
5b767c890f util: Add a canary to identify gc_ctx in debug mode
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25482>
2023-10-07 01:34:13 +00:00
Caio Oliveira
5fa2b33d56 util: Add size to ralloc_header in debug mode
For 64-bit environments this just fills a padding.  Will enable
dumping more information when debugging ralloc trees.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25482>
2023-10-07 01:34:13 +00:00
Caio Oliveira
32b361089c rusticl: Add Rust bindings for inline glsl_types functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:55 +00:00
Caio Oliveira
993e1fd9b7 compiler/types: Flip wrapping of basic "get type" functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:55 +00:00
Caio Oliveira
f1502f3f37 compiler/types: Flip wrapping of convenience accessors for vector types
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:54 +00:00
Caio Oliveira
f94377915e compiler/types: Flip wrapping of various type identification checks
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:54 +00:00
Caio Oliveira
dd9ced45f5 compiler/types: Flip wrapping of base_type checks
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:54 +00:00
Caio Oliveira
68f3b0100f compiler/types: Move C declarations into glsl_types.h
This ensures they'll be visible for the C++ inline implementations.
Reordered the functions to better organize them: queries, getters,
transformers, layout functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:54 +00:00
Caio Oliveira
2e4802ce45 compiler/types: Move the C++ inline functions in glsl_type out of the struct body
Just move code, will make easier to flip these to be wrappers to the C code.  Keep
those in a separate header file to reduce cluttering glsl_types.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25470>
2023-10-07 00:42:54 +00:00
Yiwei Zhang
ca3095672f venus: fix re-export of imported classic 3d resources
When the guest driver is Virgl while Xwayland is on Zink, Virgl can
request virtgpu classic 3d resource allocations for swapchain images.
Zink will import when the image is shared with xserver and will export
for fd info of all 2d images later to be forwarded.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25579>
2023-10-07 00:22:02 +00:00
Samuel Pitoiset
3c61fd029b radv: fix re-emitting streamout descriptors for NGG streamout
In a scenario like:
CmdBindTransformFeedbackBuffers()
BeginTransformFeedback()
CmdDraw() --> streamout descriptors emitted
EndTransformFeedback() --> streamout descriptors emitted as 0 (disabled)
CmdDraw()
BeginTransformFeedback()
CmdDraw() --> streamout descriptor not re-emitted
EndTransformFeedback()

Fix this by re-emitting streamout descriptors when streamout is
enabled/disabled because a buffer size of 0 acts like a disable bit.

This fixes dEQP-VK.transform_feedback.simple.backward_dependency_indirect*
on NAVI31.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25583>
2023-10-06 22:51:31 +00:00
antonino
3a33e59596 zink: store bindless var when creating it to avoid creating it again
When bindless variables are created they get used directly and never
stored anywhere so if another bindless instruction is encountered
duplicate variables are created.

Fixes: fe2ba184d8 ("zink: use descriptor indices in compiler")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25591>
2023-10-06 19:55:44 +00:00
Danylo Piliaiev
9b0960cfe3 tu/kgsl: Fix field order in kgsl_command_object init
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9942

Fixes: ec268fa5b6
("tu/kgsl: Support u_trace and perfetto")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25581>
2023-10-06 19:23:42 +00:00
Ian Douglas Scott
1950481d08 egl/wayland: Don't segfault if create_wl_buffer returns NULL
Normally, this shouldn't fail, but it has various cases where it returns
`NULL`. Without this change, it would result in a segfault when
`wl_buffer_add_listener` is called.

This instead makes `EGLSwapBuffers` return a `EGL_BAD_ALLOC` error.

The other place `create_wl_buffer` is called already checks the return
value, and the Vulkan WSI code doesn't seem to have an issue like this.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24915>
2023-10-06 18:31:29 +00:00
Eric Engestrom
82e342888f ci: skip dEQP-VK.api.driver_properties.conformance_version for everyone
This test checks the driver's reported conformance version against the
version of the CTS we're running. This check fails every few months
and everyone has to go and bump the number in every driver.

Running this check only makes sense while preparing a conformance
submission, so skip it in the regular CI.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25519>
2023-10-06 17:37:20 +00:00
Eric Engestrom
b72f474ff0 docs/ci: rewrite the "farm maintenance ^ other change" rule to mean what we actually meant
Sometimes updates to the farm config are needed before re-enabling it,
or updating test expectations with new failures that happened while the
farm was down, etc.

These need to be allowed, as the alternative is to update the
config/expectations/etc. blindly in one MR, merge it, and then merge
another MR with the farm re-enablement.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25560>
2023-10-06 17:30:04 +00:00
Kai Wasserbäch
6d6d0b515e fix: clover: LLVM 18: s/CodeGenOpt::/CodeGenOptLevel::/
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9833
Reference: 0a1aa6cda2
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25586>
2023-10-06 16:05:40 +00:00
Kai Wasserbäch
5815a8e746 fix: clover: LLVM 18 renamed/moved CGFT_*, update compat layer
LLVm renamed and moved the CGFT_* stuff, we need to update the clover
compat header to follow suit.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9833
Reference: 0a1aa6cda2
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25586>
2023-10-06 16:05:40 +00:00
Samuel Pitoiset
752fba4643 radv: fix gang submissions with chaining
Gang submissions are mostly only be used for task shaders to both
submit GFX and ACE command buffers in the same submission. Though,
the gang leader (the last submitted CS) IP type should match the
queue IP type to determine which fence to signal.

But if chaining is enabled, it's possible that all GFX cmdbufs are
chained to the first GFX cmdbuf, which means the last CS is ACE and
not GFX.

Fix this by resetting chaining for GFX when a cmdbuffer has GFX+ACE.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9724
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24966>
2023-10-06 12:42:33 +00:00
Samuel Pitoiset
f233a73c1c radv: fill the scratch BO in radv_fill_shader_rings()
Cleanup.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25529>
2023-10-06 12:09:46 +00:00
Samuel Pitoiset
4192e01dcc radv: always write the sample positions when a new descriptor BO is created
This was completely broken, for example in the following scenario:
- submits something which needs sample positions (this creates a new
descriptor BO with sample positions)
- submits something which needs the tess rings (this creates a new
descriptor BO with tess rings but without sample positions, ie.
add_sample_positions would be FALSE)
- submits something which needs sample positions again (this won't
create a new descriptor BO because it incorrectly remembered that
sample positions were set)

Fix this by always writing the sample positions.

This should fix the following flakes:
- dEQP-VK.fragment_shading_barycentric.*.weights.pipeline_topology_dynamic.msaa_interpolate_at_sample.*
- dEQP-VK.pipeline.fast_linked_library.multisample_interpolation.sample_interpolate_at_distinct_values.*
- dEQP-VK.pipeline.fast_linked_library.multisample_interpolation.sample_interpolation_consistency.*
- dEQP-VK.draw.renderpass.linear_interpolation.*
- dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.linear_interpolation.*

These flakes were extremely hard to reproduce!

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25529>
2023-10-06 12:09:46 +00:00
Lionel Landwerlin
596b438936 intel/ds: track acceleration RT commands
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25570>
2023-10-06 11:10:12 +00:00
Lionel Landwerlin
3e8d2617e1 anv: use buffer pools for BVH build buffers
Private memory for BVH builds doesn't need to be mapped on the host,
it's purely for use by the GPU. So it can be put into a different
buffer pool that can put into VRAM only buffers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25570>
2023-10-06 11:10:12 +00:00
Lionel Landwerlin
bab344645f anv: move bo_pool allocation flags to init caller
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25570>
2023-10-06 11:10:12 +00:00
Lionel Landwerlin
787c29f2fc anv: reduce working temporary memory for BVH builds
Part of the memory allocated (private) is a temporary working buffer
for the GRL kernels. Once the build operation is done, the buffer
becomes unused.

Rather than allocate a new buffer each time, reuse the current last
allocated one if its size fits the next build operation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25570>
2023-10-06 11:10:11 +00:00
Eric Engestrom
2d3ab674ee ci: drop unused ephemeral packages in alpine image
There's nothing between installing these packages and removing them that
uses them, so let's just drop them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25546>
2023-10-06 10:09:31 +00:00
Caio Oliveira
81bc09bf97 intel/fs: Tweak default case of fs_inst::size_read()
In the default case, there's a special case with a few conditions.
Prefer the cheapest conditions first, so we can take advantage of
short-circuiting.

Effect is a small but still significant reduce in shader compilation
times, as can be seen by:

- Fossil replay for Rise of the Tomb Raider

```
Difference at 95.0% confidence
	-0.433333 +/- 0.028609
	-1.42556% +/- 0.0941163%
	(Student's t, pooled s = 0.0337886)
```

- Fossil replay for Batman Arkham City

```
Difference at 95.0% confidence
	-8.84 +/- 0.146083
	-1.65932% +/- 0.0274207%
	(Student's t, pooled s = 0.125423)
```

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25549>
2023-10-06 09:16:56 +00:00
Mike Blumenkrantz
06816cccb9 zink: don't check submit count for unflushed usage
unflushed usage is unflushed regardless of the submit count and is
critical for detecting multi-context synchronization

fixes Wolfenstein: The New Order load screen deadlock

Fixes: db12b881c7 ("zink: track/check submit info on resource batch usage")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25572>
2023-10-06 05:30:22 +00:00
Mike Blumenkrantz
548d088c26 egl/wayland: return sooner from swrast_update_buffers() if zink
Fixes: 0f50cc03ef0 ("egl/wayland: don't block in swrast when updating buffers for zink")

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24700>
2023-10-06 04:53:40 +00:00
Mike Blumenkrantz
8aa43d70e1 egl/wayland: don't block in swrast when updating buffers for zink
this is broken, let vulkan wsi handle buffer management

Fixes: 74451ed3f0 ("egl/wayland: wait for compositor to release shm buffers")

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24700>
2023-10-06 04:53:40 +00:00
Mike Blumenkrantz
e213623a8c Revert "egl/wayland: Add image loader extension for swrast"
This reverts commit 45b9b0ba32.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24700>
2023-10-06 04:53:40 +00:00
Emma Anholt
4b9c3c76d0 ci/hasvk: Add a bunch of new CTS border color fails.
pretty sure this is from new coverage since the CTS uprev..

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25574>
2023-10-06 04:06:29 +00:00
Emma Anholt
762210e224 ci/crocus: Add known piglit flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25574>
2023-10-06 04:06:29 +00:00
Emma Anholt
c6788a1616 ci/etnaviv: return gl-1.4-tex1d-2dborder as a known flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25574>
2023-10-06 04:06:29 +00:00
Simon Zeni
2d09ae30e1 nouveau/winsys: use mmap instead of mmap64 in nouveau_bo
The function `mmap64` is part of the large file extension and should not be
called directly. Instead `mmap` should be use and let the system use the
correct interface.

Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25569>
2023-10-06 03:39:14 +00:00
Chia-I Wu
dcb764b0f0 radv: hard code format features for emulated formats
The format features are known.  No need to rely on
radv_is_sampler_format_supported which will not work for ASTC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
99e54c39f6 radv: simplify view format override for emulated formats
Override the view format to the format of plane 1 when the view format
is also emulated.  There is no functional change.

v2: check iview->vk.format directly (@yogeshmohan)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
55b7d6e5a3 radv: add radv_is_format_emulated
This is a cleanup with no functional change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
9eda61c931 vulkan/runtime, radv: remove 1D support from ETC2 emulation
The nir code deos not support 1D.  There is also no point in supporting
1D ETC2 images.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
fb40fb595b vulkan/runtime: fix a harmless typo for ETC2 emulation
Init input_img_3d correctly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
9c98be7115 vulkan/runtime: fix image type check for ETC2 emulation
There was a typo causing the wrong push constant to be loaded.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
afdbeaf1b4 radv: use vk_tecompress_etc2 from the runtime
There are some minor differences

 - fix incorrectly use of device->meta_state.resolve_compute.p_layout
 - when on_demand is true, the creation of ds and pipeline layouts are
   also deferred
 - unlike radv_meta_get_view_type, vk_texcompress_etc2_image_view_type
   returns 1d/2d array image views

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Chia-I Wu
0337b5d8c4 vulkan/runtime: add a helper for ETC2 emulation
This is based on radv's ETC2 emulation.  There is no real change to the
generated NIR shader.

v2: rename vk_texcompress_etc2_image_format to vk_texcompress_etc2_emulation_format
    update the comments

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
2023-10-06 00:55:18 +00:00
Danylo Piliaiev
7caf3e70a1 tu: Fix VK_FORMAT_A8_UNORM_KHR using UBWC when !has_8bpp_ubwc
Fixes hangs in Anno 1800 with DXVK 2.3

Fixes: 302907e347
("tu: Expose VK_KHR_maintenance5")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25567>
2023-10-05 22:36:06 +00:00
Konstantin Seurer
ac838c1c5c mesa: Fix glBegin/End when LINE_LOOP is not supported
Emits the first vertex inside glEnd.

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25346>
2023-10-05 21:52:37 +00:00
Georg Lehmann
7b4f0e714c aco/gfx11: support vinterp as fma_mix
Totals from 718 (0.94% of 76572) affected shaders:
Instrs: 657897 -> 654219 (-0.56%)
CodeSize: 3471668 -> 3457352 (-0.41%); split: -0.41%, +0.00%
VGPRs: 34200 -> 34164 (-0.11%)
Latency: 11687698 -> 11677030 (-0.09%); split: -0.10%, +0.00%
InvThroughput: 1455371 -> 1451537 (-0.26%); split: -0.26%, +0.00%
VClause: 7598 -> 7600 (+0.03%)
SClause: 18293 -> 18241 (-0.28%); split: -0.44%, +0.15%
Copies: 34641 -> 34644 (+0.01%); split: -0.05%, +0.06%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25220>
2023-10-05 20:02:53 +00:00
Georg Lehmann
7d7657ef74 aco: support v_fma_f32_dpp as fma_mix
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25220>
2023-10-05 20:02:53 +00:00
Georg Lehmann
5e9fad48bf aco/gfx11: apply clamp/omod to vinterp
Totals from 2504 (3.27% of 76572) affected shaders:
MaxWaves: 74098 -> 74106 (+0.01%)
Instrs: 1829278 -> 1823427 (-0.32%); split: -0.32%, +0.00%
CodeSize: 9775908 -> 9759308 (-0.17%); split: -0.18%, +0.01%
Latency: 13494107 -> 13485390 (-0.06%); split: -0.10%, +0.04%
InvThroughput: 2052428 -> 2048724 (-0.18%); split: -0.18%, +0.00%
VClause: 26637 -> 26640 (+0.01%); split: -0.04%, +0.05%
SClause: 62027 -> 61988 (-0.06%); split: -0.14%, +0.08%
Copies: 73776 -> 73815 (+0.05%); split: -0.07%, +0.12%
PreVGPRs: 84403 -> 84397 (-0.01%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25220>
2023-10-05 20:02:53 +00:00
Marek Olšák
7196b5318d Revert "ac/gpu_info: replace ib_alignment with per-IP IB base and size alignments"
This reverts commit b6f435888b.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25558>
2023-10-05 19:12:29 +00:00
Marek Olšák
5f42a21dad Revert "ac/gpu_info: pad IBs according to ib_size_alignment"
This reverts commit 4f660f9937.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25558>
2023-10-05 19:12:29 +00:00
Marek Olšák
29f9c49228 Revert "winsys/amdgpu: pad gfx and compute IBs with a single NOP packet"
This reverts commit 43e7285069.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25558>
2023-10-05 19:12:29 +00:00
Marek Olšák
461cb2fd77 Revert "radv: fix alignment of DGC command buffers"
This reverts commit b01e874234.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25558>
2023-10-05 19:12:29 +00:00
Marek Olšák
94f117ec9b Revert "radv/amdgpu: fix alignment of command buffers"
This reverts commit 4bc58c9f11.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25558>
2023-10-05 19:12:29 +00:00
Marek Olšák
b4be110333 Revert "ac/gpu_info: override ib_size_alignment for VCN_DEC and JPEG"
This reverts commit 867a995ce7.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25558>
2023-10-05 19:12:29 +00:00
David Heidelberg
194bcef733 ci/bare-metal: drop unused imports, sort, use SPDX license
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25285>
2023-10-05 17:10:20 +00:00
David Heidelberg
daf1df9b70 ci/bare-metal: correct workaround for R8152 issue while retrieving TFTP data
1. Move block used for detecting R8152 problems to the bootloader
phase where it belongs. Also remove requirement to 100 failures and just
retry immediatelly.

2. Consider job failed after 10 errors, not 100. From the logs on
   cheza-14, ~ 30 errors is enough to fail.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25285>
2023-10-05 17:10:20 +00:00
Erik Faye-Lund
9c2212f9b3 docs/panfrost: use math-role to denote powers of two
We do this elsewhere in the article, so let's be consistent here.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24921>
2023-10-05 15:49:46 +00:00
Erik Faye-Lund
80e8c78fed docs/panfrost: use code-blocks with wrapping for long blocks
This makes it a lot easier to read the code-blocks, because we don't
*always* need to scroll.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24921>
2023-10-05 15:49:46 +00:00
Erik Faye-Lund
3e27d8f2d4 docs/panfrost: link to lima
In the age of the internet, we can use hyperlinking to content instead
of just telling users about something! Let's do that here as well!

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24921>
2023-10-05 15:49:46 +00:00
Samuel Pitoiset
2e5d2df362 radv/ci: cleanup list of expected failures for NAVI10/NAVI21/VEGA10
These are flakes, not failures. Remove them from the list of expected
failures to avoid confusion.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25557>
2023-10-05 15:08:37 +00:00
Samuel Pitoiset
0c4b4000aa radv/ci: remove no longer existing test for VANGOGH
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25557>
2023-10-05 15:08:37 +00:00
Samuel Pitoiset
be32502979 radv: fix synchronization with emulated GS primitives/invocations queries
Move emitting the EOP even which writes the availability bit after the
GDS copy to ensure it's available.

This should fix all GS primitives/invocations flakes in CI.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25457>
2023-10-05 14:17:56 +00:00
Samuel Pitoiset
f2819c3870 radv/ci: exclude dEQP-VK.texture.explicit_lod.2d.sizes.128x128_* for all jobs
These tests usually take more than 20s to finish which is slow.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25556>
2023-10-05 12:34:59 +00:00
Samuel Pitoiset
aabf53ce6b radv/ci: remove duplicate skipped tests for RAVEN/STONEY
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25556>
2023-10-05 12:34:59 +00:00
Georg Lehmann
34d8fa6185 aco/gfx11: optimize dual source export
We can combine dpp with the v_cndmask_b32.

Foz-DB Navi31:
Totals from 222 (0.28% of 79330) affected shaders:
Instrs: 564392 -> 563373 (-0.18%); split: -0.19%, +0.01%
CodeSize: 2867040 -> 2864728 (-0.08%); split: -0.09%, +0.01%
Latency: 4278957 -> 4275199 (-0.09%); split: -0.09%, +0.00%
InvThroughput: 586636 -> 585824 (-0.14%); split: -0.14%, +0.00%
SClause: 20210 -> 20211 (+0.00%); split: -0.02%, +0.02%
Copies: 39763 -> 39778 (+0.04%); split: -0.13%, +0.17%
PreVGPRs: 13924 -> 13922 (-0.01%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25541>
2023-10-05 10:37:34 +00:00
Ganesh Belgur Ramachandra
e3e47aa96e radeonsi: "clear_12bytes_buffer" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25221>
2023-10-05 09:43:11 +00:00
Ganesh Belgur Ramachandra
3f44a8321f radeonsi: "clear_render_target_1d_array" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25221>
2023-10-05 09:43:11 +00:00
Ganesh Belgur Ramachandra
d0b14c56ea radeonsi: "clear_render_target" shader in nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25221>
2023-10-05 09:43:11 +00:00
Marek Olšák
9f569acf20 ac/surface: don't require exact pitch for gfx6-8 tiled imports
It was reported that it broke Stoney. Something probably uses a suboptimal
pitch, like minigbm.

Fixes: 7d066330e0 - ac/surface: relax custom pitch requirements to any multiple of 256B on gfx10.3+

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25540>
2023-10-05 07:27:02 +00:00
Marek Olšák
340218c51e radeonsi: upload shaders via a staging buffer so as not to map VRAM directly
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25494>
2023-10-04 23:53:19 -04:00
Marek Olšák
23af6d3d35 radeonsi: add another aux context for uploading shaders
When the first auxiliary context is locked and wants to compile and upload
a shader asynchronously, we need to use another auxiliary context
in the compiler thread because the first one is locked at that point.

This adds an array of auxiliary contexts into si_screen and changes how aux
contexts are accessed.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25494>
2023-10-04 23:53:16 -04:00
Sviatoslav Peleshko
8361cd4c4c intel/eu/validate: Validate "packed word exception" stricter
Fixes: 75b7f5a2 ("i965: Validate "Region Alignment Rules"")
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25378>
2023-10-05 01:41:42 +00:00
Sviatoslav Peleshko
8f23b45252 intel/fs: Fix "packed word exception" condition for register regioning
Fixes: a6bf5f88 ("i965/fs: Enforce common regioning restrictions by SIMD splitting.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9432
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25378>
2023-10-05 01:41:42 +00:00
Faith Ekstrand
922bd13152 nvk: Use align() and align64() instead of ALIGN_POT
For one thing, they actually assert that the alignment factor is a power
of two.  More importantly, though, because they're real functions and
not macros, they up-cast the alignment to a full uint32_t or uint64_t
before doing the alignment calculation.  If you do ALIGN_POT() on a
64-bit value with a 32-bit alignment, it truncates to 32 bits because
the NOT is done before the up-cast due to C implicit cast rules.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25555>
2023-10-04 20:15:55 -05:00
Faith Ekstrand
07744ba67e nvk: Handle zero-sized sparse buffers
In the zero case, we don't want to allocate any VMA.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25555>
2023-10-04 20:15:54 -05:00
Konstantin Seurer
20e8760c75 zink: Enable edge flags with points
Fixes: 90a8525 ("zink: handle edgeflags")
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25335>
2023-10-04 23:20:52 +00:00
Konstantin Seurer
4625e18619 nir/passthrough_gs: Support edge flags with points
Fixes: 24535ff ("nir: handle edge flags in nir_create_passthrough_gs")
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25335>
2023-10-04 23:20:52 +00:00
Konstantin Seurer
3bf60f904b zink: Initialize primitive types to an invalid value
The memory is zero initialized which corresponds to MESA_PRIM_POINTS.

Fixes: 659c39f ("zink: rework primitive rasterization type logic")
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25335>
2023-10-04 23:20:52 +00:00
Leo Liu
867a995ce7 ac/gpu_info: override ib_size_alignment for VCN_DEC and JPEG
With the commit 4f660f99 ("ac/gpu_info: pad IBs according to ib_size_alignment"),
we found kernel isn't reporting ib_base/size_alignment correctly, thus causing
VCN_DEC and JPEG functions broken. We will fix the kernel and bump the kernel
version, and now for the older kernel, we need this override.

closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9916

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25511>
2023-10-04 22:58:47 +00:00
Igor Torrente
f0762f003d zink: fix for startup crash of weston running on top of zink + venus
Venus asserts if we are transitioning to/from
`VK_IMAGE_LAYOUT_PRESENT_SRC_KHR` if we are not dealing with a wsi
image.

Now we detects this case and avoid transition the layout in this case.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25423>
2023-10-04 22:28:32 +00:00
Marek Olšák
59ea386065 gallium/util: add more tests for compute-only contexts
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25389>
2023-10-04 21:39:34 +00:00
Marek Olšák
b9289c51b5 gallium/util: fix GALLIUM_TESTS=1 by using cso_set_vertex_buffers_and_elements
util_draw_user_vertex_buffer no longer works with u_vbuf.
Add util_draw_user_vertices that does the right thing and use it.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25389>
2023-10-04 21:39:34 +00:00
Faith Ekstrand
fac31bb7bd nvk: Take GETPARAM_EXEC_PUSH_MAX into account
Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25444>
2023-10-04 20:50:34 +00:00
Faith Ekstrand
0756a13aba drm-uapi: Sync nouveau_drm.h
From https://cgit.freedesktop.org/drm-misc/

    commit d59e75eef52d89201aaf5342a3ac23ddf3e9b112
    Author: Danilo Krummrich <dakr@redhat.com>
    Date:   Mon Oct 2 15:46:48 2023 +0200

        drm/nouveau: exec: report max pushs through getparam

Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25444>
2023-10-04 20:50:34 +00:00
Gert Wollny
247946a5e4 mesa: check numlevels and numlayers when creating a texture view
v2: Compare against zero only, because the values are unsigned and
    can't be negative (Tapani Pälli)

CC: mesa-stable

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> (v1)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25532>
2023-10-04 19:58:08 +00:00
Eric Engestrom
9ec0c90d6d docs: update calendar for 23.1.9
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25547>
2023-10-04 19:49:14 +00:00
Eric Engestrom
2b36bd246d docs: add sha256sum for 23.1.9
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25547>
2023-10-04 19:49:14 +00:00
Eric Engestrom
45181a9539 docs: add release notes for 23.1.9
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25547>
2023-10-04 19:49:14 +00:00
Rhys Perry
1a268dc59d aco: disable FI for quad/masked swizzle
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8330
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25525>
2023-10-04 18:53:43 +00:00
Rhys Perry
ad5be40303 nir: add fetch inactive index to quad_swizzle_amd/masked_swizzle_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25525>
2023-10-04 18:53:43 +00:00
Rhys Perry
0e79f76aa5 aco: add fetch_inactive field to DPP instructions
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25525>
2023-10-04 18:53:43 +00:00
Rhys Perry
26fce534b5 aco: shrink DPP8_instruction
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25525>
2023-10-04 18:53:43 +00:00
Leandro Ribeiro
e90b5385a0 egl: move is_render_node flag to platform_wayland
This flag is being used only by platform_wayland. So move it to be
included by the #ifdef HAVE_WAYLAND_PLATFORM in struct dri2_egl_display.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25504>
2023-10-04 17:01:42 +00:00
Leandro Ribeiro
394c3b97f1 egl: make explicit that we don't support render nodes for software EGLDevice
Currently we verify that by checking if the EGLDevice has a NULL
drmDevicePtr.

We have a proper way of checking that with _eglDeviceSupports(dev,
_EGL_DEVICE_SOFTWARE), so use that to make things more explicit.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25504>
2023-10-04 17:01:42 +00:00
Leandro Ribeiro
950825cb36 egl: simplify _eglAddDRMDevice()
We only create EGLDevice's for render-capable devices, so it's better
to document that in the code and simplify this function.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25504>
2023-10-04 17:01:42 +00:00
Leandro Ribeiro
f0861645bb egl: remove unused parameter from _eglAddDRMDevice()
No callers are using the _EGLDevice **out_dev parameter which is being
set by this function. So just drop it.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25504>
2023-10-04 17:01:41 +00:00
Leandro Ribeiro
7de445e69a egl: rewrite outdated comment in _eglFindDevice()
_eglAddDevice() has been renamed to _eglFindDevice(). But the comment
describing what this function does is outdated. Rewrite this comment.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25504>
2023-10-04 17:01:41 +00:00
Carsten Haitzler
a4f7f9975a panfrost: Add GPU variant of G57 to the set of known ids
There already is a G57 ID, but this is for a MTK variant that is not
actually the original design. The original design is 0x9091 not
0x9093.

Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25026>
2023-10-04 16:32:05 +00:00
Danylo Piliaiev
47fb3f06c4 tu: Add push_consts_per_stage debug option
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25086>
2023-10-04 15:51:54 +00:00
Danylo Piliaiev
a5f0f7d4b1 turnip,ir3: Implement A7XX push consts load via preamble
New push consts loading consist of:
- Push consts are set for the entire pipeline via HLSQ_SHARED_CONSTS_IMM
  array which could fit up to 256b of push consts.
- For each shader stage that uses push consts READ_IMM_SHARED_CONSTS
  should be set in HLSQ_*_CNTL, otherwise push consts may get overwritten
  by new push consts that are set after the draw.
- Push consts are loaded into consts reg file in a shader preamble via
  stsc at the very start of the preamble.

OPC_PUSH_CONSTS_LOAD_MACRO is used instead of directly translating NIR
intrinsic into stsc because: we don't want to teach legalize pass how
to set (ss) between stores and loads of consts reg file, don't want for
stsc to be reordered, etc.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25086>
2023-10-04 15:51:54 +00:00
Danylo Piliaiev
e39b6e2b9b freedreno: Make possible to specify A7XX feature flags
Previously the idea was for each generation to have unique list
of feature flags, now it makes more sense for new generation
to have only new flags defined and "inherit" older gen flags.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25086>
2023-10-04 15:51:54 +00:00
Danylo Piliaiev
823b3bfeea ir3,tu: Refactor push consts info plumbing
In preparation for a new way to pass push consts into a shader,
introduced in a7xx.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25086>
2023-10-04 15:51:54 +00:00
Danylo Piliaiev
d5d7631060 freedreno/registers: Refine a7xx push consts registers
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25086>
2023-10-04 15:51:54 +00:00
Samuel Pitoiset
b8ad3ddb1e radv: fix emulated geometry shader primitives/invocations queries
If both are used together, only the geometry shader primitives were
copied.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25543>
2023-10-04 15:16:36 +00:00
Samuel Pitoiset
c3d823765a radv/ci: rename GFX1100 lists to NAVI31
The chip has been renamed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25542>
2023-10-04 14:20:34 +00:00
Eric Engestrom
86bdabb4c2 ci: fix shebang in build-deqp-runner.sh
We use bash features such as `pushd`, so be accurate in the shebang,
even though in practice this is sourced not executed so this shebang
only serves our editors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25430>
2023-10-04 13:39:36 +00:00
Marek Olšák
bc432ab9a0 radeonsi/ci: update navi10 results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25515>
2023-10-04 12:35:15 +00:00
Marek Olšák
f4d08bf92d Revert "radeonsi: specialize si_draw_rectangle using a C++ template"
This reverts commit cd7e20f513.

Navi1x turns off NGG when streamout queries are active, which breaks
the assumption of specialized si_draw_rectangle that NGG is always
enabled on Navi1x.

Fixes: cd7e20f513

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25515>
2023-10-04 12:35:15 +00:00
Karol Herbst
93d5d85d35 rusticl: fix clippys bool_to_int_with_if
New in clippy-1.65

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25538>
2023-10-04 11:44:51 +00:00
Martin Roukala (né Peres)
cbdd4f5373 zink/ci: remove 19 tests from the zink-radv-polaris10-fails list
It seems that most crashes in glgetteximage-related tests were fixed,
likely by [1] \o/.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25460

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25535>
2023-10-04 11:13:29 +00:00
Georg Lehmann
0e819465b3 aco: print final ir instead if printing asm is unsupported
Not a perfect replacement, but it's better than nothing.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25522>
2023-10-04 08:35:48 +00:00
Georg Lehmann
73605d46dd aco: assume newer generation will use GFX11 wait_imm packing
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25522>
2023-10-04 08:35:48 +00:00
Georg Lehmann
73e85c6691 aco: assume new generations are unsupported by clrx
clrx hasn't seen any changes since 2021. I guess the only reson to keep it is
GFX6 support.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25522>
2023-10-04 08:35:48 +00:00
Mike Blumenkrantz
a2641ddf0d gallium: add PIPE_MAP_NONE
not actually used, just for trace printing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25189>
2023-10-04 02:57:08 +00:00
Mike Blumenkrantz
ef00ea7b50 aux/trace: dump enum names for map usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25189>
2023-10-04 02:57:07 +00:00
Mike Blumenkrantz
72323f66d9 zink: guarantee egl syncobj lifetime
according to spec, egl syncobjs can be deleted before they complete,
which means they need to be preserved while they're still in progress

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25460>
2023-10-04 02:27:53 +00:00
Mike Blumenkrantz
4ef2226210 zink: fix end-of-batch barrier pipeline stages
ALL_COMMANDS covers all the layouts used here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25460>
2023-10-04 02:27:53 +00:00
Mike Blumenkrantz
d0dd973fe2 zink: move v3dv scalarBlockLayout workaround
this isn't actually device-level workaround, it's just error suppression

fixes #9895

Fixes: 2978b85789 ("zink: don't warn about missing scalarBlockLayout on v3dv")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25456>
2023-10-04 02:00:20 +00:00
Mike Blumenkrantz
2531050ec9 zink: move push descriptor disable to driver workarounds
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25456>
2023-10-04 02:00:20 +00:00
Mike Blumenkrantz
c3f5416eaf zink: fix crashing in image rebinds
this is invalid for buffer textures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25379>
2023-10-04 01:34:55 +00:00
Benjamin Cheng
9e67866609 radv/video: find SPS with pps_seq_parameter_set_id
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25490>
2023-10-04 01:12:34 +00:00
Samuel Pitoiset
60dd34b02a zink/ci: bump zink-anv-tgl-full timeout to 1h45m
It can timeout otherwise. Might be due to recent uprev CTS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Samuel Pitoiset
91cb09b236 zink/ci: update list of expectations for zink-anv-tgl
See https://gitlab.freedesktop.org/mesa/mesa/-/pipelines/995410.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
57aa6dad16 ci/crocus: Add a related flake to a known one.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
e8511d5adb ci/docker: Clear the results file before starting a new deqp test run.
crocus-hsw was failing because results.csv.zst was left around in the
results dir, and then zstd -o complained.  We shouldn't be uploading stale
results files, anyway, so do an rm -rf first to clean up when the docker
container gets reused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
c3c2a8def0 ci/zink: Skip more doubles tests on anv that flake at 3 minute timeouts.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
73dd48f3e0 ci/etnaviv: Skip a GLES2 test that times out the asan job.
We could make asan use a toml setup that just skipped this for asan, but
this is quick and easy and I don't think there's too much risk here.  This
would make every asan job I've looked at in the nightlies pass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
1432f7cf4a ci/etnaviv: Minor xfail/flake polishing.
Now that the regular piglit GPU hangs are sorted, we can get some more signal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
77b240a251 ci/anv: Drop the 16bit.scalar.13 skip.
It's now at 1.5 sec on my ADL and CFL systems.

Closes: #4641
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Emma Anholt
c742cba113 ci/anv: Drop incorrect xfail addition for TGL
This xfails file is for deqp-vk.  The xfail that was added was for
angle-on-anv, which has its own expectations files and has this test
recently listed as a flake already.

Fixes: a217c5c58c ("ci: update to vulkan-cts-1.3.6.3")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25509>
2023-10-03 19:38:39 +00:00
Gert Wollny
16662f8d3a copyimage: check requested slice early when cube maps are involved
The generalized check for the z-slice happens in 'check_region_bounds',
but this function requires the image pointer that is acquired in
`prepare_target_err`, therefore replace the assertion with a proper test.

v2: Also check for negative value (Brian Paul)

CC: mesa-stable

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25507>
2023-10-03 18:50:10 +00:00
Kenneth Graunke
17b8b2cffd anv: Add support for a transfer queue on Alchemist
Alchemist has an improved blitter that's sufficiently powerful to
implement a transfer queue. Tigerlake's blitter lacks compression
handling and other features we need, unfortunately.

Rework (Sagar):
- Check blitter command buffer in EndCommandBuffer

v2: (Lionel)
- Look at image, buffer and memory barriers as well
- Flush cache if there is queue ownership transfer

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18325>
2023-10-03 18:02:52 +00:00
Sagar Ghuge
5112b42146 anv: Handle end of pipe with MI_FLUSH_DW on transfer queue
Blitter command streamer supports MI_FLUSH_DW command so make sure we
don't end up emitting pipe control with CS stall and also handle the end
of pipe timestamp with MI_FLUSH_DW command.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18325>
2023-10-03 18:02:52 +00:00
Danylo Piliaiev
b048ba569a ci: Compile Turnip's virtio kmd in debian-arm64
Nothing compiled virtio kmd in CI.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25531>
2023-10-03 17:06:27 +00:00
Danylo Piliaiev
34d436fde2 tu/virtio: Fix incorrect call to tu_perfetto_submit
Virtio backend backend was not updated because it was not
compiled in CI and not compiled locally.

Fixes: 7f59e37233
("tu/perfetto: Allow gpu time to be passed into tu_perfetto_submit")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25531>
2023-10-03 17:06:26 +00:00
Danylo Piliaiev
ec95573302 tu/a7xx: Correctly record timestamps for u_trace
It was changed how CP_EVENT_WRITE works on A7XX.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25528>
2023-10-03 15:48:12 +00:00
Rob Clark
583c636ea4 freedreno: Add attach-bo debugging
Add asserts to verify that BOs referenced in cmdstream are attached to
the submit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
366367eba8 freedreno: Move/add some attach_bo()
In some cases we were missing this, in others we just needed to move it
before the OUT_RELOC().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
9870cca6a0 freedreno: Add missing indirect_draw_count tracking
Fixes: f677f64e80 ("freedreno: implement GL_ARB_indirect_parameters")
Fixes: b43e5aec0d ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
8a3b4b69a2 freedreno: Add private-BO tracking
There are some internally used buffers that we should just attach to
every submit up-front.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
c6f17d89c7 freedreno/batch: Move query_buf allocation
This lets us move fd_batch_update_queries() after resource tracking.
Which will become needed in the next patch which adds validation to
assert needed BOs are attached to the submit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
2189920e49 freedreno: Fix user const buffer dirtiness
If we went the upload_user_buffer() path, cb->buffer would be null,
causing fd_dirty_shader_resource() to be a no-op.  What we want to
use is &so->cb[index].

Fixes: b43e5aec0d ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
4c0defda8a freedreno: Fix streamout offset_buf dirtiness
We also need to mark the offset buffer as dirty.

Fixes: b43e5aec0d ("freedreno/batch: Move submit bo tracking to batch")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
1f6e20cca6 freedreno/a6xx: Remove dummy packet for globals
Unneeded since commit b43e5aec0d ("freedreno/batch: Move submit bo
tracking to batch")

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
8c537a35e6 freedreno: Use explicit QCOM_TILED3 modifier
Now that this is in upstream drm_fourcc.h we can drop the private
internal modifier.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Rob Clark
d0b861200e freedreno: Indentation fix
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25465>
2023-10-03 15:18:03 +00:00
Danylo Piliaiev
ec268fa5b6 tu/kgsl: Support u_trace and perfetto
Raw GPU time is retrieved via kgsl_cmdbatch_profiling_buffer,
offseted GPU time is retrieved via KGSL_PERFCOUNTER_GROUP_ALWAYSON.
This allows to calculate GPU time offset for each submission and
synchronize CPU/GPU time domains.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12805>
2023-10-03 14:19:24 +00:00
Danylo Piliaiev
3ccd199708 tu/kgsl: Fix memory leak of tmp allocations during submissions
cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12805>
2023-10-03 14:19:24 +00:00
Danylo Piliaiev
7f59e37233 tu/perfetto: Allow gpu time to be passed into tu_perfetto_submit
In preparation to support perfetto on KGSL, on KGSL GPU time is
retrieved on submission and requires minimal post-processing.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12805>
2023-10-03 14:19:24 +00:00
Danylo Piliaiev
18a47efb80 tu/perfetto: Remove now unnecessary tu_perfetto_util
Since Turnip now uses C++ we can directly include tu_device.h
into perfetto code.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12805>
2023-10-03 14:19:24 +00:00
Georg Lehmann
bd16d3cdaf nir/lower_subgroups: use intrinsic builder more
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25501>
2023-10-03 12:49:28 +00:00
Georg Lehmann
289b369597 nir: make quad intrinsic dst bit size match src0
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25501>
2023-10-03 12:49:28 +00:00
Christian Gmeiner
b2e4972339 isaspec: Add BitSetEnumValue object
There might be cases where you describe an enum in isaspec and want it to use
for decoding but also for codegen with e.g. mako.

Lets have a look at the following exmaple:

<enum name="#cond">
	<value val="0" display=""/>    <!-- always: display nothing -->
	<value val="1" display=".gt"/>
	...
</enum>

In the decoding case we want that nothing gets displayed if #cond has the value of "0". For
codegen with mako this could result in the following C code:

enum PACKED cond {
   COND_ = 0,
   COND_GT = 1,
   ...
};

What you really want is this:

enum PACKED cond {
   COND_ALWAYS = 0,
   COND_GT = 1,
   ...
};

To make this possible introduce BitSetEnumValue class which represents
an isaspec xml enum. It holds the value, displayname and now a name.

With the  __str__ method the old behaviour is still intact.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
2023-10-03 12:07:04 +00:00
Christian Gmeiner
b67cac5eba isaspec: Add support for custom meta information
Allows every user of isaspec to add custom meta information
to any bitset. This can be quite handy if you want to know
how many sources your instruction have, if this instruction has
a dest or provide some names for sources that can be used
by some debug tools.

All you need is to sprinkle <meta> tags in the xml file and
provide custom attributes.
  <meta has_dest="1" num_sources="3" .. />

With get_meta() method of any bitset you can get access to
the dict with all the attributes. get_meta() walks the whole
tree to collect all <meta> tags on the way to the root node.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
2023-10-03 12:07:04 +00:00
Christian Gmeiner
eb87ae4286 isaspec: Add method to get all instrustions
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
2023-10-03 12:07:04 +00:00
Christian Gmeiner
ef602e77f6 isaspec: encode: Correct used regex
The current regex misses the = sign and therefore fails to match
DST:align=16.

Fixes: 9e56f69edf ("isaspec: encode: handle special fieldname properties")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
2023-10-03 12:07:04 +00:00
Christian Gmeiner
2c9a59dcfc isaspec: Add support for templates
If you have a repeating <display> substring you can replace this
substring with a template and reference the template name instead.

Saves from doing lot of copy&paste and makes general changes to the
substring much easier.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
2023-10-03 12:07:04 +00:00
Juan A. Suarez Romero
62a4a05658 v3dv/ci: update expected list
Remove dEQP-VK.api.driver_properties.conformance_version, as the version
it required is now the one used in the CI.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25518>
2023-10-03 11:05:00 +00:00
Samuel Pitoiset
2bce101eb3 radv: enable DCC for MSAA images on GFX11
This seems to be working now! I suspect either the "recent" addrlib
update fixed it or recent comp-to-single fast clear fixes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8326
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25448>
2023-10-03 09:35:25 +00:00
Jonathan Marek
90f12ce740 tu: add a TU_DEBUG=rd option for cmdstream dumping
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25246>
2023-10-02 23:31:35 +00:00
Jonathan Marek
d35922ce26 freedreno: move redump.h to common code + cleanup
remove the unused parts and add an implementation of rd_write_section

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25246>
2023-10-02 23:31:34 +00:00
Sergi Blanch Torne
8512972787 Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit ccd3e68146

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25369>
2023-10-02 17:39:49 +00:00
Sagar Ghuge
9d7166dfc0 isl: Use 16-bit instead of 8-bits for surface format info fields
Comparing uint8_t max value 255 with devinfo->verx10 will work fine for
now but for future platforms, comparison will fail. To avoid this
let's switch the field data type from 8-bits to 16-bits.

v1: (Jordan)
- Use 16 bits instead of 32 and add assertion.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25478>
2023-10-02 17:24:33 +00:00
Samuel Pitoiset
4bc58c9f11 radv/amdgpu: fix alignment of command buffers
Fixes other recent regressions.

Fixes: 4f660f99 ("ac/gpu_info: pad IBs according to ib_size_alignment")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25502>
2023-10-02 16:48:28 +00:00
Martin Roukala (né Peres)
98bc20041c ci: make B2C_JOB_VOLUME_EXCLUSIONS to all .b2c-test jobs
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25429>
2023-10-02 14:50:27 +00:00
Georg Lehmann
79b767f4c0 aco: remove -0.0 for 32 bit fsign with mul_legacy/omod when denorms are flushed
v_mul_legacy_f32 and omod return +0.0 if any operand is +0.0/-0.0.

Foz-DB Navi21:
Totals from 4289 (5.60% of 76572) affected shaders:
Instrs: 8100571 -> 8099319 (-0.02%); split: -0.02%, +0.00%
CodeSize: 43433200 -> 43435088 (+0.00%); split: -0.01%, +0.01%
Latency: 88151566 -> 88147232 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 22966705 -> 22965192 (-0.01%); split: -0.01%, +0.00%
VClause: 190010 -> 190009 (-0.00%)
SClause: 269697 -> 269689 (-0.00%)
Copies: 687294 -> 687296 (+0.00%); split: -0.00%, +0.00%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25347>
2023-10-02 14:02:49 +00:00
Georg Lehmann
9508cadadb aco/optimizer: copy propagate to output modifier instructions
Foz-DB Navi21:
Totals from 847 (1.11% of 76572) affected shaders:
Instrs: 2331245 -> 2330335 (-0.04%); split: -0.04%, +0.00%
CodeSize: 12451040 -> 12451736 (+0.01%); split: -0.00%, +0.01%
Latency: 26230953 -> 26229153 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 6297802 -> 6296788 (-0.02%); split: -0.02%, +0.00%
VClause: 64527 -> 64528 (+0.00%); split: -0.00%, +0.01%
SClause: 73150 -> 73121 (-0.04%); split: -0.06%, +0.02%
Copies: 180083 -> 179172 (-0.51%); split: -0.53%, +0.02%
PreSGPRs: 62311 -> 62316 (+0.01%)
PreVGPRs: 51720 -> 51710 (-0.02%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25347>
2023-10-02 14:02:49 +00:00
Georg Lehmann
89f3a5ea37 aco/optimizer: check if we can use omod before labeling it
Allows to use omod for v_mul_legacy_f32 regardless of signedZeroInfNaNPreserve

Foz-DB Navi21:
Totals from 15 (0.02% of 76572) affected shaders:
Instrs: 20131 -> 20113 (-0.09%)
CodeSize: 107100 -> 107144 (+0.04%)
Latency: 400789 -> 400470 (-0.08%)
InvThroughput: 62342 -> 62278 (-0.10%)
Copies: 1194 -> 1176 (-1.51%)
PreVGPRs: 787 -> 785 (-0.25%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25347>
2023-10-02 14:02:49 +00:00
Samuel Pitoiset
d3033974ee radv/ci: update list of flakes for NAVI10/VEGA10
This one is fixed since CTS 1.3.6.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25505>
2023-10-02 14:44:58 +02:00
Samuel Pitoiset
387dc05a61 radv/ci: update list of expected failures on PITCAIRN
This one is fixed since CTS 1.3.6.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25505>
2023-10-02 14:44:35 +02:00
Samuel Pitoiset
b01e874234 radv: fix alignment of DGC command buffers
Otherwise, DGC command buffers might not be correctly aligned.

This fixes a regression with the vkd3d-proton DGC tests.

Fixes: 4f660f9937 ("ac/gpu_info: pad IBs according to ib_size_alignment")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25500>
2023-10-02 12:21:44 +00:00
Tapani Pälli
1c4d57568a intel/genxml: remove HDC from gen11.xml, it is not available
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25399>
2023-10-02 12:05:54 +00:00
Tapani Pälli
a49ff4e024 iris: HDC flush is available only for GFX_VER 12+
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25399>
2023-10-02 12:05:54 +00:00
Tapani Pälli
99d3d76646 anv: HDC flush is available only for GFX_VER 12+
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25399>
2023-10-02 12:05:53 +00:00
Tapani Pälli
c02db0d90f iris: flush data cache when flushing HDC on GFX < 12
This matches what anv driver does.

Fixes: a969ad1d ("iris: Demote DC flush to HDC flush in cache tracker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6314
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25399>
2023-10-02 12:05:53 +00:00
Rhys Perry
558738e3c5 aco: remove zero offset optimization
This is done in nir_opt_constant_folding now.

No fossil-db changes on navi31.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25477>
2023-10-02 10:11:37 +00:00
Rhys Perry
7139a78959 nir/constant_folding: remove zero texel offset
fossil-db (navi31):
Totals from 7 (0.01% of 79330) affected shaders:
Instrs: 7001 -> 6993 (-0.11%)
CodeSize: 35736 -> 35692 (-0.12%)
InvThroughput: 3232 -> 3229 (-0.09%)
Copies: 552 -> 549 (-0.54%)
PreSGPRs: 277 -> 273 (-1.44%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25477>
2023-10-02 10:11:37 +00:00
Rhys Perry
c3a894fb47 aco: disable zero offset optimization for strict WQM coords
If we try to do this, we end up using {undef,coordx} as the coordinates
for an image_sample instruction, because we can't shrink the linear VGPR.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9767
Fixes: 859e059aa9 ("radv: use fix_derivs_in_divergent_cf")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25477>
2023-10-02 10:11:37 +00:00
Georg Lehmann
305db1af11 nir: scalarize masked_swizzle_amd created from shuffle_xor
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9901
Fixes: 0ef87f148d ("nir/lower_subgroups: Don't do multiple lowerings at once")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25468>
2023-10-02 09:01:18 +00:00
Tapani Pälli
524e8865ce iris/anv: move Wa_14018912822 as a drirc workaround
This should be toggled on only for applications that hit the issue.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9886
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25424>
2023-10-02 08:26:14 +00:00
Tapani Pälli
ebe95fee21 iris: correct dst alpha blend factor in Wa_14018912822
Fixes: 0e9a26372b ("iris: implement Wa_14018912822")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25424>
2023-10-02 08:26:14 +00:00
Lionel Landwerlin
6ea2ea0bb0 anv: fix internal compute copy shader build
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9907
Fixes: 2cc5b3b1e0 ("anv: add a memcpy compute internal kernel")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25480>
2023-10-02 07:39:01 +00:00
Christian Gmeiner
d48d8aefdf docs: Move isaspec out of drivers/freedreno
Lets put it under 'Developer Topics'.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25452>
2023-10-02 07:20:13 +00:00
Iago Toral Quiroga
4afbf4ad31 v3d: get rid of shader_state pointer in v3d_key
Having this pointer in the key is undesirable since it makes
copying keys difficult and error prone (as seen in previous
patches), also, it is only there for convenience and we don't
strictly need it (in fact the vulkan driver doesn't use it at
all), so let's just get rid of it so our v3d_key is fully
static.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25418>
2023-10-02 06:35:07 +00:00
Iago Toral Quiroga
3fb9e27a3d v3d: fix RAM shader cache
The RAM shader cache was using the v3d_key for hashes and
comparisons which is not correct. Particularly, this struct
has a void pointer where we store a reference to an uncompiled
shader with the NIR code, and that is of course not accounted
for when hashing and comparing keys, which can lead to bogus
cache hits.

This patch introduces a v3d_cache_key that has both the v3d key
and a sha1 of the uncompiled NIR. Now key hashing and comparison
is done on the static part of the v3d key (that is, excluding the
uncompiled shader pointer, which may be invalid in the cache if
the original shader was deleted) and taking the sha1 from the
uncompiled shader. This also makes sure the shader key we store
in the cache has a NULL shader_state pointer to make it more
clear that this field may not be used at all for caching purposes.

This fixes GPU hangs with some OpenCL tests (through Rusticl)
caused by incorrect RAM cache hits.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25418>
2023-10-02 06:35:07 +00:00
Iago Toral Quiroga
8a4bd328cf v3d: use pre-computed shader sha1 for disk cache
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25418>
2023-10-02 06:35:06 +00:00
Iago Toral Quiroga
0ed36b524c v3d: compute nir sha1 for uncompiled shader state
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25418>
2023-10-02 06:35:06 +00:00
Iago Toral Quiroga
adc63d2503 broadcom/compiler: add a couple of shader key helpers
Our shader key includes a void pointer that we can't just memcmp,
so add helpers that allow us toget the 'static' portion and size
of a key. We will use this to fix up the shader cache in v3d in
a later patch.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25418>
2023-10-02 06:35:06 +00:00
Sergi Blanch Torne
ccd3e68146 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:
* Start: 2023-10-02 08:00 BST (07:00 UTC)
* End: 2023-10-02 12:00 BST (11:00 UTC)

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25368>
2023-10-02 07:42:08 +02:00
Martin Roukala (né Peres)
b1156507ed ci/vkcts-navi21: mark more of the RT handles checks as flakes
We keep hitting more and more of them, so let's be more inclusive.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25495>
2023-10-02 03:08:11 +00:00
Martin Roukala (né Peres)
a7ed839490 ci/vkcts-vangogh: mark dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.* as flake
This mirrors what we did on navi21, as there are just too many of these tests.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25495>
2023-10-02 03:08:11 +00:00
Janne Grunau
dbe2230408 asahi: decode: Fix uint64_t format modifiers in agxdecode_stateful()
Fixes i386 build.

Fixes: acd5ed0451 ("asahi: decode: Implement VDM call/ret")
Signed-off-by: Janne Grunau <j@jannau.net>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
d99ed6d66d asahi: Handle layered background programs
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
3715586580 asahi: Generate layered EOT programs
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
c87095e518 asahi: Use a 2D Array texture for array render targets
Fixes KHR-GLES31.core.geometry_shader.layered_framebuffer.blending_support with
eMRT forced.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
87a7b239e1 asahi: Write to cubes/etc attachments as 2D array
To reduce shader variants, the tilebuffer lowering code does not know the
actual texture targets of the spilled render targets, only whether they are
layered or not. As such, all layered targets (3D, cube map, etc) get written out
uniformly as 2D Arrays. For that to work, the driver needs to do the
corresponding transform.

Regular imageStore() instructions are not affected by any of this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
0cbecc1ad1 asahi: Predicate layer ID reads
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
e2a0d64d52 asahi: Add pass to predicate layer ID reads
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
e518c92d26 asahi: Assume LAYER is flat-shaded
It can't be anything else, this makes sure the varyings are sorted properly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
68437eb0ba asahi: Account for layering for attachment views
Do not force a single-layer view, use an actual array attachment when there are
multiple layers, since this corresponds to a layered framebuffer that will write
to an array with the eMRT path.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
9dc87a00fd asahi: Expose VS_LAYER_VIEWPORT behind a flag
We can't technically expose the extension without a higher GL version, but the
implemented subset should work and this lets us test with piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
2396d3fe62 asahi: Use layered layouts
For correct eMRT code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
8a48af4f8f agx/lower_tilebuffer: Support spilled layered RTs
If we spill render targets with a layered framebuffer, our spilled targets are
assumed to be 2D Arrays (in general). We need to use arrayed image operations to
load/store from these. The layer is given by the layer as read in the fragemnt
shader. This handles the eMRT portion of layered rendering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
041451b655 agx/tilebuffer: Support layered layouts
Just add a flag for it. We don't care about the actual # of layers when
calculating the layout, only the boolean fact of being layered or not. The
reason we need this at all is because the eMRT implementation needs to
account for layering and that is only keyed off the tilebuffer layout.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:37:55 -04:00
Alyssa Rosenzweig
b252630604 agx: Support packed layered rendering writes
With the new pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
4a954dff07 asahi,agx: Select layered rendering outputs
These 2 are together

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
88fd76d378 asahi: Add helper to get layer id in internal program
For background/EOT only.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
7d94f2ee49 agx: Add pass to lower layer ID writes
The hardware needs the layer ID and the viewport index packed together. That
consumes an entire varying slot, if we want those available in the frag shader
we need a separate slot. Add a pass to insert the extra packed write.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
175819eec6 agx: Handle layered block image stores
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
c3a208d6d9 agx: Pack block image store dim correctly
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
da0da5d6f8 agx/nir_lower_texture: Allow disabling layer clamping
For background program with layered.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
10b9c2fa36 nir: Support arrays in block_image_store_agx
For layered rendering, runs once per layer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:12 -04:00
Alyssa Rosenzweig
f4042afd57 nir: Add layer_id_written_agx sysval
We'll implement layer ID reads in the frag shader with a varying read, but if
the VS doesn't write the varying we need to return 0 per the spec. Add a sysval
to detect that case so we can handle it at runtime without keys.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
d83d24e96a agx: Insert jmp_exec_none instructions
With the exception of the backwards branch for loops, all the control flow we
insert during instruction selection just predicates instructions rather than
actually jumping around. That means, for example, we execute both sides of the
if even for a uniform condition! That's inefficient. The solution is insert
jmp_exec_none instructions after control flow in order to skip unexecuted
regions, which is much faster than predicating them out. However, jmp_exec_none
is costly in itself, so we need to use a heuristic to determine when it's
actually beneficial.

This uses a very simple heuristic for this purpose. However, it is a massive
performance speed-up for Dolphin uber shaders: 39fps -> 67fps at 2x resolution.
Nearly a doubling of performance!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
79c4d4213c agx: Add agx_prev_block helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
dd6106c8bd agx: Add jumps to block ends
jmp_exec_none variant that jumps to the last instruction of the target block,
rather than the beginning. This is convenient for skipping over elses, while
still executing the block-final pop_exec instruction. Similarly for skipping
over loop bodies while still executing the block-final pop_exec, after break
instructions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
22ab505a3d agx: Augment if/else/while_cmp with a target
Add an optional pointer to a target block for these instructions. This does NOT
act like a logical branch, and does NOT get added to the logical control flow.
It is ignored wholesale until after RA, when physical edges may be inserted by a
pass we add later in this series.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
9a894c9a33 agx: Set PIPE_SHADER_CAP_CONT_SUPPORTED
So we get adequate testing of continues, rather than lowering them in GLSL. We
don't really /want/ to see continues but lowering them away will just make them
harder to test... and besides, we should be optimizing them in NIR (not GLSL) so
we can get the win on Vulkan too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
d05657e0d6 agx: Hoist sample_mask/zs_emit
Although this is well-motivated, perf effect seems to be neglible for Dolphin.
It does prevent the scheduler from making things worse by sinking these
instructions though, so as a way to prevent future problems this seems sensible.

The kind of problem this affects (late discard) isn't modelled in shader-db.
Nevertheless, nothing concerning there:

   total instructions in shared programs: 1756699 -> 1756722 (<.01%)
   instructions in affected programs: 10106 -> 10129 (0.23%)
   helped: 21
   HURT: 41
   Inconclusive result (value mean confidence interval includes 0).

   total bytes in shared programs: 11525404 -> 11525452 (<.01%)
   bytes in affected programs: 72900 -> 72948 (0.07%)
   helped: 27
   HURT: 41
   Inconclusive result (value mean confidence interval includes 0).

   total halfregs in shared programs: 483394 -> 483286 (-0.02%)
   halfregs in affected programs: 4945 -> 4837 (-2.18%)
   helped: 88
   HURT: 78
   Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
0d8362b842 agx: Align the reg file for 256-bit vectors
This fixes live range splitting with 3D textureGrad(), which involves vectors
larger than the natural 128-bit maximum and hence requires special handling.
Fixes this assert with a combination of debug flags and new patches:

   unsigned int find_best_region_to_evict(struct ra_ctx *, unsigned int,
   unsigned int *, unsigned int *):
   Assertion `(rctx->bound % size) == 0 && "register file size must be aligned
   to the maximum vector size"' failed

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Alyssa Rosenzweig
cb14cddfa5 asahi: Clamp index buffer extent to what's read
This makes for cleaner agxdecodes, I think this matches what I've seen on the
macOS side but I might be misremembering. Certainly shouldn't hurt.

This only applies for direct draws.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-10-01 12:32:11 -04:00
Friedrich Vock
2be9b66cdd radv: Fix check in insert_block
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25496>
2023-10-01 13:11:50 +02:00
Friedrich Vock
a0fba17311 radv: Initialize shader freelist on allocation
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25496>
2023-10-01 13:11:43 +02:00
Vitaliy Triang3l Kuzmin
a43ee1ca50 r600: Replace R600_BIG_ENDIAN with UTIL_ARCH_BIG_ENDIAN
In particular, removes the dependency of r600_formats.h on r600_pipe.h so
it can be shared between Gallium and Vulkan.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24513>
2023-10-01 09:25:50 +00:00
Marek Olšák
43e7285069 winsys/amdgpu: pad gfx and compute IBs with a single NOP packet
to minimize CP overhead

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25043>
2023-10-01 08:45:22 +00:00
Marek Olšák
4f660f9937 ac/gpu_info: pad IBs according to ib_size_alignment
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25043>
2023-10-01 08:45:22 +00:00
Marek Olšák
b6f435888b ac/gpu_info: replace ib_alignment with per-IP IB base and size alignments
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25043>
2023-10-01 08:45:22 +00:00
Eric Engestrom
276caddbd9 ci/deqp-runner: restore exit-on-error after getting deqp-runner's exit code
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24738>
2023-10-01 02:00:50 +00:00
Eric Engestrom
f8326d0950 ci/deqp-runner: fix indentation
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24738>
2023-10-01 02:00:50 +00:00
Marek Olšák
6b29c16db8 amd: rename GFX110x to NAVI31-33
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25492>
2023-09-30 23:08:47 +00:00
Marek Olšák
c7e08acd12 ac/llvm: fix flat PS input corruption
Fixes: 0a54fbb5b4 - radeonsi/gfx11: interp changes for 32bit

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25492>
2023-09-30 23:08:47 +00:00
Marek Olšák
d50cc2e0cf ac/gpu_info: don't align IBs to the GL2 cache line size
PAL doesn't do it. If drivers want IBs not to share cache lines with other buffers,
they should align the size manually.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25492>
2023-09-30 23:08:46 +00:00
Marek Olšák
2d928c7fee ac/llvm: set !fpmath 3.0 for llvm.sqrt
LLVM will be changed to increase precision with additional instructions,
which we don't want.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25492>
2023-09-30 23:08:46 +00:00
Marek Olšák
476529a692 ac/perfcounter: remove a bogus assert to fix an assertion failure on gfx11
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25485>
2023-09-30 22:23:04 +00:00
Eric Engestrom
2e100bd69b ci: move shader-db clone/build into its own script
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24504>
2023-09-30 14:55:09 +00:00
Eric Engestrom
e7c0971b4f ci: drop unused shader-db clone + build from fedora image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24504>
2023-09-30 14:55:09 +00:00
Eric Engestrom
16201d5896 ci: drop unused shader-db clone + build from alpine image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24504>
2023-09-30 14:55:09 +00:00
Konstantin Seurer
ca92a10800 radv: Do not sync after radv_update_buffer_cp
WR_CONFIRM is set.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24846>
2023-09-30 11:49:14 +00:00
Konstantin Seurer
3fd0ff21e0 radv: Merge the sync_data and header initialization
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24846>
2023-09-30 11:49:14 +00:00
Konstantin Seurer
b3c43d6865 radv/bvh/ploc: Load child bounds from LDS
The bounds are already in LDS so there is no need to load them from
VRAM.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24846>
2023-09-30 11:49:14 +00:00
Eric Engestrom
8a80a3607c docs: document the merging process and what is allowed or not
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25117>
2023-09-30 11:42:32 +00:00
Cong Liu
e7d393b1d7 virgl:Fix ITEM_CPY macro pointer copy bug
The ITEM_CPY macro uses the memcpy function to copy the item variable.
When item is a pointer, the memcpy function will copy the value of the
pointer, not the address that the pointer points to.

Signed-off-by: Cong Liu <liucong2@kylinos.cn>
Reviewerd-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25453>
2023-09-30 03:01:21 +00:00
Guilherme Gallo
6de10c3585 ci/anv: Catch some flakes
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25469>
2023-09-29 17:27:49 -03:00
Guilherme Gallo
6217540eda ci/zink: Found some flakes
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25469>
2023-09-29 17:27:49 -03:00
Guilherme Gallo
2d66147376 ci/freedreno: Add a new flake
KHR-GLES31.core.compute_shader.simple-compute-shared_context resulted in
an UnexpectedPass during execution of the job
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/49445812

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25469>
2023-09-29 17:27:49 -03:00
Guilherme Gallo
8e2a049cc6 ci/radeonsi: Update flake list
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25469>
2023-09-29 17:27:49 -03:00
Mike Blumenkrantz
a524f6b5d4 radv: fix external handle type queries for dmabuf/fd
the intent of the VkExternalMemoryProperties API is that all compatible
handle types are returned, not just the type being queried. these two
types are compatible, so return both when both are supported

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25474>
2023-09-29 18:57:13 +00:00
Rhys Perry
6518d09601 aco: don't combine DPP into v_cmpx
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25471>
2023-09-29 18:23:21 +00:00
Rhys Perry
ea633c128c aco/optimizer_postRA: don't combine DPP across exec on GFX8/9
GFX8/9 seem to use FI=0 behaviour.

fossil-db (vega10):
Totals from 1 (0.00% of 63053) affected shaders:
Instrs: 542 -> 570 (+5.17%)
CodeSize: 2928 -> 3040 (+3.83%)
Latency: 2087 -> 2118 (+1.49%)
InvThroughput: 1103 -> 1143 (+3.63%)

Affected shader is from Cyberpunk 2077 fossil.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: 23.2 <mesa-stable>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9784
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25471>
2023-09-29 18:23:21 +00:00
Helen Koike
fa884141dc ci/ci_run_n_monitor: add docs for multiple targets
clarify how multiple targets can be used with the pipe character.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25472>
2023-09-29 09:50:53 -03:00
Lionel Landwerlin
a25f96c00c intel/fs: switch from SIMD 1 to 8 instructions surface/sampler rematerialization
SIMD1 instructions are problematic because they are considered partial
writes. This increases the liveness of the destination register
written by those instructions. To workaround this we use UNDEF
instructions to bound the liveness of the register. But this causing
other issues like in this case :

  undef(1) vgrf2
  mov(1)   vgrf2, u4.0
  add(1)   vgrf3, vgrf2.0, 64UD

In this case the copy propagation pass in unable to see that vgrf2 in
the add() instruction can be replaced with the uniform u4.0.

To fix this problem, we switch NoMask SIMD8 instructions that cover
the entire register. We can drop the UNDEF instructions and now copy
propagation can do its job.

Good results on 2 apps :

Cyberpunk 2077 :

  Totals from 7258 (68.80% of 10549) affected shaders:
  Instrs: 6332210 -> 6073833 (-4.08%); split: -4.11%, +0.03%
  Cycles: 130667501 -> 127351268 (-2.54%); split: -3.12%, +0.58%
  Subgroup size: 90320 -> 90400 (+0.09%)
  Spill count: 90 -> 68 (-24.44%)
  Fill count: 82 -> 64 (-21.95%)
  Scratch Memory Size: 8192 -> 6144 (-25.00%)
  Max live registers: 385464 -> 375152 (-2.68%)
  Max dispatch width: 64336 -> 64424 (+0.14%); split: +0.96%, -0.82%

  Gaining 60 SIMD16/SIMD32 shaders, loosing 33

Strange Brigade :

  Totals from 2137 (53.12% of 4023) affected shaders:
  Instrs: 1544031 -> 1457544 (-5.60%); split: -5.60%, +0.00%
  Cycles: 22292564 -> 21868978 (-1.90%); split: -2.43%, +0.53%
  Subgroup size: 25328 -> 25344 (+0.06%)
  Max live registers: 113716 -> 111214 (-2.20%)
  Max dispatch width: 17232 -> 18608 (+7.99%); split: +8.36%, -0.37%

  Gaining 138 SIMD16/SIMD32 shaders, loosing 4

On app slightly negatively affected :

Dota2 :

  Totals from 232 (14.73% of 1575) affected shaders:
  Instrs: 30029 -> 28194 (-6.11%)
  Cycles: 385155 -> 371422 (-3.57%); split: -3.59%, +0.02%
  Max live registers: 6792 -> 6780 (-0.18%)
  Max dispatch width: 2256 -> 2160 (-4.26%)

  Loosing 6 SIMD32 shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24554>
2023-09-29 10:46:47 +00:00
Lionel Landwerlin
d28f42f85d intel/fs: handle add3 in surface/sampler rematerialization
Some recent NIR changes started generated those instructions. We need
to handle them to be able to rematerialize.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24554>
2023-09-29 10:46:47 +00:00
Lionel Landwerlin
05fd418e8b intel/fs: handle ishl in surface/sampler rematerialization
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24554>
2023-09-29 10:46:47 +00:00
Samuel Pitoiset
83cad95358 radv: emit missing PA_{SC,SU}_LINE_STIPPLE_xxx regs in gfx preamble
Ported from RadeonSI and PAL.
This might fix the line stipple flakes in CI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25428>
2023-09-29 07:50:46 +00:00
Samuel Pitoiset
a9945216ba radv: fix COMPUTE_SHADER_INVOCATIONS query on compute queue
The VA needs to be adjusted, otherwise the hw always writes at offset 0.

This fixes dEQP-VK.query_pool.statistics_query.*_cq.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25406>
2023-09-29 07:16:44 +00:00
Samuel Pitoiset
c1b916ccb9 radv: re-enable DCC with mipmaps on GFX11
This is now fixed.

Hi-Fi Rush, Sonic Frontiers and Hogwarts Legacy were known broken games.

I personally reproduced the issue with Hi-Fi Rush which has been fixed
since e6735409ee ("radv: disable DCC with signedness reinterpretation
on GFX11"). I also tested Sonic Frontiers which has been fixed since
52b6886992 ("amd: update addrlib"). I didn't check Hogwarts Legacy but
I think it was also fixed by e6735409ee.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25435>
2023-09-29 06:54:42 +00:00
Caio Oliveira
80a1896539 compiler/types: Add void parameter to ensure these are valid C prototypes
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Caio Oliveira
cc1fac52da compiler/types: Spell struct and enum in type names
This is a preparation for moving compiler/types from C++ to C.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Caio Oliveira
95465b813f compiler/types: Use C compatible cast syntax
This is a preparation for moving compiler/types from C++ to C.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Caio Oliveira
0158057bd0 compiler/types: Remove use of auto
This is a preparation for moving compiler/types from C++ to C.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Caio Oliveira
4a8918f7e1 compiler/types: Remove use of references
This is a preparation for moving compiler/types from C++ to C.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Caio Oliveira
57819effc1 compiler/types: Remove use of new/delete
This is a preparation for moving compiler/types from C++ to C.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Caio Oliveira
dac4901c8a compiler/types: Remove private related declarations
Now there's no private data in glsl_type anymore, so we can remove
the friend declaration and move the private functions into file local
statics.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25445>
2023-09-28 22:43:45 +00:00
Karol Herbst
5316623d20 rusticl/mesa: create COMPUTE_ONLY contexts
This allows drivers to skip initializing unnecessary bits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25466>
2023-09-28 23:02:24 +02:00
Sagar Ghuge
3d993e63bb anv: Enable barrier handling on video engines
v1: (Lionel)
- Don't check for the layout transition

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

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25131>
2023-09-28 18:22:37 +00:00
Marek Olšák
8e97d291a8 ac/llvm: replace removed amdgcn.ldexp for LLVM 18
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25393>
2023-09-28 16:51:33 +00:00
Emma Anholt
d638c60628 ci/etnaviv: Drop some gc2k flakes that I think are resolved.
All these basic GLSL tests should be stable now that other processes
aren't hanging the GPU on us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25442>
2023-09-28 16:34:51 +00:00
Emma Anholt
990dc58995 ci/etnaviv: Skip some tests that hang the GPU and knock out other tests.
Just a few tests were causing GPU hangs that seem to cause spurious
failures in other tests.  With those skipped, the results mostly
stabilize.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25442>
2023-09-28 16:34:51 +00:00
Marek Olšák
b8ce0dcef5 radeonsi: fix compute-only contexts
We can't skip redundant register updates on compute queues, at least
not all of them.

Fixes: 315231b5a5 - radeonsi: eliminate redundant compute SH register changes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25390>
2023-09-28 15:49:34 +00:00
Faith Ekstrand
286cd18681 nvk: Init pipelineCacheUUID
Fixes: 968cefbff1 ("nvk: Cache NIR shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25458>
2023-09-28 15:31:21 +00:00
Martin Roukala (né Peres)
0e7b1e2fca radv/ci: add a manual job for vkd3d-proton on navi31
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25266>
2023-09-28 14:51:12 +00:00
Martin Roukala (né Peres)
5e47f4f008 radv/ci: add a manual job to run vkcts on navi31
We currently only have a single navi31, but we'll get more in the
next month or so.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25266>
2023-09-28 14:51:12 +00:00
Martin Roukala (né Peres)
d7aad24b5e radv/ci: update the vkcts gfx1100 flake/fail lists
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25266>
2023-09-28 14:51:12 +00:00
Timothy Arceri
2e7514cfa8 glsl: remove now unused varying linker code
All of this varying linking code has now been ported to the NIR linker.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Timothy Arceri
36e49c162c glsl: switch to nir linkers cross_validate_outputs_to_inputs()
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Timothy Arceri
7d1948e9b5 glsl: implement cross_validate_outputs_to_inputs() in nir linker
This is mostly a direct port of the GLSL IR code there are only
2 real functional changes.

1. The direct use of mesa symbol_table instead of glsl_symbol_table.
   However since none of the extra functionality offered by
   glsl_symbol_table was ever used here this can be seen as an
   improvement.

2. Because interface blocks are lowered before this new nir linker
   sees them we must explicitly skip them (they are validated
   elsewhere) to avoid errors.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Timothy Arceri
f2e87c5c28 nir: add used field to nir variables
Will be use in a following path by the glsl nir based linker.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Timothy Arceri
0bfae24640 glsl: move is_gl_identifier() to linker_util
This had started to multiply around the NIR linker. Here we move it to a
common helper shared by GLSL IR and NIR.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Timothy Arceri
78b9f1053f glsl: move interpolation_string() to linker_util
Moving it here allows us to use in in the NIR linker too.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Timothy Arceri
337c32cb3a nir: copy explicit_invariant flag to nir vars
This will be used in the following patch.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
2023-09-28 13:55:16 +00:00
Samuel Pitoiset
af2a96bb37 radv: stop skip emitting CB states when there is no color attachment
This is actually wrong. For example, if there is a DCC decompress
draw followed by a draw without any color attachments,
CB_COLOR_CONTROL.MODE is still CB_DCC_DECOMPRESS but it should be
CB_DISABLED. For some reasons, this hangs on RDNA3 (VM faults are also
reported through dmesg).

This fixes GPU hangs with Resident Evil 6, Star Wars The Old Republic
and probably more games on RDNA3.

Strictly speaking, I don't think this dynamic state optimization is
worth a try, even for other states, and I think it would be safer to
remove it completely.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9335
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8327
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9878
Fixes: c08082e861 ("radv: ignore all CB dynamic states when there is no color attachments")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25402>
2023-09-28 13:32:35 +00:00
Mike Blumenkrantz
441e57048b glx: XFree visual info
cc: mesa-stable

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25441>
2023-09-28 12:17:49 +00:00
Cong Liu
02150ca017 r300: Fix out-of-bounds access in ntr_emit_store_output()
This patch resolves the problem by modifying the for loop condition
to ensure that it stays within the bounds of the array (i.e., i < 4)

Signed-off-by: Cong Liu <liucong2@kylinos.cn>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25419>
2023-09-28 09:51:38 +00:00
Eric Engestrom
9bc1fd25a4 ci/zink+radv: document flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25427>
2023-09-28 09:06:59 +00:00
Christian Gmeiner
435699de77 isaspec: python does not need ';'
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25437>
2023-09-28 08:15:50 +00:00
Ian Romanick
03c1e67b6c spirv: Track when a shader has a cooperative matrix
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Caio Oliveira
b98f87612b spirv: Implement SPV_KHR_cooperative_matrix
Includes a modified version of using extract/insert for OpLoad/OpStore
from Ian.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (earlier version)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (earlier version)
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Caio Oliveira
b17a2c35bc spirv: Let vtn_ssa_value hold references to variables
In certain cases, we have complex opaque objects that are loaded
into (SPIR-V) SSA values.  To represent these, we now can store a
reference to a variable in vtn_ssa_value.

Also implements a few operations we know will have to be supported,
like Select and Copy.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Caio Oliveira
3d7e5ec758 spirv: Expose some memory related functions in vtn_private.h
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Caio Oliveira
af3eb80afa nir: Handle cooperative matrix in various passes
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Caio Oliveira
3105d516d0 nir: Add new intrinsics for Cooperative Matrix
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Caio Oliveira
2d0f4f2c17 compiler/types: Add support for Cooperative Matrix types
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23825>
2023-09-28 07:35:02 +00:00
Paulo Zanoni
b75da97a1d anv: enable sparse resources by default
This of course only applies to xe.ko. There is no reason to keep it
disabled by default.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
2023-09-28 06:16:40 +00:00
Paulo Zanoni
7e2d8cced3 anv/sparse: add INTEL_DEBUG=sparse
This pollutes stderr a lot, but I've used it countless times while
developing this code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
2023-09-28 06:16:40 +00:00
Paulo Zanoni
2bdd01187d anv/sparse: get ready to issue a single vm_bind ioctl per non-opaque bind
Game testing shows it's common for this operation to result in
multiple bind regions, so try to use a single ioctl when we can.

Actual testing reveals 136 shader-related tests fail when we actually
do this, so for now keep doing a single bind per ioctl while leaving a
very easy way to the desired behavior when we figure this out.

It should also be possible to go even higher-level and do this at the
anv_queue_submit_sparse_bind_locked() layer, but that should happen in
future commits.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
2023-09-28 06:16:40 +00:00
Paulo Zanoni
6368c1445f anv/sparse: add the initial code for Sparse Resources
This giant patch implements a huge chunk of the Vulkan Sparse
Resources API. I previously had this as a nice series of many smaller
patches that evolved as the xe.ko added more features, but once I was
asked to squash some of the major reworks I realized I wouldn't be
able easily rewrite history, so I just squased basically the whole
series into a giant patch. I may end up splitting this again later if
I find a way to properly do it.

If we want to support the DX12 API through vkd3d we need to support
part of the the Sparse Resources API. If we don't, a bunch of Steam
games won't work.

For now we only support the xe.ko backend, but the vast majority of
the code is KMD-independent and so an i915.ko implementation would use
most of what's here, just extending the part that binds and unbinds
memory.

v2+: There's no way to sanely track the version history of this patch
in this commit message. Please refer to Gitlab.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
2023-09-28 06:16:40 +00:00
Paulo Zanoni
e4598f0eea intel/isl: simplify the check for maximum surface size
The only thing that changes between these 3 checks is the size.

This entire patch was suggested by Kenneth Graunke, I just converted
his gitlab comment to a git commit.

Credits-to: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
2023-09-28 06:16:40 +00:00
Paulo Zanoni
0de5d142e8 intel/isl: add ISL_SURF_USAGE_SPARSE_BIT
Vulkan Sparse resources have their own set of rules, so here we try to
make ISL aware of them through ISL_SURF_USAGE_SPARSE_BIT.

The big deal here is when some image ends up not using Tile64 nor
TileYs. Previously Ys was not supported on TGL at all, and Tile64 did
not have support for 3D. Now we still have some formats that end up
not being used with either Tile64 and Ys, but need to support Sparse
on them (e.g., YUV on Tile64). In the future we may have new tiling
formats or hardware restrictions that would force this case to happen
again.

So here we do some adjustments so we can make sparse work with other
tiling formats, although with limited functionality (e.g., those
formats may be restricted to opaque binds, and certainly don't support
the standard block shapes).

v2: before we had Ys support, we had defined TGL's block size as 4k.
v3: move the size_B chunk to before nte notify_failure() checks (Ken).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23045>
2023-09-28 06:16:40 +00:00
Faith Ekstrand
968cefbff1 nvk: Cache NIR shaders
We can't cache shader binaries just yet but this at least lets us cache
the output of spirv_to_nir and the initial optimize.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25443>
2023-09-28 03:55:53 +00:00
Faith Ekstrand
cdbd86c176 nvk: Add a default pipeline cache
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25443>
2023-09-28 03:55:53 +00:00
Faith Ekstrand
abe52a6d03 nvk: Re-structure early shader compilation a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25443>
2023-09-28 03:55:53 +00:00
Faith Ekstrand
a4f8fd9dd5 nvk: Hook up the disk cache
This won't actually do much yet because we don't have pipeline caches
yet but it turns on the infrastructure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25443>
2023-09-28 03:55:53 +00:00
Faith Ekstrand
d08df319ca nvk: Store a 20-bit driver_build_sha in nvk_instance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25443>
2023-09-28 03:55:53 +00:00
Timothy Arceri
1780102923 nir: fix typo in comment
The variable is unused or dead, not used.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25414>
2023-09-28 01:54:43 +00:00
antonino
76d150674b vulkan: Handle vkSetDebugUtilsObjectNameEXT on WSI objects
Some WSI objects don't extend `vk_object_base` therefore they need
special handling.

Fixes: 3c87618d35 ("vulkan: Handle vkGet/SetPrivateDataEXT on Android swapchains")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24752>
2023-09-28 01:23:55 +00:00
antonino
5fe289d741 vulkan: Extend vkGet/SetPrivateDataEXT handling to VkSurface
VkSurface is handled by WSI and it doesn't extend `vk_object_base` so it
needs special handling.

Fixes: 3c87618d35 ("vulkan: Handle vkGet/SetPrivateDataEXT on Android swapchains")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24752>
2023-09-28 01:23:55 +00:00
antonino
710d478066 vulkan: Extend vkGet/SetPrivateDataEXT handling to all platforms
Non-android platforms use mesa WSI, however some WSI object still don't
extend `vk_object_base` so they still need special handling.

Fixes: 3c87618d35 ("vulkan: Handle vkGet/SetPrivateDataEXT on Android swapchains")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24752>
2023-09-28 01:23:55 +00:00
Dave Airlie
c45ae052f0 llvmpipe/cs: migrate cs image handle to common jit code.
This moves some of the code over, and uses the generic paths.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25416>
2023-09-28 00:41:04 +00:00
Dave Airlie
2c74f825f4 llvmpipe/cs: migrate to generic jit texture from pipe code.
This moves some cs specific bits to the generic code and uses it.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25416>
2023-09-28 00:41:04 +00:00
Marcin Ślusarz
ea92bd8d44 intel/compiler: mask GS URB handles at thread payload construction
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Marcin Ślusarz
815eee10e0 intel/compiler/mesh: implement IO for xe2
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Marcin Ślusarz
ee4214de6e intel/compiler/mesh: fix position of output URB handle for xe2
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Francisco Jerez
7f3dc4505d intel/fs: Delete manual 'inst->mlen' calculations from all uses of logical URB reads.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Francisco Jerez
53d1d793cb intel/fs: Delete manual 'inst->mlen' calculations from all uses of logical URB writes.
Rework:
 * Marcin: update emit_urb_indirect_vec4_write

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Francisco Jerez
34a2c9ce35 intel/fs: Specify number of data components of logical URB writes via control immediate.
This is what most logical SEND messages do when they take a variable
number of components.  'inst->mlen' is expected to be zero for logical
SEND opcodes, which are expected to behave like plain arithmetic
operations, so certain automated transformations (like SIMD lowering)
can manipulate them without opcode-specific special-casing.

Guessing the number of components from 'inst->mlen' has other
disadvantages, because it requires duplicating the logic that infers
the message payload size in every use of the instruction -- Instead we
can just do the computation once during logical send lowering.  In
addition on LNL platform this causes the 'inst->mlen' field of URB
writes to have units inconsistent with every other SEND instruction,
which is likely to lead to confusion and bugs down the road.

Rework:
 * Marcin: update emit_urb_indirect_vec4_write

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Francisco Jerez
74c9973c0b intel/fs/xe2+: Fix URB writes with 0 data components.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Caio Oliveira
c89597085a intel/compiler/xe2: Update TCS ICP handle code to support SIMD16
Rework:
 * Use ffs(grf_size_bytes) (s-b Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Caio Oliveira
f0fcb778b4 intel/compiler/xe2: Fix URB writes in TCS
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Caio Oliveira
0c03018abf intel/compiler/xe2: URB fence uses LSC now
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Ian Romanick
623465e26d intel/compiler/xe2: Update fs_visitor::emit_urb_writes to not assume SIMD8
v2: Account for 512b physical registers which causes the URB handle to be in FIXED_GFR 2 instead of 1.

XXX - Use fs_builder::vgrf() instead of open-coded dispatch_width calculations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Kenneth Graunke
4fffdbbfa2 intel/fs: Fix Xe2 URB read/lowering with per-slot offsets
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Jordan Justen
c28539a2fe intel/compiler: Use enum xe2_lsc_cache_load on xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Jordan Justen
8d27b327f2 intel/compiler: Add enum xe2_lsc_cache_load
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Jordan Justen
09fc9ff114 intel/compiler: Use enum xe2_lsc_cache_store on xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Jordan Justen
c54eff2e03 intel/compiler: Add enum xe2_lsc_cache_store
Rework:
 * Rohan: Fix enum value for L1WB_L3WB
 * Fix write-through comments (Ken)

Ref: bspec 71167
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Marcin Ślusarz
1245020282 intel/compiler: add initial support for URB_LOGICAL_SRC_CHANNEL_MASK to lower_urb_write_logical_send_xe2
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Marcin Ślusarz
9c90377962 intel/compiler: add lsc_msg_desc_wcmask
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Ian Romanick
feec9166cd intel/compiler/xe2: Handle new URB write messages
Rework:
 * idr v1: Fix compilation error.
 * idr v2: Add support for per-channel offsets.
 * idr v3: get_lowered_simd_width is 16 on Xe2+.
 * idr v4: Add disassembly support.  Add validation support.
 * Sqaushed in changes Marcin Ślusarz's patches:
   * "intel/compiler: skip adding 0 to payload address"
   * "intel/compiler/xe2: drop masking off top 8 bits of URB handle"

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Ian Romanick
fa53a7d241 intel/compiler/xe2: Handle new URB read messages
Rework:
 * Sqaushed in changes Marcin Ślusarz's patches:
   * "intel/compiler: skip adding 0 to payload address"
   * "intel/compiler/xe2: drop masking off top 8 bits of URB handle"

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25195>
2023-09-27 23:57:25 +00:00
Konstantin Seurer
4552e594f1 vulkan: Remove vk_get_physical_device_core_1_*_feature_ext
It's unused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24773>
2023-09-27 23:02:29 +00:00
Konstantin Seurer
05796b29f5 hasvk: Use the common GetPhysicalDeviceFeatures2 implementation
Reviewed-by: Julia Tatz <tatz.j@northeastern.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24773>
2023-09-27 23:02:29 +00:00
Rhys Perry
65afc8bebf nir/algebraic: optimize u2u32(a >> 32)
fossil-db (navi21):
Totals from 352 (0.44% of 79330) affected shaders:
Instrs: 271816 -> 271240 (-0.21%); split: -0.28%, +0.07%
CodeSize: 1546520 -> 1544448 (-0.13%); split: -0.23%, +0.09%
SpillVGPRs: 832 -> 827 (-0.60%); split: -1.08%, +0.48%
Latency: 4037120 -> 4021748 (-0.38%); split: -0.41%, +0.03%
InvThroughput: 1369540 -> 1362066 (-0.55%); split: -0.59%, +0.04%
VClause: 6476 -> 6471 (-0.08%); split: -0.12%, +0.05%
SClause: 6798 -> 6794 (-0.06%)
Copies: 44828 -> 44630 (-0.44%); split: -0.89%, +0.45%
Branches: 8845 -> 8844 (-0.01%); split: -0.05%, +0.03%
PreSGPRs: 14684 -> 14659 (-0.17%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25409>
2023-09-27 22:13:01 +00:00
Rhys Perry
bcdac65ca3 nir/lower_int64: fix find_lsb(0)
If the high 32 bits were zero, this would be umin(find_lsb(lo), 31). This
evaluates to 31 if lo is also zero, instead of -1.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fixes: 9293d8e64b ("nir: Add find_lsb lowering to nir_lower_int64.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25409>
2023-09-27 22:13:01 +00:00
wangra
e90f9d8e21 tu/kgsl: Fix bitfield of DITHER_MODE_MRT6
The enum `adreno_rb_dither_mode` needs 2 bits, change the `high` to 13 to make sure 2 bits are used for `DITHER_MODE_MRT6`

Fixes: e03259974e ("freedreno: Generate headers from xml files")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25439>
2023-09-27 21:45:40 +00:00
Jordan Justen
b5eb96384c anv: Print warning that Xe2 is not supported rather than failing
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25411>
2023-09-27 21:11:18 +00:00
Jordan Justen
30ba269070 anv: Build for Xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25411>
2023-09-27 21:11:18 +00:00
Jordan Justen
65684b0c7f anv: Disable Ray Tracing on xe2 until our compiler supports Xe2 RT
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25411>
2023-09-27 21:11:18 +00:00
Jordan Justen
3f1b4dd434 anv/blorp: Use anv_genX to set device->blorp.exec
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25411>
2023-09-27 21:11:18 +00:00
Jordan Justen
3bb96643f7 iris: Build for Xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25411>
2023-09-27 21:11:18 +00:00
Lionel Landwerlin
ee4062666c iris: add missing workaround for 3DSTATE_LINE_STIPPLE
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25425>
2023-09-27 20:32:50 +00:00
Lionel Landwerlin
a28ff995bb anv: add missing workaround for 3DSTATE_LINE_STIPPLE
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25425>
2023-09-27 20:32:50 +00:00
Lionel Landwerlin
c59179e6bb anv/iris: widen Wa_14015946265 to Gfx11+
We missed out that ICL+ added a programming requiring a CS_STALL.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25426>
2023-09-27 19:56:24 +00:00
Connor Abbott
302907e347 tu: Expose VK_KHR_maintenance5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
b0f1cb8f31 freedreno/ci: Skip dEQP-VK.info.device_extensions
Copied from anv and radv.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
e7d4bc6095 tu: Add maintenance5 properties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
a86f2132b3 tu: Check for DEVICE_LOST in vkGetEventStatus()
Required by maintenance5.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
b14a8dc2a7 tu: Support VkPipelineCreateFlags2CreateInfoKHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
53dbfab87b tu: Use new buffer usage flags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
4fd12a18db tu: Implement vkGetRenderingAreaGranularityKHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
2fb42fbd42 tu: Implement vkGetImageSubresourceLayout2KHR and vkGetDeviceImageSubresourceLayoutKHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
53e518bcda tu: Implement vkCmdBindIndexBuffer2KHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
26a88fc062 tu: Allow VK_WHOLE_SIZE in tu_CmdBindVertexBuffers2EXT pSizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
9669b48b4a tu/clear_blit: Allow VK_REMAINING_ARRAY_LAYERS as layerCount
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
b9f673e9d4 tu/clear_blit: Fix staging image view layer count
This seems to be a mistake that didn't affect anything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
c2c39a47a6 freedreno/fdl: Support PIPE_FORMAT_R5G5B5A1_UNORM on a6xx
This is just a different swap of the same format.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
dd99b58aa8 tu: Support clearing A8_UNORM
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
60b1b18eb9 freedreno/fdl: Use A8_UNORM HW format for sampling
We've already been using this for 3d blits on turnip and it works fine.
There's no need to emulate it, and it won't work on turnip where we
can't swizzle the border colors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Connor Abbott
08581e2e92 zink: Rework color clamping and conversion
Before this commit, zink_format_clamp_channel_color() ignored the format
swizzle, so it was assuming that for emulated formats like alpha,
alpha-luminance etc. that the color had already been swizzled to match
the internal format rather than the emulated one. It's somewhat confusing
that passing in e.g. A8_UNORM actually means R8_UNORM, and led to a bug
when using VK_FORMAT_A8_UNORM for texture border colors because we
didn't swizzle it back. It also wouldn't have worked for media formats
like R10X6G10X6 due to the void channel in the middle.

In order to fix this, we need to untangle the mess in its users.

For convert_color() used when clearing, this means we now need to clamp
and then swizzle instead of swizzle and then clamp, and we can drop the
hack for A8_UNORM.

For texture border colors, the state tracker duplicates colors for the
emulated formats to help drivers, which zink was previously relying on,
but fixing zink_format_clamp_channel_color() breaks this because it
assumes that those duplicated colors are useless and clamps them.
However, because we know the format we can just swizzle the border color
ourself, which convert_color() was already doing. So, we pull that out
into a common zink_convert_color() function that handles both clamping
and format emulation, and have both clearing and border color handling
use it.

This fixes A8_UNORM in turnip+zink once we enable it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25001>
2023-09-27 19:07:22 +00:00
Erico Nunes
e3e64e3dbe v3dv: allow headless device without display device
When trying to create a headless Vulkan instance without a display
device available, device enumeration would fail.
Part of the physical device creation code already accounts for a missing
display device, allow device enumeration to continue in that case too so
headless instances can be created.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25313>
2023-09-27 18:46:31 +00:00
Matt Coster
22bca4a14f pvr: Force compile error on GNU void pointer arithmetic
This GNU extension caused a bug where a void pointer was modified then
interpreted as uint32_t* (instead of the other way round). Force a
compile error to (hopefully) prevent this from happening again.

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/25327>
2023-09-27 15:25:32 +00:00
Matt Coster
140b3e1f8f pvr: Don't rely on GNU void pointer arithmetic
Besides being not standard C, one instance (in pvr_cmd_buffer.c) was a
bug caused by adding-then-casting, which would likely have been caught
if void pointer arithmetic were not allowed.

All instances detected by -Wpointer-arith have been fixed here.

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/25327>
2023-09-27 15:25:32 +00:00
Georg Lehmann
b91616e800 aco: implement 64bit div find_lsb
This can be selected for divergent subgroupBallotFindLSB.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25407>
2023-09-27 14:47:42 +00:00
Georg Lehmann
4ea611bca0 aco: fix p_extract with v1 dst and s1 operand
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: f14023666c ("aco: Allow p_extract to have different definition and operand sizes.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25403>
2023-09-27 14:12:29 +00:00
Rhys Perry
ae9a476c42 aco/waitcnt: add print helpers
These may be useful in the future.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25373>
2023-09-27 13:43:11 +00:00
Rhys Perry
0d0a8c4365 aco/waitcnt: replace wait_cnt::*_cnt with booleans
Previously, a loop could be revisited until a counter reaches it's
maximum:
loop {
   store()
}
Each visit of that loop would increase vs_cnt until it reaches max.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25373>
2023-09-27 13:43:11 +00:00
Karol Herbst
0288cb0a0c zink: lower vec8/16
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25330>
2023-09-27 11:54:13 +00:00
Karol Herbst
807ff7ed01 nir: add nir_lower_alu_vec8_16_srcs pass
This pass is useful for vector based backends as we might end up with alu
instructions referencing vec8/vec16 values even though being vec4 or
smaller themselves.

This new pass intents to clean up any use of vec8/vec16 sources other
passes won't.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25330>
2023-09-27 11:54:13 +00:00
Jose Maria Casanova Crespo
284ab9af99 vc4: Fix mask RGBA validation at YUV blit
Solves regression on video players using GPU for
video decoding that just displays the video in green.

Fixes: d13da7782c ("vc4: call blit paths in chain")
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25412>
2023-09-27 12:14:01 +02:00
Eric Engestrom
632792eca0 ci/docs: drop extra overwritten rules
Every job re-defines its own rules, so there is no point in including these here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25307>
2023-09-27 10:05:37 +01:00
Tapani Pälli
09cbced0a3 iris: use intel_needs_workaround for Wa_14014414195 part 2
Commit 3ec953ed75 left couple of extra things, these changes are
based on a patch from Francisco Jerez.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25306>
2023-09-27 06:57:26 +00:00
Caio Oliveira
c487ba26ca intel/compiler: Don't store stage name and abbrev
Those are used in the failure paths and are easily retriavable from the
stage itself, so no need to store them.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25367>
2023-09-26 18:12:53 -07:00
Dave Airlie
8791aab20f llvmpipe: reset viewport_index_slot in fb bind
I hit a problem running a set of lvp caselists with
dEQP-VK.transform_feedback.simple.draw_indirect_endqueryindexed_streamid_0_16,Crash

This was crashing due to
 assert(setup->viewport_index_slot < 0);
in try_update_scene_state

This was because a previous draw had set viewport index slot to 2,
but a clear then draw sequence never resets it, so the clear gets
a scene, and when the subsequent flush happens for that scene,
the viewport_index_slot is never updated. It only gets updated on
draws.

This just resets it as lp_setup_update_state will always pick up
the correct one for the next draw.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25387>
2023-09-27 08:25:28 +10:00
Karol Herbst
5b233d5184 rusticl/mesa/context: fix clear_sampler_views
Even though drivers are required by documentation to handle the samplers
being NULL, st/mesa changed enough so it always sets the pointer.

As being similiar to st/mesa is more important than following docs, we
simply mimic st/mesa here and meet the expectations of drivers.

In the future we want to track the set state similiar to st/mesa, so
`clear_sampler_views` will probably go away and we'll just update what
we'll need.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25363>
2023-09-26 21:57:44 +00:00
Charmaine Lee
25c771a778 svga: sync resource content from backing resource before image upload
When a backing resource is created for a render target view when the
same resource is currently bound to a shader resource view, the content
update back to the original resource happens when the associated render
target view is unbound. But state update only happens at clear or draw
time. So if TexSubImage happens after BindFrameBuffer and before Draw,
the original texture resource that is mapped to for subimage update
would not have been updated. As a matter of fact at the subsequent state
update at the next draw, the render target views will be updated, the
content from the previous backing resource will be propogated to the
original resource, hence overwriting the changes from the last TexSubImage.

To fix the problem, this patch validates the texture resource, updates
any pending changes from the backing resource before transfer map upload
occurs.

Fixes the rendering issue demonstrated from the fbo_texsubimage_update trace

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25386>
2023-09-26 21:38:01 +00:00
Italo Nicola
83c76cceaf panfrost: advertise YUV formats for valhall
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24479>
2023-09-26 21:13:51 +00:00
Italo Nicola
3db786c006 panfrost: use centered YUV chroma siting
This is likely a more reasonable default than co-sited samples, and will be
needed for valhall.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24479>
2023-09-26 21:13:51 +00:00
Italo Nicola
144f9324a3 panfrost: prepare v9+ to support YUV sampling
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24479>
2023-09-26 21:13:51 +00:00
Italo Nicola
9d7ca56115 panfrost: rename _needs_multiplanar_descriptor to _is_yuv
This is only really used to condition on YUV formats, even on v7, but
moreso now on v9+.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24479>
2023-09-26 21:13:50 +00:00
Italo Nicola
b134a4fa43 pan/genxml: add Width/Height fields to v9+ Plane descriptor
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24479>
2023-09-26 21:13:50 +00:00
Dave Airlie
3e6938696a llvmpipe/fs: fix regression in sample mask handling from tgsi removal.
This got the bits the wrong way,
dEQP-VK.rasterization.frag_side_effects.color_at_beginning.sample_mask_after

Fixes: a63c2daf7a ("llvmpipe/fs: start using nir info in some places.")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25396>
2023-09-26 20:15:22 +00:00
Konrad Dybcio
b1e851d66c freedreno: Add Adreno 643
Just another funny speedbin of A635

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25408>
2023-09-26 19:18:12 +00:00
Konrad Dybcio
b4d111ab6c freedreno: Include speedbin fallback in 690 chipid to fix probing
The kernel exposes CHIP_ID, which consists of:

[63:48] const 0 / reserved
[47:32] speedbin (default 0xffff)
[31:0 ] actual gpu chip ID

Fix the 690 chip id to make it probe correctly.
Keep the existing entry for the downstream KGSL driver.

This is essentially the same as Commit 6067aba9e6 ("freedreno: Include
speedbin fallback in 740 chipid to fix probing"), except for the older
core.

Fixes: 210c6c11cc ("freedreno+tu: Add a690 support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25408>
2023-09-26 19:18:12 +00:00
Eric Engestrom
79bc5ff6f8 docs/meson: drop mention that our meson is ready
It's been ready for a very long time, and scons & autotools are long
gone with only meson left, so this note doesn't make much sense anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25323>
2023-09-26 19:01:15 +00:00
Eric Engestrom
9618fefd18 ci: unify container and build jobs rules
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25294>
2023-09-26 18:06:23 +00:00
Lina Versace
15fcfbe046 intel/pci_ids: Consistently use lowercase
The pci ids used a mixture of uppercase and lowercase, even in the same
file. The inconsistency introduces unnecessary complexity in regular
expressions.

Diff made in vim with `%s/\v(CHIPSET\()([^,]+)/\1\L\2\E/`.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>`
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25257>
2023-09-26 15:47:25 +00:00
Karol Herbst
2a90ee1693 meson/rusticl: add sha1_h
This ensures this file is generated.

Fixes: 20c90fed5a ("rusticl: added")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25400>
2023-09-26 15:16:33 +00:00
Martin Roukala (né Peres)
07e3eb061a radv/ci/vkcts-navi10: catch all the line-related flakes
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25395>
2023-09-26 13:39:52 +00:00
Martin Roukala (né Peres)
31f852048c radv/ci/vkcts-navi21: document more flakes
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25395>
2023-09-26 13:39:52 +00:00
Martin Roukala (né Peres)
593666182a radv/ci/vkcts-navi21: catch all the line_stipple_(enable|params) flakes
There are so many of these tests, so let's just write a regular
expression to catch them all.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25395>
2023-09-26 13:39:52 +00:00
David Rosca
f7083ae94b gallium/auxiliary/vl: Only map the shader constants buffer in render
Don't map the buffer in vl_compositor_set_csc_matrix.
This avoids mapping the buffer twice with compute shaders.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25258>
2023-09-26 13:03:46 +00:00
David Rosca
40487b8e14 gallium/auxiliary/vl: Fix YUV to RGB bob compute shader deinterlacing
This reverts commit ef0d92459c and instead removes the y coordinate
divide by two in weave shaders. The scale ratio now works correctly
with interlaced input.

Also remove the YUV to YUV bob shader and reuse the progressive shader
for bob deinterlacing, same as in YUV to RGB case (video_buffer shader).

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25258>
2023-09-26 13:03:46 +00:00
David Rosca
09578e141c gallium/auxiliary/vl: Use chroma offset in YUV to RGB weave compute shader
Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25258>
2023-09-26 13:03:46 +00:00
David Rosca
d3d577b768 gallium/auxiliary/vl: Add RGB to YUV compute shader
Compared to fragment shader that was being used before, it supports
chroma location and fixes wrong color at right/bottom edge when scaling.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25258>
2023-09-26 13:03:45 +00:00
Corentin Noël
0456f5bad1 mesa: Ensure that the baselevel will never exceed the maximal supported number
GL_TEXTURE_BASE_LEVEL is only supported up to MAX_TEXTURE_LEVELS

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25332>
2023-09-26 08:24:04 +00:00
Samuel Pitoiset
7e00ec1c6f radv: declare shader_query_state for mesh/task shaders
This will control whether mesh/task queries is enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:16 +00:00
Samuel Pitoiset
fae4360a08 radv: enable lowering of mesh/task shader queries when enabled
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:16 +00:00
Samuel Pitoiset
918a57579f radv: adjust lowering of intrinsic queries for mesh/task shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:16 +00:00
Samuel Pitoiset
8ea9680890 radv: add GDS counters offset for mesh/task queries
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:16 +00:00
Samuel Pitoiset
9a3b902cac ac/nir: add lowering for task shader queries
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:15 +00:00
Samuel Pitoiset
57dec0678e ac/nir: add lowering for mesh shader queries
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:15 +00:00
Samuel Pitoiset
1ce80653b2 nir: rename atomic_add_gs_invocation_count_amd to make it more generic
It will be re-used to implement mesh/tash shader invocations queries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25331>
2023-09-26 07:50:15 +00:00
Kenneth Graunke
1c1aa579ff mesa: Fix zeroing of new ParameterValues array entries when growing
On non-Windows OSes, align_realloc is the os_realloc_aligned() from
src/util/os_memory_aligned.h, which doesn't use realloc internally.
Instead, it uses os_malloc_aligned() and memcpy's over the old data,
which is why it needs an "old size" (unlike normal realloc).

In _mesa_reserve_parameter_storage, the call to align_realloc above
passes (oldValNum * sizeof(gl_constant_value)) as the old size, which
is all the actual data.  The actual allocation size of the array may
be larger (in fact, we allocate 16 extra components), which is tracked
in SizeValues.  After realloc, we memset to zero starting at the old
allocation size, to the new allocation size.

This would work if it were a real realloc.  However, because we actually
malloc + memcpy and only copy the previous /data/, not the allocated
size, and then memset from the old /allocated size/, our new copy will
have the spaces between the old data and the old allocation size neither
copied nor memset, leaving them as uninitialized garbage memory.

These values then get written to the shader cache, meaning that if you
compile the same shader multiple times, you may get different shader
cache entries.  This is bad for reproducible, deterministic compiles.

While at it, we also memset to zero in _mesa_add_parameter, as this
looks like another place where memset-to-zero is missing.

To reproduce this error, one can run shader-db:

$ MESA_SHADER_CACHE_DIR=a ./run -b shaders/godot3.4/49-28.shader_test
$ MESA_SHADER_CACHE_DIR=b ./run -b shaders/godot3.4/49-28.shader_test

and see an occasional difference in the end of the ParameterValues
array, where there's a padding gap between the last two elements that
was never zero-initialized.

Thanks to Mark Janes for discovering this and tracking it down together!

Cc: mesa-stable
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25316>
2023-09-25 23:26:41 -07:00
Marek Olšák
f79617fe80 amd/llvm: fix build with LLVM 18
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25388>
2023-09-26 05:45:17 +00:00
Marek Olšák
6060b656f8 gallivm: fix build with LLVM 18
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25388>
2023-09-26 05:45:17 +00:00
Faith Ekstrand
ebf9d6d9c3 nvk: Don't store the descriptor pool BO in the set
Instead, store an address, size, and mapped pointer.  This is more
consistent with how things like images work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:27 +00:00
Faith Ekstrand
8a1602f187 nvk/drm: Split exec as needed for large command buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:27 +00:00
Faith Ekstrand
15235af629 nvk/drm: Restructure nvk_queue_submit_drm_nouveau()
Now that we don't need the lock, we can return directly.  Also, now that
we don't have the old UAPI, we can clean things up and make the whole
function make a bit more sense.  Also, drop some pointless braces while
we're just moving code around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:27 +00:00
Faith Ekstrand
d17db521f7 nvk: Get rid of the tiled memory allocation helpers
These existed entirely to support shadow memory for VkImage cases where
we needed tiling.  Now that we have VM_BIND, these are no longer used so
we can drop the wrappers and just implement VkAllocate/FreeMemory again.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:27 +00:00
Faith Ekstrand
39bb73b21f nvk: Drop the device-level mutex
This existed to let us lock the memory_objects list and for handling
BO-based vk_sync waits.  We don't have either of these things anymore so
there's no need for a device-level lock.  We already have fine-grained
locks around the data structures that need them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:27 +00:00
Faith Ekstrand
b4364f5762 nvk: Drop memory object tracking
We no longer have to pass a list of BOs to the kernel so there's no need
to track allocated memory objects like this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:26 +00:00
Faith Ekstrand
c2e185e5f8 nvk: Drop command buffer BO tracking
We no longer need to provide this information to the kernel so there's
no reason to track it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:26 +00:00
Faith Ekstrand
6cfac35554 nvk/drm: Drop the push_add_bo() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:26 +00:00
Faith Ekstrand
f925128f98 nvk/drm: Drop the push_add_push_bo() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:26 +00:00
Faith Ekstrand
6af617095b nvk: Rip out old UAPI support
This was mostly generated by

    unifdef -DNVK_NEW_UAPI=1 -m src/nouveau/**/*.h

with a few manual fixups for device features and to remove includes and
strip out the meson bits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25357>
2023-09-26 05:05:26 +00:00
Tapani Pälli
31883b1f5e anv: fix a leak of fp64_nir shader
Fixes: 8c4c4c3ee1 ("anv: Add softtp64 workaround")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9846
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25372>
2023-09-26 03:24:42 +00:00
Caio Oliveira
d27b135b3a util: Fix bookkeeping of linear node sizes
When creating a new node, we were clobbering the original size
requested, and use that as offset, so the node would always be full.

Fixes: 591db9a9a5 ("util: Remove per-buffer header in linear alloc for release mode")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25382>
2023-09-26 02:53:27 +00:00
Dave Airlie
6d00c2f78c draw/mesh: reset some user state values on mesh draws.
Otherwise previous non-mesh draws and can leave things dirty.

Fixes crashes in:
dEQP-VK.mesh_shader.ext.query.all_queries.triangles.reset_before.copy.no_wait.indirect_draw.32bit.no_availability.no_blocks.task_mesh.inside_rp.single_view.with_secondary
after other shaders have run.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25385>
2023-09-26 01:45:23 +00:00
Hyunjun Ko
a38cb1f597 anv: don't use cmd_buffer after destroyed.
Fixes: 13b3d7f74 ("anv: Handle companion RCS in end/destory/reset code path")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25366>
2023-09-26 00:01:40 +00:00
Charmaine Lee
c761d408ed svga: use srv raw buffer for accessing readonly shader buffer
When a surface is to be created for a buffer that is to be persistently mapped,
set the UAV bind flag as well, otherwise, an extra copy of the surface will have
to be created when the buffer is later bound as shader storage buffer, and
it will then incur extra buffer copies to keep the shadow copies of the surface
in sync. But when a buffer is simultanously bound to uniform buffer and shader
storage buffer, having both srv and uav on the same resource can also be costly.
This patch also provides optimization for readonly shader buffer. In this case,
instead of creating uav for accessing a readonly shader buffer, srv
raw buffer is used instead.

Tested with yuzu tracefile included in VMware bug 3029385.

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Charmaine Lee
2f6497c50a svga: fix immediates used in rawbuf for constant buffer
Since constant buffers can be accessed as raw buffers, indices to
the constant buffers will have to be declared as immediates.
But it is a waste to define immediates for every possible indices
to the constant buffer, we will only include immediates that are used in
the shader. But since immediate block is declared in a very early stage
of a shader, this patch will append any new immediates to the immediate
list and reemit the immediate block if needed.

Fixes assertion running yuzu

Reviewed-by: Maaz Mombasawalam <mombasawalam@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Charmaine Lee
d6b9a0a997 svga: restrict use of rawbuf for constant buffer access to GL43 device
Restrict use of rawbuf for constant buffer access to GL43 capable
device only.

Fixes glretrace regressions running with SW Renderer.

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Charmaine Lee
b46526b7a4 svga: fix persistent mapped surface update to constant buffer
Currently when a buffer is mapped with the persistent bit set and is
later bound as a constant buffer, the updated buffer content is not
properly updated to the constant buffer surface as the constant buffer
surface is different from the original buffer surface. Doing
a buffer copy to sync the content of the constant buffer will fix
the problem, but the buffer copy can be costly.
To properly fix the issue, instead of creating a secondary surface
for the constant buffer, the original buffer surface will be accessed as
a raw buffer.

This fixes the rendering issue running yuzu deko_basic.nro

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25381>
2023-09-25 23:36:58 +00:00
Gert Wollny
4f96d2f6ba ci: Upref virglrenderer
Pull in the latest changes regarding texture wrapping
modes handling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25343>
2023-09-25 22:51:20 +00:00
Gert Wollny
9efe50c83b virgl: report MIRROR_CLAMP features better
The new host version checks the support of these features better,
so report here accordingly. This fixes a number of texwrap piglit
tests on Intel.

v2: Stick to old test for PIPE_CAP_TEXTURE_MIRROR_CLAMP because
    host has to be backward compatible.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25343>
2023-09-25 22:51:20 +00:00
Faith Ekstrand
733c07bba0 nvk: Advertise discreteQueuePriorities = 2
This is a lie since we don't do anything with queue priorities at
present but Vulkan requires us to advertise at least 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25383>
2023-09-25 22:06:26 +00:00
Faith Ekstrand
00b681058f nvk: Advertise maxMemoryAllocationCount = 4096
This is the minimum and also what the proprietary driver advertises.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25383>
2023-09-25 22:06:26 +00:00
Faith Ekstrand
59000decf4 nvk: Re-order physical device limits
They now match the order in vulkan_core.h which makes it easier to find
missing entries of which there was one.  This also fixes a bug where we
were setting .bufferImageGranularity twice and we were overwriting the
correct value with an incorrect one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25383>
2023-09-25 22:06:26 +00:00
Connor Abbott
f5b8b2f57a tu: Remove pipeline from state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
9efb0f3c7d tu: Don't use pipeline for active stages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
2cd93ea4a0 tu: Don't use pipeline for per_view_viewport
We already have the state in the command buffer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
630e60fae7 tu: Don't use pipeline for bandwidth validity
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
768b1eacc7 tu: Don't use pipeline for dynamic draw states
For dynamic states that are precompiled from static state, just set the
corresponding dynamic draw state directly, and keep a record of which
ones are precompiled when we go to emit states at draw time so we don't
accidentally re-emit them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
edce0af242 tu: Make compute dispatch use the shader
With this, the last use of the compute pipeline is gone. We still use
the pipeline for the load state, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:57 +00:00
Connor Abbott
2d00b2b9c7 tu: Don't reference pipeline for some draw states
These draw states are things that depend on pipeline-only state:

- The load state depends on knowing the pipeline layout, which we won't
  know for a shader that's loaded from a binary. This is going away on
  a7xx anyway, and we should be able to use the a7xx strategy of
  prefetching the descriptors in the preamble on a6xx too.
- The prim order state depends on feedback loops and raster order
  attachment access, which isn't supported at the moment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
1d74af8bb6 tu: Rewrite remaining pipeline LRZ handling
Now that the FS-specific parts are split out, the only remaining part is
the blend state part. Use the same state that we use for dynamic
blending for static blending, eliminating the last use of the pipeline
in the LRZ code. While we're at it fix a bug where dynamic blending
didn't always disable LRZ writes (even though it only mattered with a
non-conformant debug flag because we invalidated LRZ anyway).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
41797b9e94 tu: Use pipeline feedback loop flag indirectly
Remove another use of the pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
419c4b8ece tu: Decouple program state from the pipeline
There are a couple pieces of state that we can't calculate until we know
all of the shaders:

- The actual variants to use (i.e. whether to use safe-const variants)
- Program config and VPC draw states
- Const layout, which depends on the variants
- Whether per-view viewports should be enabled

Now that these are all combined in tu_pipeline::program, move these into
a separate struct that can be referenced directly without a pipeline.
The next step is to refactor the code filling it out so that it can be
called at draw time when given just the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
26352d26bf tu: Rework passing shared consts
The way this works now is awkward to map to shader objects. We don't
have the pipeline layout when "linking" shaders at draw time, so we have
to piece it together from the shaders. Store the information we need in
the shaders and piece it together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
efaf77bbdd tu: Rewrite tessellation modes handling
Before this, we combined the modes after compiling the shaders when
constructing the pipeline. But that's a bit awkward with shader objects,
where there is no good place to put state derived from TCS and TES but
not the other stages. However, shader objects leaves us with an out:
when compiling separately, the modes must be on one of the shaders. So
instead we just copy the modes earlier, in the NIR shaders, and then get
them from the appropriate shader later. That way there is no extra
overhead when fast-linking, as there currently is, and we don't need to
create an awkward separate object just for this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
169a44d562 tu: Use shader directly for VS/TCS output size and patch size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
8810c89b44 tu: Move FS-specific pipeline information to the shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
df007dcfe7 tu: Start tracking shaders independently of pipeline
We will gradually transition over users of cmd->state.pipeline and
TU_CMD_DIRTY_PIPELINE to shaders and derived state from shaders. This
just puts in place the framework to start doing that.

When importing a library with all of the shader state, we now have to
import the shaders in addition to the program, so that they are
available when we bind the pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Connor Abbott
0f022c3076 tu: Create singleton "empty" shaders
The most important of these is the empty FS, which should cut down on
time spent in the compiler when we fast-link a pipeline where there is
only a library with the VS and no library with the empty FS. Source
engine is known to do this.

This is also necessary for shader objects where the "empty" shaders are
never created up-front. We will use these when a NULL shader is bound.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>
2023-09-25 19:03:56 +00:00
Caio Oliveira
1020cf8a82 util: Add a few basic tests for linear_alloc
Not comprehensive, but those were the ones used to work on the
previous linear_alloc changes.  Also having a test already
set up lower the barrier to add more tests for future in case of
bugs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
591db9a9a5 util: Remove per-buffer header in linear alloc for release mode
There's only need to keep the offset and size of the latest buffer,
so rename linear_header into linear_ctx and change the code to
keep records there.

For debug mode we still keep a header, now called linear_node_canary,
to have a magic check.  Since due to alignment we have a free space,
also keep the individual occupation of each node (offset), for
debugging.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
c415da3dfc util: Remove size information from child allocations
With linear_realloc() gone, there's no code that reads the size
in linear_size_chunk struct, so it can be removed.  This removes
the 8-byte overhead per child allocation and simplifies the
allocation code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
8fc130783b util: Remove linear_realloc()
Now that linear_realloc() is unused, remove it.  It is not an actual
realloc, will always allocate new memory and copy data around -- and
had a big warning about it in the documentation.

In the couple of uses we had before, the client code knew the size,
so it could be changed to perform the allocation and the copy by
themselves.  The client code keeping the size is the recommended
way here.

This will allow us remove linear_size_chunk later.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
1486742b26 util: Remove usages of linear_realloc()
Note that for linear allocator, the realloc will always
allocate new memory.  In both cases that realloc was used,
the existing size was known, so we can just allocate
and do the copy ourselves.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
63ab985511 util: Use an opaque type for linear context
In the linear allocation only the parent (context) can be used
to allocate new children, so let's use an opaque type to identify
the linear context.  This is similar to what's done in GC allocator.

Update the documentation and a couple of function names to
refer to linear context instead of linear parent.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
b269cadf56 util: Make DECLARE_LINEAR_ALLOC_* macros assume no destructors
Linear allocator doesn't support calling custom destructors to
its child allocations nor freeing individual child allocations.
So the destructor callback and the delete operator don't apply
to objects using linear allocator.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
aec516ead6 util: Remove size from linear_parent creation
None of the callsites took advantage of this, so remove
the feature.  This will help to a next change that will
add an opaque type to represent a linear parent.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
4519421db5 util: Use linear parent to (r)allocated extra nodes
Instead of making all the nodes children of the same original
ralloc_ctx, use that context just for the first node (which
is the linear parent).  The remaining nodes are (r)allocated
using the first one.

With that change, to free/steal, it is sufficient to apply the
operation to the first node, which uses the underlying linked
list between the nodes at ralloc level.  And we can remove
the 'next' pointer in linear_header, now unused.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Caio Oliveira
6764689e0e util: Remove ralloc_parent from linear_header
We can reach the ralloc parent from the linear parent, since
it is what was used to allocate the linear parent in the first
place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25280>
2023-09-25 17:26:17 +00:00
Samuel Pitoiset
53d9312a5b radv/ci: skip dEQP-VK.robustness.* on Vangogh due to weird GPU hangs
For very weird reasons, this subset hangs on VanGogh only. It took a
while to figure out that and I can't reproduce on my Steam Deck. Skip
the whole subset for now until the issue is figured out to avoid
blocking the CTS update.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24947>
2023-09-25 15:53:51 +00:00
Samuel Pitoiset
a217c5c58c ci: update to vulkan-cts-1.3.6.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24947>
2023-09-25 15:53:51 +00:00
Konrad Dybcio
f4fecdad72 freedreno: Include speedbin fallback in 730 chipid to fix probing
The kernel exposes CHIP_ID, which consists of:

[63:48] const 0 / reserved
[47:32] speedbin (default 0xffff)
[31:0 ] actual gpu chip ID

Fix the 730 chip id to make it probe correctly.
Keep the existing entry for the downstream KGSL driver.

This is essentially the same as Commit 6067aba9e6 ("freedreno: Include
speedbin fallback in 740 chipid to fix probing"), except for the older
core.

Fixes: cd3719be7d ("freedreno: Fully define a730 and a740 device properties")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25375>
2023-09-25 15:00:58 +00:00
Rhys Perry
21db2e7017 aco: reset prefetch in the correct block after removing the exit
fossil-db (navi31):
Totals from 279 (0.35% of 79332) affected shaders:
(no stat changes)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: c778803d67 ("aco/assembler: change prefetch mode on GFX10.3+ during loops if beneficial")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25312>
2023-09-25 14:18:46 +00:00
Lionel Landwerlin
1c21b3a62a intel/ds: avoid dropping traces when running out of shared memory
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
00b65c75ad anv/utrace: trace CPU on timestamp buffer readiness
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
7d30b1e28f intel/ds: track number of tracepoint timestamp copies
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
64769bc5b2 util/u_trace: count number of tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
a5f58e5f85 intel/ds: lock submissions to u_trace_context
This allows for submissions to be outside the global anv_device mutex.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
a851dc5e3c intel: don't assume Linux minor dev node
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
6857497be6 anv: enable utrace timestamp buffer copies on compute engine
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
a334fb005b anv: move utrace flush out of backends
The next patch is going to introduce some locking that needs to happen
before the submission to the backend.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
08e0c063cf anv: move simple shaders code to its own object
We would like to call those function from anv_utrace.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
7a35113455 anv: add simple shader support without a command buffer
Limited to compute for now. Annoyingly Gfx9 requires a binding table
block.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
2cc5b3b1e0 anv: add a memcpy compute internal kernel
We'll use this memcpy utrace timestamp data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
Lionel Landwerlin
e0f420c334 anv: fix utrace timestamp buffer copies
Fixes: 521c216efc ("anv: use COMPUTE_WALKER post sync field to track compute work")
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24744>
2023-09-25 13:05:45 +00:00
David Rosca
dd2ef9a0e4 frontends/va: Set default rate control values once when creating encoder
Move setting the default values from getEncParamPresetH264/5 as this
function is called on each frame which would result in overwriting
values set by application.

This fixes setting HRD parameters and max_qp/min_qp when
PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL is not supported.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25355>
2023-09-25 12:21:59 +00:00
David Rosca
c970a9b663 frontends/va: Process VAEncSequenceParameterBufferType first in vaRenderPicture
The encoder is created in handleVAEncSequenceParameterBufferType and it
also sets some default parameters, so we need to make sure to handle
this buffer first because application may have already set those
parameters from earlier buffers.

This fixes setting HRD parameters with gstreamer vah264enc/vah265enc
when PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL is supported.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25355>
2023-09-25 12:21:59 +00:00
Eric Engestrom
49e471de70 docs: add calendar for 23.3
Normally the branchpoint would have been on Oct 11, but this is the week
before XDC and everyone will be busy so let's try not to add the
branchpoint pressure on top. Let's instead branch off on the week
_after_ XDC, on Oct 25.

Besides, 23.2 has been delayed by multiple factors, so it wouldn't make
sense to rush 23.3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25122>
2023-09-25 11:49:10 +00:00
Martin Roukala (né Peres)
cf3fb0fee7 radv/ci: add more tests to the navi21 vkcts flake list
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25325>
2023-09-25 11:27:31 +00:00
Martin Roukala (né Peres)
0a065b5cf5 radv/ci: increase the parallelism of the vkcts-navi21 job
The vkcts-navi21 job currently take ~13 minutes each, but we are about
to start running the VK_EXT_shader_object tests which should
significantly increase our runtime and thus would exceed the 15 minutes.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25325>
2023-09-25 11:27:31 +00:00
Juan A. Suarez Romero
bf32199386 v3d/shim: include new ioctl parameters
Some new parameters added recently were missed in the DRM shim.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9880
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25370>
2023-09-25 10:47:58 +00:00
Samuel Pitoiset
219a14d093 radv: enable cache counters for RGP on GFX11
This was the last missing RGP feature on GFX11 compared to older chips.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271>
2023-09-25 09:05:58 +02:00
Samuel Pitoiset
70a4290e28 radv: add SPM support for GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271>
2023-09-25 09:05:58 +02:00
Samuel Pitoiset
301c402bd8 ac/spm: add support for GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271>
2023-09-25 09:05:58 +02:00
Samuel Pitoiset
26c710b7c4 ac/spm: add new segment types for GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271>
2023-09-25 08:34:31 +02:00
Samuel Pitoiset
97d87a431a ac/gpu_info: define AMD_MAX_WGP
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25271>
2023-09-25 08:34:31 +02:00
Dave Airlie
129e27a46e llvmpipe/linear: move to nir inputs
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 13:23:07 +10:00
Dave Airlie
90c4468ed0 llvmpipe/linear: convert to using nir for output.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 13:23:07 +10:00
Dave Airlie
8477b97f1b llvmpipe/fs: start converting dervied state to nir based.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 13:23:07 +10:00
Dave Airlie
b72e77bd97 llvmpipe/fs: start converting interp/input paths to nir.
This input_usage_mask is going to take a bit more thinking

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 13:23:07 +10:00
Dave Airlie
2b09d2d715 llvmpipe/nir: call gather info to update inputs read properly
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 12:06:39 +10:00
Dave Airlie
5827034dfc gallivm: drop tgsi aos paths.
These were only used by the linear code, and that doesn't use
tgsi anymore

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 12:06:37 +10:00
Dave Airlie
e9a41875da llvmpipe/linear: drop tgsi path.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24436>
2023-09-25 12:05:50 +10:00
David Heidelberg
1f3446499f ci/freedreno: disable broke cheza (Adreno 630) runners
Revert ASAP as `google-freedreno-cheza` gets running again.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25365>
2023-09-25 02:04:28 +05:30
Gert Wollny
a57cc0ae0c r600/sfn: Fix use of scheduled_shader vs shader
Thanks to Vitaliy Kuzmin for pointing this out.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25364>
2023-09-24 19:52:36 +02:00
Gert Wollny
34a068de6f r600/sfn: sort the uniforms of the right shader
Thanks to Vitaly Kuzmin for pointing this out.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25364>
2023-09-24 19:52:36 +02:00
Faith Ekstrand
c04f313cc5 r600: Use nir_builder helpers for load/store_shared_r600
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24762>
2023-09-24 17:30:03 +00:00
Faith Ekstrand
28137a187b r600: Use more auto-generated nir_builder helpers
Use nir_umad24 instead of rolling our own.  Also, all system values
already have NIR builder helpers and we don't need to be manually
building intrinsics or rolling our own helpers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24762>
2023-09-24 17:30:03 +00:00
Karmjit Mahil
feafb8a256 pvr: Fix dynamic desc offset storage
The index at which the dynamic descriptor offsets were being
stored was incorrect, leading to some offsets not being stored and
thus `0` being applied as the offset to the descriptors instead.

dEQP test fixed:
  dEQP-VK.binding_model.shader_access.{primary,secondary}_cmd_buf
    .uniform_buffer_dynamic
    .{vertex,fragment,compute,vertex_fragment}
    .multiple_discontiguous_descriptor_sets
    .*_descriptor.offset_view_{,non}zero_dynamic_nonzero

Fixes: aa791961a8 ("pvr: Add support for dynamic buffers descriptors")
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25320>
2023-09-24 14:00:57 +00:00
Karmjit Mahil
bf17e4fe33 pvr: Fix for loop itarator usage
The `i` iteration variable was being used instead of `k` when
appending new mappings, and getting the current source rect.

dEQP test fixed:
  dEQP-VK.pipeline.monolithic.image.suballocation.sampling_type
    .combined.view_type.3d.format.*.count_1.
    .{3x3x3,5x5x5,...(odd dimensions)}

Fixes: 060c3db4ef ("pvr: Complete pvr_generate_custom_mapping()")

Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25321>
2023-09-24 13:44:19 +00:00
Faith Ekstrand
47b481cace nvk: Set GUARDBAND_Z_SCALE_1 when Z-clipping
This fixes most of the remaining dEQP-VK.*.inverted_depth_range.* tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25359>
2023-09-23 13:01:52 -05:00
Faith Ekstrand
d7f3fdc262 nvk: Enable dynamic clip/clamp enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25356>
2023-09-23 14:58:22 +00:00
Faith Ekstrand
07091f0f94 nvk: Fix depth clipping parameters
This is a pretty complete overhaul which I think may actually be correct
and there are now comments explaining why various parameters were
chosen.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25356>
2023-09-23 14:58:22 +00:00
Faith Ekstrand
e317ba373b nvk: Clean up viewport math
This should make everything a bit easier to read

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25356>
2023-09-23 14:58:22 +00:00
David Heidelberg
17dfbc25d2 iris: do not mention specifically clover for OpenCL support
It's confusing, when rusticl is used.

Acked-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25287>
2023-09-23 05:04:29 +00:00
David Heidelberg
a4e4bf8ccd ci/venus: add fragment.32B_in_memory_with_vec4_s32 flake
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25349>
2023-09-23 04:44:37 +00:00
Felix DeGrood
b9c9fb7259 anv: fix frame count reporting in INTEL_MEASURE
Report frame count at CB submit time, instead of CB build time.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25235>
2023-09-22 22:41:53 +00:00
Faith Ekstrand
6f85e6b06b nvk: Disable statistics around meta ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25353>
2023-09-22 21:23:11 +00:00
Faith Ekstrand
169835da39 nvk: Lower interp_at_sample to interp_at_offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25353>
2023-09-22 21:23:10 +00:00
Frank Binns
53ed2ff742 pvr: remove pvr_pbe_get_src_pos()
This should have been removed as part of f59c6eef16 ("pvr: Move PBE START_POS
into csb enum helpers header").

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25328>
2023-09-22 21:03:43 +00:00
Frank Binns
6619802446 pvr: treat VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT as not supported
The required compiler support is missing for mutable format support, so return a
not supported error from vkGetPhysicalDeviceImageFormatProperties2() when the
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag is set in the image format info
structure.

This results in the dEQP-VK.image.mutable.* conformance tests being treated as
Not Supported.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25241>
2023-09-22 20:47:17 +00:00
Mike Blumenkrantz
865bdc3da2 lavapipe: set default min sample shading to 1
this should only affect shobj handling and even then probably no effect

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25354>
2023-09-22 20:03:06 +00:00
Mike Blumenkrantz
a2a848cb19 lavapipe: set default viewport and scissor count for cmdbufs
this otherwise breaks shobj tests

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25354>
2023-09-22 20:03:05 +00:00
Mike Blumenkrantz
0d975219ad lavapipe: more vertex stride fixups
for handling cases where bind2 and dynamic vi are used interchangeably

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25354>
2023-09-22 20:03:05 +00:00
Mike Blumenkrantz
94debd4b4c lavapipe: always set independent blend
no functional changes, but this is just how vulkan works

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25354>
2023-09-22 20:03:05 +00:00
Mike Blumenkrantz
74ac66c275 lavapipe: fix variable descriptor count support handling
if no variable counts are present this must be zero, otherwise yolo

fixes:
dEQP-VK.api.maintenance3_check.support_count_combined_image_sampler_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_combined_image_sampler_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_inline_uniform_block_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_input_attachment_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_input_attachment_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_sampled_image_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_sampled_image_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_sampler_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_sampler_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_buffer_dynamic_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_buffer_dynamic_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_buffer_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_buffer_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_image_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_image_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_texel_buffer_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_storage_texel_buffer_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_uniform_buffer_dynamic_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_uniform_buffer_dynamic_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_uniform_buffer_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_uniform_buffer_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_uniform_texel_buffer_extra_bindings_no_variable_size
dEQP-VK.api.maintenance3_check.support_count_uniform_texel_buffer_no_variable_size

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25354>
2023-09-22 20:03:05 +00:00
Mike Blumenkrantz
207b37bfd9 zink: always trace_screen_unwrap in acquire
it's possible for acquire to be called from the frontend, in which
case the screen will still be trace-wrapped

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25288>
2023-09-22 19:34:21 +00:00
Mike Blumenkrantz
aaabb5b0f2 zink: avoid UAF on wayland async present with to-be-retired swapchain
wayland surfaces are likely to become unlinked in WSI implementations upon
retiring a swapchain, requiring the pending present to complete
in order to avoid invalid access

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25288>
2023-09-22 19:34:21 +00:00
Mike Blumenkrantz
2b7b1059e4 zink: move swapchain fence to swapchain object
this is more accurate in terms of usage/ownership and avoids potential
illegal fence usage in the scenario where multiple async presents are
in flight

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25288>
2023-09-22 19:34:21 +00:00
Rob Clark
e24a710c1e freedreno/decode: Remove gpu_id
Now unused.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25333>
2023-09-22 19:17:14 +00:00
Rob Clark
066f80e31c freedreno/decode: Use info->chip to decode
Use the chip generation in cases where decoding is generation specific,
rather than range testing gpu_id.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9310
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25333>
2023-09-22 19:17:14 +00:00
Rob Clark
ebdac80b0d freedreno/decode: Lookup device info
First step for migration to chip_id.  With newer devices we won't be
able to decode the chip_id in any meaningful way, ie. it is just a
number.  But we can use the device table to figure out things like
generation which are needed to properly decode cmdstream, etc.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25333>
2023-09-22 19:17:14 +00:00
Caio Oliveira
ae99a3d76c util: Add more PRINTFLIKE and MALLOCLIKE annotations
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25230>
2023-09-22 10:47:33 -07:00
Caio Oliveira
931253b45d microsoft/compiler: Fix printf formatting string issues
Found when adding PRINTFLIKE macro to util functions.

Suggested-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25230>
2023-09-22 10:47:33 -07:00
Caio Oliveira
1cdc4be14b intel/compiler: Don't allocate memory for SIMD select error handling
The position in the error array already indicate the SIMD in question,
so take off all the formatted printing from the errors -- which in some
cases were just not needed.  We lose a little bit of extra context but
it is all easily derivable from the message and the SIMD.

This also will remove the overhead when SIMD selection is being used to
just to find the selected dispatch width -- at a point where the shaders
were already compiled -- and the errors are not used at all.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9849
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25336>
2023-09-22 16:23:02 +00:00
Caio Oliveira
e55aa87f32 compiler: Only enable mesaclc helper if we have OpenCL SPIR-V support
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25341>
2023-09-22 15:29:25 +00:00
Caio Oliveira
4e065cdaaa clover: Only compile/depend libclspirv and libclnir when using SPIR-V support
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25341>
2023-09-22 15:29:25 +00:00
Caio Oliveira
3a210932ad clover: Hide SPIR-V related code behind HAVE_CLOVER_SPIRV
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25341>
2023-09-22 15:29:25 +00:00
Caio Oliveira
0e7337e830 rusticl: Ensure NIR generated headers will be available
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25314>
2023-09-22 14:52:50 +00:00
Caio Oliveira
3988d901ac meson: Remove unnecessary inc_compiler mentions
The inc_compiler should come as part of idep_compiler, idep_nir or
idep_nir_headers dependency.

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> (v3dv)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25314>
2023-09-22 14:52:50 +00:00
Caio Oliveira
ec835595f0 compiler: Use a meson dependency for libcompiler
That will make sure the include directories are passed on and also
make sure the generated headers are properly built before whoever code
depends on it. NIR dependency propagates that dependency too.

Since the right include directory is always propagated, we can remove
the extra "compiler/" prefix from the `#include`s in glsl_types.h.

Note: NIR has a special "header only" dependency, so include the
generated headers for compiler there too.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9843
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25314>
2023-09-22 14:52:50 +00:00
Helen Koike
9442571664 ci: separate hiden jobs to -inc.yml files
make it easier to re-use the hidden jobs by other project (e.g. linux)
without enabling the executable jobs.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25238>
2023-09-22 14:12:29 +00:00
Mike Blumenkrantz
17dfbb6ce7 zink: fix semaphore signal ordering
the timeline semaphore must always be on the last submit in order to
mimic fence behavior

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25334>
2023-09-22 12:55:39 +00:00
Mike Blumenkrantz
12778fc99f zink: add a ZINK_DEBUG=validation alias
typing validation all the time makes my hands hurt

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25290>
2023-09-22 12:29:27 +00:00
Mike Blumenkrantz
fe43e63974 zink: set workgroup_memory_explicit_layout for shader validation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25290>
2023-09-22 12:29:27 +00:00
Mike Blumenkrantz
5d90b1db70 lavapipe: set separate_shaders for shader objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25292>
2023-09-22 11:59:12 +00:00
Mike Blumenkrantz
cf903ff79b zink: delete a non-maintenance5 workaround for shobj use
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25289>
2023-09-22 11:34:03 +00:00
Mike Blumenkrantz
3c50b93efe zink: require maintenance5 for shobj
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25289>
2023-09-22 11:34:03 +00:00
Mike Blumenkrantz
792d76feb1 zink: delete injected pointsize during shader creation
maintenance5 is best maintenance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25289>
2023-09-22 11:34:03 +00:00
Konstantin Seurer
51e067d9e5 lavapipe/ci: Fix asan expectations
Those failures were fixed in b2f6de8f0d.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25309>
2023-09-22 10:46:21 +00:00
Konstantin Seurer
be8a73f40d nir/deref: Layer rematerialization helpers
nir_rematerialize_derefs_in_use_blocks_impl can be implemented on top of
nir_rematerialize_deref_in_use_blocks.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>
2023-09-22 10:05:58 +00:00
Konstantin Seurer
439e8c42cc nir/lcssa: Fix rematerializing derefs
This would pull derefs out of loops by emitting the pattern
`deref(phi(deref))` which is not allowed by nir_validate.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>
2023-09-22 10:05:58 +00:00
Konstantin Seurer
29dc1b193a nir: Add nir_rematerialize_deref_in_use_blocks
nir_rematerialize_deref_in_use_blocks can be used in passes that don't
run on the whole function.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>
2023-09-22 10:05:58 +00:00
Rhys Perry
ba809dccb8 nir/deref: remove rematerialize_deref_in_block cache
Nothing was ever inserted into this.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>
2023-09-22 10:05:58 +00:00
Konstantin Seurer
ab1310e84d nir: Add nir_foreach_block_in_cf_node_reverse
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>
2023-09-22 10:05:58 +00:00
Konstantin Seurer
70e497a2ac nir: Add nir_cf_node_cf_tree_prev
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23712>
2023-09-22 10:05:58 +00:00
Eric Engestrom
01f6afb01a ci/zink+radv: bump the timeout of zink-radv-navi10-valve by 10 minutes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25342>
2023-09-22 09:35:38 +00:00
Eric Engestrom
e7c977503c ci/zink+radv: specify that zink-radv-navi10-valve should run in the mupuf farm
Fixes: 8c98ee6f3a ("radv/ci: move vkcts-navi10 testing to KWS")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25342>
2023-09-22 09:35:38 +00:00
Corentin Noël
c891c1fdce virgl: Cover all the formats defined in the virgl definition
Add all the formats currently defined in u_formats.h

Also make sure that no format on virgl protocol has the same number as another one.
Make so that the virgl_formats_conv_table is following the same order as virgl_formats

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25295>
2023-09-22 07:35:57 +00:00
Konstantin Seurer
24555cdbbd aco/spill: Make sure that offset stays in bounds
If a shader spills a lot, the offset can be above the HW limit.

cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24652>
2023-09-22 06:30:01 +00:00
Rob Clark
9510af0f60 freedreno/fence: Hold a strong ref to batch
We don't want a unflushed fence to outlive it's batch, otherwise we run
into trouble when it comes time to wait on the fence.  For ex:

1. Create a fence before framebuffer state is set, with the
   PIPE_FLUSH_DEFERRED flags.  This creates a new batch, to which the
   ctx holds the only reference (unless the fence also holds a ref)
2. set_framebuffer_state() creates a new batch and drops the ctx->batch
   reference.
3. Later something tries to wait on the fence

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8621
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25337>
2023-09-22 02:07:36 +00:00
Rob Clark
86f5077538 freedreno: Add reformatting commits to .git-blame-ignore-revs
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25337>
2023-09-22 02:07:36 +00:00
Timothy Arceri
dedb2f0208 glsl: remove unused validate_first_and_last_interface_explicit_locations()
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25318>
2023-09-22 00:41:18 +00:00
Timothy Arceri
7b744bb8df glsl: switch to nir validate_first_and_last_interface_explicit_locations()
Use the new nir version. The glsl ir version will be removed in the
following patch.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25318>
2023-09-22 00:41:18 +00:00
Timothy Arceri
92f24e6cdc glsl: add nir version of validate_first_and_last_interface_explicit_locations()
The glsl ir version will be removed in a following commit.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25318>
2023-09-22 00:41:18 +00:00
Timothy Arceri
8bf5c39994 glsl: move get_varying_type() declaration earlier
Required for the following patch to keep this file somewhat organised.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25318>
2023-09-22 00:41:18 +00:00
Jordan Justen
08735fd90d intel/isl: Build for Xe2
This is only *build* support in isl for Xe2. Before adding LNL PCI
IDs, subsequent patches will fill in ISL updates for Xe2.

Rework:
 * Rohan: Update isl_genX_declare_get_func

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25253>
2023-09-21 18:24:01 +00:00
Jordan Justen
961aa68b23 intel/genxml: Build with gen20.xml
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25253>
2023-09-21 18:24:01 +00:00
Martin Roukala (né Peres)
065ff21bf2 radv/ci: add more tests to the navi10 vkcts flake list
Since I had to aggregate the results of a lot of run, this commit also
ends up ordering some of the flakes to fit the alphabetical order.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25324>
2023-09-21 17:59:05 +00:00
Martin Roukala (né Peres)
8c98ee6f3a radv/ci: move vkcts-navi10 testing to KWS
We now have 2 more navi10 DUTs at KWS, so let's use them to speed
up vkcts testing!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25324>
2023-09-21 17:59:05 +00:00
Ian Romanick
2157f136d7 nir/rematerialize: Rematerialize ALUs used only by compares with zero
This was 4th on the list of things to try in 3ee2e84c60 ("nir:
Rematerialize compare instructions"). This is implemented as a separate
subpass that tries to find ALU instructions (with restrictions) that are
only used by comparisons with zero that are in turn only used as
conditions for bcsel or if-statements.

There are two restrictions implemented. One of the sources must be a
constant. This is done in an attempt to prevent increasing register
pressure. Additionally, the opcode of the instruction must be one that
has a high probablility of getting a conditional modifier on Intel
GPUs. Not all instructions can have a conditional modifiers (e.g., min
and max), so I don't think there is any benefit to moving these
instructions.

v2: Rebase on many, many recent NIR infrastructure changes.

v3: Make data in commit message more clear. Suggested by Matt. Rebase on
b5d6b7c402 ("nir: Drop most uses if nir_instr_rewrite_src()").

All of the affected shaders on ILK and G45 are in CS:GO. There is some
brief analysis of the changes in the MR.

Reviewed-by: Matt Tuner <mattst88@gmail.com>

Shader-db results:

DG2
total instructions in shared programs: 22824637 -> 22824258 (<.01%)
instructions in affected programs: 365742 -> 365363 (-0.10%)
helped: 190 / HURT: 97

total cycles in shared programs: 832186193 -> 832157290 (<.01%)
cycles in affected programs: 41245259 -> 41216356 (-0.07%)
helped: 208 / HURT: 117

total spills in shared programs: 4072 -> 4060 (-0.29%)
spills in affected programs: 366 -> 354 (-3.28%)
helped: 4 / HURT: 2

total fills in shared programs: 3601 -> 3607 (0.17%)
fills in affected programs: 708 -> 714 (0.85%)
helped: 4 / HURT: 2

LOST:   0
GAINED: 1

Tiger Lake and Ice Lake had similar results. (Ice Lake shown)
total instructions in shared programs: 20320934 -> 20320689 (<.01%)
instructions in affected programs: 236592 -> 236347 (-0.10%)
helped: 176 / HURT: 29

total cycles in shared programs: 849846341 -> 849843856 (<.01%)
cycles in affected programs: 41277336 -> 41274851 (<.01%)
helped: 195 / HURT: 110

LOST:   0
GAINED: 1

Skylake
total instructions in shared programs: 18550811 -> 18550470 (<.01%)
instructions in affected programs: 233908 -> 233567 (-0.15%)
helped: 182 / HURT: 25

total cycles in shared programs: 835910983 -> 835889167 (<.01%)
cycles in affected programs: 38764359 -> 38742543 (-0.06%)
helped: 207/ HURT: 94

total spills in shared programs: 4522 -> 4506 (-0.35%)
spills in affected programs: 324 -> 308 (-4.94%)
helped: 4 / HURT: 0

total fills in shared programs: 5296 -> 5280 (-0.30%)
fills in affected programs: 324 -> 308 (-4.94%)
helped: 4 / HURT: 0

LOST:   0
GAINED: 1

Broadwell
total instructions in shared programs: 18199130 -> 18197920 (<.01%)
instructions in affected programs: 214664 -> 213454 (-0.56%)
helped: 191 / HURT: 0

total cycles in shared programs: 935131908 -> 934870248 (-0.03%)
cycles in affected programs: 75770568 -> 75508908 (-0.35%)
helped: 203 / HURT: 84

total spills in shared programs: 13896 -> 13734 (-1.17%)
spills in affected programs: 162 -> 0
helped: 3 / HURT: 0

total fills in shared programs: 16989 -> 16761 (-1.34%)
fills in affected programs: 228 -> 0
helped: 3 / HURT: 0

Haswell
total instructions in shared programs: 16969502 -> 16969085 (<.01%)
instructions in affected programs: 185498 -> 185081 (-0.22%)
helped: 121 / HURT: 1

total cycles in shared programs: 925290863 -> 924806827 (-0.05%)
cycles in affected programs: 30200863 -> 29716827 (-1.60%)
helped: 100 / HURT: 85

total spills in shared programs: 13565 -> 13533 (-0.24%)
spills in affected programs: 736 -> 704 (-4.35%)
helped: 8 / HURT: 0

total fills in shared programs: 15468 -> 15436 (-0.21%)
fills in affected programs: 740 -> 708 (-4.32%)
helped: 8 / HURT: 0

LOST:   0
GAINED: 1

Ivy Bridge
total instructions in shared programs: 15839127 -> 15838947 (<.01%)
instructions in affected programs: 77776 -> 77596 (-0.23%)
helped: 58 / HURT: 0

total cycles in shared programs: 459852774 -> 459739770 (-0.02%)
cycles in affected programs: 11970210 -> 11857206 (-0.94%)
helped: 79 / HURT: 53

Sandy Bridge
total instructions in shared programs: 14106847 -> 14106831 (<.01%)
instructions in affected programs: 1611 -> 1595 (-0.99%)
helped: 10 / HURT: 0

total cycles in shared programs: 775004024 -> 775007516 (<.01%)
cycles in affected programs: 2530686 -> 2534178 (0.14%)
helped: 55 / HURT: 48

Iron Lake
total cycles in shared programs: 257753356 -> 257754900 (<.01%)
cycles in affected programs: 2977374 -> 2978918 (0.05%)
helped: 12 / HURT: 106

GM45
total cycles in shared programs: 169711382 -> 169712816 (<.01%)
cycles in affected programs: 2402070 -> 2403504 (0.06%)
helped: 12 / HURT: 57

Fossil-db results:

All Intel platforms had similar results. (DG2 shown)
Totals:
Instrs: 193884596 -> 193465896 (-0.22%); split: -0.25%, +0.03%
Cycles: 14050193354 -> 14048194826 (-0.01%); split: -0.34%, +0.33%
Spill count: 114944 -> 100449 (-12.61%); split: -13.59%, +0.98%
Fill count: 201525 -> 179534 (-10.91%); split: -11.22%, +0.31%
Scratch Memory Size: 10028032 -> 8468480 (-15.55%)

Totals from 16912 (2.59% of 653124) affected shaders:
Instrs: 34173709 -> 33755009 (-1.23%); split: -1.41%, +0.19%
Cycles: 2945969110 -> 2943970582 (-0.07%); split: -1.62%, +1.55%
Spill count: 97753 -> 83258 (-14.83%); split: -15.98%, +1.15%
Fill count: 176355 -> 154364 (-12.47%); split: -12.82%, +0.35%
Scratch Memory Size: 8619008 -> 7059456 (-18.09%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20176>
2023-09-21 16:58:29 +00:00
Pierre-Eric Pelloux-Prayer
60a7c9688c radeonsi: emit framebuffer state after allocating cmask
tex->cmask_base_address_reg and tex->cb_color_info are used in
si_emit_framebuffer_state so we have to re-emit the state when
they're modified.

It's not done in si_alloc_separate_cmask because it cannot
update framebuffer.dirty_cbufs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9830
Cc: mesa-stable
Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25317>
2023-09-21 16:12:06 +00:00
Emma Anholt
0c1b6af1b6 ci/fastboot: Use a case insensitive match for a fastboot line.
Newer boards like the RB5 have a capital F, so this will make the script
more reusable for drm ci.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25311>
2023-09-21 15:32:30 +00:00
David Rosca
2b1148ca4d radeonsi/vcn: Implement destroy_fence vfunc
Now that fences are correctly cleaned up in frontend, we can store
the fence reference in picture->fence again.

The encoder also needs to implement this vfunc because if a surface
from decoder is used directly as encode input it's now up to encoder
to destroy the fence.

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

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25296>
2023-09-21 13:30:28 +00:00
David Rosca
24ff1062b1 frontends/va: Destroy fences when destroying surface or context
It is valid to destroy VASurface after destroying VAContext, so we need
to destroy fences of all surfaces that are currently being tracked by a
context when deleting this context.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25296>
2023-09-21 13:30:28 +00:00
David Rosca
d6b2a624a1 frontends/va: Track surfaces in context
This will be needed to correctly cleanup fences.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25296>
2023-09-21 13:30:28 +00:00
Roman Stratiienko
8f513813b1 u_gralloc: Add a function that returns gralloc type
This is needed by some drivers to reject the fallback gralloc.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256>
2023-09-21 10:50:34 +00:00
Roman Stratiienko
d923d6234d Revert "util: Add NONNULL macro"
We agreed in [1] not to use it since it has little value,
but making a code less readable.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256

This reverts commit 21dcde096f.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256>
2023-09-21 10:50:34 +00:00
Roman Stratiienko
3b6f14c4d3 u_gralloc: Remove usage of NONNULL macro
We agreed in [1] not to use it since it has little value,
but making a code less readable.

[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256>
2023-09-21 10:50:34 +00:00
Roman Stratiienko
28b21fae6e u_gralloc: Remove inline modifiers from the functions
Suggested-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256>
2023-09-21 10:50:34 +00:00
Eric Engestrom
446b0fe8c9 docs: drop outdated and redundant note about the minimum meson version
The documentation we've been keeping up to date is in `docs/meson.rst`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25322>
2023-09-21 10:41:52 +00:00
Georg Lehmann
336ec2a4b4 aco: simplify masked swizzle dpp selection by removing or_mask first
and_mask and xor_mask alone can represent all patterns without or_mask

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25115>
2023-09-21 10:07:27 +00:00
Eric Engestrom
2009b9b5e2 ci: limit build jobs to 30min so that they can retry when they go wrong
Build jobs should never take more than 1-3 minutes.

These jobs are never slow, either they finish within reasonable time or
something has gone wrong and the job will never terminate, so we should
instead timeout and retry.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24995>
2023-09-21 08:21:04 +00:00
Karol Herbst
33ca3a999c rusticl/kernel: skip adding global id offsets if not used
This allows us to shrink the kernel input buffer quite significantly as
the offset is a vec aligned size_t3 value.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25303>
2023-09-21 07:58:34 +00:00
Karol Herbst
a9f408bd52 rusticl/mesa: fix set_constant_buffer when passing an empty buffer
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25303>
2023-09-21 07:58:34 +00:00
Jordan Justen
f1b9b7f955 intel/fs: Update SSBO & shared uniform block loads for Xe2
Note: lower_lsc_block_logical_send() most likely stills needs some
related updates.

Ref: a358b97c58 ("intel/fs: optimize uniform SSBO & shared loads")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 23:06:16 -07:00
Jordan Justen
9fb2b12c99 intel/compiler: Update RT stack_id access for Xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 23:06:16 -07:00
Jordan Justen
d371565d34 intel/compiler: Update ray-tracing intrinsic lowering for Xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 23:06:16 -07:00
Jordan Justen
3d744a6890 intel/compiler: Update lower_trace_ray_logical_send() for Xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 23:06:16 -07:00
Jordan Justen
9e43fa09a6 intel/compiler: Update emit_rt_lsc_fence() for Xe2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 23:06:16 -07:00
Jordan Justen
9846dd798b intel/compiler: Update opt_split_sends() for Xe2 reg size
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 23:06:04 -07:00
Jordan Justen
727ab2c11d intel/compiler/fs: Support Xe2 reg size in assign_curb_setup
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
cef4d53daf intel/xe2+: Round up size to reg_unit() in fs_reg_alloc::alloc_spill_reg().
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
fe3d90aedf intel/fs/xe2+: Fix calculation of spill message width for Xe2 regs.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
791d040104 intel/fs/xe2+: Fix execution width of SHADER_OPCODE_GET_BUFFER_SIZE for SIMD16 EU.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
ac4f598577 intel/fs/xe2+: Update regioning lowering offset alignment checks for Xe2 regs.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
37e280f28a intel/fs: Lower unsupported regioning with non-trivial 2D regions on FIXED_GRFs.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Caio Oliveira
dd632bf527 intel/fs/xe2+: Update TASK/MESH payload setup for Xe2 reg size.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Caio Oliveira
8944ac7d6c intel/fs/xe2+: Update BS payload setup for Xe2 reg size.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
14e1b9ee69 intel/fs/xe2+: Update TES payload setup for Xe2 reg size.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
4b3243104c intel/fs/xe2+: Update TCS payload setup for Xe2 reg size.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
6195eac210 intel/fs/xe2+: Update GS payload setup for Xe2 reg size.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Caio Oliveira
28744c8954 intel/compiler/xe2: Account for reg_unit() in TES intrinsics
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Caio Oliveira
9859f5b4d2 intel/compiler/xe2: Account for reg_unit() in TCS intrinsics
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
610daa3166 intel/fs/xe2+: Fix payload layout of sampler messages for Xe2 reg size
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Ian Romanick
c9f2857546 intel/compiler/xe2: TXD is lowered to SIMD16 in SIMD32 mode
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Ian Romanick
ef817650c9 intel/compiler/xe2: Use SIMD16 for nir_intrinsic_image_size
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Ian Romanick
0b23df3951 intel/compiler/xe2: Update fs_visitor::setup_vs_payload to account for Xe2 reg size
[ Francisco Jerez: Simplify. ]

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Rohan Garg
42b90f05f6 intel/compiler: Adjust barrier emission for Xe2+
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
8b1dc77521 intel/fs/xe2+: Scale BRW_MAX_MSG_LENGTH by native register size.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Rohan Garg
4de065f6a2 intel/compiler: Adjust fence message lengths for new register width on Xe2+
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Rohan Garg
e1289d6135 intel/compiler: Adjust CS payload registers for new register width on Xe2+
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
150b3e87c8 intel/fs/xe2+: Round up fs_builder::vgrf() size calculation to HW register unit.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
24dcc3269b intel/fs/xe2+: Update encoding of FB write message payload.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
a573531785 intel/compiler/xe2+: Represent dispatch_grf_start_reg in native GRF units.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
17ef5e7ead intel/fs/xe2+: Allow increased SIMD width for various get_fpu_lowered_simd_width() restrictions.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
6423cb9bfa intel/eu/xe2+: Update validation of GRF region size to account for Xe2 reg size
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
00b614a5a7 intel/fs/xe2+: Scale MAX_SAMPLER_MESSAGE_SIZE by native register size.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
421d43fe62 intel/fs/xe2+: Fixes for increased accumulator register width.
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
80e9031b44 intel/fs/xe2+: Fix grf_count in post-RA scheduling for updated register file size.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
571ddf8516 intel/fs/xe2+: Fix payload node live range calculations for change in register size.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
2b7419d090 intel/fs: Fix signedness of payload_node_count argument of calculate_payload_ranges().
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
abf8111560 intel/eu/xe2+: Fix encoding of various message descriptors for change in register size.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
6d39b3d6ae intel/fs/ra/xe2: Scale up register allocation granularity by 2x on Xe2+ platforms.
v2: Fix spill register allocation.  Switch to brw_reg::nr
    representation in fake 256b units.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
bd98df5d8e intel/compiler: Make MAX_VGRF_SIZE macro depend on devinfo and update it for Xe2.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:36 -07:00
Francisco Jerez
a7d521e556 intel/vec4/ra: Define REG_CLASS_COUNT constant specifying the number of register classes.
Rework:
 * Jordan: 16=>20 following d33aff783d ("intel/fs: add support for
   sparse accesses")

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:35 -07:00
Francisco Jerez
5d87f41a54 intel/fs/ra: Define REG_CLASS_COUNT constant specifying the number of register classes.
Rework:
 * Jordan: 16=>20 following d33aff783d ("intel/fs: add support for
   sparse accesses")

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>
2023-09-20 17:19:35 -07:00
Eric Engestrom
502b864dcc docs: add another 23.1.x
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25310>
2023-09-20 18:25:12 +01:00
Eric Engestrom
7330631fae docs: update calendar for 23.1.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25310>
2023-09-20 18:24:06 +01:00
Eric Engestrom
234654eb7c docs: add sha256sum for 23.1.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25310>
2023-09-20 18:24:06 +01:00
Eric Engestrom
e1160b9867 docs: add release notes for 23.1.8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25310>
2023-09-20 18:16:26 +01:00
Connor Abbott
c93bcb32fe amd: Use inverse ballot intrinsic if available
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25123>
2023-09-20 14:41:18 +00:00
Connor Abbott
4282386311 nir/spirv: Add inverse_ballot intrinsic
This is actually a no-op on AMD, so we really don't want to lower it to
something more complicated.  There may be a more efficient way to do
this on Intel too. In addition, in the future we'll want to use this for
lowering boolean reduce operations, where the inverse ballot will
operate on the backend's "natural" ballot type as indicated by
options->ballot_bit_size, instead of uvec4 as produced by SPIR-V. In
total, there are now three possible lowerings we may have to perform:

- inverse_ballot with source type of uvec4 from SPIR-V to inverse_ballot
with natural source type, when the backend supports inverse_ballot
natively.
- inverse_ballot with source type of uvec4 from SPIR-V to arithmetic,
when the backend doesn't support inverse_ballot.
- inverse_ballot with natural source type from reduce operation, when
the backend doesn't support inverse_ballot.

Previously we just did the second lowering unconditionally in vtn, but
it's just a combination of the first and third. We add support here for
the first and third lowerings in nir_lower_subgroups, instead of simply
moving the second lowering, to avoid unnecessary churn.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25123>
2023-09-20 14:41:18 +00:00
Connor Abbott
0ef87f148d nir/lower_subgroups: Don't do multiple lowerings at once
Since using nir_shader_lower_instructions(), instructions get revisited
before proceeding with the next one. This already guarantees that any
subsequent lowerings of those instructions happen during the same pass
of nir_lower_subgroups().

v2: use nir_shader_lower_instructions() instead of setting the cursor.

Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25123>
2023-09-20 14:41:18 +00:00
Sviatoslav Peleshko
465644640a zink: Store zink_vertex_elements_hw_state::b.strides by binding id
Currently, we store strides by vertex buffer id, which means that we have
to map the binding index to the vertex buffer index every time we want to
get a stride for a given binding. This also creates an order mismatch when
we pass strides directly to CmdBindVertexBuffers2EXT. Instead of converting
strides for CmdBindVertexBuffers2EXT too, we can just store strides by
binding id, and drop the mapping in other places.

Fixes: 76725452 ("gallium: move vertex stride to CSO")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9817
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25305>
2023-09-20 13:44:28 +00:00
Konstantin Seurer
2993853f49 radv/rt: Skip cull_mask handling if it is FF
Totals from 9 (1.32% of 680) affected shaders:
Instrs: 609329 -> 609057 (-0.04%)
CodeSize: 3267328 -> 3265664 (-0.05%)
Latency: 8289582 -> 8275874 (-0.17%)
InvThroughput: 2166498 -> 2163147 (-0.15%)
VClause: 23581 -> 23583 (+0.01%)
Copies: 51076 -> 51028 (-0.09%)
Branches: 24637 -> 24603 (-0.14%)
PreVGPRs: 996 -> 986 (-1.00%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25268>
2023-09-20 13:00:03 +00:00
Konstantin Seurer
e0cf4fbf38 radv/ray_queries: Skip cull_mask handling if it is FF
Stats for Metro Exodus:

Totals from 26 (0.99% of 2627) affected shaders:
Instrs: 14586 -> 14232 (-2.43%)
CodeSize: 77024 -> 75192 (-2.38%)
VGPRs: 1408 -> 1208 (-14.20%)
Latency: 315076 -> 309898 (-1.64%)
InvThroughput: 42345 -> 41677 (-1.58%)
VClause: 366 -> 374 (+2.19%)
Copies: 2840 -> 2800 (-1.41%); split: -1.48%, +0.07%
Branches: 587 -> 561 (-4.43%)
PreSGPRs: 897 -> 853 (-4.91%)
PreVGPRs: 1290 -> 1122 (-13.02%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25268>
2023-09-20 13:00:03 +00:00
Konstantin Seurer
3e7850f97b radv/bvh: Treat instances with mask == 0 as inactive
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25268>
2023-09-20 13:00:03 +00:00
Tapani Pälli
8d2dcd55d7 anv: refactor to fix pipe control debugging
While earlier changes to pipe control emission allowed debug dump of
each pipe control, they also changed debug output to almost always print
same reason/function for each pc. These changes fix the output so that
we print the original function name where pc is emitted.

As example:

pc: emit PC=( +depth_flush +rt_flush +pb_stall +depth_stall ) reason: gfx11_batch_emit_pipe_control_write
pc: emit PC=( ) reason: gfx11_batch_emit_pipe_control_write

changes back to:

pc: emit PC=( +depth_flush +rt_flush +pb_stall +depth_stall ) reason: gfx11_emit_apply_pipe_flushes
pc: emit PC=( ) reason: cmd_buffer_emit_depth_stencil

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25282>
2023-09-20 06:04:37 +00:00
Iago Toral Quiroga
747c7042df v3dv: we can sample from 1D array too
Fixes: 95f881ad ('v3dv: add support for sampling simple 2D linear textures')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25286>
2023-09-20 05:44:42 +00:00
Rob Clark
62f931204b freedreno/a6xx: Add L8_SRGB
Avoids a tragic slow-path with CS:GO

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25298>
2023-09-20 00:55:29 +00:00
Emma Anholt
dac6f24177 ci/zink: Add a few updates for anv/tgl from the nightly runs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25301>
2023-09-19 22:50:07 +00:00
Emma Anholt
d2ec7b4c35 ci/virgl: Disable virgl-iris-traces.
It's been failing with "No virgl contexts available on hostlibEGL warning:
egl: failed to create dri2 screen" for ages, and nobody seems to care.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25301>
2023-09-19 22:50:07 +00:00
Emma Anholt
258d8b9c23 ci/intel: Add various updates from our nightly runs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25301>
2023-09-19 22:50:07 +00:00
Jose Maria Casanova Crespo
cb96dab5c8 vc4: mark buffers as initialized at vc4_texture_subdata
This fixes several tests when the initially uploaded buffer
from CPU was being ignored because vc4_texture_subdata was not
marking the resource as written/initialized.

The usage flags management available at vc4_resource_transfer_map
is generalized into vc4_map_usage_prep and reused at
vc4_resource_transfer_map. This makes vc4 implementation more similar
to v3d.

This fixes 7 text in the following subgroups:
  -dEQP-GLES2.functional.fbo.render.texsubimage.*
  -dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.*
  -spec@arb_clear_texture@arb_clear_texture-*

Cc: mesa-stable
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25297>
2023-09-19 21:47:32 +02:00
Paulo Zanoni
7c538b5ad8 iris: assert(bo->deps) after realloc()
Iris in general doesn't really like checking the return value of its
allocations, but in some places it does assert that those pointers are
non-NULL. We've recently investigated a bug that could have been
coming from a failed bo->deps realloc(), so add the assert() here to
help give us more confidence over things the next time we're debugging
issues.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25236>
2023-09-19 18:33:48 +00:00
Paulo Zanoni
3cec15dd14 iris: avoid stack overflow in iris_bo_wait_syncobj()
Keep most cases using the stack as it's cheaper, but fall back to the
heap when the size gets too big.

This should fix a stack overflow reported by @rhezashan for a case
where we had lots of iris_screens.

Credits to Matt Turner and José Roberto de Souza for their work on
this issue, which led us to find its root cause.

Cc: mesa-stable
Reported-by: rheza shandikri (@rhezashan in gitlab)
Credits-to: José Roberto de Souza <jose.souza@intel.com>
Credits-to: Matt Turner <mattst88@gmail.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25236>
2023-09-19 18:33:48 +00:00
Paulo Zanoni
762b9aad01 iris: assert bufmgr->bo_deps_lock is held
This is the only place that touches bo->deps but does not explicitly
lock it and is not a setup/teardown function where locking won't help
anything.

I'm confident we won't hit this assertion, but I've recently had this
lock as the suspect of a bug and had to check the callers to see if we
could be calling from any unlocked place. Having the assert helps
increasing our confidence.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25236>
2023-09-19 18:33:48 +00:00
Pavel Ondračka
1c72c71bdf nir/move_vec_src_uses_to_dest: allow to skip reuse of constant sources
And enable this for r300 and intel-vec4

crocus HSW (mostly helps few doplhin ubershaders):
total instructions in shared programs: 1576736 -> 1576589 (<.01%)
instructions in affected programs: 38235 -> 38088 (-0.38%)
helped: 12
HURT: 0
total cycles in shared programs: 111025838 -> 110944796 (-0.07%)
cycles in affected programs: 5646582 -> 5565540 (-1.44%)
helped: 15
HURT: 6
total spills in shared programs: 447 -> 432 (-3.36%)
spills in affected programs: 186 -> 171 (-8.06%)
helped: 12
HURT: 0
total fills in shared programs: 792 -> 774 (-2.27%)
fills in affected programs: 291 -> 273 (-6.19%)
helped: 12
HURT: 0

r300 RV530:
total instructions in shared programs: 96655 -> 96304 (-0.36%)
instructions in affected programs: 15020 -> 14669 (-2.34%)
helped: 79
HURT: 18
total temps in shared programs: 13027 -> 12952 (-0.58%)
temps in affected programs: 677 -> 602 (-11.08%)
helped: 41
HURT: 9
total cycles in shared programs: 147745 -> 147314 (-0.29%)
cycles in affected programs: 21831 -> 21400 (-1.97%)
helped: 84
HURT: 19

r300 RV370:
total instructions in shared programs: 63678 -> 63669 (-0.01%)
instructions in affected programs: 931 -> 922 (-0.97%)
helped: 12
HURT: 6
total temps in shared programs: 10028 -> 10013 (-0.15%)
temps in affected programs: 339 -> 324 (-4.42%)
helped: 33
HURT: 10
total cycles in shared programs: 101118 -> 101087 (-0.03%)
cycles in affected programs: 2659 -> 2628 (-1.17%)
helped: 22
HURT: 6

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24932>
2023-09-19 18:05:37 +02:00
Pavel Ondračka
dc60194599 nir/move_vec_src_uses_to_dest: skip reuse if vec is used only once in store_output
lima and etnaviv show no change in shader-db.

crocus HSW:
total instructions in shared programs: 1576762 -> 1576736 (<.01%)
instructions in affected programs: 485 -> 459 (-5.36%)
helped: 28
HURT: 1
total cycles in shared programs: 111025898 -> 111025838 (<.01%)
cycles in affected programs: 1248 -> 1188 (-4.81%)
helped: 29
HURT: 0

RV370:
total instructions in shared programs: 63889 -> 63558 (-0.52%)
instructions in affected programs: 9116 -> 8785 (-3.63%)
helped: 129
HURT: 0
total temps in shared programs: 10071 -> 10016 (-0.55%)
temps in affected programs: 285 -> 230 (-19.30%)
helped: 51
HURT: 0
total cycles in shared programs: 101344 -> 100997 (-0.34%)
cycles in affected programs: 9326 -> 8979 (-3.72%)
helped: 129
HURT: 0

RV530:
total instructions in shared programs: 93597 -> 93267 (-0.35%)
instructions in affected programs: 10309 -> 9979 (-3.20%)
helped: 166
HURT: 0
total temps in shared programs: 13019 -> 12955 (-0.49%)
temps in affected programs: 337 -> 273 (-18.99%)
helped: 61
HURT: 1
total cycles in shared programs: 144506 -> 144159 (-0.24%)
cycles in affected programs: 10662 -> 10315 (-3.25%)
helped: 165
HURT: 0

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24932>
2023-09-19 18:05:30 +02:00
Pavel Ondračka
8ac975fa5e r300: enable nir_move_vec_src_uses_to_dest
We want to do this in general, right now the stats are not that good but
that will be taken care of in the next commits.

RV530:
total instructions in shared programs: 93561 -> 93597 (0.04%)
instructions in affected programs: 39015 -> 39051 (0.09%)
helped: 207
HURT: 212
total temps in shared programs: 12864 -> 13019 (1.20%)
temps in affected programs: 2010 -> 2165 (7.71%)
helped: 57
HURT: 181
total cycles in shared programs: 144639 -> 144506 (-0.09%)
cycles in affected programs: 54524 -> 54391 (-0.24%)
helped: 191
HURT: 234

RV370:
total instructions in shared programs: 63692 -> 63811 (0.19%)
instructions in affected programs: 16851 -> 16970 (0.71%)
helped: 121
HURT: 141
total temps in shared programs: 9966 -> 10050 (0.84%)
temps in affected programs: 969 -> 1053 (8.67%)
helped: 33
HURT: 126
total cycles in shared programs: 101042 -> 101205 (0.16%)
cycles in affected programs: 20606 -> 20769 (0.79%)
helped: 121
HURT: 155

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24932>
2023-09-19 18:05:14 +02:00
lorn10
00aa8816a1 docs: Update Clover's env variable documentation
Fixes: 981bc603b4 ("clover: implement CLOVER_DEVICE_TYPE like RUSTICL_DEVICE_TYPE")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21657>
2023-09-19 18:55:28 +05:30
Rohan Garg
4c877ebfe5 anv: define clear color localy within can_fast_clear_color_att
We can drop a extra function argument this way.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24972>
2023-09-19 09:57:10 +00:00
Iago Toral Quiroga
88efda1b24 v3dv: only handle Android Hardware Buffer on Android
Fixes: 733909a6 ('v3dv/android: Add AHardwareBuffer support')

Fixes the following CTS regression on Linux:
dEQP-VK.api.external.memory.android_hardware_buffer.dedicated.image.info
dEQP-VK.api.external.memory.android_hardware_buffer.suballocated.image.info

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25283>
2023-09-19 09:37:50 +00:00
Samuel Pitoiset
67ed899cd6 radv: remove absolute_depth_bias workaround
This was only used with Path of Exile and the game bug seems fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25198>
2023-09-19 07:53:51 +00:00
Samuel Pitoiset
4475c400a1 radv: remove drirc workarounds for Path Of Exile
According to https://gitlab.freedesktop.org/mesa/mesa/-/issues/9798,
all game bugs should have been fixed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9798
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25198>
2023-09-19 07:53:51 +00:00
Samuel Pitoiset
f3790959c8 drirc: remove Path of Exile workarounds
According to https://gitlab.freedesktop.org/mesa/mesa/-/issues/9798,
all game bugs should have been fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25198>
2023-09-19 07:53:51 +00:00
Samuel Pitoiset
604a9b7fae ac/perfcounter: add GFX11 groups
Source from PAL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25245>
2023-09-19 07:24:38 +00:00
Samuel Pitoiset
0925d0d042 ac/perfcounter: add SG_WQP group for GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25245>
2023-09-19 07:24:38 +00:00
Samuel Pitoiset
041d1150c1 radv: fix missing ISA with RGP and GPL
The pipeline hash is required for RGP to correctly report the ISA, so
it should be computed for fast-linked pipelines with GPL (libraries
aren't captured).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9169
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25275>
2023-09-19 06:50:59 +00:00
Samuel Pitoiset
c314bc2ab9 radv: fix checking if RGP is enabled with others tracing tools
This is a bitmask.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25275>
2023-09-19 06:50:59 +00:00
Tapani Pälli
c773794943 crocus: avoid issues with undefined clip distance
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25177>
2023-09-19 07:19:32 +03:00
Tapani Pälli
d6d73aae4f iris: avoid issues with undefined clip distance
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9797
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25177>
2023-09-19 07:19:08 +03:00
Mike Blumenkrantz
d6748c72d8 egl/wayland: enable WL_bind_wayland_display for zink
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24975>
2023-09-19 02:47:31 +00:00
Mike Blumenkrantz
1b4e877def egl/wayland: use more registry listeners to better handle device init
this handles globals like dmabuf and wl_drm and also enables creating
egl devices with valid fds

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24975>
2023-09-19 02:47:31 +00:00
Mike Blumenkrantz
7ac0dbd73b egl/wayland: split out wl drm extension init
no functional changes

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24975>
2023-09-19 02:47:31 +00:00
Mike Blumenkrantz
e0e812f34a egl/swrast: expose EXT_swap_buffers_with_damage and EXT_present_opaque
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24975>
2023-09-19 02:47:31 +00:00
David Rosca
9197dba8bc radeonsi/vcn: Don't hang GPU when using DCC surface as encoder input
Using DCC surface as encoder input will result in corrupted image in the
video, but early returning here will instead hang GPU.
Replace return with assert.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25259>
2023-09-18 23:08:51 +00:00
Yiwei Zhang
3166b14bd8 venus: drop device, family, index, flags tracking from vn_queue
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25262>
2023-09-18 22:33:49 +00:00
Yiwei Zhang
f5c706e438 venus: use more common vk_queue related implementations
This change uses common impl for below:
- GetDeviceQueue2
- DeviceWaitIdle

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25262>
2023-09-18 22:33:49 +00:00
Yiwei Zhang
3b58e934eb venus: use common ANB implementation
This change has a dependency over
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25185

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25262>
2023-09-18 22:33:49 +00:00
Yiwei Zhang
4cb0da89a5 venus: use common vk_queue object
This change only updates the object base to be vk_queue.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25262>
2023-09-18 22:33:48 +00:00
Yiwei Zhang
e8a61a8a6b vulkan/android: drop vk_buffer dependency from common AHB impl
Unlike AHB image, the spec has ensured no special treatment for
allocationSize for AHB buffer export operation.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25263>
2023-09-18 19:25:59 +00:00
Yiwei Zhang
cd0b86fce1 vulkan/android: add missing AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER usage
An AHB backing a Vkbuffer requires AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER
usage bit, which is missed from the original ANV and RADV Android
frontends as well as the common VK Android refactor.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25263>
2023-09-18 19:25:59 +00:00
Sil Vilerino
ab1bc348fc d3d12: Video - Relax ID3D12VideoDevice QI version for decode, process
Currently asking for ID3D12VideoDevice2 for process and
ID3D12VideoDevice3 for decode, which in reality they only
need ID3D12VideoDevice.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9824
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25272>
2023-09-18 19:08:12 +00:00
Ryan Neph
7a5948b3ee vulkan/android: add missed STACK_ARRAY_FINISH()
Fixes: 3c4c263dc7 ("vulkan/android: improve vkQueueSignalReleaseImageANDROID")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25277>
2023-09-18 11:30:02 -07:00
Dave Airlie
51840bbdce nir: add a deref slot counter that handles compact
Conor suggested this, so we can mark slots properly
in the io marking.

This fixes a problem seen when rewriting llvmpipe to use
nir info instead of tgsi info.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24803>
2023-09-18 16:47:30 +00:00
Alyssa Rosenzweig
b318b3d520 nir: Remove nir_ssa_for_src
It is now unused and has no real use cases now that nir_register is gone.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25247>
2023-09-18 10:25:17 -04:00
Alyssa Rosenzweig
55333fce77 treewide: Remove remaining nir_ssa_for_src
Coccinelle missed these, a few manual changes here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25247>
2023-09-18 10:25:17 -04:00
Alyssa Rosenzweig
d1eb17e92e treewide: Drop nir_ssa_for_src users
Via Coccinelle patch:

    @@
    expression b, s, n;
    @@

    -nir_ssa_for_src(b, *s, n)
    +s->ssa

    @@
    expression b, s, n;
    @@

    -nir_ssa_for_src(b, s, n)
    +s.ssa

Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25247>
2023-09-18 10:25:17 -04:00
Alyssa Rosenzweig
0df0980fc4 agx: Enable sinking ALU
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
4bcb62d203 nir/opt_sink: Also consider load_preamble as const
Acts like constants, schedule them like constants. This lets us move lowered
frag coord code down. Results on dolphin ubers:

   total instructions in shared programs: 195144 -> 196633 (0.76%)
   instructions in affected programs: 175737 -> 177226 (0.85%)
   helped: 28
   HURT: 27
   Instructions are HURT.

   total bytes in shared programs: 1379980 -> 1388308 (0.60%)
   bytes in affected programs: 1244250 -> 1252578 (0.67%)
   helped: 28
   HURT: 27
   Bytes are HURT.

   total halfregs in shared programs: 13591 -> 13557 (-0.25%)
   halfregs in affected programs: 2176 -> 2142 (-1.56%)
   helped: 12
   HURT: 2
   Inconclusive result (%-change mean confidence interval includes 0).

   total threads in shared programs: 233728 -> 234112 (0.16%)
   threads in affected programs: 3264 -> 3648 (11.76%)
   helped: 6
   HURT: 0
   Threads are helped.

Results on Android shader-db:

   total instructions in shared programs: 1775324 -> 1775912 (0.03%)
   instructions in affected programs: 155305 -> 155893 (0.38%)
   helped: 353
   HURT: 548
   Instructions are HURT.

   total bytes in shared programs: 11676650 -> 11678454 (0.02%)
   bytes in affected programs: 1058924 -> 1060728 (0.17%)
   helped: 370
   HURT: 547
   Inconclusive result (value mean confidence interval includes 0).

   total halfregs in shared programs: 484143 -> 471212 (-2.67%)
   halfregs in affected programs: 98833 -> 85902 (-13.08%)
   helped: 2478
   HURT: 674
   Halfregs are helped.

Instr count changes due to losing the RA lottery.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
aead5316d2 nir/opt_sink: Move ALU with constant sources
In general, sinking ALU instructions can negatively impact register pressure,
since it extends the live ranges of the sources, although it does shrink the live range
of the destination.

However, constants do not usually contribute to register pressure. This is not a
totally true assumption, but it's pretty good in practice, since...

* constants can be rematerialized (backend-dependent)
* constants can often be inlined (ISA-dependent)
* constants can sometimes be promoted to free uniform registers (ISA-dependent)
* constants can live in scalar registers although the ALU destination might need
  a vector register (and vector registers are assumed to be much more expensive
  than scalar registers, again ISA-dependent)

So, assume that constants have zero effect on register pressure. Now consider an
ALU instruction where all but one source is a constant. Then there are two
cases:

1. The ALU instruction is moved past when its source was otherwise killed. Then
   there is no effect on register pressure, since the source live range is
   extended exactly as much as the destination live range shrinks.

2. The ALU instruction is moved down but its source is still alive where it's
   moved to. Then register pressure is improved, since the source live range is
   unchanged while the destination live range shrinks.

So, as a heuristic, we always move ALU instructions where n-1 sources are
constant. As an inevitable special case, this also (necessarily) moves unary ALU
ops, which should be beneficial by the same justification. This is not 100%
perfect but it is well-motivated. Results on AGX are decent:

   total instructions in shared programs: 1796101 -> 1795652 (-0.02%)
   instructions in affected programs: 326822 -> 326373 (-0.14%)
   helped: 800
   HURT: 371
   Inconclusive result (%-change mean confidence interval includes 0).

   total bytes in shared programs: 11805004 -> 11801424 (-0.03%)
   bytes in affected programs: 2610630 -> 2607050 (-0.14%)
   helped: 912
   HURT: 462
   Inconclusive result (%-change mean confidence interval includes 0).

   total halfregs in shared programs: 525818 -> 515399 (-1.98%)
   halfregs in affected programs: 118197 -> 107778 (-8.81%)
   helped: 2095
   HURT: 804
   Halfregs are helped.

   total threads in shared programs: 18916608 -> 18917056 (<.01%)
   threads in affected programs: 4800 -> 5248 (9.33%)
   helped: 7
   HURT: 0
   Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
561df40211 nir/opt_sink: Do not move derivatives
At the moment, this does nothing. It will prevent problems from the next patch,
however.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
469fd36fba nir/opt_sink: Sink frag coord instructions
load_input-like. ubershaders:

   instructions in affected programs: 72392 -> 72522 (0.18%)
   helped: 8
   HURT: 18
   Inconclusive result (value mean confidence interval includes 0).

   total bytes in shared programs: 1468550 -> 1469170 (0.04%)
   bytes in affected programs: 560486 -> 561106 (0.11%)
   helped: 10
   HURT: 17
   Inconclusive result (value mean confidence interval includes 0).

   total halfregs in shared programs: 13946 -> 13898 (-0.34%)
   halfregs in affected programs: 3642 -> 3594 (-1.32%)
   helped: 21
   HURT: 0
   Halfregs are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
c07a9dca65 nir/opt_sink: Sink load_local_pixel_agx
This is the AGX version of load_output, which shaders can use for framebuffer
fetch. It is beneficial to sink framebuffer fetch as late as possible, both to
reduce register pressure but also to reduce serialization of overlapping
fragments.

Results on a collection of ubershaders:

   total bytes in shared programs: 1468928 -> 1468550 (-0.03%)
   bytes in affected programs: 495300 -> 494922 (-0.08%)
   helped: 24
   HURT: 0
   Bytes are helped.

   total halfregs in shared programs: 14162 -> 13946 (-1.53%)
   halfregs in affected programs: 5148 -> 4932 (-4.20%)
   helped: 27
   HURT: 0
   Halfregs are helped.

   total threads in shared programs: 216896 -> 217664 (0.35%)
   threads in affected programs: 6912 -> 7680 (11.11%)
   helped: 12
   HURT: 0
   Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
596682ad4b nir/opt_sink: Sink load_constant_agx
By the time this runs, we will have already lowered load_ubo and load_vbo to
load_constant_agx so we need to handle the backend version.

This is very important for reducing register pressure in monolithic VS+GS
shaders on AGX. Since no other backend has _agx intrinsics, there's no need for
an option to gate this.

The additional instruction count is from more frequent wait instructions due to
fewer instructions grouped together. This should be mitigated in the future with
an ACO-style latency-reducing scheduler in the backend, after register pressure
is reduced by opt_sink.

total instructions in shared programs: 1793385 -> 1796101 (0.15%)
instructions in affected programs: 199816 -> 202532 (1.36%)
helped: 3
HURT: 941
Instructions are HURT.

total bytes in shared programs: 11799628 -> 11805004 (0.05%)
bytes in affected programs: 1345656 -> 1351032 (0.40%)
helped: 34
HURT: 919
Bytes are HURT.

total halfregs in shared programs: 533151 -> 525818 (-1.38%)
halfregs in affected programs: 40335 -> 33002 (-18.18%)
helped: 613
HURT: 42
Halfregs are helped.

total threads in shared programs: 18910464 -> 18916608 (0.03%)
threads in affected programs: 6144 -> 12288 (100.00%)
helped: 12
HURT: 0
Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:16 -04:00
Alyssa Rosenzweig
d628be082b nir/gather_info: Use nir_op_is_derivative
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:15 -04:00
Alyssa Rosenzweig
6d3425653a nir/opt_gcm: Use nir_op_is_derivative more
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:15 -04:00
Alyssa Rosenzweig
e0246ed8e4 nir/opt_preamble: Use nir_op_is_derivative
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:15 -04:00
Alyssa Rosenzweig
1a788a86c1 nir: Hoist nir_op_is_derivative
Redefine in terms of the algebraic property. This correctly handles the
Mali-specific derivatives.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:15 -04:00
Alyssa Rosenzweig
b77dc9f7d7 nir: Add NIR_OP_IS_DERIVATIVE property
Like IS_SELECTION.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
2023-09-18 08:38:15 -04:00
Rhys Perry
f6f9c07efe radv: disable mesh dispatch XYZ_DIM when possible
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25222>
2023-09-18 12:04:06 +00:00
Rhys Perry
6dd751b3b9 aco: remove unused p_logical_end check when optimizing branching sequence
I don't see why a p_logical_end is expected or required. It might not be
present in some situations, which causes an assertion failure:
 s2: %19646:s[0-1] = p_reload %19701:v[8], 11
 s2: %0:exec,  s1: %8817:scc = s_andn2_b64 %19646:s[0-1], %0:exec
 s2: %8818:s[20-21] = p_cbranch_z %0:exec BB1116, BB1114

No fossil-db changes (gfx1100).

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25244>
2023-09-18 11:19:28 +00:00
Rhys Perry
8d5bd3ca48 aco: check logical_phi_info at p_logical_end when eliminating exec writes
This is when the copies actually happen, not at the branch.

fossil-db (gfx1100):
Totals from 1 (0.00% of 79332) affected shaders:
Instrs: 424 -> 423 (-0.24%)
CodeSize: 2172 -> 2168 (-0.18%)
Latency: 2899 -> 2896 (-0.10%)
Copies: 24 -> 23 (-4.17%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25244>
2023-09-18 11:19:28 +00:00
Mark Collins
87b79078b5 meson: Update libarchive to v3.7.2-2
The wrapdb build script used by v3.7.1-2 would lead to compilation
errors when using glibc which gated id_t's definition behind the
_GNU_SOURCE define which wasn't specified while scanning for types,
this was fixed upstream in wrapdb in v3.7.2-2.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25269>
2023-09-18 11:01:02 +00:00
Rhys Perry
ac48334ecd aco/optimizer_postRA: check overwritten_subdword in is_overwritten_since()
Fixes crash for
dEQP-VK.mesh_shader.ext.in_out.with_f16.permutation_0.mesh_only and
similar tests on GFX11.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 3d29779a25 ("aco/optimizer_postRA: Distinguish overwritten untrackable and subdword.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25223>
2023-09-18 10:26:16 +00:00
Vinson Lee
92012c9bec freedreno/replay: Fix implicit-function-declaration error
../src/freedreno/decode/replay.c: In function ‘safe_ioctl’:
../src/freedreno/decode/replay.c:608:13: error: implicit declaration of function ‘ioctl’ [-Werror=implicit-function-declaration]
  608 |       ret = ioctl(fd, request, arg);
      |             ^~~~~

Fixes: e3bbd1688b ("freedreno/replay: Add limited support for KGSL")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25264>
2023-09-18 09:45:48 +00:00
Pierre-Eric Pelloux-Prayer
63a3a9b23b st/mesa: check renderbuffer before using it
rb being NULL is only checked for in the caller if no-error isn't
used.

cc: mesa-stable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9747
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25209>
2023-09-18 08:18:39 +00:00
Pierre-Eric Pelloux-Prayer
af27ecb089 device_select: add shortcut for MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE
MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE=1 is useful but it's tedious
to type. This commit extends slightly DRI_PRIME/MESA_VK_DEVICE_SELECT
syntax support: if "!" is appended at the end then only the selected GPU
will be made visible to the application.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:28 +00:00
Pierre-Eric Pelloux-Prayer
b935ce0131 docs: update DRI_PRIME documentation
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:27 +00:00
Pierre-Eric Pelloux-Prayer
201662659e device_select_layer: support DRI_PRIME=n
For feature-parity with OpenGL.
See commit "loader: extend DRI_PRIME to support =N".

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:27 +00:00
Pierre-Eric Pelloux-Prayer
ea84b85887 loader: add DRI_PRIME_DEBUG env var
This makes debugging non-working DRI_PRIME selection much easier.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:27 +00:00
Pierre-Eric Pelloux-Prayer
b8d0b1ceb5 loader: extend DRI_PRIME to support =N
DRI_PRIME=1 isn't useful on machines with more than 2 GPUs.

This commit adds support to DRI_PRIME=N syntax meaning: select
the Nth GPU (not counting the default GPU).

So on a 3 GPUs system where drmGetDevices2 returns the following:

   /dev/dri/renderD130 [default]
   /dev/dri/renderD129
   /dev/dri/renderD128

DRI_PRIME=1 would select D129 (as is already the case without this
commit), DRI_PRIME=2 would select D128.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:27 +00:00
Pierre-Eric Pelloux-Prayer
d052baf190 loader: refactor DRI_PRIME handling code
DRI_PRIME has 3 different meanings and this refactoring
separate the handling of them.
No functional changes.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:27 +00:00
Pierre-Eric Pelloux-Prayer
06a3bb75e3 glx: drop the 'libGL' log prefix
Suggested by @ajax in !24750.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-18 07:45:27 +00:00
Samuel Pitoiset
fa4d4f84a1 ac/spm: enable support for multi-instance counters
This is what RGP expects and this will give us more fine grained
results given that all shader engines/shader arrays etc would be
sampled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:32 +00:00
Samuel Pitoiset
414783162a ac/spm: move the counter instance to ac_spm_counter_create_info
This will allow us to configure multi-instance counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:32 +00:00
Samuel Pitoiset
d5a5473185 ac,radv,radeonsi: prepare support for multi-instance SPM generic counters
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
ed0d3d8cbd ac,radv,radeonsi: prepare support for multi-instance SPM SQ counters
Each SQG modules can configure up to 16 counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
af4d4f5203 ac/spm: fix number of instances of GL2C
It's a global block, so the number of instances is equal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
0e4d5b171a radv,radeonsi: make sure to emit GRBM_GFX_INDEX before SQ select registers
This was missing, but not sure if it was required given that only the
first SE is currently sampled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
3e8922d9f7 ac/spm: select correct segment type for per-SE blocks
This currently does nothing because only the first instance is used,
but this will be needed for multi-instance.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
033e49995d ac/spm: use block flags to initialize instance mapping
This simplify this a bit, ideally we would also have a per-SA flag
for performance counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Samuel Pitoiset
037d7d0f5b radv: reserve more CS space in SQTT/SPM paths
This will prevent an assertion when SPM will emit more counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25240>
2023-09-18 07:07:31 +00:00
Caio Oliveira
edd3cd67c2 compiler/types: Use a string table for builtin type names
This avoids the relocations for each of the builtin type names, allowing
all the builtin data to be loaded in read-only memory.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25191>
2023-09-16 15:17:01 +00:00
Caio Oliveira
53149cdd6e compiler/types: Change glsl_type::name to be an uintptr_t
This will allow us later to store builtin names in a different way.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25191>
2023-09-16 15:17:01 +00:00
Caio Oliveira
bf01000a50 compiler/types: Use glsl_get_type_name() to access the type name
This will allow us later to store builtin names in a different way.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25191>
2023-09-16 15:17:01 +00:00
Caio Oliveira
d1e9e7699e compiler/types: Use Python to generate code for builtin types
Will be useful later to generate string tables for the builtin types.

Note we make some extra effort to ensure C++ client code doesn't need to change,
by keeping glsl_type::*_type pointers around.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com> (Python and Meson changes)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25191>
2023-09-16 15:17:01 +00:00
Gert Wollny
b5a79000eb r600/sfn: get rid of the method to get the index mode
Since we always split the index load we can query the value directly
without checking whether it was lowered.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25159>
2023-09-16 12:02:57 +00:00
Gert Wollny
116a389c12 r600/sfn: Sepeate resource and sampler in texture instructions
Fix the use of resource and sampler and keep separate index registers
for both so that indirect resource and sampler access can be done
independently.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25159>
2023-09-16 12:02:57 +00:00
Gert Wollny
cbda74a625 r600/sfn: Add old address to update_indirect_addr
v2: use UNUSED instead of adding (void)var; (Vitaly Kuzmin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25159>
2023-09-16 12:02:57 +00:00
Gert Wollny
56c1e6cef2 r600/sfn: rename method resource_base to resource_id
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25159>
2023-09-16 12:02:57 +00:00
Gert Wollny
552e9ddcc4 r600/sfn: Make address split pass obligatory
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25159>
2023-09-16 12:02:57 +00:00
Gert Wollny
f16582b654 r600: print texture resource index mode separately
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25159>
2023-09-16 12:02:56 +00:00
Jordan Justen
3a307e2248 intel/common: Add sse2_args for 32-bit build when -Dsse2=false was set
Fixes: 543a707b7b ("intel/common: Move intel_clflush.h to intel_mem.h/intel_mem.c")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9762
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25249>
2023-09-15 17:39:55 -07:00
Yiwei Zhang
3c4c263dc7 vulkan/android: improve vkQueueSignalReleaseImageANDROID
There're two issues with the current implementation:
1. Wait semaphores are implicitly required to be SYNC_FD exportable
2. As a queue command that can further record cmds against the wsi
   image, it currently doesn't account for pending cmds in the queue
   beyond the wait semaphores.

This change fixes both by doing a queue submission in the call with a
SYNC_FD external signal semaphore. However, due to Android wsi not
exposing swapchain to icd, we have to cache the signal semaphore in the
queue, otherwise would have to create/destroy in each present.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25185>
2023-09-15 19:03:22 +00:00
Yiwei Zhang
6ed2515df1 vulkan: remove a dup entry from vk_image_usage_to_ahb_usage
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25185>
2023-09-15 19:03:22 +00:00
Samuel Holland
497aecb210 Android.mk: Only link LLVM for radeonsi, not amd_vk
When building for Android, avoid the LLVM dependency if possible.

Cc: mesa-stable
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: Idda03f954b4b5326e23a848e541411b60fcef063
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24007>
2023-09-15 18:43:02 +00:00
Samuel Holland
ec32619cb0 Android.mk: Explicitly enable/disable LLVM support
The AMD Vulkan driver uses LLVM by default, but it is possible to build
the driver without the LLVM dependency. In this case, we must explicitly
disable LLVM support, or else meson will die after failing to find LLVM.

The Android build system already knows when to link libLLVM, so forward
that information to meson.

Cc: mesa-stable
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I7489d3811625b390aaaf2e84e666b4a8d98328b0
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24007>
2023-09-15 18:43:02 +00:00
Samuel Holland
599f47f11c Android.mk: Allow building only Vulkan drivers
Android bundles ANGLE for implementing OpenGL ES and EGL on top of
Vulkan. When using ANGLE, mesa is only needed for its Vulkan drivers.

Cc: mesa-stable
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I034a0af52f9216bc5f1322f584bc591c90222327
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24007>
2023-09-15 18:43:02 +00:00
Dylan Baker
de9bf84501 meson: use a single dependency call for lua
This is a newer Meson construct that allows passing multiple names for
the same dependency to one call. One advantage of this is that if the
first call (lua54) fails, it won't immediately fall back to a subproject
and will try the others before falling back.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25251>
2023-09-15 18:01:38 +00:00
Eric Engestrom
57f8346907 ci/zink: drop redundant MESA_LOADER_DRIVER_OVERRIDE: zink
This job extends `.zink-anv-test` and `.zink-trace-test`, both of which
extend `.zink-test` which already sets this var.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25248>
2023-09-15 17:30:04 +00:00
Tapani Pälli
3251f321b8 mesa: some cleanups for texparam extension checks
Patch removes some redudant _mesa_is_desktop_gl checks, these
extensions are available only in desktop context.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25202>
2023-09-15 17:01:38 +00:00
Erico Nunes
ee3981e84d Revert "ci: disable lima LAVA lab for maintance"
This reverts commit 079604e41e.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25242>
2023-09-15 16:38:06 +00:00
Eric Engestrom
83d856d4bc ci/farm-rules: re-add "run every container and build job when a farm gets re-enabled"
Turns out I was right the first time, I was just missing that this
should only be done in MRs, which @daniels added in 16527f6ffd.

Without this, a "farm re-enable" pipeline will run all the jobs for that
farm, but will have none of the container & build jobs to support these
tests.

This reverts commit 1c3097225a.

Fixes: 1c3097225a ("ci: don't run everything just because a farm gets re-enabled")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25243>
2023-09-15 16:07:17 +00:00
Eric Engestrom
67c7f391b3 ci/farm-rules: rename .disable-farm-mr-rules to make it clear it's only about MRs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25243>
2023-09-15 16:07:17 +00:00
Rob Clark
fa2fc50f81 freedreno/decode: Fix printing chip-id
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25231>
2023-09-15 15:07:33 +00:00
Rob Clark
9fa75efe69 freedreno/layout: Handle 565/etc MSAA special case
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25231>
2023-09-15 15:07:33 +00:00
Rob Clark
4952db73fb freedreno: Fix crash with debug msgs enabled
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25231>
2023-09-15 15:07:33 +00:00
Mike Blumenkrantz
cd2c4927c8 zink: use null attachments for null attachments with dynamic render
using dummy surfaces here is dumb

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25121>
2023-09-15 14:10:31 +00:00
Mike Blumenkrantz
267b997abf zink: propagate rp_tc_info_updated across unordered blits
this otherwise breaks rp optimizing

Fixes: 3a9f7d7038 ("zink: implement unordered u_blitter calls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25121>
2023-09-15 14:10:31 +00:00
Mike Blumenkrantz
12cdd546be zink: use much bigger dummy surfaces
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25121>
2023-09-15 14:10:30 +00:00
Mike Blumenkrantz
047213fcba tu: handle unused color attachments without crashing
if the format is not set then this attachment must be ignored

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25121>
2023-09-15 14:10:30 +00:00
Mike Blumenkrantz
4272234736 lavapipe: EXT_load_store_op_none
free real estate

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25213>
2023-09-15 13:40:08 +00:00
Connor Abbott
73a9f9c5ca tu: Actually emit patchpoint for viewports with FDM
At some point I intended to track whether the pipeline had FDM enabled
and set a dirty flag, but I realized that wasn't necessary. However I
forgot to remove the useless tu_cmd_state::pipeline_has_fdm and the
viewport/scissor emission code was still using it. Fix that.

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25225>
2023-09-15 13:02:34 +00:00
Connor Abbott
64ed357699 tu: Fix assert in FDM state emission
Making the sub_cs not writeable switches the BO we're emitting to, which
causes an assert failure in tu_cs_end_sub_stream() because it looks like
we have a mismatched start/end. Just make it not writeable later.

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25225>
2023-09-15 13:02:34 +00:00
Connor Abbott
f8bb1b22fb tu: Fix tu6_emit_*_fdm size call
cs is not initialized until the line after this.

Fixes: 95104707f1 ("tu: Basic a7xx support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25225>
2023-09-15 13:02:34 +00:00
Connor Abbott
749e1de9d3 tu: Fix per-view viewport state propagation
We no longer use viewport::per_view_viewport, it's part of the program
state instead, but we forgot to delete it and rewrite all users.

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25225>
2023-09-15 13:02:34 +00:00
Eric Engestrom
21fa677712 ci: document which image tags need to be bumped when updating {alpine,debian,fedora}/x86_64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25120>
2023-09-15 12:12:31 +00:00
Eric Engestrom
c1990cdb00 ci: document which image tags need to be bumped when updating piglit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25120>
2023-09-15 12:12:31 +00:00
Daniel Stone
7521dbae60 ci: Fix pre-merge pipelines with no code changes
Make sure we don't end up with manual container jobs in MR pipelines,
because they'll never start. This cleans up the container and build
rules so always 'do the right thing' on MRs (container+build if
required, nothing if not) and user branches (all manual).

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25219>
2023-09-15 11:29:34 +00:00
Sviatoslav Peleshko
b1a63d5418 intel/fs: Check if the whole ubo load range is in the push const range
Before this, we were checking only the beginning of the ubo range, so
partially overlapping loads were trying to load undefined data.

Fixes: b2da1238 ("i965: Use pushed UBO data in the scalar backend.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9748
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/25111>
2023-09-15 10:55:24 +00:00
Roman Stratiienko
2bd86f8048 panvk: Add Android ICD loader entry point
Enables offscreen rendering on Android.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25194>
2023-09-15 10:39:02 +00:00
Mike Blumenkrantz
dd6a7a8e61 lavapipe: clamp cache uuid size
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25232>
2023-09-15 03:48:31 +00:00
Mike Blumenkrantz
b73ebc6bfc zink: flag db maps as unsynchronized
these otherwise can be created using the wrong slab

Fixes: 98c411a2a1 ("zink: add PERSISTENT for db buffer maps")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25227>
2023-09-15 02:30:32 +00:00
Mike Blumenkrantz
a5be0385c7 aux/tc: don't use pipe_buffer_create_with_data() for rp-optimized subdata
this function doesn't use the correct tc map flags, which causes
drivers to (potentially) use the wrong slab for transfer allocation
and then crash

Fixes: 51ad269198 ("aux/tc: handle stride mismatch during rp-optimized subdata")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25227>
2023-09-15 02:30:32 +00:00
Mike Blumenkrantz
81dd39de01 aux/tc: fix rp info handling around tc_sync calls
if a set_framebuffer_state call has occurred but no draws have been
triggered, the rp info must be preserved for the driver to (eventually)
use after the sync

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25227>
2023-09-15 02:30:32 +00:00
Caio Oliveira
c9b7639a7d compiler/types: Fix array name dimension flipping for unsized arrays
Rewrite the code to use linear_asprintf and always flip the
dimensions in place if the element type is an array.  The new
code will now (correctly) flip even in the case of unsized arrays.

The flipping is done by swapping the ranges [a, b) and [b, c), as
shown below, with element type int[...] and an array of length 4.

```
           +--------------- a: first bracket in the name
           |    +---------- b: end of the element name
           |    |  +------- c: end of the array name
           |    |  |
        int[...][4]$

will be transformed into

        int[4][...]$
```

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23278>
2023-09-15 01:21:40 +00:00
Caio Oliveira
ea998ddd34 glsl: Annotate _mesa_glsl_error() with PRINTFLIKE
And fix all the errors it found.

Note that for the unsized array error, we will print the
toplevel type -- so that the fact that an inner array is
unsized can be seen.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25200>
2023-09-15 00:45:05 +00:00
Emma Anholt
2db04de6df freedreno: Build drm subdir before perfcntrs, which uses it.
Fixes: f8ac568955 ("freedreno: Only add drm/computerator when system_has_kms_drm")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25229>
2023-09-15 00:06:27 +00:00
Helen Koike
c5a6cdfeb9 ci: add locked flag to bindgen-cli on x86_64_build.sh
since the dependencies were not locked, they got updated and generating
a new container is throwing errors like the following:

error: failed to compile `bindgen-cli v0.62.0`, intermediate artifacts can be found at `/tmp/cargo-installcP54m7`
Caused by:
  package `memchr v2.6.3` cannot be built because it requires rustc 1.61 or newer, while the currently active rustc version is 1.60.0

rust packages have Cargo.lock file from when they were released, so add
--locked flag to use it.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25226>
2023-09-14 23:30:27 +00:00
Ian Romanick
92f5442489 intel/fs: Merge copy prop dataflow loops
This is kept as a separate commit because the change looks like a lot
more than it it. The order of the two loops is swapped, then the two
loops are merged.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
fa2757aa97 intel/fs: Use rb_tree for copy prop dataflow
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
35644bb483 intel/fs: Use rb_tree to store ACP entries by destination
Using a single data structure seems better. There's no appreciable
performance change. On batman_arkham_city_goty.foz, the difference
reported was 0.48%±0.36% (n=20). Several commits in the MR, including
some that should have no effect at all, reported similar changes. I
attribute this primarily changing of loop alignments and similar.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
c28bf1a249 intel/fs: Use rb_tree to store ACP entries by source
On batman_arkham_city_goty.foz, this improves fossil-db time by
-3.83%±0.24% (n=20). This fossil takes the longest time of any in my
database.

v2: Add some comments for cmp_entry_src_entry_src and
cmp_entry_src_nr. Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
06bdd3eac0 intel/fs: Encapsulate per-block ACP in a structure
This simplifies some later changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
c262752d74 intel/fs: Make opt_copy_propagation_local file private
This annoyed me durning development of this MR. Every time I changed the
parameters to this internal function, I had to modify a public header
file... and trigger a much large rebuild.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
0946108298 intel/fs: Simplify check in can_propagate_from
The larger predicate here already requires that inst->opcode must be
BRW_OPCODE_MOV, so it can't BRW_OPCODE_SEL. With that removed, the
other simplifications are pretty straight forward.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
1f15a0f8b2 intel/fs: Don't loop in try_constant_propagate
The caller already loops over the sources. This means that the caller
must loop over the sources in reverse because constant propagation
prefers to propagate into the last sources first.

The shader-db and fossil-db changes (below) are all due to SEL
instructions. Changing the order sources are visited changes whether a
SEL with two immediate sources is

    (+f0.0) sel     g12    IMM_A    IMM_B

or

    (-f0.0) sel     g12    IMM_B    IMM_A

The ordering of the sources affects the order the constant combining
encounters the values, and the determines which value is "combined"
and which value remains an immediate.

This affects the results by luck. If there are two instructions:

    (+f0.0) sel     g12    IMM_A    IMM_B
    (+f0.0) sel     g13    IMM_A    IMM_C

Picking IMM_A is advantageous over picking IMM_B and IMM_C. Since the
selection algorithm in constant combining is greedy, this case
requires the algorithm see the values in just the right order for the
right thing to happen.

v2: Rebase on many, many changes. Move instruction source fixup
reordering out or try_constant_propagate.

v3: Rebase on !7698.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
ab23d89ade intel/fs: Move src.file checks out of try_constant_propagate and try_copy_propagate
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:23 +00:00
Ian Romanick
b5b2338c5c intel/fs: Make try_constant_propagate and try_copy_propagate file private
This annoyed me durning development of this MR. Every time I changed the
parameters to this internal function, I had to modify a public header
file... and trigger a much large rebuild.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:22 +00:00
Ian Romanick
8665e37960 intel/fs: Don't try to copy propagate into a source again after progress is made
If the linked list structure used depended on the list head to know when
to terminate, this would be a pretty serious bug. If try_constant_propage
or try_copy_propagate make progress, inst->src[i].nr will change. This
results in the foreach_in_list using a different list header on later
iterations of the loop.

This causes two shaders in shader-db and 9 shaders in fossil-db to
change. Looking at the code changes, these are cases where there was a
copy of a copy that gets propagated. The part that confuses me is the
VGRF numbers involved should **not** hash to the same bucket, so it
should be impossible to find the original source from the intermediate
VGRF.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:22 +00:00
Ian Romanick
e488b46419 intel/fs: Don't continue fixed point iteration just because liveout changes
Unless the change in liveout also causes livein to change, updates to
liveout cannot have any global effect. Changes to livein already flag
additional interation.

I had additional changes in this area that didn't pan out. While working
on those change, I was a little confused about this bit of code. It's
unnecessary, so it's better to delete it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:22 +00:00
Ian Romanick
385f01c89b util/rb-tree: Inline rb_tree_init
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:22 +00:00
Ian Romanick
0f917d93bf util/rb-tree: Work around C++'s dislike of offsetof
This is the same technique used in src/compiler/glsl/list.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:22 +00:00
Ian Romanick
f7472f23ba glsl/list: Clean up an inappropriate comment
🤦

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25091>
2023-09-14 22:31:22 +00:00
Jordan Justen
6f1b1d6330 intel/genxml: Auto-import genxml files using genxml_import.py
$ src/intel/genxml/genxml_import.py --import

This can be reversed with:

$ src/intel/genxml/genxml_import.py --flatten

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
cd0c758f32 intel/genxml: Start Xe2 support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
57b5631297 intel/decoder: Implement support for importing genxml
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
0ec95e425c intel/decoder: ralloc_steal() values from spec context for fields and enums
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
0495f952d4 intel/genxml: Add genxml_import.py script
This script can:
 * validate that genxml files do not duplicate imported items
 * add imports to genxml files and optimize the file by dropping
   duplicate items
 * reverse the import operation by flattening genxml files

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
6ad2f39bab intel/genxml: Add GenXml.flatten_xml() method
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
c0f7feb239 intel/genxml: Add GenXml.add_xml_imports method
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
9e5190ad1f intel/genxml: Drop assertion to allow for importing
For example, gen11.xml will import the HEVC_ARBITRATION_PRIORITY
struct from gen9.xml.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
614aa2e62b intel/genxml: Add GenXml.optimize_xml_import()
This function drops duplicated items from a genxml file when they are
equivalent to the same item imported from another genxml file.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
1285337218 intel/genxml: Add all xml files as pack dependencies
Since the output can now depend on other imported xml files, we need
to add them all as dependencies to ensure that if any xml file is
changed, then all pack files are rebuilt.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:16 -07:00
Jordan Justen
b076b4f99b intel/genxml: Add support for excluding items when importing
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:15 -07:00
Jordan Justen
6cc21dc8b5 intel/genxml: Support importing from another genxml file
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20593>
2023-09-14 11:05:15 -07:00
Daniel van Vugt
bb06db5a62 glx: Increment dpy->request before issuing an error that had no request
This ensures the sequence number is unique and recent enough for callers
of `glXQueryDrawable` using `XNextRequest` to selectively trap errors.
The same approach is already used in `glXCreateContextAttribsARB`.

Suggested-by: Sebastian Keller <skeller@gnome.org>
Related-to: https://gitlab.gnome.org/GNOME/mutter/-/issues/3007
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25173>
2023-09-14 16:33:29 +00:00
Konstantin Seurer
73fec95358 radv: Remove ray tracing shader module identifier skips
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25142>
2023-09-14 16:07:46 +00:00
Konstantin Seurer
28dcc5959d radv/rt: Handle stages without nir properly
Fixes: e039e3cd76 ('radv/rt: Store NIR shaders separately')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25142>
2023-09-14 16:07:46 +00:00
Konstantin Seurer
3fd9894e3a radv: Update navi21 llvm fails
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25010>
2023-09-14 15:39:39 +00:00
Konstantin Seurer
77bf1408f3 radv: Don't advertise features requiring PS epilogs with LLVM
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25010>
2023-09-14 15:39:39 +00:00
Konstantin Seurer
4c168635f8 ac/llvm: Use float types for float atomics
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25010>
2023-09-14 15:39:39 +00:00
Konstantin Seurer
60e7b1c69c ac/llvm: Use the correct return type for uadd_carry and usub_borrow
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25010>
2023-09-14 15:39:39 +00:00
Konstantin Seurer
3ae0562c23 ac/llvm: Fix typed loads with 16bit formats
For some reason, LLVM can't handle those. Emit a 32bit load and type
conversion instead,

Fixes: 22ca8c8 ("ac/llvm: Implement typed buffer load intrinsic.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25010>
2023-09-14 15:39:38 +00:00
Konstantin Seurer
0cada27826 radv/ci: Improve ray tracing skips
I didn't know they were regexes. This also excludes all "1048576" tests.
They build an acceleration structure with 1 primitive 1048576 times
which only warms up the Valve farm and doesn't accomplish anything else.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24720>
2023-09-14 15:12:44 +00:00
Konstantin Seurer
97b1caf9f6 radv: Perform multiple sorts in parallel
This was the last part that didn't scale with multiple infos. Reducing
the amount of barriers in this case improves DOOM Eternal performance by
50%. (Running with low resolution)

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24720>
2023-09-14 15:12:44 +00:00
Konstantin Seurer
44c47054bc radv/radix_sort: Vendor the radix sort dispatch code
This needs to be done so we can optimize it for occpuancy when building
multiple acceleration structures in parallel. Changes to the original
code:

- Change // to /* */
- clang-format
- Replace vkCmd calls with calls to the driver entrypoints
- Add a light weight info struct
- Use radv_fill_buffer directly

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24720>
2023-09-14 15:12:44 +00:00
Konstantin Seurer
1cacc64ea7 radv: Remove dead radix_sort_vk_get_memory_requirements call
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24720>
2023-09-14 15:12:43 +00:00
Ruijing Dong
fb0f51bc64 radeonsi/vcn: change max_poc to fixed value for hevc encoder.
problem: max_poc means the number of bits used in poc lsb
         in slice header, and it should not be related to GOP
	 size. When large GOP size used, it could generate
	 corrupted video, as the POC could not be correctly
	 decoded.

solution: use fixed value of max_poc (16) for now.

Cc: mesa-stable
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25214>
2023-09-14 14:43:15 +00:00
Samuel Pitoiset
84390c5c98 ac/spm: initialize and set instance mapping for counters
This configures global, per-SE and per-SA counters with different
indexes. This is still unused because only for the first instance is
used by RADV/RadeonSI, but this will be changed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
0864a7dfa9 ac/spm: rework how segment muxsel RAM are filled
This is more close to PAL and it will be easier to add GFX11 support
on top of it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
6ae64900e2 ac/spm: fix checking if the counter instance is valid
This should be compared against the number of global instances, and
there is also an off-by-one error.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
90d9406436 ac/perfcounter: compute the number of global instances of TCP,SQ,GL1C and GL2C
This will be used by SPM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:19 +00:00
Samuel Pitoiset
60cb257d26 ac/perfcounter: set the number of instances of GL1C to 4
According to PAL there is 4 GL1C quadrants. This will also be used
by SPM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
10dc97b20f ac/gpu_info: init num_cu_per_sh from the kernel
This will be used to configure the number of instances of TCP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
9552716208 ac/spm: add SPM block definition for GFX10-GFX10.3
Instead of using magic values.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
b1ce30539b ac/spm: remove useless SPM block setting for GFX9 and older GPUs
SPM is only implemented for GFX10+ on RADV/RadeonSI, although it's
technically possible on GFX9 but unused by RGP, so don't care.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
303184e4e5 radv,radeonsi: use AC_SPM_SEGMENT_TYPE_xxx instead of magic values
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:18 +00:00
Samuel Pitoiset
db6e16a515 radv: enable the PKT3 CAM bit for some SPM register writes
PAL does that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
2023-09-14 14:17:18 +00:00
David Rosca
d57241d290 radeonsi/vcn: Set H264/HEVC chroma sample location in bitstream
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25078>
2023-09-14 13:39:59 +00:00
David Rosca
8e76b8fb35 frontends/va: Parse chroma sample location in H264/HEVC SPS
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25078>
2023-09-14 13:39:59 +00:00
Samuel Pitoiset
aca2adc36c ac/spm: add SPM counters configuration for GFX11
All SQ counters changed to SQ_WGP and the L2 miss changed too.
Sourced from PAL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25175>
2023-09-14 12:30:52 +00:00
Samuel Pitoiset
42d67183e7 ac/perfcounter: add new SQ_WGP block for GFX11+
According to PAL, these SQ counters can be sampled at WGP granularity.
Some SPM counters captured for RGP are using this GPU block.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25175>
2023-09-14 12:30:52 +00:00
Samuel Pitoiset
31e6c05527 ac,radv,radeonsi: rework SPM counters configuration and share it
This should be easier to add GFX11 support.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25175>
2023-09-14 12:30:52 +00:00
Samuel Pitoiset
f88338f801 issue_templates/Bug Report: fix outdated URL for GFXReconstruct
The URL moved.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25218>
2023-09-14 10:22:39 +00:00
Daniel Schürmann
6eaf416f35 aco/insert_exec_mask: Simplify WQM handling (2/2)
by calculating WQM requirements on demand.

No fossil-db changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:23 +00:00
Daniel Schürmann
5f66723188 aco/insert_exec_mask: Simplify WQM handling (1/2)
by using p_end_wqm as indicator for when to end WQM mode.

Totals from 10049 (13.12% of 76572) affected shaders: (GFX11)

MaxWaves: 301126 -> 301136 (+0.00%)
Instrs: 7061909 -> 7049272 (-0.18%); split: -0.21%, +0.03%
CodeSize: 37720684 -> 37664244 (-0.15%); split: -0.18%, +0.03%
VGPRs: 357204 -> 357180 (-0.01%); split: -0.13%, +0.12%
Latency: 62757830 -> 62827080 (+0.11%); split: -0.06%, +0.17%
InvThroughput: 8589248 -> 8589963 (+0.01%); split: -0.02%, +0.02%
VClause: 132541 -> 132547 (+0.00%); split: -0.03%, +0.03%
SClause: 322916 -> 322964 (+0.01%); split: -0.04%, +0.05%
Copies: 546446 -> 547657 (+0.22%); split: -0.13%, +0.35%
Branches: 189527 -> 188293 (-0.65%)
PreSGPRs: 332792 -> 332529 (-0.08%); split: -0.08%, +0.00%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:23 +00:00
Daniel Schürmann
45f6d38a76 aco: insert a single p_end_wqm after the last derivative calculation
This new instruction replaces p_wqm.

Totals from 28065 (36.65% of 76572) affected shaders: (GFX11)
MaxWaves: 823922 -> 823952 (+0.00%); split: +0.01%, -0.01%
Instrs: 22221375 -> 22180465 (-0.18%); split: -0.26%, +0.08%
CodeSize: 117310676 -> 117040684 (-0.23%); split: -0.30%, +0.07%
VGPRs: 1183476 -> 1186656 (+0.27%); split: -0.19%, +0.46%
SpillSGPRs: 2305 -> 2302 (-0.13%)
Latency: 176559310 -> 176427793 (-0.07%); split: -0.21%, +0.14%
InvThroughput: 26245204 -> 26195550 (-0.19%); split: -0.26%, +0.07%
VClause: 368058 -> 369460 (+0.38%); split: -0.21%, +0.59%
SClause: 857077 -> 842588 (-1.69%); split: -2.06%, +0.37%
Copies: 1245650 -> 1249434 (+0.30%); split: -0.33%, +0.63%
Branches: 394837 -> 396070 (+0.31%); split: -0.01%, +0.32%
PreSGPRs: 1019139 -> 1019567 (+0.04%); split: -0.02%, +0.06%
PreVGPRs: 925739 -> 931860 (+0.66%); split: -0.00%, +0.66%

Changes are due to scheduling and re-enabling cross-lane optimizations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:23 +00:00
Daniel Schürmann
28904839da aco: don't insert a copy when emitting p_wqm
Totals from 351 (0.46% of 76572) affected shaders: (GFX11)

Instrs: 709202 -> 709600 (+0.06%); split: -0.02%, +0.08%
CodeSize: 3606364 -> 3608040 (+0.05%); split: -0.01%, +0.06%
Latency: 3589841 -> 3590756 (+0.03%); split: -0.01%, +0.03%
InvThroughput: 463303 -> 463324 (+0.00%)
SClause: 28147 -> 28201 (+0.19%); split: -0.02%, +0.22%
Copies: 43243 -> 43204 (-0.09%); split: -0.24%, +0.15%
PreSGPRs: 21028 -> 21042 (+0.07%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:22 +00:00
Daniel Schürmann
040142684c aco: make p_wqm a marker instruction without Operands/Definitions
Totals from 28277 (36.93% of 76572) affected shaders: (GFX11)

MaxWaves: 833930 -> 833898 (-0.00%); split: +0.01%, -0.01%
Instrs: 21366950 -> 21353346 (-0.06%); split: -0.11%, +0.05%
CodeSize: 112855368 -> 112610508 (-0.22%); split: -0.24%, +0.03%
VGPRs: 1157748 -> 1158540 (+0.07%); split: -0.10%, +0.17%
SpillSGPRs: 2465 -> 2463 (-0.08%); split: -0.16%, +0.08%
Latency: 168339886 -> 168383646 (+0.03%); split: -0.10%, +0.12%
InvThroughput: 25164895 -> 25158376 (-0.03%); split: -0.08%, +0.06%
VClause: 347660 -> 346256 (-0.40%); split: -0.55%, +0.15%
SClause: 794460 -> 799521 (+0.64%); split: -0.33%, +0.97%
Copies: 1151908 -> 1148370 (-0.31%); split: -0.54%, +0.23%
Branches: 359447 -> 359437 (-0.00%); split: -0.01%, +0.00%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:22 +00:00
Daniel Schürmann
1275981df8 aco: don't optimize cross-lane instructions across p_wqm
We will use p_wqm as a marker in the next step.

Totals from 8846 (11.55% of 76572) affected shaders: (GFX11)

Instrs: 7031274 -> 7072729 (+0.59%); split: -0.02%, +0.60%
CodeSize: 37060272 -> 37355244 (+0.80%); split: -0.01%, +0.80%
VGPRs: 402660 -> 398724 (-0.98%); split: -0.99%, +0.01%
Latency: 62231926 -> 62322311 (+0.15%); split: -0.01%, +0.15%
InvThroughput: 10341361 -> 10392589 (+0.50%); split: -0.00%, +0.50%
VClause: 105344 -> 105368 (+0.02%); split: -0.03%, +0.05%
SClause: 218330 -> 218469 (+0.06%); split: -0.07%, +0.14%
Copies: 378609 -> 377644 (-0.25%); split: -0.42%, +0.17%
Branches: 97218 -> 97207 (-0.01%); split: -0.01%, +0.00%
PreSGPRs: 307654 -> 307644 (-0.00%); split: -0.08%, +0.08%
PreVGPRs: 314744 -> 308650 (-1.94%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:22 +00:00
Daniel Schürmann
0907b53740 aco/insert_exec_mask: set Exact mode after p_discard_if when necessary
Fixes: 5e9df85b1a ('aco: optimize discard_if when WQM is not needed afterwards')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:22 +00:00
Rhys Perry
41b6020ff3 aco: remove fast path in insert_exec_mask's process_instructions
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:22 +00:00
Daniel Schürmann
0e8192a76b aco: append p_logical_end after monolithic RT shaders
Fixes: bdec044c88 ('aco: Do not fixup registers if there are no shader calls')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25038>
2023-09-14 09:25:22 +00:00
Dave Airlie
c5fb2fff18 ac,radeonsi: move vcn enc av1 default cdf file to common
This can be used by radv.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25196>
2023-09-14 07:51:24 +00:00
Dave Airlie
daa01703cc ac,radeonsi: move vcn enc structs to common
This just moves the header to make it easier to share with radv.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25196>
2023-09-14 07:51:24 +00:00
Samuel Pitoiset
f8a7c8edd1 radv: emit relocation for mesh/task shaders
RGP requires shaders to be contiguous in memory.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25144>
2023-09-14 07:19:26 +00:00
Samuel Pitoiset
312103e0ff radv: set THREAD_TRACE_MARKER_ENABLE for mesh/task draws
PAL does that.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25144>
2023-09-14 07:19:25 +00:00
Samuel Pitoiset
505c2ee92d ac/rgp: use correct API stage string for mesh/task shaders
This allows RGP to report the ISA.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25144>
2023-09-14 07:19:25 +00:00
Samuel Pitoiset
12f1c5d23b radv: fix instruction timing on GFX11
GFX11 seems to operate on the last active CU.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25171>
2023-09-14 06:29:10 +00:00
Samuel Pitoiset
c04b10155e radv: disable unsupported hw shader stages for RGP on GFX11+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25171>
2023-09-14 06:29:10 +00:00
Samuel Pitoiset
4f5dd54713 radv: set THREAD_TRACE_TOKEN_MASK.BOP_EVENTS_TOKEN_INCLUDE on GFX10.3+
PAL does that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25171>
2023-09-14 06:29:10 +00:00
Daniel Stone
16527f6ffd ci: Only look at file changes for MRs
Lists of files changed are only really relevant if we're pushing an MR.
We don't want to trigger 'user added .ci-farms-disabled/igalia' because
the user pushed a branch when this file was already present upstream.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25205>
2023-09-14 05:53:47 +00:00
Daniel Stone
0e1ee4fac9 ci: Use container rules for containers
If we have diverging rulesets, we can have the base container jobs
possibly not being created, and the leaf container jobs then trying to
run, which ends up in us failing to create pipelines.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25205>
2023-09-14 05:53:47 +00:00
Daniel Stone
e67868fa19 ci: Always set user container jobs to manual
Don't require source changes to create the jobs, just create them
always.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25205>
2023-09-14 05:53:47 +00:00
Daniel Stone
7cb86d9adc ci: Move farm-disable rules before anything else
For consistency, make our 'when: never' rules be the first rules to
match any job, either build or container.

Otherwise we could end up with some jobs having when: never and others
having when: manual.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25205>
2023-09-14 05:53:47 +00:00
Tapani Pälli
3ec953ed75 iris: modify Wa_14014414195 to use intel_needs_workaround
Only applies to DG2, this was fixed in MTL.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25197>
2023-09-14 04:25:48 +00:00
Dave Airlie
3740b6f599 radv/video: take db alignment into account when allocating images.
Make sure to take the db alignment into account when sizing the underlying
images.

Fixes a 360p sample from Lynne.

Cc: mesa-stable
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25168>
2023-09-14 01:48:49 +00:00
Mark Collins
dee280249c meson: Warn about side-effects from DRM for FD KMDs
Any build which requires Turnip to link to libdrm will cause a
runtime dependency which could be a compatibility hazard on
platforms such as Android which generally don't ship with libdrm.
This hazard could be unintentionally triggered and to avoid this
from happening, a warning is now issued when building FD with msm
alongside other backends or if DRM is enabled due to building a
Gallium driver using DRM.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Mark Collins
ce124328a0 freedreno+meson: Add lua+libarchive+libxml from Meson WrapDB
These dependencies are required for building freedreno tools but on
platforms such as Android, these aren't included and would need to
be built from source. The easiest way to do this was using the
Meson WrapDB. Additionally, warnings were added when these deps are
missing as the decode tools will silently not be built otherwise.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Mark Collins
b91f9f68f0 freedreno/decode: Support building replay for multiple KMDs
As `freedreno_kmds` can contain both `msm` and `kgsl`, this case
would just produce a build with just KGSL due to the precedence of
the check which is inconsistent behavior. Now `replay` is built for
all active KMDs with a suffix for the KMD (eg: replay-kgsl/replay-msm).

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Mark Collins
f8ac568955 freedreno: Only add drm/computerator when system_has_kms_drm
These are both MSM-DRM specific subprojects which depend on it and
cannot be built without, this change is required to allow for KGSL
freedreno tool builds to compile successfully.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Mark Collins
a0cca5f6eb freedreno/rnn: Remove %n usage in fprintf
fprintf was utilized with %n to count the amount of characters it
outputted but this was redundant since it was at the end of the
statement and fprintf itself returns the amount of characters it
writes out.

It should be noted that %n is a compatibility hazard on Android as
it isn't supported on Android due to security reasons.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Danylo Piliaiev
73d0286eb5 freedreno/replay: Add "gpu_print" function for command streams
Allows to dump GPU memory, e.g.
 gpu_print(&ctx, cs, 0x4000086080, 4);

would print 4 dowrds from 0x4000086080:
 CP Log [0]:
         20002000 47340000 20012001 47340001

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Danylo Piliaiev
cad065cd00 freedreno/replay: Add "print" instr to ir3 asm to be used in replay
Could be used in shader assembly from rddecompiler when overriding
the cmdstream.

Usage:
 print r1.x, r3.z

 First arguments is three consecutive registers used for internal print
 needs.
 Second arg is register to print.

Output:
 Shader Log Entries: 36
 [0] 00000004 0.0000
 [1] 00000000 0.0000
 [2] 00000000 0.0000
 [3] 00000000 0.0000
 [4] beadc429 -0.3394
 [5] beadc429 -0.3394

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Danylo Piliaiev
c22f894bd1 freedreno/rddecompiler: Update to handle a7xx
Also make rdcompiler compilable for Android.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
Danylo Piliaiev
e3bbd1688b freedreno/replay: Add limited support for KGSL
KGSL doesn't support IOVAs being set form userspace, so as a workaround
we pre-allocate a single buffer and hope that it always starts from the
same address.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25005>
2023-09-13 22:20:13 +00:00
José Roberto de Souza
e2648d4255 anv: Remove i915_drm.h include from common code
With the previous commit we are now able to build Anv without
including i915_drm.h from common code.

This is important as avoids that i915 specific code is included in
common code by mistake.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25044>
2023-09-13 13:10:59 -07:00
José Roberto de Souza
5d3c5a7921 anv: Move i915 handling of imported bos bo_flags
Imported bos already imported need special handling in i915.
That handling was moved to
anv_i915_gem_import_bo_alloc_flags_to_bo_flags() as the number of
imported bos is low.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25044>
2023-09-13 13:10:59 -07:00
José Roberto de Souza
e1f846f790 anv: Move bo_alloc_flags_to_bo_flags() to backend
The bo_flags are i915 specific and should not be handled in common
code, so here adding it to backend as it is in the hot-path.

There still i915 bo_flags handling in anv_device_import_bo() that
will be handled in the next patch.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25044>
2023-09-13 13:10:59 -07:00
José Roberto de Souza
8b672c7b2c anv: Move i915 specific code from common anv_gem.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25212>
2023-09-13 19:31:45 +00:00
José Roberto de Souza
fc0acf6d90 anv: Move i915 specific gem_set_caching to backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25212>
2023-09-13 19:31:45 +00:00
Mike Blumenkrantz
b8a9c72561 vk/enum2str: add more max enum vendors
Acked-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25210>
2023-09-13 18:57:42 +00:00
Sviatoslav Peleshko
d09aac5e64 zink: Change zink_vertex_elements_hw_state::b.strides to VkDeviceSize
Currently zink_vertex_elements_hw_state::b.strides is an array of 32-bit
unsigned values, while CmdBindVertexBuffers2EXT expects an array of
VkDeviceSize (64-bit unsigned). Instead of converting them for a call,
just change the type of the array itself.

Fixes: 76725452 ("gallium: move vertex stride to CSO")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9765
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25208>
2023-09-13 18:26:57 +00:00
Mike Blumenkrantz
9399165bd4 aux/tc: fix renderpass tracking fb state clobber scenario
in a stream like:
* set fb state (A)
* flush
* set fb state (B)
* draw -> driver query
* flush

the "driver query" should return the tc info corresponding to the most
recent fb state (B). previously this would increment to C because
the flag for incrementing at the start of a batch was set

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25206>
2023-09-13 17:50:58 +00:00
José Roberto de Souza
79ba431d4a intel: Sync xe_drm.h
Sync xe_drm.h with commit e51e857ffad4 ("drm/xe/uapi: Remove useless max_page_size").
Most relevant changes are the removal of max_page_size from
drm_xe_query_mem_region and the typo fix in XE_QUERY_CONFIG_MIN_ALIGNMENT.

Signed-off-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/25162>
2023-09-13 16:38:15 +00:00
Daniel Stone
69e3af2037 ci/zink: Add another conversion fail on a618
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25207>
2023-09-13 16:01:24 +00:00
Daniel Stone
99ec13742b ci/radeonsi: Skip more really slow tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25207>
2023-09-13 16:01:24 +00:00
Konrad Dybcio
6067aba9e6 freedreno: Include speedbin fallback in 740 chipid to fix probing
The kernel exposes CHIP_ID, which consists of:

[63:48] const 0 / reserved
[47:32] speedbin (default 0xffff)
[31:0 ] actual gpu chip ID

Fix the 740 chip id to make it probe correctly.
Keep the existing entry for the downstream KGSL driver.

Fixes: cd3719be7d ("freedreno: Fully define a730 and a740 device properties")
Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25204>
2023-09-13 15:27:17 +00:00
Sil Vilerino
d48f2469be aux/tc: Add ASSERTED to unreferenced release build variable
Fixes MSVC build error src/gallium/auxiliary/util/u_threaded_context.c(3184): error C4189: 'size': local variable is initialized but not referenced

Fixes: 51ad269198 ("aux/tc: handle stride mismatch during rp-optimized subdata")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25203>
2023-09-13 13:13:51 +00:00
Vlad Schiller
ca9734c223 pvr: Use correct index when writing query availability data
The availability data would be written to a different location in
the user provided buffer depending on whether the query for a given
index was available. Fix this by using fixed indicies when writing
the query and availability data.

Fixes conformance failures seen in the
dEQP-VK.query_pool.occlusion_query.get_reset_* test group when
implementing VK_EXT_host_query_reset.

Fixes: 279c7c6d5a ("pvr: Implement vkGetQueryPoolResults API.")
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25116>
2023-09-13 12:47:09 +00:00
Erik Faye-Lund
210f1e14d5 panfrost: delete stale editorconfig file
We no longer use 8-space indent in panfrost, so let's remove the
needless .editorconfig, and instead inherit the 3-space indent from the
toplevel .editorconfig.

Fixes: 0afd691f29 ("panfrost: clang-format the tree")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25147>
2023-09-13 11:11:21 +00:00
Mike Blumenkrantz
2978b85789 zink: don't warn about missing scalarBlockLayout on v3dv
technically v3dv doesn't support the "full" feature, but it does support
enough of it to run zink without any issues

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25201>
2023-09-13 10:30:05 +00:00
Eric Engestrom
ced3ee7898 ci/windows: drop build rules from test jobs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25183>
2023-09-13 09:40:18 +00:00
Eric Engestrom
8ee6e3d8d6 ci/windows: add windows docker runner tags to .windows-docker-vs2019
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25183>
2023-09-13 09:40:18 +00:00
Eric Engestrom
87281e7dd4 ci/windows: centralize definition of windows runners tags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25183>
2023-09-13 09:40:18 +00:00
Samuel Pitoiset
6a0fb8244a zink/ci: update list of expected failures for POLARIS10/NAVI10
Fixed since piglit has been updated to
f7db20b03de6896d013826c0a731bc4417c1a5a0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25199>
2023-09-13 09:02:44 +00:00
Eric Engestrom
1c3097225a ci: don't run everything just because a farm gets re-enabled
Let the other rules take care of this, as they did before
7cf13ea504.

Fixes: 7cf13ea504 ("ci: skip containers & build jobs when disabling a farm")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25151>
2023-09-13 07:50:21 +00:00
Roman Stratiienko
907b96f1e7 v3dv: Enable VK API v1.2 for Android
Now as all features are in place, we can enable it.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
2023-09-13 07:27:21 +00:00
Roman Stratiienko
733909a637 v3dv/android: Add AHardwareBuffer support
The patch allows enabling Vulkan-based UI (SKIA, HWUI) on Android.
To enable - add 'TARGET_USES_VULKAN := true' into your device.mk file.

Passes:
 - dEQP-VK.api.external.memory.android_hardware_buffer.*
 - android.graphics.cts.BasicVulkanGpuTest
 - android.graphics.cts.MediaVulkanGpuTest

Camera preview window works.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
2023-09-13 07:27:21 +00:00
Roman Stratiienko
def20cbb07 v3dv: Split v3dv_image_init to use layout setting logic separately
In AHB importing flow, the format is known at vkCreateImage step,
but buffer layout itself is not yet known. Buffer layout and modifier
must be updated later in vkBindImageMemory.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
2023-09-13 07:27:21 +00:00
Roman Stratiienko
1fc460b203 v3dv: Use format stored in vk_image and vk_image_view after init
Both vk_image_init and vk_image_view_init are smarter about format
settings and respect AHB extension needs.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
2023-09-13 07:27:21 +00:00
Roman Stratiienko
02fc0c7e6a v3dv/android: Rework Android native buffer importing logic
Rework it to use the existing VkImageDrmFormatModifierExplicitCreateInfoEXT
logic to set the image's explicit layout.

The code turned out to be generic enough so it could be integrated into
vk_image.c in the future and removed from the v3dv code.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
2023-09-13 07:27:21 +00:00
Roman Stratiienko
179dc4a106 v3dv/android: Add a helper function to support explicit layouts
The function extracts buffer information from the gralloc and fills
the VkImageDrmFormatModifierExplicitCreateInfoEXT structure.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
2023-09-13 07:27:21 +00:00
Caio Oliveira
bc9277d81c compiler/types: Move builtin type initialization to C
While both clang and gcc can handle designated initializers in C++,
MSVC only does with the C++20 support enabled.  So move the initialization
of builtins to a C file.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:59 +00:00
Caio Oliveira
13d3efb2d1 compiler/types: Add workaround to use builtin_type_macros.h in C
In most versions of C, bool is defined as _Bool, so the macro for bool
gets generated with the wrong name.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
a67d4bde2c compiler/types: Make struct glsl_type visible to C code
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
69ade9a344 compiler/types: Use a linear (arena) allocator for glsl_types
They are only deallocated in bulk all at once, which is exactly
the use case for the linear allocator.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
5d804e833c compiler/types: Store builtin types directly as data
Remove constructors from glsl_type so it can be used as a
POD ("plain old data") struct, allowing the builtins to be
initialized directly in memory.

For other types, we now allocate them from glsl_type_cache's mem_ctx,
instead of using the global allocator.

As a side-effect of how the new helpers work, we can completely
create the mock key types for struct/interface lookup without
allocating any memory.

Note there's no `make_sampler_type` since all the sampler types
are created through direct initialization.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
492644dbef compiler/types: Move static asserts about glsl_type to a central place
Take it out of the way to reduce noise when reworking (and eventually
removing) the constructor code.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
7815f3cd3e compiler/types: Simplify clearing the glsl_type_cache
Since now all the data referenced by it is allocated with the cache's
mem_ctx, it is sufficient to just free it, and then reset the cache
state to be ready for a next initialization if it happens.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
8a62b669f2 compiler/types: Don't store a mem_ctx per type
These are used only by types created at runtime.  Since those will follow
the lifetime of the glsl_type_cache, we can use its mem_ctx for all the types.

Without a mem_ctx, there's nothing to be done in the destructor, so remove it.

Note some keys are calculated by building a mock type, so we need to create
a tmp_ctx in some cases.  We'll get rid of them in a later commit.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
4f1473ef97 compiler/types: Use type cache mem_ctx for hash tables
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
450c753f8d compiler/types: Add a mem_ctx for the glsl_type_cache
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
74d85abf00 compiler/types: Move local cache details to implementation file
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
6bf0654f4a compiler/types: Use designated initializer syntax to specify builtins
For now we use a temporary glsl_type_params struct, we will be able to
use the glsl_type directly once we make it a POD ("plain old data")
struct by getting rid of its constructors and destructors.

Note that since the name is statically allocated, there's no need to
strdup() it, deallocate it and also no need to have a mem_ctx.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
3a3318364b compiler/types: Add extra level of macro to builtin_macros
This will make easier to transition from the macro calling a constructor
to the macro using designated initializers for a struct.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
3bdd2ba194 glsl: Don't create struct type builtins
Unlike for simpler types, struct types have a runtime cache, that's used to
ensure same type can be compared to same pointer.  The existing code was bypassing
it, potentially breaking that invariant.  One potential issue would be when
decoding/encoding types, the resulting type would be pointer-different than what
was stored.

This hasn't caused a visible issue, but the (incomplete) special handling for struct
builtins is in the way of other changes.

Change the code to use get_struct_instance(), and also only ever load those if the
parser need the types, since some of them are deprecated types that we might never
want to load.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
78af1d0d9a glsl: Add missing glsl_types initialization to test_optpass
Will be needed when the builtin struct types will go through regular
initialization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Caio Oliveira
f865905fac compiler/types: Move GLSL specific builtin structs into glsl/
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
2023-09-13 05:16:58 +00:00
Emma Anholt
75bcebbb9e ci/anv: Add testing on JSL.
ChromeOS is deprioritizing native GL drivers, so move testing on the
boards we maintain mostly over to anv.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25155>
2023-09-13 04:49:02 +00:00
Emma Anholt
d1758ed14c ci/anv: Add a manual full VK run for TGL.
There's a bunch of noise over time in the anv-tgl-fails.txt from the set
of tests run changing and catching more of the failures.  If we have a
nightly full run, we can keep things up to date more easily (as seen here,
where I finish filling out the modifiers crashes and drop a stale xfail).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25155>
2023-09-13 04:49:02 +00:00
Emma Anholt
a8b8d96f20 ci/anv: Drop "-vk" from the job name.
It's already implied by "anv"

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25155>
2023-09-13 04:49:02 +00:00
Emma Anholt
7e812a122d ci/anv: Drop DEQP_VER:vk setting.
It's only used if you don't set DEQP_SUITE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25155>
2023-09-13 04:49:02 +00:00
Dave Airlie
9eed03657d clover: fix parameter arguments since recent translator changes.
The translator recently unmapped where const info gets stored,
and you can ask for the metadata to be passed through instead, do that
for now, until it's all resolved.

Fixes: api get_kernel_arg_info
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13449>
2023-09-13 04:32:38 +00:00
Timothy Arceri
718699b9f0 glsl: remove field from gl_shader_program
We don't need to carry this value around, its only used a single time in
the linker. Instead simply extract it from gl_shader when we need it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25105>
2023-09-13 03:44:40 +00:00
Mike Blumenkrantz
06af083b93 glsl: check for xfb setting xfb info
this otherwise hits the default buffer=0 path, which is invalid
for drivers which don't support xfb

fixes #9763

cc: mesa-stable

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25082>
2023-09-13 03:04:14 +00:00
Mike Blumenkrantz
a0ff56e334 zink: pass a stage mask to pipeline create functions
this is more accurate than checking random unionized zink_shader_object
members

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25087>
2023-09-13 02:36:40 +00:00
Mike Blumenkrantz
e4bca6adf1 zink: use FAIL_ON_PIPELINE_COMPILE_REQUIRED for GPL path
it should be low-cost to check for a cached+optimized pipeline on first
compile, so do that to avoid unnecessary pipeline compiles

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25087>
2023-09-13 02:36:40 +00:00
Mike Blumenkrantz
d79a615cf8 zink: remove an intermediate variable in pipeline compile selection
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25087>
2023-09-13 02:36:40 +00:00
Mike Blumenkrantz
af760c7529 zink: add a flag for combined pipeline compile for doing FAIL_ON_PIPELINE_COMPILE_REQUIRED
not yet used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25087>
2023-09-13 02:36:40 +00:00
Mike Blumenkrantz
eacc44afb9 zink: slightly refactor pipeline compile selection
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25087>
2023-09-13 02:36:40 +00:00
Mike Blumenkrantz
3802be6bac lavapipe: KHR_map_memory2
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25181>
2023-09-13 02:01:29 +00:00
Dave Airlie
f423d91790 spirv: use a pointer sized int type for opencl event_t
llvm16 + opaque pointers uses a ptr to event for the opaque type,
llvm 17 fixes this properly, but the fix doesn't look too backportable.

Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25165>
2023-09-13 00:22:51 +00:00
Juston Li
4e85c325ff venus: implement VK_EXT_vertex_input_dynamic_state
requires a fixup to ignore static pVertexInputState if dynamic state
is used.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25193>
2023-09-13 00:00:39 +00:00
Juston Li
dfbe545a2c venus: sync protocol for VK_EXT_vertex_input_dynamic_state
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25193>
2023-09-13 00:00:39 +00:00
Caio Oliveira
3890c60584 compiler/types: Remove unused GLSL_TYPE_FUNCTION and related functions
GLSL doesn't use that type.  SPIR-V used for a while but later started
relying on its own data structures and stopped using it.
See ca62e849d3 ("nir/spirv: Stop using glsl_type for function types")

If we were ever to add this one again, would be better to have a way to
grab a key for lookup that did not require allocations, right now that's
needed to inject return type as the first element in params array.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
2023-09-12 23:18:12 +00:00
Caio Oliveira
0f41da9160 compiler/types: Constify a couple of pointers in glsl_type
This will allow builtins to initialize those with read-only
data in the future.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
2023-09-12 23:18:12 +00:00
Caio Oliveira
412fe99ea6 compiler/types: Don't duplicate empty string
We can use the static version of the empty string.  There's no worry
about freeing that string incorrectly since what is being deallocated
later is the whole mem_ctx.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
2023-09-12 23:18:12 +00:00
Caio Oliveira
247f940d37 compiler/types: Use right hash for function types
No bug really materialized since function types
aren't currently being used.

Fixes: 26f456203c ("compiler/types: Use hash table pre-hashed functions for type caching")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
2023-09-12 23:18:12 +00:00
Iván Briano
f1bc58cb7b intel/fs: use ffsll so we don't explode on 32 bits
Fixes: b200e5765c ("anv: use a simpler MUE layout for fast linked libraries")

Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25192>
2023-09-12 22:42:38 +00:00
Dave Airlie
147c17c28c radv: don't emit event code on video queues.
I don't know if these can be done properly, but for now just don't
emit the standard cp stuff since it hangs the GPU.

"Fixes" dEQP-VK.video.synchronizat*

Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25170>
2023-09-12 21:42:28 +00:00
Hans-Kristian Arntzen
85192dcfc6 wsi/x11: Don't allow signal_present_id to rewind.
If present ID is 0, we should consider it to be ignored.
Avoids a theoretical problem when using IMMEDIATE mode with present ID
where some images don't set present ID.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25178>
2023-09-12 19:46:56 +00:00
Hans-Kristian Arntzen
08fee190aa wsi/x11: Fix potential deadlock in present ID.
If we observe IDLE before COMPLETE, another queued image may have
presented with present ID 0 which would break the check fixed in this
commit. The original fix for present_id / signal_present_id split
forgot to take this into account.

Fixes: 32f7ff2c20 ("Fix present ID signal when IDLE comes before
COMPLETE").

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25178>
2023-09-12 19:46:56 +00:00
Yiwei Zhang
da16a76fe7 venus: fix a device memory report leak
Fixes: f70a08bc60 ("venus: handle device memory report requests")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25176>
2023-09-12 19:28:46 +00:00
Rohan Garg
9eba1d9187 intel/genxml: update PIPE_CONTROL instruction for dg2
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25124>
2023-09-12 19:04:24 +00:00
Leo Liu
8c8985390d Revert "frontends/va: Also map VAImageBufferType for reading"
This reverts commit 12a4f2c132.

With PIPE_MAP_READ_WRITE and derived image, the encoder will copy
to and from staging buffer for each frame, which caused performance
degradation, even worse than putImage.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25128>
2023-09-12 18:40:30 +00:00
Eric Engestrom
7eabe9bb40 ci_run_n_monitor: add comment to explain "MR > fork" logic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25186>
2023-09-12 18:37:40 +00:00
Eric Engestrom
717cff829c ci: remove duplicate fork pipeline in MRs
The argument for keeping this duplicate was to not affect
the ci_run_n_monitor script (which by default picked the pipeline in the
user's fork), but the script already supported specifying
a `--pipeline-url` to support that use-case, and it now automatically
picks the MR pipeline if there is no fork pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25154>
2023-09-12 17:55:53 +00:00
Eric Engestrom
941d92408e bin/ci_run_n_monitor: automatically pick MR pipelines when they exist
When an MR has been created, we usually want to run the jobs in the MR
pipeline so that reviewers see that things work as expected.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25153>
2023-09-12 17:42:34 +00:00
Eric Engestrom
f398f0fb44 bin/ci_run_n_monitor: print in which repo we're looking for the pipeline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25153>
2023-09-12 17:42:33 +00:00
Illia Polishchuk
b8a54c50a6 nir: fix invalid sampler search by texture id
Sampler id cannot be mapped to a uniform object location

Fixes: 1a8dd84ec6 ("nir: Propagate the type sampler type change to the used variable.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9793

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25145>
2023-09-12 15:44:52 +00:00
Illia Polishchuk
5a7044d0bc zink: move find_sampler_var from zink to nir core
Avoid code duplication because it need to be used in following commits

Fixes: 1a8dd84ec6 ("nir: Propagate the type sampler type change to the used variable.")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25145>
2023-09-12 15:44:52 +00:00
Corentin Noël
010147cd64 llvmpipe: make sure to initialize the lp_setup_context slots with the default values
As 0 is an actual valid value, this can lead to issues when we actually want to use them.

This fixes `spec@arb_cull_distance@basic-cull-3` crashes for instance.

Cc: mesa-stable

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25152>
2023-09-12 15:17:39 +00:00
Rhys Perry
f9b341cbf4 radv: use shortcut_1d_workgroup_id
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24882>
2023-09-12 14:31:07 +00:00
Rhys Perry
2965a9d510 radv: optimize mesh workgroup ID using ts_mesh_dispatch_dimensions
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24882>
2023-09-12 14:31:07 +00:00
Rhys Perry
81d17246ec nir/lower_system_values change num_workgroups to uint32_t
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24882>
2023-09-12 14:31:07 +00:00
Mike Blumenkrantz
b3b58b91f4 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25180>
2023-09-12 13:53:32 +00:00
Mike Blumenkrantz
5f73b8976b aux/tc: fix address calc for segmented texture subdata
this fixes all dimension/array uses for the rp tracking path

Fixes: 51ad269198 ("aux/tc: handle stride mismatch during rp-optimized subdata")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25180>
2023-09-12 13:53:32 +00:00
Mike Blumenkrantz
b6bc1f85f4 aux/tc: fix staging buffer sizing for texture_subdata
this is the size of the src data, not the dst data

Fixes: 51ad269198 ("aux/tc: handle stride mismatch during rp-optimized subdata")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25180>
2023-09-12 13:53:31 +00:00
Iago Toral Quiroga
64b49fb501 v3dv: don't assume that bound descriptors have been written
The pipeline layout lifetime tests in CTS allocate some descriptors
and bind them to the command buffer without actually ever writing
valid resources to them since they never actually execute the command
buffers, so we want to be careful at bind time and not assume the
resources exist.

Fixes crashes in dEQP-VK.api.pipeline.pipeline_layout.lifetime.*

Fixes: 95f881adbd ('v3dv: add support for sampling simple 2D linear textures')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25172>
2023-09-12 11:42:58 +00:00
Martin Roukala (né Peres)
9d2bad8b37 zink/ci: document more flakes seen on vangogh
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25107>
2023-09-12 11:15:56 +00:00
Martin Roukala (né Peres)
13161f4adb zink/ci: automatically reboot when hitting a kernel BUG on vangogh
By rebooting immediately after hitting "BUG", we'll re-try immediately
running the job without first needing to hit the 30 minutes timeout.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25107>
2023-09-12 11:15:55 +00:00
Karol Herbst
29f730b793 docs/features: cl_khr_3d_image_writes needs driver support
And asahi doesn't support it.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25174>
2023-09-12 10:03:27 +00:00
Samuel Pitoiset
2cc981a0cd radv: fix capturing RGP on RDNA3 with more than one Shader Engine
PKT3_RESET_FILTER_CAM_S seems required on GFX11. Otherwise, capturing
with more than on SE can hang.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25156>
2023-09-12 08:38:39 +00:00
Samuel Pitoiset
6caae898dd radv: fix emitting SQTT userdata when CAM is needed
The third parameter of PKT3 is the predicate bit and this was wrong.
PAL sets the RESET_FILTER_CAM bit when emitting SQTT userdata.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25158>
2023-09-12 07:07:10 +00:00
Iván Briano
23f9e89fce anv: enable VK_EXT_mesh_shader where supported
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25047>
2023-09-12 02:51:31 +00:00
Iván Briano
4eddeea7bf intel/fs: handle URB setup for fast linked mesh pipelines
Up until now, the mesh pipeline assumed it would be always linked to the
fragment shader, and so the calculated MUE map would always be
available.
That is not the case for fast linked pipeline libraries, so the URB
setup needs to account for this. We do this by replicating what's done
for non-mesh pipelines, defining the URB based on the FS inputs, and
always assuming they will be laid out in order of varying number, except
that we also account for per-primitive attributes.

Fixes all GPL using tests under dEQP-VK.mesh_shader.ext.smoke.*

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25047>
2023-09-12 02:51:31 +00:00
Iván Briano
17d7f7a292 intel/fs: read viewport and layer from the FS payload
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25047>
2023-09-12 02:51:31 +00:00
Iván Briano
d36da7c5f8 anv: track what kind of pipeline a fragment shader may be used with
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25047>
2023-09-12 02:51:31 +00:00
Iván Briano
b200e5765c anv: use a simpler MUE layout for fast linked libraries
The compaction introduced in a252123363 ("intel/compiler/mesh: compactify MUE layout")
is not suitable for the case where graphics pipeline libraries are fast
linked, as the fragment shader won't receive the mue_map to know where
to locate its inputs.
For that case, keep doing what we did before and lay things down in the
order varyings are defined, which is also how it works for the non-mesh
case.

Fixes dEQP-VK.fragment_shading_rate.*fast_linked_library*.ms

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25047>
2023-09-12 02:51:31 +00:00
Iván Briano
bcde58ea86 blorp: fix hangs with mesh enabled
Move mesh URB allocations together with the other stages.

This fixes a hang that started happening with mesh enabled after
419531c5d9 ("intel/blorp: add a new flag to communicate PSS sync need")

Bspec 45352 says:
  L3 Space allocation can only be changed when the GPU pipeline is
  completely flushed.

It's likely that the PIPE_CONTROL added in that commit was breaking that
assumption and the URB allocation happening afterwards at the end of the
pipeline emission would then hang. And before that, we were probably
just getting lucky.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25047>
2023-09-12 02:51:31 +00:00
Erico Nunes
079604e41e ci: disable lima LAVA lab for maintance
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25112>
2023-09-12 02:48:34 +00:00
Dave Airlie
4dbc55818c llvmpipe: enable driver functions.
This enables driver functions for the CL paths.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
4ecd471ee3 llvmpipe/cs: add support for function calls.
This adds (disabled) support for function calls to the compute shader.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
3704f158a2 gallivm: add support for function calling
This adds support for calling functions in compute shaders.

Functions are passed two implicit arguments
- the current exec mask
- a context containing all the info needed for intrinsics to work
  when not in the toplevel.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
14a6668964 rusticl: use cleanup funcs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
18ca6c37f0 nir: add a function usage tracker
allows dropping old fns

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
f5bf4657fb nir: add driver_functions option to avoid inlining.
This adds a driver control to instruct NIR to not inline
all functions.

It adds a very simple inlining heuristic that works for
what I've played with, but will probably need to grow some
better ideas.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
8a95b43880 spirv/nir: parse function control and store in nir.
This just lets the nir access the inline/dont inline attributes

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
b8e93abd11 gallivm: rework translator to allow per-impl work.
This allows a function implementation to be targetted, this will
only be used by the compute shader paths, so keep a compat path
for all the others.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
3cd20feed0 gallivm/nir: split prepasses out to make per-function work easier.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
a74e98547c nir: don't inline linked functions
Don't inline linked functions here, let nir_inline_functions do the job
when we get to it.

Instead just copy over the implementation and any other pieces need.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
8f982a7fd9 nir: add nir function clone
this just refactors the existing functionality so we can use it elsewhere.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
5dea1ac64c nir/functions: move linker pass to new helper
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
b1a12cf3a8 nir/functions: put link state into a struct
this will make it easier to convert to new pass.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
4af6061fe5 nir/functions: use helper to get function for a name.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
bfe152916c nir: move the libclc lowering over to functions file.
This lowering is pretty generic, and I want to enhance it for
times when we don't want to inline.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
e6bfe7c501 nir: use nir_function_instructions_pass in the inliner.
This moves the current inliner to use the pass.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
5f568625fa nir: rename nir_inline_functions.c to nir_functions.c
I'm going to add code for non-inline purposes but related to
functions.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Alyssa Rosenzweig
97557ebfa2 nir: Add nir_function_instructions_pass helper
Extract the logic. Convenience for working with real functions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
93bb08d1f7 nir: use a _clone so users calling their variable clone don't get a warning
I've got code using clone name and it gets confused.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Emma Anholt
6417f1021a ci/freedreno: Add another excessive-constlen UBO skip.
Causes flakes in other tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24624>
2023-09-12 01:18:07 +00:00
Collabora's Gfx CI Team
52343ac668 Uprev Piglit to f7db20b03de6896d013826c0a731bc4417c1a5a0
ed58dfbd12...f7db20b03d

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24624>
2023-09-12 01:18:07 +00:00
Caio Oliveira
3f1356bef5 util: Add convenience macros for linear allocator
Similar to the ones for ralloc.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25161>
2023-09-12 00:26:06 +00:00
Konstantin Seurer
9e37631aa5 vulkan/properties: Handle unsized arrays properly
Sadly we cannot autogenerate handling for them, so fall back to hand
written handling instead.

Fixes: eaee792 ("vulkan: Add a generated vk_properties struct")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25055>
2023-09-11 22:01:44 +00:00
Rob Clark
b235e8fc9a tu: Fix heap size
It make no sense to advertise a bigger heap than what we can fit into
the GPU virtual address space.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25130>
2023-09-11 21:31:01 +00:00
Rob Clark
c4c76b72e1 freedreno/a6xx: ARB_shader_viewport_layer_array
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
0bb34e49ec freedreno/a6xx: Handle PIPE_BIND_BLENDABLE
We weren't advertising EXT_float_blend due to missing handling for the
BLENDABLE usage bit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
e6b5e965cc freedreno/a6xx: Use pipe_blit_info::sample0_only
Instead of trying to pass this back-door, and failing in a few cases we
go thru generic paths.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
c1a188ad4f freedreno/a6xx: EXT_depth_bounds_test
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
43c77244d9 freedreno/a6xx: EXT_shader_image_load_formatted
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
6df5f3d4f1 freedreno/a6xx: EXT_demote_to_helper_invocation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
babe8a10d9 freedreno/a6xx: ARB_texture_filter_minmax
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
286b7723f0 freedreno/a6xx: ARB_sample_locations
Note, gl_SamplePosition (rgetpos), and therefore interpolateAtSample(),
doesn't work with sample location_enable=true.  For vulkan, "If the
current pipeline uses custom sample locations the value of any variable
decorated with the SamplePosition built-in decoration is undefined."
But ARB_sample_positions doesn't mention this.  Possibly the vk text
should be backported to the gl extension.  (If the app is specifying the
sample locations, it shouldn't need gl_SamplePosition.)

The upshot of this is 2 out of 3 tests that piglit arb_sample_locations
test tests fail, even though sample locations itself is working.
Possibly the test should be updated.  Or we could use driconf to hide
ARB_gpu_shader5 and ARB_sample_shading from this test.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
fd00e99444 freedreno/a6xx: ARB_post_depth_coverage
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
eb3cb03bbe freedreno: Implement ATI_meminfo
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
c2e8b52922 freedreno/a6xx: Re-write the function-of-doom
Re-write the program state building to align more closely with turnip,
for easier comparision.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
9b2780dcaf freedreno/a6xx: Re-work fd6_emit_shader
Shuffle around a bit of the state emit, so that it more closely matches
tu_emit_xs().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
a11e3f35df freedreno/a6xx: Drop unused screen args
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:19 +00:00
Rob Clark
71fe3f1073 ir3+tu: Simplify ir3_find_sysval_regid callers
The test for NULL shader stage is pretty common so just move it into
ir3_find_sysval_regid().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24999>
2023-09-11 19:45:18 +00:00
Pavel Ondračka
38694b7386 r300: reduce number of iterations for vertex shader loops
Using the default value leads to occasional hangs on RV516 for unknown
reasons. Set it to 128 insted of 255.

dEQP and piglit are still happy and I don't expect any real app to hit
this, but lets see. As a side effect this boosts fps in the apps that
have non-unrollable vertex shaders (as the shaders now effectivelly run
almost two times faster) and ~5% dEQP runtime decrease.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7934
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20873>
2023-09-11 19:30:52 +00:00
Chia-I Wu
ccd3bb4548 winsys/radeon: fix a race between bo import and destroy
This is similar to commit 85e74944c6 ("winsys/amdgpu: fix a race
between import and destroy") but for winsys/radeon.  In short, we need
to check the reference count again after bo_handles_mutex is held.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25133>
2023-09-11 19:11:29 +00:00
Konstantin Seurer
028ba76a00 radv/ci: Document new flake
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25140>
2023-09-11 16:33:31 +00:00
Paulo Zanoni
0c29b7aeaf anv: remove misleading comment about batch_len
We don't fill batch_len later when chaining batches. But that doesn't
seem to be a problem, I checked i915.ko and nothing Gen8+ seems to use
batch_len. The new xe.ko exec ioctl doesn't even ask for batch_len.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24681>
2023-09-11 16:04:02 +00:00
Paulo Zanoni
9a7c6ae32c anv/xe: return failure in case waiting for the vm_bind syncobj fails
Don't hide failures, we have xe.ko bugs related to that, such as:
    https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/496

The bind ioctl may fail if the application does something wrong, but
the wait really should never fail.

v2: Don't print an error message (Lionel).

Reviewed-by: José Roberto de Souza <jose.souza@intel.com> (v1)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24681>
2023-09-11 16:04:02 +00:00
Paulo Zanoni
935a1d2c8f anv/xe: make vm_binds async
Our sparse implementation will require us to issue partial unbinds,
but partial unbinds are not supported in synchronous vm_bind ioctls,
requiring us to to have our VM be marked with the ASYNC flag. This is
not properly documented and is subject to change in the next
iterations of the API.

Error handling with async binds is also not documented anywhere and is
being actively discussed in the mailing lists, so whatever we decide
to implement here is likely to end up changing in a few weeks. Also, I
haven't seen these errors happening in the real world, so for now
they're a very corner case. So for now just foward errors to
user-space and hope things work.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24681>
2023-09-11 16:04:01 +00:00
Paulo Zanoni
7018e64d79 anv: add a new vm_bind vfunc
For Sparse Resources we need to be able to specify the address, size
and offsets and we also want to be able to issue multiple binds at the
same time. Extend xe_vm_bind_op() to handle those cases and add
the new vfunc.

v2:
 - use STACK_ARRAY() (Lionel)
 - no more need to work around xe.ko bug that was fixed (José)

Reviewed-by: José Roberto de Souza <jose.souza@intel.com> (v1)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24681>
2023-09-11 16:04:01 +00:00
Paulo Zanoni
a54451075d anv: rename the vm_bind vfuncs
The only driver that has a vm_bind ioctl is xe.ko, and its vm_bind
ioctl is not called GEM vm_bind, it's just DRM_IOCTL_XE_VM_BIND
(without GEM anywhere). Back when i915.ko was going to have a vm_bind
ioctl it had GEM on its name, so I guess that's how "gem" appeared in
the naming here, but now nothing does, so let's get rid of it.

Also, these vfuncs we have are specifically made to bind and unbind
whole BOs, so rename them to vm_bind_bo() and vm_unbind_bo() in order
to try to clarify what they mean. The goal is to add a more generic
vm_bind() later that can do anything.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24681>
2023-09-11 16:04:01 +00:00
Xaver Hugl
0a1ccd4a9a vulkan wsi: add support for PresentOptionAsyncMayTear
This commit adds tearing support for Xwayland

Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19125>
2023-09-11 15:25:25 +00:00
Mike Blumenkrantz
39aa483760 zink: set optimal_keys for turnip jobs
nobody cares about stipple on turnip for real world scenarios, so
testing it instead of the thing that people will actually want is pointless

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25037>
2023-09-11 14:48:31 +00:00
Mike Blumenkrantz
cf66ed2dec zink: imply ZINK_DEBUG=quiet if ZINK_DEBUG=optimal_keys is set on turnip
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25037>
2023-09-11 14:48:31 +00:00
Mike Blumenkrantz
1e1f58c1ac zink: add ZINK_DEBUG=quiet
mainly for use with ZINK_DEBUG=optimal_keys on turnip since spamming
a warning like that constantly is pointless

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25037>
2023-09-11 14:48:31 +00:00
Daniel Stone
cb76e90793 ci/zink: Add new zink-lvp flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25149>
2023-09-11 14:10:23 +00:00
Daniel Stone
f5c80f001b ci/intel: Add new skqp flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25149>
2023-09-11 14:10:23 +00:00
Daniel Stone
077e2da21e ci/d3d12: Add new flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25149>
2023-09-11 14:10:23 +00:00
Daniel Stone
abb612ec1f ci/radeonsi: Add new flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25149>
2023-09-11 14:10:23 +00:00
Daniel Stone
9dbc8a7ee3 ci: Declare stages before jobs
It looks like GitLab 16.x requires us to declare the stages before we
declare any jobs, else it falls down resolving 'needs' with 'job is not
in any earlier stage'.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25149>
2023-09-11 14:10:23 +00:00
Alba Mendez
e3aab80d4f meson: support installation tags
the only thing missing is to tag custom install targets, namely:
 - ICDs (vulkan, glvnd, OpenCL, VA-API, VDPAU)
 - Vulkan layers
 - custom install script for megadrivers
 - drirc file

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24911>
2023-09-11 13:00:45 +00:00
Iago Toral Quiroga
05e80e1a5e v3dv: expand sampling from linear image hack to support multi-planar images
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25048>
2023-09-11 12:04:35 +00:00
Iago Toral Quiroga
95f881adbd v3dv: add support for sampling simple 2D linear textures
V3D can't sample linear images (other than 1D), however, some applications
will require this to work. Particularly, our swapchain images may need to be
linear (for display), so sampling from them won't work.

This change detects the case where we are binding a descriptor which attempts
to sample from a simple 2D linear texture, transparently creates a tiled
copy of the image and rewrites the  descriptor to refer to the tiled image
instead. This will be slow but will allow some applications that require this
to work (i.e. some aspects of Android's user interface).

As of this patch, this only supports sampling linear images with a single
miplevel and layer from single-plane images in non-arrayed descriptors. We
could handle other cases too with a bit more work though.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9712
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25048>
2023-09-11 12:04:35 +00:00
Sergi Blanch Torne
151f78150b Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit c558c49550

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25143>
2023-09-11 11:26:30 +00:00
Roman Stratiienko
d74d017f7d v3dv: Rely on the internal tiled flag instead of the common vk structure
Common vk.tiling can have 3 states:

VK_IMAGE_TILING_OPTIMAL = 0,
VK_IMAGE_TILING_LINEAR = 1,
VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT = 1000158000,

The latter is checked by [1]

In this case, actual tiling can be either linear or tiled;
therefore, logic in v3dv_meta_copy will not work correctly.

[1]: 39fca243bb/src/vulkan/runtime/vk_image.c (L158)

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25139>
2023-09-11 11:08:04 +00:00
Connor Abbott
a03525d8db tu: Split program draw state into per-shader states
This completely rewrites how uploading variants and emitting the program
state works, which will make fast linking significantly faster and lays
some of the groundwork for EXT_shader_objects. Variants are now
compiled and uploaded as part of creating a tu_shader, and a
a per-stage draw state is also created that contains all registers that
are only set based on one stage. The program state is split into
per-stage states, which come from the shaders, and VPC state which is
emitted at linking time. Pipelines now contain shaders, and importing
shaders from libraries when fast-linking just involves taking a
reference on the shader. While the command buffer code still uses the
old pipeline structures, the plan is to switch more and more things to
directly use the shaders or derived state from the shaders that gets set
by the pipeline, so that we can eliminate pipeline usage from
tu_cmd_buffer.cc to enable ESO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:11 +00:00
Connor Abbott
a80f026073 ir3: Add helper to determine when variant exceeds safe constlen
This will help us not compile extra variants as often in the unlinked
case, which will become the only case on turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:11 +00:00
Connor Abbott
252aee2634 freedreno, ir3, tu: Constify various uses of ir3_shader_variant
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
d1b333a0b5 tu: Split up tu6_emit_vpc()
This started out as a place to set linkage-related registers, but it
gradually became a grab-bag of different things. In the future each
stage will have its own draw state, so we split out the parts that only
depend on a single stage into separate functions. Each piece of state we
can split out is another piece of state that won't have to be emitted
while fast-linking.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
211aeb2dda ir3: Add ir3_find_input_loc() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
0d82f92942 tu: Pull entangled shader state into program config
There are a few cross-stage states that we absolutely have to wait to
emit until we know more than one stage. Pull these into the program
config draw state, so that we can split up the program draw state into a
per-stage draw state. For VK_EXT_shader_object, these will have to
emitted at draw time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
5666758820 tu, freedreno/a6xx: Don't use VS for PrimID passthru state
Emit the registers solely based on whether FS reads PrimID, and assume
the HW will do the right thing and disable PrimID passthru when GS is
enabled. This untangles these registers so we can set them from the FS
draw state in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
b312155cc5 tu: Rename PrimID-related registers
It turns out that the hardware automatically selects whether PrimID
passthrough needs to happen based on whether GS is enabled, which means
that it's safe to always set these registers based whether PrimID is
read by the FS and the hardware will ignore them when GS is enabled. Use
the real names for these registers to make it less confusing when we
start to do that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
979cf7bac0 tu: Merge depth/stencil draw states
This removes more draw states that are commonly set together. We still
have a separate draw state for RB_DEPTH_CNTL, because it depends on
other things like the attachment state and depth clamp and it would be
more difficult for layers like zink to use a combined depth/stencil
state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
3a1f7c61b6 tu: Stop reusing base Vulkan dynamic state enums
We're about to remove the 1:1 correspondance between base Vulkan 1.0
dynamic states and draw states.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
1f88c9c5a4 tu: Merge PC_RASTER_CNTL into RAST draw state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:10 +00:00
Connor Abbott
51ba8d4331 tu: Merge SAMPLE_LOCATIONS and SAMPLE_LOCATIONS_ENABLE draw states
There's no need to separate them except that it was easier before, no
one will enable the second without also enabling the first. Now that
mesa will merge the states for us we can go ahead and merge them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:09 +00:00
Connor Abbott
d3ab5b68d5 tu: Remove MSAA draw state
We only need to emit MSAA state once per subpass at most, unless the
pipeline switches primitive types or for framebuffer-less subpasses
(which always use sysmem anyway). Therefore it seems like draw state
skipping isn't going to bring much benefit here, and having it as a draw
state in the first place is a remnant of how this used to be part of the
pipeline state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25076>
2023-09-11 10:34:09 +00:00
Iván Briano
8179b6fcf4 anv: tell blorp to do mesh stuff only if it's enabled
Otherwise blorp operations will set dirty bits for mesh that we don't
expect at pipeline state emission time.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25109>
2023-09-11 10:08:44 +00:00
Iván Briano
3d7153afdf anv: ensure pipelines have all state
While we don't need to emit all of the unused mesh/task states when mesh
is disabled, if we don't have them we fail some assertions in the
difference checks due to the corresponding state being empty.
This may happen when going from a mesh pipeline to a non-mesh one, or
one that uses task shaders to one that doesn't.

It may be possible to avoid having to do this, but I'd rather start from
a working state and optimize it later.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25109>
2023-09-11 10:08:44 +00:00
Iván Briano
3fb3752e33 anv: fix missing 3DSTATE_SBE_CLIP emission
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25109>
2023-09-11 10:08:44 +00:00
Lionel Landwerlin
05ebfa5463 anv: fix missing 3DSTATE_SBE_MESH emission
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 50f6903bd9 ("anv: add new low level emission & dirty state tracking")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25109>
2023-09-11 10:08:44 +00:00
Lionel Landwerlin
a023897cd3 anv: ensure partially packed instructions are emitted in the pipeline
Any partially packed instructions should always be pre-packed by
genX_pipeline.c

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/25109>
2023-09-11 10:08:44 +00:00
Lionel Landwerlin
f5344a6b1c anv: ensure mesh pipeline have all pre-rasterization stages disabled
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 44656f98d5 ("anv: split pipeline programming into instructions")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25109>
2023-09-11 10:08:44 +00:00
Lionel Landwerlin
80feff8559 anv: emit 3DSTATE_URB_ALLOC_(MESH|TASK) only when mesh shaders are enabled
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/25109>
2023-09-11 10:08:44 +00:00
Lionel Landwerlin
ef8f28403f anv: fix 3DSTATE_VFG emission
3DSTATE_VFG was moved into a section that only gets emitted for legacy
pipelines, not mesh pipelines.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0ce772bd19 ("anv: split 3DSTATE_VFG emission")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25109>
2023-09-11 10:08:44 +00:00
Ganesh Belgur Ramachandra
51773d135d radeonsi: sets OPTIMAL_BIN_SELECTION to 0 if using bottom_edge_rule
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24725>
2023-09-11 04:24:41 -05:00
Ganesh Belgur Ramachandra
86b4fe5d68 radeonsi: stores bottom_edge_rule option in the rasterizer state
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24725>
2023-09-11 04:23:59 -05:00
Corentin Noël
c558c49550 ci: disable Collabora's LAVA lab for maintenance
This is to inform you of some planned downtime in the LAVA lab as follows:

* Start: 2023-09-11 08:00 BST (UTC+1)
* End: 2023-09-11 12:00 BST (UTC+1)

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25141>
2023-09-11 07:42:26 +00:00
Samuel Pitoiset
729cb4004a radv: fix enabling DGCC
This was broken if only DGC (graphics) is enabled.

Fixes: 559da06755 ("radv: implement NV_device_generated_commands_compute")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25126>
2023-09-11 07:13:10 +00:00
Dave Airlie
2d4fe5f229 clover/llvm: move to modern pass manager.
This seems like it should work, but I haven't tested it yet.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
2023-09-11 13:04:07 +10:00
Erico Nunes
cb1c88d41f lima: fix plbu block stride calculation
For some specific texture sizes, notably some texture sizes with width
4096, block stride calculation could end up calculating stride 256 which
is an invalid value.
In those specific cases, this could cause rendering artifacts or
application/driver crashes.

Cc: mesa-stable

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25084>
2023-09-10 20:41:24 +00:00
Konstantin Seurer
df710fe695 radv/rt: Enable monolithic pipelines
Store can_inline inside the stages to avoid rerunning the analysis pass
for library stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21929>
2023-09-10 11:40:12 +00:00
Konstantin Seurer
f2514e75f0 radv/rt: Add monolithic raygen lowering
Ray traversal is inlined to allow for constant folding and avoid
spilling.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21929>
2023-09-10 11:40:12 +00:00
Konstantin Seurer
e039e3cd76 radv/rt: Store NIR shaders separately
In order to compile monolithic shaders with pipeline libraries, we need
to keep the NIR around for inlining recursive stages.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21929>
2023-09-10 11:40:12 +00:00
Mike Blumenkrantz
39fca243bb nir/inline_uniforms: fix oob access with nir_find_inlinable_uniforms
the array dimensionality needs to match nir_add_inlinable_uniforms even if
only the first member is used

Fixes: 0c0fb216dd ("nir/inline_uniforms: Allow possibility of more than one UBO")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25063>
2023-09-09 16:40:46 +00:00
Mike Blumenkrantz
94941de25b zink: delete all psiz=1.0 stores if maintenance5 is present
this frees up an output location woooo

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24782>
2023-09-09 15:44:45 +00:00
Mike Blumenkrantz
23df2bf41b zink: slightly refactor psiz deletion during linking
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24782>
2023-09-09 15:44:45 +00:00
Eric Engestrom
b5c2e91e4a Revert "ci: taking igalia farm offline"
This reverts commit a69ffbd08a.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25136>
2023-09-09 14:08:23 +00:00
Mike Blumenkrantz
6d5174974a zink: use HIC for image subdata when possible
this has a lot of caveats:
* extension must be supported
* resource must have usage bit set
* resource must not have any pending batch usage
* resource must be in supported layout

if all of these conditionals pass, then HIC can be used for direct image subdata

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
f24891269d zink: check/use suboptimal HIC during ici init
this allows implicit use of HIC where possible while rejecting it when
it would cause performance loss

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
e006a3d8bc zink: use some return codes for check_ici errors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
4feb37d629 zink: fix some off-by-one indentation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
9907573d98 zink: add a fixup method for extra driver props
some extensions have "extra" props which need the get_count -> get_prop_array
dance, and codegen is too stupid to figure this out (and probably always will be)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
9ff5026100 zink: disable HIC without resizable BAR
this otherwise ooms the system

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
f95134468a zink: move mem type detection up in file
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
521800cf59 zink: hook up VK_EXT_host_image_copy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
5edcab3385 lavapipe: don't advertise UNDEFINED layout for HIC
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
943909514e lavapipe: handle VkHostImageCopyDevicePerformanceQueryEXT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
87fa46c10d zink: use VkFormatProperties3
but wrap it in a smaller type to save some space

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:44 +00:00
Mike Blumenkrantz
e02441b000 zink: simplify redundant is_buffer check
it's in the params

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24775>
2023-09-09 13:02:43 +00:00
Mike Blumenkrantz
738eb0d78c ci: bump VVL to 1.3.263
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24925>
2023-09-09 11:29:36 +00:00
Jordan Justen
ddc3c18e4a intel/dev: Update device string for MTL PCI ID 0x7d55
Ref: bspec 55420
Cc: mesa-stable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25073>
2023-09-09 07:00:30 +00:00
Faith Ekstrand
bb91e0306c nvk: Invalidate the texture cache in PipelineBarrier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25135>
2023-09-09 05:17:05 +00:00
Faith Ekstrand
dff769e2bd nvk: Set the discard bit for Z/S self-deps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25135>
2023-09-09 05:17:05 +00:00
Faith Ekstrand
35e0989779 nvk: Don't add a dummy attachment when gl_SampleMask is written
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25135>
2023-09-09 05:17:05 +00:00
Ian Romanick
8ce4d7a08d intel/compiler: Don't evict for workgroup-scope fences
Flushing and invalidating caches isn't necessary for workgroup scope
fences.  In fact, the DP_FLUSH_TYPE docs (BSpec 54041) say:

   "If the fence scope is Local or Threadgroup, HW ignores the flush
    type and operates as if it was set to None(no flush)"

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:25 +00:00
Ian Romanick
5eddf60e56 intel/compiler: Combine control barriers with identical memory semantics
This prevents the second barrier generating a spurious, identical fence
message as the first barrier.

fossil-db stats on Alchemist:

   Totals:
   Instrs: 196513342 -> 196512777 (-0.00%); split: -0.00%, +0.00%
   Cycles: 14271426028 -> 14271404569 (-0.00%); split: -0.00%, +0.00%
   Send messages: 8021892 -> 8021770 (-0.00%)

   Totals from 46 (0.01% of 653252) affected shaders:
   Instrs: 76761 -> 76196 (-0.74%); split: -0.75%, +0.01%
   Cycles: 2027946 -> 2006487 (-1.06%); split: -1.45%, +0.39%
   Send messages: 7589 -> 7467 (-1.61%)

Nothing in shader-db was affected.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:25 +00:00
Kenneth Graunke
9f98f20c58 anv: Use nir_opt_barrier_modes() to drop unnecessary barriers
fossil-db stats on Alchemist:

   Totals:
   Instrs: 196514947 -> 196513342 (-0.00%); split: -0.00%, +0.00%
   Cycles: 14271450761 -> 14271426028 (-0.00%); split: -0.00%, +0.00%
   Send messages: 8022316 -> 8021892 (-0.01%)

   Totals from 43 (0.01% of 653252) affected shaders:
   Instrs: 98558 -> 96953 (-1.63%); split: -1.63%, +0.00%
   Cycles: 15867801 -> 15843068 (-0.16%); split: -0.17%, +0.02%
   Send messages: 8997 -> 8573 (-4.71%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
2b14618daa glsl: Use nir_opt_barrier_modes() to drop unnecessary barriers
iris shader-db stats on Alchemist:

    total instructions in shared programs: 23150249 -> 23142733 (-0.03%)
    instructions in affected programs: 157322 -> 149806 (-4.78%)
    helped: 105
    HURT: 2
    helped stats (abs) min: 2 max: 821 x̄: 71.61 x̃: 15
    helped stats (rel) min: 0.13% max: 27.56% x̄: 6.21% x̃: 2.35%
    HURT stats (abs)   min: 1 max: 2 x̄: 1.50 x̃: 1
    HURT stats (rel)   min: 0.18% max: 0.23% x̄: 0.20% x̃: 0.20%
    95% mean confidence interval for instructions value: -101.99 -38.50
    95% mean confidence interval for instructions %-change: -7.59% -4.58%
    Instructions are helped.

    total sends in shared programs: 1036916 -> 1035366 (-0.15%)
    sends in affected programs: 15274 -> 13724 (-10.15%)
    helped: 108 / HURT: 0
    helped stats (abs) min: 1 max: 162 x̄: 14.35 x̃: 3
    helped stats (rel) min: 0.88% max: 33.83% x̄: 9.81% x̃: 5.05%
    95% mean confidence interval for sends value: -20.79 -7.92
    95% mean confidence interval for sends %-change: -11.66% -7.95%

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
5754461f05 dxil: Set UAV_FENCE_THREAD_GROUP any time global isn't required
With the new nir_opt_barrier_modes() pass, we may encounter control
barriers with no memory modes set, such as:

   @barrier () (execution_scope=WORKGROUP, memory_scope=WORKGROUP, mem_semantics=ACQ|REL, mem_modes=0)

The DXIL validator documentation [1] mentions an
INSTR.BARRIERMODENOMEMORY validation rule:

   "sync must include some form of memory barrier - _u (UAV) and/or
    _g (Thread Group Shared Memory). Only _t (thread group sync) is
    optional."

We were generating a dx.op.barrier instruction with only one flag,
DXIL_BARRIER_MODE_SYNC_THREAD_GROUP.  This seems to run afoul of the
above validator rule.  So, this patch adjusts the code generator to
set DXIL_BARRIER_MODE_UAV_FENCE_THREAD_GROUP too, whenever
UAV_FENCE_GLOBAL isn't required.

[1] https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
fb3e37a014 virgl, nir_to_tgsi: Add a hack for promoting partial memory barriers
Most drivers will want nir_opt_barrier_modes() to optimize out
unnecessary memory barrier modes.  However, virgl has to translate
back to GLSL, which means it can really only handle partial memory
barriers in compute shaders today, because there isn't a proper
way to express them otherwise.  Just ask nir_to_tgsi to promote
these back to full barriers as a workaround.

See KHR-GL43.shader_storage_buffer_object.advanced-readWrite-case1
on virpipe-on-gl as a case where this hack is needed.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
dd92fd8fcc lavapipe: Don't delete control barriers
Control barriers still need to do synchronization even if there are no
associated memory barrier modes.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
fc0aaa81ee nir: Reduce the scope of shared memory barriers
Originally written by Ian Romanick for the Intel backend, but ported
to the new nir_opt_barrier_modes() common optimization pass.  Ian's
original explanation and commit message follows:

Shared memory only exists within a workgroup, so synchronizing it beyond
workgroup scope is nonsense.

Basically every SPIR-V compiler generates operations like

    OpMemoryBarrier(/*Memory*/Device,
                    /*Semantics*/AcquireRelease | WorkgroupMemory)

This is suggested in numerous places, including
https://github.com/KhronosGroup/GLSL/blob/master/extensions/khr/GL_KHR_vulkan_glsl.txt.
Even Mesa's glsl_to_nir pass does this. This advice, which has been
copy-and-pasted everywhere, is contrary to issue 13 in the original
GL_ARB_compute_shader spec:

   "Since shared memory is only accessible to threads within a single
    work group, memoryBarrierShared() also only requires synchronization
    with other threads in the same work group."

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
7dd897e1cd nir: Add an optimization pass to reduce barrier modes
Many shaders issue full memory barriers, which may need to synchronize
access to images, SSBOs, shared local memory, or global memory.
However, many of them only use a subset of those memory types - say,
only SSBOs.

Shaders may also have patterns such as:

   1. shared local memory access
   2. barrier with full variable modes
   3. more shared local memory access
   4. image access

In this case, the barrier is needed to ensure synchronization between
the various shared memory operations.  Image reads and writes do also
exist, but they are all on one side of the barrier, so it is a no-op for
image access.  We can drop the image mode from the barrier here too.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Kenneth Graunke
1c3706fc28 nir: Fix function parameter indentation in nir_opt_barriers.c
The first parameter should be on the first line, and any subsequent
lines should line up.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
2023-09-09 04:41:24 +00:00
Mike Blumenkrantz
17a35412dc zink: re-rework i/o variable handling to make having variables entirely optional
old variables are now only used for copying names if possible, which should
make it possible for zink to process shaders which have no variables at all

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
8b4904405e zink: use right function to get src_type in eliminate_io_wrmasks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
459b49a174 zink: add a new linker pass to handle mismatched i/o components
this is the inverted version of rewrite_read_as_0 which tests for mismatched
component i/o on a given location and rewrites the inputs to zero if the
producer shader didn't write to the component

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
9af2f17937 zink: create new vars without copying existing ones
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
86668052dd zink: use explicit sizing for builtins when creating variables
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
53dab1cf40 zink: use MAX_PATCH_VERTICES directly for arrayed io var sizing
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
e81048a0e2 zink: use explicit stride from types instead of copying old_var stride
should be no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
3c422ba518 zink: simplify an arrayed io check during variable creation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:44 +00:00
Mike Blumenkrantz
dcc1d115f9 zink: use nir_io_semantics::num_slots for indirect var creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
a91d920a63 zink: delete some bindless io lowering code
now that variables are pre-converted this is no longer necessary

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
7fdc74b078 zink: fix typing on bindless io lowering
with lowered io this should always be an ivec2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
a3ce422a99 zink: reorder bindless io lowering
should be no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
e87b24719f zink: set is_xfb=false for all i/o variables
this can affect streamout generation, even though it so far hasn't

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24950>
2023-09-09 04:15:43 +00:00
Mike Blumenkrantz
20cbc6b9a0 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
39b814b2a6 zink: handle multi-plane implicit sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
d4f8ad27f2 zink: handle implicit sync for dmabufs
this adds explicit queue transitions to FOREIGN at the end of the batch
for all written-to dmabufs, then also adds signal/wait semaphores
using the dmabuf fds

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
4932e65f1e zink: hook up cached fd semaphore usage for batch signal/waits
not yet used, matches handling of normal semaphores

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
7662ddc426 zink: add a util for getting cached fd semaphores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
5f7333b188 zink: add a screen cache for fd semaphores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
8d3ac89f97 zink: add another submitinfo for fd semaphore waits
these are semaphores created with VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT
and can't be cached with the others

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
ed17b6f817 zink: make submitinfo handling easier to manage with enum
this was starting to get hard to read

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
ffc371ba61 zink: add a third submitinfo (unused for now)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
efc339f958 zink: make zink_resource_image_barrier2_init public
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Mike Blumenkrantz
a30deb5d31 zink: use a pointer to simplify submit struct mechanics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24962>
2023-09-09 03:44:05 +00:00
Yiwei Zhang
68a478870d venus: expose KHR_external_fence/sempahore_fd extensions
Re-purpose renderer has_external_sync to cover explicit sync emulation
in venus, so that we don't have to add a new flag to distinguish the
emulation path enablement for virtgpu and vtest.

This is to unblock zink implicit sync hanlding against venus for now,
and soon we should migrate to virtgpu fence passing.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25127>
2023-09-09 03:26:25 +00:00
Eric Engestrom
c9c2ba3839 ci: drop clover leftover
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24098>
2023-09-09 01:49:25 +00:00
Marek Olšák
d11900d5e7 meson: use llvm-config instead of cmake to fix linking errors with meson 1.2.1
The cmake path picks a random LLVM in /usr, which happens to be 32-bit LLVM,
which fails to link with 64-bit Mesa. This is a meson, cmake, or LLVM bug.

Acked-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25042>
2023-09-09 00:56:41 +00:00
Sagar Ghuge
6a89507be8 anv: Program and emit STATE_COMPUTE_MODE
Don't rely on the HW to set values correctly so just emit
STATE_COMPUTE_MODE with default values set to zero.

Also, this change includes workaround changes:-
   - 14015808183 (Parent HSD 14015782607)  - Need to emit pipe control
     with HDC flush and untyped cache flush set to 1 when CCS has
     non-pipelined state update with STATE_COMPUTE_MODE.
   - 14014427904 (Parent HSD 22013045878) - We need additional
     invalidate/flush when emitting non-pipelined state commands with
     multiple CCS enabled.

v2: (Tapani)
- Use lineage HSD numbers for check
- Don't use poisoned WA directly
- Use intel_needs_workaround helper

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24508>
2023-09-08 23:08:26 +00:00
Sagar Ghuge
f0d5c7848a intel/genxml: Add STATE_COMPUTE_MODE instruction
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24508>
2023-09-08 23:08:26 +00:00
Sagar Ghuge
7901b536ee iris: Enable always flush cache with DEBUG_STALL option
With DEBUG_STALL option, enable always cache flush option for debugging
purpose that aligns with anv.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25108>
2023-09-08 20:57:20 +00:00
Konstantin Seurer
28e1e33c32 radv: Don't use the depth image view for depth bias emission
If the application records a secondary command buffer that inherits
a render pass without specifying a framebuffer, we should still be able
to emit the depth bias state properly.

Fixes: 266b2cf ("radv: implement VK_EXT_depth_bias_control")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9588
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25018>
2023-09-08 19:26:59 +00:00
Tatsuyuki Ishi
4171d9ff84 radv/amdgpu: Use rwlock to protect access to virtual BOs.
Vulkan provides no external synchronization guarantees on sparse memory
objects. Use a per-BO rwlock to prevent reading data mid-update.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24806>
2023-09-08 18:53:37 +00:00
Lionel Landwerlin
eb0c197090 anv: bound image usages to the associated queue family
When applying barriers for image transitions, we're currently
considering all possible usages of an image. But when running on a
compute only queue for example, the usage of an image will never be
one of those :
   - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT
   - VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR

Removing unused usages for the compute queue allows us to reduce the
scope of the VK_IMAGE_LAYOUT_GENERAL for example. This a bunch of
transition operation that are completely useless when dealing with
barriers on the compute queue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25092>
2023-09-08 18:05:08 +00:00
Eric Engestrom
fafb1a897e ci/b2c: drop logic to remove install.tar
It's still buggy, and it turns out `mcli` has some logic to check if
a file really needs to be re-uploaded, so this doesn't actually change
much to the time uploads take.

This effectively reverts https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24196

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25114>
2023-09-08 17:28:15 +00:00
Lionel Landwerlin
80a352c87c anv: remove aux checking asserts
Zink is running into those asserts on CI. The problem is that with non
auxilary modifiers like I915_FORMAT_MOD_Y_TILED, we might still
allocate larger buffers with IMPLICIT_CCS.

This isn't a complete fix, the real fix with come with
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25003 where
we stop overallocating and those assert will match the private binding
allocation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 569f80f2df ("anv: Reduce accesses of isl_mod_info->aux_usage")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25099>
2023-09-08 16:57:53 +00:00
Samuel Pitoiset
64a5472ad7 radv: remove useless PIPELINE_CREATE_2_LIBRARY_BIT check for retained shaders
VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT is only
allowed for pipeline libs, so VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR
should also be set.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25110>
2023-09-08 16:26:40 +00:00
David Rosca
d6299ec258 frontends/va: Flush after unmapping VAImageBufferType
If application changed image data we need to flush on unmap to make the
changes visible. This will also flush if the mapping was used only for
reading, but we can't know that as vaMapBuffer doesn't have a parameter
to specify if read or write is requested.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9774

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25102>
2023-09-08 16:07:34 +00:00
Georg Lehmann
136a698251 nir/opt_algebraic: remove broken fddx/fddy patterns
These patterns are broken in the following scenario:

%1 = f2fmp %0
%2 = fddx %1
%3 = ... // non quad uniform
if %3 {
   %4 = f2f32 %2
   ...
}

Which would turn into

%3 = ...
if %3 {
   %4 = fddx %0
   ...
}

Yet another example that shows why derivative instructions should be
be intrinsics, not alu.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25014>
2023-09-08 14:14:47 +00:00
Dave Airlie
109a99e691 llvmpipe: enable f16 paths on aarch64.
Karol noticed luxmark didn't work, and this seems to fix it.

Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25104>
2023-09-08 13:18:51 +00:00
Samuel Pitoiset
adaf4460bd radv: do not use pre-compiled prologs when VS is compiled separately
This wouldn't work for VS+TCS or VS+GS if they are compiled separately
on GFX9+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24933>
2023-09-08 12:43:29 +00:00
Samuel Pitoiset
871a383671 radv: adjust emitted prolog regs for merged shaders compiled separately
It should also be the merged shader stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24933>
2023-09-08 12:43:28 +00:00
Samuel Pitoiset
657cabe17e radv: adjust next stage for VS prologs and merged shaders compiled separately
It should be the merged shader stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24933>
2023-09-08 12:43:28 +00:00
Georg Lehmann
524a894ba4 aco/gfx11: don't use bfe for local_invocation_id if the others are always 0
Foz-DB GFX1100:
Totals from 4469 (3.37% of 132657) affected shaders:
Instrs: 3895053 -> 3893529 (-0.04%); split: -0.04%, +0.00%
CodeSize: 20244128 -> 20220952 (-0.11%); split: -0.11%, +0.00%
Latency: 37864147 -> 37862227 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 5578100 -> 5576469 (-0.03%); split: -0.03%, +0.00%
SClause: 108336 -> 108343 (+0.01%); split: -0.00%, +0.01%
Copies: 275897 -> 275900 (+0.00%); split: -0.00%, +0.00%

Reviewed-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/24514>
2023-09-08 11:28:24 +00:00
Danylo Piliaiev
1409f69e00 tu: Call tu_cs_dbg_stomp_regs with appropriate GPU gen
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25098>
2023-09-08 09:58:07 +00:00
Danylo Piliaiev
cb08ccb378 tu: Exclude SP_UNKNOWN_AE73 from reg stomping
There is a guess that GPU may not be able to handle different values of
certain debug register between BR/BV. This one causes GPU to hang.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25098>
2023-09-08 09:58:06 +00:00
Pierre-Eric Pelloux-Prayer
84e61d606b radv/sdma: use correct limits for gfx10.3
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24771>
2023-09-08 09:15:20 +00:00
Pierre-Eric Pelloux-Prayer
c707cb51e5 radv/sdma: use multiple commands if required
Instead of failing the copy we can use multiple chunks.

This codepath shouldn't really be used since the source
image should usually be tiled but it still better to not
fail when possible.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24771>
2023-09-08 09:15:20 +00:00
Pierre-Eric Pelloux-Prayer
ca25d5f846 radeonsi/sdma: use multiple commands if required
Instead of failing the copy we can use multiple chunks.

This codepath shouldn't really be used since the source
image should usually be tiled but it still better to not
fail when possible.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24771>
2023-09-08 09:15:20 +00:00
Eric Engestrom
a69ffbd08a ci: taking igalia farm offline
We're having internet issues, everything is extremely slow.
2023-09-08 09:37:52 +01:00
Timothy Arceri
84e0f5ce75 nir: remove unused param from nir_alu_src_copy()
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24986>
2023-09-08 03:01:39 +00:00
Timothy Arceri
9b6eae2e67 nir: remove unused nir_src_copy()
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24986>
2023-09-08 03:01:39 +00:00
Timothy Arceri
af1528cc15 nir: replace use of nir_src_copy()
Since 03b2c34793 nir_src_copy() no longer does anything useful,
it will be removed in the following patch.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24986>
2023-09-08 03:01:39 +00:00
Mike Blumenkrantz
fd297ecf98 zink: always add a per-prog ref for gpl libs
previously non-separable progs had their libs owned exclusively by
the shaders, which meant it was possible for a background compile job
to crash while the context was being destroyed when accessing libs
which no longer had active shaders

fixes #9234

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25088>
2023-09-08 01:35:00 +00:00
Bas Nieuwenhuizen
4303ea7b9a radv: Use a double jump to limit nops in DGC for dynamic sequence count.
Some RGP data showing that a large amount of NOPs might be a performance
concern.

Some data from a Granite demo repurposed as benchmark:
  - with max_count = 16, actual draw count 1-4, the new path is ~5% slower
  - with max_count = 2048, actual draw count 1-4, the new path is >2x as fast.
  - with max_count = 16384, actual draw count 1-4, the new path is >7x as fast.

Due to the new path being slower in e.g. small cmdbuffers I added a heuristic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25046>
2023-09-08 00:41:34 +00:00
David Heidelberg
05bd55a994 ci/traces: extend no-output timeout by 5 minutes
This should help us handling possibly slower downloads of the traces,
which leads into piglit not printing anything on the output.

After Infra will get stabilized again, needs to be reverted.

Acked-by: Helen Koike <helen.koike@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25097>
2023-09-07 23:43:02 +00:00
Samuel Pitoiset
a2ead228ac radv: avoid emitting THREAD_TRACE_MARKER for predicated draws/dispatches
This confused RGP for example when DGC calls are skipped.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25060>
2023-09-07 22:51:51 +00:00
Samuel Pitoiset
51eb072eb6 radv: skip DGC calls when the indirect sequence count is zero with a predicate
Starfield has a lot of empty ExecuteIndirect() calls. This optimizes
them by using the indirect sequence count as predicate.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25060>
2023-09-07 22:51:51 +00:00
Martin Roukala (né Peres)
13723e3097 radv/ci: use the default kernel on vkcts-navi10
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7888
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25095>
2023-09-07 21:02:25 +00:00
Martin Roukala (né Peres)
76ef5f82ab radv/ci: drop the auto-reboot-on-hang for vkcts-navi10
Anecdotal evidence seems to suggest this is not happening anymore, so
let's try dropping it and see how it fares!

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25095>
2023-09-07 21:02:25 +00:00
Danylo Piliaiev
b16472fc97 ir3/lower_tex_prefetch: Fix crash with lowered load_barycentric_at_offset
ir3_nir_lower_tex_prefetch expects src0 of load_interpolated_input to
be intrinsic, however this assumption broke when src0 is
load_barycentric_at_offset and is lowered in series of alu instructions.

 32x2  %1121 = @load_barycentric_at_offset (%1120) (interp_mode=0)
 32x4  %1118 = @load_interpolated_input (%1121, %1116 (0x0)) ...
 32x2    %32 = vec2 %1118.x, %1118.y
 32x4    %37 = (float32)tex %36 (texture_handle), %34 (sampler_handle), %32 (coord), 0 (texture), 0 (sampler)

is lowered into:

 [...]
 32      %54 = ffma %46.y, %52, %50
 32      %55 = ffma %46.y, %53, %51
 32x2    %56 = vec2 %54, %55
 32x4    %57 = @load_interpolated_input (%56, %25 (0x0))
 [...]

Crash backtrace:

 #5  in __GI___assert_fail (assertion=0x7ff6692328 "parent && parent->type == nir_instr_type_intrinsic",
     file=0x7ff66921c8 "nir.h", line=2536, function=0x7ff6692630 <__PRETTY_FUNCTION__.13> "nir_instr_as_intrinsic")
     at assert.c:101
 #6  in nir_instr_as_intrinsic (parent=0x7fd4b648e8) at nir.h:2536
 #7  in coord_offset (ssa=0x7fd4b649d0) at ir3_nir_lower_tex_prefetch.c:77
 #8  in coord_offset (ssa=0x7fd4b64a90) at ir3_nir_lower_tex_prefetch.c:48
 #9  in ir3_nir_coord_offset (ssa=0x7fd4b64a90) at ir3_nir_lower_tex_prefetch.c:104
 #10 in lower_tex_prefetch_block (block=0x7fd482c100) at ir3_nir_lower_tex_prefetch.c:185
 #11 in lower_tex_prefetch_func (impl=0x7fd4aa0890) at ir3_nir_lower_tex_prefetch.c:218
 #12 in ir3_nir_lower_tex_prefetch (shader=0x7fd4942b10) at ir3_nir_lower_tex_prefetch.c:242

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25096>
2023-09-07 16:12:58 +00:00
Iago Toral Quiroga
eb7a46ed3d v3dv: bump up MAX_UNIFORM_BUFFERS to 16
We currently expose 12 but that becomes 11 when running on Zink
since Mesa's state tracker is aware that the first one is reserved
for its own constant buffer, and the minimum number of UBOs required
by GL is 12, so Zink won't be able to expose UBO support.

Bump it up to 16 to meet Zink requirements, which is what we offer
on V3D.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9764
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25093>
2023-09-07 12:46:10 +00:00
Tatsuyuki Ishi
383842fab8 radv: Fix dumping vertex descriptors with RADV_DEBUG=hang.
Adding 3 words should be done before the uint32_t ** cast. This is in
line with other places which uses pointer arithmetic on trace_id_ptr.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25081>
2023-09-07 11:50:32 +00:00
Vlad Schiller
6d2d74fa1c pvr: Add VK_KHR_driver_properties
This commit will implement the VK_KHR_driver_properties extension.
At the moment, the extension is disabled, because the current conformance
test version does not include the Imagination driver ID. The extension
can be enabled after conformance test version 1.3.6.0.

Co-Authored-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24927>
2023-09-07 11:35:05 +00:00
Lionel Landwerlin
34813e13db pps-producer: add ability to select device with DRI_PRIME
When running with multiple Intel cards in a system, having the ability
to select the device recording performance data is useful.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25051>
2023-09-07 10:44:51 +00:00
Tatsuyuki Ishi
0228b294e8 radv: Fix IB size for RADV_DEBUG=hang.
cs->base.cdw here is the size of the last CS in the chain, but we are
passing in the first CS in the chain to begin decoding. Hence,
cs->ib_buffers[0].cdw is the correct size here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25061>
2023-09-07 09:45:19 +00:00
Tapani Pälli
6e4663635f mesa: disable snorm readpix clamping with EXT_render_snorm
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25054>
2023-09-07 08:59:07 +00:00
Samuel Pitoiset
285223d0fd radv: fix interactions with primitives generated queries and pipeline stats
SAMPLE_STREAMOUTSTATS requires PIPELINESTAT_START to be enabled,
otherwise the hw doesn't count anything.

This fixes
dEQP-VK.transform_feedback.primitives_generated_query.concurrent.pipeline_statistics_2.*
on GFX8. GFX6-9 are probably also affected by this bug, but with NGG
these queries are slightly different and don't use legacy streamout.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25049>
2023-09-07 08:06:40 +00:00
Lionel Landwerlin
6f4fe3f81b anv: Copy/Clear MSAA images over companion RCS while we are on compute
When we have MSAA copy/clear operation on the compute queue, use the
companion RCS command buffer to carry out copy/clear operations.

v2: (Sagar)
- Flush cache according to command buffer
- Invalidate AUX when we create new companion RCS command buffer if
  platform support AUX TT.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
5b8bef8650 anv: Extract batch print code to anv_print_batch helper
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
9866c4e32b anv: Skip layout transition on the compute queue
v2: (Nanley)
- Make sure we skip layout transition during queue ownership transfer

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
46d203c0ab anv: Add secondary companion RCS cmd buffer to primary
Add secondary buffer's companion RCS command buffer to primary buffer's
companion RCS command buffer for execution if secondary RCS is valid.

v2: (Lionel)
- Fix the primary companion RCS check
- Set batch error

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
4d79c2d280 anv: Execute an empty batch to sync main and companion RCS batch
We need to synchronize main (CCS/BCS) and companion rcs batch, so let's
create an empty batch and make both the batches (CCS/BCS) and companion
RCS batch wait on empty sync batch and signal the fence.

Reason to execute the empty batch is we need to make sure the companion
RCS batch finish as soon as the CCS/BCS batch finish. Preemption could
prevent the companion RCS batch execution and we might end up destroying
the CCS/BCS batch before companion RCS finishes.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
0c49d3cf97 anv: Setup companion RCS command buffer submission
Add all the wait fences from the main (CCS/BCS) command buffer to the
companion RCS command buffer so that the companion RCS batch starts at
the same time as the main (CCS/BCS) batch.

v2:
- Drop unncessary flush (Jose)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
a63277ec36 anv: Execute RCS init batch on companion RCS context/engine
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
103512ef3b anv: Move compute specfic bits under compute queue init
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
b375302576 anv: Create companion RCS engine
We need to create companion RCS engine when there is CCS/BCS engine
creation requested.

v2:
- Factor out anv_xe_create_engine code in create_engine (Jose)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Lionel Landwerlin
a5f2c8c845 anv: create individual logical engines on i915 when possible
This enables us to create more logical engines than HW engines are
available. This also brings the uAPI usage closer to what is happening
on Xe.

Rework: (Sagar)
- Correct exec_flag at the time of submission
- Handle device status check
- Set queue parameters

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
a5e4be45c0 intel: Pass virtual memory address space ID while creating context
In future patches, we will be creating a separate companion RCS engine
and each engine is created with it's own address space, and we really
don't want. CCS and RCS engine writes should be visible to each other in
order to get the wait/signal mechanism working.

v2:
- Move drm_i915_gem_context_create_ext_setparam out of if block (Lionel)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
b73960fc40 intel: Add helper to create/destroy i915 VM
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
13b3d7f741 anv: Handle companion RCS in end/destory/reset code path
If we have valid companion RCS command buffer, we should
end/destroy/reset in the same fashion as of main command buffer.

v2:
- Add lock around anv_cmd_buffer_destroy (Sagar)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:06 +00:00
Sagar Ghuge
801523f03d anv: Split out End/Destroy/Reset cmd buffer code into helper
Since we are going to have companion RCS command buffer, we need to
end/destroy/reset companion RCS command buffer similar to main (CCS/BCS)
command buffer.

It's better to split out common code into helper function so that we can
use it later in this series.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:05 +00:00
Sagar Ghuge
edcde0679c anv: Add helper to create companion RCS command buffer
This helper takes the main command buffer as input and then create a
companion RCS command buffer.

v2:
- Rename anv_get_render_queue_index helper to
  anv_get_first_render_queue_index (Jose)
- Rename RCS command buffer to companion RCS command buffer (Lionel)
- Add early return in anv_get_first_render_queue_index (Lionel)
- Add lock around the function (Jose)
- Move companion rcs command pool creation in device create (Sagar)
- Reset companion RCS cmd buffer (Sagar)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23661>
2023-09-07 06:39:05 +00:00
Iago Toral Quiroga
31eaeb8274 v3dv: handle pPlaneLayouts in VkImageDrmFormatModifierExplicitCreateInfoEXT
We have been ignoring these completely until now. V3D isn't very flexible
regarding image layouts anyway, so for the most part we require that
whatever the user puts here matches exactly what the driver would compute
while setting up the slices. The only exceptions are plane offsets which
and array strides.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9742
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25074>
2023-09-07 06:22:36 +00:00
Iago Toral Quiroga
717fbda536 v3dv: be more precise in vkGetImageSubresourceLayout
Only return non-zero values for arrayPitch and depthPitch if
they make sense for the image type.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25074>
2023-09-07 06:22:36 +00:00
Piotr Kocia
8019a1b929 glsl: ir_function_param_visitor::visit_enter always true condition
The condition

!param->type->is_vector() || !param->type->is_scalar()

alawys evaluates to true:

* type is not scalar or vector -> true
* type is vector, i.e. num_components > 1 -> num_components == 1 is
  false and !is_scalar() == true
* type is scalar, i.e. num_components == 1 -> num_components > 1 is
  false and !is_vector() == true

There is no comment explaining why such code has been written, therefore
this seems to be a mistake.

To maintain consistency with the surrounding code,
glsl_type_is_scalar_or_vector has been used instead of
replacing || with &&.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24914>
2023-09-07 15:00:26 +10:00
Timothy Arceri
5d203c4ae0 glsl_to_nir: add more unhandled function types
These are unhandled but were working ok because a mistake fixed
in the following patch caused all functions to be skipped.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24914>
2023-09-07 14:08:02 +10:00
Timothy Arceri
67d1c36bb4 glsl: fix out params in glsl to nir
We must use a temp var for out params and later copy the out values
to the correct parameter otherwise we can end up overwriting
global variables prematurely.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24914>
2023-09-07 14:03:21 +10:00
Mike Blumenkrantz
51ad269198 aux/tc: handle stride mismatch during rp-optimized subdata
to avoid splitting renderpasses, this subdata optimization handles the usual
driver dance of staging buffer -> gpu copy

if the pbo stride doesn't match the image format's stride, however, then
a direct copy will yield broken pixels and the image will misrender. to avoid this,
detect stride mismatch and translate the single subdata call into a sequence
of non-overlapping subdata calls that the driver can magically figure out
while continuing to not split renderpasses

fixes #9589

cc: mesa-stable

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24849>
2023-09-07 01:37:22 +00:00
Eric Engestrom
3ecc5f0180 docs: add one more 23.1.x release
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25090>
2023-09-07 00:28:49 +00:00
Eric Engestrom
a6b8bfabeb docs: update calendar for 23.1.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25090>
2023-09-07 00:28:49 +00:00
Eric Engestrom
67f97816b9 docs: add sha256sum for 23.1.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25090>
2023-09-07 00:28:49 +00:00
Eric Engestrom
bd58c84b03 docs: add release notes for 23.1.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25090>
2023-09-07 00:28:49 +00:00
Dave Airlie
12967c8dcb rusticl: don't store ptrs to nir_variables across opt passes.
If we use NIR_DEBUG=serialize all these ptrs will be left hanging,
just store the var locations and look them up after opt passes.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25072>
2023-09-06 21:58:17 +00:00
Sil Vilerino
f857c9a96f d3d12: Extend video screen AV1 encode tile support checking
Add fallback case to take into account driver reported tile restrictions if
default hardcoded tile configurations are not supported by driver

Reviewed-by: Tanner Van De Walle <tvandewalle@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25070>
2023-09-06 21:30:02 +00:00
Sil Vilerino
967133cc91 util/vl_vlc: Use UINT64_MAX instead of ~0UL with MSVC compiler
vl_vlc_removebits fails on MSVC where ~0UL is taken as 32 bits.
Use the UINT64_MAX constant instead in that case.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25059>
2023-09-06 20:47:20 +00:00
Lionel Landwerlin
23071b9adc docs: update Anv documentation about dynamic state emission
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
ceb1c6033b anv: split BLEND_STATE packing from BLEND_STATE_POINTERS emit
This way when blorp changes the 3DSTATE_BLEND_STATE_POINTERS, we can
just reemit the prior Vulkan state without repacking any of the values
in the BLEND_STATE structure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
2b5f9cc30a anv: remove unused state emission
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
50f6903bd9 anv: add new low level emission & dirty state tracking
A single Vulkan state can map to multiple fields in different GPU
instructions. This change introduces the bottom half of a simplified
emission mechanism where we do the following :
          Vulkan runtime state
                   |
                   V
        Intermediate driver state
                   |
                   V
         Instruction programming

This way we can detect that the intermediate state didn't change and
avoid HW instruction emission.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
8d66ff01b1 vulkan/runtime: add helper to name dirty states
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
44656f98d5 anv: split pipeline programming into instructions
The goal of this change it to move away from a single batch buffer
containing all kind of pipeline instructions to a list of instructions
we can emit separately.

We will later implement pipeline diffing and finer state tracking that
will allow fewer instructions to be emitted.

This changes the following things :

   * instead of having a batch & partially packed instructions, move
     everything into the batch

   * add a set of pointer in the batch that allows us to point to each
     instruction (almost... we group some like URB instructions,
     etc...).

At pipeline emission time, we just go through all of those pointers
and emit the instruction into the batch. No additional packing is
involved.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
758540d741 anv: add a flag tracking occlusion query count change
We'll use this later to know when to reemit
3DSTATE_STREAMOUT::ForceRendering

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
0ce772bd19 anv: split 3DSTATE_VFG emission
Leave the static part in genX_pipeline.c and only repack the dynamic
part in genX_gfx_state.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
1e081bd680 anv: split 3DSTATE_TE packing between static & dynamic parts
We can reduce the amount of packing we do by only packing the dynamic
part.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
19c3f3ede4 anv: categorize partial/final pipeline instruction
The old gfx8 field doesn't apply anymore.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:02 +00:00
Lionel Landwerlin
b1614c4e22 anv: rename files to represent their usage
gfx8_cmd_buffer.c does not apply to gfx8 anymore for instance, it can
also be included in all builds.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:01 +00:00
Lionel Landwerlin
a1f7e7d93e anv: move all dynamic state emission to cmd_buffer_flush_dynamic_state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:01 +00:00
Lionel Landwerlin
047c0ba44b intel/decoder: implement accumulated prints
Useful when you want to compare 2 batches with different ordering in
instruction emission. Also when the driver tries to avoid re-emitting
state.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:01 +00:00
Lionel Landwerlin
2c3a51573a intel/anv: batch stats util
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:01 +00:00
Lionel Landwerlin
1fdc089e9c anv: change anv_batch_emit_merge to also do packing
Instead of having that function do only merging of 2 sets of dwords,
it can also do the packing of the new dynamic values. This saves us a
bunch of local structures to declare and calling the packing functions
ourselves.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:01 +00:00
Lionel Landwerlin
5c287385c2 anv: remove ReorderMode from pipeline 3DSTATE_GS emission
This bit is set in the dynamic state emission. This is currently not
breaking anything because LEADING=0.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 71ebd9b9d7 ("anv,hasvk: respect provoking vertex setting on geometry shaders")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24536>
2023-09-06 20:07:01 +00:00
Lionel Landwerlin
adfa4f0453 blorp: remove unused variable
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24719>
2023-09-06 19:34:28 +00:00
Lionel Landwerlin
9231f24be1 hasvk: add state cache invalidation back before fast clears
Prior to 87149cc545, blorp added a state cache invalidation prior to
fast clears. This got dropped on Hasvk.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 87149cc545 ("blorp: update and move fast clear PIPE_CONTROLs to drivers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24719>
2023-09-06 19:34:28 +00:00
Faith Ekstrand
97c9e01517 nouveau/mme: SPDX everything
For all the Fermi stuff, I've credited Mary because she wrote it before
joining Collabora.  For everything else, credit Collabora.

Acked-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25085>
2023-09-06 17:05:58 +00:00
Faith Ekstrand
919a717ba4 nouveau/nil: SPDX everything
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25085>
2023-09-06 17:05:58 +00:00
Faith Ekstrand
963d658f09 nvk: SPDX everything
I chose to use "Collabora Ldt. and Red Hat Inc." as the author line.  I
could have gone through and manually checked every single file but I
think it's better to spread the blame around.  No one should actually
trust those lines anyway.  That's what git blame is for.

Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25085>
2023-09-06 17:05:58 +00:00
Faith Ekstrand
9aa18e45d9 nvk: Add include guards to nvk_bo_sync.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25085>
2023-09-06 17:05:58 +00:00
Faith Ekstrand
1249937b5d nvk: Clean up includes
Drop a bunch of totally unnecessary stuff from xf86drm.h from
nvk_private.h and limit it to vk_util and vk_log.  In particular, we
drop nvk_entrypoints.h which is auto-generated, allowing NVK headers to
be included in other parts of the tree.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25085>
2023-09-06 17:05:58 +00:00
Gert Wollny
318b838990 r600/sfn: Simplify dependency chain for index loads on EG
Address loads that just load the index register don't need to chain
up like loads if the address register that are used for indirect
register loads. With the latter it is important that the load and the
address register use are in the same clause. For index register loads
this is scheduled accordingly.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24638>
2023-09-06 15:14:19 +00:00
Gert Wollny
e9f60482fb r600/sfn: factor out resource as extra class
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24638>
2023-09-06 15:14:19 +00:00
Gert Wollny
0dea86e886 r600/sfn: drop unused ControlFlowInstr type enum
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24638>
2023-09-06 15:14:19 +00:00
Gert Wollny
16bef14dd4 r600/sfn: Make use of four clause local registers
The hardware is actually configures like this, but for fma64
we have to sacrifice a "normal" register to allocate z and w
channels, even though the result written there is not used.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24638>
2023-09-06 15:14:19 +00:00
Lionel Landwerlin
c9739e8912 intel/fs: limit register flag interaction of FIND_*LIVE_CHANNEL
Those instructions do not access the flag registers on Gfx8+. Removing
the interaction enables CSE to remove more of those instructions.

Results are a bit mixed (DG2 vulkan fossils):

  ACO:
  Totals from 127 (5.97% of 2128) affected shaders:
  Instrs: 139966 -> 138972 (-0.71%); split: -0.85%, +0.14%
  Cycles: 1685747 -> 1667480 (-1.08%); split: -2.35%, +1.26%
  Max live registers: 10582 -> 10544 (-0.36%)
  Max dispatch width: 1048 -> 1040 (-0.76%)

  Cyberpunk 2077:
  Totals from 2879 (27.95% of 10301) affected shaders:
  Instrs: 4264789 -> 4225666 (-0.92%); split: -1.01%, +0.09%
  Cycles: 72380209 -> 71619521 (-1.05%); split: -1.63%, +0.58%
  Subgroup size: 30624 -> 30632 (+0.03%)
  Spill count: 98 -> 101 (+3.06%)
  Fill count: 90 -> 93 (+3.33%)
  Scratch Memory Size: 8192 -> 9216 (+12.50%)
  Max live registers: 217807 -> 217098 (-0.33%); split: -0.59%, +0.26%
  Max dispatch width: 23792 -> 24112 (+1.34%)

  Gaining 40 SIMD16 shaders

  Rise Of The Tomb Raider:
  Totals from 622 (5.06% of 12289) affected shaders:
  Instrs: 437380 -> 434760 (-0.60%); split: -0.72%, +0.12%
  Cycles: 261843085 -> 261580703 (-0.10%); split: -0.73%, +0.63%
  Max live registers: 27731 -> 27766 (+0.13%); split: -1.01%, +1.14%
  Max dispatch width: 5832 -> 5432 (-6.86%); split: +0.27%, -7.13%

  Loosing 26 SIMD32 shaders

  Strange Brigade:
  Totals from 1298 (31.48% of 4123) affected shaders:
  Instrs: 1504408 -> 1487968 (-1.09%); split: -1.17%, +0.08%
  Cycles: 20735976 -> 20443216 (-1.41%); split: -1.60%, +0.19%
  Max live registers: 89911 -> 89957 (+0.05%)

DG2 shader-db run:

  total instructions in shared programs: 23130895 -> 23130036 (<.01%)
  instructions in affected programs: 260956 -> 260097 (-0.33%)
  helped: 234
  HURT: 101
  helped stats (abs) min: 1 max: 54 x̄: 6.36 x̃: 4
  helped stats (rel) min: 0.05% max: 8.16% x̄: 2.01% x̃: 1.90%
  HURT stats (abs)   min: 1 max: 37 x̄: 6.23 x̃: 3
  HURT stats (rel)   min: 0.02% max: 5.67% x̄: 0.89% x̃: 0.55%
  95% mean confidence interval for instructions value: -3.62 -1.51
  95% mean confidence interval for instructions %-change: -1.33% -0.94%
  Instructions are helped.

  total loops in shared programs: 6071 -> 6071 (0.00%)
  loops in affected programs: 0 -> 0
  helped: 0
  HURT: 0

  total cycles in shared programs: 898610645 -> 898557166 (<.01%)
  cycles in affected programs: 18308201 -> 18254722 (-0.29%)
  helped: 315
  HURT: 48
  helped stats (abs) min: 1 max: 19312 x̄: 404.23 x̃: 128
  helped stats (rel) min: 0.02% max: 28.98% x̄: 3.92% x̃: 2.65%
  HURT stats (abs)   min: 2 max: 14478 x̄: 1538.60 x̃: 409
  HURT stats (rel)   min: <.01% max: 23.24% x̄: 3.34% x̃: 0.41%
  95% mean confidence interval for cycles value: -333.68 39.03
  95% mean confidence interval for cycles %-change: -3.51% -2.41%
  Inconclusive result (value mean confidence interval includes 0).

  total spills in shared programs: 5964 -> 5964 (0.00%)
  spills in affected programs: 0 -> 0
  helped: 0
  HURT: 0

  total fills in shared programs: 6909 -> 6909 (0.00%)
  fills in affected programs: 0 -> 0
  helped: 0
  HURT: 0

  total sends in shared programs: 1040266 -> 1040266 (0.00%)
  sends in affected programs: 0 -> 0
  helped: 0
  HURT: 0

  LOST:   3
  GAINED: 1

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24553>
2023-09-06 14:47:40 +00:00
Matt Coster
421d8f1479 pvr: Cleanup comments in pvr_physical_device_get_supported_*()
pvr_physical_device_get_supported_extensions() contained unneeded
/* clang-format off */ guards.

The section comments in pvr_physical_device_get_supported_features()
also now match the pattern in pvr_physical_device_get_properties().

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25033>
2023-09-06 13:24:17 +00:00
Vignesh Raman
4f199175c4 ci: enforce -Wimplicit-const-int-float-conversion for clang
All -Wimplicit-const-int-float-conversion warnings are fixed and ci
can drop -Wno-error=implicit-const-int-float-conversion.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24362>
2023-09-06 12:38:09 +00:00
Vignesh Raman
81a28fb3e2 Do explicit cast to suppress clang warnings
Do explicit cast to suppress the below clang warnings,
../src/mesa/main/get.c:86:31: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
   return ( ((F) * 65536.0f > INT_MAX) ? INT_MAX :

../src/mesa/main/texparam.c:967:27: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
                ((param > INT_MAX) ? INT_MAX : (GLint) (param + 0.5)) :

../src/mesa/main/texparam.c:2609:65: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
         *params = LCLAMPF(obj->Sampler.Attrib.MinLod, INT_MIN, INT_MAX);

../src/mesa/main/texparam.c:2624:65: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
         *params = LCLAMPF(obj->Sampler.Attrib.MaxLod, INT_MIN, INT_MAX);

../src/mesa/main/texparam.c:2648:72: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
         *params = LCLAMPF(obj->Sampler.Attrib.MaxAnisotropy, INT_MIN, INT_MAX);

../src/mesa/main/texparam.c:2693:66: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
         *params = LCLAMPF(obj->Sampler.Attrib.LodBias, INT_MIN, INT_MAX);

../src/gallium/drivers/freedreno/a3xx/fd3_emit.c:731:43: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-const-int-float-conversion]
         OUT_RING(ring, (uint32_t)(zmin * 0xffffffff));

../src/gallium/drivers/freedreno/a3xx/fd3_emit.c:732:43: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-const-int-float-conversion]
         OUT_RING(ring, (uint32_t)(zmax * 0xffffffff));

../src/nouveau/codegen/nv50_ir_peephole.cpp:1647:30: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-const-int-float-conversion]
      CASE(TYPE_U32, u32, 0, UINT32_MAX, 0, INT32_MAX, 0, UINT32_MAX);

../src/nouveau/codegen/nv50_ir_peephole.cpp:1648:38: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
      CASE(TYPE_S32, s32, INT32_MIN, INT32_MAX, INT32_MIN, INT32_MAX, 0, INT32_MAX);

../src/gallium/drivers/radeonsi/si_nir_lower_vs_inputs.c:400:51: error: implicit conversion from 'unsigned long long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-const-int-float-conversion]
         loads[chan] = nir_fmul_imm(b, tmp, 1.0 / BITFIELD64_MASK(bits));

../src/gallium/drivers/radeonsi/si_nir_lower_vs_inputs.c:408:43: error: implicit conversion from 'unsigned long long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-const-int-float-conversion]
         tmp = nir_fmul_imm(b, tmp, 1.0 / BITFIELD64_MASK(bits - 1));

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24362>
2023-09-06 12:38:09 +00:00
Vlad Schiller
3a949de28c pvr: Remove PVR_WINSYS_BO_FLAG_ZERO_ON_ALLOC flag
There has been a recent change to the new powervr KMD to always zero buffer
objects at allocation time to avoid information leaks. This change was made to
address upstream feedback [1]. The result is that the
PVR_WINSYS_BO_FLAG_ZERO_ON_ALLOC no longer makes a difference when using this
KMD.

As the powervr KMD is the one we actually care about, it makes sense to mirror
this change when using the downstream pvrsrvkm KMD in order to avoid differences
in behaviour between the two KMDs. As this makes the
PVR_WINSYS_BO_FLAG_ZERO_ON_ALLOC flag entirely redundant, remove it.

[1] https://lists.freedesktop.org/archives/dri-devel/2023-August/418042.html

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24930>
2023-09-06 12:19:46 +00:00
Rohan Garg
a57faf5037 iris: migrate preemption streamwout wa to WA infra
Fixes: db6c374 ('iris: disable preemption for 3DPRIMITIVE during streamout')
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25080>
2023-09-06 11:51:21 +00:00
Samuel Pitoiset
ed48d1cb53 zink/ci: merge piglit testing with deqp-runner for RADV
This avoids using an extra script to run GLCTS+piglit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25062>
2023-09-06 09:31:00 +00:00
Samuel Pitoiset
b2ce36b40b zink/ci: merge GLCTS testing with GLESx for RADV
Both testsuites used to be executed separately because of spurious
failures/hangs but they seem fixed now.

GLCTS+GLES might be faster to run now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25062>
2023-09-06 09:31:00 +00:00
David Heidelberg
938465ccac ci/farms: no need to check RUNNER_TAG for Collabora farm
Since Google Freedreno and Collabora farm definition split,
we don't need to check for runner tag.

Reported-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24961>
2023-09-06 08:20:30 +00:00
Samuel Pitoiset
17cd153dd0 radv: add support for DGC with SQTT
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25035>
2023-09-06 07:52:50 +00:00
Samuel Pitoiset
63e0fcfb13 radv: avoid emitting SQTT markers for DGC calls
This confuses RGP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25035>
2023-09-06 07:52:50 +00:00
Jordan Justen
8c8fca53fd intel/genxml: Fix comparing xml when node counts differ
This fix is more relevant to MR !20593. Normally when sorting the
number of nodes will be equivalent today, so this bug will not be
encountered. But in !20593, we can shrink (--import) or grow the
number of elements (--flatten) when the genxml_import.py tool is used.

Fixes: e60a0b1616 ("intel/genxml: Move sorting & writing into GenXml class")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24902>
2023-09-06 07:18:47 +00:00
Jordan Justen
d8038c8d09 intel/genxml: Ignore tail leading/trailing whitespace in node_validator()
When importing or flattening genxml with the genxml_import.py script
in MR !20593, it can lead to the tail portion of xml items differing
in whitespace.

If we strip the trailing and leading whitespace from the tail string,
and the strings are equivalent, then we can consider the xml items to
be equivalent.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24903>
2023-09-06 06:51:48 +00:00
Jordan Justen
5d37359f32 intel/dev/xe: Move placeholder subslice info into XEHP_FEATURES
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24418>
2023-09-05 23:02:42 -07:00
Chris Spencer
9123505dde radv/video: use correct enum value for max level IDC
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24649>
2023-09-06 05:10:33 +00:00
Chris Spencer
c29e3d5205 anv/video: use correct enum value for max level IDC
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24649>
2023-09-06 05:10:33 +00:00
Marek Olšák
3040aa2e26 ac/llvm: don't convert undef to 0 because nir_opt_undef does it now
TOTALS FROM AFFECTED SHADERS (29663/58918)
  Code Size: 39163724 -> 37842360 (-3.37 %) bytes
  Max Waves: 394813 -> 396334 (0.39 %)
  Outputs: 84616 -> 84616 (0.00 %)
  Patch Outputs: 0 -> 0 (0.00 %)

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24059>
2023-09-06 03:24:16 +00:00
Marek Olšák
497c40be19 nir: remove nir_op_unpack_64 handling from nir_opt_undef
It's no longer needed because undef is replaced with 0 in this case.

It also has a bug that it doesn't freeze the undef value if undef has
multiple uses.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24059>
2023-09-06 03:24:16 +00:00
Marek Olšák
861d274453 nir: replace undef only used by ALU opcodes with 0 or NaN
If undef is consumed by an FP opcode, replace it with NaN to eliminate
that opcode, else replace it with 0, but there are exceptions, such as
when undef is used by stores or phis, it's not touched.

This also contains workarounds for viewperf shaders.

radeonsi:
TOTALS FROM AFFECTED SHADERS (1987/58918)
  Code Size: 5158692 -> 5143796 (-0.29 %) bytes
  Max Waves: 22456 -> 22513 (0.25 %)
  Outputs: 3726 -> 3726 (0.00 %)
  Patch Outputs: 0 -> 0 (0.00 %)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24059>
2023-09-06 03:24:16 +00:00
Jordan Justen
2b128c570b intel/clflush: Add support for clflushopt instruction
Rework:
 * Split clflushopt into a separate file as recommended by Ken.
   If we enable -mclflush on all driver source compilation, then
   gcc may insert uses of it on processors that don't support it.
 * Add uintptr_t casting to cpu_caps->cacheline usage

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
b68582b1c5 meson: Check for the __builtin_ia32_clflushopt function
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
6f30c980dd util/u_cpu_detect: Detect clflushopt support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
159c797362 util/u_cpu_detect: Drop unused has_tsc
This will allow us to add has_clflushopt without spilling into an new
unsigned.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
e111d3241a anvil,hasvk: Use intel_flush_range_no_fence to flush command buffers
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
9f20be64e6 intel/common: Add intel_flush_range_no_fence
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
486e7bdbd8 anvil,hasvk: Replace intel_clflush_range with intel_flush_range
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
543a707b7b intel/common: Move intel_clflush.h to intel_mem.h/intel_mem.c
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Jordan Justen
735026e811 anvil,hasvk: Rename need_clflush to need_flush
$ git grep -l need_clflush | xargs sed -i 's/need_clflush/need_flush/g'

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22379>
2023-09-06 01:39:53 +00:00
Karol Herbst
785d96b040 rusticl/mesa: create contexts with PIPE_CONTEXT_NO_LOD_BIAS
It's not a thing in OpenCL

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25067>
2023-09-06 01:23:34 +00:00
Sil Vilerino
8d79376957 d3d12: Video Decode - Remove unnecessary copy for texture array case
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25069>
2023-09-06 01:05:36 +00:00
antonino
1456cb9c0b drirc: enable vk_wsi_force_swapchain_to_current_extent for "Serious Sam Fusion"
This game handles swapchain size incorrecly and can crash because of
it.

Enable this driconf as a workaround.

Fixes: 6139493ae3 ("vulkan/wsi: return VK_SUBOPTIMAL_KHR for sw/x11 on window resize")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24818>
2023-09-06 00:10:41 +00:00
antonino
142e317024 drirc: enable vk_wsi_force_swapchain_to_current_extent for "The Talos Principle"
This game handles swapchain size incorrecly and can crash because of
it.

Enable this driconf as a workaround.

Fixes: 6139493ae3 ("vulkan/wsi: return VK_SUBOPTIMAL_KHR for sw/x11 on window resize")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24818>
2023-09-06 00:10:41 +00:00
antonino
aa657247ce vulkan/wsi: add vk_wsi_force_swapchain_to_current_extent driconf
Add a driconf to force the swapchain size to match
`VkSurfaceCapabilities2KHR::currentExtent` as a workaround for
misbehaved games

Fixes: 6139493ae3 ("vulkan/wsi: return VK_SUBOPTIMAL_KHR for sw/x11 on window resize")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24818>
2023-09-06 00:10:41 +00:00
Dave Airlie
d45f598ece llvmpipe: move to nir lowering for fquantize2f16
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24988>
2023-09-05 23:33:20 +00:00
Tapani Pälli
b6bd7107e6 driconf: use lower_depth_range_rate for The Spirit and The Mouse
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9738
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25029>
2023-09-05 22:40:36 +00:00
David Heidelberg
6223e88757 Revert "ci: disable Google Freedreno farm, currently timeouting on all jobs"
This reverts commit fc46062ee5.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25058>
2023-09-05 22:15:19 +00:00
David Rosca
ad6557b101 frontends/va: Support chroma sample location in postproc
Rename vlVaSetCscMatrix to vlVaSetProcParameters because it now does
more than just setting csc matrix.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24869>
2023-09-05 21:31:43 +00:00
David Rosca
a50a46acf5 gallium/auxiliary/vl: Support chroma sample location in compute shaders
Used only in YUV to RGB video_buffer shader for now.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24869>
2023-09-05 21:31:43 +00:00
David Rosca
a6a43963ed gallium/auxiliary/vl: Clamp coordinates in compute shaders
Video textures include padding, so this is needed to avoid sampling
outside of src rect due to scaling or additional offset.
Fixes wrong colors on right/bottom edge.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24869>
2023-09-05 21:31:43 +00:00
David Rosca
a90b9f1d1e gallium/auxiliary/vl: Map range when updating constants
Use WRITE | DISCARD_RANGE to avoid having to read back the csc matrix
and luma min/max values.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24869>
2023-09-05 21:31:43 +00:00
David Rosca
7c8e1596d6 gallium/auxiliary: Fix util_compute_blit half texel offset with scaling
Video textures include padding, so make sure to not sample outside
src rect. Also remove the parameter and always use the offset.

When not scaling, this fixes blurry output.
When scaling, this fixes incorrect color at right/bottom edge.

Acked-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24869>
2023-09-05 21:31:43 +00:00
Mike Blumenkrantz
959801d9d9 zink: polaris ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25056>
2023-09-05 19:43:46 +00:00
Alyssa Rosenzweig
07cb81f0fc asahi: Skip LOD bias lowering for GLES
This reduces silliness in Dolphin ubershaders by eliminating the double
lowering. It also makes the GLES shader assembly nicer to read.

Dolphin ubershader performance at 4K on MMG improved by about 0.5%. Not massive,
but definitely noticeable and reduces the delta to macOS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:35 +00:00
Alyssa Rosenzweig
2adb0f31fc gallium,mesa/st: Add PIPE_CONTEXT_NO_LOD_BIAS flag
While desktop GL supports sampler LOD bias, GLES does not. To support the GL use
case, all Gallium drivers are expected to handle sampler LOD bias. However, this
may require shader code to implement (lowering tex to txb, txl to fadd+txl) and
cost resources to push the LOD bias constants into the shader. The issue is
compounded with something like Dolphin's GLES renderer, which does this LOD bias
emulation itself -- meaning that LOD bias is lowered twice when using Dolphin
with GLES! As such, this commit adds a context flag for frontends to communicate
that they will never use sampler LOD bias, allowing the driver to omit the
lowering as a GLES fast path (or, for Dolphin, for performance parity between
GLES and GL).

This will be used on Asahi. It could also be used to optimize a path on
Mali-T720 supported in Panfrost, though I don't intend to write that patch.

Originally https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25034

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
6269b60a1c asahi: Conditionally expose cube arrays
With =deqp. I don't want this exposed before geometry shaders since we run dEQP
(GLES) far more than Piglit (GL), and we need geometry shaders to get adequate
regression testing via dEQP-GLES.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
dd3dd6e127 asahi: Handle linear 1D Arrays
Lowered to linear 2D Arrays, handle them like that. Fixes 1D Array case of
arb_shader_image_size-builtin.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
56267ec14d asahi: Forbid linear 1D Array images
Porbably a theoretical case, but these fall down the 2D path so better not allow
it at any rate.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
fb60626260 agx: Run opt_idiv_const after lowering texture
Shaves 10 instructions off the cube map array lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
49951ef3cc agx: Lower coordinates for cube map array images
Annoyingly different from texture coordinates.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
fb76f6cc6e agx: Handle cube arrays when clamping arrays
Need to adjust the component.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
54ebddaa0f ail: Force page-alignment for layered attachments
When rendering to a layered depth/stencil attachment, we specify the layer
stride in pages. That means that depth/stencil targets must be page-aligned to
be rendered to correctly.

If we're merely sampling, not rendering, we do not need the extra alignment. So
we add a flag to handle this case so we keep passing the generated ail tests.

Fixes KHR-GLES31.core.texture_cube_map_array.color_depth_attachments

Similarly, we page-align colour attachments. I don't have a good theoretical
justification for this part, but it seems to be necessary and layered rendering
fails otherwise. Possibly the PBE requires page-aligned layers unconditionally?

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
f9b08cf3a6 asahi: Translate cube array dimension
Yet another enum.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
7895d5b79c agx: Add unit test for cmp+sel fusing
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
bdad7992bc agx: Add unit test for if_cmp fusing
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
08e0c5a9cf agx: Fuse compares into selects
This lets us save a LOT of instructions at the cost of increased register
pressure. However, on my shader-db, this is still coming out ahead since no
shaders are hurt for thread count/spills, and only 1/10 of the shaders helped
for instruction count are hurt for register pressure. The shaders most hurt
for pressure have very low pressure (7 -> 15 is the worst case) and you need a
certain number of registers to use a 4 source instruction at all. Analyzing the
hurt shaders, nothing concerns me too much ... this isn't as bad as I feared.

So I think at this point it's worth ripping off the bandage, given the massive
potential for instruction count win. This is a big improvement for some of the
shaders I'm working on for my $SECRET_PROJECT.

   total instructions in shared programs: 1784943 -> 1775169 (-0.55%)
   instructions in affected programs: 644211 -> 634437 (-1.52%)
   helped: 3498
   HURT: 38
   Instructions are helped.

   total bytes in shared programs: 11720734 -> 11643224 (-0.66%)
   bytes in affected programs: 4370986 -> 4293476 (-1.77%)
   helped: 3572
   HURT: 36
   Bytes are helped.

   total halfregs in shared programs: 474094 -> 475165 (0.23%)
   halfregs in affected programs: 12821 -> 13892 (8.35%)
   helped: 65
   HURT: 247
   Halfregs are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
e7ffc799d1 agx: Fuse conditions into if's
Simple greedy thing that has the potential to inflate register pressure but
reduces instructions. Thanks to the recent loop work that turns if { break }
into while_icmp, this also implicitly handles fusing conditions into loops,
which is what actually prompted this.

Surprisingly, this helps register pressure on my shader-db (no change to thread
count), I guess by eliminating the boolean temps in case where the sources are
used multiple times.

   total instructions in shared programs: 1786561 -> 1784943 (-0.09%)
   instructions in affected programs: 128557 -> 126939 (-1.26%)
   helped: 474
   HURT: 13
   Instructions are helped.

   total bytes in shared programs: 11733236 -> 11720734 (-0.11%)
   bytes in affected programs: 976034 -> 963532 (-1.28%)
   helped: 521
   HURT: 13
   Bytes are helped.

   total halfregs in shared programs: 474245 -> 474094 (-0.03%)
   halfregs in affected programs: 1869 -> 1718 (-8.08%)
   helped: 28
   HURT: 7
   Halfregs are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
f17ad0c516 agx: Generate unfused comparison pseudo ops
So we can optimize them easier.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
ed6e391349 agx: Add pseudo-instructions for icmp/fcmp
Easier to optimize with.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
139e56c0db agx: Only use nest by 1 for loops w/o continue
Apple doesn't do this, but it should be equivalent and it makes it easier to see
that we can use while_icmp for break_if_icmp in loops that don't use continue
(which Apple does do). So, the effect of this commit is to use while_icmp for
most breaks, which saves an instruction.

   total instructions in shared programs: 1764199 -> 1764076 (<.01%)
   instructions in affected programs: 24149 -> 24026 (-0.51%)
   helped: 78
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 11609306 -> 11608322 (<.01%)
   bytes in affected programs: 164604 -> 163620 (-0.60%)
   helped: 78
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
8f06252e9b agx: Add helper to determine if a NIR loop uses continue
We need to emit extra instructions to handle continues, but if we don't have
any, we can omit those.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
5c9495cf37 agx: Omit while_icmp without continue
The only role of the while_icmp at the end of a NIR loop is to make continue
jumps work. If, after emitting the loop, we learn that there are no continues,
there is no need to insert a while_icmp since it would be a no-op anyway.

   total instructions in shared programs: 1764311 -> 1764199 (<.01%)
   instructions in affected programs: 26321 -> 26209 (-0.43%)
   helped: 82
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 11609978 -> 11609306 (<.01%)
   bytes in affected programs: 178842 -> 178170 (-0.38%)
   helped: 82
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
e71a1469a8 agx: Omit push_exec at top level
In general, loops need a push_exec at the start for correctness. However, a
push_exec at the top level (non-nested) is a no-op, so we can omit and save a
few cycles.

   total instructions in shared programs: 1764350 -> 1764311 (<.01%)
   instructions in affected programs: 7339 -> 7300 (-0.53%)
   helped: 36
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 11610212 -> 11609978 (<.01%)
   bytes in affected programs: 48638 -> 48404 (-0.48%)
   helped: 36
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
6e0ae2c316 agx: Detect conditional breaks
Search for code like

   if ... {
      break
   }

and replace with a break_if pseudo-instruction for optimized handling, since the
break_if lowering is better than the original code.

   total instructions in shared programs: 1764596 -> 1764350 (-0.01%)
   instructions in affected programs: 24540 -> 24294 (-1.00%)
   helped: 78
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 11611196 -> 11610212 (<.01%)
   bytes in affected programs: 166458 -> 165474 (-0.59%)
   helped: 78
   HURT: 0
   Bytes are helped.

shader-db probably understates the benefit here, since this optimizes the body
of loops.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
a009f39fca agx: Use agx_first_instr
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
aad7d5288a agx: Add agx_first/last_instr helpers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
ffb64283ee agx: Add break_if_*cmp instructions
To faciliate break optimizations. We use a more efficient lowering than the
literal transition of the NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
ff816f224b agx: Split nest instruction into begin_cf + break
We use it for two different things. Pseudo-instructions are cheap, split it up
for easier optimization passes. This also fixes the schedule classes.. we can
move the cf_begin around if we want, it's inert.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
b89c048c9b agx: Lower nest later
As part of pseudo op lowering. Simpler and will simplify control flow opts.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
b25b36a9e3 agx: Expand nest
For breaking out of deeper control flow.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
8405444143 agx: Lower pseudo-ops later
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
f9343fe5ca agx: Remove logical_end instructions
They're more trouble than they're worth for us. They were originally lifted
unthinkingly from ACO, where I assume they're necessary for software CF
lowering, but they're just an inconvenient convenience for us. Remove em.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
a2e5d1ddd1 asahi: Force translucency for ignored render targets
If we bound 4 render targets but we only write to 1 of them, the other 3 need
their contents preserved. This requires either properly configuring HSR to
implement colour masking (TODO) or using the big hammer of setting TRANSLUCENT.
This patch picks the latter for now.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
62a2bdde7f agx: Lower pack_32_4x8_split
Fixes test_integer_ops integer_dot_product.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
23c5ff814e asahi: Allow no16 flag for disk cache
The debug flags are already plumbed into driver_flags for the disk
cache, so we just need to actually allow some flags instead of bailing
out of the disk cache init.

We only care about no16 for production right now, and it's probably a
good idea to disable disk caching during most debug sessions, so
allowlist only that one.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
8781c448a4 driconf: Disable fp16 for browsers
There are way too many broken WebGL apps using the wrong precision
qualifiers, which causes anything from jittery geometry to complete
breakage (e.g. QuakeJS and other games).

In addition, a Firefox bug is breaking basic canvas rendering for the
same reason (mozilla bug #1845309).

Let's just disable fp16 for browsers. There is no hope of getting all
this broken stuff fixed.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
025da70013 asahi: Add and support the no_fp16 driconf flag
This is the driconf equivalent of our debug no16 flag, which disables
fp16 support to work around apps using bad GLSL precision qualifiers.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
45be01374f asahi: Add scaffolding for supporting driconf options
It's time to start using some of these, so add the required scaffolding
to be able to have driver-specific driconf handling for us.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
c83672a0b3 asahi: Fix VDM pipeline field width
The lower bits have a special meaning, like on the other pipelines.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
0424017e72 asahi: decode: Do not assert on buffer overruns
This kills the hypervisor, let's just print and return.

Also flush after decoding, so that if something else goes wrong at least
we get the logs up to that point.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
acd5ed0451 asahi: decode: Implement VDM call/ret
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
c43dbadaa0 asahi: cmdbuf: Identify call/ret bits
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Asahi Lina
4f793d878a asahi: Allocate staging resources as staging
We were never setting the flag, which made these resources
write-combine...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
119e5b9719 agx: Schedule for register pressure
Since we register allocate in SSA, the number of registers required (register
demand) equals to the maximum number of simultaneous live values (register
pressure). So if we can reduce register pressure, we are guaranteed to reduce
register demand. Even an ineffective heuristic like randomly swapping
instructions can only reduce pressure as long as it's conservative.

This implements one such heuristic: in each block, schedule backwards, selecting
the free instruction that looks like it will reduce liveness the most. In other
words, the greedy algorithm to reduce register pressure. At the end of the
block, if we haven't actually reduced pressure, we bail. This isn't optimal, but
it's well-motivated and optimally handles special cases (like 0-source
instructions).

This is based on the scheduler I originally wrote for Mali.

In my Dolphin ubershader branch, this improved performance at native 4K by 10fps
(105fps->115fps) when I measured together with some other optimizations. On top
of my current next (which notably includes nir_opt_sink improvements), this
commit alone goes (53fps->54fps) which is considerably less impressive :-p

shader-db results are a win, but not as large as we might hope. Instruction
count win seems to be from the smaller live ranges being easier on RA (fewer
swaps / moves). The two shaders affected for thread count are from fifa mobile,
which go from 640 threads ->
1024 (full occupancy). In other words... this heuristic does an excellent job in
a small subset of shaders. The Dolphin ubershader win was real, though :~)

Note these shader-db wins are on top of a branch with the nir_opt_sink
improvements. Without that, the stats are much better... The schedulers have
some overlap, but they're better together.

   total instructions in shared programs: 1766635 -> 1763496 (-0.18%)
   instructions in affected programs: 445855 -> 442716 (-0.70%)
   helped: 1963
   HURT: 350
   Instructions are helped.

   total bytes in shared programs: 11597648 -> 11586924 (-0.09%)
   bytes in affected programs: 3106230 -> 3095506 (-0.35%)
   helped: 2003
   HURT: 374
   Bytes are helped.

   total halfregs in shared programs: 504609 -> 481980 (-4.48%)
   halfregs in affected programs: 138322 -> 115693 (-16.36%)
   helped: 3405
   HURT: 311
   Halfregs are helped.

   total threads in shared programs: 18839936 -> 18840704 (<.01%)
   threads in affected programs: 1280 -> 2048 (60.00%)
   helped: 2
   HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
47873ec55e agx: Include schedule class in the opcode info
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
0ea47d86c7 agx: Add schedule-specialized get_sr variants
Some special registers imply scheduling constraints. We want to have a single
scheduling class per instruction in the IR, so fork off various get_sr variants
depending on what kind of SR we're reading, and validate that we use the right
kind.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
f6df092925 agx: Annotate opcodes with a scheduling class
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
6f189afcd5 agx/validate: Print to stderr
Otherwise unusable.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
0df6f22bd1 agx: Fix jmp_exec_none encoding
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Alyssa Rosenzweig
a58bb49fc0 asahi: Fixes for clang-warnings
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Christian Gmeiner
c2b803090b agx/lower_address: Remove not used has_offset
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Christian Gmeiner
d97a79a85e agx/lower_address: Use intrinsics_pass
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:34 +00:00
Neal Gompa
251008c1bf asahi: Fix 32-bit x86 build with correct data type for overflow error message
Currently, when building on 32-bit x86, we get compilation errors
due to data type mis-matches in the format string.

This should fix the issue.

Signed-off-by: Neal Gompa <neal@gompa.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
cce1933ca5 rusticl: enable asahi
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
b70172baff rusticl/memory: fallback if allocating linear images fails
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
7fd3e53279 asahi: handle images in is_format_supported
Some frontends differentiate between textures and images more explicitly
than st/mesa. So we might end up with PIPE_BIND_SHADER_IMAGE but not
PIPE_BIND_SAMPLER_VIEW in is_format_supported.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
3bc09aaf1a asahi: gracefully handle allocating linear images
Frontends might try to allocate linear textures or images, we  should
gracefully return NULL so frontends can do fallback paths.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
01aa487c40 asahi: implement clear_buffer
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
91f4062959 asahi: implement set_global_binding
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
9b59602338 asahi: implement get_compute_state_info
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
9f8a466e03 asahi: handle load_global_invocation_id_zero_base
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
ce5d1100eb asahi: handle load_workgroup_size
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
36e42299fa asahi: handle kernels
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
37597c60ea asahi: lower hadd
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Karol Herbst
36235b5668 asahi: fetch available system memory
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25052>
2023-09-05 18:50:33 +00:00
Connor Abbott
1cef1f02b5 vk/graphics_state: Fix copying MS locations pipeline state
Copying the state below overwrote the ms.sample_locations we set,
so our new_sample_locations was never actually used and we were
accidentally doing a shallow copy. Turnip passes a stack-allocated
old_state, so this resulted in invalid stack pointers.

Fixes: f497cc9d56 ("vk/graphics_state: Add helpers for pre-baking state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25031>
2023-09-05 18:09:41 +00:00
Eric Engestrom
7cf13ea504 ci: skip containers & build jobs when disabling a farm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25032>
2023-09-05 14:04:52 -04:00
Danylo Piliaiev
83cb5c3491 tu/a7xx: Disable LRZ
Even with GMEM disabled LRZ is still interacted with in some cases.
So it has to be completely disabled until it is fixed.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
4b84ae157a tu/a7xx: Fix CmdDrawIndirectByteCountEXT
On a7xx DI_SRC_SEL_AUTO_INDEX is used instead of DI_SRC_SEL_AUTO_XFB.

On a7xx the counter value and offset are shifted right by 2, so
the vertexStride should also be in units of dwords.
CTS doesn't test this though.

Fixes:
 dEQP-VK.transform_feedback.simple.draw_indirect_*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
a2191239f9 tu/a7xx: Fix 3d blits after multiview usage
Fixes cts tests:
 dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
720480943d tu/a7xx: Fix occlusion query
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Mark Collins
9eaf8ab8a0 tu/a7xx: Adapt r3d blits for A7xx
As r3d_ops emits sysmem draws directly, it needs to be manually
updated to emit the A7XX commands instead of A6XX.

VK-CTS tests success on A630 + A740:
dEQP-VK.api.copy_and_blit.core.blit_image.*

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
cdf28d3b4f tu/a7xx: Fix flat shading
dEQP-VK.rasterization.flatshading.* are passing.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
15334c045e tu/a7xx: Fix multiview
dEQP-VK.multiview.* mostly works, fails seem to be caused by lack of
3d blits.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
d13c5aeee8 tu/a7xx: Fix tesselation shaders
dEQP-VK.tessellation.* are passing now.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
d9b33245d4 tu/a7xx: Fix geometry shaders
dEQP-VK.geometry.* are passing now

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
4dc75fc723 freedreno/fdl: Set LOSSLESSCOMPEN for image when ubwc is enabled on a7xx
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
95104707f1 tu: Basic a7xx support
Works:
- sysmem rendering

Doesn't work:
- gmem rendering
- 3d blits
- TESS and GS

Wild Life Extreme benchmarks runs without issues, most Sascha Willems
Vulkan demos are working.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
e19272a7a2 tu/common: Generalize TU_GENX macro
Now it doesn't require generated macro.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
7a01325200 ir3/a7xx: Disable shared consts for a7xx
a7xx introduced a new way to upload shared consts with old one
becoming unavailable, use fallback mechanism until we implement
the new shared consts.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
ba32f44da9 ir3/a7xx: Use ccinv for data synchronization
Fixes a lot of tests in dEQP-VK.memory_model.* e.g.:
 dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.device.payload_local.buffer.guard_local.buffer.comp

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
99457286c9 ir3/a7xx: Add ccinv instruction
_Presumably_ invalidates workgroup-wide cache for image/buffer data access.
so while "fence" is enough to synchronize data access inside a workgroup,
for cross-workgroup synchronization we have to invalidate that cache.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:30 +00:00
Danylo Piliaiev
9b7452c5e6 ir3/a7xx: insert lock/unlock at the end of every compute shader
Add (ss)(sy) in all cases until.

TODO: Set sync flags depending on real need.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
5f89ce8799 ir3/a7xx: Don't multiply global mem instruction's offset by 4
a7xx global memory instructions don't have implied shift.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
5d0d5108d7 ir3/a7xx: cat5 mode1 has swapped tex/samp ids
Though blob is not seen to even use mode1 on a740, it uses
S2EN variant instead.

Fixes:
 dEQP-VK.binding_model.descriptor_buffer.multiple.*
 dEQP-VK.binding_model.descriptor_buffer.embedded_imm_samplers.*
 dEQP-VK.pipeline.monolithic.descriptor_limits.compute_shader.*

Adapted from Jonathan Marek's changes.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
d0ab1a6217 isaspec: Make possible to obtain gpu_id in <expr> blocks
Done with ISA_GPU_ID() macro. This makes possible to use
gpu generation in to select between overrides.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
7e10a175c7 freedreno/computerator: Fix remaining issues with A7XX
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
b0ea4883f0 ir3/tests: Use fd_dev_info to infer GPU generation
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
cd3719be7d freedreno: Fully define a730 and a740 device properties
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
a70e04b0c0 freedreno: Add a list of raw magic regs
The set of magic regs is different between generations and even
sub-gens. Adding a new one and/or emitting one on specific generation
takes much more code than necessary. Doing this in a single place is
much nicer.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
0b25388afe freedreno/registers: Generate python files with reg offsets
This would allow us to use register names in python scripts.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Danylo Piliaiev
a9fc9bc46b freedreno/registers: Refactor gen_header.py to allow more options
We want it to also generate .py files with reg definitions.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217>
2023-09-05 16:19:29 +00:00
Lionel Landwerlin
10e75aae1b intel/nir: rerun lower_tex if it lowers something
nir_lower_tex can lower tg4 coords into tg4 offset which on DG2+ we
also need to lower into constant offsets.

Unfortunately the nir_lower_tex pass is not able to lower the
instructions it itself generates, so the easy fix for when
nir_lower_tex lowers tg4 coords into tg4 offsets is to rerun the pass.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9735
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25015>
2023-09-05 13:35:51 +00:00
Vlad Schiller
c4506b5af5 pvr: Implement VK_KHR_format_feature_flags2
This commit will implement and set VK_KHR_format_feature_flags2
instead of the old ones.

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24929>
2023-09-05 13:15:30 +00:00
Samuel Pitoiset
e80fddf81f radv/amdgpu: do not copy the original chain link for IBs
Otherwise, if a secondary CS is grown and then executed without IB2,
the INDIRECT_BUFFER packet would have been copied but it shouldn't.

This fixes a regression that introduced GPU hangs with
gl_vk_meshlet_cadscene on RDNA2.

Fixes: df0c742543 ("radv/amdgpu: rework growing a CS with the chained IB path slightly")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24891>
2023-09-05 12:38:33 +00:00
Samuel Pitoiset
9206aeb077 radv/amdgpu: fix executing secondaries without IB2
If a secondary cmdbuf has been grown and is executed without IB2
(eg. on compute queue or when it's not allowed), the ib size ptr
contains chaining info, which means the IB size was wrong.

This fixes CPU crashes when running gl_vk_meshlet_cadscene.

Fixes: 277b2afd70 ("radv/amdgpu: add support for executing DGC cmdbuf with RADV_DEBUG=noibs")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24891>
2023-09-05 12:38:33 +00:00
Lionel Landwerlin
40d7cb4000 intel/measure: track batch buffer sizes
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24628>
2023-09-05 11:50:02 +00:00
Lionel Landwerlin
2108742257 anv: reuse cmd_buffer::total_batch_size
This was left unused after 624ac55721 ("anv: move total_batch_size to
anv_batch"). We're now going to use it to store the total amount of
commands written in a command buffer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24628>
2023-09-05 11:50:02 +00:00
Lionel Landwerlin
94e3e05b93 anv: rename total_batch_size
This name is confusing, the real thing it represents is the allocated
amount of batch space.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24628>
2023-09-05 11:50:02 +00:00
Chris Spencer
b492f73f87 anv/android: Enable shared presentable image support
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24941>
2023-09-05 10:02:24 +00:00
Chris Spencer
574bdee19d android: Add explanatory comment to u_gralloc
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24941>
2023-09-05 10:02:24 +00:00
Dmitry Osipenko
0ed4c86873 util/cache_test: Add test for get/put() with disabled cache
The disk_cache_create() now always returns valid cache even when disk
cache is disabled. In a case of disabled cache, the disk cache is NO-OP.
Test whether get/put() work as expected for the disabled cache.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24985>
2023-09-05 09:04:34 +00:00
Dmitry Osipenko
4547671fc3 util/cache_test: Fix disabled cache test using SHADER_CACHE_DISABLE_BY_DEFAULT
Previous commit decoupled EGL_ANDROID_blob_cache from the disk cache
and haven't updated the SHADER_CACHE_DISABLE_BY_DEFAULT test-case that
is failing because now cache is always created even if disk cache is
disabled, such cache is NO-OP in this case. Fix the failing test.

Fixes: 39f26642 ("util: Decouple disk cache from EGL_ANDROID_blob_cache")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24985>
2023-09-05 09:04:34 +00:00
Dmitry Osipenko
976fe1d77c util/cache_test: Re-add test for disabled cache
Test for disabled cache was removed when we decoupled
EGL_ANDROID_blob_cache from the disk cache because test was failing
since it became outdated. Add the updated test.

Fixes: 39f26642 ("util: Decouple disk cache from EGL_ANDROID_blob_cache")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24985>
2023-09-05 09:04:34 +00:00
Dave Airlie
651c47f0ff llvmpipe/cs: further cleanups after tgsi removal.
These was still a few more places that could be polished better.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25045>
2023-09-05 07:14:27 +00:00
Mike Blumenkrantz
ca162bc82d zink: fix linear modifier dmabuf imports
these are disguised as INVALID modifiers, but really they're LINEAR

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25002>
2023-09-05 04:58:36 +00:00
Alyssa Rosenzweig
31b5f5a51f nir/opt_if: Simplify if's with general conditions
Dolphin ubershaders have a pattern:

   if (x && y) {
   } else {
      discard;
   }

The current code to simplify if's will bail on this pattern, since the condition
is not a comparison. However, if that check is dropped and we allow NIR to
invert this, we get:

   if (!(x && y)) {
      discard;
   } else {
   }

which is now in a form for nir_opt_conditional_discard to turn into it

   discard_if(!(x && y))

which may be substantially cheaper than the original code.

In general, I see no reason to restrict to conditionals. Assuming the backend is
clever enough to delete empty else blocks (I think most are), then this patch is
a strict win as long as inot instructions are cheaper than empty else blocks.
This matches my intuition for typical GPUs, where simple ALU instructions are
cheaper than control flow. Furthermore, it may be possible in practice for
backends to fold the inot into a richer set of instructions. For example, most
GPUs have a NAND instructions which would fold in the inot in the above code.

So just drop the check, simplify the pass, get the win.

---

Also, to avoid inflating register pressure, make sure we put the inot right
before the if. Android shader-db on is uninspiring due to terrible
coalescing decisions in the current RA. But it does fix the Dolphin smell.

   total instructions in shared programs: 1756571 -> 1756568 (<.01%)
   instructions in affected programs: 1600 -> 1597 (-0.19%)
   helped: 1
   HURT: 4
   Inconclusive result (value mean confidence interval includes 0).

   total bytes in shared programs: 11521172 -> 11521156 (<.01%)
   bytes in affected programs: 10080 -> 10064 (-0.16%)
   helped: 1
   HURT: 4
   Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24965>
2023-09-05 02:36:41 +00:00
Mike Blumenkrantz
977ef3b388 lavapipe: fix pipeline stride propagation
this is on the cso now

affects dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.before_good_static.large_stride

Fixes: 7672545223 ("gallium: move vertex stride to CSO")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24954>
2023-09-05 01:10:42 +00:00
Mike Blumenkrantz
f2865308c4 lavapipe: update vbo indices before propagating stride
the vbo index is used to set the stride, so it needs to be updated

affects dEQP-VK.pipeline.pipeline_library.bind_buffers_2.single.stride_0_4_offset_1_0.count_2

Fixes: 7672545223 ("gallium: move vertex stride to CSO")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24954>
2023-09-05 01:10:42 +00:00
Mike Blumenkrantz
4f7fb8341e zink: don't block reordering during ref updates in unordered blits
unordered blits handle all the reorder mechanics already, so any changes
here end up unnecessarily blocking further reordering

test case KHR-GLES3.packed_pixels.varied_rectangle.rgb

ref #9016

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24934>
2023-09-05 00:27:23 +00:00
Mike Blumenkrantz
98340dc8c4 zink: be more precise about flagging rp changes around unordered u_blitter
failing to update rp attachments as needed after unordered blits results in
broken (depth) rendering

Fixes: 3a9f7d7038 ("zink: implement unordered u_blitter calls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24934>
2023-09-05 00:27:23 +00:00
Leo Liu
7876a2f685 radeonsi/vcn: fix the incorrect dt_size
Issue: For texture with multiple planes, the planes will point to the
same BO with the total size, so current vcn dt_size is incorrect.

(gdb) p/x *((struct si_resource *)(((struct vl_video_buffer *)out_surf)->resources[0]))
...
  buf = 0x5555558daa30,
  gpu_address = 0xffff800101000000,
  bo_size = 0xa2000,
...
}
(gdb) p/x *((struct si_resource *)(((struct vl_video_buffer *)out_surf)->resources[1]))
...
  buf = 0x5555558daa30,
  gpu_address = 0xffff800101000000,
  bo_size = 0xa2000,
...
}

This is because: in function static struct si_texture *si_texture_create_object(),
   if (plane0) {
      /* The buffer is shared with the first plane. */
      resource->bo_size = plane0->buffer.bo_size;
      ...
      radeon_bo_reference(sscreen->ws, &resource->buf, plane0->buffer.buf);
      resource->gpu_address = plane0->buffer.gpu_address;
   }

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9728
Cc: mesa-stable

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25013>
2023-09-04 22:04:58 +00:00
Tapani Pälli
0e9a26372b iris: implement Wa_14018912822
When MSAA is enabled, instead of using BLENDFACTOR_ZERO use CONST_COLOR,
CONST_ALPHA and supply zero by using blend constants.

We need info on blend state entries in the CSO so that we can set them
up properly.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24714>
2023-09-04 18:57:33 +00:00
Tapani Pälli
672155ee04 anv: implement Wa_14018912822
When MSAA is enabled, instead of using BLENDFACTOR_ZERO use CONST_COLOR,
CONST_ALPHA and supply zero by using blend constants.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24714>
2023-09-04 18:57:33 +00:00
Samuel Pitoiset
6e0ad50102 ci: do not fail vkd3d-proton job when the expectations match
When the list of expected failures match, the job shouldn't fail.
This also adjusts the first error check to catch segfaults.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25025>
2023-09-04 16:56:34 +00:00
Samuel Pitoiset
4a8afc9072 radv/ci: re-enable vkd3d-polaris10-valve
Like the vkcts job, this was disabled a while ago but it seems to be
working well again.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25025>
2023-09-04 16:56:34 +00:00
Pavel Ondračka
58f1931104 r300: use w channel for scalar opcodes if possible
The opcodes write to w by default so using anything else means we can't
schedule anything in the rbg slot anyway becasue we have to replicate the
result from w. We already attempt to do this during the scheduling, but
at that point it is more tricky, so doing it early leads to much better
code. Performance++

RV530 benchmarks:

Lightsmark, 1280x800, fullscreen
before:
    N           Min           Max        Median           Avg        Stddev
x   5         27.32         27.36         27.34         27.34   0.015811388
after:
    N           Min           Max        Median           Avg        Stddev
x   5         27.53         27.61         27.59        27.576   0.034351128

Unigine Sanctuary, 1280x800, fullscreen, medium shaders
before:
    N           Min           Max        Median           Avg        Stddev
x   5       10.1211       10.1238       10.1214      10.12192  0.0011211601
after:
    N           Min           Max        Median           Avg        Stddev
x   5       10.4607       10.4637       10.4619      10.46206  0.0012441865

RV530 shader-db:
total instructions in shared programs: 129643 -> 128038 (-1.24%)
instructions in affected programs: 45415 -> 43810 (-3.53%)
helped: 514
HURT: 43
total presub in shared programs: 4912 -> 5201 (5.88%)
presub in affected programs: 752 -> 1041 (38.43%)
helped: 40
HURT: 30
total omod in shared programs: 381 -> 383 (0.52%)
omod in affected programs: 6 -> 8 (33.33%)
helped: 1
HURT: 3
total temps in shared programs: 16904 -> 16841 (-0.37%)
temps in affected programs: 1377 -> 1314 (-4.58%)
helped: 81
HURT: 52
total lits in shared programs: 3555 -> 3550 (-0.14%)
lits in affected programs: 294 -> 289 (-1.70%)
helped: 13
HURT: 11
total cycles in shared programs: 194771 -> 193734 (-0.53%)
cycles in affected programs: 79079 -> 78042 (-1.31%)
helped: 452
HURT: 84
GAINED: shaders/glamor/82.shader_test FS

RV370 shader-db:
total instructions in shared programs: 82116 -> 81600 (-0.63%)
instructions in affected programs: 11888 -> 11372 (-4.34%)
helped: 273
HURT: 40
total temps in shared programs: 12438 -> 12441 (0.02%)
temps in affected programs: 692 -> 695 (0.43%)
helped: 36
HURT: 39
total cycles in shared programs: 128140 -> 127630 (-0.40%)
cycles in affected programs: 25838 -> 25328 (-1.97%)
helped: 266
HURT: 41
GAINED: shaders/0ad/12.shader_test FS
GAINED: shaders/CC3-tiberium-wars/314.shader_test FS
GAINED: shaders/lightsmark/16.shader_test FS
GAINED: shaders/sanctuary/159.shader_test FS
GAINED: shaders/sanctuary/162.shader_test FS
GAINED: shaders/sanctuary/51.shader_test FS
GAINED: shaders/sanctuary/54.shader_test FS
GAINED: shaders/trine/fp-422.shader_test FS

Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6661

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24889>
2023-09-04 16:13:43 +00:00
Vlad Schiller
326080428e pvr: Add 'info' PVR_DEBUG flag
This commit will add a new PVR_DEBUG flag that, when used,
it will display information about the display and render
devices in the common code (without adding dependencies)

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24931>
2023-09-04 14:38:27 +00:00
Carsten Haitzler
d01a60e8a3 kmsro: Add hdlcd DPU
Arm hdlcd display units do exist on Juno SoC's. This is the
first time Mesa has had to deal with panfrost working on these SoC's,
thus have to add hdlcd support.

Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25027>
2023-09-04 12:33:58 +00:00
David Heidelberg
fc46062ee5 ci: disable Google Freedreno farm, currently timeouting on all jobs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25030>
2023-09-04 11:54:58 +00:00
Roman Stratiienko
b0830e911e v3dv/android: Skip swapchain binding
ANV functionality was used as a reference. As stated in anv_BindImageMemory2:

    Ignore this struct on Android, we cannot access swapchain
    structures there.

Fixes 2 failing VTS test:

    dEQP-VK.wsi.android.swapchain.create#image_swapchain_create_info
    dEQP-VK.wsi.android.swapchain.simulate_oom#image_swapchain_create_info

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25028>
2023-09-04 10:59:38 +00:00
Roman Stratiienko
064e034d5f v3dv: Migrate to vk_device_memory
It allows the reuse of some generic code, especially AHB logic.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25028>
2023-09-04 10:59:38 +00:00
Roman Stratiienko
22809765ac v3dv/android: Enable shared presentable image support
Functionality ensures gralloc won't allocate compressed buffer
incompatible with shared presentable image support.

Broadcom does not support compressed buffers and we can just enable the
feature without additional logic. Despite that, we add the logic here
so it can be replaced with the generic code someday.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25028>
2023-09-04 10:59:38 +00:00
Roman Stratiienko
83b90c4400 v3dv/android: Use u_gralloc code
Use generic u_gralloc logic instead of custom.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25028>
2023-09-04 10:59:38 +00:00
Samuel Pitoiset
083e7d3a92 radv: fix capturing indirect dispatches with SQTT
Looks like indirect dispatches require an event marker instead of an
event marker with dims. That makes sense somehow given the blocks size
is not known at record time with indirect dispatches.

This allows RGP to report correct block sizes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24994>
2023-09-04 06:31:40 +00:00
Qiang Yu
b5eaec6c80 aco,radv,radeonsi: rename is_monolithic to merged_shader_compiled_separately
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24990>
2023-09-04 10:53:44 +08:00
Alexander Orzechowski
6b4d213a6f radeonsi: Set PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET for auxiliary contexts
This fixes a regression with context loss hardened compositors such as
wlroots or kwin where instead of continuing execution in a reset
situation, the process would be aborted. Although these applications set
their notification strategy to lose context on reset, radeonsi also
creates auxiliary contexts for its own use observed when
`egl_init_display` and `gbm_create_device` are called from these
compositors. Fix this by allowing a context loss on reset for these
auxiliary contexts.

Note: It seems this has been attempted before for another call site
creating auxiliary contexts, but this location was missed, hence the
fixed commit hash below.

Fixes: #9672
Fixes: 591aaea648

Signed-off-by: Alexander Orzechowski <alex@ozal.ski>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25023>
2023-09-04 01:09:03 +00:00
Dave Airlie
07ef39ddc6 nir/gather: add support for fbfetch and bindless image loads.
If a driver calls gather after lowering the uses_fbfetch_output
needs to be set properly if we have bindless image loads.

Fixes a regression seen calling gather info later in some llvmpipe
work.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24987>
2023-09-04 08:06:08 +10:00
Timur Kristóf
19a7d9615c ac/nir/ngg: Extract nogs_export_vertex_params function.
Just for better code readability. No functional changes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574>
2023-09-03 11:04:35 +00:00
Timur Kristóf
93b4f200de ac/nir/ngg: Wait for attribute ring stores in mesh shaders.
Make sure that both per-vertex and per-primitive attribute
ring stores are finished before position or primitive export
instructions are executed.

This is necessary because we need to ensure that mesh shader
waves work correctly when they have either vertex-only or
primitive-only waves.

Cc: mesa-stable
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/24574>
2023-09-03 11:04:35 +00:00
Timur Kristóf
0721784b78 ac/nir/ngg: Refactor mesh shader primitive export.
Cleanup the code that generates the two channels of the
primitive export instruction, and move storing the built-in
per-primitive outputs out to match how vertex attributes work.

Prepares the mesh shader lowering for a workaround that
affect export instructions.

Cc: mesa-stable
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/24574>
2023-09-03 11:04:35 +00:00
Timur Kristóf
edd51655f0 ac/nir/ngg: Wait for attribute stores before VS/TES/GS pos0 export.
This is a HW bug workaround for some (all?) GFX11 chips.

On these chips, rasterization can start before the attribute ring
stores are finished, which can cause issues.
As a workaround, wait for attribute ring stores to finish
before doing the position export.

Mesh shaders will be taken care of in another commit.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574>
2023-09-03 11:04:35 +00:00
Timur Kristóf
9c096e4ace ac/nir: Slightly refactor how pos0 exports are added when missing.
Prepares for a workaround. Makes it possible for this function
to not emit the pos0 export at all so that it can be emitted
by a subsequent call to the function later.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574>
2023-09-03 11:04:35 +00:00
Timur Kristóf
838d886d90 ac/nir: Add done arg to ac_nir_export_position.
This prepares for a workaround where we won't need to add
the done flag to the last export in this function, because
it will be added in a subsequent call to the same function.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24574>
2023-09-03 11:04:35 +00:00
Lionel Landwerlin
8a32614a18 isl/tilememcpy_test: add multiple tile testing
Also verify that there is no out-of-bounds accesses.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Aditya Swarup <aditya.swarup@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13391>
2023-09-02 21:49:05 -07:00
Aditya Swarup
fa6562b239 Revert "iris: Disable tiled memcpy for Tile4"
This reverts commit 0022a11ff4.

Enable path for Tile4 memcpy functions to be used.

Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13391>
2023-09-02 21:49:05 -07:00
Aditya Swarup
a6c8ddb596 intel/isl: Linear to Tile-4 conversion unittest
Add unittest to test conversion of data from linear to
Tile-4 format based on bit swizzling conversion info
mentioned in Bspec.

Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13391>
2023-09-02 21:49:05 -07:00
Aditya Swarup
4f0d02902e intel/isl: Convert Tile4 texture to linear format
Add memcpy function to convert Tile-4 4KB texture to linear
format.

Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13391>
2023-09-02 21:49:05 -07:00
Aditya Swarup
a648ee7a70 intel/isl: Convert linear texture to Tile4 format
Add memcpy function to convert linear data to Tile 4 format.
Tile 4 format consists of 4KB block divided into chunks of 512B.
Each 512B chunk/block is comprised of 8 64B blocks arranged in
Y-tile format.

Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13391>
2023-09-02 21:49:05 -07:00
Aditya Swarup
d16eac17d8 intel/isl: Unittest for linear to Ytile conversion
Add unittests for linear to tiled and tiled to linear texture
conversions for Ytile. The test prints the source/output buffer
in hex format with debug flags to verify the result.

Linear to tile conversion fills the linear buffer with values
based on the OWORD index number i.e., OWORD3 will contain
all values filled as 0x03 and
OWORD3 = 0x03030303030303030303030303030303.

The Y-tile to Linear tile conversion uses a similar logic to place
the tiled values in a manner that will result in a linear buffer with
OWORDs filled according to index number as mentioned above.

Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13391>
2023-09-02 21:49:03 -07:00
Rohan Garg
ca7ae1a53f blorp: drop undefined macro
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 97d6ceaf04 ("intel: Remove GEN_IS_HASWELL macro")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25011>
2023-09-03 03:04:26 +00:00
Rohan Garg
99a88ca4a2 crocus: fix GFX_VERx10 macro
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25011>
2023-09-03 03:04:26 +00:00
Rohan Garg
802043018e crocus: add a __gen_get_batch_address declaration
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25011>
2023-09-03 03:04:26 +00:00
Rohan Garg
86e8ba4d32 anv: use the lineage number for WA
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d0669f3ede ("intel/dev: switch defect identifiers to use lineage numbers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25011>
2023-09-03 03:04:26 +00:00
Rohan Garg
50c2fe46fa iris: use the correct WA macros and lineage numbers
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0ce595a89a ("intel: use generated helpers for Wa_1508744258")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25011>
2023-09-03 03:04:26 +00:00
Rohan Garg
cbc4916661 anv: drop dead ifdef
The GFX_VERX10 macro doesn't exist and we no longer use
SCRATCH_SURFACE_STATE_POOL_SIZE.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b3f6e5dc70 ('anv: remove incorrect ifdef')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25011>
2023-09-03 03:04:26 +00:00
Matt Turner
c38b67f4d1 intel: Limit Intel Vulkan RT to x86_64
Note: passed CI repeatedly except for the timing out WHL jobs.

Fixes: 28c1053c07 ("intel: Allow using intel_clc from the system")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25009>
2023-09-02 15:43:18 -04:00
Alyssa Rosenzweig
fd114ab706 ci: Disable WHL jobs
Timing out all day.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-09-02 15:43:01 -04:00
Alyssa Rosenzweig
3e457c6b7e ci: Disable known broken Bifrost Vulkan job
Until someone does the work to eliminate faults, PanVK will be inherently flaky
and should not be in CI. deqp-runner can eat a lot of flakes, and then retrying
the whole job eats more flakes, but neither is a substitute for not testing
known broken (and hence flaky) code and both increase runtime unacceptably. the
g52-vk job earned 2 spots on the latest leaderboard for slowest jobs, I clicked
on https://gitlab.freedesktop.org/mesa/mesa/-/jobs/48142375 to see a jawdropping
54 flakes reported by deqp-runner.

If people insist on keeping the job, then panfrost-g52-vk needs to be demoted to
manual until after someone fixes all these bugs on the driver side. If that's
not going to happen, then there's no point in it being in CI at all. It's broken
code. After a buggy MR, it'll still be broken code. CI doesn't matter if we're
ok with it being broken.

Bottom line is, we can't be running known broken code in CI (bugs = faults =
flakes = unhappy developers), at least for non-robust stacks (panfrost.ko
included). This needs to be policy if it isn't already. Merging this single
character change deals with the hot problem without any fanfare or adverse
effects.

This turns the job into a nightly as David suggested to get it out of the
premerge path until someone is committed to supporting it and does the work to
make it happen.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9721
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24943>
2023-09-02 13:32:17 +00:00
Georg Lehmann
2ae94b3894 aco: implement some exclusive scans with inclusive scans
exclusive scan lowering uses full wave shift, for iadd/ixor it's faster
to do inclusive scans and subtract/xor the thread's source.

Foz-DB Navi21:
Totals from 21 (0.02% of 132657) affected shaders:
Instrs: 10925 -> 10727 (-1.81%)
CodeSize: 58064 -> 56488 (-2.71%)
Latency: 178471 -> 177928 (-0.30%)
InvThroughput: 24374 -> 24145 (-0.94%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24555>
2023-09-02 11:42:22 +00:00
Karol Herbst
f90f68aa1c rusticl/memory: only specify PIPE_BIND_SHADER_IMAGE where supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24982>
2023-09-02 10:11:24 +00:00
Georg Lehmann
3a715cc9d2 nir: add nir_scalar_equal
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24656>
2023-09-02 00:26:31 +00:00
Georg Lehmann
bce9bba90d nir: add nir_scalar intrinsic helpers
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24656>
2023-09-02 00:26:31 +00:00
David Heidelberg
1ae3c40732 docs: add LAVA farm informations
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24959>
2023-09-01 23:58:51 +00:00
David Heidelberg
1a990e21c8 Revert "ci: disable a660 jobs"
This reverts commit 209ed8eace.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24959>
2023-09-01 23:58:51 +00:00
Lionel Landwerlin
4066f05fe4 anv: enable standard Y tiles
We kept those tilings disabled up to know. Now that ISL has proper
support for them, remove this.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Jason Ekstrand
db4488a2dc anv: Align memory VA to support for Ys, Tile64 tiled images
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Aditya Swarup
e03f3b646c isl: enable Tile64 for 3D images
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Jason Ekstrand
e956f6ad30 intel/isl: Allow Ys tiling
Ys & Yf are both implemented in ISL now, we still have some Yf issues
to investigate. Instead of disabling them in ISL, we disable them in
the two drivers.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
4ac46dbb46 isl: reorder tiling selection
Select tilings in this order :
  - recommended Y tilings
  - Yf tilings
  - Ys/Tile64 tilings
  - legacy tilings (W, X) & Linear

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
af559c48d3 intel/aux_map: correctly program tiling mode for Ys
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
3c6d003d9f blorp: allow 3D blits/copies on Ys/Yf/Tile64 tiling
The data in Ys/Yf/Tile64 tiled images is arranged differently for 2D &
3D images. Therefore we cannot assume that we will use 2D images for
blits/copies.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
e182f5770d isl: disable CCS on Ys/Yf
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
4e36aa507e isl: disable miptails on gfx12 with yuv formats
A number of CTS tests are failing, like :

   dEQP-VK.ycbcr.format.b8g8r8g8_422_unorm.vertex_optimal

Failures are reproduced on simulation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
aa31683dde isl: disallow miptails on planar formats
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
7ee41c162d isl: add Gfx12/12.5 restriction on 3D surfaces & compression
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Jason Ekstrand
63c86a95b2 intel/isl: Disallow CCS on 3D surfaces with miptails
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Jason Ekstrand
46f45d62d1 intel/isl: Start using miptails
This commit adds the code for choosing where to start the miptail and
enables miptails by default unless the client driver passes
info->min_miptail_start_level >= info->levels.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Jason Ekstrand
a42d808b71 intel/isl: Support miptails in isl_surf_get_uncompressed_surf
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Lionel Landwerlin
866af3d8fa isl: make isl_surf_get_uncompressed_surf robust to argument accesses
Since the input & output arguments can point to the same location in
memory, if you ever access the input after writing the output you're
in trouble.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:18 +00:00
Jason Ekstrand
988fa2006a intel/isl: Add support for computing offsets with miptails
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
1ada5f5490 intel/isl: Add a max_miptail_levels field to isl_tile_info
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
b1862a0964 intel/isl: Add initial data-structure support for miptails
This commit just adds a miptail start field to isl_surf and wires it up
in the RENDER_SURFACE_STATE and 3DSTATE_DEPTH code.  We also add a
minimum miptail LOD so that client drivers have a knob to control the
miptails a bit.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
68ac5c2165 intel/isl: Support Yf/Ys tiling in emit_depth_stencil_hiz
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
01b50c9dac intel/isl: Support Yf/Ys tiling in surf_fill_state
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
6f90d6d228 intel/isl: Support Ys, Yf & Tile64 in isl_surf_get_uncompressed_surf
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
4ef7b074e7 intel/isl: Indent uncompressed surface code
We're about to add separate code for Yf/Ys and this helps keep the diff
reasonable.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
9a4e9848ad intel/isl: Fill out the correct phys_total_extent for Ys/Yf/Tile64
With these tilings, everything is aligned to a tile and the tiled
surface size calculations will handle the array stride for us.  We need
to provide an accurate 4D size so that 3D and multisampled images get
tiled correctly.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
9421998e95 intel/isl: Use the depth field of phys_level0_sa for GFX4_2D 3D surfaces
This makes things a tiny bit stickier in isl_calc_phys_total_extent_el
but will be worth it when we enable Yf and Ys.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
390d53e13f isl: disallow TileYs/Yf on 3D storage images on Gfx9/11
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
15648dcbba isl: add a usage flag to request 2D/3D compatible views
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
7c5015e181 isl: disable Yf/Ys/Tile64 tilings for 1D images
The ICL+ PRMs show that this is not a supported thing anymore for
Ys/Yf and there isn't really much use for it in Vulkan/Sparse.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
6cde6b1d1a intel/isl: Disallow Yf, Ys and Tile64 for 3D depth/stencil surfaces
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
911832e9cf intel/isl: Implement correct tile size calculations for Ys/Yf
The tile size calculations use a clever bit of math to make them short
and simple.  We add unit tests to assert that they identically match the
tables in the PRM.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
e230ef329b intel/isl: Add ICL variants of Yf and Ys tiling
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Jason Ekstrand
fa625aea3d intel/isl: Rename ISL_TILING_Yf/s to ISL_TILING_SKL_Yf/s
The Yf and Ys tilings change a bit between SKL and later generations so
we have to be able to distinguish between them.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
298e8dee61 isl: program 3DSTATE_HIER_DEPTH_BUFFER_BODY::TiledMode as documented
Since this value is 0, it doesn't change anything, but it's just good
practice like we did for Gfx12.5 right above.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
3e9f366b70 genxml/gfx12: rename Tiled Resource Mode
To match documentation.

BSpec 46965

TGL PRMs, Volume 2d: Command Reference: Structures, 3DSTATE_HIER_DEPTH_BUFFER_BODY

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:17 +00:00
Lionel Landwerlin
cc985bb2ad genxml/gfx11: remove Tiled Resource Mode field from HIER_DEPTH_BUFFER
This field doesn't exist according to documentation. Only a MBZ.

BSpec 6511

ICL PRMs, Volume 2a - Command Reference: Instructions (Command
Opcodes) 3DSTATE_HIER_DEPTH_BUFFER

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:16 +00:00
Lionel Landwerlin
34d5db0583 anv: add missing ISL storage usage
ISL makes a bunch of decision on programming (MOCS,
RENDER_SURFACE_STATE values) based on this flag. It's important to set
it if we're going to use an image as storage.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23620>
2023-09-01 23:22:16 +00:00
Matt Turner
28c1053c07 intel: Allow using intel_clc from the system
With -Dintel-clc=system, the build system will search for an `intel_clc`
binary and use it instead of building `intel_clc` itself.

This allows Intel Vulkan ray tracing support to be built when cross
compiling without terrible hacks (that would otherwise be necessary due
to `intel_clc`'s dependence on SPIRV-LLVM-Translator, libclc, clang, and
LLVM).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24983>
2023-09-01 21:36:02 +00:00
Karol Herbst
5263802618 rusticl/memory: do not verify pitch for IMAGE1D_BUFFER
Devices might report an image_pitch_alignment of 0 leading to a division
by 0 trap.

Fixes: 06daa03c5c ("rusticl: Implement spec for cl_khr_image2d_from_buffer")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24993>
2023-09-01 20:06:30 +00:00
Eric Engestrom
a8c7a2fb69 ci/amd: split the polaris10 rules into one for each farm
There is now one polaris10 in each farm, so we need two rules for which
one to use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24996>
2023-09-01 19:35:33 +00:00
Mark Janes
0f291cb6c0 intel: allow reduced memory usage for INTEL_MEASURE
The default batch size was increased to support large numbers of
INTEL_MEASURE snapshots for complex workloads.  Some titles create
large numbers of small secondary command buffers, and quickly exhaust
memory.  An example of this is Dota2, where INTEL_MEASURE increases
the memory usage by a factor of 20.

Allow the user to specify smaller batch sizes and buffer sizes.

Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24860>
2023-09-01 18:50:24 +00:00
Georg Lehmann
cda5784eb3 aco: use v_cvt_f32_ubyte for signed casts too
The extract is always positive, so signed vs unsigned conversion doesn't matter.

Foz-DB GFX11:
Totals from 167 (0.13% of 133461) affected shaders:
Instrs: 401631 -> 401225 (-0.10%)
CodeSize: 2107256 -> 2104344 (-0.14%)
VGPRs: 13320 -> 13332 (+0.09%)
Latency: 6468063 -> 6467241 (-0.01%)
InvThroughput: 801854 -> 801653 (-0.03%)
Copies: 13926 -> 13927 (+0.01%); split: -0.08%, +0.09%

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24893>
2023-09-01 17:21:57 +00:00
Nanley Chery
144c2d4e4a anv: Initialize the clear color more often for FCV
Instead of only initializing the clear color when the first subresource
is accessed, initialize it for every FCV-enabled subresource. This is
needed because writes to any subresource may be converted to fast
clears.

Now that init_fast_clear_color is called for every subresource, we take
care not to stomp on the fast-clear-tracking state of the first
subresource by moving the code which updates it outside of
init_fast_clear_color.

Now init_fast_clear_color does just what it says: initializes the fast
clear color.

This fixes the regression introduced with commit 57445adc89,
("anv: Re-enable CCS_E on TGL+").

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8461
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24857>
2023-09-01 16:34:22 +00:00
Samuel Pitoiset
223d00fe0a radv/ci: re-enable vkcts-polaris10-valve
This was disabled a long time ago because of unknown GPU hangs during
boot but it seems stable again for some reasons.

This also bumps the job timeouts to make sure it will be able to finish.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24968>
2023-09-01 15:14:58 +00:00
Karol Herbst
46c17a8e54 rusticl/queue: properly implement clCreateCommandQueueWithProperties
It didn't do any of the error checking, but it was supposed to be. Also
the error checking was slightly wrong and we should return
CL_INVALID_QUEUE_PROPERTIES instead of CL_INVALID_VALUE for unsupported
properties.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24991>
2023-09-01 13:51:22 +00:00
Samuel Pitoiset
969f7b97fd zink/ci: add zink-radv-polaris10-valve
This introduces Zink/RADV testing on Polaris10!

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24976>
2023-09-01 12:52:42 +00:00
Feng Jiang
a1a2aac3a3 meson: Move video to separate section in meson configuration summary
Since the video configuration is shared by multiple video APIs, not
just vulkan, move it to a separate section.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24598>
2023-09-01 11:57:37 +00:00
Tapani Pälli
48a41c7700 ci: add a fix for KHR-GLES3.packed_pixels.*snorm tests
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24600>
2023-09-01 10:37:43 +00:00
Tapani Pälli
ff17766fbb mesa: remove GL_UNSIGNED_BYTE as supported for snorm reads
UNSIGNED_BYTE should not be allowed for reading snorm color buffers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9718
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24600>
2023-09-01 10:37:43 +00:00
Vlad Schiller
05179931af pvr: Implement VK_EXT_tooling_info
This commit will enable the EXT_tooling_info extension,
which was already implemented in the common code.

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24928>
2023-09-01 10:10:42 +00:00
Rohan Garg
51bee677b3 anv: use the pre defined _3DPRIMITIVE_DIRECT macro
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24978>
2023-09-01 08:07:54 +00:00
Konstantin Seurer
0385dcac5c aco/lower_to_cssa: Fix typo
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24906>
2023-09-01 07:23:33 +00:00
Konstantin Seurer
ce4c38ecae radv: Only generate debug info if required
Fixes: 51f2fa1a5e ("radv: Break up radv_shader_nir_to_asm")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24906>
2023-09-01 07:23:33 +00:00
Konstantin Seurer
2a5d8d4cf4 aco: Unify demote and demote_if selection
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24906>
2023-09-01 07:23:33 +00:00
Konstantin Seurer
9af91edda9 aco: Use bytes() instead of size() in emit_wqm
This should get most of the cases that would fail validation.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24906>
2023-09-01 07:23:33 +00:00
Konstantin Seurer
1ddf8378cb aco/validate: Handle p_wqm like p_parallelcopy
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24906>
2023-09-01 07:23:32 +00:00
Samuel Pitoiset
e104718c9f aco: allow separate compilation of NGG shaders
Also prevent to emit a long-jump for VS as NGG without a GS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24907>
2023-09-01 06:52:40 +00:00
Samuel Pitoiset
ee8ba0f98f aco: adjust fix_exports() for VS/TES as NGG and non-monolithic shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24907>
2023-09-01 06:52:40 +00:00
Samuel Pitoiset
bfb39031f1 aco: flag blocks with long-jump as export_end for separate compilation
This will allow us to adjust fix_exports().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24907>
2023-09-01 06:52:40 +00:00
Samuel Pitoiset
05185e8412 radv: preserve shader argument for separate compilation of NGG shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24907>
2023-09-01 06:52:40 +00:00
Qiang Yu
1f3858509c radeonsi: enable aco compile for part mode standalone vs
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24713>
2023-09-01 04:44:32 +00:00
Qiang Yu
287f7a9c35 radeonsi: set vs has prolog aco shader info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24713>
2023-09-01 04:44:32 +00:00
Qiang Yu
4247b742ec radeonsi: add vs prolog aco build
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24713>
2023-09-01 04:44:32 +00:00
Qiang Yu
8c3b5ce0c4 radeonsi: fix aco options has_ls_vgpr_init_bug setup
Fixes: b313d950e2 ("radeonsi: enable aco compile for mono merged LS/HS")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24713>
2023-09-01 04:44:32 +00:00
Qiang Yu
ec57236824 radeonsi: extract si_get_vs_prolog_args to be shared with aco
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24713>
2023-09-01 04:44:32 +00:00
Qiang Yu
07b62af810 radeonsi: remove is_monolithic from vs prolog key
We do not generate vs prolog for monolithic shader any more.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24713>
2023-09-01 04:44:32 +00:00
Dave Airlie
b5d9c4ef4f nvk: add build_id linker argument.
the build id was failing for a gentoo build causing instance
creation to fail, this seems to fix it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24916>
2023-09-01 04:00:13 +00:00
Qiang Yu
4c10bf1e6d radeonsi: fill aco_shader_info->is_monolithic
Fixes: 80177e0296 ("aco: add support for compiling VS+TCS separately on GFX9+")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24944>
2023-09-01 03:06:03 +00:00
Karol Herbst
667375999c rusticl/event: disable profiling for devices without timestamps
Timestamp queries are strictly required, but a bit odd to not expose CL
for not supporting it...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24938>
2023-09-01 02:48:55 +00:00
Karol Herbst
8e4d51aa1f rusticl/query: fix use-after-free, but also fix incorrect usage of unsafe
`PipeQuery::new` create a `PipeQuery` wrapper before handling errors, so
we ended up calling `drop` and destroy_query, meaning the latter ended up
being called twice.

While at it, also restrict visibility of related methods and add some
unsafe declarations.

Fixes: 52e53938c3 ("rusticl: Wrap pipe queries")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24938>
2023-09-01 02:48:55 +00:00
Lina Versace
6d3a7c1773 docs: Add row for VK_KHR_maintenance5
Reviewed-By: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24980>
2023-09-01 01:36:55 +00:00
Matt Turner
01f5fd36c8 intel: Only build perf if drivers or tools are enabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24974>
2023-08-31 21:53:19 +00:00
Matt Turner
ce7d41bbc5 intel: Only build ds if drivers are enabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24974>
2023-08-31 21:53:19 +00:00
Matt Turner
60d01cb1af intel: Only build blorp if drivers are enabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24974>
2023-08-31 21:53:19 +00:00
Matt Turner
4f89c1dafd intel: Consider with_intel_clc in with_any_intel
This makes it possible to configure mesa to build only intel_clc.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24974>
2023-08-31 21:53:19 +00:00
Matt Turner
37b88a72fb intel: Rearrange for next commit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24974>
2023-08-31 21:53:19 +00:00
Lang Yu
f2c8cb2649 radeonsi: use wave size to determine index stride
Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24920>
2023-08-31 20:30:03 +00:00
Lang Yu
42abb231aa radeonsi: use AMD_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32 to determine wave size
Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24920>
2023-08-31 20:30:03 +00:00
Lang Yu
11106bab1b amd/common: add AMD_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32 property
This property can be used to determine wave size on gfx10+.

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24920>
2023-08-31 20:30:03 +00:00
Connor Abbott
2ee3367dc9 freedreno/a7xx: Add CP_RESET_CONTEXT_STATE
Used by the kernel driver. Definition taken from kgsl.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24969>
2023-08-31 18:41:04 +00:00
Mike Blumenkrantz
9bd2fabee9 egl: bind dri2_set_WL_bind_wayland_display for zink when necessary
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24701>
2023-08-31 17:54:26 +00:00
Mike Blumenkrantz
4e7c7656f3 egl: call dri3_x11_connect() for zink
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24701>
2023-08-31 17:54:26 +00:00
Mike Blumenkrantz
a31922b785 egl/dri3: only set driver_name if not already set
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24701>
2023-08-31 17:54:26 +00:00
Eric Engestrom
223c36e7db ci/b2c: assert that install folder is present whether or not the tarball was extracted
We already `rm -rf install` at the beginning so it can't be a stale install folder.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24970>
2023-08-31 17:18:22 +00:00
Eric Engestrom
e17f3a2b5a ci/b2c: don't allow failures in test script preparation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24970>
2023-08-31 17:18:22 +00:00
Eric Engestrom
95a9f66f30 ci/b2c: skip install.tar extraction if the tarball is not present
This is the case when retrying after a B2C_TIMEOUT for instance.

Fixes: 85a8f03211 ("ci: delete install.tar after extracting it to avoid re-uploading it")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24970>
2023-08-31 17:18:22 +00:00
Friedrich Vock
728f6c0b70 radv/rt: Pre-initialize instance address
It's not disallowed by spec to load instance-related data in case of a
miss where no instance was ever visited. Such loads make no sense, so we
can return garbage, but it mustn't hang the GPU. Initialize the instance
addresses to the TLAS base to make sure we always have valid memory to load from.

Partially fixes GPU hangs in RTX Remix games.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24971>
2023-08-31 16:29:52 +00:00
Eric Engestrom
9b87912f62 ci: document farm rules
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24898>
2023-08-31 15:33:17 +00:00
Karol Herbst
1a20ac7891 rusticl/disk_cache: fix stack corruption
The length passed to mesa_bytes_to_hex is the one of the input, not output
data.

Fixes: fbe9a7ca3e ("rusticl/mesa: create proper build-id hash for the disk cache")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24967>
2023-08-31 15:17:50 +00:00
Lionel Landwerlin
bcc0ec8e6c anv: enable KHR_maintenance5
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Lionel Landwerlin
688bb37552 anv: deal with new pipeline flags
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Lionel Landwerlin
bbd5baa326 anv: add maintenance5 A8_UNORM/A1B5G5R5_UNORM support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Lionel Landwerlin
fb61bb6af4 anv: implement GetDeviceImageSubresourceLayoutKHR/GetImageSubresourceLayout2KHR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Lionel Landwerlin
8b662d41b4 anv: add vkGetRenderingAreaGranularityKHR()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Lionel Landwerlin
4bd864c487 anv: handle new VkBufferViewUsageCreateInfoKHR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Lionel Landwerlin
5c2aca456e anv: implement vkCmdBindIndexBuffer2KHR
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24387>
2023-08-31 16:02:52 +03:00
Connor Abbott
ceb1d81763 vk/graphic_state, tu: Use dynamic blend count from subpass
A future spec clarification will state that pipelines will not have to
fill out the blend attachment count if every blend state is dynamic.
Instead, this comes from the subpass/rendering/inheritance info. To fix
this while still being able to use the same code to emit dynamic and
precompiled state, we have to set the attachment count in the blend
struct at the beginning of the subpass.

This will also help with ESO where it already worked like this.

Closes: #9709
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24957>
2023-08-31 08:54:04 +00:00
Konstantin Seurer
8bc0f6be67 lavapipe: Fix the locking around cso destruction
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24956>
2023-08-31 07:54:44 +00:00
Konstantin Seurer
3d0ed8bb26 lavapipe: Avoid lowering shaders twice
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9726
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24956>
2023-08-31 07:54:44 +00:00
Dave Airlie
55e348b879 llvmpipe/fs: rewrite output finding using nir.
Reviewed-by: Brian Paul	<brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24817>
2023-08-31 07:13:33 +00:00
Dave Airlie
89451e79cd llvmpipe/fs: drop the simple shader logic
It's been turned off since 2013.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24817>
2023-08-31 07:13:33 +00:00
Dave Airlie
a63c2daf7a llvmpipe/fs: start using nir info in some places.
Reviewed-by: Brian Paul	<brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24817>
2023-08-31 07:13:33 +00:00
Dave Airlie
f36488a406 llvmpipe/analyse: drop TGSI path.
This drop the AERO path, this should probably be reworked using NIR.

Reviewed-by: Brian Paul	<brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24817>
2023-08-31 07:13:33 +00:00
Dave Airlie
d2c4b8b32a llvmpipe/fs: switch to using tgsi->nir instead of handling tgsi
This just swaps, lots of cleanup after this.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24817>
2023-08-31 07:13:33 +00:00
Roman Stratiienko
17f7ffcb36 android: Fix num_planes assignment in u_gralloc_fallback
That seems to be an uncaught porting issue from EGL code to a common.

Fixes: ee42e2166d ("android: Introduce the Android buffer info abstraction")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24953>
2023-08-31 04:03:06 +00:00
Qiang Yu
c8687a4b09 aco: do not fix_exports when program is prolog
Otherwise fix_export() will abort when find no export.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24712>
2023-08-31 02:39:16 +00:00
Qiang Yu
9cce7ce80a aco: add aco compile interface for radeonsi vs prolog
Radeonsi prolog does not need s_endpgm.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24712>
2023-08-31 02:39:16 +00:00
Qiang Yu
a2ba50aee6 aco: add vs prolog instruction selection for radeonsi
Port from llvm si_llvm_build_vs_prolog().

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24712>
2023-08-31 02:39:15 +00:00
Qiang Yu
3f87413811 aco: prepare fix_ls_vgpr_init_bug to be used by gl vs prolog
Prolog does not have nir shader.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24712>
2023-08-31 02:39:15 +00:00
Qiang Yu
eb4f871034 aco: pass sw_stage when setup_isel_context
We are going to add more shader parts.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24712>
2023-08-31 02:39:15 +00:00
Qiang Yu
ffd7328547 aco: simplify setup_tcs_info
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24712>
2023-08-31 02:39:15 +00:00
Mike Blumenkrantz
9b488f36fb ci: disable nouveau shaderdb
this has been timing out with some regularity

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24955>
2023-08-30 22:33:33 +00:00
Derek Foreman
bf1c7ac5cf vulkan/wsi: warn about unset present_mode in PresentModeCompatibilityExt
A bug in vulkan tools, https://github.com/KhronosGroup/Vulkan-Tools/issues/846
causes vulkaninfo to crash in Mesa under wayland since the changes
in 5ceba97c

Handle the crashing case on wayland similarly to how other WSIs
do (nonsensically claiming a single compatible mode), and log
the condition once for all WSIs.

Fixes 5ceba97c2

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24888>
2023-08-30 21:44:46 +00:00
Samuel Pitoiset
a48beddb56 ci: add comment explaining which image tags to update for Fossilize
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24923>
2023-08-30 20:13:17 +00:00
Samuel Pitoiset
6963a6c8e0 ci: uprev Fossilize
This version was really old.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24923>
2023-08-30 20:13:17 +00:00
Samuel Pitoiset
b810eeda6f ci: uprev vkd3d-proton
This introduces more tests, especially coverage for
NV_device_generated_commands_compute.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24923>
2023-08-30 20:13:17 +00:00
Alyssa Rosenzweig
8efc25c54c radv: Use before/after_cf_list for entrypoints
Via Coccinelle patch:

    @@
    expression shader;
    @@

    -nir_before_cf_list(&nir_shader_get_entrypoint(shader)->body)
    +nir_before_impl(nir_shader_get_entrypoint(shader))

    @@
    expression shader;
    @@

    -nir_after_cf_list(&nir_shader_get_entrypoint(shader)->body)
    +nir_after_impl(nir_shader_get_entrypoint(shader))

Suggested-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910>
2023-08-30 19:30:58 +00:00
Alyssa Rosenzweig
f80c57c38f treewide: Use nir_before/after_impl for more elaborate cases
Via Coccinelle patch:

    @@
    expression func_impl;
    @@

    -nir_before_block(nir_start_block(func_impl))
    +nir_before_impl(func_impl)

    @@
    expression func_impl;
    @@

    -nir_after_block(nir_impl_last_block(func_impl))
    +nir_after_impl(func_impl)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910>
2023-08-30 19:30:58 +00:00
Alyssa Rosenzweig
25cc04c59b treewide: Use nir_before/after_impl in easy cases
These open-code the same idiom as the helper.

Via Coccinelle patch:

    @@
    expression func_impl;
    @@

    -nir_before_cf_list(&func_impl->body)
    +nir_before_impl(func_impl)

    @@
    expression func_impl;
    @@

    -nir_after_cf_list(&func_impl->body)
    +nir_after_impl(func_impl)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910>
2023-08-30 19:30:58 +00:00
Alyssa Rosenzweig
4c45503aae nir: Add nir_before/after_impl cursors
These are common enough to merit their own helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24910>
2023-08-30 19:30:58 +00:00
Karol Herbst
bd0d3c7b1c panfrost: drop pan_nir_lower_64bit_intrin
It's dead code now.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24939>
2023-08-30 16:25:40 +00:00
Karol Herbst
7d29a264ea rusticl: reduce global_invocation_id_zero_base to 32 bit
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24939>
2023-08-30 16:25:40 +00:00
Samuel Pitoiset
088c2bbd51 amd/ci: update list of failures/flakes for glcts-vangogh-valve
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24952>
2023-08-30 15:46:34 +00:00
Rhys Perry
c7bb2f7bb9 aco/spill: add all live-in to merge block spill candidates
Previously, only already spilled live-in or phis were added to the spill
candidates. Because of branch definitions, this might not be enough.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9722
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24949>
2023-08-30 15:20:02 +00:00
Mike Blumenkrantz
ae5e2c1fea zink: add lavapipe flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24951>
2023-08-30 14:50:05 +00:00
Matt Coster
e3bedd984e pvr: Zero tail of cs buffers after linking when dumping cs
Dumps already force buffers to zero before they get written to, this
keeps up the pattern of making the contents easier to grok.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24692>
2023-08-30 14:30:15 +00:00
Matt Coster
d59f9999d2 pvr: Do not require TA_STATE_HEADER.pres_ispctl_dbsc for {db,sc}enable
This was a faulty assumption and caused valid control streams to report
as invalid.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24692>
2023-08-30 14:30:15 +00:00
Matt Coster
367aad4f33 pvr: Don't override commands copied to new buffer when extending cs
The next pointer wasn't advanced past the start of the new buffer,
meaning anything overflowed into the new buffer would be overwritten
on the next emit.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24692>
2023-08-30 14:30:15 +00:00
Corentin Noël
9c39ea796c virgl: Do not expose EXT_texture_mirror_clamp when using a GLES host
The GL_MIRROR_CLAMP_EXT wrap parameter is never available in GLES.

This fixes the `spec@!opengl 1.1@texwrap 2d proj` piglit test when using a GLES
host.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24935>
2023-08-30 12:57:58 +00:00
Corentin Noël
1c367933ba ci: Add locked flag to bindgen-cli installation
Ensures that the bindgen-cli dependencies are not changing.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24936>
2023-08-30 10:44:38 +00:00
Simon Ser
6c469f9b19 radv/winsys: check amdgpu_create_bo_from_user_mem() for EINVAL
amdgpu_create_bo_from_user_mem() may fail for multiple reasons.
Only return VK_ERROR_INVALID_EXTERNAL_HANDLE if the kernel
returned EINVAL, which indicates a bad input parameter.

Signed-off-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24858>
2023-08-30 09:42:05 +00:00
Samuel Pitoiset
496a17bffe radv: re-order IO slot layout for stages that aren't linked
Otherwise, if eg. PSIZ is exported the ESGS stride is wrong. This isn't
optimal yet but let's start with this to support separate compilation
of VS/TCS/TES/GS correctly first.

This fixes a bunch of issues when forcing separate compilation on RDNA2.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24908>
2023-08-30 08:59:06 +00:00
Karol Herbst
7550f59178 panfrost: drop 64 bit handling for cl workgroup intrinsics
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
2023-08-30 07:04:33 +00:00
Karol Herbst
202fe3de31 intel/compiler: drop 64 bit handling for cl workgroup intrinsics
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
2023-08-30 07:04:33 +00:00
Karol Herbst
bf4243f080 gallivm/nir: drop 64 bit handling for cl workgroup intrinsics
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
2023-08-30 07:04:33 +00:00
Karol Herbst
a19f98a134 ac: drop 64 bit handling for cl workgroup intrinsics
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
2023-08-30 07:04:33 +00:00
Karol Herbst
513cd29eda nir: make num_workgroups 32 bit only
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
2023-08-30 07:04:33 +00:00
Karol Herbst
1b22b67199 nir: make workgroup_id 32 bit only
No backend supports 64 bit values natively anyway.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905>
2023-08-30 07:04:33 +00:00
Iago Toral Quiroga
ade44ad82e v3d,v3dv: use fquantize2f16 lowering in NIR
Ths is equivalent to what we have been doing in the backend.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24924>
2023-08-30 06:26:35 +00:00
Karol Herbst
209ed8eace ci: disable a660 jobs
They are not working right now and it's blocking:
- https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24936 (critical)
- https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24905

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24945>
2023-08-30 07:22:01 +02:00
Lionel Landwerlin
45e2efbe85 zink+anv: add regression testing with pipeline libraries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24716>
2023-08-29 23:19:13 +00:00
Lionel Landwerlin
74a40cc4b6 intel/fs: move lower of non-uniform at_sample barycentric to NIR
We use a non-uniform lowering loop in the backend which we can do
better in NIR because we can also use divergence analysis there.

This change also limits VGRF usage to a single VGRF to hold the sample
ID in the backend.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24716>
2023-08-29 23:19:13 +00:00
Lionel Landwerlin
68027bd38e intel/fs: implement dynamic interpolation mode for dynamic persample shaders
There is no restriction for query per sample positions from the
interpolator when in non-per-sample dispatch mode. But apparently
that's not giving us the expected values for fragment shaders compiled
without per-sample dispatch knowledge (graphics pipeline libraries).

So when per-sample dispatch is dynamic and we're doing at_sample
interpolation, turn the interpolation back into at_offset at runtime
when we detect that the fragment shader is not run per sample.

Fixes a bunch of dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d8dfd153c5 ("intel/fs: Make per-sample and coarse dispatch tri-state")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24716>
2023-08-29 23:19:13 +00:00
Lionel Landwerlin
9bf2a89127 intel/compiler: fix dynamic alpha-to-coverage handling
Got the wrong logic operation. Let's reuse the nicer NIR builder
helper.

Fixes a bunch of KHR-GL46.sample_variables.mask.rgba8.*.samples*.mask*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: fd7debc8bb ("intel/fs: make alpha_to_coverage a tristate")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9568
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24716>
2023-08-29 23:19:12 +00:00
Lionel Landwerlin
d74c301026 intel/compiler: disable per-sample interpolation modes with non-per-sample dispatch
Fixes hangs in dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5644011f06 ("intel/compiler: Convert wm_prog_key::persample_interp to a tri-state")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24716>
2023-08-29 23:19:12 +00:00
Eric Engestrom
8366d77e4c bin/ci_run_n_monitor: error out if both --project and --pipeline-url are passed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24937>
2023-08-29 19:27:22 +00:00
Ian Romanick
927a24db14 intel/fs: New VGRF packing scheme for constant combining
Each block is processed separately.  VGRF channels that are allocated to
values that are only used in a particular block are made available in
other blocks.

This is almost always an improvement, but there are some pessimal cases
where it goes horribly wrong.  Imagine a shader with two blocks.  In
that shader, the first block has 5 constants used in the first block and
the second block.  Three other constants are only used in the first
block.  The second block has 15 constants that are used only in the
block.  The static VGRF usage is 3 regardless of packing.  However,
scheduling may be able to shorten the live range of the first VGRF when
it only has values that came from the first block (because three of the
values are dead on entry to the second block).

This used to occurs in a Mad Max shader on Broadwell.  That shader
went from 0:0 spills:fills to 107:52.  Some changes over the last
year, I'm assuming !13734, have prevented this case from occuring.

This change created a lot of churn on Haswell and Ivy Bridge.  This
seems to be primarily due to all the extra constants used for coissue,
but I did not investigate very deeply.  On older platforms, there were
no changes to spills or fills.  As a result, this is only used on
Broadwell and newer platforms.

v2: Update expected checksum for pixmark-piano-v2.trace on
gl-zink-anv-tgl. See #9714 for more details.

shader-db results:

Tiger Lake
total instructions in shared programs: 21101332 -> 21102084 (<.01%)
instructions in affected programs: 863686 -> 864438 (0.09%)
helped: 463 / HURT: 437

total cycles in shared programs: 790573225 -> 790664391 (0.01%)
cycles in affected programs: 92546803 -> 92637969 (0.10%)
helped: 558 / HURT: 629

total spills in shared programs: 3959 -> 3951 (-0.20%)
spills in affected programs: 184 -> 176 (-4.35%)
helped: 2 / HURT: 0

total fills in shared programs: 2639 -> 2631 (-0.30%)
fills in affected programs: 184 -> 176 (-4.35%)
helped: 2 / HURT: 0

LOST:   1
GAINED: 5

Ice Lake and Skylake had similar results. (Ice Lake shown)
total instructions in shared programs: 19945216 -> 19944711 (<.01%)
instructions in affected programs: 139569 -> 139064 (-0.36%)
helped: 66 / HURT: 3

total cycles in shared programs: 858410082 -> 857381323 (-0.12%)
cycles in affected programs: 383825958 -> 382797199 (-0.27%)
helped: 1012 / HURT: 1055

total spills in shared programs: 6190 -> 6116 (-1.20%)
spills in affected programs: 891 -> 817 (-8.31%)
helped: 66 / HURT: 3

total fills in shared programs: 7382 -> 7238 (-1.95%)
fills in affected programs: 1538 -> 1394 (-9.36%)
helped: 66 / HURT: 3

LOST:   5
GAINED: 8

Broadwell
total instructions in shared programs: 17820886 -> 17812515 (-0.05%)
instructions in affected programs: 800512 -> 792141 (-1.05%)
helped: 385 / HURT: 1

total cycles in shared programs: 904482935 -> 903102070 (-0.15%)
cycles in affected programs: 422427015 -> 421046150 (-0.33%)
helped: 1091 / HURT: 812

total spills in shared programs: 17908 -> 16576 (-7.44%)
spills in affected programs: 9459 -> 8127 (-14.08%)
helped: 386 / HURT: 0

total fills in shared programs: 25397 -> 22354 (-11.98%)
fills in affected programs: 15504 -> 12461 (-19.63%)
helped: 385 / HURT: 1

LOST:   2
GAINED: 2

No shader-db changes on Haswell or older platforms.

fossil-db results:

Tiger Lake
Instructions in all programs: 156881463 -> 156890970 (+0.0%)
Instructions helped: 9033
Instructions hurt: 10285

Cycles in all programs: 7532597466 -> 7529647924 (-0.0%)
Cycles helped: 10548
Cycles hurt: 13667

Spills in all programs: 5490 -> 5110 (-6.9%)
Spills helped: 100
Spills hurt: 3

Fills in all programs: 6123 -> 5752 (-6.1%)
Fills helped: 100
Fills hurt: 3

Gained: 17
Lost: 47

Ice Lake
Instructions in all programs: 141309644 -> 141309603 (-0.0%)
Instructions helped: 9
Instructions hurt: 4

Cycles in all programs: 9095812690 -> 9097008049 (+0.0%)
Cycles helped: 14288
Cycles hurt: 16381

Spills in all programs: 7418 -> 7404 (-0.2%)
Spills helped: 9
Spills hurt: 4

Fills in all programs: 8326 -> 8321 (-0.1%)
Fills helped: 9
Fills hurt: 4

Skylake
Instructions in all programs: 131872347 -> 131870690 (-0.0%)
Instructions helped: 111
Instructions hurt: 3

Cycles in all programs: 8800835649 -> 8802483884 (+0.0%)
Cycles helped: 9415
Cycles hurt: 9678

Spills in all programs: 6917 -> 6476 (-6.4%)
Spills helped: 111
Spills hurt: 3

Fills in all programs: 7584 -> 7354 (-3.0%)
Fills helped: 111
Fills hurt: 3

Lost: 5

Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7698>
2023-08-29 19:01:37 +00:00
Ian Romanick
c506d7e511 intel/fs: Combine constants for integer instructions too
v2: Remove type change for SHR with negation.  This was a leftover from
a previous attempt to deal with SHR and negation.  Now all right-shifts
with unsigned parameters are marked as not being able to have source
modifiers.

v3: Disallow negations on right shifts of unsigned sources by setting
the no_negations flag in add_candidate_immediate.  This eliminates the
need to exclude SHR in can_do_source_mods.

Tiger Lake
total instructions in shared programs: 21102817 -> 21099443 (-0.02%)
instructions in affected programs: 296796 -> 293422 (-1.14%)
helped: 92 / HURT: 356

total cycles in shared programs: 790564691 -> 790393358 (-0.02%)
cycles in affected programs: 36456886 -> 36285553 (-0.47%)
helped: 171 / HURT: 286

total spills in shared programs: 3951 -> 3959 (0.20%)
spills in affected programs: 176 -> 184 (4.55%)
helped: 0 / HURT: 2

total fills in shared programs: 2631 -> 2639 (0.30%)
fills in affected programs: 176 -> 184 (4.55%)
helped: 0 / HURT: 2

LOST:   0
GAINED: 4

Ice Lake
total instructions in shared programs: 19954204 -> 19949122 (-0.03%)
instructions in affected programs: 40301 -> 35219 (-12.61%)
helped: 23 / HURT: 2

total cycles in shared programs: 858377735 -> 858462082 (<.01%)
cycles in affected programs: 75537286 -> 75621633 (0.11%)
helped: 124 / HURT: 319

total spills in shared programs: 6255 -> 6190 (-1.04%)
spills in affected programs: 392 -> 327 (-16.58%)
helped: 1 / HURT: 2

total fills in shared programs: 7813 -> 7382 (-5.52%)
fills in affected programs: 942 -> 511 (-45.75%)
helped: 1 / HURT: 2

LOST:   0
GAINED: 3

Skylake
total instructions in shared programs: 18049362 -> 18044440 (-0.03%)
instructions in affected programs: 48317 -> 43395 (-10.19%)
helped: 26 / HURT: 2

total cycles in shared programs: 844884806 -> 844915655 (<.01%)
cycles in affected programs: 76137133 -> 76167982 (0.04%)
helped: 171 / HURT: 293

total spills in shared programs: 6148 -> 6149 (0.02%)
spills in affected programs: 595 -> 596 (0.17%)
helped: 4 / HURT: 2

total fills in shared programs: 7484 -> 7067 (-5.57%)
fills in affected programs: 1226 -> 809 (-34.01%)
helped: 4 / HURT: 2

LOST:   0
GAINED: 8

Broadwell
total instructions in shared programs: 17826844 -> 17821805 (-0.03%)
instructions in affected programs: 60687 -> 55648 (-8.30%)
helped: 28 / HURT: 8

total cycles in shared programs: 905332682 -> 904369499 (-0.11%)
cycles in affected programs: 76743509 -> 75780326 (-1.26%)
helped: 179 / HURT: 225

total spills in shared programs: 17922 -> 17908 (-0.08%)
spills in affected programs: 2495 -> 2481 (-0.56%)
helped: 6 / HURT: 8

total fills in shared programs: 26290 -> 25397 (-3.40%)
fills in affected programs: 2606 -> 1713 (-34.27%)
helped: 8 / HURT: 6

LOST:   1
GAINED: 1

Haswell
total instructions in shared programs: 16678878 -> 16674444 (-0.03%)
instructions in affected programs: 78458 -> 74024 (-5.65%)
helped: 87 / HURT: 6

total cycles in shared programs: 880189381 -> 880301043 (0.01%)
cycles in affected programs: 29956463 -> 30068125 (0.37%)
helped: 169 / HURT: 163

total spills in shared programs: 14428 -> 14378 (-0.35%)
spills in affected programs: 2384 -> 2334 (-2.10%)
helped: 8 / HURT: 6

total fills in shared programs: 16975 -> 16881 (-0.55%)
fills in affected programs: 1334 -> 1240 (-7.05%)
helped: 10 / HURT: 4

Ivy Bridge
total instructions in shared programs: 15706048 -> 15706035 (<.01%)
instructions in affected programs: 9941 -> 9928 (-0.13%)
helped: 13 / HURT: 0

total cycles in shared programs: 433618834 -> 433624637 (<.01%)
cycles in affected programs: 12926714 -> 12932517 (0.04%)
helped: 52 / HURT: 41

Sandy Bridge
total cycles in shared programs: 741223552 -> 741223443 (<.01%)
cycles in affected programs: 19814 -> 19705 (-0.55%)
helped: 14 / HURT: 0

No changes on Iron Lake or GM45

fossil-db changes:

Tiger Lake
Instructions in all programs: 156858030 -> 156905532 (+0.0%)
Instructions helped: 3915
Instructions hurt: 15411

Cycles in all programs: 7529667771 -> 7532117340 (+0.0%)
Cycles helped: 10260
Cycles hurt: 9990

Spills in all programs: 5610 -> 5457 (-2.7%)
Spills helped: 18

Fills in all programs: 6274 -> 6091 (-2.9%)
Fills helped: 18

Gained: 2
Lost: 16

Ice Lake
Instructions in all programs: 141308082 -> 141303083 (-0.0%)
Instructions helped: 574
Instructions hurt: 172

Cycles in all programs: 9091361325 -> 9094622766 (+0.0%)
Cycles helped: 8764
Cycles hurt: 11702

Spills in all programs: 7531 -> 7385 (-1.9%)
Spills helped: 19

Fills in all programs: 8462 -> 8294 (-2.0%)
Fills helped: 19

Gained: 22
Lost: 15

Skylake
Instructions in all programs: 131872162 -> 131867263 (-0.0%)
Instructions helped: 566
Instructions hurt: 172

Cycles in all programs: 8795095440 -> 8799676943 (+0.1%)
Cycles helped: 8333
Cycles hurt: 12182

Spills in all programs: 7006 -> 6884 (-1.7%)
Spills helped: 13

Fills in all programs: 7696 -> 7552 (-1.9%)
Fills helped: 13

Gained: 24
Lost: 1

Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7698>
2023-08-29 19:01:36 +00:00
Ian Romanick
64c251bb3a intel/fs: Combine constants for SEL instructions too
It is very common to have bcsel where the second and third sources are
both constants.  This results in a situation where we would want to emit
a SEL with two constant sources, but that's not allowed.

Previously, we would load both constants into registers, then let
constant propagation copy the last constant into the SEL instruction.
This results in the constant using an entire SIMD register instead of a
single channel.

Instead, copy propagate both sources, then let the combine-constants
pass do its thing.  In the worst case, this stores the constant in a
single channel of the SIMD register.  In the best case, it reuses a
value that was loaded into a register to satisfy another instruction.

shader-db results:

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
total instructions in shared programs: 19951549 -> 19948709 (-0.01%)
instructions in affected programs: 482795 -> 479955 (-0.59%)
helped: 1184 / HURT: 3

total cycles in shared programs: 858584724 -> 858205341 (-0.04%)
cycles in affected programs: 356168375 -> 355788992 (-0.11%)
helped: 1448 / HURT: 1195

total spills in shared programs: 6569 -> 6255 (-4.78%)
spills in affected programs: 912 -> 598 (-34.43%)
helped: 58 / HURT: 0

total fills in shared programs: 8218 -> 7813 (-4.93%)
fills in affected programs: 1570 -> 1165 (-25.80%)
helped: 58 / HURT: 0

LOST:   6
GAINED: 16

Broadwell
total instructions in shared programs: 17819660 -> 17819389 (<.01%)
instructions in affected programs: 1078129 -> 1077858 (-0.03%)
helped: 1067 / HURT: 304

total cycles in shared programs: 904722624 -> 905035016 (0.03%)
cycles in affected programs: 362583117 -> 362895509 (0.09%)
helped: 1381 / HURT: 1123

total spills in shared programs: 17884 -> 17922 (0.21%)
spills in affected programs: 5088 -> 5126 (0.75%)
helped: 55 / HURT: 152

total fills in shared programs: 25533 -> 26290 (2.96%)
fills in affected programs: 12992 -> 13749 (5.83%)
helped: 61 /HURT: 295

LOST:   7
GAINED: 24

Haswell
total instructions in shared programs: 16678080 -> 16673976 (-0.02%)
instructions in affected programs: 1162893 -> 1158789 (-0.35%)
helped: 1584 / HURT: 7

total cycles in shared programs: 880180082 -> 879932525 (-0.03%)
cycles in affected programs: 364067522 -> 363819965 (-0.07%)
helped: 1226 / HURT: 976

total spills in shared programs: 14937 -> 14428 (-3.41%)
spills in affected programs: 7866 -> 7357 (-6.47%)
helped: 351 / HURT: 5

total fills in shared programs: 17572 -> 16975 (-3.40%)
fills in affected programs: 11028 -> 10431 (-5.41%)
helped: 350 / HURT: 3

LOST:   8
GAINED: 16

Ivy Bridge
total instructions in shared programs: 15704044 -> 15703158 (<.01%)
instructions in affected programs: 304513 -> 303627 (-0.29%)
helped: 707 / HURT: 0

total cycles in shared programs: 433560149 -> 433471118 (-0.02%)
cycles in affected programs: 19299650 -> 19210619 (-0.46%)
helped: 687 / HURT: 395

LOST:   2
GAINED: 9

Sandy Bridge
total instructions in shared programs: 13913386 -> 13912884 (<.01%)
instructions in affected programs: 195687 -> 195185 (-0.26%)
helped: 455 / HURT: 0

total cycles in shared programs: 741156272 -> 741136266 (<.01%)
cycles in affected programs: 10934349 -> 10914343 (-0.18%)
helped: 578 / HURT: 289

LOST:   9
GAINED: 4

Iron Lake and GM45 had similar results. (Iron Lake shown)
total instructions in shared programs: 8364056 -> 8364042 (<.01%)
instructions in affected programs: 5178 -> 5164 (-0.27%)
helped: 10 / HURT: 0

total cycles in shared programs: 248759794 -> 248757940 (<.01%)
cycles in affected programs: 4305246 -> 4303392 (-0.04%)
helped: 183 / HURT: 24

fossil-db results:

Tiger Lake
Instructions in all programs: 156943594 -> 156802601 (-0.1%)
Instructions helped: 20595
Instructions hurt: 23248

Cycles in all programs: 7512086950 -> 7528386387 (+0.2%)
Cycles helped: 29531
Cycles hurt: 27837

Spills in all programs: 13500 -> 5643 (-58.2%)
Spills helped: 394
Spills hurt: 22

Fills in all programs: 18943 -> 6306 (-66.7%)
Fills helped: 394
Fills hurt: 11

Gained: 93
Lost: 76

Ice Lake
Instructions in all programs: 141395899 -> 141249621 (-0.1%)
Instructions helped: 30067
Instructions hurt: 3

Cycles in all programs: 9097127057 -> 9089668235 (-0.1%)
Cycles helped: 32268
Cycles hurt: 24315

Spills in all programs: 13695 -> 7564 (-44.8%)
Spills helped: 403

Fills in all programs: 18400 -> 8494 (-53.8%)
Fills helped: 403

Gained: 114
Lost: 137

Skylake
Instructions in all programs: 131948328 -> 131826063 (-0.1%)
Instructions helped: 29968
Instructions hurt: 3

Cycles in all programs: 8794778440 -> 8793934844 (-0.0%)
Cycles helped: 32705
Cycles hurt: 23575

Spills in all programs: 10526 -> 7039 (-33.1%)
Spills helped: 403

Fills in all programs: 11025 -> 7728 (-29.9%)
Fills helped: 403

Gained: 102
Lost: 250

Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7698>
2023-08-29 19:01:36 +00:00
Ian Romanick
44d62a5224 intel/fs: Completely re-write the combine constants pass
The is a squash of what in the original MR was "util: Add generic pass
that tries to combine constants" and "intel/fs: Switch to using
util_combine_constants".

The new algorithm uses a multi-pass greedy algorithm that attempts to
collect constants for loading in order of increasing degrees of freedom.
The first pass collects constants that must be emitted as-is (e.g.,
without source modifiers).

The second pass emits all constants that must be emitted (because they
are used in a source field that cannot be a literal constant) but that
can have a source modifier.

The final pass possibly emits constants that may not have to be emitted.
This is used for instructions where one of the fields is allowed to be a
constant.  This is not used in the current commit, but future commits
that enable SEL will use this.  The SEL instruction can have a single
constant, but when both sources are constant, one of the sources has to
be loaded into a register.

By loading constants in this order, required "choices" made in earlier
passes may be re-used in later passes.  This provides a more optimal
result.

At this point in the series, most platforms have the same results with
the new implementation.  Gen7 platforms see a significant number of
"small" changes.  Due to the coissue optimization on Gen7, each shader
is likely to have most constants affected by constant combining.

If a shader has only a single basic block, constants are packed into
registers in the order produced by the constant combining process.
Since each constant has a different live range in the shader, even
slightly different packing orders can have dramatic effects on the live
range of a register.  Even in cases where this does not affect register
pressure in a meaningful way, it can cause the scheduler to make very
different choices about the ordering of instructions.

From my analysis (using the `if (debug) { ... }` block at the end of
fs_visitor::opt_combine_constants), the old implementation and the new
implementation pick the same set of constants, but the order produced
may be slightly different.  For the smaller number of values in non-Gfx7
shaders, the orders are similar enough to not matter.

No shader-db or fossil-db changes on any non-Gfx7 platforms.

Haswell and Ivy Bridge had similar results. (Haswell shown)
total cycles in shared programs: 879930036 -> 880001666 (<.01%)
cycles in affected programs: 22485040 -> 22556670 (0.32%)
helped: 1879
HURT: 2309
helped stats (abs) min: 1 max: 6296 x̄: 258.54 x̃: 34
helped stats (rel) min: <.01% max: 54.63% x̄: 3.88% x̃: 0.87%
HURT stats (abs)   min: 1 max: 9739 x̄: 241.41 x̃: 40
HURT stats (rel)   min: <.01% max: 160.50% x̄: 6.01% x̃: 0.99%
95% mean confidence interval for cycles value: -1.04 35.25
95% mean confidence interval for cycles %-change: 1.23% 1.92%
Inconclusive result (value mean confidence interval includes 0).

LOST:   82
GAINED: 39

Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7698>
2023-08-29 19:01:36 +00:00
Helen Koike
e6625fa25a ci/android: remove strace output from cuttlefish-runner.sh
strace output is only used for debug and its output takes too much
space. Remove it to save resources.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Fixes: 7b51a583ed ("ci/android: add android to the ci")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24913>
2023-08-29 17:06:12 +00:00
Helen Koike
67147a3c5c ci: add --project option to ci_run_n_monitor.py
Now that we have drm-ci, add --project, so the script can also be used
to linux (and any other projects).

Let the default to "mesa" so it can keep behaving as before when the
option is not given.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24912>
2023-08-29 16:54:31 +00:00
Eric Engestrom
f97e38f9cd ci/farm-rules: fix missing valve-infra jobs in scheduled pipelines
Fixes: 79f7882fc6 ("ci: add quirk for GitLab assuming changes is always true for scheduled runs")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24897>
2023-08-29 16:13:44 +00:00
Alyssa Rosenzweig
011f0b0d7d nir/lower_shader_calls: Fix warning with clang
Implicit conversion warning.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24864>
2023-08-29 14:06:14 +00:00
Konstantin Seurer
a209d76722 nir/lower_shader_calls: Limit the remat chain length
There is no way we will rematerialize a 40k instruction long chain and
it also won't be beneficial. This improves the replay time if our CP2077
fossil by 350% when compiling only ray tracing pipelines.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24864>
2023-08-29 14:06:14 +00:00
David Heidelberg
78ec03b3ba panvk: catch unsupported arch in the panvk_physical_device_init
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24201>
2023-08-29 13:17:44 +00:00
David Heidelberg
deb17db38e panvk: architecture isn't invalid, just unsupported
When we fail, tell users clearly why.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24201>
2023-08-29 13:17:44 +00:00
David Rosca
32610bee4c gallium/auxiliary/vl: Set vertex element src_stride in vl_deint_filter
Fixes: 7672545223 ("gallium: move vertex stride to CSO")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24926>
2023-08-29 12:21:06 +00:00
Rhys Perry
cb096b85ff aco/spill: skip p_branch in process_block
Fixes compilation of a Dead by Daylight shader.

fossil-db (gfx1100):
Totals from 58 (0.04% of 133461) affected shaders:
Instrs: 319824 -> 319421 (-0.13%); split: -0.13%, +0.00%
CodeSize: 1711260 -> 1708744 (-0.15%); split: -0.15%, +0.00%
SpillSGPRs: 2567 -> 2459 (-4.21%)
Latency: 3274930 -> 3274921 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 924106 -> 924105 (-0.00%); split: -0.00%, +0.00%
Copies: 41883 -> 41757 (-0.30%); split: -0.31%, +0.00%
Branches: 9144 -> 9146 (+0.02%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9599
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24896>
2023-08-29 11:53:57 +00:00
David Heidelberg
2d98b45086 ci/panfrost: add G52 simple_tests.partial_image_pot_same_format_noclear flake
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24922>
2023-08-29 11:11:51 +00:00
David Heidelberg
c395e445a6 ci/freedreno: add another a530 flake
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24922>
2023-08-29 11:11:51 +00:00
David Heidelberg
ba5085469d ci/virgl: flakes in functional.draw_buffers_indexed group
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24922>
2023-08-29 11:11:51 +00:00
Timothy Arceri
ddac37a8b3 util: add radeonsi workaround for Nowhere Patrol
Cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24919>
2023-08-29 10:15:16 +00:00
Samuel Pitoiset
f30d47c518 aco: fix emitting TCS epilogs end on GFX9+
With merged shaders, the long-jump should be emitted inside the
divergent if (ie. only for TCS invocations) and other non TCS
invocations should just end the program.

This fixes a bunch of failures with CTS by forcing TCS epilogs on
RDNA2.

Not sure how RadeonSI will handle that but maybe doing the merged
wave info thing in epilogs would help.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24832>
2023-08-29 09:30:07 +00:00
Samuel Pitoiset
6463e60fe4 radv: remove the pipeline dependency for emitting VGT_GS_MODE
For shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24865>
2023-08-29 09:10:18 +00:00
Alejandro Piñeiro
c435a71728 v3dv: re-enable sync_fd import/export on the simulator
On commit 29588fe116 we re-enable sync_fd import/export. But only
with the real hw, because at that time there were wrong CTS tests
(that were calling vkSetEvent after submission) that needed to be
fixed.

Since this commit:
717c051d4b

Those tests are fixed. That fix has been on CTS releases for some
time. So we can enable it on the simulator too.

With this change the pattern dEQP-VK.api.external.semaphore.sync_fd*
goes from 2 Passed/10 Not Supported to 12 Passed on the simulator.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24688>
2023-08-29 08:45:31 +00:00
Samuel Pitoiset
3f517ff947 radv: fix emitting TCS epilogs if TES and GS are linked on GFX9+
TES would be NULL because everything is merged to GS.
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24890>
2023-08-29 07:09:51 +00:00
Samuel Pitoiset
01ecaca188 radv: small cleanups in radv_emit_patch_control_points()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24890>
2023-08-29 07:09:51 +00:00
Samuel Pitoiset
9314d5c6df radv: rename tcs_shader to tcs in radv_emit_tcs_epilog_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24890>
2023-08-29 07:09:51 +00:00
Mike Blumenkrantz
f7f6a015d0 zink: remove sync TODO
after investigating, this is pointless and won't ever generate any value

fixes #9016

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24886>
2023-08-29 04:30:46 +00:00
Mike Blumenkrantz
361f7796b4 zink: simplify some image barrier conditionals
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24886>
2023-08-29 04:30:46 +00:00
Mike Blumenkrantz
4d0e975a81 zink: make image barrier init functions void return
the return value was never used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24886>
2023-08-29 04:30:46 +00:00
Mike Blumenkrantz
43be9a867e zink: reset unordered flags for image barriers on non-matching batch access
this allows more reordering when the first barrier in a new cmdbuf can
be reordered after previous ordered access exists

KHR-GLES3.copy_tex_image_conversions.required.texture2d_cubemap_negz:
before - ordered 68
after - ordered 16

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24886>
2023-08-29 04:30:46 +00:00
Mike Blumenkrantz
e64a47cee7 zink: force-reset unordered flags for buffer barriers on non-matching batch access
this should allow slightly better reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24886>
2023-08-29 04:30:46 +00:00
Simon Ser
639bdadd4a vulkan/wsi/wayland: fix unset present_mode
chain->base.present_mode is unset at this point, ie. it's
zero-initialized. VK_PRESENT_MODE_IMMEDIATE_KHR happens to be 0,
so the WSI will attempt to use tearing-control on compositors that
don't support it.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 5ceba97c2e ("vulkan/wsi/wayland: add support for IMMEDIATE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24885>
2023-08-29 02:37:10 +00:00
Mike Blumenkrantz
6776f7c6d3 zink: fix optimal_keys warning message
needs more newlines

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24894>
2023-08-29 01:12:48 +00:00
Mike Blumenkrantz
b8ea9724fa zink: be consistent with ds3 state resetting for blits
handle no-stipple case

Fixes: 122ffb0c88 ("zink: unset line stipple ds3 state flags when stipple not available")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24894>
2023-08-29 01:12:48 +00:00
Mike Blumenkrantz
87044cfe33 zink: break out ds3 state resetting
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24894>
2023-08-29 01:12:48 +00:00
Bas Nieuwenhuizen
60b3090d5d vulkan: Add trace points for more Vulkan waiting functions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24799>
2023-08-29 00:27:33 +00:00
Ruijing Dong
b39d328dcb frontends/va: checking va version for av1enc support
need to ensure va version >= 1.16 to support av1enc.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24901>
2023-08-28 22:32:42 +00:00
Yiwei Zhang
72f104791d venus: expose at least one cached memory type
Kernel makes every mapping coherent. If a memory type is truly
incoherent, it's better to remove the host-visible flag than silently
making it coherent. However, for app compatibility purpose, when
coherent-cached memory type is unavailable, we emulate the first cached
memory type with the first coherent memory type.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24875>
2023-08-28 18:21:48 +00:00
Sil Vilerino
7c98510d17 d3d12: Fix H264 interlaced decode
Have to set the interlaced field of the surface before
end_frame is called in the pipe codec object so the info
is available to the frontend/va, instead of setting it
directly in end_frame like before.

Fixes: 578e10e157 ("frontends/va: Alloc interlaced surface for interlaced pics")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24909>
2023-08-28 13:15:55 -04:00
Sil Vilerino
c3cf7f3e35 d3d12: Fix Map/Unmap of YUV resources
Restore transfer box original size after temporal per plane
dimension calculation.

Currently the returned transfer object on Map will have the
size (usually downsampled) of the latest plane instead of
the overall resource size. Then on unmap, when flushing the
changes the received transfer box has the wrong dimensions
and only partial data is flushed.

Fixes: 12a4f2c132 ("frontends/va: Also map VAImageBufferType for reading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24909>
2023-08-28 13:15:55 -04:00
Vinson Lee
71466eb863 vk/wsi/x11: Remove dead code
Fix defect reported by Coverity Scan.

Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return VK_ERROR_SURFACE_LOS....

Fixes: fb9f697fbb ("vk/wsi/x11: move surface alpha check from get_caps to creation")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24802>
2023-08-26 20:12:18 +00:00
Vinson Lee
f816578e4e nv50: Remove unused value
Fix defect reported by Coverity Scan.

Unused value (UNUSED_VALUE)
assigned_pointer: Assigning value from &nv50->vtxbuf[b] to vb here, but
that stored value is overwritten before it can be used.

Fixes: 7672545223 ("gallium: move vertex stride to CSO")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24801>
2023-08-26 12:17:21 -07:00
Paul Gofman
3e66eba59e driconf: add a workaround for Rainbow Six Extraction
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24784>
2023-08-26 17:59:34 +00:00
M Henning
577b231458 nv/codegen: Delete copy and assign
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24904>
2023-08-26 11:04:02 -04:00
M Henning
932d7fe4cd nv/codegen: Change copy-constructor call to assign
This almost certainly intends to call the user-definied assignment
operator here instead of the automatically generated copy constructor.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24904>
2023-08-26 11:03:48 -04:00
Ian Romanick
5ce6e09ffc nir/algebraic: Remove redundant pack / unpack lowering patterns
No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24900>
2023-08-25 14:54:11 -07:00
Ian Romanick
69d086c6c4 nir/builder: Add nir_extract_i8_imm and nir_extract_u8_imm helpers
v2: Fix problems with 16-bit src0.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24899>
2023-08-25 20:15:37 +00:00
Caio Oliveira
58c7ad6ace hasvk/tests: Propagate failures to gtest
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24355>
2023-08-25 12:08:29 -07:00
Caio Oliveira
27a66f70a5 hasvk/tests: Link a single hasvk_tests binary using gtest
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24355>
2023-08-25 12:08:29 -07:00
Caio Oliveira
66d3b4a8b2 hasvk/tests: Refactor state_pool_test_helper to not use macros for parametrization
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24355>
2023-08-25 12:08:29 -07:00
Caio Oliveira
54b0745b5e anv/tests: Propagate failures to gtest
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24355>
2023-08-25 12:08:26 -07:00
Caio Oliveira
c374033f5b anv/tests: Link a single anv_tests binary using gtest
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24355>
2023-08-25 12:08:26 -07:00
Caio Oliveira
695e356d4a anv/tests: Refactor state_pool_test_helper to not use macros for parametrization
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24355>
2023-08-25 12:08:26 -07:00
David Heidelberg
2d2a189fef ci/panfrost: we have enough device, parallelize Vulkan tests
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24873>
2023-08-25 18:14:49 +00:00
David Heidelberg
cccbd8ae69 ci/panfrost: add G52 flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24873>
2023-08-25 18:14:48 +00:00
Roland Scheidegger
35b2af0f0b lavapipe: further limit accurate_a0 hack
With lavapipe the previous change to only enable the hack when there's
no textures bound doesn't work anymore, since we don't have that
information when using the texture handles.
So add another random state restriction which is sufficient to pass
tests. (This really needs a better long term solution.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24887>
2023-08-25 17:51:12 +00:00
Mike Blumenkrantz
bba4880ffc zink: add a618 flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24892>
2023-08-25 12:46:36 -04:00
Pavel Ondračka
c9e060bfbe r300: there is no limitation on presubtract source file
RV530 shader-db:
total instructions in shared programs: 128840 -> 128803 (-0.03%)
instructions in affected programs: 1085 -> 1048 (-3.41%)
helped: 37
HURT: 1
total presub in shared programs: 7670 -> 7751 (1.06%)
presub in affected programs: 328 -> 409 (24.70%)
helped: 0
HURT: 81
total temps in shared programs: 16926 -> 16939 (0.08%)
temps in affected programs: 182 -> 195 (7.14%)
helped: 6
HURT: 19
total cycles in shared programs: 193751 -> 193729 (-0.01%)
cycles in affected programs: 3088 -> 3066 (-0.71%)
helped: 33
HURT: 5

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>
2023-08-25 14:48:15 +00:00
Pavel Ondračka
87ea850d76 r300: move power of two multipliers down
RV530 shader-db:
total instructions in shared programs: 128864 -> 128840 (-0.02%)
instructions in affected programs: 1260 -> 1236 (-1.90%)
helped: 21
HURT: 2
total presub in shared programs: 7682 -> 7670 (-0.16%)
presub in affected programs: 77 -> 65 (-15.58%)
helped: 12
HURT: 0
total omod in shared programs: 386 -> 403 (4.40%)
omod in affected programs: 3 -> 20 (566.67%)
helped: 0
HURT: 14
total temps in shared programs: 16948 -> 16926 (-0.13%)
temps in affected programs: 280 -> 258 (-7.86%)
helped: 20
HURT: 2
total cycles in shared programs: 194101 -> 193751 (-0.18%)
cycles in affected programs: 3422 -> 3072 (-10.23%)
helped: 25
HURT: 5

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6855
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>
2023-08-25 14:48:15 +00:00
Pavel Ondračka
7ae3d3eb8d r300: convert x * 2 into x + x for presubtract
total instructions in shared programs: 128859 -> 128864 (<.01%)
instructions in affected programs: 931 -> 936 (0.54%)
helped: 0
HURT: 5
total presub in shared programs: 7635 -> 7682 (0.62%)
presub in affected programs: 208 -> 255 (22.60%)
helped: 0
HURT: 17
total cycles in shared programs: 194124 -> 194101 (-0.01%)
cycles in affected programs: 1671 -> 1648 (-1.38%)
helped: 9
HURT: 1

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>
2023-08-25 14:48:15 +00:00
Pavel Ondračka
0508db9155 r300: implement bias presubtract
RV530 shader-db:
total instructions in shared programs: 129468 -> 128859 (-0.47%)
instructions in affected programs: 34432 -> 33823 (-1.77%)
helped: 362
HURT: 56
total presub in shared programs: 5411 -> 7635 (41.10%)
presub in affected programs: 2069 -> 4293 (107.49%)
helped: 8
HURT: 468
total temps in shared programs: 16918 -> 16944 (0.15%)
temps in affected programs: 2022 -> 2048 (1.29%)
helped: 73
HURT: 79
total lits in shared programs: 3555 -> 2913 (-18.06%)
lits in affected programs: 2346 -> 1704 (-27.37%)
helped: 479
HURT: 0
total cycles in shared programs: 194675 -> 194124 (-0.28%)
cycles in affected programs: 62939 -> 62388 (-0.88%)
helped: 343
HURT: 84

Also dEQP-GLES2.functional.shaders.random.trigonometric.fragment.15
now fits into the instruction limit on RV370.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>
2023-08-25 14:48:14 +00:00
Pavel Ondračka
3b74360338 r300: exit early in presubtract is not supported
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>
2023-08-25 14:48:14 +00:00
Pavel Ondračka
24d35a56d9 r300: reorder for easier presubtract 1-x pattern recognition
It is much easier to just add a simple late algebraic pass than actually
trying to teach the backend to recognize all the different patterns.

RV530 shader-db:
total instructions in shared programs: 129643 -> 129468 (-0.13%)
instructions in affected programs: 17665 -> 17490 (-0.99%)
helped: 176
HURT: 39
total presub in shared programs: 4912 -> 5411 (10.16%)
presub in affected programs: 1651 -> 2150 (30.22%)
helped: 0
HURT: 287
total temps in shared programs: 16904 -> 16918 (0.08%)
temps in affected programs: 812 -> 826 (1.72%)
helped: 25
HURT: 37
total cycles in shared programs: 194771 -> 194675 (-0.05%)
cycles in affected programs: 28096 -> 28000 (-0.34%)
helped: 146
HURT: 41

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9364
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24830>
2023-08-25 14:48:14 +00:00
Mike Blumenkrantz
939845e424 zink: pass KERNEL shaders through successfully
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24868>
2023-08-25 12:03:29 +00:00
Mike Blumenkrantz
226aefccd3 rusticl: fixes for zink shader images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24868>
2023-08-25 12:03:29 +00:00
Karol Herbst
07272f6c35 rusticl/device: _MAX_CONST_BUFFER0_SIZE is unsigned
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24868>
2023-08-25 12:03:29 +00:00
Karol Herbst
54b37078eb rusticl: add debug option to sync every event
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24868>
2023-08-25 12:03:28 +00:00
Samuel Pitoiset
43fe842b92 radv,aco: remove unused clip/cull distances variables
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24883>
2023-08-25 11:13:26 +00:00
Samuel Pitoiset
8ebb29245c aco: add support for compiling {VS,TES}+GS separately on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24862>
2023-08-25 10:22:41 +00:00
Samuel Pitoiset
37aa6d25e1 aco: ensure to initialize exec manually for non-monolithic {VS,TES}/GS on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24862>
2023-08-25 10:22:41 +00:00
Samuel Pitoiset
92015fe3dc radv: preserve shader arguments for non-monolithic {VS,TES}/GS on GFX9+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24862>
2023-08-25 10:22:41 +00:00
Samuel Pitoiset
c906723009 radv: always declare some arguments for non-monolithic {VS,TES}/GS shaders
When compiling VS/TES and GS separately, we can't know if the GS will
need shader queries, so we have to always declare this argument.
Similar story for the view index.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24862>
2023-08-25 10:22:41 +00:00
Kenneth Graunke
d693027a00 iris: Check prog[] instead of uncompiled[] for BLORP state skipping
Huge thanks to Tapani Pälli for debugging this issue, figuring out
what was going wrong, proposing fixes, and walking me through where
things were going off the rails.

BLORP always disables tessellation and geometry shaders.  Our handling
tried to look at ice->shaders.uncompiled[] to determine whether the next
draw needed those shaders.  If not, we can leave BLORP's residual state
that disabled those stages in place, and skip looking at it.

Unfortunately, predicting the future is a bit fraught, in part due to
the uncompiled[] and prog[] arrays being slightly out of sync at times.

Consider the following case:

1. Draw with tessellation shaders in place

   => uncompiled[TES] and prog[TES] will both point at valid shaders.

2. Gallium calls pipe->bind_tes_state(NULL).

   => This makes uncompiled[TES] point at NULL, and flags
      IRIS_STAGE_DIRTY_UNCOMPILED_TES.

      Because iris_update_compiled_shaders() hasn't happened yet,
      uncompiled[TES] is NULL but prog[TES] has the stale TES from
      the previous draw still.

3. BLORP operations happen

   => BLORP sees uncompiled[TES] == NULL and decides that tessellation
      is off for the upcoming draws.  So it skips flagging tess state.

4. Gallium calls pipe->bind_tes_state(shader from step #1).

   => uncompiled[TES] points at the original shader.
      IRIS_STAGE_DIRTY_UNCOMPILED_TES gets flagged again.

5. Draw again

   => This calls iris_update_compiled_shaders(), which sees that
      a TES is bound, and calls iris_update_compiled_tes().  But
      because the same shader was bound as before, the program it
      comes up with is identical to the one already bound at
      ice->shaders.prog[TES].  So, it thinks it doesn't have to
      flag any tessellation state dirty because it was already
      set up for the last draw.

This random unbind and rebind between draws leads to a situation
where, at step #3, BLORP thinks it can skip flagging tessellation
state (nothing is bound), and at step #5, normal state handling
thinks it can skip flagging tessellation state (nothing changed
since last time).  So nobody does, and things break.

This unbind appears to be happening when st_release_variants()
decides it wants to free some shaders.  Then a rebind happens to
put back the actual shader for the draw.  So, it's not theoretical.

To fix this, we change BLORP to look at ice->shaders.prog[] rather
than uncompiled[].  This is equivalent to thinking about the previous
draw, rather than the next.  If the last draw had tessellation off,
then BLORP's disabling was a no-op, and the GPU is still in the same
state as the previous draw.  This is more reliable than predicting
the future.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8308
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9678
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24880>
2023-08-25 09:22:57 +00:00
Yiwei Zhang
0c529a61fc venus: set deviceMemoryReport feature
VK_EXT_device_memory_report is implemented in venus driver side, which
has a feature struct. So we must enable it after setting features for
renderer extensions. This change also includes tiny format fixes.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24881>
2023-08-25 08:59:51 +00:00
Konstantin Seurer
1e46a810d6 venus: Use the common GetPhysicalDeviceFeatures2 implementation
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24881>
2023-08-25 08:59:50 +00:00
Konstantin Seurer
8c98814874 vulkan/wsi/x11: Implement capture hotkey using the keymap
This way, we can avoid opening another connection. The capture key is
changes to F1 because F12 has issues on Wayland. (After pressing F12,
all keys become unresponsive, refocussing the window fixes it)

Fixes: 291fa05  ("vulkan/wsi/x11: Capture traces using a hotkey")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9578
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24710>
2023-08-25 08:05:58 +00:00
Samuel Pitoiset
80177e0296 aco: add support for compiling VS+TCS separately on GFX9+
The VS will just jump to the TCS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:04 +00:00
Samuel Pitoiset
196b355db6 aco: ensure to initialize exec manually for VS as LS on GFX9+
When VS and TCS are compiled separately with shader object on GFX9+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:04 +00:00
Samuel Pitoiset
aba16211a8 aco: disable shared VGPRs for non-monolithic shaders on GFX9+
For unmerged shaders on GFX9+, we would need to jump to the second
shader part which means shared VGPRs can't be enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:04 +00:00
Samuel Pitoiset
4224da6726 radv: preserve shader arguments for non-monolithic VS/TCS on GFX9+
This is more robust than re-creating the function signature in ACO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:04 +00:00
Samuel Pitoiset
c161337029 ac: allow to mark shader arguments as preserved
These arguments would be used by ACO to generate a function signature
for merged shaders automatically.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Samuel Pitoiset
8ba1860fbd radv: add a new shader argument for non-monolithic shaders PC
This will be used to jump from VS to TCS/GS or TES to GS on GFX9+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Samuel Pitoiset
7b4f10b434 radv: always declare some arguments for non-monolithic VS/TCS shaders
For separate VS/TCS compilation on GFX9+, the TCS might be using push
constants but not the VS and we can't know this information when
compiling the VS. Similar logic for the other arguments.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Samuel Pitoiset
a4933d2d7f radv: force indirect descriptor sets for non-monolithic shaders
When VS and TCS are compiled separately on GFX9+, we can't know how
many descriptor sets are used for both stages and the function
arguments must match.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Samuel Pitoiset
e5d30462c9 radv: do not inline push constants for non-monolithic shaders
It's hard to implement this because the function arguments must match
when eg. VS or TCS are compiled separately on GFX9+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Samuel Pitoiset
34ddde6d63 radv: use info->uses_view_index directly when declaring shader arguments
No need for a separate variable.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Samuel Pitoiset
467bf47281 radv: add radv_shader_info::is_monolithic
This will be used to implement shader object on GFX9+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>
2023-08-25 07:22:03 +00:00
Benjamin Cheng
f64f08a9e0 anv/video: send h264 scaling list in raster order
ITU spec defines the H264 ScalingList{4x4,8x8} in zig-zag order, but
Intel HW wants raster order.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24572>
2023-08-25 03:08:13 +00:00
Benjamin Cheng
dd20ec5655 radv/video: send h264 scaling list in raster order
ITU spec defines the H264 ScalingList{4x4,8x8} in zig-zag order, but
AMD HW wants raster order.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24572>
2023-08-25 03:08:13 +00:00
Benjamin Cheng
1d2f7f068c util/vl: extract gallium vl scanning data to shared code
Vulkan video on both ANV and RADV need these data to make converting
from zig-zag to raster order easier.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24572>
2023-08-25 03:08:13 +00:00
Benjamin Cheng
e921b889e3 anv/video: use vk_video_derive_h264_scaling_list
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24572>
2023-08-25 03:08:13 +00:00
Benjamin Cheng
d578e4416a radv/video: use vk_video_derive_h264_scaling_list
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24572>
2023-08-25 03:08:13 +00:00
Benjamin Cheng
8daa329634 vulkan/video: add helper to derive H264 scaling lists
The H264 spec defines a complicated way of layering PPS scaling lists
on top of SPS scaling lists. The details can be found in 7.4.2.1
(seq_scaling_matrix_present_flag semantics) and 7.4.2.2
(pic_scaling_matrix_present_flag semantics).

Both ANV and RADV need to derive the final scaling lists sent to HW
using this logic in order to handle H264 scaling lists correctly.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24572>
2023-08-25 03:08:13 +00:00
Yiwei Zhang
0d4df682b9 venus: add no_sparse debug option to disable sparse resource support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24877>
2023-08-25 01:12:29 +00:00
twisted89
d3e796da6b util/driconf: add workarounds for the Chronicles of Riddick
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24567>
2023-08-24 22:38:56 +00:00
Mike Blumenkrantz
640173cdbb zink: fix rewrite_read_as_0 filtering
Fixes: 9e42553ca8 ("zink: use lowered io (kinda) for i/o vars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24874>
2023-08-24 21:27:50 +00:00
Faith Ekstrand
f9cf872745 nouveau/mme: Fix a compile warning
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24840>
2023-08-24 19:26:44 +00:00
Faith Ekstrand
819d359d1d nvk: Plumb no_prefetch through to the DRM back-end
Instead of using bit 23 of nvk_cmd_push::range for this, pass it as a
separate bool.  This lets us use the actual kernel flag with the new
UAPI.

Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Tested-by: Danilo Krummrich <dakr@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24840>
2023-08-24 19:26:44 +00:00
Faith Ekstrand
458baeee5f drm-uapi: Sync nouveau_drm.h
From https://cgit.freedesktop.org/drm-misc/

    commit 443f9e0b1ab5e3b95abf8606097d13e30e2f2413
    Author: Danilo Krummrich <dakr@redhat.com>
    Date:   Wed Aug 23 20:15:34 2023 +0200

        drm/nouveau: uapi: don't pass NO_PREFETCH flag implicitl

Reviewed-by: Danilo Krummrich <dakr@redhat.com>
Tested-by: Danilo Krummrich <dakr@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24840>
2023-08-24 19:26:44 +00:00
Ian Romanick
8852e9cb2e util/rb-tree: Fix typo in comment
Trivial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24856>
2023-08-24 17:50:28 +00:00
Ian Romanick
2ff38260b9 util/rb-tree: Return the actual first node from rb_tree_search
Previously rb_tree_search would return the first node encountered, but
that may not be the first node that would be encoutnered by, say,
rb_tree_foreach.

Two test cases are added.

v2: Add more curly braces. Suggested by Faith.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24856>
2023-08-24 17:50:28 +00:00
David Heidelberg
e51056f9f7 ci/iris: add GL46.arrays_of_arrays_gl.SizedDeclarationsPrimitive timeout
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24870>
2023-08-24 17:06:42 +00:00
Dmitry Baryshkov
2fdcc00b01 tu: Pass real size of prime buffers to allocator
The msm driver reserves the actual DMABUF size in the memory map, while
TU can request smaller memory chunk to be allocated. This potentially
can lead to a situation when next allocation IOVA will be in the middle
of the address space which is reserved for the DMABUF. Pass the
`real_size' to TU allocator instead, so that kernel and userspace have
the same picture of memory allocations.

Cc: mesa-stable
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24861>
2023-08-24 16:35:43 +00:00
Alyssa Rosenzweig
cda1961835 treewide: Also handle struct nir_builder form
Via Coccinelle patch:

    @def@
    typedef bool;
    typedef nir_builder;
    typedef nir_instr;
    typedef nir_def;
    identifier fn, instr, intr, x, builder, data;
    @@

    static fn(struct nir_builder* builder,
    -nir_instr *instr,
    +nir_intrinsic_instr *intr,
    ...)
    {
    (
    -   if (instr->type != nir_instr_type_intrinsic)
    -      return false;
    -   nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
    |
    -   nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
    -   if (instr->type != nir_instr_type_intrinsic)
    -      return false;
    )

    <...
    (
    -instr->x
    +intr->instr.x
    |
    -instr
    +&intr->instr
    )
    ...>

    }

    @pass depends on def@
    identifier def.fn;
    expression shader, progress;
    @@

    (
    -nir_shader_instructions_pass(shader, fn,
    +nir_shader_intrinsics_pass(shader, fn,
    ...)
    |
    -NIR_PASS_V(shader, nir_shader_instructions_pass, fn,
    +NIR_PASS_V(shader, nir_shader_intrinsics_pass, fn,
    ...)
    |
    -NIR_PASS(progress, shader, nir_shader_instructions_pass, fn,
    +NIR_PASS(progress, shader, nir_shader_intrinsics_pass, fn,
    ...)
    )

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24852>
2023-08-24 15:48:02 +00:00
Alyssa Rosenzweig
465b138f01 treewide: Use nir_shader_intrinsic_pass sometimes
This converts a lot of trivial passes. Nice boilerplate deletion. Via Coccinelle
patch (with a small manual fix-up for panfrost where coccinelle got confused by
genxml + ninja clang-format squashed in, and for Zink because my semantic patch
was slightly buggy).

    @def@
    typedef bool;
    typedef nir_builder;
    typedef nir_instr;
    typedef nir_def;
    identifier fn, instr, intr, x, builder, data;
    @@

    static fn(nir_builder* builder,
    -nir_instr *instr,
    +nir_intrinsic_instr *intr,
    ...)
    {
    (
    -   if (instr->type != nir_instr_type_intrinsic)
    -      return false;
    -   nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
    |
    -   nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
    -   if (instr->type != nir_instr_type_intrinsic)
    -      return false;
    )

    <...
    (
    -instr->x
    +intr->instr.x
    |
    -instr
    +&intr->instr
    )
    ...>

    }

    @pass depends on def@
    identifier def.fn;
    expression shader, progress;
    @@

    (
    -nir_shader_instructions_pass(shader, fn,
    +nir_shader_intrinsics_pass(shader, fn,
    ...)
    |
    -NIR_PASS_V(shader, nir_shader_instructions_pass, fn,
    +NIR_PASS_V(shader, nir_shader_intrinsics_pass, fn,
    ...)
    |
    -NIR_PASS(progress, shader, nir_shader_instructions_pass, fn,
    +NIR_PASS(progress, shader, nir_shader_intrinsics_pass, fn,
    ...)
    )

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24852>
2023-08-24 15:48:02 +00:00
David Heidelberg
5fa9f842b0 ci: switch to 6.4 kernel, improving Adreno 660 reliability
Second argument is to leave Linux 6.3 which is EOL.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24815>
2023-08-24 13:12:28 +00:00
David Heidelberg
39a0791627 ci/freedreno: There is only one King of Town.
Drop -r1, which got removed in the Linux 6.4.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24815>
2023-08-24 13:12:28 +00:00
David Heidelberg
fd21c998e6 ci/piglit: add extra space on top to prevent single quote getting into URL
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24815>
2023-08-24 13:12:28 +00:00
Karol Herbst
9c3746fe9c zink: update some compute caps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24859>
2023-08-24 12:44:23 +00:00
Karol Herbst
ac289b7268 zink: fix global stores
We have to cast the value if the type doesn't match.

Fixes: ddc5c30489 ("zink: handle global and scratch vars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24859>
2023-08-24 12:44:23 +00:00
Karol Herbst
ac1685bc6a zink: fix source type in load/store scratch
Fixes: ddc5c30489 ("zink: handle global and scratch vars")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24859>
2023-08-24 12:44:23 +00:00
Mike Blumenkrantz
db41d62be9 zink: use Aligned with global load/store ops
this is required by spec

Fixes: ddc5c30489 ("zink: handle global and scratch vars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24859>
2023-08-24 12:44:22 +00:00
Mike Blumenkrantz
2ff560514b zink: handle global atomic intrinsics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24859>
2023-08-24 12:44:22 +00:00
Mauro Rossi
ef6725a5f4 hasvk/android: remove numFds check
Change required for compatibility with minigbm gralloc4
due to gralloc handle having DRV_MAX_FDS = (DRV_MAX_PLANES + 1)

https://android.googlesource.com/platform/external/minigbm/+/refs/tags/android-13.0.0_r18/cros_gralloc/cros_gralloc_handle.h#14

Cc: "22.3" mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7807
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20231>
2023-08-24 11:07:12 +00:00
Mauro Rossi
143d417fcc anv/android: remove numFds check
Change required for compatibility with minigbm gralloc4
due to gralloc handle having DRV_MAX_FDS = (DRV_MAX_PLANES + 1)

https://android.googlesource.com/platform/external/minigbm/+/refs/tags/android-13.0.0_r18/cros_gralloc/cros_gralloc_handle.h#14

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20231>
2023-08-24 11:07:12 +00:00
Chris Spencer
6a4e9b55e4 anv: Don't reject Android image format if external props not supplied
anv_GetPhysicalDeviceImageFormatProperties2 returns 'not supported' if an
Android hardware buffer external memory handle type is specified, but no
external image format properties output struct is supplied. This struct is
optional, so we should populate it if present, but return successfully
either way.

This fixes an error when using ANV with hwui, which otherwise prevents the
system from booting.[1]

[1] https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/renderthread/VulkanSurface.cpp;l=271;drc=ad3fb95aa2fe0be59d3e991ddc883592ab5542bc

Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24844>
2023-08-24 10:26:09 +00:00
Simon Ser
5ceba97c2e vulkan/wsi/wayland: add support for IMMEDIATE
Use the tearing-control-unstable-v1 protocol to indicate to the
Wayland compositor that tearing is acceptable.

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/18268>
2023-08-24 09:38:54 +00:00
Simon Ser
f7da5e3e38 wayland: enable use of wayland-protocols as a subproject
This allows developers to link subprojects/wayland-protocols/ to
a repository checkout. Useful when adding support for new protocols.

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/18268>
2023-08-24 09:38:53 +00:00
Jordan Justen
d65b0b0424 intel/dev: Add more RPL PCI IDs
Ref: https://patchwork.freedesktop.org/patch/553646/?series=122712&rev=1
Cc: mesa-stable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24820>
2023-08-24 00:42:19 -07:00
Jordan Justen
27f6b4b1c6 intel/dev: Use RPL-U name on RPL-U devices
Ref: https://patchwork.freedesktop.org/patch/553646/?series=122712&rev=1
Cc: mesa-stable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24820>
2023-08-24 00:42:19 -07:00
Samuel Pitoiset
112b393766 radv: stop declaring unused SGPR arguments for PS epilogs
ACO no longer requires these arguments.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24838>
2023-08-24 07:21:58 +00:00
Samuel Pitoiset
0004d903d4 radv: fix the per-patch data offset when TES isn't linked with TCS
When TCS and TES aren't linked together and TCS exports unused outputs,
the per-patch data offset needs to be adjusted. This is similar to the
LS-HS vertex stride when VS and TCS aren't linked together.

This fixes a bunch of failures by forcing the driver to use TCS epilogs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24776>
2023-08-24 06:03:12 +00:00
Tapani Pälli
d65fe6eff1 mesa: fix some TexParameter and SamplerParameter cases
EXT extension was added without tests so these functions did
not work properly.

Fixes: 799710be88 ("mesa: Add EXT_texture_mirror_clamp_to_edge to extension table")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24845>
2023-08-24 04:26:52 +00:00
Yonggang Luo
26c5200acf compiler/glsl: Move glsl_print_type from glsl_types.* to ir_print_visitor.cpp
glsl_print_type only referenced in ir_print_visitor.cpp
there is no need expose it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>
2023-08-24 02:54:09 +00:00
Yonggang Luo
01ddb18427 compiler: use 4 instead ATOMIC_COUNTER_SIZE in glsl_types.h to avoid #include "mesa/main/config.h"
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>
2023-08-24 02:54:09 +00:00
Yonggang Luo
26a23a7c1f d3d12: replace use of MAX_VERTEX_STREAMS with PIPE_MAX_VERTEX_STREAMS
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>
2023-08-24 02:54:09 +00:00
Yonggang Luo
0b84e38684 intel/brw: use 4 instead of MAX_VERTEX_STREAMS to avoid #include "mesa/main/config.h"
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>
2023-08-24 02:54:08 +00:00
Yonggang Luo
d6f8bdcb5f sfn: Use 4 instead of ATOMIC_COUNTER_SIZE
../../src/gallium/drivers/r600/sfn/sfn_nir.cpp:458:59: error: ‘ATOMIC_COUNTER_SIZE’ was not declared in this scope

../../src/gallium/drivers/r600/sfn/sfn_shader.cpp:609:53: error: ‘ATOMIC_COUNTER_SIZE’ was not declared in this scope

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>
2023-08-24 02:54:08 +00:00
Rob Clark
75789e9429 tu: Workaround bionic _SC_LEVEL1_DCACHE_LINESIZE
Bionic just returns a hard-coded 0, which isn't helpful.  But
fortunately on aarch64 it is easy enough just to read the value
ourselves.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24829>
2023-08-23 22:41:55 +00:00
Kenneth Graunke
08fc4603dd intel/fs: Dump IR for pre-RA scheduler modes in DEBUG_OPTIMIZER
This lets us more easily compare and contrast the various scheduling
options that the compiler considered.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
2023-08-23 21:34:38 +00:00
Kenneth Graunke
07f2ad32e4 intel/fs: Pick the lowest register pressure schedule when spilling
We try various pre-RA scheduler modes and see if any of them allow
us to register allocate without spilling.  If all of them spill,
however, we left it on the last mode: LIFO.  This is unfortunately
sometimes significantly worse than other modes (such as "none").

This patch makes us instead select the pre-RA scheduling mode that
gives the lowest register pressure estimate, if none of them manage
to avoid spilling.  The hope is that this scheduling will spill the
least out of all of them.

fossil-db stats (on Alchemist) speak for themselves:

    Totals:
    Instrs: 197297092 -> 195326552 (-1.00%); split: -1.02%, +0.03%
    Cycles: 14291286956 -> 14303502596 (+0.09%); split: -0.55%, +0.64%
    Spill count: 190886 -> 129204 (-32.31%); split: -33.01%, +0.70%
    Fill count: 361408 -> 225038 (-37.73%); split: -39.17%, +1.43%
    Scratch Memory Size: 12935168 -> 10868736 (-15.98%); split: -16.08%, +0.10%

    Totals from 1791 (0.27% of 668386) affected shaders:
    Instrs: 7628929 -> 5658389 (-25.83%); split: -26.50%, +0.67%
    Cycles: 719326691 -> 731542331 (+1.70%); split: -10.95%, +12.65%
    Spill count: 110627 -> 48945 (-55.76%); split: -56.96%, +1.20%
    Fill count: 221560 -> 85190 (-61.55%); split: -63.89%, +2.34%
    Scratch Memory Size: 4471808 -> 2405376 (-46.21%); split: -46.51%, +0.30%

Improves performance when using XeSS in Cyberpunk 2077 by 90% on A770.
Improves performance of Borderlands 3 by 1.54% on A770.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
2023-08-23 21:34:38 +00:00
Kenneth Graunke
158ac265df intel/fs: Make helpers for saving/restoring instruction order
This moves a bit of code out of a large function, but also lets us reuse
it a few extra places in the next commit.

I opted to stop using ralloc here since this is short-lived data that
doesn't need to stick around for the rest of the compile, and it's easy
enough to free.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
2023-08-23 21:34:38 +00:00
Kenneth Graunke
2dd56921c9 intel/fs: Index scheduler mode string table by mode enum
pre_modes[] is an array with the modes ordered in our desired
preference.  scheduler_mode_name[] was also in that order, and the two
had to be kept in sync.  This is a little silly; we should just have
a mode enum -> string table and look it up via the enum.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
2023-08-23 21:34:38 +00:00
Kenneth Graunke
7eba19245d intel/compiler: Move SCHEDULE_NONE handling into schedule_instructions()
I'm going to introduce another call site for this function, and just
handling SCHEDULE_NONE in the scheduler itself makes more sense than
duplicating the logic.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
2023-08-23 21:34:38 +00:00
Kenneth Graunke
743fd60bea intel/fs: Account for payload GRFs when calculating register pressure
The register pressure analysis I wrote in 2013 only considered VGRFs,
and not other GRFs, such as payload registers and push constants.  We
need to consider those too, because payload registers definitely occupy
space and add to pressure.

In 2015, Connor already made the scheduler account for this, so the only
real use for this is in shader statistic dumps and optimizer printouts.
But we should make it more accurate.  (We will use it in more places
shortly, a few commits from now.)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
2023-08-23 21:34:38 +00:00
Rob Clark
4275781896 docs: Followup to !24636
Update docs to reflect that EGL_ANDROID_blob_cache is now available even
if on-disk caching is disabled.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24853>
2023-08-23 21:26:08 +00:00
David Rosca
ee1132bd79 Revert "radeonsi/vcn: add an exception of field case for h264 decoding"
This change causes page faults when playing corrupted video from the
bugreport. The original issue have now been resolved in firmware.

This reverts commit bfce57c7a5.

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

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24836>
2023-08-23 20:27:34 +00:00
Georg Lehmann
87d13ee73d aco: combine a | ~b to bfi(b, a, -1)
Somehow I missed this when writing the a & ~b patch.

Foz-DB Navi21:
Totals from 1591 (1.20% of 132657) affected shaders:
Instrs: 2316379 -> 2315940 (-0.02%)
CodeSize: 12524240 -> 12528724 (+0.04%); split: -0.00%, +0.04%
Latency: 45393195 -> 45389285 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 8658991 -> 8657944 (-0.01%); split: -0.01%, +0.00%
Copies: 135777 -> 135778 (+0.00%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24505>
2023-08-23 20:06:49 +00:00
Piotr Kocia
27eafbcd4e nir: Remove dead nir_const_value variables
nir_const_value variables in nir_const_value_for_int and
nor_const_value_for_uint are unused resulting in unnecessary dead code.
The unused-variable warning has been suppressed by the memset following
their declarations.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24851>
2023-08-23 19:29:19 +00:00
David Heidelberg
74bf80323e panfrost/ci: revert Disable T720
Tested, it was just some unlucky coincidence it didn't worked, the
device queue is almost empty.

This reverts commit b0f02973d7.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24850>
2023-08-23 19:05:30 +00:00
Mike Blumenkrantz
56587b24e5 zink: copy some cs shader properties to the program struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24835>
2023-08-23 18:13:55 +00:00
Konstantin Seurer
1f3ffb7fd9 lavapipe: Lock around CSO destroys
They can race in llvmpipe_register_shader.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9680
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24827>
2023-08-23 17:49:38 +00:00
Charmaine Lee
04cb346973 svga: fix stride used in vertex declaration
The stride for each vertex buffer should come from the corresponding
vertex element structure.

Fixes piglit/glretrace regressions running on svga vgpu9 device.

Fixes: 7672545223 ("gallium: move vertex stride to CSO")

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24841>
2023-08-23 09:37:38 -07:00
Alyssa Rosenzweig
4b84e76951 asahi: Fix shader stage dirtying
Now this is actually doing what I expect. drawoverhead #1 score more than
doubles (6091->13375).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
bb663b8595 asahi: Dirty the shader stage when the shader changes
We need to re-emit all descriptors in this case for correctness. Avoids
regressions from the following commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
581514d925 asahi: Dirty track VBOs + blend const separately
We're staging everything anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
24238cc507 asahi: Use proper dirty tracking for VBOs
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
0a5ca3f34f asahi: Use finer dirty tracking for blend constant
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
d6ca887f90 asahi: Decouple sysval lowering from uniform assignment
For merging shader states, we'll need to lower sysvals separately for each
shader but assign uniforms together for the final merged shader. The easiest way
to do that is to decouple the lowering of sysvals to driver uniform reads, from
the assignment of driver uniform reads to actual uniform registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
17563210d4 asahi: Put unuploaded uniforms on the batch
Less copying needed this way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
871d97f7d0 asahi: Extract sampler upload
Dirty track it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
9fa5dec767 asahi: Add real per-stage dirty flags
Instead of just using ~0 as a stub todo.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
9a60478966 asahi: Upload a single draw_uniforms per draw
Not per stage per draw. This is less frequent.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
4717b08f78 asahi: Extract agx_upload_textures
By uploading textures ahead-of-time, we can upload uniforms ahead-of-time too.
This will also allow some overhead shaving optimizations, I guess.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
0e6cb6d893 asahi: Collapse grid_info
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
b049b1c98f asahi: Split out per-stage sysvals
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
31afce2fa5 asahi: Add sysval tables for each shader stage
So we can model the descriptors of each shader stage independently, as required
for merged shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
5189bae50c asahi: Move UBO lowering into GL driver
In Vulkan, UBOs are lowered by nir_lower_explicit_io, and the ubo_base_agx
sysval is unused (since it doesn't handle descriptor sets). That makes the UBO
lowering GL-only and hence belongs with the GL driver rather than the compiler.
This lets us delete the ubo_base_agx sysval.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
1d77fb967d nir,asahi: Remove texture_base_agx
Doing a descriptor crawl with binding tables requires a real binding table in
the shader, which won't work for VK or merged shader stages in GL. Instead,
let's lower anything that needs a crawl to bindless in the driver, so the
compiler code doesn't need to know anything about descriptor binding models.
That gets rid of the texture_base_agx sysval, which is problematic when there
are multiple descriptor sets worth of textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
cd25f753d5 agx: Add helper returning if a descriptor crawl is needed
For agx_nir_lower_texture to lower to a descriptor crawl, the driver needs to
make sure the address of the descriptor is available. This means a slightly
different code path should be used in the driver. Rather than the drivers
needing to know what exactly will be lowered, add a helper in the same file as
agx_nir_lower_texture that returns whether descriptor-based lowering will be
needed so the driver can act appropriately.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
1e11862753 agx: Do some texture lowering early
We want to make the implicit txs in operations explicit before lower_bindings so
lower_bindings knows to force bindless.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
6e1bdc1291 asahi: Add missing LOD source for agx_meta's txfs
These would be inserted by nir_lower_tex anyway, but we shouldn't be relying on
that behaviour for the meta shaders when we can just create the correct thing
from the start.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
176484d7f0 agx: Do not fence write-only images
Reduces fencing significantly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
d49ed63d07 agx/fence_images: Use intrinsics_pass
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
d42bb650b3 asahi: Add get_query_address helper
This is the counterpart of get_oq_index for non-occlusion hardware queries.
These are not tracked with occlusion queries, since occlusion query allocations
are limited, and they are not based on indexing but rather general
batch-allocated space.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
a620e86f35 asahi: Add non-occlusion query tracking
For other GPU queries, handled similarly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
9845814c98 asahi: Sync when beginning a query
Otherwise batch->writer might be non-null. Fixes Piglit occlusion_query_conform
(which I think regressed when we added proper syncing).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
a13f233219 asahi: Only touch batch->occlusion_queries for occlusion
We will soon have other types of queries with non-null writers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
dfde9345d7 asahi: Refactor agx_get_query_result
In preparation for other types of GPU queries.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
e5dd053640 asahi: Simplify occlusion query batch tracking
Yes, this means we now lie to the app. There's nothing more in the spirit of
dumb OpenGL features than lying!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
e72facab9a asahi: Generalize query logic
We will need to do the same flushing dance for non-occlusion GPU queries.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
542a317a12 agx: Use 16-bit reg for pixel_coord
Mistake during IR translation, this is 16-bit in NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
58efa64c5c asahi: Preserve atomic ops when rewriting image to bindless
Bug fix on its own, and prevents regressions from using bindless more.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
8ae3eebba4 agx: Clear image_array after lowering
We lower to access to a non-array 2D image, so we need to update the image_array
flag when we lower or otherwise we get an incorrect 2D Array store to a 2D image
which the hardware doesn't want.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
c8ea02a883 agx: Clear sample count after lowering MSAA
Pedantic.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
a51c3f638b asahi: Pass layer stride in pixels, not elements
We do all the math in pixels and only multiply by the sample count at the end,
meaning the layer stride needs to be in terms of pixels (not samples) for
correct addressing of multisample array images in our texture lowering. This is
particularly used for lowering the multisample array stores we get from eMRT
with multisampled layered framebuffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
486fb75981 asahi: Use local_size from compiler directly
This avoids an unnecessary trip through agx_uncompiled_shader.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
6247e617c1 asahi: Report local_size from compiler
So we can add more shared in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
5b3f4cf6f8 asahi/decode: Turn assert into error
To allow us to debug broken fetches.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
6aa1cf6e7a asahi: Advertise OpenGL ES 3.1!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
c8b44eb4c3 agx: Implement imul_high
Like umul_high. Fixes
dEQP-VK.spirv_assembly.instruction.compute.mul_extended.signed_16bit

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
cf12429c97 agx: Convert 8-bit comparisons
Fixes dEQP-VK.spirv_assembly.type.vec3.i8.slessthan_frag

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
72231b042c agx: Handle b2i8
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:55 +00:00
Alyssa Rosenzweig
7590b2b39d agx: Allow loop headers without later preds
These happen for loops that break after exactly 1 iteration, unconditionally.
Fixes validation splat in dEQP-VK.glsl.switch.conditional_fall_through_2_uniform_vertex

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
4dcfb681bc agx/lower_vbo: Handle nonzero component
Fixes dEQP-VK.glsl.440.linkage.varying.component.vert_in.vec2.as_float_float

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Mary
0ec2183dfc agx: Ensure to lower 1D image load/store to 2D
This was missing from lower_images.
This fix a good chunk of Vulkan deQP failures with 1D images.

Signed-off-by: Mary <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
8701ad4396 agx: Don't blow up when lowering textures twice
Hard to avoid with GS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
7f636a08c8 asahi: Keep drawoverhead from OOMing itself
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
c363fcbe1e agx: Assert vertex_id, instance_id are VS-only
We can get them in other shaders transiently due to merging shader stages, but
they need to be lowered since the hardware versions only exist in the hardware
VS. So the compiler should never see them outside VS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
4c36f9052b asahi: Copy CSO stride
Fixes: 7672545223 ("gallium: move vertex stride to CSO")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
240ee9564b agx: Use more barriers
Fixes flakiness in
KHR-GLES31.core.texture_buffer.texture_buffer_atomic_functions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
f068ed0534 agx: Fix extraneous bits with b2b32
From expanding mov_imm to take a 64-bit immediate. this worked by accident
before. Fixes brief regression in
dEQP-GLES31.functional.compute.shared_var.basic_type.bvec3.

Fixes: dbd98aa24d1 ("agx: Fix 64-bit immediate moves")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Alyssa Rosenzweig
ec2ab7d771 nir: Add load_sysval_agx intrinsic
For merging shader stages, it will be useful to express a load from an explicit
GL "descriptor set", so we can represent things like UBO loads with merged
shaders where UBOs can come from either stage. To do so, we add an intrinsic
representing a load from the driver's uniform tables, indexed like "descriptor
sets" with "bindings".

In principle, a layered GL-on-Vulkan implementation would use literal descriptor
sets for each stage, so I feel comfortable with the analogy here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
2023-08-23 15:06:54 +00:00
Chris Spencer
bda4eb18dd anv: Advertise Vulkan 1.3 on Android 13
Older versions of Android rejected newer versions of Vulkan,[1] but Android
13 devices are 'strongly recommended' to support Vulkan 1.3.[2]

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4781
[2] https://source.android.com/docs/compatibility/13/android-13-cdd#7142_vulkan

Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24816>
2023-08-23 14:31:26 +00:00
Alyssa Rosenzweig
b0f02973d7 panfrost/ci: Disable T720
Timing out and preventing merges. The lab needs to fix the devices and likely
add more coverage before this can be re-enabled.

The rest of the Panfrost/Collabora farm seems ok, it's just the T720 devices.

See https://gitlab.freedesktop.org/mesa/mesa/-/jobs/47910575 which at the time
of pushing has been waiting for t720 job to start for 45 minutes. This will
allow us to merge code today.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2023-08-23 10:26:38 -04:00
Sviatoslav Peleshko
9865e5dff4 anv: Do fast clear color initialization more delicately
Fixes: b4198e79 ("anv/cmd_buffer: Initalize the clear color struct for CNL+")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9464
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24768>
2023-08-23 12:55:08 +00:00
Sviatoslav Peleshko
caa5c23e48 intel/isl: Don't over-allocate CLEAR_COLOR size to use whole cache line
At the time this was added to fix some test failures. But it seems that
the failures were happening due to missing cache flushes, so
this extra space is no longer neccessary.

Fixes: 37b4eacc ("intel/isl: Resize clear color buffer to full cacheline")
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24768>
2023-08-23 12:55:08 +00:00
Georg Lehmann
6d949e18fd aco: fix u2f16 with 32bit input
The vulkan spec says all conversions are correctly rounded, so if the input
is larger than the largest fp16 value, we need to return MAX_FLOAT/inf
instead of cutting off the msbs.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24826>
2023-08-23 12:25:56 +00:00
Rhys Perry
1d29a1e2fc aco: add adjust_bpermute_dst helper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24693>
2023-08-23 12:36:46 +01:00
Rhys Perry
9169fbf83c aco: clarify bpermute pseudo opcode names
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24693>
2023-08-23 12:36:46 +01:00
Rhys Perry
8a024c985f aco: fix p_bpermute_gfx6's exec save/restore with wave32
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24693>
2023-08-23 12:36:46 +01:00
Rhys Perry
85957dd6e5 aco: fix p_bpermute_gfx6 with input at non-zero byte
Same as the other bpermute pseudo instructions.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24693>
2023-08-23 12:36:46 +01:00
Chris Spencer
280281f8f7 anv/android: Add support for AHARDWAREBUFFER_FORMAT_YV12
The default MediaCodec software video decoder returns frames in this
format.

Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24388>
2023-08-23 09:56:03 +00:00
Chris Spencer
35fddccf3f anv/android: Fix importing hardware buffers with planar formats
Currently, we try to fetch the color aspect of the format and convert that
to an ISL format, which is then used to convert the pixel stride to bytes.
This does not work with planar formats because they don't have a color
aspect, and the planes can be of different sizes anyway, so may not have
the same byte stride. Change to calculate the stride individually for each
plane.

Signed-off-by: Chris Spencer <spencercw@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24388>
2023-08-23 09:56:03 +00:00
Samuel Pitoiset
203b4054f3 aco: rework printing shader stages
To avoid printing "unknown" for shader object when eg. VS and TCS
are compiled separately.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24810>
2023-08-23 09:21:33 +00:00
Feng Jiang
09ff733a3e CODEOWNERS: Add @flynnjiang for VirGL video
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Acked-by: Corentin Noël <corentin.noel@collabora.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24570>
2023-08-23 08:35:08 +00:00
Samuel Pitoiset
aef257fd15 radv: advertise NV_device_generated_commands_compute
This extension introduces a token for implementing DGC compute, it's
only intended to be used by vkd3d-proton.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24275>
2023-08-23 06:05:39 +00:00
Samuel Pitoiset
1a90b7a5da radv: allow DGC on the compute queue
DGC cmdbuf on ACE are executed as IB1 without chaining because IB2
isn't supported on ACE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24275>
2023-08-23 06:05:39 +00:00
Samuel Pitoiset
559da06755 radv: implement NV_device_generated_commands_compute
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24275>
2023-08-23 06:05:39 +00:00
Samuel Pitoiset
a57fe712f7 radv: prepare radv_prepare_dgc() for DGC compute
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24275>
2023-08-23 06:05:39 +00:00
Samuel Pitoiset
aa0ca1e1db radv: prepare radv_get_sequence_size() for DGC compute
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24275>
2023-08-23 06:05:39 +00:00
Samuel Pitoiset
bb82a3402a radv: track the pipeline bind point for indirect commands layout
This will be used to implement DGC compute.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24275>
2023-08-23 06:05:39 +00:00
Mike Blumenkrantz
fbf3f64c6d zink: sanitize optimal keys
shader keys represent pipeline states which trigger variants, but not
all shaders are affected by certain states

this adds some sanitizing for the optimal path to ignore shader variants
which won't have any effect for the currently bound shaders, thus reducing
the number of pipelines compiled (both unoptimized and optimized)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24831>
2023-08-23 01:39:42 +00:00
Mike Blumenkrantz
dae144aeac zink: use the "set" optimal key for prog last_variant_hash for consistency
this is the key that has been set during program update for reuse
everywhere else, and everything else in the driver uses it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24831>
2023-08-23 01:39:42 +00:00
Mike Blumenkrantz
d5157356ce zink: don't start multiple cache jobs for the same program
if there's already a cache job in flight then starting a second one
is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24831>
2023-08-23 01:39:42 +00:00
David Rosca
87e2d5d605 frontends/va: Add BT.709 as supported postproc color standard
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24788>
2023-08-23 01:01:16 +00:00
David Rosca
33dc69b9fa gallium/auxiliary/vl: Don't set csc matrix in video_buffer/rgb_to_yuv_layer
It's now handled in va frontend instead.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24788>
2023-08-23 01:01:16 +00:00
David Rosca
92690aee95 frontends/va: Set csc matrix in postproc
Set correct matrix according to format, color standard and range.

Change default value for color range when not explicitly specified.
Use limited range for YUV and full range for RGB.

This also adds support for converting from full range YUV to RGB.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24788>
2023-08-23 01:01:16 +00:00
David Rosca
e99f0f953e gallium/auxiliary/vl: Add BT.709 full csc matrix
Used for converting from full range YUV.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24788>
2023-08-23 01:01:16 +00:00
Sagar Ghuge
839b03cc06 blorp: Drop unnecessary assertions in blorp_can_hiz_clear_depth
We already checks for the alignment and the multislice surface, we don't
need to add assertions around those two.

fixes: 37fcbb375c ("blorp: Disable unaligned partial HIZ fast clears for HIZ_CCS too")
closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9684

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24837>
2023-08-23 00:35:07 +00:00
Rob Clark
39f26642d6 util: Decouple disk cache from EGL_ANDROID_blob_cache
Just because the user / system-integrater doesn't want shader disk
cache, doesn't mean they don't want EGL_ANDROID_blob_cache to work.
We've kind of already solved this for the android case, so just
generalize that solution.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9520
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24636>
2023-08-23 00:04:16 +00:00
Emma Anholt
5bd0750921 intel/fs: Simplify compute_start_end().
Now that we have moved the screening up, we can simplify the code.  No
change in shader-db steam performance, n=10.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24702>
2023-08-22 23:34:30 +00:00
Emma Anholt
2b01246f49 intel/fs: Move the defin[]/defout[] screening up to livein[]/liveout[] setup.
This keeps us from having to run the loop to propagate up quite so much.

steam shader-db time -1.86356% +/- 0.941498% (n=10).  There's a small
scheduling effect, since previously the scheduler wasn't considering
defin/defout:

cycles helped:   shaders/closed/steam/amnesia-the-dark-descent/high/241.shader_test FS SIMD16: 11428 -> 11422 (-0.05%) (scheduled: scheduled)
cycles helped:   shaders/humus-volumetricfogging2/1.shader_test FS SIMD32: 13832 -> 13800 (-0.23%) (scheduled: scheduled)
cycles helped:   shaders/tesseract/479.shader_test FS SIMD32:      9330 -> 8644 (-7.35%) (scheduled: scheduled)

cycles HURT:   shaders/robclark-shaders/android/angle/aztec_ruins/36.shader_test FS SIMD32: 7870 -> 7940 (0.89%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/57.shader_test FS SIMD32: 7870 -> 7940 (0.89%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/54.shader_test FS SIMD32: 7870 -> 7940 (0.89%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/android/angle/aztec_ruins/30.shader_test FS SIMD32: 8726 -> 8808 (0.94%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/51.shader_test FS SIMD32: 8726 -> 8808 (0.94%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/48.shader_test FS SIMD32: 8726 -> 8808 (0.94%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/gfxbench5/gl_4_off/129.shader_test TCS SIMD8: 3911 -> 3979 (1.74%) (scheduled: scheduled)
cycles HURT:   shaders/robclark-shaders/gfxbench5/gl_4_off/109.shader_test TCS SIMD8: 3911 -> 3979 (1.74%) (scheduled: scheduled)

total cycles in shared programs: 313096438 -> 313096306 (<.01%)
cycles in affected programs: 92200 -> 92068 (-0.14%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24702>
2023-08-22 23:34:30 +00:00
Emma Anholt
ed4e1becea intel/fs: Move defin/defout setup to the start of the loop.
Refactor for the next commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24702>
2023-08-22 23:34:30 +00:00
Daniel Schürmann
7e246f7f2b nir/opt_move: fix handling of if-condition
By accident, this used the parent of the nir_src which is a nir_if
instead of the parent of the SSA value.

Totals from 10814 (8.10% of 133461) affected shaders: (GFX11)
Instrs: 21759185 -> 21757190 (-0.01%); split: -0.02%, +0.01%
CodeSize: 112320272 -> 112316008 (-0.00%); split: -0.02%, +0.01%
SpillSGPRs: 11220 -> 11212 (-0.07%)
SpillVGPRs: 911 -> 903 (-0.88%); split: -1.54%, +0.66%
Latency: 258334759 -> 258316073 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 31428650 -> 31426394 (-0.01%); split: -0.02%, +0.01%
VClause: 309119 -> 309090 (-0.01%); split: -0.01%, +0.01%
SClause: 657028 -> 657150 (+0.02%); split: -0.03%, +0.04%
Copies: 1434209 -> 1432420 (-0.12%); split: -0.28%, +0.15%
Branches: 481804 -> 481801 (-0.00%)
PreSGPRs: 829995 -> 829966 (-0.00%)
PreVGPRs: 758249 -> 758253 (+0.00%)

Fixes: 8a78706643 ('nir: refactor nir_opt_move')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24695>
2023-08-22 21:05:18 +00:00
Alyssa Rosenzweig
f9e5534182 nir/lower_gs_intrinsics: Remove end primitive for points
EndPrimitive() for points is entirely pointless, so just remove it when lowering
EndPrimitive to simplify the IR. This is (maybe) an optimization everywhere, and
will be relied on for correctness on Asahi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24798>
2023-08-22 20:24:40 +00:00
Alyssa Rosenzweig
8c7629524e nir/print: Print access qualifiers for intrinsics
Instead of printing an opaque integer that needs to be manually decoded.
Example output:

    32x4   %7 = @image_load (%4 (0x0), %6, %5 (0x0), %4 (0x0)) (image_dim=2D, image_array=false, format=r8g8b8a8_snorm, access=readonly|reorderable, range_base=0, dest_type=float32)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24798>
2023-08-22 20:24:40 +00:00
Caio Oliveira
48b86a877f compiler/types: Use smaller keys for explicit_matrix_types table
Instead of using the name as key, use a shorter struct type.
Only build a name string if we are adding a new entry to the table.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23281>
2023-08-22 18:52:15 +00:00
Caio Oliveira
fd1da0f7f5 compiler/types: Extract get_explicit_matrix_instance() function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23281>
2023-08-22 18:52:15 +00:00
Caio Oliveira
b248740e30 compiler/types: Use smaller keys for array_types table
Instead of building a string, build a short struct type and use
that as key.  The only caveat here is ensure there either there's
no internal padding or the internal padding is always the same.
Use a static assert to ensure we are in the former case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23281>
2023-08-22 18:52:15 +00:00
Caio Oliveira
d4fcc97a3f compiler/types: Use ralloc for the key in array_types
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23281>
2023-08-22 18:52:15 +00:00
Eric Engestrom
566c919df8 ci/deqp: backport fix for dEQP-EGL.functional.wide_color.*_888_colorspace_*
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24808>
2023-08-22 18:12:08 +00:00
norablackcat
f744c114d1 rusticl: add cl_khr_expect_assume
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Andrey Alekseenko <al42and@gmail.com>
Tested-by: Yifeng Li <tomli@tomli.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23115>
2023-08-22 17:28:05 +00:00
norablackcat
25bc3d2824 spirv/nir_to_spirv: add expect assume op codes
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23115>
2023-08-22 17:28:05 +00:00
Emma Anholt
37fcbb375c blorp: Disable unaligned partial HIZ fast clears for HIZ_CCS too.
Fixes MSAA scissored fast clears under zink and ANGLE.

Fixes: e488773b29 ("anv: Fast clear depth/stencil surface in vkCmdClearAttachments")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24225>
2023-08-22 16:34:52 +00:00
Konstantin Seurer
7aee3ba36d radv: Stop updating the stack_size in insert_rt_case
There are two paths that call insert_rt_case:
- Traversal shader: The stack size is ignored.
- Monolithic raygen shader: The stack sizes of the inlined shaders are
                            accounted for in compute_rt_stack_size.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
Konstantin Seurer
bdec044c88 aco: Do not fixup registers if there are no shader calls
Frees up some registers when using monolithic compilation.

Quake II RTX and Control (with monolithic compilation):

Totals from 10 (29.41% of 34) affected shaders:
MaxWaves: 77 -> 98 (+27.27%)
Instrs: 49047 -> 48984 (-0.13%); split: -0.16%, +0.03%
CodeSize: 260420 -> 259880 (-0.21%); split: -0.25%, +0.04%
VGPRs: 1328 -> 1104 (-16.87%)
Latency: 477134 -> 479377 (+0.47%); split: -0.05%, +0.52%
InvThroughput: 137763 -> 114108 (-17.17%)
VClause: 1318 -> 1286 (-2.43%); split: -2.66%, +0.23%
SClause: 1295 -> 1293 (-0.15%); split: -0.54%, +0.39%
Copies: 7838 -> 7782 (-0.71%); split: -0.82%, +0.10%
Branches: 2592 -> 2589 (-0.12%)
PreSGPRs: 874 -> 796 (-8.92%)
PreVGPRs: 1283 -> 1013 (-21.04%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
Konstantin Seurer
ec708c26ef radv/rt: Split stage initialization and hashing
The dependency chain is: init stages -> compute pipeline key -> hash
stages.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
Konstantin Seurer
f3e2900c59 radv/rt: Insert rt_return_amd before lowering shader calls
Also skips running nir_lower_shader_calls for the traversal shader. This
will be used to skip the pass and the rt_return_amd insertion for
monolithic raygen shaders.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
Konstantin Seurer
774421f11e radv/rt: Add and use radv_build_traversal
Moves most of the build code to a helper which will be useful for adding
inline traversal.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
Konstantin Seurer
2d7965dbff radv/rt: Do not apply stack_ptr for non-recursive stages
stack_ptr is set to 0.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
Konstantin Seurer
d174a71db8 radv/rt: Remove some dead code
- call_idx_base was used for resume shaders in the shader call loop
- hit attribs are lowered elsewhere
- stack_size is set in radv_pipeline_rt.c

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24809>
2023-08-22 15:46:29 +00:00
M Henning
10bbe17253 nv/codegen: Remove Function::buildDefSets
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
bf48f7ca97 nv/codegen: Delete periodicMask32
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
eae6800ec3 nv/codegen: Delete unused OP_CONSTRAINT
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
dcec14c51e nv50_ir_ra: Delete unused functions
Wrap the file in an anonymous namespace and delete any code that
gcc warns is unused.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
21a3889d9b nv/codegen: Remove unused clipVertexOutput var
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
95c20be563 nv/codegen: Merge from_common into from_nir
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
b80897fab1 nv/codegen: Remove fragCoord variable.
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
2ef8af39d8 nv/codegen: Delete OP_EXP, OP_LOG
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
401bdd7d1e nv/codegen: Delete OP_WRSV
It's never generated by anything.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:24 -04:00
M Henning
f4ba2fdd73 nv/codegen: Fix an uninitialized variable warning
The warning was actually a false positibe, but CI failed with:
error: 'nvirOp' may be used uninitialized [-Werror=maybe-uninitialized]

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24791>
2023-08-22 10:42:16 -04:00
Friedrich Vock
a28ff7f240 nir/load_store_vectorize: Handle intrinsics with constant base
This includes nir_load_stack and nir_store_stack, which are vectorized
in nir_lower_shader_calls. If not adjusted, we end up loading from
the wrong base.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9596
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9587
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24789>
2023-08-22 13:26:12 +00:00
Tapani Pälli
db05db44fe iris: implement a dummy depth flush for Wa_14016712196
Emit depth flush after state that sends implicit depth flush. These
states are:

 3DSTATE_HIER_DEPTH_BUFFER
 3DSTATE_STENCIL_BUFFER
 3DSTATE_DEPTH_BUFFER
 3DSTATE_CPSIZE_CONTROL_BUFFER

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24689>
2023-08-22 12:49:37 +00:00
Tapani Pälli
c9abcddad4 anv: implement a dummy depth flush for Wa_14016712196
Emit depth flush after state that sends implicit depth flush. These
states are:

 3DSTATE_HIER_DEPTH_BUFFER
 3DSTATE_STENCIL_BUFFER
 3DSTATE_DEPTH_BUFFER
 3DSTATE_CPSIZE_CONTROL_BUFFER

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24689>
2023-08-22 12:49:37 +00:00
Georg Lehmann
9cf6984200 nir: unify lower_find_msb with has_{find_msb_rev,uclz}
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24662>
2023-08-22 12:08:37 +00:00
Georg Lehmann
2ac7e6614a nir: unify lower_bitfield_extract with has_bfe
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24662>
2023-08-22 12:08:37 +00:00
Georg Lehmann
34c3f81614 nir: unify lower_bitfield_insert with has_{bfm,bfi,bitfield_select}
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24662>
2023-08-22 12:08:37 +00:00
Friedrich Vock
bfb55d0266 ac/sqtt,radv/sqtt: Add and use marker for separate RT compilation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
3d3d5c4bc3 radv/sqtt: Handle separately-compiled RT pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
1cd9525b18 radv/sqtt: Write LDS size metadata in code objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
7809fb9e49 radv/sqtt: Unregister records based on hash
RT pipelines have multiple hashes used in records, so don't always use
the pipeline hash.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
3ed4cca883 radv/sqtt: Move record filling to helper function
RT shaders construct records differently, but this piece of code is
common to all types of pipelines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
b4a704b42a ac/rgp: Add metadata for separate-compiled RT stages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
0c4e92bf3e ac/rgp: Write lds_size metadata
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
be0e3e8e09 ac/sqtt,radv: Split internal and API hash in PSO correlations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:11 +00:00
Friedrich Vock
d5f1c9fb4b ac/msgpack: make fixstrs a const char
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24371>
2023-08-22 11:33:10 +00:00
Marek Vasut
ef4cb2431d etnaviv: Fully replicate back stencil config
The blob replicates both the value mask as well as the stencil reference
of the back-facing stencil to the front-facing stencil. This fixes the
remaining failures in the following dEQPs:

   dEQP-GLES2.functional.fbo.render.*_stencil_index8

Fixes: c8ccd63911 ("etnaviv: Fix depth stencil ops on GC880/GC2000")
Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4867>
2023-08-22 12:00:27 +02:00
José Roberto de Souza
a425ae17ac anv: Update Wa_16014390852 for MTL
On MTL Wa_16014390852 is fixed on B0 stepping so we can't use a macro
check anymore for this workaround.

cc: mesa-stable

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24812>
2023-08-22 06:33:56 +00:00
Samuel Pitoiset
a29e2c6fbc aco: implement create_tcs_jump_to_epilog()
This implements jumping from the main TCS to the epilog.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
e03c09dfb2 aco: allow SGPRs operands with p_jump_to_epilog
For TCS epilogs, we will have to pass SGPRs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
fc9283938f aco: adjust TCS epilogs for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
0c2adc7ada aco: fix jumping from main TCS to epilog on GFX9+
On GFX9+, VS is merged with TCS which means this function is called
twice and the epilog was emitted in both shader parts.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
131c3aa3dc radv: add tcs_out_patch_fits_subgroup to radv_tcs_epilog_key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
65191bb351 radv: declare shader arguments for TCS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
d0808b22cb radv: stop declaring the scratch offset argument for TCS epilogs
ACO skip it for epilogs now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Samuel Pitoiset
6ad8abf7aa radv: use the maximum possible workgroup size for TCS epilogs
It's similar to when the patch control points value is dynamic.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24643>
2023-08-22 06:10:32 +00:00
Chia-I Wu
e74c3dbb70 ac/surface: limit RADEON_SURF_NO_TEXTURE to color surfaces
For z surfaces, flags.texture should be based on
RADEON_SURF_TC_COMPATIBLE_HTILE alone.  Otherwise, addrlib could pick a
_X/_T swizzle mode for a MSAA depth texture, which is said to be broken:

  When _X/_T swizzle mode was used for MSAA depth texture, TC will get zplane
  equation from wrong address within memory range a tile covered and use the
  garbage data for compressed Z reading which finally leads to corruption.

Fixes: de0885cdb8 ("amd/surface: add RADEON_SURF_NO_TEXTURE flag")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24767>
2023-08-22 02:36:20 +00:00
Dave Airlie
21778950e1 lavapipe: use vk_buffer_range common code.
trivial switch over.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24822>
2023-08-22 02:13:10 +00:00
Dave Airlie
d4f5ac5025 lavapipe: use vk_buffer common code.
This is a trivial swapover to the common runtime code for buffers.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24822>
2023-08-22 02:13:10 +00:00
Mike Blumenkrantz
d9942442f2 zink: handle patch variable locations for separate shaders better
these don't overlap with other locations so they can keep whatever their
current assignments are

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24757>
2023-08-22 01:31:35 +00:00
Mike Blumenkrantz
ca987c0dfb zink: wait on async fence during ctx program removal
removed=true implies that no async jobs are outstanding

fixes #9580

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24811>
2023-08-22 00:58:56 +00:00
Dave Airlie
0a90994fce llvmpipe/cs: drop tgsi for compute/mesh/task shader internals.
This drops the info from the compute shader infrastructure.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
2023-08-22 09:53:42 +10:00
Dave Airlie
6222d0633d llvmpipe/cs: convert to using tgsi->nir
Step 1 to removing tgsi info from llvmpipe

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
2023-08-22 09:53:42 +10:00
Dave Airlie
e32510be82 llvmpipe/fs: move some tgsi checks in nir path to nir code.
This just does the equivalent checks using NIR instead of tgsi
translated info.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
2023-08-22 09:53:42 +10:00
Dave Airlie
156d509ca4 gallivm/nir: avoid using params->info
This shouldn't be needed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
2023-08-22 09:53:42 +10:00
Dave Airlie
8e2f020bb4 llvmpipe/fs: drop cbuf 0 since it's lowered now.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
2023-08-22 09:53:42 +10:00
Dave Airlie
5120139958 gallivm: drop unused info parameter
This isn't used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24804>
2023-08-22 09:53:42 +10:00
David Heidelberg
6079c3ca49 ci: disable Material Testers.x86_64_2020.04.08_13.38_frame799.rdc trace
This change will be revert as soon, as Collabora proxy gets fixed.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24819>
2023-08-21 22:31:21 +00:00
Pavel Ondračka
df11f3f7e6 r300: remove the nrt main optimization loop
Most of it is already called during finalize_nir, so here we do just some final
polishing.

This brings some minor but reproducible compile-time speedups (dEQP on my RV370
and AMD Ryzen 9 3900X at 8 threads goes from 80s to 74s).

RV530 shader-db:
total instructions in shared programs: 130303 -> 130275 (-0.02%)
instructions in affected programs: 1661 -> 1633 (-1.69%)
helped: 9
HURT: 2

instructions helped:   shaders/godot3.4/10-36.shader_test FS:            163 -> 162 (-0.61%)
instructions helped:   shaders/tropics/240.shader_test VS:               144 -> 140 (-2.78%)
instructions helped:   shaders/tropics/246.shader_test VS:               137 -> 133 (-2.92%)
instructions helped:   shaders/tropics/222.shader_test VS:               131 -> 127 (-3.05%)
instructions helped:   shaders/tropics/228.shader_test VS:               128 -> 124 (-3.12%)
instructions helped:   shaders/tropics/252.shader_test VS:               126 -> 122 (-3.17%)
instructions helped:   shaders/tropics/234.shader_test VS:               121 -> 117 (-3.31%)
instructions helped:   shaders/tropics/216.shader_test VS:               104 -> 100 (-3.85%)
instructions helped:   shaders/tropics/210.shader_test VS:               101 -> 97 (-3.96%)

instructions HURT:   shaders/yofrankie/15.shader_test FS:              211 -> 213 (0.95%)
instructions HURT:   shaders/yofrankie/42.shader_test FS:              295 -> 298 (1.02%)

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
4c122086b6 r300: simplify ntr_get_gl_varying_semantic
We support TEXCOORDS since d4b8e8a481

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
85c10bab8c r300: remove unused barrier code from ntr
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
b5c2833258 r300: remove some unsupported texture opcodes
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
e363b2a77f r300: simplify ntr_try_store_in_tgsi_output
r300 doesn't support anything besides vertex and fragment shaders.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
12e9c20bfb r300: simplify ntr_output_decl
We have no tesselation.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
b3cf43bda3 r300: simplify ntr_setup_uniforms
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
0b11a9d893 r300: remove some virglrenderer specifics from ntr
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
5d567f0c1b r300: simplify ntr_emit_load_input
r300 doesn't support anything besides vertex and fragment shaders.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
8facefb451 r300: simplify ntr_emit_load_ubo
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
608613b937 r300: remove ntr default options
r300 sets its own options.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:40 +00:00
Pavel Ondračka
30b62b7733 r300: remove unused ntr default settings
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
1c045c54b7 r300: remove unneeded 64bit and atomic lowering passes
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
6b3be0cc2a r300: remove the unneeded ntr_lower_vec_to_reg callback
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
b60b27c762 r300: remove more ntr unused helpers
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
868eee6e18 r300: simplify vectorization rules
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
0f63a92328 r300: remove more unused 64-bit pieces from ntr
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
c8ef840081 r300: remove ntr_tgsi_usage_mask
This is just u_bit_consecutive for non-64bit.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
e81c64f2fa r300: remove unused integer support in ntr
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
fcefbf9599 r300: remove irrelevant opcodes in ntr
Remove anything unsupported by the hardware, including the 64bit
variants.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
98ae4efcec r300: remove unused intrinsics in ntr
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
553c1d33dd r300: add lower_sqrt to nir option
This is now by default for ntt, but we will get rid of the default
definitions soon.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Pavel Ondračka
ed8b7eaec9 r300: copy ntt to r300 compiler
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23437>
2023-08-21 20:10:39 +00:00
Tatsuyuki Ishi
6c5512568b radv/amdgpu: Do not pass in a BO handle when clearing PRT VA region.
This field is invalid to access for virtual BOs.

Fixes: a931d5a4a4 ("radv/winsys: clear the PRT VA range when destroying a virtual BO")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24805>
2023-08-21 17:24:35 +00:00
M Henning
2b78fe5b95 nv/codegen: Delete OP_POW
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24796>
2023-08-21 15:34:14 +00:00
M Henning
4ac1f4bf7d nv50_ir_from_nir: Use nir's lower_fpow
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24796>
2023-08-21 15:34:14 +00:00
George Ouzounoudis
eb5cabf3ae nouveau/codegen: Add a 4th optimization level for MemoryOpts
MemoryOpt optimization pass makes some tests in NVK fail. Until its
fixed in codegen or implemented on NIR instead, move it to a 4th level.
This affects the GL driver as well, but less often.

Fixes dEQP-VK.pipeline.monolithic.dynamic_control_points.change_output*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24705>
2023-08-21 14:26:34 +00:00
Konstantin Seurer
2943bc34e9 radv: Remove leaf_args::dst_offset
We can use first_id instead.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24756>
2023-08-21 12:45:06 +00:00
Konstantin Seurer
90a24c7cb3 radv: Add internal_nodes_offset to scratch_layout
It shouldn't be a part of bvh_state.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24756>
2023-08-21 12:45:06 +00:00
Samuel Pitoiset
85cc70a629 zink/ci: update list of expected failures for NAVI10
This matches recent VanGogh CI list changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24807>
2023-08-21 12:12:22 +00:00
Erik Faye-Lund
db8e49682d docs: expand mobile-menu without js
Without javascript support, a user can't expand the menu. So let's
leave it always-expanded in that case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24721>
2023-08-21 12:03:20 +00:00
Samuel Pitoiset
b8b42be555 radv/amdgpu: add support for submitting external IBs with the chained path
External IBs are currently only used for DGC. With the chained path,
these IBs will only be used to workaround missing IB2 packet on the
compute queue, which is rare enough to care about chaining inside CS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24207>
2023-08-21 10:52:13 +00:00
Samuel Pitoiset
33f584f033 radv/amdgpu: allow to execute external IBs on the compute queue
IB2 isn't supported on ACE, so external IBs should be submitted as IB1.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24207>
2023-08-21 10:52:13 +00:00
Samuel Pitoiset
e3fae01730 Revert "radv/amdgpu: skip adding per VM BOs for sparse during CS BO list build"
This reverts commit 51caece74c.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24774>
2023-08-21 09:42:51 +00:00
Samuel Pitoiset
f67eb9ce07 Revert "radv/amdgpu: workaround a kernel bug when replacing sparse mappings"
This workaround was added temporarily but it can actually cause
stuttering in some games like Forza Horizon 5.

The kernel fix
(https://lists.freedesktop.org/archives/amd-gfx/2023-June/094648.html)
landed in some stable kernels (5.15.121+, 6.1.40+ and 6.4.5+). Sadly,
older stable kernels don't have it, so you might experiment random GPU
hangs in games that use sparse mapping. Please ensure your kernel is
up-to-date for the best experience.

This reverts commit 9b00867327.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9443
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24774>
2023-08-21 09:42:51 +00:00
Christian Gmeiner
9153dc327f etnaviv: unbreak cmdline compiler
Fixes the following assert:
  etnaviv_compiler: ../src/compiler/glsl_types.cpp:1219: static const glsl_type* glsl_type::get_array_instance(const glsl_type*, unsigned int, unsigned int): Assertion `glsl_type_users > 0' failed.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24753>
2023-08-21 05:13:16 +00:00
Eric Engestrom
953ac9da79 v3d/qpu: fix type of function argument
Fixes: 05c7d9715b ("broadcom: Add V3D 3.3 QPU instruction pack, unpack, and disasm.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24787>
2023-08-20 04:58:17 +00:00
Eric Engestrom
8a1f3d0d73 v3dv: fix shader stage name in error message
Fixes: 60145629a2 ("v3dv: initial CreateGraphicsPipeline/DestroyPipeline implementation")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24787>
2023-08-20 04:58:17 +00:00
Eric Engestrom
ae0cb0b998 v3dv: fix copy/pasted type of sample
And use the type in functions instead of a generic `uint32_t` to make it
easier to notice the wrong type.

Fixes: 47e02a2ef1 ("v3dv: add a fast path for vkCmdClearAttachments")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24787>
2023-08-20 04:58:17 +00:00
Eric Engestrom
4dc0cb1ebe v3dv: fix VK_PIPELINE_ROBUSTNESS_{BUFFER,IMAGE}_BEHAVIOR_DEVICE_DEFAULT_EXT copy/paste typo
Fixes: 24d9a80247 ("v3dv: implement VK_EXT_pipeline_robustness")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24787>
2023-08-20 04:58:16 +00:00
Bas Nieuwenhuizen
c2d3d655b8 docs: Add documentation for gpuvis.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22505>
2023-08-20 00:49:38 +02:00
Bas Nieuwenhuizen
4eb57ab97a vulkan: Add CPU tracing for vkWaitForFences.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22505>
2023-08-19 23:10:37 +02:00
Bas Nieuwenhuizen
d980f311b7 egl,venus,vulkan,turnip,freedreno: Update CPU trace init to init more than perfetto.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22505>
2023-08-19 23:09:45 +02:00
Bas Nieuwenhuizen
11198951e6 util/perf: Add gpuvis integration.
Initial integration, still needs the init functions to be changed
across the codebase.

For the context usage https://github.com/mikesart/gpuvis/pull/82 is
needed to display it correctly in gpuvis.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22505>
2023-08-19 23:09:45 +02:00
Marek Olšák
ff3db3e6cf radeonsi: fix templated si_draw_rectangle callback for Navi14
Navi14 is the only gfx10 chip that doesn't enable NGG.

Fixes: cd7e20f513 ("radeonsi: specialize si_draw_rectangle using a C++ template")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
1a2c12937d radeonsi/gfx11: pass attribute ring addr via SGPR instead of memory for blits
This removes the scalar memory load from blit vertex shaders.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
bfdff13f91 radeonsi: don't pass gl_Layer to PS for blit shaders
This will be required by the next commit to prevent hangs. See the comment.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
59e49cc6ab radeonsi: simplify/merge emit_shader_ngg functions
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
1c82067b60 radeonsi: improve the heuristic when to use Wave32 for compute shaders
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
7f25f30443 radeonsi: rename uses_subgroup_info to uses_tg_size
that's the name of the SGPR

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
e359254a19 radeonsi: allow setting any index in radeon_set_sh_reg_idx
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
905a00f10a ac/surface: add radeon_surf::u::gfx9::uses_custom_pitch
so that we don't try to guess when the pitch is overridden

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
9eb00f612a ac/surface: trivial non-functional changes
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
40b426c8f9 ac: add a standalone IB parser program
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:56 +00:00
Marek Olšák
229833d118 ac: update gfx11 shadowed register tables
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
176ef72ff5 ac: improve the IB parser
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
05e7bf471c ac: change offsets of DMA_DATA dwords to prevent reg offset conflicts
Use non-multiples of 4.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
8e4ba537a1 ac: minor updates to packet documentation and definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
bc44121444 ac: document ac_shader_args::gs_vtx_offset
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
a2bf30961f ac: implement AMD_FORCE_FAMILY properly, remove SI_FORCE_FAMILY
This sets radeon_info for the forced family correctly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
5d19a0a19b Revert "ac: don't call ac_query_pci_bus_info from ac_query_gpu_info"
This reverts commit a48642400b.

Instead, add a new parameter require_pci_bus_info to control the behavior.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
b02b43eef1 ac/gpu_info: add the /dev/dri/ filename into radeon_info
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24759>
2023-08-19 19:36:55 +00:00
Marek Olšák
1ac379c4a0 nir/algebraic: collapse ALU opcodes sourcing NaN
Undef will be replaced by NaN whenever it leads to elimination of FP
instructions. This implements the elimination part.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24792>
2023-08-19 14:18:52 -04:00
Marek Olšák
ee225e31c1 nir: fix constant evaluation of fddx/fddy sourcing Inf & NaN constant
A derivative of NaN is NaN.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24792>
2023-08-19 14:18:52 -04:00
Timur Kristóf
8780f66c3a nir/opt_dead_cf: Remove if branches with undef condition.
Treat them as if the undef were false.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24792>
2023-08-19 14:18:52 -04:00
Alyssa Rosenzweig
558e36f641 nir/passthrough_gs: Fix array size
Triangle strips with adjacency have 6 vertices input, so we need an array big
enough for all 6 vertices to avoid overflow. Fixes passthrough GS generated for
KHR-GLES31.core.draw_indirect.basic-mode-*-triangle*adj*.

Fixes: ea14579f3d ("nir: handle primitives with adjacency")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24780>
2023-08-19 17:13:49 +00:00
Alyssa Rosenzweig
fe4208ed4c nir/passthrough_gs: Correctly set vertices_in
If the input primitive has adjacency, the output primitive will have fewer
vertices than the input. For example, if we input TRIANGLE_STRIPS_ADJACENCY, we
need to set vertices_in = 6 even though we'll output TRIANGLE_STRIPS with
vertices_out = 3. Respect that, in order to correctly handle adjacency inputs.

Fixes: ea14579f3d ("nir: handle primitives with adjacency")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24780>
2023-08-19 17:13:49 +00:00
Alyssa Rosenzweig
04ba4059b7 nir/lower_helper_writes: Consider bindless images
These need to be handled like other image ops.

Fixes KHR-GLES31.core.shader_image_load_store.basic-allTargets-atomicFS on Asahi
with bindless image access forced.

Fixes: 586da7b329 ("nir: Add nir_lower_helper_writes pass")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24778>
2023-08-19 12:27:34 -04:00
M Henning
c07d3f00c4 nv/codegen: Use nir_lower_clip
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24653>
2023-08-19 15:34:28 +00:00
Eric Engestrom
ab0f0d1563 zink: fix format in zink_make_{image,texture}_handle_resident()
`ds->db.format` is a `pipe_format`, while `buffer_infos[handle].format` is
a `VkFormat`; the conversion from one to the other was missing.

Fixes: 99ba529fee ("zink: implement descriptor buffer handling of bindless texture")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24790>
2023-08-19 14:28:19 +00:00
Eric Engestrom
af28356de0 vc4: drop duplicate .lower_ldexp
It's set 3 lines above already.

Fixes: 2a33ea95d6 ("glsl: Retire ldexp lowering in favor of the nir lowering flag.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24786>
2023-08-19 07:23:32 +00:00
Sylvain Munaut
caf15a3276 egl: Advertise EGL_MESA_gl_interop extension if support present
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:30 +00:00
Sylvain Munaut
8ee8788208 glx: Advertise GLX_MESA_gl_interop extension if support present
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:30 +00:00
Sylvain Munaut
c0d804685d glx: Remove MESA_depth_float_bit from enum
This is not used anywhere. Been there from the beginning of this
file but with no related code in glxextensions.c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:30 +00:00
Sylvain Munaut
48e416ee2f egl: Export the MESA GL Interop functions through eglGetProcAddress
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:30 +00:00
Sylvain Munaut
1b8d81f3f8 glx: Export the MESA GL Interop functions through glXGetProcAddress
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:30 +00:00
Sylvain Munaut
414c4583e8 glx: Add missing MesaGLInteropGLXFlushObjects
All the plumbing was added in 8d55fb54b1
but for some reason the top level access method was not ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:30 +00:00
Sylvain Munaut
798a7ef698 include: Fix the PFN declarations to be pointers as they should
Broken by b5f9820d90 back in 2016.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Antonio Gomes <antoniospg100@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19 01:08:29 +00:00
Eric Engestrom
51a911cfa1 egl: bump extension string length
We've actually been over the 1000 char limit for a while, but we didn't
have a driver in CI that enabled enough extensions to notice it.

If all currently supported extensions are enabled, we need 1441 chars.
Let's bump the string to 2048 to have a little bit of margin.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24781>
2023-08-18 23:37:36 +00:00
Alyssa Rosenzweig
c0cb358f1b agx: Lower fquantize2f16
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24616>
2023-08-18 22:20:02 +00:00
Alyssa Rosenzweig
a257e2daad nir: Lower fquantize2f16
Passes dEQP-VK.spirv_assembly.*opquantize*.

Unlike the DXIL lowering, this should correctly handle NaNs. (I belive Dozen has
a bug here that is masked by running constant folding early and poor CTS
coverage.) It is also faster than the DXIL lowering for hardware that supports
f2f16 conversions natively. It is not as good as a backend implementation that
could flush-to-zero in hardware... but for a debug instruction it should be more
than good enough.

It might be slightly better to multiply with 0.0 to get the appropriate zero,
but NIR really likes optimizing that out ...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24616>
2023-08-18 22:20:02 +00:00
David Heidelberg
05cb55abe8 gtest: backport ansi color fix
Fixes ubsan runs for Mesa3D.

Adds prevents from returning
nullptr by choosing default color.

Upstream PR: https://github.com/google/googletest/pull/4322

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9404
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24783>
2023-08-18 21:33:14 +00:00
Eric Engestrom
798becf2da ci/freedreno: reuse freedreno_gl_file_list instead of re-definining it
Fixes: 9d442b459a ("ci/freedreno: handle disabling farm properly for each FD/Collabora farm")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24779>
2023-08-18 20:59:09 +00:00
Pavel Ondračka
9fa26f69cc r300: add dEQP baseline for RV370 with forced swtcl
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24769>
2023-08-18 20:18:32 +00:00
Pavel Ondračka
8657a09f9a r300: don't abort on flow control when using draw for vs
It can handle it just fine. Around 250 dEQPs go from Skip to Pass.

Fixes: 1021e2b946
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24769>
2023-08-18 20:18:32 +00:00
Mike Blumenkrantz
659b7eb279 r600: better tracking for vertex buffer emission
Fixes: 76725452 (gallium: move vertex stride to CSO)

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24754>
2023-08-18 18:58:08 +00:00
Mike Blumenkrantz
63267bcb94 r600: store the mask of buffers used by a vertex state
Fixes: 76725452 (gallium: move vertex stride to CSO)

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24754>
2023-08-18 18:58:08 +00:00
David Rosca
f638ba4669 radeonsi/vcn: Fix leaking fences in decode
Unref fence used in destroy.

Don't store the fence reference in picture->fence, instead
keep it in the driver. Because only the last fence will
now be valid, check the fence pointer in get_decoder_fence.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24677>
2023-08-18 18:22:04 +00:00
Faith Ekstrand
1198816f50 nir: Use nir_shader_intrinsic_pass() a few places
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24760>
2023-08-18 17:39:53 +00:00
Faith Ekstrand
831085afa3 nir: Fix metadata in nir_lower_is_helper_invocation
It does not preserve everything.  It adds and removes instructions and
even adds a variable.

Fixes: f17b41ab4f ("nir: add lowering pass for helperInvocationEXT()")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24760>
2023-08-18 17:39:53 +00:00
Alyssa Rosenzweig
d620d8d74f nir: Add nir_shader_intrinsics_pass
Like instructions_pass but specialized to intrinsics. More ergnomic for this
extremely common case, and possibly a bit faster by avoiding the extra function
call on non-intrinsics.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24760>
2023-08-18 17:39:53 +00:00
Konstantin Seurer
f6f302bbbc lavapipe: Advertise AMDX_shader_enqueue
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
ce4af69d7e lavapipe: Implement AMDX_shader_enqueue commands
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
ff6a133b72 lavapipe: Implement exec graph pipelines
Just a collection of compute shaders that can enqueue each other.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
b817b597c7 lavapipe: Add lvp_pipeline_type
A boolean is not enough to support exec graph pipelines.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
2489f7d84f spirv: Implement SPV_AMDX_shader_enqueue
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
289df72d10 spirv: Update headers and grammer JSON
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
ccc52ae887 nir: Add shader enqueue data structures and handling
There are two new variable modes:
- nir_var_mem_node_payload
- nir_var_mem_node_payload_in

Also add a few more intrinsics and some shader info.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
2953c93cca vulkan Add enqueue entrypoint for CmdDispatchGraphAMDX
The generyted one doesn't copy deep enough.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
083793a39d vulkan: Allow beta extensions for physical device properties
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
a7141a6f8a vulkan: Allow beta extensions for physical device features
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Konstantin Seurer
32ad8baa05 bin: Update spirv sources
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24512>
2023-08-18 16:57:22 +00:00
Julia Zhang
9557aa8822 radeonsi: modify algorithm of skipping holes of sparse bo
Modify current algorithm of skipping holes of sparse bo to cover the
following using situations:
1. The whole sparse buffer is uncommitted.
2. More than one page that in the tail of sparse buffer are uncommitted.

Signed-off-by: Julia Zhang <julia.zhang@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24535>
2023-08-18 15:42:20 +00:00
Flora Cui
e259f4050d radeonsi: limit CP DMA to skip holes in sparse bo
CP DMA on gfx9 can't handle the hole in sparse buffer. The fix skip
sparse bo hole so that arb_sparse_buffer-buffer-data &&
arb_sparse_buffer-commit pass

Signed-off-by: Flora Cui <flora.cui@amd.com>
Signed-off-by: Julia Zhang <julia.zhang@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24535>
2023-08-18 15:42:20 +00:00
Rohan Garg
8849e1e3a6 anv: emitting 3DSTATE_PRIMITIVE_REPLICATION is required on Gen12+
This change helps fix the following tests on future platforms:
  - func.multiview
  - dEQP-VK.fragment_shading_rate.renderpass2.monolithic.multiviewsrlayered.dynamic.attachment.noshaderrate.keep.replace.1x1.samples1.vs
  - anything else that uses multiview

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24746>
2023-08-18 11:36:45 +00:00
Sviatoslav Peleshko
e62f2c48a0 dri: Use RGB internal formats for RGBX formats
These formats do not contain alpha channel, so their internal formats
should reflect that.

Fixes: bf576772 ("dri_util: add driImageFormatToSizedInternalGLFormat function")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9429
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24580>
2023-08-18 11:00:40 +00:00
David Heidelberg
61dd0ff97d ci/freedreno: another batch of Adreno 530 flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24772>
2023-08-18 12:20:06 +02:00
Samuel Pitoiset
b78ea2a38f radv: stop copying if VS or TES uses the InvocationID built-in
It's only allowed in TCS or GS which means the src shader stage
value is always FALSE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24691>
2023-08-18 09:31:23 +00:00
Samuel Pitoiset
d547c996ae radv: simplify declaring VS specific input SGPRs
stage/previous_stage are actually useless.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24691>
2023-08-18 09:31:23 +00:00
Samuel Pitoiset
525143d01a radv: remove unused param from radv_pipeline_init_multisample_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24691>
2023-08-18 09:31:23 +00:00
Samuel Pitoiset
1cf840fb3e radv: remove radv_cmd_buffer::cached_vertex_formats
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24770>
2023-08-18 10:23:45 +02:00
Samuel Pitoiset
c136169062 radv: fix emitting TCS epilogs for GFX6-9
The number of SGPRs need to be adjusted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24747>
2023-08-18 07:52:22 +00:00
Samuel Pitoiset
f9a9471caf radv: add missing comment about TCS_OFFCHIP_LAYOUT_LSHS_VERTEX_STRIDE
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24745>
2023-08-18 07:11:26 +00:00
Samuel Pitoiset
c6a56e6b3d radv: reduce TCS_OFFCHIP_LAYOUT_NUM_PATCHES to 6-bits
RADV clamps the number of tess patches to 40.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24745>
2023-08-18 07:11:26 +00:00
Faith Ekstrand
20381eb522 nir: Drop nir_push_if_src()
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24765>
2023-08-17 23:26:40 -05:00
Faith Ekstrand
96c0f8c580 nir: Drop nir_instr_rewrite_src()
Replace all its remaining users with nir_src_rewrite().

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
b5d6b7c402 nir: Drop most uses if nir_instr_rewrite_src()
Generated by the following semantic patch:

    @@
    expression I, S, D;
    @@

    -nir_instr_rewrite_src(I, S, nir_src_for_ssa(D));
    +nir_src_rewrite(S, D);

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
71ddaca2e2 nir: Drop nir_instr_rewrite_src_ssa()
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
de063a1481 nir: Drop most uses of nir_instr_rewrite_src_ssa()
Generated with the following semantic patch:

    @@
    expression I, S, D;
    @@

    -nir_instr_rewrite_src_ssa(I, S, D);
    +nir_src_rewrite(S, D);

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
964c73e13e nir: Drop nir_if_rewrite_condition()
Use nir_src_rewrite() instead.  In a couple of cases, we can even drop a
switch on whether or not it's an if source.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
267b4fb1b9 nir: Add and use a nir_instr_init_src() helper
This helper exists for a very tiny set of use-cases but it's better to
have the helper live in nir.c than hand-roll it elsewhere.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
9c8cb69c15 nir: Add a nir_instr_clear_src() helper and use it
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:15 +00:00
Faith Ekstrand
7af0dcbdfc nir/opt_undef: Don't rewrite a bcsel to mov
Technically, it's possible because bcsel has more sources than mov.
However, it's not worth the pain of trying to get it right.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:14 +00:00
Faith Ekstrand
53294de682 nir: Take a nir_def * in nir_phi_instr_add_src()
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:14 +00:00
Faith Ekstrand
298a3eebd8 nir: Take a nir_def * in nir_tex_instr_add_src()
NIR bits were hand-typed.  Driver updates done through the following
semantic patch:

    @@
    expression T, ST, D;
    @@

    -nir_tex_instr_add_src(T, ST, nir_src_for_ssa(D));
    +nir_tex_instr_add_src(T, ST, D);

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24729>
2023-08-18 01:00:14 +00:00
Christian Gmeiner
6d168b93bc ci/etnaviv: update ci expectation
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24751>
2023-08-18 00:41:53 +00:00
Karol Herbst
3e0cd6dfb9 nv50: limit max code uploads to 0x8000
I have no idea why a bigger size doesn't work, the hardware doesn't
complain, but it turns out that uploading big shaders still causes issues
with the old limit. *shrug*

Fixes: 7f63d2ebdb ("nv50: fix code uploads bigger than 0x10000 bytes")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24758>
2023-08-18 00:24:01 +00:00
Sagar Ghuge
26b2bdcfe0 iris,crocus: drop unnecessary DEBUG_NO_CCS/NO_HIZ checks
Now isl_surf_supports_ccs helper handles DEBUG_NO_CCS check and
isl_surf_get_hiz_surf handles DEBUG_NO_HIZ, so we don't
need to check it everywhere.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24731>
2023-08-17 23:49:34 +00:00
Sagar Ghuge
20db03d32f anv,hasvk: drop unnecessary DEBUG_NO_CCS/NO_HIZ checks
Now isl_surf_supports_ccs helper handles DEBUG_NO_CCS check and
isl_surf_get_hiz_surf handles DEBUG_NO_HIZ, so we don't
need to check it everywhere.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24731>
2023-08-17 23:49:34 +00:00
Sagar Ghuge
b3affef252 intel/isl: Enable INTEL_DEBUG=noccs/nohiz in ISL helpers
Let's enable INTEL_DEBUG=noccs in isl_surf_supports_ccs helper and
INTEL_DEBUG=nohiz in isl_surf_get_hiz_surf helper.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24731>
2023-08-17 23:49:34 +00:00
Emma Anholt
4dfd306454 disk_cache: Disable the "List" test for RO disk cache.
It uses a poll function that waits for a second hoping for another thread
to catch up, which is not a reliable way to do synchronization.  The test
has been spuriously failing merges on a regular basis recently.

This is issue #9222, which I'm leaving open until the author can fix the test.

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24755>
2023-08-17 22:52:23 +00:00
Igor Torrente
e595c367d5 zink: Fix one addicional case when running a compositor
Covers the case where the `dri2_init_screen` calls
`pipe_loader_create_screen_vk` directly and not sets
the device major and minor.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24678>
2023-08-17 20:47:34 +00:00
Kenneth Graunke
d7daf78f62 intel/compiler: Respect NIR_DEBUG_PRINT_INTERNAL for DEBUG_OPTIMIZER
If the NIR_DEBUG_PRINT_INTERNAL flag is not set, don't print debugging
information for internal shaders in INTEL_DEBUG=optimizer dumps.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24684>
2023-08-17 18:19:53 +00:00
Emma Anholt
8a8bde69a5 ci/turnip: Add a660 VK coverage.
1/2 run pre-merge, and a half-hour full run for nightly.  Test status
looks very stable so far.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24737>
2023-08-17 16:46:25 +00:00
Tapani Pälli
71a2d651c1 anv: refactor batch_set_preemption to use batch_emit_pipe_control
This makes it easier to hook workarounds for this pipe control.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24690>
2023-08-17 16:07:59 +00:00
Marek Olšák
f3398683f2 radeonsi: don't use threadID.yz/blockID.yz for compute_blit if they're always 0
This can improve performance because fewer VGPRs and SGPRs need to be
initialized.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:07 +00:00
Marek Olšák
3952b89ebb radeonsi: don't use threadID.yz/blockID.yz for copy_image if those are always 0
This can improve performance because fewer VGPRs and SGPRs need to be
initialized.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:07 +00:00
Marek Olšák
47a57416cf radeonsi: don't abort for descriptor failures, let the winsys handle it
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:07 +00:00
Marek Olšák
784492a363 radeon_winsys: add a ctx_set_sw_reset_status callback
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
d7b7332a16 winsys/amdgpu: rework how SW reset status is generated and reported
This adds a new helper amdgpu_ctx_set_sw_reset_status that sets the SW
status. The logic of which CS is reported as rejected is also changed
slightly, i.e. other contexts no longer affect the current context.

The helper will be exposed to radeonsi to allow reporting non-recoverable
allocation failures and skipped draws.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
4b0f822e26 radeon_winsys: move allow_context_lost from cs_create to ctx_create
to apply it to all command streams of each context.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
591aaea648 radeonsi: set PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET on aux_context explicitly
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
a7e6d5bad1 radeonsi: rewrite how occlusion query precision is determined for performance
The precision of occlusion queries is determined from active queries.
Then the register programming is determined from the precision and other
states.

This has the effect that we no longer set PERFECT_ZPASS_COUNTS
for PIPE_QUERY_OCCLUSION_PREDICATE in some cases, resulting in higher
performance.

This also disables conservative occlusion queries for gfx11 because it's
not recommended with late Z, but detecting late Z vs early Z would be
more complicated, so just never use it, which results in better performance
with late Z.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
5d50e77207 radeonsi: enable shader culling by default because it helps Viewperf
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
652593ee23 radeonsi: use num_patches_per_workgroup directly in si_get_ia_multi_vgt_param
We don't need to pass it via parameters.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
eb90fffa58 radeonsi: move GE_CNTL emission from si_draw into si_emit_vgt_pipeline_state
It doesn't depend on pipe_draw_info since pipe_context::set_patch_vertices
was added.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
0b2d1fe9cf radeonsi/ci: update gfx11 failures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
bf579559ed radeonsi: convert si_gfx_resources_add_all_to_bo_list to a state atom
We can do this as part of the state emit loop instead of having a separate
call in si_draw.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
0125e8d334 radeonsi: merge si_upload_*_descriptors into si_emit_*_shader_pointers
This removes calling si_upload_graphics_shader_descriptors from si_draw
by moving the uploading into si_emit_graphics_shader_pointers.

Similar for compute.

si_upload_shader_descriptors used to set sctx->shader_pointers_dirty to
pass the mask to the emit function. Now, shader_pointers_dirty is both set
and consumed in si_emit_graphics_shader_pointers and si_emit_compute_-
shader_pointers, so the mask is passed via a local variable.

All places that set descriptors_dirty must now also dirty
the gfx_shader_pointers state for the descriptors to be uploaded.

All places that set bindless_descriptors_dirty must do the same and also
make the cache_flush state dirty because si_emit_graphics_shader_pointers
can now set cache flush flags (through si_upload_bindless_descriptors).

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
2783f4d98e radeonsi: rename shader_pointers state -> gfx_shader_pointers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
43c8502db1 radeonsi: abort when failing to upload descriptors instead of skipping draws
This removes a jump from si_draw, and it's a prerequisite for the next
change, which will move uploading descriptors into a state emit function.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
28089e0a66 radeonsi: remove render condition logic from si_draw by reordering atoms
If we reorder state atoms to emit the render condition after cache flushes,
it will automatically give us the behavior we want in si_draw.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
1e4b539042 radeonsi: handle deferred cache flushes as a state (si_atom)
This allows us to remove a little bit of code from si_draw, and enable
removing more code in the future.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
c3129b2b83 radeonsi: add a simple version of si_pm4_emit_state for non-shader states
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
3986f27396 radeonsi: merge pm4 state and atom emit loops into one
This merges both loops in si_draw by tracking which pm4 states are dirty
using the state atom mechanism used for other states. pm4 states now have
to set their own emit function.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
c21ce04014 radeonsi: move code around si_pm4_emit_state into si_pm4_emit_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
9ab2a92f27 radeonsi: split direct pm4 emission from si_pm4_emit
si_pm4_emit_state will be changed.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
95cbdcee83 radeonsi: add index parameter into si_atom::emit
si_pm4_state will use si_atom, and both loops in si_emit_all_states will
be merged. This is a preparation for that because si_pm4_emit needs to know
the state index.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
cd7e20f513 radeonsi: specialize si_draw_rectangle using a C++ template
We have only 1 variant per gfx version except gfx10+, which have 2.
The motivation is to remove instructions from si_draw_vbo.

Code size before this commit:
    si_draw_vbo<GFX11, no tess, no GS, has NGG, has pairs>: 8616 bytes
    si_draw_rectangle: 272 bytes

Code size after this commit:
    si_draw_vbo<GFX11, no tess, no GS, has NGG, has pairs>: 8534 bytes
    si_draw_rectangle<GFX11, has NGG, has pairs>: 2295 bytes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
eeb384193c radeonsi: always inline si_prefetch_shaders
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
79e33b8b40 radeonsi: remove the draw counter with primitive restart from the HUD
not used

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
d7f6985dd4 radeonsi: remove unused check_mem parameter from si_sampler_view_add_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
1744a8b89c radeonsi: add padding to si_resource to fix Viewperf2020/catiav5test1 perf
This is needed after the previous commit.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
7d67e10b02 radeonsi: remove splitting IBs that use too much memory
It was needed for r300, not so much for GCN/RDNA.
This reduces draw overhead.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
a59d387bc2 radeonsi: move si_emit_rasterizer_prim_state out of si_emit_all_states
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
3a9de499b8 radeonsi: move si_emit_spi_map into si_state_shaders.cpp
to reduce the amount of code in si_state_draw.cpp.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
e234c9fc21 radeonsi: move si_update/emit_tess_io_layout_state into si_state_shaders.cpp
to reduce the amount of code in si_state_draw.cpp.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
9999660386 radeonsi: remove si_compute.h, move the contents into si_pipe.h
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
a10c46d8a6 radeonsi: update obsolete comments about compiler queues
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
cb7dcdcea0 radeonsi: handle draw user SGPRs as tracked registers
instead of this custom code doing the same thing. This tracks changes to LS,
ES, and VS user SGPRs separately, so that we can skip more redundant register
changes when enabling/disabling GS and tess. The perf impact should be neutral.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:06 +00:00
Marek Olšák
3f34bd5f3f radeonsi: cosmetic changes to radeon_opt_* macros
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:05 +00:00
Marek Olšák
a5b3165774 radeonsi: restructure the loop for non-indexed multi draws
Have one loop for increment_draw_id and another loop without it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:05 +00:00
Marek Olšák
c30aed0002 radeonsi: turn sh_base[PIPE_SHADER_VERTEX] into a constant in emit_draw_packets
HAS_TESS will also be used in the next commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
2023-08-17 15:34:05 +00:00
Jason Ekstrand
f34f740b64 spirv: Re-emit constants at their uses
Right now, spirv_to_nir places all constants at the top of the function
and has a hash table to de-duplicate them.  This change drops the hash
table and starts re-emitting constants more-or-less at their uses.  This
is more consistent with what we do in GLSL -> NIR translation.  It is,
however, a change to SPIR-V -> NIR translation which will likely affect
other optimizations in unexpected ways so it should be evaluated
separately.

This gives some good saves for spills/fills for Intel, without causing
any significant regressions on RADV, because it is using the
nir_opt_reuse_constants() pass.  In the long run that should be superseded
by some form of GCM.

```
Intel TGL results for Intel fossils:

Totals:
Instrs: 183287977 -> 183269431 (-0.01%); split: -0.07%, +0.06%
Cycles: 18224600804 -> 18223114114 (-0.01%); split: -0.16%, +0.15%
Spill count: 111031 -> 108377 (-2.39%); split: -2.45%, +0.06%
Fill count: 221781 -> 216479 (-2.39%); split: -2.39%, +0.00%
Scratch Memory Size: 4355072 -> 4180992 (-4.00%); split: -5.31%, +1.32%

Totals from 43684 (6.54% of 667704) affected shaders:
Instrs: 38289482 -> 38270936 (-0.05%); split: -0.33%, +0.28%
Cycles: 7166415272 -> 7164928582 (-0.02%); split: -0.40%, +0.38%
Spill count: 93747 -> 91093 (-2.83%); split: -2.90%, +0.07%
Fill count: 190943 -> 185641 (-2.78%); split: -2.78%, +0.00%
Scratch Memory Size: 3127296 -> 2953216 (-5.57%); split: -7.40%, +1.83%
```

```
RADV GFX1100 results for radv fossils:

Totals:
Instrs: 71623708 -> 71624667 (+0.00%); split: -0.00%, +0.01%
CodeSize: 369324312 -> 369334744 (+0.00%); split: -0.00%, +0.01%
SpillSGPRs: 13586 -> 13582 (-0.03%)
SpillVGPRs: 911 -> 910 (-0.11%); split: -0.55%, +0.44%
Latency: 632887831 -> 632880378 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 81674859 -> 81676684 (+0.00%); split: -0.00%, +0.01%
VClause: 1273752 -> 1273727 (-0.00%); split: -0.00%, +0.00%
SClause: 2409593 -> 2409078 (-0.02%); split: -0.02%, +0.00%
Copies: 4063579 -> 4064425 (+0.02%); split: -0.05%, +0.07%
Branches: 1196723 -> 1196720 (-0.00%); split: -0.00%, +0.00%

Totals from 16244 (12.17% of 133461) affected shaders:
Instrs: 31116807 -> 31117766 (+0.00%); split: -0.01%, +0.01%
CodeSize: 160316656 -> 160327088 (+0.01%); split: -0.01%, +0.01%
SpillSGPRs: 12270 -> 12266 (-0.03%)
SpillVGPRs: 835 -> 834 (-0.12%); split: -0.60%, +0.48%
Latency: 344388549 -> 344381096 (-0.00%); split: -0.01%, +0.00%
InvThroughput: 43043761 -> 43045586 (+0.00%); split: -0.01%, +0.01%
VClause: 433221 -> 433196 (-0.01%); split: -0.01%, +0.00%
SClause: 900825 -> 900310 (-0.06%); split: -0.06%, +0.00%
Copies: 1989000 -> 1989846 (+0.04%); split: -0.11%, +0.15%
Branches: 676625 -> 676622 (-0.00%); split: -0.00%, +0.00%
```

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5282>
2023-08-17 14:58:02 +00:00
Caio Oliveira
39e24082fc radv: Use nir_opt_reuse_constants()
Right now, this won't change much the shaders since most of the NIR constants
are reused in the NIR generated by SPIR-V, but will make radv resilient to
when that behavior change.

```
RADV GFX1100 results for radv fossils:

Totals:
Instrs: 71623585 -> 71623708 (+0.00%); split: -0.00%, +0.00%
CodeSize: 369326156 -> 369324312 (-0.00%); split: -0.00%, +0.00%
SpillSGPRs: 13576 -> 13586 (+0.07%)
Latency: 632889681 -> 632887831 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 81674616 -> 81674859 (+0.00%); split: -0.00%, +0.00%
SClause: 2409601 -> 2409593 (-0.00%); split: -0.00%, +0.00%
Copies: 4063438 -> 4063579 (+0.00%); split: -0.00%, +0.01%
Branches: 1196703 -> 1196723 (+0.00%)
PreSGPRs: 4242897 -> 4243061 (+0.00%); split: -0.00%, +0.00%
PreVGPRs: 3926739 -> 3926742 (+0.00%)

Totals from 217 (0.16% of 133461) affected shaders:
Instrs: 353567 -> 353690 (+0.03%); split: -0.04%, +0.07%
CodeSize: 1790200 -> 1788356 (-0.10%); split: -0.15%, +0.04%
SpillSGPRs: 8 -> 18 (+125.00%)
Latency: 5152817 -> 5150967 (-0.04%); split: -0.05%, +0.01%
InvThroughput: 664273 -> 664516 (+0.04%); split: -0.03%, +0.06%
SClause: 10164 -> 10156 (-0.08%); split: -0.10%, +0.02%
Copies: 24225 -> 24366 (+0.58%); split: -0.32%, +0.90%
Branches: 7116 -> 7136 (+0.28%)
PreSGPRs: 13351 -> 13515 (+1.23%); split: -0.16%, +1.39%
PreVGPRs: 11583 -> 11586 (+0.03%)
```

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5282>
2023-08-17 14:58:02 +00:00
Caio Oliveira
74746ac03a nir: Add nir_opt_reuse_constants()
Currently SPIR-V does pull all the NIR constants it creates into the
first block, but we plan to change that behavior to let those constants
be defined as they are used.

This pass was written to provide a fallback to the old behavior, it will
be used for radv to avoid regressions when performing the SPIR-V change.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5282>
2023-08-17 14:58:02 +00:00
Gert Wollny
d80392a6df r600: use correct cso pointer for fetch shader
Fixes: 76725452 (gallium: move vertex stride to CSO)

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9567

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24728>
2023-08-17 14:27:51 +00:00
David Heidelberg
9d442b459a ci/freedreno: handle disabling farm properly for each FD/Collabora farm
To acknowledge for disable freedreno or collabora farm, split definitions into:
 - google-* (a306, a530, a630)
 - collabora-* (a618, a660)

This let us control when jobs will run. This rules gets also used in zink.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24665>
2023-08-17 13:25:46 +00:00
David Heidelberg
e6928735e6 ci/freedreno: switch references, the farm-rules takes care about this
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24665>
2023-08-17 13:25:46 +00:00
David Heidelberg
e62527c2d0 ci/freedreno: the tag belongs to the apq8016 only
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24665>
2023-08-17 13:25:46 +00:00
David Heidelberg
bcf5288351 ci/zink: drop a630, which we currently have very low amount available
It's disabled anyway.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24665>
2023-08-17 13:25:46 +00:00
David Heidelberg
3a4bdf26e6 ci: remove LAVA prefix from variables which can be used also elsewhere
At least these two can be easily used in bare-metal or Labgrid setups.

Currently I already have MR for implementing these for Labgrid.

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24665>
2023-08-17 13:25:46 +00:00
Mike Blumenkrantz
8f3499bafc Revert "vk/wsi/x11: handle geometry updating more asynchronously"
This reverts commit 36d5b58317.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24742>
2023-08-17 12:52:35 +00:00
Karol Herbst
cc2f59d840 rusticl/kernel: optimize nir between lowering io and explicit types
This is required to get rid of unneeded memory operations, like direct
scratch stores/loads to the same location.

Fixes: 66c6061491 ("rusticl/kernel: get rid of initial function_temp type lowering")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24734>
2023-08-17 12:34:26 +00:00
Karol Herbst
91029b7e87 nouveau: take glsl_type ref unconditionally
Calling into tgsi_to_nir requires it, which we are running into with vdpau
and potential other state-trackers still handing us TGSIs over.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9481
Fixes: 5889c13fcd ("nv50,nvc0: Use ttn for tgsi shaders by default")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24740>
2023-08-17 12:12:56 +00:00
Eric Engestrom
51511892c6 ci: rename *.log to *.txt to work around gitlab bug
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24620>
2023-08-17 11:36:42 +00:00
Mike Blumenkrantz
0fb9064231 vk/graphics: fix CWE handling with DS3
VkPipelineColorBlendStateCreateInfo::attachmentCount cannot be used to
generate the CWE mask since it cannot be read if enough dynamic state is in use

instead just pass the max mask and let drivers figure it out

cc: mesa-stable

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24673>
2023-08-17 11:01:36 +00:00
Christian Gmeiner
e13bdbbd5b etnaviv: switch to float_to_ubyte(..)
The blob generates following values for e.g. this call.
  glBlendColor(0.002000f, 0.018000f, 0.030000f, 1.0)

  0xff010508, /*   [01424] PE.ALPHA_BLEND_COLOR := B=0x8,G=0x5,R=0x1,A=0xff */

etnaviv's etna_cfloat_to_uint8(..) creates different values.

  0.002000: 0x0
  0.018000: 0x4
  0.030000: 0x7

The same applies for the alpha reference value.

Lets drop this hand-rolled conversion helper to get the same values as
blob.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24727>
2023-08-17 09:42:20 +00:00
Tapani Pälli
98eecece9b anv: remove assert, size is asserted in the runtime
Otherwise gets hit on Android CTS tests.

Reported-by: Chris Spencer <spencercw@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24722>
2023-08-17 08:36:15 +00:00
Tapani Pälli
2cbe85e6a9 vulkan/runtime: change assert to match specification needs
Otherwise gets hit on Android CTS tests.

Reported-by: Chris Spencer <spencercw@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24722>
2023-08-17 08:36:15 +00:00
Marek Olšák
20d6bb2769 glthread: sync for VDPAU sync functions
They should sync according to the spec.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24528>
2023-08-17 04:53:37 +00:00
Helen Koike
3fe0cec4c1 ci: disable duplicated pipelines triggered by marge
When Marge rebases, it creates two pipelines, one in the author's account
due to the rebase and another one in the target account due to the merge
request event. Depending on the order they appear, Marge erroneously
check the author's pipeline, and since it doesn't have the rights to
start this pipeline, Marge fails to merge because it timed out (since the
pipeline never got run).

Fix this by disabling the author's pipeline (source of type "push") when
a merge request is open.

We only disable when the pipeline is triggered by marge to not affect
running ci_run_n_monitor.py script

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24730>
2023-08-17 03:45:39 +00:00
Eric Engestrom
9a2a0c6fa3 docs: add one more 23.1.x release
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24735>
2023-08-17 01:50:47 +00:00
Eric Engestrom
444bc03fa8 docs: update calendar for 23.1.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24735>
2023-08-17 01:50:47 +00:00
Eric Engestrom
42118a7504 docs: add sha256sum for 23.1.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24735>
2023-08-17 01:50:47 +00:00
Eric Engestrom
42ab34522f docs: add release notes for 23.1.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24735>
2023-08-17 01:50:47 +00:00
Emma Anholt
5a8672952a freedreno/a3-5xx: Don't try to emit ISAM for SSBO loads.
We don't emit tex descriptors for the SSBOs, so if we took this path we'd
fault.

Fixes: 75eb0d2891 ("freedreno/ir3: Allow isam for non-bindless ssbo loads")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24682>
2023-08-17 01:18:19 +00:00
Emma Anholt
408199236f ci/freedreno: Skip some tests on a5xx that destabilize other tests.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24682>
2023-08-17 01:18:19 +00:00
Konstantin Seurer
3aa3eb8ddd nir/opt_large_constants: Handle small float arrays
Handles small arrays of integer, positive floats.

RADV fossils:

Totals from 65 (0.05% of 131205) affected shaders:
Instrs: 30001 -> 29936 (-0.22%); split: -0.39%, +0.18%
CodeSize: 165676 -> 164996 (-0.41%); split: -0.53%, +0.12%
Latency: 126873 -> 127178 (+0.24%); split: -0.29%, +0.53%
InvThroughput: 26640 -> 26895 (+0.96%); split: -0.48%, +1.44%
VClause: 425 -> 371 (-12.71%)
SClause: 982 -> 981 (-0.10%); split: -0.92%, +0.81%
Copies: 2072 -> 1939 (-6.42%); split: -6.52%, +0.10%
PreVGPRs: 1553 -> 1537 (-1.03%)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9000>
2023-08-16 23:36:29 +00:00
Faith Ekstrand
e38522608f nir/opt_large_constants: Add Small constant handling
Adds handling for constant arrays that can be lowered to
'(imm >> bit_index) & bit_mask' instead of constant loads.

RADV fossils:

Totals from 70 (0.05% of 131205) affected shaders:
Instrs: 31441 -> 31260 (-0.58%); split: -0.59%, +0.02%
CodeSize: 172104 -> 170568 (-0.89%)
VGPRs: 2608 -> 2616 (+0.31%)
Latency: 296687 -> 280859 (-5.33%); split: -5.34%, +0.00%
InvThroughput: 65491 -> 65696 (+0.31%); split: -0.11%, +0.42%
VClause: 671 -> 646 (-3.73%)
SClause: 1014 -> 964 (-4.93%)
Copies: 1742 -> 1564 (-10.22%); split: -10.51%, +0.29%
PreSGPRs: 2039 -> 2036 (-0.15%)
PreVGPRs: 2014 -> 2017 (+0.15%)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9000>
2023-08-16 23:36:29 +00:00
Faith Ekstrand
8ec0fdf017 nir/large_constants: Add read/write_const_values helpers
The write helper is just pulling code we already have out into a helper
and flipping the order of the loop and the switch.  The read helper will
be useful in the next commit where we add small constant support.  This
keeps the two helpers right next to each other in the file where they're
easy to compare and we can ensure that they stay in sync.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9000>
2023-08-16 23:36:29 +00:00
Faith Ekstrand
7456ee0523 nir/large_constants: Use nir_component_mask_t
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9000>
2023-08-16 23:36:29 +00:00
Mohamed Ahmed
783d59eec1 nil: Add support for G8B8_G8R8_UNORM and B8G8_R8G8_UNORM
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24614>
2023-08-16 22:36:27 +00:00
Mohamed Ahmed
c7f109352d nvk: Enable MIDPOINT_CHROMA_SAMPLES_BIT for multi-planar formats only
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24614>
2023-08-16 22:36:27 +00:00
Mohamed Ahmed
b9801a3c08 nvk: Enable SEPARATE_RECONSTRUCTION_FILTER_BIT for multi-planar formats only
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24614>
2023-08-16 22:36:27 +00:00
Faith Ekstrand
4e2830c9ef nir: Clean up nir_op_is_vec() and its callers
The nir_op_is_vec() helper I added in 842338e2f0 ("nir: Add a
nir_op_is_vec helper") treats nir_op_mov as a vec even though the
semanitcs of the two are different.  In retrospect, this was a mistake
as the previous three fixup commits show.  This commit splits the helper
into two: nir_op_is_vec() and nir_op_is_vec_or_mov() and uses the
appropriate helper at each call site.  Hopefully, this rename will
encurage any future users of these helpers to think about nir_op_mov as
separate from nir_op_vecN and we can avoid these bugs.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
2023-08-16 21:42:30 +00:00
Faith Ekstrand
408929289a nir: Don't handle nir_op_mov in get_undef_mask in opt_undef
It's unnecessary because earlier parts of the pass will ensure that a
mov of undef is turned into an undef.  It's also wrong because
nir_op_mov has different semantics from nir_op_vecN when it comes to how
sources map to destination components.

Fixes: 5f26c21e62 ("nir: Expand opt_undef to handle undef channels in a store intrinsic")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
2023-08-16 21:42:30 +00:00
Faith Ekstrand
f9a17c6fef nir: Handle nir_op_mov properly in opt_shrink_vectors
If the opcode is a mov, it falls into the nir_alu_src_is_trivial_ssa
case, not the vec case.

Fixes: 94eff7ccd8 ("nir: shrink phi nodes in nir_opt_shrink_vectors")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
2023-08-16 21:42:30 +00:00
Faith Ekstrand
9bcc9597a5 nir: Fix nir_op_mov handling in nir_collect_src_uniforms
For mov we need to follow the swizzle for the destination component, not
grab swizzle[0] for some random source.

Fixes: a406fff78a ("nir/inline_uniforms: support vector uniform")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
2023-08-16 21:42:30 +00:00
Faith Ekstrand
87004fa701 nir: Rework nir_scalar_chase_movs a bit
The cases in the if are the same as the cases we're using for the early
break.  Just check the things and break if it's not a handleable case.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
2023-08-16 21:42:30 +00:00
Rhys Perry
cf796aa885 radv: vectorize scratch access
fossil-db (gfx1100):
Totals from 20 (0.01% of 133461) affected shaders:
Instrs: 49421 -> 49134 (-0.58%)
CodeSize: 251668 -> 249604 (-0.82%); split: -0.83%, +0.01%
Latency: 178126 -> 178412 (+0.16%); split: -0.16%, +0.32%
InvThroughput: 23565 -> 23646 (+0.34%); split: -0.05%, +0.39%
VClause: 957 -> 943 (-1.46%)
Copies: 5770 -> 5801 (+0.54%); split: -0.36%, +0.90%
PreVGPRs: 1368 -> 1359 (-0.66%)

Regressions seem to be a couple of cases of bad RA luck.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24350>
2023-08-16 19:11:26 +00:00
Rhys Perry
81641b0155 radv: vectorize RT stack access
fossil-db (gfx1100):
Totals from 10 (0.01% of 133461) affected shaders:
MaxWaves: 176 -> 174 (-1.14%)
Instrs: 39260 -> 38710 (-1.40%)
CodeSize: 202272 -> 197288 (-2.46%)
VGPRs: 888 -> 900 (+1.35%)
Latency: 82306 -> 81762 (-0.66%); split: -0.68%, +0.02%
InvThroughput: 11182 -> 11158 (-0.21%); split: -0.52%, +0.30%
VClause: 721 -> 700 (-2.91%)
SClause: 1147 -> 1148 (+0.09%); split: -0.17%, +0.26%
Copies: 3625 -> 3891 (+7.34%)
PreVGPRs: 819 -> 845 (+3.17%); split: -0.37%, +3.54%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24350>
2023-08-16 19:11:26 +00:00
Rhys Perry
6f315e6049 nir/opt_load_store_vectorize: support scratch access
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24350>
2023-08-16 19:11:26 +00:00
Rhys Perry
afb465013f nir/lower_shader_calls: fix align_offset
I don't think this does anything at the moment, because all accesses are
scalar aligned.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24350>
2023-08-16 19:11:26 +00:00
Rhys Perry
5a7efccdc3 radv/gfx11: re-enable 0001/1110 clear values
Since 87444bb7ab, vi_alpha_is_on_msb always
returned false here. The new version matches radeonsi.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24400>
2023-08-16 18:38:24 +00:00
Rhys Perry
19f73f8eb4 radv: support 128bpp comp-to-single with all colors
Previously, it was restricted to clear colors where R==G==B, but it seems
to work if that isn't the case.

This restriction was probably a leftover from before comp-to-single.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24400>
2023-08-16 18:38:24 +00:00
Rhys Perry
e2c7ce3719 radv: fix 128bpp comp-to-single clears
We were clearing GB to A, instead of R.

This fixes some red tinting in Overwatch 2 when shadow quality is set to
"Ultra".

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: 7451eb1d61 ("radv: implement DCC fast clears with comp-to-single")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9446
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24400>
2023-08-16 18:38:24 +00:00
Rhys Perry
405f3bf990 radv: disable 64-bit color attachments
These work in some circumstances (dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.input_output_float_16_to_64.scalar9_tessc),
but I'm not sure if they work in all, blending certainly doesn't work and
this probably wasn't intended in the first place.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: 01bd012edd ("amd: fix 64-bit integer color image clears")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24400>
2023-08-16 18:38:24 +00:00
Feng Jiang
ad40073e4e meson: Rename dri-vdpau.dyn to dri.dyn
File 'src/gallium/targets/dri-vdpau.dyn' is now shared by multiple
targets and not just VDPAU, so renamed it to 'dri.dyn' as suggested
by Marek Olšák.

Related link:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23177#note_2030493

Suggested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24569>
2023-08-16 16:57:54 +00:00
Emma Anholt
f0a362d5ba turnip: Move sysmem clears to the first subpass that uses them.
This is a partial fix for the case where
VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT and the aliased attachment clears
the attachment that was last used in a previous subpass (we have to move
the stores to the last used subpass, as well).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20994>
2023-08-16 16:02:51 +00:00
Emma Anholt
21334e3b53 turnip: Move gmem clears and loads to the first subpass that uses them.
This will help us share gmem space between attachments that aren't used at
the same time.  It's also a correctness fix for
VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT, because they're supposed to
happen at the first subpass using the attachment, not the start of the
renderpass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20994>
2023-08-16 16:02:51 +00:00
Emma Anholt
4cfd021e3f turnip: Save the renderpass's clear values in the cmdbuf state.
For delaying clears to subpass begin time, I needed to save these until
later.  Turns out this cleans up a good bit of threading these values all
through the command buffer setup.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20994>
2023-08-16 16:02:51 +00:00
Emma Anholt
139cc91697 turnip: Skip emitting empty CP_COND_REG_EXEC.
If we ended up emitting no code to be conditionally run, then drop the
whole conditional exec packet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20994>
2023-08-16 16:02:51 +00:00
Emma Anholt
c96b2cc511 turnip: Track the first/last subpass an attachment is used in.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20994>
2023-08-16 16:02:51 +00:00
Emma Anholt
fce10ddf0f vulkan/util: Make multialloc succeed with 0 allocations.
I wanted to use it for the attachments and clear values of a
vkCmdBeginRenderPass(), but both can be 0 count.  In that case, we would
end up with vk_default_alloc(0,0) because nothing had set the alignment,
and assertion fail instead of allocating 0 bytes.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20994>
2023-08-16 16:02:51 +00:00
Matt Turner
d142c845d0 Revert "intel/fs: only avoid SIMD32 if strictly inferior in throughput"
This reverts commit 6b494745be.

The logic is not entirely correct: the comparison is between two
static-analysis estimates of a dynamic system with variables that aren't
captured by the shader source, so using ">" will always have greater potential
to cause regressions whenever the performance difference between the two builds
is something not captured by the static model, no matter how much the model is
improved.

Reference: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9262
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24615>
2023-08-16 14:56:15 +00:00
Lionel Landwerlin
aebe584586 iris: ensure stalling pipe control before fast clear
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 87149cc545 ("blorp: update and move fast clear PIPE_CONTROLs to drivers")
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24718>
2023-08-16 13:59:46 +00:00
Christian Gmeiner
bd1d322107 etnaviv: fix null pointer dereference
Fixes: 734b15186b ("etnaviv: Stop passing around nir_dest")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24717>
2023-08-16 13:17:23 +00:00
Erik Faye-Lund
cff6c4d885 docs: upgrade bootstrap to 5.3.1
Bootstrap 5.3.1 is out, implementing the color fix we introduced to make
dark-mode more readable. So let's update to that, and drop our override.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24670>
2023-08-16 10:47:36 +00:00
Dor Askayo
daa1f789b5 nouveau: add exported GEM handles to the global list
Adding GEM handles to the global list is necessary to allow
maintaining a single reference count for handles that are shared
between multiple buffer objects.

Since exported handles can end up being shared with other buffer
objects, as in the case that drmPrimeHandleToFD() and gbm_bo_import()
are called externally to Mesa, they too must be added to the global
list.

Unfortunately, doing this properly requires a new libdrm API. Use
the best possible option for now.

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

Signed-off-by: Dor Askayo <dor.askayo@gmail.com>
Acked-by: Karol Herbst <git@karolherbst.de>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24648>
2023-08-16 10:28:22 +00:00
Andrew Randrianasulu
d7cc19363f nv50/ir: Remove few nvc0 specific defines from nv50-specific header.
Compile, and run-tested on nv92

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7259>
2023-08-16 10:11:45 +00:00
Karol Herbst
7f63d2ebdb nv50: fix code uploads bigger than 0x10000 bytes
The hardware has a max limit on how much data we can upload in one go via
the 2D engine. Just split the uploads up.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9571
Acked-by: M Henning <drawoc@darkrefraction.com>
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24706>
2023-08-16 09:50:33 +00:00
Qiang Yu
8e13736222 radeonsi: remove unused arg of get_tcs_tes_buffer_address
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Sigend-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:36:37 +08:00
Qiang Yu
0e97fe38b7 radeonsi: part mode standalone tcs support aco compile
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:36:37 +08:00
Qiang Yu
59f4504d05 radeonsi: add si_aco_build_shader_part
Now it only has tcs epilog build, will add more prolog/epilog to it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:36:37 +08:00
Qiang Yu
8631851b8f radeonsi: change si_fill_aco_options args
Prepare to be shared with prolog/epilog generation which
does not have si_shader param.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:29 +08:00
Qiang Yu
04aadb32ad radeonsi: add si_get_tcs_epilog_args
For shared with aco tcs epilog creation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:29 +08:00
Qiang Yu
8e0cff56f3 radeonsi: remove separate_prolog arg from prolog/epilog build
It's always true.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:28 +08:00
Qiang Yu
b744405aa2 radeonsi: extract si_llvm_build_shader_part
Prepare for aco code path.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:28 +08:00
Qiang Yu
e797bd78c9 radeonsi: fill part mode tcs aco shader info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:28 +08:00
Qiang Yu
ac867af099 radeonsi: share si_get_tcs_out_patch_stride with aco
Move it out of llvm to be shared with aco.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:28 +08:00
Qiang Yu
1001478a68 radeonsi: support upload multi part shader binary
Need to split shader binary into exec and data part, then combine
exec and data of all shader parts separately. So const data symbols
in code need to be relocated.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:28 +08:00
Qiang Yu
85c0f31099 radeonsi: add exec_size to shader binary
Used by aco binary to split exec code and const data when combine
multi part shader binary.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24443>
2023-08-16 11:25:28 +08:00
Qiang Yu
51a8479a51 aco: use semantic location as io temp index
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
4c7fdebf9b ac/nir/tess: move tess factor output out of control flow
For radeonsi aco compile which can't handle outputs without
nir_lower_io_to_temporaries().

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
4756388038 aco,radeonsi: save const addr to symbol
For radeonsi to relocation const data when combine multiple
shader parts to a single one. So the final shader binary will
begin with exec code of all parts then const data.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
facbd13df1 aco: skip scratch init when no scratch arg provide
epilog does not use scratch so has no scratch arg.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
d3333609e6 aco: don't emit s_endpgm for tcs with epilog
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
b41d3e42f7 aco: add tcs epilog generation for radeonsi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
a2484b20f9 aco: add pending_lds_access option for insert waitcnt
For tcs epilog to add p_barrier at the beginning to sync
main shader part tess factor LDS write.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
5cf6f4f9a7 aco: allow tcs with epilog to keep nir store output instruction
Used to same tess factor outputs.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
5d05ae5df0 aco: add tcs end regs for epilog usage
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
7c7062f8f9 aco: move jump to epilog out of ic_merged_wave_info
TCS may be wrapped with if/else when merged shader. Jump
to epilog or end with regs should not be inside it.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Qiang Yu
85d9646288 aco: add p_end_with_regs pseudo instruction
Used by radeonsi shader parts to pass args from one part to another.
It has variable number of operands to reserve fixed registers with
wanted value.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24442>
2023-08-16 02:27:45 +00:00
Julia Tatz
a3549d7f7a aux/trace: trace video_buffer method return vals
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
992ded3a3f aux/trace: unwrap refrence frames in picture_desc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
ac9c2689a6 aux/trace: wrap video_codec & video_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
a5279f1ec5 aux/trace: add context video methods
Preliminary support without wrapping video_codec or video_buffer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
ace894cff8 aux/trace: add screen video methods
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
9d1da9ec20 aux/trace: fix set_hw_atomic_buffers method name
Fixes: b2dc63ed8c ("aux/trace: Add pipe_context::set_hw_atomic_buffers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
713437b2fc aux/trace: move trace_sample_view logic
it's defined in tr_texture, so it makes sense and is more
re-usable to have it's logic there.
Also documented the magic number used for private refcounting

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:30 +00:00
Julia Tatz
9ff20e23fe aux/trace: deduplicate enum dump macro work
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:29 +00:00
Julia Tatz
87850734e7 aux/trace: skip multi-line comments in enums2names
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24482>
2023-08-16 00:11:29 +00:00
Julia Tatz
c4133a110d gallium/dri: fix dri2_from_names
`createImageFromNames` uses fourcc, not dri_image_formats

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8547
Fixes: 433ca3127a ("st/dri: replace format conversion functions with single mapping table")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24597>
2023-08-15 23:36:24 +00:00
José Roberto de Souza
f7e39c6f85 intel/isl: Remove Wa_22011186057
This is a ADL-P workaround of a pre-production stepping, with RPL-P
already being sold we can remove this workaround.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24699>
2023-08-15 18:47:36 +00:00
José Roberto de Souza
4c06c736c5 intel/isl: Remove unknown workaround
The way this workaround is implemented, it is being applied to all
gfx 12 platforms(TGL, ADL, RKL, RPL, DG1, DG2 and MTL) but it was
supposed to be fixed in TGL B0.
Unfortunately I did not found any workaround number that would match it.

But as all released platforms don't ship to customers with revision == 0
this workaround was never being applied and can be safely removed.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24699>
2023-08-15 18:47:36 +00:00
Faith Ekstrand
b64da56b1a nir: s/nir_instr_ssa_def/nir_instr_def/
Generated by sed:

    sed -i -e 's/nir_instr_ssa_def/nir_instr_def/g' src/**/*.h src/**/*.c src/**/*.cpp

Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24703>
2023-08-15 17:44:27 +00:00
Faith Ekstrand
43be4129d2 nir: s/live_ssa_def/live_def/
Generated mostly with sed:

    sed -i -e 's/live_ssa_def/live_def/g' src/compiler/nir/nir.h src/compiler/nir/*.c

Plus three fixups in various Intel drivers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24703>
2023-08-15 17:44:27 +00:00
Faith Ekstrand
b781dd6200 nir s/nir_get_ssa_scalar/nir_get_scalar/
Generated with sed:

    sed -i -e 's/nir_get_ssa_scalar/nir_get_scalar/g' src/**/*.h src/**/*.c src/**/*.cpp

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24703>
2023-08-15 17:44:27 +00:00
Faith Ekstrand
65b6ac8aa4 nir: Rename nir_instr_type_ssa_undef to nir_instr_type_undef
We already renamed the type, we just need to rename the enum and the
casting helper functions.

Generated with sed:

    sed -i -e 's/nir_instr_type_ssa_undef/nir_instr_type_undef/g' src/**/*.h src/**/*.c src/**/*.cpp
    sed -i -e 's/nir_instr_as_ssa_undef/nir_instr_as_undef/g' src/**/*.h src/**/*.c src/**/*.cpp

and two tiny whitespace fixups in lima.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24703>
2023-08-15 17:44:27 +00:00
Mike Blumenkrantz
252bff0f48 zink: use real A8_UNORM when possible
this is tricky because drivers are exposing their native support, but
that support may not fit the specific needs of the format

as such, (almost) every use of format where alpha emulation workarounds are
present now need to add a second layer of workarounds in order to handle
the case of possibly-genuine A8 (which might also be emulated A8 even if
the driver supports A8 for some things)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24685>
2023-08-15 16:42:27 +00:00
Mike Blumenkrantz
f501f9453a zink: use maintenance5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24685>
2023-08-15 16:42:27 +00:00
Mike Blumenkrantz
8be6b7caa3 zink: add maintenance extensions to profile
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24685>
2023-08-15 16:42:27 +00:00
Mike Blumenkrantz
d19e8fc1fb zink: split create_ici to init and eval
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24685>
2023-08-15 16:42:27 +00:00
Mike Blumenkrantz
4f8561369e zink: remove unused param from create_ici
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24685>
2023-08-15 16:42:27 +00:00
Alyssa Rosenzweig
eff5e18714 nir: Assert that nir_ssa_for_src components matches
In prep for removing the helper.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24654>
2023-08-15 11:59:03 -04:00
Alyssa Rosenzweig
8552311343 broadcom/compiler: Use nir_trim_vector explicitly
...when trying to ignore components. Trim functionality with nir_ssa_for_src is
deprecated.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24654>
2023-08-15 11:59:03 -04:00
Alyssa Rosenzweig
c182ab2b83 lvp,nir/lower_input_attachments: Use nir_trim_vector
Make the trimming obvious. We will lock down ssa_for_src soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24654>
2023-08-15 11:59:03 -04:00
Mike Blumenkrantz
88d753631c aux/trace: print bindless handles as pointers
this makes traces using bindless ops easier to read/diff

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24679>
2023-08-15 14:36:38 +00:00
Alyssa Rosenzweig
823827a295 panfrost: Pack stride at CSO create time on v9
Now that the stride is in the CSO, there's no merging needed at draw-time. The
whole descriptor could probably be uploaded at CSO create time but I didn't want
to deal with that right now, this isn't even my driver anymore I just like
deleting code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24680>
2023-08-15 13:27:58 +00:00
Sylvain Munaut
32675a304b mesa: Enable ARB_texture_border_clamp in GL Core
According to the GL3 spec, only the `CLAMP` mode was deprecated,
the `CLAMP_TO_EDGE` and `CLAMP_TO_BORDER_ARB` are not, so this
extension should be advertised.

As a side note, Davinci Resolve uses a Core profile and tests for
that extension so it fixes an issue with that app.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24660>
2023-08-15 12:46:56 +00:00
Mike Blumenkrantz
714362b7da zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
bc5ba7b7c4 zink: remove pipe_stream_output from function params
this is no longer used at all

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
3c7f50ba4d zink: stop using pipe_stream_output
nir_xfb_info is much cleaner and simpler to use

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
1abd507049 zink: delete all the extra gross xfb handling
xfb outputs should always be inlined into the base variables now,
so there's no need for anything further here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
01d3c691a5 zink: fix clip/cull dist xfb inlining
these are compact arrays which don't take up slots according to normal
array i/o sizing rules

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
235ae7c3c6 zink: delete lower_64bit_vertex_attribs pass
this is no longer useful

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
25fd1dfca3 zink: delete split_blocks pass
this is no longer useful

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:06 +00:00
Mike Blumenkrantz
f8cb0d8a44 ntt: handle interp intrinsics as derefs
this fixes usage_mask gathering for fs inputs

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:05 +00:00
Mike Blumenkrantz
aedebb9d30 zink: stop lowering indirect derefs
this is no longer necessary

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:05 +00:00
Mike Blumenkrantz
9e42553ca8 zink: use lowered io (kinda) for i/o vars
this runs io lowering on shader create, which is a huge pita
and waste of time since it requires then re-creating all the deref io later,
but it also makes the variables simpler by eliminating struct awfulness
(which was already eliminated by the split_blocks pass, but who's keeping
track) and will enable future use of some bizarro inter-stage linker thing

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:05 +00:00
Mike Blumenkrantz
0156058a3b zink: add a mode param to find_var_with_location_frac
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:05 +00:00
Mike Blumenkrantz
b0e4ecc032 zink: move fragcolor lowering further along the compile process
no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:05 +00:00
Mike Blumenkrantz
df238e8fc0 nir/zink: fix gs emulation xfb_info sizing
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24634>
2023-08-15 11:54:05 +00:00
David Heidelberg
fa5ebfbeb9 ci/freedreno: document another a530 flake batch
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24694>
2023-08-15 11:20:34 +00:00
Rhys Perry
c9b177db0e aco: don't create sendmsg(dealloc_vgprs) if scratch is used
LLVM does something similar: https://reviews.llvm.org/D153295

fossil-db (gfx1100):
Totals from 21 (0.02% of 133461) affected shaders:
Instrs: 147428 -> 147396 (-0.02%)
CodeSize: 797188 -> 797060 (-0.02%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 2930317cea ("aco/gfx11: deallocate VGPRs at the end of the shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24669>
2023-08-15 11:00:31 +00:00
Konstantin Seurer
a02b5138a7 radv/rt: Rename traversal_shader to traversal_shader_addr
It's more in line with shader_addr and uniform_shader_addr as well as
the user data name.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23565>
2023-08-15 11:11:16 +02:00
Konstantin Seurer
c291f612cb radv/rt: Rename shader_pc and next_shader
The names basically had the same meaning. Changing them to
uniform_shader_addr and shader_addr makes it clear, that
uniform_shader_addr is the jump target and shader_addr is the next
shader executed by this invocation.

The next_ prefix is dropped since both are input and output variables.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23565>
2023-08-15 11:11:16 +02:00
Italo Nicola
2edf222abd egl: reenable partial redraw with a warning when using gallium hud
Partial revert of e516a0a94f ("egl: disable partial redraw when gallium
hud is active").

We shouldn't change the behavior of the application when the hud is
enabled, doing so could make it harder do diagnose issues. Instead, now
we warn and ask the user to manually disable the extension if he
considers it to be worth it.

Fixes: e516a0a94f ("egl: disable partial redraw when gallium hud is active")
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23456>
2023-08-15 08:18:52 +00:00
Vinson Lee
d0f4333fca intel/decoder: Fix memory leak on error path
Fix defect reported by Coverity Scan.

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

Fixes: b4c8d2dc45 ("intel/decoder: Add intel_spec_load_common()")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24659>
2023-08-14 23:42:58 -07:00
Paul Gofman
6a2a36d7dd driconf: add a workaround for Captain Lycop: Invasion of the Heters
CC: mesa-stable

Tested-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24639>
2023-08-15 04:38:09 +00:00
Mike Blumenkrantz
210fe9f586 zink: drop CWE requirement for renderpass tracking with primgen queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
2023-08-15 01:31:42 +00:00
Mike Blumenkrantz
1bff8ade88 zink: rip out some awkward parts of the old non-cwe path
this is no longer used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
2023-08-15 01:31:42 +00:00
Mike Blumenkrantz
5536030735 zink: rework rast-discard for primgen queries
I originally used CWE for this case since it nicely avoids a lot of the
"complex" operations while still disabling most effects of a fragment shader

in theory, however, there are some cases where CWE isn't quite the same as actually
disabling the fs, so this adds a new rast-discard mode that can be used for
those cases

it can also be used instead of the dummy surface handling that was previously
used for drivers/hw that didn't support primitivesGeneratedQueryWithRasterizerDiscard,
which enables a bunch of gross conditionals to be simplified

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
2023-08-15 01:31:42 +00:00
Mike Blumenkrantz
4f743df4f0 zink: unset primgen suspended flag when ending a primgen query
this otherwise could result in rast-discard being permanently enabled
in certain corner cases

Fixes: 7f956435a0 ("zink: rework xfb queries for drivers with poor primgen support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
2023-08-15 01:31:41 +00:00
Mike Blumenkrantz
5ea5318e60 zink: require EDS1 for CWE usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
2023-08-15 01:31:41 +00:00
Mike Blumenkrantz
69cacebd29 zink: track start/stop of a couple query types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24676>
2023-08-15 01:31:41 +00:00
Faith Ekstrand
da5ca7529f gallivm: Drop the Vulkan YUV format hacks
Vulkan is now using the raw formats so we don't need this hack.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Mohamed Ahmed
4accbb27a2 vulkan/format: Translate G8B8G8R8_422_UNORM and B8G8R8G8_422_UNORM properly
They were being translated to YUYV and UYVY formats which, in
PIPE_FORMAT parlance, are auto-converted formats, not raw data
formats.  Use the raw data formats like everything else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Faith Ekstrand
eb23ce91b5 vulkan/format: Use correct swizzle for 1-plane YCbCr formats
VK_FORMAT_G8B8G8R8_422_UNORM and VK_FORMAT_B8G8R8G8_422_UNORM already
place the luminance channel in the green component which is where we NIR
lowering code for ycbcr expects it.  Set an RGBA swizzle in the common
format table and make it the driver's responsibility to re-map the
formats as needed for their hardware.

The only Vulkan drivers affected by this change are the Intel drivers
and lavapipe.  None of NVK, RADV, and v3dv support these formats yet and
Turnip has its own lowering that doesn't rely on the YCbCr format table
in util/vk_format.c.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Faith Ekstrand
b9870275b1 anv: Disable CCS_E for ISL_FORMAT_YCRCB_*
We're about to start using YCRCB_NORMAL and YCRCB_SWAPUV for 8-bit
interleaved YCbCr and, while ISL claims CCS_E support, it's not well
tested and we don't think it's working yet for all of ANV's use-cases.
Disable it for now in ANV and only for YUV formats.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Faith Ekstrand
0e33bb56a4 blorp: Use R8G8_UINT for YCRCB_* formats with CCS
BLORP uses the get_ccs_compatible_copy_format() based on whether or not
ISL claims the format supports CCS_E, not whether or not CCS_E is used
on the image.  This is probably a good thing as it improves consistency.
However, it means that we need CCS-compatible formats for YCRCB_*
formats even if we never use them with CCS_E enabled.  In practice,
these do actually seem to work according to the Vulkan CTS but coverage
is likely far less than perfect.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Faith Ekstrand
3fff38f624 gallivm: Support G8B8_G8R8_422_UNORM and B8G8_R8G8_422_UNORM
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Mohamed Ahmed
0c03d44093 util/format: Add G8B8_G8R8_422_UNORM and B8G8_R8G8_422_UNORM formats
These actually match the Vulkan format enums for single-plane YCbCr
formats, unlike the other PIPE_FORMAT_* enums which put luminance in the
red channel.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Faith Ekstrand
9a6ec6cdd6 util/format: 8-bit interleaved YUV formats are UNORM
Without this, gallivm doesn't know what to do with the result data of a
texture fetch.  We have a bunch of gallivm code to handle these but, as
far as I can tell, none of it works properly without channel types.  The
YUYV texturing helpers all consume a 32-bit packed value, unpack it,
shuffle things as needed, and then re-pack into a 32-bit RGBA value,
trusting later code to unpack that as 8-bit UNORM.  For the raw formats,
this unpacking never happens.

What saves us is that I also don't think any of this code is ever used.
LLVMpipe supports the actual YUYV formats and we don't use the gallium
lowering pass which lowers to the raw formats.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24619>
2023-08-14 23:44:19 +00:00
Jordan Justen
c1a0bdae1c intel/genxml: Update xml with gen_sort_tags.py output
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24605>
2023-08-14 23:09:36 +00:00
Jordan Justen
549540ca7c intel/genxml: Add final newline to output when saving xml
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24605>
2023-08-14 23:09:36 +00:00
Jordan Justen
548a0bc7d2 intel/genxml: Don't rewrite sorted xml if the contents didn't change
Rework:
 * Make better use of pathlib. (Dylan)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24605>
2023-08-14 23:09:36 +00:00
Jordan Justen
e60a0b1616 intel/genxml: Move sorting & writing into GenXml class
Rework:
 * Use "all" in is_equivalent_xml() (Dylan)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24605>
2023-08-14 23:09:36 +00:00
Italo Nicola
3176abc0f2 panfrost/ci: updated CI expectations
These tests were crashing because of a pandecode bug that's now been fixed.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24144>
2023-08-14 22:41:10 +00:00
Italo Nicola
56be9a55be pan/decode: handle more than one panfrost_device
Before this commit, if an application tried to create more than one
panfrost_device, such as piglit's "ext_image_dma_buf_import" tests,
it would result in a crash when running with PAN_MESA_DEBUG=sync or
PAN_MESA_DEBUG=trace.

This commit fixes that by introducing a pandecode_context, which
encapsulates all the information that is being tracked, and thus
avoiding memory conflicts.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24144>
2023-08-14 22:41:10 +00:00
Italo Nicola
cea0cc5b16 panfrost: fix invalid memory access in get_equation_str()
Fixes: f55efb4ae6 ("panfrost: Convert to PIPE_BLEND enums internally")
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24144>
2023-08-14 22:41:10 +00:00
Mike Blumenkrantz
bfa4125308 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24661>
2023-08-14 22:02:26 +00:00
Konstantin Seurer
f5c1da10f5 lavapipe/ci: Remove descriptor_indexing fails
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24661>
2023-08-14 22:02:26 +00:00
Konstantin Seurer
b2f6de8f0d gallivm: Run nir_convert_to_lcssa before nir_convert_from_ssa
Without loop exit phis, the code emitted by nir_lower_non_uniform_access
won't be lowered to registers. Therefore, all lanes will have the value
of the last iteration.

Fixes the remaining descriptor indexing fails:
dEQP-VK.descriptor_indexing.storage_texel_buffer
dEQP-VK.descriptor_indexing.storage_texel_buffer_after_bind
dEQP-VK.descriptor_indexing.storage_texel_buffer_after_bind_in_loop
dEQP-VK.descriptor_indexing.storage_texel_buffer_after_bind_in_loop_lifetime
dEQP-VK.descriptor_indexing.storage_texel_buffer_after_bind_lifetime
dEQP-VK.descriptor_indexing.storage_texel_buffer_in_loop
dEQP-VK.descriptor_indexing.storage_texel_buffer_in_loop_lifetime
dEQP-VK.descriptor_indexing.storage_texel_buffer_lifetime
dEQP-VK.descriptor_indexing.storage_texel_buffer_minNonUniform

cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24661>
2023-08-14 22:02:26 +00:00
Faith Ekstrand
4695bebc79 nir: Drop nir_dest
Instead, we replace every use of it with nir_def.  Most of this commit
was generated by sed:

   sed -i -e 's/dest.ssa/def/g' src/**/*.h src/**/*.c src/**/*.cpp

A few manual fixups were required in lima and the nir_legacy code.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
6c1d32581a nir: Drop nir_alu_dest
Instead, we replace it directly with nir_def.  We could replace it with
nir_dest but the next commit gets rid of that so this avoids unnecessary
churn.  Most of this commit was generated by sed:

   sed -i -e 's/dest.dest.ssa/def/g' src/**/*.h src/**/*.c src/**/*.cpp

There were a few manual fixups required in the nir_legacy.c and
nir_from_ssa.c as nir_legacy_reg and nir_parallel_copy_entry both have a
similar pattern.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
977999d836 nir: Get rid of nir_dest_is_divergent()
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
9d81f13a75 nir: Get rid of nir_dest_num_components()
We could add a nir_def_num_components() helper but we use
ssa.num_components about 3x as often as nir_dest_num_components() today
so that's a major Coccinelle refactor anyway and this doesn't make it
much worse.  Most of this commit was generated byt the following
semantic patch:

    @@
    expression D;
    @@

    <...
    -nir_dest_num_components(D)
    +D.ssa.num_components
    ...

Some manual fixup was needed, especially in cpp files where Coccinelle
tends to give up the moment it sees any interesting C++.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
80a1836d8b nir: Get rid of nir_dest_bit_size()
We could add a nir_def_bit_size() helper but we use ->bit_size about 3x
as often as nir_dest_bit_size() today so that's a major Coccinelle
refactor anyway and this doesn't make it much worse.  Most of this
commit was generated byt the following semantic patch:

    @@
    expression D;
    @@

    <...
    -nir_dest_bit_size(D)
    +D.ssa.bit_size
    ...

Some manual fixup was needed, especially in cpp files where Coccinelle
tends to give up the moment it sees any interesting C++.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
0dd76b1abb nir/print: Replace all dest printing with print_def
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
c7fb2228e6 nir/validate: Replace all dest validation with validate_def
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
b9e514d25b nir/propagate_invariant: Stop passing around nir_dest
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
c69eb8dfd7 nir/dce: Stop passing around nir_dest
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
cced401b0f nir/gather_types: Stop passing around nir_dest
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
2155634fb9 nv50/ir: Stop passing around nir_dest and nir_alu_dest
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
dd2178060d r600/sfn: Stop passing around nir_dest and nir_alu_dest
We want to get rid of nir_dest and nir_alu_dest so back-ends need to
stop storing it in structs and passing it through helpers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
734b15186b etnaviv: Stop passing around nir_dest
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
11af0c1f1b lima: Stop using nir_dest directly
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
9b4677981f nir,ntt,a2xx,lima: Stop using nir_dest directly
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
b30da1b281 vc4: Stop passing around nir_dest
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
f922ea7c07 broadcom: Stop using nir_dest directly
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
ce8b157b94 intel/fs: Stop passing around nir_dest and nir_alu_dest
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Faith Ekstrand
de5bc9128c intel/vec4: Stop passing around nir_dest
We want to get rid of nir_dest so back-ends need to stop storing it
in structs and passing it through helpers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Alyssa Rosenzweig
6b01d6a6b8 nir: Drop nir_dest_init
Unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:53 +00:00
Alyssa Rosenzweig
1deba364e1 dxil: Do not reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
262373541d ir3: Do not reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
b41676d7ed zink: Do not reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
dcdd9966c7 panfrost: Do not reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
02ddb7eae2 asahi: Do not reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
5aa38181cc pan/bi: Don't reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
08093a7dea pan/mdg: Don't reference nir_dest
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
d9786a48aa agx: Remove agx_nir_ssa_index
Deduplicated from agx_def_index.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Alyssa Rosenzweig
6f66f3583e agx: Stop passing nir_dest around
Towards deleting nir_dest.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
2023-08-14 21:22:52 +00:00
Konstantin Seurer
7cf9ff304e nir/from_ssa: Don't insert store_reg instructions before phis
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9528
Fixes: ae0408b ("nir/from_ssa: Support register intrinsics")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24647>
2023-08-14 19:27:19 +00:00
David Rosca
cbb28eaeaf gallium/auxiliary/vl: Set correct csc matrix in set_buffer_layer
Shaders used in set_buffer_layer will apply colorspace conversion,
so we need to set correct matrix depending on the input and output
surface formats.
Use BT.601 (default) for YUV to RGB and identity for RGB to RGB.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24626>
2023-08-14 18:18:16 +00:00
Mike Blumenkrantz
69fa48fbb1 lavapipe: handle VkBufferUsageFlags2KHR
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24633>
2023-08-14 17:56:23 +00:00
Mike Blumenkrantz
566e556478 lavapipe: handle VkPipelineCreateFlagBits2KHR
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24633>
2023-08-14 17:56:22 +00:00
David Heidelberg
5174cae8c2 ci/baremetal: shorten BM_KERNEL to filename and BM_DTB to name only
We don't need the path, not at all when we use external kernel.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24646>
2023-08-14 17:18:04 +00:00
David Heidelberg
795a099f38 ci/baremetal: do not install curl, it's already there
curl is already installed in these images, drop it.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24646>
2023-08-14 17:18:04 +00:00
Yonggang Luo
a93d7ec445 freedreno: Use shared DIV_ROUND_UP instead div_round_up
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24666>
2023-08-14 16:24:18 +00:00
Mike Blumenkrantz
581f6fb7c8 u/draw: skip zero-sized indirect draws
cc: mesa-stable

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24631>
2023-08-14 15:32:26 +00:00
Rhys Perry
efb80c1715 aco: summarize register demand after handling branches
Fixes various dEQP-VK.ray_query.builtin.rayqueryterminate.* crashes.

fossil-db (gfx1100):
Totals from 196 (0.15% of 133461) affected shaders:
PreSGPRs: 8342 -> 8558 (+2.59%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 5a536eca9c ("aco: calculate correct register demand for branch instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24579>
2023-08-14 15:08:37 +00:00
Sergi Blanch Torne
b882309e84 Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 0089d4507a

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24425>
2023-08-14 14:32:34 +00:00
Christian Gmeiner
83d7e327f9 etnaviv: switch to S_FIXED(..) macro
In different traces for different GPU models I see the same pattern:
    0x00c80000, /*   [00A00] PA.VIEWPORT_SCALE_X = 200.000000 */
    0xff880000, /*   [00A04] PA.VIEWPORT_SCALE_Y = -120.000000 */

etna_f32_to_fixp16(..) handles the negative case differently then blob. In the
concrete example -120 gets converted to 0xff880001. Switch to S_FIXED(..) to
simplify our code and to get the same results as blob.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
2023-08-14 14:10:15 +00:00
Christian Gmeiner
8bce68edf5 etnaviv: switch to U_FIXED(..) macro
Lets have a look at trace from blob (GC3000):
    0x000b000b, /*   [10080] NTE.SAMPLER[0].SIZE := WIDTH=11,HEIGHT=11 */
    0x2001b86e, /*   [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=3.437500,HEIGHT=3.437500,ASTC=0,INT_FILTER=1,SRGB=0 */

If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x2001b86e) we can see that 0x6e is used for WIDTH and HEIGHT.

Lets have a look at an other texutre size 180x180:
    0x00b400b4, /*   [10080] NTE.SAMPLER[0].SIZE := WIDTH=180,HEIGHT=180 */
    0x2003bcef, /*   [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=7.468750,HEIGHT=7.468750,ASTC=0,INT_FILTER=1,SRGB=0 */

Lets use the same test on a different GPU that uses texture descriptors (GC7000):
    [44] SIZE: 0x000b000b WIDTH=11,HEIGHT=11
    ...
    [74] LOG_SIZE_EXT: 0x03750375 WIDTH=3.457031,HEIGHT=3.457031

If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x03750375) we can see that 0x375 is used for WIDTH and HEIGHT.

Lets have a look at an other texutre size 180x180:
    [44] SIZE: 0x00b400b4 WIDTH=180,HEIGHT=180
    ..
    [74] LOG_SIZE_EXT: 0x077d077d WIDTH=7.488281,HEIGHT=7.488281

etnaviv creates the following values for the two texture sizes:
  11 -> 0x6f
  180 -> 0xf0

Lets switch to U_FIXED(..) which results in equal values.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
2023-08-14 14:10:15 +00:00
Christian Gmeiner
16915c7a71 etnaviv: switch to log2f(..)
Drop our custom calculation of the logarithm base 2 and switch
to log2f(..).

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
2023-08-14 14:10:15 +00:00
Mike Blumenkrantz
04dbb556c2 zink: fix crash in lower_pv_mode_gs_store
src->parent can be null

Fixes: 39770c6503 ("zink: fix store subsitution in `lower_pv_mode_gs_store`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24642>
2023-08-14 11:46:05 +00:00
Mike Blumenkrantz
198719de39 zink: fix null config screen creation
Fixes: 6d60115be7 ("zink: Fix enumerate devices when running compositor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24641>
2023-08-14 11:26:51 +00:00
Karol Herbst
e1c278ae82 clc: use CLANG_RESOURCE_DIR for clang's resource path
With certain build configuration that value can be a non empty string and
needs to be used.

This will also require distributions to rebuild mesa if and only if
CLANG_RESOURCE_DIR changes between clang rebuilds or updates.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23981>
2023-08-14 10:50:25 +00:00
Yonggang Luo
9d7a3f170b v3d: Use DIV_ROUND_UP instead div_round_up
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24485>
2023-08-14 10:27:44 +00:00
Lionel Landwerlin
7ec12b537a anv: don't try to access dynamic buffers from surface states
Even with direct descriptors, our current implementation works by
doing A64 messages to read/write dynamic buffers. This is so that we
can apply the sliding range view of the descriptor while having
robustness support.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 06dfd216d3 ("anv: add direct descriptor support to apply_layout")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24256>
2023-08-14 07:27:16 +00:00
Yonggang Luo
3e72539dc2 radv: Fixes mingw linkage error undefined reference to `radv_GetCalibratedTimestampsEXT'
message:
../../src/amd/vulkan/radv_sqtt.c:812: undefined reference to `radv_GetCalibratedTimestampsEXT'

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24664>
2023-08-14 15:00:56 +08:00
Sergi Blanch Torne
7006104d7e ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

* Start: 2023-08-14 08:00 BST (UTC+1)
* End: 2023-08-14 12:00 BST (UTC+1)

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24424>
2023-08-14 08:11:22 +02:00
Mike Blumenkrantz
7672545223 gallium: move vertex stride to CSO
this simplifies code in most place and enables some optimizations in
frontends

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>
2023-08-14 01:23:25 +00:00
Mike Blumenkrantz
29fd7bf603 nouveau: calloc vertex csos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>
2023-08-14 01:23:25 +00:00
Mike Blumenkrantz
ea09370204 virgl: fix some indentation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>
2023-08-14 01:23:25 +00:00
Mike Blumenkrantz
6984e524f4 virgl: move virgl_vertex_elements_state to header
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>
2023-08-14 01:23:25 +00:00
Mike Blumenkrantz
4eb4c9bba9 d3d10umd: use cso_context to set vertex buffers and elements
should be no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24117>
2023-08-14 01:23:25 +00:00
Faith Ekstrand
65cda2c0e1 nir: Drop nir_foreach_dest()
This requires an annoying bit of shuffling into nir_inline_helpers.h but
it's not horrible.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
95a3c1325d nir/from_ssa: Use nir_foreach_def() instead of nir_foreach_dest()
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
581ee2ccb4 dxil: Use nir_foreach_def() instead of nir_foreach_dest()
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
369270906b st,zink,sfn: Use nir_foreach_def instead of nir_foreach_dest
It's basically the same code in all three.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
6203750d78 nir: nir_foreach_ssa_def() -> nir_foreach_def()
s/nir_foreach_ssa_def/nir_foreach_def/g

followed by

    ninja -C _build clang-format

and a little hand clean-up in nir.c.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
0ec7b8455e nir: Drop nir_ssa_dest_init_for_type()
Replace it with a new nir_def_init_for_type()

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
6914272c30 nir: Drop nir_ssa_dest_init()
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
174a75631f nir/serialize: [De]serialize nir_def nor nir_dest
This both gets rid of its use of nir_ssa_dest_init() but also will make
it easier to mechanically remove nir_dest entirely later.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
9cd9115d87 nir/clone: Clone nir_def nor nir_dest
This both gets rid of its use of nir_ssa_dest_init() but also will make
it easier to mechanically remove nir_dest entirely later.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
d2c4749986 nir: Drop more instances of nir_ssa_dest_init()
Catching the cases that Coccinelle missed.  Mostly in C++ files using
gtest which causes Coccinelle to just give up and walk away.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
Faith Ekstrand
ed9affa02f nir: Drop most instances of nir_ssa_dest_init()
Generated using the following two semantic patches:

    @@
    expression I, J, NC, BS;
    @@

    -nir_ssa_dest_init(I, &J->dest, NC, BS);
    +nir_def_init(I, &J->dest.ssa, NC, BS);

    @@
    expression I, J, NC, BS;
    @@

    -nir_ssa_dest_init(I, &J->dest.dest, NC, BS);
    +nir_def_init(I, &J->dest.dest.ssa, NC, BS);

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
2023-08-13 17:12:52 +00:00
David Rosca
7bcbfae87c frontends/va: Ignore requested size when creating VAEncCodedBufferType
The buffer data is not directly accessible to application and it's
internally used to only store VACodedBufferSegment struct.
Ignore the size requested by application and instead allocate
sizeof(VACodedBufferSegment). Use calloc to zero out the struct.

This can save significant amount of memory, for example FFmpeg
will request up to tens of MB for single buffer.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6462

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24410>
2023-08-13 16:52:14 +00:00
Konstantin Seurer
040a0fcf42 lavapipe: Use common physical device properties
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24629>
2023-08-13 15:30:10 +00:00
Konstantin Seurer
e2a02f3910 clang-format: Disable formatting by default
This should make `git clang-format` usable for patches that modify
clang formatted and manually formatted code.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9492
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24645>
2023-08-13 16:48:49 +02:00
M Henning
47722b2d7f nvk: Remove reference to genUserClip
GL uses this for adding clip distances to shaders that are missing them,
but the vulkan spec guarantees "A shader must write a single clip distance
for each enabled clip half-space"

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24657>
2023-08-12 19:38:18 -04:00
Faith Ekstrand
0b9fee379d nvk: Don't use nir_ssa_for_src()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24655>
2023-08-12 23:10:54 +00:00
Alyssa Rosenzweig
09d31922de nir: Drop "SSA" from NIR language
Everything is SSA now.

   sed -e 's/nir_ssa_def/nir_def/g' \
       -e 's/nir_ssa_undef/nir_undef/g' \
       -e 's/nir_ssa_scalar/nir_scalar/g' \
       -e 's/nir_src_rewrite_ssa/nir_src_rewrite/g' \
       -e 's/nir_gather_ssa_types/nir_gather_types/g' \
       -i $(git grep -l nir | grep -v relnotes)

   git mv src/compiler/nir/nir_gather_ssa_types.c \
          src/compiler/nir/nir_gather_types.c

   ninja -C build/ clang-format
   cd src/compiler/nir && find *.c *.h -type f -exec clang-format -i \{} \;

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24585>
2023-08-12 16:44:41 -04:00
Faith Ekstrand
777d336b1f nir: clang-format src/compiler/nir/*.[ch]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
6fb63f369c nir: Add a .clang-format file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
0d9254204b nir: Add a do to the do/while in nir_const_value_t_array()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
bb8f143749 nir: Wrap pass macros in braces
This makes clang-format not mess them up so bad.  It's also probably a
good idea to make sure anything we declare in the macro is properly
scoped.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
7f6112302b nir: Pretty format type mapping helpers
One of them was even breaking after every return statement. Classy...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
59e5b51084 nir: More manual formatting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
57e10f7c93 nir: Don't clang-format debug print setup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
4d54b423e7 nir: Don't clang-format a couple typedefs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
8579224fe1 nir: Don't clang-format const_value helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
a89fb36f6b nir: Re-align a couple enums and add clang-format comments
I actually kinda care about the human-readable formatting of these
enums.  Keep clang-format from messing them up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
a6be819121 clang-format: Set the default ColumnLimit to 0
This is a better default than any actual limit because it causes
clang-format to mostly leave line wrapping alone.

Suggested-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
54680948a8 clang-format: nir_foreach_src is not a foreach macro
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Faith Ekstrand
fe5671e881 clang-format: Add nir_foreach_reg_*
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>
2023-08-12 19:27:28 +00:00
Roman Stratiienko
ee42e2166d android: Introduce the Android buffer info abstraction
Both EGL and Vulkan implementations require obtaining buffer metadata,
e.g., format, modifier, offsets, strides, etc.

Currently, mesa3d doesn't have a generic solution, and every Vulkan
implementation uses its getters. Most of the getters rely on
kernel metadata storage that is available for x86-based GPU drivers.

ARM-based Vulkan drivers rely on userspace metadata sharing, making it
important to use advanced metadata API. Otherwise, the driver will work
with limited functionality (no YUV, lack of support for modifiers, etc.)

Current EGL buffer getter implementation is advanced enough and used as
a base for a common Android buffer-getter logic.

Use example:

    void
    android_buffer_test(android_handle_type *a_handle)
    {
       // First, get the gralloc object. It will be created if it doesn't
       // exist. Use U_GRALLOC_TYPE_AUTO to let the implementation choose
       // the best gralloc
       struct u_gralloc *gralloc = u_gralloc_create(U_GRALLOC_TYPE_AUTO);

       // Prepare the internal handle structure (hal_format and
       // pixel_stride are required for the fallback implementation).
       // Both Vulkan and EGL clients expose HAL format / pixel stride
       // in their structures.
       u_gralloc_buffer_handle hnd = {
          .handle = a_handle->native_handle,
          .hal_format = a_handle->hal_format,
          .pixel_stride = a_handle->pixel_stride,
       };

       // Get the basic buffer info
       u_gralloc_buffer_basic_info basic_info;
       int ret = u_gralloc_get_buffer_basic_info(gralloc, &hnd, &basic_info);
       if (ret) {
          // Handle the error
       }

       // Get the color info
       u_gralloc_buffer_color_info color_info;
       ret = u_gralloc_get_buffer_color_info(gralloc, &hnd, &color_info);
       if (ret) {
          // Handle the error
       }

       // unref the gralloc object
       u_gralloc_destroy(&gralloc);
    }

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>
2023-08-12 18:46:57 +00:00
Roman Stratiienko
21dcde096f util: Add NONNULL macro
Macro leverages __attribute__((__nonnull__)) to help users mark
the function parameter that isn't allowed to be NULL.

Suggested-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>
2023-08-12 18:46:57 +00:00
David Heidelberg
9bf104f934 ci/deqp: really remove the uncompressed results.csv file
Arguments are parsed in order, so the `-c` here causes that first `--rm`
won't get applied and then it gets overriden by `-o` which writes the file.

Sadly zstd won't report this as a issue, but that's being reported in [1],
so maybe in future versions zstd will warn about it.

[1] https://github.com/facebook/zstd/issues/3719

Fixes: d110299d77 ("ci/deqp-runner: compress results.csv before uploading it to GitLab")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24651>
2023-08-12 19:32:34 +02:00
Lionel Landwerlin
7cc2f23d53 anv: move genX(rasterization_mode) to gfx8_cmd_buffer.c
Only used there.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>
2023-08-12 13:49:32 +00:00
Lionel Landwerlin
705840d417 anv: get rid of genX(emit_multisample)
The initialization can be simplified and the real programming moved
over to genX_pipeline.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>
2023-08-12 13:49:32 +00:00
Lionel Landwerlin
eef54f3175 intel/decoder: add options to decode surfaces/samplers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>
2023-08-12 13:49:32 +00:00
Lionel Landwerlin
cf5ee0a0f7 anv: emit 3DSTATE_GS only once per pipeline
Following 71ebd9b9d7, 3DSTATE_GS can be emitted as part of the
pipeline batch and as a dynamic state. Just do the latter.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 71ebd9b9d7 ("anv,hasvk: respect provoking vertex setting on geometry shaders")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>
2023-08-12 13:49:31 +00:00
Lionel Landwerlin
8689791e1f blorp: drop programming of 3DSTATE_(MESH|TASK)_SHADER
We can disable the MESH/TASK stages by just using the CONTROL
instruction and keep the rest of the HW programmed as before.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>
2023-08-12 13:49:31 +00:00
Lionel Landwerlin
22c7ccb523 intel/decoder: constify some input parameters
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>
2023-08-12 13:49:31 +00:00
David Heidelberg
9d45a25b80 ci/farms: enabled Microsoft job only when conditions are met
Otherwise it gets run by default on newly pushed fork branch.

In general, this is copy-paste of `.container-rules`.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24604>
2023-08-12 13:09:13 +00:00
antonino
19d318d88a zink/nir: add a zink specific intrinsic for push constants
Push costants in Zink are not flat indexed like in vulkan drivers which
makes the `nir_intrinsic_load_push_constant` intrinsic inappropiate.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24401>
2023-08-12 12:20:31 +00:00
antonino
333b6ef409 zink: remove unused indices from nir_load_push_constant calls
Zink passes `base` and `range` indices to this intrinsic despite those
being ignored by nir_to_spirv. This change removes them completely.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24401>
2023-08-12 12:20:31 +00:00
David Heidelberg
57b8b82d7d ci/freedreno: document vs-nested-return-sibling-loop2 flake on Adreno 530
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24607>
2023-08-12 13:35:24 +02:00
David Heidelberg
aee00062f4 ci/amd: add glx@glx-visuals-depth flake to raven
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24607>
2023-08-12 13:35:23 +02:00
David Heidelberg
17021f70f4 ci/build: limit debian-build-testing to 30 minutes
Previous 45 minutes is too much.

 - 5 - 15 minutes mesa LTO build
 - 5 - 15 minutes shader-db run

Should be safe, in case something fails, we still can make another run.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24607>
2023-08-12 13:35:23 +02:00
Georg Lehmann
9585689839 nir/opt_if: also rewrite uniform uses for read_invocation
No Foz-DB changes, but maybe it matters in the future because dxil-spirv
will use read_invocation for WaveReadLaneFirst in fragment shaders.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24618>
2023-08-12 07:16:28 +00:00
Samuel Pitoiset
ce0c70fb0c vulkan: ignore VkPipelineColorWriteCreateInfoEXT if the state is dynamic
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24601>
2023-08-11 23:38:55 +00:00
Erico Nunes
c43135d740 egl/drm: fix EGL_EXT_buffer_age with gbm contexts
Fix remaining dri2 check from 3d59f4cfcb, which caused gbm contexts to
not expose EGL_EXT_buffer_age anymore.

Fixes: 3d59f4cfcb ("egl/drm: Use IMAGE_DRIVER instead of DRI2_LOADER")

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24630>
2023-08-11 21:50:21 +00:00
Alyssa Rosenzweig
ae81eb9d50 asahi: Legalize compression before blitting
Fixes invalid recursive blitting.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
7ac6176ea5 agx: Do not allow creating vec8
mem_access_bit_size needs to split up 64x4 into 2 loads. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.64bit_compare.int64.comp_opiequal_vector

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
fd481d00d3 agx: Handle <32-bit local memory access
I don't know if this is possible to hit with GL, but it is with Vulkan. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.workgroup_memory.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
aeffd22c30 agx: Handle f2f16_rtne like f2f16
TBD whether we can control round modes later on.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
4002ba95bb agx: Lower f2f16_rtz
Based on what VIR does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
3634791baa agx: Fix 64-bit immediate moves
Don't truncate them in the builder. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.convertutof.uint64_to_float32_4294967296

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
4d0233cb1d agx: Fix uadd_sat packing
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
73657cd011 agx: Handle conversions to 8-bit
These can't be lowered by nir_lower_bit_sizes but it doesn't actually matter.
Fixes SPIR-V conversions tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
fa2a7cb2a8 agx: Lower f2u8/f2i8
The less 8-bit we need to emulate in the backend the better.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
b3ed5228b4 agx: Handle blocks with no predecessors
This can come up with loops with SPIR-V. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.loop_control.none

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Asahi Lina
c247de37bb asahi: Fix incorrect BO bitmap reallocations
If the BO handle is greater than 2x what fits inside the current bitmap
size, then we end up overflowing. Make sure to always reallocate to a
large enough bitmap, not just 2x the previous size.

Found while replaying firefox apitraces with looping (which apparently
leaks a ton of objects, but that might just be apitrace).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Asahi Lina
f1fedb72d3 asahi: Handle non-written RTs correctly
When a bound RT is not written to, we need to force the pass type to
translucent to ensure that this draw does not cull draws that do write
to that RT.

Fixes Inochi2D regression after c24b753378.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Mary
0f4e3a03fd agx: Move nir_lower_fragcolor out of agx_preprocess_nir
Do not apply "nir_lower_fragcolor" in the common code.

This fix a crash on agxv side when a frag shader have SSBO writes.

This is caused by "nir_lower_frag_color" assuming that every
"store_deref" will have a variable backing the
output.

Signed-off-by: Mary <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
3704caca0b agx: Stop setting forwarding bit
We need actual analysis to set it properly, and improperly setting it can cause
random data dependency hazards it turns out. Stop setting it. Fixes some flaky
tests with shuffle code inserted.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
09dfaf2c91 agx: Remove unused allocation
Relic from early RA attempts.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
ae440c9929 agx: Don't reuse ssa_to_reg across blocks
This avoids an entire class of bugs with live range splitting. Fixes with
AGX_MESA_DEBUG=demand:

   dEQP-GLES31.functional.separate_shader.random.8

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
d035908550 agx: Don't use ssa_to_reg across blocks
This is a footgun with live range spltiting.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
964a67fda4 agx: Assert invariant stated in the comment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
6909cb6379 agx: Use agx_replace_src
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
6447bf4cce agx: Stop setting registers after the shader
Leftover from before live range splitting. Should be a no-op.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
87121cf9a4 agx: Set phi sources in predecessors
This ensures correctness with live range splits. Now agx_set_sources is only for
non-phis where it makes sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
8cc96d64b0 agx: Fix accounting for phis
All affected shaders are in pubg. Presumably, with the new demand calculation,
RA is hitting a higher target thread count at the expense of a little more live
range splitting.

   total instructions in shared programs: 1773295 -> 1773310 (<.01%)
   instructions in affected programs: 6058 -> 6073 (0.25%)
   helped: 0
   HURT: 15
   Instructions are HURT.

   total bytes in shared programs: 11695360 -> 11695450 (<.01%)
   bytes in affected programs: 40496 -> 40586 (0.22%)
   helped: 0
   HURT: 15
   Bytes are HURT.

   total halfregs in shared programs: 530844 -> 530724 (-0.02%)
   halfregs in affected programs: 1785 -> 1665 (-6.72%)
   helped: 15
   HURT: 0
   Halfregs are helped.

   total threads in shared programs: 18909440 -> 18910400 (<.01%)
   threads in affected programs: 12480 -> 13440 (7.69%)
   helped: 15
   HURT: 0
   Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:28 +00:00
Alyssa Rosenzweig
d2224544d6 agx: Allow 64-bit memory regs
The mask is based on the format, which can be at most 32-bits per channel. So if
we have 64-bit loads/stores we're still using a 32-bit format with double the
bits set in the mask. This will fix validation fails with spilling.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
d0b966cb10 agx: Maintain ctx->max_reg while assigning regs
We can't calculate after since ssa_to_reg[] gets overwritten during live range
splits. Theoretical issue only, but let's fix it while squashing live range
splitting bugs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
b973e38214 agx: Fix AGX_MESA_DEBUG=demand
No wonder it seemed like it wasn't doing anything!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
135f3c35c5 agx: Optimize logical_end removal
We know logical_end instructions are only at the end of the block (validated),
so by changing how we iterate the pass goes from O(instructions) to O(blocks)
which is strictly better.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
d459de85b7 agx: Optimize swaps of 2x16 channels
We can use extr to swap the low and high halves of a 32-bit register in one
instruction.

No shader-db changes, but it reduces xor's on a deqp I'm looking at. Yes, I'm
procrastinating on debugging deqps, how'd you guess?

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
efbdc31ce5 agx: Use compressed fadd/fmul encodings
See applegpu commit b9b3582 ("FBinaryInstructions have compressed encodings")

   total bytes in shared programs: 11717310 -> 11716524 (<.01%)
   bytes in affected programs: 317504 -> 316718 (-0.25%)
   helped: 196
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
a30c668e44 agx: Require an immediate for nest
There's no good reason to allow non-immediate nesting values, and this lets us
use the (smaller) mov_imm instruction without special casing. This matches what
Metal produces, so it seems like a good preference.

   total bytes in shared programs: 11720338 -> 11717310 (-0.03%)
   bytes in affected programs: 2341580 -> 2338552 (-0.13%)
   helped: 1385
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
85d6f162ad agx: Fix length bit confusion
Man, this expression was wrong. First of all, raw is 64-bit so our mask needs to
be too. Second, length is in bytes -- not bits -- so we need to multiply by 8 to
get something sensible. In effect, the old wrong expression would always use the
long encoding for ALU instructions... whoops. This particular bug probably goes
back to the very first version of agx_pack...

Massive improvement in code density. Noticed while comparing assembly with the
blob. It's my Saturday, I can pointless optimize if I want to.

   total bytes in shared programs: 12175112 -> 11720338 (-3.74%)
   bytes in affected programs: 11963800 -> 11509026 (-3.80%)
   helped: 16624
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
e83b708676 agx: Optimize out pointless else instructions
Now that they're in the right blocks, this is easy. Includes an informal proof
and the implementation itself is built around a finite state machine, which
together meant this code worked on its first try :~)

And hey, it's a pointless little instruction saving optimization I've wanted to
do for a while~

Major note is that this HAS to be done after register allocation, since it
doesn't update the control flow graph and would introduce critical edges
if it tried to actually deleted the else block. The intuitive reason for this is
simple: sometimes RA needs to insert instructions into the else block, even if
it was empty in the original NIR, so we always need an else block even if we can
delete it with this pass after RA.

   total instructions in shared programs: 1778390 -> 1776725 (-0.09%)
   instructions in affected programs: 268459 -> 266794 (-0.62%)
   helped: 1013
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 12185102 -> 12175112 (-0.08%)
   bytes in affected programs: 1927524 -> 1917534 (-0.52%)
   helped: 1013
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
782055106f agx: Use unconditional else instruction
Rather than duplicating the condition. This matches the blob, so is presumably
the most energy-efficient way of expressing the logic.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
41b7891673 agx: Put else instructions in the right block
According to Dougall's pseudocode, else_icmp operates as:

  if r0l == 0:
    r0l = n
  elif r0l == 1:
    if cc.compare(A[thread], B[thread]):
      r0l = 0
    else:
      r0l = 1

  exec_mask[thread] = (r0l == 0)

Notice that the comparison only happens when r0l == 1, that is, for threads that
are about to enter the else block. Threads that just executed the if body are
still active (r0l = 0) and skip the comparison. As such, the sources of
else_icmp are only read in the else block, and hence the whole instruction
should be placed in the else block for correctness with respect to live range
splitting.

shader-db is a wash, but shows some improvements due to correctly modelling the
liveness of the condition variable.

   total instructions in shared programs: 1778376 -> 1778390 (<.01%)
   instructions in affected programs: 14753 -> 14767 (0.09%)
   helped: 35
   HURT: 39
   Inconclusive result (value mean confidence interval includes 0).

   total bytes in shared programs: 12185018 -> 12185102 (<.01%)
   bytes in affected programs: 101522 -> 101606 (0.08%)
   helped: 35
   HURT: 39
   Inconclusive result (value mean confidence interval includes 0).

   total halfregs in shared programs: 531174 -> 531032 (-0.03%)
   halfregs in affected programs: 2320 -> 2178 (-6.12%)
   helped: 40
   HURT: 1
   Halfregs are helped.

   total threads in shared programs: 18909184 -> 18909440 (<.01%)
   threads in affected programs: 1792 -> 2048 (14.29%)
   helped: 2
   HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
5196558204 agx: Do not move bindless handles
NIR->AGX translation relies on bindless handles being vec2 instructions with a
constant first index. Moving the entire vec2 into the preamble would mess this
up, so tell nir_opt_preamble to never do this. It's still allowed to move the
offset calculation into the preamble, if it thinks that's beneficial.

Fixes dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
c252120239 agx: Fix shader info with sample mask writes
Otherwise the discard_agx isn't lowered.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
c1e2200b70 asahi: Enable explicit coherency for G14D (multi-die)
It turns out we do need this explicit coherency dance for G14,
but only on G14D.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Janne Grunau
d6ee12a4d7 asahi,agx: Upload constant buffers immediately
The lifetime of the constant buffer's user_buffer is not guaranteed
to last until agx_upload_uniforms.
Fixes the same ASAN issue mesa/mesa!21685 is trying to address.

Fixes: 080b05e29e ("asahi: Add Gallium driver")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
f4fd4d4d50 agx: Fix atomics with no destination
We need to:

* properly null out the dest in DCE.
* not assert out when packing with null dest

Fixes potential reg pressure blow up with atomics that don't use their
destinations, though I don't see shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
9da8dc47f9 agx/dce: Use the helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
0d7b8bfce5 agx: Don't lower load_local_invocation_index
We have an SR for it, which can save a bit of math. This came up while working
on the spiller.

   total instructions in shared programs: 1778396 -> 1778376 (<.01%)
   instructions in affected programs: 3036 -> 3016 (-0.66%)
   helped: 10
   HURT: 3
   Instructions are helped.

   total bytes in shared programs: 12185182 -> 12185018 (<.01%)
   bytes in affected programs: 38640 -> 38476 (-0.42%)
   helped: 18
   HURT: 2
   Bytes are helped.

   total halfregs in shared programs: 531218 -> 531174 (<.01%)
   halfregs in affected programs: 471 -> 427 (-9.34%)
   helped: 6
   HURT: 0
   Halfregs are helped.

   total threads in shared programs: 18909056 -> 18909184 (<.01%)
   threads in affected programs: 1280 -> 1408 (10.00%)
   helped: 2
   HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Janne Grunau
3f8894b0f7 asahi,agx: Fix stack buffer overflow in agx_link_varyings_vs_fs
Discovered while running dEQP-EGL under address sanitizer.

Fixes: f3877f56ba ("asahi,agx: Rewrite varying linking")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
eafd35e458 asahi: Force linear for SHARED buffers with no/implicit modifier
Consumers might not pass through the modifier information in this case.

Fixes XWayland/mutter using dma-buf v4 feedback (though the fact they
try to use implicit modifiers is likely a bug on their end, and will
decrease performance).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
3e5d2f0c1b asahi,agx: Respect no16 even for I/O
Don't call lower_mediump_io for no16. This is helpful for debugging and soon
driconf-shaming apps with broken precision qualifiers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
721aa39ad9 asahi: Impose limits on resource shadowing
Apps can have pathological use cases where huge resources are shadowed
repeatedly. An app that alternately writes to a resource and then uses
it to draw can create an unbounded amount of shadow BOs.

To fix this, introduce both a maximum resource size for shadowing, and a
maximum cumulative size that resource may be shadowed before we start
flushing readers. The flush path then clears the counter, as does the
happy path where there are no readers left after flushing writers.

Fixes massive memory bloating in Firefox and probably others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
9d668f87d3 asahi: Print info about shadowed resources
If resource and perf debugging are both enabled, this prints resource
info for shadowed resources.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
ccbd125468 asahi: Always use resource size, not BO size
BOs can be oversized, as they can come from the BO cache. Make sure to
always use the resource layout size, not the BO size, when we need this
for some reason.

This fixes BO shadowing creating overlarge BOs, and also the attachment
size for submissions (probably doesn't matter, but it's more correct now).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
f8f4f466f7 asahi: Fix race in BO stats accounting
These counters are accessed without locking, so they need to be atomic.
Should be cosmetic only.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
9762c55589 asahi: Do not overallocate BOs by more than 2x
This is not likely to be useful, and might take over a correctly-sized
BO that is going to be reused later.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Asahi Lina
175e02baed asahi: Add a noshadow debug flag
This lets us trivially test whether resource shadowing helps or hurts
any given workload.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
5f3d784c6c agx: Handle 8-bit vecs
These should "just" work, promoting the 8-bit channels to 16-bit registers
internally, allowing us to use our 8-bit stores with 8-bit data vectors packed
in 16-bit registers. All other non-conversion ALU gets lowered by the previous
patch, this is just needed for simple things like nir_op_vec of lowered math
passed to a vectorized store.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
c3b86bcbbc agx: Lower 8-bit ALU
No hardware support for it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
aeac45c188 asahi: Move a bunch of helpers to common
These have no real Vulkan or Gallium dependence and are (as such) useful for
both VK and GL without any real change in level of abstraction. Do the code
motion.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
Alyssa Rosenzweig
e5f76821f1 asahi: Stub num_dies
We'll use it in the upstreamable driver portion soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>
2023-08-11 20:31:27 +00:00
George Ouzounoudis
41d094c2cc nvk: Support dynamic state for enabling sample locations
When switching dynamically we should also push the corresponding sample
locations, the default when disabled or the custom ones when enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24592>
2023-08-11 19:27:24 +00:00
George Ouzounoudis
2de545c68f nvk: Fix support for VK_EXT_sample_locations
Fixes some crashes on sample locations pipeline tests.
The implementation was already there but the device properties were
missing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24592>
2023-08-11 19:27:24 +00:00
Italo Nicola
2dc883eb37 gallium/st: lower NV21 to R8_B8G8 instead of G8_B8R8
When NV21 lowering with hardware sampling and shader CSC was added, the
incorrect PIPE_FORMAT_G8_B8R8_UNORM was used. That format is supposed to
represent vulkan NV12 instead.

This commit introduces PIPE_FORMAT_R8_B8G8_UNORM, which correctly describes the
gallium mapping for YUV CSC, with R as Y, instead of G as Y.

Fixes: 26e3be513d ("gallium/st: add support for PIPE_FORMAT_NV21 and PIPE_FORMAT_G8_B8R8_420")
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24266>
2023-08-11 18:43:38 +00:00
Italo Nicola
4eb0a98e5a pan/bi: add support for I420 and YV12 sampling
These formats can be directly sampled, and they have a lower stride
alignment requirement.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24266>
2023-08-11 18:43:38 +00:00
Italo Nicola
b890a5ff61 gallium/st: add non-CSC lowering of YV12 as PIPE_FORMAT_R8_B8_G8_420
YV12 is the same as DRM_FORMAT_YVU420.
We lower it to PIPE_FORMAT_R8_B8_G8_420, which is equivalent to
PIPE_FORMAT_R8_G8_B8_420 with U/V planes swapped.

This is used for hardware that can sample from YUV but need CSC in shader.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24266>
2023-08-11 18:43:38 +00:00
Italo Nicola
60ebef430a gallium/st: add non-CSC lowering of I420 as PIPE_FORMAT_R8_G8_B8_420
This new format is similar to PIPE_FORMAT_G8_B8_R8_420, but with R as Y, G as U
and B as V. The need for two diferent formats here is because gallium maps the
YUV channels differently from vulkan.

Some hardware, e.g. Mali GPUs, can sample from I420 but need CSC in shader,
this patch implements that.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24266>
2023-08-11 18:43:38 +00:00
David Rosca
06495f11da radeonsi/vcn: Update rate control when framerate changes with HEVC
Similar to H264/AV1, check for framerate changes and update
rate control also with HEVC.

Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24475>
2023-08-11 17:47:43 +00:00
Georg Lehmann
c4f356faf4 aco: always use rtne for fquantize2f16
The SPIR-V spec says:

If Value is positive with a magnitude too large to represent as a
16-bit floating-point value, the result is positive infinity.
If Value is negative with a magnitude too large to represent as a
16-bit floating-point value, the result is negative infinity.

This is only the case for rtne v_cvt_f16_f32

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24617>
2023-08-11 12:37:23 +00:00
Alyssa Rosenzweig
144546f434 agx: Lower flat shading in NIR
We get this as part of the lowering we added for interpolateAtOffset.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:12 +00:00
Alyssa Rosenzweig
ff0e25d293 agx: Add interpolateAtOffset lowering pass
Add a lowering pass that lowers interpolation to math on the coefficient
registers. This handles interpolateAtOffset, as well as flat shading as an easy
special case.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:11 +00:00
Alyssa Rosenzweig
48029548f3 agx: Forcibly vectorize pointcoord coeffs
This avoids regressions from scalarizing pointcoord loads.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:11 +00:00
Alyssa Rosenzweig
52b8d31548 agx: Set lower_fisnormal
We're going to generate this in our interpolation lower.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:11 +00:00
Alyssa Rosenzweig
5577aebfb2 agx: Allow more varying slots
Don't overflow.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:11 +00:00
Alyssa Rosenzweig
22f694c008 agx: Implement nir_intrinsic_load_coefficients_agx
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:11 +00:00
Alyssa Rosenzweig
10cdc0ad9f nir: Add load_coefficients_agx intrinsic
For lowering interpolation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24498>
2023-08-11 09:50:11 +00:00
Mike Blumenkrantz
e9a5da2f4b nir: add a filter cb to lower_io_to_scalar
this is useful for drivers that want to do selective scalarization
of io

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24565>
2023-08-11 09:02:53 +00:00
Mike Blumenkrantz
550f3dc437 nir/lower_io: add a new doubles-only 64bit lowering option
this allows lowering only 64bit float operations for drivers that
support 64bit integers

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24565>
2023-08-11 09:02:53 +00:00
Vitaliy Triang3l Kuzmin
933e6e4751 r600/asm: Make sure MOVA and SET_CF_IDX are in the same clause
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24545>
2023-08-11 08:04:05 +00:00
Vitaliy Triang3l Kuzmin
99c8d15c67 r600/asm: Fix AR force_add_cf setting if a clause is not open
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24545>
2023-08-11 08:04:05 +00:00
Samuel Pitoiset
b34c027cb0 radv: use the number of VS outputs for computing the tessellation info
When TCS isn't linked with VS, the vertex stride should be computed
from vertex outputs. This is only for shader object and shouldn't
change anything right now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24540>
2023-08-11 07:43:58 +00:00
Samuel Pitoiset
8a97302f57 radv: add support for loading the LSHS vertex stride from a SGPR
With shader object, if VS and TCS aren't linked together, the LSHS
vertex stride should be computed from the vertex outputs. Otherwise,
if an output is unused, the stride is wrong in TCS.

This is currently for GFX8 only because for merged shaders this won't
be needed but shader object on GFX9+ isn't yet a thing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24540>
2023-08-11 07:43:58 +00:00
Tapani Pälli
0cb88ddca2 iris: implement required PSS sync for Wa_18019816803
According to WA description, we need to track DS write state
and emit a PSS_STALL_SYNC whenever that state changes.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18411>
2023-08-11 07:15:49 +00:00
Tapani Pälli
92941ee84b anv: implement required PSS sync for Wa_18019816803
According to WA description, we need to track DS write state
and emit a PSS_STALL_SYNC whenever that state changes.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18411>
2023-08-11 07:15:48 +00:00
Tapani Pälli
419531c5d9 intel/blorp: add a new flag to communicate PSS sync need
This is required for Wa_18019816803 when blorp emit DS state.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18411>
2023-08-11 07:15:48 +00:00
Yogesh Mohan Marimuthu
973e6f3be0 gallium: remove start_slot parameter from pipe_context::set_vertex_buffers
This patch removes start_slot from set_vertex_buffers() as suggested in
https://gitlab.freedesktop.org/mesa/mesa/-/issues/8142

compilation testing:
all gallium drivers, nine frontend compilation has been tested.
d3d10umd compilation has not been tested

driver, frontend testing:
only llvmpipe and radeonsi driver was tested running game

only the nine frontend changes are complex. All other changes are easy.
nine front end was using start slot and also using multi context.

nine frontend code changes:
In update_vertex_elements() and update_vertex_buffers(), the vertex
buffers or streams are ordered removing the holes. In update_vertex_elements()
the vertex_buffer_index is updated for pipe driver to match the ordered list.

v2: remove start_slot usage code from Marek (Marek Olšák)
v3: nine stream number holes mask code from Axel (Axel Davy)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> (except nine, which is Ab)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22436>
2023-08-11 06:37:22 +00:00
Dave Airlie
e0da62c0e9 nvk: NOUVEAU_WS_BO_LOCAL is a trap.
This flag isn't a flag, don't be & at it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24625>
2023-08-11 06:20:01 +00:00
Faith Ekstrand
9f767db126 nv50/ir: Rework conversions for texture array indices
Currently, negative array texture indices get saturated to 0 which,
while technically in-bounds, isn't what we want for Vulkan with image
robustness or robustness2.  Vulkan requires that a negative index on a
texelFetch() count as out-of-bounds but a negative index on any other
texture operation gets clamped to 0.  (See the spec section entitled
"(u,v,w,a) to (i,j,k,l,n) Transformation And Array Layer Selection").

Instead of using CVT for TXF, we now take U32 MAX with 0xffff. Because
it's unsigned, this ensures that negative array indices clamp to 0xffff
and will be considered out-of-bounds by the hardware (there are a
maximum of 2048 array indices in an image descriptor).  For everything
other than TXF, we keep using an F32->U16 conversion but add a saturate.
This ensures that negative array indices clamp to 0 as per the Vulkan
spec.  Very large indices will clamp to 0xffff which the hardware will
clamp to the maximum array index.

This fixes 324 tests in the dEQP-VK.robustness.* group, all those for 1D
and 2D array textures

Acked-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24593>
2023-08-11 06:02:23 +00:00
Mike Blumenkrantz
585f0e8b48 nir: minor fixes for io_to_scalar
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24613>
2023-08-11 05:14:00 +00:00
Mike Blumenkrantz
0a12cedec9 zink: add a special separate shader i/o mode for legacy variables
ARB shaders have no rules restricting i/o interfaces since it's assumed
that they'll match by name. given that mesa marks these all as separate
shaders, a separate path is needed to ensure these variables correctly
match up their i/o even when it's mismatched

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24608>
2023-08-11 04:44:46 +00:00
Mike Blumenkrantz
b24911e5db zink: pre-convert mode in fixup_io_locations
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24608>
2023-08-11 04:44:46 +00:00
Faith Ekstrand
52c57667ed nvk: Use common physical device properties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24575>
2023-08-11 02:53:47 +00:00
Konstantin Seurer
c06f70ca18 radv: Use common physical device properties
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24575>
2023-08-11 02:53:47 +00:00
Konstantin Seurer
eaee792ea5 vulkan: Add a generated vk_properties struct
Generates a physical device properties table to avoid dealing with pNext
chains in the driver. Based on vk_features.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24575>
2023-08-11 02:53:47 +00:00
Eric Engestrom
0ab0e5d803 ci/a530: document piglit flake
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/47086976

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24622>
2023-08-11 01:19:27 +00:00
Derek Foreman
5ba5bcf2b6 vulkan/wsi: Allow binding presentation_timing when software rendering
The presentation timing extension is used for doing WaitForPresent
properly, but we accidentally bind it after an early return intended to
stop us from binding dmabuf when software rendering.

Remove the early return.

cc: mesa-stable

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24588>
2023-08-11 00:35:37 +00:00
Eric Engestrom
54c7099087 panfrost: upcast uint8/uint16 before shifting them beyond their range
../src/panfrost/compiler/compiler.h:89:14: runtime error: left shift of 51966 by 16 places cannot be represented in type 'int'
        #0 0x55c72fd7dda4 in bi_apply_swizzle ../src/panfrost/compiler/compiler.h:89
        #1 0x55c72fd808d6 in bi_source_value ../src/panfrost/compiler/bi_opt_constant_fold.c:35
        #2 0x55c72fd80a83 in bi_fold_constant ../src/panfrost/compiler/bi_opt_constant_fold.c:52
        #3 0x55c72fb2080c in constant_fold_pred ../src/panfrost/compiler/test/test-constant-fold.cpp:48
        #4 0x55c72fb21a65 in ConstantFold_Swizzles_Test::TestBody() ../src/panfrost/compiler/test/test-constant-fold.cpp:103
        #5 0x55c73070cc97 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../src/gtest/src/gtest.cc:2621
        #6 0x55c7306f0df7 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../src/gtest/src/gtest.cc:2657
        #7 0x55c730694add in testing::Test::Run() ../src/gtest/src/gtest.cc:2696
        #8 0x55c73069798d in testing::TestInfo::Run() ../src/gtest/src/gtest.cc:2845
        #9 0x55c73069b684 in testing::TestSuite::Run() ../src/gtest/src/gtest.cc:3004
        #10 0x55c7306ccfcb in testing::internal::UnitTestImpl::RunAllTests() ../src/gtest/src/gtest.cc:5890
        #11 0x55c73071053c in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../src/gtest/src/gtest.cc:2621
        #12 0x55c7306f4ed3 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../src/gtest/src/gtest.cc:2657
        #13 0x55c7306c23fa in testing::UnitTest::Run() ../src/gtest/src/gtest.cc:5455
        #14 0x55c730748faf in RUN_ALL_TESTS() ../src/gtest/include/gtest/gtest.h:2314
        #15 0x55c730748ffa in main ../src/gtest/src/gtest_main.cc:63
        #16 0x7f8554bcc1c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
        #17 0x7f8554bcc284 in __libc_start_main_impl ../csu/libc-start.c:360
        #18 0x55c72fb18be0 in _start (/builds/mesa/mesa/_build/src/panfrost/compiler/bifrost_tests+0xbd0be0)

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24610>
2023-08-10 23:14:12 +00:00
Eric Engestrom
90a6ebdf80 amd/ci: drop duplicate test expectations
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24612>
2023-08-10 22:35:51 +00:00
Chia-I Wu
85e74944c6 winsys/amdgpu: fix a race between import and destroy
amdgpu_bo_destroy is called when the bo ref count reaches 0.  But if the
bo is on bo_export_table, amdgpu_bo_from_handle can race with
amdgpu_bo_destroy and increments the bo ref count.  When that happens,
amdgpu_bo_destroy should bail.

v2:
 - reorder amdgpu_bo_free and amdgpu_bo_unmap
 - fix an assert

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24526>
2023-08-10 21:47:58 +00:00
Gert Wollny
17c95e070c r600/sfn: work around injecting extra CF's to handle hardware bugs
The clause local registers can't be used if a new CF is started, but
the assembler still may introduce a CFs to work around some hardware bug,
so make sure RA doesn't assume that the predicate ALU op is in the same ALU
CF like the ALU ops before.

This is a hotfix, the scheduler should handle this better.

Fixes:  cfbd1fd413
    r600/sfn: Use clause local registers in RA

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24611>
2023-08-10 18:21:12 +00:00
Friedrich Vock
b8edd19358 radv: Handle VK_SUBOPTIMAL_KHR in trace layers
vkQueuePresentKHR might return VK_SUBOPTIMAL_KHR which is not VK_SUCCESS
but presentation succeeded anyway. We should capture a trace even if
VK_SUBOPTIMAL_KHR is returned.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24052>
2023-08-10 17:39:07 +00:00
Eric Engestrom
de6d298fd0 ci/zink+radv: set a timeout of 2x the normal runtime
Normal runtime for both zink-radv-vangogh-valve and zink-radv-navi10-valve
is ~10min, so let's double that as our timeout.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24602>
2023-08-10 17:12:02 +00:00
Nanley Chery
9da56a3698 iris: Inline iris_can_sample_mcs_with_clear
Now that there's only one user, inline the function.

While we're here, update the stale comment about unknown sampling
formats causing us to implement a simplified workaround.  We've had
visibility into the formats that blorp_copy will use for some time now.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24446>
2023-08-10 16:21:28 +00:00
Nanley Chery
1d1dbbd03f iris: Drop get_copy_region_aux_settings
With the previous commit, it is no longer used.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24446>
2023-08-10 16:21:28 +00:00
Nanley Chery
60aebe8fa8 iris: Fix iris_copy_region calls involving FCV_CCS_E
iris_copy_region improperly handles destinations that have
ISL_AUX_USAGE_FCV_CCS_E in use. To avoid corruption when copying to a
resource which has this aux usage, this function needs to:

   1. Remove existing fast-clear blocks that would be incompatible with
      the surface format that will be used by blorp_copy.

      This is actually a general rendering requirement that affects more
      aux usages than just FCV_CCS_E.

   2. Either avoid generating new fast-clear blocks that would be
      incompatible with the original surface format, or remove the newly
      generated incompatible fast-clear blocks.

      This is particular to FCV_CCS_E, which sometimes generates
      fast-clear blocks during a rendering operation. The generation is
      dependent on the surface format, the clear color, and the pixels
      being written.

iris_copy_region does step 1, only allowing fast-clear blocks that
represent the value of zero. These are compatible with every surface
format. This function does not do step 2 however, leading to rendering
corruption in certain cases.

Fix this by generally relying more on the standard resource preparation
functions, which account for this issue. Specifically, by using
iris_resource_prepare_render, steps 1 and 2 are both handled for us.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3732
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24446>
2023-08-10 16:21:28 +00:00
Nanley Chery
3acdb29332 iris: Fix aux usage tracking in prepare_render
When a resource goes from being accessed with one aux usage to another,
iris_resource_prepare_access will flush the appropriate caches to
prevent rendering/sampling corruption. So, we must be careful to call
the prepare access function with the aux usage that will match the next
memory access of the resource.

iris_resource_prepare_render fails to do this because it sometimes calls
the prepare access function with the resource's aux usage after calling
that same function with the aux usage that will be used in the next
memory access.

Fix this by reversing the order of the prepare access function calls.

Fixes: 046bba0be0 ("iris: Handle clear color compatibility in prepare_render")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24446>
2023-08-10 16:21:28 +00:00
Matt Coster
abc0b3a0dd pvr: Add VK_KHR_copy_commands2
We already expose the *2() functions and allow the common vulkan code
to provide the vulkan 1.0 equivalents, so we might as well expose this
extension.

Coverage in dEQP is dEQP-VK.api.copy_and_blit.copy_commands2.*, which
are mostly identical to dEQP-VK.api.copy_and_blit.core.* without
additional extensions.

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/24489>
2023-08-10 15:38:38 +00:00
Matt Coster
3c6356493a pvr: Print VkStructureType name on pvr_debug_ignored_stype()
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/24489>
2023-08-10 15:38:38 +00:00
Matt Coster
ffc93ba7a3 pvr: Add VK_KHR_get_surface_capabilities2
Common vulkan wsi code already exposes the *2() functions (as well as
the vulkan 1.0 equivalents), so we might as well expose this extension.

Coverage in dEQP is dEQP-VK.wsi.*.surface.query_capabilities2, which
are all currently unsupported as we do not expose any platform surface
extensions.

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/24489>
2023-08-10 15:38:38 +00:00
Matt Coster
4088831124 pvr: Add VK_KHR_get_memory_requirements2
We already expose the *2() functions and allow the common vulkan code
to provide the vulkan 1.0 equivalents, so we might as well expose this
extension.

The runtime also provides common implementations for the *2() functions
based on VK_KHR_maintenance4, but those functions require the
requirements to be evaluated without creating a resource; that would
need significantly more refactoring work to achieve.

Coverage in dEQP is dEQP-VK.memory.requirements.extended.*, which all
pass or are unsupported.

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/24489>
2023-08-10 15:38:38 +00:00
Matt Coster
1823afa94a pvr: Add VK_KHR_get_display_properties2
Common vulkan wsi code already exposes the *2() functions (as well as
the vulkan 1.0 equivalents), so we might as well expose this extension.

Coverage in dEQP is dEQP-VK.wsi.display.get_display_*2, which all pass
or are unsupported.

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/24489>
2023-08-10 15:38:37 +00:00
Matt Coster
64a3320f22 docs: Fixup imagination/pvr extension support
VK_KHR_timeline_semaphore support was missed by mistake.

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/24489>
2023-08-10 15:38:37 +00:00
Matt Coster
3208207998 pvr: Refactor pvr_GetPhysicalDeviceProperties2()
This makes use of the vk_get_physical_device_core_1_*_property_ext()
helpers.

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/24489>
2023-08-10 15:38:37 +00:00
Matt Coster
afe9b73cd5 pvr: Clean up extension tables
Switches PVR_USE_WSI_PLATFORM to be an always defined boolean to allow
for cleaner use in the extension tables (borrowed from tu) and extends
the pattern to create PVR_USE_WSI_PLATFORM_* equivalents for each
supported platform.

Also fixes the ordering to match the struct definitions.

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/24489>
2023-08-10 15:38:37 +00:00
Eric Engestrom
efb3c93d5f ci: build hasvk in debian-vulkan job
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24586>
2023-08-10 14:53:21 +00:00
Eric Engestrom
9dfd8b3723 ci: reorder vk drivers alphabetically in debian-vulkan job
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24586>
2023-08-10 14:53:21 +00:00
David Rosca
ee6eadb65a ci/amd: Skip all VAAPI tests that creates too many huge surfaces
These tests creates up to thousand surfaces of 8192x8192 or
10240x10240 sizes which often times out.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9472
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24590>
2023-08-10 14:20:13 +00:00
Matt Coster
06c8ebaa66 pvr: Pad rogue_regarray_cache_key union members to avoid UB
GCC zeroes out the unreferenced parts of the union when assigning by
the smaller member, but clang doesn't. Neither is wrong, because the C
standard calls this UB; insert padding to ensure any compiler behaves
predictably.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24477>
2023-08-10 13:00:40 +00:00
Mike Blumenkrantz
e15832e6f4 zink: don't try to replace separate shader prog in noopt mode
this crashes

Fixes: ca2e2f4bd0 ("zink: apply ZINK_DEBUG=noopt to linked separate shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24606>
2023-08-10 12:32:58 +00:00
Eric Engestrom
5862568663 docs/v3dv: mark direct display extensions as implemented
Fixes: bf5cfb6486 ("v3dv: Enable (leased) direct display extensions.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24584>
2023-08-10 11:39:10 +00:00
Gert Wollny
d1b0629c41 r600: retire SB optimizer
The NIR backend is good enough and here is already a long list of
reasons why SB should not be called because it doesn't handle certain
instructions correctly.

v2: - remove more references to SB (Vitaly Kuzmin)
    - remove unused sb context (Sam Ravnborg)
v3: - drop used variable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7166
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24509>
2023-08-10 11:19:36 +00:00
Mike Blumenkrantz
ee6ba2bb57 zink: fix big tcs output io
as in the producer case, big io needs to reserve the appropriate number
of slots

fixes:
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-float-index-rd-after-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-float-index-wr-before-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec2-index-rd-after-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec2-index-wr-before-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec3-index-rd-after-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec3-index-wr-before-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec4-index-rd-after-barrier,Fail
spec@arb_tessellation_shader@execution@variable-indexing@tcs-output-array-vec4-index-wr-before-barrier,Fail

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Mike Blumenkrantz
ccc195c3a3 zink: explicitly set non-optimal last_vertex_stage shader key on ctx create
this otherwise results in generated gs not having the flag set, which breaks
various things

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Mike Blumenkrantz
12d997cd64 lavapipe: zero-init pipe_sampler_state
makes trace more reliable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Mike Blumenkrantz
5b4aa5b999 zink: reindex ssa defs before dumping debug shaders
this makes things more consistent across patches

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Mike Blumenkrantz
7498c83ace draw: fix so debug offset printing
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Mike Blumenkrantz
48b0af7217 zink: move ZINK_DEBUG=nir printing to just before compile
it's not useful to know what the nir is when zink receives it, as
this has minimal relation to the spirv that is output

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Mike Blumenkrantz
f272a88505 zink: fix xfb buffer array sizing to use buffer limit, not output
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24568>
2023-08-10 10:44:03 +00:00
Connor Abbott
aa322a37fc ir3: Implement helper invocation optimization
This kills helper invocations to ensure that subsequent memory accesses
don't fetch unused memory and unnecessary branch divergence from helper
invocations is eliminated.

shader-db results:

total instructions in shared programs: 3840580 -> 3841531 (0.02%)
instructions in affected programs: 278416 -> 279367 (0.34%)
helped: 0
HURT: 744
HURT stats (abs)   min: 1 max: 16 x̄: 1.28 x̃: 1
HURT stats (rel)   min: 0.05% max: 8.51% x̄: 0.75% x̃: 0.39%
95% mean confidence interval for instructions value: 1.22 1.34
95% mean confidence interval for instructions %-change: 0.67% 0.83%
Instructions are HURT.

total nops in shared programs: 866716 -> 867667 (0.11%)
nops in affected programs: 72851 -> 73802 (1.31%)
helped: 0
HURT: 744
HURT stats (abs)   min: 1 max: 16 x̄: 1.28 x̃: 1
HURT stats (rel)   min: 0.17% max: 33.33% x̄: 2.84% x̃: 1.82%
95% mean confidence interval for nops value: 1.22 1.34
95% mean confidence interval for nops %-change: 2.59% 3.08%
Nops are HURT.

total last-baryf in shared programs: 139806 -> 139864 (0.04%)
last-baryf in affected programs: 11772 -> 11830 (0.49%)
helped: 0
HURT: 58
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.40% max: 5.26% x̄: 0.60% x̃: 0.47%
95% mean confidence interval for last-baryf value: 1.00 1.00
95% mean confidence interval for last-baryf %-change: 0.42% 0.78%
Last-baryf are HURT.

total last-helper in shared programs: 1508295 -> 935561 (-37.97%)
last-helper in affected programs: 1192594 -> 619860 (-48.02%)
helped: 7816
HURT: 3
helped stats (abs) min: 1 max: 1095 x̄: 73.28 x̃: 34
helped stats (rel) min: 0.42% max: 100.00% x̄: 71.91% x̃: 100.00%
HURT stats (abs)   min: 1 max: 11 x̄: 4.67 x̃: 2
HURT stats (rel)   min: 0.80% max: 1.44% x̄: 1.03% x̃: 0.86%
95% mean confidence interval for last-helper value: -75.64 -70.86
95% mean confidence interval for last-helper %-change: -72.67% -71.10%
Last-helper are helped.

fossil-db results:

Totals:
Instrs: 55172795 -> 55189122 (+0.03%)
CodeSize: 108952746 -> 108984452 (+0.03%)
NOPs: 11536680 -> 11553007 (+0.14%)
(ss)-stall: 4166810 -> 4166581 (-0.01%)
(sy)-stall: 15890324 -> 15884974 (-0.03%)
last-baryf: 659588 -> 659633 (+0.01%)
last-helper: 25742996 -> 12601636 (-51.05%); split: -51.05%, +0.00%
Cat0: 12294891 -> 12311218 (+0.13%)

Totals from 39576 (25.22% of 156916) affected shaders:
Instrs: 24200008 -> 24216335 (+0.07%)
CodeSize: 44968736 -> 45000442 (+0.07%)
NOPs: 5854965 -> 5871292 (+0.28%)
(ss)-stall: 2357830 -> 2357601 (-0.01%)
(sy)-stall: 6166670 -> 6161320 (-0.09%)
last-baryf: 590330 -> 590375 (+0.01%)
last-helper: 24160432 -> 11019072 (-54.39%); split: -54.39%, +0.00%

Cat0: 6205561 -> 6221888 (+0.26%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:28 +00:00
Connor Abbott
b9489dea3d ir3: Gather pixlod status earlier
We'll need this to skip optimizing helper invocations if it's
unnecessary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:28 +00:00
Connor Abbott
5411f01f93 freedreno, tu, ir3: Add last_helper statistic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:28 +00:00
Connor Abbott
1f44d8d51d tu: Add missing last_baryf statistic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:28 +00:00
Connor Abbott
662db8e894 ir3, freedreno, tu: Plumb through SP_FS_PREFETCH_CNTL::ENDOFQUAD
Add a flag but don't use it yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:28 +00:00
Danylo Piliaiev
86440685f3 freedreno/regs: Define unknown SP_FS_PREFETCH_CNTL fields
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:28 +00:00
Connor Abbott
6aabdb7a57 ir3: Parse (eq) flag
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24433>
2023-08-10 10:09:27 +00:00
Eric Engestrom
f22437654a meson: fix indentation
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24603>
2023-08-10 09:28:58 +00:00
Samuel Pitoiset
3bbfc45c37 radv: re-introduce radv_pipeline_stage_init()
This helper is used to initialize a radv_shader_stage struct for
pipelines, while radv_shader_stage_init() would be for shader object
only (ie. using VkCreateShaderInfoEXT).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24562>
2023-08-10 08:51:05 +00:00
Samuel Pitoiset
afcafa1b61 radv: stop passing redundant stage to radv_shader_stage_init()
It's sinfo->stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24562>
2023-08-10 08:51:05 +00:00
Samuel Pitoiset
66eaca3a0a radv: introduce radv_shader_layout for per-stage descriptor layout
With pipelines, the shader layout is inherited from the pipeline layout
but with shader objects, the layout is passed through
VkCreateShaderInfoEXT.

This basically replaces uses of radv_pipeline_layout by
radv_shader_layout during shaders compilation. This will avoid
creating a pipeline layout with ESO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24562>
2023-08-10 08:51:05 +00:00
Samuel Pitoiset
7a3e256d27 radv: remove useless NULL for pipeline layout during shader info pass
It should be non-NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24562>
2023-08-10 08:51:05 +00:00
Iago Toral Quiroga
6ae2844c52 v3d: fix texture packing lowering
For texture instructions that don't have sampler state we have
been incorrectly using sampler index to retrive texture packing
information. This is incorrect for two reasons:

1. These instructions don't have a defined sampler index by
   definition.
2. The driver was not setting it either, so effectively, we
   have always been using whatever we had set for the first
   texture, which is obviously bogus.

Fix this by running a lowering pass that sets the index to use
in backend_flags, which is what the compiler expects, based on
the texture index, which is what we want in GL since we make
this decision based on the texture format.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
2023-08-10 07:10:01 +00:00
Iago Toral Quiroga
d28e5960e5 v3dv: assert that only tex instructions with sampler state have a sampler src
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
2023-08-10 07:10:01 +00:00
Iago Toral Quiroga
da625903c7 squash! v3dv,broadcom/compiler: don't abuse sampler index
For tex instructions that don't have sampler state use backend_flags
instead of sampler index to bind default sampler state.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
2023-08-10 07:10:01 +00:00
Iago Toral Quiroga
b2de3f71dc nir/lower_tex: use a callback to check sampler return size packing
The lower_tex_packing pass relies on the sampler index to access packing
information, but this is only valid for tex instructions that have sampler
state (so not txf, etc). Instead, let backends provide a callback to inform
the lowering about the packing used with a given texture instruction which
is more flexible.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
2023-08-10 07:10:00 +00:00
Iago Toral Quiroga
374c660582 nir/lower_tex: copy backend_flags field when copying a tex instruction
Fixes: 29c4417fb8 ('nir: Add a backend_flags field to nir_tex_instr')
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
2023-08-10 07:10:00 +00:00
Iago Toral Quiroga
a95c33eeaf v3dv: remove unused code
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24537>
2023-08-10 07:10:00 +00:00
Lionel Landwerlin
6f694432e4 intel/fs: add variable for output of debug backend optimizer
It can be useful to compare 2 runs with different compiler changes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24552>
2023-08-10 06:39:57 +00:00
Lionel Landwerlin
0e244d56e3 intel/fs: track more steps with INTEL_DEBUG=optimizer
One particular nice thing to have is the first generated backend IR
before validation. Especially if you made a mistake in the NIR
translation, you can at least look at it before validation tells you
off.

Then the last 2 steps of the optimize() function can be interesting to
look at.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24552>
2023-08-10 06:39:57 +00:00
Vinson Lee
f9cd8446ef lavapipe: Fix struct initialization
Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In box.x = box.x = copy->imageOffset.x, box.x is written twice with the same value.

Fixes: 9e9d90c6c3 ("lavapipe: VK_EXT_host_image_copy")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24531>
2023-08-09 23:15:10 -07:00
Dave Airlie
81cae3d8d2 nvk: enable KHR_shader_clock.
This should all be wired up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24595>
2023-08-10 03:39:49 +00:00
Samuel Pitoiset
ba49f2bef1 radv: advertise VK_KHR_maintenance5
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
54caa8d346 radv: implement radv_Get{Device}ImageSubresourceLayout2KHR()
Not really possible without creating an image internally.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
6861c5275b radv: allow VK_REMAINING_ARRAY_LAYERS with VkImageSubresourceLayers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
2ed52ca578 radv: add support for VkBufferUsageFlags2CreateInfoKHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
9089b091b2 radv: add support for VkPipelineCreateFlags2CreateInfoKHR
If the structure is present in pNext, it's used instead of flags.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
f4b9c5b1d0 radv: store pipeline create flags to radv_pipeline::create_flags
This is a common practice in vulkan/runtime and this will be easier
to use extended pipeline create flags.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
15548d8a5f radv/rmv: remove unused pipeline create flags when logging pipelines
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
3f617b8e4a radv: allow VK_WHOLE_SIZE for pSizes in vkCmdBindVertexBuffers2()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
cbfd2931bb radv: implement vkCmdBindIndexBuffer2KHR()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Samuel Pitoiset
bbb5cdcf40 vulkan/render_pass: add common vkGetRenderingAreaGranularityKHR()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24392>
2023-08-10 03:05:02 +00:00
Thomas H.P. Andersen
95feb95c95 nvk: advertise VK_EXT_tooling_info
Use the implementation in common code to report no tools in use.

Passes:
dEQP-VK.api.tooling_info.validate_getter
dEQP-VK.api.tooling_info.validate_tools_properties

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24594>
2023-08-10 02:30:45 +00:00
Mike Blumenkrantz
134014dfc7 lavapipe: maintenance5
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
e70179f3c6 lavapipe: VK_REMAINING_ARRAY_LAYERS for copy ops
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
6522b55a39 lavapipe: GetDeviceImageSubresourceLayoutKHR
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
c5a8c97098 lavapipe: BindIndexBuffer2
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
cee494aafd lavapipe: block yuv formats from getting blit feature flags
this is illegal

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
9e2f95eae3 lavapipe: fix resolves where src image has a layer offset
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
8a5936ae2f lavapipe: fix BindVertexBuffers2 buffer size handling
if the size specified is smaller than the buffer, the buffer needs to
be clamped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
ce09458917 llvmpipe: fix early depth + alpha2coverage + occlusion query interaction
in this scenario, sample counting must happen before a2c, as a2c may eliminate
coverage if alpha is zero, leading to a sample count of zero

dEQP-VK.fragment_operations.early_fragment.sample_count_early_fragment_tests_depth_alpha_to_coverage_samples_4_maintenance5

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
632d4de214 llvmpipe: block weird uses of subsampled formats in buffers
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
6cd51fc1d9 lavapipe: GetRenderingAreaGranularityKHR
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
db7304fe3c llvmpipe: export PIPE_CAP_IMAGE_LOAD_FORMATTED
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
b60ac8b52a llvmpipe: enable A8_UNORM for shader images
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
Mike Blumenkrantz
ba7efa4dfa gallivm: handle A8_UNORM image stores
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24589>
2023-08-10 01:56:03 +00:00
timmac-qmc
ae5a08de67 glsl: fix potential crash with DisableUniformArrayResize
We still need to gather information on uniform use when skipping
uniform array resize.

Fixes: ac5af6c0 ("util/driconf: add Dune: Spice Wars workaround")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24576>
2023-08-10 01:12:51 +00:00
Georg Lehmann
5c70a55bf3 nir/opt_intrinsics: optimize (exclusive_scan(op, a) op a) to inclusive scan
D3D only has exclusive scans so some games use this pattern.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24557>
2023-08-09 23:10:13 +00:00
Georg Lehmann
7a3e5dd2ec aco: use s_bitreplicate_b64_b32 to set exec to 0xffff0000ffff0000
Foz-DB Navi21:
Totals from 29 (0.02% of 132657) affected shaders:
Instrs: 19342 -> 19301 (-0.21%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24561>
2023-08-09 20:29:01 +00:00
Eric Engestrom
f71d43ecfb git-blame-ignore-revs: add pvr formatting commit
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24583>
2023-08-09 18:23:31 +00:00
Eric Engestrom
3d459fa4da git-blame-ignore-revs: add radv formatting commit
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24583>
2023-08-09 18:23:31 +00:00
Eric Engestrom
415a660aaf git-blame-ignore-revs: repeat instruction on how to enable to avoid having to look for it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24583>
2023-08-09 18:23:31 +00:00
Mike Blumenkrantz
ca2e2f4bd0 zink: apply ZINK_DEBUG=noopt to linked separate shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24581>
2023-08-09 14:13:47 +00:00
Mike Blumenkrantz
717ad8c5c8 zink: generated tcs is on the tes, not the vs
not sure how I screwed this up

Fixes: 4c47d83051 ("zink: use EXT_shader_object to implement generic separate shader precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24581>
2023-08-09 14:13:47 +00:00
Eric Engestrom
e1ff7893ba docs/radv: mark VK_INTEL_shader_integer_functions2 as implemented
Fixes: aa9d2d8893 ("radv: Enable VK_INTEL_shader_integer_functions2.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24582>
2023-08-09 14:38:22 +01:00
Eric Engestrom
0e9e033cde docs/radv: mark VK_EXT_tooling_info as implemented
Fixes: 10d1073aa6 ("radv: advertise VK_EXT_tooling_info")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24582>
2023-08-09 14:38:22 +01:00
Eric Engestrom
53231b0137 ci: document max image tag length
I've known about this for years and yet I still accidentally wrote a too
long tag.

Document this for myself next time, and for everyone else.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24560>
2023-08-09 12:00:33 +00:00
David Heidelberg
39e281073a ci/zink: Add flake seen in the wild
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24577>
2023-08-09 10:36:24 +00:00
Georg Lehmann
42ab786e52 ac/nir: handle more special cases in ac_nir_unpack_arg
Foz-DB Navi21:
Totals from 60972 (45.96% of 132657) affected shaders:
CodeSize: 158371336 -> 158127376 (-0.15%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24534>
2023-08-09 10:04:53 +00:00
Feng Jiang
82dd60dfb0 virgl/video: Enable AV1 decoding
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23386>
2023-08-09 09:04:58 +00:00
Feng Jiang
c4a1b4e100 virgl/video: Add support for AV1 decoding
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23386>
2023-08-09 09:04:58 +00:00
Feng Jiang
ea5054a94a virgl/video: Add definition of virgl_av1_picture_desc
The virgl_av1_picture_desc references to pipe_av1_picture_desc.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23386>
2023-08-09 09:04:58 +00:00
Feng Jiang
82ee420b15 frontends/va: Add slice_count to AV1 slice_parameter
Save the number of slice in AV1 slice parameter, so that the
underlying driver (such as virgl) can handle the slice parameters
better.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Suggested-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23386>
2023-08-09 09:04:58 +00:00
Lionel Landwerlin
c87d5c67d9 anv: implement VK_EXT_pipeline_robustness
v2:
 - Use vk_pipeline_robustness_state

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17545>
2023-08-09 09:03:45 +03:00
Lionel Landwerlin
9934613c74 anv/hasvk: track robustness per pipeline stage
And split them into UBO and SSBO

v2 (Lionel):
 - Get rid of robustness fields in anv_shader_bin
v3 (Lionel):
 - Do not pass unused parameters around

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17545>
2023-08-09 09:00:12 +03:00
Lionel Landwerlin
c4ec60e87d hasvk: remove descriptor array bounds checking
Same reason as Anv.

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/17545>
2023-08-09 09:00:12 +03:00
Lionel Landwerlin
059e82a469 anv: remove descriptor array bounds checking
We cannot find anything in the Vulkan spec requiring this. D3D12 [1]
says it's undefined as long as it doesn't crash the OS :

   "Out of bounds indexing of any descriptor table from the shader
    results in a largely undefined memory access, including the
    possibility of reading arbitrary in-process memory as if it is a
    hardware state descriptor and living with the consequence of what
    the hardware does with that. This could produce a device reset, but
    will not crash Windows."

[1] : https://learn.microsoft.com/en-us/windows/win32/direct3d12/advanced-use-of-descriptor-tables#out-of-bounds-indexing

Found 2 titles affected by this change

Some pretty good results on Cyberpunk 2077 :

  Totals from 10285 (100.00% of 10285) affected shaders:
  Instrs: 7638709 -> 7517360 (-1.59%); split: -1.64%, +0.05%
  Cycles: 148047414 -> 148470916 (+0.29%); split: -0.83%, +1.12%
  Subgroup size: 112544 -> 112576 (+0.03%); split: +0.04%, -0.01%
  Spill count: 98 -> 90 (-8.16%)
  Fill count: 90 -> 82 (-8.89%)
  Max live registers: 495274 -> 479502 (-3.18%); split: -3.21%, +0.03%
  Max dispatch width: 87824 -> 91168 (+3.81%); split: +4.10%, -0.29%

  Gaining 297 shaders in SIMD16/32, loosing 16 SIMD32 shaders

Some not so good results on Strange Brigade :

  Totals from 4027 (100.00% of 4027) affected shaders:
  Instrs: 2080355 -> 2013880 (-3.20%); split: -3.20%, +0.01%
  Cycles: 25405149 -> 25170579 (-0.92%); split: -1.37%, +0.45%
  Max live registers: 167303 -> 168958 (+0.99%)
  Max dispatch width: 33264 -> 32496 (-2.31%)

  Loosing 96 SIMD16 shaders.

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/17545>
2023-08-09 09:00:12 +03:00
Lionel Landwerlin
0e5b4b1b43 hasvk: fix null descriptor handling with A64 messages
This replicates the same fix we did for Anv and null descriptors with
A64 messages from commit efcda1c530 ("anv: fix null descriptor
handling with A64 messages").

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17545>
2023-08-09 09:00:12 +03:00
Yonggang Luo
8fe6e6957c svga: use alignas over struct MKSGuestStatInfoEntry
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24571>
2023-08-09 05:15:09 +00:00
Yonggang Luo
0ca43db2d0 v3dv: Use alignas(8) over 64 bit atomic value
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24571>
2023-08-09 05:15:09 +00:00
Yonggang Luo
d130c96bda util/treewide: Use alignas(x) instead __attribute__((aligned(x)))
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24571>
2023-08-09 05:15:09 +00:00
Thomas H.P. Andersen
8c25cd307a nvk: EXT_conditional_rendering
This reads the buffer value, combines it with the inverted setting
and sets SET_RENDER_ENABLE depending on this.

This works for draw and clear calls, but not for dispatch.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24520>
2023-08-09 04:11:50 +00:00
Dave Airlie
07c70c77de nvk: add cond render upload buffer.
conditional render has some issues with vram, so we have to use
a gart buffer to put the value into. This is similiar to what
nvidia seem to do.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24520>
2023-08-09 04:11:50 +00:00
Dave Airlie
fbe171638e nvk: add gart forced cmd pool side buffer.
Currently we put the upload and cmd bos into GART, however in the
future this might change, but for conditional rendering we must have
 a GART space to read the value from. This creates a separate buffer
allocations that are gart forced. This will be used to provide
cond render with a gart location.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24520>
2023-08-09 04:11:50 +00:00
Timothy Arceri
92c5460253 glsl: mark structs containing images as bindless
Structs are not allowed to contain an image in regular glsl. The only time
they are intended to be allowed to be declared in a struct is when
they are bindless.

Unfortunately the bindless spec does not meantion this behaviour
explicitly so there is no spec quote to reference but you can see in
the original commit to allow them in mesa that spec clarification was
provided 48b7882200

The spec also states that certain uses are implicitly bindless as per
the following spec quote:

   "When used as shader inputs, outputs, uniform block members,
   or temporaries, the value of the sampler is a 64-bit unsigned
   integer handle and never refers to a texture image unit."

Given images are not allowed in regular glsl for the above types
similair to being forbidden in structs, we can also assume
declarations in structs are implicitly bindless.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24269>
2023-08-09 01:27:58 +00:00
Mike Blumenkrantz
8dd2691020 aux/trace: fix winsys handle dumping
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24493>
2023-08-08 23:54:29 +00:00
Mike Blumenkrantz
f1db28da35 zink: add VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT
now that there's more locking around pipeline caches this makes sense

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24559>
2023-08-08 23:13:46 +00:00
Mike Blumenkrantz
1c1e09249c zink: add more locking for pipeline cache
this ensures the size remains constant for entry updates

fixes #9494

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24559>
2023-08-08 23:13:46 +00:00
Mike Blumenkrantz
eea408e563 zink: use SPV_KHR_workgroup_memory_explicit_layout when available
aliasing shared memory is otherwise questionably legal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24467>
2023-08-08 21:20:05 +00:00
Mike Blumenkrantz
904cf2329b zink: propagate have_workgroup_memory_explicit_layout to ntv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24467>
2023-08-08 21:20:05 +00:00
Mike Blumenkrantz
ae3163dfd2 zink: hook up VK_KHR_workgroup_memory_explicit_layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24467>
2023-08-08 21:20:05 +00:00
George Ouzounoudis
0bb55b4634 nvk: Enable dynamic line rasterization mode state
Enables extendedDynamicState3LineRasterizationMode feature.
Just moved the state flipping from the pipeline to the dynamic rs state
flush.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24517>
2023-08-08 20:45:31 +00:00
georgeouzou
870636cc1f nvk: Support VK_EXT_line_rasterization
- bresenham and smooth lines

These two need to override multisample rasterization to get correct
results on CTS tests.

- stippled lines

The stipple factor needs to be remapped from [1, 256] to [0, 255].

-rectangular and strict lines

Rectangular lines need multisample rasterization rules to get correctly
rasterized even for one sample. That way we get strict lines too for
VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT.

As per the DX rasterization rules:

Rasterization rules for primitives are, in general, unchanged by multisample antialiasing, except:
- For a triangle, a coverage test is performed for each sample location (not for a pixel center).
  If more than one sample location is covered, a pixel shader runs once with attributes interpolated at the pixel center.
  The result is stored (replicated) for each covered sample location in the pixel that passes the depth/stencil test.
- A line is treated as a rectangle made up of two triangles, with a line width of 1.4.
- For a point, a coverage test is performed for each sample location (not for a pixel center).

For single sample rasterization we get the same results for the
triangles and points, but for lines we get the rectangular form instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24517>
2023-08-08 20:45:31 +00:00
Mike Blumenkrantz
cf8fe9baec zink: set msrtss depth resolve mode when enabled
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24309>
2023-08-08 20:20:09 +00:00
Mike Blumenkrantz
2630a89b72 zink: don't append msrtss to dynamic render if not supported
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24309>
2023-08-08 20:20:09 +00:00
Mike Blumenkrantz
751407a59a zink: don't add VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT for transient images
this is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24309>
2023-08-08 20:20:09 +00:00
Mike Blumenkrantz
300cbedc78 zink: fix zs resolve attachment indexing
this has never been tested until now

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24309>
2023-08-08 20:20:09 +00:00
Mike Blumenkrantz
5ac2291c6b zink: add batch refs for transient images
ensure these don't get deleted while in use

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24309>
2023-08-08 20:20:09 +00:00
Tatsuyuki Ishi
e1e813586c radv/winsys: Remove unused struct radv_winsys_bo_list.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24551>
2023-08-08 19:24:10 +00:00
Tatsuyuki Ishi
b85817f877 radv/amdgpu: Remove unused bo_list variable from cs_submit.
Handle based bo_list is no longer used since 767a9324b9 ("radv/amdgpu:
remove legacy code path for creating the BO list").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24551>
2023-08-08 19:24:10 +00:00
Emma Anholt
371c18b331 freedreno/a5xx: Skip SSBO emit when none are enabled.
There was a weird NUM_UNIT=0 in a crash dump I was looking at, but this
doesn't fix the crash.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
e9a6832a1b freedreno: Fix crashdec pre-a6xx.
We'd assert fail looking up the REM registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
33f2726b97 ci/freedreno: Add a regression test for decoding a540 blob's compute shaders.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Eric Anholt
b10f4eda70 freedreno/cffdec: Fix decode on pixel 2 blob's COMPUTE_CHECKPOINT
dEQP-GLES31.functional.image_load_store.buffer.image_size.writeonly_7
produces:

t7		opcode: CP_COMPUTE_CHECKPOINT (6e) (8 dwords)
			{ ADDR_0_LO = 0x15000 }
			{ ADDR_0_HI = 0x5 }
			0x18
			{ ADDR_1_LEN = 3 }
			0xf
			{ ADDR_1_LO = 0x2e010 }
			{ ADDR_1_HI = 0x5 }

and it was asserting due to sizedwords==7.  Without the assert, we were
dereffing a len past the end of the packet.  This len value we were
loading is also suspiciously not the location of the ADDR_1_LEN field in
the packet's XML.  But then, the command stream at ADDR_1 was clearly 0xf
long, and that puts ADDR_1_LEN at the spot we would expect compared to
SET_RENDER_MODE's ADDR_1.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
f7bd10ed38 freedreno/a5xx: Add private mem support.
A bunch of our piglit fails were due to failing to compile shaders due to
a lack of spilling support.  I used a simple shader with a large local
array with tunable size to determine the MEMSIZEPERITEM increment and the
location of HWSTACKOFFSET (matching a3xx locations).  Unfortunately
fibers_per_sp I had to guess by taking a big spilling shader and cranking
it up until it rendered correctly.  The value I found made HWSTACKOFFSET's
shift value match a6xx's, as a bit of confirmation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
c4874b4cee freedreno/a5xx: Set num_sp_cores and set PC/VFD_POWER_CNTL accordingly.
Based on libwrap tracing of the blob.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
c9f9d71412 freedreno/a5xx: Refactor SHADER_OBJ emit to a helper function.
This will grow private mem setup shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
c361e1d0d9 freedreno/a3xx: Add the shift for MEMSIZEPERITEM according to db410c docs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
0fb797aab0 freedreno/a6xx: Move pvtmem allocation to ir3_gallium.
This will be the same thing for pre-a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:59 +00:00
Emma Anholt
a4c89cc8a6 freedreno/devices: Set num_sp_cores explicitly for pre-gen6.
These are all 0 currently, but will change for a5xx shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
f6ea7c3a99 freedreno/devices: Move fibers_per_sp to the common info struct.
We'll need it for pvt mem on other GPUs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
b468286937 ci/freedreno: Add some more db820c xfails.
We do a fractional run so we didn't have them listed.  Adding these helps
me with local baseline testing, and future people doing uprevs or
rebalancing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
bdeadc366a ci/freedreno: Update comments for some a530 xfails.
That assert doesn't exist any more but the test still fails.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
0918b90987 ci/freedreno: Sort another a530 xfail with its friends.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
9cfa86202e ci/freedreno: Drop a bunch of stale a530 xfails.
These all pass fairly reliably on my a530 when run on their own.  We've
not noticed this because a530 has some very loose flakes regexes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
e3274e9e1b freedreno/ir3: Move pvtmem per-fiber size alignment to the compiler.
Instead of having tu and each fd backend do it.  This will help me make
some shared code on freedreno for pre-6xx pvtmem support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
a297624182 freedreno/a5xx: Skip emitting unused texture descriptors for images.
In that case, we'd emit it to DST_OFF=255+i, angering the hardware
mightily.  This was missed in the addition of a6xx image support.

Fixes: 2e0ea3f09c ("freedreno/ir3: add image/ssbo <-> ibo/tex mapping")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Emma Anholt
59e9909cc1 freedreno/a5xx: Fix border color structure size.
This now matches a6xx.  This major border color flakiness in deqp -- when
a prior test in the caselist bound a VS and it didn't get unbound at the
gallium level, our FS border colors would be up at offset 8 instead of 0,
and the wrong padding would make FS sampler 0 get a junk border color.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24358>
2023-08-08 18:51:58 +00:00
Samuel Pitoiset
1b66ebf09a radv/rt: fix capture/replay support
When replaying a RT pipeline, RADEON_FLAG_REPLAYABLE should be set.

The idea is that for capture, RADEON_FLAG_REPLAYABLE should be passed
when allocating a BO (ie. replay_va would be 0), and then for replay
the VA would be non-zero but the flag is also required.

Fixes
dEQP-VK.ray_tracing_pipeline.pipeline_library.configurations.multithreaded_compilation.*.

Fixes: 744357477e ("radv: Add utilities to serialize and deserialize shader allocation info")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24543>
2023-08-08 18:07:22 +00:00
Sagar Ghuge
12be0829ea docs: Add INTEL_DEBUG_BKP_BEFORE/AFTER_DRAW_COUNT
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24308>
2023-08-08 17:36:20 +00:00
Sagar Ghuge
f575d4bc6f blorp: Implement blorp hooks to emit breakpoint
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24308>
2023-08-08 17:36:19 +00:00
Sagar Ghuge
1e3b40ffcf iris: Add GPU breakpoint before/after draw call
This change allow us to insert the MI_SEMAPHORE_WAIT before/after
specific draw call. With GTX tool, we can always update the memory
address to unblock spinning wait.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24308>
2023-08-08 17:36:19 +00:00
Sagar Ghuge
49eabb9ea6 anv: Add GPU breakpoint before/after specific draw call
This change allow us to insert the MI_SEMAPHORE_WAIT before/after
specific draw call. With GTX tool, we can always update the memory
address to unblock spinning wait.

v2:
- Make sure draw_call_count is thread-safe (Lionel)
- Add static inline helper (Lionel)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24308>
2023-08-08 17:36:19 +00:00
Sagar Ghuge
e5116e00ca intel: Add env variable to add break point on/before draw
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24308>
2023-08-08 17:36:19 +00:00
David Heidelberg
7a9ee94e1f ci/panfrost: t760-gles is nightly job, test also GLES 3 and 3.1
We don't care about how long it takes since it's nightly.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24546>
2023-08-08 17:01:59 +00:00
David Heidelberg
a7f512ad6f CI: Re-enable G52 Vulkan testing
This gives us coverage back on panvk on Bifrost. There are a lot of
fails since it was last tested though.

[daniels: Updated with new expectations.]

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24546>
2023-08-08 17:01:59 +00:00
David Heidelberg
a3615fad25 ci/panfrost: re-enable t760 and t860 traces as a nightly job
Two crashing jobs documented in: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9473

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24546>
2023-08-08 17:01:59 +00:00
David Heidelberg
c4357c6c49 ci: add perfetto into mesa git-cache
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8821

Fixes: 8aff228127 ("ci: Enable building the testing drivers with perfetto.")
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23611>
2023-08-08 16:13:05 +00:00
Samuel Pitoiset
478a18aa3d zink: fix setting VkShaderCreateInfoEXT::nextStage
nextStage has some restrictions depending on the current stage.

Fixes: cd6625c6eb ("zink: use EXT_shader_object to (re)implement separate shaders")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24558>
2023-08-08 14:44:38 +00:00
Mike Blumenkrantz
f75ba983ca nir/print: always group variables by type when printing
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23752>
2023-08-08 13:51:34 +00:00
Mike Blumenkrantz
4a783abd79 nir/print: print location names for (some) tess slots
these should be fine to print

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23752>
2023-08-08 13:51:34 +00:00
Julian Hagemeister
4c11fe8ae6 Gallium: Fix shared memory segment leak
Commit abe6d750e5 caused shared memory
segments to be leaked. We need to mark shared memory segments for
deletion upon construction.

Fixes: abe6d750e5 xlib: fix glXDestroyContext in Gallium frontends
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9425
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24556>
2023-08-08 13:24:01 +00:00
Bas Nieuwenhuizen
5325582968 radv: Expose VK_EXT_external_memory_acquire_unmodified.
No-op, since we generally don't do anything to revalidate images.

In general on external/foreign queues we prepare on "export" that
it might be used on more queues, but we do pretty much nothing on
"import".

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9348
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24524>
2023-08-08 12:26:06 +00:00
Eric Engestrom
edab54dd68 ci: build nvk
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24542>
2023-08-08 11:43:18 +00:00
Feng Jiang
9f0866018c meson: Export winsys function symbols for target va
Export winsys function symbols of target va, even if the user
links with '-Bsymbolic-functions'.

It refers target vdpau, which commit is:
8c136b53b7
("fix vdpau interop when using -Bsymbolic-functions in ldflags")

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23177>
2023-08-08 11:13:56 +00:00
Juan A. Suarez Romero
0dafa2e0f0 vc4/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24550>
2023-08-08 10:52:01 +00:00
Samuel Pitoiset
a7d6edfb36 radv: use vk_query
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24416>
2023-08-08 10:24:54 +00:00
Samuel Pitoiset
97c926cf17 radv: use common vkCmdBegin/EndQuery wrappers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24416>
2023-08-08 10:24:54 +00:00
Samuel Pitoiset
36a93b41d4 radv: use vk_sampler
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24416>
2023-08-08 10:24:54 +00:00
Samuel Pitoiset
b6d542d7ba radv: use vk_buffer_view
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24416>
2023-08-08 10:24:54 +00:00
Samuel Pitoiset
fc14988082 vulkan: add init/finish helpers for vk_buffer_view
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24416>
2023-08-08 10:24:54 +00:00
Lionel Landwerlin
9acbb197fb anv: fake non intel vendorID for Death Stranding
The assumption is the same issue that is plaguing Cyberpunk 2077 is
also at play here. That is the XeSS library is looking for the Windows
driver binary and not finding them in the Wine/Proton distribution.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24237>
2023-08-08 09:50:44 +00:00
Samuel Pitoiset
b135149986 radv: update cmdbuf scratch size info when shaders are bound
This will automatically update the scratch size info for shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24502>
2023-08-08 09:28:54 +00:00
Samuel Pitoiset
ea31193532 radv: update the number of scratch waves for RT prolog at bind time
The compute scratch size is computed later because the RT stack size
can be dynamic, but the number of waves shouldn't change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24502>
2023-08-08 09:28:54 +00:00
Samuel Pitoiset
44e82a6cf1 radv: add a helper to get the maximum number of scratch waves per shader
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24502>
2023-08-08 09:28:54 +00:00
Samuel Pitoiset
9880224490 radv: use the RT prolog scratch size directly for tracing rays
It should be the same as the pipeline scratch size value.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24502>
2023-08-08 09:28:54 +00:00
Jordan Justen
493e8c4b50 intel/genxml: Add filter_engines() to GenXml class
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24547>
2023-08-08 08:58:36 +00:00
Jordan Justen
5e275d8a2b intel/genxml: Add GenXml class into intel_genxml module
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24547>
2023-08-08 08:58:36 +00:00
Jordan Justen
6e54245d00 intel/genxml: Convert gen_pack_header to use ElementTree
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24547>
2023-08-08 08:58:36 +00:00
Jordan Justen
a8a50332a6 intel/genxml: Convert gen_bits_header to use ElementTree
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24547>
2023-08-08 08:58:36 +00:00
Jordan Justen
ef2f2ae765 intel/genxml: Split some genxml sorting code into a intel_genxml module
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24547>
2023-08-08 08:58:36 +00:00
Jordan Justen
761bcc3716 intel/genxml: Align "Texture Coordinate Mode" naming
Some older gens used '_' (underscore) while newer gens used a ' '
(space).

$ sed -i 's/Texture_Coordinate_Mode/Texture\ Coordinate\ Mode/' \
      src/intel/genxml/*.xml

The naming needs to be aligned for importing enums later on.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24547>
2023-08-08 08:58:36 +00:00
Martin Stransky
87ec9456be llvmpipe: fix UAF in lp_scene_is_resource_referenced.
reworked slightly by airlied

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24414>
2023-08-08 08:02:28 +00:00
Vinson Lee
9dd6866958 nvk: Fix assert
Fix defect reported by Coverity Scan.

Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
assign_where_compare_meant: use of "=" where "==" may have been intended

Fixes: e41031d8ff ("nvk: Enable multiplane images and image views")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24530>
2023-08-08 07:40:55 +00:00
Karol Herbst
43f7d9693b nouveau/mme: fix OOB inside tu104 simulator
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24544>
2023-08-08 07:10:38 +00:00
Karol Herbst
1bee6a35ec nouveau/mme: fix OOB access inside while_ine builder test
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24544>
2023-08-08 07:10:38 +00:00
José Roberto de Souza
8483a59dde anv: Override vendorID for Hogwarts Legacy
This is another game that makes use of XeSS but works when we fake
the vendorID.

With this temporary hack it works on i915 and Xe KMDs.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24506>
2023-08-08 06:16:16 +00:00
Timothy Arceri
a7850f8cf3 glsl: fix spirv sso validation
The api validation calls will segfault without this as it will
try to fallback to string matching names which are NULL. This
would be incorrect behaviour even if the names weren't NULL so
here we correctly set the explicit location flag.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9483
Fixes: ffdb44d3a0 ("nir/linker: Add inputs/outputs to the program resource list")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24529>
2023-08-08 05:36:39 +00:00
Dave Airlie
ae6be7a44a zink: turn off threaded cpu access if not visible.
This turns off the threaded cpu access it the resource isn't visible.

Fixes a bunch of crashes with current nvk.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24548>
2023-08-08 05:06:11 +00:00
Faith Ekstrand
4f217e9670 nvk: Remove plane sources from tex instructions
The plane source is entirely handled by lower_tex() so there's no need
to keep it around.  Codegen currently just ignores these but NAK will
assert if it sees an unknown source type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24549>
2023-08-08 04:48:33 +00:00
Mike Blumenkrantz
ac00f5a361 nir/linking_helpers: force type matching in does_varying_match
this otherwise breaks when i/o is scalarized in the producer but not
the consumer

cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24458>
2023-08-08 03:55:06 +00:00
Mike Blumenkrantz
58ba2bcc8c nir/lower_io_to_scalar: fix 64bit io splitting
this was creating broken 64bit loads/stores using 32bit component
size

cc: mesa-stable

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24458>
2023-08-08 03:55:06 +00:00
Benjamin Cheng
4755276baf anv/video: copy from correct H264 scaling lists
Vulkan defines the scaling lists according to the H264 ITU spec, which
only defines ScalingList8x8[0] and ScalingList8x8[1] for
non-444 formats.

Reviewed-by: Lynne <dev@lynne.ee>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24474>
2023-08-08 03:21:39 +00:00
Benjamin Cheng
0e4b1b8f23 radv/video: copy from correct H264 scaling lists
Vulkan defines the scaling lists according to the H264 ITU spec, which
only defines ScalingList8x8[0] and ScalingList8x8[1] for
non-444 formats. Since RADV only supports 420, just directly use those.

Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24413>
2023-08-08 02:48:49 +00:00
Dave Airlie
08ca37645e nvk: align sampler allocation counts with nvidia.
Fill out the missing property as well.

found running some zink piglit runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24532>
2023-08-08 02:28:47 +00:00
Faith Ekstrand
f2f4e811be nir/gl: Move glsl_type::sampler_target() into a helper in its one caller
The new version also doesn't need to worry about arrays of textures
because the caller already takes care of that.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24503>
2023-08-08 01:50:05 +00:00
Rob Clark
f17c5297d7 tu: Add virtgpu support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
006342be8b tu/drm: Split out helper for iova alloc
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
84524cfdfa tu/drm: Add missing error path cleanup
Fixes: bea6290ca0 ("turnip: device global bo list")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
811f332d81 tu/drm: Factor out shared helpers
Factor out a few things that we can re-use between virtio and msm
backends.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
c14a13d40d tu: close submitqueues before device_finish()
Otherwise we would have already closed the device.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
2196fdb2cf freedreno/drm/virtio: Use global_faults
Rather than doing a synchronous round trip to the host to query fault
count, use the shmem->global_faults field if available.  The kernel is
already only reporting faults associated with the same drm_file (which
in this case maps 1:1 to guest process), so the only thing we really
miss is, if the app is using multiple contexts, _which_ context the
fault was in.  But vulkan doesn't even use that, which sounds like a
good enough argument that per-submitqueue granularity isn't really
needed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
0be8fab6c8 freedreno: Update virtgpu proto
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
b0deba6210 drm-uapi: Update virtgpu header
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
5d701d4eba tu/knl: Remove some random const'ness
This gets in the way with virtio_gpu backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
3a3a658797 tu/msm: staticify a couple things
Stop leaking some private implementation details as global symbols.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
37834e3d7c freedreno/drm/virtio: Remove unused header
A remnant from a very early version, prior to refactoring out
fd_ringbuffer_sp to share more code btwn msm and virtgpu backends.
Somehow this never got removed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Rob Clark
6ae6536ed9 freedreno: move virtgpu msm_proto.h to common
src/freedreno/virtgpu seems a bit overkill for a single header.. but
maybe there are some other bits we could share?

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>
2023-08-08 00:20:48 +00:00
Gert Wollny
f7226181b4 r600/sfn: take number of dest values into account
With the write mask removed we have to run the loop correctly.

Fixes: b870988b77
    r600/sfn: Stop referencing legacy functionality

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9490
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24533>
2023-08-08 00:02:18 +00:00
Kevron Rees
0bce97ce83 Force vk vendor for spider-man remastered
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24194>
2023-08-07 23:06:44 +00:00
Mike Blumenkrantz
122ffb0c88 zink: unset line stipple ds3 state flags when stipple not available
Fixes: 7b4c1b3a42 ("zink: track and apply ds3 states only on change")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24478>
2023-08-07 22:12:38 +00:00
Mike Blumenkrantz
b2a9881475 zink: use VK_WHOLE_SIZE when binding null db buffer descriptors
using range=0 is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24478>
2023-08-07 22:12:38 +00:00
Mike Blumenkrantz
4e9b20beb9 ci: bump VVL to 1.3.261
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24478>
2023-08-07 22:12:38 +00:00
José Roberto de Souza
d686cadfbf intel: Sync xe_drm.h and rename engine to exec_queue
Sync with commit f16c04291100 ("drm/xe: Rename engine to exec_queue").
With that Iris and ANV had some major renames that were done manually
as there is to many "engine" in non-related code.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24476>
2023-08-07 21:34:14 +00:00
Eric Engestrom
6db246c960 egl: fixup _eglFilterConfigArray() params and drop _eglFallbackMatch() wrapper
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24292>
2023-08-07 19:58:30 +00:00
Eric Engestrom
78714a4328 egl: make _eglFilterConfigArray static
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24292>
2023-08-07 19:58:30 +00:00
Italo Nicola
109a6b8cd7 panfrost: add PAN_MESA_DEBUG=yuv for debugging yuv sampler
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:13 +00:00
Italo Nicola
bba74a84a9 panfrost: mandate proper alignment requirement depending format and arch
v7+ mandates row_stride alignment to be equal to surface alignment.
AFBC surface alignment is always 16-bytes.
NV12/NV21 formats on v7+ have 16-byte surface alignment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
c1ad78476d panfrost: advertise support for YUYV and variants
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
4685628411 panfrost: prepare the driver to support YUYV and variants
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
9692815293 panfrost: prepare pan_image_view for multiplanar formats
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
3fff7f3d0e pan/decode: decode Multiplanar Surface descriptors
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
6a15167b81 panfrost: refactor (un)packing of surface descriptors
Use the genxml helpers to pack/unpack midgard and bifrost surface
descriptors. Also changed how we describe midgard's descriptors, to make
it more straightforward. We currently only use SURFACE_WITH_STRIDE for
midgard, but pandecode should still be able to decode other surface
descriptor types.

This commit shouldn't change panfrost/pandecode behavior.

Consequenctly, this refactor also prepares pandecode to handle the
SURFACE_YUV descriptor for bifrost in the following patch.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
f27b02838d panfrost/genxml: add Multiplanar Surface descriptor
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Italo Nicola
0d5bf46272 panfrost/genxml: fix Surface With Stride descriptor alignment
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
2023-08-07 19:35:12 +00:00
Luigi Santivetti
c5a6e88c4e pvr: do not claim support for ASTC texture compression
We don't support any ASTC formats yet, but the textureCompressionASTC_LDR
feature was incorrectly set to true. Fix this by setting it to false and
don't advertise ASTC support for texture compression.

Fixes dEQP-VK.api.info.format_properties.compressed_formats

Fixes: 8991e646 ("pvr: Add a Vulkan driver for Imagination Technologies PowerVR Rogue GPUs")
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24448>
2023-08-07 14:06:44 +00:00
antonino
6c25dc0909 freedreno: add ci flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24539>
2023-08-07 13:30:18 +00:00
antonino
d2d0f4a28a virgl: add ci flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24539>
2023-08-07 13:30:18 +00:00
Daniel Stone
cfa23e6690 panfrost/vk: Use correct sampler dimensions for MSAA
2D-MS samplers are SAMPLER_DIM_MS, not SAMPLER_DIM_2D. There is no MSAA
for non-2D textures.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: mesa/mesa#9474
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24494>
2023-08-07 10:39:37 +00:00
Lionel Landwerlin
f5074adeb5 anv: enable INTEL_DEBUG=nofc
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24510>
2023-08-07 12:02:57 +03:00
Iago Toral Quiroga
85c5b68823 v3dv: drop cpu path for buffer to image copies
We really want to avoid cpu jobs as much as possible. Also,
the texel buffer path we have for this should be able to
handle most cases.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24466>
2023-08-07 06:48:40 +00:00
Chris Spencer
67be2b6e63 radv: initialize result when pipeline cache creation fails
Signed-off-by: Chris Spencer <spencercw@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24521>
2023-08-07 06:29:04 +00:00
Dave Airlie
77773490cf zink: use fprintf instead of printf to align the requirements warnings
This just seems to have been overlooked and nvk triggers it right now.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24527>
2023-08-07 02:11:51 +00:00
Mike Blumenkrantz
4f5bfc6691 zink: force image barriers after dmabuf import
if the image will be used, then it has to be on the right queue

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24492>
2023-08-07 01:43:52 +00:00
Mike Blumenkrantz
652e87bc5d zink: better handle separate shader dsl creation when no bindings exist
this otherwise underflows the array and provides a (probably huge) garbage
value for the binding id, which then causes the driver to massively overallocate
both the layout and set/pool/buffer

the main result of this is that on radv any simple test that should be near-instant
takes 2-3 seconds to execute, which somehow nobody noticed

Fixes: e3b746e3a3 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24501>
2023-08-07 01:18:56 +00:00
Dave Airlie
18214bf9ea docs: add two nvk exts to features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24523>
2023-08-06 21:55:36 +00:00
Jordan Justen
bfe4a0e744 intel/decoder: Make intel_spec_load_filename() have separate dir and name strings
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20889>
2023-08-06 20:44:59 +00:00
Jordan Justen
b4c8d2dc45 intel/decoder: Add intel_spec_load_common()
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20889>
2023-08-06 20:44:59 +00:00
Jordan Justen
1d5535613e intel/decoder: Fix xml filename when verx10 % 10 is not 0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20889>
2023-08-06 20:44:59 +00:00
Gert Wollny
807c0d6bb7 r600/sfn: Take source uses into account when switching channels
When we switch the channels by re-creating vec4 values we have to
take into account that the source values may be used in an ALU op,
and with that we have to take read-port limitations into account.

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24519>
2023-08-06 19:05:47 +00:00
Faith Ekstrand
bcfa71a6d0 nvk: Call nir_lower_int64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24518>
2023-08-06 11:56:12 -05:00
Faith Ekstrand
93362f801a nvk: Use more consistent device variable names
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24518>
2023-08-06 11:56:12 -05:00
David Heidelberg
8088d73fd1 ci/freedreno: document another flakes on Adreno 530
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24511>
2023-08-05 09:52:48 +00:00
Karol Herbst
286e58b8d8 nv50/ir: convert system values to gl_system_value
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24447>
2023-08-05 00:39:34 +02:00
Karol Herbst
f5c41c4b78 nv50/ir: use own info struct for sys vals
This makes it more obvious what's actually needed by the driver and allows
us to drop some code in the nir to nvir step.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24447>
2023-08-05 00:35:57 +02:00
Faith Ekstrand
8c62b3938a nvk: Enable the new UAPI
We also add a meson option to disable it and re-enable the legacy API.
This code probably won't last long but it gives developers the option.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
b2fe4c7729 nvk: Print an error message if VM_BIND support is missing
This should prevent a lot of bug reports.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
0b6afbc407 nouveau/winsys: Allow nouveau_ws_device_new() without VM_BIND
Silently fall back to non-VM_BIND.  The client can check for the
has_vm_bind flag in the device to detect whether VM_BIND is actually
available or not.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
1a6a198ab5 nvk: add new internal bo allocation flag.
This is to allow the kernel to use a single resv object, this might
need more work.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
766a6a5a4d nvk: Use an empty EXEC for the empty submit case
The new UAPI allows for an EXEC with zero pushes just fine so we no
longer need the no-op push just for synchronization.  This lets us drop
the whole empty push we allocate per-queue as well.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
9cb945015c nvk: enable sparse residency buffer on maxwell+
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
0fe8090bc7 nvk: enable a bunch of external fence/semaphore bits
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
921fc517ce nvk: enable sparse features
There is a bug on my turing with
dEQP-VK.sparse_resources.buffer.ssbo.sparse_residency.buffer_size_2_24
but none of the others and we aren't seeing it on some other devices.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
9a0a5f8561 nvk: Handle pre-turing indirect buffers with sparse
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
723041a3ed nvk/queue: add support for syncobjs and sparse binds
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
7321d151a9 nvk: Add support for sparse images
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
03f0f01904 nvk: Add support for sparse buffers
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
6dbf02ec64 nouveau/mme: Support the new UAPI
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
fa8bbfaa55 nouveau/winsys: add support for the vma bind interfaces
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
c815ff1661 nvk: always sync internal cmd bufs for vma lifetimes.
We always sync on the internal push buf submissions for zero vram
and ctx setup, these shouldn't be bottlenecks.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
9d7d76cddc nouveau/shim: Use the imported nouveau_drm.h headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
5fd1b8e086 nvk: Use the imported nouveau_drm.h headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
300df8e177 nouveau/winsys: Use the imported nouveau_drm.h headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
fc1fb3a516 drm-uapi: Import nouveau_drm.h
From https://cgit.freedesktop.org/drm-misc/

    commit e02238990b1ab2dfc8abb4c28369f1da6e863f81
    Author: Danilo Krummrich <dakr@redhat.com>
    Date:   Fri Aug 4 20:23:43 2023 +0200

        drm/nouveau: new VM_BIND uAPI interfaces

Signed-off-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
ae37fbba12 nouveau: Move shader topology info to nv_device_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
d8b7b1d784 nvk: Decorate CmdBegin/EndRendering entrypoints
These decorations are necessary for proper building on Android and
Windows.  You don't notice them in regular Linux builds, though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
40ab58035e nvk: Implement GetRenderingAreaGranularityKHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
8636597c4a nvk: Implement CmdBindIndexBuffer2KHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
c4b7754e7c nvk: Use VkBufferUsageFlags2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
98a3bc699b nvk: Implement the maintenance5 image layout queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
af72961ff1 nvk: Rework memory requirements to handle aspects correctly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
733d20277c nvk: Misc. style nits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
50e5ee586c nvk: enable EXT_depth_clip_enable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
15d12bb615 nvk: enable EXT_depth_clip_control
This is already handled in the dynamic state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
57c38a5669 nvk: Implement CopyQueryPoolResults with a compute shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
4a049f0d2c nvk: Separate the MME query copy code out a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
f090efa8dc nvk: Enable the SPIR-V DeviceGroup capability
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
dadf9d59e6 nvk: Add support for variable pointers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
0241ed6025 nvk: Add a root_desc_addr to the root descriptor table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
2e709a9278 nvk: Use nvk_root_descriptor_offset for drawInfoBase
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
0afc57afad nvk: Rework multi-plane format features a bit
We need to avoid returning certain feature flags such as rendering or
storage from vkGetPhysicalDeviceFormatFeatures*() but still allow those
for single-plane views of the image which means allowing them in
vkGetPhysicalDeviceImageFormatProperties*().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
b883031b91 nvk: Improve image format properties and limits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Mohamed Ahmed
2b85ccacf0 nouveau/nvk: Enable VK_KHR_sampler_ycbcr
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Mohamed Ahmed
e311b24b79 nouveau/nvk: Add multiple sampler planes for CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Mohamed Ahmed
67a2d78477 nouveau/nvk: Create helper function for sampler creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Mohamed Ahmed
41b2034460 nouveau/nvk: Support multi-plane descriptors in nvk_nir_lower_descriptors.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Mohamed Ahmed
a863ddcf9e nouveau/nvk: Add YCbCr sampler NIR lowering pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
fd03f4cd1a nvk: Use the new NIL helper for image level extents for copies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
866fc8b3f4 nil: Add a nil_image_level_extent_px() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Dave Airlie
113d3447bb nvk: enable rgb32 texel buffer support
This is needed for zink.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Emma Anholt
758973fb62 nvk: Disable shaderStorageImageReadWithoutFormat pre-Maxwell.
On Kepler and earlier, image loads must get lowered based on the declared
format, since we don't have a SULDP op.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
1bbfdccc9f nouveau: Drop GART size from nv_device_info
The kernel always returns something rediculously high, like 40 bits or
something.  There's really no point in us tracking it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
George Ouzounoudis
b2fa2ed04e nouveau/codegen: Do not keep redundant info for tessellation domain
Just add an assert instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
94e5eb68f4 nvk: Do not keep redundant info for tessellation domain
This is not needed after merge_tess_info that or's the info of both the
tesc and tese shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
2d670169ce nvk: fix independent color write masks.
This fixes:
dEQP-VK.renderpass.suballocation.attachment_write_mask.attachment_count_*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
b844b6b66a docs/relnotes: Stick something about NVK in new_features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
34ea8dfbdd docs: Add NVK to features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
71f7cf8acf docs: Add a docs page for NVK
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
d0192cec1e nvk: Don't skip zero-size bindings in GetDescriptorSetLayoutSupport
We still need to handle them in the case of variable descriptor counts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
89bab0012a nvk: align geometry clip setting with nvc0
This fixes
dEQP-VK.clipping.clip_volume.depth_clamp.point_list,Fail
dEQP-VK.clipping.clip_volume.depth_clip.point_list,Fail

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
d6e347c82d nvk: Flush more state on VI_BINDINGS_VALID dirty
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
9345b95346 nvk: Bind 3D depth/stencil images as 2D arrays
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
f0e8749e13 nvk/tess: don't emit patch control points in pipeline
Let the dynamic state thing emit these.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
afd6219055 vulkan/meta: Use vk_meta_get_pipeline_layout in blit/resolve
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
574d6362ca vulkan/meta: Add a get_pipeline_layout helper
This helper handles the cache lookup and constructs a pipeline layout
and a descriptor set layout, as needed, all in one go.  This saves a bit
of boilerplate in the various meta functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
f65fdfcca8 Revert "vulkan: Allow scissors or viewports to be set without counts"
This reverts commit b551f26a0caad52de620222e2df8416e80332943.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
9b2e7aab52 nvk: Use the new core vk_sampler struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
1524906f73 nvk: enable fp helper invocations loads on more gens
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
27eb9af9d8 nvk: Require an environment variable for poorly tested hardware
We really only know that Turing and Ampere work right now.  Maxwell has
recieved some testing but still can't survive a CTS run.  Other hardware
is even less well tested.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
a4367f2e3c nouveau: fix max_warps_per_mp_for_sm for builds with asserts disabled
Fixes: 1b756be2bca ("nvk: properly calculate SLM region by taking per arch limits into account")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
61c0d86831 nvk: properly calculate SLM region by taking per arch limits into account
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
4b66a0a70c nvk: replace mp with tpc
The tls space is calculate per TPC, but nouveau also doesn't report the MP
count to us, but the TPC count instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
a5129fb03f nvk: fix num_gprs for Volta+
Fixes OOR_REG errors being thrown

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c6a8851902 nvk: Implement VK_EXT_physical_device_drm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c68b4e4b3a nvk: Don't enumerate pre-Kepler GPUs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
f52add16fc nvk: Move the winsys device to nvk_device
Vulkan requires that different VkDevices be unable to affect each other.
To correctly provide this invariant, each VkDevice really needs its on
virtual address space.  This means opening a new nouveau_device per
nvk_device.  This may make device creation a tiny bit less efficient but
we can fix that with some sort of caching if we absolutely need to.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
be5d6c7cbe nvk: Add a ws_dev to nvk_device and use it
At the moment, this is just a convenient short-hand but we're about to
permanently move the nouveau_ws_device to nvk_device so it will be the
only way to access it soon.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
e2bdbc2151 nvk: Rename nvk_device::ctx to ws_ctx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
088692d954 nvk: Use nv_device_info for class checks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
1756e4601a nouveau: Move gart_size to nv_device_info
This is more complicated than the others since it is a calculated value.
For nv_device_info struct, we want the raw version that raw query from
the chip.  We move the calculation into nvk_create_drm_physical_device().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
372c884b4a nouveau: Move more stuff into nv_device_info
The device_id and is_integrated fields in nouveau_device can be dropped
entirely since they're redundant with nv_device_info::device_id and
nv_device_info::type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
8e85ea6f7a nvk: Set deviceType based on nv_device_info::type
The is_integrated bool is based on VRAM size which is a bit clunky and
not really what the Vulkan query means.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
56ccada087 nouveau: Stop using hex for SM numbers
There's no indication that NVIDIA considers this to be anything other
than a decimal number.  Much to the contrary, the number of 5s and 9s in
the SM number table implies they very much are base 10.  Given that
Lovelace is SM90, we'll likely be hitting 100 fairly soon at which point
this will stop fitting in a uint8_t.  Switch to decimal to compress it
down a bit.

Also, rename the field to SM which beter matches the NVIDIA docs and
ensures that there are no users of this which are likely to be confused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
9846c4e13e nouveau: Put PCI info in a pci substruct in nv_device_info
We separate out device_id because even non-PCI devices have one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
b232e42532 nvk: Only advertise EXT_pci_bus_info on discrete GPUs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
e722d0ff0b nvk: Drop nvk_physical_device::instance
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
221e024386 nvk: Use canonical variable names in nvk_sampler.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
75fc6260e8 nvk: Use canonical variable names in nvk_bo_sync.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
2be4acce25 nvk: Use canonical variable names in nvk_shader.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
6170e1c8d9 nvk: Use canonical variable names in nvk_physical_device.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
0d9155c9f8 nvk: handle alignments in device memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
f0a165799c nvk: Add an addr field to nvk_image_plane
Nothing actually needs the pointer to the memory object so it's better
to not even include it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
ad37394dfe nvk: init image fields for requirements
Fixes a crash in dEQP-VK.memory.requirements.create_info.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
0498eeba32 nvk: Add a buffer alignment helper
This consolodates buffer alignment calculations into one place,
including physical device queries, buffer creation, and buffer memory
requirements queries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
6a0cc93bd4 nvk: Reformat nvk_buffer.c
Mostly, using dev instead of device and re-flow the arguments to
nvk_GetDeviceBufferMemoryRequirements().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Karol Herbst
5fb3298a95 nouveau/winsys: fix SM value for Ada
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
9ffbd53bb7 nvk: Add support for probing as a platform device.
The driver now comes up on gk20a (Jetson TK1).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
880663c25d nvk: Clean up redundant vendor checking for physical device creation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
826486339b nvk: Quiet a compiler warning.
Looks like it's always set to me, but 🤷

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
0410054459 nouveau/winsys: Fix an undefined use in the error path.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
820c03ebee nvk/query: fix push buffer size for copy pool results.
the immediate takes two slots, so bump this by one,
fixes a crash in zink KHR-GL45.transform_feedback.query_vertex_interleaved_test

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
4fe57b2d7a nvk: Enable external memory extensions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
113b9b00e7 nvk: Support dma-buf export
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
0399999dec nvk: Support dma-buf import
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c370260a8f nouveau/winsys: Add dma-buf import support
This requires a lock and a buffer cache on the nouveau_ws_device.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
10ffe8e709 nvk: Require dedicated allocations for external images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
7f0c06e130 nvk: Dedicated allocations override internal
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
702326d013 nvk: Add external memory queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
3d247f447e nvk: Add device and driver UUIDs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
cccc044f51 nvk: Use abbreviated names in nvk_device_memory.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
14d35c7048 nvk: Use NVIDIA_VENDOR_ID in pdev try_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
ccfbd94891 nvk: Enable descriptor indexing
These values follow the already existing per-stage and descriptor set
limits.  If we change these to be similar to the reported values of the
proprietary driver, care must be taken as Turing has bigger limits for
uniform buffers than older generations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
edb58c6660 nvk: Add nir non-uniform optimization pass
The hardware supports non-uniform access natively so we do not need to
lower most non-uniform access in the shader. Just lower the ubo access
as it should probably be faster when we uniformly load from real hw
ubos in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
George Ouzounoudis
0dd15199a1 nvk: Handle cases of descriptor bindings with variable counts
We need to compute the allocated descriptor buffer size at descriptor allocation
time. So we need to split to a pre-computed size for all the other bindings
except the one with the variable count.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
6a74b3e311 nvk: Support VkDescriptorSetVariableDescriptorCountLayoutSupport
On cases with variable descriptor counts we need to calculate the
maximum supported variable count while taking into account the other existing
descriptors and their alignments in the set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
81bec8b63b nvk: Use the max descriptor alignemtn in GetDescriptorSetLayoutSupport
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Benjamin Lee
354fe8fda0 nvk: Fix segfault when opening DRI device file returns error
Previously, ver was unitialized on this path, causing UB on the
`if (ver)` branch after the out_err label.

Signed-off-by: Benjamin Lee <benjamin@computer.surgery>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Dave Airlie
3572f5cd7e nvk: add support for D32_SFLOAT_S8_UINT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
62fa4ff5e0 nvk: Take an nvk_image_plane in nouveau_copy_rect_image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
8d712c2e06 nvk: Add helpers for binding image planes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
fe022d4e87 nvk: s/device/dev in nvk_image.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Dave Airlie
ebcac6b81c nvk: introduce an optimisation loop.
This brings in pretty much the radv opt loop.

So for tess ctrl where this a loop we can unroll, this fixes
some dynamic array access later to be non-dynamic.

Fixes:
dEQP-VK.clipping.user_defined.clip_distance_dynamic_index.vert_tess.1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Dave Airlie
0b6b59e654 nvk: merge tess info between tcs/tes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Dave Airlie
136d49054b nvk: fix transform feedback crash when optimiser removes things.
This optimise loop can remove stuff, which causes this to crash,
just exit early.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
7715aea5aa nvk: Lower io to temporaries for tessellation evaluation nir
This is consistent to what radv does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
f561406d38 nvk: Respect tessellation domain origin state
When switching to lower left tessellation domain origin we need to
switch the orientation for triangles/quads. The changes are based on
what anv and radv do.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
93369f1f96 nvk: Fix cases where execution mode is specified in the tesc shader.
We need to keep some context for the compilation of the tessellation shaders.
This is required in the case where the domain is specified in the
tessellation control shader instead of the tessellation evaluation
shader, as codegen needs the domain information when compiling the
tessellation evaluation shader.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
544aadc56b nvk: Enable multiview with tessellation shader
This works by default, we just switch it on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
76e02c7f77 nvk: Assign locations correctly for arrayed IO
Arrayed IO, encountered in tessellation shaders, should not take up
multiple driver locations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
304636297f nvk: Basic tessellation shader support
Based on nvc0 implementation but with added nvidia-headers usage.
Device limits taken from http://www.vulkan.gpuinfo.org/ and minimum
required values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Thomas H.P. Andersen
ecbcc26a6e nvk: remove duplicated device features
These are already set in the Vulkan 1.2 section

Add status for bufferDeviceAddressCaptureReplayEXT

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Mohamed Ahmed
e41031d8ff nvk: Enable multiplane images and image views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
39d8d3811d nvk: Advertise KHR_spirv_1_4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
1ea94caab6 nvk: Fix the NO_PREFETCH assert for CmdDrawIndirect
The NO_PREFETCH bit gets set on the range.  The offset can pretty much
be whatever.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
e2379a2e87 nvk: Advertise shaderStorageImageReadWithoutFormat
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
6334cac288 nvk/heap: Set the right pitch for heap resize copies
Otherwise, once we need to grow past 2^17 B, we attempt to copy two
lines, the hardware errors out, and we get left with a junk heap.
While we're here, re-arrange the code a bit so we keep all the P_FOO
together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Echo J
729b34be8a nil: Add A4B4G4R4_UNORM format support
DXVK versions before v1.5.5 need this format in some cases

I haven't tried running CTS yet, but GTA San Andreas runs
well now on DXVK v1.5.1 (before this change it crashed) so
I think CTS should be happy enough 🐸

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Dave Airlie
ac4073a4ee nvk: expose EXT_sampler_filter_minmax
The sampler bits of this were already hooked up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
72263d7589 nvk: Only use view_id for layer in multiview
I can't prove that this fixes anything but it seems right.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
3e93173cc9 nvk: Move code inside view mask loops to a helper function
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
45001c878f nvk: Combine CLEAR_VIEWS and CLEAR_LAYERS MME macros
Check view_mask inside the macro to determine which loop to run. In
emit_clear_rects(), move code out of if/else that is the same in both
branches.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
b6a3dd4b51 nvk: Load view_mask to shadow scratch in nvk_CmdBeginRendering
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Thomas H.P. Andersen
71a00a0a1c nvk: simplify code by using new helpers
All tests still pass:
dEQP-VK.query_pool.*.compute_shader_invocations*

Test run totals:
  Passed:        78/78 (100.0%)
  Failed:        0/78 (0.0%)
  Not supported: 0/78 (0.0%)
  Warnings:      0/78 (0.0%)
  Waived:        0/78 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Echo J
d1bbd16f1f nvk: Reset offset value in ResetDescriptorPool
This is another secret change you've been waiting for 🐸

This change resets the current_offset value to 0 in ResetDescriptorPool
(without it the offset would keep counting until it reaches the limit
which causes allocation issues and/or application crashes/freezes)

RADV does the same thing, so I think this change is correct 🤓

BTW this meme seems to be relevant: https://youtu.be/1stQbTuUBIE

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Echo J
35d85fca88 nvk: Add bufferImageGranularity limit
This is the secret change everyone has been waiting for 🐸

But anyway, this change adds the bufferImageGranularity limit (which
is needed by both DXVK and osu!lazer; DXVK will be a corrupted mess
without it and osu!lazer simply throws an exception)

The values have been scraped from https://vulkan.gpuinfo.org BTW
(because of that I'm not sure if they're actually accurate)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
c4aba5b310 nvk: Advertise EXT_shader_viewport_index_layer on MaxwellB+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
8269ca0d51 nvk: Sort SPIR-V caps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
86f960090e nvk: Implement VK_KHR_map_memory2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
fc368b2b90 nvk: Use vk_device_memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
0dd4237896 nvk: Set spirv_to_nir_options::min_*_alignment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
7810c9171e nvk: Add a separate #define for SSBO alignment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
06c798f39b nvk: Expose VK_KHR_maintenance2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
a626eff1c3 nvk: Set pointClippingBehavior
This is what the blob advertises.  I don't know if it's correct or not
because the CTS test for this seems to pass either way:

    dEQP-VK.clipping.clip_volume.depth_clamp.point_list

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
4c760d2436 nvk: Implement uncompressed views of compressed images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
0895e160a8 nil: Add an image_level_as_uncompressed helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
5fff5b7c4f nil: Add a nil_image_for_level helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
6caf1e473d nvk: Support geometry shaders
This enables geometry shaders for nvk.  Physical device limits taken
from nouveau codebase and http://www.vulkan.gpuinfo.org

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
8eac1b0c4d nvk: Fix geometry shader active stream mask
This sets StreamOutMask in the shader header correctly based on:
https://download.nvidia.com/open-gpu-doc/Shader-Program-Header/1/Shader-Program-Header.html

After this fix transform feedback CTS tests with geometry shader streams
are passing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
George Ouzounoudis
921c06a6d4 nvk: Disable PRIMITIVE_RESTART_VERTEX_ARRAY by default
This made various strip geometry tests fail.  Tests with primitive
restart do not seem affected after this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
7cbe711760 nvk: Increase the push runout to 512 dwords
This is needed in order to do all of viewport state in a single push.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Echo J
16f4c21559 nvk: Add A8B8G8R8_*_PACK32 format support
Here it is; the long-awaited change (as requested by 2 people on Discord 🥺)

This change originally added one Vulkan format which was needed for STK's
Vulkan renderer, but @gfxstrand suggested to add all of the A8B8G8R8_*_PACK32
formats in a GitLab thread)

This obviously fixes SuperTuxKart crashing with the Vulkan renderer 🐸

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
d02e895152 nvk: Advertise VK_KHR_multiview
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/52

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
5472e96849 nvk: Add input attachments support for multiview
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
ec4e014b9b nvk: Add query support for multiview
When multiview is enabled, queries must use N consecutive query indices in the
query pool, where N is the number of bits set in the view mask in the subpass
the query is used in.

In our case, only the first query is used, so we emit zeros for the remaining
queries.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
903b917979 nvk: Add draw support for multiview
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
df2f07a57c nvk: Break the inner MME draw loop into a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
18c1977b65 nvk: Spill DRAW_IDX pre-Turing
Spill draw_idx to shadow scratch once we've written it to the root
descriptor.  This saves us a bit of register pressure around a pretty
tight seciton.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
3d8ffa3dd4 nvk: Rework spill helpers and DRAW_COUNT spilling
The new helpers, now moved to nvk_mme.h, take an nvk_mme_scratch value
to ensure no overlap.  They also ensure that we use exactly the same
register for the unspilled value as the spilled value.  This makes
spilling safe for loop-carried values and the like.  The old
nvk_mme_fill() helper just loads a spilled value to a new, possibly
different register.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
6b7d13529a nouveau/mme: Add a helper for re-allocating registers
This helper unlike alloc, tries to use the same value as the register
had before.  This is intended for manual spill/unspill code which wants
to keep register numbers the same while carefully spilling around high-
pressure regions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
9009100486 nvk: Use the new load/store_scratch helpers for DRAW_PAD_DW
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Faith Ekstrand
8ae61af5e3 nvk: Add begin to mme_scratch
Introduce helpers to make it easier to work with the nvk mme shadow
scratch. Store begin in the shadow scratch in vkCmdDraw* related code to
save registers, which is necessary for Fermi.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
ec917719bf nvk: Lower nir_intrinsic_load_view_index
Lower view_index intrinsics to a load_ubo using NIR.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:05 +00:00
Rebecca Mckeever
f0c86365da nvk: Add view_index to root descriptor table
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
08a200193f nouveau/mme: Fix while loops pre-Turing
Pre-Turing, we don't have a full condition built into the loop so, for
mme_while(b, ine, x, y) we have to generate the following:

[top]   BR -> [cond]
        /* loop body */
[cond]  XOR tmp, x, y
        BRZ !tmp -> [top]

However, due to an accounting error, we were generating

[top]   BR -> [cond]
        /* loop body */
        XOR tmp, x, y
[cond]  BRZ !tmp -> [top]

which meant that the XOR (or ADD if one is an immediate) was getting
skipped, leading to the loop either never terminating or always
terminating.  The way to fix this accounting error is to close the while
first, then compute the condition value, then do the jump.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
ccf004837a nouveau/mme: Use ADD for ine with an immediate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Karol Herbst
837b622dbf nvk: Add a macro to set MMIO registers via falcons
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Karol Herbst
63bb25f87d nouveau/mme: add a macro exit helper
At the moment it's turing+ only.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Karol Herbst
dc099bd808 nouveau/mme: add test for BEQ with magic exit offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Echo J
bd1ff51b77 nvk: Fix some cast defines
This removes compiler warnings on 32-bit builds 🐸

Also other drivers do define casts this way, so this should actually
be an uncontroversial change 😁

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
3ecf6db521 nvk: Add instace WSI entrypoints
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
bb003b75a1 nvk: Advertise ICD/loader interface version 4
We can't advertise v5 yet because we don't support Vulkan 1.1 yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
43083a041b nvk: Use the same lock for the submit and the memory objects list
We need to lock the memory objects list around the entire push builder
process.  Otherwise, a memory object could get destroyed between adding
it to the BO list and doing the submit, leading to the kernel rejecting
our pushbuf.

When the time comes that we switch to the new uAPI both uses of
nvk_device::mutex will go away.  We'll no longer be passing lists of BOs
to the kernel and we'll move to syncobj and be able to drop all the
nvk_bo_sync nonsense.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Mohamed Ahmed
93c439f660 nvk: advertise DemoteToHelperInvocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Dave Airlie
651bdb3822 nvk: fix r32_sint format support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Dave Airlie
c7b240c67c nvk: add min_lod to spirv caps.
We expose the vulkan feature

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Dave Airlie
d96cac61c5 nvk: add compute support for ampere
ampere has support for QMDv3, it's not mandatory but lets use it for now.

the more important change is the PCAS2_B call.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
9dbeef7fa1 nvk: Clamp viewport clip to max range
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Dave Airlie
f1b4ddcf1f nvk/barrier: handle host bit.
Fixes dEQP-VK.pipeline.monolithic.timestamp.transfer_tests.host_stage* crashes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
44fd2e94a3 nvk: Support vertex shader transform feedback on Fermi
Byte counts should be fetched with a different way in case of Fermi.
We cannot read the buffer directly in the mme.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
6e5efe6407 nvk: Support transform feedback queries
We need 2 reports for these. One for successfully written primitives
and one for needed primitives. Also we need to use report semaphore's
sub_report member to specify the query's corresponding vertex stream.
Finally availability index is 2 in the query results, as we have 2
results for succeeded and needed primitives.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
2b3730d271 nvk: Support transform feedback geometry streams
We just need to set the correct limits and features.  The meaningful
change here is the selected stream for rasterization which is configured
through the graphics pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
bdd4a65718 nvk: Support transform feedback indirect draws
This draw needs to read the byte count indirectly so it is implemented
as an mme function.  Some refactoring was done in the draw functions, so
that nvk_mme_build_draw could be used for this case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
6dded0bc53 nvk: De-duplicate MME code for setting draw params
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
fb60830935 nouveau/mme: Ensure that zero-initizlied mme_value is ZERO
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
5fd7df4aa2 nvk: Support for vertex shader transform feedback
For starters, we support only vertex shader output transform feedback.
Optional support for queries, streams and indirect draw are left out for
now.

Pipeline and shader state is based on nvc0 code. Most of the shader
state is going to change with the new compiler.

Required support for pause/resume is implemented with an mme function
that loads the offset indirectly from the counter buffer on resume.
For pause, we store the offset indirectly with a SET_REPORT_SEMAPHORE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Dave Airlie
d66182b215 nvk/nil: don't ask for compressed image kind
These need special kernel handling around the mmu, avoid asking
for them, nvidia don't seem to use them with gsp either yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Dave Airlie
983b5e9934 nouveau/winsys: allocate unique object handles across channels.
GSP requires unique object handles across channels, otherwise
it reports an error.

This fixes vulkaninfo on gsp enabled fw

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
37505e9bba nouveau/mme: Add a bfe helper
This extracts a fixed number of bits from a possibly variable position
in the source value.  Very helpful for testing for a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
b0658acf17 nvk: Advertise shaderImageGatherExtended
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/62
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
97346f0fe1 nvk: Rework features enables
Use the new feature enables framework.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
e37c20a3da nvk: Rework extension enables
Take an nv_device_info instead of a full nvk_physical_device.  This
prevents errors where nvk_get_device_extensions() may access an
uninitialized field of nvk_physical_device.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Mohamed Ahmed
b07fef43bf nvk: advertise VK_KHR_maintenance4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Mohamed Ahmed
08057651ea nvk: implement vkGetDeviceBufferMemoryRequirementsKHR()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Mohamed Ahmed
81dc17c4db nvk: add stub for vkGetDeviceImageSparseMemoryRequirementsKHR()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Mohamed Ahmed
e4ec8df90b nvk: implement vkGetDeviceImageMemoryRequirementsKHR()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
e83faece09 nouveau/mme: Add a helper to dump instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
c1ae91d89e nouveau/mme: Fix nested while instructions on Turing+
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/49
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
f2aec3b99e nvk: Bump init context batch size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Thomas H.P. Andersen
b4ddae03b7 nvk: set device info before use in nvk_get_device_extensions
nvk_get_device_extensions uses device->info to enable extensions
only for supported device architectures.

Only info is needed, but it seemed cleaner to keep all the three
changed lines together.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Thomas H.P. Andersen
0e5fcf912f nvk: Implement VK_KHR_draw_indirect_count on Turing+
v2: handle maxDrawCount parameter
v3: assert on pre-turing. Free regsisters after use.
v4: less register presure. Update to pass new tests

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Thomas H.P. Andersen
d0cf79b28f nvk: add warning on non-nouveau drm driver
Check that the drm kernel driver in use is nouveau, and
add a short description of the issue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
0083eb330f nvk: Return VK_ERROR_INCOMPATIBLE_DRIVER if the PCI vendor isn't NVIDIA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
52db7738f7 nvk: Support VK_KHR_shader_draw_parameters
We need to supply the base vertex, the base instance and draw index to
the shader for this extension. Similar to the base instance we supported
before, we load base vertex and draw index as root constants at draw time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
09358fc0c1 nvk: Simplify mme build function argument
We do not need the full nvk_device struct for the mme builder functions,
just the nv_device_info is enough. We keep a pointer in the
mme_builder so we can use this instead. Also, when we run mme builder
tests we do not need to initialize a device struct.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
George Ouzounoudis
ffd896852b nouveau/mme: Keep device info in mme_builder
We keep a pointer to nv_device_info instead of just copying the GPU's
3D engine class.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
c9eac89da8 nvk: Advertise VK_EXT_robustness2
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/39

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
ea06f9a893 nvk: Advertise VK_EXT_image_robustness
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
2532f5654f nvk: Set image index to zero for NULL nvk_buffer_view
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
290bd3e027 nvk: Advertise VK_EXT_mutable_descriptor_type
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/41

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
7ff951d3cc nvk: Enable VK_KHR_maintenance3
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
635b252b4b nvk: Implement nvk_GetDescriptorSetLayoutSupport
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
63c35814aa nvk: Don't over-size push descriptor sets
We were over-allocating them by 4x.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
34e842eedb nvk: Replace asserts with conditional that sets type_list = NULL
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Rebecca Mckeever
b7e39f5e15 nvk: Update mutable descriptor struct type
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Mauro Rossi
f6ab6fe401 nouveau/mme: fix print inst for case MME_FERMI_OP_MERGE
By applying the same coding style of the other case statements,
this patch fixes the following building errors:

../src/nouveau/mme/mme_fermi.c:209:10: error: expected expression
         uint32_t src_bit  = inst->bitfield.src_bit;
         ^
../src/nouveau/mme/mme_fermi.c:216:39: error: use of undeclared identifier 'src_bit'; did you mean 'dst_bit'?
         fprintf(fp, " (%u, %u, %u)", src_bit, size, dst_bit);
                                      ^~~~~~~
                                      dst_bit
../src/nouveau/mme/mme_fermi.c:211:19: note: 'dst_bit' declared here
         uint32_t dst_bit  = inst->bitfield.dst_bit;
                  ^
2 errors generated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Thomas H.P. Andersen
197b4f8fc7 nouveau/mme: use fermi enum in fermi builder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
715dff0b93 nvk: Add a build test for MMEs
This simple test compiles all the MMEs for Turing and Volta to ensure
that they build and don't run out of registers.  We could, in theory, do
actual unit testing here with gtest but just building is enough to
ensure that no one breaks driver start-up on hardware they don't own.
They can still break the driver functionally, of course, but at least
it'll initialize.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
978415e7a2 vulkan/meta: Use the new NIR texture helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
a3716f1b9e nvk: Implement Draw*Indirect on pre-Turing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
4fb8fa5241 nouveau/push: Add an NV_PUSH_MAX_COUNT #define
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
ee8fb23d20 nvk: Reduce register pressure in nvk_mme_build_draw*()
Re-order things a bit so we deal with vertex offset and first instance
separately and free those regs when we're done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
83142c825f nouveau/mme: Don't allow WaW dependencies in the same Turing instruction
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
5560f5f4ff nvk: Make some MME builder names more consistent
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
0d45486f2c nvk: Add a helper for pushing indirect data
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
d5a31866ec nvk: Rework nvk_cmd_push a bit
Instead of taking an nvk_cmd_bo take a nouveau_ws_bo and keep the map
pointer separate.  We'll need to do this when we start pushing stuff
that isn't nvk_cmd_bo.  Also, rework the bounds to be in bytes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
eed24d89dd nvk/drm: Take a byte offset/range in push_add_push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
b76d6725e2 nouveau/mme: nouveau/mme: Add builder tests for SLL and SRL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
aa69c25125 nouveau/mme: Use a uint32_t for size in mme_fermi_bfe()
It will never be a non-fixed value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
c98179b868 nouveau/mme: Add builder tests for SUB
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
e8032b893d nouveau/mme: Add some generic builder tests
These don't need hardware and instead run entirely in the simulator.
The goal is to have something that we can run in CI and which ensures
consistency between the Turing and Fermi MMEs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
15295e32ec nouveau/mme: Unify some of the test framework
Most of the actual nouveau device enumeration and test running framework
was copy+paste between the two.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
94ea7cad3a nouveau/mme: Take a const nv_device_info in mme_builder_init
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
b664b42fce nouveau/mme: Don't swap x and y in mme_fermi_merge_to()
This was probably an artifact of the fermi/turing merge.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
75deae5988 nouveau/mme: Fix is_int18 for negative numbers
util_mask_sign_extend returns a uint64_t which we need to cast to
uint32_t in order to get the right comparison.  Otherwise, we risk
having ~0 in the top 32 bits and the comparison failing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
67008dfe78 nil: Only choose a PTE kind for tiled images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Dave Airlie
22cd2658e8 nvk: Report image alignments from NIL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Dave Airlie
be5a07aa52 nil: Fix image align and size constraints
In order to use compressed images we have to align to at least (1<<16)
though the kernel also likes (1<<21).

This fixes the alignments/sizes so they can work with vm allocs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Dave Airlie
a51b06c730 nvk: set the device fd
This is needed later for syncobj support

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Dave Airlie
ee06bee79a nvk/winsys: store device ptr into bo instead of ptr
This will be needed later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Dave Airlie
be456a3be2 nvk: init dev->physical_device earlier.
When device is passed to bo destroy this is needed earlier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
cca5f6b280 nvk: Cosmetic clean-ups to Create/DestroyDevice
Use dev and pdev instead of device and physical_device.  Also, clean up
whitespace a bit while we're here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
ade334a807 nvk: Handle zero-size index and vertex buffers pre-Turing
According to the nouveau GL driver, this should be the addres of the
last byte, not the byte after the end.  The calculation will overflow if
range is 0 so we need to handle that special.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
7c096786ca nvk: Use a GS for layerered rendering pre-MaxwellB
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
74e8be6545 vulkan/meta: Insert a geometry shader when needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
af3400a957 nvk: Compile all NIR before running codegen
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
George Ouzounoudis
838c92ae95 nvk: Compile geometry shaders
This enables compiling geometry shaders.  Based primarily on gallium
nvc0/nvc0_program.c.

We need to enable/disable user clip planes based on the last geometry
stage.  Some asserts in codegen need to be changed too because the
compacted clip distance inputs are arrayed in the geometry shader. So we
have an array of clip distances for each input vertex.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
ccc50eb276 nvk: Properly align root descriptor tables for pre-Pascal
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
3595701e16 nvk: Free a couple regs in nvk_mme_build_draw_*()
We don't need base_instance after we've set it the first time. We also
don't need to keep intance_count around forever.  mme_loop() always
consumes the value at the beginning so we can free up a register right
away.  Fermi is really tight on registers and this is enough to make
the basic draw MMEs successfully compile.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
dabc4f6bcc nvk: Disable indirect draw/dispatch and query copy MMEs for now
These all rely on mme_tu104_read_fifoed() which isn't available before
Turing.  They're also really register-expensive and we can't compile
them without paring things down a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
731cfb86e7 nvk: Use a contiguous shader heap pre-Volta
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
55be10648d nvk: Add support for contiguous heaps to nvk_heap
This is required for shader heaps pre-Volta because they use a single
64-bit base address and 32-bit offsets for individual shaders.  In this
case, the addresses returned from the heap are relative to the base.
The BO for the heap can be retrieved via nvk_heap_get_contiguous_bo_ref
which returns an actual reference so it's safe to call from the queue
submit path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Mary
dc8fd9050c nouveau/mme: Add Fermi hardware tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Mary
d64a0b787e nouveau/mme: Add Fermi simulator
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
b949a53206 Add add immediate optimizations
Also, immediates are signed 18-bit values so modify the builder to
support the entire range.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
e848cbafa4 Support immediates in MERGE
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Mary
162269f049 nouveau/mme: Add Fermi builder
Co-Authored-By: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Mary
663258be5e nouveau/mme: Add initial Fermi definition
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
5971c0967a nouveau/mme: Take an nv_device_info in mme_builder_init
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
dfe4627e3d nouveau/mme: Prepare the builder for multiple GPU generations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
ff39efdf55 nouveau/mme: Move the cf_stack struct to mme_builder.h
Fermi wants exactly the same thing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
7630f0e645 nouveau/mme: Drop the implicit_imm parameter from mme_alu_to()
It's only used for control-flow and MERGE, all of which are special.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
baa1735364 nouveau/mme: Move the guts of mme_state_arr_to() into mme_tu104_builder.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
9e1a868b6d nouveau/mme: Move the guts of mme_merge_to() into mme_tu104_builder.c
It's going to be a bit different on Fermi.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
0b52da5afa nouveau/mme: Break the Turing builder guts into a separate header
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
724f7a875f nouveau/mme: Make helpers less Turing specific
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
cc87631b20 nouveau/mme: Use mme_mov() for temp copies of register IMM32 sources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
d207b3356e nouveau/mme: Add an intermediate MME_CMP_OP enum
Having everything go through the Turing opcodes isn't a good long-term
plan so add an intermediate which is independent of HW generation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
c0c7e23ca8 nouveau/mme: Add an intermediate MME_ALU_OP enum
Having everything go through the Turing opcodes isn't a good long-term
plan so add an intermediate which is independent of HW generation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
db5b38cb9e nouveau/mme: Add a mme_reg_alloc struct
This has some nice asserts which we'll want when we start having
reserved registers on Fermi.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
2d7f96228d nouveau/mme: Move mme_value into its own header
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Rebecca Mckeever
70ce8ba5a4 nvk: Implement VK_EXT_image_view_min_lod
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/40

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Rebecca Mckeever
71da9cbefb nouveau/nil: Add macros for ufixed
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
fa5a82dc32 nouveau/mme: Make alu_op_to_str static
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
ffc619b3eb nouveau/mme: Invoke SET_OBJECT in the tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
6fd6baa989 nouveau/nil: Use nv_device_info for format queries
There's no reason why any of this needs access to the fd or the context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
f23b892a9d nouveau/nil: Take an nv_device_info for image functions
There's no reason why any of this needs access to the fd or the context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
433e742682 nouveau/winsys: Move device type into nv_device_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
87f946730f nouveau/winsys: Add an info to nouveau_ws_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Faith Ekstrand
0d25483101 nouveau/winsys: Take a drmDevicePtr in nouveau_ws_device_new()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Rebecca Mckeever
44431f8ee5 nvk: Implement VK_EXT_non_seamless_cube_map
Add new bit to VkSamplerCreateFlags and then advertise
VK_EXT_non_seamless_cube_map.

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/42

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Rebecca Mckeever
788ae9b601 nvk: Enable shadow sampling
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
53e0bef359 nvk: Advertise EXT_4444_formats
The following tests now pass:

dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.nearest
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.linear
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.nearest_mipmap_nearest
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.linear_mipmap_nearest
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.nearest_mipmap_linear
dEQP-VK.texture.filtering.2d.formats.a4b4g4r4_unorm.linear_mipmap_linear

The corresponding tests for a4r4g4b4_unorm are still passing.

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/36

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
e89a715f4a nvk: Add A4B4G4R4 formats to nil_format_info table
The nil_format_info table contains the following lines, which add
A4R4G4B4 formats.

   C4(A, B4G4R4A4_UNORM,   NONE,       B, G, R, A, UNORM,   A4B4G4R4,   T),
   F3(A, B4G4R4X4_UNORM,   NONE,       B, G, R, x, UNORM,   A4B4G4R4,   T),

Add similar lines to the nil_format_info table for A4B4G4R4 formats.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
115644cbc6 nvk: Add VK_FORMAT_B4G4R4A4_UNORM_PACK16 format to nil_format_info table
The following tests now pass:

dEQP-VK.pipeline.monolithic.sampler.view_type.2d_unnormalized.format.b4g4r4a4_unorm_pack16.*

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
44b7d71c65 nvk: Advertise KHR_device_group
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/35

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
d471da3f95 nvk: Implement nvk_CmdDispatchBase and delete nvk_CmdDispatch
Implement nvk_CmdDispatchBase() and then delete nvk_CmdDispatch() so that
the vk_common verion with be used instead. This will avoid repeated code.
Update nvk_CmdDispatchIndirect() so that it sets the three base_group
fields of the root descriptor table to 0.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
3fb732ad7d nvk: Lower base_workgroup_id
Lower load_base_workgroup_id intrinsics to a load_ubo using NIR.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
668e859255 nvk: Add base_group to root descriptor table
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
3c5fbfcc30 nvk: Set maxMemoryAllocationCount
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Thomas H.P. Andersen
7bb03cbd7a nvk: call correct macro to clear views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Thomas H.P. Andersen
1de2bc6144 nvk: fix maxPushDescriptors
maxPushDescriptors was advertised as 0.

Spotted with Sascha Willems pushdescriptors example

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
436171ecf1 nvk: Add a helper for loading resource_index-based descriptors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
abe806236d nvk: Drop block_size from the root descriptor table
It's unused because Vulkan doesn't support compute dispatches with an
unknown workgroup size.  If we ever do, we can add it back in. In case
it ever comes back, add an unreachable() to nvk_nir_lower_descriptors().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
6411cbc6c5 nvk: Lower load_num_workgroups ourselves
Instead of relying on the back-end to put it at a magic offset in a
magic constant buffer, lower it in NIR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
3a6aeb7caa nvk: Rename grid_size to group_count
That's the Vulkan name for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
03738819f9 nvk: Capitalize NVK in user exposed strings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Yusuf Khan
062b8e7477 nvk: expose KHR_driver_properties
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
748bc8e487 nvk: Advertise VK_EXT_separate_stencil_usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
0a84e58180 nvk: Advertise EXT_index_type_uint8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
c461c30181 nvk: Advertise KHR_uniform_buffer_standard_layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
1bcb8797bc nvk: Enable KHR_dynamic_rendering
We've been dynamic rendering since day 1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
dd044423a2 nvk: Advertise VK_KHR_bind_memory2
We already use the entrypoint (via the 1.0 wrappers); we just need to
turn on the extension.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
1e5b6074e0 nvk: Advertise samplerMirrorClampToEdge via 1.2 features
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
b934e98452 nvk: Enable VK_EXT_provoking_vertex
We already have it plumbed through.  Just need to turn it on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
d1b9441a8e nvk: Enable inheritedQueries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
0e84eb35e2 nvk: Re-order Vulkan 1.0 feature bits
Also, leave TODO comments for anything we want to enable but haven't.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Rebecca Mckeever
45c2ebc341 nvk: Convert system values for gl_PointCoord and PointCoord into inputs
Currently, any attempt to use gl_PointCoord (GLSL) or PointCoord (SPIR-V)
results in an assert in codegen:

ERROR: unknown nir_intrinsic_op load_point_coord

This patch addresses the error by converting nir_intrinsic_load_point_coord
system value into VARYING_SLOT_PNTC. The following tests now pass:

dEQP-VK.glsl.builtin_var.simple.pointcoord
dEQP-VK.glsl.builtin_var.simple.pointcoord_uniform_frag
dEQP-VK.glsl.builtin_var.simple.pointcoord_uniform_vert

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/33
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
a08ad59ea6 nvk: Use nvk_buffer_addr_range for buffer descriptors
Because the helper checks for buffer == NULL, this should prepare us for
VK_KHR_robustness2 where we need to handle null descriptors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
08e5a211dc nvk: Add an nvk_buffer_addr_range helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
e0e16a7893 nvk: Fix a comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
George Ouzounoudis
d8c21d89e8 nvk: Support large points
We just need to enable the shader attribute.  With point sprite
rasterization we get correct results on rasterization and draw tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
George Ouzounoudis
e6ef49b454 nvk: Switch point rasterization to point sprites
It seems for Vulkan we always need square points with shader PointCoords
just like OpenGL point sprites.

From vulkan spec's point rasterization:
"Point rasterization produces a fragment for each fragment area group of
framebuffer pixels with one or more sample points that intersect a region
centered at the point’s (xf,yf).
This region is a square with side equal to the current point size.
... (xf,yf) is the exact, unrounded framebuffer coordinate of the vertex
for the point"

From OpenGL compatibility spec:
Basic point rasterization:
"If point sprites are enabled, then point rasterization produces a
fragment for each framebuffer pixel whose center lies inside a square
centered at the point’s (xw, yw), with side length equal to the current
point size.
... and xw and yw are the exact, unrounded window coordinates of the
vertex for the point"

Also in OpenGL multisampling leads to circle points as we see in the spec:
Point multisample rasterization:
"This region is a circle having diameter equal to the current point width
if POINT_SPRITE is disabled, or a square with side equal to the current
point width if POINT_SPRITE is enabled."

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
4fa8df43ea nvk: Lower image_size to txs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
ae14362ff6 nvk: wire up M2MF for Fermi
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
970bd70584 nvk: allocate VAB memory area
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
8633aac584 nvk/device: fix order of error handling
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
27d6f994ba nvk: support pre Maxwell Texture Headers
GM10x seems to disable it by default, so enable them there.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
6214bfd139 nvk: bind more subchans in init_context_state
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
cd48710176 nvk: reduce pitch for FillBuffer
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
1eb63dd19a nvk: use remaps for image copies
This helps us to get around hardware limitations on the width.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
a39d22f246 nvk: properly align slm size
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
cb54c32fee nvk: Use SET_PIPELINE_PROGRAM pre-Volta
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
f24bd52915 nvk: align desc root table
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
2a8673f694 nvk: rework QMD handling to support pre Turing
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
80d0a074fc nvk: properly align shaders pre Turing
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
1949c83381 nvk: fix some class version checks
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
891624b08f nvk: Advertise EXT_vertex_attribute_divisor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Thomas H.P. Andersen
b9316b624a nvk: advertise EXT_image_2d_view_of_3d
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Thomas H.P. Andersen
380a2bc795 nvk: add check for VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT
The tests in dEQP-VK.pipeline.*.image_2d_view_3d_image.* set this
bit and nil was not checking for it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
George Ouzounoudis
6f9319f60f nvk: Support base instance in instanced draw calls
Vulkan's gl_InstanceIndex is different than OpenGL gl_InstanceID.
For nvk, gl_InstanceIndex is lowered as gl_BaseInstance + gl_InstanceID in nir
code. This means we need to supply base instance to the vertex shader.
We load the value at mme draw time to a root constant, as it seems there
is no existing system value corresponding to this info.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
George Ouzounoudis
b2a52982d1 nvk: Set base vertex state in sequential mme draw
We need to set base vertex state to zero before emitting a sequential
draw call, if we have already emitted an indexed draw call that changed
that state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
George Ouzounoudis
73f5ab5456 nvk: Add a macro for root descriptor table byte offsets
Use a helper macro instead of using offsetof directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
George Ouzounoudis
0de4083544 nvk: Do not increment instance id across draws
In cases of multiple draws (i.e. indirect draws) instance id should not
increment across draw boundaries. Use a local copy of "begin" to modify
the instance id inside the instances loop only.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
ff30b05917 nvk: Add a devenv ICD json file
This also reworks the ICD generation stuff based on the radv header

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
b0d8ddc70e nvk: Support VK_FORMAT_B10G11R11_UFLOAT_PACK32 for vertex buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Dave Airlie
c9b72acc4e nvk: fix multiple pipelines failure allocation case.
Fixes these failures:
dEQP-VK.api.object_management.alloc_callback_fail_multiple*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
79d7ee22e1 nvk/format: Style fix for VkFormatProperties3KHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
7d629d7aec nvk: Add a bo size to nvk_descriptor_set
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
3568027b9d nvk: Assert that descriptor buffer access stays in-bounds
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
be417625c4 nvk: Advertise VK_KHR_depth_stencil_resolve
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
d47ca67cde nvk: Advertise MSAA via image format properties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
8dc19e1cce nvk: Stop advertising higher framebufferNoAttachmentsSampleCounts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
d6a0c1cd4b nvk: Replace gl_SamplePosition with fract(gl_FragCoord.xy)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
4bd2ba31fc nvk: Use meta for MSAA resolves
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
1c3dc8c632 nvk/meta: Fix restore for descriptor set 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
1a94c55632 vulkan/meta: Add support for MSAA resolves
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
57314fcdc6 vulkan/meta: Rename vk_meta_blit.c to vk_meta_blit_resolve.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
d813fe50a4 vulkan/meta: Support writing stencil as iterative discard
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
c184b54ef9 vulkan/meta: Break the guts of blit into a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
266a472b28 vulkan/meta: Add a helper for building texture ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
996844f884 vulkan/meta: Bind whole LODs of 3D blit destinations
Instead of only binding the layers we need, bind the whole LOD.  In
particular, we now set a layer range of [0, 1] when creating the image
view but a layerCount of minify(depth, level) in VkRenderingInfo.  While
still a bit out of spec, this is more in line with how 3D image views
typically work for sampled and storage images and allows us to avoid
creating 2D images views which would require 2D_ARRAY_COMPATIBLE_BIT.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
a34edc7500 nvk: Fill out sample locations on Maxwell B+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
7660e585f6 nvk: Stop creating a new upload BO every time
We intended this optimization for the case where we're uploading more
data than we had in the previous upload BO.  If there is no previous
upload BO, we always want to set it to the new one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
55278fe2b8 nvk: Set correct multisample regs for graphics pipelines
This adds SAMPLE_MASK_*, ANTI_ALIAS_CONTROL, and drops ANTI_ALIAS which
we set in BeginRendering().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
0842cae081 nvk: Pass through a shader key for fragment shaders and MSAA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
a02f65809c nvk: Use the right view format for stencil texturing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
de3ef1a9ec nvk: Support copies of MSAA images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
9145286083 nvk: Handle multisampled render targets properly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
a34467001d nvk: Handle zero color attachments better
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
48f9ec1fe5 nvk: Stop asserting on MSAA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
0ae334b32b nouveau/parser: Handle SET_ANTI_ALIAS_SAMPLE_POSITIONS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
c3a6b529e4 nouveau/parser: Sort METHOD_ARRAY_SIZES
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
28e73a72f6 nil: Add an offset4d struct and some helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
256a1e4193 nil: Properly support MSAA
We had a num_samples field in nil_image but didn't do anything with it
for layout.  This adds real code for MSAA which seems analygous to the
code in nvc0_miptree.c and seems to match HW based on my image layout
R/E crucible test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
157fa1871c nil: Use ONE for the anixotropic coarse spread function
No idea if it's what we want but this is what nouveau does and it's good
to be consistent for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
f35b0f6f2a nvk: Implement CS invocations statistics queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
62bd03a0e7 nouveau/mme: Add a mul64 helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
adb880cd29 nvk: Implement DispatchIndirect
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
1179d7606b nvk: Break the guts of CmdDispatch into a helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
0b2f9cfecd nvk: advertize KHR_relaxed_block_layout
Test run totals:
  Passed:        16/32 (50.0%)
  Failed:        0/32 (0.0%)
  Not supported: 16/32 (50.0%)
  Warnings:      0/32 (0.0%)

Not supported is: "Physical storage buffer pointers not supported", so
waiting for VK_KHR_buffer_device_address.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
ed6d5c33c6 nvk: Implement VK_EXT/KHR_buffer_device_address
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Emma Anholt
07f48c925b nvk: Use depth_clamp_enable to select PIXEL_*_Z_CLAMP.
Fixes most of "-t depth_clamp" (just point_list fails, but other
point_list stuff fails too)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Emma Anholt
d6423d402c nvk: Fix missing init of the stages to sync against.
Fixes: d8a0dcb234cd ("nvk: Events")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Emma Anholt
8f25f9f068 nvk: Remove duplicate (disabled) point sprite setup.
There's another copy of this above, with just slightly different unused
state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Dave Airlie
5610fad23e nvk: fix copy lower address extraction
this was missing an 0xf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
d4d210c588 nvk: sort extensions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
130e9381a8 nvk: fix initialization override
this is already set a few lines up

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
3974f88de7 nvk: drop dead assignment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
683102a3bd nvk: drop dead assignment
p_format is not used again after this assignment

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
f4fc6511ac nouveau/headers: Add generated headers to dependencies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
fd70fcd62b nvk: CmdPushDescriptorSetWithTemplateKHR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
1944af3260 nvk: Add a helper for pushing descriptors
This reduces the boilerplate a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
15be43acc1 nvk: KHR_descriptor_update_template
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
e1b0e6220f nvk: advertise KHR_sampler_mirror_clamp_to_edge
Test run totals:
  Passed:        3162/13944 (22.7%)
  Failed:        0/13944 (0.0%)
  Not supported: 10782/13944 (77.3%)
  Warnings:      0/13944 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
de85746f90 nvk: advertise EXT_private_data
Test run totals:
  Passed:        69/112 (61.6%)
  Failed:        0/112 (0.0%)
  Not supported: 43/112 (38.4%)
  Warnings:      0/112 (0.0%)
  Waived:        0/112 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
86283a4fc4 nvk: advertise KHR_image_format_list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Thomas H.P. Andersen
e23f6819e0 nvk: advertise KHR_shader_non_semantic_info
Test run totals:
  Passed:        8/8 (100.0%)
  Failed:        0/8 (0.0%)
  Not supported: 0/8 (0.0%)
  Warnings:      0/8 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
c0f42ddee4 nvk: Advertise VK_KHR_storage_buffer_storage_class
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
574b92ded6 nvk: Move more states to dynamic
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
350e851b47 nvk: Advertise VK_EXT_extended_dynamic_state3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
07f6947981 nvk: Implement VK_EXT_border_color_swizzle
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
39958c9e9d vulkan: Add a helper for swizzling color values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
55483d8c7c nvk: Advertise custom border color features
We were advertising the extension string but not filling out the
features struct.  Now we should be properly advertising it "for real".

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
611889bc2a nil: Fix include guards in nil_image.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
640783513b nvk: Use 2D array views for 3D storage images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
1fd3e5ff1d nvk: Advertise VK_KHR_maintenance1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
2c57a941cd nvk: Support 2D views of 3D images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
7559d2e93c nil: Add a helper for getting 2D views of 3D images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
343933d77a nvk: Support copies between 3D and 2D images
This requires that we unify and only have one layer count for the copy
region so we arbitrarily choose extent_el.depth.  We could choose layer
count but we already have a VkExtent3D so we may as well use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
681224260f nvk: Bind 3D images as 3D for clears
Normally, Vulkan doesn't support binding 3D image views for rendering
but we support it in NVK.  If we bind it as a 2D array, that requires
setting 2D_ARRAY_COMPATIBLE_BIT to get a 2D array layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
c3f5211137 nvk: Implement VK_EXT_pci_bus_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
9b20394b89 nouveau: Add PCI information to nv_device_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
8e722497cd nvk: Tell WSI we don't support legacy scanout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
a3416aab1f nvk: Advertise VK_KHR_separate_depth_stencil_layout
We entirely ignore image layouts on NVIDIA so this is trivial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
426de27b6f nvk: Flush the current pushbuf before allocating a new one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
495c1202d3 nvk: Advertise VK_KHR_imageless_framebuffer
Handled entirely in common code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
ec4675bcfc nvk: Enable VK_KHR_create_renderpass2
Handled entirely in common code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
b8021cc635 nvk: Stop leaking command pool BOs
There are a couple of bugs here.  First, vk_command_pool_finish() may
destroy command buffers which may end up returning BOs to the pool so we
need to wait to call nvk_cmd_pool_destroy_bos() until after that's
happened.  Second, we weren't actually adding allocated BOs to the BO
list in nvk_cmd_buffer so they weren't ever getting returned.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
156d7dd012 nvk: Don't crash if we fail to allocate a push BO
Currently, we continue just fine until nvk_EndCommandBuffer calls
nvk_cmd_buffer_flush_push() and it crashes tring to look at
cmd->push_bo.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
23409aea73 nvk: Events
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
62e8faf56c nvk: Use poll for BO waits
The nouveau ioctl doesn't support timeouts but poll() does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
dd1b27fcb4 nvk: Use mme_load_addr64()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
696a1fe776 nouveau/parser: Handle 6F methods
These are the methods below 0x100 which exist on all subchannels.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
9a0d6cf442 nvk: Use a normal DMA for CmdUpdateBuffer
Sure, inline data is neat and all, but our upload buffers are better set
up for handling large quantities of data.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
e16b1f37a7 nvk: Handle large command buffer uploads better
Change our assertion from a < to a <=.  Also, if the size of the upload
is greater than the amount of space we have left in the old BO, don't
set cmd->upload_bo to point to the new thing.  Instead, let the next
upload carry on with the old buffer since it has more room.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
c86d0e635d nvk: Implement vkCmdCopyQueryPoolResults()
One day, we may want to make this a compute shader like RADV uses but
this gets us up-and-going without more infra and it's probably what we
want for small numbers of queries anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
8f1b9c35fc nvk: Use mme_tu104_read_fifoed()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
8fba9f81b4 nouveau/mme: Add a helper for MME_DMA_READ_FIFOED
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
92970b1515 nouveau/mme: Add a couple helpers for working 64-bit addresses
In the command stream, they always come high bits first which is
backwards from little endian. These helpers follow that same convention
so that MMEs use the same conventions as other registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
54fd3604ef nouveau/mme: Add support for freeing registers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
d83fb1d29c nouveau/mme: Assert on OOB registers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
c88e10dc2f nouveau/mme: Allow ZERO as the destinatio nof mme_load_to
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
052bbd65c9 nvk: Implement pipeline statistics and occlusion queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
26db771abe nvk: Implement timestamp queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
253d1c4469 nvk: Add a query pool object
Also, while we're here, add a skeliton for vkGetQueryPoolResult().  It
doesn't do anything yet because we haven't implemented any qeury types,
but all the helpers, etc. we need are there.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
bc992fc6cc nouveau/parser: Parse all fields in each method
When converting to mako, the break got moved to the wrong spot and we
were only parsing the first method.  Now we parse them all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
6f01802be5 nvk/wsi: Use the common present implementation
This enables WSI for NVK.  Currently, it always gets the blit path and
renders correctly on X11 and corrupts on Wayland.  The problem is that
we don't yet support linear images so wayland gets tiled and is wrong.
The thing that saves us for X11 is the lack of VK_EXT_pci_bus_info.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
d9bb29d3f8 nvk/wsi: Style fixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
279d81c083 nvk: Reset semaphore syncs on wait
Vulkan semaphores are spec'd to auto-reset on wait but we currently
assert on signal that the state is RESET. Without this, semaphores used
more than once assert which isn't what we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
5b9ea2863b nvk: Style fixes in nvk_physical_device.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Karol Herbst
32830a2d07 nvk: support exporting buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
e2d0be7d08 nvk: Rework whitespace in nvk_device_memory.c
Trying to keep things consistent...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
c9a4fd19cf nvk: Allocate shaders from a heap
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
c227cfdaec nvk: Add a shader heap to nvk_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
b110445bb8 nvk: Return a VkResult from nvk_shader_upload()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
52331a3406 nvk: Add a heap data structure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
16bdefa530 nvk: Rework nvk_queue_submit_simple()
This is a few changes rolled into one:

 1. Add a sync flag to force a stall before returning
 2. Re-order dw and push_dw_count to put the count first
 3. Take an array of extra BOs instead of just one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
f25d239675 util/vma: Allow initializing zero-size heaps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
275691e94c nvk: WFI in pipeline barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
32f2317223 nvk: Use meta for doing blits with the 3D hardware
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
2a319d0fe9 nvk/meta: Save/restore descriptor set 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
1ed8fe749d nvk: Support load_layer_id
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
cda469428d vulkan/meta: Implement vkCmdBlitImage()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
98867ad976 vulkan/meta: Fixes for clear
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
edef53c337 vulkan/meta: Add a create_sampler helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
c13c6d04d7 vulkan/meta: Add a helper for image view types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
ecf5c5c46d vulkan/meta: Add key types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
07530902b2 nvk: Properly implement robustBufferAccess
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
acf067d635 nvk: Add lowering for load_global_constant_bounded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
9f57d958c3 nvk: drop nvk_nir.h
Instead, move the definition of nvk_nir_lower_descriptors to
nvk_shader.h.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Thomas H.P. Andersen
f098d26e91 nvk: use common pipeline layout code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Thomas H.P. Andersen
04e7c38fd6 nvk: use common descriptor set layout code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
e0c551599f nvk: Bring back push sync and dumping
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
13c73e3214 nvk: Also store the push BO map in nvk_queue_state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
23aaa4e179 nvk: Add an nvk_queue_submit wrapper
Instead of having the common queue code call into drm_nouveau code
directly, add a wrapper layer.  This gives us a place to put things like
command buffer dumping.  Importantly, we move calling
`vk_queue_set_error()` to this layer because it may abort if the
`VK_ABORT_ON_DEVICE_LOST` is set and we may want to dump before that
happens.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
f249555504 nvk: Embed a nv_device_info in nvk_physical_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
e523c04006 nvk: Reference descriptor set layouts in the sets themselves
We need descriptor set layouts for vkUpdateDescriptorSets() but they
have different lifetimes.  This is the entire reason for doing reference
counting at all but we haven't actually set up the descriptor set code
to take references yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
687900de4b nvk: Implement VK_KHR_push_descriptor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
87956e98c1 nvk: Fix up whitespace in nvk_descriptor_set.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
f1611979b4 nvk: Use vk_object_zalloc/free for descriptor pools/sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
b6ce5af12b nvk: Re-indent vk_instance.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
ed2898eb2d nouveau: Drop nouveau_ws_push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
6315ebf58d nouveau: Use DRM interfaces directly in MME tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
cf7b5de3e1 nvk: Remove remaining references to nouveau_push.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
4e58eb39ad nvk: Implement vkCmdExecuteCommands()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
40eedabd4a nvk: Use nvk_cmd_bo for push bufs
This allows us to recycle them.  It also makes implementing secondary
command buffers tractable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
4998896ae8 nvk: Allocate upload buffers from the command pool
Instead of the growing BO thing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
c1b92bdf71 nvk: Add an nvk_cmd_buffer_ref_bo helper
We only need this for internal stuff that isn't tracked any other way.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
567148c172 nvk: Add an nvk_cmd_buffer_push helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
87686a2220 nvk: Rework side-band data upload
Instead of doing magic alignments, it now takes an explicit alignment
parameter.  Also, we now have a version of the helper which does the
memcpy.  This should encourage users to avoid reading reading upload
maps in case they're ever write-combine in the future.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
56843707c1 nvk: Constant buffer alignment is actually 64B
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
42fb0646a1 nvk: Fully populate QMDs before uploading
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
9ae0a5fb16 nvk: memcpy root descriptors for compute instead of doing a DMA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
9bc97bc208 nvk: Return VkResult from nvk_cmd_buffer_upload_alloc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
903c000055 nvk: Add BO recycling to the command pool
Command BOs (nvk_cmd_bo) are automatically mapped recyclable BOs to use
for upload and push buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
366fa3c7e1 nvk: Use cmd instead of cmd_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
8b4f441e84 nvk: Break nvk_cmd_pool into its own file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
4bdeaef7f2 nvk: Use queue_submit_simple for zero_vram
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
4ebb6ca41b nvk: Use submit_simple for draw state init
We also move it to being a queue function.  This architecturally makes
more sense even if it seems a bit redundant at first. Worst case, we
initialize multiple times but this guarantees that we're initialized by
the time we try to submit something.  It also doesn't matter now because
we only have the one queue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
a132e18846 nvk: Initialize the queue later in device setup
We basically want it at the end but before we set up meta.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
b660d064c2 nvk: Add an nvk_queue_submit_simple helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
1094ffa82c nvk: Use a regular BO for the queue state push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
08d0231dac nvk: Use a regular BO for the empty push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
1cf4eea7b3 nvk: Submit pushbufs directly
By getting rid of the winsys stuff we can batch everything into a single
ioctl which should be a bit more efficient.  It also simplifies BO
reference handling because we no longer need any of the save/restore
nonsense because we're the ones building the BO list, not the pushbuf
code.  This should be a lot more robust.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
3ffa526c04 nvk: Move queue_sumbit to nvk_queue_drm_nouveau.c
We're about to start doing nouveau DRM specific stuff in here so let's
move it to a nouveau DRM specific file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
1832acbac6 nvk: Always allocate empty_push
We always allocate it on queue_submit anyway so we may as well allocate
it up-front.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
75a97b6cb7 nvk: Use bo_new_mapped for the zero page
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
b8d092afb1 nouveau: Add a nouveau_ws_bo_new_mapped helper
Error handling for allocating a bo and immediately mapping it is a pain.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
dee921f46d nvk: Use nv_push directly for graphics pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
5ce9d75701 nouveau: Move push dumping to nv_push.c
Because we need access to classes, we also add a basic device info
struct.  We'll expand on this a bit later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
f89f05c94e nouveau: Move push validate to nv_push.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
76edce98f7 nouveau/parser: Take a FILE* in DUMP_*_MTHD_DATA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
fb9524f5dd nouveau: Move nv_push and helpers to their own header
We put this in nvidia-headers to separate it from the pushbuf stuff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
ccd670cc2f nouveau: Rename the fields of vk_push
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
60fa24ee09 nouveau: Add an nv_push struct
This encapsulates the minimum we need for the push macros/functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
3964457ba0 nvk: Use p for the nouveau_ws_push_buffer in zero_vram
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
e16918df03 nvk: Implement vkCmdDraw[Indexed]Indirect()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
9ceec19adb nvk: Use MME for vkCmdDraw[Indexed]()
This lets us move the instance loop to the MME and stop emitting state
per-instance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
02783c822c nouveau/mme: Add helper macros for setting fields
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
d6ac9dcac7 nvk: Use MME for clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
d753d0a809 nvk: Add MME infrastructure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
f50e7cf015 nouveau/mme: Add unit tests for the Turing+ MME simulator
These verify that its behavior is the same as the hardware.  Very useful
for reverse engineering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
e4b936d817 nouveau/mme: Make the winsys headers C++ safe
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
58b9108468 nouveau/mme: Add an isaspec-based dumper
This actually dumps everything, unlike the pretty printer which tries to
dump something readable and may ignore bits of instructions if it thinks
they're no-ops.  Useful for debugging the pretty printer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
4a5c0b686a nouveau/mme: Add a tiny simulator for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
51e8194736 nouveau/mme: Add a builder for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
e9170ef452 nouveau/mme: Add an assembler and disassembler for the Turring+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
01d0c78386 nouveau/mme: Add isaspec XML for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
af961f9aec nouveau/mme: Add basic structures for the Turing+ MME
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
a6c62732da nouveau/parser: Add more arrays
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
9db0c9fb2d nouveau/push: Fix a void pointer arithmetic bug
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
33ed4b9bc5 nil: Don't claim texture support for 2-bit SNORM
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
1e3e00dad7 nvk: Increase the graphics pipeline push space
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
82fc528773 nvk: Use VK_IMAGE_USAGE_*_ATTACHMENT_BIT for image clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
46f54d53e8 nvk: Drop a TODO
Dynamic buffer bindings work fine

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
8825d8effe nvk: Use f for extension features
It's shorter and more ergonamic and the driver is still small so we can
pick a reasonable convention before things get out-of-hand.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Emma Anholt
e96c3cb965 nvk: Fix unused result warnings in pushbuf resets.
We know we aren't hitting the resize paths here, so errors can't be
thrown.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Emma Anholt
2773e55e86 nvk: Fix uninitialized result usage in NVK_DEBUG_ZERO_MEMORY.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Emma Anholt
5d0aa694ee nvk: Avoid strict aliasing warning in the pushbuffer encoding.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Karol Herbst
5c853ed300 nvk: fix zero page refing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
7f413ef104 nouveau/parser: Put the dump helpers in C files
This should make the build faster since we don't have to compile those
giant functions with giant switch statements constantly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
7e1291d7be nouveau/parser: Use more idiomatic python
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
9855b80a7a nouveau/parser: Convert to mako
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Karol Herbst
309c6cfd99 nvk: alloc a zero page and use it for vertex runouts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
c87a7b87fa nvk: Initialize fixed draw/default state once
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
daa6f9c700 nvk: Start every command buffer with a nop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
7cdb86a843 nvk: Split nvk_queue into its own file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Thomas H.P. Andersen
adb71cace7 nvk: fix mem leaks
device would leak in various situations.
Separate out lables were needed in the earlier
versions of this function but now we can just
use a single label

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Thomas H.P. Andersen
c9f0ec90fc nvk: delete commented code
nvk_CmdClearColorImage first lived in nvk_cmd_copy,
then moved to nvk_cmd_meta, and finally in nvk_cmd_clear

I seems that this was left behind in one of the moves

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Thomas H.P. Andersen
c086d60466 nvk: fix implicit-fallthrough warnings with clang
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Thomas H.P. Andersen
6bfecf8448 nvk: use common physical device enumeration
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
3f16c30516 nvk: fix OOB read inside nvk_get_va_format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
6ba98ca4a1 nvk: Update to the new command buffer infrastructure
We leave nvk_command_pool because we'll want to use it for recycling
individual pushbufs.  Drop reset_on_submit becuse there was never really
that much point in that micro-optimization and it isn't thread-safe
anyway if we recycle things in the pool.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
fa8be32aec nouveau/ws: push chaining
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
3d5b9d8b78 nouveau/ws: rework refing push buffer bos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
c791fae67b nouveau/ws: bound check nouveau_ws_push_append
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
6f702f9939 nvk: Add some asserts for nv50 compiler image restrictions
These just ensure that we assert instead of doing something that the
nv50 compiler is likely to screw up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
c36ee41fdb nvk: Zero unused descriptors
When a descriptor gets freed because a buffer/image veiw or sampler is
deleted, zero out the descriptor memory.  This prevents the descriptor
from being used later and faulting on possibly non-existant memory.

While we're here, clean up the function a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
67a45d1c5f nvk: Implement descriptor table growing
Now that command buffers are no longer referencing descriptor table BOs
directly and we're not handing out maps, we can support growing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
cad1834ba4 nvk: Rework nvk_descriptor_table_add/remove
The new api returns a VkResult for more accurate error checking.  More
importantly, it also does copies the descriptor data into the table
instead of returning a map.  This means the users of the descriptor
table will never see a map and we can make sure that the copy happens
under the lock in case we have to grow.  Since each descriptor is only
32 bytes, this isn't going to be a perf problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
9e549ce08b nvk/sampler: Free descriptor table entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
b13faff71c nvk: Invalidate texture header and sampler caches each submit
It's possible descriptors have been added or removed.  We could track
it, but there's really no point.  Per-submit shouldn't be terrible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
6935fe5c68 nvk: Rework TLS/SLM and image/sampler table handling
When Dave originally added SLM, he did so with a preamble pushbuf which
sets up the SLM area prior to executing any actual command buffers.
This has the advantage that the SLM BO is never directly referenced in
any command buffer and we can swap it out even after command buffers
have been built.  When I added image/sampler tables, I sort-of went
along with it but then did something different for 3D.

Thanks to buffer reference counting, we can employ a fairly simple
locking scheme.  Each of the globals: images, samplers, and TSL has a
lock which gets taken whenever the table is modified.  When we go to do
a submit, we take each lock and take a queue-local reference to the BO
and grab a copy of its size parameter under the lock.  If anything has
changed, we update the queue-local preamble pushbuf.  Because the queue
also holds a reference, we can safely proceed to submit command buffers
which reference those global BOs without the individual global locks
taken.  If SLM or one of the descriptor tables resizes while we're
mid-submit, our reference to the BO will remain valid until either the
destruction of the queue or the next submit.

The one small bit of threaded cleverness (one always has to be careful
with that) is that the SLM size can be checked without taking the lock
because the SLM size only ever increases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
e8183da71f nvk: Drop most buffer tracking
If it's backed by an nvk_device_memory, we don't need to track it since
we always add all of those to every submit so that bindless works.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
a43e3fc80b nvk/dispatch: Rename push to p
I took to using this convention in nvk_cmd_draw.c because it's shorter.
Let's use it other places too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
26fc226a7e nvk/blit: Rename push to p
I took to using this convention in nvk_cmd_draw.c because it's shorter.
Let's use it other places too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
23260c3619 nvk/copy: Rename push to p
I took to using this convention in nvk_cmd_draw.c because it's shorter.
Let's use it other places too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
39b64aed3f nvk: Inline nouveau_copy_linear
It has exactly one caller so the helper's not really doing us much.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
71c830278f nvk: clean up bo mappings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
05bc4500ad nouveau/ws: add a bo unmap helper function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
886db84e94 nouveau/ws: add API to query if the context was killed
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
e1af0f983f nvk: Fix dynamic buffer descriptor copies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
c88cf7828d nvk: Set up clip and cull distances
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/12
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
7696f8c8d2 nil: Fix nonnormalized coordinates
Also, replace our TODO with a real comment explaining how nonnormalized
coordinate select works between image and texture header.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
d407e2b130 nil: Fix max mip level
The MAX_MIP_LEVEL field needs the actual number from the image because
it's used to compute the stride between layers.  The restrictions on mip
level come entirely from the RES_VIEW fields.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
89591214a3 nil/format: Depth/stencil formats appear as red
Previously, it was treated as luminance and the depth or stencil
component was broadcast to all channels except alpha.  In Vulkan, depth
and stencil textures are treated as red.  If we want it treated
differntly by some other API, that driver can do that with a swizzle.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
fe84f07fce nvk: Fix border color alpha
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
d3f4a23f7b nvk: VkSamplerCreateInfo::mipLodBias is signed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
b5cdb13b55 nvk: Assert on CmdExecuteCommands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
bd4988b9c0 nvk: Fix max anisotropy
Now that we're using the bitpack helpers, we don't need the extra shift

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
2a2076b0d2 nvk: Don't advertise tiling on non-power-of-two formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
60f41aca47 nvk: Use a UINT format to clear non-renderable images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
177c968cd1 nvk: Implement vkCmdClear*Image directly
Instead of invoking the meta code, implement it ourselves so we get the
HW clear path.  We could probably put these implementations somewhere
common since they only set up a few things and invoke Begin/EndRendering
but there's not that much point for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
f1aa12d596 nvk: Add image_view_init/finish functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
7b7bfbcc61 nvk: Use hardware clears for attachment clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
10d16dce1c nouveau/parser: Add array and float tags for clear values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Mauro Rossi
4d02d9d796 vulkan/meta: fix gnu-empty-initializer build error
Fixes the following building error:

../src/vulkan/runtime/vk_meta_clear.c:213:42: error: use of GNU empty initializer extension [-Werror,-Wgnu-empty-initializer]
   struct vk_meta_clear_push_data push = { };
                                         ^
1 error generated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
b877922b07 nvk: Save/restore push constants around meta ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
a1652525e2 nvk: Wire up early z and post depth coverage
Was crawling through header bits and found that we weren't plumbing
these through.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Dave Airlie
b5beae5777 nvk: add basic primitive restart
fixes crucible
func.draw-index16-restart
func.draw-index32-restart

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Yusuf Khan
8e052c311f nvk: support GetImageSparseMemoryRequirements2
KHR_get_memory_requirements2 was enabled but GetImageMemoryRequirem
ents2 was not. This stubs out GetImageMemoryRequirements2 to fix it.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>

v2: remove the v1 version of the command as its provided by the
common runtime

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Yusuf Khan
8271228289 nvk: implement GetDeviceMemoryCommitment
vulkan spec says:

If the memory object is allocated from a heap with the
VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set, that object’s
backing memory may be provided by the implementation lazily. The
actual committed size of the memory may initially be as small as
zero (or as large as the requested size), and monotonically
increases as additional memory is needed.

As far as I can tell we ignore the bit meaning that we allocate the
requested size so return that as the size.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
f3d43c2a86 nvk: Allocate descriptors for input attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
d2b30362eb nvk: Assert samples == 1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
e3afa1e3c2 nvk: Re-flow a couple function prototypes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
0252b000de nvk: Align descriptor buffers to NVK_MIN_UBO_ALIGNMENT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
8fff829b0b nvk: Add nvk_queue_init/finish() helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
1410100ebe nil: Add a PTE kind for Z32_FLOAT
This values was found by trial-and-error poking at the hardware until it
stopped complaining.  It's not clear if we need separate values for
compressed vs. not.  This appears to work on Turing regardless of what
we set for SET_Z_COMPRESSION.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
cbb14e5483 nvk: Return OUT_OF_DEVICE_MEMORY if bo_new fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
91c1be22ed nvk: Set GEOMETRY_SHADER_SELECTS_LAYER properly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
2d108bb672 nvk: Call nir_lower_input_attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
da0ad121bf nvk: Don't destroy NULL descriptor pool BOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
226c152f55 nvk: Advertise depth/stencil support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
5570e2c06b nvk: Flip the front-face setting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
6ab9fe31fe nvk: Enable two-sided stencil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
c6a50c2745 nvk: Fix viewport Z scale
Because Z needs to end up in [0, 1] and not [-1, 1], we don't want to
divide by 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
9deab8f139 nvk: Fix depth/stencil render pass clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
78009a1a9a nvk: Do internal dedicated allocations for ZS images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
ba70017f68 nvk: Add internal helpers for device memory allocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
ac8bbb355a nouveau: Add a function to allocate a tiled buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
71420b4c7d nil: Compute PTE kinds and tile modes for images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
3ef84bc1e0 nvk: Disable sparse Z on Maxwell+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
99248274b4 nvk: Depth buffers don't allow Z-tiling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
90b94828dd vulkan/meta: Make stencil reference dynamic for clears
We call CmdSetStencilReference() but don't set it to dynamic in the
pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6b7ee96391 nvk: Clear dynamic state dirty after flushing it all
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6909155346 nvk: Advertise more format features
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
77db3e99dd nil: Add more format support helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
0af169b86b nil: Re-introduce the format capabilities
The bits are already in the table we copied from the nouveau GL drivers,
we just need to set up some enums and plumb it through.  With that,
we're now properly advertising which formats are renderable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
0c6c2fe2cf nil: Rename rendering to color_target
Also, add a helper for depth/stencil formats and use
nil_format_supports_color_targets() helper to compute Vulkan format
features rather than checking for a non-zero color format.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
e6866593d5 nil: Rename rt to czt in the format info struct
It's used for both depth/stencil and color so rt isn't quite the name we
want.  Also, add a comment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
db0a63c909 nil: Use nvidia headers for ZS format enums
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
56ad7b57a4 nil: Use the nvidia headers for render target format enums
Two notable changes here:

 1. BITMAP no longer exists
 2. B10G10R10A2_UINT was wrongly mapped to RGB10_A2_UINT before

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
312e9a3eb0 nil: Use nvidia headers for texture format enums
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6eaa45933e nil: Properly depend on nouveau winsys and nvidia-headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
53215c98bb nouveau: Add class information to nouveau_ws_device
Annoyingly, with the current uAPI, this requires creating a dummy
context and throwing it away.  Fortunately, we should only do this once
on driver load so it's really not that big a problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
58bf9ff90e nvk: Depth bounds need fui()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
1d4c6cee45 nouveau/parser: Dump more fields as float
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6d1babc9a0 nvk: Clean up try_create_physical_device error handling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
673bb5c8b7 nvk: Advertise vertex buffer format featues
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
db4efa14df nvk: Move the vertex format table into nvk_format.h
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
7fdb8e247d nvk: Re-initialize dynamic_graphics_state.vi when recycling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
26f6458c70 nvk/meta: Save and restore VI state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
e824cdc0e5 nvk: Drop sample locations structs
IDK if NVIDIA hardware even supports setting sample locations.  I've not
been able to find the packets.  In any case, if and when we implement
the extension, we can wire it up then.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
f498696370 nvk: Implement copies for D24_UNORM_S8_UINT images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
25fb43475f nvk/copy: Mape bpp part of nouveau_copy_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
33bdd75639 nvk: handle NULL to destroy descriptor pool
Fixes dEQP-VK.api.null_handle.destroy_descriptor_pool

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
51e24cd5b0 nvk: lower io to temps to avoid output reads in vertex shaders
fixes a bunch of these
nv50_ir_lowering_nvc0.cpp:2878: void nv50_ir::NVC0LoweringPass::handleLDST(nv50_ir::Instruction*): Assertion `prog->getType() == Program::TYPE_TESSELLATION_CONTROL' failed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
875d4fe6f2 nvk: assign vertex locations according to input attrib index
This copies what lavapipe does. is there a better plan?

Fixes
dEQP-VK.draw.renderpass.simple_draw.simple_draw_triangle_list

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
e1b12b49e6 vulkan: Allow scissors or viewports to be set without counts
This is unlikely but can happen if you have the following sequence:

 1. vkCmdSetScissors()
 2. No pipeline bind
 3. vkCmdClearImage() which causes a meta save
 4. Meta restore with vk_cmd_set_dynamic_graphics_state()

In that case, we don't have scissor counts but need to restore the
scissors set with `vkCmdSetScissors()` before the meta save.  We can
safely copy all of them, it's just more memory traffic than maybe we'd
like.  Fortunately, this can only happen at the start of a command
buffer and only with a fairly silly sequence of commands.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
a6f8ab2a2c nvk: Track and reference all device memory objects
This way bindless will work properly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
853f454dba nvk: Don't assert when there are no attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8cc9c91f67 vulkan/meta_clear: Populate VkRenderingInfo::renderArea
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
c24db442b1 nvk: Implement nir_intrinsic_load_frag_coord
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
d97397f084 nvk: Use the new headers for samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
17ab445930 nvk: Bind texture and sampler header pools for 3D
No idea if this has to be done separately for 3D vs. compute but it
shouldn't hurt anything to do it for both.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
c25f0c1dbe nvk: Zero client memory objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
5268ad9b8d nvk: Use meta for CmdClear*Image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
a4c1460641 nil: Switch to using the new headers for TIC entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
24c0aa3a93 nvk: Use max alignment for descriptor pool sizes
Since we only know the number of each descriptor type and not their
groupings, we don't know how alignments will compound.  Figure out the
maximum alignment and then use that for everything to ensure that, no
matter how they're combined, we always have enough room.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
b7acd1030d nvk: add indexed draw support.
This passes the
dEQP-VK.draw.renderpass.basic_draw.draw_indexed* tests for me on Turing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
8017ac0e79 nvk: add some limits/features from binary driver.
These are just copied from nvidia vulkaninfo for my tu104.

I've left geom/tess stuff out for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
ba2faab08c nvk: fix depth emission ordering.
dEQP-VK.api.image_clearing.core.clear_depth_stencil_image.single_layer.x8_d24_unorm_pack32_200x180
was hitting
nouveau_push.h:233: nvk_push_val: Assertion `last_method == idx' failed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
871c587414 nvk: increase graphics cpu push buffer
dEQP-VK.pipeline.monolithic.image.suballocation.sampling_type.separate.view_type.1d.format.r8g8_uint.count_4.size.512x1
was hitting 98 dwords

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
86b05c2750 nvk: fix pipeline pushbuf sizing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8dff06aada nvk: add linear image creation support.
the dEQP-VK.draw.* tests use a tiled + linear image and copy between
them.

This fixes the result gathering, not the actual result.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Dave Airlie
f28bf4407d nvk: add initial 8/16 byte clears.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
3d77175f1d nouveau: Fix pushbuf ref reset for user command buffers
Copy+paste error.  Also, we should do the refs reset before potentialy
doing a full reset, otherwise the refs reset will assert.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
150cba46ba nvk: Enable all the dynamic state features
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
0a9903f778 nvk: Stop using vk_cmd_set_dynamic_graphics_state in meta_end()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
e1c665013b nvk: Use vk_meta for CmdClearAttachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
4746099306 nvk: Expose a bind_vertex_buffer helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
b0d007e7de nvk: Add an addr field to nvk_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
5b10446a9b nvk: Add an attachment format even for secondaries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
b07e2a1049 vulkan/meta: Add implementations of Clear*Image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6a25cba792 vulkan/meta: Implement start-of-rendering clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
daa4485ecf vulkan/meta: Implement attachment clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
514c10344e vulkan/meta: Add a concept of rect pipelines
Most hardware supports some sort of rectangle primitive.  This adds a
new VK_PRIMITIVE_TOPOLOGY_RECT_LIST_MESA which will be used by the vast
majority of (if not all) meta commands.  Drivers can key off of of this
to build pipelines differently and implement their own cmd_draw_rects
and cmd_draw_volume hooks or they can map it to TRIANGLE_LIST and use
the provided helpers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8418d6c97a vulkan/meta: Add an object tracking list
This will let us create objects which get held onto by the command
buffer until it's reset or destroyed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
54366ea922 vulkan/meta: Add the start of a meta framework
For now, this just adds some basic object caching.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8c2f95e3e7 nvk: Color attachments clears via image clears
This is a bit of a hack but it's good enough for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
8ce12f33e2 nvk: Implement vkCmdDraw()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
83598f44a9 nvk: Graphics pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
c9e28274cc nouveau: Add CPU push buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
8530c3c882 nvk: Implement push constants and descriptors for graphics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
1e3e85056b nvk: Emit dynamic graphics state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
d98a7d0de5 nvk: Misc. additional state setup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ff3e099a73 nvk: Add boilerplate for Begin/EndRendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
5ee481bf26 nil/format: Add helpers for render formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
617532b24e nvk: Import 3D context init code from nouveau
We really should organize this better but at least we have it now.
This should pretty much be equivalent to what nouveau is doing on
screen/context create.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
7315650739 nvk: Add a nvk_cmd_buffer_device() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
abb7f69520 nvk/shader: Populate headers for vertex and fragment shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
8df9d16fb4 nvk/shader: Assign I/O locations and gather info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
0b179da344 nvk: Make shader_upload take an nvk_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
61a91914df nvk: Expose pipeline alloc/free functions
This will provide some commonality between graphics and compute.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ae0d8edc1d nvk: Free pipeline shader BOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
c2f636861a nvk: Add an nvk_shader_address helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
782d376363 nvk: Don't free the NIR in nvk_compile_nir
It's a layering violation and the NIR is currently leaked if we the
compile fails.  It's better to make the caller clean up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ffc6c3afaf nvk: Switch to vk_pipeline_shader_stage_to_nir
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
65b1cc3adf nvk: Split pipeline binding into helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
db2cf498ce nvk: Add graphics state to command buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
0f203b2b44 nouveau: Generate 3D headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
b3531276c6 nouveau: Null terminate the debug flag list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
4a22e24e98 nouveau/push: Make P_IMMD more versatile
It's now able to use either the immediate form or method form depending
on whether or not the value fits into 13 bits.  We wrap the check with
__builtin_constant_p() so that this choice is compile-time determined
instead of runtime.  I've verified with SET_CT_SELECT() that GCC is able
to determine which bits are used even if not all of them are constants.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ec0b9109b8 nouveau/parser: Handle arrays properly in P_IMMD()
We make a new macro VA_NVCLS_FOO which is either an array macro or a
regular macro and, either way, redirects to V_NVCLS_FOO.  This lets us
unconditionally use VA_NVCLS_FOO in P_IMMD() and, if the caller hands in
a FOO(i), it will get unwrapped and mangled to produce to V_NVCLS_FOO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
68403e5742 nouveau/parser: Better dump float data
For now, we only do something with floats when we dump.  You still need
to use fui() when setting them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
bbdd35f155 nouveau/parser: Properly dump most arrays used by 3D
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
76e30e64da nouveau/parser: Fix an integer overflow and a typo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
a4b29aaa72 nvk: Init WSI after setting up supported_sync_types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
edfc84b4eb nouveau/ws: allocate copy subchan as well
Starting with Ampere we have to do this. It is a safe thing for previous
gens to do.
Very old kernels might reject this, but too lazy to check.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
25a91f9093 nouveau/ws: allocate 3D subchan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
3f07cd31e3 nouveau/headers: initial 3D headers import
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
e6b2c84d0f nouveau/headers: add path for 3D headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
84830a1725 nvk: set deviceName
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
dc1f87864d nouveau/push: Add a P_INLINE_FLOAT helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
5e3f6f326f nvk: Make image/buffer address helpers const
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
7ebc94a17a nvk: Include nvk_private.h in everything
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Yusuf Khan
d76175955f nouveau/ws: remove the drm.h header
It can cause compilation issues on Arch, there is a workaround by
including it as <drm.h> but this solution is simpler.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Mauro Rossi
403ac39bbc nouveau/ws: fix building error in nouveau_ws_push_dump()
PRIxPTR macro solves the problem

Fixes the following build error:

../src/nouveau/winsys/nouveau_push.c:119:43: error: format specifies type 'unsigned long' but the argument has type 'int' [-Werror,-Wformat]
      printf("[0x%08lx] HDR %x subch %i", cur - push->orig_map, hdr, subchan);
                 ~~~~~                    ^~~~~~~~~~~~~~~~~~~~
                 %08x
1 error generated.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
002516aeb8 nouveau/ws: use new NVIF interface to query oclasses
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
daa91dfedf nouveau/ws: get rid of libdrm
and just completely rework device and context creation

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
cafccc2305 nouveau/ws: depend on generated class header files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a8d545602a nvk: Padd shader BOs by 4K to avoid I-cache overflow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
06cf8244f1 nvk: Bind immutable samplers on descriptor set creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
61e910bde0 nvk: Rework OOM handling for descriptor pools
We now properly return VK_ERROR_OUT_OF_POOL_MEMORY if we run out instead
of silently assigning a NULL bo and map.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
933d487313 nvk: Advertise minUniformBufferOffsetAlignment
Fixes a bunch of dEQP-VK.image.store.with_format.*_constant tests

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
152ded2b97 nvk: No-op sparse image format properties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
0e284f71e1 nvk: Unconditionally zero image format properties
It seems like this shouldn't be neded but some of the tests complain if
we don't because they call vkGetPhysicalDeviceImageFormatProperties()
and vkGetPhysicalDeviceImageFormatProperties2() and compare if they
return identical results even if they return error.  Zero is the
reasonable thing to do if you don't support a format anyway because then
it's a maximum extent, sample count, etc. of zero.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
cf76c3d17c nvk: Initial vkCmdClearImage support
Doing something for some formats is better than silently doing nothing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
f8b48ccf0b nvk: Assert that we don't double-free descriptors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a68b0fcd05 nvk: Delete the storage TIC in nvk_image_view_destroy
Also, assert that descriptors are non-zero.  Zero is reserved for the
null image descriptor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
e1c93352d7 nvk: Support inline uniform blocks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a45f789083 nvk: Use a switch for descriptor types in load_descriptor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
fff59a5f4f nvk: Fix descriptor offset alignment
This fixes two bugs.  First, we were aligning when setting the bindign
offset but not actually applying that alignment to buffer_size so when
we incremented by stride * descriptorCount, it incremented starting with
the unaligned value.  Second, in some cases we return stride = align = 0
and the ALIGN_POT macro will return 0 when something's aligned to 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
443717a17e nvk: Properly indent a comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
98a573eb15 nvk: Implement push constants
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
717ed1c48f nvk: Load the requested descriptor size
We were hard-coding to vec4s for some reason.  This results in vec4
texture handles which, while properly ignroed by codegen, are just
weird and not what we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
b6483f5126 nvk: Handle cube storage images properly
TIC entries for cubes divide the array size by 6 so we don't want that
when using it as a storage image.  This means nvk_image_view needs
separate TIC entries for storage vs. sampled now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
8b08bbe2cf nvk: Use a descriptor type instead of a hand-rolled thing
This was an attempt to prematurely optimize some things.  Sure, it's a
hot-path, but there's other control-flow in there and we can optimize it
later if needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
0648f0fa03 nvk: Advertise non-zero descriptor set limits
Right now, everything's pretty much unlimited.  We may want to limit
UBOs in the future to just what we can bind but everything else will
probably remain pretty high.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
aa78f098f2 nvk: Advertise descriptor array indexing
This isn't as dynamic as it looks.  It still requires the index to be
uniform, it just lets it be not a constant.  Given how our descriptor
sets work, this is all handled trivially already.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
dda149c053 nvk: Better advertise image format features
We now advertise the top-level features and we don't falsely claim
write-without-format support per-format.  In theory, NV hardware should
be able to do shaderStorageImageReadWithoutFormat but codegen doesn't
know how yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
db81c26525 nvk: Add support for dynamic buffers
These are recorded in the CPU portion of the descriptor set and combined
with the dynamic offset at vkCmdBindDescriptorSets time and placed into
the root descriptor table.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
1f7476a03d nvk: Use the correct root descriptor table size for CmdDispatch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
fae4f1884c nvk: Advertise KHR_dedicated_allocation
We're not requiring or even requesting anything to be dedicated yet but
we may as well put in the plumbing.  This gets more tests running.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
fedff04fbd nvk: Implement buffer views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
1f72430bd6 nvk: Move is_storage_image_format to nvk_format.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
788e94294f nil: Add a helper for filling out buffer TIC entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
834f01f1b1 nvk: Implement samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
100c7060d8 nvk: Re-format nvk_sampler.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
cb4eff26e7 nvk: Teture pool sizes are maximums not sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
e13a64d286 nil: Fix image array layer alignments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
f3ef6f2ee1 nil: Refactor TIC image extent setup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
6a6cf64a78 nil: Don't minify image dimensions when setting up TIC
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a67cfe2590 nil: Drop miptail support for now
We don't have any idea how they work or even which TIC bits have to do
with them.  Better off just leave them alone for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Dave Airlie
974212a581 nouveau/classes: add 906f header support.
This needed some tweaks to the generator script

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
7a86192d3a nvk: Drop vk_sync BO refs after push_submit
Otherwise, all syncs are cumulative and, if the same command buffer is
submitted multiple times, it will sync on the union of all syncs it's
ever seen.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Dave Airlie
4c485b0b6f nouveau/ws: add a push reset just for references.
This is to be used with the empty submission pushbuf.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Dave Airlie
e2565c2fc2 nvk: fix empty cmd submission.
The sync obj stuff does a second queue submit with just signals
and no command buffers. Make sure things get sent to the kernel
so sync works.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
bf01f4d66a nvk: Support compressed images in copy commands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
20d8d1e239 nvk: Add a more competent GetPhysicalDeviceImageFormatProperties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
fc19173014 nvk: Rework format features queries
Split the buffer and image portions into vk_buffer_view.c and vk_image.c
respectively.  This way they're a lot closer to each other.  Put the
main combined helper in nvk_format.c since it's a format thing.  Also,
restructure things a bit based on ANV to make the code look nicer.
Also, implement VK_KHR_format_feature_flags2 while we're here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
76253dbf94 nvk: Reset and properly clean up command buffer upload areas
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
2a914028f1 nvk: Implement VkGetImageSubresourceLyout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
23e6689b38 nvk: Re-indent image entrypoints
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
04d2bf2ee7 nvk: Convert to using NIL for image layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
eefb60b832 nvk: Manually offset for array layers in copy/blit
The more I start at the hardware the more convinced I become that arrays
and 3D are not the same thing.  I'm sure they're similar enough in
certain circumstances but they don't appear to be in the way they're
treated in the 2D hardware, especially when miplevels are involved.
Instead of trying to use the 2D engine's depth/slice logic, offset
manually.  We have to emit a copy command for each slice anyway so
making the GPU do those calculations doesn't really gain us anything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
d673111bc8 Revert "nvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable"
This reverts commit 74ad75f2624c50f732db35946a127eb11edee3e5.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
3e706a974e nvk: Move Fill/UpdateBuffer to nvk_cmd_copy
Even if they technically use blit-like HW commands, they're much more a
copy operation than a blit since there's no scaling going on.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
3beb4daa2b nvk: Align arguments consistently in copy/blit code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
b647527476 nvk: Use helpers for push_ref
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
3516136d7a nvk: Add an nvk_get_format helper
This makes the array size internal to nvk_format.c so we don't have to
keep it in sync when we add extra elements.  Also, there's no reason why
we need to be hand-rolling that loop all the time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ec6d56d4ce nil: Add a nil_view and code to fill out TIC entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
c12c94cde3 nil: Add the TIC format table from nouveau
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
69967e3f0d nil: Create images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
13abd1dbf2 nouveau: Add stubs for an image layout library called NIL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
5623de7345 nouveau/ws: initial debugging options for command submissions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
95843dd754 nouveau/headers: Generate parser functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
43444e1a72 nvk/blit: assert that formats are supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
1de656bce3 nouveau/ws: assert on broken channel
no point in continuing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
008e9768ad nouveau/ws: make sure we don't submit nonsense
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ee50fe7d85 nvk: Rework descriptor writes
In particular, this makes us only touch the descriptor UBO memory as a
memcpy destination unless we're doing a descriptor copy.  This should be
much better for mapped GPU memory than the read-modify-write required by
our previous implementation of image descriptor writes with their 12:20
configuration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
7d6ea3fcf5 nvk: Reserve a null image descriptor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
86d367e75b nvk: GART os host-cache-coherent
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
8213eaa99f nvk: Make texture descriptors a bit more acceptable to codegen
Codegen assumes that it gets a combined descriptor on both the texture
and sampler handle sources and that it's 64-bit.  It's not too hard to
just give it that in NIR.  We may make codegen a bit more flexible in
future but, for now, this gets things working.  While we're here, do a
quick optimization for combined texture+sampler descriptors because it's
easy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
c9bf974472 nvk: Add a stub implementation of buffer views
We don't actually populate the TIC entries yet but we can at least
pretend and stick them in descriptor sets.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
8d3f185a4d nvk: Re-format nvk_buffer.c a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
da3e5c13c3 nvk: Re-format nvk_image_view.h a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
9cd1753a29 nvk: Unify descriptor loading in lower_descriptors
The code we were using for images/textures was broken since it didn't
track with the change to always use root descriptors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
035a63d8bf nvk: Set b->cursor when lowering image intrinsics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
e120a789d3 nvk: Fill out TIC table entries for image views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ff84f8aa48 nvk: Add an image descriptor table to the device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
e0d445c28d nvk/image_view: Reformat and fix Create/DestroyImageView
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
52565b1e62 nvk: Copy in the nouveau TIC format table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
108c9dc655 nvk: Add a descriptor table data structure
This will be used for image and sampler descriptors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
2ec2ce44f3 nvk: Mark nvk_push_descriptor_set_ref() inline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
460a026d72 nvk: Allow R32_UINT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ecbc820898 nvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
6a481d8170 nvk: Drop image_view_init
It's unused.  Drop for now.  If we want it for meta later, we can add it
then.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
a0d64f2770 nvk: add basic nve4+ compute support.
This can do most basic compute execution, except indirect

computeheadless demo runs, and some CTS tests pass.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
f845c72283 nvk: add some compute limits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
a2d9f95961 nvk: add some basic format wrapping framework
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
25dc939252 nouveau/winsys: Add m2mf/compute objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
0870cd8719 nvk: add command stream upload buffer.
This is an upload buffer that is kept beside the command buffer.

It can be used to allocate any per command buffer gpu state that
doesn't fit in the cmd stream.

compute dispatches will go in here for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
c8805f4544 nvk: add record result to cmd_buffer.
This keeps track of recording errors so end command buffer
 can report them

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
fa32ee409a nvk: add support for preamble and tls allocation.
This adds support for per-queue allocations that are reallocated
upwards if the submitted cmd needs more space.

This is used to implement the tls allocations for compute.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
a3e5eb1134 nvk: retrieve gpc/mp counts from kernel.
These are needed to size the tls area.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
bd8077bef5 nouveau/vk: add support for compute classes to generator.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
d440084d96 nvk: tiling prep work for VK_EXT_image_2d_view_of_3d
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
b73b91016a nvk: support array blits over multiple layers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
e49a66c40c nvk: support multiple miplevels
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
d8a9d662e4 nvk: Lower load_global_constant_offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
1b7ff4b62c nvk: Re-arrange nir_lower_explicit_io a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
0c775223da nvk: Fetch descriptor set addresses from the root table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
5017a3b092 nvk: Add a root descriptor table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
935f316eb0 nvk: Basic descriptor binding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
95cb668051 nvk: Rework whitespace in nvk_cmd_buffer.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
e2e83e68b6 nvk: Move nvk_cmd_pool cast definitions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
6dfb36c636 nvk: Add a couple descriptor set address helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
fca440dcb2 nvk: Reformat nvk_nir_lower_descriptors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
4fbe45ca58 nvk: Re-arrange nvk_descriptor_set.h a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
9230629c03 nvk: reduce pitch even further in CmdFillBuffer
otherwise the coords would overflow hw limits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
05d969fc2e nouveau/ws: handle 0inc inside nvk_push_val as well
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
1f8682a1e7 nvk: implicitly reset the command buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
eae2eac3cf nvk: Add a skeleton for pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
c165e5b5b0 nvk: Initial wiring in of the compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
124f2708ef nvk: Add an nvk_device_physical helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
8050f61b62 nvk: link in codegen without gallium bits.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
325109122a nvk: advertise VK_KHR_copy_commands2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
eaed2a4340 nvk: implement CmdCopyBuffer2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
198d2da5b1 nvk: implement CmdUpdateBuffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
dc84cf6ccb nvk: implement CmdFillBuffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
fd7d38875d nvk: optimize blit command buffer gen
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
6df4eda000 nouveau/ws: drop the old push generators.
leave drf.h as it's need for the compute qmd stuff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
af823ae71a nvk: port the blit and copy code to new command submission.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
4cd3d74136 nvk: move to new command stream generator.
This auto generates macros/inlines/structs from the nvidia
class headers using a python for noobs script

v2: use argparse.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
b5010e630a nvk/copy: Use nvk_image_base_address()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
13dca99623 nvk/image: Add image address helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
1f42ab6f30 nvk/copy: Use nvk_buffer_address in CmdCopyBuffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
1a906072db nvk/buffer: Add a push_buffer_ref helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
d59c6dc4a7 nvk/buffer: Take an offset in nvk_buffer_address
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
b783809270 nvk: report maxMipLevels as 1
the CTS uses that value in some places

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
242c5ddb67 nvk: add support for blits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
aa0ac90ed3 nvk: simple format table
this is enough to run the image copy and blit tests on a couple of formats

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
d98540c645 nvk: add basic support for images
enough to get basic operations working

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
7e2f7e38bf nvk: use fermi class definitions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
36e5573ef0 nouveau/ws: bind 2D class
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
acbd4523a4 nouveau/ws: set GPU object class
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
8e382f197d nouveau/ws: PUSH_IMMD only works with 16 bit values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
78a94be05a nvk: Re-format descriptor sets some more
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
f57a3ef7f3 nvk: Re-format pipeline layouts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
e9fbac9002 nvk: Re-format descriptor set layouts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
0b675ef7a3 nvk: descriptor set freeing fix
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
d4e71940c2 nvk: implement buffer address.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
56a5ed2b70 nvk: add descriptor set bo allocation.
This allocates the backing bo for the pool, and allocates the
sets from it.

This is mostly ported from radv.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
79c9223864 nvk: Expose nvk_descriptor_stride_align_for_type
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
3033681f93 nvk: some boilerplate for descriptor sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
50ca748b6a nvk: add initial descriptor pool framework.
destruct has internal impl for create to call on errors later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
0930936a6e nvk: reindent descriptor sets to mesa std.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
b8a6a4cb7d nvk: Implement vkUpdateDescriptorSets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
1b2656b674 nvk: Add initial descriptor set lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
04e52c25ac nvk: Implement VkPipelineLayout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Faith Ekstrand
3137f9df6e nvk: Implement VkDescriptorSetLayout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
fc6f9a45e9 nvk: Reset pushbufs on command buffer reset
Karol: also reset on VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
464534995f nouveau/ws: fix setting push bo domains
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
927de5918f nvk: impl nvk_CmdCopyBuffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
bc4f7b4bf1 nvk: add nvk_CmdPipelineBarrier2 stub
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
47b95416ae nvk: add nvk_bo_sync
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
6e0089307e nvk: add cmd buffer framework
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
decb8c6fd4 nvk: allocate a GPU context for each VkDevice
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
f190398049 nvk: Add initial queue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
cd46cf852b novueau/bo: add nouveau_ws_bo_wait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
d71a4d73b8 novueau/bo: refcount it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
f9cd1d6941 nouveau/ws: add a cmd buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
bede03cbd8 nouveau/ws: add context support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
81e680edc9 nouveau/headers: add host classes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
e47b0c42cc nouveau/headers: typedef Nv void types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
2810d4cf6d nouveau/headers: add nvtypes.h
Nvidia does provide an nvtypes.h file within their open-gpu-kernel-modules,
but that one is painful to port over to userspace.

Just provide the defines we will need instead.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
787fbe85b9 nvk: add bind buffer memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
12e8ea2630 nvk: fix header guards to be less generic.
You could imagine want to use these defines for something
that isn't header guards, so just make the headers guards
more explicit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
ab4452b9af nvk: add some initial wsi framework.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Dave Airlie
6725804efb nvk: add missing finish calls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
24641ecce4 nvk: add basic device memory support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
b193729645 nouveau/ws: add bo API
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
d270ad422c nvk: set nonCoherentAtomSize as the CTS divides with this value
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
63a1d52e62 nouveau/ws: add a field for the SM version
This is very useful when looking up capabitilites in Nvidia CUDA docs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
0e9fda6efb nouveau/ws: dup the fd
We do the same in gallium

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
ba7d2ba45e nouveau/ws: reorganize a little
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
cd4e67c536 nvk: advertize memory heaps and types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
b2b13b1944 nvk: implement GetPhysicalDeviceQueueFamilyProperties2 to make the CTS happy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
179f996c04 nouveau/headers: initial sync of headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
b081325fc7 nouveau/headers: add script to sync in-tree headers with open-gpu-doc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
a07b069417 nvk: fix nvk_buffer include guards
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Faith Ekstrand
89d7ce0fda nvk: Add a stub implementation of VkBuffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Faith Ekstrand
bbe7f42e2a nvk: Add stub implementation of VkSampler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Faith Ekstrand
32b7d178fd nvk: Add stub implementations of VkImage and VkImageView
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Faith Ekstrand
c5775c7ed6 nvk: Implement EnumerateInstanceVersion
This is required for future Vulkan versions.  The common code also calls
it for validating Vulkan versions.  May as well implement it now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
a0d521d268 nvk: use winsys lib
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
0749492760 nouveau/winsys: add the new winsys implementation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
83786bf1c9 nvk: add vulkan skeleton
This is enough to run vulkaninfo without crashing.

Jason:
* Drop a redundant nvk_device_entrypoints
* Add some VKAPI_ATTR and VKAPI_CALL
* nvk: Move EnumerateInstanceExtensionProperties to the top
  This way things are more-or-less in initialization order.  First the
  version then extensions then create the instance.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Gert Wollny
cfbd1fd413 r600/sfn: Use clause local registers in RA
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24480>
2023-08-04 21:01:59 +00:00
Gert Wollny
ebf45153d8 r600/sfn: Track whether a register is ALU clause local
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24480>
2023-08-04 21:01:59 +00:00
Gert Wollny
f03b466fb5 r600/sfn: Renumber shader blocks in scheduler
Consistent block numbering is required for identifying registers
that are used clause-locally.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24480>
2023-08-04 21:01:59 +00:00
Rhys Perry
ab5da82e00 radv/ci: skip some mesh shader tests on GFX1100
This lets me do a GFX11 CTS run without RADV_DEBUG=nocompute.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24499>
2023-08-04 19:34:14 +00:00
Eric Engestrom
746b90839f zink/ci: set the default timeout for zink jobs to 30min instead of 1h
Except zink-anv-tgl which takes a lot more, and keeps the 1h timeout
(for now, future changes might improve this).

Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24500>
2023-08-04 19:06:22 +00:00
Sylvain Munaut
a0a5d0f02e egl/dri2: Add a couple of missing mutex release in error path
This is causing a hang in the intel compute runtime when
trying to cl/gl share an unsupported texture format.

Fixes: f1efe037df ("egl/dri2: Add display lock")

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24487>
2023-08-04 18:34:56 +00:00
Faith Ekstrand
04cc8c6f8d clang-format: Set ColumnLimit to 78
This matches the tree-wide .editorconfig.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24429>
2023-08-04 17:46:42 +00:00
Eric Engestrom
35307aa9b9 ci: use mold to build deqp
deqp is probably the biggest thing that we're building (definitely in
size of binary linked), so it's also the one that benefits the most from
using mold for linking.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24490>
2023-08-04 16:47:11 +00:00
Eric Engestrom
2c6dc51a90 ci: include mold in x86_64_test-base & rootfs images
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24490>
2023-08-04 16:47:11 +00:00
Faith Ekstrand
9359ff9c2d vulkan: Use VkBufferUsageFlags2 in vk_buffer
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24497>
2023-08-04 16:03:16 +00:00
Karol Herbst
a9a30a7e09 n50/compute: submit initial compute state in nv50_screen_create
This fixes some CACHE_ERROR caused by proper multi-threading support. The
bug is a bit older though, just never triggered because there was only one
push buffer to begin with.

Without this change the compute initialization stayed unpushed in the
screen push buffer causing random issues.

Fixes: ff72440b40 ("nv50: implement a basic compute support")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24496>
2023-08-04 15:31:24 +00:00
Samuel Pitoiset
23082347bd vulkan/format: add VK_FORMAT_{A8_UNORM,A1B5G5R5_UNORM_PACK16}_KHR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24365>
2023-08-04 13:55:11 +00:00
Samuel Pitoiset
fb8ba9d3b9 vulkan/runtime: add common implementation for GetImageSubresourceLayout()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24365>
2023-08-04 13:55:11 +00:00
Lionel Landwerlin
3651eb0be8 vulkan/runtime: add a layered implementation of vkCmdBindIndexBuffer
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24365>
2023-08-04 13:55:11 +00:00
Samuel Pitoiset
db6ba033c1 vulkan: bump header register to 1.3.261
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24365>
2023-08-04 13:55:11 +00:00
Lionel Landwerlin
48b5353ac3 vulkan: skip non required extension structures
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24365>
2023-08-04 13:55:11 +00:00
Faith Ekstrand
bf6d6a0934 Revert "compiler: Combine duplicated implementation of is_gl_identifier into glsl_types.h"
This reverts commit f9860a84b3.  It's a
bit annoying having this scattered around but it's 100% a GLSL thing and
there's no reason why it should go in glsl_types.h.  The fact that
glsl_print_type() even uses it is a bit sketchy.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24491>
2023-08-04 13:14:35 +00:00
Faith Ekstrand
b89a48e00d Revert "mesa, compiler: Move gl_texture_index to glsl_types.h"
This reverts commit 1b836a52ea.  This
patch, while claiming to decouple things, actually increases coupling
because it leaks two OpenGL state tracker limits and an OpenGL state
tracker fixed binding enum into the entire compiler.  Nothing wants to
know these outside the OpenGL state tracker and the GL-specific compiler
passes.  Put them back where they were.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24491>
2023-08-04 13:14:35 +00:00
Karol Herbst
e331245541 rusticl/kernel: mark can_remove_var as unsafe and document it
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24470>
2023-08-04 12:55:33 +00:00
Karol Herbst
66c6061491 rusticl/kernel: get rid of initial function_temp type lowering
It's not needed and causes some issues with generic memory.

Fixes: 01cb01a7ee ("rusticl/kernel: only handle function_temp memory before lowering printf")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24470>
2023-08-04 12:55:33 +00:00
Karol Herbst
b9e47cf5fd rusticl/kernel: move things around in lower_and_optimize_nir
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24470>
2023-08-04 12:55:33 +00:00
Karol Herbst
f06f59ea3b rusticl/kernel: merge lower_and_optimize_nir_pre_inputs and lower_and_optimize_nir_late
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24470>
2023-08-04 12:55:33 +00:00
Karol Herbst
2bc3103f00 rusticl/kernel: rename res to internal_args inside lower_and_optimize_nir_late
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: @LingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24470>
2023-08-04 12:55:33 +00:00
Samuel Pitoiset
c327ab9e33 radv: track if vertex binding stride is dynamic from the cmdbuf state
This allows us to remove one more pipeline occurence during cmdbuf
recording. Note that shader object always uses dynamic vertex input.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24473>
2023-08-04 12:34:12 +00:00
Samuel Pitoiset
976297b73a radv: re-emit binning state if the framebuffer is dirty
This used to depend on the graphics pipeline, but now that everything
is dynamic it should be fine to trigger it on fb changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24473>
2023-08-04 12:34:12 +00:00
Samuel Pitoiset
0a102d3fd6 radv: track if patch control points is dynamic from the cmdbuf state
This allows us to remove one more pipeline occurence during cmdbuf
recording. Note that patch control points is always dynamic with
shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24473>
2023-08-04 12:34:12 +00:00
Samuel Pitoiset
b56c288589 radv: remove redundant check in radv_cmd_buffer_after_draw()
RADV_CMD_FLAG_PS_PARTIAL_FLUSH is only used for draws with
RADV_DEBUG=syncshaders, which implies a valid graphics pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24473>
2023-08-04 12:34:12 +00:00
Rhys Perry
63aea80cc0 radv: don't set vertex_attribute_strides on GFX8+
Bounds checking no longer compares against the stride.

fossil-db (navi21):
Totals from 5 (0.00% of 133461) affected shaders:
Instrs: 1532 -> 1520 (-0.78%)
CodeSize: 8144 -> 8084 (-0.74%)
Latency: 5104 -> 5102 (-0.04%)
InvThroughput: 686 -> 680 (-0.87%)
VClause: 19 -> 17 (-10.53%)
PreVGPRs: 118 -> 116 (-1.69%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24115>
2023-08-04 11:53:56 +00:00
Feng Jiang
d7fa2561a5 virgl: Only PIPE_BUFFER with VIRGL_BIND_CUSTOM flag is considered busy during creation
When the virglrenderer performs the attach action for the PIPE_BUFFER
with the VIRGL_BIND_CUSTOM flag, it will synchronize the data from
res->ptr to res->iov, at this time we need to treat it as busy,
otherwise it will cause some race conditions.

This optimizes commit:
fe9333f7b5 ("virgl: Set res->maybe_busy to true when creating resources")

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18098>
2023-08-04 09:46:40 +00:00
Kenneth Graunke
95db3e87fe intel/compiler: Fix sparse cube map array coordinate lowering
Brown paper bag fix for my untested review feedback comments.

Cube array images use a coordinate of the form <X, Y, 6*Slice+Face>,
while cube array textures use a <X, Y, Slice, Face> style coordinate.

This code tried to convert one to the other, but instead of writing
Z / 6 and Z % 6, we tried to reuse our original division result.  What
we wanted was Z - (Z/6) * 6, but instead we botched it and wrote Z-Z*6
which produced...totally invalid cube faces.

Fixes: fe81d40bff ("intel/nir: add lower for sparse images & textures")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24481>
2023-08-04 00:09:05 -07:00
Biswapriyo Nath
2a580bba76 radv/video: Match function definitions to declarations
This adds the same function attributes from definitions to declarations
and fixes the following compiler errors for 32 bit Windows OS.

../src/amd/vulkan/radv_video.c:270:1: error: conflicting types for 'radv_CreateVideoSessionKHR'
src/amd/vulkan/radv_entrypoints.h:3963:34: note: previous declaration of 'radv_CreateVideoSessionKHR'
../src/amd/vulkan/radv_video.c:319:1: error: conflicting types for 'radv_DestroyVideoSessionKHR'
src/amd/vulkan/radv_entrypoints.h:3971:30: note: previous declaration of 'radv_DestroyVideoSessionKHR'

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24460>
2023-08-04 06:03:50 +00:00
Eric Engestrom
b13473efe9 bin/pick-ui: use venv wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24367>
2023-08-03 23:21:32 +00:00
Eric Engestrom
2eca558dd4 bin/ci/update_traces_checksum: use venv wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24367>
2023-08-03 23:21:32 +00:00
Eric Engestrom
ce49034bbb bin/ci/gitlab_gql: use venv wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24367>
2023-08-03 23:21:32 +00:00
Eric Engestrom
6e4843bb04 bin/ci/ci_run_n_monitor: use venv wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24367>
2023-08-03 23:21:31 +00:00
Eric Engestrom
75f44bd79a bin: add wrapper to run scripts in a python venv
This isolates the script environment from the rest of the machine,
avoiding missing/incompatible dependencies and avoiding polluting the
rest of the machine with python packages.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24367>
2023-08-03 23:21:31 +00:00
Alyssa Rosenzweig
f34bae7d8c nir: Simplify alu_instr_is_copy
mov is considered vec.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
3f5e8b85f7 nir: Drop no-op all_srcs_are_ssa
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
92e59b5af5 nir: Remove no-op remove_def_cb
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
b2ddbecaad lima: Clean up after deleting asserts
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
91ae717d0b nir: Remove nir_foreach_def
Leftover.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
42ee8a55dd nir: Remove nir_alu_dest::write_mask
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
f5b09fefe3 ntt: Evaluate write_mask check
In light of the input necessarily being SSA.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
4828881e28 intel/vec4: Don't use legacy write mask
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
56be39996a etnaviv: What if we just didn't have a compiler?
alyssa: please no.

etnaviv: ok but we'll just not run nir_validate so it's fine.

alyssa: please no.

etnaviv: ok but we have ci now so you have to keep it working.

alyssa: please no.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:30 +00:00
Alyssa Rosenzweig
d878470bbc etnaviv: Don't use alu->dest.write_mask
Just plug n chug tbh all of this code is bad.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
e93dd20451 rogue: Stop reading write masks
Scalar SSA.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
d550dea819 ir3: Drop write_mask handling
It's all scalar SSA.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
7be895f960 nir/from_ssa: Remove pointless union
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Suggested-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
b23d951e96 nir: Drop nir_register
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
1c49586a1f nir: Remove nir_{src,dest}::is_ssa
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
312c647272 nir: Collapse more SSA checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
d18dfe6e27 nir: Initialize source as a NULL SSA def
This keeps src_is_valid working without depending on registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
fb79497b44 nir: Do not init dests
There is no sensible way to do this. It is a hard requirement that the dest is
initialized with nir_ssa_dest_init immediately after creating the instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
70c64b5d49 nir: Remove def_is_register
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
696fdde485 nir: Collapse more SSA checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
312089fea7 nir/instr_set: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
306182c63e treewide: Collapse more SSA checks
Via Coccinelle patch:

    @@
    expression x;
    @@

    -if (x->is_ssa) {
    ...
    -}

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
700e270df5 nir/range_analysis: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
d78ca1badf nir/worklist: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
73e82b9281 nir/gather_ssa_types: Collapse SSA checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
84f7fb70e1 radeonsi: Collapse SSA check
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
b047016e70 lima: Collapse is_ssa checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
c3077d3ad4 ir3: Collapse is_ssa checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
2734f1b586 llvmpipe: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
11fc4f969c intel: Collapse is_ssa checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
cf8ceb6e0a aco: Remove is_ssa check
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
ca9e2ceeeb nir: Drop trivial reg handling
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
579bc1e72e treewide: Drop some is_ssa if's
Via Coccinelle patch:

    @@
    expression x;
    @@

    -if (!x.is_ssa) {
    -...
    -}

and likewise with x->is_ssa, with invalid hunks manually filtered out.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
ba5aaf2ff7 pan/mdg: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:29 +00:00
Alyssa Rosenzweig
95e3df39c0 treewide: sed out more is_ssa
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
a8013644a1 nir: Drop nir_alu_src::{negate,abs}
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
efc1c3261a nir/print: Drop legacy NIR
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
09d7f6d64b nir: Remove stale todo
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
c512636cf0 nir: Remove reg-only dest manipulation
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
ab0d878932 treewide: Remove more is_ssa asserts
Stuff Coccinelle missed.

   sed -i -e '/assert(.*\.is_ssa)/d' $(git grep -l is_ssa)
   sed -i -e '/ASSERT.*\.is_ssa)/d' $(git grep -l is_ssa)

+ a manual fixup to restore the assert for parallel copy lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
042a3eca00 nir: Collapse some SSA checks
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
5fead24365 treewide: Drop is_ssa asserts
We only see SSA now.

Via Coccinelle patch:

    @@
    expression x;
    @@

    -assert(x.is_ssa);

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
d559764e7c nir: Remove nir_alu_dest::saturate
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
0bbf458a32 nir: Remove impl->{registers,reg_alloc}
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
20f38b4b41 nir/validate: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
71699e59a3 nir/serialize: Drop legacy NIR
Assume SSA, no modifiers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
441188cd7a nir/clone: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
97a3302bf8 nir/print: Assume SSA
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
08035ce388 ntt: Drop nir_register reference
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
5133dcebb4 nir: remove nir_{src,dest}_for_reg
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:28 +00:00
Alyssa Rosenzweig
ed018babf7 nir: Remove nir_foreach_register
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Alyssa Rosenzweig
9f0427e3e3 nir/schedule: Drop more nir_register handling
No-op.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Alyssa Rosenzweig
c11c75d1a1 nir: Remove nir_index_local_regs and callers
With no registers seen, it is now a no-op.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Alyssa Rosenzweig
1bc05bb847 nir: Drop NIR reg create/destroy
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Alyssa Rosenzweig
068770aaa6 nir/schedule: Drop nir_schedule_dest_pressure
Unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Alyssa Rosenzweig
b606a0b91e nir/from_ssa: Drop legacy reg support
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Alyssa Rosenzweig
bbb9838b78 nir: Add {...} before case
Will prevent a clang regression.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>
2023-08-03 22:40:27 +00:00
Yonggang Luo
86bcc90c0e intel/compiler,intel/blorp,intel/vulkan: decouple vulkan driver and compiler from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24438>
2023-08-03 22:00:15 +00:00
Yonggang Luo
fc73d275b9 crocus: #include "program/prog_instruction.h" for SWIZZLE_*
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24438>
2023-08-03 22:00:15 +00:00
Yonggang Luo
9eb8a0b16a intel/brw: Define and use BRW_SWIZZLE_* instead of SWIZZLE_*
This is for avoid #include "program/prog_instrunction.h" in intel/brw code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24438>
2023-08-03 22:00:15 +00:00
Yonggang Luo
846d620632 intel/blorp: brw_sampler_prog_key_data::swizzles is only and should only accessed in crocus
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24438>
2023-08-03 22:00:15 +00:00
Yonggang Luo
66880eeaec intel/blorp: Use float directly to avoid #include "mesa/main/format_utils.h"
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24438>
2023-08-03 22:00:15 +00:00
Yonggang Luo
8b2d2dd43d compiler: Move WRITEMASK_* from prog_instruction.h into shader_enums.h
Because both compiler/glsl/* and intel/compiler accessed it, so do the move

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24438>
2023-08-03 22:00:15 +00:00
David Heidelberg
ced762a8d3 bin/ci: handle errors more gracefully in update_traces_checksum script
UnicodeDecodeError is present very often, since GitLab logs are scary.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24444>
2023-08-03 21:58:13 +00:00
Faith Ekstrand
356a268b46 nir/builder: Don't assume we have compiler options
We use nir_builder a variety of places where we may not yet have
back-end compiler options such as for building meta shaders.  Don't
assume we always have an options struct.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24459>
2023-08-03 21:20:30 +00:00
xurui
0a5fab555d glx: There is no need to psc++
Signed-off-by: xurui <xurui@kylinos.cn>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24360>
2023-08-03 20:46:32 +00:00
Felix DeGrood
6e7718dcea anv: debug messaging for sparse texture usage
Enable sparse debug messages with INTEL_DEBUG=sparse

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24046>
2023-08-03 19:57:19 +00:00
Felix DeGrood
df349bc2be anv: enable fake sparse for Elden Ring
Elden Ring requires sparse support to be advertised but does not
use the feature. Enable fake sparse support for Elden Ring through
dri-conf.

This change fixes Elden Ring on Intel graphics.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24046>
2023-08-03 19:57:18 +00:00
Felix DeGrood
7db2003209 anv: add fake sparse support
Some DX12 games require sparse resource support but don't
actually use sparse resources. Add a way to make these games work
while we still don't have sparse resources fully working on every
KMD backend.

When fake_sparse=true, anv advertises sparse resource support
despite lacking full support.

Based-on-patch-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24046>
2023-08-03 19:57:18 +00:00
Yonggang Luo
17e505cb2d asahi: decouple layout from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24465>
2023-08-03 19:38:56 +00:00
Yonggang Luo
68c30215a9 etnaviv: decouple drm from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24465>
2023-08-03 19:38:56 +00:00
Eric Engestrom
7458912333 docs/ci: expand the description of test suites
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24472>
2023-08-03 19:30:11 +00:00
Eric Engestrom
774ce3ff88 docs/ci: drop mention of build systems variants in the CI
We managed to get rid of all the other ones, so let's forget about them
now :P

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24472>
2023-08-03 19:30:11 +00:00
Eric Engestrom
a4df4fd0f5 docs/ci: in paragraph about the CI being overwhelmed, mention our tool to help with that
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24472>
2023-08-03 19:30:11 +00:00
Eric Engestrom
845518d5d4 docs/ci: stop trying to enumerate drivers that are tested using VK-GL-CTS
Most of our drivers are tested by now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24472>
2023-08-03 19:30:11 +00:00
Eric Engestrom
f5672d048e ci: include some timing information in the git cache download script
In https://gitlab.freedesktop.org/zmike/mesa/-/jobs/46476087 it is unclear
whether this script is where 30+ minutes were lost, or if this ran fine and
the `git clone` afterwards is where the issue was.

Printing these timestamps will help next time something like this happens.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24452>
2023-08-03 18:44:44 +00:00
David Heidelberg
f8cc1ab04b docs/ci: remove default nginx config, which we don't need for proxy
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24445>
2023-08-03 17:36:59 +00:00
David Heidelberg
f9ebbcd8b6 docs/ci: update to systemd and used version of the trace for testing
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24445>
2023-08-03 17:36:59 +00:00
David Heidelberg
e389234a5e docs/ci: default to port 80 for the caching proxy
Also use `caching-proxy` as a name which is automatically
generated from `NFS_SERVER_IP`.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24445>
2023-08-03 17:36:59 +00:00
David Heidelberg
57b0db63e1 ci/amd: fix timeouting radeonsi-raven-va-full job
LAVA needs to know that job will run more than default 30 minutes.

Fixes: ae9c67d773 ("ci/amd: add radeonsi-raven-va-full job to cover all VA-API tests")

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24469>
2023-08-03 14:05:23 +00:00
David Rosca
9543143593 radeonsi: Enable PIPE_VIDEO_CAP_SUPPORTS_CONTIGUOUS_PLANES_MAP
This is needed for vaDeriveImage to map multi-plane surfaces.

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

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24389>
2023-08-03 13:36:58 +00:00
David Rosca
4f047c9583 radeonsi: Copy all planes with multi-plane staging textures
Multi-plane format textures are allocated as a single buffer
for all planes, so when mapping first plane it will map
all planes.
However, when staging texture is used, only the first
plane will be available.

When asked to map first plane of multi-plane texture,
create a staging texture with matching multi-plane format
and copy all planes on map/unmap.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24389>
2023-08-03 13:36:58 +00:00
Alyssa Rosenzweig
2cb3c2cbfb zink: Collapse is_ssa check
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24471>
2023-08-03 13:06:38 +00:00
Alyssa Rosenzweig
91f676819c vc4,broadcom/compiler: Drop write_mask handling
There's no legacy register support so we ncessarily write a contiguous vector.
In other words, the write_mask is of the form `(1 << x) - 1`. Meanwhile this
code asserts the write mask is of the form (1 << x)`. Putting it together the
write mask is necessarily always 0x1, writing out a single scalar.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24471>
2023-08-03 13:06:38 +00:00
Alyssa Rosenzweig
59645f05a7 nouveau/codegen: Drop writemask check
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24471>
2023-08-03 13:06:38 +00:00
Alyssa Rosenzweig
30ff0857be r600/sfn: Ignore instruction write masks
It's all SSA so this is redundant.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24471>
2023-08-03 13:06:38 +00:00
Alyssa Rosenzweig
b870988b77 r600/sfn: Stop referencing legacy functionality
It's unused now, just need the references to it dropped so we'll still build
when it's all removed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24471>
2023-08-03 13:06:38 +00:00
David Rosca
c545df7426 frontends/va: Init view_resources array in vlVaPut/GetImage
Fixes crash when VA format num_planes > surface num_planes.

Fixes: 975a8ecc88 ("frontends/va: use resources instead of views")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9377

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24381>
2023-08-03 12:41:22 +00:00
David Rosca
ca8647e29b frontends/va: Don't allow multi-plane derive without driver support
Mapping multi-plane surfaces won't work correctly without driver
supporting PIPE_VIDEO_CAP_SUPPORTS_CONTIGUOUS_PLANES_MAP.

Remove the check for ffmpeg process and instead check for
multi-plane format and driver support only.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24381>
2023-08-03 12:41:22 +00:00
Mike Blumenkrantz
9e9d90c6c3 lavapipe: VK_EXT_host_image_copy
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24278>
2023-08-03 10:38:23 +00:00
Mike Blumenkrantz
6d3009d758 lavapipe: be slightly more permissive for bad apps (and cts) with dynrender
this is stupid, but it makes the default color output "write the output"
instead of zero, which is still wrong, but at least maybe it's wrong
in a way that's useful instead of just being confusing

Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24278>
2023-08-03 10:38:22 +00:00
Yonggang Luo
cd3ea02da0 ac/radv: decouple radv vulkan driver and compiler from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24464>
2023-08-03 09:45:42 +00:00
Yonggang Luo
b5401a4b0e nouveau/drm-shim: Decouple from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24463>
2023-08-03 09:26:41 +00:00
Jordan Justen
9ecfd9feea intel/tools: Use 'env bash' to find bash executable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24453>
2023-08-03 01:56:40 -07:00
Yonggang Luo
37b56dfd7d meson: Remove arm_neon_workaround
Suddenly found this workaround doesn't need anymore

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/24461>
2023-08-03 08:11:17 +00:00
Yonggang Luo
4c4d2d35c2 glx: decouple from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23438>
2023-08-03 07:29:36 +00:00
Yonggang Luo
3b731d92d9 freedreno: decouple compiler and vulkan driver from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23438>
2023-08-03 07:29:36 +00:00
Yonggang Luo
d8ed291751 pvr: decouple vulkan driver and compiler from gallium
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-By: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23438>
2023-08-03 07:29:35 +00:00
Iago Toral Quiroga
f0e603583e broadcom/compiler: drop execution environment from the shader key
We are no longer using this for anything.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:41 +00:00
Iago Toral Quiroga
b95bb44c61 broadcom/compiler: always clamp results from logic ops
We have also been clamping our integer RTs in GL for a while now.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:41 +00:00
Iago Toral Quiroga
fb80e830ef v3dv: don't set lower_wpos_pntc for Vulkan
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:41 +00:00
Iago Toral Quiroga
87e167baa1 broadcom/compiler: move vulkan's point coord lowering to the driver
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Iago Toral Quiroga
59018b0228 broadcom/compiler: move uniform offset lowering from compiler to GL driver
We only need this in GL so move it there.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Iago Toral Quiroga
f5931ba6d8 broadcom/compiler: use NIR's lowering for dispatch base
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Iago Toral Quiroga
9211b9afdf broadcom/compiler: stop asserting on Vulkan environment
The idea is to eventually get rid of key->environment.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Iago Toral Quiroga
fc0ca7407b v3dv: fix incorrect key setup
We had this incorrectly included inside the body of loop over
the subpass attachments so when all attachments are unused we
would not set this correctly.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Iago Toral Quiroga
ebe66479fb nir/lower_robustness: drop skip_ubo_0 option
v3dv was the only user and it no longer requires this.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Iago Toral Quiroga
e941732ab1 v3dv: stop incrementing UBO indices by one
This matches what we do for OpenGL, allowing us to
have the same compiler behavior for both worlds.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24396>
2023-08-03 06:32:40 +00:00
Samuel Pitoiset
c733c166d7 radv: add radv_graphics_shaders_compile() to compile graphics shaders
Similar to radv_compile_cs() but for all graphics stages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24423>
2023-08-03 06:04:52 +00:00
Samuel Pitoiset
5be4446abe radv: add a struct for the retained shaders and GPL
This will be used to remove the pipeline dependency completely when
compiling graphics shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24423>
2023-08-03 06:04:52 +00:00
Samuel Pitoiset
2050f2fe48 radv: inline radv_pipeline_get_nir() in radv_graphics_pipeline_compile()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24423>
2023-08-03 06:04:52 +00:00
Samuel Pitoiset
581f4701be radv: stop passing a graphics pipeline to radv_pipeline_nir_to_asm()
Also rename the function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24423>
2023-08-03 06:04:52 +00:00
Samuel Pitoiset
efbb6de035 radv: remove unnecessary check in radv_pipeline_nir_to_asm()
If a NIR stage is present, there shouldn't be any compiled binaries
in the same stage slot.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24423>
2023-08-03 06:04:52 +00:00
Jordan Justen
19d0b24927 intel/dev: Support xe2 device init (for intel_device_info_test)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24419>
2023-08-03 00:10:35 +00:00
Jordan Justen
b80bcd8327 intel/dev: Add LNL platform enum
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24421>
2023-08-02 23:38:37 +00:00
Dave Airlie
773d77dc7e llvmpipe: fix fragdata/lastfragdata heuristic a bit more.
This heuristic broke when zmike lowered fragcolor using NIR,

This fixes a regression in:
dEQP-GLES31.functional.shaders.framebuffer_fetch.basic.last_frag_data

Fixes: db1371cce1 ("llvmpipe: fix handling of unused color attachments")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24435>
2023-08-03 08:51:41 +10:00
Eric Engestrom
17ee184e25 docs: update calendar for 23.1.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24455>
2023-08-02 20:39:53 +01:00
Eric Engestrom
17b856d97a docs: add sha256sum for 23.1.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24455>
2023-08-02 20:39:43 +01:00
Eric Engestrom
71a07831a9 docs: add release notes for 23.1.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24455>
2023-08-02 20:39:29 +01:00
Gert Wollny
4c3fc03d7f r600/sfn: AR loads should depend on all previous non ALU instructions
These instructions could be re-ordered, so depending just on the last one
is not sufficient.

Fixes: d21054b4bc
   r600/sfn: Add pass to split address and index register loads

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24454>
2023-08-02 18:55:36 +00:00
Gert Wollny
5b75d86df9 r600/sfn: Only switch to other CF if no AR uses are pending
Otherwise we end up with an incorrect array load (or an assertion failure).

Fixes: d617052db6
    r600/sfn: take address loads into account when scheduling

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24454>
2023-08-02 18:55:36 +00:00
Eric Engestrom
b1ce5fe20a ci: drop rule for non-existent src/include/
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24449>
2023-08-02 18:20:46 +00:00
Eric Engestrom
f69e60406f ci: add .core-rules to .gallium-core-rules
All the users of the latter were already getting the former through
other rules so there's no functional change, but it's more correct.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24449>
2023-08-02 18:20:46 +00:00
Samuel Pitoiset
e7cf235422 radv: add support for emitting TCS epilogs in cmdbuf
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:19 +00:00
Samuel Pitoiset
ce05412417 radv: add support for a TCS epilogs cache in the device
Similar to VS prologs and PS epilogs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:19 +00:00
Samuel Pitoiset
8abf8dad6b radv: add infra for creating TCS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Samuel Pitoiset
198291f45b radv: add radv_tcs_epilog_key
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Samuel Pitoiset
f950eae10f radv: declare new argument for the TCS epilog PC
To jump to the TCS epilog.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Samuel Pitoiset
c12ab8af96 radv: track if TES reads tess factors differently
This information will be passed through the TCS epilog key.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Samuel Pitoiset
61999253de radv: do not write tess factors in main TCS when it has an epilog
Tess factors will be written by TCS epilogs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Samuel Pitoiset
54a6eb6613 radv: assume a TCS needs an epilog unless it's linked with a TES
For shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Samuel Pitoiset
f4ec2e7bb3 radv,aco: move has_epilog to radv_shader_info
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24404>
2023-08-02 16:59:18 +00:00
Eric Engestrom
eadc72d9de broadcom/ci: reduce v3dv-rpi4-vk timeout to 30min (instead of 1h)
This means that when things go wrong, we don't hold the runner (and Marge)
for as long, while still having a 2x margin over the usual run time.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24402>
2023-08-02 16:36:51 +00:00
Eric Engestrom
4346fe8e2a broadcom/ci: reduce v3d-rpi4-traces timeout to 30min (instead of 1h)
This means that when things go wrong, we don't hold the runner (and Marge)
for as long, while still having a 2x margin over the usual run time.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24402>
2023-08-02 16:36:50 +00:00
Eric Engestrom
9ca031b4a8 broadcom/ci: reduce v3d-rpi4-gl timeout to 30min (instead of 1h)
This means that when things go wrong, we don't hold the runner (and Marge)
for as long, while still having a 2x margin over the usual run time.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24402>
2023-08-02 16:36:50 +00:00
Eric Engestrom
b23d4d86dd broadcom/ci: reduce vc4-rpi3-gl timeout to 30min (instead of 1h)
This means that when things go wrong, we don't hold the runner (and Marge)
for as long, while still having a 2x margin over the usual run time.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24402>
2023-08-02 16:36:50 +00:00
Alyssa Rosenzweig
9ee4de829e nir: Remove register load/store builders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24450>
2023-08-02 10:27:17 -04:00
Alyssa Rosenzweig
17d66055ae nir: Remove reg_intrinsics parameter to convert_from_ssa
All users must set it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24450>
2023-08-02 10:26:45 -04:00
Alyssa Rosenzweig
11a161b9b9 nir: Remove lower_vec_to_movs
Unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24450>
2023-08-02 10:26:45 -04:00
Alyssa Rosenzweig
f218a2c3df nir: Remove lower_to_source_mods
Unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24450>
2023-08-02 10:26:45 -04:00
Eric Engestrom
61d24ea88c ci: reduce bare-metal retries of poe_run to only 3 attempts
10 is overkill, if we fail that many times in a row we should stop
trying on this runner.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24407>
2023-08-02 11:23:44 +00:00
Eric Engestrom
52ee1f6fa6 ci: add a 10min job timeout to formatting checks
They both take only a few seconds, but it can take up to a minute for
setting up the job, and various external factors such as network can add
delays, so let's round it up to a generous 10 minutes.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24431>
2023-08-02 10:28:07 +00:00
David Heidelberg
39ddc509e1 ci/freedreno: document another mapbuffer flake on a530
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24441>
2023-08-02 08:48:20 +00:00
Juan A. Suarez Romero
08579810d1 broadcom/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24437>
2023-08-02 08:16:20 +00:00
Samuel Pitoiset
f433d39935 aco: add infra for compiling TCS epilogs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24417>
2023-08-02 07:29:50 +00:00
Qiang Yu
572625ea6c aco: extract aco_compile_shader_part from aco_compile_ps_epilog
Will be shared with radeonsi tcs epilog and other shader parts build.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24417>
2023-08-02 07:29:50 +00:00
Samuel Pitoiset
ac99fbe591 aco: add aco_shader_info::tcs::has_epilog
This will be used by both RADV and RadeonSI to jump from the main TCS
to the epilog.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24417>
2023-08-02 07:29:50 +00:00
Samuel Pitoiset
ac40924a3b radv: allow to use fixed IO locations for VS<->TCS<->TES without linking
For shader objects.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24408>
2023-08-02 06:54:09 +00:00
Samuel Pitoiset
ec1e11ab23 amd,radeonsi: move si_shader_io_get_unique_index_patch() to common code
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24408>
2023-08-02 06:54:09 +00:00
Yonggang Luo
235b10e7cf util/meson: Getting mesa util core to be self contained
Guard util to be standalone by move subdir('util') just behind subdir('android_stub')

texcompress_rgtc_tmp.h is not a standard c header, do not treat it as source

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:24 +00:00
Yonggang Luo
e87969eed5 util:Move only gallium used u_debug_refcnt.* and u_debug_describe.* into src/gallium/auxiliary/util/
Because these files indeed doesn't belongs to src/util, they are tightly coupled with
src/gallium/auxiliary

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:24 +00:00
Yonggang Luo
518e21ab87 util: Remove include "pipe/*.h" in src/util/* files
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:24 +00:00
Yonggang Luo
4bdbf44cce util: Move u_pack_color.h and dbughelp.h into src/util from/src/gallium/auxiliary/util/
As u_pack_color.h is used in vulkan drivers, so decouple it from gallium by this move
And dbghelp.h is included in u_debug_symbol.c and that's resident in src/util/

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:24 +00:00
Yonggang Luo
52b92a7166 util: Move pipe_color_union from p_defines.h into u_formats.h
As pipe_color_union is used in vulkan drivers, so decouple it from gallium by this move

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:24 +00:00
Yonggang Luo
ed1281a170 util: Move PIPE_MASK_* from p_defines.h to u_formats.h
PIPE_MASK_* is used by src/util/*, so do the move to decouple src/util/* from gallium

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:24 +00:00
Yonggang Luo
9817f7d621 util: Move pipe_swizzle from p_defines.h to u_formats.h
pipe_swizzle is used by src/util/*, so do the move to decouple src/util/* from gallium

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19522>
2023-08-02 03:41:23 +00:00
Mike Blumenkrantz
4de7e0034a lavapipe: don't check geometry for fb attachments
this is broken since surfaces always have minified geometry

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24339>
2023-08-02 03:20:56 +00:00
Mike Blumenkrantz
33d06f8cc2 lavapipe: zero fb attachment array at rp start
this avoids invalid access if an attachment moves to a lower index
in a smaller renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24339>
2023-08-02 03:20:56 +00:00
Mike Blumenkrantz
b39815fa9c lavapipe: statically allocate fb attachment array
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24339>
2023-08-02 03:20:56 +00:00
Mike Blumenkrantz
b398036c73 glsl: only explicitly check GS components in PSIZ injection with output variables
if no output variables exist then there's plenty of room for a psiz

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24182>
2023-08-02 02:43:03 +00:00
Mike Blumenkrantz
473ae3c89b zink: add feedback loop exts to optimal profile
base feedback loop ext is more like a hard requirement, but it's tough to
pin down exactly which version requires it, and also it might "just work"
magically, so...yeah here we are

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24403>
2023-08-02 02:06:46 +00:00
David Heidelberg
ae848634ab ci/nouveau: add 20 minutes timeout to gk20a and align gm20b
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24405>
2023-08-02 00:14:03 +00:00
Alyssa Rosenzweig
51db19f7a2 nir: Rename scoped_barrier -> barrier
sed + ninja clang-format + fix up spacing for common code.

If you are unhappy that I did not manually change the whitespace of your driver,
you need to enable clang-format for it so the formatting would happen
automatically.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
04159a2973 panfrost: Gate overdraw_alpha on Bifrost+
Not used on Midgard, deals with a -Wunused-function warning.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
7a32a9aa18 panfrost: Add missing inline
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
59d5d090ac panfrost: Only define pan_blitter_get_blend_shaders for midgard
Unused otherwise, responds to a -Wunused-function warning.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
f5690d2e81 panfrost: Drop unused decode_position for samples
There's a Gallium helper for this now.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
21790954a6 pan/mdg: Add missing static inline annotation
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
fb36995fe4 pan/decode: Drop unused debug function
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
df879723b3 panfrost: Add missing static inline annotation
Quiets -Wunused-function

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:29 +00:00
Alyssa Rosenzweig
2b09ab4bad nir/passthrough_gs: Drop unused array_size_for_prim
../src/compiler/nir/nir_passthrough_gs.c:96:1: warning: ‘array_size_for_prim’ defined but not used [-Wunused-function]
   96 | array_size_for_prim(enum mesa_prim prim)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:28 +00:00
Alyssa Rosenzweig
54ce1d9437 nir/loop_analyze: Drop unused inverse_comparison
../src/compiler/nir/nir_loop_analyze.c:1134:1: warning: ‘inverse_comparison’ defined but not used [-Wunused-function]
 1134 | inverse_comparison(nir_op alu_op)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:28 +00:00
Alyssa Rosenzweig
c885e906b3 gallium/u_transfer_helper: Remove dead forward decl
Doesn't point to anything.

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

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24428>
2023-08-01 23:18:28 +00:00
Nanley Chery
e5b6556697 iris: Sample more texture view fast-clears on gfx11+
On platforms with an indirect clear color BO, the clear color used when
sampling is in the form of a pixel. The sampler can interpret the pixel
correctly regardless of the format, so allow fast clears in more cases
within iris_resource_prepare_texture.

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

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

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

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24323>
2023-08-01 22:56:54 +00:00
José Roberto de Souza
f49989148a anv: Return earlier in anv_reloc_list functions
Xe KMD don't need relocs, so calling a nop function and avoiding the
CPU cycles and memory waste with reloc.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24411>
2023-08-01 22:30:04 +00:00
José Roberto de Souza
d9d284d050 anv: Remove VkAllocationCallbacks parameter from reloc functions
Mismatch allocator could cause bad things, so better set the allocator
on anv_reloc_list_init() and use it in every reloc function.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24411>
2023-08-01 22:30:04 +00:00
José Roberto de Souza
0584bb450e anv: Nuke unused READ_ONCE() from anv_batch_chain.c
Only genX_cmd_buffer.c makes use of READ_ONCE() but that file also
defines it so it can be removed from anv_batch_chain.c.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24411>
2023-08-01 22:30:04 +00:00
David Rosca
ad9d39a5ba ci/amd: Skip VAAPI CreateSurfacesWithConfigAttribs/1121 test
It now times out with surfaces being allocated non-interlaced
by default due to a slower path being taken in clear_render_target.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>
2023-08-01 21:58:27 +00:00
David Rosca
71f7d4e673 radeonsi: Don't prefer interlaced for video decode
Preferring interlaced results in all surfaces being allocated
as interlaced for H264 decode regardless of whether the decoded
pic is interlaced or progressive, which makes VA postproc
apply deinterlacing even for progressive pics.

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

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>
2023-08-01 21:58:27 +00:00
David Rosca
0ee4506c3a frontends/vdpau: Alloc interlaced surface for interlaced pics
When decoding interlaced pics, the output surface should
also be allocated as interlaced to make the deinterlace
postproc filter work correctly.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>
2023-08-01 21:58:27 +00:00
David Rosca
578e10e157 frontends/va: Alloc interlaced surface for interlaced pics
When decoding interlaced pics, the output surface should
also be allocated as interlaced to make the deinterlace
postproc filter work correctly.

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

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

v2: Avoid reallocating in vlVaExportSurfaceHandle

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24361>
2023-08-01 21:58:27 +00:00
Italo Nicola
d7b9da2673 mesa/main: allow readpix/teximage to read from implicitly multisampled fbos
The GL_EXT_multisampled_render_to_texture spec explicitly allow reading
from these FBOs.

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

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

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10747>
2023-08-01 21:22:28 +00:00
Italo Nicola
4d1a07c1a0 mesa/main: account for RTT samples when updating framebuffer
For EXT_multisampled_render_to_texture, we store the number of samples
in Attachment->NumSamples instead of Renderbuffer->NumSamples. This
meant that the previous code ignored that the framebuffer was
multisampled. Because of this, pipe_rasterizer_state::multisample is set
incorrectly, leading to visual artifacts on drivers that support MS-RTT
extension, such as panfrost.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10747>
2023-08-01 21:22:28 +00:00
Mike Blumenkrantz
ba72946fa3 gallium: bump PIPE_MAX_SO_OUTPUTS to 128
this is the number of components supported for streamout

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24285>
2023-08-01 20:47:34 +00:00
Mike Blumenkrantz
b1cca11220 ir3: bump max xfb output to 128
this is the number of components supported for streamout

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24285>
2023-08-01 20:47:34 +00:00
Mike Blumenkrantz
4d8c53b070 radv: bump max xfb output to 128
this is the number of components supported for streamout

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24285>
2023-08-01 20:47:34 +00:00
jazzfool
f70fb753b9 zink: Hash only first 32 bits of zink_gfx_pipeline_state with full DS3
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8245
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24430>
2023-08-01 20:19:40 +00:00
José Roberto de Souza
373019f9ef intel/genxml/gen125: Set MI_MATH MOCS field as non-zero
All MOCS tables have 0 as a invalid value, so this will asssert
in case some place misset to set MI_MATH MOCS field.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>
2023-08-01 19:49:45 +00:00
José Roberto de Souza
b0b763d0be intel/tests/mi_builder: Set MI_MATH MOCS field
MOCS = 0 is a invalid MOCS index on MTL, so it is necessary get a
valid value and set to MI_MATH instructions.

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

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>
2023-08-01 19:49:45 +00:00
José Roberto de Souza
a7ab31b96a anv: Set MI_MATH MOCS field
MOCS = 0 is a invalid MOCS index, so it is necessary get a valid value
and set to MI_MATH instructions.

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

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>
2023-08-01 19:49:45 +00:00
José Roberto de Souza
d0890a0b8b iris: Set MI_MATH MOCS field
MOCS = 0 is a invalid MOCS index on MTL, so it is necessary get a
valid value and set to MI_MATH instructions.

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

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>
2023-08-01 19:49:44 +00:00
José Roberto de Souza
0233e3639f intel/genxml/gen125: Add missing fields in MI_MATH
BSpec: 53415
BSpec: 45737
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>
2023-08-01 19:49:44 +00:00
Faith Ekstrand
ae105ad5cd anv: Use the common versions of vkBegin/EndQuery()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>
2023-08-01 19:17:05 +00:00
Faith Ekstrand
e4485bc062 anv: Use vk_query_pool
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>
2023-08-01 19:17:05 +00:00
Faith Ekstrand
f2930ec5dd vulkan: Add init/finish helpers for vk_query_pool
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>
2023-08-01 19:17:05 +00:00
Faith Ekstrand
1d6d775ffe anv: Use vk_buffer_view
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>
2023-08-01 19:17:05 +00:00
Faith Ekstrand
92f996d0fa anv: Use vk_sampler
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24409>
2023-08-01 19:17:05 +00:00
M Henning
d4086be6bc nv/codegen: Implement nir_op_fquantize2f16
Passes most of dEQP-VK.spirv_assembly.instruction.graphics.opquantize.* but
not the too_small_* tests for some reason. (Tested on kepler.)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:04 +00:00
Faith Ekstrand
6023943b81 nv50/ir: Run nir_divergence_analysis before out-of-SSA
We don't actually use or need this information but it gets generated by
nir_opt_non_uniform_access() and stale divergence information can cause
out-of-SSA to assert in parallel copy lowering.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:04 +00:00
George Ouzounoudis
cdece16cf4 nouveau/codegen: Add capability to pre-specify tessellation domain
In the case of SPIRV tessellation shaders, the execution mode can be
specified in the tessellation control shader. So we need a way to know the domain
when compiling the tessellation evaluation shader.

Acked-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:04 +00:00
George Ouzounoudis
df5d1ef2b5 nouveau/codegen: Fix compact patch varyings in case of NIR
The code path was not implemented and an assert was reached.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Faith Ekstrand
b96639011c nouveau/codegen: Don't convertSurfaceFormat for unknown formats
Without this and the previous patch, it would see PIPE_FORMAT_NONE as a
zero-component format and delete the whole load.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Faith Ekstrand
2200d3c2e7 nouveau/codegen: Use a NULL format for PIPE_FORMAT_NONE for images
Get rid of our own FMT_NONE and just use a NULL format in that case.
We're already checking su->tex.format != NULL in a bunch of cases but
none of those NULL checks are doing anything right now execpt detecting
when its an actual texture op and not an image op.  We'd like them to
start also applying for image load/store with an unspecified format.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
George Ouzounoudis
f453623255 nouveau/codegen: Handle nir op amul
This came from CTS clipping tests with geometry shaders.  Maybe can be
done as a lowering operation instead.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
George Ouzounoudis
43b8da3a8b nouveau/codegen: Support compact clip distances with arrayed_io
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Rebecca Mckeever
6990439eb8 nouveau/codegen: Set lower_device_index_to_zero
This instructs NIR to lower DeviceIndex to zero, which is needed
for a no-op implementation of VK_KHR_device_group.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Rebecca Mckeever
e2221a9cac nouveau/codegen: Support nir_intrinsic_load_workgroup_id_zero_base
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Faith Ekstrand
f9d385d777 nouveau/codegen: Handle/indirect goes before sample index
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Faith Ekstrand
1f60923b89 nouveau/nir: Implement support for compact arrays
This is needed for clip and cull distances.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
M Henning
77acf89336 nv/codegen: Call nir_shader_gather_info
We need this info to be up-to-date for slot assignment.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Faith Ekstrand
9a2d016021 nouveau: Allow GLSL_SAMPLER_DIM_SUBPASS*
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Faith Ekstrand
9cb70c6ee0 nv50/nir: Lower to scratch AFTER optimization
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>
2023-08-01 18:58:03 +00:00
Erico Nunes
21424577cb lima/gpir: switch to register intrinsics
gp has explicit load and store reg instructions so it can implement
the new nir_intrinsic_{decl,load,store}_reg intrinsics.
The implementation reuses the gpir_node_find and register_node functions
instead of just emitting load and store instructions in order to
preserve the behavior that there will never be a store_reg followed by
a load_reg of the same register in the same block.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>
2023-08-01 18:36:50 +00:00
Erico Nunes
9ad3a80b13 lima/ppir: convert to nir_legacy
With the upcoming transition away from nir_register and modifiers in
nir, ppir needs to prepare for those features to be removed.
The most straightforward way for ppir without major reworks at this time
is to use the new nir_legacy helpers so that most of the backend can be
kept untouched (particularly due to use of abs/neg/sat modifiers).
Do this for now to unblock the transition with little impact; ppir can
be optimized at a later moment to have its own passes which will allow
it to drop the nir_legacy use and use just the chasing helpers.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>
2023-08-01 18:36:50 +00:00
Erico Nunes
87a1703949 lima/ppir: don't optimize loads with different block successors
Even if loads are initially duplicated for each user, with new
optimizations such as folding modifiers, it may happen that loads
end up with only users in different blocks.
Handle that and don't delete or pipeline those nodes.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>
2023-08-01 18:36:49 +00:00
Emma Anholt
c124fa4a4f Revert "ci: Disable nouveau CI"
This reverts commit 1440a0f95b.

runner got wedged, it's back up now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24427>
2023-08-01 18:19:40 +00:00
Georg Lehmann
82920c99a5 aco: fix non constant 16bit bitnz/bitz
Fixes: 573e98f34a ("aco: implement nir_op_bitz/bitnz")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24420>
2023-08-01 15:54:31 +00:00
David Rosca
12a4f2c132 frontends/va: Also map VAImageBufferType for reading
VAImageBufferType can be used for both reading and writing,
so map it as such.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24390>
2023-08-01 15:36:04 +00:00
Adam Jackson
f41ce4b210 mesa: Implement and advertise GL_MESA_sampler_objects
This is the GLES3 sampler object API trivially backported to GLES2,
because it allows for simpler/better support in glamor and mutter.

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

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2440>
2023-08-01 14:52:10 +00:00
Alyssa Rosenzweig
18b2daa136 gallium/u_simple_shaders: Optimize out ffloors
ffloor(f2i(x)) can't be optimized to f2i(x) due to differing behaviour for
negative x, but u_blitter only uses this with nonnegative x so we can instead
use ftrunc(f2i(x)) which NIR will optimize to f2i(x) for us. This gets rid of
the silly ffloor instructions in blit shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24319>
2023-08-01 14:04:08 +00:00
Alyssa Rosenzweig
ff9423b693 nir/schedule: Assume no old-style registers
True for all users. I intentionally didn't add is_ssa asserts because they're
pointless and will be deleted, like, next week and will just make that churn
even more annoying.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24319>
2023-08-01 14:04:07 +00:00
Karol Herbst
caa52774ae rusticl/nir: use the new nir_pass macro
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>
2023-08-01 13:16:55 +00:00
Karol Herbst
237feff917 rusticl/nir: add a nir_pass macro
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>
2023-08-01 13:16:55 +00:00
Karol Herbst
78dd9f4a42 rusticl/nir: add helper functions we need for a NIR_PASS macro
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>
2023-08-01 13:16:55 +00:00
Karol Herbst
ec93d46a7c meson,ci: bump meson req for rusticl to 1.2
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21451>
2023-08-01 13:16:55 +00:00
Igor Torrente
388bf84c07 zink: Removes disable_xcb_surface
This dri config is no longer necessary since the case where it was
required is being handled in the previous commit.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24222>
2023-08-01 12:27:55 +00:00
Igor Torrente
6d60115be7 zink: Fix enumerate devices when running compositor
When we try to run a compositor on top of Zink, we hit a lockup
when enumerating the Vulkan devices. The vulkan_device_select
tries to reorder the devices and gets stuck waiting for the Xserver.

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

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

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24222>
2023-08-01 12:27:55 +00:00
Robert Foss
71db99e566 egl: Always set _EGLDisplay->Device during eglGetPlatformDisplay()
Make sure that all platform specific implementations of
eglGetPlatformDisplay() overwrite the Device field.

Fixes: c237539d62 ("egl: Implement EGL_EXT_explicit_device")

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24394>
2023-08-01 11:21:59 +00:00
Robert Foss
1efaa85889 egl: Fix attrib_list[0] == EGL_NONE check
_eglGetSurfacelessDisplay(), _eglGetWaylandDisplay() and
_eglGetGbmDisplay() handle the attrib_list[0] == EGL_NONE
case incorrectly by returning an EGL_BAD_ATTRIBUTE error.

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

Fixes: c237539d62 ("egl: Implement EGL_EXT_explicit_device")

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24394>
2023-08-01 11:21:59 +00:00
Daniel Stone
1440a0f95b ci: Disable nouveau CI
It's offline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24426>
2023-08-01 11:53:29 +01:00
Karol Herbst
01cb01a7ee rusticl/kernel: only handle function_temp memory before lowering printf
There was no need to handle the other variable modes. This also fixes
double accounting of shared memory.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9058
Fixes: 5795ee0e08 ("rusticl: translate spirv to nir and first steps to kernel arg handling")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24398>
2023-08-01 10:08:23 +00:00
Danylo Piliaiev
5fc5123f63 turnip: Use common nir_vk_is_not_xfb_output
On a7xx fixes:
 dEQP-VK.rasterization.provoking_vertex.transform_feedback.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24318>
2023-08-01 10:32:04 +02:00
Danylo Piliaiev
261df5fb3c radv: Use common nir_vk_is_not_xfb_output
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24318>
2023-08-01 10:32:02 +02:00
Danylo Piliaiev
555a1a3be1 vulkan/nir: Add common helper to check if output is XFB
It was not taken into account that without Offset decoration
the output is not written into XFB.

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

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

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24318>
2023-08-01 10:30:59 +02:00
Danylo Piliaiev
81407797b9 radv: fix unused non-xfb shader outputs not being removed
It was not taken into account that without Offset decoration
the output is not written into XFB.

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

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

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

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

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24318>
2023-08-01 10:30:59 +02:00
Georg Lehmann
1e8d445bcf aco/gfx11: use v_cmp_class_f16 with opsel for bitnz/bitz
Foz-DB GFX11:
Totals from 1607 (1.21% of 132657) affected shaders:
MaxWaves: 36511 -> 36513 (+0.01%)
Instrs: 2412601 -> 2408770 (-0.16%); split: -0.16%, +0.00%
CodeSize: 12434716 -> 12414536 (-0.16%); split: -0.17%, +0.00%
VGPRs: 108872 -> 108860 (-0.01%)
Latency: 27555570 -> 27541897 (-0.05%); split: -0.05%, +0.00%
InvThroughput: 3144382 -> 3140929 (-0.11%); split: -0.11%, +0.00%
SClause: 65762 -> 65770 (+0.01%)
Copies: 127148 -> 127170 (+0.02%); split: -0.06%, +0.08%
PreVGPRs: 96737 -> 96447 (-0.30%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24380>
2023-08-01 07:52:42 +00:00
Georg Lehmann
1659d982c3 aco: combine a & ~b to bfi(b, 0, a)
Foz-DB Navi21:
Totals from 905 (0.68% of 132657) affected shaders:
Instrs: 1223583 -> 1221016 (-0.21%); split: -0.22%, +0.01%
CodeSize: 6567272 -> 6567064 (-0.00%); split: -0.04%, +0.03%
SpillSGPRs: 1231 -> 1223 (-0.65%)
SpillVGPRs: 829 -> 823 (-0.72%); split: -1.45%, +0.72%
Latency: 40952209 -> 40946230 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 9411929 -> 9397932 (-0.15%); split: -0.17%, +0.02%
VClause: 29108 -> 29112 (+0.01%); split: -0.04%, +0.05%
Copies: 105272 -> 105221 (-0.05%); split: -0.28%, +0.23%
Branches: 29330 -> 29329 (-0.00%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24383>
2023-08-01 07:15:28 +00:00
Alyssa Rosenzweig
c9b2f83a2f clang-format: Ignore original panfrost commit
Blame better.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24406>
2023-07-31 18:56:34 +00:00
Rhys Perry
76232d6724 radv: correctly skip MRT output NaN fixup for meta shaders
radv_nir_compiler_options::enable_mrt_output_nan_fixup is only used for
epilogs, these days.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 290c3d360e ("aco,radv: lower outputs to exports when nir for monolithic ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9414
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24352>
2023-07-31 17:31:00 +00:00
Faith Ekstrand
8de38aded5 vulkan: Add a core vk_sampler struct
Unlike some other core structs, I didn't bother to copy the entire
VkSamplerCreateInfo into the sampler.  There isn't typcially a lot of
pre-processing we can or need to do here and we may as well keep the
struct small for now.  It does, however, handle most things involving
chain-in structs.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>
2023-07-31 17:01:42 +00:00
Faith Ekstrand
6ff0b430d5 vulkan/format: Add the remaining 1-plane YCbCr formats
Each of these are just themselves in a single plane.  This is copied
from the 8888 version, these are just the 10, 12, and 16-bit versions.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>
2023-07-31 17:01:41 +00:00
Faith Ekstrand
829b3c0106 vulkan: Add common vkCmdBegin/EndQuery wrappers
These are identical to the IndexedEXT versions with index == 0.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>
2023-07-31 17:01:41 +00:00
Faith Ekstrand
f7e5e2cc4f vulkan: Add a vk_query_pool base object
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>
2023-07-31 17:01:41 +00:00
Faith Ekstrand
25b1e349c6 vulkan: Add a more direct way to use a NIR shader
This follows the pipeline libraries method of including SPIR-V and lets
you provide the NIR shader without wrapping it in a VkShaderModule.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>
2023-07-31 17:01:41 +00:00
Faith Ekstrand
b083f44303 vulkan: Add a core vk_buffer_view struct
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24335>
2023-07-31 17:01:41 +00:00
José Roberto de Souza
fa73130d9b iris: Add support for userptr in Xe KMD
Xe KMD only requires userptr to be bound to VM, so here returning
UINT32_MAX as gem_handle in Xe version of gem_create_userptr() for all
userptr bos.

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

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

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

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23817>
2023-07-31 16:38:46 +00:00
José Roberto de Souza
b38f7834f5 iris: Add gem_create_userptr() to KMD backend
Xe support of userptr will be implemented in the next patch,
this is just moving the i915 function to KMD backend.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23817>
2023-07-31 16:38:46 +00:00
José Roberto de Souza
0698bc9e5a iris: Move iris_bufmgr_bo_close() to kmd backend
The next patch will need a special handling when closing userptr bos
in Xe KMD, so here moving iris_bufmgr_bo_close() to kmd backend
and changing the gem_handle parameter to iris_bo.

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

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23817>
2023-07-31 16:38:46 +00:00
José Roberto de Souza
36bc3da586 iris: Move i915_gem_set_domain() call to i915 backend
This was being called from the common code, so it was being executed
for Xe KMD.
Luckily Xe don't have any uAPI at 0x1f offset.

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

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23817>
2023-07-31 16:38:46 +00:00
Rohan Garg
7f6e6eb8ec anv: partially revert 2e8b1f6d
set_image_compressed_bit checks for the image aux usage whereas
cmd_buffer_mark_image_written checks for the subresource's aux usage.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Fixes: 2e8b1f6d ('anv: drop duplicate checks when setting the compressed bit')
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24363>
2023-07-31 15:06:39 +00:00
Lionel Landwerlin
c1c0311d42 anv: enable EDS3 ConservativeRasterizationMode
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24395>
2023-07-31 12:30:37 +00:00
Lionel Landwerlin
a0179c32b6 anv: fix 3DSTATE_RASTER::APIMode field setting
The APIMode field is set in the dynamic part in gfx8_cmd_buffer.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 55951ac28e ("anv: fix emitting dynamic primitive topology")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24395>
2023-07-31 12:30:37 +00:00
Rhys Perry
e88c077096 radv: workaround WWZ exporting index=1 through location=1
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 290c3d360e ("aco,radv: lower outputs to exports when nir for monolithic ps")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9232
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24354>
2023-07-31 11:38:14 +00:00
Gert Wollny
618fc13db7 r600/sfn: Don't try to propagate to vec4 with more than one use
Otherwise we end up with weird dependencies that make the scheduler
choke.

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

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24393>
2023-07-31 09:37:20 +02:00
Yiwei Zhang
03ff3c0027 venus: suppress a false logging
Should only log when there's batched query feedbacks in the suspended
render pass instance. Additionally gate behind debug option.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24379>
2023-07-30 14:33:34 +00:00
Gert Wollny
99aeea467b r600: Force CF when emitting a NOP on R600 in gs copy shader
Fixes: 9d4104d4fb
    r600: Explicitly force new CF in gs copy shader

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24391>
2023-07-30 13:41:50 +00:00
Karol Herbst
8d7f682bdb nv50/ir/nir: Fix zero source handling of tex instructions.
For TXQ we know make sure that we at least add one source. If the nir
instruction however didn't had any sources, we inserted a fake 0 source
ending up with two 0s for TXQ.

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

Fixes: 85a31fa1fc ("nv50/ir/nir: fix txq emission on MS textures")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Acked-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24373>
2023-07-29 19:01:40 +00:00
Jordan Justen
5df97c27dc intel/compiler: Use nir SUBGROUP_INVOCATION for RT TOPOLOGY_ID
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21774>
2023-07-28 22:54:59 +00:00
Jordan Justen
dbf19b76e8 intel/isl: Use intel_needs_workaround() for MTL CCS WA
Also use parent WA number of 14017240301 instead of 14017353530.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22401>
2023-07-28 15:23:47 -07:00
Eric Engestrom
23b45c5a29 lavapipe/ci: use tighter changes: rules
This removes src/{egl,glx,loader,mapi,mesa}/* from the match.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24372>
2023-07-28 21:20:38 +00:00
Faith Ekstrand
0831f93e5f nir/builder: Add a nir_txs_deref() helper
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24375>
2023-07-28 20:39:07 +00:00
Faith Ekstrand
ee0942f7a6 nir/builder: Allow tex helpers on image types
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24375>
2023-07-28 20:39:07 +00:00
Connor Abbott
e690d88d69 freedreno/afuc: Initial a7xx support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
6fd0007447 afuc: Fix writing $00
This is valid and should do nothing. Don't make the PC overlap $00 in
the reg file, so that we can print out "writes" to $00 but they're still
discarded.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
7d7aa2251e afuc: Add setbit/clrbit
First introduced in a660_sqe.fw.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
1046ebbb89 afuc: Convert to isaspec
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
7376af0eef afuc: Fix xmov lexer typo
This happened to work by luck, but was caught with the isaspec encoding
assertions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
038680c2f6 isaspec: Add initial decoding support
This reuses the <map> entries in the <encode> block to go in the reverse
direction and parse an instruction into a machine-readable structure. It
currently assumes that <map> entries are simple l-values like
"src->src[0]" or "src->flag", which is enough for afuc, but the plan for
the future is to use the <decode> block to allow us to override that for
more complex cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
2faf344f03 isaspec: Rename isa_decode() to isa_disasm()
This actually disassembles the binary, and we will add a function that
actually decodes it to the same structure that the encoder uses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
26cce0a133 isaspec: Add callback after decoding an instruction
This will be used by afuc for printing register decodings in a comment.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
b63782da16 isaspec: Add "custom" field type
Add support for a field which is decoded by a user callback. This will
be used for decoding control registers in cread/cwrite by afuc.

In order for this to interact well with the align feature, we need to
pull print() out of the decode implementation so that the callback can
call it and keep track of the line column.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
dc874e4654 isaspec: Add support for function and entrypoint labels
Functions (i.e. labels reached from call instructions) should be printed
differently from normal labels. In addition we also need to add support
for entrypoints with user-defined names in order to show packet names in
afuc.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:58 +00:00
Connor Abbott
569d3ac5a1 isaspec: Add support for "absolute" branches
afuc has branches which use an absolute offset in instructions from the
microcode base. Add another type to support them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:57 +00:00
Connor Abbott
86b17d96b3 isaspec: Add "displayname" for altering {NAME} when decoding
In afuc, we have the situation where there are a number of ALU
instructions with two (almost) completely different encodings, including
a different opcode location, etc. These need to be different leaf
bitsets with different names for the encoder to work, because otherwise
the encoder has no way of descriminating between them, but when
displaying them we want to use the same name. This adds a small facility
to make the name used for {NAME} when displaying and for the opcode
when encoding different, so that e.g. OPC_ADDI can display as "add"
instead of "addi".

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
2023-07-28 18:41:57 +00:00
Adam Jackson
c237539d62 egl: Implement EGL_EXT_explicit_device
Implement support for EGL_EXT_explicit_device[1].

[1] https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_explicit_device.txt

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Robert Foss <rfoss@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23873>
2023-07-28 18:00:34 +00:00
Roman Stratiienko
41e664f825 egl: android: Remove legacy name-based shared buffers support
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3415
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16578>
2023-07-28 17:09:14 +00:00
José Roberto de Souza
2b7599dc49 intel: Rename intel_gem_add_ext() to intel_i915_gem_add_ext()
gem_add_ext() is i915 specific so adding it to the name.

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/23905>
2023-07-28 15:36:52 +00:00
José Roberto de Souza
c9950786f6 intel/common: Move functions inside of C++ ifdef
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/23905>
2023-07-28 15:36:52 +00:00
José Roberto de Souza
4198a301b3 intel: Move i915_drm.h specific code from common/intel_gem.h to common/i915/intel_gem.h
This allow us to remove one more i915_drm.h include from code shared
by both backends.

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/23905>
2023-07-28 15:36:52 +00:00
José Roberto de Souza
0579627f21 iris: Replace I915_EXEC_FENCE_SIGNAL by IRIS_BATCH_FENCE_SIGNAL in common code
This I915_EXEC_FENCE_SIGNAL was missed in the conversion from i915_drm.h
types to IRIS ones.
Both have the same value, so it was not causing any issues.

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/23905>
2023-07-28 15:36:52 +00:00
José Roberto de Souza
1174e7412e intel/dev: Port intel_dev_info tool to Xe KMD
Only hwconfig was calling i915 specifc function, so it was only
necessary split the function that fetches it from backends and call it
from intel_get_and_print_hwconfig_table() depending on the KMD loaded.

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/23905>
2023-07-28 15:36:52 +00:00
Illia Polishchuk
56e0aff530 anv, drirc: Add workaround to speed up Cyberpunk 2077 reg allocation
Calling the ra_allocate function after each register spill can take
several minutes. This option speeds up shader compilation by spilling
more registers after the ra_allocate failure.Required for
Cyberpunk 2077, which uses a watchdog thread to terminate the process
in case the render thread hasn't responded within 2 minutes.

Execution time of my Cyberpunk2077 shader compilation test:
https://gitlab.freedesktop.org/illia.a.polishchuk/cyberpunk-vulkan-compute-hang-test-anv

Before the patch:

real 1m28,738s
user 1m28,329s
sys 0m0,400s

After the patch

real 0m33,245s
user 32m,835s
sys 0m0,404s

I think it's acceptable patch because Cyberpunk benchmarks has
the same FPS with and without patch. (I started
it without patch with a patched binary with disabled watchdog thread)

Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Requires: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24228
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9241
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24299>
2023-07-28 14:51:42 +00:00
Jason Ekstrand
739e21fa9a intel/fs: Add a parameter to speed up register spilling
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24299>
2023-07-28 14:51:42 +00:00
Timur Kristóf
be11fee2a7 aco: Refactor select_program to smaller functions.
This prepares for allowing to compile 1 shader at a time
for merged shader stages.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23874>
2023-07-28 14:27:29 +00:00
José Roberto de Souza
623d704de8 iris/xe: Call iris_lost_context_state() when batch engine is replaced
This is necessary to initialize context and mark all the state as
dirty so it is re submitted.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24336>
2023-07-28 14:04:20 +00:00
Mike Blumenkrantz
e68e612826 nir: add a helper for calculating variable slots
this will maybe avoid future bugs, but probably not

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24163>
2023-07-28 13:14:35 +00:00
Mike Blumenkrantz
330f728cc4 lavapipe: use the component offset directly for xfb
the mask is only indicative of the components being used, not the offset
from which they start

cc: mesa-stable

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24163>
2023-07-28 13:14:35 +00:00
Mike Blumenkrantz
59396eefe6 nir: fix slot calculations for compact variables with location_frac
a variable with a component offset may span multiple slots, and this cannot
be inferred from its type alone (e.g., compacted clip+cull distances)

cc: mesa-stable

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24163>
2023-07-28 13:14:35 +00:00
Eric Engestrom
42021b4d13 bin/ci_run_n_monitor: get git sha from pipeline if specified, instead of requiring --rev to match
Fixes: 9ce717ab31 ("ci_run_n_monitor: add ability to specify the pipeline to use, instead of auto-detecting it")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24366>
2023-07-28 13:10:41 +00:00
Daniel Stone
f4d24ca414 egl/drm: Assume modern DRI interface versions
We know we always have modern versions of DRI_IMAGE and DRI_FLUSH as
we're version-locked to our same Mesa version.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
3d59f4cfcb egl/drm: Use IMAGE_DRIVER instead of DRI2_LOADER
We always have this extension available to us, since we demand matching
Mesa builds, and it's much better. Just use it always when we're not on
swrast.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
0b976bd48d egl/wayland: Assume modern DRI interface versions
We know what version the DRI_IMAGE extension is, and it's higher than 7.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
b3ec7c2a9e egl/wayland: Never use DRI2_LOADER extension
We don't need this anymore; the image loader extension does everything
we want it to and more, and is mandatory when we load.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
45b9b0ba32 egl/wayland: Add image loader extension for swrast
It doesn't hurt to have it here, so might as well.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
449e5bad7c egl/wayland: Always initialise fd_display_gpu
Set it to an invalid value, rather than leaving it to be stdout or
something.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
08bfc7395e egl/dri2: Don't look up image extension twice
We already look up the image driver extension inside
dri2_core_extensions, so don't do it again in the optional extensions -
just do it in the swrast path so we have it covered for both.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24347>
2023-07-28 12:25:19 +00:00
Daniel Stone
00aa095d53 dri: Support 1555/4444 formats
Add support for 1555 and 4444 formats, both in RGB/BGR ordering, with
and without alpha.

These are already supported by Gallium and drivers, but not yet for
winsys surfaces. Adding these is enough to make them renderable when
using Weston on iris.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24331>
2023-07-28 12:44:01 +01:00
Konstantin Seurer
0a07431e9a llvmpipe: Zero extend vectors in widen_to_simd_width
Extending using the first element vould extend the exec_mask (-1, 0, 0,
0) to (-1, 0, 0, 0, -1, -1, -1, -1).

Fixes: 573b8f2 ("gallivm: Implement vulkan textures")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9435
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24340>
2023-07-28 11:05:06 +00:00
Samuel Pitoiset
0d75fc8e42 radv: remove radv_shader_info::tes::num_linked_patch_inputs
It's never used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
f04577b789 radv: add support for dynamic TCS vertices out for TES
With shader object, if TES is compiled without a TCS, the number of
TCS vertices out might not be known at compile time and it needs to be
loaded from a user SGPR.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
faa756b3ba radv: copy the number of TCS vertices out to TES shader info
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
e855c7dd3d radv: stop checking if patch control points is dynamic everywhere
Check that the values are non-zero instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
a50cec9e18 radv: use a packed user SGPR for the TES state
It only contains the number of tessellation patches for now, but it
will be used to pass the number of TCS vertices out for shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
7ee74881d9 radv: prevent linking TCS<->TES when TES is NULL
This can happen with shader object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
54414a2121 radv: initialize tcs.tes_{patch}_inputs_read to a default value
For shader object when a TCS is not linked to a TES at compile time.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
afa5b83152 radv: do not always copy the number of tess patches to TES
This is only needed when the number of patch control points is known
at compile time. Adding a check makes it less confusing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
f1b98f32c4 radv: stop lowering patch vertices for TES
This intrinsic is replaced during ABI lowering later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Samuel Pitoiset
40a693e056 radv: stop copying some NIR info fields from TES to TCS
They aren't used, only TES needs to know them.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24346>
2023-07-28 08:21:40 +00:00
Alex Denes
16a66a67ef virgl: link VA driver with build-id
Without a build-id the virgl VAAPI driver segfaults trying to access the
NULL returned by the build-id header retriever used for disk caches

Fixes: d6db4d2e08 ("virgl: Add simple disk cache")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19885>
2023-07-28 07:51:11 +00:00
Samuel Pitoiset
76cc85ebb9 radv: compute the legacy GS info earlier
This allows geometry shaders to work with shader object on GFX6-8
because the workgroup size is the wave size. We will need different
tweaks for NGG but that's for later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24333>
2023-07-28 08:55:48 +02:00
Samuel Pitoiset
329907178e radv: use next stage to determine if primID/clip dist should be exported
More shader object friendly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24333>
2023-07-28 08:55:12 +02:00
Samuel Pitoiset
48fc29e075 radv: use next_stage to determine if the layer should be exported
More shader object friendly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24333>
2023-07-28 08:55:12 +02:00
Samuel Pitoiset
8ab8145aa1 radv: add support for VS/TES as ES without shaders IO linking
This implements fixed IO location for VS/TES with GS. This is currently
unused because everything is linked with GPL or monolithic pipelines,
but this will be used for shader object.

Tested by running full CTS after disabling NIR IO linking for VS/TES.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24328>
2023-07-28 06:51:24 +00:00
Samuel Pitoiset
2e7ea0fc24 radv: track whether inputs/outputs are linked per shader stage
With shader object, it's possible to compile shaders without any
linking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24328>
2023-07-28 06:51:24 +00:00
Benjamin Cheng
3629b43822 radv/video: use app provided hevc scaling list order
This partially reverts commit da54b578.

Vulkan spec defers the definition of these lists to the H265 ITU spec,
which defines the scaling lists to be in "up-right diagonal scan order"
already.

Fixes: da54b578 ("radv/video: fix hevc scaling lists.")
Reviewed-by: Lynne <dev@lynne.ee>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24356>
2023-07-28 12:35:26 +10:00
Lionel Landwerlin
87149cc545 blorp: update and move fast clear PIPE_CONTROLs to drivers
Before this patch, when updating the indirect clear color, BLORP only
invalidated the texture cache on gfx11. The hardware docs state that
the texture cache invalidation is also needed on gfx12 however. Add
this invalidation for gfx12 and move the fast-clear related cache
invalidations to the drivers for clarity and performance.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5850
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23588>
2023-07-28 00:07:15 +00:00
Lionel Landwerlin
c94bd56114 blorp: switch blorp_update_clear_color to early return
Avoid even going to the function if we don't need to.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23588>
2023-07-28 00:07:15 +00:00
Karol Herbst
85a31fa1fc nv50/ir/nir: fix txq emission on MS textures
In GL and a lot of Vulkan if we end up with either a lod or an ms index.

Sadly in Vulkan we can end up with both and have to choose properly. For
TXQ we have to emit a zero LOD. For TXF we have to emit the ms index.

Fixes: bb032d8b62 ("nv50/ir/nir: implement nir_instr_type_tex")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24343>
2023-07-27 22:49:05 +00:00
Yiwei Zhang
6b2956e569 ci/venus: reenable pipeline cts
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24344>
2023-07-27 20:32:18 +00:00
Yiwei Zhang
9e05ef823c ci/venus: remove fixed tests that no longer run
Those multiview failures have been fixed in lvp while the EDS failure
tests are obsolete.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24344>
2023-07-27 20:32:18 +00:00
Mike Blumenkrantz
626e3a6e34 zink: don't clobber descriptor mode on multiple screen creation
the env var should only ever be read if the mode is unset

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:22 +00:00
Mike Blumenkrantz
f9d62b4c0b kopper: determine modifier support per-drawable
this should more accurately block modifier usage when not supported

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:22 +00:00
Mike Blumenkrantz
a9efabd8f3 kopper: pass modifier availability to drawable creation
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:21 +00:00
Mike Blumenkrantz
1887368df4 glx/sw: check for modifier support in the kopper path
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:21 +00:00
Mike Blumenkrantz
5589d2b556 glx/dri3: split out modifier check
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:21 +00:00
Mike Blumenkrantz
6b0f8973c9 kopper: move pixmap param for drawable creation to info struct
no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:21 +00:00
Mike Blumenkrantz
7100ef4566 glxsw: check geometry of drawables on creation
this mimics the dri codepath and allows early rejection of invalid
drawables to avoid subsequent breakage

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:21 +00:00
Mike Blumenkrantz
2b71e645bc kopper: handle pixmap creation failure more gracefully
cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27 19:18:21 +00:00
Iván Briano
71ebd9b9d7 anv,hasvk: respect provoking vertex setting on geometry shaders
We need to set the right value on ReorderMode based on the provoking
vertex mode, or the order in which the vertices for tristrip[_adj] are
delivered to the geometry shader doesn't match what Vulkan expects.

Fixes
dEQP-VK.transform_feedback.primitives_generated_query.concurrent.*triangle_strip_with_adjacency*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23243>
2023-07-27 18:52:49 +00:00
Eric Engestrom
88deb4bb88 ci: print clang-format's version
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24302>
2023-07-27 17:33:59 +00:00
Eric Engestrom
02e40d3b48 ci: print rustfmt's version
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24302>
2023-07-27 17:33:59 +00:00
Caio Oliveira
e693fd815a nir: Let nir_fixup_deref_modes() fix deref_casts when possible
If a deref_cast parent is also a deref, and the parent mode is not
generic, we can safely propagate the parent mode down to the
deref_cast.

This will allow the fixup to work when the deref_cast is used just
to change the glsl_type when accessing a variable/deref-chain.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23734>
2023-07-27 16:20:36 +00:00
David Heidelberg
38d1e73868 ci/kdl: remove extra-verbose ls command
Not needed for non-debugging builds.

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

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24348>
2023-07-27 18:31:53 +03:00
Rohan Garg
4aeac9f21c iris: allow for a unsynchronized device reset query
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24224>
2023-07-27 13:43:38 +00:00
Rohan Garg
2756534660 iris: track reset signalling instead of replacing the context
Instead of creating a new context when a reset is encountered, we now
track whether the reset was reported back to the application. According
to the spec, the application should poll the reset status and recreate
the context when NO_ERROR encountered after a RESET.

From the EXT_robustness spec:

5. How should the application react to a reset context event?

RESOLVED: For this extension, the application is expected to query
the reset status until NO_ERROR is returned. If a reset is encountered,
at least one *RESET* status will be returned. Once NO_ERROR is again
encountered, the application can safely destroy the old context and
create a new one.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24224>
2023-07-27 13:43:38 +00:00
David Rosca
e52f7d5cb9 gallium/auxiliary/vl: Fix chroma offset of compute_shader_weave
Truncate UV coordinates to fix incorrect chroma offset.
Adjust texture offsets to match this change:
   0.5   on X
   0.25  on Y (interlaced)

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24301>
2023-07-27 13:16:10 +00:00
David Rosca
3a484cd4ea gallium/auxiliary/vl: Fix chroma and blurry output of cs video_buffer
Truncate UV coordinates to fix incorrect chroma offset.
Add texture offset to avoid blur from linear sampler.

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24301>
2023-07-27 13:16:10 +00:00
Rhys Perry
59f24c7df8 nir/lower_shader_calls: vectorize stack access for all shaders
fossil-db (gfx1100):
Totals from 9 (0.01% of 133461) affected shaders:
MaxWaves: 156 -> 158 (+1.28%)
Instrs: 37193 -> 37324 (+0.35%)
CodeSize: 191008 -> 191968 (+0.50%)
VGPRs: 816 -> 804 (-1.47%)
Latency: 75789 -> 75641 (-0.20%); split: -0.35%, +0.15%
InvThroughput: 10475 -> 10441 (-0.32%); split: -0.40%, +0.08%
VClause: 666 -> 663 (-0.45%); split: -0.75%, +0.30%
SClause: 1077 -> 1076 (-0.09%)
Copies: 3425 -> 3407 (-0.53%); split: -0.73%, +0.20%
PreVGPRs: 770 -> 745 (-3.25%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24334>
2023-07-27 12:38:01 +00:00
Mike Blumenkrantz
318d0316dd zink: fix the fix for separate shader program refcounting
the previous fix fixed the initial refcount but then left a dangling
ref when doing the optimized program replacement

Fixes: 4e38061643 ("zink: fix separate shader program refcounting")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24255>
2023-07-27 11:59:21 +00:00
Eric Engestrom
70eff58767 ci: allow hw jobs even if lint jobs fail for non-Marge pipelines
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24257>
2023-07-27 11:24:24 +00:00
Eric Engestrom
b4bcb1a567 ci/lint: also print a diff for rust format issues
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24257>
2023-07-27 11:24:24 +00:00
Eric Engestrom
5ae6d5e436 ci/lint: deduplicate formatting check jobs
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24257>
2023-07-27 11:24:24 +00:00
Karmjit Mahil
59e08ad78c pvr: Fix csb relocation status assert on pvr_csb_finish()
The app might not have emitted any cs words before freeing
resources so it is valid for the csb relocation mark to be
uninitialised on `pvr_csb_finish()`.

Fixes the assert being hit for:
  dEQP-VK.api.pipeline.pipeline_layout.lifetime.graphics

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24329>
2023-07-27 11:03:41 +00:00
Karmjit Mahil
2c6cadb5ea pvr: Fix packing issue with max_{x,y}_clip
The spec. guarantees the framebuffer width and height to be `> 0`
but the same is not true for the render area.

Previously a render area of `0` size would wrap around due to the
`- 1` so we now check for `0`.

Fixes:
  pvr_packet_helpers.h:79: __pvr_uint: Assertion `v <= max' failed.
on
  dEQP-VK.api.pipeline.renderpass.framebuffer_compatible_renderpass

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24329>
2023-07-27 11:03:41 +00:00
Samuel Pitoiset
670bd70fa6 radv: emulate GEOMETRY_SHADER_INVOCATIONS query on RDNA1-2
The number of geometry shader invocations is correctly counted by the
hardware for both NGG and the legacy GS path but it increments for
NGG VS/TES because they are merged with GS, but it shouldn't. Fix this
by emulating the number of geometry shader invocations.

This fixes piglit/bin/arb_query_buffer_object-qbo and recent
dEQP-VK.query_pool.statistics_query.gs_invocations_no_gs.* failures
with NGG.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:15:22 +02:00
Samuel Pitoiset
b3aeaee5eb radv: implement nir_intrinsic_atomic_add_gs_invocation_count_amd
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:13:11 +02:00
Samuel Pitoiset
2e0893cf8b radv: rename RADV_SHADER_QUERY_PIPELINE_STAT_OFFSET
To RADV_SHADER_QUERY_GS_PRIM_EMIT_OFFSET.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:13:11 +02:00
Samuel Pitoiset
50709863ac radv: simplify the NGG vs legacy pipelinestat query path
NGG is enabled by default on RDNA1-2 but the driver might fallback to
legacy GS for some reasons, like XFB. On these generations, the number
of generated primitives by GS needs to be emulated from the NGG shader
because the hw doesn't increment the related pipelinestat counter.

In order to support NGG and legacy GS with that query (remember that
we can't know pipelines when starting/ending queries), we used to
reserve 2x 64-bit counters to store the GDS results, and the results
were accumulated.

Now that legacy GS also uses GDS counters, we can simplify this path
and overwrite the pipelinestat counter directly instead of having two
separate counters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:13:11 +02:00
Samuel Pitoiset
f13ff5e70e radv: enable pipelinestat query emulation for legacy GS
This will allow us to fix a bug with the number of geometry shader
invocations which increase for NGG VS or TES but shouldn't. And also
for simplifying the NGG vs legacy query path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:13:11 +02:00
Samuel Pitoiset
96b97ed527 radv: declare the shader query user SGPR for emulating GS counters
This user SGPR is only declared on chips that support NGG but might
fallback to legacy GS for some reasons, like XFB. It will be used to
emulate GS counters from shaders.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:13:11 +02:00
Samuel Pitoiset
e1f8cfc2b2 radv: rename NGG query state to be more generic
To use emulated GS counters for legacy GS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>
2023-07-27 09:13:11 +02:00
Christian Gmeiner
86a5e942dd freedreno/regs: python does not need ';'
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24330>
2023-07-27 04:53:19 +00:00
Christian Gmeiner
d305b4a1c8 freedreno/regs: remove dead code
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24330>
2023-07-27 04:53:19 +00:00
Christian Gmeiner
03bd9b9a58 freedreno/regs: remove not used variable
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24330>
2023-07-27 04:53:19 +00:00
Christian Gmeiner
c2d8f3c561 freedreno/regs: remove double assignment of self.current_domain
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24330>
2023-07-27 04:53:19 +00:00
Erik Faye-Lund
9709ae4cc6 meson: report with_glvnd in summary
GLVND *really* kinda belongs in *both* GLX and EGL, but it feels silly
to repeat the same setting. So let's just report it under the GL
section, as that's generic enough to apply to both of other sections.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24317>
2023-07-27 00:46:29 +00:00
Lionel Landwerlin
365b14489d anv: wire image sparse loads
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23882>
2023-07-27 02:03:02 +03:00
Lionel Landwerlin
fe81d40bff intel/nir: add lower for sparse images & textures
We have to lower images into image load + sampler residency.

There is also a restriction on sampler access with a compare, lower
those as 2 sampler instructions to meet the restriction.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23882>
2023-07-27 02:02:59 +03:00
Lionel Landwerlin
300cc829de intel/nir: handle image_sparse_load in storage format lowering
The last component of sparse load is the residency data. We don't want
to touch/convert that value with the format lowering.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23882>
2023-07-27 02:02:34 +03:00
Lionel Landwerlin
d33aff783d intel/fs: add support for sparse accesses
Purely from the backend point of view it's just an additional
parameter to sampler messages.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23882>
2023-07-27 02:02:30 +03:00
Dmitry Baryshkov
ba5f0c203c gallium: unbreak kmsro/freedreno case
In case the case of kmsro and freedreno driver, freedreno will fail to
with the xmlconfig errors as the kmsro declaration doesn't have defaults
for the freedreno options. Instead of directly using v3d_driconf for
kmsro, add native kmsro_driconf, which optionally includes v3d and
freedreno options.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24218>
2023-07-26 21:57:13 +00:00
Dmitry Baryshkov
a5b445782e gallium: move kmsro definition to the bottom of the file
The kmsro (in theory) can be using any other driver. In order to
simplify handling of driver public headers, move kmsro definition to the
bottom of the drm_helper.h

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24218>
2023-07-26 21:57:13 +00:00
David Heidelberg
2cf55d94b6 ci/kernel: add amd patch to prevent crashes when starting X
See: https://gitlab.freedesktop.org/drm/amd/-/issues/2669

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

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24338>
2023-07-26 21:12:37 +00:00
Faith Ekstrand
29c4417fb8 nir: Add a backend_flags field to nir_tex_instr
In 9ffd00bcf1 ("nir_to_tgsi: Pack our tex coords into vec4
nir_tex_src_backend[12]"), Emma added a pair of back-end sources to
nir_tex_instr to allow complex lowering to be done in NIR.  This adds a
tiny bit more hw-specific back-end information that a NIR lowering pass
can communicate to the back-end compiler.

While the opcode contains most of the information needed, some thing
such as the presence of offsets is currently only communicated via the
presence of specific source types in the source list.  This information
is gone when the texture instruction is lowered to back-end sources.
Adding a backend_flags field fixes this by allowing the lowering pass to
communicate a small amount of side-band information if needed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22303>
2023-07-26 20:12:49 +00:00
Gert Wollny
3954d545ca r600: don't use sb disasm to disassamble copy shader
We will remove sb at one point, so drop its use.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
02384de494 r600: don't check possible size of ALU CF
The scheduler and sfn assembler already o this.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
c3e5b8da58 r600: Assert when backend wants to create a new ALU CF
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
9d4104d4fb r600: Explicitly force new CF in gs copy shader
With that we can assert on ALU CF mission in the assembler

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
104cac4dbd r600/sfn: Schedule AR uses befor possible groups
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
9bf68273ad r600/sfn: rework checks for ALU CF emission
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
6aafa2bb49 r600/sfn: Splizt ALU blocks in scheduler to fit into 128 slots
With that the backend doesn't split these ALU CFs any more.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
440cf7439d r600/sfn: on Cayman loading an index register needs only one slot
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
4b4770e820 r600/sfn: make remaining slots a signed value
Needed to check the limits.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
b4ddc9b0c7 r600/sfn: Add flags to check whether a group starts CF and can do that
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:43 +00:00
Gert Wollny
acf21d7462 r600/sfn: Add method to convert to AluGroup directly
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:42 +00:00
Gert Wollny
bd7a9b7f4e r600/sfn: override slot count for IfInstr
We have one slot for the predicate (todo fix this value)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:42 +00:00
Gert Wollny
c517defbdd r600/sfn: Fix typo with block type
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:42 +00:00
Gert Wollny
e60ff83834 r600/sfn: set block sizes based on chip class
Be conservative with the ALU slots and the VTX slots.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:42 +00:00
Gert Wollny
55f692c451 r600/sfn: Always check arrays writes before allowing copy propagation
Also propaate extra dependencies when an indirect load is propagated

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:42 +00:00
Gert Wollny
1d4dd664e0 r600/sfn: Fix use of multiple IDX with kcache
Currently we don't properly support using he two IDX registers in the
same ALU CF, so work around this by enforcing a new CF if both indices
are used.

Fixes: d21054b4bc
    r600/sfn: Add pass to split addess and index register loads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
2023-07-26 19:33:42 +00:00
David Heidelberg
d99b830c2b Revert "ci/farms: always compare the code against main repository"
Unsustainable solution for the fork due to need keep main repository
up-date there.

This reverts commit 7b29ae557a.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24337>
2023-07-26 20:59:57 +03:00
Connor Abbott
37a92d0af1 tu: Disable transformFeedbackPreservesProvokingVertex
Our implementation only preserves the provoking vertex if it is last,
and always preserving it would be more draw-time validation because the
vertex ordering is tied up with the tessellation domain origin. It turns
out we didn't notice this because the tests aren't good enough to catch
the issue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24304>
2023-07-26 17:09:36 +00:00
Connor Abbott
6383f9c131 ir3: Handle GS stream "mixing" with non-point output primitives
This fixes some new Vulkan CTS tests that do this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24304>
2023-07-26 17:09:36 +00:00
Rhys Perry
37fbfa655a aco: insert s_nop before VGPR deallocation
A hazard requires this, apparently.

https://reviews.llvm.org/D155681

fossil-db (gfx1100):
Totals from 23175 (17.36% of 133461) affected shaders:
Instrs: 41240100 -> 41263275 (+0.06%)
CodeSize: 211858524 -> 211951224 (+0.04%)
Latency: 469738570 -> 469738576 (+0.00%)
InvThroughput: 58013998 -> 58013999 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24320>
2023-07-26 13:58:22 +00:00
David Heidelberg
7b29ae557a ci/farms: always compare the code against main repository
`rules:changes:compare_to` resolved firstly pushed branch pipelines,
which always evaluated `rules:changes` as true which breaks the workflow

Since we now explicitely say, that we compare against `main` repository,
GitLab can evaluate against real changes.

Fixes: 79f7882fc6 ("ci: add quirk for GitLab assuming changes is always true for scheduled runs")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24305>
2023-07-26 15:01:17 +03:00
Lionel Landwerlin
50c29e1ffa anv: simplify buffer address+size loads from descriptor buffer
Only found a couple titles that have been helped by this :

 PERCENTAGE DELTAS Shaders   Instrs    Cycles
 cyberpunk_2077    10388     -0.00%    -0.00%
 -----------------------------------------------
 All affected      1         -2.24%    -0.39%
 -----------------------------------------------
 Total             10388     -0.00%    -0.00%

 PERCENTAGE DELTAS    Shaders   Instrs    Cycles
 red_dead_redemption2 5949      -0.10%    -0.00%
 --------------------------------------------------
 All affected         111       -0.74%    -0.14%
 --------------------------------------------------
 Total                5949      -0.10%    -0.00%

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23318>
2023-07-26 09:41:23 +00:00
Lionel Landwerlin
f1f58c3bea isl: add ability to store buffer size in unused RENDER_SURFACE_STATE fields
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23318>
2023-07-26 09:41:23 +00:00
Lionel Landwerlin
d099e47de0 intel/fs: add more UNDEFs around SEND messages
lower_find_live_channel() in particular is used a lot in control flow
to find the live channel for the surface/sampler handle. Adding UNDEFs
on the temporary registers used for finding the live channels helps
reduce the liveness of those temporary registers, especially in loops.

Some titles affected :

Rise Of The Tomb Raider:
Totals from 2780 (22.58% of 12311) affected shaders:
Instrs: 1294455 -> 1294592 (+0.01%); split: -0.15%, +0.16%
Cycles: 1473136441 -> 1471302617 (-0.12%); split: -1.52%, +1.40%
Max live registers: 144282 -> 143595 (-0.48%)
Max dispatch width: 22200 -> 22232 (+0.14%)

Red Dead Redemption 2:
Totals from 435 (7.28% of 5972) affected shaders:
Instrs: 488472 -> 487594 (-0.18%); split: -0.31%, +0.14%
Cycles: 11354732 -> 11384928 (+0.27%); split: -0.44%, +0.71%
Spill count: 1217 -> 1172 (-3.70%)
Fill count: 3521 -> 3447 (-2.10%)
Scratch Memory Size: 64512 -> 62464 (-3.17%)
Max live registers: 35997 -> 35798 (-0.55%)

Fallout 4:
Totals from 8 (0.49% of 1638) affected shaders:
Instrs: 41908 -> 40509 (-3.34%)
Cycles: 3638464 -> 3555680 (-2.28%); split: -2.67%, +0.39%
Spill count: 717 -> 665 (-7.25%)
Fill count: 2542 -> 2438 (-4.09%)
Scratch Memory Size: 32768 -> 16384 (-50.00%)
Max live registers: 567 -> 534 (-5.82%)

Cyberpunk 2077:
Totals from 2984 (28.97% of 10301) affected shaders:
Instrs: 3888874 -> 3891600 (+0.07%); split: -0.20%, +0.27%
Cycles: 67906489 -> 67767721 (-0.20%); split: -0.68%, +0.47%
Spill count: 200 -> 98 (-51.00%)
Fill count: 237 -> 90 (-62.03%)
Scratch Memory Size: 10240 -> 8192 (-20.00%)
Max live registers: 215715 -> 212727 (-1.39%)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24282>
2023-07-26 08:48:33 +00:00
Lionel Landwerlin
5c72724819 intel/fs: consider UNDEF as non-partial write
A few titles show max live register reductions, but nothing
significant in instruction count or other stats.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24282>
2023-07-26 08:48:32 +00:00
Samuel Pitoiset
08bfcc12d4 radv: rename radv_pipeline_stage to radv_shader_stage
It's more generic and it will fit shader object just well.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
090d88247d radv: cleanup pipeline compute emit helpers
Merge both functions together and rename the function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
fdec88bd7c radv: rework determining the NGG stage without a graphics pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
174816019f radv: simplify lowering NGG GS intrinsics
The is_ngg field is already set correctly for GS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
70dbe011bb radv: rename graphics pipeline linking helpers
There is no pipeline dependency.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
697d4d4b03 radv: move removing all varyings when the FS is a noop
This allows us to remove one more pipeline dependency.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
5da9f38c53 radv: stop passing radv_graphics_pipeline to radv_fill_shader_info()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
a7fdcc3b22 radv: rework considering force VRS without relying on graphics pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
9d89b29a80 radv: set next_stage to MESA_SHADER_NONE if there is no FS
This follows the same convention as shader object where the last stage
would have nextStage to 0. This will allow more refactoring.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Samuel Pitoiset
b250efa714 radv: initialize stage/next_stage earlier
This will allow more refactoring.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24313>
2023-07-26 07:44:49 +00:00
Lionel Landwerlin
d62e494b37 intel/vec4: fix log_data pointer
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3384f029be ("intel/compiler: rework input parameters")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9421
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24307>
2023-07-26 06:36:18 +00:00
Yonggang Luo
6e43618b82 ac: Switch to use nir_foreach_function_impl in function analyze_shader_before_culling
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23940>
2023-07-26 03:43:40 +00:00
Yonggang Luo
a606074a7a radeonsi: Convert to use nir_foreach_function_impl
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23940>
2023-07-26 03:43:40 +00:00
Yonggang Luo
3f7a3a6698 microsoft/clc/compiler: Convert to use nir_foreach_function_impl when possible
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23940>
2023-07-26 03:43:40 +00:00
Yonggang Luo
d5baad2afa microsoft/compiler: convert to use nir_foreach_function_with_impl in function emit_module
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23940>
2023-07-26 03:43:40 +00:00
Rebecca Mckeever
87109c3e1b vulkan/runtime: Add helper functions for VK_EXT_host_image_copy
Add helper functions vk_memory_to_image_copy_layout() and
vk_image_to_memory_copy_layout(), which will be useful in
VK_EXT_host_image_copy implementations.

vk_memory_to_image_copy_layout() is similar to
vk_image_buffer_copy_layout(), except the second parameter is
VkMemoryToImageCopyEXT instead of VkBufferImageCopy2.

vk_image_to_memory_copy_layout() is similar to
vk_image_buffer_copy_layout(), except the second parameter is
VkImageToMemoryCopyEXT instead of VkBufferImageCopy2.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24290>
2023-07-25 23:34:02 +00:00
Karol Herbst
2388f22a5e gm107/ir: fix SULDP for loads without a known format
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24312>
2023-07-25 23:15:41 +00:00
Iván Briano
377c2a045f intel/compiler: call brw_nir_adjust_payload from brw_postprocess_nir
Calling anything after nir_trivialize_registers() risks undoing some of
its work.
In this case, brw_nir_adjust_payload() will do a constant folding pass
if any payload adjusting happened, and that can turn a bunch of
@store_regs into basically noops.

Fixes dEQP-VK.subgroups.*task

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24325>
2023-07-25 22:48:09 +00:00
Ian Romanick
cb0de0a1d3 intel/fs: Constant fold OR and AND
The path taken in fs_visitor::swizzle_nir_scratch_addr for DG2 generates
some AND and OR instructions before the SHL. This commit folds those so
the whold calculation becomes a constant (like on older platforms).

v2: Fix return type of src_as_uint. Noticed by Marcin.

shader-db results:

DG2
total instructions in shared programs: 23190475 -> 23179540 (-0.05%)
instructions in affected programs: 36026 -> 25091 (-30.35%)
helped: 7 / HURT: 0

total cycles in shared programs: 841196807 -> 841142563 (<.01%)
cycles in affected programs: 1660670 -> 1606426 (-3.27%)
helped: 7 / HURT: 0

No shader-db changes on any older Intel platforms.

fossil-db results:

DG2
Totals:
Instrs: 197780372 -> 197773966 (-0.00%)
Cycles: 14066410782 -> 14066399378 (-0.00%); split: -0.00%, +0.00%
Subgroup size: 8438104 -> 8438112 (+0.00%)
Send messages: 8049445 -> 8049446 (+0.00%)
Scratch Memory Size: 14263296 -> 14264320 (+0.01%)

Totals from 9 (0.00% of 668055) affected shaders:
Instrs: 24547 -> 18141 (-26.10%)
Cycles: 1984791 -> 1973387 (-0.57%); split: -0.98%, +0.40%
Subgroup size: 88 -> 96 (+9.09%)
Send messages: 867 -> 868 (+0.12%)
Scratch Memory Size: 69632 -> 70656 (+1.47%)

No fossil-db changes on any older Intel platforms.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23884>
2023-07-25 22:11:21 +00:00
Ian Romanick
61c786bad5 intel/fs: Constant fold SHL
This is a modified version of a commit originally in !7698. This version
add the changes to brw_fs_copy_propagation. If the address passed to
fs_visitor::swizzle_nir_scratch_addr is a constant, that function will
generate SHL with two constant sources.

DG2 uses a different path to generate those addresses, so the constant
folding can't occur there yet. That will be addressed in the next
commit.

What follows is the commit change history from that older MR.

v2: Previously this commit was after `intel/fs: Combine constants for
integer instructions too`.  However, this commit can create invalid
instructions that are only cleaned up by `intel/fs: Combine constants
for integer instructions too`.  That would potentially affect the
shader-db results of each commit, but I did not collect new data for
the reordering.

v3: Fix masking for W/UW and for Q/UQ types. Add an assertion for
!saturate. Both suggested by Ken. Also add an assertion that B/UB types
don't matically come back.

v4: Fix sources count. See also ed3c2f73db ("intel/fs: fixup sources
number from opt_algebraic").

v5: Fix typo in comment added in v3. Noticed by Marcin. Fix a typo in a
comment added when pulling this commit out of !7698. Noticed by Ken.

shader-db results:

DG2
No changes.

Tiger Lake, Ice Lake, and Skylake had similar results (Ice Lake shown)
total instructions in shared programs: 20655696 -> 20651648 (-0.02%)
instructions in affected programs: 23125 -> 19077 (-17.50%)
helped: 7 / HURT: 0

total cycles in shared programs: 858436639 -> 858407749 (<.01%)
cycles in affected programs: 8990532 -> 8961642 (-0.32%)
helped: 7 / HURT: 0

Broadwell and Haswell had similar results. (Broadwell shown)
total instructions in shared programs: 18500780 -> 18496630 (-0.02%)
instructions in affected programs: 24715 -> 20565 (-16.79%)
helped: 7 / HURT: 0

total cycles in shared programs: 946100660 -> 946087688 (<.01%)
cycles in affected programs: 5838252 -> 5825280 (-0.22%)
helped: 7 / HURT: 0

total spills in shared programs: 17588 -> 17572 (-0.09%)
spills in affected programs: 1206 -> 1190 (-1.33%)
helped: 2 / HURT: 0

total fills in shared programs: 25192 -> 25156 (-0.14%)
fills in affected programs: 156 -> 120 (-23.08%)
helped: 2 / HURT: 0

No shader-db changes on any older Intel platforms.

fossil-db results:

DG2
Totals:
Instrs: 197780415 -> 197780372 (-0.00%); split: -0.00%, +0.00%
Cycles: 14066412266 -> 14066410782 (-0.00%); split: -0.00%, +0.00%

Totals from 16 (0.00% of 668055) affected shaders:
Instrs: 16420 -> 16377 (-0.26%); split: -0.43%, +0.17%
Cycles: 220133 -> 218649 (-0.67%); split: -0.69%, +0.01%

Tiger Lake, Ice Lake and Skylake had similar results. (Ice Lake shown)
Totals:
Instrs: 153425977 -> 153423678 (-0.00%)
Cycles: 14747928947 -> 14747929547 (+0.00%); split: -0.00%, +0.00%
Subgroup size: 8535968 -> 8535976 (+0.00%)
Send messages: 7697606 -> 7697607 (+0.00%)
Scratch Memory Size: 4380672 -> 4381696 (+0.02%)

Totals from 6 (0.00% of 662749) affected shaders:
Instrs: 13893 -> 11594 (-16.55%)
Cycles: 5386074 -> 5386674 (+0.01%); split: -0.42%, +0.43%
Subgroup size: 80 -> 88 (+10.00%)
Send messages: 675 -> 676 (+0.15%)
Scratch Memory Size: 91136 -> 92160 (+1.12%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23884>
2023-07-25 22:11:21 +00:00
Ian Romanick
56e6186dcf intel/fs: Always do opt_algebraic after opt_copy_propagation makes progress
opt_copy_propagation can create invalid instructions like

    shl(8) vgrf96:UD, 2d, 8u

These instructions will be cleaned up by opt_algebraic.  The irony is
opt_algebraic converts these to simple mov instructions that
opt_copy_propagation should clean up.  I don't think we want a loop like

   do {
      progress = false;
      if (OPT(opt_copy_propagation)) {
         OPT(opt_algebraic);
         OPT(dead_code_eliminate);
      }
   } while (progress);

But maybe we do?

Maybe this would be sufficient:

   while (OPT(opt_copy_propagation))
      OPT(opt_algebraic);
   OPT(dead_code_eliminate);

No shader-db or fossil-db changes (yet) on any Intel platform.  This is
expected.

v2: Do opt_algebraic immediately after every call to
opt_copy_propagation instead of being clever. Suggested by Lionel.

Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23884>
2023-07-25 22:11:21 +00:00
Emma Anholt
d089272fc0 ci/a5xx: Add another GPU hanging piglit test to the skips.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23485>
2023-07-25 21:29:33 +00:00
Collabora's Gfx CI Team
2f834340a6 Uprev Piglit to ed58dfbd12be34fa3dab97a7a2987b890e0637f1
5036601c43...ed58dfbd12

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23485>
2023-07-25 21:29:33 +00:00
Emma Anholt
65ff9f0a55 tu: Fix data race in userspace VMA management.
The sequence was two threads A and B on a shared VkDevice:

A: move a BO to zombie VMA list
A: drop the BO VMA lock
B: prepare to allocate a BO
B:   Lock BO VMA lock
B:     call tu_free_zombie_vma_locked()
B:       close the gem handle from the VMA list
B:   Drop BO VMA lock
B: allocate a BO, getting the recently-closed handle back.
B: initialize the BO struct for the new handle.
A: memset the BO struct to 0.

Multithreading in C is the worst.

Closes: #9049, #9247
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24324>
2023-07-25 13:34:25 -07:00
José Roberto de Souza
3efba1e2e9 iris: Request Xe KMD to place BOs to CPU visible VRAM when required
This is required to support discrete GPUs placed in systems with large
PCI bar or resizeble PCI bar not available or disabled.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23781>
2023-07-25 19:33:16 +00:00
José Roberto de Souza
f59d272e93 anv: Request Xe KMD to place BOs to CPU visible VRAM when required
This is required to support discrete GPUs placed in systems with large
PCI bar or resizeble PCI bar not available or disabled.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23781>
2023-07-25 19:33:16 +00:00
José Roberto de Souza
f9fcd7168a intel/dev/xe: Add support for small-bar setups
This adds support for discrete GPUs placed in systems with large PCI
bar or resizeble PCI bar not available or disabled.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23781>
2023-07-25 19:33:15 +00:00
José Roberto de Souza
a8279d37ec intel: Sync xe_drm.h
Sync with commit aef50195664a ("drm/xe/uapi: add the userspace bits for small-bar")

Link: https://patchwork.freedesktop.org/series/115515/
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23781>
2023-07-25 19:33:15 +00:00
Emma Anholt
a3e3609590 ci/tu: Drop some xfails for !24086
Fixes: 99e58460ef ("tu: Fix zombie VMAs array not initialized when first BOs may be freed")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24322>
2023-07-25 18:53:16 +00:00
Emma Anholt
1d97838871 ci/tu: Mark descriptor_buffer.basic.limits as failing in gmem too.
Noticed in a full run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24322>
2023-07-25 18:53:16 +00:00
Emma Anholt
b05d640b95 ci/tu: Add more crash cases for the multithreading bugs caught on a630.
Weirdly, we don't see this group on a618.  Different CPU timings/core
counts just getting unlucky?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24322>
2023-07-25 18:53:16 +00:00
Alyssa Rosenzweig
6619317172 nir/lower_blend: Optimize out PIPE_LOGICOP_NOOP
Just drop the store. Written while debugging
dEQP-VK.pipeline.monolithic.logic_op.r8_uint.no_op.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24252>
2023-07-25 18:03:57 +00:00
Alyssa Rosenzweig
9c0740211d nir/lower_blend: Fix 32-bit logicops
nir_const_value_for_int asserts signed bounds on the input, but we pass in an
unsigned value that would be out-of-bounds for 32-bit channels, causing the
assert to fail for 32-bit channel formats.

Fixes dEQP-VK.pipeline.monolithic.logic_op.r32_uint.* on AGXV (and probably
PanVK).

Fixes: dbd0615e7a ("nir/lower_blend: Avoid useless iand with logic ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24252>
2023-07-25 18:03:57 +00:00
Alyssa Rosenzweig
b010b6f691 panfrost: Disable blending for no-op logic ops
Prevents regression from the series, since we don't support empty blend
shaders. This could be fixed more generically but I'm not inclined to compile
more blend shaders than needed so shrug.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24252>
2023-07-25 18:03:57 +00:00
Karol Herbst
2d902dbf02 rusticl: fix warnings with newer rustc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24315>
2023-07-25 17:12:40 +00:00
Faith Ekstrand
94f36cfaa3 intel/fs: Assume NIR is in SSA form
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24310>
2023-07-25 16:25:11 +00:00
Faith Ekstrand
965bbe5286 intel/fs: Rework the overlapping mov/vec case
Now that we're using load/store_reg intrinsics, the previous checks for
registers aren't what we want.  Instead, we need to be looking for a mov
or vec where both the destination and a source are load/store_reg with
matching decl_reg.

Fixes: b8209d69ff ("intel/fs: Add support for new-style registers")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24310>
2023-07-25 16:25:11 +00:00
Faith Ekstrand
45ee952efb intel/fs: Use write masks from store_reg intrinsics
Fixes: b8209d69ff ("intel/fs: Add support for new-style registers")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24310>
2023-07-25 16:25:10 +00:00
Faith Ekstrand
d89ca14e71 broadcom/compiler: Convert to new-style NIR registers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Faith Ekstrand
355afc92d1 nir/schedule: Support load/store_reg
These are tracked the same way as register reads and writes, allowing
them to be re-arranged as long as they respect dependencies within the
same reg.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Faith Ekstrand
6908814d46 vc4: Convert to new-style NIR registers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Iago Toral Quiroga
dff85b6163 nir/trivialize: Move decl_reg to the start of the block
This makes it so we never find a reg_decl in between a reg_store and the def
for its value, which helps avid inserting copy movs.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Alyssa Rosenzweig
0655bada4b nir/trivialize: Handle more RaW hazards
Consider the snippet of NIR:

   div 32    %447 = @load_reg (%442) (base=0, legacy_fabs=0, legacy_fneg=0)
   div 32    %463 = @load_reg (%442) (base=0, legacy_fabs=0, legacy_fneg=0)
   con 32    %409 = iadd %17 (0x3), %447
                    @store_output (%182 (0x601), %463) (base=0, wrmask=x, component=0, src_type=invalid...
                    @store_reg (%409, %442) (base=0, wrmask=x, legacy_fsat=0)

The load_reg's are trivial, so the %442 read will get folded into store_output.
But under the old definition, the store_reg is also trivial so it gets folded
into the iadd... causing a read-after-write hazard and invalid code generation.

The fix is to amend our definition of store_reg triviality to account for loads
getting folded in. It's not good enough that there's no intervening load_reg,
there can also be no intervening source that gets chased to a load_reg. Handle
that case as well.

Identified in dEQP-VK.geometry.input.basic_primitive.triangles_adjacency on
V3DV.

Fixes: d313eba94e ("nir: Add pass for trivializing register access")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Faith Ekstrand
f8b69abbd4 nir/trivialize: Trivialize cross-block loads
In order for a register load to be trivial, it cannot be used in any
block other than the one in which it is loaded.  We're not currently
explicitly doing anything to ensure this invariant holds.  It may be
that it holds regardless but I couldn't find any documented reason why
it should so let's explicitly handle that case.  Worst case, the newly
added code does nothing.

Fixes: d313eba94e ("nir: Add pass for trivializing register access")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Faith Ekstrand
f1f05cc7cf nir/trivialize: Maintain divergence information
Because this pass is intended to be run after out-of-SSA and directly
before injesting the NIR into the back-end, it may come after divergence
analysis and needs to preserve the divergence information. Fortunately,
since all we ever do is insert nir_op_mov, this is easy.

Fixes: d313eba94e ("nir: Add pass for trivializing register access")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Faith Ekstrand
4fd257d20f nir: Properly handle divergence for load_reg
This commit makes three changes:

 1. Default all newly created registers divergent because this is the
    safer default.

 2. Make divergence analysis do something sane with register divergence.
    It's not perfect because divergence analysis isn't able to prove
    registers divergent based on stores but at least if someone uses
    registers a bit they'll end up with safe defaults.  This matches
    what they'd get with nir_ssa_def_init().

 3. Make the load_reg() helper automatically propagate divergence from
    the register.  Because the defaults for both nir_ssa_def_init() and
    nir_decl_reg() are to mark everything divergent, this only means
    that nir_load_reg() of a uniform reg is now uniform.

Putting all these together, nir_from_ssa should now be producing
load_reg intrinsics with the proper uniform information.

Fixes: 7229bffcb1 ("nir: Add intrinsics for register access")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Alyssa Rosenzweig
91c3ee2412 pan/bi: Remove leftover include
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24153>
2023-07-25 15:36:52 +00:00
Marcin Ślusarz
4f1125e4ae intel/compiler/test: fix crashes when TEST_DEBUG is set
Dumping instructions requires that ISA info is not empty.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24274>
2023-07-25 15:13:29 +00:00
Yonggang Luo
23a2b83639 lavapipe: fixes indent of function lvp_inline_uniforms
The indent fixes are in separate patch is for easier to review

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24316>
2023-07-25 12:09:07 +00:00
Yonggang Luo
b4ed366d6b lavapipe: Convert to use nir_foreach_function_impl
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24316>
2023-07-25 12:09:07 +00:00
Yonggang Luo
d557169e81 zink: Convert to use nir_foreach_function_impl when possible
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24316>
2023-07-25 12:09:07 +00:00
Yonggang Luo
c7672f4fa5 freedreno: Switch to use nir_foreach_function_impl in tu_shader.cc
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24316>
2023-07-25 12:09:07 +00:00
Yonggang Luo
d45f846946 lima: Convert to use nir_foreach_function_impl when possible
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24316>
2023-07-25 12:09:06 +00:00
Antonio Gomes
29f4e7b215 rusticl/core: Make convert_spirv_to_nir output pair (KernelInfo, NirShader)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
2448bdc81b rusticl/core: Delete KernelDevState and KernelDevStateInner
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
58979e9247 rusticl/program: New helper functions to NirKernelBuild
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
323dcbb4b5 rusticl: Move NirKernelBuild to ProgramDevBuild
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
7ec9b9cd07 rusticl/compiler: Remove unnecessary functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
218dce5e38 rusticl: Move Cso to Program
Commit got huge, but couldn't figure out a better way to split without
breaking stuff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
11729e8311 rusticl/compiler: Add NirPrintfInfo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
e3169f624d rusticl/kernel: Add CsoWrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
Antonio Gomes
07c8bce24d rusticl/kernel: Removing unnecessary clone in kernel launch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23898>
2023-07-25 10:30:11 +00:00
David Heidelberg
f49bfb1108 ci/freedreno: add a530 flake vs-lessthanequal-uvec4-uvec4
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24314>
2023-07-25 09:26:12 +00:00
Illia Polishchuk
c1a02c0138 state_tracker: fix dereference before null check
Coverity error
CID 1528178 (#1 of 1): Dereference before null check (REVERSE_INULL)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
2023-07-25 08:55:56 +00:00
Illia Polishchuk
34e47b40e6 glx: fix dead code when gc var cannot be null due to earlier check
CID 1528170 (#1 of 1): Logically dead code (DEADCODE)
At condition gc, the value of gc cannot be NULL.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
2023-07-25 08:55:56 +00:00
Illia Polishchuk
c2724b4d37 s/Intel: fix/anv: fix: potentially overflowing expression in genX
CID 1528164 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression
pool->n_passes * pool->khr_perf_preamble_stride with type
unsigned int (32 bits, unsigned) is evaluated using 32-bit arithmetic,
and then used in a context that expects an expression of type uint64_t (64 bits, unsigned).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
2023-07-25 08:55:56 +00:00
Illia Polishchuk
1cbf10ca88 iris: remove NULL check for already dereferenced pointer earlier
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>

Found by Coverity.

CID: 1528158
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
2023-07-25 08:55:56 +00:00
Illia Abernikhin
33546705b5 i915: change format in dbg string
Actually, uintptr_t is of type unsigned long, but the
debug line uses the %d format specifier, which expects an int.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>

Found by Coverity.

CID: 1515961
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
2023-07-25 08:55:56 +00:00
Illia Abernikhin
c22961571a state_tracker: moving initialisation of whandle out from if statement
whandle initialization inside if statement but used also outside

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Found by Coverity.

CID: 1516746
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
2023-07-25 08:55:56 +00:00
Konstantin Seurer
ae18247e88 lavapipe: Advertise samplerYcbcrConversion
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
32403c696b lavapipe: Implement samplerYcbcrConversion
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
2667da5174 lavapipe: Fix binding immutable samplers with desc buffers
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
da95f64a6f lavapipe: Store immutable_samplers as lvp_sampler array
We will need this to access the ycbcr conversion.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
7dc6c4b581 lavapipe: Remove dummy sampler ycbcr conversion
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
dbbd84ce8b gallivm: Ignore nir_tex_src_plane
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
c7914a84e9 gallivm: Fix subsampled format sampling under Vulkan
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Konstantin Seurer
1280cf5b2a draw: Do not restart the primitive_id at 0
Otherwise the primitive_id will wrap around to 0 if more than 4096
patches are drawn.

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295>
2023-07-25 08:22:27 +00:00
Samuel Pitoiset
df98dca7ad radv: pass submit info to radv_check_gpu_hangs()
This will allow to dump preambles/postambles CS and eventually even
more CS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24191>
2023-07-25 06:50:33 +00:00
Samuel Pitoiset
9c95a74e5e radv/amdgpu: rename old_ib to ib in radv_amdgpu_winsys_cs_dump()
Forgot this variable when I renamed the ib_buffers array.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24191>
2023-07-25 06:50:33 +00:00
Samuel Pitoiset
7eb1105829 radv/amdgpu: fix dumping CS with the chained IBs path
ib_buffer is now NULL in both paths, and the first IB is the beginning
of the chain.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24191>
2023-07-25 06:50:33 +00:00
Samuel Pitoiset
7f173d1ff3 radv: use next_stage for determining the stage to lower NGG
If the next stage is FS, it's also the last VGT API stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Samuel Pitoiset
340f74e468 radv: simplify getting next VS stage for VS prologs
It's the VS shader info stage.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Samuel Pitoiset
ca520c49f5 radv: determine as_ls earlier by using the next stage
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Samuel Pitoiset
f68316d78b radv: determine ES info for VS/TES with GS earlier
By using the next stage, it's possible to compute these information
earlier without having to link shaders info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Samuel Pitoiset
4098e47ab6 radv: use the number of GS linked inputs to compute the ESGS itemsize
It's similar.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Samuel Pitoiset
7c2d38f4d1 radv: add a helper to compute the ESGS itemsize
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Samuel Pitoiset
54ab7b24a2 radv: remove the pipeline dependency for creating a GS copy shader
This is unnecessary. While we are at it, stop passing the array of
shaders and use the GS stage only.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24273>
2023-07-25 06:31:08 +00:00
Jianxun Zhang
75452f611e intel/common: Only set op mask on instructions in decoder
When a default value of a struct's field, which is in the
higher half of the first dword, is specified in a gen xml
file, setting op mask makes decoder treat the field as a
header (intel_field_is_header()). As a result, it won't
output the field in batch dump. This is not a common case
but can happen once a gen xml file includes such fields.

The op mask is only meaningful to instructions, so we fix
the above issue by not setting op mask of structs (also
registers).

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24268>
2023-07-24 22:56:59 +00:00
Nanley Chery
046bba0be0 iris: Handle clear color compatibility in prepare_render
Before this patch, iris_resource_render_aux_usage would disable
compression when the clear color did not support format
reinterpretation.

With this patch, iris now replaces the clear color with zero and keeps
compression enabled. Disabling fast clears would be enough for most aux
usages, but replacement is also done to handle ISL_AUX_USAGE_FCV_CCS_E.

Note that this also fixes a bug. Format reinterpretation with
incompatible clear colors previously was not handled for the MCS aux
usages.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23676>
2023-07-24 22:29:01 +00:00
Nanley Chery
1aa4e6bac0 iris: Create BLORP surfaces after resource preparation
iris_resource_prepare_render will soon gain the ability to change a
resource's clear color. iris_blorp_surf_for_resource will keep a copy of
that clear color, so make sure calls to it happen after the render
preparation helper. At the moment, this shouldn't have an impact besides
improving debugging.

While we're here, do the same for the generic access preparation helper.
We may convert those to more specific helpers at a later time.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23676>
2023-07-24 22:29:01 +00:00
Nanley Chery
215b50ace1 iris: Pass the render format to prepare_render
This will be used in an upcoming patch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23676>
2023-07-24 22:29:01 +00:00
Nanley Chery
c59ba8ac07 iris: Reorder render_aux_usage parameters
Match the order of the parameters for iris_resource_texture_aux_usage.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23676>
2023-07-24 22:29:01 +00:00
Nanley Chery
1d12b29b3f intel/blorp: Ambiguate after CCS resolves on gfx7-8
ISL's state-machine of CCS_D describes full resolves as leaving the aux
buffer in the pass-through state. Hardware doesn't behave this way on
gfx8 however. On that platform, full resolves transition the aux buffer
to the resolved state. This was verified by dumping the CCS before and
after a full resolve on BDW (gfx7 is simply assumed to behave the same).
Ambiguate after resolving to match driver expectations.

Prevents iris from failing piglit's fcc-write-after-clear on BDW with a
future patch which relies on fast-clear encodings being removed after a
resolve. The avoided failure is:

   Testing implicit read of partial block UNORM -> SNORM
   Probe color at (0,1,0)
     Expected:  1.000000 1.000000 1.000000 1.000000
     Observed:  0.000000 0.000000 0.000000 0.000000

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23676>
2023-07-24 22:29:01 +00:00
Lionel Landwerlin
8cbf730145 intel/fs: don't try to rebuild sequences of non ssa values
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 04777171e0 ("intel/fs: try to rematerialize surface computation code")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9378
Reviewed-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24228>
2023-07-24 20:04:24 +00:00
Caio Oliveira
2f3230a736 meson: Ensure that LLVMSPIRVLib is not required for Clover
Fixes: cb588d5d6e ("compiler/clc: Move related NIR passes to the common mesa clc")
Closes: #9391
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24244>
2023-07-24 18:21:11 +00:00
Emma Anholt
61ec26db26 ci/tgl: Improve the info for ANGLE's MSAA regression on TGL.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24200>
2023-07-24 16:07:28 +00:00
Emma Anholt
3ef07e6c44 ci: Uprev ANGLE to 0518a3ff4d4e ("Android: Simplify power metrics collection")
There have been some fixes for our drivers that we'd like to bring in.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24200>
2023-07-24 16:07:28 +00:00
Emma Anholt
48b725279e ci/radv: Clarify when the ANGLE GS failures started happening.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24200>
2023-07-24 16:07:28 +00:00
Faith Ekstrand
079e8a9674 anv,hasvk,iris: sampler_prog_key::swizzles is only used on crocus
The field is no longer consumed by brw_complie_* and is instead handled
directly by the crocus driver.  Therefore, it's safe to leave it zero
and not even bother setting it.  This removes our reliance on the
SWIZZLE_* macros in prog_instructions.h.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24288>
2023-07-24 15:40:40 +00:00
Christian Gmeiner
1e29b3cee8 etnaviv: nir: convert to new-style NIR registers
The initial plan was to use 'nir_legacy' helpers but it turns out
that our RA pass is hard to confince to be happy with it. So we are
useing the 'chasing' helpers now.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
935730a563 etnaviv: nir: switch to etna_nir_lower_to_source_mods(..)
nir's source modifiers are going away soon and with it also the lowering
pass. Lets switch to our own lowering pass. We need to run our own
lowering pass almost at the end else opc_cse(..) etc. might do some
wrong needed opts as nir does not see our modifiers.

Also we need to remove the last nir_opt_dce(..) as it will remove not dead
code caused by the used load_const hack.

32    %15 = load_const (0x00000000 = 0.000000)
32     %4 = fabs %15 (0.000000)

nir_opt_dce is correct when it removes the two instructions. But in reality
the load_const is a uniform that should not be removed.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
5ae3bd616c etnaviv: nir: add etna_nir_lower_to_source_mods(..)
This is more or less a copy of nir_lower_to_source_mods(..) with
the following differences:

 - we store the source mods in pass_flags
 - we do not try to saturate the destination

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
276f91dad0 etnaviv: nir: look at parent instr in lower_alu(..)
When we switch to our own lower_to_source_mods pass we will start
to see such patterns:

32x4  %18 = fneg %5 (-5.125000, -30.000000, 5.500000, -6.500000)
32x4  %19 = ffma %18, %8, %4 (-6.500000, -7.750000, 6.500000, 6.000000)

This is a problem as we will generate instruction that accesses two
different uniforms, which is a problem on GPUs where has_no_oneconst_limit
is false.

Make lower_alu(..) smarter by looking in the parent for for the constant
value.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
f3be07cb2d etnaviv: do not clear all pass_flags before RA
We only need to clear the 'dead' bits. The others are
used for source mods.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
8d89e78cf5 etnaviv: extend etna_pass_flags with source modifiers
As nir_lower_to_source_mods(..) will be deleted and with it the modifier storage
in nir's core we need to find an other way store the information.

We have have 6 bits left in nir's pass_flags - so lets go that route.

This also adds some small helpers that will be used later.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
5b7104b7a0 etnaviv: add is_dead_instruction(..) helper
As we are going to extend the enum etna_pass_flags it makes sense
to add a small helper to test if an instruction is dead. An instruction
is dead if BYPASS_DST or BYPASS_SRC is set.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
0c9c450f44 etnaviv: name the enum used for pass_flags
This enum is used for the pass_flags that can be set on a
nir_instr. Name it to make the intention of its usage clear.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
Christian Gmeiner
8305fb196c etnaviv: make use of BITFIELD_BIT(..) macro
It helps to make the code easier to read.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24216>
2023-07-24 15:22:56 +00:00
David Rosca
0a5fe1f524 frontends/va: Add YUV420 to NV12 postproc conversion
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7853
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24272>
2023-07-24 14:46:02 +00:00
David Rosca
c0545f2a4f gallium/auxiliary/vl: Fix blurry output of compute_shader_yuv
There is a linear sampler used, so add half texel offset
to avoid undesirable blur when input and output resolutions
are the same.

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24272>
2023-07-24 14:46:02 +00:00
David Rosca
fc2b32c5d3 gallium/auxiliary/vl: Handle UV subsampling in compute_shader_yuv
Also remove the 1px vertical shift as it results
in a black line at the bottom of the picture.

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24272>
2023-07-24 14:46:02 +00:00
Georg Lehmann
92900d8bf4 aco: improve get_gfx11_true16_mask description
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24294>
2023-07-24 14:12:19 +00:00
Georg Lehmann
8fbebb6a2a aco/gfx11: fix get_gfx11_true16_mask with v_cmp_class_f16
The second operand is 16bit, so the we need to use VOP3 to address v128-v255.

Closes: #9413
Fixes: 6872f8d861 ("aco/gfx11: allow true 16-bit instructions to access v128+")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24294>
2023-07-24 14:12:19 +00:00
Rhys Perry
a53d3ff0b3 nir/tests: add nir_opt_dead_cf_test.jump_before_constant_if
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24235>
2023-07-24 14:06:16 +01:00
Rhys Perry
21f0aca948 nir/opt_dead_cf: remove nodes after a jump earlier
In the case of:
   halt
   // succs: b9
   if %618 {
       block b3:// preds:
       break
       // succs: b6
   } else {
       block b4:  // preds: , succs: b5
   }
   block b5:    // preds: b4
   32    %556 = iadd %617, %2 (0x1)
opt_constant_if() doesn't work because stitch_blocks() can't join blocks if the
before ends in a jump and the after isn't empty.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24235>
2023-07-24 14:06:16 +01:00
Konstantin Seurer
1c8577b493 nir/tests: Use a single binary
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24249>
2023-07-24 11:44:46 +00:00
Konstantin Seurer
6eb0a3a5b7 nir/tests: Refactor boilerplate into a common header
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24249>
2023-07-24 11:44:46 +00:00
Danylo Piliaiev
eeb1fd90fc tu,freedreno: Forbid blit event for R8G8_SRGB due to gpu faults
Same cause as for other R8G8 formats - msaa resolve via
blit event causes gpu fault.

Fixes:
 dEQP-VK.api.image_clearing.*.clear_color_attachment.*.r8g8_srgb_*

Fixes: 029919f3c8
("tu: allow using resolve engine for SRGB MSAA resolves")

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24277>
2023-07-24 10:13:49 +00:00
Charles Giessen
f3d948eb6c panvk: Use 1.0 in ICD Manifest json
PanVK downgraded from supporting Vulkan 1.1 to 1.0, but did not change
their ICD Manifest api_version to reflect that. This cause the Vulkan-Loader
to interpret the ICD as a 1.1 driver erroneously. Originally discussed in this
issue https://github.com/KhronosGroup/Vulkan-Loader/issues/1242

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24289>
2023-07-24 08:24:13 +00:00
Marcin Ślusarz
48885c7fe3 intel/compiler: load debug mesh compaction options once
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20407>
2023-07-24 07:55:29 +00:00
Marcin Ślusarz
c1685f08dd intel/compiler,anv: put some vertex and primitive data in headers
Both per-primitive and per-vertex space is allocated in MUE in 8 dword
chunks and those 8-dword chunks (granularity of
3DSTATE_SBE_MESH.Per[Primitive|Vertex]URBEntryOutputReadLength)
are passed to fragment shaders as inputs (either non-interpolated
for per-primitive and flat vertex attributes or interpolated
for non-flat vertex attributes).

Some attributes have a special meaning and must be placed in separate
8/16-dword slot called Primitive Header or Vertex Header.

Primitive Header contains 4 such attributes (Cull Primitive,
ViewportIndex, RTAIndex, CPS), leaving 4 dwords (the rest of 8-dword
slot) potentially unused.

Vertex Header is similar - it starts with 3 unused dwords, 1 dword for
Point Size (but if we declare that shader doesn't produce Point Size
then we can reuse it), followed by 4 dwords for Position and optionally
8 dwords for clip distances.

This means we have an interesting optimization problem - we can put
some user attributes into holes in Primitive and Vertex Headers, which
may lead to smaller MUE size and potentially more mesh threads running
in parallel, but we have to be careful to use those holes only when
we need it, otherwise we could force HW to pass too much data to
fragment shader.

Example 1:
Let's assume that Primitive Header is enabled and user defined
12 dwords of per-primitive attributes.

Without packing we would consume 8 + ALIGN(12, 8) = 24 dwords of
MUE space and pass ALIGN(12, 8) = 16 dwords to fragment shader.

With packing, we'll consume 4 + 4 + ALIGN(12 - 4, 8) = 16 dwords of
MUE space and pass ALIGN(4, 8) + ALIGN(12 - 4, 8) = 16 dwords to
fragment shader.

16/16 is better than 24/16, so packing makes sense.

Example 2:
Now let's assume that Primitive Header is enabled and user defined
16 dwords of per-primitive attributes.

Without packing we would consume 8 + ALIGN(16, 8) = 24 dwords of
MUE space and pass ALIGN(16, 16) = 16 dwords to fragment shader.

With packing, we'll consume 4 + 4 + ALIGN(16 - 4, 8) = 24 dwords of
MUE space and pass ALIGN(4, 8) + ALIGN(16 - 4, 8) = 24 dwords to
fragment shader.

24/24 is worse than 24/16, so packing doesn't make sense.

This change doesn't affect vk_meshlet_cadscene in default configuration,
but it speeds it up by up to 25% with "-extraattributes N", where
N is some small value divisible by 2 (by default N == 1) and we
are bound by URB size.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20407>
2023-07-24 07:55:29 +00:00
Marcin Ślusarz
a252123363 intel/compiler/mesh: compactify MUE layout
Instead of using 4 dwords for each output slot, use only the amount
of memory actually needed by each variable.

There are some complications from this "obvious" idea:
- flat and non-flat variables can't be merged into the same vec4 slot,
  because flat inputs mask has vec4 stride
- multi-slot variables can have different layout:
   float[N] requires N 1-dword slots, but
   i64vec3 requires 1 fully occupied 4-dword slot followed by 2-dword slot
- some output variables occur both in single-channel/component split
  and combined variants
- crossing vec4 boundary requires generating more writes, so avoiding them
  if possible is beneficial

This patch fixes some issues with arrays in per-vertex and per-primitive data
(func.mesh.ext.outputs.*.indirect_array.q0 in crucible)
and by reduction in single MUE size it allows spawning more threads at
the same time.

Note: this patch doesn't improve vk_meshlet_cadscene performance because
default layout is already optimal enough.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20407>
2023-07-24 07:55:29 +00:00
Samuel Pitoiset
fb765a65c8 radv: add radv_compile_cs() to compile a compute shader
This doesn't rely on the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24280>
2023-07-24 07:04:44 +00:00
Samuel Pitoiset
8ccabbfc50 radv: stop using an array of binaries when compiling a compute shader
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24280>
2023-07-24 07:04:44 +00:00
Zhang Ning
06db9bd3f6 Revert "intel/ci: disable iris-jsl-deqp because it always fails for an AMD MR"
This reverts commit da4b5b4a47.

Signed-off-by: Zhang Ning <zhangn1985@outlook.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23815>
2023-07-24 03:02:14 +00:00
Timothy Arceri
2cf8c8cba4 nir/opt_copy_prop_vars: drop reuse of dynamic arrays
After the previous commit there are so few to reuse that this is no
longer worth doing and actually causes compilation to slow down.

The Blender shader compile time in issue #9326 improves as folows:
21.11 seconds -> 9.90 seconds

The CTS test dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20
improves as follows:

0.92 seconds -> 0.68 seconds

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

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24227>
2023-07-24 02:29:54 +00:00
Timothy Arceri
d56e739417 nir/opt_copy_prop_vars: skip cloning of copies arrays until needed
Most of the variables in the hash table will never actually be looked up
for any given block so cloning every possible value just creates a bunch
of unrequired memcpy calls.

Here we change the code to only clone the copies array once it is
actually looked up for the first time.

The Blender shader compile time in issue #9326 improves as folows:
151.09 seconds -> 21.11 seconds

The CTS test dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20
improves as follows:

1.67 seconds -> 0.92 seconds

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24227>
2023-07-24 02:29:54 +00:00
Timothy Arceri
869b5a562e nir/opt_copy_prop_vars: remove var hash entry on kill alias
If kill alias results in the hash table entry holding an empty
copies array then remove the hash entry and return the dynamic array
to the unused pool.

This helps avoid hash table size getting out of control in very large
shaders.

151.09 seconds -> 118.60 seconds

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24227>
2023-07-24 02:29:54 +00:00
Timothy Arceri
9b4c7cc611 nir/opt_copy_prop_vars: speedup cloning of copy tables
Here we change things to simply clone the entire hash table. This
is much faster than trying to rebuild it and is needed to avoid
slow compilation of very large shaders.

The Blender shader compile time in issue #9326 improves as folows:
251.29 seconds -> 151.09 seconds

The CTS test dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20
improves as follows:

2.38 seconds -> 1.67 seconds

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24227>
2023-07-24 02:29:54 +00:00
Timothy Arceri
e9804bdc4c nir/opt_copy_prop_vars: don't clone copies if branch empty
There is no point doing an expensive clone of the copies if the
if-branch is empty.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24227>
2023-07-24 02:29:54 +00:00
Qiang Yu
527cc3ad29 radeonsi: enable aco compile for mono merged ES/GS
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
b313d950e2 radeonsi: enable aco compile for mono merged LS/HS
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
1b53708a62 radeonsi: calculate lds size for merged shaders
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
339ea9e344 radeonsi: aco compile support merged mono shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
21ae5909a4 radeonsi: refine si_llvm_es_build_end
1. merge si_set_es_return_value_for_gs into si_llvm_es_build_end
2. stop return value when mono mode in which case GS use ES input as
   input instead of ES output

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
401a40a5f4 radeonsi: refine si_llvm_ls_build_end
1. merge si_set_ls_return_value_for_tcs into si_llvm_ls_build_end because they
   do the same job to return value
2. stop return value when mono mode with different thread count, in which case
   TCS use LS input as its input instead of LS output
3. use si_insert_input_ret_float

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
07fcb4aa19 radeonsi: remove param type check in wrapper function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
7ebf667360 radeonsi: move vertex shader vb desc input sgpr args to last
ACO use same args for merged shader stages, but vb desc input sgpr args
is not present when second stage of merged shader. In order to share
same shaders args, move it to last so other args have same index.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
a4b4f9a62a radeonsi: simplify si_build_wrapper_function
We only need it to merge LS/HS or ES/GS now, prolog and epilog have
been lowered in nir already. So we just need to handle two parts and
they are sure to be first and second stage of a merged shader.

This also remove the needs SGPRs must be before VGPRs, which is required
by following commits to move some SGPRs after VGPRs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
d9f7902afb radeonsi: init aco shader info for merged LS/HS
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
7daa0857c0 radeonsi: extract si_get_prev_stage_nir_shader to be shared with aco
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
ec17cc345f radeonsi: aco does not pass LS outputs to HS by arg
aco has global input/output variables for this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:21 +00:00
Qiang Yu
599b50b448 aco,radv: replace tess_input_vertices shader info param
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24204>
2023-07-24 01:49:20 +00:00
David Heidelberg
826c570ab3 ci/freedreno: cover all texture gather flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24300>
2023-07-24 01:37:01 +02:00
Konstantin Seurer
01266f8119 llvmpipe: Fix compiling with LP_USE_TEXTURE_CACHE
Fixes: 36eb75d ("llvmpipe: move to common sampler/image binding code")
Closes: #9359

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24243>
2023-07-23 19:11:40 +00:00
Bas Nieuwenhuizen
c2e3986326 nir: Fix 16-component nir_replicate.
Fixes: f534c2c539 ("nir/builder: Add nir_replicate helper")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24286>
2023-07-22 22:11:15 +00:00
Bas Nieuwenhuizen
e536d31a46 aco: Fix some constant patterns in 16-bit vec4 construction with s_pack.
Fixes: 04e3d7ad93 ("aco: improve nir_op_vec with constant operands")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24286>
2023-07-22 22:11:15 +00:00
Bas Nieuwenhuizen
2fcf7c7014 aco: fix nir_op_vec8/16 with 16-bit elements.
Fixes: 5718347c2b ("aco: implement vec2/3/4 with subdword operands")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24286>
2023-07-22 22:11:15 +00:00
Alyssa Rosenzweig
e890bb0e75 asahi: Don't depend on glibc to decode
fopencookie is a glibc feature, so we can't use it on macOS (and
probably other libc's?). It's only used for the hypervisor interface,
though, so we can just make the hypervisor piece glibc-only while
otherwise fixing the wrap.dylib build.

Fixes: ee83453f69 ("asahi: Add a shared library interface for decode")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24293>
2023-07-22 12:42:58 -04:00
Eric Engestrom
f997d32f9f asahi: drop unused include paths
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24287>
2023-07-22 10:10:03 +00:00
Christian Gmeiner
2572a96162 ci/etnaviv: update ci expectations
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24291>
2023-07-22 04:16:32 +00:00
Chia-I Wu
5cca1124d1 amd/ci: update radv-stoney-aco-fails.txt for depth/stencil resolve
image_2d_16_64_6 ones have been fixed by the previous commit.  The
others are outdated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23959>
2023-07-22 02:32:31 +00:00
Chia-I Wu
e7c4ebc0cd radv: disable tc-compat htile for layered images on gfx8
sliceInterleaved may be true for layered images on gfx8.  Such a htile
cannot be cleared with radv_clear_htile.

Fixes 24 failures in
dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_16_64_6.* on GFX8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23959>
2023-07-22 02:32:31 +00:00
Thomas H.P. Andersen
d84d5ff0ce tgsi: drop two unused functions
Removes:
* tgsi_util_get_src_from_ind
* tgsi_full_src_register_from_dst

The last usage of these got removed in !24175

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24283>
2023-07-22 02:04:57 +00:00
Yiwei Zhang
2ed4f04869 venus: use in_render_pass to skip present_src counting
It's an early return also benefiting dynamic rendering. We then no
longer need to track the legacy pass from inheritance info.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
e47da97be6 venus: refactor more cmd states into cmd builder
This change:
- adds helpers for cmd begin/end rendering
- simplifies cmd reset
- updates ordering to align with cmd builder

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
10c791619c venus: avoid redundant tracking of render pass
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
540242f9ff venus: add helpers to track subpass view mask
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
311a0eeb21 venus: cleanup vn_cmd_begin_render_pass usage
For secondary command buffers, vn_cmd_begin_render_pass was only used to
track inherited render pass previously. So we clean it up.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
81b69f8e8b venus: use tracked queue_family_index from the cmd pool
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
72728f83ed venus: remove redundant fb tracking from cmd builder
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
f0b5a6335d venus: move transient storage from cmd to pool
The storage is for command scope usage, so it fits better for the pool.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
566df7821b venus: log and doc the broken query feedback in suspended render pass
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:43 +00:00
Yiwei Zhang
d13bf8f6b1 venus: fix cmd state leak across implicit reset
Reset cmd states during vkBeginCommandBuffer regardless of the
VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT for simplicity.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:42 +00:00
Yiwei Zhang
a9f058d614 venus: fix a cmd builder render_pass state leak across reset
Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24103>
2023-07-22 01:49:42 +00:00
Dave Airlie
2b03938f27 gallivm: fix atomic global temporary storage.
Fixes regression on llvm15 with
piglit tests/cl/program/execute/builtin/atomic/atomic_xchg-global.cl

Fixes: f281290005 ("gallivm: Fix atomic_global types")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Tested-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24267>
2023-07-21 20:48:16 +00:00
Charmaine Lee
9c17d9df43 svga: set clear_texture to NULL for vgpu9
With PIPE_CAP_CLEAR_TEXTURE removed, we need to set clear_texture to NULL
on svga vgpu9 device so it can use the fallback path.

Fixes: a1eabeff66 ("gallium: remove PIPE_CAP_CLEAR_TEXTURE")

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24264>
2023-07-21 17:36:31 +00:00
Yiwei Zhang
fd9a0ecc86 ci/venus: update venus-lavapipe expectations
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24263>
2023-07-21 17:11:26 +00:00
Yiwei Zhang
8cb7bab341 lvp: avoid reading immutable sampler from desc write info
Lavapipe has switched to layer push descriptor support atop descriptor
updates internally since 12a7fc51c7, so
it must skip retrieving immutable samplers from the write info even if
the update call itself is blessed by the spec to not hit that case.

Fixes: 12a7fc51c7 ("lavapipe: Rework descriptor handling")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24263>
2023-07-21 17:11:26 +00:00
Lionel Landwerlin
1f3e320d15 vulkan: bump header register to 1.3.258
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24279>
2023-07-21 16:36:26 +00:00
Connor Abbott
c75bf084d0 tu, freedreno/a6xx: Remove has_ccu_flush_bug
Based on the previous commit, this isn't actually a bug and is expected
behavior. Turnip should already be handling it correctly for user
flushes, we just have to make sure to handle it for flushes we insert
ourselves in turnip and freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24162>
2023-07-21 16:02:50 +00:00
Connor Abbott
847834461e tu: Fix and simplify execution dependency handling
When I wrote this code, I was under the impression that at most one
context from each cluster could be executing at a time. This would mean
that we could treat clusters as pipeline stages and only insert a WFI if
there was a bubble where an earlier stage depends on the result of a
later stage.

This mental model was wrong, though. Experiments on a6xx show it's
possible for two contexts to be executing simultaneously, even though
there are only two contexts - register writing is just stalled until the
earliest-launched context finishes.

This means that the mental model is now much simpler. Any draw can, in
theory, execute in parallel with any previous draw, blit, flush, etc,
although it seems that flushes do wait for any earlier work to finish.
Clusters are mostly just an implementation detail that only matter in
some corner cases, like setting a non-context register (written in the
last cluster) that is used by an earlier cluster that can race ahead of
the write.

An example where this makes a difference is a fragment shader that
writes an image via stib followed by a blit from that same image.
Because both operations happen in the same cluster and use the same
cache, we wouldn't emit anything in the barrier, however actually we
still need to WFI.

This was getting worse on a7xx because later clusters now have 4
contexts, making it easier for draws to be executed in parallel. However
AFAICT it was already a problem on a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24162>
2023-07-21 16:02:50 +00:00
Connor Abbott
ed02094235 tu: Fix vk2tu_*_stage flag type
New flags were silently getting dropped.

Fixes: 59259a0167 ("tu: Convert to sync2 entrypoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24162>
2023-07-21 16:02:50 +00:00
Eric Engestrom
e1abf85bf5 docs: update calendar for 23.1.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24281>
2023-07-21 15:53:50 +00:00
Eric Engestrom
0720b0a613 docs: add sha256sum for 23.1.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24281>
2023-07-21 15:53:50 +00:00
Eric Engestrom
f6de634e6b docs: add release notes for 23.1.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24281>
2023-07-21 15:53:50 +00:00
David Rosca
0bd9ab232b gallium/auxiliary/vl: Fix RGB->YCbCr full range matrix
Also rename it to bt_709_rev_full as there already
is bt_709 which is used for YCbCr->RGB.

Fixes: 8a21efce3a ("frontends/va: Add postproc support for converting to full range")

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24238>
2023-07-21 15:16:26 +00:00
Sathishkumar S
0195e1204b radeonsi/vcn: num bs_bufs must be proportional to num jpeg engines
using limited number of bs buffers constraints the simultaneous
use of all available jpeg engines especially when count is lesser than
that of the available engines. make sure the number of buffers
available are more than or equal to the number of jpeg engines on the asic.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24240>
2023-07-21 14:42:09 +00:00
Sathishkumar S
47a9d01641 radeonsi/vcn: support variable number of bs_bufs
add support to use variable number of bitstream buffers for decode

v2: remove the always true if condition (CI report)

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24240>
2023-07-21 14:42:09 +00:00
Samuel Pitoiset
53d35c641d radv: bind the pre-compiled PS epilog to the cmdbuf state
For PS epilogs we have two paths, the first one is to pre-compile PS
epilogs at pipeline creation time, while the second one is to compile
PS epilogs on-demand when some dynamic states are used.

Binding the pre-compiled PS epilog to the cmdbuf state allows us to
remove one more pipeline dependency when recording cmdbufs (for shader
objects).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24254>
2023-07-21 12:55:30 +00:00
Samuel Pitoiset
55f05309ca radv: pass a shaders array for computing ia_multi_vgt_param
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24251>
2023-07-21 12:19:28 +00:00
Samuel Pitoiset
b0f53c3a48 radv: remove unused param in radv_pipeline_emit_vgt_gs_out()
Also rename the function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24251>
2023-07-21 12:19:28 +00:00
Samuel Pitoiset
3348cd3a80 radv: stop using a pipeline for emitting VGT_VERTEX_REUSE_BLOCK_CNTL
Passing a TES is enough.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24251>
2023-07-21 12:19:28 +00:00
Alyssa Rosenzweig
03b2c34793 nir: Remove register arrays
Nothing produces them any more, so remove them from NIR. This massively reduces
the size of nir_src, which should improve performance all over.

nir_src size reduced from 56 bytes -> 40 bytes (pahole results on arm64, x86_64
should be similar.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24253>
2023-07-21 11:25:49 +00:00
Alyssa Rosenzweig
1466014184 nir: Rename lower_locals_to_reg_intrinsics back
The short name is freed up.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24253>
2023-07-21 11:25:49 +00:00
Alyssa Rosenzweig
d2c94f9e71 nir: Remove nir_lower_locals_to_regs
No more users, all switched to the intrinsic version.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24253>
2023-07-21 11:25:49 +00:00
Alyssa Rosenzweig
a8c0b6695f panfrost: Remove unused helpers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24253>
2023-07-21 11:25:48 +00:00
Alyssa Rosenzweig
a08286f993 intel/fs: Don't read reg.base_offset
It's not set in the new intrinsics path.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24253>
2023-07-21 11:25:48 +00:00
Rohan Garg
01965a2fe9 anv: drop CFE state validation checks
anv no longer needs to track if the CFE state is valid since we ensure
that the state is valid at pipeline creation time.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23934>
2023-07-21 10:46:08 +00:00
Rohan Garg
e7e7042093 anv,iris: program the maximum number of threads on compute queue init
Fixes: 90a39cac87 ("intel/blorp: Emit compute program based on BLORP_BATCH_USE_COMPUTE")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23934>
2023-07-21 10:46:08 +00:00
Christian Gmeiner
5a95280748 etnaviv: nir: lower nir_texop_txs
Non of the GPU models know at this time have hardware support to
retrieve the dimensions of a level of a texture. Do almost the
same as the binary blob and store the needed values as uniforms.

Passes dEQP-GLES3.functional.shaders.texture_functions.texturesize.*

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24217>
2023-07-21 08:52:03 +00:00
Christian Gmeiner
88f399b651 etnaviv: nir: support intrinsic used for txs lowering
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24217>
2023-07-21 08:52:03 +00:00
Christian Gmeiner
fb48d3d1da nir: add enta specific intrinsic used for txs lowering
Non of the know etnaviv GPUs support this feature in hardware
and the binary blob provides sizes via uniforms too.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24217>
2023-07-21 08:52:03 +00:00
Christian Gmeiner
65ffa5b0b8 etnaviv: move nir texture lowerings into one pass
This is just a prep commit to keep all texture related
lowerings in one c file.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24217>
2023-07-21 08:52:03 +00:00
Marcin Ślusarz
06046a02f8 anv: merge cases leading to the same code
Added in: 688968e888 ("anv: add support for direct descriptor in allocation/writes")

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24260>
2023-07-21 07:22:22 +00:00
Marcin Ślusarz
0eb2679cdb anv: drop unused function
Added in: 02cecffe2b ("anv: add a pass to partially lower resource_intel")

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24260>
2023-07-21 07:22:22 +00:00
Marcin Ślusarz
3c83ac8002 intel/compiler: remove redundant code
has_lsc is checked few lines above, so this code doesn't matter.

Added in: a358b97c58 ("intel/fs: optimize uniform SSBO & shared loads")

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24260>
2023-07-21 07:22:22 +00:00
Hyunjun Ko
e3ecba3266 anv: use ycbcr_info for P010 format
Since !24096 landed, we can just use ycbcr_info to get information
of an image of the P010 format.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24265>
2023-07-21 06:15:30 +00:00
M Henning
340df42977 nouveau: Delete the nouveau_compiler tool
It's TGSI only.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:36 +00:00
M Henning
b5a638454d nouveau: Drop BuildUtil::Location
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:36 +00:00
M Henning
73239d4029 nouveau: Drop BuildUtil::DataArray
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:35 +00:00
M Henning
51dfde7b96 nouveau: Drop ConverterCommon::Subroutine
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:35 +00:00
M Henning
c631635f43 nouveau: Drop tgsi support from nv50_ir_prog_info
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:35 +00:00
M Henning
38a96f79af nouveau: Delete nv50_ir_from_tgsi.cpp
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:35 +00:00
M Henning
9178b049cc nv50: Keep nir directly in nv50_program
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:35 +00:00
M Henning
d00d967399 nvc0: Keep nir directly in nvc0_program
instead of under pipe_shader_state.

This makes it obvious that we never produce tgsi shaders since
c3cbe610 "nouveau: Delete the NV50_PROG_USE_TGSI env var."

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
2023-07-21 02:40:35 +00:00
Mike Blumenkrantz
88bf4b61af zink: emit SpvCapabilitySampleMaskPostDepthCoverage with SpvExecutionModePostDepthCoverage
can't have one without the other

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24183>
2023-07-21 01:28:56 +00:00
Mike Blumenkrantz
d744bb5bfc zink: be even dumber about buffer refs when replacing storage
these extra checks can cause issues when multiple contexts and transfer
ops are involved

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24141>
2023-07-21 01:01:04 +00:00
Karol Herbst
23795dc318 nvc0: fix num_gprs for Volta+
Overallocating by 2 gprs for ugprs is a wild guess by me. It does make
sense though as each subgroup shares 64 ugprs and that's 2 per thread.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24261>
2023-07-20 23:19:58 +00:00
Karol Herbst
fa8634388b llvmpipe: enable system SVM
The API bits are already implemented in clover and rusticl and by
definition a CPU driver implements SVM.

This should allow anybody to work on proper SyCL/CHIP-SPV support for
rusticl running llvmpipe.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24092>
2023-07-20 23:00:24 +00:00
Karol Herbst
44e652af9a rusticl/mesa: make svm_migrate optional
It's just a hint and drivers might want to ignore implementing it for now.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24092>
2023-07-20 23:00:24 +00:00
Nanley Chery
99ffa4043e intel/isl: Add a score for DG2_RC_CCS
This enables the DG2 render compression modifier in anv. When I tested
this against vkcube, I observed that the full resolve which happened at
the end of every frame was converted to a partial resolve, allowing the
framebuffer to retain compression.

According to Caleb Callaway's testing, enabling this modifier positively
impacts the FPS of the following game benchmarks:

 - Strange Brigade.vk-g6              +12.78%
 - Strange Brigade.dx12vk-g6          + 9.33%
 - Shadow of the Tomb Raider.vk-g6-lx + 2.37%
 - Dota 2 (replay Jul 2020).vk-g6     + 2.28%

Thanks to Felix Degrood for pointing out that Strange Brigade would
benefit from this optimization.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:27 +00:00
Nanley Chery
15dec30877 intel/isl: Move the Tile4 modifier score case down
Group modifiers by platform first, then the score. I find it easier to
read this way.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:27 +00:00
Nanley Chery
d9bdffa708 intel: Describe modifier compression with booleans
Replace the aux_usage field with two booleans: one for render
compression and one for media compression.

This more accurately describes how CCS_E is used on gfx12. On those
platforms, the FCV feature may be enabled or disabled, but ISL's
modifier table has been using the FCV aux-usage for every gfx12 render
compression modifier. Instead, set the newly-added render compression
boolean to true.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:27 +00:00
Nanley Chery
37068e8aaf iris: Swap stencil and modifier aux assignment order
Makes the next patch clearer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
f5f61c5bb7 hasvk: Delete modifier with aux code
Modifiers with compression are not supported.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
2d7fc325d6 crocus: Delete modifier with aux code
Modifiers with compression are not supported.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
5568970d63 iris: Reduce accesses of mod_info->aux_usage
This field will be replaced in an upcoming patch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
569f80f2df anv: Reduce accesses of isl_mod_info->aux_usage
This field will be replaced in an upcoming patch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
f2dab434d8 anv: Handle explicit surface layout of DG2_RC_CCS
We're going to enable the DG2 modifier. Account for the reduced plane
count that exists with it.

Also add an assert to make it clearer that the aux in use is CCS.
Otherwise, it may not be obvious because of the generic compression
names being used here.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
47565d31e1 intel: Add and use isl_drm_modifier_get_plane_count
We're going to enable the DG2_RC_CCS modifier in anv. Add and use this
function to prepare for the new plane count that comes with that
modifier.

iris is left alone for now because it supports more modifiers than
isl_drm_modifier_get_score is aware of.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
e50af52e3d anv: Don't support ASTC images with modifiers
Before this change, anv_get_image_format_features2 reported support for
ASTC formats with any modifier (even those not supported by anv). But,
we didn't intend to support that compressed image format with modifiers.

With this change, the format feature function reports no support for
modifiers on ASTC-formatted images.

This prevents the next patch from causing assertion failures due to
unsupported modifiers.

Fixes: 355f318843 ("anv: Allow transfer-only linear ASTC images")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Nanley Chery
c042eb653d iris: Remap DRM_FORMAT_MOD_INVALID more often during import
We'd eventually like to use an ISL helper that doesn't support
DRM_FORMAT_MOD_INVALID. Prepare for this by replacing the invalid value
with the modifier associated with the BO's tiling in more cases.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24120>
2023-07-20 20:53:26 +00:00
Rohan Garg
ba071ee81c anv: use the correct GFX_VERx10 macro for WA
Fixes: 60b0d2c2cb ("add required invalidate/flush for Wa_14014427904")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23937>
2023-07-20 20:25:12 +00:00
Rohan Garg
097f3b4a98 anv: use the WA infrastructure where possible when generating state
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23937>
2023-07-20 20:25:12 +00:00
Marek Olšák
54f18b5000 radeonsi: fix a CDNA regression breaking compute
reported internally

Fixes: 315231b5a5 - radeonsi: eliminate redundant compute SH register changes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24169>
2023-07-20 18:42:56 +00:00
Christian Gmeiner
019e5cbd39 nir/print: print instr pass_flags
From time to time it can be helpful to "see" the pass_flags.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24234>
2023-07-20 18:03:47 +00:00
Yiwei Zhang
a89752d630 turnip: flush cache for dstBuffer in vkCmdCopyQueryPoolResults
There can be other writes to the dstBuffer gated by proper barriers
beforehand.

TEST=dEQP-VK.pipeline.*.timestamp.* with Venus on Turnip

Fixes: 487aa807bd ("tu: Rewrite flushing to use barriers")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24245>
2023-07-20 16:28:17 +00:00
Alyssa Rosenzweig
950a0b6a63 ir2: Switch to nir_legacy
Addresses a2xx portion of #9051.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24118>
2023-07-20 15:50:54 +00:00
Alyssa Rosenzweig
ad214fcaf7 asahi: Advertise Z16_UNORM
This works (on the downstream kernel, anyway).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:29 +00:00
Alyssa Rosenzweig
0197d46b34 asahi: Execute preambles for background programs
This will be useful when spilling render targets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:29 +00:00
Alyssa Rosenzweig
9fbe2fdea0 asahi: Offset clear colour uniform by 4
Frees up u0_u1 for a bindless base address which will make render target
spilling easier to implement.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:29 +00:00
Alyssa Rosenzweig
0597c100cc asahi: Ignore spilled render targets for background load
Nothing to reload.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:29 +00:00
Alyssa Rosenzweig
ef5a5e170f asahi: Permit meta shaders to use preambles
Preambles are occassionally useful with background programs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:29 +00:00
Alyssa Rosenzweig
5f167c9f72 asahi: Lower multisample image stores
These will be used for spilling multisampled render targets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
ff16397912 asahi: Lower tilebuffer access for spilled RTs
Conceptually similar, we just don't have the tilebuffer available this time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
66e8afe7c9 asahi: Extract some tilebuffer lowering code
In prep for spilling. No functional change.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
46b5406483 asahi: Ignore spilled render targets with partial renders
Partial renders exist to the spill the tilebuffer to memory, there's nothing to
do if it's already spilled (and would just waste memory bandwidth and create a
feedback loop).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
dc38f24de3 asahi: Ignore spilled render targets in EOT shaders
Regardless whether we implement Apple-style eMRT or something simpler, the EOT
shader isn't involved here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
73fb1543fd asahi: Do not support masking with spilled RTs
Extra complexity for this interaction, not worth it until we have an actual use
case IMHO.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
fa0e671b7b asahi: Add agx_tilebuffer_spills query
We can skip various work in the driver if we're not spilling render targets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
6bc42054d1 asahi: Introduce concept of spilled render targets
To accommodate framebuffers which exceed tilebuffer limits, we'll need to spill
render targets to main memory. In effect, we need to emulate an immediate-mode
renderer for some render targets. This decision is made on a per-render target
basis. In our tilebuffer layout calculation, rather than asserting that all
render targets fit, introduce a notion of spilling.

This doesn't actually implement spilling -- it just pushes the assert failure
down to the users. But it's progress.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
17e10499b9 asahi: Extract sampler_view_for_surface
We'll reuse this logic for the spilled RT case.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
10fc9e3d59 agx: Plumb in coverage mask
This is internally used by the hardware when writing to the tilebuffer. We need
to use it externally to spill multisample render targets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
56bb3dcc21 agx: Require tag writes with side effects
Otherwise the fragment shader might be skipped entirely. (Possibly this is the
wrong approach to this though...)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
46bb0037ce agx: Add simple image fencing pass
Minimum needed to pass CTS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
7ed2596fe7 agx: Implement fence_*_to_tex_agx intrinsics
We need these fencing intrinsics because our image caches aren't coherent with
memory. Furthermore, we need some sync intrinsics for imageblocks (which are
spicy images). These are a stub of what the final fragment shader interlock
implementation will look like, or what a real Metal-grade imageblock
implementation needs, but this is good enough for handling the sync requirements
with spilled render targets.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
c1afe26be6 agx: Don't emit silly barriers
Trust in the scoped_barrier.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
b618ba9330 agx: Emit global memory barriers for images
This is part of image atomics, since those go through the regular memory path.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
93f26abe49 agx: Implement image_load
Texture loads can be reordered freely but image loads can't be (since there
could be writes). Implement image_load natively to avoid subtle problems with
CSE and scheduling.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
e5f37ac5cb agx: Extract texture write mask handling
image_load will share the logic.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
34c759467c agx: Add image_load opcode
This is equivalent to texture_load but cannot be reordered, since it might be
writeable.

It also sets bit 43. This needs more investigation, but it fixes
KHR-GLES31.core.shader_image_load_store.basic-glsl-misc-fs. Some sort of cache
control bit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
02b1ddeca6 asahi,agx: Fix txf sampler
Bizarrely, the clamps/wrap modes are respected so we need to set them
appropriately for correct out-of-bounds behaviour (returning all zero). That in
turn means we can't use whatever sampler is already there, instead we need to
allocate a dedicated sampler just for txf. Good news is we have an extra sampler
state register available for the purpose.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
1106e2499e agx: Lower buffer images
Similar to buffer reads, we need to implement buffer images as 2D images with
fixed width and some lowering code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
15915f021a agx: Lower image atomics
Lower image atomics to texel address loads, and lower texel address loads to
arithmetic and descriptor reads. This implements image atomics.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
c09089025d agx: Extract texture_descriptor_ptr_for_* helpers
For implementing image_texel_address, when there's no point in creating an
internal texture instruction just to lower immediately.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
a43141f3b5 agx: Extract coords_for_buffer_texture helper
The mapping of 1D -> 2D coordinates for indexing into buffer textures (lowered
to fixed-width 2D images) will be shared between both texture load and image
store code paths, so pull it out.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
e2cfd2a228 agx: Add interleave opcode
We'll use it for texture atomics.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
a6ed776a13 agx: Handle early_fragment_tests
Simply doing nothing fixes
dEQP-GLES31.functional.image_load_store.early_fragment_tests.*. However, we need
to actually insert the sample_mask instruction to make sure the shader runs at
all (I think), doing that fixes:

   KHR-GLES31.core.shader_image_load_store.basic-glsl-earlyFragTests

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
76641762ce agx: Implement image barriers
Or cache flushes or whatever these actually are. Probably could be optimized
once we understand what the 4 individual instructions are actually doing. Fixes
dEQP-GLES31.functional.image_load_store.2d.qualifiers.*.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
ad456a683c agx: Wait for outstanding stores before barriers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
5b3635a197 agx: Handle frag side effects without render targets
We still need to insert our lowering code, though this case could probably be
optimized somehow. Fixes a massive number of KHR-GLES3 and KHR-GLES31 tests,
including
KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-draw-calls2 and lots
of PBO tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
4ef89e71ba agx: Translate image_store from NIR
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
13bb1209e2 agx: Translate texture bindless handles
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
bb21160a19 agx: Pack bindless textures
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
34a9582091 agx: Handle bindless properly for txs lowering
When I wrote this pass I mostly guessed what our bindless handles would look
like. Now that we know we can do it right.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
f4aa6fd22e agx: Model texture bindless base
Extra source we need to implement bindless.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
4505cb962c agx: Add image write instruction
Model and pack what's in the hardware for this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
2978f4eef2 agx: Generalize texture/PBE packing
For the generic image write instruction we'll want the full forms of these
fields.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
8398a2469a agx: Lower image size to txs
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
c6e3324980 agx: Legalize image LODs to be 16-bit
Required by the hardware. Do it in NIR so we can optimize the conversion.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
dfea028aa2 asahi: Use nir_lower_robust_access
This makes images robust as required by the OpenGL ES spec.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
2ebdd5fd12 asahi: Extend PBE packing for image support
We need to support arrayed images and sRGB images, which are hardware. For
atomics, we need to pack the augmented software data structure. Finally, we need
to support buffer images. Like their texture counterparts, these get lowered to
2D images.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
a77facd459 asahi: Augment PBE descriptor for software access
For implementing image atomics (and multisample image writes), we need
information about the image layout in the shader. It's a lot nicer to determine
the image layouts on the CPU (where we have ail) and stash the results in the
PBE descriptor, where we have a convenient hole to do so, rather than trying to
do all the layout calculations on the GPU on the fly. Add a data structure that
the driver will fill out and the image atomic lowering will consider as part of
the hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Asahi Lina
ee83453f69 asahi: Add a shared library interface for decode
Add a simple API so that decode can be used as a shared library by the
Python hypervisor. Note that this is not thread-safe. If we ever want to
use this in other contexts with thread safety, it will need a refactor
(along with the core decode code anyway).

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/24258>
2023-07-20 15:33:28 +00:00
Asahi Lina
55d363e02e asahi: decode: Add a function to construct decode_params from a chip_id
Should be useful on macOS later to properly support detecting the right
GPU, but for now just hardcode T8103/G13G.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Asahi Lina
56d5db247a asahi: decode: Refactor to always copy GPU mem to local buffers
We want to plug this library into the hypervisor, but there we don't
have all GPU memory already mapped in our address space. Refactor the
GPU mem read function to always allocate local buffers and copy in the
data there.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Asahi Lina
2c2858c2af asahi: wrap: Handle freeing shmems
Needed for some Metal demos that end up creating multiple queues.

This is still definitely broken/not fully correct, but it at least
gets things working for those.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Asahi Lina
0dc819f284 asahi: Add extra CDM header block for G14X
Looks like we finally found our first properly divergent codepath.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Asahi Lina
69e91527d3 asahi: decode: Add a params argument to pass through
Sooner or later we were going to need divergent codepaths in decode, and
it looks like now is the time. Add a `params` typedef and pass it
through all the decoder callbacks. This is an alias for
drm_asahi_params_global, but use a typedef so we can change that later
without changing dozens of instances.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
de1174791d agx: Fix bogus assert
Dolphin uses all the uniforms.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
80e103d718 agx: Reduce un/packs with mem access lowering
Often not needed and makes the NIR harder to read.

shader-db is noise.

total instructions in shared programs: 1752712 -> 1752688 (<.01%)
instructions in affected programs: 8338 -> 8314 (-0.29%)
helped: 21
HURT: 8
Inconclusive result (%-change mean confidence interval includes 0).

total bytes in shared programs: 11943572 -> 11943434 (<.01%)
bytes in affected programs: 56716 -> 56578 (-0.24%)
helped: 21
HURT: 8
Inconclusive result (%-change mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
afa38c7d4f agx: Vectorize 16-bit parallel copies
If we have two 16-bit copies to/from adjacent 16-bit registers, we can instead
use a single 32-bit copy from the 32-bit register pair. Since 32-bit integer
arithmetic is (almost) as efficient as 16-bit on AGX, this (almost) doubles
performance of affected parallel copies.

total instructions in shared programs: 1788606 -> 1788301 (-0.02%)
instructions in affected programs: 17057 -> 16752 (-1.79%)
helped: 150
HURT: 0
Instructions are helped.

total bytes in shared programs: 12196492 -> 12194662 (-0.02%)
bytes in affected programs: 122894 -> 121064 (-1.49%)
helped: 150
HURT: 0
Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
42a4c09b72 agx: Try to allocate phi sources with loop phis
total instructions in shared programs: 1788666 -> 1788606 (<.01%)
instructions in affected programs: 7953 -> 7893 (-0.75%)
helped: 29
HURT: 0
Instructions are helped.

total bytes in shared programs: 12196852 -> 12196492 (<.01%)
bytes in affected programs: 53908 -> 53548 (-0.67%)
helped: 29
HURT: 0
Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
d0caa08c26 agx: Try to allocate phi sources with phis
Not meaningfully using more registers since this is just about how we assign
registers after fixing the maximum # of registers used (note that thread count
is unaffected).

total instructions in shared programs: 1790901 -> 1788666 (-0.12%)
instructions in affected programs: 230680 -> 228445 (-0.97%)
helped: 681
HURT: 2
Instructions are helped.

total bytes in shared programs: 12210266 -> 12196852 (-0.11%)
bytes in affected programs: 1634100 -> 1620686 (-0.82%)
helped: 682
HURT: 2
Bytes are helped.

total halfregs in shared programs: 532130 -> 532218 (0.02%)
halfregs in affected programs: 848 -> 936 (10.38%)
helped: 3
HURT: 13
Halfregs are HURT.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
73da872a66 agx: Try to allocate phis compatibly with sources
All shaders affected for thread count are in pubg... by chance the allocation
before used fewer registers than the calculated register demand (I guess because
we're conservative with our vector handling) and so got lucky and got higher
thread count. That shader is also helped massively for instructions.

The halfreg change doesn't matter -- we're not actually increasing register
demand, we're just being more choosy about our registers.

total instructions in shared programs: 1799738 -> 1790901 (-0.49%)
instructions in affected programs: 306081 -> 297244 (-2.89%)
helped: 889
HURT: 14
Instructions are helped.

total bytes in shared programs: 12263290 -> 12210266 (-0.43%)
bytes in affected programs: 2150966 -> 2097942 (-2.47%)
helped: 889
HURT: 14
Bytes are helped.

total halfregs in shared programs: 531981 -> 532130 (0.03%)
halfregs in affected programs: 1925 -> 2074 (7.74%)
helped: 0
HURT: 26
Halfregs are HURT.

total threads in shared programs: 18885184 -> 18884224 (<.01%)
threads in affected programs: 13440 -> 12480 (-7.14%)
helped: 0
HURT: 15

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
6cc8d7b52a agx: Add try_coalesce_with helper
Common logic the next few patches will use to try to assign something to the
same register as something else. "If it's already been assigned a register and
that register is free now, use it, otherwise bail."

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
42fbbd2a73 asahi: Forbid 2D Linear with images
There's no known use case, so forbidding this reduces the combinatorics required
in the texture atomic lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
4e53da7265 asahi: Don't restrict sampler views
We now emulate an infinitely large binding table with bindless, so the sky is
the limit for this CAP. Note we still have the limit for samplers, so this
probably doesn't do anything for OpenGL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
6788194c39 asahi: Make clear the non-sRGBness of EOT images
For sRGB render targets, we encode sRGB when writing pixels into the tilebuffer
(in the fragment shader), not when writing out the image. When we actually write
out the tilebuffer to the image, we don't use the PBE's sRGB conversion, we just
bind it as a UNORM 8 image and blit the pre-transformed pixels.

We're about to add real sRGB support for the PBE, so make this linearization
explicit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
8db9eeaeec asahi: Upload image descriptors
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:28 +00:00
Alyssa Rosenzweig
689d47fe7c asahi: Upload at most the max texture state registers
The rest are bindless now.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
274d0d1c82 asahi: Add texture/image indexing lowering pass
Both textures and images share a unified indexing scheme in AGX. When binding
tables are used, they can be mapped to texture state registers. Otherwise, there
is bindless access available.

It would be nice to map OpenGL's binding table based textures and images to AGX
texture state registers 1:1. The problem is that OpenGL allows more combined
textures and images than we necessarily have texture state registers. So, we use
as many texture state registers as we can, and then we fallback on an internal
bindless scheme mapping an extended binding table.

Add and use a lowering pass to map all of the API-level texture/image indices to
either texture state registers or bindless handles as required.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
1ad4a35a6c asahi: Add agx_batch_track_image helper
Adapted from Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
868d85bd83 asahi: Reallocate to set the writeable image flag
...If needed, for array images.

But avoid doing so for non-array images.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
92cd946028 asahi: Mark writeable images as such
ail needs this information to select the appropriate layout.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
16f081bf2a ail: Page-align layers for writable images
This appears to be necessary for PBE writes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
f716da596b asahi,agx: Set coherency bit for clustered targets
We need to set a particular bit on atomics for them to be coherent across
clusters. Fixes atomics on G13X.

Setting this bit on the single-cluster G13G, on the other hand, wedges the GPU.
So best be careful ;-)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Janne Grunau
f66fc18886 asahi: toggle more barrier bits after transform feedback
Fixes KHR-GLES31.core.draw_indirect.advanced-twoPass-transformFeedback-arrays
and KHR-GLES31.core.draw_indirect.advanced-twoPass-transformFeedback-elements
on M1 Ultra (G13D). Let's assume that same bits are required on M1 Pro
and Max.

Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
58d43ca03c asahi: Identify background/EOT counts
Similar to the counts for VDM/PDM/CDM.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
198c51d664 asahi: Serialize NIR in memory
Deserializing isn't expected to be much more expensive than cloning, and the
serialized NIR is *significantly* smaller. So store the serialized instead of
the deserialized, and deserialize on the fly.

This reduces a lot of noise in valgrind due to random crap alloc'd against the
NIR shader by lowering passes that now get properly freed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
8df0a86cc0 asahi: Extract shader_initialize helper
To fill out an agx_uncompiled_shader struct, since the logic was duplicated
between graphics and compute.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Asahi Lina
0e08923a7b asahi: Add nomsaa debug flag
This forces off MSAA, which together with smalltile mode helps test more
combinations.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Asahi Lina
e9b2f02c2f asahi: Add smalltile debug option
This lets us force small tiles when they otherwise would not be
necessary, which is useful for decoupling tile size and the logic that
depends on it from things like MSAA and MRT which can trigger small
tiles.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Asahi Lina
35715db30d asahi: Add synctvb debug flag
This requests synchronous TVB growth (instead of split renders). Mostly
for testing at this point.

Only works with newer kernels and the kernel will complain on dmesg for
now.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
d33375bb05 asahi: Refactor PBE upload routine
In general, PBE descriptors map pipe_image_views for the hardware. That we use a
writeable shader image internally for render targets is an implementation-detail
of the end-of-tile program. So, refactor the PBE upload routine to take a
pipe_image_view (not a pipe_surface), and translate the pipe_surface into an
internal pipe_image_view for end-of-tile programs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
85c829d64f asahi: Remove unused #define
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
f10d51541d asahi: Use nir_builder_at more
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Alyssa Rosenzweig
c20c9f06d3 asahi: Augment fake drm_asahi_params_global
Stub out a bit more UAPI so we can build with the additions in this patch
series.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
2023-07-20 15:33:27 +00:00
Sergi Blanch Torne
f7d0586524 Integrate ci-kdl in the building process and launch process.
Modify the build process for the images to include the build to have ci-kdl
available in the Mesa jobs. Modify also the init-stage2 to launch in the
background the process that will collect data and store a json file with the
relative changes on the recorded data.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24177>
2023-07-20 12:04:41 +00:00
Sergi Blanch Torne
8a1c95caab Introduce ci-kdl builder and launcher.
A tool to collect relative changes in some registers of sysfs can be used in
the Mesa jobs to record information while the tests are being executed.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24177>
2023-07-20 12:04:41 +00:00
Vignesh Raman
95c9d3db32 ci: add Vignesh Raman into restricted traces access list
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24247>
2023-07-20 11:08:10 +00:00
Eric Engestrom
85a8f03211 ci: delete install.tar after extracting it to avoid re-uploading it
Leaving it means it gets re-uploaded when sync'ing the artifacts back
from the DUT to GitLab.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24196>
2023-07-20 10:34:03 +00:00
Pavel Ondračka
c9a0e91d4c r300: fix cycles calculation
There might be more texture semaphores per begin tex block, just do the
cycles calculation on the first one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24250>
2023-07-20 10:19:24 +00:00
Lionel Landwerlin
2007d67054 ci/a530: switch a few tests to flakes to unblock CI
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24248>
2023-07-20 09:46:21 +00:00
Felix DeGrood
d04be9770b intel/compiler: use shader source hash in shader dump code
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Felix DeGrood
6ac8a9a030 intel: use shader source hash in INTEL_MEASURE
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Felix DeGrood
49182271e3 mesa: propagate shader source sha1 from gl_shader to nir_shader
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Felix DeGrood
96f344e5a6 iris: save shader source sha1 in ish
Save lowest dword of shader source sha1 in pipeline object for use
later as hash for uniquely identifying shader in debug outputs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Felix DeGrood
124973c635 anv: Add Source hash field to VkPipelineExecutableStatisticKHR
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Felix DeGrood
b145d05381 anv: save a shader source uint32_t hash in gfx/compute pipelines
Save lowest dword of shader source sha1 in pipeline object for use
later as hash for uniquely identifying shader in debug outputs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Lionel Landwerlin
3384f029be intel/compiler: rework input parameters
Use a struct for various common parameters rather than per stage
structure or arguments to stage specific entrypoints.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23942>
2023-07-20 09:08:08 +00:00
Konstantin Seurer
df3f2c89f5 radv/meta_buffer: Rename size_minus16 to max_offset
It's just better.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24213>
2023-07-20 07:43:16 +00:00
Konstantin Seurer
c49bd75fa7 radv/meta_buffer: Stop setting RADV_META_SAVE_DESCRIPTORS
Everything is done via push constants.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24213>
2023-07-20 07:43:16 +00:00
Konstantin Seurer
839d6f9fa2 radv: Stop using the misleading round_up_u* functions
The functions had the same behavior as DIV_ROUND_UP but their names do
not mention a division.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24210>
2023-07-20 06:51:30 +00:00
Pavel Ondračka
34a12a2727 r300: cycles estimate for shader-db
To account for:
- macro MAD in vs
- NOPs needed before presubtract
- texture scheduling and a proper texture semaphore usage

The docs don't mention any other references to extra cycles, so otherwise
we assume 1 instruction = 1 cycle.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7573
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24152>
2023-07-20 06:37:10 +00:00
Pavel Ondračka
219dc0fc08 r300: add a helper for checking number of temporary sources
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24152>
2023-07-20 06:37:10 +00:00
Pavel Ondračka
c86e1b97a3 r300: normal instruction can't have presubtract op
Only fs have presubtract ops and by the time we gather the stats,
all normal instructions were converted to pair ones.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24152>
2023-07-20 06:37:10 +00:00
Pavel Ondračka
c577655f8c r300: bump the RC_MAX_INDEX_BITS
We skip ntt regalloc for vertex shaders and we have 1024 instruction
limit for R500 vs, so in theory we could run some shaders with more that
1024 ssa registers (if we can optimize the number of instruction in the
backend). So add one more bit.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24154>
2023-07-20 06:22:03 +00:00
Pavel Ondračka
beee5c3658 r300: source register index is always unsigned
This was forgotten when we converted to the NIR lowering of negative
indirect adressing.

Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24154>
2023-07-20 06:22:03 +00:00
Pavel Ondračka
953dd9605f r300: check for index overflow when translating from TGSI
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24154>
2023-07-20 06:22:03 +00:00
David Heidelberg
3b5daba32d ci/panfrost: introduce OpenGL testing with Mali-G57 MP5 on Asurada chromebook
Copy-paste *-skips,fails,flakes from g52.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24198>
2023-07-20 01:25:34 +00:00
Alyssa Rosenzweig
ac51cc12b1 panfrost: Fix transform feedback on v9 harder
We might need more push uniforms (FAU) than the currently bound program. Update
that too for correct results on v9.

Fixes: c282f80c98 ("panfrost: Fix transform feedback on v9")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24198>
2023-07-20 01:25:34 +00:00
Alyssa Rosenzweig
64ff2b3ed6 panfrost: Lower vertex_id for XFB
Even on Valhall, vertex_id is zero-based in a transform feedback program. Lower
that for transform feedback programs properly since it wouldn't happen
automatically on Valhall. Fixes assertion fails.

Fixes: 91ffd10351 ("pan/bi: Lower gl_VertexID in NIR")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24198>
2023-07-20 01:25:34 +00:00
Chia-I Wu
539bf3929b amd/ci: update radv-stoney-aco-fails.txt for depth/stencil clear
This MR fixes the
stencil_d32_sfloat_s8_uint_load_op_none_store_op_none_write_off one.
The rest appears to be outdated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22114>
2023-07-19 23:46:02 +00:00
Chia-I Wu
e0602775c1 radv: fix separate depth/stencil layouts in clear meta
Depth and stencil can be in different layouts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22114>
2023-07-19 23:46:02 +00:00
Chia-I Wu
aaec5ea293 radv: refactor depth clear in clear meta
Modify what we pass to radv_fast_clear_depth and emit_depthstencil_clear
in preparation for separate depth/stencil layouts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22114>
2023-07-19 23:46:02 +00:00
Chia-I Wu
a06cb572f6 radv: fix separate depth/stencil layouts in resolve meta
Depth and stencil can be in different layouts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22114>
2023-07-19 23:46:02 +00:00
Chia-I Wu
673d416e22 radv: fix separate depth/stencil layouts in fb state
Set S_028000_DEPTH_COMPRESS_DISABLE/S_028000_STENCIL_COMPRESS_DISABLE
depending on the depth/stencil layouts respectively.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22114>
2023-07-19 23:46:02 +00:00
Dave Airlie
460e62b5e7 ci: remove binding model from the asan skips for lavapipe.
These should be fine now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20661>
2023-07-19 23:28:31 +00:00
Asahi Lina
32a79e9be7 docs/tgsi: Specify that depth texture fetches are replicated
This is what drivers do, and code like u_blitter expects this.

Commit 6cac9c748e implied that this was already specified, but only
stencil actually was, depth was still listed as TBD. Let's actually
specify this for future reference.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22361>
2023-07-19 23:21:36 +00:00
José Roberto de Souza
6f88e3befb anv: Add support for userptr in Xe KMD
Xe KMD only requires userptr to be bound to VM, so here reusing
workaround_bo->gem_handle id to all userptr bos in Xe version of
gem_create_userptr(). The Xe version of gem_close() will make sure
that workaround_bo->gem_handle is not closed when userptr bos
are closed.

With the same gem_handle for all userptr bos, it was also necessary
skip the anv_device_lookup_bo() and manually allocate memory to store
anv_bo in host heap memory, what lead to some small changes in
anv_device_release_bo() as well.

The remaining changes are the support to VM bind userptr bos and the
gem_vm_bind() call in anv_device_import_bo_from_host_ptr().

Fixes: dEQP-VK.memory.external_memory_host*
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23787>
2023-07-19 22:20:24 +00:00
José Roberto de Souza
5c729cb1b8 anv: Replace handle by anv_bo in the gem_close()
struct anv_bo will be needed in the next patch to properly handle
closure of userptr bos.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23787>
2023-07-19 22:20:24 +00:00
José Roberto de Souza
7e7ab39424 anv: Add gem_create_userptr() to KMD backend
Xe support of userptr will be implemented in the next patch,
this is just moving the i915 and stub functions to KMD backend.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23787>
2023-07-19 22:20:24 +00:00
Lionel Landwerlin
46958bcb74 intel/fs: fix missing predicate on SEL instruction
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d8dfd153c5 ("intel/fs: Make per-sample and coarse dispatch tri-state")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9381
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24236>
2023-07-19 21:57:25 +00:00
Mike Blumenkrantz
7fe1657140 zink: set feedback attachments on batch init
just to be safe

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23766>
2023-07-19 20:57:53 +00:00
Mike Blumenkrantz
7cbdb0b714 zink: set pipeline dynamic state count after all dynamic states are set
Fixes: d17c081b7c ("zink: use dynamic state for feedback loops when available")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23766>
2023-07-19 20:57:53 +00:00
Caio Oliveira
97c79cdf19 nir: Use instructions_pass() for nir_fixup_deref_modes()
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24220>
2023-07-19 20:15:12 +00:00
Danylo Piliaiev
a0d426370d ir3: Fix FS quad ops returning wrong values from helper invocations
Without SP_FS_CTRL_REG0.LODPIXMASK quad ops don't get values from
helper invocations, but from the current one.

Fixes:
 dEQP-VK.glsl.derivate.dfdxsubgroup.*
 dEQP-VK.glsl.derivate.dfdysubgroup.*

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24211>
2023-07-19 19:41:51 +00:00
Danylo Piliaiev
696f37f5c3 freedreno/regs: Rename SP_FS_CTRL_REG0.DIFF_FINE into LODPIXMASK
That's the "real" name of the field.

It enables ALL helper invocations in a quad, which is necessary for
fine derivatives and quad subgroup ops.

While PIXLODENABLE by itself enables only 3 out 4 fragments in a quad.

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24211>
2023-07-19 19:41:51 +00:00
Gert Wollny
59087003c4 r600/sfn: remove debug output leftovers
Fixes: ae7d904a73
    r600/sfn: Implement source mod optimization in backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24239>
2023-07-19 19:12:31 +00:00
David Rosca
7a4e3b2788 radeonsi/vcn: Fix setting color range in AV1 bitstream
As per spec color_range and chroma_sample_position parameters
are always set, not conditional on color_description_present_flag.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24179>
2023-07-19 18:51:48 +00:00
José Roberto de Souza
2661e975dc intel/aux_map: Add function and macro to return l2 and l1 table masks
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
c50008903b intel/aux_map: Drop magic sub table size number
Each entry is a uint64_t, L2 and L1 maps 12 bits so:
(1 << 12) = 4096
sizeof(uint64_t) = 8
4096 * 8 = 32768 = 32K

Same value but easier to understand.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
b9a38a1661 intel/aux_map: Convert l1_entry_addr_out to canonical
The expression 'l1_gpu_addr + l1_index * sizeof(*l1_map)' could cause
bit 47 to be set so it needs to be converted to canonical.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
4f44c47db8 intel/aux_map: Mask out bits above index 47 in intel_aux_get_meta_address_mask()
The bits above index 47 in l1 entry are used to define format,
depth and luminance.
aux_address is formated as canonical, so bits above 47 could all be
set to 1 causing wrong values being set to format, depth and luminance.

intel_aux_get_meta_address_mask() was previously using 2 shifts to
mask out bits above index 47, what is not so obvious and are 2
operations, so here doing a AND with VALID_ADDRESS_MASK to make it
easier to understand.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
47792b3642 intel/aux_map: Rename some variables to improve readability
No changes in behavior here, mostly doing this types of renames:
- address to main_address, to know that addresses refers to main
surface address or aux surface address
- gpu to addr
- main_map_addr to main_inc_addr
- aux_dest_addr to aux_inc_addr

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
14ae2c58b8 intel/aux_map: Replace magic number by INTEL_AUX_MAP_ENTRY_VALID_BIT
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
4fc38aa99b intel/aux_map: Use get_aux_entry() in remove_mapping()
remove_mapping() duplicated almost half of get_aux_entry(), it is
only dropping the cases were entries are not alocated but during
removal it is expected that entries were already alocated so we can
reuse get_aux_entry() and drop duplicated code.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
José Roberto de Souza
872b4247ad intel/aux_map: Nuke format_enum
The only user of format_enum is intel_aux_map_get_alignment() that
can easily use information in format->main_page_size.
This allow us to nuke format_enum and remove duplicated information
in intel_aux_map_get_alignment().

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24077>
2023-07-19 16:53:59 +00:00
Lucas Stach
db4b365f2b etnaviv: initialize VIVS_GL_BUG_FIXES
Same as the blob, always initialize this state when feature
BUG_FIXES18 is present.

Fixes spec@!opengl 2.0@occlusion-query-discard on GC3000.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24166>
2023-07-19 16:35:04 +00:00
Samuel Pitoiset
af38b1acd5 zink/ci: update list of expected failures for NAVI10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24232>
2023-07-19 16:08:39 +00:00
Robert Mader
74451ed3f0 egl/wayland: wait for compositor to release shm buffers
Some Wayland compositors, notably Exo, do not always release buffers
fast enough, and not in sync with their frame callbacks, to guarantee
that a free buffer is available the next time a client calls
`eglSwapBuffers()`.

This currently leads to a crash in `dri2_wl_swrast_get_backbuffer_data()`
with the swrast backend. To avoid this, simply block until the
compositor releases a buffer eventually.

While arguably compositors should release buffers they don't need any
more for the next frame, this can be quite complex depending on
the architecture - notably multi-process/IPC in case of Exo.

cc: mesa-stable

Signed-off-by: Robert Mader <robert.mader@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24091>
2023-07-19 15:11:46 +00:00
José Roberto de Souza
2a6fc690c1 anv: Use workaround framework to Wa_14016118574
Wa_14016118574 is not the lineage number for this workaround so
it was updated to Wa_22014412737.
Wa_22014412737 is not applicable for MTL B0 steppings and newer
so using the workaround framework eliminates this pipe_control
instruction for not affected revisions.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24221>
2023-07-19 14:43:44 +00:00
Thomas H.P. Andersen
58febefa9a tgsi: remove unused tgsi_shader_info.max_depth
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
0335976fb2 tgsi: remove unused tgsi_shader_info.const_buffers_indirect
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
674fbed75d tgsi: remove unused tgsi_shader_info.indirect_files_written
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
bfb7f85461 tgsi: remove unused tgsi_shader_info.indirect_files_read
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
606db8cc40 tgsi: remove unused tgsi_shader_info.uses_bindless_image_atomic
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
67f85d3f45 tgsi: remove unused tgsi_shader_info.uses_bindless_image_store
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
70d8408666 tgsi: remove unused tgsi_shader_info.uses_bindless_image_load
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
aa6a3faf75 tgsi: remove unused tgsi_shader_info.uses_bindless_buffer_atomic
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
33e9189aa1 tgsi: remove unused tgsi_shader_info.uses_bindless_buffer_store
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
98b157bd9c tgsi: remove unused tgsi_shader_info.uses_bindless_buffer_load
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:28 +00:00
Thomas H.P. Andersen
b2c6f21f10 tgsi: remove unused tgsi_shader_info.images_atomic
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
4b9b6a0711 tgsi: remove unused tgsi_shader_info.images_store
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
8c227964f3 tgsi: remove unused tgsi_shader_info.images_load
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
eeb0d979f3 tgsi: remove unused tgsi_shader_info.culldist_writemask
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
14454e20ea tgsi: remove unused tgsi_shader_info.clipdist_writemask
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
a481db8f3e tgsi: remove unused tgsi_shader_info.uses_bindless_images
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
7d21d1317f tgsi: remove unused tgsi_shader_info.uses_bindless_samplers
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
395a2409cb tgsi: remove unused tgsi_shader_info.uses_derivatives
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
908441e0ee tgsi: remove unused tgsi_shader_info.uses_doubles
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
87d1dde7f9 tgsi: remove unused tgsi_shader_info.writes_primid
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
9c207d4f89 tgsi: remove unused tgsi_shader_info.uses_subgroup_info
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
68d0c847bb tgsi: remove unused tgsi_shader_info fields
uses_thread_id
uses_block_id
uses_block_size

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
402f5c5407 tgsi: remove unused tgsi_shader_info.uses_drawid
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
436e59e3d9 tgsi: remove unused tgsi_shader_info fields
Removes:
uses_persp_opcode_interp_centroid
uses_persp_opcode_interp_offset
uses_persp_opcode_interp_sample
uses_linear_opcode_interp_centroid
uses_linear_opcode_interp_offset
uses_linear_opcode_interp_sample

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
6c513ef4fd tgsi: remove unused tgsi_shader_info fields
Removes:
uses_persp_center
uses_persp_centroid
uses_persp_sample
uses_linear_center
uses_linear_centroid
uses_linear_sample

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
76b0e7b25c tgsi: remove unused tgsi_shader_info.reads_tess_factors
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
9050b10627 svga: remove unused struct field
This will allow further cleanup in tgsi_shader_info

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
29673ac8d0 tgsi: remove unused tgsi_shader_info.reads_samplemask
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
ad2c811884 tgsi: remove unused tgsi_shader_info.reads_position
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
1f1ffd5b1d tgsi: remove unused tgsi_shader_info.colors_written
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
9684fbc87d tgsi: remove unused tgsi_shader_info.colors_read
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
849065b9f3 tgsi: remove unused tgsi_shader_info.num_memory_instructions
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
64ce4669a3 tgsi: remove unused tgsi_shader_info.array_max
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:27 +00:00
Thomas H.P. Andersen
8807f0ec3e tgsi: remove unused tgsi_shader_info.num_tokens
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24100>
2023-07-19 12:41:26 +00:00
Karmjit Mahil
6b6102f2ff pvr: Fix writing query availability write out
The query value was accidentally being written as the availability
value. Queries that were available but of value `0` would never
become available.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24209>
2023-07-19 12:22:30 +00:00
Karmjit Mahil
a4bdf2de0f pvr: Fix occlusion query unaccounted for user fences
User provided fences can never have a source stage for occlusion
queries as the occlusion query job is internal to the driver. So
at vkQueueSubmit the user's VkFence could be signalled before the
queries had completed.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24209>
2023-07-19 12:22:30 +00:00
Karmjit Mahil
2b685fb09e pvr: Allow query stage for barrier sub cmds
The function is accounting for the occlusion query job so changing
the assert to allow it.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24209>
2023-07-19 12:22:30 +00:00
Karmjit Mahil
0ba29bf641 pvr: Use the correct size for the unified store allocation
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24209>
2023-07-19 12:22:30 +00:00
Frank Binns
0137de917b pvr: cleanup SPM EOT dynarray after upload
Fixes a memory leak found with Valgrind.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Fixes: ad0ca7a879 ("pvr: Compile SPM EOT shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24208>
2023-07-19 12:06:32 +00:00
M Henning
f39df8fe2d nv50/ir: Remove SpillSlot
Since nothing ever reads this data.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23006>
2023-07-19 11:47:10 +00:00
M Henning
42f5f9cb8f nv50/ir: Remove dead loop from assignSlot
This loop can never execute. On entry we have offset = offsetBase and
offsetBase >= stackSize, so the condition offset < stackSize is always
false. The git history suggests that this was always broken this way.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23006>
2023-07-19 11:47:10 +00:00
M Henning
3c0f8aec84 nv50/ir: Remove Function.stackPtr
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23006>
2023-07-19 11:47:10 +00:00
M Henning
cd2c314ee0 nv50/ir: Remove ArgumentMovesPass
We only use OP_CALL for builtins at this point, so no need for this.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23006>
2023-07-19 11:47:10 +00:00
M Henning
1032d5c836 nv50/ir: Drop nir_jump_return handling
This is always lowered before this point.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23006>
2023-07-19 11:47:10 +00:00
Dr. David Alan Gilbert
69101c72f3 rusticl: Wire the 'start' and 'end' profilng times up
We use the timestamp pipe queries to retrieve times from the
device, hopefully close to the execution of the code.

For now we use the End value for complete as well.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
2023-07-19 10:29:25 +00:00
Dr. David Alan Gilbert
4a44dd1654 rusticl: Wrap pipe query reads
Take a query we previously created and read it's result.
The type of the result is usually implicitly known; for now
just handle the query we use in 64 bit.

This is safe because the trait bindings ensure that
when we create a query with PipeQueryGen we embed the type
of the result in the PipeQuery, and that produces the correct
result type.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
2023-07-19 10:29:25 +00:00
Dr. David Alan Gilbert
52e53938c3 rusticl: Wrap pipe queries
Pipe queries are asynchronous state reads, you create a query
and sometime later retrieve the result.

Wrap the underlying basic calls and types and provide a type
(PipeQuery) to handle the lifetype of the query.  Note the pipe context
used for the query must live at last as long as the query.

Queries are created by calls to the PipeQueryGen, a wrapper
that figures out the return type and wraps that in the intermediate
that's returned.   A typical use is:

  query_start = PipeQueryGen::<{pipe_query_type::PIPE_QUERY_TIMESTAMP}>::new(ctx);

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
2023-07-19 10:29:25 +00:00
Dr. David Alan Gilbert
c893fa1fcd rusticl: Wire the 'submit' profiling time up
Set it from the timestamp when it's taken out of the queue and
submitted, and wire the APU up to read it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
2023-07-19 10:29:25 +00:00
Dr. David Alan Gilbert
85ca349be0 rusticl: Wire the 'queued' profiling time up
Set it from the timestamp when it's added to the queue, and wire
the API up to read it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
2023-07-19 10:29:24 +00:00
Dr. David Alan Gilbert
6052e58bf6 rusticl/core: Add profiling time storage (queued) to event
Add the first, of a few, profiling time values to the Event,
with access methods.  This is defined as

   'when the command identified by event is enqueued in a command-queue
    by the host'

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24101>
2023-07-19 10:29:24 +00:00
Karol Herbst
a944a8eba9 nvc0: initial Ada enablement
Cc: 23.2 <mesa-stable>
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24226>
2023-07-19 09:08:16 +00:00
Philipp Zabel
f626605cbf etnaviv: fix segfault after compile failure
Do not try to determine the shader stage from the compiled shader
variant, which may be NULL after compile failure. Instead, get it
from the NIR shader.

Fixes a segfault when trying to evaluate etna_shader_stage(NULL)
after compile failure.

Suggested-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Fixes: 3d49619071 ("etnaviv: add support for performance warnings")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24178>
2023-07-19 08:46:22 +00:00
Honglei Huang
b246f96573 virgl: Enable vp9 hardware decode
Add vp9 fill function in fill_picture_desc to enable vp9 decoding.

Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Boyuan Zhang
d4220c14cc virgl: Implement vp9 hardware decode
Implement vp9 hardware decode by filling vp9 picture desc.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Boyuan Zhang
7eff5cdbac virgl: Add vp9 picture desc
Define vp9 picture and slice parameters.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Honglei Huang
15a2b1797b virgl/video: Add jpeg buf start code check
Add jpeg start code check to fix the issue that
double header adding in virgl video codec.

Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Honglei Huang
9cbb7cb13b virgl/video: Add more pipe type in virgl formats convert table
Add Y8_400_UNORM, YUYV, Y8_U8_V8_444_UNORM,
R8G8_R8B8_UNORM into virgl_formats_conv_table to fix
the resource create fail issue.

Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Honglei Huang
2b6301e870 virgl/video: Add support for hevc10bit decoding.
Add P010 CONV_FORMAT to support virgl hevc10bit decoding.

Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Honglei Huang
e1b8e4d7fc virgl/video: Add support for jpeg decoding
Implement for virgl jpeg decoding.

Signed-off-by: Honglei Huang <honghuan@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:38 +00:00
Honglei Huang
dad4b79ee0 virgl/video: Add support for vc1 decoding
Implement for virgl vc1 decoding.

Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:37 +00:00
Honglei Huang
deafeab1ee virgl/video: Add support for mpeg12 decoding
Implement for mpeg12 virgl video decoding.

Signed-off-by: Honglei Huang <honglei1.huang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Feng Jiang <jiangfeng@kylinos.cn>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22108>
2023-07-19 07:06:37 +00:00
Faith Ekstrand
61a90c2968 intel/vec4: Drop support for nir_register
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24104>
2023-07-19 02:11:57 +00:00
Faith Ekstrand
39b5bb0809 intel/fs: Drop support for nir_register
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24104>
2023-07-19 02:11:57 +00:00
Faith Ekstrand
ce75c3c3fe intel: Switch to intrinsic-based registers
Results on HSW (vec4 only):

    total instructions in shared programs: 2978400 -> 2974135 (-0.14%)
    instructions in affected programs: 77870 -> 73605 (-5.48%)
    helped: 143
    HURT: 48
    helped stats (abs) min: 1 max: 100 x̄: 30.22 x̃: 9
    helped stats (rel) min: 0.03% max: 30.49% x̄: 8.02% x̃: 6.39%
    HURT stats (abs)   min: 1 max: 4 x̄: 1.19 x̃: 1
    HURT stats (rel)   min: 0.08% max: 16.67% x̄: 3.71% x̃: 3.23%
    95% mean confidence interval for instructions value: -26.69 -17.97
    95% mean confidence interval for instructions %-change: -6.24% -3.90%
    Instructions are helped.

    total cycles in shared programs: 45345924 -> 44742666 (-1.33%)
    cycles in affected programs: 29083466 -> 28480208 (-2.07%)
    helped: 4785
    HURT: 3879
    helped stats (abs) min: 2 max: 8072 x̄: 276.00 x̃: 24
    helped stats (rel) min: 0.02% max: 54.43% x̄: 7.78% x̃: 1.95%
    HURT stats (abs)   min: 2 max: 14736 x̄: 184.95 x̃: 20
    HURT stats (rel)   min: 0.02% max: 97.00% x̄: 7.69% x̃: 1.53%
    95% mean confidence interval for cycles value: -83.49 -55.77
    95% mean confidence interval for cycles %-change: -1.16% -0.55%
    Cycles are helped.

    total spills in shared programs: 1093 -> 539 (-50.69%)
    spills in affected programs: 772 -> 218 (-71.76%)
    helped: 74
    HURT: 0

    total fills in shared programs: 760 -> 757 (-0.39%)
    fills in affected programs: 66 -> 63 (-4.55%)
    helped: 3
    HURT: 0

Results on TGL (all stages):

    total instructions in shared programs: 21486982 -> 21488266 (<.01%)
    instructions in affected programs: 2245938 -> 2247222 (0.06%)
    helped: 1288
    HURT: 1385
    helped stats (abs) min: 1 max: 93 x̄: 4.05 x̃: 2
    helped stats (rel) min: 0.02% max: 3.82% x̄: 0.61% x̃: 0.46%
    HURT stats (abs)   min: 1 max: 134 x̄: 4.69 x̃: 2
    HURT stats (rel)   min: <.01% max: 5.59% x̄: 0.65% x̃: 0.44%
    95% mean confidence interval for instructions value: 0.13 0.83
    95% mean confidence interval for instructions %-change: <.01% 0.08%
    Instructions are HURT.

    total cycles in shared programs: 809326677 -> 809475669 (0.02%)
    cycles in affected programs: 447781659 -> 447930651 (0.03%)
    helped: 1924
    HURT: 1994
    helped stats (abs) min: 1 max: 74567 x̄: 1217.49 x̃: 10
    helped stats (rel) min: <.01% max: 38.44% x̄: 1.09% x̃: 0.17%
    HURT stats (abs)   min: 1 max: 76426 x̄: 1249.47 x̃: 8
    HURT stats (rel)   min: <.01% max: 137.11% x̄: 1.64% x̃: 0.17%
    95% mean confidence interval for cycles value: -125.61 201.67
    95% mean confidence interval for cycles %-change: 0.12% 0.48%
    Inconclusive result (value mean confidence interval includes 0).

    LOST:   4
    GAINED: 4

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24104>
2023-07-19 02:11:57 +00:00
Faith Ekstrand
abb6188a04 intel/vec4: Add support for new-style registers
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24104>
2023-07-19 02:11:57 +00:00
Faith Ekstrand
f783eb9ebd intel/vec4: Assume get_nir_dest() provides a sane write-mask
It should be providing a write mask that is all the channels.  Drop the
one case for load_input where we stomp this for no good reason.  Also,
make ALU write-masking AND with the existing mask.  This prepares us for
the next patch where we convert to new-style registers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24104>
2023-07-19 02:11:57 +00:00
Faith Ekstrand
b8209d69ff intel/fs: Add support for new-style registers
The old ones still work for now.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24104>
2023-07-19 02:11:57 +00:00
Timothy Arceri
c64ad299e4 glsl: fix validation of ES vertex attribs
From OpenGL ES 3.0 spec, page 56:

    "Binding more than one attribute name to the same location
     is referred to as aliasing, and is not permitted in OpenGL
     ES Shading Language 3.00 vertex shaders. LinkProgram will
     fail when this condition exists. However, aliasing is
     possible in OpenGL ES Shading Language 1.00 vertex shaders.
     This will only work if only one of the aliased attributes
     is active in the executable program, or if no path through
     the shader consumes more than one attribute of a set of
     attributes aliased to the same location. A link error can
     occur if the linker determines that every path through the
     shader consumes multiple aliased attributes, but implemen-
     tations are not required to generate an error in this case."

So here we make sure to allow the optimisations before validation
for earlier ES shader versions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

Fixes: 80c001013c ("glsl: do vs attribute validation in NIR linker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9342
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24205>
2023-07-19 00:43:26 +00:00
Mike Blumenkrantz
28b07a7bd2 ci: bump VVL to 1.3.257
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24214>
2023-07-18 23:43:16 +00:00
Eric Engestrom
0f557ffa26 ci: move lavapipe files rules to src/gallium/drivers/lavapipe/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
a15384383b ci: move softpipe files rules to src/gallium/drivers/softpipe/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
14b9f460c2 ci: move llvmpipe files rules to src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
96344c7b71 ci: move virgl files rules to src/gallium/drivers/virgl/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
e9f2c4b4c2 ci: move intel files rules to src/intel/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
c99f10eb54 ci: move virtio files rules to src/virtio/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
5828d86c26 ci: move zink files rules to src/gallium/drivers/zink/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
7aa9abe473 ci: move microsoft files rules to src/microsoft/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
b7298836c5 ci: move amd files rules to src/amd/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
58077c6add ci: move lima files rules to src/gallium/drivers/lima/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
1625b5984a ci: move broadcom files rules to src/broadcom/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
728ae85b5d ci: move panfrost files rules to src/panfrost/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
8b8169f52e ci: move nouveau files rules to src/gallium/drivers/nouveau/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:52 +00:00
Eric Engestrom
52528c7088 ci: move freedreno files rules to src/freedreno/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
6f176d2cf2 ci: move etnaviv files rules to src/etnaviv/ci/gitlab-ci.yml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
a445f611c4 ci: replace virgl_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
a35056421e ci: replace radeonsi_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
068b68db94 ci: replace radv_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
e6d5448229 ci: replace iris_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
8af6ad46dd ci: replace lavapipe_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
d8503dc5fd ci: replace softpipe_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
426d417f3a ci: replace llvmpipe_file_list anchor with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
2668c02c32 ci: add .gallium-core-rules and use it instead of gallium_core_file_list anchor
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
f55a2b5bab ci: add .llvmpipe-manual-rules and use it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Eric Engestrom
593b85f672 ci: use !reference for scheduled_pipeline retry rule
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24099>
2023-07-18 23:07:51 +00:00
Rohan Garg
614efeeafe intel/genxml: set a default value for "Pixel Position Offset Enable" in genxml
Set the default value for "Pixel Position Offset Enable" when emitting
3DSTATE_MULTISAMPLE in the genxml so that we can drop it from blorp
and genX_state.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23936>
2023-07-18 22:25:38 +00:00
David Rosca
e6f0819806 radeonsi/vcn: Enable full/limited range support for H264/HEVC/AV1
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24174>
2023-07-18 21:40:34 +00:00
David Rosca
756e5d6687 radeonsi/vcn: Set HEVC video signal parameters in bitstream
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24174>
2023-07-18 21:40:34 +00:00
David Rosca
f44697239d radeonsi/vcn: Set H264 video signal parameters in bitstream
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24174>
2023-07-18 21:40:34 +00:00
David Rosca
8a21efce3a frontends/va: Add postproc support for converting to full range
Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24174>
2023-07-18 21:40:34 +00:00
David Rosca
8438d6363a frontends/va: Parse HEVC SPS for video signal parameters
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24174>
2023-07-18 21:40:33 +00:00
David Rosca
2785d54b71 frontends/va: Parse H264 SPS for video signal parameters
Since packed headers support is now advertised for H264,
it also fixes encoding into mkv with ffmpeg.

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

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24174>
2023-07-18 21:40:33 +00:00
David Rosca
cfd24047a1 radeonsi/vcn: Don't use chroma in AV1 encode with RGB input
Fixes: 64eab1f3ae

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24170>
2023-07-18 20:09:42 +00:00
David Rosca
2cb4c6aef0 frontends/va: Don't use EFC with scaling or filtering enabled
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24170>
2023-07-18 20:09:42 +00:00
David Rosca
b5fa9f992d frontends/va: Skip processing buffers already converted with EFC
Since the EFC conversion reallocates the dst buffer with new format,
any subsequent VA postproc calls on the same surface will fall back
to vl_compositor conversion.

This is the case in ffmpeg where the postproc filter output
buffers are reused instead of allocated for each frame.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24170>
2023-07-18 20:09:42 +00:00
Yiwei Zhang
0e9affd267 venus: reduce to use 4K mem suballoc align on platforms known to fit
This is a workaround for low ram arm devices before fixing:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/9351

Test: patch to prior higher limit 16384 and run
      dEQP-VK.api.object_management.max_concurrent.query_pool

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24219>
2023-07-18 19:38:34 +00:00
Kenneth Graunke
283e3acd3a iris: Re-emit 3DSTATE_DS for each primitive (workaround 14019750404)
Some platforms require us to re-emit 3DSTATE_DS before every 3DPRIMITIVE
when tessellation is enabled.  See workaround 14019750404.

Cc: 23.2 <mesa-stable>

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24150>
2023-07-18 19:14:27 +00:00
Iván Briano
4ad19c8310 anv: implement Wa_14019750404
Cc: 23.2 <mesa-stable>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8931

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24150>
2023-07-18 19:14:27 +00:00
Iván Briano
7b0ded0b23 anv: ensure mesh is disabled on context init
It turns out the hardware doesn't save the whole state on a context
switch, as the kernel expects when it creates the golden context.
For some HW units, only the state that was explicitly programmed will be
part of it, so we need to make sure mesh shading is disabled on context
creation, or we risk being context switched with an application that
uses mesh, and when ours gets to run again, the mesh state won't be
reset, and submitting a legacy 3D pipeline while the HW thinks mesh is
enabled causes us to hang.

Cc: 23.2 <mesa-stable>

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24150>
2023-07-18 19:14:27 +00:00
Iván Briano
50d68f74b5 iris: ensure mesh is disabled on context init
It turns out the hardware doesn't save the whole state on a context
switch, as the kernel expects when it creates the golden context.
For some HW units, only the state that was explicitly programmed will be
part of it, so we need to make sure mesh shading is disabled on context
creation, or we risk being context switched with an application that
uses mesh, and when ours gets to run again, the mesh state won't be
reset, and submitting a legacy 3D pipeline while the HW thinks mesh is
enabled causes us to hang.

Cc: 23.2 <mesa-stable>

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24150>
2023-07-18 19:14:27 +00:00
Gert Wollny
f48aa460a2 r600/sfn: Print more info if scheduling fails
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
2a9348967a r600/sfn: Add some tests for proper register access
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
382e198503 r600/sfn: reorder the value factory class member declaration a bit
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
00417c216e r600/sfn: Add peephole optimization to move a dest to the previous op
This is mostly tailored to the register store op where we get a sequence

   ALU OP S1.x : ...
   ALU MOV R1.x = S1.x

but it can help elsewhere too.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
197bc1ee07 r600/sfn: Increase LDS fetch schedule priority
Otherwise we may end up scheduling the value read before the
value fetch.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
ddb167e81a r600/sfn: Handle indirect array load/store dependencies better
Indirect access must depend on all writes to the array

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
d0beaf73d9 r600/sfn: Allow for larger ALU CF's
We should get as close as possible to the limit the hardware and the
assembler backend allows for.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
d8291cc7ee r600/sfn/tests: add simple copy-prop test with register source
Just to make sure the register intrinsic conversion doesn't need the helpers.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Gert Wollny
10938cddd7 r600/sfn: Switch to register intrinsics
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Alyssa Rosenzweig
886a7ae786 r600/sfn: Remove nir_register unit tests
These tests will be obsolete soon and are just extra users of an API that will
be removed. Drop them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24212>
2023-07-18 17:51:47 +00:00
Samuel Pitoiset
f334d00a8a radv: make radv_get_pa_su_sc_mode_cntl() static
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24192>
2023-07-18 17:07:19 +00:00
Samuel Pitoiset
9299a90cc1 radv: remove support for VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV
This isn't used by vkd3d-proton which is the only user of DGC, no need
to overcomplicate this.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24192>
2023-07-18 17:07:18 +00:00
Marek Olšák
4b93ae7e7a util/u_queue: always enable UTIL_QUEUE_INIT_SCALE_THREADS, remove the flag
It means that threads are created on demand except for the first one.
It reduces process startup time.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24173>
2023-07-18 11:11:12 -04:00
Marek Olšák
bfdfe5aa82 util/u_queue: fix util_queue_finish deadlock by merging lock and finish_lock
and by disabling the on-demand thread creation, which breaks the finish logic.

Fixes: 3713dc6b2a - util/u_queue: add UTIL_QUEUE_INIT_SCALE_THREADS flag
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8363

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24173>
2023-07-18 11:11:12 -04:00
Alyssa Rosenzweig
c282f80c98 panfrost: Fix transform feedback on v9
We were using a stale FAU buffer which meant we wrote to garbage addresses. I'm
guessing this was fallout from the big sysval rework but not 100% sure.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24199>
2023-07-18 12:03:05 +00:00
Iván Briano
75990e5564 anv: ensure CFE_STATE is emitted for ray tracing pipelines
Fixes sporadic failures in dEQP-VK.robustness.robustness2.*.rgen

Fixes: ecb709c853 ("anv: only emit CFE_STATE when scratch space increases")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9382

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24206>
2023-07-17 22:19:12 -07:00
David Heidelberg
4cf94ce90e ci/freedreno: add a530 flakes, remove one fail which recently started passing
dEQP-GLES31.functional.texture.texture_buffer.render.as_vertex_array_as_index_array_as_fragment_texture.offset_1_alignments
seems to got fixed by accident?

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24203>
2023-07-18 00:11:07 +00:00
David Heidelberg
a6edac3764 ci/microsoft: when re-enabling Windows Farm, always run the container
Otherwise, Marge queue has to wait for someone manually trigger it.

Fixes: d3b66356 ("ci/microsoft: partly revert rename from container-rules to manual-rules")

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24048>
2023-07-18 01:08:19 +02:00
Robert Foss
1d9d72b3fb egl: Rename _eglAddDevice() to _eglFindDevice()
_eglAddDevice() is now only used to look up eglDevices,
which means that the function name is a bit misleading.

Since this function is only used for finding the
eglDevice, it should also no longer support adding
a device to the egl devices list.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:01 +00:00
Robert Foss
3a9e1014e1 egl: Rename _eglAddDevice() to _eglFindDevice()
_eglAddDevice() is now only used to look up eglDevices,
which means that the function name is a bit misleading.

Since this function is only used for finding the
eglDevice, it should also no longer support adding
a device to the egl devices list.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:01 +00:00
Robert Foss
7d231f8282 egl/android: Use EGL DeviceList instead drmGetDevices2()
droid_open_device() lists all of the DRM devices available,
but since EGL already already has created such a list use that
instead.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:01 +00:00
Robert Foss
a2aea26727 egl/surfaceless: Use EGL DeviceList instead of drmGetDevices2()
surfaceless_probe_device() lists all of the DRM devices available,
but since EGL already already has created such a list use that instead.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:00 +00:00
Robert Foss
cd52762bb6 egl: Refresh DeviceList during eglInitialize()
eglInitialize() must be called before the dri2 platforms probe
in order for the EGL DeviceList to be populate with devices.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:00 +00:00
Robert Foss
e0c97148de egl: Rename _eglRefreshDeviceList() to _eglDeviceRefreshList()
Rename this function to better reflect it's location
and what structs it relates to.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:00 +00:00
Robert Foss
0e0adec81e egl: Expose access to DeviceList
In order to not have the different dri2 platforms all build
lists of available devices, use the device list provided by EGL.

Signed-off-by: Robert Foss <rfoss@kernel.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23742>
2023-07-17 22:27:00 +00:00
Eric Engestrom
3a8aae9e6a ci: drop leftover kernel configs
Fixes: 23158e9a3f ("ci: build kernel in gfx-ci/linux and just use binaries in Mesa3D CI")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24195>
2023-07-17 20:51:58 +00:00
Alyssa Rosenzweig
5178c81e26 radv: Rely on workgroup_size initialization
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24158>
2023-07-17 19:53:49 +00:00
Alyssa Rosenzweig
3fed1b4a9e v3dv: Rely on nir_builder setting workgroup size
Now the default.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24158>
2023-07-17 19:53:49 +00:00
Alyssa Rosenzweig
d0f0afc6a4 nir: Initialize workgroup_size in builder_init_simple_shader
It can't be 0 in Vulkan.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24158>
2023-07-17 19:53:49 +00:00
Danylo Piliaiev
ce25668d02 ir3: Use NIR info to enable per sample shading
NIR is tracking this better than us.

New CTS tests seem to add the requirement where in the presence of some
builtin's like gl_SampleID in a shader, even if unused, sample shading
is expected to be enabled.

See https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3712

Fixes:
 dEQP-VK.draw.*.implicit_sample_shading.sample_id_static_use
 dEQP-VK.draw.*.implicit_sample_shading.sample_position_static_use

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24193>
2023-07-17 19:00:39 +00:00
David Heidelberg
79f7882fc6 ci: add quirk for GitLab assuming changes is always true for scheduled runs
Sadly GitLab CI always evaluate `rules:changes` as true, when running
scheduled runs. So we have to add explicit condition to ignore it there.

Every line using `rules:changes` has to have following condition
ignoring "schedule" runes.

Cc: mesa-stable
Reported-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24051>
2023-07-17 18:12:27 +00:00
Alyssa Rosenzweig
16b080b5d8 ir3: Use nir_lower_tess_coord_z
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24159>
2023-07-17 17:31:52 +00:00
Alyssa Rosenzweig
2c8f884103 r600: Use nir_lower_tess_coord_xy
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24159>
2023-07-17 17:31:52 +00:00
Alyssa Rosenzweig
4f0f76346e nir: Add nir_lower_tess_coord_z pass
Lowers tess_coord to tess_coord_xy and math. Based on ir3's version.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24159>
2023-07-17 17:31:52 +00:00
Alyssa Rosenzweig
9109830bb0 nir: Promote tess_coord_r600 to tess_coord_xy
This intrinsic (vec2 tess_coord) is generally useful for non-r600 backends.
Promote it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24159>
2023-07-17 17:31:52 +00:00
Eric Engestrom
74f8956f27 ci: replace copy of nouveau rules with reference
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24190>
2023-07-17 16:11:42 +00:00
Marek Olšák
005ffbe4b7 freedreno,lima,zink: update CI fixes and flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24165>
2023-07-17 15:36:48 +00:00
Marek Olšák
c97961a855 mesa: fix 38% decrease in display list performance of Viewperf2020/NX8_StudioAA
It happened because glCallList was restoring varying_vp_inputs, which
caused every glCallList to process the state change again.

This loosely reverts commit 3a294ff01f
"mesa: move the _mesa_set_varying_vp_inputs call to where the state changes".

Fixes: 3a294ff01f - "mesa: move the _mesa_set_varying_vp_inputs call to where the state changes"

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24165>
2023-07-17 15:36:47 +00:00
Guilherme Gallo
701b035179 bin/ci: Ensure that all jobs have nodes in DAG
Some automatic jobs, such as 'rustfmt' and 'clang-format', are skipped
during the graph sweep because their parents are already included in the
node set.

This commit ensures all visited jobs are in DAG and fixes iteration
modification using deepcopy.

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

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24176>
2023-07-17 15:34:11 +00:00
Rhys Perry
5e4029bfe5 nir/tests: add test for unsigned_upper_bound with loop header phis
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23990>
2023-07-17 14:45:21 +00:00
Rhys Perry
1139d870f3 nir/unsigned_upper_bound: fix phi(bcsel)
This was looking at the wrong sources. src0 is the condition.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: 72ac3f6026 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23990>
2023-07-17 14:45:21 +00:00
Leo Liu
34c4a195f9 radeonsi: add AV1 profile to supported profile
With fully supported profile, we will get info based on querying to
the kernel.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24161>
2023-07-17 14:25:12 +00:00
Rohan Garg
36d4e83299 intel/perf: add perf query support for Intel Raptorlake
Fixes: 4e0eca7dc3 ("intel/dev: Add device info for RPL")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24180>
2023-07-17 13:56:02 +00:00
Marek Olšák
6cda08416b glthread: determine global locking once every 64 batches to fix get_time perf
This mitigates a large perf degradation when the clock source is HPET instead of TSC.
Just call get_time less frequently.

Fixes: 3ed141e9 - glthread: add a heuristic to stop locking global mutexes with multiple contexts
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8910

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24168>
2023-07-17 13:16:47 +00:00
Rhys Perry
d4b211bf1b ac/nir: always round cube array layers
It seems this is still necessary if conformant_trunc_coord=true.

Fixes various dEQP-VK.texture.shadow.cube_array.* and
dEQP-VK.glsl.texture_functions.texture*samplercubearray* failures with
conformant_trunc_coord.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: 23.2 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24137>
2023-07-17 12:17:22 +00:00
Rhys Perry
e02f8b62af radv: don't unset TRUNC_COORD if conformant_trunc_coord=true
This isn't necessary.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24137>
2023-07-17 12:17:21 +00:00
Rhys Perry
436df35c17 radv: add conformant_trunc_coord to cache UUID
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24137>
2023-07-17 12:17:21 +00:00
Rhys Perry
0cb26f31fe ac/llvm: skip ballot zext for 32-bit dest with wave32-as-wave64
NGG lowering can ballots with a 32-bit destination even if the ballot bit
size is 64.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24140>
2023-07-17 11:21:35 +00:00
Rhys Perry
47c9dea6ac ac/llvm: fix wave32 ac_build_mbcnt_add with 64-bit mask
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24140>
2023-07-17 11:21:35 +00:00
Rhys Perry
7a199a051e radv: fix radv_get_ballot_bit_size with CS
For wave64-as-wave32, this would return 32.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24140>
2023-07-17 11:21:34 +00:00
Rhys Perry
85d1159a2a ac/llvm: fix AC_TM_CHECK_IR
This was using the wrong pass.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 3f272fd15e ("ac/llvm: fix build with LLVM 17")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24140>
2023-07-17 11:21:34 +00:00
Lucas Stach
f7c74e35ee etnaviv: remove bogus comment about replacing resource storage
While we might want to employ this orphaning trick one day to avoid stalls
on busy resources it's certainly not as easy as the comment implies, as
this would involve changing all relocs in cached state objects referencing
the resource.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
4b17bab6b4 etnaviv: remove always true assert in etna_transfer_unmap
The level parameter is already checked in etna_transfer_map, so there
is no way that the unmap could end up violating the assert.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
ab1d4ac338 etnaviv: remove superfluous braces
etnaviv gernerally uses the style where no braces are used if the
statement inside a conditional clause fits on a single line. Remove
some superfluous braces to be more consistent.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
bee2a84657 etnaviv: move buffer range tracking into the PIPE_MAP_WRITE clause
Move the valid buffer range tracking next to all the other things we
do on write mapping.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
e1c00ce5c9 etnaviv: remove huge outdated comment
The comment makes it seem like we don't track resource status, which might
have been the case long ago, before the driver was even merged in upstream
Mesa, but is definitely no longer true. The kernel driver keeps track of
submitted work on BOs, the Mesa driver properly tracks unsubmitted usages
of any resource.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
6638ba513b etnaviv: reword comment about staging resource usage
The current wording isn't really accurate. It talks about depth surfaces,
while in reality any surface used by the PE can have TS allocated. Also
with compression the TS doesn't only track "holes" aka clear tiles, but
instead carries the compression tags.

Reword to hopefully match reality a bit better.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
f6222a4b92 etnaviv: check for valid TS as condition to create the staging resource
Presence of the TS buffer doesn't necessarily mean that there is valid
TS information that we need to take into account. This is pretty harmless
as the blit into the staging resource will just ignore invalid TS data
and most TS enabled resources are (super-)tiled anyways, which we will
handle with a staging resource nonetheless, but better not keep this bad
example around and replace with the appropriate check.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
78a999ecfa etnaviv: don't allocate full resource as transfer staging
The transfer only targets a specific level of a resource, so we don't
need to allocate all potential resource levels for the staging resource,
but instead shrink the allocation to a single level.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Lucas Stach
8c8741a17e etnaviv: split etna_copy_resource_box levels parameter in src/dst
Allow to copy between different level in the source and destination
resource.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24164>
2023-07-17 09:27:13 +00:00
Rohan Garg
07a9585898 iris: fix iris for WA 16013000631
iris needs to emit a PIPE_CONTROL_INSTRUCTION_INVALIDATE for the
aforementioned WA.

Fixes: 83716b08c ('iris: migrate WA 14013910100 to use the WA framework')
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24171>
2023-07-17 09:03:21 +00:00
Lionel Landwerlin
a303ff6684 isl: add a tool to query surface parameters
$ ./build/src/intel/isl/isl_query -p dg2 -w 128 -h 64 -l 4
Surface parameters:
  dim:                 2d
  dim_layout:          0
  msaa_layout:         0
  tiling:              64
  format:              R8G8B8A8_UNORM
  img_align_el:        128x128x1
  logical_level0_px:   128x64x1x1
  phys_level0_sa:      128x64x1x1
  levels:              4
  samples:             1x
  size_B:              131072
  alignment_B:         65536
  row_pitch_B:         512
  array_pitch_el_rows: 256
  tile_info:
    tiling:             64
    format_bpb:         32
    logical_extent_el:  128x128x1x1
    phys_extent_B:      512x128 = 65536

$./build/src/intel/isl/isl_query -p skl -w 128 -h 64 -l 4 -f R8G8B8_UINT
Surface parameters:
  dim:                 2d
  dim_layout:          0
  msaa_layout:         0
  tiling:              Y0
  format:              R8G8B8_UINT
  img_align_el:        16x4x1
  logical_level0_px:   128x64x1x1
  phys_level0_sa:      128x64x1x1
  levels:              4
  samples:             1x
  size_B:              36864
  alignment_B:         4096
  row_pitch_B:         384
  array_pitch_el_rows: 96
  tile_info:
    tiling:             Y0
    format_bpb:         8
    logical_extent_el:  128x32x1x1
    phys_extent_B:      128x32 = 4096

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24142>
2023-07-17 08:05:21 +00:00
David Heidelberg
dfd96fac41 ci/freedreno: add another a530 flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:24 +02:00
David Heidelberg
f952756d1e ci/freedreno: fix unexpectedpass flake on a630
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:24 +02:00
David Heidelberg
5b3cccaf63 ci/lima: EGL testing was disabled when fp16 fail was removed
fd4d0e1cc2 ("st/mesa: Set gl_config.floatMode based on color_format"),
fixed this functionality across multiple drivers, but EGL testing on
Mali was disabled back then, theofore it still fails here.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:24 +02:00
David Heidelberg
87439a8c71 ci/radeonsi: stoney arb_timer_query got fixed between kernel 6.3.1..13
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:23 +02:00
David Heidelberg
d3f26cbbe1 Revert "lima/ci: temporarily disable deqp-egl tests due to timeouts"
This reverts commit be2619766b.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:23 +02:00
David Heidelberg
c467d760cb ci/freedreno: add fails introduced by upreving to 6.3.13
Some of these fails/crashes was already present when trying 6.3.4,
two disappeared, one new crash appeared. Identical `.config`.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9247

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:23 +02:00
David Heidelberg
bd2b31a89c ci: update kernel to 6.3.13
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:23 +02:00
David Heidelberg
23158e9a3f ci: build kernel in gfx-ci/linux and just use binaries in Mesa3D CI
This bring visible speedup while preparing the rootfs and containers.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24079>
2023-07-16 02:11:23 +02:00
Alyssa Rosenzweig
9bcdc45ee7 nir: Devendor load_sample_mask
AGX will use this too for its MSAA lowerings.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24148>
2023-07-15 19:48:30 +00:00
Alyssa Rosenzweig
56d61d9a64 nir: Add fence_{pbe,mem}_to_tex(_pixel)_agx intrinsics
Read-after-write hazards require special handling on AGX, since image loads are
implemented with texturing. Add intrinsics to handle these hazards.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24148>
2023-07-15 19:48:30 +00:00
Faith Ekstrand
259ba104f7 nv50/ir: Support vector movs
nir_opt_mov and nir_op_vecN are only the same if the mov is only a
single component.  Otherwise the vec loop will try to access src[c]
where c > 0 which breaks for nir_op_mov.  It's uncommon but scalar
back-ends can see vector movs so we need to handle this correctly.

Fixes: 6513c675ad ("nv50/ir/nir: implement nir_alu_instr handling")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24167>
2023-07-15 15:53:40 +00:00
Semjon Kravtsenko
3982445728 glx: Assign unique serial number to GLXBadFBConfig error
Fixes: e89e1f5049 ("glx: Fix error handling yet again in CreateContextAttribs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9171
Tested-by: yan12125
Co-authored-by: XRevan86
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23762>
2023-07-15 03:27:17 +00:00
WinLinux1028
9590bce3e2 radeonsi: prefix function with si_ to prevent name collision
Fixed a build error caused by multiple gfx11_init_query symbols when building with iris and radeonsi specified in gallium-drivers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9238
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24045>
2023-07-14 22:37:05 +00:00
Sagar Ghuge
27d30fe3c0 isl: Disable MCS compression just on ACM platform
We're still seeing failures with render target reads of multisampled
images on Alchemist platforms, but Meteorlake doesn't appear to have
that issue. Enable MCS on Meteorlake.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22802>
2023-07-14 21:17:19 +00:00
Sagar Ghuge
efa6594536 intel/compiler: Look at 2 register worth of data instead of 4
Sampler always writes 4/8 register worth of data but for ld_mcs only
valid data is in first two register. So with 16-bit payload, we need to
split 2-32bit registers into 4-16-bit payload.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22802>
2023-07-14 21:17:19 +00:00
Rohan Garg
8b93fa149b iris: migrate WA 14016118574 to use the WA framework
Fixes: 58829d9f1 ("iris: implement Wa_14016118574")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24156>
2023-07-14 21:29:28 +02:00
Rohan Garg
83716b08cf iris: migrate WA 14013910100 to use the WA framework
Fixes: eeb3f4594d ("intel/xehp: Implement XeHP workaround Wa_14013910100.")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24156>
2023-07-14 21:29:27 +02:00
Thong Thai
e85a18a9af Update radeon_vcn_enc.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24151>
2023-07-14 17:46:03 +00:00
Thong Thai
64eab1f3ae radeonsi: enable vcn encoder rgb input support
v2: use luma pitch when chroma not available (Ruijing)

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24151>
2023-07-14 17:46:02 +00:00
Marek Olšák
043dcfad04 Revert "ac/nir/ngg: Follow intrinsic sources when analyzing before culling."
This reverts commit 411f69b9c5.

It broke tessellation in Unigine Heaven with radeonsi.

Fixes: 411f69b9c5 - ac/nir/ngg: Follow intrinsic sources when analyzing before culling.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24160>
2023-07-14 12:00:44 -04:00
David Rosca
d408ae88db radeonsi: Use DIV_ROUND_UP instead of ALIGN_POT
DIV_ROUND_UP is the correct replacement for ALIGN_TO.

Fixes: ba83c1e2
Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24127>
2023-07-14 14:38:20 +00:00
Lucas Stach
6d312c6160 etnaviv: optimize transfers when whole resource level is discarded
Now that all our age tracking is moved to etna_resource_level we can unlock
some more optimizations in the transfers by skipping copies or flushes when
the whole level is discarded.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
f8f0f1c5cb etnaviv: optimize render resource update
Now that we track the age at the resource level we can optimize
the render surface update by only copying the single level we are
going to render to.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
61e27debf5 etnaviv: keep blit destination tile status valid if possible
If the blit was just a resource flush on a uncompressed buffer we can
keep the tile status as valid, as in that case only clear tiles are filled
in the target buffer, but it doesn't hurt to look at the TS buffer when
fetching from this resource as the tile status matches the content of the
buffer. For compressed formats we can't do the same, as the compressed
tiles are uncompressed when flushing the resource, so the compression tags
don't match the buffer content anymore.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
dce4aa83e4 etnaviv: allow sampler TS even if the resource is flushed
As long as the TS is valid we can use the tile status to optimize the
sample fetch, even if the resource has been flushed for any reason.
Do the check for valid TS first when checking whether to enable sampler
TS to avoid all the other checks when TS isn't usable.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
fdedc0b3b3 etnaviv: optimize sampler source update
Now that we track age at the resource level we can optimize
the sampler source update by only copying/flushing the levels
that are actually used by the sampler.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
995e34840f etnaviv: add tile status buffer status into TS metadata
When the TS is shared all sharing instances must see the same status
information about the resource TS buffer. Add this information to the
shared TS metadata and make it take precedence over the internal
status tracking when the TS is shared.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
49d2f9f918 etnaviv: move TS meta into etna_resource_level
Handle imports/exports always deal with one specific level of
a resource, so the shared TS metadata should also be per level.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
97aec88c79 etnaviv: add helper to set TS validity
Wrap the setting of the resource level TS validity into a
helper function to allow the implementation to change later.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
0f2df7d361 etnaviv: add helper to get TS validity
Add a small helper to get the validity of the TS buffer for
a resource level. We can drop the ts_size check in several
places, as we never set ts_valid to true if there is no TS
buffer.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
f9af3b368a etnaviv: add helper to transfer resource level age to another
Add a small helper to transfer the age (seqno) from one resource level
to another.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
2d2d0e803d etnaviv: add helper to mark resource level as changed
Add a small helper to mark a resource level as changed so the
seqno handling is hidden.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
99daab8bf0 etnaviv: add helper to mark resource level as flushed
Add a small helper to mark a resource level as flushed so the
seqno handling is hidden.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
83a05447c5 etnaviv: optimize resource copies by skipping clean levels
If we sync/flush a full resource we can skip any level where the
target is of the same age as the source.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
87021531a3 etnaviv: flush destination before executing blit
A blit into a render target may destroy valid TS information, as the
destination TS isn't updated. Flush the blit destination when necessary
to make sure that all pending TS is resolved into the destination before
the blit is executed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
ff3741eee1 etnaviv: move resource seqnos to level
Resource maps, blits and surfaces all target a specific level of a
resource, so they can have different ages. Move the seqnos tracking
the age to etna_resource_level.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19964>
2023-07-14 14:21:35 +00:00
Lucas Stach
73c1eb50dc ci/etnaviv: update ci expectation
Etnaviv fails in the same way as Lima after the merge of
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23735

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24157>
2023-07-14 14:04:49 +00:00
Alyssa Rosenzweig
1e9f4b967a ir3: Convert to register intrinsics
Thanks to our SSA-based RA, we only use nir_register for arrays, and we only
access array registers with dedicated moves anyway. So there's no reason to need
any fancy coalescing... we can just switch to register access intrinsics and
translate them to moves exactly like we would've done when getting srcs/dests
before.

This addresses the ir3 portion of #9051.

No shader-db changes with a (significant subset of) Rob's shader-db. (Some
shaders are affected by this change but not in any way that shows up in the
stats.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24126>
2023-07-14 09:28:48 -04:00
Timur Kristóf
7ad9416c61 ac/llvm: Remove subgroup_id and num_subgroups intrinsics.
We expect that these will be lowered in NIR now.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
9fb9e54d69 aco: Remove subgroup_id and num_subgroups intrinsics.
These are lowered in NIR now.

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/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
2468874bf0 radeonsi: Use ac_nir_lower_intrinsics_to_args.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
7000cd8362 radeonsi: Move si_select_hw_stage to si_shader_info.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
9bade0205a radv: Use ac_nir_lower_intrinsics_to_args.
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/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
6551be9c6e radv: Move radv_select_hw_stage to radv_shader_info.
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/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
5825e20dbf ac/nir: Add new pass to lower intrinsics to shader args.
This is beneficial for intrinsics that do an algebraic
instruction such as bitfield extract on shader arguments,
because it allows NIR to be aware of these instructions and
optimize them together with other algebraic instructions in
the shader.

Currently, just handle subgroup_id and num_subgroups intrinsics.
More will be added here in the future.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
a7f2d821ec ac/nir: Simplify arg unpacking when shift is zero.
This is so we can just use the same function when it's zero.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24005>
2023-07-14 12:17:24 +00:00
Timur Kristóf
dc3bbd351a aco: Fix subgroup_id intrinsic on GFX10.3+.
Change this to match how it works in the LLVM backend.

Cc: mesa-stable
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/24005>
2023-07-14 12:17:24 +00:00
Karmjit Mahil
3798f99c46 pvr: Submit PR commands
This commit adds a partial render command to job submission.
For geom only jobs we must always submit a pr command in case we
enter SPM. For now, for geom+frag jobs, we'll also always submit
a pr command event.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24138>
2023-07-14 10:45:49 +00:00
Karmjit Mahil
3c9d1a6cfa pvr: Restructure rogue_kmd_stream.xml
Now things are structured in sections, like the other xml files.
And elements within a section are sorted alphabetically.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24138>
2023-07-14 10:45:49 +00:00
Karmjit Mahil
87e7f6abbe pvr: Remove some magic numbers and increments from km stream
- Update and add csbgen definitions to make the content of the
   geom and frag km stream more obvious.

 - Replace some of the hard coded constants with defines.

 - Adds some static assert to make the provenance of definitions
   more clear as well as making sure things fit properly.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24138>
2023-07-14 10:45:49 +00:00
Karmjit Mahil
f1e45f4bbd pvr: Use the SPM EOT on barrier stores
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24138>
2023-07-14 10:45:49 +00:00
Karmjit Mahil
ad0ca7a879 pvr: Compile SPM EOT shader
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24138>
2023-07-14 10:45:49 +00:00
Karmjit Mahil
bf5c529f97 pvr: Remove mrt setup from SPM EOT
Remove the mrt setup stuff since the EOT program only support
output registers for now. When implementing the tile buffer
support this change can be reverted, or things could be changed
to better fit with how the compiler wants things.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24138>
2023-07-14 10:45:49 +00:00
Marcin Ślusarz
36ff6c0004 intel/compiler: remove NV_mesh_shader support
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24071>
2023-07-14 08:27:14 +00:00
Marcin Ślusarz
87dd96bbbe anv: drop support for VK_NV_mesh_shader
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24071>
2023-07-14 08:27:14 +00:00
Marcin Ślusarz
ed72d6e2a7 hasvk: remove dead code & comments related to mesh shading
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24071>
2023-07-14 08:27:14 +00:00
Marcin Ślusarz
55e75d89e3 iris: avoid duplicating validation entries
If the *first* BO is not marked as "written", but the same BO is marked
as "written" later, then it will be added twice, because the first
instance will have index_for_handle equal to 0.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24108>
2023-07-14 07:58:51 +00:00
Frank Binns
b470d931dc pvr: skip setting up SPM consts buffer when no const shared regs are used
This is a temporary measure until the zeroed shaders are replaced with the real
ones. This avoids a VK_ERROR_OUT_OF_DEVICE_MEMORY error due to a zero sized
allocation.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Fixes: 1dfd535124 ("pvr: Setup SPM background object")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24139>
2023-07-14 07:37:16 +00:00
Alyssa Rosenzweig
5f5be9e4e1 ntt: Switch to new-style registers and modifiers
Use all the nir_legacy.h features to transition away from the deprecated
structures. shader-db is quite happy. I assume that's a mix of more aggressive
source mod usage and better coalescing (nir-to-tgsi doesn't copyprop).

   total instructions in shared programs: 900179 -> 887156 (-1.45%)
   instructions in affected programs: 562077 -> 549054 (-2.32%)
   helped: 5198
   HURT: 470
   Instructions are helped.

   total temps in shared programs: 91165 -> 91162 (<.01%)
   temps in affected programs: 398 -> 395 (-0.75%)
   helped: 21
   HURT: 18
   Inconclusive result (value mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24116>
2023-07-13 22:43:36 +00:00
Alyssa Rosenzweig
d54aa28b97 nir/legacy: Fix handling of fsat(fabs)
Consider code like:

    32x4  %2 = @load_interpolated_input (%1, %0 (0x0)) (base=0, component=0, dest_type=float32, io location=VARYING_SLOT_VAR0 slots=1 mediump)  // Color
    32x4  %3 = fabs %2
    32x4  %4 = fsat %3
    32x4  %5 = fsin %4

The existing logic would incorrectly tell the backend that both fabs and fsat
could be folded, and then half the shader disappears. Whoops. Fix by stopping
the folding in this case. I choose to do this check in the fsat rather than the
fabs because it's more straightforward (1 source vs N uses) but it's somewhat
arbitrary.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24116>
2023-07-13 22:43:36 +00:00
Alyssa Rosenzweig
34fcf6d479 nir/legacy: Fix fneg(load_reg) case
Consider the IR:

   %0 = load_reg
   %1 = fneg %0
   %2 = ffloor %1
   %3 = bcsel .., .., %1

Because the fneg has both foldable and non-foldable users, nir/legacy does not
fold the fneg into the load_reg. This ensures that the backend correctly emits a
dedicated fneg instruction (with the load_reg folded in) for the bcsel to use.
However, because the chasing helpers did not previously take other uses of a
modifier into account, the helpers would fuse in the fneg to the ffloor. Except
that doesn't work, because the load_reg instruction is supposed to be
eliminated. So we end up with broken chased IR:

   1 = fneg r0
   2 = ffloor -NULL
   3 = bcsel, ..., 1

The fix is easy: only fold modifiers into ALU instructions if the modifiers can
be folded away. If we can't eliminate the modifier instruction altogether, it's
not necessarily beneficial to fold it anyway from a register pressure
perspective. So this is probably ok. With that check in place we get correct IR

   1 = fneg r0
   2 = ffloor 1
   3 = bcsel, ..., 1

Fixes carchase/230.shader_test under softpipe.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24116>
2023-07-13 22:43:36 +00:00
Juston Li
2e23d8c885 zink: remove venus from renderpass optimizations
For venus, need to query the underlying driver.
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/9358

Remove venus for now as it is causing crashes on top of anv/radv.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24147>
2023-07-13 22:12:40 +00:00
Alyssa Rosenzweig
a608f5804c compiler: Remove blend enums duplicating util
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
3748d143a7 gallium: Remove pipe->compiler BLEND enum translation
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
f55efb4ae6 panfrost: Convert to PIPE_BLEND enums internally
This removes all the users of the compiler enums, and is a lot more natural now
that nir_lower_blend speaks PIPE_BLEND enums.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
a2d56c4c73 nir/lower_blend: Use util enums
This avoids the silly compiler versions. Some bits are slightly more
complicated, because they have to account for inverted enum values (rather than
a separate invert bit), but this is a LOT friendlier to drivers using the pass
and it makes the pass itself more readable.

The conversion functions in panfrost/panvk will go away momentarily.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
eb1112ae7a lvp: Use common blend/logicop translation
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
31001c6184 vulkan: Add helpers for blend enum translation
Vulkan drivers that use nir_lower_blend need to translate Vulkan enums to the
common (non-Vulkan) versions used in nir_lower_blend. We don't need to duplicate
that boilerplate in every VK driver that uses nir_lower_blend, move panvk's
versions to common code so we can use them in agxv. I suspect powervr wants this
too.

It might be useful to also share the logic to translate vk_color_blend_state
to nir_lower_blend_options wholesale, but panvk wouldn't use it and agxv is
downstream so it wouldn't have any in-tree users. So I'll keep that part
vendored (for now). For now, let's share the easy win of the enum translation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
521d596d27 util/blend: Add helpers for normalizing inverts
To avoid duplicating piles of cases.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
5764071f95 gallium,util: Move util_blend_dst_alpha_to_one
PanVK will use this too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
02868c9e77 gallium,util: Move blend enums to util/
For sharing across the tree.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Alyssa Rosenzweig
b0313d9f09 gallium/trace: Collect enums from multiple files
We're going to do some code motions out of p_state.h so the one file assumption
will fail. relax it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076>
2023-07-13 21:03:32 +00:00
Dylan Baker
cef578c5fc docs: truncate feature list for 23.3-devel
Which I forgot to do when branching for 23.2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24143>
2023-07-13 20:55:23 +00:00
Connor Abbott
7220deff90 afuc: Rework and significantly expand README.rst
This hasn't been updated since the a5xx days, and we've learned much
more since then. I've tried to expand it from a random collection of
notes to a more complete guide to explaining how to read the firmware
and understand the various tricks it uses to make code more compact.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24125>
2023-07-13 19:24:28 +00:00
Amber
426708796c turnip: Add debug option to allow non-conforming features.
This is because we still may want to be able to expose vulkan 1.3
on some devices that technically do not support it, for instance
the adreno 610 has everything required except multiview, which is
not essential for most games.

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Amber
576a4e85f0 freedreno: Add support for devices not supporting double thread size.
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Amber
0f57d7c0c3 ir3: handle non-uniform case for atomic image/ssbo intrinsics
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Amber
7373ab7f95 freedreno, turnip: set correct reg_size_vec4 for a6xx_gen1_low
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Amber
49ed69369e turnip: make sampler_minmax support configurable.
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Amber
f78bce1b59 turnip: Add support for devices not supporting double thread size.
On these devices the actual thread size for compute shaders seems to be
controlled by REG_A6XX_HLSQ_FS_CNTL_0 rather than the CS-related
register.

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Amber
9d2fd39f84 ir3: make wave_granularity configurable
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Danylo Piliaiev
e58f28f3da ir3: Make FS tex prefetch optimization optional
a610 and friends seem not to have tex prefetch.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Danylo Piliaiev
9ed32b386a turnip: Make multiview support configurable per generation
a610 and similar models don't have HW support for multiview,
proprietary driver unrolls the drall calls instead.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Danylo Piliaiev
3d299bc7ef freedreno: Add A605, A608, A610, A612 GPUs definition
While we tested a610, a605/a608 are added by observing traces being same
to a610.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Danylo Piliaiev
02ea3e4e10 freedreno,turnip: Make VS input attr/binding count configurable
a610 and similar models have fewer VS inputs available.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:37 +00:00
Danylo Piliaiev
4a43ab3019 freedreno,turnip: Make CS shared memory size configurable
a610 and similar models have less shared memory size.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:36 +00:00
Danylo Piliaiev
05fffc7b25 freedreno,turnip: Make number of VSC pipes configurable
a610/a608 has less pipes, so we need to make it configurable.

In particular we need to program all of the VSC_PIPE_CONFIG_REG[n]
rather than leaving garbage values for the unused pipes.  Pointing
multiple VSC pipes at the same bin makes the hw angry.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:36 +00:00
Konrad Dybcio
0814c2c7a6 freedreno: Set magic writes per-GPU, using existing data
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:36 +00:00
Danylo Piliaiev
c8ce3e5096 freedreno, turnip: Clarify some RB_CCU_CNTL fields
There is no .gmem field, there is a ccu color cache size field
which tells the size as a fraction of depth cache used in direct
rendering.

There is also GMEM_FAST_CLEAR_DISABLE flag which is set on a608/a610.

Since these values will stop being the same between models,
make them configurable.

Credits to Connor Abbott for deciphering color cache size meaning.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20991>
2023-07-13 18:06:36 +00:00
Lionel Landwerlin
67a8b70c57 anv: hide exec_flags selection inside the i915 backend
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24073>
2023-07-13 17:12:26 +00:00
Sil Vilerino
f6dddcef79 util: Blake3 - Identify arm64ec as aarch64 instead of x64
ARM64EC is a new build target for Windows ARM64 devices for x64 support.
Currently that build flavor fails due to attempting to use x64 intrinsics.
This commit fixes it by changing the auto-detection to be aarch64
instead of x64 for arm64ec.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24119>
2023-07-13 15:30:39 +00:00
Filip Gawin
6e87b277bd crocus: Avoid fast-clear with incompatible view
Port of code from iris.
Original author: Nanley Chery

Helps with fast_color_clear@fcc-write-after-clear

Cc: mesa-stable

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24135>
2023-07-13 15:02:38 +00:00
Danylo Piliaiev
4fa02c5c8e freedreno/cffdec: Decode CP_DRAW_AUTO
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24074>
2023-07-13 12:44:45 +00:00
Pavel Ondračka
0a2a7bfd19 r300: update RV370 failures
This was missed in 0bf6dcb785
There is a loop which iterates over a temp array. NIR optimization
moves the real work out of the loop and what remains are just ALU ops
with undefs. So after converting undefs to zero, the ALU ops are
optimized out and DCE kills the loop. This is a good thing in
general and we don't fail the linking due to the loop presence.

However than we hit the shader constants and ALU limits later :-(
So from dEQP POW we go from NotSupported to Fail.

Fixes: 0bf6dcb785
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24134>
2023-07-13 12:22:22 +00:00
Frank Binns
953c04ebd3 pvr: clang-format fixes
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24070>
2023-07-13 10:23:32 +00:00
Jordan Justen
39f547381c isl: Set MOCS to uncached for MTL stream-out
Without this change various OpenGL CTS tranform feedback tests were
failing.

Cc: 23.2 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23823>
2023-07-13 00:32:13 -07:00
Jordan Justen
fa47c82fbe isl/dev: Add uncached MOCS value
Rework:
 * Jordan: Add uncached for all platforms (Requested by Francisco)
 * Jordan: Use gen7 & gen8 values suggested by Francisco
 * Jordan: Fix IVB and CHV MOCS mistakes pointed out by Francisco

Cc: 23.2 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23823>
2023-07-13 00:32:13 -07:00
Jordan Justen
ef105f8cce genxml/chv: Add MEMORY_OBJECT_CONTROL_STATE_CHV to document compared to BDW
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23823>
2023-07-13 00:32:09 -07:00
Jordan Justen
90535d7aef genxml/hsw: Add additional MOCS field enumerations
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23823>
2023-07-13 00:32:05 -07:00
Jordan Justen
492b07625d anv,iris,hasvk: Use ISL_SURF_USAGE_STREAM_OUT_BIT for setting stream-out MOCS
Cc: 23.2 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23823>
2023-07-12 23:47:25 -07:00
Jordan Justen
6b5082f5d5 isl: Add ISL_SURF_USAGE_STREAM_OUT_BIT
Cc: 23.2 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23823>
2023-07-12 23:47:03 -07:00
Helen Koike
0dc961645c docs/ci: Add docs for EXTRA_LOCAL_PACKAGES
Add a section about reusing the CI scripts for other projects.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23894>
2023-07-13 01:06:29 +00:00
Helen Koike
a3d10300b0 ci: add EXTRA_LOCAL_PACKAGES to apt-get install
This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23894>
2023-07-13 01:06:29 +00:00
Helen Koike
afaefb20f3 ci: re-add EXTRA_LOCAL_PACKAGES to rootfs
This variable was removed on commit
848f59deda when file `create-rootfs.sh`
was splitted.
Re-add it.

This can make it more convenient for other projects to reuse these
scripts.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23894>
2023-07-13 01:06:29 +00:00
David Heidelberg
29de652060 ci/freedreno: update a530 flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24132>
2023-07-13 02:23:16 +02:00
Dylan Baker
6b64c27a97 docs: Update release calendar for 23.2.0-rc1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24131>
2023-07-12 23:08:06 +00:00
Faith Ekstrand
c136a22b60 nv50/ir: Convert to new-style NIR registers
Shader-db results on Turing:

    total inst in shared programs : 11121531 -> 11121458 (-0.00%)
    total gpr in shared programs : 1848287 -> 1848425 (0.01%)
    total ugpr in shared programs : 0 -> 0 (0.00%)
    total local in shared programs : 27200 -> 27200 (0.00%)
    total shared in shared programs : 236476 -> 236476 (0.00%)
    total bytes in shared programs : 177944496 -> 177943328 (-0.00%)
    total cached in shared programs : 0 -> 0 (0.00%)

               inst      gpr     ugpr    local   shared    bytes   cached
    helped      470       50        0        0        0      470        0
      hurt      327      197        0        0        0      327        0

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24110>
2023-07-12 22:49:27 +00:00
Yiwei Zhang
a151d26513 venus: refactor query feedback cmd record
Now copy and reset are similar enough to unify.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24130>
2023-07-12 22:32:45 +00:00
Yiwei Zhang
ed79b30639 venus: add a missing barrier before copying query feedback
The 1st sync scope of vkCmdCopyQueryPoolResults is not sufficient to
cover transfer writes against query feedback buffer. We must ensure
ordering against prior query reset cmd where the feedback buffer fill
gets injected.

Fixes: de4593faa1 ("venus: add query pool feedback cmds")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24130>
2023-07-12 22:32:45 +00:00
Mohamed Ahmed
c4c258e19e vulkan/util: Use ycbcr_info for multiplane helpers in vk_format.c
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24096>
2023-07-12 21:39:41 +00:00
Mohamed Ahmed
d5b6edec0f vulkan/util: Support VK_EXT_ycbcr_2plane_444_formats color formats in vk_format.c
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24096>
2023-07-12 21:39:41 +00:00
Mohamed Ahmed
c263e5307f vulkan/util: Support 10-bit and 12-bit color formats in ycbcr_info in vk_format.c
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24096>
2023-07-12 21:39:41 +00:00
Yiwei Zhang
7b44880e3e venus: ensure consistency of query overflow behavior
Fixes: e6cffa1f0e ("venus: use feedback for vkGetQueryPoolResults")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24123>
2023-07-12 21:18:06 +00:00
Yiwei Zhang
c55d43df04 venus: handle query feedback creation failure
Fixes: e6cffa1f0e ("venus: use feedback for vkGetQueryPoolResults")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24123>
2023-07-12 21:18:06 +00:00
Friedrich Vock
d810d67a8c radv/ci: Set DRIVER_NAME in LAVA raven vkcts jobs
Some CTS tests work with RADV, but take a very long time, making
deqp-runner trigger timeout failures. These tests are supposed to be
skipped, so they're contained in radv-skips.txt. But without setting
DRIVER_NAME to "radv", deqp-runner.sh won't pick up that file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24095>
2023-07-12 20:30:51 +00:00
Eric Engestrom
bdaee9e09d ci: avoid running hardware jobs if lint fails - now on Windows too!
I missed this in !23774.

Fixes: a1c1cce9df ("ci: avoid running hardware jobs if there are already trivial issues")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24121>
2023-07-12 19:31:01 +00:00
Eric Engestrom
fd35e59139 ci: avoid running hardware jobs if lint fails - now on LAVA too!
I missed this in !23774.

Fixes: a1c1cce9df ("ci: avoid running hardware jobs if there are already trivial issues")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24121>
2023-07-12 19:31:01 +00:00
Alyssa Rosenzweig
ef80f81c8f zink: Switch to register intrinsics
SPIR-V does not have anything like nir_register natively, so we were already
inserting loads/stores for register sources/destinations. That means it's easy
to switch to register intrinsics, getting explicit load_reg/store_reg intrinsics
in the NIR and translating those to the SPIR-V load/stores, dropping the
handling for nir_register. There's no need to use any of the chasing helpers for
coalescing the load/stores, like a hardware backend would. (In
fact, the underlying Vulkan driver will probably turn this back into SSA.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24111>
2023-07-12 19:05:09 +00:00
Dylan Baker
fac4f526ac VERSION: bump to 23.3.0-devel
For further development

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24124>
2023-07-12 11:13:17 -07:00
3954 changed files with 487749 additions and 230148 deletions

0
.ci-farms/ondracka Normal file
View File

View File

@@ -1,8 +1,8 @@
# The following files are opted into `ninja clang-format` and
# enforcement in the CI.
src/**/asahi/**/*
src/**/panfrost/**/*
src/gallium/drivers/i915
src/amd/vulkan/**/*
src/amd/compiler/**/*
src/egl/**/*
src/etnaviv/isa/**/*

View File

@@ -1,4 +1,6 @@
# List of commits to ignore when using `git blame`.
# Enable with:
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# Per git-blame(1):
# Ignore revisions listed in the file, one unabbreviated object name
@@ -45,3 +47,21 @@ c7bf3b69ebc8f2252dbf724a4de638e6bb2ac402
# egl: re-format using clang-format
2f670d89db038d5a29f6b72732fd7ad63dfaf4c6
# panfrost: clang-format the tree
0afd691f29683f6e9dde60f79eca094373521806
# aco: Format.
1e2639026fec7069806449f9ba2a124ce4eb5569
# radv: Format.
59c501ca353f8ec9d2717c98af2bfa1a1dbf4d75
# pvr: clang-format fixes
953c04ebd39c52d457301bdd8ac803949001da2d
# freedreno: Re-indent
2d439343ea1aee146d4ce32800992cd389bd505d
# ir3: Reformat source with clang-format
177138d8cb0b4f6a42ef0a1f8593e14d79f17c54

1
.gitattributes vendored
View File

@@ -4,3 +4,4 @@
*.png binary
*.gif binary
*.ico binary
*.cl gitlab-language=c

View File

@@ -1,21 +1,67 @@
# Types of CI pipelines:
# | pipeline name | context | description |
# |----------------------|-----------|-------------------------------------------------------------|
# | merge pipeline | mesa/mesa | pipeline running for an MR; if it passes the MR gets merged |
# | pre-merge pipeline | mesa/mesa | same as above, except its status doesn't affect the MR |
# | post-merge pipeline | mesa/mesa | pipeline immediately after merging |
# | fork pipeline | fork | pipeline running in a user fork |
# | scheduled pipeline | mesa/mesa | nightly pipelines, running every morning at 4am UTC |
# | direct-push pipeline | mesa/mesa | when commits are pushed directly to mesa/mesa, bypassing Marge and its gating pipeline |
#
# Note that the release branches maintained by the release manager fall under
# the "direct push" category.
#
# "context" indicates the permissions that the jobs get; notably, any
# container created in mesa/mesa gets pushed immediately for everyone to use
# as soon as the image tag change is merged.
#
# Merge pipelines contain all jobs that must pass before the MR can be merged.
# Pre-merge pipelines contain the exact same jobs as merge pipelines.
# Post-merge pipelines contain *only* the `pages` job that deploys the new
# version of the website.
# Fork pipelines contain everything.
# Scheduled pipelines only contain the container+build jobs, and some extra
# test jobs (typically "full" variants of pre-merge jobs that only run 1/X
# test cases), but not a repeat of the merge pipeline jobs.
# Direct-push pipelines contain the same jobs as merge pipelines.
workflow:
rules:
# do not duplicate pipelines on merge pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
# merge pipeline
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
- if: &is-merge-attempt $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
variables:
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
MESA_CI_PERFORMANCE_ENABLED: 1
VALVE_INFRA_VANGOGH_JOB_PRIORITY: "" # Empty tags are ignored by gitlab
# post-merge pipeline
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
- if: &is-post-merge $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "push"
# nightly pipeline
- if: &is-scheduled-pipeline $CI_PIPELINE_SOURCE == "schedule"
variables:
LAVA_JOB_PRIORITY: 40
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
JOB_PRIORITY: 50
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
# any other pipeline
- if: $GITLAB_USER_LOGIN != "marge-bot"
# pipeline for direct pushes that bypassed the CI
- if: &is-direct-push $CI_PROJECT_NAMESPACE == "mesa" && $CI_PIPELINE_SOURCE == "push" && $GITLAB_USER_LOGIN != "marge-bot"
variables:
LAVA_JOB_PRIORITY: 50
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
JOB_PRIORITY: 40
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
- when: always
# pre-merge or fork pipeline
- if: $FORCE_KERNEL_TAG != null
variables:
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${FORCE_KERNEL_TAG}
JOB_PRIORITY: 50
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
- if: $FORCE_KERNEL_TAG == null
variables:
KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/${KERNEL_REPO}/${KERNEL_TAG}
JOB_PRIORITY: 50
VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
variables:
FDO_UPSTREAM_REPO: mesa/mesa
@@ -38,6 +84,9 @@ variables:
# Disable farm with `git mv .ci-farms{,-disabled}/$farm_name`
# Re-enable farm with `git mv .ci-farms{-disabled,}/$farm_name`
# NEVER MIX FARM MAINTENANCE WITH ANY OTHER CHANGE IN THE SAME MERGE REQUEST!
ARTIFACTS_BASE_URL: https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts
# Python scripts for structured logger
PYTHONPATH: "$PYTHONPATH:$CI_PROJECT_DIR/install"
default:
before_script:
@@ -49,6 +98,9 @@ default:
unset CI_JOB_JWT # Unsetting vulnerable env variables
after_script:
# Work around https://gitlab.com/gitlab-org/gitlab/-/issues/20338
- find -name '*.log' -exec mv {} {}.txt \;
- >
set +x
@@ -71,6 +123,24 @@ default:
- data_integrity_failure
- unknown_failure
stages:
- sanity
- container
- git-archive
- build-x86_64
- build-misc
- code-validation
- amd
- intel
- nouveau
- arm
- broadcom
- freedreno
- etnaviv
- software-renderer
- layered-backends
- deploy
include:
- project: 'freedesktop/ci-templates'
ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
@@ -97,6 +167,7 @@ include:
- local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
- local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
- local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
- local: 'src/gallium/drivers/r300/ci/gitlab-ci.yml'
- local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
- local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
- local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
@@ -109,66 +180,70 @@ include:
- local: 'src/panfrost/ci/gitlab-ci.yml'
- local: 'src/virtio/ci/gitlab-ci.yml'
stages:
- sanity
- container
- git-archive
- build-x86_64
- build-misc
- lint
- amd
- intel
- nouveau
- arm
- broadcom
- freedreno
- etnaviv
- software-renderer
- layered-backends
- deploy
# YAML anchors for rule conditions
# --------------------------------
.rules-anchors:
rules:
# Post-merge pipeline
- if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
when: on_success
# Post-merge pipeline, not for Marge Bot
- if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
when: on_success
# Pre-merge pipeline
- if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
# Pre-merge pipeline for Marge Bot
- if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
# Pre-merge pipeline
- &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
# When to automatically run the CI for build jobs
.build-rules:
.never-post-merge-rules:
rules:
# If any files affecting the pipeline are changed, build/test jobs run
# automatically once all dependency jobs have passed
- changes: &all_paths
- VERSION
- bin/git_sha1_gen.py
- bin/install_megadrivers.py
- bin/symbols-check.py
# GitLab CI
- .gitlab-ci.yml
- .gitlab-ci/**/*
# Meson
- meson*
- build-support/**/*
- subprojects/**/*
# Source code
- include/**/*
- src/**/*
- .ci-farms/*
- if: *is-post-merge
when: never
.container+build-rules:
rules:
# Run when re-enabling a disabled farm, but not when disabling it
- !reference [.disable-farm-mr-rules, rules]
# Never run immediately after merging, as we just ran everything
- !reference [.never-post-merge-rules, rules]
# Build everything in merge pipelines, if any files affecting the pipeline
# were changed
- if: *is-merge-attempt
changes: &all_paths
- VERSION
- bin/git_sha1_gen.py
- bin/install_megadrivers.py
- bin/symbols-check.py
# GitLab CI
- .gitlab-ci.yml
- .gitlab-ci/**/*
- .ci-farms/*
# Meson
- meson*
- build-support/**/*
- subprojects/**/*
# clang format
- .clang-format
- .clang-format-include
- .clang-format-ignore
# Source code
- include/**/*
- src/**/*
when: on_success
# Otherwise, build/test jobs won't run because no rule matched.
# Same as above, but for pre-merge pipelines
- if: *is-pre-merge
changes:
*all_paths
when: manual
# Skip everything for pre-merge and merge pipelines which don't change
# anything in the build
- if: *is-merge-attempt
when: never
- if: *is-pre-merge
when: never
# Build everything after someone bypassed the CI
- if: *is-direct-push
when: on_success
# Build everything in scheduled pipelines
- if: *is-scheduled-pipeline
when: on_success
# Allow building everything in fork pipelines, but build nothing unless
# manually triggered
- when: manual
.ci-deqp-artifacts:
@@ -183,34 +258,6 @@ stages:
- _build/meson-logs/*.txt
- _build/meson-logs/strace
.container-rules:
rules:
# Run pipeline by default in the main project if any CI pipeline
# configuration files were changed, to ensure docker images are up to date
- if: *is-post-merge
changes:
- .gitlab-ci.yml
- .gitlab-ci/**/*
when: on_success
# Run pipeline by default if it was triggered by Marge Bot, is for a
# merge request, and any files affecting the pipeline were changed
- if: *is-pre-merge-for-marge
changes:
*all_paths
when: on_success
# Run pipeline by default in the main project if it was not triggered by
# Marge Bot, and any files affecting the pipeline were changed
- if: *is-post-merge-not-for-marge
changes:
*all_paths
when: on_success
# Allow triggering jobs manually in other cases if any files affecting the
# pipeline were changed
- changes:
*all_paths
when: manual
# Otherwise, container jobs won't run because no rule matched.
# Git archive
make git archive:
@@ -241,7 +288,7 @@ sanity:
rules:
- if: *is-pre-merge
when: on_success
# Other cases default to never
- when: never
variables:
GIT_STRATEGY: none
script:
@@ -251,6 +298,8 @@ sanity:
when: on_failure
reports:
junit: check-*.xml
tags:
- placeholder-job
# Jobs that need to pass before spending hardware resources on further testing

View File

@@ -2,6 +2,13 @@
# non-zero-length and not starting with '#', will regex match to
# delete lines from the test list. Be careful.
# This test checks the driver's reported conformance version against the
# version of the CTS we're running. This check fails every few months
# and everyone has to go and bump the number in every driver.
# Running this check only makes sense while preparing a conformance
# submission, so skip it in the regular CI.
dEQP-VK.api.driver_properties.conformance_version
# These are tremendously slow (pushing toward a minute), and aren't
# reliable to be run in parallel with other tests due to CPU-side timing.
dEQP-GLES[0-9]*.functional.flush_finish.*
@@ -29,6 +36,44 @@ spec@!opengl 1.1@windowoverlap
# Note that "glx-" tests don't appear in x11-skips.txt because they can be
# run even if PIGLIT_PLATFORM=gbm (for example)
glx@glx-copy-sub-buffer.*
# Reads the front buffer but it doesn't have to.
# https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/755
glx-swap-copy
# A majority of the tests introduced in CTS 1.3.7.0 are experiencing failures and flakes.
# Disable these tests until someone with a more deeper understanding of EGL examines them.
#
# Note: on sc8280xp/a690 I get identical results (same passes and fails)
# between freedreno, zink, and llvmpipe, so I believe this is either a
# deqp bug or egl/wayland bug, rather than driver issue.
#
# With llvmpipe, the failing tests have the error message:
#
# "Illegal sampler view creation without bind flag"
#
# which might be a hint. (But some passing tests also have the same
# error message.)
#
# more context from David Heidelberg on IRC: the deqp commit where these
# started failing is: https://github.com/KhronosGroup/VK-GL-CTS/commit/79b25659bcbced0cfc2c3fe318951c585f682abe
# prior to that they were skipping.
wayland-dEQP-EGL.functional.color_clears.single_context.gles1.other
wayland-dEQP-EGL.functional.color_clears.single_context.gles2.other
wayland-dEQP-EGL.functional.color_clears.single_context.gles3.other
wayland-dEQP-EGL.functional.color_clears.multi_context.gles1.other
wayland-dEQP-EGL.functional.color_clears.multi_context.gles2.other
wayland-dEQP-EGL.functional.color_clears.multi_context.gles3.other
wayland-dEQP-EGL.functional.color_clears.multi_context.gles1_gles2.other
wayland-dEQP-EGL.functional.color_clears.multi_context.gles1_gles2_gles3.other
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles1.other
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles2.other
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles3.other
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles1_gles2.other
wayland-dEQP-EGL.functional.color_clears.multi_thread.gles1_gles2_gles3.other
# Seems to be the same is as wayland-dEQP-EGL.functional.color_clears.*
wayland-dEQP-EGL.functional.render.single_context.gles2.other
wayland-dEQP-EGL.functional.render.single_context.gles3.other
wayland-dEQP-EGL.functional.render.multi_context.gles2.other
wayland-dEQP-EGL.functional.render.multi_context.gles3.other
wayland-dEQP-EGL.functional.render.multi_context.gles2_gles3.other
wayland-dEQP-EGL.functional.render.multi_thread.gles2.other
wayland-dEQP-EGL.functional.render.multi_thread.gles3.other
wayland-dEQP-EGL.functional.render.multi_thread.gles2_gles3.other

View File

@@ -2,12 +2,7 @@ version: 1
# Rules to match for a machine to qualify
target:
{% if tags %}
tags:
{% for tag in tags %}
- '{{ tag | trim }}'
{% endfor %}
{% endif %}
id: '{{ ci_runner_id }}'
timeouts:
first_console_activity: # This limits the time it can take to receive the first console log
@@ -50,8 +45,8 @@ deployment:
SALAD.machine_id={{ '{{' }} machine_id }}
console={{ '{{' }} local_tty_device }},115200 earlyprintk=vga,keep
loglevel={{ log_level }} no_hash_pointers
b2c.service="--privileged --tls-verify=false --pid=host docker://{{ '{{' }} fdo_proxy_registry }}/mupuf/valve-infra/telegraf-container:latest" b2c.hostname=dut-{{ '{{' }} machine.full_name }}
b2c.container="-ti --tls-verify=false docker://{{ '{{' }} fdo_proxy_registry }}/mupuf/valve-infra/machine_registration:latest check"
b2c.service="--privileged --tls-verify=false --pid=host docker://{{ '{{' }} fdo_proxy_registry }}/gfx-ci/ci-tron/telegraf:latest" b2c.hostname=dut-{{ '{{' }} machine.full_name }}
b2c.container="-ti --tls-verify=false docker://{{ '{{' }} fdo_proxy_registry }}/gfx-ci/ci-tron/machine-registration:latest check"
b2c.ntp_peer=10.42.0.1 b2c.pipefail b2c.cache_device=auto b2c.poweroff_delay={{ poweroff_delay }}
b2c.minio="gateway,{{ '{{' }} minio_url }},{{ '{{' }} job_bucket_access_key }},{{ '{{' }} job_bucket_secret_key }}"
b2c.volume="{{ '{{' }} job_bucket }}-results,mirror=gateway/{{ '{{' }} job_bucket }},pull_on=pipeline_start,push_on=changes,overwrite{% for excl in job_volume_exclusions %},exclude={{ excl }}{% endfor %},remove,expiration=pipeline_end,preserve"
@@ -59,8 +54,8 @@ deployment:
b2c.volume={{ volume }}
{% endfor %}
b2c.container="-v {{ '{{' }} job_bucket }}-results:{{ working_dir }} -w {{ working_dir }} {% for mount_volume in mount_volumes %} -v {{ mount_volume }}{% endfor %} --tls-verify=false docker://{{ local_container }} {{ container_cmd }}"
{% if cmdline_extras is defined %}
{{ cmdline_extras }}
{% if kernel_cmdline_extras is defined %}
{{ kernel_cmdline_extras }}
{% endif %}
initramfs:

View File

@@ -22,86 +22,34 @@
# IN THE SOFTWARE.
from jinja2 import Environment, FileSystemLoader
from argparse import ArgumentParser
from os import environ, path
import json
parser = ArgumentParser()
parser.add_argument('--ci-job-id')
parser.add_argument('--container-cmd')
parser.add_argument('--initramfs-url')
parser.add_argument('--job-success-regex')
parser.add_argument('--job-warn-regex')
parser.add_argument('--kernel-url')
parser.add_argument('--log-level', type=int)
parser.add_argument('--poweroff-delay', type=int)
parser.add_argument('--session-end-regex')
parser.add_argument('--session-reboot-regex')
parser.add_argument('--tags', nargs='?', default='')
parser.add_argument('--template', default='b2c.yml.jinja2.jinja2')
parser.add_argument('--timeout-boot-minutes', type=int)
parser.add_argument('--timeout-boot-retries', type=int)
parser.add_argument('--timeout-first-minutes', type=int)
parser.add_argument('--timeout-first-retries', type=int)
parser.add_argument('--timeout-minutes', type=int)
parser.add_argument('--timeout-overall-minutes', type=int)
parser.add_argument('--timeout-retries', type=int)
parser.add_argument('--job-volume-exclusions', nargs='?', default='')
parser.add_argument('--volume', action='append')
parser.add_argument('--mount-volume', action='append')
parser.add_argument('--local-container', default=environ.get('B2C_LOCAL_CONTAINER', 'alpine:latest'))
parser.add_argument('--working-dir')
args = parser.parse_args()
# Pass all the environment variables prefixed by B2C_
values = {
key.removeprefix("B2C_").lower(): environ[key]
for key in environ if key.startswith("B2C_")
}
env = Environment(loader=FileSystemLoader(path.dirname(args.template)),
env = Environment(loader=FileSystemLoader(path.dirname(values['job_template'])),
trim_blocks=True, lstrip_blocks=True)
template = env.get_template(path.basename(args.template))
template = env.get_template(path.basename(values['job_template']))
values = {}
values['ci_job_id'] = args.ci_job_id
values['container_cmd'] = args.container_cmd
values['initramfs_url'] = args.initramfs_url
values['job_success_regex'] = args.job_success_regex
values['job_warn_regex'] = args.job_warn_regex
values['kernel_url'] = args.kernel_url
values['log_level'] = args.log_level
values['poweroff_delay'] = args.poweroff_delay
values['session_end_regex'] = args.session_end_regex
values['session_reboot_regex'] = args.session_reboot_regex
try:
values['tags'] = json.loads(args.tags)
except json.decoder.JSONDecodeError:
values['tags'] = args.tags.split(",")
values['template'] = args.template
values['timeout_boot_minutes'] = args.timeout_boot_minutes
values['timeout_boot_retries'] = args.timeout_boot_retries
values['timeout_first_minutes'] = args.timeout_first_minutes
values['timeout_first_retries'] = args.timeout_first_retries
values['timeout_minutes'] = args.timeout_minutes
values['timeout_overall_minutes'] = args.timeout_overall_minutes
values['timeout_retries'] = args.timeout_retries
if len(args.job_volume_exclusions) > 0:
exclusions = args.job_volume_exclusions.split(",")
values['job_volume_exclusions'] = [excl for excl in exclusions if len(excl) > 0]
if args.volume is not None:
values['volumes'] = args.volume
if args.mount_volume is not None:
values['mount_volumes'] = args.mount_volume
values['working_dir'] = args.working_dir
assert(len(args.local_container) > 0)
values['ci_job_id'] = environ['CI_JOB_ID']
values['ci_runner_id'] = environ['CI_RUNNER_ID']
values['job_volume_exclusions'] = [excl for excl in values['job_volume_exclusions'].split(",") if excl]
values['working_dir'] = environ['CI_PROJECT_DIR']
# Use the gateway's pull-through registry caches to reduce load on fd.o.
values['local_container'] = args.local_container
for url, replacement in [('registry.freedesktop.org', '{{ fdo_proxy_registry }}'),
('harbor.freedesktop.org', '{{ harbor_fdo_registry }}')]:
values['local_container'] = values['local_container'].replace(url, replacement)
values['local_container'] = environ['IMAGE_UNDER_TEST']
values['local_container'] = values['local_container'].replace(
'registry.freedesktop.org',
'{{ fdo_proxy_registry }}'
)
if 'B2C_KERNEL_CMDLINE_EXTRAS' in environ:
values['cmdline_extras'] = environ['B2C_KERNEL_CMDLINE_EXTRAS']
if 'kernel_cmdline_extras' not in values:
values['kernel_cmdline_extras'] = ''
f = open(path.splitext(path.basename(args.template))[0], "w")
f.write(template.render(values))
f.close()
with open(path.splitext(path.basename(values['job_template']))[0], "w") as f:
f.write(template.render(values))

View File

@@ -9,6 +9,7 @@
# We're run from the root of the repo, make a helper var for our paths
BM=$CI_PROJECT_DIR/install/bare-metal
CI_COMMON=$CI_PROJECT_DIR/install/common
CI_INSTALL=$CI_PROJECT_DIR/install
# Runner config checks
if [ -z "$BM_SERIAL" ]; then
@@ -83,24 +84,41 @@ mkdir -p /nfs/results
rm -rf /tftp/*
if echo "$BM_KERNEL" | grep -q http; then
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
$BM_KERNEL -o /tftp/vmlinuz
elif [ -n "${FORCE_KERNEL_TAG}" ]; then
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_KERNEL}" -o /tftp/vmlinuz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst" -o modules.tar.zst
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C "/nfs/"
rm modules.tar.zst &
else
cp $BM_KERNEL /tftp/vmlinuz
cp /baremetal-files/"$BM_KERNEL" /tftp/vmlinuz
fi
echo "$BM_CMDLINE" > /tftp/cmdline
set +e
STRUCTURED_LOG_FILE=job_detail.json
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update dut_job_type "${DEVICE_TYPE}"
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update farm "${FARM}"
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --create-dut-job dut_name "${CI_RUNNER_DESCRIPTION}"
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit "${CI_JOB_STARTED_AT}"
python3 $BM/cros_servo_run.py \
--cpu $BM_SERIAL \
--ec $BM_SERIAL_EC \
--test-timeout ${TEST_PHASE_TIMEOUT:-20}
ret=$?
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close
set -e
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
# will look for them.
cp -Rp /nfs/results/. results/
if [ -f "${STRUCTURED_LOG_FILE}" ]; then
cp -p ${STRUCTURED_LOG_FILE} results/
echo "Structured log file is available at https://${CI_PROJECT_ROOT_NAMESPACE}.pages.freedesktop.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts/results/${STRUCTURED_LOG_FILE}"
fi
exit $ret

View File

@@ -1,37 +1,18 @@
#!/usr/bin/env python3
#
# Copyright © 2020 Google LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# SPDX-License-Identifier: MIT
import argparse
import queue
import re
from serial_buffer import SerialBuffer
import sys
import threading
from custom_logger import CustomLogger
from serial_buffer import SerialBuffer
class CrosServoRun:
def __init__(self, cpu, ec, test_timeout):
def __init__(self, cpu, ec, test_timeout, logger):
self.cpu_ser = SerialBuffer(
cpu, "results/serial.txt", "R SERIAL-CPU> ")
# Merge the EC serial into the cpu_ser's line stream so that we can
@@ -39,6 +20,7 @@ class CrosServoRun:
self.ec_ser = SerialBuffer(
ec, "results/serial-ec.txt", "R SERIAL-EC> ", line_queue=self.cpu_ser.line_queue)
self.test_timeout = test_timeout
self.logger = logger
def close(self):
self.ec_ser.close()
@@ -56,6 +38,7 @@ class CrosServoRun:
RED = '\033[0;31m'
NO_COLOR = '\033[0m'
print(RED + message + NO_COLOR)
self.logger.update_status_fail(message)
def run(self):
# Flush any partial commands in the EC's prompt, then ask for a reboot.
@@ -63,6 +46,8 @@ class CrosServoRun:
self.ec_write("reboot\n")
bootloader_done = False
self.logger.create_job_phase("boot")
tftp_failures = 0
# This is emitted right when the bootloader pauses to check for input.
# Emit a ^N character to request network boot, because we don't have a
# direct-to-netboot firmware on cheza.
@@ -72,6 +57,17 @@ class CrosServoRun:
bootloader_done = True
break
# The Cheza firmware seems to occasionally get stuck looping in
# this error state during TFTP booting, possibly based on amount of
# network traffic around it, but it'll usually recover after a
# reboot. Currently mostly visible on google-freedreno-cheza-14.
if re.search("R8152: Bulk read error 0xffffffbf", line):
tftp_failures += 1
if tftp_failures >= 10:
self.print_error(
"Detected intermittent tftp failure, restarting run.")
return 1
# If the board has a netboot firmware and we made it to booting the
# kernel, proceed to processing of the test run.
if re.search("Booting Linux", line):
@@ -83,41 +79,30 @@ class CrosServoRun:
# in the farm.
if re.search("POWER_GOOD not seen in time", line):
self.print_error(
"Detected intermittent poweron failure, restarting run...")
return 2
"Detected intermittent poweron failure, abandoning run.")
return 1
if not bootloader_done:
print("Failed to make it through bootloader, restarting run...")
return 2
self.print_error("Failed to make it through bootloader, abandoning run.")
return 1
tftp_failures = 0
self.logger.create_job_phase("test")
for line in self.cpu_ser.lines(timeout=self.test_timeout, phase="test"):
if re.search("---. end Kernel panic", line):
return 1
# The Cheza firmware seems to occasionally get stuck looping in
# this error state during TFTP booting, possibly based on amount of
# network traffic around it, but it'll usually recover after a
# reboot.
if re.search("R8152: Bulk read error 0xffffffbf", line):
tftp_failures += 1
if tftp_failures >= 100:
self.print_error(
"Detected intermittent tftp failure, restarting run...")
return 2
# There are very infrequent bus errors during power management transitions
# on cheza, which we don't expect to be the case on future boards.
if re.search("Kernel panic - not syncing: Asynchronous SError Interrupt", line):
self.print_error(
"Detected cheza power management bus error, restarting run...")
return 2
"Detected cheza power management bus error, abandoning run.")
return 1
# If the network device dies, it's probably not graphics's fault, just try again.
if re.search("NETDEV WATCHDOG", line):
self.print_error(
"Detected network device failure, restarting run...")
return 2
"Detected network device failure, abandoning run.")
return 1
# These HFI response errors started appearing with the introduction
# of piglit runs. CosmicPenguin says:
@@ -130,28 +115,30 @@ class CrosServoRun:
# break many tests after that, just restart the whole run.
if re.search("a6xx_hfi_send_msg.*Unexpected message id .* on the response queue", line):
self.print_error(
"Detected cheza power management bus error, restarting run...")
return 2
"Detected cheza power management bus error, abandoning run.")
return 1
if re.search("coreboot.*bootblock starting", line):
self.print_error(
"Detected spontaneous reboot, restarting run...")
return 2
"Detected spontaneous reboot, abandoning run.")
return 1
if re.search("arm-smmu 5040000.iommu: TLB sync timed out -- SMMU may be deadlocked", line):
self.print_error("Detected cheza MMU fail, restarting run...")
return 2
self.print_error("Detected cheza MMU fail, abandoning run.")
return 1
result = re.search("hwci: mesa: (\S*)", line)
if result:
if result.group(1) == "pass":
self.logger.update_dut_job("status", "pass")
return 0
else:
self.logger.update_status_fail("test fail")
return 1
self.print_error(
"Reached the end of the CPU serial log without finding a result")
return 2
return 1
def main():
@@ -164,16 +151,17 @@ def main():
'--test-timeout', type=int, help='Test phase timeout (minutes)', required=True)
args = parser.parse_args()
while True:
servo = CrosServoRun(args.cpu, args.ec, args.test_timeout * 60)
retval = servo.run()
logger = CustomLogger("job_detail.json")
logger.update_dut_time("start", None)
servo = CrosServoRun(args.cpu, args.ec, args.test_timeout * 60, logger)
retval = servo.run()
# power down the CPU on the device
servo.ec_write("power off\n")
servo.close()
# power down the CPU on the device
servo.ec_write("power off\n")
logger.update_dut_time("end", None)
servo.close()
if retval != 2:
sys.exit(retval)
sys.exit(retval)
if __name__ == '__main__':

View File

@@ -96,27 +96,33 @@ else
popd
fi
# Make the combined kernel image and dtb for passing to fastboot. For normal
# Mesa development, we build the kernel and store it in the docker container
# that this script is running in.
#
# However, container builds are expensive, so when you're hacking on the
# kernel, it's nice to be able to skip the half hour container build and plus
# moving that container to the runner. So, if BM_KERNEL+BM_DTB are URLs,
# fetch them instead of looking in the container.
if echo "$BM_KERNEL $BM_DTB" | grep -q http; then
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"$BM_KERNEL" -o kernel
# FIXME: modules should be supplied too
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"$BM_DTB" -o dtb
cat kernel dtb > Image.gz-dtb
elif [ -n "${FORCE_KERNEL_TAG}" ]; then
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_KERNEL}" -o kernel
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst" -o modules.tar.zst
if [ -n "$BM_DTB" ]; then
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_DTB}.dtb" -o dtb
fi
cat kernel dtb > Image.gz-dtb || echo "No DTB available, using pure kernel."
rm kernel
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C "$BM_ROOTFS/"
rm modules.tar.zst &
else
cat $BM_KERNEL $BM_DTB > Image.gz-dtb
cp $BM_DTB dtb
cat /baremetal-files/"$BM_KERNEL" /baremetal-files/"$BM_DTB".dtb > Image.gz-dtb
cp /baremetal-files/"$BM_DTB".dtb dtb
fi
export PATH=$BM:$PATH

View File

@@ -51,8 +51,8 @@ class FastbootRun:
try:
return subprocess.call(cmd, shell=True, timeout=timeout)
except subprocess.TimeoutExpired:
self.print_error("timeout, restarting run...")
return 2
self.print_error("timeout, abandoning run.")
return 1
def run(self):
if ret := self.logged_system(self.powerup):
@@ -60,20 +60,20 @@ class FastbootRun:
fastboot_ready = False
for line in self.ser.lines(timeout=2 * 60, phase="bootloader"):
if re.search("fastboot: processing commands", line) or \
if re.search("[Ff]astboot: [Pp]rocessing commands", line) or \
re.search("Listening for fastboot command on", line):
fastboot_ready = True
break
if re.search("data abort", line):
self.print_error(
"Detected crash during boot, restarting run...")
return 2
"Detected crash during boot, abandoning run.")
return 1
if not fastboot_ready:
self.print_error(
"Failed to get to fastboot prompt, restarting run...")
return 2
"Failed to get to fastboot prompt, abandoning run.")
return 1
if ret := self.logged_system(self.fastboot):
return ret
@@ -81,7 +81,7 @@ class FastbootRun:
print_more_lines = -1
for line in self.ser.lines(timeout=self.test_timeout, phase="test"):
if print_more_lines == 0:
return 2
return 1
if print_more_lines > 0:
print_more_lines -= 1
@@ -92,20 +92,20 @@ class FastbootRun:
# when if we see a reboot after we got past fastboot.
if re.search("PON REASON", line):
self.print_error(
"Detected spontaneous reboot, restarting run...")
return 2
"Detected spontaneous reboot, abandoning run.")
return 1
# db820c sometimes wedges around iommu fault recovery
if re.search("watchdog: BUG: soft lockup - CPU.* stuck", line):
self.print_error(
"Detected kernel soft lockup, restarting run...")
return 2
"Detected kernel soft lockup, abandoning run.")
return 1
# If the network device dies, it's probably not graphics's fault, just try again.
if re.search("NETDEV WATCHDOG", line):
self.print_error(
"Detected network device failure, restarting run...")
return 2
"Detected network device failure, abandoning run.")
return 1
# A3xx recovery doesn't quite work. Sometimes the GPU will get
# wedged and recovery will fail (because power can't be reset?)
@@ -115,7 +115,7 @@ class FastbootRun:
# of the hang. Once a hang happens, it's pretty chatty.
if "[drm:adreno_recover] *ERROR* gpu hw init failed: -22" in line:
self.print_error(
"Detected GPU hang, restarting run...")
"Detected GPU hang, abandoning run.")
if print_more_lines == -1:
print_more_lines = 30
@@ -127,8 +127,8 @@ class FastbootRun:
return 1
self.print_error(
"Reached the end of the CPU serial log without finding a result, restarting run...")
return 2
"Reached the end of the CPU serial log without finding a result, abandoning run.")
return 1
def main():
@@ -147,13 +147,8 @@ def main():
fastboot = FastbootRun(args, args.test_timeout * 60)
while True:
retval = fastboot.run()
fastboot.close()
if retval != 2:
break
fastboot = FastbootRun(args, args.test_timeout * 60)
retval = fastboot.run()
fastboot.close()
fastboot.logged_system(args.powerdown)

View File

@@ -12,6 +12,7 @@
# We're run from the root of the repo, make a helper var for our paths
BM=$CI_PROJECT_DIR/install/bare-metal
CI_COMMON=$CI_PROJECT_DIR/install/common
CI_INSTALL=$CI_PROJECT_DIR/install
# Runner config checks
if [ -z "$BM_SERIAL" ]; then
@@ -60,8 +61,8 @@ if [ -z "$BM_ROOTFS" ]; then
exit 1
fi
if [ -z "$BM_BOOTFS" ]; then
echo "Must set /boot files for the TFTP boot in the job's variables"
if [ -z "$BM_BOOTFS" ] && { [ -z "$BM_KERNEL" ] || [ -z "$BM_DTB" ]; } ; then
echo "Must set /boot files for the TFTP boot in the job's variables or set kernel and dtb"
exit 1
fi
@@ -70,11 +71,6 @@ if [ -z "$BM_CMDLINE" ]; then
exit 1
fi
if [ -z "$BM_BOOTCONFIG" ]; then
echo "Must set BM_BOOTCONFIG to your board's required boot configuration arguments"
exit 1
fi
set -ex
date +'%F %T'
@@ -91,7 +87,6 @@ date +'%F %T'
# If BM_BOOTFS is an URL, download it
if echo $BM_BOOTFS | grep -q http; then
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}$BM_BOOTFS" -o /tmp/bootfs.tar
BM_BOOTFS=/tmp/bootfs.tar
@@ -100,23 +95,50 @@ fi
date +'%F %T'
# If BM_BOOTFS is a file, assume it is a tarball and uncompress it
if [ -f $BM_BOOTFS ]; then
if [ -f "${BM_BOOTFS}" ]; then
mkdir -p /tmp/bootfs
tar xf $BM_BOOTFS -C /tmp/bootfs
BM_BOOTFS=/tmp/bootfs
fi
# If BM_KERNEL and BM_DTS is present
if [ -n "${FORCE_KERNEL_TAG}" ]; then
if [ -z "${BM_KERNEL}" ] || [ -z "${BM_DTB}" ]; then
echo "This machine cannot be tested with external kernel since BM_KERNEL or BM_DTB missing!"
exit 1
fi
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_KERNEL}" -o "${BM_KERNEL}"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${BM_DTB}.dtb" -o "${BM_DTB}.dtb"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst" -o modules.tar.zst
fi
date +'%F %T'
# Install kernel modules (it could be either in /lib/modules or
# /usr/lib/modules, but we want to install in the latter)
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
if [ -n "${FORCE_KERNEL_TAG}" ]; then
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C /nfs/
rm modules.tar.zst &
elif [ -n "${BM_BOOTFS}" ]; then
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
else
echo "No modules!"
fi
date +'%F %T'
# Install kernel image + bootloader files
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
if [ -n "${FORCE_KERNEL_TAG}" ] || [ -z "$BM_BOOTFS" ]; then
mv "${BM_KERNEL}" "${BM_DTB}.dtb" /tftp/
else # BM_BOOTFS
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
fi
date +'%F %T'
@@ -148,19 +170,31 @@ LABEL primary
EOF
# Create the rootfs in the NFS directory
mkdir -p /nfs/results
. $BM/rootfs-setup.sh /nfs
date +'%F %T'
echo "$BM_CMDLINE" > /tftp/cmdline.txt
# Add some required options in config.txt
printf "$BM_BOOTCONFIG" >> /tftp/config.txt
# Add some options in config.txt, if defined
if [ -n "$BM_BOOTCONFIG" ]; then
printf "$BM_BOOTCONFIG" >> /tftp/config.txt
fi
set +e
ATTEMPTS=10
STRUCTURED_LOG_FILE=job_detail.json
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update dut_job_type "${DEVICE_TYPE}"
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update farm "${FARM}"
ATTEMPTS=3
first_attempt=True
while [ $((ATTEMPTS--)) -gt 0 ]; do
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --create-dut-job dut_name "${CI_RUNNER_DESCRIPTION}"
# Update subtime time to CI_JOB_STARTED_AT only for the first run
if [ "$first_attempt" = "True" ]; then
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit "${CI_JOB_STARTED_AT}"
else
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --update-dut-time submit
fi
python3 $BM/poe_run.py \
--dev="$BM_SERIAL" \
--powerup="$BM_POWERUP" \
@@ -170,10 +204,14 @@ while [ $((ATTEMPTS--)) -gt 0 ]; do
if [ $ret -eq 2 ]; then
echo "Did not detect boot sequence, retrying..."
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job
first_attempt=False
else
ATTEMPTS=0
fi
done
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close-dut-job
python3 $CI_INSTALL/custom_logger.py ${STRUCTURED_LOG_FILE} --close
set -e
date +'%F %T'
@@ -181,6 +219,10 @@ date +'%F %T'
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
# will look for them.
cp -Rp /nfs/results/. results/
if [ -f "${STRUCTURED_LOG_FILE}" ]; then
cp -p ${STRUCTURED_LOG_FILE} results/
echo "Structured log file is available at ${ARTIFACTS_BASE_URL}/results/${STRUCTURED_LOG_FILE}"
fi
date +'%F %T'

View File

@@ -24,23 +24,26 @@
import argparse
import os
import re
from serial_buffer import SerialBuffer
import sys
import threading
from custom_logger import CustomLogger
from serial_buffer import SerialBuffer
class PoERun:
def __init__(self, args, test_timeout):
def __init__(self, args, test_timeout, logger):
self.powerup = args.powerup
self.powerdown = args.powerdown
self.ser = SerialBuffer(
args.dev, "results/serial-output.txt", "")
self.test_timeout = test_timeout
self.logger = logger
def print_error(self, message):
RED = '\033[0;31m'
NO_COLOR = '\033[0m'
print(RED + message + NO_COLOR)
self.logger.update_status_fail(message)
def logged_system(self, cmd):
print("Running '{}'".format(cmd))
@@ -48,9 +51,11 @@ class PoERun:
def run(self):
if self.logged_system(self.powerup) != 0:
self.logger.update_status_fail("powerup failed")
return 1
boot_detected = False
self.logger.create_job_phase("boot")
for line in self.ser.lines(timeout=5 * 60, phase="bootloader"):
if re.search("Booting Linux", line):
boot_detected = True
@@ -59,10 +64,12 @@ class PoERun:
if not boot_detected:
self.print_error(
"Something wrong; couldn't detect the boot start up sequence")
return 2
return 1
self.logger.create_job_phase("test")
for line in self.ser.lines(timeout=self.test_timeout, phase="test"):
if re.search("---. end Kernel panic", line):
self.logger.update_status_fail("kernel panic")
return 1
# Binning memory problems
@@ -71,24 +78,26 @@ class PoERun:
return 1
if re.search("nouveau 57000000.gpu: bus: MMIO read of 00000000 FAULT at 137000", line):
self.print_error("nouveau jetson boot bug, retrying.")
return 2
self.print_error("nouveau jetson boot bug, abandoning run.")
return 1
# network fail on tk1
if re.search("NETDEV WATCHDOG:.* transmit queue 0 timed out", line):
self.print_error("nouveau jetson tk1 network fail, retrying.")
return 2
self.print_error("nouveau jetson tk1 network fail, abandoning run.")
return 1
result = re.search("hwci: mesa: (\S*)", line)
if result:
if result.group(1) == "pass":
self.logger.update_dut_job("status", "pass")
return 0
else:
self.logger.update_status_fail("test fail")
return 1
self.print_error(
"Reached the end of the CPU serial log without finding a result")
return 2
return 1
def main():
@@ -103,10 +112,13 @@ def main():
'--test-timeout', type=int, help='Test phase timeout (minutes)', required=True)
args = parser.parse_args()
poe = PoERun(args, args.test_timeout * 60)
logger = CustomLogger("job_detail.json")
logger.update_dut_time("start", None)
poe = PoERun(args, args.test_timeout * 60, logger)
retval = poe.run()
poe.logged_system(args.powerdown)
logger.update_dut_time("end", None)
sys.exit(retval)

View File

@@ -19,6 +19,7 @@ date +'%F %T'
cp $CI_COMMON/capture-devcoredump.sh $rootfs_dst/
cp $CI_COMMON/intel-gpu-freq.sh $rootfs_dst/
cp $CI_COMMON/kdl.sh $rootfs_dst/
cp "$SCRIPTS_DIR/setup-test-env.sh" "$rootfs_dst/"
set +x

View File

@@ -1,8 +1,16 @@
# Shared between windows and Linux
.build-common:
extends: .build-rules
extends: .container+build-rules
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
# Build jobs don't take more than 1-3 minutes. 5-8 min max on a fresh runner
# without a populated ccache.
# These jobs are never slow, either they finish within reasonable time or
# something has gone wrong and the job will never terminate, so we should
# instead timeout so that the retry mechanism can kick in.
# A few exception are made, see `timeout:` overrides in the rest of this
# file.
timeout: 30m
artifacts:
name: "mesa_${CI_JOB_NAME}"
when: always
@@ -35,12 +43,9 @@
- !reference [default, after_script]
.build-windows:
extends: .build-common
tags:
- windows
- docker
- "2022"
- mesa
extends:
- .build-common
- .windows-docker-tags
cache:
key: ${CI_JOB_NAME}
paths:
@@ -56,15 +61,6 @@
script:
- .gitlab-ci/meson/build.sh
.meson-build_mingw:
extends:
- .build-linux
- .use-debian/x86_64_build_mingw
- .use-wine
stage: build-x86_64
script:
- .gitlab-ci/meson/build.sh
debian-testing:
extends:
- .meson-build
@@ -79,8 +75,9 @@ debian-testing:
GALLIUM_ST: >
-D dri3=enabled
-D gallium-va=enabled
GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,crocus,iris,i915"
VULKAN_DRIVERS: "swrast,amd,intel,intel_hasvk,virtio"
-D gallium-rusticl=true
GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,crocus,iris,i915,r300"
VULKAN_DRIVERS: "swrast,amd,intel,intel_hasvk,virtio,nouveau-experimental"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D spirv-to-dxil=true
@@ -128,42 +125,6 @@ debian-testing-msan:
GALLIUM_DRIVERS: "freedreno,iris,nouveau,kmsro,r300,r600,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus"
VULKAN_DRIVERS: intel,amd,broadcom,virtio
.debian-cl-testing:
extends:
- .meson-build
- .ci-deqp-artifacts
variables:
LLVM_VERSION: 15
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=disabled
-D egl=disabled
-D gbm=disabled
GALLIUM_DRIVERS: "swrast"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D valgrind=disabled
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
# TODO: remove together with Clover
.debian-clover-testing:
extends:
- .debian-cl-testing
variables:
GALLIUM_ST: >
-D gallium-opencl=icd
-D opencl-spirv=true
debian-rusticl-testing:
extends:
- .debian-cl-testing
variables:
GALLIUM_ST: >
-D gallium-rusticl=true
-D opencl-spirv=true
debian-build-testing:
extends: .meson-build
variables:
@@ -182,7 +143,6 @@ debian-build-testing:
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=true
-D gallium-opencl=disabled
-D gallium-rusticl=false
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,asahi,crocus"
VULKAN_DRIVERS: swrast
@@ -203,6 +163,7 @@ debian-build-testing:
.gitlab-ci/meson/build.sh
section_switch shader-db "shader-db"
.gitlab-ci/run-shader-db.sh
timeout: 30m
# Test a release build with -Werror so new warnings don't sneak in.
debian-release:
@@ -225,7 +186,6 @@ debian-release:
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=false
-D gallium-opencl=disabled
-D gallium-rusticl=false
-D llvm=enabled
GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,crocus"
@@ -277,8 +237,6 @@ alpine-build-testing:
-D shared-llvm=enabled
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,imagination-experimental"
script:
- .gitlab-ci/meson/build.sh
fedora-release:
extends:
@@ -318,7 +276,6 @@ fedora-release:
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=false
-D gallium-opencl=icd
-D gallium-rusticl=true
-D gles1=disabled
-D gles2=enabled
@@ -328,8 +285,6 @@ fedora-release:
LLVM_VERSION: ""
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,imagination-experimental,intel,intel_hasvk"
script:
- .gitlab-ci/meson/build.sh
debian-android:
extends:
@@ -345,7 +300,6 @@ debian-android:
-Wno-error=enum-conversion
-Wno-error=initializer-overrides
-Wno-error=sometimes-uninitialized
-Wno-error=implicit-const-int-float-conversion
CPP_ARGS: >
-Wno-error=c99-designator
-Wno-error=unused-variable
@@ -369,7 +323,6 @@ debian-android:
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=disabled
-D gallium-rusticl=false
LLVM_VERSION: ""
PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
@@ -462,6 +415,7 @@ debian-arm64:
-D valgrind=disabled
-D imagination-srv=true
-D perfetto=true
-D freedreno-kmds=msm,virtio
S3_ARTIFACT_NAME: mesa-arm64-default-${BUILDTYPE}
script:
- .gitlab-ci/meson/build.sh
@@ -488,8 +442,6 @@ debian-arm64-build-test:
VULKAN_DRIVERS: "amd"
EXTRA_OPTION: >
-Dtools=panfrost,imagination
script:
- .gitlab-ci/meson/build.sh
debian-arm64-release:
extends:
@@ -515,12 +467,11 @@ debian-clang:
C_ARGS: >
-Wno-error=constant-conversion
-Wno-error=enum-conversion
-Wno-error=implicit-const-int-float-conversion
-Wno-error=initializer-overrides
-Wno-error=sometimes-uninitialized
-Werror=misleading-indentation
CPP_ARGS: >
-Wno-error=c99-designator
-Wno-error=implicit-const-int-float-conversion
-Wno-error=overloaded-virtual
-Wno-error=tautological-constant-out-of-range-compare
-Wno-error=unused-private-field
@@ -538,7 +489,6 @@ debian-clang:
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=true
-D gallium-opencl=icd
-D gles1=enabled
-D gles2=enabled
-D llvm=enabled
@@ -547,7 +497,7 @@ debian-clang:
-D opencl-spirv=true
-D shared-glapi=enabled
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi"
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,swrast,panfrost,imagination-experimental,microsoft-experimental
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,swrast,panfrost,imagination-experimental,microsoft-experimental,nouveau-experimental
EXTRA_OPTION:
-D spirv-to-dxil=true
-D osmesa=true
@@ -575,7 +525,6 @@ debian-clang-release:
-D gallium-va=enabled
-D gallium-xa=enabled
-D gallium-nine=true
-D gallium-opencl=icd
-D gles1=disabled
-D gles2=disabled
-D llvm=enabled
@@ -584,10 +533,10 @@ debian-clang-release:
-D opencl-spirv=true
-D shared-glapi=disabled
windows-vs2019:
windows-msvc:
extends:
- .build-windows
- .use-windows_build_vs2019
- .use-windows_build_msvc
- .windows-build-rules
stage: build-misc
script:
@@ -597,49 +546,6 @@ windows-vs2019:
- _build/meson-logs/*.txt
- _install/
.debian-cl:
extends: .meson-build
variables:
LLVM_VERSION: 15
UNWIND: "enabled"
DRI_LOADERS: >
-D glx=disabled
-D egl=disabled
-D gbm=disabled
EXTRA_OPTION: >
-D valgrind=disabled
# TODO: remove with Clover
.debian-clover:
extends: .debian-cl
variables:
GALLIUM_DRIVERS: "r600,radeonsi,swrast"
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=icd
-D gallium-rusticl=false
debian-rusticl:
extends: .debian-cl
variables:
BUILDTYPE: debug
GALLIUM_DRIVERS: "iris,swrast"
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
-D gallium-omx=disabled
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=disabled
-D gallium-rusticl=true
RUSTC: clippy-driver
debian-vulkan:
extends: .meson-build
variables:
@@ -650,6 +556,9 @@ debian-vulkan:
-D glx=disabled
-D gbm=disabled
-D egl=disabled
-D opengl=false
-D gles1=disabled
-D gles2=disabled
-D platforms=x11,wayland
-D osmesa=false
GALLIUM_ST: >
@@ -659,13 +568,12 @@ debian-vulkan:
-D gallium-va=disabled
-D gallium-xa=disabled
-D gallium-nine=false
-D gallium-opencl=disabled
-D gallium-rusticl=false
-D b_sanitize=undefined
-D c_args=-fno-sanitize-recover=all
-D cpp_args=-fno-sanitize-recover=all
UBSAN_OPTIONS: "print_stacktrace=1"
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,imagination-experimental,microsoft-experimental
VULKAN_DRIVERS: amd,broadcom,freedreno,intel,intel_hasvk,virtio,imagination-experimental,microsoft-experimental
EXTRA_OPTION: >
-D vulkan-layers=device-select,overlay
-D build-aco-tests=true
@@ -680,7 +588,7 @@ debian-x86_32:
BUILDTYPE: debug
CROSS: i386
VULKAN_DRIVERS: intel,amd,swrast,virtio
GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus"
GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus,d3d12"
LLVM_VERSION: 15
EXTRA_OPTION: >
-D vulkan-layers=device-select,overlay
@@ -708,41 +616,3 @@ debian-ppc64el:
CROSS: ppc64el
GALLIUM_DRIVERS: "nouveau,radeonsi,swrast,virgl,zink"
VULKAN_DRIVERS: "amd,swrast"
# Disabled as it hangs with winedbg on shared runners
.debian-mingw32-x86_64:
extends: .meson-build_mingw
stage: build-misc
variables:
UNWIND: "disabled"
C_ARGS: >
-Wno-error=format
-Wno-error=unused-but-set-variable
CPP_ARGS: >
-Wno-error=format
-Wno-error=unused-function
-Wno-error=unused-variable
-Wno-error=sign-compare
-Wno-error=narrowing
GALLIUM_DRIVERS: "swrast,d3d12,zink"
VULKAN_DRIVERS: "swrast,amd,microsoft-experimental"
GALLIUM_ST: >
-D gallium-opencl=icd
-D gallium-rusticl=false
-D opencl-spirv=true
-D microsoft-clc=enabled
-D static-libclc=all
-D opencl-external-clang-headers=disabled
-D llvm=enabled
-D gallium-va=enabled
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
EXTRA_OPTION: >
-D min-windows-version=7
-D spirv-to-dxil=true
-D gles1=enabled
-D gles2=enabled
-D osmesa=true
-D cpp_rtti=true
-D shared-glapi=enabled
-D zlib=enabled
--cross-file=.gitlab-ci/x86_64-w64-mingw32

View File

@@ -2,6 +2,7 @@
for var in \
ACO_DEBUG \
ARTIFACTS_BASE_URL \
ASAN_OPTIONS \
BASE_SYSTEM_FORK_HOST_PREFIX \
BASE_SYSTEM_MAINLINE_HOST_PREFIX \
@@ -69,7 +70,7 @@ for var in \
JOB_ARTIFACTS_BASE \
JOB_RESULTS_PATH \
JOB_ROOTFS_OVERLAY_PATH \
KERNEL_IMAGE_BASE_URL \
KERNEL_IMAGE_BASE \
KERNEL_IMAGE_NAME \
LD_LIBRARY_PATH \
LP_NUM_THREADS \
@@ -90,13 +91,13 @@ for var in \
NIR_DEBUG \
PAN_I_WANT_A_BROKEN_VULKAN_DRIVER \
PAN_MESA_DEBUG \
PANVK_DEBUG \
PIGLIT_FRACTION \
PIGLIT_NO_WINDOW \
PIGLIT_OPTIONS \
PIGLIT_PLATFORM \
PIGLIT_PROFILES \
PIGLIT_REPLAY_ARTIFACTS_BASE_URL \
PIGLIT_REPLAY_DESCRIPTION_FILE \
PIGLIT_REPLAY_DEVICE_NAME \
PIGLIT_REPLAY_EXTRA_ARGS \
PIGLIT_REPLAY_LOOP_TIMES \
@@ -104,7 +105,9 @@ for var in \
PIGLIT_REPLAY_SUBCOMMAND \
PIGLIT_RESULTS \
PIGLIT_TESTS \
PIGLIT_TRACES_FILE \
PIPELINE_ARTIFACTS_BASE \
RADEON_DEBUG \
RADV_DEBUG \
RADV_PERFTEST \
SKQP_ASSETS_DIR \

View File

@@ -7,10 +7,10 @@ set -ex
cd /
mount -t proc none /proc
mount -t sysfs none /sys
findmnt --mountpoint /proc || mount -t proc none /proc
findmnt --mountpoint /sys || mount -t sysfs none /sys
mount -t debugfs none /sys/kernel/debug
mount -t devtmpfs none /dev || echo possibly already mounted
findmnt --mountpoint /dev || mount -t devtmpfs none /dev
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
mkdir /dev/shm

View File

@@ -86,7 +86,7 @@ if [ "$HWCI_KVM" = "true" ]; then
mkdir -p /lava-files
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o "/lava-files/${KERNEL_IMAGE_NAME}" \
"${KERNEL_IMAGE_BASE_URL}/${KERNEL_IMAGE_NAME}"
"${KERNEL_IMAGE_BASE}/amd64/${KERNEL_IMAGE_NAME}"
fi
# Fix prefix confusion: the build installs to $CI_PROJECT_DIR, but we expect
@@ -127,6 +127,15 @@ if [ "$HWCI_FREQ_MAX" = "true" ]; then
/intel-gpu-freq.sh -s 70% --cpu-set-max 65% -g all -d
fi
# Start a little daemon to capture sysfs records and produce a JSON file
if [ -x /kdl.sh ]; then
echo "launch kdl.sh!"
/kdl.sh &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
else
echo "kdl.sh not found!"
fi
# Increase freedreno hangcheck timer because it's right at the edge of the
# spilling tests timing out (and some traces, too)
if [ -n "$FREEDRENO_HANGCHECK_MS" ]; then
@@ -207,7 +216,11 @@ fi
[ ${EXIT_CODE} -eq 0 ] && RESULT=pass || RESULT=fail
set +x
echo "hwci: mesa: $RESULT"
# Sleep a bit to avoid kernel dump message interleave from LAVA ENDTC signal
sleep 1
# Print the final result; both bare-metal and LAVA look for this string to get
# the result of our run, so try really hard to get it out rather than losing
# the run. The device gets shut down right at this point, and a630 seems to
# enjoy corrupting the last line of serial output before shutdown.
for _ in $(seq 0 3); do echo "hwci: mesa: $RESULT"; sleep 1; echo; done
exit $EXIT_CODE

24
.gitlab-ci/common/kdl.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091 # the path is created in build-kdl and
# here is check if exist
terminate() {
echo "ci-kdl.sh caught SIGTERM signal! propagating to child processes"
for job in $(jobs -p)
do
kill -15 "$job"
done
}
trap terminate SIGTERM
if [ -f /ci-kdl.venv/bin/activate ]; then
source /ci-kdl.venv/bin/activate
/ci-kdl.venv/bin/python /ci-kdl.venv/bin/ci-kdl | tee -a /results/kdl.log &
child=$!
wait $child
mv kdl_*.json /results/kdl.json
else
echo -e "Not possible to activate ci-kdl virtual environment"
fi

View File

@@ -1,18 +1,14 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# ALPINE_X86_64_BUILD_TAG
set -e
set -o xtrace
EPHEMERAL=(
autoconf
automake
bzip2
libtool
libepoxy-dev
libtbb-dev
make
openssl-dev
unzip
)
@@ -50,17 +46,10 @@ DEPS=(
wayland-protocols
)
apk add "${DEPS[@]}" "${EPHEMERAL[@]}"
apk --no-cache add "${DEPS[@]}" "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_pre_build.sh
pushd /usr/local
git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
rm -rf shader-db/.git
cd shader-db
make
popd
############### Uninstall the build software

View File

@@ -18,7 +18,7 @@ DEPS=(
)
apk add "${DEPS[@]}" "${EPHEMERAL[@]}"
apk --no-cache add "${DEPS[@]}" "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_pre_build.sh

View File

@@ -1,69 +0,0 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
CONFIG_DEVFREQ_GOV_POWERSAVE=y
CONFIG_DEVFREQ_GOV_USERSPACE=y
CONFIG_DEVFREQ_GOV_PASSIVE=y
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
CONFIG_DRM=y
CONFIG_DRM_ETNAVIV=y
CONFIG_DRM_ROCKCHIP=y
CONFIG_DRM_PANFROST=y
CONFIG_DRM_LIMA=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_PWM_CROS_EC=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_ROCKCHIP_CDN_DP=n
CONFIG_SPI_ROCKCHIP=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_DP=y
CONFIG_DWMAC_ROCKCHIP=y
CONFIG_MFD_RK808=y
CONFIG_REGULATOR_RK808=y
CONFIG_RTC_DRV_RK808=y
CONFIG_COMMON_CLK_RK808=y
CONFIG_REGULATOR_FAN53555=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_VCTRL=y
CONFIG_KASAN=n
CONFIG_KASAN_INLINE=n
CONFIG_STACKTRACE=n
CONFIG_TMPFS=y
CONFIG_PROVE_LOCKING=n
CONFIG_DEBUG_LOCKDEP=n
CONFIG_SOFTLOCKUP_DETECTOR=n
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=n
CONFIG_FW_LOADER_COMPRESS=y
CONFIG_USB_USBNET=y
CONFIG_NETDEVICES=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_RTL8152=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_SMSC95XX=y
# TK1
CONFIG_ARM_TEGRA_DEVFREQ=y
# 32-bit build failure
CONFIG_DRM_MSM=n

View File

@@ -1,197 +0,0 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
CONFIG_DEVFREQ_GOV_POWERSAVE=y
CONFIG_DEVFREQ_GOV_USERSPACE=y
CONFIG_DEVFREQ_GOV_PASSIVE=y
CONFIG_DRM=y
CONFIG_DRM_ROCKCHIP=y
CONFIG_DRM_PANFROST=y
CONFIG_DRM_LIMA=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_PANEL_EDP=y
CONFIG_DRM_MSM=y
CONFIG_DRM_ETNAVIV=y
CONFIG_DRM_I2C_ADV7511=y
CONFIG_PWM_CROS_EC=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_ROCKCHIP_CDN_DP=n
CONFIG_SPI_ROCKCHIP=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_DP=y
CONFIG_DWMAC_ROCKCHIP=y
CONFIG_STMMAC_ETH=y
CONFIG_TYPEC_FUSB302=y
CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
# MSM platform bits
# For CONFIG_QCOM_LMH
CONFIG_OF=y
CONFIG_ARM_SMMU_QCOM=y
CONFIG_QCOM_COMMAND_DB=y
CONFIG_QCOM_RPMHPD=y
CONFIG_QCOM_RPMPD=y
CONFIG_QCOM_OCMEM=y
CONFIG_SDM_GPUCC_845=y
CONFIG_SDM_VIDEOCC_845=y
CONFIG_SDM_DISPCC_845=y
CONFIG_SDM_LPASSCC_845=y
CONFIG_SDM_CAMCC_845=y
CONFIG_RESET_QCOM_PDC=y
CONFIG_DRM_TI_SN65DSI86=y
CONFIG_I2C_QCOM_GENI=y
CONFIG_SPI_QCOM_GENI=y
CONFIG_PHY_QCOM_QUSB2=y
CONFIG_PHY_QCOM_QMP=y
CONFIG_QCOM_CLK_APCC_MSM8996=y
CONFIG_QCOM_LLCC=y
CONFIG_QCOM_LMH=y
CONFIG_QCOM_SPMI_TEMP_ALARM=y
CONFIG_QCOM_WDT=y
CONFIG_POWER_RESET_QCOM_PON=y
CONFIG_RTC_DRV_PM8XXX=y
CONFIG_INTERCONNECT=y
CONFIG_INTERCONNECT_QCOM=y
CONFIG_INTERCONNECT_QCOM_MSM8996=y
CONFIG_INTERCONNECT_QCOM_SDM845=y
CONFIG_INTERCONNECT_QCOM_MSM8916=y
CONFIG_INTERCONNECT_QCOM_OSM_L3=y
CONFIG_INTERCONNECT_QCOM_SC7180=y
CONFIG_INTERCONNECT_QCOM_SM8350=y
CONFIG_CRYPTO_DEV_QCOM_RNG=y
CONFIG_SC_DISPCC_7180=y
CONFIG_SC_GPUCC_7180=y
CONFIG_SM_GPUCC_8350=y
CONFIG_QCOM_SPMI_ADC5=y
CONFIG_DRM_PARADE_PS8640=y
CONFIG_DRM_LONTIUM_LT9611UXC=y
CONFIG_PHY_QCOM_USB_HS=y
CONFIG_QCOM_GPI_DMA=y
CONFIG_USB_ONBOARD_HUB=y
CONFIG_NVMEM_QCOM_QFPROM=y
CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=y
# db410c ethernet
CONFIG_USB_RTL8152=y
# db820c ethernet
CONFIG_ATL1C=y
# Chromebooks ethernet
CONFIG_USB_ONBOARD_HUB=y
# 888 HDK ethernet
CONFIG_USB_LAN78XX=y
CONFIG_ARCH_ALPINE=n
CONFIG_ARCH_BCM2835=n
CONFIG_ARCH_BCM_IPROC=n
CONFIG_ARCH_BERLIN=n
CONFIG_ARCH_BRCMSTB=n
CONFIG_ARCH_EXYNOS=n
CONFIG_ARCH_K3=n
CONFIG_ARCH_LAYERSCAPE=n
CONFIG_ARCH_LG1K=n
CONFIG_ARCH_HISI=n
CONFIG_ARCH_MVEBU=n
CONFIG_ARCH_SEATTLE=n
CONFIG_ARCH_SYNQUACER=n
CONFIG_ARCH_RENESAS=n
CONFIG_ARCH_R8A774A1=n
CONFIG_ARCH_R8A774C0=n
CONFIG_ARCH_R8A7795=n
CONFIG_ARCH_R8A7796=n
CONFIG_ARCH_R8A77965=n
CONFIG_ARCH_R8A77970=n
CONFIG_ARCH_R8A77980=n
CONFIG_ARCH_R8A77990=n
CONFIG_ARCH_R8A77995=n
CONFIG_ARCH_STRATIX10=n
CONFIG_ARCH_TEGRA=n
CONFIG_ARCH_SPRD=n
CONFIG_ARCH_THUNDER=n
CONFIG_ARCH_THUNDER2=n
CONFIG_ARCH_UNIPHIER=n
CONFIG_ARCH_VEXPRESS=n
CONFIG_ARCH_XGENE=n
CONFIG_ARCH_ZX=n
CONFIG_ARCH_ZYNQMP=n
# Strip out some stuff we don't need for graphics testing, to reduce
# the build.
CONFIG_CAN=n
CONFIG_WIRELESS=n
CONFIG_RFKILL=n
CONFIG_WLAN=n
CONFIG_REGULATOR_FAN53555=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_VCTRL=y
CONFIG_KASAN=n
CONFIG_KASAN_INLINE=n
CONFIG_STACKTRACE=n
CONFIG_TMPFS=y
CONFIG_PROVE_LOCKING=n
CONFIG_DEBUG_LOCKDEP=n
CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_FW_LOADER_COMPRESS=y
CONFIG_FW_LOADER_USER_HELPER=n
CONFIG_USB_USBNET=y
CONFIG_NETDEVICES=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_RTL8152=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_SMSC95XX=y
# For amlogic
CONFIG_MESON_GXL_PHY=y
CONFIG_MDIO_BUS_MUX_MESON_G12A=y
CONFIG_DRM_MESON=y
# For Mediatek
CONFIG_DRM_MEDIATEK=y
CONFIG_PWM_MEDIATEK=y
CONFIG_DRM_MEDIATEK_HDMI=y
CONFIG_GNSS=y
CONFIG_GNSS_MTK_SERIAL=y
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_MTK=y
CONFIG_MTK_DEVAPC=y
CONFIG_PWM_MTK_DISP=y
CONFIG_MTK_CMDQ=y
# For nouveau. Note that DRM must be a module so that it's loaded after NFS is up to provide the firmware.
CONFIG_ARCH_TEGRA=y
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_TEGRA=m
CONFIG_R8169=y
CONFIG_STAGING=y
CONFIG_DRM_TEGRA_STAGING=y
CONFIG_TEGRA_HOST1X=y
CONFIG_ARM_TEGRA_DEVFREQ=y
CONFIG_TEGRA_SOCTHERM=y
CONFIG_DRM_TEGRA_DEBUG=y
CONFIG_PWM_TEGRA=y

View File

@@ -24,11 +24,11 @@ if [[ $arch == "arm64" ]]; then
pushd /baremetal-files
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/Image
-O "${KERNEL_IMAGE_BASE}"/arm64/Image
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/Image.gz
-O "${KERNEL_IMAGE_BASE}"/arm64/Image.gz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/cheza-kernel
-O "${KERNEL_IMAGE_BASE}"/arm64/cheza-kernel
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES apq8016-sbc.dtb"
@@ -38,7 +38,7 @@ if [[ $arch == "arm64" ]]; then
for DTB in $DEVICE_TREES; do
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}/$DTB"
-O "${KERNEL_IMAGE_BASE}/arm64/$DTB"
done
popd
@@ -47,7 +47,7 @@ elif [[ $arch == "armhf" ]]; then
pushd /baremetal-files
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/zImage
-O "${KERNEL_IMAGE_BASE}"/armhf/zImage
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES imx6q-cubox-i.dtb"
@@ -55,7 +55,7 @@ elif [[ $arch == "armhf" ]]; then
for DTB in $DEVICE_TREES; do
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}/$DTB"
-O "${KERNEL_IMAGE_BASE}/armhf/$DTB"
done
popd

View File

@@ -2,7 +2,7 @@
set -ex
ANGLE_REV="82f1cee01a9ea24960e8f23b24d348fccbe0aae0"
ANGLE_REV="0518a3ff4d4e7e5b2ce8203358f719613a31c118"
# DEPOT tools
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git

View File

@@ -6,13 +6,13 @@ set -ex
git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
CROSVM_VERSION=d0cbf0b23eb4bd2355b011184025c7c5d8749376
CROSVM_VERSION=e3815e62d675ef436956a992e0ed58b7309c759d
git clone --single-branch -b main --no-checkout https://chromium.googlesource.com/crosvm/crosvm /platform/crosvm
pushd /platform/crosvm
git checkout "$CROSVM_VERSION"
git submodule update --init
VIRGLRENDERER_VERSION=45bb2449b81336b88c267b1c1735f3b4946c7b3a
VIRGLRENDERER_VERSION=747c6ae5b194ca551a79958a9a86c42bddcc4553
rm -rf third_party/virglrenderer
git clone --single-branch -b main --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer
pushd third_party/virglrenderer

View File

@@ -1,6 +1,12 @@
#!/bin/sh
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BASE_TAG
# DEBIAN_X86_64_TEST_ANDROID_TAG
# KERNEL_ROOTFS_TAG
set -ex
if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then
@@ -27,7 +33,7 @@ if [ -z "$ANDROID_NDK_HOME" ]; then
else
mkdir -p /deqp-runner
pushd /deqp-runner
git clone --branch v0.16.1 --depth 1 https://gitlab.freedesktop.org/anholt/deqp-runner.git deqp-runner-git
git clone --branch v0.18.0 --depth 1 https://gitlab.freedesktop.org/anholt/deqp-runner.git deqp-runner-git
pushd deqp-runner-git
cargo install --locked \

View File

@@ -8,17 +8,23 @@
# DEBIAN_X86_64_TEST_VK_TAG
# KERNEL_ROOTFS_TAG
set -ex
set -ex -o pipefail
DEQP_VERSION=vulkan-cts-1.3.7.0
git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
git clone \
https://github.com/KhronosGroup/VK-GL-CTS.git \
-b vulkan-cts-1.3.5.2 \
-b $DEQP_VERSION \
--depth 1 \
/VK-GL-CTS
pushd /VK-GL-CTS
mkdir -p /deqp
echo "dEQP base version $DEQP_VERSION" > /deqp/version-log
# Patches to VulkanCTS may come from commits in their repo (listed in
# cts_commits_to_backport) or patch files stored in our repo (in the patch
# directory `$OLDPWD/.gitlab-ci/container/patches/` listed in cts_patch_files).
@@ -26,46 +32,17 @@ pushd /VK-GL-CTS
# patches.
cts_commits_to_backport=(
# sync fix for SSBO writes
44f1be32fe6bd2a7de7b9169fc71cc44e0b26124
# Take multiview into account for task shader inv. stats
22aa3f4c59f6e1d4daebd5a8c9c05bce6cd3b63b
# sync fix for KHR-GL46.multi_bind.dispatch_bind_image_textures
db6c9e295ab38054ace425cb75ff966719ccc609
# Remove illegal mesh shader query tests
2a87f7b25dc27188be0f0a003b2d7aef69d9002e
# VK robustness barriers fix
6052f21c4d6077438d644f525c10cc58dcdf25bf
# Relax fragment shader invocations result verifications
0d8bf6a2715f95907e9cf86a86876ff1f26c66fe
# correctness fixes for zink validation fails
1923cbc89ed3969a3afe7c6926124b51157902e1
af3a979c49dc65f8809c27660405ae3a76c7da4a
# GL/GLES vertex_attrib_binding.advanced-largeStrideAndOffsetsNewAndLegacyAPI fix
bdb456dcf85e34fced872ebdaf06f6b73451f99c
# KHR-GLES31.core.compute_shader.max fix
7aa3ebb49d07982f5c44edd4799edb5a894567e9
# GL arrays_of_arrays perf fix
b481dada59734e8e34050fe884ba6d627d9e5c54
# GL shadow samplers require depth compares fix
a8bc242ec234bf8d7df8b4eec1eeccab4e401288
# GL PolygonOffsetClamp fix
1f2feb2388da88b4e46eba55547d50856467cc20
# KHR-GL46.texture_view.view_sampling fix
aca29fb9553ebe28094513ce18bb46bad138cf46
# video validation fails
4cc3980a86ba5b7fe6e76b559cc1a9cb5fd1b253
a7a2ce442db51ca058ce051de7e09d62db44ae81
# Check for robustness before testing it
ee7138d8adf5ed3c4845e5ac2553c4f9697be9d8
# dEQP-VK.wsi.acquire_drm_display.*invalid_fd
98ad9402e7d94030d1689fd59135da7a2f52384c
# Fix several issues in dynamic rendering basic tests
c5453824b498c981c6ba42017d119f5de02a3e34
)
for commit in "${cts_commits_to_backport[@]}"
@@ -88,13 +65,14 @@ do
git am < $OLDPWD/.gitlab-ci/container/patches/$patch
done
echo "The following local patches are applied on top:" >> /deqp/version-log
git log --reverse --oneline $DEQP_VERSION.. --format=%s | sed 's/^/- /' >> /deqp/version-log
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
# libpng (sigh). The archives get their checksums checked anyway, and git
# always goes through ssh or https.
python3 external/fetch_sources.py --insecure
mkdir -p /deqp
# Save the testlog stylesheets:
cp doc/testlog-stylesheet/testlog.{css,xsl} /deqp
popd
@@ -120,10 +98,10 @@ if [ "${DEQP_TARGET}" != 'android' ]; then
fi
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=${DEQP_TARGET:-x11_glx} \
-DDEQP_TARGET=${DEQP_TARGET:-default} \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja
mold --run ninja
if [ "${DEQP_TARGET}" = 'android' ]; then
mv /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-android
@@ -170,8 +148,7 @@ rm -rf /deqp/external/openglcts/modules/cts-runner
rm -rf /deqp/modules/internal
rm -rf /deqp/execserver
rm -rf /deqp/framework
# shellcheck disable=SC2038,SC2185 # TODO: rewrite find
find -iname '*cmake*' -o -name '*ninja*' -o -name '*.o' -o -name '*.a' | xargs rm -rf
find . -depth \( -iname '*cmake*' -o -name '*ninja*' -o -name '*.o' -o -name '*.a' \) -exec rm -rf {} \;
${STRIP_CMD:-strip} external/vulkancts/modules/vulkan/deqp-vk
${STRIP_CMD:-strip} external/openglcts/modules/glcts
${STRIP_CMD:-strip} modules/*/deqp-*

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BUILD_TAG
set -ex
git clone https://github.com/microsoft/DirectX-Headers -b v1.611.0 --depth 1
pushd DirectX-Headers
meson setup build --backend=ninja --buildtype=release -Dbuild-test=false $EXTRA_MESON_ARGS
meson install -C build
popd
rm -rf DirectX-Headers

View File

@@ -1,10 +1,15 @@
#!/bin/bash
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_X86_64_TEST_VK_TAG
# KERNEL_ROOTFS_TAG
set -ex
git clone https://github.com/ValveSoftware/Fossilize.git
cd Fossilize
git checkout 16fba1b8b5d9310126bb02323d7bae3227338461
git checkout b43ee42bbd5631ea21fe9a2dee4190d5d875c327
git submodule update --init
mkdir build
cd build

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091 # the path is created by the script
set -ex
KDL_REVISION="5056f71b100a68b72b285c6fc845a66a2ed25985"
mkdir ci-kdl.git
pushd ci-kdl.git
git init
git remote add origin https://gitlab.freedesktop.org/gfx-ci/ci-kdl.git
git fetch --depth 1 origin ${KDL_REVISION}
git checkout FETCH_HEAD
popd
python3 -m venv ci-kdl.venv
source ci-kdl.venv/bin/activate
pushd ci-kdl.git
pip install -r requirements.txt
pip install .
popd
rm -rf ci-kdl.git

View File

@@ -1,54 +1,31 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# shellcheck disable=SC2153
set -ex
mkdir -p kernel
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 ${KERNEL_URL} \
| tar -xj --strip-components=1 -C kernel
pushd kernel
# The kernel doesn't like the gold linker (or the old lld in our debians).
# Sneak in some override symlinks during kernel build until we can update
# debian (they'll get blown away by the rm of the kernel dir at the end).
mkdir -p ld-links
for i in /usr/bin/*-ld /usr/bin/ld; do
i=$(basename $i)
ln -sf /usr/bin/$i.bfd ld-links/$i
done
NEWPATH=$(pwd)/ld-links
export PATH=$NEWPATH:$PATH
KERNEL_FILENAME=$(basename $KERNEL_URL)
export LOCALVERSION="$KERNEL_FILENAME"
./scripts/kconfig/merge_config.sh ${DEFCONFIG} ../.gitlab-ci/container/${KERNEL_ARCH}.config
make ${KERNEL_IMAGE_NAME}
for image in ${KERNEL_IMAGE_NAME}; do
cp arch/${KERNEL_ARCH}/boot/${image} /lava-files/.
done
if [[ -n ${DEVICE_TREES} ]]; then
make dtbs
cp ${DEVICE_TREES} /lava-files/.
fi
make modules
INSTALL_MOD_PATH=/lava-files/rootfs-${DEBIAN_ARCH}/ make modules_install
if [[ ${DEBIAN_ARCH} = "arm64" ]]; then
make Image.lzma
mkimage \
-f auto \
-A arm \
-O linux \
-d arch/arm64/boot/Image.lzma \
-C lzma\
-b arch/arm64/boot/dts/qcom/sdm845-cheza-r3.dtb \
/lava-files/cheza-kernel
KERNEL_IMAGE_NAME+=" cheza-kernel"
fi
for image in ${KERNEL_IMAGE_NAME}; do
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o "/lava-files/${image}" "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${image}"
done
for dtb in ${DEVICE_TREES}; do
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o "/lava-files/${dtb}" "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${dtb}"
done
mkdir -p "/lava-files/rootfs-${DEBIAN_ARCH}"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/modules.tar.zst"
tar --keep-directory-symlink --zstd -xf modules.tar.zst -C "/lava-files/rootfs-${DEBIAN_ARCH}/"
popd
rm -rf kernel

View File

@@ -1,9 +1,10 @@
#!/usr/bin/env bash
# Script used for Android and Fedora builds
# shellcheck disable=SC2086 # we want word splitting
set -ex
export LIBDRM_VERSION=libdrm-2.4.114
export LIBDRM_VERSION=libdrm-2.4.119
curl -L -O --retry 4 -f --retry-all-errors --retry-delay 60 \
https://dri.freedesktop.org/libdrm/"$LIBDRM_VERSION".tar.xz

View File

@@ -1,9 +1,14 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -ex
REV="5036601c43fff63f7be5cd8ad7b319a5c1f6652c"
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_X86_64_TEST_GL_TAG
# DEBIAN_X86_64_TEST_VK_TAG
# KERNEL_ROOTFS_TAG
REV="f7db20b03de6896d013826c0a731bc4417c1a5a0"
git clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
pushd /piglit
@@ -11,18 +16,18 @@ git checkout "$REV"
patch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
cmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
ninja $PIGLIT_BUILD_TARGETS
# shellcheck disable=SC2038,SC2185 # TODO: rewrite find
find -name .git -o -name '*ninja*' -o -iname '*cmake*' -o -name '*.[chao]' | xargs rm -rf
find . -depth \( -name .git -o -name '*ninja*' -o -iname '*cmake*' -o -name '*.[chao]' \) -exec rm -rf {} \;
rm -rf target_api
if [ "$PIGLIT_BUILD_TARGETS" = "piglit_replayer" ]; then
# shellcheck disable=SC2038,SC2185 # TODO: rewrite find
find ! -regex "^\.$" \
find . -depth \
! -regex "^\.$" \
! -regex "^\.\/piglit.*" \
! -regex "^\.\/framework.*" \
! -regex "^\.\/bin$" \
! -regex "^\.\/bin\/replayer\.py" \
! -regex "^\.\/templates.*" \
! -regex "^\.\/tests$" \
! -regex "^\.\/tests\/replay\.py" 2>/dev/null | xargs rm -rf
! -regex "^\.\/tests\/replay\.py" \
-exec rm -rf {} \; 2>/dev/null
fi
popd

View File

@@ -11,11 +11,11 @@ set -ex
mkdir -p "$HOME"/.cargo
ln -s /usr/local/bin "$HOME"/.cargo/bin
# Rusticl requires at least Rust 1.60.0
# Rusticl requires at least Rust 1.66.0 and NAK requires 1.73.0
#
# Also, pick a specific snapshot from rustup so the compiler doesn't drift on
# us.
RUST_VERSION=1.60.0-2022-04-07
RUST_VERSION=1.73.0-2023-10-05
# For rust in Mesa, we use rustup to install. This lets us pick an arbitrary
# version of the compiler, rather than whatever the container's Debian comes

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BUILD_TAG
set -ex
pushd /usr/local
git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
rm -rf shader-db/.git
cd shader-db
make
popd

View File

@@ -6,7 +6,7 @@
# KERNEL_ROOTFS_TAG
set -ex
VKD3D_PROTON_COMMIT="6365efeba253807beecaed0eaa963295522c6b70"
VKD3D_PROTON_COMMIT="a0ccc383937903f4ca0997ce53e41ccce7f2f2ec"
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"

View File

@@ -7,7 +7,7 @@
set -ex
VALIDATION_TAG="v1.3.251"
VALIDATION_TAG="v1.3.269"
git clone -b "$VALIDATION_TAG" --single-branch --depth 1 https://github.com/KhronosGroup/Vulkan-ValidationLayers.git
pushd Vulkan-ValidationLayers

View File

@@ -1,10 +1,12 @@
#!/bin/sh
#!/usr/bin/env bash
if test -f /etc/debian_version; then
apt-get autoremove -y --purge
fi
# Clean up any build cache for rust.
# Clean up any build cache
rm -rf /root/.cache
rm -rf /root/.cargo
rm -rf /.cargo
if test -x /usr/bin/ccache; then

View File

@@ -25,7 +25,7 @@ fi
# When not using the mold linker (e.g. unsupported architecture), force
# linkers to gold, since it's so much faster for building. We can't use
# lld because we're on old debian and it's buggy. ming fails meson builds
# lld because we're on old debian and it's buggy. mingw fails meson builds
# with it with "meson.build:21:0: ERROR: Unable to determine dynamic linker"
find /usr/bin -name \*-ld -o -name ld | \
grep -v mingw | \

View File

@@ -8,55 +8,61 @@ export DEBIAN_FRONTEND=noninteractive
export LLVM_VERSION="${LLVM_VERSION:=15}"
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
"
EPHEMERAL=(
)
DEPS=(
"crossbuild-essential-$arch"
"pkgconf:$arch"
"libasan8:$arch"
"libdrm-dev:$arch"
"libelf-dev:$arch"
"libexpat1-dev:$arch"
"libffi-dev:$arch"
"libpciaccess-dev:$arch"
"libstdc++6:$arch"
"libvulkan-dev:$arch"
"libx11-dev:$arch"
"libx11-xcb-dev:$arch"
"libxcb-dri2-0-dev:$arch"
"libxcb-dri3-dev:$arch"
"libxcb-glx0-dev:$arch"
"libxcb-present-dev:$arch"
"libxcb-randr0-dev:$arch"
"libxcb-shm0-dev:$arch"
"libxcb-xfixes0-dev:$arch"
"libxdamage-dev:$arch"
"libxext-dev:$arch"
"libxrandr-dev:$arch"
"libxshmfence-dev:$arch"
"libxxf86vm-dev:$arch"
"libwayland-dev:$arch"
)
dpkg --add-architecture $arch
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
apt-get update
apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
crossbuild-essential-$arch \
pkgconf:$arch \
libasan8:$arch \
libdrm-dev:$arch \
libelf-dev:$arch \
libexpat1-dev:$arch \
libffi-dev:$arch \
libpciaccess-dev:$arch \
libstdc++6:$arch \
libvulkan-dev:$arch \
libx11-dev:$arch \
libx11-xcb-dev:$arch \
libxcb-dri2-0-dev:$arch \
libxcb-dri3-dev:$arch \
libxcb-glx0-dev:$arch \
libxcb-present-dev:$arch \
libxcb-randr0-dev:$arch \
libxcb-shm0-dev:$arch \
libxcb-xfixes0-dev:$arch \
libxdamage-dev:$arch \
libxext-dev:$arch \
libxrandr-dev:$arch \
libxshmfence-dev:$arch \
libxxf86vm-dev:$arch \
libwayland-dev:$arch
apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
$EXTRA_LOCAL_PACKAGES
if [[ $arch != "armhf" ]]; then
# We don't need clang-format for the crossbuilds, but the installed amd64
# package will conflict with libclang. Uninstall clang-format (and its
# problematic dependency) to fix.
apt-get remove -y clang-format-${LLVM_VERSION} libclang-cpp${LLVM_VERSION}
apt-get remove -y "clang-format-${LLVM_VERSION}" "libclang-cpp${LLVM_VERSION}"
# llvm-*-tools:$arch conflicts with python3:amd64. Install dependencies only
# with apt-get, then force-install llvm-*-{dev,tools}:$arch with dpkg to get
# around this.
apt-get install -y --no-remove --no-install-recommends \
libclang-cpp${LLVM_VERSION}:$arch \
libgcc-s1:$arch \
libtinfo-dev:$arch \
libz3-dev:$arch \
llvm-${LLVM_VERSION}:$arch \
"libclang-cpp${LLVM_VERSION}:$arch" \
"libgcc-s1:$arch" \
"libtinfo-dev:$arch" \
"libz3-dev:$arch" \
"llvm-${LLVM_VERSION}:$arch" \
zlib1g
fi
@@ -67,19 +73,19 @@ fi
# dependencies where we want a specific version
EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)"
. .gitlab-ci/container/build-libdrm.sh
MULTIARCH_PATH=$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)
export EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/${MULTIARCH_PATH}"
. .gitlab-ci/container/build-wayland.sh
apt-get purge -y \
$STABLE_EPHEMERAL
. .gitlab-ci/container/build-directx-headers.sh
apt-get purge -y "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_post_build.sh
# This needs to be done after container_post_build.sh, or apt-get breaks in there
if [[ $arch != "armhf" ]]; then
apt-get download llvm-${LLVM_VERSION}-{dev,tools}:$arch
dpkg -i --force-depends llvm-${LLVM_VERSION}-*_${arch}.deb
rm llvm-${LLVM_VERSION}-*_${arch}.deb
apt-get download llvm-"${LLVM_VERSION}"-{dev,tools}:"$arch"
dpkg -i --force-depends llvm-"${LLVM_VERSION}"-*_"${arch}".deb
rm llvm-"${LLVM_VERSION}"-*_"${arch}".deb
fi

View File

@@ -1,15 +1,19 @@
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BUILD_TAG
set -ex
EPHEMERAL="\
autoconf \
rdfind \
unzip \
"
EPHEMERAL=(
autoconf
rdfind
unzip
)
apt-get install -y --no-remove $EPHEMERAL
apt-get install -y --no-remove "${EPHEMERAL[@]}"
# Fetch the NDK and extract just the toolchain we want.
ndk=$ANDROID_NDK
@@ -21,7 +25,7 @@ rm $ndk.zip
# duplicate files. Turn them into hardlinks to save on container space.
rdfind -makehardlinks true -makeresultsfile false /${ndk}/
# Drop some large tools we won't use in this build.
find /${ndk}/ -type f | grep -E -i "clang-check|clang-tidy|lldb" | xargs rm -f
find /${ndk}/ -type f \( -iname '*clang-check*' -o -iname '*clang-tidy*' -o -iname '*lldb*' \) -exec rm -f {} \;
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3" $ANDROID_SDK_VERSION
@@ -30,33 +34,13 @@ sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x8
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android aarch64 armv8 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl $ANDROID_SDK_VERSION armv7a-linux-androideabi
# Not using build-libdrm.sh because we don't want its cleanup after building
# each arch. Fetch and extract now.
export LIBDRM_VERSION=libdrm-2.4.114
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
tar -xf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz
for arch in \
x86_64-linux-android \
i686-linux-android \
aarch64-linux-android \
arm-linux-androideabi ; do
cd $LIBDRM_VERSION
rm -rf build-$arch
meson setup build-$arch \
--cross-file=/cross_file-$arch.txt \
--libdir=lib/$arch \
-Dnouveau=disabled \
-Dvc4=disabled \
-Detnaviv=disabled \
-Dfreedreno=disabled \
-Dintel=disabled \
-Dcairo-tests=disabled \
-Dvalgrind=disabled
meson install -C build-$arch
cd ..
EXTRA_MESON_ARGS="--cross-file=/cross_file-$arch.txt --libdir=lib/$arch -Dnouveau=disabled -Dintel=disabled" \
. .gitlab-ci/container/build-libdrm.sh
done
rm -rf $LIBDRM_VERSION
@@ -106,4 +90,4 @@ done
cd ..
rm -rf $LIBELF_VERSION
apt-get purge -y $EPHEMERAL
apt-get purge -y "${EPHEMERAL[@]}"

View File

@@ -8,67 +8,68 @@ export LLVM_VERSION="${LLVM_VERSION:=15}"
apt-get -y install ca-certificates
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
apt-get update
# Ephemeral packages (installed for this script and removed again at
# the end)
STABLE_EPHEMERAL=" \
libssl-dev \
"
# Ephemeral packages (installed for this script and removed again at the end)
EPHEMERAL=(
libssl-dev
)
apt-get -y install \
${STABLE_EPHEMERAL} \
apt-utils \
android-libext4-utils \
autoconf \
automake \
bc \
bison \
ccache \
cmake \
curl \
debootstrap \
fastboot \
flex \
g++ \
git \
glslang-tools \
kmod \
libasan8 \
libdrm-dev \
libelf-dev \
libexpat1-dev \
libvulkan-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxcb-dri3-dev \
libxcb-glx0-dev \
libxcb-present-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxdamage-dev \
libxext-dev \
libxrandr-dev \
libxshmfence-dev \
libxxf86vm-dev \
libwayland-dev \
libwayland-egl-backend-dev \
llvm-${LLVM_VERSION}-dev \
ninja-build \
meson \
openssh-server \
pkgconf \
python3-mako \
python3-pil \
python3-pip \
python3-requests \
python3-setuptools \
u-boot-tools \
xz-utils \
zlib1g-dev \
zstd
DEPS=(
apt-utils
android-libext4-utils
autoconf
automake
bc
bison
ccache
cmake
curl
fastboot
flex
g++
git
glslang-tools
kmod
libasan8
libdrm-dev
libelf-dev
libexpat1-dev
libvulkan-dev
libx11-dev
libx11-xcb-dev
libxcb-dri2-0-dev
libxcb-dri3-dev
libxcb-glx0-dev
libxcb-present-dev
libxcb-randr0-dev
libxcb-shm0-dev
libxcb-xfixes0-dev
libxdamage-dev
libxext-dev
libxrandr-dev
libxshmfence-dev
libxxf86vm-dev
libwayland-dev
libwayland-egl-backend-dev
"llvm-${LLVM_VERSION}-dev"
ninja-build
meson
openssh-server
pkgconf
python3-mako
python3-pil
python3-pip
python3-requests
python3-setuptools
u-boot-tools
xz-utils
zlib1g-dev
zstd
)
apt-get -y install "${DEPS[@]}" "${EPHEMERAL[@]}"
pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
@@ -81,6 +82,6 @@ arch=armhf
. .gitlab-ci/container/build-wayland.sh
apt-get purge -y $STABLE_EPHEMERAL
apt-get purge -y "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_post_build.sh

View File

@@ -9,23 +9,29 @@ set -e
set -o xtrace
############### Install packages for baremetal testing
DEPS=(
cpio
curl
fastboot
netcat-openbsd
openssh-server
procps
python3-distutils
python3-filelock
python3-fire
python3-minimal
python3-serial
rsync
snmp
zstd
)
apt-get install -y ca-certificates
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
apt-get update
apt-get install -y --no-remove \
cpio \
curl \
fastboot \
netcat-openbsd \
openssh-server \
procps \
python3-distutils \
python3-minimal \
python3-serial \
rsync \
snmp \
zstd
apt-get install -y --no-remove "${DEPS[@]}"
# setup SNMPv2 SMI MIB
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
arch=ppc64el

View File

@@ -1,16 +1,18 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
arch=s390x
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL="libssl-dev"
EPHEMERAL=(
libssl-dev
)
apt-get -y install "$STABLE_EPHEMERAL"
apt-get -y install "${EPHEMERAL[@]}"
. .gitlab-ci/container/build-mold.sh
apt-get purge -y "$STABLE_EPHEMERAL"
apt-get purge -y "${EPHEMERAL[@]}"
. .gitlab-ci/container/cross_build.sh

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
arch=i386

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -e
set -o xtrace
# Installing wine, need this for testing mingw or nine
apt-get update
apt-get install -y --no-remove \
wine \
wine64 \
xvfb
# Used to initialize the Wine environment to reduce build time
wine wineboot.exe --init

View File

@@ -1,6 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BUILD_TAG
set -e
set -o xtrace
@@ -9,82 +13,86 @@ export LLVM_VERSION="${LLVM_VERSION:=15}"
apt-get install -y ca-certificates
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
# Ephemeral packages (installed for this script and removed again at
# the end)
STABLE_EPHEMERAL=" \
"
EPHEMERAL=(
)
DEPS=(
apt-utils
bison
ccache
curl
"clang-format-${LLVM_VERSION}"
dpkg-cross
findutils
flex
g++
cmake
gcc
git
glslang-tools
kmod
"libclang-${LLVM_VERSION}-dev"
"libclang-cpp${LLVM_VERSION}-dev"
"libclang-common-${LLVM_VERSION}-dev"
libelf-dev
libepoxy-dev
libexpat1-dev
libgtk-3-dev
"libllvm${LLVM_VERSION}"
libomxil-bellagio-dev
libpciaccess-dev
libunwind-dev
libva-dev
libvdpau-dev
libvulkan-dev
libx11-dev
libx11-xcb-dev
libxext-dev
libxml2-utils
libxrandr-dev
libxrender-dev
libxshmfence-dev
libxxf86vm-dev
libwayland-egl-backend-dev
make
ninja-build
openssh-server
pkgconf
python3-mako
python3-pil
python3-pip
python3-ply
python3-requests
python3-setuptools
qemu-user
valgrind
x11proto-dri2-dev
x11proto-gl-dev
x11proto-randr-dev
xz-utils
zlib1g-dev
zstd
)
apt-get update
apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
apt-utils \
bison \
ccache \
curl \
clang-format-${LLVM_VERSION} \
dpkg-cross \
findutils \
flex \
g++ \
cmake \
gcc \
git \
glslang-tools \
kmod \
libclang-${LLVM_VERSION}-dev \
libclang-cpp${LLVM_VERSION}-dev \
libclang-common-${LLVM_VERSION}-dev \
libelf-dev \
libepoxy-dev \
libexpat1-dev \
libgtk-3-dev \
libllvm${LLVM_VERSION} \
libomxil-bellagio-dev \
libpciaccess-dev \
libunwind-dev \
libva-dev \
libvdpau-dev \
libvulkan-dev \
libx11-dev \
libx11-xcb-dev \
libxext-dev \
libxml2-utils \
libxrandr-dev \
libxrender-dev \
libxshmfence-dev \
libxxf86vm-dev \
libwayland-egl-backend-dev \
make \
meson \
ninja-build \
openssh-server \
pkgconf \
python3-mako \
python3-pil \
python3-pip \
python3-ply \
python3-requests \
python3-setuptools \
qemu-user \
valgrind \
x11proto-dri2-dev \
x11proto-gl-dev \
x11proto-randr-dev \
xz-utils \
zlib1g-dev \
zstd
apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
$EXTRA_LOCAL_PACKAGES
# Needed for ci-fairy, this revision is able to upload files to S3
pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
. .gitlab-ci/container/build-rust.sh
# We need at least 1.3.1 for rusticl
pip3 install --break-system-packages 'meson==1.3.1'
. .gitlab-ci/container/debian/x86_64_build-base-wine.sh
. .gitlab-ci/container/build-rust.sh
############### Uninstall ephemeral packages
apt-get purge -y $STABLE_EPHEMERAL
apt-get purge -y "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,78 +0,0 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -e
# Pull packages from msys2 repository that can be directly used.
# We can use https://packages.msys2.org/ to retrieve the newest package
mkdir ~/tmp
pushd ~/tmp
MINGW_PACKET_LIST="
mingw-w64-x86_64-headers-git-10.0.0.r14.ga08c638f8-1-any.pkg.tar.zst
mingw-w64-x86_64-vulkan-loader-1.3.211-1-any.pkg.tar.zst
mingw-w64-x86_64-libelf-0.8.13-6-any.pkg.tar.zst
mingw-w64-x86_64-zlib-1.2.12-1-any.pkg.tar.zst
mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst
"
for i in $MINGW_PACKET_LIST
do
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://mirror.msys2.org/mingw/mingw64/$i"
tar xf $i --strip-components=1 -C /usr/x86_64-w64-mingw32/
done
popd
rm -rf ~/tmp
mkdir -p /usr/x86_64-w64-mingw32/bin
# The output of `wine64 llvm-config --system-libs --cxxflags mcdisassembler`
# containes absolute path like '-IZ:'
# The sed is used to replace `-IZ:/usr/x86_64-w64-mingw32/include`
# to `-I/usr/x86_64-w64-mingw32/include`
# Debian's pkg-config wrapers for mingw are broken, and there's no sign that
# they're going to be fixed, so we'll just have to fix it ourselves
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
cat >/usr/x86_64-w64-mingw32/bin/pkg-config <<EOF
#!/bin/sh
PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig:/usr/x86_64-w64-mingw32/share/pkgconfig pkg-config \$@
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/pkg-config
cat >/usr/x86_64-w64-mingw32/bin/llvm-config <<EOF
#!/bin/sh
wine64 llvm-config \$@ | sed -e "s,Z:/,/,gi"
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-config
cat >/usr/x86_64-w64-mingw32/bin/clang <<EOF
#!/bin/sh
wine64 clang \$@
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/clang
cat >/usr/x86_64-w64-mingw32/bin/llvm-as <<EOF
#!/bin/sh
wine64 llvm-as \$@
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-as
cat >/usr/x86_64-w64-mingw32/bin/llvm-link <<EOF
#!/bin/sh
wine64 llvm-link \$@
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-link
cat >/usr/x86_64-w64-mingw32/bin/opt <<EOF
#!/bin/sh
wine64 opt \$@
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/opt
cat >/usr/x86_64-w64-mingw32/bin/llvm-spirv <<EOF
#!/bin/sh
wine64 llvm-spirv \$@
EOF
chmod +x /usr/x86_64-w64-mingw32/bin/llvm-spirv

View File

@@ -1,125 +0,0 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -e
# Building libdrm (libva dependency)
. .gitlab-ci/container/build-libdrm.sh
wd=$PWD
CMAKE_TOOLCHAIN_MINGW_PATH=$wd/.gitlab-ci/container/debian/x86_mingw-toolchain.cmake
mkdir -p ~/tmp
pushd ~/tmp
# Building DirectX-Headers
git clone https://github.com/microsoft/DirectX-Headers -b v1.606.4 --depth 1
mkdir -p DirectX-Headers/build
pushd DirectX-Headers/build
meson .. \
--backend=ninja \
--buildtype=release -Dbuild-test=false \
-Dprefix=/usr/x86_64-w64-mingw32/ \
--cross-file=$wd/.gitlab-ci/x86_64-w64-mingw32
ninja install
popd
# Building libva
git clone https://github.com/intel/libva
pushd libva/
# libva-win32 is released with libva version 2.17 (see https://github.com/intel/libva/releases/tag/2.17.0)
git checkout 2.17.0
popd
# libva already has a build dir in their repo, use builddir instead
mkdir -p libva/builddir
pushd libva/builddir
meson .. \
--backend=ninja \
--buildtype=release \
-Dprefix=/usr/x86_64-w64-mingw32/ \
--cross-file=$wd/.gitlab-ci/x86_64-w64-mingw32
ninja install
popd
export VULKAN_SDK_VERSION=1.3.211.0
# Building SPIRV Tools
git clone -b sdk-$VULKAN_SDK_VERSION --depth=1 \
https://github.com/KhronosGroup/SPIRV-Tools SPIRV-Tools
git clone -b sdk-$VULKAN_SDK_VERSION --depth=1 \
https://github.com/KhronosGroup/SPIRV-Headers SPIRV-Tools/external/SPIRV-Headers
mkdir -p SPIRV-Tools/build
pushd SPIRV-Tools/build
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CROSSCOMPILING=1 \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW
ninja install
popd
# Building LLVM
git clone -b release/15.x --depth=1 \
https://github.com/llvm/llvm-project llvm-project
git clone -b v15.0.0 --depth=1 \
https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/SPIRV-LLVM-Translator
mkdir llvm-project/build
pushd llvm-project/build
cmake ../llvm \
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CROSSCOMPILING=1 \
-DLLVM_ENABLE_RTTI=ON \
-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PWD/../../SPIRV-Tools/external/SPIRV-Headers \
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PWD/../../SPIRV-Tools/external/SPIRV-Headers \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \
-DLLVM_OPTIMIZED_TABLEGEN=TRUE \
-DLLVM_ENABLE_ASSERTIONS=TRUE \
-DLLVM_INCLUDE_UTILS=OFF \
-DLLVM_INCLUDE_RUNTIMES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_GO_TESTS=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_BUILD_LLVM_C_DYLIB=OFF \
-DLLVM_ENABLE_DIA_SDK=OFF \
-DCLANG_BUILD_TOOLS=ON \
-DLLVM_SPIRV_INCLUDE_TESTS=OFF
ninja install
popd
# Building libclc
mkdir llvm-project/build-libclc
pushd llvm-project/build-libclc
cmake ../libclc \
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_MINGW_PATH \
-DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CROSSCOMPILING=1 \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
-DCMAKE_CXX_FLAGS="-m64" \
-DLLVM_CONFIG="/usr/x86_64-w64-mingw32/bin/llvm-config" \
-DLLVM_CLANG="/usr/x86_64-w64-mingw32/bin/clang" \
-DLLVM_AS="/usr/x86_64-w64-mingw32/bin/llvm-as" \
-DLLVM_LINK="/usr/x86_64-w64-mingw32/bin/llvm-link" \
-DLLVM_OPT="/usr/x86_64-w64-mingw32/bin/opt" \
-DLLVM_SPIRV="/usr/x86_64-w64-mingw32/bin/llvm-spirv" \
-DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-"
ninja install
popd
popd # ~/tmp
# Cleanup ~/tmp
rm -rf ~/tmp

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
set -e
set -o xtrace
apt-get update
apt-get install -y --no-remove \
zstd \
g++-mingw-w64-i686 \
g++-mingw-w64-x86-64
. .gitlab-ci/container/debian/x86_64_build-mingw-patch.sh
. .gitlab-ci/container/debian/x86_64_build-mingw-source-deps.sh

View File

@@ -1,6 +1,10 @@
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BUILD_TAG
set -e
set -o xtrace
@@ -8,49 +12,52 @@ export DEBIAN_FRONTEND=noninteractive
export LLVM_VERSION="${LLVM_VERSION:=15}"
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
autoconf \
automake \
autotools-dev \
bzip2 \
libtool \
libssl-dev \
"
EPHEMERAL=(
autoconf
automake
autotools-dev
bzip2
libtool
libssl-dev
)
DEPS=(
check
"clang-${LLVM_VERSION}"
libasan8
libarchive-dev
libdrm-dev
"libclang-cpp${LLVM_VERSION}-dev"
libgbm-dev
libglvnd-dev
liblua5.3-dev
libxcb-dri2-0-dev
libxcb-dri3-dev
libxcb-glx0-dev
libxcb-present-dev
libxcb-randr0-dev
libxcb-shm0-dev
libxcb-sync-dev
libxcb-xfixes0-dev
libxcb1-dev
libxml2-dev
"llvm-${LLVM_VERSION}-dev"
ocl-icd-opencl-dev
python3-pip
python3-venv
procps
spirv-tools
shellcheck
strace
time
yamllint
zstd
)
apt-get update
apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
check \
clang-${LLVM_VERSION} \
libasan8 \
libarchive-dev \
libdrm-dev \
libclang-cpp${LLVM_VERSION}-dev \
libgbm-dev \
libglvnd-dev \
liblua5.3-dev \
libxcb-dri2-0-dev \
libxcb-dri3-dev \
libxcb-glx0-dev \
libxcb-present-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libxcb-sync-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxml2-dev \
llvm-${LLVM_VERSION}-dev \
ocl-icd-opencl-dev \
python3-pip \
python3-venv \
procps \
spirv-tools \
shellcheck \
strace \
time \
yamllint \
zstd
"${DEPS[@]}" "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_pre_build.sh
@@ -74,31 +81,21 @@ rm -rf $XORGMACROS_VERSION
. .gitlab-ci/container/build-wayland.sh
pushd /usr/local
git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
rm -rf shader-db/.git
cd shader-db
make
popd
. .gitlab-ci/container/build-shader-db.sh
git clone https://github.com/microsoft/DirectX-Headers -b v1.711.3-preview --depth 1
pushd DirectX-Headers
meson setup build --backend=ninja --buildtype=release -Dbuild-test=false
meson install -C build
popd
rm -rf DirectX-Headers
. .gitlab-ci/container/build-directx-headers.sh
python3 -m pip install --break-system-packages -r .gitlab-ci/lava/requirements.txt
# install bindgen
RUSTFLAGS='-L native=/usr/local/lib' cargo install \
bindgen-cli --version 0.62.0 \
--locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local
############### Uninstall the build software
apt-get purge -y \
$STABLE_EPHEMERAL
apt-get purge -y "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,8 +0,0 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32/)
set(ENV{PKG_CONFIG} /usr/x86_64-w64-mingw32/bin/pkgconf)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
# The relative paths in this file only become valid at runtime.
# shellcheck disable=SC1091
# shellcheck disable=SC2086 # we want word splitting
set -e
set -o xtrace
@@ -9,20 +8,22 @@ set -o xtrace
export DEBIAN_FRONTEND=noninteractive
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
ccache \
unzip \
dpkg-dev \
build-essential:native \
config-package-dev \
debhelper-compat \
cmake \
ninja-build \
"
EPHEMERAL=(
build-essential:native
ccache
cmake
config-package-dev
debhelper-compat
dpkg-dev
ninja-build
unzip
)
DEPS=(
iproute2
)
apt-get install -y --no-remove --no-install-recommends \
$STABLE_EPHEMERAL \
iproute2
"${DEPS[@]}" "${EPHEMERAL[@]}"
############### Building ...
@@ -33,9 +34,9 @@ apt-get install -y --no-remove --no-install-recommends \
# Fetch the NDK and extract just the toolchain we want.
ndk=$ANDROID_NDK
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o $ndk.zip https://dl.google.com/android/repository/$ndk-linux.zip
unzip -d / $ndk.zip
rm $ndk.zip
-o "$ndk.zip" "https://dl.google.com/android/repository/$ndk-linux.zip"
unzip -d / "$ndk.zip"
rm "$ndk.zip"
############### Build dEQP runner
@@ -91,9 +92,6 @@ usermod -a -G kvm,cvdnetwork root
rm -rf "/${ndk:?}"
ccache --show-stats
apt-get purge -y "${EPHEMERAL[@]}"
apt-get purge -y \
$STABLE_EPHEMERAL
apt-get autoremove -y --purge
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,6 +1,10 @@
#!/usr/bin/env bash
# shellcheck disable=SC2086 # we want word splitting
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# DEBIAN_BASE_TAG
set -e
set -o xtrace
@@ -10,50 +14,92 @@ apt-get install -y ca-certificates gnupg2 software-properties-common
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/*
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
export LLVM_VERSION="${LLVM_VERSION:=15}"
# Ephemeral packages (installed for this script and removed again at
# the end)
STABLE_EPHEMERAL=" \
autoconf \
automake \
bc \
bison \
bzip2 \
ccache \
cmake \
clang-${LLVM_VERSION} \
flex \
glslang-tools \
g++ \
libasound2-dev \
libcap-dev \
libclang-cpp${LLVM_VERSION}-dev \
libdrm-dev \
libegl-dev \
libelf-dev \
libepoxy-dev \
libgbm-dev \
libpciaccess-dev \
libvulkan-dev \
libwayland-dev \
libx11-xcb-dev \
libxext-dev \
llvm-${LLVM_VERSION}-dev \
make \
meson \
openssh-server \
patch \
pkgconf \
protobuf-compiler \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel \
spirv-tools \
wayland-protocols \
xz-utils \
"
# Ephemeral packages (installed for this script and removed again at the end)
EPHEMERAL=(
autoconf
automake
bc
bison
bzip2
ccache
cmake
"clang-${LLVM_VERSION}"
flex
glslang-tools
g++
libasound2-dev
libcap-dev
"libclang-cpp${LLVM_VERSION}-dev"
libdrm-dev
libegl-dev
libelf-dev
libepoxy-dev
libgbm-dev
libpciaccess-dev
libssl-dev
libvulkan-dev
libwayland-dev
libx11-xcb-dev
libxext-dev
"llvm-${LLVM_VERSION}-dev"
make
meson
openssh-server
patch
pkgconf
protobuf-compiler
python3-dev
python3-pip
python3-setuptools
python3-wheel
spirv-tools
wayland-protocols
xz-utils
)
DEPS=(
apt-utils
curl
git
git-lfs
inetutils-syslogd
iptables
jq
libasan8
libdrm2
libexpat1
"libllvm${LLVM_VERSION}"
liblz4-1
libpng16-16
libpython3.11
libvulkan1
libwayland-client0
libwayland-server0
libxcb-ewmh2
libxcb-randr0
libxcb-xfixes0
libxkbcommon0
libxrandr2
libxrender1
python3-mako
python3-numpy
python3-packaging
python3-pil
python3-requests
python3-six
python3-yaml
socat
vulkan-tools
waffle-utils
xauth
xvfb
zlib1g
zstd
)
apt-get update
apt-get dist-upgrade -y
@@ -61,48 +107,9 @@ apt-get dist-upgrade -y
apt-get install --purge -y \
sysvinit-core libelogind0
apt-get install -y --no-remove \
apt-utils \
curl \
git \
git-lfs \
inetutils-syslogd \
iptables \
jq \
libasan8 \
libdrm2 \
libexpat1 \
libllvm${LLVM_VERSION} \
liblz4-1 \
libpng16-16 \
libpython3.11 \
libvulkan1 \
libwayland-client0 \
libwayland-server0 \
libxcb-ewmh2 \
libxcb-randr0 \
libxcb-xfixes0 \
libxkbcommon0 \
libxrandr2 \
libxrender1 \
python3-mako \
python3-numpy \
python3-packaging \
python3-pil \
python3-requests \
python3-six \
python3-yaml \
socat \
vulkan-tools \
waffle-utils \
xauth \
xvfb \
zlib1g \
zstd
apt-get install -y --no-install-recommends \
$STABLE_EPHEMERAL
apt-get install -y --no-remove "${DEPS[@]}"
apt-get install -y --no-install-recommends "${EPHEMERAL[@]}"
. .gitlab-ci/container/container_pre_build.sh
@@ -123,6 +130,8 @@ pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedeskt
# Needed for manipulation with traces yaml files.
pip3 install --break-system-packages yq
. .gitlab-ci/container/build-mold.sh
############### Build LLVM-SPIRV translator
. .gitlab-ci/container/build-llvm-spirv.sh
@@ -143,11 +152,9 @@ pip3 install --break-system-packages yq
############### Build dEQP runner
. .gitlab-ci/container/build-deqp-runner.sh
rm -rf /root/.cargo
apt-get purge -y "${EPHEMERAL[@]}"
rm -rf /root/.rustup
ccache --show-stats
apt-get purge -y $STABLE_EPHEMERAL
apt-get autoremove -y --purge
. .gitlab-ci/container/container_post_build.sh

View File

@@ -10,59 +10,62 @@ export LLVM_VERSION="${LLVM_VERSION:=15}"
apt-get install -y libelogind0 # this interfere with systemd deps, install separately
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
bzip2 \
ccache \
clang-${LLVM_VERSION} \
cmake \
g++ \
glslang-tools \
libasound2-dev \
libcap-dev \
libclang-cpp${LLVM_VERSION}-dev \
libdrm-dev \
libgles2-mesa-dev \
libpciaccess-dev \
libpng-dev \
libudev-dev \
libvulkan-dev \
libwaffle-dev \
libwayland-dev \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
libxrandr-dev \
libxrender-dev \
llvm-${LLVM_VERSION}-dev \
make \
meson \
ocl-icd-opencl-dev \
patch \
pkgconf \
python3-distutils \
xz-utils \
"
EPHEMERAL=(
bzip2
ccache
"clang-${LLVM_VERSION}"
cmake
g++
glslang-tools
libasound2-dev
libcap-dev
"libclang-cpp${LLVM_VERSION}-dev"
libdrm-dev
libgles2-mesa-dev
libpciaccess-dev
libpng-dev
libudev-dev
libvulkan-dev
libwaffle-dev
libwayland-dev
libx11-xcb-dev
libxcb-dri2-0-dev
libxkbcommon-dev
libxrandr-dev
libxrender-dev
"llvm-${LLVM_VERSION}-dev"
make
meson
ocl-icd-opencl-dev
patch
pkgconf
python3-distutils
xz-utils
)
DEPS=(
clinfo
iptables
"libclang-common-${LLVM_VERSION}-dev"
"libclang-cpp${LLVM_VERSION}"
libcap2
libegl1
libepoxy0
libfdt1
libxcb-shm0
ocl-icd-libopencl1
python3-lxml
python3-renderdoc
python3-simplejson
spirv-tools
sysvinit-core
weston
)
apt-get update
apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
clinfo \
iptables \
libclang-common-${LLVM_VERSION}-dev \
libclang-cpp${LLVM_VERSION} \
libcap2 \
libegl1 \
libepoxy0 \
libfdt1 \
libxcb-shm0 \
ocl-icd-libopencl1 \
python3-lxml \
python3-renderdoc \
python3-simplejson \
spirv-tools \
sysvinit-core \
weston
apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
$EXTRA_LOCAL_PACKAGES
. .gitlab-ci/container/container_pre_build.sh
@@ -85,9 +88,6 @@ DEQP_TARGET=surfaceless . .gitlab-ci/container/build-deqp.sh
############### Uninstall the build software
ccache --show-stats
apt-get purge -y "${EPHEMERAL[@]}"
apt-get purge -y \
$STABLE_EPHEMERAL
apt-get autoremove -y --purge
. .gitlab-ci/container/container_post_build.sh

View File

@@ -11,65 +11,63 @@ export DEBIAN_FRONTEND=noninteractive
apt-get install -y libelogind0 # this interfere with systemd deps, install separately
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
ccache \
cmake \
g++ \
g++-mingw-w64-i686-posix \
g++-mingw-w64-x86-64-posix \
glslang-tools \
libexpat1-dev \
gnupg2 \
libdrm-dev \
libgbm-dev \
libgles2-mesa-dev \
liblz4-dev \
libpciaccess-dev \
libudev-dev \
libvulkan-dev \
libwaffle-dev \
libx11-xcb-dev \
libxcb-ewmh-dev \
libxcb-keysyms1-dev \
libxkbcommon-dev \
libxrandr-dev \
libxrender-dev \
libzstd-dev \
meson \
mingw-w64-i686-dev \
mingw-w64-tools \
mingw-w64-x86-64-dev \
p7zip \
patch \
pkgconf \
python3-dev \
python3-distutils \
python3-pip \
python3-setuptools \
python3-wheel \
software-properties-common \
wine64-tools \
xz-utils \
"
EPHEMERAL=(
ccache
cmake
g++
glslang-tools
libexpat1-dev
gnupg2
libdrm-dev
libgbm-dev
libgles2-mesa-dev
liblz4-dev
libpciaccess-dev
libudev-dev
libvulkan-dev
libwaffle-dev
libx11-xcb-dev
libxcb-ewmh-dev
libxcb-keysyms1-dev
libxkbcommon-dev
libxrandr-dev
libxrender-dev
libzstd-dev
meson
p7zip
patch
pkgconf
python3-dev
python3-distutils
python3-pip
python3-setuptools
python3-wheel
software-properties-common
wine64-tools
xz-utils
)
DEPS=(
curl
libepoxy0
libxcb-shm0
pciutils
python3-lxml
python3-simplejson
sysvinit-core
weston
xwayland
wine
wine64
xinit
xserver-xorg-video-amdgpu
xserver-xorg-video-ati
)
apt-get update
apt-get install -y --no-remove --no-install-recommends \
$STABLE_EPHEMERAL \
curl \
libepoxy0 \
libxcb-shm0 \
pciutils \
python3-lxml \
python3-simplejson \
sysvinit-core \
weston \
xwayland \
wine \
wine64 \
xinit \
xserver-xorg-video-amdgpu \
xserver-xorg-video-ati
apt-get update -q
"${DEPS[@]}" "${EPHEMERAL[@]}"
############### Install DXVK
@@ -123,11 +121,6 @@ PIGLIT_BUILD_TARGETS="piglit_replayer" . .gitlab-ci/container/build-piglit.sh
############### Uninstall the build software
ccache --show-stats
apt-get purge -y "${EPHEMERAL[@]}"
apt-get purge -y \
$STABLE_EPHEMERAL
apt-get autoremove -y --purge
#dpkg -r --force-depends "mesa-vulkan-drivers" "mesa-vdpau-drivers" "mesa-va-drivers" "libgl1-mesa-dri" "libglx-mesa0" "vdpau-driver-all" "va-driver-all" "libglx0" "libgl1" "libvdpau-va-gl1" "libglu1-mesa" "libegl-mesa0" "libgl1-mesa-dri" "libglapi-mesa" "libosmesa6"
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,5 +1,10 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
# When changing this file, you need to bump the following
# .gitlab-ci/image-tags.yml tags:
# FEDORA_X86_64_BUILD_TAG
set -e
set -o xtrace
@@ -14,6 +19,7 @@ EPHEMERAL=(
"pkgconfig(epoxy)"
"pkgconfig(gbm)"
"pkgconfig(openssl)"
python3-pip
unzip
xz
)
@@ -30,7 +36,7 @@ DEPS=(
glslang
kernel-headers
llvm-devel
meson
ninja-build
"pkgconfig(LLVMSPIRVLib)"
"pkgconfig(SPIRV-Tools)"
"pkgconfig(dri2proto)"
@@ -90,19 +96,15 @@ tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
rm -rf $XORGMACROS_VERSION
# We need at least 1.3.1 for rusticl
pip install meson==1.3.1
. .gitlab-ci/container/build-mold.sh
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
pushd /usr/local
git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
rm -rf shader-db/.git
cd shader-db
make
popd
############### Uninstall the build software

View File

@@ -23,10 +23,6 @@
variables:
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${FDO_DISTRIBUTION_TAG}"
.use-wine:
variables:
WINEPATH: "/usr/x86_64-w64-mingw32/bin;/usr/x86_64-w64-mingw32/lib;/usr/lib/gcc/x86_64-w64-mingw32/10-posix;c:/windows;c:/windows/system32"
# Build the CI docker images.
#
# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
@@ -44,14 +40,16 @@
# repository's container registry, so that the image from the main
# repository's registry will be used there as well.
.debian-container:
variables:
FDO_DISTRIBUTION_VERSION: bookworm-slim
.container:
stage: container
extends:
- .container-rules
- .container+build-rules
- .incorporate-templates-commit
- .use-wine
variables:
FDO_DISTRIBUTION_VERSION: bookworm-slim
FDO_REPO_SUFFIX: $CI_JOB_NAME
FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
# no need to pull the whole repo to build the container image
@@ -61,20 +59,20 @@
extends:
- .container
- .incorporate-base-tag+templates-commit
# Don't want the .container rules
- .build-rules
# Debian based x86_64 build image base
debian/x86_64_build-base:
extends:
- .fdo.container-build@debian
- .container
- .debian-container
variables:
MESA_IMAGE_TAG: &debian-x86_64_build-base ${DEBIAN_BASE_TAG}
MESA_IMAGE_TAG: &debian-x86_64_build-base "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
.use-debian/x86_64_build-base:
extends:
- .fdo.container-build@debian
- .debian-container
- .use-base-image
variables:
MESA_BASE_IMAGE: ${DEBIAN_X86_64_BUILD_BASE_IMAGE}
@@ -89,6 +87,10 @@ debian/x86_64_build:
- .use-debian/x86_64_build-base
variables:
MESA_IMAGE_TAG: &debian-x86_64_build ${DEBIAN_BUILD_TAG}
rules:
- !reference [.use-debian/x86_64_build-base, rules]
# python-test requires this job
- !reference [python-test, rules]
.use-debian/x86_64_build:
extends:
@@ -117,24 +119,6 @@ debian/x86_32_build:
needs:
- debian/x86_32_build
# Debian based x86_64-mingw cross main build image
# FIXME: Until gets fixed on Debian 12, disabled.
.debian/x86_64_build-mingw:
extends:
- .use-debian/x86_64_build-base
variables:
MESA_IMAGE_TAG: &debian-x86_64_build_mingw ${DEBIAN_BUILD_MINGW_TAG}
.use-debian/x86_64_build_mingw:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_64_build-base
MESA_IMAGE_PATH: ${DEBIAN_X86_64_BUILD_MINGW_IMAGE_PATH}
MESA_IMAGE_TAG: *debian-x86_64_build_mingw
needs:
- .debian/x86_64_build-mingw
# Debian based ppc64el cross-build image
debian/ppc64el_build:
extends:
@@ -192,12 +176,12 @@ debian/android_build:
debian/x86_64_test-base:
extends: debian/x86_64_build-base
variables:
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v6.3-for-mesa-ci-43c973a8ff91/linux-v6.3-for-mesa-ci-6fc749a2a59a.tar.bz2"
MESA_IMAGE_TAG: &debian-x86_64_test-base ${DEBIAN_BASE_TAG}
MESA_IMAGE_TAG: &debian-x86_64_test-base "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${KERNEL_TAG}"
.use-debian/x86_64_test-base:
extends:
- .fdo.container-build@debian
- .debian-container
- .use-base-image
variables:
MESA_BASE_IMAGE: ${DEBIAN_X86_64_TEST_BASE_IMAGE}
@@ -259,10 +243,11 @@ debian/arm64_build:
extends:
- .fdo.container-build@debian
- .container
- .debian-container
tags:
- aarch64
variables:
MESA_IMAGE_TAG: &debian-arm64_build ${DEBIAN_BASE_TAG}
MESA_IMAGE_TAG: &debian-arm64_build "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
.use-debian/arm64_build:
extends:
@@ -281,7 +266,8 @@ debian/arm64_build:
- .fdo.container-build@alpine
- .container
variables:
FDO_DISTRIBUTION_VERSION: "3.18"
FDO_DISTRIBUTION_VERSION: "edge" # switch to 3.20 when gets released
FDO_BASE_IMAGE: alpine:$FDO_DISTRIBUTION_VERSION # since cbuild ignores it
# Alpine based x86_64 build image
alpine/x86_64_build:
@@ -327,13 +313,13 @@ fedora/x86_64_build:
.kernel+rootfs:
extends:
- .build-rules
- .container+build-rules
- .debian-container
stage: container
variables:
GIT_STRATEGY: fetch
KERNEL_URL: *kernel-rootfs-url
MESA_ROOTFS_TAG: &kernel-rootfs ${KERNEL_ROOTFS_TAG}
DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
script:
- .gitlab-ci/container/lava_build.sh
@@ -344,7 +330,7 @@ kernel+rootfs_x86_64:
image: "$FDO_BASE_IMAGE"
variables:
DEBIAN_ARCH: "amd64"
DISTRIBUTION_TAG: &distribution-tag-x86_64 "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
DISTRIBUTION_TAG: &distribution-tag-x86_64 "${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_ARTIFACTS_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
kernel+rootfs_arm64:
extends:
@@ -377,12 +363,13 @@ kernel+rootfs_arm32:
extends:
- .fdo.container-build@debian
- .container
- .debian-container
# Don't want the .container rules
- .build-rules
- .container+build-rules
variables:
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}"
ARTIFACTS_PREFIX: "https://${S3_HOST}/mesa-lava"
ARTIFACTS_SUFFIX: "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
ARTIFACTS_SUFFIX: "${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
MESA_ARTIFACTS_TAG: *debian-arm64_build
MESA_ROOTFS_TAG: *kernel-rootfs
@@ -392,7 +379,7 @@ debian/arm32_test:
needs:
- kernel+rootfs_arm32
variables:
MESA_IMAGE_TAG: &debian-arm32_test ${DEBIAN_BASE_TAG}
MESA_IMAGE_TAG: &debian-arm32_test "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
debian/arm64_test:
extends:
@@ -400,14 +387,14 @@ debian/arm64_test:
needs:
- kernel+rootfs_arm64
variables:
MESA_IMAGE_TAG: &debian-arm64_test ${DEBIAN_BASE_TAG}
MESA_IMAGE_TAG: &debian-arm64_test "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}"
.use-debian/arm_test:
variables:
MESA_ROOTFS_TAG: *kernel-rootfs
.use-debian/arm32_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}"
extends:
- .use-debian/arm_test
variables:
@@ -417,7 +404,7 @@ debian/arm64_test:
- debian/arm_test
.use-debian/arm64_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}"
extends:
- .use-debian/arm_test
variables:
@@ -438,98 +425,92 @@ debian/arm64_test:
# (host PowerShell) in the container stage to build and push the image,
# then in the build stage by executing inside Docker.
.windows-docker-vs2019:
.windows-docker-msvc:
variables:
MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}"
MESA_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MESA_IMAGE_PATH:${MESA_IMAGE_TAG}"
extends:
- .windows-docker-tags
.windows_container_build:
inherit:
default: [retry]
extends:
- .container
- .windows-docker-vs2019
- .windows-docker-msvc
- .windows-shell-tags
rules:
- !reference [.microsoft-farm-container-rules, rules]
- !reference [.container-rules, rules]
- !reference [.container+build-rules, rules]
variables:
GIT_STRATEGY: fetch # we do actually need the full repository though
MESA_BASE_IMAGE: None
tags:
- windows
- shell
- "2022"
- mesa
script:
- .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE ${DOCKERFILE} ${MESA_BASE_IMAGE}
windows_vs2019:
windows_msvc:
inherit:
default: [retry]
extends:
- .windows_container_build
variables:
MESA_IMAGE_PATH: &windows_vs_image_path ${WINDOWS_X64_VS_PATH}
MESA_IMAGE_TAG: &windows_vs_image_tag ${WINDOWS_X64_VS_TAG}
DOCKERFILE: Dockerfile_vs
MESA_IMAGE_PATH: &windows_msvc_image_path ${WINDOWS_X64_MSVC_PATH}
MESA_IMAGE_TAG: ${WINDOWS_X64_MSVC_TAG}
DOCKERFILE: Dockerfile_msvc
MESA_BASE_IMAGE: "mcr.microsoft.com/windows/server:ltsc2022"
windows_build_vs2019:
windows_build_msvc:
inherit:
default: [retry]
extends:
- .windows_container_build
rules:
- !reference [.microsoft-farm-rules, rules]
- !reference [.build-rules, rules]
- !reference [.container+build-rules, rules]
variables:
MESA_IMAGE_PATH: &windows_build_image_path ${WINDOWS_X64_BUILD_PATH}
MESA_IMAGE_TAG: &windows_build_image_tag ${MESA_BASE_IMAGE_TAG}--${WINDOWS_X64_BUILD_TAG}
MESA_IMAGE_TAG: &windows_build_image_tag ${WINDOWS_X64_MSVC_TAG}--${WINDOWS_X64_BUILD_TAG}
DOCKERFILE: Dockerfile_build
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
MESA_BASE_IMAGE_PATH: *windows_msvc_image_path
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${WINDOWS_X64_MSVC_TAG}"
timeout: 2h 30m # LLVM takes ages
needs:
- windows_vs2019
- windows_msvc
windows_test_vs2019:
windows_test_msvc:
inherit:
default: [retry]
extends:
- .windows_container_build
rules:
- !reference [.microsoft-farm-rules, rules]
- !reference [.build-rules, rules]
- !reference [.container+build-rules, rules]
variables:
MESA_IMAGE_PATH: &windows_test_image_path ${WINDOWS_X64_TEST_PATH}
MESA_IMAGE_TAG: &windows_test_image_tag ${MESA_BASE_IMAGE_TAG}--${WINDOWS_X64_TEST_TAG}
MESA_IMAGE_TAG: &windows_test_image_tag ${WINDOWS_X64_MSVC_TAG}--${WINDOWS_X64_TEST_TAG}
DOCKERFILE: Dockerfile_test
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
MESA_BASE_IMAGE_PATH: *windows_msvc_image_path
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${WINDOWS_X64_MSVC_TAG}"
timeout: 2h 30m
needs:
- windows_vs2019
- windows_msvc
.use-windows_build_vs2019:
.use-windows_build_msvc:
inherit:
default: [retry]
extends: .windows-docker-vs2019
extends: .windows-docker-msvc
image: "$MESA_IMAGE"
variables:
MESA_IMAGE_PATH: *windows_build_image_path
MESA_IMAGE_TAG: *windows_build_image_tag
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
needs:
- windows_build_vs2019
- windows_build_msvc
.use-windows_test_vs2019:
.use-windows_test_msvc:
inherit:
default: [retry]
extends: .windows-docker-vs2019
extends: .windows-docker-msvc
image: "$MESA_IMAGE"
variables:
MESA_IMAGE_PATH: *windows_test_image_path
MESA_IMAGE_TAG: *windows_test_image_tag
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag

View File

@@ -35,20 +35,20 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
KERNEL_ARCH="arm64"
SKQP_ARCH="arm64"
DEFCONFIG="arch/arm64/configs/defconfig"
DEVICE_TREES="arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-g12b-a311d-khadas-vim3.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/apq8016-sbc.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/apq8096-db820c.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r5.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sm8350-hdk.dtb"
DEVICE_TREES="rk3399-gru-kevin.dtb"
DEVICE_TREES+=" meson-g12b-a311d-khadas-vim3.dtb"
DEVICE_TREES+=" meson-gxl-s805x-libretech-ac.dtb"
DEVICE_TREES+=" meson-gxm-khadas-vim2.dtb"
DEVICE_TREES+=" sun50i-h6-pine-h64.dtb"
DEVICE_TREES+=" imx8mq-nitrogen.dtb"
DEVICE_TREES+=" mt8192-asurada-spherion-r0.dtb"
DEVICE_TREES+=" mt8183-kukui-jacuzzi-juniper-sku16.dtb"
DEVICE_TREES+=" tegra210-p3450-0000.dtb"
DEVICE_TREES+=" apq8016-sbc.dtb"
DEVICE_TREES+=" apq8096-db820c.dtb"
DEVICE_TREES+=" sc7180-trogdor-lazor-limozeen-nots-r5.dtb"
DEVICE_TREES+=" sc7180-trogdor-kingoftown.dtb"
DEVICE_TREES+=" sm8350-hdk.dtb"
KERNEL_IMAGE_NAME="Image"
elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
@@ -56,12 +56,25 @@ elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
KERNEL_ARCH="arm"
SKQP_ARCH="arm"
DEFCONFIG="arch/arm/configs/multi_v7_defconfig"
DEVICE_TREES="arch/arm/boot/dts/rk3288-veyron-jaq.dtb"
DEVICE_TREES+=" arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dtb"
DEVICE_TREES+=" arch/arm/boot/dts/imx6q-cubox-i.dtb"
DEVICE_TREES+=" arch/arm/boot/dts/tegra124-jetson-tk1.dtb"
DEVICE_TREES="rk3288-veyron-jaq.dtb"
DEVICE_TREES+=" sun8i-h3-libretech-all-h3-cc.dtb"
DEVICE_TREES+=" imx6q-cubox-i.dtb"
DEVICE_TREES+=" tegra124-jetson-tk1.dtb"
KERNEL_IMAGE_NAME="zImage"
. .gitlab-ci/container/create-cross-file.sh armhf
CONTAINER_ARCH_PACKAGES=(
libegl1-mesa-dev:armhf
libelf-dev:armhf
libgbm-dev:armhf
libgles2-mesa-dev:armhf
libpng-dev:armhf
libudev-dev:armhf
libvulkan-dev:armhf
libwaffle-dev:armhf
libwayland-dev:armhf
libx11-xcb-dev:armhf
libxkbcommon-dev:armhf
)
else
GCC_ARCH="x86_64-linux-gnu"
KERNEL_ARCH="x86_64"
@@ -69,7 +82,9 @@ else
DEFCONFIG="arch/x86/configs/x86_64_defconfig"
DEVICE_TREES=""
KERNEL_IMAGE_NAME="bzImage"
ARCH_PACKAGES="libasound2-dev libcap-dev libfdt-dev libva-dev wayland-protocols p7zip"
CONTAINER_ARCH_PACKAGES=(
libasound2-dev libcap-dev libfdt-dev libva-dev wayland-protocols p7zip wine
)
fi
# Determine if we're in a cross build.
@@ -89,64 +104,57 @@ if [[ -e /cross_file-$DEBIAN_ARCH.txt ]]; then
export CROSS_COMPILE="${GCC_ARCH}-"
fi
# no need to remove these at end, image isn't saved at the end
CONTAINER_EPHEMERAL=(
automake
bc
"clang-${LLVM_VERSION}"
cmake
curl
mmdebstrap
git
glslang-tools
libdrm-dev
libegl1-mesa-dev
libxext-dev
libfontconfig-dev
libgbm-dev
libgl-dev
libgles2-mesa-dev
libglu1-mesa-dev
libglx-dev
libpng-dev
libssl-dev
libudev-dev
libvulkan-dev
libwaffle-dev
libwayland-dev
libx11-xcb-dev
libxcb-dri2-0-dev
libxkbcommon-dev
libwayland-dev
ninja-build
openssh-server
patch
protobuf-compiler
python-is-python3
python3-distutils
python3-mako
python3-numpy
python3-serial
python3-venv
unzip
zstd
)
echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
apt-get update
apt-get install -y --no-remove \
-o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' \
${ARCH_PACKAGES} \
automake \
bc \
clang-${LLVM_VERSION} \
cmake \
curl \
mmdebstrap \
git \
glslang-tools \
libdrm-dev \
libegl1-mesa-dev \
libxext-dev \
libfontconfig-dev \
libgbm-dev \
libgl-dev \
libgles2-mesa-dev \
libglu1-mesa-dev \
libglx-dev \
libpng-dev \
libssl-dev \
libudev-dev \
libvulkan-dev \
libwaffle-dev \
libwayland-dev \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
libwayland-dev \
ninja-build \
openssh-server \
patch \
protobuf-compiler \
python-is-python3 \
python3-distutils \
python3-mako \
python3-numpy \
python3-serial \
unzip \
zstd
if [[ "$DEBIAN_ARCH" = "armhf" ]]; then
apt-get install -y --no-remove \
libegl1-mesa-dev:armhf \
libelf-dev:armhf \
libgbm-dev:armhf \
libgles2-mesa-dev:armhf \
libpng-dev:armhf \
libudev-dev:armhf \
libvulkan-dev:armhf \
libwaffle-dev:armhf \
libwayland-dev:armhf \
libx11-xcb-dev:armhf \
libxkbcommon-dev:armhf
fi
"${CONTAINER_EPHEMERAL[@]}" \
"${CONTAINER_ARCH_PACKAGES[@]}" \
${EXTRA_LOCAL_PACKAGES}
ROOTFS=/lava-files/rootfs-${DEBIAN_ARCH}
mkdir -p "$ROOTFS"
@@ -188,6 +196,7 @@ PKG_DEP=(
)
[ "$DEBIAN_ARCH" = "amd64" ] && PKG_ARCH=(
firmware-amd-graphics
firmware-misc-nonfree
libgl1 libglu1-mesa
inetutils-syslogd iptables libcap2
libfontconfig1
@@ -210,7 +219,11 @@ mmdebstrap \
--include "${PKG_BASE[*]} ${PKG_CI[*]} ${PKG_DEP[*]} ${PKG_MESA_DEP[*]} ${PKG_ARCH[*]}" \
bookworm \
"$ROOTFS/" \
"http://deb.debian.org/debian"
"http://deb.debian.org/debian" \
"deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main"
############### Install mold
. .gitlab-ci/container/build-mold.sh
############### Setuping
if [ "$DEBIAN_ARCH" = "amd64" ]; then
@@ -290,6 +303,12 @@ if [[ ${DEBIAN_ARCH} = "amd64" ]]; then
mv /usr/local/libexec/virgl* $ROOTFS/usr/local/libexec/
fi
############### Build ci-kdl
section_start kdl "Prepare a venv for kdl"
. .gitlab-ci/container/build-kdl.sh
mv ci-kdl.venv $ROOTFS
section_end kdl
############### Build local stuff for use by igt and kernel testing, which
############### will reuse most of our container build process from a specific
############### hash of the Mesa tree.
@@ -305,6 +324,11 @@ fi
rm -rf /root/.cargo
rm -rf /root/.rustup
############### Delete firmware files we don't need
if [ "$DEBIAN_ARCH" = "amd64" ]; then
dpkg -L firmware-misc-nonfree | grep -v "i915" | xargs rm || true
fi
############### Fill rootfs
cp .gitlab-ci/container/setup-rootfs.sh $ROOTFS/.
cp .gitlab-ci/container/strip-rootfs.sh $ROOTFS/.
@@ -323,25 +347,16 @@ if [ "${DEBIAN_ARCH}" = "arm64" ]; then
KERNEL_IMAGE_NAME+=" Image.gz"
fi
ROOTFSTAR="lava-rootfs.tar.zst"
du -ah "$ROOTFS" | sort -h | tail -100
pushd $ROOTFS
tar --zstd -cf /lava-files/lava-rootfs.tar.zst .
tar --zstd -cf /lava-files/${ROOTFSTAR} .
popd
. .gitlab-ci/container/container_post_build.sh
############### Upload the files!
FILES_TO_UPLOAD="lava-rootfs.tar.zst \
$KERNEL_IMAGE_NAME"
if [[ -n $DEVICE_TREES ]]; then
FILES_TO_UPLOAD="$FILES_TO_UPLOAD $(basename -a $DEVICE_TREES)"
fi
for f in $FILES_TO_UPLOAD; do
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" /lava-files/$f \
https://${S3_PATH}/$f
done
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" /lava-files/"${ROOTFSTAR}" \
https://${S3_PATH}/"${ROOTFSTAR}"
touch /lava-files/done
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" /lava-files/done https://${S3_PATH}/done

View File

@@ -1,4 +1,4 @@
From bf8ada0d15f94824ee1643d4e17a66dffdbaf2e5 Mon Sep 17 00:00:00 2001
From dc97ee83a813f6b170079ddf2a04bbb06221a5a7 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Fri, 26 Aug 2022 18:24:27 +0200
Subject: [PATCH 1/2] Allow running on Android from the command line
@@ -13,7 +13,6 @@ $ cmake -S . -B build/ -DDEQP_TARGET=android -DDEQP_TARGET_TOOLCHAIN=ndk-modern
$ ninja -C build modules/egl/deqp-egl
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
---
CMakeLists.txt | 36 ++-----------------
.../android/tcuAndroidNativeActivity.cpp | 36 ++++++++++---------
@@ -21,11 +20,11 @@ Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
3 files changed, 33 insertions(+), 51 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ff2bb9..8c76abb 100644
index f9c61d0db..d6ad2990b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,7 +249,7 @@ include_directories(
external/vulkancts/framework/vulkan/generated/vulkan
@@ -272,7 +272,7 @@ include_directories(
external/vulkancts/framework/vulkan
)
-if (DE_OS_IS_ANDROID OR DE_OS_IS_IOS)
@@ -33,7 +32,7 @@ index 1ff2bb9..8c76abb 100644
# On Android deqp modules are compiled as libraries and linked into final .so
set(DEQP_MODULE_LIBRARIES )
set(DEQP_MODULE_ENTRY_POINTS )
@@ -293,7 +293,7 @@ macro (add_deqp_module MODULE_NAME SRCS LIBS EXECLIBS ENTRY)
@@ -316,7 +316,7 @@ macro (add_deqp_module MODULE_NAME SRCS LIBS EXECLIBS ENTRY)
set(DEQP_MODULE_LIBRARIES ${DEQP_MODULE_LIBRARIES} PARENT_SCOPE)
set(DEQP_MODULE_ENTRY_POINTS ${DEQP_MODULE_ENTRY_POINTS} PARENT_SCOPE)
@@ -42,8 +41,8 @@ index 1ff2bb9..8c76abb 100644
# Executable target
add_executable(${MODULE_NAME} ${PROJECT_SOURCE_DIR}/framework/platform/tcuMain.cpp ${ENTRY})
target_link_libraries(${MODULE_NAME} PUBLIC "${EXECLIBS}" "${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}")
@@ -367,37 +367,7 @@ add_subdirectory(external/vulkancts/vkscpc)
add_subdirectory(external/openglcts)
@@ -390,37 +390,7 @@ add_subdirectory(external/vulkancts/vkscpc ${MAYBE_EXCLUDE_FROM_ALL})
add_subdirectory(external/openglcts ${MAYBE_EXCLUDE_FROM_ALL})
# Single-binary targets
-if (DE_OS_IS_ANDROID)
@@ -82,7 +81,7 @@ index 1ff2bb9..8c76abb 100644
set(DEQP_IOS_CODE_SIGN_IDENTITY "drawElements" CACHE STRING "Code sign identity for iOS build")
diff --git a/framework/platform/android/tcuAndroidNativeActivity.cpp b/framework/platform/android/tcuAndroidNativeActivity.cpp
index 6f8cd8f..b83e30f 100644
index 6f8cd8fc5..b83e30f41 100644
--- a/framework/platform/android/tcuAndroidNativeActivity.cpp
+++ b/framework/platform/android/tcuAndroidNativeActivity.cpp
@@ -116,23 +116,25 @@ namespace Android
@@ -129,7 +128,7 @@ index 6f8cd8f..b83e30f 100644
NativeActivity::~NativeActivity (void)
diff --git a/framework/platform/android/tcuAndroidPlatform.cpp b/framework/platform/android/tcuAndroidPlatform.cpp
index 69ab384..d7288f6 100644
index b8a35898c..cf02e6b70 100644
--- a/framework/platform/android/tcuAndroidPlatform.cpp
+++ b/framework/platform/android/tcuAndroidPlatform.cpp
@@ -22,6 +22,7 @@
@@ -149,7 +148,7 @@ index 69ab384..d7288f6 100644
return new NativeWindow(window, params.width, params.height, format);
}
@@ -286,6 +287,9 @@ static size_t getTotalSystemMemory (ANativeActivity* activity)
@@ -292,6 +293,9 @@ static size_t getTotalSystemMemory (ANativeActivity* activity)
try
{
@@ -159,7 +158,7 @@ index 69ab384..d7288f6 100644
const size_t totalMemory = getTotalAndroidSystemMemory(activity);
print("Device has %.2f MiB of system memory\n", static_cast<double>(totalMemory) / static_cast<double>(MiB));
return totalMemory;
@@ -382,3 +386,9 @@ bool Platform::hasDisplay (vk::wsi::Type wsiType) const
@@ -388,3 +392,9 @@ bool Platform::hasDisplay (vk::wsi::Type wsiType) const
} // Android
} // tcu
@@ -170,5 +169,5 @@ index 69ab384..d7288f6 100644
+ return new tcu::Android::Platform(activity);
+}
--
2.39.1
2.42.0

View File

@@ -1,16 +1,15 @@
From c2d5252f4a8be94720235feb9e358ecb0a2e8e11 Mon Sep 17 00:00:00 2001
From a602822c53e22e985f942f843ccadbfb64613212 Mon Sep 17 00:00:00 2001
From: Helen Koike <helen.koike@collabora.com>
Date: Tue, 27 Sep 2022 12:35:22 -0300
Subject: [PATCH 2/2] Android prints to stdout instead of logcat
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
---
framework/qphelper/qpDebugOut.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framework/qphelper/qpDebugOut.c b/framework/qphelper/qpDebugOut.c
index 6579e9f..c200c6f 100644
index 6579e9f48..c200c6f6b 100644
--- a/framework/qphelper/qpDebugOut.c
+++ b/framework/qphelper/qpDebugOut.c
@@ -98,7 +98,7 @@ void qpDiev (const char* format, va_list args)
@@ -23,5 +22,5 @@ index 6579e9f..c200c6f 100644
#include <android/log.h>
--
2.39.1
2.42.0

View File

@@ -1,111 +0,0 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
CONFIG_PWM=y
CONFIG_PM_DEVFREQ=y
CONFIG_OF=y
CONFIG_CROS_EC=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
CONFIG_DEVFREQ_GOV_POWERSAVE=y
CONFIG_DEVFREQ_GOV_USERSPACE=y
CONFIG_DEVFREQ_GOV_PASSIVE=y
CONFIG_DRM=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_PWM_CROS_EC=y
CONFIG_BACKLIGHT_PWM=y
# Strip out some stuff we don't need for graphics testing, to reduce
# the build.
CONFIG_CAN=n
CONFIG_WIRELESS=n
CONFIG_RFKILL=n
CONFIG_WLAN=n
CONFIG_REGULATOR_FAN53555=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_VCTRL=y
CONFIG_KASAN=n
CONFIG_KASAN_INLINE=n
CONFIG_STACKTRACE=n
CONFIG_TMPFS=y
CONFIG_PROVE_LOCKING=n
CONFIG_DEBUG_LOCKDEP=n
CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_USB_USBNET=y
CONFIG_NETDEVICES=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_RTL8152=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB_GADGET=y
CONFIG_USB_ETH=y
CONFIG_FW_LOADER_COMPRESS=y
# options for AMD devices
CONFIG_X86_AMD_PLATFORM_DEVICE=y
CONFIG_ACPI_VIDEO=y
CONFIG_X86_AMD_FREQ_SENSITIVITY=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_AMD=y
CONFIG_DRM_AMDGPU=m
CONFIG_DRM_AMDGPU_SI=y
CONFIG_DRM_AMDGPU_USERPTR=y
CONFIG_DRM_AMD_ACP=n
CONFIG_ACPI_WMI=y
CONFIG_MXM_WMI=y
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y
CONFIG_PARPORT_SERIAL=y
CONFIG_SERIAL_8250_DW=y
CONFIG_CHROME_PLATFORMS=y
CONFIG_KVM_AMD=m
#options for Intel devices
CONFIG_MFD_INTEL_LPSS_PCI=y
CONFIG_KVM_INTEL=m
#options for KVM guests
CONFIG_FUSE_FS=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_KVM=y
CONFIG_KVM_GUEST=y
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO_FS=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_PARAVIRT=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTUALIZATION=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_TUN=y
CONFIG_VSOCKETS=y
CONFIG_VIRTIO_VSOCKETS=y
CONFIG_VHOST_VSOCK=m

View File

@@ -126,7 +126,15 @@ if [ "$PIGLIT_PLATFORM" = "gbm" ]; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/gbm-skips.txt"
fi
if [ -n "$VK_DRIVER" ] && [ -z "$DEQP_SUITE" ]; then
# Bump the number of tests per group to reduce the startup time of VKCTS.
DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --tests-per-group ${DEQP_RUNNER_TESTS_PER_GROUP:-5000}"
fi
# Set the path to VK validation layer settings (in case it ends up getting loaded)
# Note: If you change the format of this filename, look through the rest of the
# tree for other places that need to be kept in sync (e.g.
# src/gallium/drivers/zink/ci/gitlab-ci-inc.yml)
export VK_LAYER_SETTINGS_PATH=$INSTALL/$GPU_VERSION-validation-settings.txt
report_load() {
@@ -154,13 +162,15 @@ if [ -z "$DEQP_SUITE" ]; then
export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --renderer-check $DEQP_EXPECTED_RENDERER"
fi
if [ $DEQP_VER != vk ] && [ $DEQP_VER != egl ]; then
VER=$(sed 's/[() ]/./g' "$INSTALL/VERSION")
VER=$(sed 's/[() ]/./g' "$INSTALL/VERSION")
export DEQP_RUNNER_OPTIONS="$DEQP_RUNNER_OPTIONS --version-check $VER"
fi
fi
uncollapsed_section_switch deqp "deqp: deqp-runner"
cat /deqp/version-log
set +e
if [ -z "$DEQP_SUITE" ]; then
deqp-runner \
@@ -172,10 +182,14 @@ if [ -z "$DEQP_SUITE" ]; then
--flakes $INSTALL/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \
--jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS \
$DEQP_RUNNER_OPTIONS \
-- \
$DEQP_OPTIONS
else
# If you change the format of the suite toml filenames or the
# $GPU_VERSION-{fails,flakes,skips}.txt filenames, look through the rest
# of the tree for other places that need to be kept in sync (e.g.
# src/**/ci/gitlab-ci*.yml)
deqp-runner \
suite \
--suite $INSTALL/deqp-$DEQP_SUITE.toml \
@@ -184,12 +198,13 @@ else
--flakes $INSTALL/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \
--fraction-start $CI_NODE_INDEX \
--fraction $((CI_NODE_TOTAL * ${DEQP_FRACTION:-1})) \
--fraction $((CI_NODE_TOTAL * ${DEQP_FRACTION:-1})) \
--jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS
$DEQP_RUNNER_OPTIONS
fi
DEQP_EXITCODE=$?
set -e
set +x
@@ -215,7 +230,7 @@ deqp-runner junit \
--results $RESULTS/failures.csv \
--output $RESULTS/junit.xml \
--limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
# Report the flakes to the IRC channel for monitoring (if configured):
if [ -n "$FLAKES_CHANNEL" ]; then
@@ -229,7 +244,7 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--job "$CI_JOB_ID" \
--url "$CI_JOB_URL" \
--branch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-$CI_COMMIT_BRANCH}" \
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}" || true
fi
# Compress results.csv to save on bandwidth during the upload of artifacts to

View File

@@ -15,7 +15,7 @@ fi
TMP_DIR=$(mktemp -d)
echo "Downloading archived master..."
echo "$(date +"%F %T") Downloading archived master..."
if ! /usr/bin/wget \
-O "$TMP_DIR/$CI_PROJECT_NAME.tar.gz" \
"https://${S3_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.tar.gz";
@@ -27,8 +27,10 @@ fi
set -e
rm -rf "$CI_PROJECT_DIR"
echo "Extracting tarball into '$CI_PROJECT_DIR'..."
echo "$(date +"%F %T") Extracting tarball into '$CI_PROJECT_DIR'..."
mkdir -p "$CI_PROJECT_DIR"
tar xzf "$TMP_DIR/$CI_PROJECT_NAME.tar.gz" -C "$CI_PROJECT_DIR"
rm -rf "$TMP_DIR"
chmod a+w "$CI_PROJECT_DIR"
echo "$(date +"%F %T") Git cache download done"

View File

@@ -1,3 +1,33 @@
# The logic for each $FARM is as follows:
#
# If the disable file exists, we are disabling the farm, or it's already
# disabled:
# - exists: [ .ci-farms-disabled/$FARM ]
# when: never
#
# Otherwise, changing the disable file means removing it, so we are
# re-enabling the farm:
# - changes: [ .ci-farms-disabled/$FARM ]
# if: '$CI_PIPELINE_SOURCE != "schedule"'
# when: on_success
# Note: the "manual" variant of each farm rules changes the above to `never`,
# so that jobs meant to be manual don't run in re-enablement MRs. This is the
# only difference between `.$FARM-farm-rules` and `.$FARM-farm-manual-rules`.
#
# If any other disable file is modified, we are disabling/re-enabling another
# farm:
# - changes: [ .ci-farms-disabled/* ]
# if: '$CI_PIPELINE_SOURCE != "schedule"'
# when: never
#
# The `not schedule` condition is there to make sure scheduled pipelines
# contains all the jobs, as `changes` conditions in scheduled pipelines are
# always evaluated to `true`.
#
# The "fallback", if none of these rules match, is usually the list of files
# that are used by a driver. See the various `.$DRIVER-rules` in the
# corresponding `src/**/ci/gitlab-ci.yml`.
.microsoft-farm-rules:
rules:
- exists: [ .ci-farms-disabled/microsoft ] # 1. Is disabled, never run
@@ -28,29 +58,41 @@
- exists: [ .ci-farms-disabled/microsoft ]
when: never
- changes: [ .ci-farms-disabled/microsoft ]
if: '$CI_PIPELINE_SOURCE != "schedule"'
if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
when: on_success
- !reference [.microsoft-farm-rules, rules]
- changes: [ .ci-farms-disabled/microsoft ]
if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
when: on_success
- changes: [ .ci-farms-disabled/microsoft ]
if: '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
when: on_success
- changes: [ .ci-farms-disabled/* ]
if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
when: never
- changes: [ .ci-farms-disabled/* ]
if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- changes: [ .ci-farms-disabled/* ]
if: '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
when: never
.collabora-farm-rules:
rules:
- if: '$RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
exists: [ .ci-farms-disabled/collabora ]
- exists: [ .ci-farms-disabled/collabora ]
when: never
- if: '$RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/ && $CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE != "schedule"'
changes: [ .ci-farms-disabled/collabora ]
when: on_success
- if: '$RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/ && $CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE != "schedule"'
changes: [ .ci-farms-disabled/* ]
when: never
.collabora-farm-manual-rules:
rules:
- if: '$RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/'
exists: [ .ci-farms-disabled/collabora ]
- exists: [ .ci-farms-disabled/collabora ]
when: never
- if: '$RUNNER_TAG =~ /^mesa-ci-x86-64-lava-/ && $CI_PIPELINE_SOURCE != "schedule"'
- if: '$CI_PIPELINE_SOURCE != "schedule"'
changes: [ .ci-farms-disabled/collabora ]
when: never
- !reference [.collabora-farm-rules, rules]
@@ -195,3 +237,82 @@
when: never
- !reference [.freedreno-farm-rules, rules]
.ondracka-farm-rules:
rules:
- exists: [ .ci-farms-disabled/ondracka ]
when: never
- changes: [ .ci-farms-disabled/ondracka ]
if: '$CI_PIPELINE_SOURCE != "schedule"'
when: on_success
- changes: [ .ci-farms-disabled/* ]
if: '$CI_PIPELINE_SOURCE != "schedule"'
when: never
.ondracka-farm-manual-rules:
rules:
- exists: [ .ci-farms-disabled/ondracka ]
when: never
- changes: [ .ci-farms-disabled/ondracka ]
if: '$CI_PIPELINE_SOURCE != "schedule"'
when: never
- !reference [.ondracka-farm-rules, rules]
# Skip container & build jobs when disabling any farm, and run them if any
# farm gets re-enabled.
# Only apply these rules in MR context, because otherwise we get a false
# positive on files being 'created' when pushing to a new branch, and break
# our pipeline
.disable-farm-mr-rules:
rules:
# changes(disabled) + exists(disabled) = disabling the farm
# Note: this cannot be simplified into a single `.ci-farms-disabled/*` rule
# because if there are more than one disabled farm and we only re-enable
# one, the exits(.ci-farms-disabled/*) would match and what should be
# a farm re-enable pipeline will be detected as a farm disable pipeline.
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/microsoft ]
exists: [ .ci-farms-disabled/microsoft ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/collabora ]
exists: [ .ci-farms-disabled/collabora ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/igalia ]
exists: [ .ci-farms-disabled/igalia ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/lima ]
exists: [ .ci-farms-disabled/lima ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/anholt ]
exists: [ .ci-farms-disabled/anholt ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/valve-mupuf ]
exists: [ .ci-farms-disabled/valve-mupuf ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/valve-kws ]
exists: [ .ci-farms-disabled/valve-kws ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/austriancoder ]
exists: [ .ci-farms-disabled/austriancoder ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/freedreno ]
exists: [ .ci-farms-disabled/freedreno ]
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes: [ .ci-farms-disabled/ondracka ]
exists: [ .ci-farms-disabled/ondracka ]
when: never
# Any other change to ci-farms/* means some farm is getting re-enabled.
# Run jobs in Marge pipelines (and let it fallback to manual otherwise)
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $GITLAB_USER_LOGIN == "marge-bot"'
changes: [ .ci-farms/* ]
when: on_success

View File

@@ -55,7 +55,7 @@ deqp-runner junit \
--results $RESULTS/failures.csv \
--output $RESULTS/junit.xml \
--limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
# Report the flakes to the IRC channel for monitoring (if configured):
if [ -n "$FLAKES_CHANNEL" ]; then
@@ -69,7 +69,7 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--job "$CI_JOB_ID" \
--url "$CI_JOB_URL" \
--branch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-$CI_COMMIT_BRANCH}" \
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}" || true
fi
exit $GTEST_EXITCODE

View File

@@ -1,12 +1,16 @@
# Keep the tags below under 25-30 chars each, as they end up combined into
# docker image tags, and docker has a length limit of 128 chars total in tags.
#
# If you update a tag and you get an error like this:
# cannot parse input: "$image:$tag": invalid reference format
# check the length of $tag; if it's > 128 chars you need to shorten your tag.
variables:
DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base"
DEBIAN_BASE_TAG: "2023-08-30-bindgen-cli"
DEBIAN_BASE_TAG: "2024-01-10-deb-fix"
DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build"
DEBIAN_BUILD_TAG: "2023-06-24-agility-711"
DEBIAN_X86_64_BUILD_MINGW_IMAGE_PATH: "debian/x86_64_build-mingw"
DEBIAN_BUILD_MINGW_TAG: "2023-05-25-bookworm"
DEBIAN_BUILD_TAG: "2024-01-04-find"
DEBIAN_X86_64_TEST_BASE_IMAGE: "debian/x86_64_test-base"
@@ -14,20 +18,23 @@ variables:
DEBIAN_X86_64_TEST_IMAGE_VK_PATH: "debian/x86_64_test-vk"
DEBIAN_X86_64_TEST_ANDROID_IMAGE_PATH: "debian/x86_64_test-android"
DEBIAN_X86_64_TEST_ANDROID_TAG: "2023-06-07-deqp"
DEBIAN_X86_64_TEST_GL_TAG: "2023-07-02-apitrace-lto"
DEBIAN_X86_64_TEST_VK_TAG: "2023-07-08-weston-0"
DEBIAN_X86_64_TEST_ANDROID_TAG: "2024-01-04-default"
DEBIAN_X86_64_TEST_GL_TAG: "2024-01-04-default"
DEBIAN_X86_64_TEST_VK_TAG: "2024-01-04-default"
ALPINE_X86_64_BUILD_TAG: "2023-05-01-3.18-bump-1"
ALPINE_X86_64_BUILD_TAG: "2023-01-07-libdrm2_4_119"
ALPINE_X86_64_LAVA_SSH_TAG: "2023-06-26-first-version"
FEDORA_X86_64_BUILD_TAG: "2023-05-05-ccache-on"
KERNEL_ROOTFS_TAG: "2023-07-10-virglrenderer"
FEDORA_X86_64_BUILD_TAG: "2024-01-06-libdrm"
KERNEL_ROOTFS_TAG: "2024-01-10-default"
KERNEL_TAG: "v6.6.4-for-mesa-ci-e4f4c500f7fb"
KERNEL_REPO: "gfx-ci/linux"
PKG_REPO_REV: "67f2c46b"
WINDOWS_X64_VS_PATH: "windows/x64_vs"
WINDOWS_X64_VS_TAG: "2022-10-20-upgrade-zlib"
WINDOWS_X64_MSVC_PATH: "windows/x86_64_msvc"
WINDOWS_X64_MSVC_TAG: "2023-12-22-msvc"
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
WINDOWS_X64_BUILD_TAG: "2023-06-24-agility-711"
WINDOWS_X64_BUILD_PATH: "windows/x86_64_build"
WINDOWS_X64_BUILD_TAG: "2023-12-22-msvc"
WINDOWS_X64_TEST_PATH: "windows/x64_test"
WINDOWS_X64_TEST_TAG: "2023-05-30-warp-1.0.7.1"
WINDOWS_X64_TEST_PATH: "windows/x86_64_test"
WINDOWS_X64_TEST_TAG: "2023-12-22-msvc"

View File

@@ -116,6 +116,8 @@ variables:
.lava-traces-base:
variables:
HWCI_TEST_SCRIPT: "/install/piglit/piglit-traces.sh"
# until we overcome Infrastructure issues, give traces extra 5 min before timeout
DEVICE_HANGING_TIMEOUT_SEC: 600
artifacts:
reports:
junit: results/junit.xml

View File

@@ -21,12 +21,12 @@ mkdir -p results/job-rootfs-overlay/
cp artifacts/ci-common/capture-devcoredump.sh results/job-rootfs-overlay/
cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/
cp artifacts/ci-common/intel-gpu-freq.sh results/job-rootfs-overlay/
cp artifacts/ci-common/kdl.sh results/job-rootfs-overlay/
cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/
# Prepare env vars for upload.
section_start variables "Variables passed through:"
KERNEL_IMAGE_BASE_URL="https://${BASE_SYSTEM_HOST_PATH}" \
artifacts/ci-common/generate-env.sh | tee results/job-rootfs-overlay/set-job-env-vars.sh
artifacts/ci-common/generate-env.sh | tee results/job-rootfs-overlay/set-job-env-vars.sh
section_end variables
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
@@ -41,7 +41,8 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
--dump-yaml \
--pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
--rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--kernel-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--kernel-url-prefix "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}" \
--kernel-external "${FORCE_KERNEL_TAG}" \
--build-url "${ARTIFACT_URL}" \
--job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \
--job-timeout-min ${JOB_TIMEOUT:-30} \
@@ -58,4 +59,5 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
--mesa-job-name "$CI_JOB_NAME" \
--structured-log-file "results/lava_job_detail.json" \
--ssh-client-image "${LAVA_SSH_CLIENT_IMAGE}" \
--project-name "${CI_PROJECT_NAME}" \
>> results/lava.log

View File

@@ -17,32 +17,32 @@ import time
from collections import defaultdict
from dataclasses import dataclass, fields
from datetime import datetime, timedelta
from io import StringIO
from os import environ, getenv, path
from typing import Any, Optional
import fire
from lavacli.utils import flow_yaml as lava_yaml
from lava.exceptions import (
MesaCIException,
MesaCIParseException,
MesaCIRetryError,
MesaCITimeoutError,
)
from lava.utils import CONSOLE_LOG
from lava.utils import DEFAULT_GITLAB_SECTION_TIMEOUTS as GL_SECTION_TIMEOUTS
from lava.utils import (
CONSOLE_LOG,
GitlabSection,
LAVAJob,
LAVAJobDefinition,
LogFollower,
LogSectionType,
call_proxy,
fatal_err,
generate_lava_job_definition,
hide_sensitive_data,
print_log,
setup_lava_proxy,
)
from lavacli.utils import flow_yaml as lava_yaml
from lava.utils import DEFAULT_GITLAB_SECTION_TIMEOUTS as GL_SECTION_TIMEOUTS
# Initialize structural logging with a defaultdict, it can be changed for more
# sophisticated dict-like data abstractions.
@@ -58,7 +58,7 @@ except ImportError as e:
# Timeout in seconds to decide if the device from the dispatched LAVA job has
# hung or not due to the lack of new log output.
DEVICE_HANGING_TIMEOUT_SEC = int(getenv("LAVA_DEVICE_HANGING_TIMEOUT_SEC", 5*60))
DEVICE_HANGING_TIMEOUT_SEC = int(getenv("DEVICE_HANGING_TIMEOUT_SEC", 5*60))
# How many seconds the script should wait before try a new polling iteration to
# check if the dispatched LAVA job is running or waiting in the job queue.
@@ -370,6 +370,7 @@ class LAVAJobSubmitter(PathResolver):
kernel_image_name: str = None
kernel_image_type: str = ""
kernel_url_prefix: str = None
kernel_external: str = None
lava_tags: str = "" # Comma-separated LAVA tags for the job
mesa_job_name: str = "mesa_ci_job"
pipeline_info: str = ""
@@ -379,6 +380,7 @@ class LAVAJobSubmitter(PathResolver):
job_rootfs_overlay_url: str = None
structured_log_file: pathlib.Path = None # Log file path with structured LAVA log
ssh_client_image: str = None # x86_64 SSH client image to follow the job's output
project_name: str = None # Project name to be used in the job name
__structured_log_context = contextlib.nullcontext() # Structured Logger context
def __post_init__(self) -> None:
@@ -402,7 +404,7 @@ class LAVAJobSubmitter(PathResolver):
minutes=self.job_timeout_min
)
job_definition = generate_lava_job_definition(self)
job_definition = LAVAJobDefinition(self).generate_lava_job_definition()
if self.dump_yaml:
self.dump_job_definition(job_definition)
@@ -456,10 +458,8 @@ class LAVAJobSubmitter(PathResolver):
self.finish_script(last_attempt_job)
def print_log_artifact_url(self):
base_url = "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/"
artifacts_path = "-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/"
relative_log_path = self.structured_log_file.relative_to(pathlib.Path.cwd())
full_path = f"{base_url}{artifacts_path}{relative_log_path}"
full_path = f"$ARTIFACTS_BASE_URL/{relative_log_path}"
artifact_url = path.expandvars(full_path)
print_log(f"Structural Logging data available at: {artifact_url}")

View File

@@ -1,7 +1,7 @@
from .console_format import CONSOLE_LOG
from .gitlab_section import GitlabSection
from .lava_job import LAVAJob
from .lava_job_definition import generate_lava_job_definition
from .lava_job_definition import LAVAJobDefinition
from .lava_proxy import call_proxy, setup_lava_proxy
from .log_follower import (
LogFollower,

View File

@@ -0,0 +1,14 @@
from os import getenv
# How many attempts should be made when a timeout happen during LAVA device boot.
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
# Supports any integers in [0, 100].
# The scheduler considers the job priority when ordering the queue
# to consider which job should run next.
JOB_PRIORITY = int(getenv("JOB_PRIORITY", 75))
# Use UART over the default SSH mechanism to follow logs.
# Caution: this can lead to device silence in some devices in Mesa CI.
FORCE_UART = bool(getenv("LAVA_FORCE_UART", False))

View File

@@ -1,150 +1,216 @@
from io import StringIO
from typing import TYPE_CHECKING, Any
import re
from lava.utils.lava_farm import LavaFarm, get_lava_farm
from ruamel.yaml.scalarstring import LiteralScalarString
from ruamel.yaml import YAML
from os import getenv
from lava.utils.lava_farm import LavaFarm, get_lava_farm
from lava.utils.ssh_job_definition import (
generate_docker_test,
generate_dut_test,
wrap_boot_action,
wrap_final_deploy_action,
)
from lava.utils.uart_job_definition import (
fastboot_boot_action,
fastboot_deploy_actions,
tftp_boot_action,
tftp_deploy_actions,
uart_test_actions,
)
if TYPE_CHECKING:
from lava.lava_job_submitter import LAVAJobSubmitter
# How many attempts should be made when a timeout happen during LAVA device boot.
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
# Supports any integers in [0, 100].
# The scheduler considers the job priority when ordering the queue
# to consider which job should run next.
JOB_PRIORITY = int(getenv("LAVA_JOB_PRIORITY", 75))
from .constants import FORCE_UART, JOB_PRIORITY, NUMBER_OF_ATTEMPTS_LAVA_BOOT
def has_ssh_support(job_submitter: "LAVAJobSubmitter") -> bool:
force_uart = bool(getenv("LAVA_FORCE_UART", False))
if force_uart:
return False
# Only Collabora's farm supports to run docker container as a LAVA actions,
# which is required to follow the job in a SSH section
current_farm = get_lava_farm()
# SSH job definition still needs to add support for fastboot.
job_uses_fastboot: bool = job_submitter.boot_method == "fastboot"
return current_farm == LavaFarm.COLLABORA and not job_uses_fastboot
def generate_lava_yaml_payload(job_submitter: "LAVAJobSubmitter") -> dict[str, Any]:
class LAVAJobDefinition:
"""
Bridge function to use the supported job definition depending on some Mesa
CI job characteristics.
The strategy here, is to use LAVA with a containerized SSH session to follow
the job output, escaping from dumping data to the UART, which proves to be
error prone in some devices.
This class is responsible for generating the YAML payload to submit a LAVA
job.
"""
from lava.utils.ssh_job_definition import (
generate_lava_yaml_payload as ssh_lava_yaml,
)
from lava.utils.uart_job_definition import (
generate_lava_yaml_payload as uart_lava_yaml,
)
if has_ssh_support(job_submitter):
return ssh_lava_yaml(job_submitter)
def __init__(self, job_submitter: "LAVAJobSubmitter") -> None:
self.job_submitter: "LAVAJobSubmitter" = job_submitter
return uart_lava_yaml(job_submitter)
def has_ssh_support(self) -> bool:
if FORCE_UART:
return False
# Only Collabora's farm supports to run docker container as a LAVA actions,
# which is required to follow the job in a SSH section
current_farm = get_lava_farm()
def generate_lava_job_definition(job_submitter: "LAVAJobSubmitter") -> str:
job_stream = StringIO()
yaml = YAML()
yaml.width = 4096
yaml.dump(generate_lava_yaml_payload(job_submitter), job_stream)
return job_stream.getvalue()
return current_farm == LavaFarm.COLLABORA
def generate_lava_yaml_payload(self) -> dict[str, Any]:
"""
Generates a YAML payload for submitting a LAVA job, based on the provided arguments.
def to_yaml_block(steps_array: list[str], escape_vars=[]) -> LiteralScalarString:
def escape_envvar(match):
return "\\" + match.group(0)
Args:
None
filtered_array = [s for s in steps_array if s.strip() and not s.startswith("#")]
final_str = "\n".join(filtered_array)
Returns:
a dictionary containing the values generated by the `generate_metadata` function and the
actions for the LAVA job submission.
"""
args = self.job_submitter
values = self.generate_metadata()
nfsrootfs = {
"url": f"{args.rootfs_url_prefix}/lava-rootfs.tar.zst",
"compression": "zstd",
}
for escape_var in escape_vars:
# Find env vars and add '\\' before them
final_str = re.sub(rf"\${escape_var}*", escape_envvar, final_str)
return LiteralScalarString(final_str)
init_stage1_steps = self.init_stage1_steps()
artifact_download_steps = self.artifact_download_steps()
deploy_actions = []
boot_action = []
test_actions = uart_test_actions(args, init_stage1_steps, artifact_download_steps)
def generate_metadata(args) -> dict[str, Any]:
# General metadata and permissions
values = {
"job_name": f"mesa: {args.pipeline_info}",
"device_type": args.device_type,
"visibility": {"group": [args.visibility_group]},
"priority": JOB_PRIORITY,
"context": {
"extra_nfsroot_args": " init=/init rootwait usbcore.quirks=0bda:8153:k"
},
"timeouts": {
"job": {"minutes": args.job_timeout_min},
"actions": {
"depthcharge-retry": {
# Could take between 1 and 1.5 min in slower boots
"minutes": 4
},
"depthcharge-start": {
# Should take less than 1 min.
"minutes": 1,
},
"depthcharge-action": {
# This timeout englobes the entire depthcharge timing,
# including retries
"minutes": 5
* NUMBER_OF_ATTEMPTS_LAVA_BOOT,
},
},
},
}
if args.boot_method == "fastboot":
deploy_actions = fastboot_deploy_actions(self, nfsrootfs)
boot_action = fastboot_boot_action(args)
else: # tftp
deploy_actions = tftp_deploy_actions(self, nfsrootfs)
boot_action = tftp_boot_action(args)
if args.lava_tags:
values["tags"] = args.lava_tags.split(",")
if self.has_ssh_support():
wrap_final_deploy_action(deploy_actions[-1])
# SSH jobs use namespaces to differentiate between the DUT and the
# docker container. Every LAVA action needs an explicit namespace, when we are not using
# the default one.
for deploy_action in deploy_actions:
deploy_action["namespace"] = "dut"
wrap_boot_action(boot_action)
test_actions = (
generate_dut_test(args, init_stage1_steps),
generate_docker_test(args, artifact_download_steps),
)
return values
def artifact_download_steps(args):
"""
This function is responsible for setting up the SSH server in the DUT and to
export the first boot environment to a file.
"""
# Putting JWT pre-processing and mesa download, within init-stage1.sh file,
# as we do with non-SSH version.
download_steps = [
"set -ex",
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
f"{args.job_rootfs_overlay_url} | tar -xz -C /",
f"mkdir -p {args.ci_project_dir}",
f"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 {args.build_url} | "
f"tar --zstd -x -C {args.ci_project_dir}",
]
# If the JWT file is provided, we will use it to authenticate with the cloud
# storage provider and will hide it from the job output in Gitlab.
if args.jwt_file:
with open(args.jwt_file) as jwt_file:
download_steps += [
"set +x # HIDE_START",
f'echo -n "{jwt_file.read()}" > "{args.jwt_file}"',
"set -x # HIDE_END",
f'echo "export CI_JOB_JWT_FILE={args.jwt_file}" >> /set-job-env-vars.sh',
]
else:
download_steps += [
"echo Could not find jwt file, disabling S3 requests...",
"sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh",
values["actions"] = [
*[{"deploy": d} for d in deploy_actions],
{"boot": boot_action},
*[{"test": t} for t in test_actions],
]
return download_steps
return values
def generate_lava_job_definition(self) -> str:
"""
Generates a LAVA job definition in YAML format and returns it as a string.
Returns:
a string representation of the job definition generated by analysing job submitter
arguments and environment variables
"""
job_stream = StringIO()
yaml = YAML()
yaml.width = 4096
yaml.dump(self.generate_lava_yaml_payload(), job_stream)
return job_stream.getvalue()
def generate_metadata(self) -> dict[str, Any]:
# General metadata and permissions
values = {
"job_name": f"{self.job_submitter.project_name}: {self.job_submitter.pipeline_info}",
"device_type": self.job_submitter.device_type,
"visibility": {"group": [self.job_submitter.visibility_group]},
"priority": JOB_PRIORITY,
"context": {"extra_nfsroot_args": " init=/init rootwait usbcore.quirks=0bda:8153:k"},
"timeouts": {
"job": {"minutes": self.job_submitter.job_timeout_min},
"actions": {
"depthcharge-retry": {
# Could take between 1 and 1.5 min in slower boots
"minutes": 4
},
"depthcharge-start": {
# Should take less than 1 min.
"minutes": 1,
},
"depthcharge-action": {
# This timeout englobes the entire depthcharge timing,
# including retries
"minutes": 5
* NUMBER_OF_ATTEMPTS_LAVA_BOOT,
},
},
},
}
if self.job_submitter.lava_tags:
values["tags"] = self.job_submitter.lava_tags.split(",")
return values
def attach_kernel_and_dtb(self, deploy_field):
if self.job_submitter.kernel_image_type:
deploy_field["kernel"]["type"] = self.job_submitter.kernel_image_type
if self.job_submitter.dtb_filename:
deploy_field["dtb"] = {
"url": f"{self.job_submitter.kernel_url_prefix}/"
f"{self.job_submitter.dtb_filename}.dtb"
}
def attach_external_modules(self, deploy_field):
if self.job_submitter.kernel_external:
deploy_field["modules"] = {
"url": f"{self.job_submitter.kernel_url_prefix}/modules.tar.zst",
"compression": "zstd"
}
def artifact_download_steps(self):
"""
This function is responsible for setting up the SSH server in the DUT and to
export the first boot environment to a file.
"""
# Putting JWT pre-processing and mesa download, within init-stage1.sh file,
# as we do with non-SSH version.
download_steps = [
"set -ex",
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
f"{self.job_submitter.job_rootfs_overlay_url} | tar -xz -C /",
f"mkdir -p {self.job_submitter.ci_project_dir}",
f"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 {self.job_submitter.build_url} | "
f"tar --zstd -x -C {self.job_submitter.ci_project_dir}",
]
# If the JWT file is provided, we will use it to authenticate with the cloud
# storage provider and will hide it from the job output in Gitlab.
if self.job_submitter.jwt_file:
with open(self.job_submitter.jwt_file) as jwt_file:
download_steps += [
"set +x # HIDE_START",
f'echo -n "{jwt_file.read()}" > "{self.job_submitter.jwt_file}"',
"set -x # HIDE_END",
f'echo "export CI_JOB_JWT_FILE={self.job_submitter.jwt_file}" >> /set-job-env-vars.sh',
]
else:
download_steps += [
"echo Could not find jwt file, disabling S3 requests...",
"sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh",
]
return download_steps
def init_stage1_steps(self) -> list[str]:
run_steps = []
# job execution script:
# - inline .gitlab-ci/common/init-stage1.sh
# - fetch and unpack per-pipeline build artifacts from build job
# - fetch and unpack per-job environment from lava-submit.sh
# - exec .gitlab-ci/common/init-stage2.sh
with open(self.job_submitter.first_stage_init, "r") as init_sh:
run_steps += [x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()]
# We cannot distribute the Adreno 660 shader firmware inside rootfs,
# since the license isn't bundled inside the repository
if self.job_submitter.device_type == "sm8350-hdk":
run_steps.append(
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
+ "https://github.com/allahjasif1990/hdk888-firmware/raw/main/a660_zap.mbn "
+ '-o "/lib/firmware/qcom/sm8350/a660_zap.mbn"'
)
return run_steps

View File

@@ -28,15 +28,15 @@ script after sourcing "dut-env-vars.sh" again for the second SSH test case.
"""
from pathlib import Path
from typing import Any
import re
from typing import TYPE_CHECKING, Any, Iterable
from .lava_job_definition import (
NUMBER_OF_ATTEMPTS_LAVA_BOOT,
artifact_download_steps,
generate_metadata,
to_yaml_block,
)
from ruamel.yaml.scalarstring import LiteralScalarString
from .constants import NUMBER_OF_ATTEMPTS_LAVA_BOOT
if TYPE_CHECKING:
from ..lava_job_submitter import LAVAJobSubmitter
# Very early SSH server setup. Uses /dut_ready file to flag it is done.
SSH_SERVER_COMMANDS = {
@@ -79,12 +79,23 @@ lava_ssh_test_case() {
]
def generate_dut_test(args):
def to_yaml_block(steps_array: Iterable[str], escape_vars=[]) -> LiteralScalarString:
def escape_envvar(match):
return "\\" + match.group(0)
filtered_array = [s for s in steps_array if s.strip() and not s.startswith("#")]
final_str = "\n".join(filtered_array)
for escape_var in escape_vars:
# Find env vars and add '\\' before them
final_str = re.sub(rf"\${escape_var}*", escape_envvar, final_str)
return LiteralScalarString(final_str)
def generate_dut_test(args: "LAVAJobSubmitter", first_stage_steps: list[str]) -> dict[str, Any]:
# Commands executed on DUT.
# Trying to execute the minimal number of commands, because the console data is
# retrieved via UART, which is hang-prone in some devices.
first_stage_steps: list[str] = Path(args.first_stage_init).read_text().splitlines()
return {
"namespace": "dut",
"definitions": [
@@ -109,7 +120,9 @@ def generate_dut_test(args):
}
def generate_docker_test(args):
def generate_docker_test(
args: "LAVAJobSubmitter", artifact_download_steps: list[str]
) -> dict[str, Any]:
# This is a growing list of commands that will be executed by the docker
# guest, which will be the SSH client.
docker_commands = []
@@ -148,14 +161,14 @@ def generate_docker_test(args):
(
"lava_ssh_test_case 'artifact_download' 'bash --' << EOF",
"source /dut-env-vars.sh",
*artifact_download_steps(args),
*artifact_download_steps,
"EOF",
)
),
"export SSH_PTY_ARGS=-tt",
# Putting CI_JOB name as the testcase name, it may help LAVA farm
# maintainers with monitoring
f"lava_ssh_test_case 'mesa-ci_{args.mesa_job_name}' "
f"lava_ssh_test_case '{args.project_name}_{args.mesa_job_name}' "
# Changing directory to /, as the HWCI_SCRIPT expects that
"'\"cd / && /init-stage2.sh\"'",
]
@@ -163,46 +176,21 @@ def generate_docker_test(args):
return init_stages_test
def generate_lava_yaml_payload(args) -> dict[str, Any]:
values = generate_metadata(args)
# URLs to our kernel rootfs to boot from, both generated by the base
# container build
deploy = {
def wrap_final_deploy_action(final_deploy_action: dict):
wrap = {
"namespace": "dut",
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
"timeout": {"minutes": 10},
"timeouts": {"http-download": {"minutes": 2}},
"to": "tftp",
"os": "oe",
"kernel": {"url": f"{args.kernel_url_prefix}/{args.kernel_image_name}"},
"nfsrootfs": {
"url": f"{args.rootfs_url_prefix}/lava-rootfs.tar.zst",
"compression": "zstd",
},
}
if args.kernel_image_type:
deploy["kernel"]["type"] = args.kernel_image_type
if args.dtb_filename:
deploy["dtb"] = {"url": f"{args.kernel_url_prefix}/{args.dtb_filename}.dtb"}
# always boot over NFS
boot = {
final_deploy_action.update(wrap)
def wrap_boot_action(boot_action: dict):
wrap = {
"namespace": "dut",
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
"method": args.boot_method,
"commands": "nfs",
"prompts": ["lava-shell:"],
**SSH_SERVER_COMMANDS,
}
# only declaring each job as a single 'test' since LAVA's test parsing is
# not useful to us
values["actions"] = [
{"deploy": deploy},
{"boot": boot},
{"test": generate_dut_test(args)},
{"test": generate_docker_test(args)},
]
return values
boot_action.update(wrap)

View File

@@ -1,22 +1,23 @@
from typing import Any
from .lava_job_definition import (
generate_metadata,
NUMBER_OF_ATTEMPTS_LAVA_BOOT,
artifact_download_steps,
)
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from ..lava_job_submitter import LAVAJobSubmitter
from .lava_job_definition import LAVAJobDefinition
from .constants import NUMBER_OF_ATTEMPTS_LAVA_BOOT
# Use the same image that is being used for the hardware enablement and health-checks.
# They are pretty small (<100MB) and have all the tools we need to run LAVA, so it is a safe choice.
# You can find the Dockerfile here:
# https://gitlab.collabora.com/lava/health-check-docker/-/blob/main/Dockerfile
# And the registry here: https://gitlab.collabora.com/lava/health-check-docker/container_registry/
DOCKER_IMAGE = "registry.gitlab.collabora.com/lava/health-check-docker"
def generate_lava_yaml_payload(args) -> dict[str, Any]:
values = generate_metadata(args)
# URLs to our kernel rootfs to boot from, both generated by the base
# container build
nfsrootfs = {
"url": f"{args.rootfs_url_prefix}/lava-rootfs.tar.zst",
"compression": "zstd",
}
def fastboot_deploy_actions(
job_definition: "LAVAJobDefinition", nfsrootfs
) -> tuple[dict[str, Any], ...]:
args = job_definition.job_submitter
fastboot_deploy_nfs = {
"timeout": {"minutes": 10},
"to": "nfs",
@@ -34,7 +35,7 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
},
"postprocess": {
"docker": {
"image": "registry.gitlab.collabora.com/lava/health-check-docker",
"image": DOCKER_IMAGE,
"steps": [
f"cat Image.gz {args.dtb_filename}.dtb > Image.gz+dtb",
"mkbootimg --kernel Image.gz+dtb"
@@ -44,13 +45,28 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
}
},
}
if args.kernel_image_type:
fastboot_deploy_prepare["images"]["kernel"]["type"] = args.kernel_image_type
if args.dtb_filename:
fastboot_deploy_prepare["images"]["dtb"] = {
"url": f"{args.kernel_url_prefix}/{args.dtb_filename}.dtb"
}
fastboot_deploy = {
"timeout": {"minutes": 2},
"to": "fastboot",
"docker": {
"image": DOCKER_IMAGE,
},
"images": {
"boot": {"url": "downloads://boot.img"},
},
}
# URLs to our kernel rootfs to boot from, both generated by the base
# container build
job_definition.attach_kernel_and_dtb(fastboot_deploy_prepare["images"])
job_definition.attach_external_modules(fastboot_deploy_nfs)
return (fastboot_deploy_nfs, fastboot_deploy_prepare, fastboot_deploy)
def tftp_deploy_actions(job_definition: "LAVAJobDefinition", nfsrootfs) -> tuple[dict[str, Any]]:
args = job_definition.job_submitter
tftp_deploy = {
"timeout": {"minutes": 5},
"to": "tftp",
@@ -60,40 +76,15 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
},
"nfsrootfs": nfsrootfs,
}
if args.kernel_image_type:
tftp_deploy["kernel"]["type"] = args.kernel_image_type
if args.dtb_filename:
tftp_deploy["dtb"] = {
"url": f"{args.kernel_url_prefix}/{args.dtb_filename}.dtb"
}
job_definition.attach_kernel_and_dtb(tftp_deploy)
job_definition.attach_external_modules(tftp_deploy)
fastboot_deploy = {
"timeout": {"minutes": 2},
"to": "fastboot",
"docker": {
"image": "registry.gitlab.collabora.com/lava/health-check-docker",
},
"images": {
"boot": {"url": "downloads://boot.img"},
},
}
return (tftp_deploy,)
fastboot_boot = {
"timeout": {"minutes": 2},
"docker": {"image": "registry.gitlab.collabora.com/lava/health-check-docker"},
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
"method": args.boot_method,
"prompts": ["lava-shell:"],
"commands": ["set_active a"],
}
tftp_boot = {
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
"method": args.boot_method,
"prompts": ["lava-shell:"],
"commands": "nfs",
}
def uart_test_actions(
args: "LAVAJobSubmitter", init_stage1_steps: list[str], artifact_download_steps: list[str]
) -> tuple[dict[str, Any]]:
# skeleton test definition: only declaring each job as a single 'test'
# since LAVA's test parsing is not useful to us
run_steps = []
@@ -120,26 +111,8 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
],
}
# job execution script:
# - inline .gitlab-ci/common/init-stage1.sh
# - fetch and unpack per-pipeline build artifacts from build job
# - fetch and unpack per-job environment from lava-submit.sh
# - exec .gitlab-ci/common/init-stage2.sh
with open(args.first_stage_init, "r") as init_sh:
run_steps += [
x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()
]
# We cannot distribute the Adreno 660 shader firmware inside rootfs,
# since the license isn't bundled inside the repository
if args.device_type == "sm8350-hdk":
run_steps.append(
"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 "
+ "https://github.com/allahjasif1990/hdk888-firmware/raw/main/a660_zap.mbn "
+ '-o "/lib/firmware/qcom/sm8350/a660_zap.mbn"'
)
run_steps += artifact_download_steps(args)
run_steps += init_stage1_steps
run_steps += artifact_download_steps
run_steps += [
f"mkdir -p {args.ci_project_dir}",
@@ -150,22 +123,31 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
"sleep 1",
# Putting CI_JOB name as the testcase name, it may help LAVA farm
# maintainers with monitoring
f"lava-test-case 'mesa-ci_{args.mesa_job_name}' --shell /init-stage2.sh",
f"lava-test-case '{args.project_name}_{args.mesa_job_name}' --shell /init-stage2.sh",
]
if args.boot_method == "fastboot":
values["actions"] = [
{"deploy": fastboot_deploy_nfs},
{"deploy": fastboot_deploy_prepare},
{"deploy": fastboot_deploy},
{"boot": fastboot_boot},
{"test": test},
]
else: # tftp
values["actions"] = [
{"deploy": tftp_deploy},
{"boot": tftp_boot},
{"test": test},
]
return (test,)
return values
def tftp_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]:
tftp_boot = {
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
"method": args.boot_method,
"prompts": ["lava-shell:"],
"commands": "nfs",
}
return tftp_boot
def fastboot_boot_action(args: "LAVAJobSubmitter") -> dict[str, Any]:
fastboot_boot = {
"timeout": {"minutes": 2},
"docker": {"image": DOCKER_IMAGE},
"failure_retry": NUMBER_OF_ATTEMPTS_LAVA_BOOT,
"method": args.boot_method,
"prompts": ["lava-shell:"],
"commands": ["set_active a"],
}
return fastboot_boot

View File

@@ -51,9 +51,8 @@ fi
# Only use GNU time if available, not any shell built-in command
case $CI_JOB_NAME in
# strace and wine don't seem to mix well
# ASAN leak detection is incompatible with strace
debian-mingw32-x86_64|*-asan*)
*-asan*)
if test -f /usr/bin/time; then
MESON_TEST_ARGS+=--wrapper=$PWD/.gitlab-ci/meson/time.sh
fi
@@ -71,7 +70,7 @@ rm -rf _build
meson setup _build \
--native-file=native.file \
--wrap-mode=nofallback \
--force-fallback-for perfetto \
--force-fallback-for perfetto,syn \
${CROSS+--cross "$CROSS_FILE"} \
-D prefix=$PWD/install \
-D libdir=lib \
@@ -85,9 +84,10 @@ meson setup _build \
-D libunwind=${UNWIND} \
${DRI_LOADERS} \
${GALLIUM_ST} \
-D gallium-opencl=disabled \
-D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
-D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec \
-D video-codecs=all \
-D werror=true \
${EXTRA_OPTION}
cd _build
@@ -104,10 +104,11 @@ fi
uncollapsed_section_switch meson-test "meson: test"
LC_ALL=C.UTF-8 meson test --num-processes "${FDO_CI_CONCURRENT:-4}" --print-errorlogs ${MESON_TEST_ARGS}
section_switch meson-install "meson: install"
if command -V mold &> /dev/null ; then
mold --run ninja install
else
ninja install
fi
cd ..
section_end meson-test
section_end meson-install

View File

@@ -106,7 +106,7 @@ deqp-runner junit \
--results $RESULTS/failures.csv \
--output $RESULTS/junit.xml \
--limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml"
--template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
# Report the flakes to the IRC channel for monitoring (if configured):
if [ -n "$FLAKES_CHANNEL" ]; then
@@ -120,7 +120,7 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--job "$CI_JOB_ID" \
--url "$CI_JOB_URL" \
--branch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-$CI_COMMIT_BRANCH}" \
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}" || true
fi
# Compress results.csv to save on bandwidth during the upload of artifacts to

View File

@@ -13,9 +13,14 @@ S3_ARGS="--token-file ${CI_JOB_JWT_FILE}"
RESULTS=$(realpath -s "$PWD"/results)
mkdir -p "$RESULTS"
export PIGLIT_REPLAY_DESCRIPTION_FILE="$INSTALL/$PIGLIT_TRACES_FILE"
if [ "$PIGLIT_REPLAY_SUBCOMMAND" = "profile" ]; then
yq -iY 'del(.traces[][] | select(.label[]? == "no-perf"))' \
"$PIGLIT_REPLAY_DESCRIPTION_FILE"
else
# keep the images for the later upload
export PIGLIT_REPLAY_EXTRA_ARGS="--keep-image ${PIGLIT_REPLAY_EXTRA_ARGS}"
fi
# WINE
@@ -122,7 +127,7 @@ if [ -n "$CI_NODE_INDEX" ]; then
fi
# shellcheck disable=SC2317
replay_minio_upload_images() {
replay_s3_upload_images() {
find "$RESULTS/$__PREFIX" -type f -name "*.png" -printf "%P\n" \
| while read -r line; do
@@ -133,7 +138,7 @@ replay_minio_upload_images() {
fi
__S3_PATH="$PIGLIT_REPLAY_REFERENCE_IMAGES_BASE"
__DESTINATION_FILE_PATH="${line##*-}"
if curl -L -s -X HEAD "https://${__S3_PATH}/${__DESTINATION_FILE_PATH}" 2>/dev/null; then
if curl -L -s -I "https://${__S3_PATH}/${__DESTINATION_FILE_PATH}" | grep -q "content-type: application/octet-stream" 2>/dev/null; then
continue
fi
else
@@ -185,8 +190,6 @@ then
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
fi
ARTIFACTS_BASE_URL="https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts"
./piglit summary aggregate "$RESULTS" -o junit.xml
PIGLIT_RESULTS="${PIGLIT_RESULTS:-replay}"
@@ -203,7 +206,7 @@ __S3_PATH="$PIGLIT_REPLAY_ARTIFACTS_BASE_URL"
__S3_TRACES_PREFIX="traces"
if [ "$PIGLIT_REPLAY_SUBCOMMAND" != "profile" ]; then
quiet replay_minio_upload_images
quiet replay_s3_upload_images
fi
@@ -221,5 +224,5 @@ find "$RESULTS"/summary -type f -name "*.html" -print0 \
echo "Failures in traces:"
cat $RESULTSFILE
error echo "Review the image changes and get the new checksums at: ${ARTIFACTS_BASE_URL}/results/summary/problems.html"
error echo "Review the image changes and get the new checksums at: ${ARTIFACTS_BASE_URL}/results/summary/problems.html "
exit 1

View File

@@ -23,7 +23,7 @@ else
STRIP="strip"
fi
if [ -z "$ARTIFACTS_DEBUG_SYMBOLS" ]; then
find install -name \*.so -exec $STRIP {} \;
find install -name \*.so -exec $STRIP --strip-debug {} \;
fi
# Test runs don't pull down the git tree, so put the dEQP helper
@@ -42,6 +42,8 @@ cp -Rp .gitlab-ci/valve install/
cp -Rp .gitlab-ci/vkd3d-proton install/
cp -Rp .gitlab-ci/setup-test-env.sh install/
cp -Rp .gitlab-ci/*-runner.sh install/
cp -Rp .gitlab-ci/bin/structured_logger.py install/
cp -Rp .gitlab-ci/bin/custom_logger.py install/
find . -path \*/ci/\*.txt \
-o -path \*/ci/\*.toml \
-o -path \*/ci/\*traces\*.yml \

View File

@@ -19,14 +19,14 @@ for driver in freedreno intel v3d vc4; do
done
# Run shader-db over a number of supported chipsets for nouveau
for chipset in 40 a3 c0 e4 f0 134 162; do
section_start shader-db-nouveau-${chipset} "Running shader-db for nouveau - ${chipset}"
env LD_PRELOAD="$LIBDIR/libnouveau_noop_drm_shim.so" \
NOUVEAU_CHIPSET=${chipset} \
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt"
section_end shader-db-nouveau-${chipset}
done
#for chipset in 40 a3 c0 e4 f0 134 162; do
# section_start shader-db-nouveau-${chipset} "Running shader-db for nouveau - ${chipset}"
# env LD_PRELOAD="$LIBDIR/libnouveau_noop_drm_shim.so" \
# NOUVEAU_CHIPSET=${chipset} \
# ./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
# > "$ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt"
# section_end shader-db-nouveau-${chipset}
#done
# Run shader-db for r300 (RV370 and RV515)
for chipset in 0x5460 0x7140; do

File diff suppressed because it is too large Load Diff

View File

@@ -16,37 +16,69 @@
name: "mesa_${CI_JOB_NAME}"
paths:
- results/
rules:
- !reference [.never-post-merge-rules, rules]
.formatting-check:
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: code-validation
extends:
- .use-debian/x86_64_build
variables:
GIT_STRATEGY: fetch
timeout: 10m
script:
- git diff --color=always --exit-code # Fails if there are diffs
tags:
- placeholder-job
rustfmt:
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: lint
extends:
- .use-debian/x86_64_build
- .formatting-check
- .lint-rustfmt-rules
variables:
GIT_STRATEGY: fetch
script:
before_script:
- shopt -s globstar
- rustfmt --check --verbose src/**/lib.rs
- rustfmt --version
- rustfmt --verbose src/**/lib.rs
- rustfmt --verbose src/**/main.rs
clang-format:
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: lint
extends:
- .use-debian/x86_64_build
- .formatting-check
- .lint-clang-format-rules
variables:
GIT_STRATEGY: fetch
LLVM_VERSION: 15
script:
before_script:
- shopt -s globstar
# We need a meson build dir, but its config doesn't actually matter, so
# let's just use the default.
- meson setup build
- clang-format-${LLVM_VERSION} --version
- ninja -C build clang-format
- git diff --color=always --exit-code # Fails if there are diffs
.test-check:
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: code-validation
extends:
- .use-debian/x86_64_build
variables:
GIT_STRATEGY: fetch
timeout: 10m
python-test:
extends:
- .test-check
script:
- cd bin/ci
- pip install --break-system-packages -r test/requirements.txt
- PYTHONPATH=. pytest -v
rules:
- !reference [.disable-farm-mr-rules, rules]
- !reference [.never-post-merge-rules, rules]
- changes:
- bin/ci/**/*
.test-gl:
extends:
@@ -56,6 +88,8 @@ clang-format:
- debian/x86_64_test-gl
- debian-testing
- !reference [.required-for-hardware-jobs, needs]
variables:
DEBIAN_ARCH: amd64
.test-vk:
extends:
@@ -65,6 +99,8 @@ clang-format:
- debian-testing
- debian/x86_64_test-vk
- !reference [.required-for-hardware-jobs, needs]
variables:
DEBIAN_ARCH: amd64
.test-cl:
extends:
@@ -130,7 +166,9 @@ clang-format:
exclude:
- results/*.shader_cache
variables:
PIGLIT_REPLAY_EXTRA_ARGS: --keep-image --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=mesa-tracie-public --jwt-file=${CI_JOB_JWT_FILE}
PIGLIT_REPLAY_EXTRA_ARGS: --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=mesa-tracie-public --jwt-file=${CI_JOB_JWT_FILE}
# until we overcome Infrastructure issues, give traces extra 5 min before timeout
DEVICE_HANGING_TIMEOUT_SEC: 600
script:
- section_start variables "Variables passed through:"
- install/common/generate-env.sh
@@ -139,6 +177,7 @@ clang-format:
.deqp-test:
script:
- rm -rf results # Clear out old results if the docker container was cached
- ./install/deqp-runner.sh
artifacts:
exclude:
@@ -177,6 +216,8 @@ clang-format:
- rm -rf install
- (set -x; curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}.tar.zst | tar --zstd -x)
- section_end artifacts_download
variables:
BM_ROOTFS: /rootfs-${DEBIAN_ARCH}
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
@@ -194,7 +235,7 @@ clang-format:
- .baremetal-test
- .use-debian/arm32_test
variables:
BM_ROOTFS: /rootfs-armhf
DEBIAN_ARCH: armhf
S3_ARTIFACT_NAME: mesa-arm32-default-debugoptimized
needs:
- debian/arm32_test
@@ -208,7 +249,7 @@ clang-format:
- .baremetal-test
- .use-debian/arm64_test
variables:
BM_ROOTFS: /rootfs-arm64
DEBIAN_ARCH: arm64
S3_ARTIFACT_NAME: mesa-arm64-default-debugoptimized
needs:
- debian/arm64_test
@@ -260,13 +301,16 @@ clang-format:
# like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
# depend on more than one image per job. So, the job container is
# built as part of the CI in the boot2container project.
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2023-03-08.1
image: registry.freedesktop.org/gfx-ci/ci-tron/mesa-trigger:2024-01-05.1
timeout: 1h 40m
rules:
- if: $FORCE_KERNEL_TAG != null
when: never
variables:
# No need by default to pull the whole repo
GIT_STRATEGY: none
# boot2container initrd configuration parameters.
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/519/download' # Linux 6.1
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/gfx-ci/ci-tron/-/package_files/519/download' # Linux 6.1
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.10/downloads/initramfs.linux_amd64.cpio.xz'
B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout'
@@ -281,6 +325,7 @@ clang-format:
B2C_TIMEOUT_MINUTES: 5
B2C_TIMEOUT_OVERALL_MINUTES: 90
B2C_TIMEOUT_RETRIES: 0
B2C_JOB_VOLUME_EXCLUSIONS: "*.shader_cache,install/*,*/install/*,*/vkd3d-proton.cache*,vkd3d-proton.cache*,*.qpa"
# As noted in the top description, we make a distinction between the
# container used by gitlab-runner to queue the work, and the container
@@ -300,7 +345,7 @@ clang-format:
- !reference [default, before_script]
- |
set -x
set -eux
# Useful as a hook point for runner admins. You may edit the
# config.toml for the Gitlab runner and use a bind-mount to
@@ -321,40 +366,17 @@ clang-format:
[ -d "$CI_B2C_ARTIFACTS" ] || exit 1
[ -d "$CI_COMMON_SCRIPTS" ] || exit 1
B2C_TEST_SCRIPT="bash -c 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'"
export B2C_CONTAINER_CMD="bash -euc 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'"
# The Valve CI gateway receives jobs in a YAML format. Create a
# job description from the CI environment.
python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py \
--ci-job-id "${CI_JOB_ID}" \
--container-cmd "${B2C_TEST_SCRIPT}" \
--initramfs-url "${B2C_INITRAMFS_URL}" \
--job-success-regex "${B2C_JOB_SUCCESS_REGEX}" \
--job-warn-regex "${B2C_JOB_WARN_REGEX}" \
--kernel-url "${B2C_KERNEL_URL}" \
--log-level "${B2C_LOG_LEVEL}" \
--poweroff-delay "${B2C_POWEROFF_DELAY}" \
--session-end-regex "${B2C_SESSION_END_REGEX}" \
--session-reboot-regex "${B2C_SESSION_REBOOT_REGEX}" \
--tags "${CI_RUNNER_TAGS}" \
--template "${B2C_JOB_TEMPLATE}" \
--timeout-boot-minutes "${B2C_TIMEOUT_BOOT_MINUTES}" \
--timeout-boot-retries "${B2C_TIMEOUT_BOOT_RETRIES}" \
--timeout-first-minutes "${B2C_TIMEOUT_FIRST_MINUTES}" \
--timeout-first-retries "${B2C_TIMEOUT_FIRST_RETRIES}" \
--timeout-minutes "${B2C_TIMEOUT_MINUTES}" \
--timeout-overall-minutes "${B2C_TIMEOUT_OVERALL_MINUTES}" \
--timeout-retries "${B2C_TIMEOUT_RETRIES}" \
--job-volume-exclusions "${B2C_JOB_VOLUME_EXCLUSIONS}" \
--local-container "${IMAGE_UNDER_TEST}" \
${B2C_EXTRA_VOLUME_ARGS} \
--working-dir "$CI_PROJECT_DIR"
python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py
cat b2c.yml.jinja2
rm -rf ${JOB_FOLDER} || true
mkdir -v ${JOB_FOLDER}
# Create a script to regenerate the CI environment when this job
# begins running on the remote DUT.
set +x
@@ -362,7 +384,6 @@ clang-format:
echo "export SCRIPTS_DIR=./install" >> ${JOB_FOLDER}/set-job-env-vars.sh
echo "Variables passed through:"
cat ${JOB_FOLDER}/set-job-env-vars.sh
echo "export CI_JOB_JWT=${CI_JOB_JWT}" >> ${JOB_FOLDER}/set-job-env-vars.sh
set -x
# Copy the mesa install tarball to the job folder, for later extraction
@@ -378,17 +399,23 @@ clang-format:
env PYTHONUNBUFFERED=1 executorctl \
run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER} -i "$CI_RUNNER_DESCRIPTION"
# Anything our job places in results/ will be collected by the
# Gitlab coordinator for status presentation. results/junit.xml
# will be parsed by the UI for more detailed explanations of
# test execution.
# Anything our job places in results/ will be collected by the
# Gitlab coordinator for status presentation. results/junit.xml
# will be parsed by the UI for more detailed explanations of
# test execution.
after_script:
# Keep the results path the same as baremetal and LAVA
- mkdir -p "${JOB_FOLDER}"/results
- mv "${JOB_FOLDER}"/results results/
- !reference [default, after_script]
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
paths:
- ${JOB_FOLDER}/results
- results
reports:
junit: ${JOB_FOLDER}/results/**/junit.xml
junit: results/**/junit.xml
.b2c-test-vk:
extends:

View File

@@ -0,0 +1,142 @@
job_name: 'test-project: my_pipeline_info'
device_type: my_fastboot_device_type
visibility:
group:
- my_visibility_group
priority: 75
context:
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
timeouts:
job:
minutes: 10
actions:
depthcharge-retry:
minutes: 4
depthcharge-start:
minutes: 1
depthcharge-action:
minutes: 15
actions:
- deploy:
timeout:
minutes: 10
to: nfs
nfsrootfs:
url: None/lava-rootfs.tar.zst
compression: zstd
namespace: dut
- deploy:
timeout:
minutes: 5
to: downloads
os: oe
images:
kernel:
url: None/None
dtb:
url: None/my_dtb_filename.dtb
postprocess:
docker:
image: registry.gitlab.collabora.com/lava/health-check-docker
steps:
- cat Image.gz my_dtb_filename.dtb > Image.gz+dtb
- mkbootimg --kernel Image.gz+dtb --cmdline "root=/dev/nfs rw nfsroot=$NFS_SERVER_IP:$NFS_ROOTFS,tcp,hard
rootwait ip=dhcp init=/init" --pagesize 4096 --base 0x80000000 -o boot.img
namespace: dut
- deploy:
timeout:
minutes: 10
to: fastboot
docker:
image: registry.gitlab.collabora.com/lava/health-check-docker
images:
boot:
url: downloads://boot.img
namespace: dut
failure_retry: 3
- boot:
timeout:
minutes: 2
docker:
image: registry.gitlab.collabora.com/lava/health-check-docker
failure_retry: 3
method: fastboot
prompts:
- 'lava-shell:'
commands:
- set_active a
namespace: dut
auto_login:
login_commands:
- dropbear -R -B
- touch /dut_ready
login_prompt: 'ogin:'
username: ''
- test:
namespace: dut
definitions:
- from: inline
name: setup-ssh-server
path: inline-setup-ssh-server
repository:
metadata:
format: Lava-Test Test Definition 1.0
name: dut-env-export
run:
steps:
- |-
echo test FASTBOOT
- export -p > /dut-env-vars.sh
- test:
namespace: container
timeout:
minutes: 10
failure_retry: 3
definitions:
- name: docker_ssh_client
from: inline
path: inline/docker_ssh_client.yaml
repository:
metadata:
name: mesa
description: Mesa test plan
format: Lava-Test Test Definition 1.0
run:
steps:
- |-
set -ex
timeout 1m bash << EOF
while [ -z "$(lava-target-ip)" ]; do
echo Waiting for DUT to join LAN;
sleep 1;
done
EOF
ping -c 5 -w 60 $(lava-target-ip)
lava_ssh_test_case() {
set -x
local test_case="${1}"
shift
lava-test-case "${test_case}" --shell \
ssh ${SSH_PTY_ARGS:--T} \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
root@$(lava-target-ip) "${@}"
}
- lava_ssh_test_case 'wait_for_dut_login' << EOF
- while [ ! -e /dut_ready ]; do sleep 1; done;
- EOF
- |-
lava_ssh_test_case 'artifact_download' 'bash --' << EOF
source /dut-env-vars.sh
set -ex
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz -C /
mkdir -p /ci/project/dir
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd -x -C /ci/project/dir
echo Could not find jwt file, disabling S3 requests...
sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
EOF
- export SSH_PTY_ARGS=-tt
- lava_ssh_test_case 'test-project_dut' '"cd / && /init-stage2.sh"'
docker:
image:

View File

@@ -0,0 +1,96 @@
job_name: 'test-project: my_pipeline_info'
device_type: my_fastboot_device_type
visibility:
group:
- my_visibility_group
priority: 75
context:
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
timeouts:
job:
minutes: 10
actions:
depthcharge-retry:
minutes: 4
depthcharge-start:
minutes: 1
depthcharge-action:
minutes: 15
actions:
- deploy:
timeout:
minutes: 10
to: nfs
nfsrootfs:
url: None/lava-rootfs.tar.zst
compression: zstd
- deploy:
timeout:
minutes: 5
to: downloads
os: oe
images:
kernel:
url: None/None
dtb:
url: None/my_dtb_filename.dtb
postprocess:
docker:
image: registry.gitlab.collabora.com/lava/health-check-docker
steps:
- cat Image.gz my_dtb_filename.dtb > Image.gz+dtb
- mkbootimg --kernel Image.gz+dtb --cmdline "root=/dev/nfs rw nfsroot=$NFS_SERVER_IP:$NFS_ROOTFS,tcp,hard
rootwait ip=dhcp init=/init" --pagesize 4096 --base 0x80000000 -o boot.img
- deploy:
timeout:
minutes: 2
to: fastboot
docker:
image: registry.gitlab.collabora.com/lava/health-check-docker
images:
boot:
url: downloads://boot.img
- boot:
timeout:
minutes: 2
docker:
image: registry.gitlab.collabora.com/lava/health-check-docker
failure_retry: 3
method: fastboot
prompts:
- 'lava-shell:'
commands:
- set_active a
- test:
timeout:
minutes: 10
failure_retry: 1
definitions:
- name: mesa
from: inline
lava-signal: kmsg
path: inline/mesa.yaml
repository:
metadata:
name: mesa
description: Mesa test plan
os:
- oe
scope:
- functional
format: Lava-Test Test Definition 1.0
run:
steps:
- echo test FASTBOOT
- set -ex
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz
-C /
- mkdir -p /ci/project/dir
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd
-x -C /ci/project/dir
- echo Could not find jwt file, disabling S3 requests...
- sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
- mkdir -p /ci/project/dir
- curl None | tar --zstd -x -C /ci/project/dir
- sleep 1
- lava-test-case 'test-project_dut' --shell /init-stage2.sh

View File

@@ -0,0 +1,114 @@
job_name: 'test-project: my_pipeline_info'
device_type: my_uboot_device_type
visibility:
group:
- my_visibility_group
priority: 75
context:
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
timeouts:
job:
minutes: 10
actions:
depthcharge-retry:
minutes: 4
depthcharge-start:
minutes: 1
depthcharge-action:
minutes: 15
actions:
- deploy:
timeout:
minutes: 10
to: tftp
os: oe
kernel:
url: None/None
nfsrootfs:
url: None/lava-rootfs.tar.zst
compression: zstd
dtb:
url: None/my_dtb_filename.dtb
namespace: dut
failure_retry: 3
- boot:
failure_retry: 3
method: u-boot
prompts:
- 'lava-shell:'
commands: nfs
namespace: dut
auto_login:
login_commands:
- dropbear -R -B
- touch /dut_ready
login_prompt: 'ogin:'
username: ''
- test:
namespace: dut
definitions:
- from: inline
name: setup-ssh-server
path: inline-setup-ssh-server
repository:
metadata:
format: Lava-Test Test Definition 1.0
name: dut-env-export
run:
steps:
- |-
echo test UBOOT
- export -p > /dut-env-vars.sh
- test:
namespace: container
timeout:
minutes: 10
failure_retry: 3
definitions:
- name: docker_ssh_client
from: inline
path: inline/docker_ssh_client.yaml
repository:
metadata:
name: mesa
description: Mesa test plan
format: Lava-Test Test Definition 1.0
run:
steps:
- |-
set -ex
timeout 1m bash << EOF
while [ -z "$(lava-target-ip)" ]; do
echo Waiting for DUT to join LAN;
sleep 1;
done
EOF
ping -c 5 -w 60 $(lava-target-ip)
lava_ssh_test_case() {
set -x
local test_case="${1}"
shift
lava-test-case "${test_case}" --shell \
ssh ${SSH_PTY_ARGS:--T} \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
root@$(lava-target-ip) "${@}"
}
- lava_ssh_test_case 'wait_for_dut_login' << EOF
- while [ ! -e /dut_ready ]; do sleep 1; done;
- EOF
- |-
lava_ssh_test_case 'artifact_download' 'bash --' << EOF
source /dut-env-vars.sh
set -ex
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz -C /
mkdir -p /ci/project/dir
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd -x -C /ci/project/dir
echo Could not find jwt file, disabling S3 requests...
sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
EOF
- export SSH_PTY_ARGS=-tt
- lava_ssh_test_case 'test-project_dut' '"cd / && /init-stage2.sh"'
docker:
image:

View File

@@ -0,0 +1,70 @@
job_name: 'test-project: my_pipeline_info'
device_type: my_uboot_device_type
visibility:
group:
- my_visibility_group
priority: 75
context:
extra_nfsroot_args: ' init=/init rootwait usbcore.quirks=0bda:8153:k'
timeouts:
job:
minutes: 10
actions:
depthcharge-retry:
minutes: 4
depthcharge-start:
minutes: 1
depthcharge-action:
minutes: 15
actions:
- deploy:
timeout:
minutes: 5
to: tftp
os: oe
kernel:
url: None/None
nfsrootfs:
url: None/lava-rootfs.tar.zst
compression: zstd
dtb:
url: None/my_dtb_filename.dtb
- boot:
failure_retry: 3
method: u-boot
prompts:
- 'lava-shell:'
commands: nfs
- test:
timeout:
minutes: 10
failure_retry: 1
definitions:
- name: mesa
from: inline
lava-signal: kmsg
path: inline/mesa.yaml
repository:
metadata:
name: mesa
description: Mesa test plan
os:
- oe
scope:
- functional
format: Lava-Test Test Definition 1.0
run:
steps:
- echo test UBOOT
- set -ex
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar -xz
-C /
- mkdir -p /ci/project/dir
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 None | tar --zstd
-x -C /ci/project/dir
- echo Could not find jwt file, disabling S3 requests...
- sed -i '/S3_RESULTS_UPLOAD/d' /set-job-env-vars.sh
- mkdir -p /ci/project/dir
- curl None | tar --zstd -x -C /ci/project/dir
- sleep 1
- lava-test-case 'test-project_dut' --shell /init-stage2.sh

View File

@@ -0,0 +1,197 @@
import importlib
import os
import re
from itertools import chain
from pathlib import Path
from typing import Any, Iterable, Literal
from unittest import mock
import lava.utils.constants
import pytest
from lava.lava_job_submitter import LAVAJobSubmitter
from lava.utils.lava_job_definition import LAVAJobDefinition
from ruamel.yaml import YAML
def flatten(iterable: Iterable[Iterable[Any]]) -> list[Any]:
return list(chain.from_iterable(iterable))
# mock shell file
@pytest.fixture(scope="session")
def shell_file(tmp_path_factory):
def create_shell_file(content: str = "# test"):
shell_file = tmp_path_factory.mktemp("data") / "shell_file.sh"
shell_file.write_text(content)
return shell_file
return create_shell_file
# fn to load the data file from $CWD/data using pathlib
def load_data_file(filename):
return Path(__file__).parent.parent / "data" / filename
def load_yaml_file(filename) -> dict:
with open(load_data_file(filename)) as f:
return YAML().load(f)
def job_submitter_factory(mode: Literal["UBOOT", "FASTBOOT"], shell_file):
if mode == "UBOOT":
boot_method = "u-boot"
device_type = "my_uboot_device_type"
elif mode == "FASTBOOT":
boot_method = "fastboot"
device_type = "my_fastboot_device_type"
job_timeout_min = 10
mesa_job_name = "dut test"
pipeline_info = "my_pipeline_info"
project_name = "test-project"
visibility_group = "my_visibility_group"
return LAVAJobSubmitter(
boot_method=boot_method,
ci_project_dir="/ci/project/dir",
device_type=device_type,
dtb_filename="my_dtb_filename",
first_stage_init=shell_file,
job_timeout_min=job_timeout_min,
mesa_job_name=mesa_job_name,
pipeline_info=pipeline_info,
visibility_group=visibility_group,
project_name=project_name,
)
@pytest.fixture
def clear_env_vars(autouse=True):
with mock.patch.dict(os.environ) as environ:
# Remove all LAVA-related environment variables to make the test more robust
# and deterministic, once a envvar is capable of overriding the default value
for key in environ:
if any(kw in key for kw in ("LAVA_", "CI_", "JOB_", "RUNNER_", "DEVICE_")):
del environ[key]
# reload lava.utils.constants to update the JOB_PRIORITY value
importlib.reload(lava.utils.constants)
importlib.reload(lava.utils.lava_job_definition)
yield
@pytest.fixture
def mock_collabora_farm(clear_env_vars, monkeypatch):
# Mock a Collabora farm-like device runner tag to enable SSH execution
monkeypatch.setenv("RUNNER_TAG", "mesa-ci-1234-lava-collabora")
@pytest.mark.parametrize("force_uart", [True, False], ids=["SSH", "UART"])
@pytest.mark.parametrize("mode", ["UBOOT", "FASTBOOT"])
def test_generate_lava_job_definition_sanity(
force_uart, mode, shell_file, mock_collabora_farm, monkeypatch
):
monkeypatch.setattr(lava.utils.lava_job_definition, "FORCE_UART", force_uart)
init_script_content = f"echo test {mode}"
job_submitter = job_submitter_factory(mode, shell_file(init_script_content))
job_definition = LAVAJobDefinition(job_submitter).generate_lava_job_definition()
# Load the YAML output and check that it contains the expected keys and values
yaml = YAML()
job_dict = yaml.load(job_definition)
yaml.dump(job_dict, Path(f"/tmp/{mode}_force_uart={force_uart}_job_definition.yaml"))
assert job_dict["device_type"] == job_submitter.device_type
assert job_dict["visibility"]["group"] == [job_submitter.visibility_group]
assert job_dict["timeouts"]["job"]["minutes"] == job_submitter.job_timeout_min
assert job_dict["context"]["extra_nfsroot_args"]
assert job_dict["timeouts"]["actions"]
assert len(job_dict["actions"]) == 3 if mode == "UART" else 5
last_test_action = job_dict["actions"][-1]["test"]
# TODO: Remove hardcoded "mesa" test name, as this submitter is being used by other projects
first_test_name = last_test_action["definitions"][0]["name"]
is_running_ssh = "ssh" in first_test_name
# if force_uart, is_ssh must be False. If is_ssh, force_uart must be False. Both can be False
assert not (is_running_ssh and force_uart)
assert last_test_action["failure_retry"] == 3 if is_running_ssh else 1
run_steps = "".join(last_test_action["definitions"][0]["repository"]["run"]["steps"])
# Check for project name in lava-test-case
assert re.search(rf"lava.?\S*.test.case.*{job_submitter.project_name}", run_steps)
action_names = flatten(j.keys() for j in job_dict["actions"])
if is_running_ssh:
assert action_names == (
[
"deploy",
"boot",
"test", # DUT: SSH server
"test", # Docker: SSH client
]
if mode == "UBOOT"
else [
"deploy", # NFS
"deploy", # Image generation
"deploy", # Image deployment
"boot",
"test", # DUT: SSH server
"test", # Docker: SSH client
]
)
test_action_server = job_dict["actions"][-2]["test"]
# SSH server in the DUT
assert test_action_server["namespace"] == "dut"
# SSH client via docker
assert last_test_action["namespace"] == "container"
boot_action = next(a["boot"] for a in job_dict["actions"] if "boot" in a)
assert boot_action["namespace"] == "dut"
# SSH server bootstrapping
assert "dropbear" in "".join(boot_action["auto_login"]["login_commands"])
return
# ---- Not SSH job
assert action_names == (
[
"deploy",
"boot",
"test",
]
if mode == "UBOOT"
else [
"deploy", # NFS
"deploy", # Image generation
"deploy", # Image deployment
"boot",
"test",
]
)
assert init_script_content in run_steps
# use yaml files from tests/data/ to test the job definition generation
@pytest.mark.parametrize("force_uart", [False, True], ids=["SSH", "UART"])
@pytest.mark.parametrize("mode", ["UBOOT", "FASTBOOT"])
def test_lava_job_definition(mode, force_uart, shell_file, mock_collabora_farm, monkeypatch):
monkeypatch.setattr(lava.utils.lava_job_definition, "FORCE_UART", force_uart)
yaml = YAML()
yaml.default_flow_style = False
# Load the YAML output and check that it contains the expected keys and values
expected_job_dict = load_yaml_file(f"{mode}_force_uart={force_uart}_job_definition.yaml")
init_script_content = f"echo test {mode}"
job_submitter = job_submitter_factory(mode, shell_file(init_script_content))
job_definition = LAVAJobDefinition(job_submitter).generate_lava_job_definition()
job_dict = yaml.load(job_definition)
# Uncomment the following to update the expected YAML files
# yaml.dump(job_dict, Path(f"../../data/{mode}_force_uart={force_uart}_job_definition.yaml"))
# Check that the generated job definition matches the expected one
assert job_dict == expected_job_dict

View File

@@ -1,26 +0,0 @@
#!/bin/bash
set -eu
function execute_testsuite {
local RESULTS_FOLDER EXEC_DONE_FILE
RESULTS_FOLDER="results/$1"
EXEC_DONE_FILE="$RESULTS_FOLDER/.done"
if [ ! -f "$EXEC_DONE_FILE" ]; then
DEQP_RESULTS_DIR="$RESULTS_FOLDER" PIGLIT_RESULTS_DIR="$RESULTS_FOLDER" $2
touch "$EXEC_DONE_FILE"
else
echo "--> Skipped, as it already was executed"
fi
}
echo -e "\n# GL CTS testing"
DEQP_VER=gl46 execute_testsuite gl ./install/deqp-runner.sh
echo -e "\n# GLES CTS testing"
DEQP_SUITE=zink-radv execute_testsuite gles ./install/deqp-runner.sh
echo -e "\n# Piglit testing"
execute_testsuite piglit ./install/piglit/piglit-runner.sh

View File

@@ -55,7 +55,11 @@ quiet printf "%s\n" "Running vkd3d-proton testsuite..."
set +e
if ! /vkd3d-proton-tests/x64/bin/d3d12 > "$RESULTS/vkd3d-proton.log";
then
error printf "%s\n" "Failed, see vkd3d-proton.log!"
# Check if the executable finished (ie. no segfault).
if ! grep "tests executed" "$RESULTS/vkd3d-proton.log" > /dev/null; then
error printf "%s\n" "Failed, see vkd3d-proton.log!"
exit 1
fi
# Collect all the failures
VKD3D_PROTON_RESULTS="${VKD3D_PROTON_RESULTS:-vkd3d-proton-results}"
@@ -75,9 +79,8 @@ then
if ! diff -q ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE"; then
error printf "%s\n" "Changes found, see vkd3d-proton.log!"
quiet diff --color=always -u ".gitlab-ci/vkd3d-proton/$VKD3D_PROTON_RESULTS.txt.baseline" "$RESULTSFILE"
exit 1
fi
exit 1
fi
printf "%s\n" "vkd3d-proton execution: SUCCESS"

View File

@@ -3,6 +3,10 @@
ARG base_image
FROM ${base_image}
COPY mesa_deps_vulkan_sdk.ps1 C:\
RUN C:\mesa_deps_vulkan_sdk.ps1
COPY mesa_init_msvc.ps1 C:\
COPY mesa_deps_build.ps1 C:\
RUN C:\mesa_deps_build.ps1

View File

@@ -12,11 +12,9 @@ RUN powershell -ExecutionPolicy RemoteSigned -Command "$ErrorActionPreference =
SHELL ["pwsh", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN Write-Output $PSVersionTable $ErrorActionPreference
COPY mesa_deps_vs2019.ps1 C:\
RUN C:\mesa_deps_vs2019.ps1
COPY mesa_vs_init.ps1 C:\
COPY mesa_deps_msvc.ps1 C:\
RUN C:\mesa_deps_msvc.ps1
ENV VULKAN_SDK_VERSION='1.3.211.0'
COPY mesa_deps_choco.ps1 C:\
RUN C:\mesa_deps_choco.ps1
@@ -25,5 +23,5 @@ RUN C:\mesa_deps_choco.ps1
# since the resulting container will want to be used that way be later containers in the build process.
# Only --isolation=hyperv can succeed building this container locally,
# --isolation=process have network issue when installing Visual Studio and choco will crash
# docker build --isolation=hyperv -f .\Dockerfile_vs -t mesa_vs --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .
# docker build --isolation=hyperv -f .\Dockerfile_msvc -t mesa_vs --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .

View File

@@ -3,5 +3,20 @@
ARG base_image
FROM ${base_image}
COPY mesa_deps_vulkan_sdk.ps1 C:\
RUN C:\mesa_deps_vulkan_sdk.ps1
COPY mesa_deps_d3d.ps1 C:\
RUN C:\mesa_deps_d3d.ps1
COPY mesa_deps_rust.ps1 C:\
RUN C:\mesa_deps_rust.ps1
COPY mesa_init_msvc.ps1 C:\
COPY mesa_deps_test_piglit.ps1 C:\
RUN C:\mesa_deps_test_piglit.ps1
COPY mesa_deps_test_deqp.ps1 c:\
RUN C:\mesa_deps_test_deqp.ps1
COPY mesa_deps_test.ps1 C:\
RUN C:\mesa_deps_test.ps1

View File

@@ -27,7 +27,7 @@ deqp-runner suite --suite $($suite) `
$jobs
$deqpstatus = $?
$template = "See https://$($env:CI_PROJECT_ROOT_NAMESPACE).pages.freedesktop.org/-/$($env:CI_PROJECT_NAME)/-/jobs/$($env:CI_JOB_ID)/artifacts/results/{{testcase}}.xml"
$template = "See $($env:ARTIFACTS_BASE_URL)/results/{{testcase}}.xml"
deqp-runner junit --testsuite dEQP --results "$($results)/failures.csv" --output "$($results)/junit.xml" --limit 50 --template $template
Copy-Item -Path "C:\deqp\testlog.css" -Destination $($results)
Copy-Item -Path "C:\deqp\testlog.xsl" -Destination $($results)

View File

@@ -30,7 +30,7 @@ Write-Output installdir:$installdir
Write-Output sourcedir:$sourcedir
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
. "$MyPath\mesa_vs_init.ps1"
. "$MyPath\mesa_init_msvc.ps1"
$depsInstallPath="C:\mesa-deps"
@@ -50,7 +50,7 @@ meson setup `
-Dvulkan-drivers="swrast,amd,microsoft-experimental" `
-Dgallium-drivers="swrast,d3d12,zink" `
-Dgallium-va=enabled `
-Dvideo-codecs="h264dec,h264enc,h265dec,h265enc,vc1dec" `
-Dvideo-codecs="all" `
-Dshared-glapi=enabled `
-Dgles1=enabled `
-Dgles2=enabled `

View File

@@ -1,6 +1,6 @@
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
. "$MyPath\mesa_vs_init.ps1"
. "$MyPath\mesa_init_msvc.ps1"
# we want more secure TLS 1.2 for most things, but it breaks SourceForge
# downloads so must be done after Chocolatey use
@@ -12,7 +12,7 @@ $depsInstallPath="C:\mesa-deps"
Get-Date
Write-Host "Cloning DirectX-Headers"
git clone -b v1.711.3-preview --depth=1 https://github.com/microsoft/DirectX-Headers deps/DirectX-Headers
git clone -b v1.611.0 --depth=1 https://github.com/microsoft/DirectX-Headers deps/DirectX-Headers
if (!$?) {
Write-Host "Failed to clone DirectX-Headers repository"
Exit 1

Some files were not shown because too many files have changed in this diff Show More