mesa-for-android-container icon indicating copy to clipboard operation
mesa-for-android-container copied to clipboard

[Turnip] Request for Vulkan Video extensions support (VK_KHR_video_queue) on Adreno

Open DienoX opened this issue 10 months ago • 4 comments

Feature Request

Description: I would like to request the implementation of Vulkan Video extensions in the Turnip driver for Qualcomm Adreno GPUs. Specifically, support for:

  • VK_KHR_video_queue
  • VK_KHR_video_decode_queue
  • VK_KHR_video_decode_h264
  • VK_KHR_video_decode_h265

Context and Motivation: Currently, Android (via CDD requirements) explicitly mandates that system drivers MUST NOT enumerate Vulkan Video support. This creates a significant bottleneck for users relying on translation layers and emulators on Android devices (e.g., Winlator, box64, Yuzu/Sudachi, Cassia).

Many Windows games running via DXVK/VKD3D require hardware-accelerated video decoding to play cutscenes. Since the system driver blocks this, and Turnip currently does not expose these extensions, users are forced to rely on CPU decoding, which is inefficient and causes stuttering or crashes on mobile devices.

Since Turnip is widely used as a user-space driver alternative (sideloaded into emulator containers) to bypass proprietary driver bugs and limitations, adding Vulkan Video support would be a massive improvement for the mobile Linux/Android gaming ecosystem.

Hardware:

  • Qualcomm Snapdragon SoCs (Adreno 6xx/7xx series)

Additional Info: I understand this might require interfacing with the Venus VPU or specific hardware blocks on Adreno, but having exposed Vulkan extensions for this would bridge the gap created by Google's restriction.

Thank you for your hard work on Turnip!

DienoX avatar Feb 04 '26 20:02 DienoX

This is indeed a very pressing need. However, the current upstream Freedreno/Turnip drivers do not have any implementation code regarding video encoding/decoding functions, and a true open-source implementation is inseparable from the support of Qualcomm engineers.

Currently, the only possible indirect method I can think of is—in Termux Native, providing ffmpeg or the Android MediaCodec API to Wine's components through some means for invocation. In PRoot/Chroot/LXC containers, perhaps libhybris and some kind of "bridge" could be utilized to make it work, similar to this project: https://github.com/kde-yyds/android-vulkan-bridge

Regardless, this is a major undertaking, as many related open-source projects have incomplete support in this area or are even in the conceptual stage. I might spend some time in the future to give it a try, but I am not certain that substantial progress can be achieved.

lfdevs avatar Feb 04 '26 23:02 lfdevs

@DienoX What's the point of requesting implementation of a feature that hasn't even been implemented in Mesa?

Repeating the same issue twice seems like ignoring what people say.

hansm629 avatar Feb 09 '26 01:02 hansm629

@DienoX

UPDATE: If your device has Root privileges, you can now try this project: https://github.com/Re-s/droidspaces-media-decode

lfdevs avatar Aug 25 '26 18:08 lfdevs

Closing this issue as not planned & out of scope.

After investigating the Qualcomm hardware architecture and kernel driver implementations, implementing native Vulkan Video (VK_KHR_video_queue, VK_KHR_video_decode_*, VK_KHR_video_encode_*) support in Turnip is not feasible currently. Below is a summary of the technical reasons:

  1. Hardware IP Block Separation:
  • Unlike architectures (e.g., AMD, Intel, NVIDIA) where hardware video engines share a unified command processor and ringbuffer with the GPU, Qualcomm Snapdragon SoCs separate graphics processing from video decoding/encoding into two completely independent hardware blocks:
  • GPU (Adreno): Dedicated exclusively to 3D rendering and general-purpose compute.
  • VPU (Iris / Venus): Dedicated hardware processing unit with independent firmware responsible for video decoding and encoding.
  1. Kernel Driver Architecture:
  • As shown in the qualcomm-linux/kgsl repository, the GPU driver (msm_kgsl) manages only Adreno 3D graphics, GMU, command streams, and compute dispatches. The GPU command processor (CP) has no hardware video queues or video codec instructions.
  • Conversely, hardware video codecs are controlled entirely through a separate kernel driver, as seen in the qualcomm-linux/video-driver repository. This driver implements the msm_vidc / Iris VPU interface using V4L2 ioctls and communicates directly with VPU firmware over the Host Firmware Interface (HFI).
  1. Implications for Turnip:
  • Vulkan Video extensions require the driver to submit video decode/encode operations through Vulkan queues mapped to underlying hardware engines. Because the Adreno GPU itself lacks video hardware engines, Turnip cannot dispatch native video commands through GPU command buffers.
  • Emulating Vulkan Video by having Turnip act as a wrapper around the independent V4L2/VIDC kernel driver would introduce significant complexity (cross-driver synchronization, memory mapping, and ioctl translation) that falls outside Turnip’s scope as a GPU driver.

For hardware-accelerated video decoding and encoding in container environments, applications should rely on the standard V4L2 / MediaCodec (like Re-s/droidspaces-media-decode) interfaces or frameworks like FFmpeg and GStreamer utilizing the dedicated VPU driver rather than the Vulkan driver.

lfdevs avatar Aug 28 '26 19:08 lfdevs