Commit graph

1430 commits

Author SHA1 Message Date
Ella Stanforth
9f740b26a6 pvr: Fix bugs in the format table
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 0f0938ed2e ("pvr: Convert format table to indexing with pipe_format")

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39240>
2026-01-14 00:58:18 +00:00
Erik Faye-Lund
b9a4f286ab pvr: encapsulate format-table
It's a bit awkward to pass this around with two values. Let's
wrap them up in a struct for convenience instead.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:04 +00:00
Erik Faye-Lund
97bb5918ac pvr: use pvr_arch defines in implementations
This just makes the code slightly easier to follow, because we don't
need to bother with the verbose PVR_PER_ARCH macros here.

Functions that are left out are those that doens't have an alias. This
is either because they are only used by the dispatch-code, or because
they are entrypoints. Neither of those benefits from an alias.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:04 +00:00
Erik Faye-Lund
a51f1311bf pvr: rename PVR_PER_ARCH aliases to pvr_arch_ for clarity
When using the aliases for the PVR_PER_ARCH functions, it's hard to see
what's per-arch and what's not. Let's bake that into the name instead,
so it's a bit more clear.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:03 +00:00
Erik Faye-Lund
8f23859c84 pvr: do not use alias in definition
This is not the norm... yet. A later patch will go in the oposite
direction, but it seems better to make things consistent first, in case
we decide to not stick with the later patch.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:03 +00:00
Erik Faye-Lund
6696f0a1f4 pvr: do not use PVR_PER_ARCH for static function
It's not nessecary, and only makes things harder to read. Let's back out
of compiling this per-arch.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:02 +00:00
Erik Faye-Lund
2cc831d75a pvr: use pvr_arch aliases
These were just missed case when switching to the aliases earlier. This
is just a consistency issue, it doesn't affect correctness.

Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:01 +00:00
Erik Faye-Lund
9912883045 pvr: use per-arch macro for pvr_device_init_spm_load_state
Not sure how this didn't blow up in testing, but this misses the
entire per-arch dance for this function. Let's fix it up!

Fixes: e762592bff ("pvr: build pvr_arch_*.c as a multi-arch sources")
Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:01 +00:00
Erik Faye-Lund
ea107e588d pvr: clean up include
We don't need pvr_physical_device.h included here, but we *do* need it
in pvr_arch_framebuffer.c, so let's move the include there. This will
help with avoiding circular includes.

Fixes: e762592bff ("pvr: build pvr_arch_*.c as a multi-arch sources")
Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:38:00 +00:00
Erik Faye-Lund
ae6ddec410 pvr: add missing forward-declaration
Not sure how we missed this, but we need the declaration here. This
probably only worked because of transitative includes, which we shound't
rely on.

Fixes: 82fad3f258 ("pvr: Enable PBE_FILTERABLE_F16")
Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:37:59 +00:00
Erik Faye-Lund
d7a2cca937 pvr: add missing include
Not sure how we missed this, but we need to include pvr_formats.h here,
otherwise we don't see all the definitions we need. We probably got away
without this due to other transitive includes, but let's not rely on
that.

Fixes: 949e41a664 ("pvr: split pvr_formats.c")
Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39035>
2026-01-12 19:37:59 +00:00
Ella Stanforth
0f0938ed2e pvr: Convert format table to indexing with pipe_format
This simplifies adding extension formats later down the line.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39214>
2026-01-09 10:08:06 +00:00
Christian Gmeiner
6a42493c94 pvr: Use BUILD_ID_EXPECTED_HASH_LENGTH
SHA1_DIGEST_LENGTH was changed to refect BLAKE3 exposed with SHA1 functions - switch
to BUILD_ID_EXPECTED_HASH_LENGTH.

Fixes: 492a176cbb ("util: increase SHA1_DIGEST_LENGTH to 32 (BLAKE3_KEY_LEN)")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39192>
2026-01-07 18:38:56 +00:00
Icenowy Zheng
0837ea14b8 pvr: advertise X11-related WSI instance extensions
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39014>
2026-01-06 18:45:44 +00:00
Icenowy Zheng
cb6312c629 pvr: advertise VK_EXT_headless_surface
Since commit e8c81652c9 ("vulkan/wsi/headless: do not destroy images
that are never created"), the CTS failure that prevents headless surface
from being advertised is already solved.

Re-advertise VK_EXT_headless_surface for pvr driver.

Running `dEQP-VK.wsi.headless.*` with VK CTS 1.4.5.0 results in no
failure on BXM-4-64 .

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39038>
2026-01-06 18:29:07 +00:00
Icenowy Zheng
ca89407fa3 pvr: prevent a NULL dereference for pass-less pipeline creation w/o info
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It's allowed in the specification that a graphics pipeline being created
with either a render pass or a VkPipelineRenderingCreateInfo , in this
case the multiview mask should be set to 0. However, currently the code
in pvr_early_init_shader_data() tries to access RenderingCreateInfo w/o
checking for NULL, which leads to potential crash.

Set multiview to disabled if no RenderingCreateInfo is available.

This fixes crash of Vulkan CTS 1.4.4.0 / 1.4.5.0 test case
dEQP-VK.pipeline.monolithic.misc.no_rendering .

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39050>
2026-01-07 01:45:41 +08:00
Nick Hamilton
eccdfb397e pvr: Fix missing sample mask test instructions
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The sample mask test instructions were only being added if the sample
mask was an input or no other discard test was being done.

In the failing test cases, instructions to handle alpha to one and/or
alpha to coverage were being added and the program marked as having
a discard test. This would lead to the instructions for the sample
mask test to not be added.

The fix is to specifically check for whether the instructions for sample mask
have been added instead of check for any discard test.

Fix deqp:

dEQP-VK.pipeline.monolithic.extended_dynamic_state.after_pipelines.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.after_pipelines.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.before_draw.large_static_rasterization_samples_off
dEQP-VK.pipeline.monolithic.extended_dynamic_state.before_draw.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.before_draw.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.before_good_static.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.before_good_static.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.between_pipelines.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.between_pipelines.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.cmd_buffer_start.large_static_rasterization_samples_off
dEQP-VK.pipeline.monolithic.extended_dynamic_state.cmd_buffer_start.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.cmd_buffer_start.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.three_draws_dynamic.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.three_draws_dynamic.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.two_draws_dynamic.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.two_draws_dynamic.single_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.two_draws_static.multi_sample_sample_mask_disable
dEQP-VK.pipeline.monolithic.extended_dynamic_state.two_draws_static.single_sample_sample_mask_disable

Signed-off-by: Nick Hamilton <nick.hamilton@imgtec.com>
Tested-by: Icenowy Zheng <uwu@icenowy.me>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39040>
2026-01-06 12:37:20 +00:00
Icenowy Zheng
c294b061ad pvr: advertise VK_KHR_incremental_present
The implementation of this extension is part of the common Mesa WSI
code, and it's used by Zink without checking for the presence.

Advertise it for PowerVR open source driver.

With Headless WSI advertised, Tests in Vulkan CTS that is
incremental_present related can pass.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39037>
2026-01-06 12:07:29 +00:00
Frank Binns
2a35d624b2 pvr: check image usage features against image features
Fixes deqp failures in:
  dEQP-VK.api.info.unsupported_image_usage.*

Backport-to: 25.3
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Simon Perretta <simon.perretta@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37686>
2026-01-06 11:24:29 +00:00
Erik Faye-Lund
c1e4c073cd pvr: limit hw-defs to rogue
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Because we are using these carefully picked HW-defs in common code here,
we need to set PVR_BUILD_ARCH_ROGUE first.

Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Erik Faye-Lund
13d12b33c0 pvr: make some winsys files multi-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Erik Faye-Lund
e762592bff pvr: build pvr_arch_*.c as a multi-arch sources
This will allow us to build this multiple times for different
architectures. For now, it only defines a single architecture, because
that's what we currently support. But this makes room for future
architectures, that will follow relatively soon.

Co-authored-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Erik Faye-Lund
346e365daa pvr: pass device-info to a few winsys functions
These will have to start knowing about the arch...

Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Erik Faye-Lund
ba2c40cd03 pvr: use rogue-prefix for rogue-specific code
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Erik Faye-Lund
6ae6dd7db6 pvr: make blit/clear-code rogue-specific
For Volcanic, we're planning on on using vk_meta instead of these, so
let's mark them as rogue-only for now.

Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Erik Faye-Lund
e1064e57a7 pvr: only build pvr_dump_csb.c for rogue
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:05 +01:00
Ashish Chauhan
6b4577e12d pvr: prepare for multi-gen compilation
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 10:35:02 +01:00
Erik Faye-Lund
edca79bc41 pvr: prepare winsys files for multi-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
f473c5fa97 pvr: mark pvr_framebuffer.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
e11fac9f26 pvr: mark pvr_mrt.c as multi-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
3d84905198 pvr: mark pvr_query_compute.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Ashish Chauhan
be52ea2af7 pvr: mark pvr_queue.c as multi-arch
Signed-off-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
d0d443abd7 pvr: mark pvr_sampler.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
921a04aac6 pvr: mark pvr_job_common.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
6bd378131a pvr: mark pvr_hw_pass.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Ashish Chauhan
949e41a664 pvr: split pvr_formats.c
Signed-off-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
0b97360139 pvr: split pvr_image.c
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
8c7f0ad749 pvr: mark pvr_job_context.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Ashish Chauhan
1f1a6cdadf pvr: split pvr_spm.c
Signed-off-by: Ashish Chauhan <ashish.chauhan@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
8af73b5614 pvr: mark pvr_job_transfer.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
11f59c942e pvr: mark pvr_job_render.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
d07bf4b190 pvr: mark pvr_cmd_query.c as per-arch
This is riddled with per-arch details; this should all be per-arch I
think.

Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
bd9d87592e pvr: mark pvr_cmd_buffer.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
6e57d71c0a pvr: mark pvr_job_compute.c as per-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
eb56f9a200 pvr: mark pvr_tex_state.c as multi-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
6c14ff34e8 pvr: mark pvr_pass.c as multi-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:04 +01:00
Erik Faye-Lund
f789eb0d7d pvr: mark pvr_border.c as multi-arch
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:03 +01:00
Erik Faye-Lund
120a89e2a9 pvr: split pvr_descriptor_set.c
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:03 +01:00
Erik Faye-Lund
1facaaba69 pvr: split pvr_csb.c
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:03 +01:00
Erik Faye-Lund
2c828a8825 pvr: split pvr_device.c
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
2025-12-19 09:52:03 +01:00