From 16dcb6dd2a247442f968a90616383814f8a78437 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 29 Aug 2024 12:26:36 -0700 Subject: [PATCH] gfxstream: guest: remove unneeded dependencies in meson build In the Fuchsia and meson builds, we can remove dependencies on RenderControl and just replace it with a stub. That's because only Goldfish needs RenderControl's "process pipe" logic to initialize the VkDecoders. The Fuchsia build may be migrated to Bazel over GN, so that's why it's left unmodified. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- .../guest/GoldfishAddressSpace/meson.build | 2 -- src/gfxstream/guest/vulkan/meson.build | 15 +++++++++------ .../vulkan/stubs/GfxStreamRenderControl.cpp | 13 +++++++++++++ .../guest/vulkan/stubs/GfxStreamRenderControl.h | 17 +++++++++++++++++ src/gfxstream/guest/vulkan/stubs/meson.build | 15 +++++++++++++++ 5 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.cpp create mode 100644 src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.h create mode 100644 src/gfxstream/guest/vulkan/stubs/meson.build diff --git a/src/gfxstream/guest/GoldfishAddressSpace/meson.build b/src/gfxstream/guest/GoldfishAddressSpace/meson.build index e668a4a0d96..789d5d9b45b 100644 --- a/src/gfxstream/guest/GoldfishAddressSpace/meson.build +++ b/src/gfxstream/guest/GoldfishAddressSpace/meson.build @@ -18,8 +18,6 @@ lib_goldfish_address_space = static_library( inc_android_emu, inc_goldfish_address_space, inc_guest_iostream, - inc_system, - inc_opengl_codec, inc_platform_virtgpu, inc_include, inc_src], diff --git a/src/gfxstream/guest/vulkan/meson.build b/src/gfxstream/guest/vulkan/meson.build index e47880924aa..2d3611e5454 100644 --- a/src/gfxstream/guest/vulkan/meson.build +++ b/src/gfxstream/guest/vulkan/meson.build @@ -1,6 +1,8 @@ # Copyright 2022 Android Open Source Project # SPDX-License-Identifier: MIT +subdir('stubs') + files_lib_vulkan_gfxstream = files( 'gfxstream_vk_device.cpp', 'gfxstream_vk_cmd.cpp', @@ -20,12 +22,13 @@ lib_vulkan_gfxstream = shared_library( 'vulkan_gfxstream', files_lib_vulkan_gfxstream + files_lib_vulkan_enc + gfxstream_vk_entrypoints, cpp_args: gfxstream_guest_args + gfxstream_vk_wsi_args, - include_directories: [inc_vulkan_headers, inc_opengl_headers, inc_android_emu, - inc_android_compat, inc_opengl_system, inc_guest_iostream, - inc_opengl_codec, inc_render_enc, inc_vulkan_enc, inc_platform_virtgpu, - inc_goldfish_address_space, inc_system, inc_include, inc_src, - inc_platform_virtgpu, inc_codec_common, inc_connection_manager], - link_with: [lib_android_compat, lib_emu_android_base, lib_stream, + include_directories: [inc_vulkan_headers, inc_android_emu, + inc_android_compat, inc_guest_iostream, + inc_vulkan_enc, inc_platform_virtgpu, + inc_gfxstream_vk_stubs, inc_goldfish_address_space, + inc_include, inc_src, inc_platform_virtgpu, + inc_connection_manager], + link_with: [lib_android_compat, lib_emu_android_base, libgfxstream_vk_stubs, libvulkan_wsi, libplatform_virtgpu, libconnection_manager], link_args: [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections], link_depends: vulkan_icd_link_depends, diff --git a/src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.cpp b/src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.cpp new file mode 100644 index 00000000000..8283baada41 --- /dev/null +++ b/src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.cpp @@ -0,0 +1,13 @@ +/* + * Copyright 2024 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "GfxStreamRenderControl.h" +#include + +GfxStreamTransportType renderControlGetTransport() { + return GFXSTREAM_TRANSPORT_VIRTIO_GPU_ADDRESS_SPACE; +} + +int32_t renderControlInit(GfxStreamConnectionManager* mgr, void* vkInfo) { return -EINVAL; } diff --git a/src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.h b/src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.h new file mode 100644 index 00000000000..ec42bf3bf58 --- /dev/null +++ b/src/gfxstream/guest/vulkan/stubs/GfxStreamRenderControl.h @@ -0,0 +1,17 @@ +/* + * Copyright 2024 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef GFXSTREAM_RENDER_CONTROL_H +#define GFXSTREAM_RENDER_CONTROL_H + +#include + +#include "GfxStreamConnectionManager.h" + +GfxStreamTransportType renderControlGetTransport(); + +int32_t renderControlInit(GfxStreamConnectionManager* mgr, void* vkInfo); + +#endif diff --git a/src/gfxstream/guest/vulkan/stubs/meson.build b/src/gfxstream/guest/vulkan/stubs/meson.build new file mode 100644 index 00000000000..dfd4f8201fd --- /dev/null +++ b/src/gfxstream/guest/vulkan/stubs/meson.build @@ -0,0 +1,15 @@ +# Copyright 2022 Android Open Source Project +# SPDX-License-Identifier: MIT + +inc_gfxstream_vk_stubs = include_directories('.') +files_libgfxstream_vk_stubs = files( + 'GfxStreamRenderControl.cpp', +) + +libgfxstream_vk_stubs = static_library( + 'gfxstream_vk_stubs', + files_libgfxstream_vk_stubs, + cpp_args: gfxstream_guest_args, + include_directories: [inc_connection_manager, inc_platform_virtgpu, + inc_guest_iostream], +)