Skip to content

Add legacy ion interface handling and non-qcom heap mask fallback - #5

Merged
utkarshdalal merged 1 commit into
GameNative:wrapper-25from
leegao:fix-ion
Jul 17, 2026
Merged

Add legacy ion interface handling and non-qcom heap mask fallback#5
utkarshdalal merged 1 commit into
GameNative:wrapper-25from
leegao:fix-ion

Conversation

@leegao

@leegao leegao commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Potential fix for the Cry of Fear and other 32-bit applications crashing on various Bifrost era devices (devices released on pre-Android 12 kernels)

Specifically, on devices with <15.10 (mandatory for all devices release on Android 12+), the device /dev/dmabuf_heap/ does not exist. As a result, wrapper_device_memory.c will try to fallback to the ionheap path. The current implementation is a bit buggy, as depending on the underlying kernel driver, there are two potential ion uapis that we have to target.

This PR basically copies how turnip does the ion iface handling: https://github.com/mirror/mesa/blob/e24dc5bd1e7fe6101bdc866fb16a15a8fcae1aae/src/freedreno/vulkan/tu_knl_kgsl.cc#L1789 but additionally adds a fallback mode to avoid trying to allocate on heap 25 (which is qcom specific)


Not tested as ion has been removed in all devices released after Android 12. Unfortunately, this requires testing with testers who have Mali-G52/71/72/76/77 devices that specifically came out before October 2021.

See also:

  1. [Mali-G76] Fuel and other 32-bit games/dx test don't work leegao/bionic-vulkan-wrapper#157
  2. 32 bit directx games not working on mali g72 mp3 Pipetto-crypto/winlator#42
  3. placedaddr failing for DolphinVS.exe - mali g72 mp3 leegao/bionic-vulkan-wrapper#115

Credits to @Trass3r in leegao/bionic-vulkan-wrapper#157 (comment) who found the Turnip implementation of legacy ion iface detection.

@utkarshdalal
utkarshdalal merged commit 8e64d5f into GameNative:wrapper-25 Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants