Add legacy ion interface handling and non-qcom heap mask fallback - #5
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Credits to @Trass3r in leegao/bionic-vulkan-wrapper#157 (comment) who found the Turnip implementation of legacy ion iface detection.