From 7150e19db3554feb2d9a0d27d49b4223c1efd162 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Mon, 26 Oct 2026 01:28:57 +0000 Subject: [PATCH] Answer the KHR calibrated-timestamp queries with a HAL's EXT entries With the Android 14 dispatch fix, Steam still aborted on the Pocket FIT within two seconds: its update window (GLX) and the browser's glxinfo check both died. The 0.762.24 driver offers only VK_EXT_calibrated_timestamps; Zink called vkGetPhysicalDeviceCalibrateableTimeDomainsKHR, the bridge returned no entry for the KHR name, and the desktop loader's terminator aborted ("ICD associated with VkPhysicalDevice does not support ...KHR"). 0013-calibrated-timestamps-khr-alias.patch returns the EXT entry for the KHR name (same signature and time-domain values) for both the instance and the device query. --- tools/qualcomm/README.md | 2 +- ...0013-calibrated-timestamps-khr-alias.patch | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tools/qualcomm/hybris-patches/0013-calibrated-timestamps-khr-alias.patch diff --git a/tools/qualcomm/README.md b/tools/qualcomm/README.md index a77528534..dbef9b569 100644 --- a/tools/qualcomm/README.md +++ b/tools/qualcomm/README.md @@ -4,7 +4,7 @@ The Linux backend uses the installed Qualcomm Vulkan HAL through a pinned libhyb ## Bridge patch for Android 14 loaders -The bridge creates the Vulkan instance through Android's `libvulkan.so` and then checks that this instance dispatches to the same HAL it loaded itself. Upstream compares only `vkGetPhysicalDeviceProperties`. Android 14's loader wraps that query (seen on an AYANEO Pocket FIT, Adreno 750, Qualcomm 0.762.24, SDK 34): it resolved into `libvulkan.so` while `vkGetPhysicalDeviceFeatures` resolved to the same `vulkan.adreno.so` entry from both sides, so every session failed with `Android instance and configured HAL use different dispatch implementations` and `vkCreateInstance` -9. `hybris-patches/0012-android-loader-wrapped-queries.patch` accepts the instance when any of five core physical-device queries resolves to the HAL's own entry; another driver matches none. The bridge is rebuilt with wallentx's builder (`tools/hybris` at `4ed93fb9`, patches 0001-0011) plus this patch on DroidDeck-Components. +The bridge creates the Vulkan instance through Android's `libvulkan.so` and then checks that this instance dispatches to the same HAL it loaded itself. Upstream compares only `vkGetPhysicalDeviceProperties`. Android 14's loader wraps that query (seen on an AYANEO Pocket FIT, Adreno 750, Qualcomm 0.762.24, SDK 34): it resolved into `libvulkan.so` while `vkGetPhysicalDeviceFeatures` resolved to the same `vulkan.adreno.so` entry from both sides, so every session failed with `Android instance and configured HAL use different dispatch implementations` and `vkCreateInstance` -9. `hybris-patches/0012-android-loader-wrapped-queries.patch` accepts the instance when any of five core physical-device queries resolves to the HAL's own entry; another driver matches none. `0013-calibrated-timestamps-khr-alias.patch` answers `vkGetPhysicalDeviceCalibrateableTimeDomainsKHR` and `vkGetCalibratedTimestampsKHR` with the HAL's EXT entries when it has only those (same signatures and time-domain values). The same Pocket FIT driver offers only `VK_EXT_calibrated_timestamps`; Zink called the KHR name, the desktop loader found no ICD entry and aborted (`ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceCalibrateableTimeDomainsKHR`), which took down every OpenGL program, including Steam's update window and the browser's `glxinfo` check. The bridge is rebuilt with wallentx's builder (`tools/hybris` at `4ed93fb9`, patches 0001-0011) plus these patches on DroidDeck-Components. ## Imported AdrenoTools Qualcomm packages diff --git a/tools/qualcomm/hybris-patches/0013-calibrated-timestamps-khr-alias.patch b/tools/qualcomm/hybris-patches/0013-calibrated-timestamps-khr-alias.patch new file mode 100644 index 000000000..a1f30cebb --- /dev/null +++ b/tools/qualcomm/hybris-patches/0013-calibrated-timestamps-khr-alias.patch @@ -0,0 +1,31 @@ +diff --git a/hybris/vulkan/icd/device.c b/hybris/vulkan/icd/device.c +index 1758b37..a9bfee4 100644 +--- a/hybris/vulkan/icd/device.c ++++ b/hybris/vulkan/icd/device.c +@@ -148,6 +148,9 @@ PFN_vkVoidFunction VKAPI_CALL hybris_icd_device_proc(VkDevice device, const char + int swapchain_enabled = state ? state->swapchain_enabled : 0; + pthread_mutex_unlock(&device_guard); + PFN_vkVoidFunction backend = resolver ? resolver(device, name) : NULL; ++ /* Same promotion as vkGetPhysicalDeviceCalibrateableTimeDomainsKHR. */ ++ if (!backend && resolver && !strcmp(name, "vkGetCalibratedTimestampsKHR")) ++ backend = resolver(device, "vkGetCalibratedTimestampsEXT"); + PFN_vkVoidFunction local = hybris_icd_swapchain_proc(name, swapchain_enabled); + if (local) return local; + if (backend && swapchain_enabled) { +diff --git a/hybris/vulkan/icd/instance.c b/hybris/vulkan/icd/instance.c +index 6717d19..7f30014 100644 +--- a/hybris/vulkan/icd/instance.c ++++ b/hybris/vulkan/icd/instance.c +@@ -295,6 +295,12 @@ PFN_vkVoidFunction hybris_icd_instance_proc(VkInstance instance, const char *nam + int platforms_enabled = state ? state->platforms_enabled : 0; + pthread_mutex_unlock(&instance_guard); + PFN_vkVoidFunction backend = resolver ? resolver(instance, name) : NULL; ++ /* VK_KHR_calibrated_timestamps is VK_EXT_calibrated_timestamps promoted with ++ * the same signature and time-domain values. A HAL that only has the EXT ++ * name returns NULL for the KHR one, and the desktop loader aborts when an ++ * application or layer calls the KHR trampoline. */ ++ if (!backend && resolver && !strcmp(name, "vkGetPhysicalDeviceCalibrateableTimeDomainsKHR")) ++ backend = resolver(instance, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT"); + PFN_vkVoidFunction local_wsi = hybris_icd_wsi_proc(name, surface_enabled, platforms_enabled); + if (local_wsi) return local_wsi; + /* Device WSI entry points are adapter-owned. Enablement is checked on the