mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
fix(drivers): Auto gives Xclipse GPUs the old RADV pair only where that build supports them (#2337)
* fix: route unsupported Xclipse generations upstream * fix: let Auto load upstream Xclipse pairs * fix: clear stale auto-owned Xclipse RADV pair * fix(drivers): clear independently owned fallback selections * fix(drivers): keep independently chosen drivers when session start reconciles an unsupported Xclipse * fix(drivers): name the Xclipse from Vulkan before session start picks which drivers Auto clears * fix(drivers): keep the Vulkan query off the UI thread when session start reconciles Xclipse drivers * test(drivers): control Xclipse GPU family in auto-driver reconciliation test * fix(gpu): guard Xclipse auto-driver cleanup when running and handle open-driver bundles * fix(gpu): keep active RADV-Xclipse-upstream bundle on unsupported Xclipse
This commit is contained in:
1 parent
ca7b7e74ec
commit
bb5218746f
8 files changed
+373
-28
No files matched your search
@@ -697,14 +697,42 @@ object SessionPrefs {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun ensurePowerVrAutoDrivers(context: Context) {
|
||||
if (com.droiddeck.launcher.core.DeviceSupport.openDriverActive(context)) return
|
||||
ensurePowerVrAutoDrivers(context, SystemVulkanDriver.isPowerVr())
|
||||
fun ensurePowerVrAutoDrivers(context: Context) = reconcilePowerVrAutoDrivers(
|
||||
context, SystemVulkanDriver.isPowerVr(), SystemVulkanDriver.isXclipse(),
|
||||
com.droiddeck.launcher.gpu.VulkanInfo::cachedOrNull,
|
||||
)
|
||||
|
||||
fun ensurePowerVrAutoDriversAfterGpuQuery(context: Context) = reconcilePowerVrAutoDrivers(
|
||||
context, SystemVulkanDriver.isPowerVr(), SystemVulkanDriver.isXclipse(),
|
||||
com.droiddeck.launcher.gpu.VulkanInfo::query,
|
||||
)
|
||||
|
||||
internal fun reconcilePowerVrAutoDrivers(
|
||||
context: Context, powerVr: Boolean, xclipse: Boolean, vulkan: () -> Map<String, String>?,
|
||||
) {
|
||||
val device = if (xclipse) vulkan() ?: return else null
|
||||
val unsupported = unsupportedXclipse(xclipse) {
|
||||
com.droiddeck.launcher.gpu.GpuInfo.systemDriverName(SystemVulkanDriver.gpuName(), device)
|
||||
}
|
||||
val activeKey = com.droiddeck.launcher.gpu.DriverBundle.active(context)
|
||||
?.id
|
||||
?.let(com.droiddeck.launcher.gpu.DriverPairs::nonAdreno)
|
||||
val upstreamBundle = activeKey == com.droiddeck.launcher.gpu.DriverPairs.NAD_RADV_XCLIPSE_UPSTREAM ||
|
||||
(activeKey != null && activeKey.startsWith("${com.droiddeck.launcher.gpu.DriverPairs.NAD_RADV_XCLIPSE_UPSTREAM}-"))
|
||||
if (com.droiddeck.launcher.core.DeviceSupport.openDriverActive(context) && (!unsupported || upstreamBundle)) return
|
||||
ensurePowerVrAutoDrivers(context, powerVr, unsupported)
|
||||
}
|
||||
|
||||
internal fun ensurePowerVrAutoDrivers(context: Context, powerVr: Boolean) {
|
||||
internal fun unsupportedXclipse(xclipse: Boolean, gpuName: () -> String): Boolean =
|
||||
xclipse && com.droiddeck.launcher.gpu.DriverPairs.xclipseNeedsUpstream(gpuName())
|
||||
|
||||
internal fun ensurePowerVrAutoDrivers(context: Context, powerVr: Boolean, autoOwnedOnly: Boolean = false) {
|
||||
if (!powerVr || gpuDriverMode(context) != GPU_DRIVERS_AUTO) return
|
||||
prefs(context).edit().putString("linuxDriver", "").putString("androidDriver", TurnipDriver.AUTO).apply()
|
||||
val owned = gpuAutoInstalled(context)
|
||||
val edit = prefs(context).edit()
|
||||
if (!autoOwnedOnly || linuxDriver(context) in owned) edit.putString("linuxDriver", "")
|
||||
if (!autoOwnedOnly || androidDriver(context) in owned) edit.putString("androidDriver", TurnipDriver.AUTO)
|
||||
edit.apply()
|
||||
}
|
||||
|
||||
fun gpuAutoInstalled(context: Context): Set<String> =
|
||||
|
||||
@@ -497,7 +497,7 @@ class SessionService : Service() {
|
||||
|
||||
|
||||
private fun runSession(gen: Int) {
|
||||
SessionPrefs.ensurePowerVrAutoDrivers(this)
|
||||
SessionPrefs.ensurePowerVrAutoDriversAfterGpuQuery(this)
|
||||
if (!com.droiddeck.launcher.core.DeviceSupport.adreno()) {
|
||||
com.droiddeck.launcher.gpu.VulkanInfo.query()["api"]?.let { SessionPrefs.setHostVulkanApi(this, it) }
|
||||
if (SessionPrefs.venus(this)) VenusComponent.hostVulkanTooOld(this)?.let {
|
||||
|
||||
Reference in new issue
Block a user