17 Commits
Author SHA1 Message Date
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 b001c743d3 Update non interface parts of Gfxstream to use new base lib
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
2025-05-01 16:29:17 +00:00
Jason Macnak 4b4e852b36 Cleanup references to host-common
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: I6765726663c333cd8dbbf3223e8960bec5d224d9
2025-04-28 13:06:02 +00:00
Jason Macnak ff0ca91754 Move sync devce from h/g/aemu to h/g/gfxstream
and split type declarations off into render-utils as this is a
part of the RenderLib 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 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: I14f0e04b67d3a10556dc4be1b5e4404598b94f14
2025-04-20 04:56:38 +00: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
Serdar Kocdemir 5e009fa42d Fix debug logging for syncthread
Useful when debugging issues with the sync thread and fences.

Bug: 388691356
Test: presubmit
Change-Id: I059aa1f587ad204ff7344d15ea1c433d4afeff28
2025-02-11 01:15:16 -08:00
Bo Hu bf8c695c81 correctly serialize sync worker thread initialization
aosp/3414257 only serialized the command submission;
but we need to serialize the command execution instead.

BUG:383543476

Change-Id: I944165f3d885f18ed09611541f62060f9c93d3e4
2025-01-03 09:51:50 -08:00
Bo Hu 80c8672d9b serialize syncThread creation
try, to avoid driver lock up in make current
call on nvidia gpu.

this does not consistently happen, but when
it happens, there are a few sync threads calling
into SyncThread::initSyncEGLContext, and one
is always sleep on make current into the driver;
others blocked by the segl lock half way through
their completion of initSyncEGLContext task.

The hypothesis is that the initSyncEGLContext code
is not thread safe, hence the mutex here to
force them to complete initSyncEGLContext one by
one.

This could slow down the starting up a bit, but
a good enough trade off for stability.


Bug: 383543476

Change-Id: If0f02f448dff51cafb3ae861732ff421c1a04c0d
2024-12-13 14:33:24 -08:00
Jason Macnak b77f50d471 Unlock at end of SyncThread::main()
... to fix minor -Wthread-safety issue.

Bug: b/383139165
Test: m
Change-Id: Id1e4704bb6d96828f621a915160d052b94b01265
2024-12-09 15:15:43 -08:00
Jason Macnak 9bc12d915e Add perfetto tracing to host renderer
... to aid debugging.

Bug: b/364967041
Test: cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader
Test: perfetto capture and open in ui.perfetto.dev
Change-Id: Ieda7f9ce8d0a0923a989cd201438819568cab140
2024-09-05 17:24:05 -07:00
Jason Macnak 09548c18e5 Remove some unused sync functions
... now that there are async equivalents.

Bug: b/360379616
Test: build
Change-Id: I30619388e58d25e277c7e1a98906ae4d9b58a217
2024-08-20 11:39:49 -07:00
Gurchetan Singh 95b30dc862 Reland "gfxstream: introduce GFXSTREAM_ENABLE_HOST_GLES compiler flag"
Same as before, but added extra GFXSTREAM_ENABLE_HOST_GLES
to keep MacOS builders happy.

Change-Id: I333503ecb6e67840326ce248428fa097eb152e92
2024-01-18 18:34:08 -08:00
Gurchetan Singh 6ed12e9d66 Revert "gfxstream: introduce GFXSTREAM_ENABLE_HOST_GLES compiler flag"
This reverts commit 4675a9d4ef.

Reason for revert: I suppose it breaks MacOS

Change-Id: I91bef5c2fa0e8726b6e77e6678540b808ad26316
2024-01-19 02:19:50 +00:00
Gurchetan Singh 4675a9d4ef gfxstream: introduce GFXSTREAM_ENABLE_HOST_GLES compiler flag
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
2024-01-17 18:13:22 -08:00
Andrew Woloszyn f4355a98ef Add timeline triggering triggerWaitVkQsri.
Bug: b/277980467
Test: running Chrome with instructions from the bug
Change-Id: Ie4bc8942b41ea37d8432859ad0a73ef2a65e50a7
2023-07-24 15:34:00 -04:00
Jason Macnak 648a9edc06 Rename stream-servers to host
Bug: b/271464937
Test: m
Change-Id: I89553dfe2e27170e1e968e234b364f13e76b2f88
2023-05-19 15:09:46 -07:00