Commit Graph

30 Commits

Author SHA1 Message Date
Yiwei Zhang 62f79f9ec1 venus: add more tracepoints for perf analysis
This change adds the tracepoints that can help understand app behavior
for debugging and performance optimization purposes.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17497>
2022-07-15 20:57:41 +00:00
Yiwei Zhang 9f9d543b12 venus: renderer to store allow_vk_wait_syncs capset
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16731>
2022-06-16 19:00:36 +00:00
Renato Pereyra c642ebf8ab venus: Add driconf option to enable implicit fencing
Signed-off-by: Renato Pereyra <renatopereyra@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16735>
2022-06-02 18:05:50 +00:00
Renato Pereyra e6706d230e venus: add support for vk_xwayland_wait_ready
Signed-off-by: Renato Pereyra <renatopereyra@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16229>
2022-04-29 00:45:24 +00:00
Yiwei Zhang 4ab640852b venus: refactor to add struct vn_env
This is to prepare for adding perf options.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16110>
2022-04-26 23:49:59 +00:00
Yiwei Zhang a263da69ec venus: prepare and feed renderer protocol info into cs
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15495>
2022-04-09 00:19:05 +00:00
Chia-I Wu 5d188274ee venus: add vn_extension_get_spec_version
It is a wraper for vn_info_extension_get

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15498>
2022-03-22 21:10:56 +00:00
Yiwei Zhang 05a2cea14c venus: no roundtrip needed for shmem backed by BLOB_MEM_HOST3D
A successful DRM_IOCTL_VIRTGPU_MAP on BLOB_MEM_HOST3D implies a
roundtrip.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14658>
2022-02-11 21:16:42 +00:00
Yiwei Zhang a76d1e0e74 venus: init renderer_info at renderer creation (part 2)
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14658>
2022-02-11 21:16:42 +00:00
Chia-I Wu b41adbf211 venus: update venus-protocol to 1.3.204
There should be no visible functional change.  Although an unrelated
change in the codegen replaced vn_info_extension_spec_version by
vn_info_extension_get.  We have to adapt to that.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14782>
2022-02-02 06:57:24 +00:00
Chia-I Wu 350dfb8c3c venus: format with clang-format
clang-format misaligns one of the comments in
vn_physical_device_get_passthrough_extensions, but we can live with
that.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14550>
2022-01-27 20:35:07 +00:00
Chia-I Wu 108881cbcc venus: add some trace points
Add trace points for

 - vn_AcquireNextImage2KHR and vn_QueuePresentKHR
 - vn_AcquireImageANDROID and vn_QueueSignalReleaseImageANDROID
 - vn_BeginCommandBuffer and vn_EndCommandBuffer
 - vn_*Wait*
 - vn_Queue*
 - vn_instance_wait_roundtrip
 - shmem allocations and cache miss/skip

v2: fix cache miss/skip trace points (Ryan)

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14215>
2021-12-16 19:27:56 +00:00
Chia-I Wu 7bec2a0b23 venus: add VN_CS_ENCODER_STORAGE_SHMEM_POOL for VkCommandBuffer
It suballocates from a shmem pool owned by vn_instance.  The goals are
to speed up shmem allocations for VkCommandBuffer and to reduce the
number of BOs.  Both are crucial when shmems are HOST3D BOs, because
they require roundtrips to the renderer to allocate and they take up KVM
memslots.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 487926aa86 venus: add vn_cs_encoder_storage_type
It generalizes cs->indirect.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu 1fe8f0fea0 venus: use vn_renderer_shmem_pool for reply shmems
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14179>
2021-12-15 19:02:29 +00:00
Chia-I Wu b14dd3a866 venus: prefer VIRTGPU_BLOB_MEM_HOST3D for shmems
They are logically contiguously in the host.  More importantly, they
enable host process isolation.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13800>
2021-12-08 21:23:05 +00:00
Chia-I Wu bfa245e0c1 venus: fix vn_instance_wait_roundtrip when seqno wraps
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14026>
2021-12-02 15:02:15 -08:00
Jason Ekstrand 1f2ef68bab venus: Use the common WSI wrappers
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Chia-I Wu 6df3973b61 venus: add atrace support
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13255>
2021-10-09 00:42:32 +00:00
Chia-I Wu e38c58c808 venus: raise the ring buffer size to 64KB
When the renderer supports largeRing, raise the ring buffer size to 64KB
and raise the direct submit threshold to 4KB.  The numbers are randomly
picked.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>
2021-09-08 16:38:24 +00:00
Chia-I Wu c9eedba75d venus: make ring buffer size configurable
Until we can assume large ring support.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>
2021-09-08 16:38:24 +00:00
Chia-I Wu eb88c8e1d4 venus: rework vn_instance_submission
The goal is to remove local_cs_data.  To that end, vn_ring_submit is
modified to take a cs than a pointer.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>
2021-09-08 16:38:24 +00:00
Chia-I Wu 0641a230a0 venus: init experimental features before the ring
We can no longer use
vn_call_vkGetVenusExperimentalFeatureData100000MESA which requires the
ring to be initialized.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>
2021-09-08 16:38:24 +00:00
Chia-I Wu e5a005dd0c venus: support reply shmem without ring
Let vn_instance_get_reply_shmem_locked use the renderer if it is called
before the ring is initialized.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>
2021-09-08 16:38:24 +00:00
Chia-I Wu 2996c707cf venus: init roundtrip fields in vn_instance later
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12568>
2021-09-08 16:38:24 +00:00
Chia-I Wu bd04ff972e venus: initialize physical devices once
Avoid re-enumeration when there is no device or no supported device.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12653>
2021-09-01 20:27:50 +00:00
Chia-I Wu fc74233363 venus: group physical device fields with a struct
This makes it clear what the mutex protects.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12653>
2021-09-01 20:27:50 +00:00
Chia-I Wu a7ebcbbd6b venus: pre-initialize device groups
We don't need to worry about how vkEnumeratePhysicalDeviceGroups is
called (props is NULL, props is non-NULL but count is 0, etc.) this way.
It also allows us to fix up VkPhysicalDeviceGroupProperties easily.

v2: let the for-loop increment (Yiwei)

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> (v1)
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12637>
2021-08-31 20:54:06 +00:00
Rob Clark 6edf0d8e90 driconfig: Add support for device specific config
Add support for driconf overrides on a per-device level, for cases
where we don't want to override behavior for all devices supported
by a particular driver.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12135>
2021-08-02 16:37:24 -07:00
Chia-I Wu a753f50668 venus: break up vn_device.c
Break it up into vn_{device,instance,physical_device}.c.  Suggested by
Ryan Neph.

vn_EnumerateDeviceExtensionProperties and
vn_EnumerateDeviceLayerProperties were previously said to be device
commands.  But in this commit, we move them to vn_physical_device.c
instead.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12144>
2021-08-02 22:45:45 +00:00