Commit Graph

843 Commits

Author SHA1 Message Date
Eric Engestrom
90a77f55de ci: drop containers, builds, and tests from post-merge pipeline
All these jobs are redundant and a waste of resources:
- the containers have already been built & pushed in the merge pipeline
- the mesa build variants have already all passed
- the driver tests have already all passed

None of these jobs are doing anything useful in this pipeline, but it
costs a factor of 2x to our infrastructure, so let's remove them.

In other words, the only job left in the post-merge pipeline is the
`pages` job that deploys the update to the website.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26451>
2023-12-06 08:26:04 +00:00
Ryan Neph
a495d437b7 venus: add dri option to enable multi-plane wsi modifiers
Adds a venus dri option to advertise support for multi-plane format
modifiers to Vulkan's common WSI. Otherwise, Venus will only support
modifiers with planeCount == 1 to ensure compatibility with Xwayland's
virgl-backed Glamor backend.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
035730f26e venus: reject multi-plane modifiers for tiled wsi images
Force the use of single-plane modifiers for tiled wsi images as long as
Venus is integrated with Virgl, which does not support non-format
compression metadata planes (e.g. Intel's CCS or AMD's DCC modifiers).

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
833d228f53 venus: strip ALIAS_BIT for WSI image creation on ANV
For compositors that advertise modifier support, Vulkan common WSI
modifier support queries still fail in Venus on the Intel ANV driver.

This is due to the presence of VK_CREATE_IMAGE_ALIAS_BIT, without
accompanying wsi_image_create_info struct, which is implicitly excluded
from serialized messages over the venus-protocol.

By removing ALIAS_BIT, modifier queries begin to pass when the host
supports them.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Ryan Neph
9bde89591e venus: add VN_PERF=no_tiled_wsi_image
Force DRM_FORMAT_MOD_LINEAR for wsi image creation, even for winsys that
supports non-linear modifiers.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26240>
2023-12-05 23:55:05 +00:00
Eric Engestrom
dafd6e776e venus: fix typo in comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26495>
2023-12-05 00:03:56 +00:00
Eric Engestrom
64a827a8e6 venus: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26495>
2023-12-05 00:03:56 +00:00
Yiwei Zhang
3475c8cc41 venus: scrub msaa sample mask only with valid msaa state
No crash in dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics

Fixes: 417437c715 ("venus: pipeline fixes for VK_EXT_extended_dynamic_state3")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26404>
2023-11-29 20:49:29 +00:00
Juston Li
746da376e4 venus: implement vkGet[Device]ImageSparseMemoryRequirements
These were left unimplemented despite sparse support being added back to
venus in a55d26b5 ("venus: add back sparse binding support")

Same as vn_GetPhysicalDeviceSparseImageFormatProperties2, venus sparse
support requires queues that also support transfer so any sparse-only
queues are filtered out. If a device only supports sparse with
sparse-only queues, sparse features are disabled and these functions
return count of 0.

Fixes: a55d26b566 ("venus: add back sparse binding support")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26297>
2023-11-29 00:22:26 +00:00
Mary Guillemard
f59665bb62 venus: Do not submit batch manually when no feedback is required
This fixes hangs with Zink on piglit spec@arb_sparse_buffer tests caused by the double submission.

Fixes: a55d26b566 ("venus: add back sparse binding support")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26375>
2023-11-27 19:53:09 +00:00
Juston Li
d54c140eb6 venus: disable unsupported ExtendedDynamicState3Features
Fixes: 49e5b583 ("venus: enable VK_EXT_extended_dynamic_state3")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26261>
2023-11-17 22:00:27 +00:00
Andrew Gazizov
bafc27583c venus: Make sure that guest allocated blobs from hostmem are mappable
For guest-based blob allocations from hostmem (Host visible memory),
to make sure that virtio-gpu driver will send to the host the address
(offset in the region) of the allocated blob using RESOURCE_MAP_BLOB
command a flag VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT must be set.

Otherwise, if the upper layers didn't set it, host can't import memory
and guest allocation from Host visible memory region makes no sense.

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Andrew Gazizov
8929889563 venus: Tighten the conditions for guest_vram device memory alloc
In addition to the platform requirement (use_guest_vram), device memory
allocations from dedicated heap (guest_vram) are necessary only when:

1. VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is set and it indicates that
memory is host visible and assumed to be accessed by CPU (vkMapMemory).
2. One of external memory handle types is set, that indicates memory
can be exported with external handle.

In other cases it's not necessary to create virtgpu_bo object in the
guest and enough just perform vkAllocateMemory on host side without
memory import from dedicated heap.

Reported-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Andrew Gazizov
816f66cdfd venus: Use vk_object_id as blob_id for guest_vram device memory alloc
blob_id == 0 does not refer to an existing VkDeviceMemory and implies
a shmem allocation. So for guest_vram device memory allocations, 0 is
not a valid blob id and must be greater than 0.

Therefore, set vk_object_id as blob_id for guest_vram device memory
allocations. Considering that vk_object_id made from valid pointer, it
will be always greater than 0.

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26130>
2023-11-17 18:24:20 +00:00
Juston Li
49e5b58315 venus: enable VK_EXT_extended_dynamic_state3
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25921>
2023-11-15 23:30:14 +00:00
Juston Li
417437c715 venus: pipeline fixes for VK_EXT_extended_dynamic_state3
- pMultisampleState->pSampleMask should be ignored when
VK_DYNAMIC_STATE_SAMPLE_MASK_EXT is used.
- pRasterizationState can be null now

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25921>
2023-11-15 23:30:14 +00:00
Juston Li
e3de4a9852 venus: sync protocol for VK_EXT_extended_dynamic_state3
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25921>
2023-11-15 23:30:14 +00:00
Andrew Gazizov
d1009481c8 venus: Add use_guest_vram capset to enable guest-based blob alloc
For hypervisors that do not support host memory injection into the
guest address space, it's necessary to have guest-based blob alloc.
Therefore, use a new 'use_guest_vram' virgl capset to decide on
performing guest blob allocations from dedicated heap (Host visible
memory).

Signed-off-by: Andrew D. Gazizov <andrew.gazizov@opensynergy.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25889>
2023-11-06 18:33:15 +00:00
Mary Guillemard
f71f5cf856 venus: skip bind sparse info when checking for feedback query
Fix an assertion when using vkQueueBindSparse.

Fixes: 7fbf608f2d ("venus: append query feedback at submission time")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26027>
2023-11-06 18:15:03 +00:00
Rob Clark
06e57e3231 virtio: Add vdrm native-context helper
Add a helper to de-duplicate some of the virtgpu native-context support
between turnip and freedreno.  This should make things easier for other
drivers adding virtgpu support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-intel
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Rob Clark
b90244776a virtio/drm: Split out common virtgpu drm structs
Since these all ended up the same with (not yet merged) intel and amd
implementation of drm native context, split these out so they can be
shared.  This will also make it easier to extract out a shared helper
that can be re-used across native-context drivers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> # virtio-intel
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24733>
2023-11-04 03:00:04 +00:00
Jesse Natalie
228329f4da vulkan: Consolidate common ICD methods
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Yiwei Zhang
ae3b022fa0 venus: fix query feedback batch leak and race upon submission
Summary:
- fixed the combined query batches leak
- fixed the race condition of accessing feedback cmd pool
- very scoped code refactor

Cc: 23.3 <mesa-stable>
Fixes: 5b24ab91e4 ("venus: switch to unconditionally deferred query feedback")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25988>
2023-11-02 17:46:32 +00:00
Max R
75f7910850 virgl: Implement clear_render_target and clear_depth_stencil
This functions are required by d3d10umd frontend.
To implement both clear_render_target and clear_depth_stencil
common virgl command VIRGL_CCMD_CLEAR_SURFACE is introduced.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25947>
2023-11-01 20:33:01 +00:00
Gert Wollny
4cdd094ae1 virgl: Use host reported limits for max outputs
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24136>
2023-10-31 13:03:29 +00:00
David Heidelberg
3669ca159f ci/venus: reduce pre-merge to fit under 15 min
Currently the run takes ~ 35 minutes, which is too much.

Reported-by: default avatarDaniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25843>
2023-10-31 01:00:25 +00:00
Juston Li
5b24ab91e4 venus: switch to unconditionally deferred query feedback
All commands that make queries available have feedback cmds batched
and stored during recording. At submission time, for each batch
(SubmitInfo) these feedback cmds are recorded in a cmd buffer that is
appended after the last original cmd buffer (but before
semaphore/fence feedback).

Query reset cmds are deferred as well and also remove any prior feedback
cmds for queries its resetting within the batch.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
7fbf608f2d venus: append query feedback at submission time
Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
d2a626787e venus: track/recycle appended query feedback cmds
Link the query feedback cmd lifecycle to a cmd in the batch so that when
that last cmd gets reset/freed, we assert its safe to reset the query
feedback cmd. The cmd is then placed on the free list for reuse.

Some edge cases if the the last cmd is simultaneous or gets resubmitted.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
6dcf033dc3 venus: support deferred query feedback recording
Add function to alloc a cmd buffer and record all the deferred query
feedback cmds into it at submission time.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
99807b3db6 venus: refactor out common cmd feedback functions
defered query feedback cmds have similaries with timeline semaphore
feedback so refactor out some common functions for reuse

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Juston Li
2ea6f935ce venus: add helper function to get cmd handle
rename previous vn_get_cmd_handle as that was getting cmd
handles from the temp storage cmd_handle buffer.

Cc: 23.3 <mesa-stable>
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25413>
2023-10-30 22:22:10 +00:00
Yiwei Zhang
38deb97d10 venus: use vk_device_memory tracked memory_type_index
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
99b716c64d venus: use vk_device_memory tracked size
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
73267e38c9 venus: use vk_device_memory tracked export and import handle types
Meanwhile, we merge the export and non-external allocate paths since
export alloc will be rejected by vn_device_memory_should_suballocate.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
a47992734a venus: use common AHB management and export impl
vk_device_memory_create handles AHB export alloc and import tracking.
Also use common GetMemoryAndroidHardwareBufferANDROID impl.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:40 +00:00
Yiwei Zhang
6418a93510 venus: use common vk_device_memory as vn_device_memory base
This change only updates the handle object creation to use common vk
device memory.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
35a3a6338f venus: use common vk_image as vn_image base
This change only switches the object base, and is to prepare for using
vk_alloc_ahardware_buffer. Large refactor via leveraging existing common
vk_image state tracking will be followed.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
a8b2cfe877 venus: avoid modifier prop query in vn_android_get_image_builder
AHB prop query would check the memory plane count match instead. This
reduces vn_android_get_image_builder overhead and simplifies the AHB
import api to prepare for later common vk ahb adoption.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
7b76e1f62c venus: tiny refactor of device memory report interface
Pass type and handle directly instead of vn_object_base to prepare for
device level objects using corresponding common vk objects.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
bf0a5ebca8 venus: use common vk_image_usage_to_ahb_usage helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Yiwei Zhang
1547cf137e venus: use common vk_image_format_to_ahb_format helper
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184>
2023-10-28 00:28:39 +00:00
Corentin Noël
2ef0e6be17 util: Remove MESA_TRACE_BEGIN/END
There are no user of these macros anymore, simplify the cpu_trace header.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Corentin Noël
bf1a68833b venus: Change the only occurrence of VN_TRACE_BEGIN/END to VN_TRACE_SCOPE
This is the only part of venus using this macro, let's replace it with the scope
one.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25308>
2023-10-23 17:20:03 +00:00
Yiwei Zhang
b0100d23fb ci/venus: mark more flaky tests after recent cts uprev
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25799>
2023-10-20 21:33:22 +00:00
Juston Li
cd08d331f3 venus: set lvp queries as saturate on overflow
Test case 'dEQP-VK.pipeline.monolithic.timestamp.misc_tests.consistent_results'..
  Fail (Results are inconsistent: B32=0xffffffff B64=0x10103ba2cdd4e G32=0xba2cdd4e G64=0x10103ba2cdd4e)

Fixes: e6cffa1f0e ("venus: use feedback for vkGetQueryPoolResults")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25820>
2023-10-19 23:28:01 +00:00
Lina Versace
904f31edff venus: Fix -Wmaybe-uninitialized
src/virtio/vulkan/vn_ring.c: In function ‘vn_ring_submit’:
  src/virtio/vulkan/vn_ring.c:259:4: warning: ‘cur_seqno’ may be used uninitialized [-Wmaybe-uninitialized]
    259 |    vn_ring_retire_submits(ring, cur_seqno);
        |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25797>
2023-10-19 22:19:00 +00:00
Lina Versace
71599a1a20 venus: Enable VK_EXT_graphics_pipeline_library behind debug flag
Until the performance issues get resolved, enable the extension
if `VN_DEBUG=gpl`.

Also enable the required (and trivial) VK_KHR_pipeline_library.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
a65ac274ac venus: Do pipeline fixes for VK_EXT_graphics_pipeline_library
Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00
Lina Versace
258f04a426 venus: Refactor pipeline fixup into two stages
Function vn_fix_graphics_pipeline_create_infos() had two interleaved
phases: discovery of needed fixes, and application of those fixes.
Move the discovery phase into new function
vn_find_graphics_pipeline_create_info_fixes(). The two-phase approach
will be simplify the implementation of VK_EXT_graphics_pipeline_library.

No intended change in behavior.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>
2023-10-18 12:12:17 -07:00