Commit Graph

433 Commits

Author SHA1 Message Date
Chad Versace d0cb99e96a venus: Enable VK_EXT_pipeline_creation_feedback
Implement natively by always returning invalid feedback. This is a legal
(but useless) implementation according to the spec.

In the future, I want to return the real feedback values from the host,
but that requires changes to the venus protocol.  The protocol does not
know that the VkPipelineCreationFeedback structs in the
VkGraphicsPipelineCreateInfo pNext are output parameters. Before
VK_EXT_pipeline_creation_feedback, the pNext chain was input-only.

Tested with `dEQP-VK.pipeline.*.creation_feedback.*`.

The tests in vulkan-cts-1.3.3.0 are buggy. I submitted a fix to dEQP
upstream; see below.

Results with the bug:
    Passed:         0/30 ( 0.0%)
    Failed:        12/30 (40.0%)
    Not supported: 18/30 (60.0%)
    Warnings:       0/30 ( 0.0%)

Results with bugfix:
    Passed:        12/30 (40.0%)
    Failed:         0/30 ( 0.0%)
    Not supported: 18/30 (60.0%)
    Warnings:       0/30 ( 0.0%)

See: https://gerrit.khronos.org/c/vk-gl-cts/+/10086
See: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/909
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18035>
2022-09-08 19:13:51 +00:00
Yiwei Zhang 4ae4e4362c venus: double the abort timeout
To avoid bumping abort timeout too much. This change also doubles the
busy wait cycles, which would further reduce unnecessary sleeps for
synchronous calls. Ultimately, after we fix the fencing and push all
roundtrip waiting to the renderer side as well as we fixing the abort
logic, we can live with busy wait alone here.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18472>
2022-09-07 18:48:07 +00:00
Yiwei Zhang d399685da5 venus: enable KHR_driver_properties on Android
Venus has a driver id now and Android cts has been patched.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18447>
2022-09-06 19:52:26 +00:00
Yiwei Zhang 61e899a181 venus: enable zink required extensions on Android
Below extensions are enabled:
- VK_KHR_external_memory_fd
- VK_EXT_external_memory_dma_buf
- VK_EXT_image_drm_format_modifier

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18447>
2022-09-06 19:52:26 +00:00
Yiwei Zhang ac95ecd044 venus: some clang format fixes
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18447>
2022-09-06 19:52:26 +00:00
Dawn Han 2a2766ce18 Enable .VALVE_mutable_descriptor_type in physical_device
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>
2022-09-02 21:15:43 +00:00
Dawn Han de5879447b Track bitset when create descriptor pool
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>
2022-09-02 21:15:43 +00:00
Dawn Han d5f116feb5 Update bitset when init descriptor layout.
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>
2022-09-02 21:15:43 +00:00
Dawn Han 7039467522 Increase enum type in vn_descriptor_set.
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>
2022-09-02 21:15:43 +00:00
Igor Torrente 1ebfa00bc5 venus: Fix dEQP-VK.pipeline.timestamp.calibrated.host_domain_test failure
The current implementation is getting its clock value from the host
and this value is not guaranteed to be the same as the VM guest.

This commit implements the CLOCK_MONOTONIC[_RAW] natively.

Signed-off-by: Igor Torrente <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18281>
2022-09-02 00:54:24 +00:00
Renato Pereyra f5a81bb1d0 venus: Increase vn_relax sleep time
After the recent Venus changes to fence feedback, the performance drop from
increasing this setting are now negligible while DX games still experience a
sizable decrease in CPU utilization.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18357>
2022-09-01 00:50:39 +00:00
Yiwei Zhang 0e0e5d1f20 venus: allow no external memory handle when renderers lacks support
This is to make vtest happy.

Fixes: 9c5a7ffbd8 ("venus: fix external memory ext filtering")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18331>
2022-08-31 03:13:39 +00:00
Chad Versace 6d0c86c777 venus: Enable VK_EXT_tooling_info
Implement it locally with the common implementation.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 2bf2a05312 venus: Enable VK_EXT_private_data
Implement it as hybrid native/passthrough as a workaround until venus
learns how to deep surgery on pNext chains. Eventually, we want to
implement it purely natively. For details, see the big code comment.

See: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/908
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Signed-off-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 4d80ccbf2d venus: Enable VK_KHR_format_feature_flags2
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace fc2d37882c venus: Enable VK_EXT_ycbcr_2plane_444_formats
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace ea273dd8b9 venus: Enable VK_EXT_texel_buffer_alignment
The patch looks asymmetic because the extension was promoted to 1.3 but
not its feature struct.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 246f29d0b1 venus: Enable VK_EXT_subgroup_size_control
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace c01f0bbbec venus: Enable VK_KHR_zero_initialize_workgroup_memory
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 23a424f6e3 venus: Enable VK_KHR_shader_terminate_invocation
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 8fbc12feb2 venus: Enable VK_KHR_shader_non_semantic_info
This extension has no Vulkan API, only SPIR-V API.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 1951eb2dad venus: Enable VK_KHR_shader_integer_dot_product
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 1985afdde5 venus: Simplify vn_GetPhysicalDeviceProperties2
Reduce approximately 220 lines to 80.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 7d1fb018f2 venus: Simplify vn_GetPhysicalDeviceFeatures2
Reduce approximately 300 lines to 60.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Chad Versace 3ed2c58047 venus: Sort passthrough extensions
Only the Vulkan 1.3 extensions were unsorted.

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
2022-08-30 08:09:55 +00:00
Juston Li c1871cfde4 venus: add support for VK_EXT_primitive_topology_list_restart
See:
virgl/virglrenderer!902
olv/venus-protocol!46

Test:
./deqp-vk -n dEQP-VK.pipeline.monolithic.input_assembly.primitive_restart.*

Test run totals:
  Passed:        55/55 (100.0%)
  Failed:        0/55 (0.0%)
  Not supported: 0/55 (0.0%)
  Warnings:      0/55 (0.0%)
  Waived:        0/55 (0.0%)

Signed-off-by: Juston Li <justonli@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18283>
2022-08-26 16:30:51 -07:00
Chia-I Wu 05baeef69c venus: use MESA_TRACE_*
Acked-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18260>
2022-08-26 21:47:44 +00:00
Yiwei Zhang ce0e13155d venus: avoid scrubing wsi/external sempahores
When the renderer supports sync_fd import for the binary semaphore,
venus can import the special signaled payload to the semaphore instead
of scrubing it. This avoids the bugs w.r.t timeline semaphore and device
group submission in the legacy scrub path.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 7cf59d6982 venus: re-implement sync_fd external sempahore
sync_wait is deferred to a submission that waits on the semaphore.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 4da0ac54cf venus: re-implement sync_fd external fence
Instead of waiting for signal before importing, we are able to retain
the imported sync file and handle the fence related commands on the
driver side.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang db9fa4be04 venus: query renderer sync_fd props to fill the feature stubs
This change enables the fixed code paths.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 3518c31098 venus: fix vn_GetSemaphoreFdKHR
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang adac798598 venus: fix vn_GetFenceFdKHR
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang b21e4a7990 venus: put android wsi on the sub-optimal path
Simplify Android wsi to only use performant path if fixed sync_fd fence
support is enabled. This removes hacky codes and allows us to deprecate
a special ring wait code path as well.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 64f9fbb9ea venus: stub out renderer sync_fd fencing features
With syncFdFencing feature, venus starts forwarding renderer sync_fd
fencing support. The driver side now can track the renderer sync_fd
fencing features. This change adds the initial stubs.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 88a5146d95 venus: avoid pre-allocating the feedback pool
Now that we don't create fence upon device creation, let's also defer
the feedback pool grow to the first event or non-external fence
creation. This makes venus device creation lighter and is good for CI.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 81b44b4931 venus: lazily create queue wait fence and make it non-external
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang d85d29b731 venus: use a separate sync fence for Android wsi
Also refactors the codes a bit.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 5457f4c0a4 venus: avoid feedback for external fence
Sync fd fence export implies a payload reset operation, and application
can immediately do another submission with the same fence after export.
Concurrent use of the same feedback slot is incorrect. Keeping a list of
feedback slots for sync_fd external fence is a bit over designed given
those fences are usually not checked or waited by the app, but will hand
off the ownership via sync fd to an external client.

Fixes: d7f2e6c8d0 ("venus: add fence feedback")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 7925340220 venus: require necessary extensions for common wsi support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Yiwei Zhang 9c5a7ffbd8 venus: fix external memory ext filtering
Fixes: 390722620e ("venus: clean up vn_device_fix_create_info")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17975>
2022-08-25 20:18:28 +00:00
Chad Versace a771efdefe venus: Enable VK_EXT_pipeline_creation_cache_control
The extension disrupts assumptions in venus. It gives
vkCreateFooPipelines an additional success code,
VK_PIPELINE_COMPILE_REQUIRED, which allows some pipelines to succeed
creation and others fail.

Tested with 'dEQP-VK.*cache_control*' at vulkan-cts-1.3.3.1.
  pass/fail/skip/warn = 15/0/0/3
Warnings were from long pipeline compiles on a full debug build in host
and guest.

See: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/890
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17847>
2022-08-24 22:50:33 +00:00
Chad Versace f81915585d venus: Fix failure path on pipeline creation
It's not sufficient to vk_free() the pipeline. We must also
vn_object_base_fini().

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17847>
2022-08-24 22:50:33 +00:00
Chad Versace ad8c8e366a venus: Dedupe pipeline handle creation
Refactor the code into new function vn_create_pipeline_handles().

Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17847>
2022-08-24 22:50:33 +00:00
Juston Li 95b0b2bea0 venus: Enable VK_EXT_texture_compression_astc_hdr
See: virgl/virglrenderer!874

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17967>
2022-08-10 19:07:22 +00:00
Chad Versace 56f3319519 venus/pipeline: Fix ignore rules for VK_EXT_extended_dynamic_state
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16681>
2022-08-10 18:17:52 +00:00
Chad Versace e643173cc5 venus/pipeline: Fix ignore rules for VK_KHR_dynamic_rendering
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16681>
2022-08-10 18:17:52 +00:00
Chad Versace 33e791bc02 venus/pipeline: Ignore basePipelineHandle
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16681>
2022-08-10 18:17:52 +00:00
Chad Versace d39e202dac venus/pipeline: Ignore pViewportState::pScissors
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16681>
2022-08-10 18:17:52 +00:00
Chad Versace d6f2915ae5 venus/pipeline: Ignore pViewportState::pViewports
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16681>
2022-08-10 18:17:52 +00:00