15 Commits
Author SHA1 Message Date
Serdar Kocdemir f9d0c2dfc4 Fix time difference waitable warnings
Bug: 389637419
Test: CI
Change-Id: I95422047c84c5582d842d8e7c61dd9567a69de58
2025-06-04 22:40:43 +00:00
Jason Macnak c2b159afd1 Move logging to common
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
2025-05-14 16:51:19 -07:00
Jason Macnak 1c33a8d747 Update to new logging
Bug: b/403363880
Test: m
Change-Id: I931edf878a023864c7208f69e1eba7393cfce8b6
2025-04-11 14:34:57 -07:00
Jason Macnak a43dfa9f3c Add gfxstream host logging lib
... 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
2025-04-09 13:11:08 -07:00
Jason Macnak 74eb9f7c32 Re-enable -Wshadow and fix remaining issue
Bug: b/399867568
Test: build
Change-Id: I860dcda104b4f24bd8a62ad88a9701d91acb1106
2025-03-05 11:31:19 -08:00
Aaron Ruby 1ade01f177 Revert "Revert "Revert "gfxstream: stream-renderer: add waitSyncResource...""
This reverts commit 1cc4e5cfc8.

This is now a "revert^3". So finally removing this API/feature,
and all the associated code that was tracking this in queueSubmit.
As mentioned on chromium review, this was initially added by QNX for
zink+gfxstream-vulkan bring-up on Linux, but sync issues fixed in
Vulkan. This was never a robust API, and doesn't make sense in the
context of the virtio-gpu spec (i.e. for scanout resources).

Test:Linux + Android guests using gfxstream-vulkan-only configs

Change-Id: I9e25f797b27388f78c19b2fb6d979fd803bce60e
2025-03-03 18:51:02 -05:00
Aaron Ruby 71bd0142d0 Fix compilation warnings in all host code
Uncovered with QNX toolchain

Test: QNX and Linux compilation

Change-Id: Iafb692351c8315db80251ccf616fd792e3a1a43f
2025-03-03 08:45:53 -08:00
Serdar Kocdemir ced37af624 Reduce severity of pending waitable warnings
Warnings are not very useful to the end users and due to other fence
management issues, there can be too many fences in flight in a valid
way.

Bug: 390538781
Test: -feature GuestAngle
Change-Id: I3a7e0aea728eba8c7f51bd87f1c44e95714d0b60
2025-02-04 15:21:31 +00:00
Serdar Kocdemir 6a46f839e6 Replace vkWaitForFences with vkGetFenceStatus
Some vkGetFenceStatus implementations are sligtly more optimized than
a zero timeout wait, and makes it easier to follow operations in an
API dump.

Bug: 382028853
Test: CI
Change-Id: I33ec3672127591ba7d1b0fccebf6bc9cd1155155
2024-12-03 16:54:06 +00:00
Serdar Kocdemir 9e14c2da9a Add timing threshold for operation tracker logs
Check if the pending operations are old enough before reporting
warning messages, avoids getting lots of warnings when a lot of
command submissions are done by the guest.

Bug: 382028853
Test: run emulator with -feature GuestAngle, check logs
Change-Id: I40e805400274b2f977801cd1db5090421d283674
2024-12-03 14:05:25 +00:00
Bo Hu 90e4ecd400 device tracker: clean up finished fences regularly
Current logic will miss some finished fences that
are queued behind a pending fence, and that could
lead to failure to clean up finished fences, and
later lead to failure to create more fences by GPU.

So a reasonable approach is to just go through
the queue and clean up all the finished fences.

Test: run deqp with -feature GuestAngle on nvidia
GPU + linux; the waitable fence number should not
increase too rapidly.

Bug: 379683411
Change-Id: Id170525a004b67463adf72d307d60b46e91ee378
2024-11-18 09:12:19 -08:00
Gurchetan Singh 1cc4e5cfc8 Revert "Revert "gfxstream: stream-renderer: add waitSyncResource..."
Revert submission 3125001

BUG=346348303
TEST=atbd

Change-Id: Iff294455e95093e80cbcb66f36d0a280c48299b3
2024-06-14 07:48:33 -07:00
Gurchetan Singh 68437f938a Revert "gfxstream: stream-renderer: add waitSyncResource interface"
BUG=346348303
TEST=todo

This reverts commit 7609a83699.

Change-Id: I15432fe856bc1e5b3f1b71731c5bdf290da54ac1
2024-06-13 18:31:34 +00:00
Aaron Ruby 7609a83699 gfxstream: stream-renderer: add waitSyncResource interface
Useful for syncing against a specific resource. This will only be
applicable to colorBuffer resources.

Add waitSync implementation for ColorBufferVk

BUG=343234676
TEST=gfxstream guest ANGLE + gfxstream guest Zink + end2endtests

Change-Id: I8268f3b3637984f3d4d1cd6127fdd542978790c0
2024-06-06 16:21:07 -07:00
Jason Macnak 9a061665b6 Add tracking for sync objs used by vkAcquireImageANDROID()
... as the Gfxstream host renderer may launch additional queue
submits to signal these sync objects without the guest knowing.

This is an alternative approach to aosp/2908038. aosp/2908038 deferred
the destruction of these sync objects until VkDevice destruction
time under the assumption that these sync objects are generally
recycled across frames frequently. However, this did not work for
persistant services (SystemUI) nor longer lived apps (CTS) and
would result in continuous build up of open objects which would
eventually cause issues when the nofile limit was reached for the
host process (CtsGraphicsTestCases seemed to peak at ~12k open FDs).

Bug: b/319697090
Test: cts -m CtsDeqpTestCases
      --module-arg CtsDeqpTestCases:include-filter:dEQP-EGL.*
      on a GCE instance with 4096 nofile limit
Test: GfxstreamEnd2EndTests
Change-Id: I746f4e79fb998c01a90b8da691a1fbcf3f7033d3
2024-04-24 13:24:26 -07:00