fix(hud): bind the GPU clock and load nodes even when the HUD starts hidden

With the overlay hidden at session start the blocked feeds have no value,
so cur_freq and perf_now were never written before the binds were taken
and stayed unbound for the whole session.
This commit is contained in:
angelrenefm committed 2026-11-04 00:07:13 +01:00
1 parent 7901e76561
commit 3ad13b1b66
2 files changed
+32

No files matched your search

@@ -54,6 +54,7 @@ class GpuStatsComponent(val dir: File, private val root: File) : SessionPart() {
}
pick("temp", tempSources(), "%6d\n") { milliCelsius(it) }?.let { feeds.add(it) }
refresh()
createMissing(feeds.map { it.file })
describeSources()
Log.i(TAG, "hud: kgsl stats from the session's own: $sources")
true
@@ -354,6 +355,10 @@ class GpuStatsComponent(val dir: File, private val root: File) : SessionPart() {
fun guestLoadDir(root: File) = File(root, GUEST_LOAD_DIR.removePrefix("/"))
// A feed with no value yet (the HUD hidden at start) still needs its file, or binds() leaves its node out for
// the whole session.
internal fun createMissing(files: List<File>) = files.forEach { runCatching { it.createNewFile() } }
/** True when this app can see kgsl but none of its GPU load nodes (SELinux-blocked, e.g. the Retroid Pocket Duo). */
fun loadBlocked(): Boolean = File(KGSL).exists() && !File(GPUBUSY).canRead() && LOAD_SOURCES.none { File(it).canRead() }