Auto drivers for Mali and Xclipse on the non-Adreno test branch

Auto now picks an open driver pair for the GPU, the way it does for Adreno:
- Mali (no KGSL, /dev/mali0): the GPU's name ("Mali-G720-Immortalis MC12", from the vendor
  Vulkan driver or kbase's gpuinfo) picks the PanVK build: G52-G78 (Job Manager), G610/G710,
  G615 or G720. A Mali none of them covers (G925...), or one whose pair is not published yet,
  draws through the Mali bridge, switched on by Auto.
- Xclipse keeps the system-driver path as Auto; the RADV pair is offered as a manual choice.
- The pairs come from The412Banner/droiddeck-nonadreno-drivers (one pre-release per driver,
  each a DriverBundle zip). Only a device without an Adreno reads that repo.
- The importers accept PanVK and RADV libraries (libvulkan_panfrost / libvulkan_radeon).
- An open driver pair and the Mali bridge are alternatives: a selected pair turns the bridge off.
- TU_DEBUG is only set for Turnip, on an Adreno.

Every new branch is reached only when the device has no Adreno; an Adreno's detection, release
sources, Auto choice and session environment are unchanged.
This commit is contained in:
The412Banner committed 2026-10-12 19:12:03 -04:00
1 parent ddb3b176a2
commit c22d9d4f71
10 files changed
+204 -16

No files matched your search

@@ -12,6 +12,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.mutableIntStateOf
import com.droiddeck.launcher.gpu.DriverBundle
import com.droiddeck.launcher.core.DeviceSupport
import com.droiddeck.launcher.gpu.DriverPairs
import com.droiddeck.launcher.gpu.GpuInfo
import com.droiddeck.launcher.gpu.LinuxVulkanDriver
@@ -164,6 +165,12 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
}
if (!force && autoCheckedThisProcess) return
autoCheckedThisProcess = true
if (gpu.family == GpuInfo.Family.MALI_OTHER) {
useMaliBridge()
autoStatus = activity.getString(R.string.drivers_mali_bridge_auto)
refreshDrivers()
return
}
if (DriverPairs.recommendedKey(gpu, emptyList()) == null) {
autoStatus = activity.getString(R.string.drivers_none_to_set, gpu.supportText(activity).lowercase())
return
@@ -186,6 +193,12 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
when {
row?.active == true -> autoStatus = problem?.let { activity.getString(R.string.drivers_up_to_date_check_failed, it) }
?: activity.getString(R.string.upd_current_status)
gpu.family.mali && (pair == null || !pair.complete) -> {
// No open driver for this Mali published yet: draw through the bridge.
useMaliBridge()
autoStatus = activity.getString(R.string.drivers_mali_bridge_fallback, key?.let { DriverPairs.nonAdrenoName(it) } ?: gpu.name)
refreshDrivers()
}
pair == null || !pair.complete ->
autoStatus = problem?.let { activity.getString(R.string.upd_couldnt_check, it) } ?: activity.getString(R.string.drivers_recommended_unpublished)
else -> installPair(pair, auto = true)
@@ -194,6 +207,18 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
}, "gpu-driver-auto").start()
}
/**
* Auto on a Mali without an open driver pair: the Vulkan bridge draws instead, on the phone's
* own driver, so a pair Auto set earlier is unset rather than left half-working.
*/
private fun useMaliBridge() {
if (DeviceSupport.openDriverActive(activity)) {
SessionPrefs.setAndroidDriver(activity, TurnipDriver.AUTO)
SessionPrefs.setLinuxDriver(activity, "")
}
SessionPrefs.setVkBridge(activity, true)
}
/** Manual: install (if need be) and set both halves of a pair. */
fun selectPair(key: String) {
if (pairBusy != null) return
@@ -230,6 +255,8 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
val displayChanged = SessionPrefs.androidDriver(activity) != displayId
SessionPrefs.setAndroidDriver(activity, displayId)
SessionPrefs.setLinuxDriver(activity, linuxId)
// An open Mali/Xclipse driver and the Mali bridge are alternatives: the pair wins.
if (DriverPairs.isNonAdreno(pair.key)) SessionPrefs.setVkBridge(activity, false)
val restart = displayChanged && CompositorHost.isStarted
if (auto) {
val previous = SessionPrefs.gpuAutoInstalled(activity)