Commit graph

72 commits

Author SHA1 Message Date
columbarius
8bbc1c1abf vulkan: fix uninitialized writeDescriptor 2023-08-31 10:08:06 +00:00
columbarius
00c475e646 vulkan: download buffer to MemPtr 2023-08-31 10:08:06 +00:00
columbarius
73d6c20225 vulkan: spa_vulkan_use_buffers support datatype MemPtr 2023-08-31 10:08:06 +00:00
columbarius
eea8096b12 vulkan: Track spa_buffers for stream 2023-08-31 10:08:06 +00:00
columbarius
2456d58397 vulkan: Only allocate buffers when DMABUFS are used 2023-08-31 10:08:06 +00:00
columbarius
b8c91f7e54 vulkan: Synchronize in and out buffers 2023-08-31 10:08:06 +00:00
columbarius
412b0c7b49 vulkan: Add dmabuf sync helpers from wlroots
These helpers are obtained from the wlroots project at
https://gitlab.freedesktop.org/wlroots/wlroots/
2023-08-31 10:08:06 +00:00
columbarius
2c65eb6c2c vulkan: vulkan_compute fixate modifier
If the modifier for a format is not fixated yet, we will use vulkan to
fixate a modifier, update the parsed format, change the EnumFormats mask
and exit early. This triggers a new enum_params with EnumFormats and a
new set_param for Format.
2023-08-31 10:08:06 +00:00
columbarius
a673c56eea vulkan: announce SPA_PARAM_BUFFERS wrt. modifiers 2023-08-31 10:08:06 +00:00
columbarius
3274880e8e vulkan: use capability flags to enumerate formats 2023-08-31 10:08:06 +00:00
columbarius
d549d9e595 vulkan: vulkan_compute enumerate format with modifiers 2023-08-31 10:08:06 +00:00
columbarius
06a1d5151b vulkan: vulkan_compute initialize base on plugin creation 2023-08-31 10:08:06 +00:00
columbarius
402ed65a79 vulkan: Add {spa_,}vulkan_fixate_modifier 2023-08-31 10:08:06 +00:00
columbarius
35b080ec61 vulkan: split spa_vulkan_use_buffers into separate allocation and import functions
This commit add helpers to create and to import a DmaBuf via the
external_dmabuf_info struct.
The import path is based on the image creation of wlroots and the create path is
inspired by the wlroots vulkan allocator MR.
2023-08-31 10:08:06 +00:00
columbarius
2068972bb3 vulkan: Add wait functions
vulkan_wait_idle waits until the device is idle and all referenced
objects can be destroyed.
vulkan_wait_fence waits until a fence is triggered by a finished
queueSubmit.

vulkan: wait on fence
2023-08-31 10:08:06 +00:00
columbarius
0bb662f2e7 vulkan: limit supported modifiers with DMABUF_MAX_PLANES 2023-08-31 10:08:06 +00:00
columbarius
58853eb2c7 vulkan: Add function to query format and modifier information 2023-08-31 10:08:06 +00:00
columbarius
cf0e3a35ba vulkan: Add format convertion functions 2023-08-31 10:08:06 +00:00
columbarius
ea2a2c47c7 vulkan: split vulkan-utils into generic and compute part
This commit should just shuffle code around with no functional changes.
The goal is to ease development of simple vulkan nodes by providing
generic helpers.
2023-08-31 10:08:06 +00:00
columbarius
e7b4129944 vulkan: use SPDX tags to specify copyright information 2023-08-31 10:08:06 +00:00
columbarius
e226dccde8 vulkan: log if buffer is added in vulkan-compute-source 2023-08-31 10:08:06 +00:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
97aafe2234 fix use_buffers checks
We can set 0 buffers even if there is no format.
Return -ENOSPC when too many buffers are set.
2023-01-10 12:30:25 +01:00
Wim Taymans
d4eff5b058 fix build some more. 2022-12-09 18:10:15 +01:00
Wim Taymans
f44d55f6c2 handle read from timerfd correctly
When reading the timerfd gives an error, we should return right away
because the timeout did not happen.

If we change the timerfd timeout before reading it, we can get -EAGAIN.
Don't log an error in that case but wait for the new timeout.
2022-12-09 17:30:31 +01:00
Wim Taymans
9123710971 spa: clean up some port io checks
We should not generate a warning.
2022-09-01 15:39:34 +02:00
Wim Taymans
2fa1b4384b spa: don't warn for NULL io
The io is set to NULL when the port becomes unnegotiated.
2022-09-01 15:31:14 +02:00
Lucas Holt
4c3f5a7655 When adding MidnightBSD support, I inversed the condition here. 2022-07-08 12:25:58 +02:00
Lucas Holt
6a15a02ec2 Add support for MidnightBSD
Fix build issue

Fix build issue
2022-06-19 18:22:47 +00:00
Wim Taymans
9493dafe44 vulkan: update example shaders 2022-06-06 12:13:20 +02:00
Wim Taymans
80f317344e vulkan: fix validation errors 2022-06-06 12:13:20 +02:00
Wim Taymans
d40e6aeedd vulkan: use image sampler 2022-06-06 12:13:20 +02:00
Wim Taymans
b02ebec954 vulkan: use images
The filter can now run shadertoy filters.
2022-06-06 12:13:20 +02:00
Wim Taymans
24fc972164 vulkan: add some more error checks 2022-06-06 12:13:20 +02:00
Wim Taymans
6e681fc98d vulkan: more improvements 2022-06-06 12:13:19 +02:00
Wim Taymans
e6f01563ab vulkan: support multiple streams of buffers 2022-06-06 12:13:19 +02:00
Wim Taymans
332e8b7029 vulkan: start of vulkan filters 2022-06-06 12:13:19 +02:00
Wim Taymans
9071678643 spa: set port flags on port info 2022-05-26 10:39:31 +02:00
Wim Taymans
2f5bba112f spa: Improve PropInfo fields
The PropInfo either has a registered id (and then also a name from the
type-info) or a custom name as a string.
In all cases, the description contains a free form text that clarifies
the property.

Use the description in the stream controls name.
2022-03-30 17:09:08 +02:00
Barnabás Pőcze
60b9d9081b spa: only remove embedded source from data loop from within the loop
Use `spa_loop_invoke()` to invoke a callback on the data loop
to remove an embedded `spa_source` from the data loop.

Embedded `spa_source` objects cannot be safely removed
while the loop is polling without risking potential
use-after-frees.
2022-03-06 18:40:43 +00:00
Wim Taymans
35cbe4e939 buffers: make alignment optional
Make the alignment parameter optional when negotiating buffers.
Default to a 16 bytes alignment and adjust for the max cpu
alignment.
Remove the useless align buffer parameter in plugins, we always
set it to 16 anyway.
2022-01-03 12:32:26 +01:00
Barnabás Pőcze
2b110af366 treewide: meson.build: use dependency variable for SPA
Use `spa_dep` everywhere instead of `spa_inc`,
and remove `spa_inc` altogether.
2021-12-28 18:34:06 +01:00
Peter Hutterer
ebda71d489 spa: fix the indentation in the various meson.build files
Was all over the place using tabs and spaces, let's make this more
consistent.
2021-09-20 07:29:03 +00:00
George Kiagiadakis
36c7e820d8 test nodes: make the timerfd non-blocking
Relates to #1377
2021-07-01 11:52:35 +03:00
Barnabás Pőcze
f5d51162c4 treewide: mark things static and const
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.

All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
2021-06-30 14:44:08 +02:00
Wim Taymans
46ef88e520 spa: save the old change_mask and restore when emitting full
When we add a new listener to an object, it will emit the full state
of the object. For this it temporarily sets the change_mask to all
changes. Restore the previous state after this or else we might not
emit the right change_mask for the next listener.

Consider the case where one there are two listeners on an object.
The object emits a change and the first listener wants to enumerate the
changed params. For this is adds a new listener and then triggers the
enumeration. If we set the change_mask to 0 after adding the listener,
the second listener would get a 0 change_mask and fail to update
its state.
2021-05-27 15:21:44 +02:00
Peter Hutterer
7697ed0757 treewide: replace strcmp() == 0 with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
223f20709d meson: replace join_paths(a, b) with a / b
More readable and from the meson reference manual:
(since 0.49.0) Using the/ operator on strings is equivalent to calling join_paths.
2021-04-15 06:57:00 +00:00
Wim Taymans
4f60dcadc6 vulkan: check results of stat 2020-05-20 15:24:25 +02:00
Wim Taymans
f1dc3d9728 vulkan: fix macro variables 2020-05-20 15:24:25 +02:00