URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d17ddcc84773899ef8b022d94969ffc0909db0bc
Author: Yiwei Zhang <[email protected]>
Date: Tue Dec 5 20:17:44 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b26bebcf4e58d04b6dfd43aea53a1649b3a2f37
Author: Yiwei Zhang <[email protected]>
Date: Sat Nov 11 10:14:57 2023 -0800
venus: add vn_gettid helper
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b170c1a39126fbb816dd849b41a9f2ffa9f2067b
Author: Yiwei Zhang <[email protected]>
Date: Thu Nov 9 20:18:37 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5943f70c7a1d48eb1e840c1c00130bf6b2b1f87e
Author: Yiwei Zhang <[email protected]>
Date: Thu Nov 9 19:17:51 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d28ebf7b99a2e5a9cab93ca7a192dcc7d065a885
Author: Yiwei Zhang <[email protected]>
Date: Thu Nov 9 14:51:57 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a0ef347a825a662beb6db002cf32e717018a70bf
Author: Yiwei Zhang <[email protected]>
Date: Thu Nov 9 12:31:54 2023 -0800
venus: add vn_ring_get_id and hide vn_ring internals entirely
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e38c741399a8e8fe96b4206f6051c3db50b9716
Author: Yiwei Zhang <[email protected]>
Date: Thu Nov 9 11:43:12 2023 -0800
venus: move the actual ring creation into ring as well
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c779fc9fb1cfa3907eb70e9198c52c67683c7549
Author: Yiwei Zhang <[email protected]>
Date: Thu Nov 9 11:25:39 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9229c13a2cbb860693f5bf5c3e3926e343170262
Author: Yiwei Zhang <[email protected]>
Date: Wed Nov 8 17:08:49 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1e29b7557877c9b278593b8f0c7e6c531849f23
Author: Yiwei Zhang <[email protected]>
Date: Mon Nov 6 12:33:22 2023 -0800
venus: move ring shmem into vn_ring
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e122014cf37faf7f7c76db4ebc2ba993c805ec8
Author: Yiwei Zhang <[email protected]>
Date: Wed Nov 8 22:48:24 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b98d850efdb30eb31b905d470836a6322b78e5e5
Author: Yiwei Zhang <[email protected]>
Date: Wed Nov 8 20:47:56 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=90e64564b8c99035213fe4f502bca4955496284c
Author: Yiwei Zhang <[email protected]>
Date: Tue Nov 7 20:05:36 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0273c9cc031bf5474b251ae0bb1b356f57514f67
Author: Yiwei Zhang <[email protected]>
Date: Mon Nov 6 23:58:31 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=70e8d1397ec0a426fb6562724bf3c2f23ea27d19
Author: Yiwei Zhang <[email protected]>
Date: Mon Nov 6 12:46:42 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6adc60822777d95165e5001fd1125b8b989ecb4
Author: Yiwei Zhang <[email protected]>
Date: Mon Nov 6 11:24:40 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8b059b01b08f961ec07ad3f6ca6ef07f0aad345
Author: Yiwei Zhang <[email protected]>
Date: Sun Nov 5 19:16:04 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=22b5c9c65fe06798d98f7d42fd3648284f9f37b8
Author: Yiwei Zhang <[email protected]>
Date: Sun Nov 5 18:10:07 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=26e20eb12cdc58676b6e951db27f42950a9fae45
Author: Yiwei Zhang <[email protected]>
Date: Sun Nov 5 17:55:30 2023 -0800
venus: add vn_instance_fini_ring helper
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2cdab2c25d94704e9469169a4b8973e696b5fc5e
Author: Yiwei Zhang <[email protected]>
Date: Wed Nov 8 16:21:07 2023 -0800
venus: use instance allocator for indirect cs storage alloc
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec131c6e55313d5816a4d69e5a828d7e56965e3d
Author: Yiwei Zhang <[email protected]>
Date: Fri Nov 3 21:38:38 2023 -0700
venus: use instance allocator for ring allocs
and some nice to have refactors
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=15c7e7743e36f81e37be915a1d10b18ad6a55cc9
Author: Yiwei Zhang <[email protected]>
Date: Sun Oct 22 19:28:50 2023 -0700
venus: add ring helper to avoid redundant ring wait requests
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=891d3fb2dba4a471f9c42aa63cbb5937ed6fe0c6
Author: Yiwei Zhang <[email protected]>
Date: Tue Oct 24 14:04:54 2023 -0700
venus: enable renderer shmem cache dump for cache debug
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=34c9864318d1d01e0cc77728b99ca512022c7963
Author: Yiwei Zhang <[email protected]>
Date: Mon Nov 6 22:50:58 2023 -0800
venus: use STACK_ARRAY to prepare for indirect submission
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=60e0af96614c8540835ed51a3f141260b4c4476a
Author: Yiwei Zhang <[email protected]>
Date: Mon Nov 13 09:37:06 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c9e09758535f1ccce47766687ce34893a47b6a3
Author: Yiwei Zhang <[email protected]>
Date: Tue Nov 7 19:32:25 2023 -0800
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ac7d78bf3512aa7575f9c8595494ea592ab2e58
Author: Yiwei Zhang <[email protected]>
Date: Tue Nov 28 12:17:29 2023 -0800
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: 4a4b05869a6 ("venus: check and configure new ringMonitoring feature")
Signed-off-by: Yiwei Zhang <[email protected]>
Reported-by: Lina Versace <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aed4c4d04e76e65ed3ae3159ae12014aa1c8f492
Author: Yiwei Zhang <[email protected]>
Date: Sat Nov 11 19:27:10 2023 -0800
venus: fix async compute pipeline creation
Fixes: a771efdefed ("venus: Enable VK_EXT_pipeline_creation_cache_control")
Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26179>