About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@google.com>2024-12-16 13:09:54 -0800
committerMarge Bot <marge-bot@fdo.invalid>2025-06-17 22:28:55 +0000
commitf7a9991b893955b34d3344aad20302e63b345378 (patch)
tree9429c805bf7ce48c341b1aa01e14b78b0c81a417
parentf2b07903abaf348151aad02116585367d7d42f51 (diff)
mesa: add option to enable virtgpu_kumquat FFI for gfxstream
Will be used by Cuttlefish CI/CD, but also commonly used by gfxstream developers. meson setup gfxstream-build -Dvulkan-drivers="gfxstream" -Dgallium-drivers="" -Dvirtgpu_kumquat=true -Dopengl=false -Drust_std=2021 In distros, virtgpu_kumquat is not expected to be packaged since it is a CI/CD tool. Reviewed-by: Aaron Ruby <aruby@qnx.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35210>
-rw-r--r--meson.build3
-rw-r--r--meson.options7
-rw-r--r--src/gfxstream/guest/meson.build10
-rw-r--r--src/gfxstream/guest/platform/kumquat/VirtGpuKumquat.h5
-rw-r--r--src/gfxstream/guest/platform/kumquat/meson.build8
-rw-r--r--src/meson.build6
6 files changed, 19 insertions, 20 deletions
diff --git a/meson.build b/meson.build
index 209f3fdb9b9..604c4a7e00d 100644
--- a/meson.build
+++ b/meson.build
@@ -736,7 +736,8 @@ if with_gallium_rusticl
endif
endif
-if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv')
+with_virtgpu_kumquat = get_option('virtgpu_kumquat') and with_gfxstream_vk
+if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') or with_virtgpu_kumquat
# rust.bindgen() does not pass `--rust-target` to bindgen until 1.7.0.
if meson.version().version_compare('< 1.7.0')
error('Mesa Rust support requires Meson 1.7.0 or newer')
diff --git a/meson.options b/meson.options
index a3a77ba15fa..7bfe94abf41 100644
--- a/meson.options
+++ b/meson.options
@@ -840,3 +840,10 @@ option(
],
description : 'Allows the fallback mechanism if the dependency is not available on the system, or too old.'
)
+
+option(
+ 'virtgpu_kumquat',
+ type : 'boolean',
+ value : false,
+ description : 'Build virtgpu_kumquat (only useful with gfxstream currently)'
+)
diff --git a/src/gfxstream/guest/meson.build b/src/gfxstream/guest/meson.build
index fb8694a7c32..2244456cabe 100644
--- a/src/gfxstream/guest/meson.build
+++ b/src/gfxstream/guest/meson.build
@@ -25,16 +25,6 @@ endif
gfxstream_guest_args += '-DVK_GFXSTREAM_STRUCTURE_TYPE_EXT'
#===============#
-# Dependencies #
-#===============#
-
-with_kumquat = false
-virtgpu_kumquat_dep = dependency('virtgpu_kumquat_ffi', required: false)
-if virtgpu_kumquat_dep.found()
- with_kumquat = true
-endif
-
-#===============#
# Includes #
#===============#
diff --git a/src/gfxstream/guest/platform/kumquat/VirtGpuKumquat.h b/src/gfxstream/guest/platform/kumquat/VirtGpuKumquat.h
index 68fc462d562..03c352a767a 100644
--- a/src/gfxstream/guest/platform/kumquat/VirtGpuKumquat.h
+++ b/src/gfxstream/guest/platform/kumquat/VirtGpuKumquat.h
@@ -8,12 +8,7 @@
#include "GfxStreamVulkanMapper.h"
#include "VirtGpu.h"
-// Blueprint and Meson builds place things differently
-#if defined(ANDROID)
#include "virtgpu_kumquat_ffi.h"
-#else
-#include "virtgpu_kumquat/virtgpu_kumquat_ffi.h"
-#endif
class VirtGpuKumquatResource : public std::enable_shared_from_this<VirtGpuKumquatResource>,
public VirtGpuResource {
diff --git a/src/gfxstream/guest/platform/kumquat/meson.build b/src/gfxstream/guest/platform/kumquat/meson.build
index c1e70759745..c7fc9bdd06f 100644
--- a/src/gfxstream/guest/platform/kumquat/meson.build
+++ b/src/gfxstream/guest/platform/kumquat/meson.build
@@ -1,7 +1,7 @@
# Copyright 2022 Android Open Source Project
# SPDX-License-Identifier: MIT
-if with_kumquat
+if with_virtgpu_kumquat
files_libplatform_virtgpu_kumquat = files(
'VirtGpuKumquatDevice.cpp',
'VirtGpuKumquatBlobMapping.cpp',
@@ -17,7 +17,7 @@ libplatform_virtgpu_kumquat = static_library(
files_libplatform_virtgpu_kumquat,
cpp_args: gfxstream_guest_args,
include_directories: [inc_platform_virtgpu, inc_src, inc_gfxstream_vulkan_mapper,
- inc_vulkan_util, inc_include],
- link_with: [libgfxstream_vulkan_mapper],
- dependencies: [idep_vulkan_util_headers, virtgpu_kumquat_dep],
+ inc_vulkan_util, inc_include, inc_virtgpu_kumquat_ffi],
+ link_with: [libgfxstream_vulkan_mapper, libvirtgpu_kumquat_ffi],
+ dependencies: [idep_vulkan_util_headers],
)
diff --git a/src/meson.build b/src/meson.build
index 1b52d0bdc04..7b91402e1b4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -100,6 +100,12 @@ if with_any_nouveau
subdir('nouveau')
endif
if with_gfxstream_vk
+ if with_virtgpu_kumquat
+ subdir('util/rust')
+ subdir('virtio/protocols')
+ subdir('virtio/virtgpu_kumquat')
+ subdir('virtio/virtgpu_kumquat_ffi')
+ endif
subdir('gfxstream')
endif
if with_gallium_asahi or with_asahi_vk or with_tools.contains('asahi')