Turn the Mali bridge on by default on a Mali GPU

A device with /dev/mali0 and no KGSL starts with the bridge on, so it draws
without a trip to Setup. An Adreno keeps Turnip and its automatic driver
route whatever the setting says, other GPUs keep the switch off until it is
turned on, and a choice made in Setup always wins. The GPU checks are read
once per process.
This commit is contained in:
maxjivi05 committed 2026-10-26 13:55:31 -04:00
1 parent 7aeb194d6e
commit 9c8d2acacc
2 files changed
+9 -2

No files matched your search

@@ -6,8 +6,15 @@ import com.droiddeck.launcher.R
import java.io.File
object DeviceSupport {
fun adreno(): Boolean =
private val adrenoGpu by lazy {
File("/sys/class/kgsl/kgsl-3d0").exists() || File("/vendor/lib64/hw/vulkan.adreno.so").exists()
}
private val maliGpu by lazy { !adrenoGpu && File("/dev/mali0").exists() }
fun adreno(): Boolean = adrenoGpu
fun mali(): Boolean = maliGpu
fun vkBridge(context: Context): Boolean =
!adreno() && com.droiddeck.launcher.session.SessionPrefs.vkBridge(context)
@@ -597,7 +597,7 @@ object SessionPrefs {
fun zinkLazy(context: Context): Boolean = prefs(context).getBoolean("zinkLazy", true)
@JvmStatic
fun vkBridge(context: Context): Boolean = prefs(context).getBoolean("vkBridge", false)
fun vkBridge(context: Context): Boolean = prefs(context).getBoolean("vkBridge", com.droiddeck.launcher.core.DeviceSupport.mali())
fun setVkBridge(context: Context, on: Boolean) {
prefs(context).edit().putBoolean("vkBridge", on).apply()