From 126af1feb937f4eec034337f4881ed7ee36a5f9c Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 22 May 2025 09:14:53 -0700 Subject: [PATCH] gfxstream: get rid of logspam in virtualized case In the case of running a Linux VM using some other capability set than gfxstream, some logspam may be triggered. Fix this. CC: mesa-stable Reviewed-by: Aaron Ruby Reviewed-by: Yiwei Zhang Part-of: --- .../guest/platform/linux/LinuxVirtGpuDevice.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp b/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp index 4ced22746ec..d1084821517 100644 --- a/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp +++ b/src/gfxstream/guest/platform/linux/LinuxVirtGpuDevice.cpp @@ -7,9 +7,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -18,6 +18,7 @@ #include "LinuxVirtGpu.h" #include "drm-uapi/virtgpu_drm.h" +#include "util/detect_os.h" #include "util/log.h" #ifdef MAJOR_IN_MKDEV @@ -191,6 +192,13 @@ int32_t LinuxVirtGpuDevice::init(int32_t descriptor) { mCaps.params[i] = params[i].value; } +#if !DETECT_OS_ANDROID + if ((mCaps.params[kParamSupportedCapsetIds] & (1 << VIRTGPU_DRM_CAPSET_GFXSTREAM_VULKAN)) == + 0) { + return -EINVAL; + } +#endif + auto capset = getCapset(); get_caps.cap_set_id = static_cast(capset); switch (capset) {