We acquire the lock when createExtraHandlecsForNextApi is called. But
depending on config, vkCreateDescriptorPool may or may not call
createExtraHandlesForNextApi, which results in inconsistency of the lock
state when calling snapshot()->vkCreateDescriptorPool.
We add a tryLock so that it always acquires the lock before modifying
mReconstruction.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
The HealthMonitor is hang detection at the API Vulkan
encoder level.
It's actually not used in CF/AAOS/Emualtor. The
plan for AOSP is actually to increase the amount
of Android CTS that are run against gfxstream to
increase health/stability, for example (b/347288539).
So if we consistently pass CTS on main with gfxstream
(as is the plan), HealthMonitoring would be somewhat
redundant.
Also, AndroidHealthMonitor is somewhat duplicated with
libaemu's HealthMonitor as well.
Also, nuke EncoderAutoLock while we're at it. It also
is unused code.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
vkInitializeKumquat is a custom Vulkan API to allow
the user to specify the particular kumquat instance.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
An multi-threaded test might want:
- launch multiple kumquats
- connect each thread to a specific instance
of kumquat.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
A descriptor is an int32_t number. Anything >= 0
is considered a valid descriptor. It essentially like
a fd, but it will be used with kumquat testing.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This was added for Fuchsia support, and now we have a
dedicated Fuchsia subdir.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Includes more complete support for depth formats.
Bug=b:352091996
Test=Ran CTS deqp test cases with cuttlefish
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Print missing structure information before calling abort.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
- API for virtgpu_kumquat_init will change with
crrev.com/c/5747430
- Better error reporting
- Use paths prefered by AOSP
- Handle emulated sync files via eventfd
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
... to avoid aborts due to unbox failures on the host as the
mesa layer was turned back on for Android in aosp/3066068.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
... by silo'ing each physical device in its own device group.
This unblocks dEQP VK testing until the mesa layer has codegen
to fully translate structs in pNext chains.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Things that missed the last round of deletions.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
- One less dependency on guest/android-emu/
- MESA_SCOPE_TRACE works on Linux guests or via Kumquat
too, for better performance analysis
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
vkcube-wayland uses this format on Intel/Linux.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Unboxing fails if a NULL handle is passed in, triggering an abort.
However for vkCmdBeginTransformFeedbackEXT, this is perfectly
valid:
"For each element of pCounterBuffers that is VK_NULL_HANDLE,
transform feedback will start capturing vertex data to byte zero
in the corresponding bound transform feedback buffer."
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
pCounterBuffers can be NULL, which crashes on the autogen path:
"For each element of pCounterBuffers that is VK_NULL_HANDLE,
transform feedback will start capturing vertex data to byte zero
in the corresponding bound transform feedback buffer."
Need to special case.
Intel
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
From the Vulkan 1.3.204 spec:
VUID-VkSubmitInfo-pNext-03240
"If the pNext chain of this structure includes a
VkTimelineSemaphoreSubmitInfo structure and any element of
pSignalSemaphores was created with a VkSemaphoreType of
VK_SEMAPHORE_TYPE_TIMELINE, then its signalSemaphoreValueCount
member must equal signalSemaphoreCount"
Internally, Mesa WSI creates placeholder semaphores/fences (see
transformVkSemaphore functions in in gfxstream_vk_private.cpp).
We don't want to forward that to the host, since there is no host
side Vulkan object associated with the placeholder sync objects.
The way to test this behavior is Zink + glxgears, on Linux hosts.
It should fail without this check.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Only seems to be used in the Fuchsia builds.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Removes dependency on gfxstream::guest's AEMU lock classes.
Mostly consists on Autolock<RecursiveMutex> to
std::lock_guard<std::recursive_mutex>.
There are some cases where the code does:
Autolock<RecursiveMutex> lock(mLock)
..
lock.unlock()
[ do something ]
lock.lock().
..
Those cases were replaced with std::unique_lock.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
With newer versions of libstdc++, debug builds of gfxstream
hit this assert:
0x00007ffff6ed2d60 in std::__glibcxx_assert_fail
(file=<optimized out>, line=<optimized out>, function=<optimized out>,
condition=<optimized out>)
at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/assert_fail.cc:41
std::allocator<VkDescriptorBufferInfo> >::operator[]
(this=0x555555609380, __n=0)
at /usr/include/c++/14.1.1/bits/stl_vector.h:1130
(pDescriptorSets=0x7fffffffcc30, descriptorSetCount=2,
bufferInfos=std::vector of length 1, capacity 1 = {...})
at ../guest/vulkan/gfxstream_vk_device.cpp:718
(device=0x55555562f400, descriptorWriteCount=2,
pDescriptorWrites=0x7fffffffcc30, descriptorCopyCount=0,
pDescriptorCopies=0x0)
at ../guest/vulkan/gfxstream_vk_device.cpp:746
Use resize instead of reserve + memset.
"That way the vector size would be initialized, bounds checks would
be happy, and default-init would automatically zero out POD structs
for us." -- dextero@
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
... to remove some logspam. Looks like some ALOGVs were converted
to mesa_logi() in aosp/3093240.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
... which triggers the device lost failures when aosp/3163776
is reverted.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Add VK_KHR_ray_tracing_pipeline and VK_KHR_pipeline_library
extensions support which are used by some test applications.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
If gfxstream-vulkan host supports these features and
the virtgpu layer is new enough, use the apis.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
It's a rename so the same concept can be used with sync
descriptors.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This uses the new fence passing APIs provided by kumquat.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Guest side needs to check availability of new protocol.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
New protocol which instructs the host to share sync descriptor
with ExternalObjectManager.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
... which was useful for debugging b/347288539.
--gpu_mode=gfxstream_guest_angle \
--gpu_renderer_features=VulkanCommandBufferCheckpoints:enabled
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Structure size is needed to parse incoming streams correctly.
This avoids emulator crashes when an unsupported extension structure is
used on the guest side.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
The real Linux kernel must copy the ioctl struct, while
virtgpu_kumquat does not have to. For this reason, the
get_param implementations can be different.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Extensions known in the vulkan header will be displayed with their
names to make debugging easier and the missing feature more visible.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
Reduce clutter due to extensions related ifdef code block generation
and avoid changing many files when a new extension support is added
with partial functionality.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This makes Linux guests create color buffers blobs and
buffer blobs, in response to dedicated image and buffer
requests from the guest. This is only done in Linux guests
for now.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This reports the new host side capabilities (the ability to
make exportable color buffer blobs) back to the guest.
This feature is only used with experimental Linux guest
support in gfxstream.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This uses libvirtgpu_kumquat_ffi.so to send commands to the
Kumquat Media Server. The implementation of Kumquat is found
at crrev.com/c/5645904.
This is a more complex, but more fully featured end-to-end testing
framework. This biggest benefit it is can run complex apps (vkcube,
gfxbench + ANGLE/Zink) on Linux, without a VM or a full Android tree.
The rutabaga FFI path -- which relied on a nested Vulkan loader -- didn't
work for complex apps and funkiness was observed with the nested
Vulkan loader.
Plus, app 1 + app 2 could connect Kumquat at the same time.
This may also benefit snapshot tests, particular since end to end
flow relies on external blob. For example, a snapshot save command
could actually call stream_renderer_teardown(..) on the host-side,
while the guest retains it's state (ASG mappings + vulkano mappings).
A snapshot restore would actually call stream_renderer_init(..)
+ stream_renderer_restore(..), which an actual upstream VMM would
do.
Another additional benefit is multi-context testing. Since
libvirtgpu_kumquat_ffi.so is portable, other libraries (minigbm)
can also call it. We can mimic the cross-domain context allocating
via libminigbm.so, while context libgfxstream_vulkan.so imports the
file descriptor.
This change only transitions the meson build since the main goal
is once again is Linux on Linux testing w/o an Android tree.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This reverts commit e43734cb0fa4e938f6ca43a01ed82d5921ad3f0d.
Reason for revert: have a real fix in aosp/3151746
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
We did a few things here.
1. Update VkBindImageMemoryInfo in vkBindImageMemory2 for snapshot. In
its implementation, vkBindImageMemory2 sometimes replaces an unboxed
VkImage handle with a new one, which breaks snapshot. We update its
value so that it can map to the proper one when calling snapshot
functions. Note that there is a const cast which we might want to fix
later.
2. Lock it properly when calling createExtraHandlesForNextApi.
3. Add support for more VkImage format. Fix mipmap extend calculation.
Now it works with -guest-angle but fails with VVL, not sure why.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This reverts commit 58934c4400e20934ef3172aab1a5ebefaa08e786.
Reason for revert: Breaks meson build
Same issue has aosp/3141746
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>