Commit Graph

195237 Commits

Author SHA1 Message Date
Jason Macnak
6d2dd9c22f Update vkMapMemory to not hold lock when calling into enc
... as this can lead to a deadlock with the following sequence:

Time1: guest-thread-1: vkDestroyBuffer() called
Time2:                 VkEncoder grabs seqno 1

Time3: guest-thread-2: vkMapMemory() called
Time4:                 ResourceTracker::on_vkMapMemory() locks mLock
                       for using `info_VkDeviceMemory`
Time5:                 ResourceTracker::on_vkMapMemory() calls
                       enc->vkGetBlobGOOGLE()
Time6:                 VkEncoder grabs seqno 2
Time7:                 VkEncoder sends the vkGetBlobGOOGLE with seqno
                       2 via ASG to host
Time8:                 VkEncoder waits for the `VkResult` from the
                       host via `stream->read()`

Time9: guest-thread-1: VkEncoder calls sResourceTracker->destroyMapping()
                       ->mapHandles_VkBuffer((VkBuffer*)&buffer);
                       which calls ResourceTracker::unregister_VkBuffer()

                       ResourceTracker::unregister_VkBuffer() tries to
                       locks mLock to erase the buffer's info struct
                       from `info_VkBuffer`

!!! DEADLOCKED HERE !!!

guest-thread-1 is stuck waiting on mLock (currently locked by
guest-thread-2) before it would `stream->flush();` to finishing
sending the vkDestroyBuffer() command to the host and potentially
ping its corresponding host-render-thread-1.

guest-thread-2 stuck waiting on the result from host-render-thread-2
but host-render-thread-2 won't progress until host-render-thread-1
finishes seqno 1 which needs guest-thread-1 to finish sending/pinging.

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>
2024-09-19 20:06:00 +00:00
Hailin Zhang
8d4630549d Vulkan: fix dstArrayElement index wrap issue
See https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkWriteDescriptorSet.html

> If the dstBinding has fewer than descriptorCount array elements
> remaining starting from dstArrayElement, then the remainder will
> be used to update the subsequent binding - dstBinding+1 starting
> at array element zero. If a binding has a descriptorCount of zero,
> it is skipped. This behavior applies recursively, with the update
> affecting consecutive bindings as needed to update all
> descriptorCount 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>
2024-09-19 20:06:00 +00:00
C Stout
8e708a6c45 [guest] Fuchsia: initialize queries
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>
2024-09-19 20:06:00 +00:00
Jason Macnak
8ebd422fcd Reland "Partial revert of aosp/2858589 to avoid Mesa layer for Android"
This reverts commit 9eef6d0aefcf0aa1c07d42d9b307b1092a6deec9.

... as this does not yet have a way to generically convert Mesa
handles into Gfxstream handles in extension structs which causes
breakage in dEQP VK for many tests.

Moves the mesa based codegen to a separate `mesa_func_table`.

Reland fixes the end2end test guest vulkan ICD.

      cts -m CtsDeqpTestCases
          --module-arg CtsDeqpTestCases:include-filter:dEQP-VK.*

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>
2024-09-19 20:06:00 +00:00
Yahan Zhou
d6af74d9b0 Handle dependency by VkMemoryDedicatedAllocateInfo
We have a situation that if an image memory is created with
VkMemoryDedicatedAllocateInfo, the following commands that refer to the
same image  must happen in this exact order:

vkCreateImage
vkAllocateMemory (with dedicated image memory)
vkBindImageMemory
vkCreateImageView

Our previous dependency graph implementation uses Vulkan objects as
nodes and does not haven enough granularity to handle this situation.
vkCreateImageView can only be executed after an image is created and
bound to memory. Our previous dependency graph does not have the
notion of "bound to memory". We worked around it by adding
vkBindImageMemory as part of the image initialization steps.

To make sure we can bind image at initialization, we marked image to be
dependent on the memory it bounds to. When adding the new
vkAllocateMemory with dedicated image memory extension into the mix, it
introduced a circular dependency. vkAllocateMemory will say the memory
has dependency on the image. vkBindImageMemory will say the image has
dependency on the memory.

To properly resolve the issue, we will need to record the state of an
Vulkan object, and declare that vkCreateImageView not only depends on an
image, but also requires the image to be bound to memory. We do so by
introducing a "State" enum and use the pair <VkObjectHandle, State> as
the vertex in the deppendency graph. Currently State is an enum with 2
values: CREATED and BOUND_MEMORY. By default, after a VkCreate* command,
an object will be in CREATED state. When calling vkBindImageMemory or
vkBindBufferMemory it will transform the image or buffer into
BOUND_MEMORY state. Then vkCreateImageView will have dependency with
{VkImage, BOUND_MEMORY}.

Then we can create a dependency graph that looks like this:

VkImageView --> {VkImage,BOUND_MEMORY} --> VkMemory
                        |                       |
                        |   ┌-------------------⅃
                        v   v
                       VkImage

No more circular dependency.

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
b57b7043f6 Revert "Partial revert of aosp/2858589 to avoid Mesa layer for Android"
This reverts commit d6e1b00029419b3ae52607967bbb950137bff848.

Reason for revert: broke end2end tests b/333885743

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
cc76ad2582 Partial revert of aosp/2858589 to avoid Mesa layer for Android
... as this does not yet have a way to generically convert Mesa
handles into Gfxstream handles in extension structs which causes
breakage in dEQP VK for many tests.

Moves the mesa based codegen to a separate `mesa_func_table`.

      cts -m CtsDeqpTestCases
          --module-arg CtsDeqpTestCases:include-filter:dEQP-VK.*

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
70c695550a Explicitly specify target/bind/bpp in resource creation
... instead of trying to guess it so that BLOB AHBs can be
distinguished from pipe buffers used for guest<->host communication
in VirtioGpuPipeStream.

Adds a test which allocates a BLOB AHB.

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
d0a61f5813 Rename VirtGpuBlob -> VirtGpuResource
... as this is more generic and "VirglBlob" is not actually a blob.

find . -type f -name "*.cpp" -print0 | \
    xargs -0 sed -i '' -e 's/VirtGpuBlob/VirtGpuResource/g'
find . -type f -name "*.h" -print0 | \
    xargs -0 sed -i '' -e 's/VirtGpuBlob/VirtGpuResource/g'
find . -type f -name "*.cpp" -print0 | \
    xargs -0 sed -i '' -e 's/createVirglBlob/createResource/g'
find . -type f -name "*.h" -print0 | \
    xargs -0 sed -i '' -e 's/createVirglBlob/createResource/g'

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
d9518399dc Update emulated gralloc to use AHB format
... to match the existing real guest usage. This was okay since all of
the tests were using the drm format too but we should match.

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>
2024-09-19 20:06:00 +00:00
Yahan Zhou
563c11a3a9 Fix corner cases where vk dependency graph breaks
There are 2 issues with the current implementation of VkReconstruct:

a. When deleting a child handle it does not erase itself from its
   parent. When doing snapshot we enumerate children handles and check
   if they are still "alive". But the handle pool is written in the way
   that it could reuse handles that have been previously destroyed,
   invalidating the "alive" check.
b. Previous dependency graph does not support one handle with multiple
   parents.

In this commit we fix (a) by making child<->parent pointer
bidirectional. When deleting a child it will be erased from its parents.

We fix (b) by rewriting a significant part of dependency graph logic on
snapshot save.

The commit also makes all destroy command to be recursive (except for
vkDestroyShaderModule), which will be handled in later commits.

Also add dependency VkFrameBuffer -> VkImageView.

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
d0a4d3f3bc Add composition support to the end2end test framework
... so that we can start to test GL->VK->Host-Compositor flows.

Adds a fake render control lib that basically just exposes some of
the render control functions with scoped host connection inside of
a `RenderControlDevice`.

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
c2d57b76be Ensure glProgramBinary initializes uniform and attrib info
Adds Scoped* helper classes to hopefully make writing tests easier.

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>
2024-09-19 20:06:00 +00:00
Yahan Zhou
b1b8eb9301 Make it not crash during vk snapshot load
We are trying to make vk snapshot load the google Chrome home page
without crashing. With this CL it does not crash during load but would
crash with a device lost after submitting a queue (which is
unsurprising because everything is missing to snapshot vk queue).

Content of this commit includes:

 - Add dependencies for VkImageView, VkGraphicsPipelines, VkFramebuffer.
   They are necessary to tell the snapshot module the order of vk object
   creation.
 - Add vkBindImageMemory into the loading sequencey of VkImage, so that
   it would be executed before vkCreateImageView.
 - Delay the destruction of VkShaderModule. This is because other
   objects can still refer to it after it is destroyed.
 - Initialize VK backend for color buffer properly on snapshot load.
 - Save and load vk images in the same order by sorting them according
   to their boxed handle.
 - Record all the placeholder handles for vkCreateDescriptorPool. For
   performance purpose this function creates a lot of extra handles
   without real contents. We need to snapshot those handles as well.

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>
2024-09-19 20:06:00 +00:00
Bo Hu
2f958ad3f8 goldfish: handle null handle
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>
2024-09-19 20:06:00 +00:00
Erwin Jansen
677b398ea4 Enable GFXStream bazel build
This builds the "standalone" GFXStream library that can be consumed by
Qemu 8.2

The bazel build allows us to transition rutabaga to a bazel based
build, which will unify the Qemu 8.2 build as used by the emulator.

It also opens up the path to migrate this to g3 if we decide to do this.

This change forces a few header changes, as bazel is more strict about
the relationship between headers and packages, and doesn't easily give
you fine grained control over the include paths.

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>
2024-09-19 20:06:00 +00:00
Serdar Kocdemir
0deb66fcae Add support for VK_EXT_robustness2
This extension is required to get Vulkan Capabilities
Viewer working correctly in the emulator.

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>
2024-09-19 20:06:00 +00:00
C Stout
36d09f70ce [guest] Fuchsia: open magma device
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>
2024-09-19 20:06:00 +00:00
Jason Macnak
a7b61ee151 Introduce Gfxstream Features to decouple Gfxstream from AEMU
... which will allow building Gfxstream from a fixed version of
AEMU for the purposes of packaging.

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>
2024-09-19 20:06:00 +00:00
Gurchetan Singh
f1392431e0 gfxstream: generate development ICD for meson build
An user is now able to do:

export VK_ICD_FILENAMES=./amd64-build/guest/vulkan/gfxstream_vk_devenv_icd.x86_64.json

that allows vulkan apps without install the ICD.

If built with option `-Dgfxstream-build=guest-test`, that would go
into the gfxstream VK ICD and the test layer.  Unfortunately,
the test layer hangs right now since I believe the gfxstream_backend's
vulkan loading logic is also affected by the environment variable.

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>
2024-09-19 20:06:00 +00:00
Serdar Kocdemir
876844ddd6 Add VK_EXT_validation_features to host modules
This is another extension used for vulkan validation.

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>
2024-09-19 20:06:00 +00:00
Yahan Zhou
fe6accba65 Better track color buffer usage in Vulkan
Sometimes guest renders to an AHB without calling
vkQueueSignalReleaseImageANDROIDAsyncGOOGLE. This would result in the
color buffer not being updated from Vulkan.

This commit tracks the situation that AHB is rendered to, and copies its
content to color buffer.

Note that it adds extra wait, which could hurt performance.

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>
2024-09-19 20:06:00 +00:00
Serdar Kocdemir
ae8d2c2907 Add VK_EXT_debug_utils to host modules for codegen
Fixes emulator crashes when the validation layers
are enabled 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>
2024-09-19 20:06:00 +00:00
C Stout
9fbbdf87b6 [guest] Fix Fuchsia build, add missing header
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>
2024-09-19 20:06:00 +00:00
C Stout
220d0ffb79 [guest] Remove Fuchsia syslog_static dependency
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>
2024-09-19 20:06:00 +00:00
Serdar Kocdemir
272db6ebc4 Use append to chain memory pointer info
Append importHostInfo rather than directly assigning
to pNext for VkMemoryAllocateInfo struct.

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>
2024-09-19 20:06:00 +00:00
C Stout
2daad5f609 [guest] Fuchsia: include missing Vulkan entry points
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>
2024-09-19 20:06:00 +00:00
Serdar Kocdemir
bb2e9be160 Reduce heap pressure on getPacketContents
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>
2024-09-19 20:06:00 +00:00
Jason Macnak
092dbc32ab Make RutabagaLayer shared between "guest impls"
... so that "guest gralloc", "guest egl", "guest vulkan", etc are
all using the same underlying emulation layer (RutabagaLayer).

This moves Gralloc and ANativeWindow into platform as these should
be hidden from GfxstreamEnd2EndTests.

Note: we still want to static-ify a lot of the guest libraries.

      meson setup \
          -Ddefault_library=static \
          -Dgfxstream-build=both \
          build
      meson compile -C build

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>
2024-09-19 20:06:00 +00:00
Jason Macnak
bfac7ab65e Handle AHB R8 format conversions
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>
2024-09-19 20:06:00 +00:00
Lars Harrison
fe4a621c7b Fix coherent memory allocation to use device
When allocating coherent memory (generally, suballocations) and looking
up existing VkDeviceMemory entries, the device is critical to finding
valid allocation blocks, otherwise allocations from other devices might
be chosen, which invalidate things.

This happens only in situations where a single process has multiple
VkDevices, so it was rare enough not to be caught until 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>
2024-09-19 20:06:00 +00:00
Gurchetan Singh
ef4d6d8fb4 gfxstream: build the test layer via Meson
Useful for host driver in guest efforts.

     ninja -C amd64-build/

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>
2024-09-19 20:06:00 +00:00
Yahan Zhou
362ffb5f81 Snapshot vk image content in common situation
This commit snapshots vk image content by allocating a staging buffer
and copying the bytes on snapshot. It only works in the simplest setup.
Many situations are not considered in this commit, they include:

(1) the image does not support VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
layout;
(2) the image does not support VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
layout;
(3) the queue is dirty.

Also there is no performance optimization.

Implementation-wise, snapshot happens in VkDecoderGlobalState after
recording / playing back all create / bind commands. It borrows an
existing queue to run the extra vk copy commands. A temporary staging
buffer is also created for copying. Later we could optimize the code
by reusing most of the temporary objects.

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>
2024-09-19 20:06:00 +00:00
Yahan Zhou
67203e1574 Add snasphot support for vk coherent memory
This commit tracks more functions related to coherent memory snapshot
and saves the memory content.

At this point we are not sure if we need to manually copy the memory
content, because they are supposed to be cloned in RAM snapshot. We
could revert that part if they turn out to be unnecessary in future.

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>
2024-09-19 20:06:00 +00:00
Mitchell Kember
6af6eb87c6 [fxbug.dev] Migrate bug numbers
This changes fxbug.dev/ URLs from Monorail bug numbers to the new
Fuchsia Issue Tracker numbers.

The migration to the new issue tracker was announced here:
https://groups.google.com/a/fuchsia.dev/g/announce/c/GOYfJozEqmk/m/qsGsaJ7UAAAJ

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>
2024-09-19 20:05:59 +00:00
C Stout
db16144c89 [guest] Build fixes for Fuchsia
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>
2024-09-19 20:05:59 +00:00
Aaron Ruby
c3f327db2f gfxstream: logging on Linux guests
- Downgrade some logging messages to verbose

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>
2024-09-19 20:05:59 +00:00
Jean-Francois Thibert
cdc3c521fd Add vkUpdateDescriptorSetWithTemplateKHR to resource tracker
The call has to be processed using the internal descriptor logic.

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
1050781c4e gfxstream: always initialize rcEncoder and other things
Similiar solution to aosp/2925036, but perhaps simpler.

- Creates the rcEncoder(..) when a new thread-local encoder
  is initialized.
- keeps SetupInstanceForProcess improvement
- Always use kCapsetGfxStreamVulkan.  This should make no
  difference, since goldfish doesn't advertise
  kCapsetGfxstreamVulkan and HostConnection::get(..) defaults
  to kCapsetGfxstreamVulkan anyways to get ASG ring parameters.
- Move additional static global variables before functions

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
2dbbeca869 gfxstream: add REQUIRED_TYPES list
This makes the checks into a list.  It also adds support for
uint16_t, which are hit with newer versions of vk.xml.

I'm not sure exactly why we need the list, only that codegen
errors occur if we don't don't generate a type here.

Maybe as we try to upstream the cerealgenerator, we can figure
out why and fix it.

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
a1ac0bedfc gfxstream: add GFXSTREAM_ENABLE_GUEST_GOLDFISH
Reduces the need for goldfish sync headers in guest Linux VK build.

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
c5ced9e430 gfxstream: nuke HOST_BUILD
The host build has been deprecated in favor of end2end tests.

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
7d85b542e8 gfxstream: nuke VIRTIO_GPU flag
It's always set.

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>
2024-09-19 20:05:59 +00:00
Lars Harrison
f44b1e5523 Always initialize gfxstream vulkan
This change splits SetupInstance on the gfxstream vulkan layer into
SetupInstanceForProcess and SetupInstanceForThread, then forces
SetupInstanceForThread if the HostConnection for the current thread
hasn't been initialized when getConnection is called. Currently, this
will create an rcEncoder and include the PUID, which - when missing -
causes the host to get very confused.

This path is triggered by ANGLE, where a separate thread runs through
vulkan initialization than which ultimately uses the vulkan
components. In this case, none of the vulkan initialization code will
have independently called SetupInstanceForProcess on the current thread.

The semantics of SetupInstanceForProcess and SetupInstanceForThread are
somewhat muddled, because the sequence number pointer is a per-process
concept, but only set when initializing the rcEncoder per thread.

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
4eadf2b2a7 gfxstream: don't forward declare ProcessResources
This avoids compilation errors when codegen'ing at build
time.

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
afe32a932a gfxstream: PLATFORM_SDK_VERSION --> ANDROID_API_LEVEL
Name change.  Previosuly, the code keyed on the level was not
compiled?

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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
833850c606 gfxstream: reduce use of PLATFORM_SDK_VERSION
It's way past API-level 26 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>
2024-09-19 20:05:59 +00:00
Jason Macnak
5dc2d5f5c5 Fix "-Werror=conversion" errors for RanchuHwc
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Merged-In: I371b357e8e4400a58d0010dd20a8da285d4602b0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:05:59 +00:00
Yahan Zhou
1de3238758 Add VK_EXT_fragment_density_map for Chrome
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>
2024-09-19 20:05:59 +00:00
Gurchetan Singh
ab348d8429 gfxstream: guest: cpp_args --> guest_cpp_args
This is more descriptive..

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>
2024-09-19 20:05:59 +00:00