Commit graph

484 commits

Author SHA1 Message Date
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
Gurchetan Singh
943ac08280 gfxstream: determine page size based on guest properties too
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
blobAlignment helps with running a 4KB guest on a 16KB host.
But for 16KB guest on 4KB host, we'll need to check guest
size too.  os_get_page_size(..) might not work on all target
guest OSes now, so default to 4KB.

TEST=CF 16KB works

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37460>
2025-09-22 16:21:44 +00:00
Jason Macnak
03a4d7ff7e gfxstream: Address some Werror errors from ag/35389434
Fix things.

Test: github CI

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37410>
2025-09-16 23:26:27 +00:00
Serdar Kocdemir
f1c1dc66d4 gfxstream: Enable VK_MVK_macos_surface for host dispatch
To be used in Vulkan composition on macOS.

Test: -feature GuestAngle, VulkanNativeSwapchain

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37410>
2025-09-16 23:26:27 +00:00
Jason Macnak
2e56f34952 gfxstream: hide vkTraceAsyncGOOGLE behind new capset flag
... to make it forward compatible / to make it not crash older
Gfxstream host builds.

Test: Capture guest and host trace and inspect in perfetto UI

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37410>
2025-09-16 23:26:27 +00:00
Jason Macnak
46bfb31d7f gfxstream: add a vkTraceAsyncGOOGLE
... to allow sharing perfetto global flow ids between guest and host
so that combined traces can have an arrow between the guest and host
render threads to aid debugging.

Test: Capture guest and host trace and inspect in perfetto UI

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37410>
2025-09-16 23:26:27 +00:00
Aaron Ruby
39a5e80a7a gfxstream: address-space graphics requires kParamResourceBlob and kParamHostVisible
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Make init failure more clear if this is not the case.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37285>
2025-09-12 18:38:21 +00:00
Alyssa Ross
6f8cdd8a3c gfxstream: guest: don't use transitional LFS64 API
musl removed the LFS64 APIs like mmap64(), which were intended to be a
transitional measure multiple decades ago, causing a build failure
here.  Since virtio-gpu sizes and offsets are 64-bit, we do still want
to make sure that we're using 64-bit mmap here, so I've added
-D_FILE_OFFSET_BITS=64, which will ensure that off_t is always 64-bit
in gfxstream guest, and which is generally the modern solution here.

With this change, I am able to build gfxstream with musl.

Fixes: fec8e296a3 ("Make VirtGpu* interfaces")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37086>
2025-09-02 16:45:20 +00:00
Aaron Ruby
c3533e49ab gfxstream: Prune all guest-side KHR entrypoints that are provided with VK_VERSION_1_1
vk dispatch in mesa provides the redirection for this. Also, other
recent changes have increment the minimium host requirement for
gfxstream-vk to VK_VERSION_1_1, anyways.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36942>
2025-08-27 16:40:44 +00:00
Gurchetan Singh
091e2f5ec5 gfxstream: ANDROID --> VK_USE_PLATFORM_ANDROID_KHR
gfxstream mostly uses VK_USE_PLATFROM_ANDROID_KHR to determine
the presence of window system extensions.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36826>
2025-08-19 10:46:16 +00:00
sergiuferentz
651d2fd804 gfxstream: VirtGpuDevice can be null for Goldfish.
Fixes crashes.

Test: atest CtsDeqpTestCases -- --module-arg 'CtsDeqpTestCases:include-filter:dEQP-VK.image.swapchain_mutable.android.2d*'

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36826>
2025-08-19 10:46:16 +00:00
Bo Hu
4ebda87b49 gfxstream: [vulkan snapshot]: update code gen for vkUpdateDescriptorSet change
Update codegen

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36826>
2025-08-19 10:46:16 +00:00
Jeongik Cha
3e39c09aa0 gfxstream: Generate goldfish dispatch code for AHB extension
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36510>
2025-08-01 18:34:15 +00:00
Jason Macnak
72d07c16a3 gfxstream: Add gfxstream TLS connection manager reset
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
... which is still needed to keep the end2end tests happy
when one thread creates and destroys instances multiple times
(which happens in the MultiThreadedShutdown test).

Test: GfxstreamEnd2EndTests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36471>
2025-07-30 19:41:14 +00:00
Gurchetan Singh
8d899622b6 gfxstream: correct Android API level check
The header says:

enum ADataSpace AHardwareBuffer_getDataSpace(const AHardwareBuffer* _Nonnull buffer)
        __INTRODUCED_IN(__ANDROID_API_V__);

which is API level 35.

Reviewed-by: Jason Macnak <jmacnak@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36338>
2025-07-24 20:30:45 +00:00
Aaron Ruby
49ec8bc982 gfxstream: Add init+tracking for the host-equivalent queue_family
information

This information (otherwise invisible to the guest) may be used in the
future in some other guest-only functionality

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36330>
2025-07-24 15:58:30 +00:00
Aaron Ruby
89ccc8ba2b gfxstream: Pre-fetch the VkQueue objects from the host
.. and refactor vk_queue initialization entirely to store the queue
information at device-creation time.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36330>
2025-07-24 15:58:30 +00:00
Aaron Ruby
b1f6b76f85 gfxstream: Remove on_vkGetDeviceQueue* impls entirely
The VkQueue_info::device field is not actually needed anywhere.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36330>
2025-07-24 15:58:30 +00:00
Aaron Ruby
4a30c6fd70 gfxstream: Use the Mesa common tss_* TLS helper functions
... in GfxstreamConnectionManager, to acquire the threadLocalInstance
of the connectionManager. Using thread_local attribute storage to store
some CPP primitives (i.e. unique_ptr) can cause issues on some
platforms.

Better to do all TLS as explicit as possible, using the available
utilities from common src/util. Don't need to wrap it in
a std::unique_ptr either, as the instance is just managed by the
destructor in the TLS interface.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36302>
2025-07-24 15:44:42 +00:00
Aaron Ruby
525513fd23 gfxstream: Modify deviceName, driverVersion, driverName, driverInfo ...
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
... to report that Vulkan is running through a gfxstream driver to the
host driver. This matches what Venus does.

TODOs added for driverID, need spec'd driverID for gfxstream in Mesa.

Example:

Device Properties and Extensions:
=================================
GPU0:
VkPhysicalDeviceProperties:
---------------------------
        apiVersion        = 1.3.0 (4206592)
        driverVersion     = 525.147.5.0 (2204418368)
        vendorID          = 0x10de
        deviceID          = 0x1fb9
        deviceType        = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
        deviceName        = Virtio-GPU GFXStream (Quadro T1000)
        pipelineCacheUUID = 5e84b6ed-4e70-35e3-a855-d75f23b64fd5

VkPhysicalDeviceDriverProperties:
---------------------------------
        driverID        = DRIVER_ID_NVIDIA_PROPRIETARY
        driverName      = gfxstream
        driverInfo      = Mesa 25.1.0
        conformanceVersion:
                major    = 1
                minor    = 3
                subminor = 3
                patch    = 1

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36290>
2025-07-23 17:26:25 +00:00
Gurchetan Singh
5740c65b6a gfxstream: vulkan-mapper: special case Nvidia
Also, VIRTGPU_KUMQUAT_HANDLE_TYPE_MEM_DMABUF is 0x2, not 0x1

Fixes create device failures in end2end tests.

Reviewed-by: Jason Macnak <jmacnak@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36295>
2025-07-22 23:44:28 +00:00
Aaron Ruby
13e6fa4ba8 gfxstream: Remove duplicate/unnecessary frees in destroyDevice
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36273>
2025-07-22 18:12:35 +00:00
Gurchetan Singh
e315917554 gfxstream: null-check in vulkan-mapper
Fixes an observed crash.

Reviewed-by: Jason Macnak <jmacnak@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36264>
2025-07-21 19:00:18 +00:00
Aaron Ruby
34babeac9b gfxstream: Downgrade some debug prints to traces
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
They are more "verbose" debugging statements, even at the debug level,
they are too verbose (i.e. every waitFence)

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36232>
2025-07-18 19:20:30 +00:00
Aaron Ruby
c83f481cdd gfxstream: Remove all "Yoda conditions" in gfxstream_vk_device.cpp
Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36227>
2025-07-18 18:49:37 +00:00
Aaron Ruby
ae904e11a8 gfxstream: init vk_queues in CreateDevice() based on queueCreateInfo
... and defer getDeviceQueue impl to vk_common and trim down impls in
gfxstream.

gfxstream advertises, and selects queues/queueFamilies from what the
real device on the host advertises. During createDevice(), it needs to
allocate the queue objects to support this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36227>
2025-07-18 18:49:37 +00:00
Aaron Ruby
4f227dc00c gfxstream: Rename platform/linux to platform/drm
... And rename LinuxVirtGpu* -> DrmVirtGpu*

The characteristic of this virtgpu implementation is that it works
through the DRI from Linux. Yes, this is traditionally "Linux" specific,
but some platforms such as QNX, have started to incorporate parts of the
"DRM framework", on a platform that otherwise still is not "Linux". This
is just a more generally applicable naming to this implementation.

Reviewed-by: Gurchetan Singh <gurchetansingh@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36229>
2025-07-18 18:35:17 +00:00
K900
0dc9108f7a gfxstream: fix build on 32-bit
VkDeviceMemory is always 64-bit, and %p on 32-bit is, well, 32-bit,
breaking the build.

There doesn't seem to be a good way to printf a Vulkan handle
cross-platform-ly, and it's unlikely to actually be useful,
so just don't print it at all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36231>
2025-07-18 18:09:03 +00:00
Eric Engestrom
e39a41e104 gfxstream: move variables into the #ifdef that uses them
../src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp:7585:14: warning: unused variable ‘actualFormat’ [-Wunused-variable]
 7585 |     VkFormat actualFormat = imageInfo.createInfo.format;
      |              ^~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36171>
2025-07-16 20:30:40 +00:00
Bo Hu
f146a3a13a gfxstream: update codegen for event save and load
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Event save and load codegen.

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36047>
2025-07-16 17:03:43 +00:00
Serdar Kocdemir
650691e93c gfxstream: fix warnings about unused parameters
Fix warnings.

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36047>
2025-07-16 17:03:43 +00:00
Serdar Kocdemir
5fbb3817ba gfxstream: Small optimization on transformDescriptorSetList
Reduce number of possible allocations and remove unnecessary
memory initialization which will be overwritten immediately.

Test: dEQP-GLES31.functional.ssbo.layout.*

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35768>
2025-06-26 17:11:41 +00:00