Remove printf usages. Also reduces the severity of error for unimplemented
displayvk::clear call.
Bug: 389637419
Test: CI
Change-Id: If3de85fc910d1c7e1e10a1292bf02d26be0b8801
Do not initialize emulationGl when vulkan composition is used and
handle usages of it by reporting errors to the logs with the function
name when possible, rather than doing a fatal crash.
Calls to createEmulatedEglFenceSync are still being made frequently
in GuestAngle mode, probably due to a separate bug, so the error
message is logged only once.
Also changes the return type of EmulatedEglImage::destroy to a regular
bool to limit usages of EGL structures.
Bug: 389646068
Test: -feature GuestAngle,VulkanNativeSwapchain,GuestUsesAngle
Change-Id: Ib9f7f1b98fe91aa2fcd47bd98f4494eb947d00b7
Reduce usages of stderr printing and use gfxstream logging
functions instead.
Bug: 389637419
Bug: 433496880
Test: CI
Change-Id: I52ad2fe9953cffa1b028b9a388e7f90c7141a9c0
and add Android support which uses __android_log_print to
the default callback. This will allow us to eventually build
and run the guest libs in a standalone bazel environment without
Android libs (no "liblog", "libcutils", etc).
Misc notes:
* Updates some cases of ANDROID vs __ANDROID__. The former is
set when building with Soong (either host or guest) while the
latter is set specifically when targeting the Android platform.
Some places that were using ANDROID needed to be fixed to use
__ANDROID__ to properly detect when to use ANativeWindow.
* Updates the EGL platform header to address something similar
to the above where we may want to use X11 display when building
host binaries with Soong where ANDROID may still be defined.
Bug: b/416342919
Test: cd hardware/google/gfxstream
bazel build ...
bazel test ...
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu main dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: I4db669047f3900392d50509c470ea350d94a64ba
Refactors Gfxstream's ASG to hide ASG internals (context init, ring
buffer, ring config, etc) from external use. The ASG consumer interface
is updated to only take the shared memory pointers as arguments and then
all of the internal ASG context / ring initialization should happen
inside of `RingStream`. This requires a little bit of refactoring
around `onUnavailableRead()` to move the unavailable read count and
to move the setting of the `asg_context::host_state` into `RingStream`.
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu main dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: I43cc8e55ec4ded3071c22e2cfce6fab930262a17
Moves several of the "common/base" classes to host/backend as these
classes all used `Stream` which is a host only interface.
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu main dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: Ia664776c2322b310614f632e4926bb3b031f3bc1
NO_IFTTT=existing field covered with type change
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu master dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: I6bfb2c4ef8368799d9f99f6293d9762b7dcb4c7f
When a guest process died, e.g., during adb reboot,
it's vk instance will be cleaned up automatically on
the host. However, this does not happen after loading
vulkan snapshot, as there is no context id information saved
for each vk instance.
This cl fixes that problem by remembering the context id
associated with each VkInstance, save them during
snapshot save and restore them during load.
Test: save snapshot, load, adb reboot, save and load again
it should not crash during loading.
Bug: 413670220
Change-Id: I0cc7db41efc61d596ba64903cada27d9cb6348f3
VkDecoder's seqno logic may get stuck if a guest process dies and
some vk commands don't make it over to the host.
Bug: 410069267
Test: CtsGraphicsTestCases
Change-Id: Ibcf3996ca6a681e1f734c943281b112506bab7ad
... to eventually replace the existing host-common/logging. This
is needed to break up the circular dependency between aemu-base and
aemu-host-common, so that we can move parts of aemu-base and
aemu-host-common into hardware/google/gfxstream, in order to make
Gfxstream a self contained library for building.
Hooks up the existing host-common/logging via the
RenderLibImpl::setLogger() call.
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu master dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: Id52c6f756f85d0a5fb948601228234d7a84a14c2
... so that members can start to be protected with GUARDED_BY
annotations and potentially can start to eliminate having a
global `sVkEmulation`.
Bug: b/383139165
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
Change-Id: Iae4dd859991015e386fcc30ef091ccdb7ed1aeb6
Without waiting for the `RenderThread`s to complete,
`RenderThread::resume()` might destroy `mStream` before
or during use `RenderThread::loadSnapshot()`.
Setting the `waitForSave` to false was a carry over from
aosp/2824962 where some allowances were made for the end2end that
did fake snapshoting. The snapshot end2end tests were removed
to do fundamental limitations with faking VM functionality
so this `waitForSave` is no longer needed and can be completely
removed.
Bug: b/397503985
Test: snapshot with Cuttlefish
Change-Id: If252466e677a985e9ee3bde2b35d53ac2ebda759
We expose the global egl lock to synchronize the followiing
scenarios where we have observed deadlocks:
- Nvidia seems to have registered some cleanup code
(pthread_key_create) that has a race condition against other
threads calling vkDestroyDevice. So this workaround synchronizes
the RenderThread exit with vkDestroyDevice calls.
- Nvidia also seems to have a deadlock between vkDestroyDevice
and eglMakeCurrent.
Also add addtional protection around eglSwapBuffers.
Bug: 377677250
Test: Run dEQP with Nvidia GPU. Observe no hang/crash.
Change-Id: I570c14671cb8cdc79f8a1b3b1077a1f7c13d28fe
RenderThread guest puids are assumed to be invalid if it is 0, but
it seems we were using -1 as an invalid virtio-gpu context id. So
Let's check for both in RenderThread.
Bug: 339461355
Bug: 300146030
Test: Boot emulator, observe no logspam
Change-Id: I01d5bda6b48cf5f71c42f7234609b372e5612dd4
... which will allow building Gfxstream from a fixed version of
AEMU for the purposes of packaging.
Bug: b/326648397
Test: cvd start --gpu_mode=gfxstream
Test: cvd start --gpu_mode=gfxstream_guest_angle
Change-Id: I8ac1622428f0194997597868bef49118bcc3ea90
This allows:
meson -Ddecoders=vulkan
to build without errors. This is useful for enviroments where
GLES does not exist (Fuchsia) or where importing the entire
gfxstream GLES decoder is undesirable.
BUG=31148679
TEST=compile
Change-Id: I59e385c205588a4dbbe472fac1681ebe261127dc
... and avoid setting invalid PUIDs in rcSetPuid() to avoid lots of
"Failed to find process owned resources fpr puid" errors.
After aosp/2752873, the host GlProcessPipe stopped initializing a unique
id for the process pipe. However, it continued to communicate the value
of the `m_uniqueId` back to the guest. The guest still uses PUID for
rcSetPuid commands in the guest EGL/GL implementations. This would
result in garbage PUIDs being used by RenderThreads for
getProcessResources() calls. Further, if a guest process used both
EGL/GL and Vulkan, getProcessResources() would return nullptr and then
the host would crash when the VkDecoder tried to read the seqnoPtr in
the process resources.
Bug: b/312560224
Test: cvd start --gpu_mode=gfxstream
Change-Id: Ie3697a7588a8d2180ccc9e7f02f38ed6d9f1bd12
The test creates an instance, saves and loads it, to make sure it does
not crash.
In end2end snapshot tests, we do not have a real guest system. Thus
snapshot can only test the host part. To make it work we will need to
skip render thread and stream snapshots, and reuse all render channels
created before snapshots.
We also added APIs to ask render thread not to wait for snapshots, and
sync up with FrameBuffer after snapshot loads.
It runs with cuttlefish.
Bug: 294277842
Test: GfxstreamEnd2EndVkSnapshotBasicTest
Change-Id: Ibea5d9830f0e927e7dbe3552ed31ad901b5397ab
This allows to deprecate the process pipe logic, and associated
pipe services infra. In the virtio-gpu world, a "context" more
or less corresponds to a process.
BUG=297245651
TEST=launch_cvd --gpu_mode=gfxstream_guest_angle
launch_cvd --gpu_mode=gfxstream
Change-Id: I71db5ff9a71786e89a04876a2a00b9e1fd754787
libdrm doesn't exist on all platforms. Fix this and conditionally
compile Magma until multi-platform Magma can be achieved.
BUG=299991018
TEST=meson -Ddecoders=gles,vulkan,composer amd64-build/
ninja -C amd64-build/
Change-Id: I08d17ef20bd3fed021fe32df9222db941f5485a4
The virtio-gpu protocol already provides a way to name
a process (known as a "context" in it's nomenclature").
Use that. That'll allow use to delete the extra
renderControl side channel in the VK encoder while
still retaining this functionality.
BUG=297245651
TEST=launch_cvd --gpu_mode=gfxstream_guest_angle
Change-Id: I3cc4f4a497c438ed1c8bdea83a1c1180bb20f5ed
This only shows up when we use MoltenVk with the emulator on Macos.
The encoder is not setting the packetlength properly.
Fixing this in the encoder would mean re-spinning all images
that enable Vulkan.
BUG: 297588622
Test: Running vulkan_test_applications/cube
Change-Id: Ifc8dc0c3ce2a21f57bc7acd69d9d0ff967138279