mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-10-14 19:27:09 -04:00
Offer faux123's device PanVK builds (RP4 Pro, Ace, RG556) as manual pairs for their Mali
This commit is contained in:
1 parent
efd93dd9b4
commit
1fbe162b49
4 files changed
+32
-3
No files matched your search
@@ -37,11 +37,17 @@ object DriverPairs {
|
||||
/** One PanVK kbase binary for Mali v9-v13; its display half needs Android 15. */
|
||||
const val NAD_MALI_KBASE = "nad:panvk-mali-kbase"
|
||||
const val MALI_KBASE_MIN_SDK = 35
|
||||
/** faux123's PanVK builds for three handhelds: manual choices, never Auto. */
|
||||
const val NAD_FAUX_RP4PRO = "nad:panvk-faux123-rp4pro"
|
||||
const val NAD_FAUX_ACE = "nad:panvk-faux123-ace"
|
||||
const val NAD_FAUX_RG556 = "nad:panvk-faux123-rg556"
|
||||
/** The one Mali a device-specific build is for, by the number in the GPU's name. */
|
||||
private val DEVICE_BUILDS = mapOf(NAD_FAUX_RP4PRO to 77, NAD_FAUX_ACE to 610, NAD_FAUX_RG556 to 57)
|
||||
/** "PanVK-Mali-G720" (the release asset's id) to its pair key, "nad:panvk-mali-g720". */
|
||||
fun nonAdreno(id: String) = "$NON_ADRENO:" + id.lowercase()
|
||||
/** True for a non-Adreno pair's key, or a bundle installed from one ("PanVK-Mali-G720"). */
|
||||
fun isNonAdreno(keyOrBundleId: String?): Boolean = keyOrBundleId != null &&
|
||||
(keyOrBundleId.startsWith("$NON_ADRENO:") || Regex("""^(?i)(RADV-Xclipse|PanVK-Mali-[A-Za-z0-9]+)(-\d+)?$""").matches(keyOrBundleId))
|
||||
(keyOrBundleId.startsWith("$NON_ADRENO:") || Regex("""^(?i)(RADV-Xclipse|PanVK-[A-Za-z0-9]+)(-[A-Za-z0-9]+)*$""").matches(keyOrBundleId))
|
||||
|
||||
fun nonAdrenoName(key: String): String = describeNonAdreno(key).first
|
||||
|
||||
@@ -51,6 +57,9 @@ object DriverPairs {
|
||||
NAD_MALI_G710 -> "PanVK · Mali-G610/G710" to setOf(Family.MALI_G610_G710)
|
||||
NAD_MALI_G615 -> "PanVK · Mali-G615" to setOf(Family.MALI_G615)
|
||||
NAD_MALI_G720 -> "PanVK · Mali-G720" to setOf(Family.MALI_G720)
|
||||
NAD_FAUX_RP4PRO -> "PanVK faux123 · Retroid Pocket 4 Pro (Mali-G77)" to setOf(Family.MALI_JM)
|
||||
NAD_FAUX_ACE -> "PanVK faux123 · GameForce Ace (Mali-G610)" to setOf(Family.MALI_G610_G710)
|
||||
NAD_FAUX_RG556 -> "PanVK faux123 · Anbernic RG556 (Mali-G57)" to setOf(Family.MALI_JM)
|
||||
NAD_MALI_KBASE -> "PanVK kbase · Mali G57-G925" to
|
||||
setOf(Family.MALI_JM, Family.MALI_G610_G710, Family.MALI_G615, Family.MALI_G720, Family.MALI_LATEST)
|
||||
else -> key.removePrefix("$NON_ADRENO:") to emptySet<Family>()
|
||||
@@ -78,6 +87,7 @@ object DriverPairs {
|
||||
key == NAD_RADV_XCLIPSE -> gpu.family == Family.POWERVR && gpu.name.contains("Xclipse", ignoreCase = true)
|
||||
// One binary for Mali v9-v13, not the older G52/G76 in the Job Manager family.
|
||||
key == NAD_MALI_KBASE -> gpu.family.mali && GpuInfo.maliKbaseCovered(gpu.name)
|
||||
key in DEVICE_BUILDS -> gpu.family.mali && GpuInfo.maliNumber(gpu.name) == DEVICE_BUILDS[key]
|
||||
else -> gpu.family in families ||
|
||||
(gpu.family == Family.ADRENO_UNKNOWN && (Family.A7XX in families || Family.A8XX in families))
|
||||
}
|
||||
|
||||
@@ -161,7 +161,8 @@ data class GpuInfo(
|
||||
?.substringBefore(" ")
|
||||
?: ""
|
||||
|
||||
private fun maliNumber(name: String): Int? =
|
||||
/** The number in a Mali's name: 720 for "Mali-G720-Immortalis MC12". */
|
||||
fun maliNumber(name: String): Int? =
|
||||
Regex("""G(\d{2,3})""", RegexOption.IGNORE_CASE).find(name)?.groupValues?.get(1)?.toIntOrNull()
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,7 +82,7 @@ object TurnipReleases {
|
||||
// Xclipse), both halves in one zip. One release per driver, replaced in place on each
|
||||
// rebuild; every one is a test build, published as a pre-release.
|
||||
Source("Non-Adreno", NON_ADRENO_REPO, prerelease = true) { name, _ ->
|
||||
val m = Regex("""^((?:RADV-Xclipse|PanVK-Mali-[A-Za-z0-9]+))-Pair\.zip$""").find(name) ?: return@Source null
|
||||
val m = Regex("""^(RADV-Xclipse|PanVK-[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*?)-Pair\.zip$""").find(name) ?: return@Source null
|
||||
val key = DriverPairs.nonAdreno(m.groupValues[1])
|
||||
Kind(false, "Android + Linux · " + DriverPairs.nonAdrenoName(key), key, bundle = true)
|
||||
},
|
||||
|
||||
@@ -201,4 +201,22 @@ class DriverPairsTest {
|
||||
assertFalse(DriverPairs.isNonAdreno("DD-Turnip-v0.1.0"))
|
||||
assertFalse(DriverPairs.isNonAdreno(null))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun deviceBuildsAreOfferedOnlyForTheirMaliAndNeverByAuto() {
|
||||
fun bundle(id: String) = TurnipReleases.Asset("Non-Adreno", id.lowercase(), "$id-Pair.zip", "https://example/$id", 9_000_000,
|
||||
false, "label", "0".repeat(64), DriverPairs.nonAdreno(id), bundle = true)
|
||||
val pairs = DriverPairs.from(TurnipReleases.Check(
|
||||
listOf(bundle("PanVK-faux123-RP4Pro"), bundle("PanVK-faux123-Ace"), bundle("PanVK-faux123-RG556")),
|
||||
emptyList(), emptyList(), 0L))
|
||||
val g77 = GpuInfo("Mali-G77 MC9", 0, Family.MALI_JM, "", false)
|
||||
val g57 = GpuInfo("Mali-G57 MC2", 0, Family.MALI_JM, "", false)
|
||||
val g610 = GpuInfo("Mali-G610 MC6", 0, Family.MALI_G610_G710, "", false)
|
||||
assertTrue(pairs.single { it.key == DriverPairs.NAD_FAUX_RP4PRO }.suits(g77))
|
||||
assertFalse(pairs.single { it.key == DriverPairs.NAD_FAUX_RP4PRO }.suits(g57))
|
||||
assertTrue(pairs.single { it.key == DriverPairs.NAD_FAUX_RG556 }.suits(g57))
|
||||
assertTrue(pairs.single { it.key == DriverPairs.NAD_FAUX_ACE }.suits(g610))
|
||||
assertEquals(DriverPairs.NAD_MALI_JM, DriverPairs.recommendedKey(g77, pairs, sdk = 34))
|
||||
assertTrue(DriverPairs.isNonAdreno("PanVK-faux123-RP4Pro"))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user