From f92cfe9a744e3028b144c693f064ee5b7ef14603 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 7 Apr 2026 17:47:47 -0700 Subject: [PATCH] gfxstream: additional Goldfish logic for Android builds Goldfish needs a non-stub QEMU pipe stream and access to the goldfish_sync device. All of this logic may be deleted once qemu over virtio-gpu is fully enabled. TEST=run meson2hermetic + m vulkan.ranchu Reviewed-by: Bo Hu Part-of: --- src/gfxstream/guest/connection-manager/meson.build | 7 ++++++- src/gfxstream/guest/meson.build | 5 ++++- src/gfxstream/guest/vulkan/meson.build | 10 +++++++--- src/gfxstream/guest/vulkan/stubs/meson.build | 5 +++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/gfxstream/guest/connection-manager/meson.build b/src/gfxstream/guest/connection-manager/meson.build index ebd9f8b7dfe..df2a49bcef2 100644 --- a/src/gfxstream/guest/connection-manager/meson.build +++ b/src/gfxstream/guest/connection-manager/meson.build @@ -6,10 +6,15 @@ inc_connection_manager = include_directories('.') files_libconnection_manager = files( 'GfxStreamConnection.cpp', 'GfxStreamConnectionManager.cpp', - 'QemuPipeStreamStub.cpp', 'VirtioGpuPipeStream.cpp', ) +if with_platform_android + files_libconnection_manager += files('QemuPipeStream.cpp') +else + files_libconnection_manager += files('QemuPipeStreamStub.cpp') +endif + libconnection_manager = static_library( 'connection_manager', files_libconnection_manager, diff --git a/src/gfxstream/guest/meson.build b/src/gfxstream/guest/meson.build index 7bfbf8309f4..b352c78eedd 100644 --- a/src/gfxstream/guest/meson.build +++ b/src/gfxstream/guest/meson.build @@ -46,9 +46,12 @@ gfxstream_guest_args += '-DVK_GRAPHICS_VERSION_1_4' gfxstream_guest_args += '-DVK_COMPUTE_VERSION_1_4' if with_gfxstream_emulated_android - gfxstream_guest_args += '-DEND2END_TESTS' + gfxstream_guest_args += '-DEND2END_TESTS' endif +if with_platform_android + gfxstream_guest_args += '-DGFXSTREAM_ENABLE_GUEST_GOLDFISH' +endif #====================================# # Standard deps # diff --git a/src/gfxstream/guest/vulkan/meson.build b/src/gfxstream/guest/vulkan/meson.build index aafeaaac5eb..f376e8110f0 100644 --- a/src/gfxstream/guest/vulkan/meson.build +++ b/src/gfxstream/guest/vulkan/meson.build @@ -1,7 +1,13 @@ # Copyright 2022 Android Open Source Project # SPDX-License-Identifier: MIT -subdir('stubs') +if with_platform_android + dep_gfxstream_stubs = null_dep +else + subdir('stubs') +endif + +gfxstream_deps += dep_gfxstream_stubs files_lib_vulkan_gfxstream = files( 'gfxstream_vk_cmd.cpp', @@ -35,7 +41,6 @@ lib_vulkan_gfxstream = shared_library( inc_vulkan_headers, inc_guest_iostream, inc_vulkan_enc, - inc_gfxstream_vk_stubs, inc_goldfish_address_space, inc_include, inc_src, @@ -44,7 +49,6 @@ lib_vulkan_gfxstream = shared_library( inc_connection_manager, ], link_with: [ - libgfxstream_vk_stubs, libvulkan_wsi, libplatform_virtgpu, libconnection_manager, diff --git a/src/gfxstream/guest/vulkan/stubs/meson.build b/src/gfxstream/guest/vulkan/stubs/meson.build index 2cf2d6f27d4..85cc1a24df9 100644 --- a/src/gfxstream/guest/vulkan/stubs/meson.build +++ b/src/gfxstream/guest/vulkan/stubs/meson.build @@ -15,3 +15,8 @@ libgfxstream_vk_stubs = static_library( inc_src, ], ) + +dep_gfxstream_stubs = declare_dependency( + include_directories: [inc_gfxstream_vk_stubs], + link_with: [libgfxstream_vk_stubs], +)