GameScope on non-Adreno GPUs: system Vulkan driver path (Pixel 7 / Mali-G710)

Merged
UT
20d ago
+2400-51

Gets gamescope mode working on GPUs without Adreno (tested on a Pixel 7, Mali-G710, Android 15). Every shim change is gated on the absence of /dev/kgsl-3d0.

  • System driver path. Without kgsl the shim opens the Android loader (libvulkan.so) and runs every process through the WSI proxy. For guest processes it drives the container's wrapper ICD (GN_VKSHIM_WRAPPER_ICD, set by the app) so games get the wrapper's Mali emulation; gamescope itself stays on the system loader.
  • Scan-out export emulation. Mali reports no exportable LINEAR dma-buf images, so gamescope's flippable images are backed by the daemon's AHardwareBuffer pool and the export/modifier/layout queries answer from it.
  • Placed memory. 32-bit games need VK_EXT_map_memory_placed; Mali lacks it and its kbase mappings cannot be moved, so host-visible allocations become AHardwareBuffer blobs mapped at the requested address (same approach as the wrapper). Off when the wrapper ICD is driven.
  • Smaller fixes: VK_EXT_robustness2 advertised to gamescope and stripped at device create; VK_EXT_vertex_attribute_divisor advertised over the KHR extension; vkCreateDevice only adds extensions the driver lists; a guest swapchain slot Mali refuses as LINEAR-tiled is retried with an explicit LINEAR modifier; the alias proc lookup no longer recurses forever when neither spelling resolves.
  • Preload shim (all devices): wlroots reopens its shm format-table memfd through /proc/self/fd and fchmods it, which Android 15 refuses; both now fall back, otherwise the linux-dmabuf global never appears.

Tested:

  • Pixel 7: Celeste (DXVK) and Hades II (DX12) under gamescope at 60 fps with input, real 2400x1080 mode with the A37/A38 gamescope payload. Hades II needs app PR #2207 (or a non-NVIDIA gpuName) on Mali, unrelated to this PR.
  • Odin 3 (Adreno 830, 1080p), same build: Celeste under X11 unchanged at 60 fps; Celeste and Hades II under gamescope at 60 fps on the adrenotools path, none of the non-Adreno gates engaged, zero failed commits. HDR was off in that run.

Companion PRs: GameNative/gamescope #1 (A37, A38) and joshuatam/GameNative #12 (app).