Commit graph

515 commits

Author SHA1 Message Date
Gurchetan Singh
ea5d69eb52 gfxstream: fix build after vk.xml update
This is a backport of f134cc5a1e:

("Update <type category="funcpointer"> schema to simplify")

in vulkan-docs, essentially.  It changed things about how vk.xml
is parsed.

Fixes: b30f780c ("vulkan: update spec to 1.4.340")

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39502>
2026-01-26 18:25:51 +00:00
Gurchetan Singh
9c511a1fa5 gfxstream: fixes related to -Wmissing-prototypes
- the vkSetDebugMetadataAsyncGOOGLE command should
  not have an entry in the function table: it
  leads to missing prototype errors

- Make gfxstream respect cpp_msvc_compat_args, since
  it is a C++ project.  -Wmissing-prototypes will be
  made a cpp error *eventually*.

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39418>
2026-01-23 18:06:01 +00:00
Serdar Kocdemir
9ef6ed5531 gfxstream: Add VK_EXT_frame_boundary support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Also add codegen for VK_EXT_blend_operation_advanced

Test: dEQP-VK.api.frame_boundary.*

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39360>
2026-01-20 20:27:10 +00:00
Jason Macnak
7dfb009601 gfxstream: Reland "Remove unnecessary tag to simplify perfetto trac..."
Reason for reland: relanding with fix

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39360>
2026-01-20 20:27:10 +00:00
Jason Macnak
bf55e43f30 gfxstream: Reland "Add Vulkan func/structs for passing debugging da..."
Reason for reland: relanding with host side fix

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39360>
2026-01-20 20:27:10 +00:00
Sharjeel Khan
01bd71788d gfxstream: [C++23] Fixes for C++23 issues
C++23 removed certain transitive includes so you need to add C++ headers
directly to utilize their functions and classes. We add cstdlib header
for abort.

Errors:
external/mesa3d/src/gfxstream/guest/vulkan_enc/goldfish_vk_counting_guest.cpp:9505:13:
error: use of undeclared identifier 'abort'
 9505 |             abort();

Test: m vulkan.ranchu

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39360>
2026-01-20 20:27:10 +00:00
Gurchetan Singh
adec216eb0 meson,gfxstream: add Android support via meson2hermetic
Previously, there were no meson.build rules for the Android
portion of gfxstream_vk, since nobody builds gfxstream_vk + Android
via the Android NDK.

Using Soong (and not the Android NDK) is an absolute requirement,
since Android Virtual Devices (AVDs) were amongst to fully
transition to Soong over Android makefiles, leading to
breath-taking and exhilarating build speeds.

The meson build rules that do exist works are designed for
gfxstream_vk + Linux.  That leads to higher maintainence
costs: maintaining hand-written Android.bp files for Android,
and meson.build for Linux.

Enter meson2hermetic.  With this tool, meson.build becomes the
source of truth, and Android.bp are generating automatically,
reducing maintainence costs.

But for this to work, the portion of gfxstream_vk that didn't
have meson build rules needs them.  This patch does this
and there are two things to note:

1) gfxstream_vk + Android needs dependencies that don't have
any pkg-config files, and exist only with the AOSP tree.
These include things like:

   - libqemupipe.ranchu
   - libOpenglCodecCommon
   - libgralloc_cb.ranchu
   - renderControlEncoder

Most of these dependencies support the Goldfish AVD, and will
be deleted over time as the that emulator transitions to
virtio-gpu.  There are more generic Android deps too, like
"android_base".

Generic Android dependencies are given the prefix "android-",
while Goldfish (a.k.a Android Emulator) is given the prefix
"android-aemu-".

The ability to use dependencies that don't have a direct
Linux-distro style analogue is the one of motivators
meson2hermetic.

2) There's a special "gfxstream_emulated_android" case.  This
is for the GfxstreamEnd2EndTests target, which uses the code
defined here:

- src/gfxstream/guest/android/ANativeWindowEmulated.cpp
- src/gfxstream/guest/android/GrallocEmulated.cpp

This is used by Gfxstream Github for CI/CD.

Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39279>
2026-01-20 17:17:58 +00:00
Aaron Ruby
ab01793281 gfxstream: Partial revert of "gfxstream: revert "gfxstream: Add Vulkan func/structs for passing debugging data to host""
i.e. A revert^2 of 8f8bc7ca3b, to undo the
revert in cerealgenerator.py.

It needs to track latest file-naming in upstream host gfxstream:
https://github.com/google/gfxstream/blob/main/host/common/include/gfxstream/host/process_resources.h

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39241>
2026-01-09 22:50:18 +00:00
Gurchetan Singh
147ba7b1ae gfxstream: filter VkPhysicalDeviceProperties2 structs before encoder call
Otherwise, the following crash is observed on the host:

"Unhandled Vulkan structure type Unhandled VkStructureType [1000010002], aborting"

which corresponds to PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID.

We shouldn't be sending those structs down to the host.  Don't
post-process vkGetPhysicalDeviceProperties2, pre-process it to
filter the guest-only structs.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:37 -08:00
Gurchetan Singh
f29a905ab6 gfxstream: explicitly list Python dependencies for gfxstream codegen
This helps Meson track when dependencies are modified.  If they
are modified, running ninja -C actually re-generates the code.
Beforehand, this was not the case and contrary to the user
expectation.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:37 -08:00
Gurchetan Singh
933cb74c25 gfxstream: drm_fourcc.h --> drm-uapi/drm_fourcc.h
That's the include path that is provided by "inc_include".

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:37 -08:00
Serdar Kocdemir
593998ad6c gfxstream: Enable VK_EXT_blend_operation_advanced
Test: dEQP-VK.pipeline.blend.advanced.*

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:36 -08:00
Andrew Sinclair
89ffdf8c5a gfxstream: revert "gfxstream: Remove unnecessary tag to simplify perfetto trace config"
Breaks emulator 26Q1 release.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:36 -08:00
Andrew Sinclair
8f8bc7ca3b gfxstream: revert "gfxstream: Add Vulkan func/structs for passing debugging data to host"
Breaks emulator 26Q1-release.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:36 -08:00
Aaron Ruby
22a19b306e gfxsteam: Support QNX-native swapchain in host codegen
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39177>
2026-01-06 16:39:49 +00:00
Gurchetan Singh
bb17ad3f08 gfxstream: fix warning
Fixes:

DrmVirtGpuBlob.cpp:46:21: warning: comparison of integer
    expressions of different signedness: ‘uint32_t’
    {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39161>
2026-01-05 18:47:21 +00:00
Jason Macnak
d1ea08738a gfxstream: Remove unnecessary tag to simplify perfetto trace config
Test: capture guest + host trace

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39161>
2026-01-05 18:47:21 +00:00
Jason Macnak
462e73ce1c gfxstream: Add Vulkan func/structs for passing debugging data to host
... and send data on connection creation.

Test: cvd create --gpu_mode=gfxstream_guest_angle
      and go/cuttlefish-tracing to grab perfetto trace

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39161>
2026-01-05 18:47:21 +00:00
Dmitry Baryshkov
4315c28739 gfxstream: don't dump genvk.py args to generated files
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Full command lines include full path to the output file, which triggers
reproducibility warnings (e.g. in Yocto builds). Drop the args and print
only a basename of the script used to generate the file.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38875>
2025-12-18 18:52:19 +00:00
Yonggang Luo
be4ad5c819 meson: Remove VK_ICD_FILENAMES totally from source tree.
This is a follow up of
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28516

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> hk changes
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> for RADV changes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38637>
2025-12-10 14:46:11 +00:00
Gurchetan Singh
4f45e834ae gfxstream: fix logspam in TLS helper function
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Logspam has been reported in a gfxstream initialization
path.

Fixes: 4a30c6fd70 ("gfxstream: Use the Mesa common tss_* TLS helper functions")
Cc: mesa-stable

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38776>
2025-12-03 09:12:21 -08:00
Gurchetan Singh
15983e6d0d gfxstream: more fixes for missing prototypes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes things like:

GfxStreamVulkanMapper.cpp:45:10:
error: no previous prototype for function 'chooseGfxQueueFamily'[-Werror,-Wmissing-prototypes]

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38751>
2025-12-01 14:07:18 -08:00
Yonggang Luo
168042fb05 gfxstream: os_set_option can be used on windows now
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38640>
2025-11-27 18:22:34 +00:00
Yonggang Luo
0a32d5e6fd treewide: Use regexp to replace usage of setenv with os_set_option.
setenv\((.*), 1\);
=>
os_set_option($1, true);

setenv\((.*), 0\);
=>
os_set_option($1, false);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38640>
2025-11-27 18:22:34 +00:00
Yonggang Luo
1825715623 treewide: Use regexp to replace usage of unsetenv with os_unset_option.
unsetenv\((.*)\);
=>
os_unset_option($1);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38640>
2025-11-27 18:22:33 +00:00
Yonggang Luo
6356efc4e0 gfxstream: Use os_get_option_dup(VK_DRIVER_FILES)
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
As the return value os_get_option should be immediately consumed.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38687>
2025-11-27 10:20:52 +08:00
Yonggang Luo
d668c0ad42 gfxstream: Use VK_DRIVER_FILES instead of VK_ICD_FILENAMES as VK_ICD_FILENAMES is deprecated for a while.
This is a prepare for remove VK_ICD_FILENAMES in source tree.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38687>
2025-11-27 10:20:48 +08:00
Gurchetan Singh
4f9d7c3385 gfxstream: codegen: don't generate custom protocols in function table
vulkan_gfxstream.h contains custom protocols not found
in vk.xml (vk_gfxstream.xml).

gfxstream_vk_entrypoints.h is codegen by Mesa common code,
and it does not accept the custom XML.

So avoid generating implementations for them:

guest/vulkan_enc/gfxstream_guest_vk_autogen_impl/gen/func_table.cpp:5321:1:
note: declare 'static' if the function is not intended to be
      used outside of this translation unit
 5321 | void gfxstream_vk_CollectDescriptorPoolIdsGOOGLE(
      | ^
      | static
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38632>
2025-11-25 09:12:15 -08:00
Gurchetan Singh
169f571f4f gfxstream: delete createImmutableSamplersFilteredImageInfo
This function is not used.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38632>
2025-11-25 09:12:10 -08:00
Gurchetan Singh
b6df034363 gfxstream: make functions static when needed
Fixes errors like:

ResourceTracker.cpp:62:6: error: no previous prototype for function 'zx_handle_close'
                          [-Werror,-Wmissing-prototypes]

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38632>
2025-11-25 09:12:06 -08:00
Gurchetan Singh
0a231dfb40 gfxstream: silence non-null Clang check on Android
Workaround:

src/gfxstream/guest/connection-manager/GfxStreamConnectionManager.cpp:82:51:
error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
   82 |     tss_set(gfxstream_connection_manager_tls_key, nullptr);
      |                                                   ^~~~~~~

Ultimately, the Bionic headers look wrong.  Passing NULL to tss_set
is completely legit.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38632>
2025-11-25 09:11:35 -08:00
Simon McVittie
b860ae309a vulkan: Optionally share one JSON manifest per driver between architectures
If the library_path is just a basename like `libvulkan_lvp.so`, then we
can share the same JSON manifest like `lvp_icd.json` between all of the
architectures, like we already do for Vulkan layers. The library will
be looked up in the dynamic linker's default search path in this case,
and in practice will be found in `${libdir}`. This is how the Mesa's
EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13,
and also how the Nvidia proprietary driver works; it makes installation
simpler for distros, especially on multiarch systems like Debian and
the freedesktop.org SDK.

However, if we want a separate manifest per architecture in order to
be able to write the full path into it, we still need per-architecture
filename disambiguation like `lvp_icd.x86_64.json`.

We presumably still want a separate per architecture on Windows, because
the concept of a single monolithic `${libdir}` is less common there, and
it can also be helpful during development when setting `$VK_DRIVER_FILES`
to force the use of a specific driver installed in a non-default location.

Use the following parameter to passed to vk_icd_gen:
'--icd-lib-path', vulkan_icd_lib_path,
'--icd-filename', icd_file_name,
output : 'virtio_icd.' + vulkan_manifest_suffix,

and the output is passed by '--out', '@OUTPUT@',
so we can detect vulkan_manifest_per_architecture from the --out parameter in script.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
2025-11-24 19:05:57 +00:00
Gurchetan Singh
62d0957a3b gfxstream: enable kumquat building on Windows
This adds several fixes so that kumquat can build.

TEST=meson setup -Dvulkan-drivers="gfxstream" -Dgallium-drivers="" \
                 -Dzlib=false -Dopengl=false -Degl=false \
                 -Dvirtgpu_kumquat=true
                 --cross-file ${CROSS_PATH}

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
2025-11-24 06:59:22 -08:00
Gurchetan Singh
3a16b69337 gfxstream: WindowsVirtGPU.h --> WindowsVirtGpu.h
Proper naming is important.  Needed for cross-compile for mingw.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
2025-11-24 06:56:07 -08:00
Gurchetan Singh
5826a0aad9 gfxstream: meson format -i {all meson files}
More readable, allows meson format to be used in the future.

Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38388>
2025-11-12 16:05:12 +00:00
Vinson Lee
1889f1a779 gfxstream: Fix GfxStreamVulkanMapper.cpp build error
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
../src/gfxstream/guest/platform/kumquat/vulkan-mapper/GfxStreamVulkanMapper.cpp: In static member function ‘static GfxStreamVulkanMapper* GfxStreamVulkanMapper::getInstance(std::optional<DeviceId>)’:
../src/gfxstream/guest/platform/kumquat/vulkan-mapper/GfxStreamVulkanMapper.cpp:208:30: error: ‘os_get_option’ was not declared in this scope
  208 |         const char* driver = os_get_option(VK_ICD_FILENAMES);
      |

Fixes: 222b85328e ("mesa: replace most occurrences of getenv() with os_get_option()")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38331>
2025-11-09 03:10:37 +00:00
Antonio Ospite
222b85328e mesa: replace most occurrences of getenv() with os_get_option()
The standard way to query options in mesa is `os_get_option()` which
abstracts platform-specific mechanisms to get config variables.

However in quite a few places `getenv()` is still used and this may
preclude controlling some options on some systems.

For instance it is not generally possible to use `MESA_DEBUG` on
Android.

So replace most `getenv()` occurrences with  `os_get_option()` to
support configuration options more consistently across different
platforms.

Do the same with `secure_getenv()` replacing it with
`os_get_option_secure()`.

The bulk of the proposed changes are mechanically performed by the
following script:

-----------------------------------------------------------------------
  #!/bin/sh

  set -e

  replace() {

    # Don't replace in some files, for example where `os_get_option` is defined,
    # or in external files
    EXCLUDE_FILES_PATTERN='(src/util/os_misc.c|src/util/u_debug.h|src/gtest/include/gtest/internal/gtest-port.h)'

    # Don't replace some "system" variables
    EXCLUDE_VARS_PATTERN='("XDG|"DISPLAY|"HOME|"TMPDIR|"POSIXLY_CORRECT)'

    git grep "[=!( ]$1(" -- src/ | cut -d ':' -f 1 | sort | uniq | \
      grep -v -E "$EXCLUDE_FILES_PATTERN" | \
      while read -r file;
      do
        # Don't replace usages of XDG_* variables or HOME
        sed -E -e "/$EXCLUDE_VARS_PATTERN/!s/([=!\( ])$1\(/\1$2\(/g" -i "$file";
      done
  }

  # Add const to os_get_option results, to avoid warning about discarded qualifier:
  #   warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  # but also errors in some cases:
  #   error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
  add_const_results() {
    git grep -l -P '(?<!const )char.*os_get_option' | \
      while read -r file;
      do
        sed -e '/^\s*const/! s/\(char.*os_get_option\)/const \1/g' -i "$file"
      done
  }

  replace 'secure_getenv' 'os_get_option_secure'

  replace 'getenv' 'os_get_option'

  add_const_results
-----------------------------------------------------------------------

After this, the `#include "util/os_misc.h"` is also added in files where
`os_get_option()` was not used before.

And since the replacements from the script above generated some new
`-Wdiscarded-qualifiers` warnings, those have been addressed as well,
generally by declaring `os_get_option()` results as `const char *` and
adjusting some function declarations.

Finally some replacements caused new errors like:

-----------------------------------------------------------------------
../src/gallium/auxiliary/gallivm/lp_bld_misc.cpp:127:31: error: no matching function for call to 'strtok'
  127 |          for (n = 0, option = strtok(env_llc_options, " "); option; n++, option = strtok(NULL, " ")) {
      |                               ^~~~~~
/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/string.h:124:17: note: candidate function not viable: 1st argument ('const char *') would lose const qualifier
  124 | char* _Nullable strtok(char* _Nullable __s, const char* _Nonnull __delimiter);
      |                 ^      ~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------

Those have been addressed too, copying the const string returned by
`os_get_option()` so that it could be modified.

In particular, the error above has been fixed  by copying the `const
char *env_llc_options` variable in
`src/gallium/auxiliary/gallivm/lp_bld_misc.cpp` to a `char *` which can
be tokenized using `strtok()`.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38128>
2025-11-06 04:36:13 +00:00
Serdar Kocdemir
7bc14977a8 gfxstream: Check host allocation mode for external memory
New host feature allows usage of external_memory_host extension
for external memory support, mainly for software renderers which
don't implement platform specific extensions.

Also moves enablement of queue_family_foreign outside of android,
to allow it also on linux guests (ref: github PR#74), and removes
the check for VK_MVK_moltenvk extension in favor of metal mode.

Test: -gpu lavapipe -feature VulkanNativeSwapchain on windows

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38153>
2025-10-30 15:27:26 +00:00
Jason Macnak
deb48556dc gfxstream: codegen changes for new filenames and namespaces
Bug: n/a
Test: build + CI

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38153>
2025-10-30 15:27:26 +00:00
Gurchetan Singh
a85e9b8d8a gfxstream: fix build after VK 1.4.33.0 spec update
The root cause is "Add initial Vulkan Base support", which refactors
Vulkan versions into smaller features (base + graphics + compute).
Not sure if this is the cleanest solution, but someone needs to
refactor gfxstream codegen anyways.

There's also can issue with VkRenderingArea.

Fixes: 61c71733c8 ("vulkan: update spec to 1.4.330")
TEST=libgfxstream_vulkan.so + gfxstream_backend.so (host) commpiles
     with new changes

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38153>
2025-10-30 15:27:26 +00:00
Eric Engestrom
4ab65cdaa4 docs: update/fix vk spec urls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37993>
2025-10-22 09:23:34 +02:00
Gurchetan Singh
cd06ec1dcb gfxstream: codegen: remove CheckOutOfMemory
Nobody uses it.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:07 +00:00
Gurchetan Singh
af6ff36379 gfxstream: codegen: add vkTraceAsyncGOOGLE to GLOBAL_COMMANDS_WITHOUT_DISPATCH
Otherwise the codegen output fails to compile.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:07 +00:00
Jason Macnak
14e01b1eea gfxstream: Handle BGRA in Gfxstream AHB format conversions
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:06 +00:00
Gurchetan Singh
37a2a5c552 gfxstream: kumquat: opaque fd or dmabuf, not both
So Mesa drivers actually don't like both:

src/vulkan/runtime/vk_device_memory.c:

"""
 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
   const VkImportMemoryFdInfoKHR *fd_info = (void *)ext;
     if (fd_info->handleType) {
       assert(fd_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT ||
              fd_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
"""

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:06 +00:00
Gurchetan Singh
05cd676287 gfxstream: delete magma-over-gfxstream
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This was always meant to a be transitional approach.

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37728>
2025-10-08 15:42:13 +00:00
Vinson Lee
77f6753d68 gfxstream: Fix build error
../src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp:40:10: fatal error: perfetto/tracing.h: No such file or directory
   40 | #include <perfetto/tracing.h>
      |          ^~~~~~~~~~~~~~~~~~~~

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13939
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37699>
2025-10-08 05:38:19 +00:00
Simon McVittie
9d36bf891b vulkan: Compute path to write into JSON manifests once, use it everywhere
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This reduces duplication: we only need to distinguish between Windows
and Unix in one place.

The previous code was inconsistent about using either the `platforms`
option, or the `host_machine`. Following the logic described in
commit 94379377 "lavapipe: build "Windows" check should use the host machine, not the `platforms` option.",
I've assumed that checking the host machine is the more-correct version
and used that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37576>
2025-09-26 10:47:31 +00:00
Simon McVittie
be8cac52d3 vulkan: Consistently form driver library names as prefix + name + suffix
This consistently uses `NAME.dll` on Windows, `libNAME.dylib` on Darwin
derivatives such as macOS, and `libNAME.so` on Linux, *BSD and so on.
It's also consistent about using the local variable name `icd_file_name`
for this name in every Vulkan driver, which was already the case in many
but not all drivers.

Some of these drivers probably don't make sense (or don't work) on
Windows and/or macOS, but if this is kept consistent for all drivers,
it should avoid the need for driver-specific commits like
commit 611e9f29e "lavapipe: fix icd generation for windows",
commit 951f3287 "lavapipe: set empty dll prefix",
commit 13e7a39f "lavapipe: fixes for macOS support",
commit 7008e655 "radv: Update JSON generator if Windows" and so on,
each time a driver is found to be relevant on more platforms than
previously believed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37576>
2025-09-26 10:47:31 +00:00
Eric Engestrom
618038860d gfxstream/meson: generate git_sha1.h before compiling ResourceTracker.cpp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00