aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2021-11-09 09:38:21 -0800
committerGurchetan Singh <gurchetansingh@google.com>2022-01-06 10:42:29 -0800
commit1a68f65b056a43dab9aa45cab53f7fbc9727d41e (patch)
treee347bd7a6082f2ecee70bf91116e3dd1ae9da0cc
parent12946baac0a82affd506e1ea3d961cffd9e9fe13 (diff)
downloadgoldfish-opengl-1a68f65b056a43dab9aa45cab53f7fbc9727d41e.tar.gz
goldfish-opengl: add Linux meson build for Vulkan cereal
This adds a Meson build for Vulkan cereal. Meson is well-liked as an alternative to cmake, autogen, etc. To build: mkdir amd64-build/ meson amd64-build/ ninja -C amd64-build This assumes the Vulkan headers are already installed in the system. The best bet is to define Vulkan headers internally in goldfish-opengl to avoid the hassle of downloading them. BUG=202552093 TEST=compile Change-Id: Iab65f1cc6fde2ffcb1a07e65a44f2341cb9b84ef
-rw-r--r--android-emu/android/base/meson.build26
-rw-r--r--fuchsia/meson.build15
-rw-r--r--meson.build52
-rw-r--r--shared/GoldfishAddressSpace/meson.build17
-rw-r--r--shared/OpenglCodecCommon/meson.build16
-rw-r--r--shared/meson.build9
-rw-r--r--shared/qemupipe/meson.build17
-rw-r--r--system/OpenglSystemCommon/meson.build25
-rw-r--r--system/meson.build12
-rw-r--r--system/renderControl_enc/meson.build14
-rw-r--r--system/vulkan/meson.build17
-rw-r--r--system/vulkan_enc/meson.build31
12 files changed, 251 insertions, 0 deletions
diff --git a/android-emu/android/base/meson.build b/android-emu/android/base/meson.build
new file mode 100644
index 00000000..882b28e7
--- /dev/null
+++ b/android-emu/android/base/meson.build
@@ -0,0 +1,26 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_linux_platform = files(
+ 'AlignedBuf.cpp',
+ 'AndroidSubAllocator.cpp',
+ 'AndroidSubAllocator.h',
+ 'Pool.cpp',
+ 'Tracing.cpp',
+ 'ring_buffer.c',
+ 'files/MemStream.cpp',
+ 'files/Stream.cpp',
+ 'files/StreamSerializing.cpp',
+ 'synchronization/AndroidMessageChannel.cpp',
+ 'threads/AndroidFunctorThread.cpp',
+ 'threads/AndroidThread_pthread.cpp',
+ 'threads/AndroidWorkPool.cpp',
+)
+
+lib_emu_android_base = static_library(
+ 'emu_android_base',
+ files_lib_linux_platform,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_emu, inc_android_compat],
+ dependencies: thread_dep
+)
diff --git a/fuchsia/meson.build b/fuchsia/meson.build
new file mode 100644
index 00000000..d7f5458e
--- /dev/null
+++ b/fuchsia/meson.build
@@ -0,0 +1,15 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_android_compat = include_directories('include')
+
+files_lib_android_compat = files(
+ 'port.cc',
+)
+
+lib_android_compat = static_library(
+ 'android_compat',
+ files_lib_android_compat,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_compat]
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..25c89a78
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,52 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+project('gfxstream', 'cpp', 'c',
+ version : '0.0.1',
+ license : 'MIT OR Apache-2.0')
+
+cc = meson.get_compiler('cpp')
+
+#===============#
+# Configuration #
+#===============#
+c_args = []
+cpp_args = []
+
+# Paravirtualization moving towards virtio
+cpp_args += '-DVIRTIO_GPU'
+# Gfxstream
+cpp_args += '-DGFXSTREAM'
+# Our internal guest build
+cpp_args += '-DLINUX_GUEST_BUILD'
+# Don't want to goldfish OpenGL
+cpp_args += '-DGOLDFISH_NO_GL'
+# This is a good number for PAGE_SIZE
+# But we should really do getpagesize(..).
+cpp_args += '-DPAGE_SIZE=4096'
+# This should just be called NO_TRACE eventually
+cpp_args += '-DFUCHSIA_NO_TRACE'
+
+#===============#
+# Dependencies #
+#===============#
+
+dl_dep = cc.find_library('dl', required: false)
+drm_dep = dependency('libdrm')
+thread_dep = dependency('threads')
+
+#===============#
+# Includes #
+#===============#
+
+inc_android_emu = include_directories('android-emu')
+inc_host = include_directories('host/include/libOpenglRender')
+
+#================#
+# Subdirectories #
+#================#
+
+subdir('fuchsia')
+subdir('android-emu/android/base')
+subdir('shared')
+subdir('system')
diff --git a/shared/GoldfishAddressSpace/meson.build b/shared/GoldfishAddressSpace/meson.build
new file mode 100644
index 00000000..1db9258b
--- /dev/null
+++ b/shared/GoldfishAddressSpace/meson.build
@@ -0,0 +1,17 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_goldfish_address_space = include_directories('include')
+
+files_lib_goldfish_address_space = files(
+ 'goldfish_address_space.cpp',
+)
+
+lib_goldfish_address_space = static_library(
+ 'goldfish_address_space',
+ files_lib_goldfish_address_space,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_compat,
+ inc_goldfish_address_space],
+ dependencies: drm_dep
+)
diff --git a/shared/OpenglCodecCommon/meson.build b/shared/OpenglCodecCommon/meson.build
new file mode 100644
index 00000000..0dfcb473
--- /dev/null
+++ b/shared/OpenglCodecCommon/meson.build
@@ -0,0 +1,16 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_codec_common = files(
+ 'ChecksumCalculator.cpp',
+ 'goldfish_dma.cpp',
+ 'glUtils.cpp',
+)
+
+lib_codec_common = static_library(
+ 'codec_common',
+ files_lib_codec_common,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_compat, inc_qemu_pipe,
+ inc_qemu_pipe_types, inc_host]
+)
diff --git a/shared/meson.build b/shared/meson.build
new file mode 100644
index 00000000..762ba1e4
--- /dev/null
+++ b/shared/meson.build
@@ -0,0 +1,9 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_opengl_codec = include_directories('OpenglCodecCommon')
+inc_gralloc = include_directories('gralloc_cb/include')
+
+subdir('GoldfishAddressSpace')
+subdir('qemupipe')
+subdir('OpenglCodecCommon')
diff --git a/shared/qemupipe/meson.build b/shared/qemupipe/meson.build
new file mode 100644
index 00000000..96d49b68
--- /dev/null
+++ b/shared/qemupipe/meson.build
@@ -0,0 +1,17 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_qemu_pipe = include_directories('include')
+inc_qemu_pipe_types = include_directories('include-types')
+
+files_qemu_pipe = files(
+ 'qemu_pipe_common.cpp',
+ 'qemu_pipe_guest.cpp',
+)
+
+lib_qemu_pipe = static_library(
+ 'qemu_pipe',
+ files_qemu_pipe,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_compat, inc_qemu_pipe, inc_qemu_pipe_types]
+)
diff --git a/system/OpenglSystemCommon/meson.build b/system/OpenglSystemCommon/meson.build
new file mode 100644
index 00000000..f880f650
--- /dev/null
+++ b/system/OpenglSystemCommon/meson.build
@@ -0,0 +1,25 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_stream = files(
+ 'AddressSpaceStream.cpp',
+ 'HostConnection.cpp',
+ 'ProcessPipe.cpp',
+ 'QemuPipeStream.cpp',
+ 'ThreadInfo.cpp',
+ 'VirtioGpuStream.cpp',
+ 'VirtioGpuPipeStream.cpp',
+)
+
+lib_stream = static_library(
+ 'stream',
+ files_lib_stream,
+ cpp_args: cpp_args,
+ include_directories: [inc_host, inc_opengl_codec, inc_android_emu,
+ inc_render_enc, inc_android_compat,
+ inc_qemu_pipe, inc_qemu_pipe_types, inc_gralloc,
+ inc_vulkan_enc, inc_goldfish_address_space],
+ link_with: [lib_codec_common, lib_goldfish_address_space, lib_qemu_pipe,
+ lib_render_control_enc],
+ dependencies: drm_dep
+)
diff --git a/system/meson.build b/system/meson.build
new file mode 100644
index 00000000..f14306be
--- /dev/null
+++ b/system/meson.build
@@ -0,0 +1,12 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+inc_system = include_directories('include')
+inc_opengl_system = include_directories('OpenglSystemCommon')
+inc_render_enc = include_directories('renderControl_enc')
+inc_vulkan_enc = include_directories('vulkan_enc')
+
+subdir('vulkan_enc')
+subdir('renderControl_enc')
+subdir('OpenglSystemCommon')
+subdir('vulkan')
diff --git a/system/renderControl_enc/meson.build b/system/renderControl_enc/meson.build
new file mode 100644
index 00000000..fad55f45
--- /dev/null
+++ b/system/renderControl_enc/meson.build
@@ -0,0 +1,14 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_render_control_enc = files(
+ 'renderControl_enc.cpp',
+)
+
+lib_render_control_enc = static_library(
+ 'render_control',
+ files_lib_render_control_enc,
+ cpp_args: cpp_args,
+ include_directories: [inc_host, inc_opengl_codec, inc_android_emu,
+ inc_android_compat],
+)
diff --git a/system/vulkan/meson.build b/system/vulkan/meson.build
new file mode 100644
index 00000000..953655de
--- /dev/null
+++ b/system/vulkan/meson.build
@@ -0,0 +1,17 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_vulkan_cereal = files(
+ 'goldfish_vulkan.cpp',
+)
+
+lib_vulkan_cereal = shared_library(
+ 'vulkan_cereal',
+ files_lib_vulkan_cereal,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_emu, inc_android_compat, inc_opengl_system,
+ inc_host, inc_opengl_codec, inc_render_enc,
+ inc_vulkan_enc],
+ link_with: [lib_android_compat, lib_emu_android_base, lib_stream,
+ lib_vulkan_enc]
+)
diff --git a/system/vulkan_enc/meson.build b/system/vulkan_enc/meson.build
new file mode 100644
index 00000000..e7a8280d
--- /dev/null
+++ b/system/vulkan_enc/meson.build
@@ -0,0 +1,31 @@
+# Copyright 2022 Android Open Source Project
+# SPDX-License-Identifier: MIT
+
+files_lib_vulkan_enc = files(
+ 'CommandBufferStagingStream.cpp',
+ 'DescriptorSetVirtualization.cpp',
+ 'HostVisibleMemoryVirtualization.cpp',
+ 'ResourceTracker.cpp',
+ 'Resources.cpp',
+ 'Validation.cpp',
+ 'VkEncoder.cpp',
+ 'VulkanHandleMapping.cpp',
+ 'VulkanStreamGuest.cpp',
+ 'func_table.cpp',
+ 'goldfish_vk_counting_guest.cpp',
+ 'goldfish_vk_counting_guest.h',
+ 'goldfish_vk_deepcopy_guest.cpp',
+ 'goldfish_vk_extension_structs_guest.cpp',
+ 'goldfish_vk_marshaling_guest.cpp',
+ 'goldfish_vk_reserved_marshaling_guest.cpp',
+ 'goldfish_vk_transform_guest.cpp',
+)
+
+lib_vulkan_enc = static_library(
+ 'vulkan_enc',
+ files_lib_vulkan_enc,
+ cpp_args: cpp_args,
+ include_directories: [inc_android_emu, inc_host, inc_android_compat,
+ inc_opengl_codec, inc_render_enc,
+ inc_goldfish_address_space]
+)