Commit graph

208226 commits

Author SHA1 Message Date
Yiwei Zhang
eb567fefc9 anv: use common ANB swapchain gralloc usage query
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:07 +00:00
Yiwei Zhang
8f4c938c1e anv: fix ANB gralloc usage query to not append display usage bits
The consumer of the Android surface may or may not be display. e.g. it
can also be a media encoder. When BufferQueue makes the allocation, it
takes the gralloc usage bits from both the client API (EGL/Vulkan) and
the consumer side.

Cc: mesa-stable
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:06 +00:00
Yiwei Zhang
fb77881262 radv: use AHARDWAREBUFFER_USAGE_CAMERA_MASK
Now AHB header has it defined.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:06 +00:00
Yiwei Zhang
0d33739216 radv: use common ANB swapchain gralloc usage query
The additional usage bits added for rgba8 and rgb565 are not needed as
those are conditionally added based on the consumer side of the Android
surface (e.g. display, encoder, etc).

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:06 +00:00
Yiwei Zhang
99eac81bb9 vulkan/android: fix and re-orgnize support before api level 26
The existing common ANB helpers are declared under DETECT_OS_ANDROID but
the implementations are hidden further behind ANDROID_API_LEVEL >= 26,
which is not right.

In addition, for the sanity, let's move front buffer usage query behind
api level 26, while moving baseline ANB entry points above the
conditional api level scope.

In the future, we should look to drop below 26 support (basically drop
Android N support where Vulkan 1.0.3 was initially supported).

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:05 +00:00
Yiwei Zhang
a07306ad98 vulkan/android: rewrite swapchain gralloc usage query
Drop redundant validation and simplify code.

v2: error out for unknown image usages and preserve helper

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:05 +00:00
Yiwei Zhang
04570c14ea vulkan/android: drop redundant image format query
No need to check the baseline support since that's part of core, and the
extended support is checked from vkGetPhysicalDeviceSurfaceFormatsKHR by
the platform against both gralloc and the driver.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:05 +00:00
Yiwei Zhang
495156079c vulkan/android: fix to not append GRALLOC_USAGE_HW_COMPOSER bit
The composer usage bit is automatically added by the surface consumer
side when the consumer is SurfaceFlinger. e.g. if the swapchain is
connected with a media encoder surface, the consumer side would append
encoder usage bit instead.

Fixes: c406d53858 ("vulkan/android: Add common vkGetSwapchainGrallocUsage{2}ANDROID")
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
2025-07-09 03:47:04 +00:00
Connor Abbott
63be5358c7 tu: Don't allow changing writeableness in a condition
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We can't currently handle this. Assert instead of silently hanging the
GPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35993>
2025-07-09 02:49:44 +00:00
Connor Abbott
5d7e4ab405 tu/cs: Assert that the CS is not writeable when resetting
Leaving writeable on probably means that we forgot to disable
writeable somewhere, which is a bad idea. The existing code couldn't
handle this and would subtly crash somewhere else due to start not being
saved, but just assert instead to make the problem more clear.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35993>
2025-07-09 02:49:44 +00:00
Connor Abbott
336839bcd8 tu: Don't leave tile store CS writeable
A rebase problem meant that the hunk leaving the CS not writeable again
was dropped. This isn't what was intended and caused a crash in the CS
code.

Because tu6_emit_gmem_stores() is now called inside a condition, we have
to move the enable/disable outside of it because changing to a
read-write buffer inside of a condition isn't currently supported.

Fixes: ba9d0ba9a0 ("turnip: Emit tile stores at subpass end time.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35993>
2025-07-09 02:49:43 +00:00
Simon Perretta
ad66ebb686 pvr: enable partial vertex input dmas
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:59 +00:00
Simon Perretta
043e05768a pco: add support for more pack/unpack ops
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:59 +00:00
Simon Perretta
2983d23e63 pvr: reorder device setup to create the compiler context earlier
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:59 +00:00
Simon Perretta
ba4628a094 pco: allow empty/nop vertex shaders
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:59 +00:00
Simon Perretta
f06e14cc6c pvr: setup vk pipeline cache
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:59 +00:00
Simon Perretta
a4500abc75 pvr: store device uuid and build sha
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:59 +00:00
Simon Perretta
0751eb576d pco: enable translation of vs sysvals
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:58 +00:00
Simon Perretta
410bba0463 pco: support flat interpolation varyings
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:58 +00:00
Simon Perretta
c386c2f9e8 pvr, pco: point size handling
Clamp point size to limits.
Emit default point size if required but none is provided.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:57 +00:00
Simon Perretta
dc6ea99fde pco, pygen: add f{min,max} support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:57 +00:00
Simon Perretta
1cd2bb58fb pco: skip vector coalescing if ssa srcs are repeatedly referenced
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:57 +00:00
Simon Perretta
9d23d92afa pco: handle frag/point coords sysvals
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:56 +00:00
Simon Perretta
74d50d7720 pco: add support for load_ubo
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:56 +00:00
Simon Perretta
d17d97a867 pco: remove per-device specialization of SPIR-V/NIR options
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:55 +00:00
Simon Perretta
6ff964dd03 pvr, pco: initial descriptor rework
Use more Vulkan runtime/common functions.
Properly use the descriptor pool.
Start to remove legacy/unused constructs from PDS generation.
Support for UBO descriptors.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:55 +00:00
Simon Perretta
38d581d842 pvr: drop pvr_lower_nir
This pass can now remain in the compiler as Vulkan-specific data will be
abstracted into the compiler-driver interface.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:54 +00:00
Frank Binns
08222dc461 pvr: add missing refcounting for descriptor set layouts
Do this by switching to vk_descriptor_set_layout and making use of the helper
functions. This also has the bonus of less code in the driver.

Fixes a segfault seen when running glmark2-es2-wayland.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:54 +00:00
Simon Perretta
51a3372ff2 pvr: clarify image/sampler state word packing
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:53 +00:00
Simon Perretta
8b8e33106d pco: additional helper functions for address refs
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:53 +00:00
Simon Perretta
e7d50a6781 pco: add pco nir algebraic pass boilerplate and basic lowering/opts
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:53 +00:00
Simon Perretta
087d439a52 pco: run dce pass until no more progress is made
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:52 +00:00
Luigi Santivetti
6ad0b59cc8 Revert "pvr: Implement VK_EXT_memory_budget"
This reverts commit 97efa57531.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:52 +00:00
Simon Perretta
a22ad99bdd pvr: set device features/props/extensions to Vulkan 1.0 minimums (unless implemented)
The KHR_shader_expect_assume dEQP tests use dynamic rendering without
first checking that the driver supports 1.3 or the
KHR_dynamic_rendering extension

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:52 +00:00
Simon Perretta
ac2460bb3c pvr: commonize limits
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:51 +00:00
Simon Perretta
b13fe4e7a7 pco: commonise pass macro, use on opt subpasses
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:51 +00:00
Simon Perretta
765e9d837d pco, pygen: validate phases and io allocations for ops
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:50 +00:00
Simon Perretta
c201332fff pco, pygen: iterators for igrps and the instrs they contain
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:50 +00:00
Simon Perretta
04f3b3a5c9 pco, pygen: track valid phases and io allocations for ops
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:49 +00:00
Simon Perretta
05912bcb60 pco: initial legalize pass/validation to handle hw restrictions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:49 +00:00
Simon Perretta
4402649b01 pco, pygen: track which hw srcs map to op srcs/dests
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:49 +00:00
Simon Perretta
4e171bcf89 pco, pygen: further abstract src/dest references
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:48 +00:00
Simon Perretta
d552d5b278 pco, pygen: add support for bitwise logical ops
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:48 +00:00
Simon Perretta
c2787d1d12 pco, pygen: add support for unpck and conversions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:47 +00:00
Simon Perretta
8c379b0c3e pco, pygen: add support for dma ld and add64_32
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:47 +00:00
Simon Perretta
ff51ba7e43 pco, pygen: add support for tst, movc instructions and s{lt,ge,eq,ne} ops
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:47 +00:00
Simon Perretta
f1b63fe3f9 pco, pygen: add fdiv/frcp support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:46 +00:00
Simon Perretta
7fb0223c93 pco, pygen: support enum mappings for instances of two bitsets
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:46 +00:00
Simon Perretta
88ac50cbb2 pco, pygen: amend translation of srcs/dests with no mods
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:45 +00:00
Simon Perretta
e9c7afc217 pco, pygen: rework isa gen to support multi-instruction groups
- Split encode and group mappings to allow the former to be re-used.
- Add custom zero value mapping for bitset enums.
- Enable optional enum mapping for ref mods (previously just op mods).
- Commonize nop/nop.end.

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33998>
2025-07-08 23:10:45 +00:00