Commit Graph

70 Commits

Author SHA1 Message Date
Jason Ekstrand 12920b227f pvr: Use the common AcquireNextImage implementation
The only reason for the wrapper was so that we could dummy signal the
semaphore and fence.  Now that the WSI code always dos this for us, we
can drop our wrapper.

Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Matt Coster 0fbcaa4b3a pvr: debug: Implement PVR_DEBUG variable
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/16907>
2022-06-08 10:51:37 +01:00
Matt Coster 7c615b4103 pvr: csbgen: Add *_unpack() functions for all generated struct types
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 4c0941f0d4 pvr: csbgen: Fix "local variable may be undefined" lints
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 9f8556a44a pvr: csbgen: Replace map() and filter() with list comprehension
Guido originally wanted to drop these (along with reduce()) in 3.0, but
compromised to just recommending list comprehension instead [1].

[1]: https://www.artima.com/weblogs/viewpost.jsp?thread=98196

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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 2285ddc720 pvr: csbgen: Isolate "main" function with __name__ check
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster a8b80c610b pvr: csbgen: Add typing information
This is generally PEP-484 stuff, but there is one functional change.
The base class Node needed to have an add() method to allow typed
dynamic dispatch. This could have been decorated @abstractmethod, but
that would require an error-raising implementation on all leaf-type
nodes. Instead, I added a base implementation that just errors out with
information from the subclass instance.

As a simple optimization, subclass implementations of add() (instead of
raising the same (or similar) error) now call super().add() in the
case of invalid child nodes.

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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster f2de3716d8 pvr: csbgen: Remove unused function parameters
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 14ca712362 pvr: csbgen: Remove "dim" functionality from Group
This allowed for nested groups rendered as arrays. Support for this had
mostly been removed already; this removes the additional value to make
typing easier.

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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 6961c31938 pvr: csbgen: Cleanup imports
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 34a76ec4e6 pvr: csbgen: Make some loops more pythonic
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster b813ca5d3b pvr: csbgen: Add a missing @staticmethod decorator
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/16884>
2022-06-08 09:13:22 +00:00
Matt Coster 89d6a1cfe4 pvr: csbgen: Formatting pass (PEP-8 plus other minor changes)
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/16884>
2022-06-08 09:13:22 +00:00
Karmjit Mahil 721fb18a38 pvr: Fix incorrect samples to cr_isp_aa_mode conversion.
This commit fixes the use of 'case 3' where 'case 4' should have
been.

Reported-by: Matt Coster <matt.coster@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/16883>
2022-06-08 08:35:44 +00:00
Karmjit Mahil 61db3154b4 pvr: Write immutable descriptor words in vkAllocateDescriptorSets().
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/16883>
2022-06-08 08:35:44 +00:00
Karmjit Mahil 81077a4c7d pvr: Add csb enum helper funciton header.
A new header is introduced which groups all vk, uint, rogue types
to csb enum type conversions.

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/16883>
2022-06-08 08:35:44 +00:00
Rajnesh Kanwal 4dd5f03edc pvr: Remove clang-format off comment from vk_format.h
This enables clang formatting for vk_format.h. This was disabled
as we were using tabs for indentation and vk_format.h uses three
spaces for indentation.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:11 +01:00
Rajnesh Kanwal 9acb8ba3db pvr: Move transfer logic to pvr_job_transfer.[ch]
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:11 +01:00
Rajnesh Kanwal 16d4ca6e14 pvr: Add services winsys transfer cmd submit interface.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal df671f6a8f pvr: Change ALIGN macro to ALIGN_ATTR.
ALIGN is defined as a function in u_math.h and same name is
used to define a macro in pvr_rogue_fwif_shared.h. This commit
resolves this conflict.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 7a93e8900e pvr: Fix UTIL_ARCH_BIG_ENDIAN check in vk_format.h.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 2d0f49534f pvr: Restrict argument to dev_info where possible.
Avoid passing whole device structure. In most of the cases
we only need dev_info from device pointer to check for
features and ERNs.
This commits simply avoids the need to carry device pointer
where ever we go.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 4b6c18fea8 pvr: Fix ISP_RENDER_MODE_TYPE enum in rogue_cr.xml
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 11d8973efb pvr: Add transfer 3d parameter heap support.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 0c3c1a8be4 pvr: Remove vk_format_is_pure_integer and use common helper.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 72c634fb23 pvr: Allow signal_sync pointer to be NULL in job submission.
This allows the common driver to pass NULL signal_sync for cases
where there are multiple jobs (of the same type) to be processed.
In that case, it's useless to maintain the signal_syncs other than
the one returned by the last submission.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal ce36859b95 pvr: Add support for R32G32B32A32_UINT, R32_UINT and R8_UINT formats.
These formats are required by vkCmdCopyBuffer implementation. The
formats in pvr_format_table are exposed to applications as well.
Given these formats are supported for rendering and sampling, there
shouldn't be a problem exposing these to applications.

Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@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/16897>
2022-06-07 14:55:10 +01:00
Rajnesh Kanwal 86f703e7b1 pvr: Pass device info struct in pds generator.
Fixes a potential NULL pointer dereference.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>
2022-06-07 14:55:10 +01:00
Frank Binns fd0f02ec4e pvr: shorten error to err in label names
This is for consistency with the rest of the driver.

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/16882>
2022-06-06 15:58:33 +00:00
Erik Faye-Lund f7efa2858f pvr: do not use c_msvc_compat_args
This code isn't MSVC compatible, as it uses VLAs (for instance).

Until there's a reason to support MSVC, let's not even try. Otherwise,
we make it harder than needed to add flags to make the MSVC compat flags
more complete.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16670>
2022-06-03 07:14:43 +00:00
Erik Faye-Lund df2dd474c7 include: drop c11_compat.h
We now require C11, and C++ supports static_assert just fine, which is
the only thing this header ever added support for. So let's get rid of
this needless header.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>
2022-06-02 13:09:16 +00:00
Jan Palus 9fb97c75f2 pvr: use UINT64_C for 64-bit constant
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6528

Signed-off-by: Jan Palus <jpalus@fastmail.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16630>
2022-05-23 08:52:56 +00:00
Jason Ekstrand fc8d2543fc vulkan,v3dv: Add a driver_internal flag to vk_image_view_init/create
We already had a little workaround for v3dv where, for some if its meta
ops, it had to bind a depth/stenicil image as color.  Instead of
special-casing binding depth/stencil as color, let's flip on the
drier_internal flag and get rid of most of the checks in that case.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Rajnesh Kanwal 65fce0f813 pvr: Fix argument comments in render job submission.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15709>
2022-05-13 23:18:16 +00:00
Rajnesh Kanwal d50418a4fc pvr: Add vk_sync support and remove service winsys syncobjs interface.
Removing internal pvr_winsys_syncobj abstraction and porting
service winsys syncobj over to vk_sync_type.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15709>
2022-05-13 23:18:16 +00:00
Rajnesh Kanwal e8ed0e4984 pvr: Add support to create transfer context and setup required shaders.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16451>
2022-05-12 12:38:48 +01:00
Rajnesh Kanwal f88d1fbdbd pvr: Add services winsys transfer context support.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16451>
2022-05-12 12:38:48 +01:00
Rajnesh Kanwal ad7f494a1c pvr: Setup common nop shader.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16451>
2022-05-12 12:38:48 +01:00
Rajnesh Kanwal c2aa3acf7e pvr: Change phase_rate_change type to bool from uint32_t.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16451>
2022-05-12 12:38:48 +01:00
Rajnesh Kanwal eaa5d37161 pvr: Remove double error reporting in error path.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16451>
2022-05-12 12:38:48 +01:00
Karmjit Mahil e7351178aa pvr: Update pvrsrvkm to fw 1.17 .
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/16238>
2022-05-05 10:35:35 +00:00
Karmjit Mahil 58d9afb80b pvr: Add compute update kernel in vkCmdDispatch().
We upload a new data section whenever a patched variant is
needed. They will be freed at command buffer destruction since
the uploads are linked.

Co-authored-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Karmjit Mahil 5e9e3fe7f7 pvr: Add compute update shared kernel in vkCmdDispatch().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Karmjit Mahil 7ccf9494b6 pvr: Add initial implementation of vkCmdDispatch().
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Karmjit Mahil 4b7a9bf364 pvr: Add PVR_WORKGROUP_DIMENSIONS define.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16040>
2022-05-03 13:41:28 +00:00
Frank Binns e0e5cbd5a4 pvr: replace p_compiler.h boolean with stdbool
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16037>
2022-04-21 12:52:52 +00:00
Karmjit Mahil 4c6bec2c0c pvr: Fix clang-format errors caused by vk outarrays.
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/15944>
2022-04-19 09:13:07 +00:00
Karmjit Mahil f7ddd584ab pvr: Implement vkCreateQueryPool() and vkDestroyQueryPool().
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/15880>
2022-04-13 17:58:03 +00:00
Karmjit Mahil 1250e30929 pvr: Add pvrsrvkm visibility test heap.
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/15880>
2022-04-13 17:58:03 +00:00
Karmjit Mahil 76ee1671f6 pvr: Add core count info and pvr_device_runtime_info.
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/15880>
2022-04-13 17:58:03 +00:00