Merge pull request #2168 from porschemad911/rk3326-mangohud

RK3326 - enable MangoHud for Panfrost
This commit is contained in:
John Williams
2026-01-11 22:09:50 +11:00
committed by GitHub
6 changed files with 75 additions and 11 deletions

View File

@@ -242,7 +242,7 @@ frame_timing
### Change the hud font size
font_size=40
font_size=@FONT_SIZE@
# font_scale=1.0
# font_size_text=24
# font_scale_media_player=0.55

View File

@@ -68,4 +68,14 @@ post_makeinstall_target() {
mkdir -p ${INSTALL}/usr/config/MangoHud
cp -rf ${PKG_DIR}/config/* ${INSTALL}/usr/config/MangoHud
# Set font size for display resolution
case ${DEVICE} in
S922X|RK3326)
sed -e "s/@FONT_SIZE@/30/g" -i ${INSTALL}/usr/config/MangoHud/MangoHud.conf
;;
*)
sed -e "s/@FONT_SIZE@/40/g" -i ${INSTALL}/usr/config/MangoHud/MangoHud.conf
;;
esac
}

View File

@@ -0,0 +1,26 @@
From 425462bfd2913ab9e97a7df114cdcea783bcf8fd Mon Sep 17 00:00:00 2001
From: John Williams <porschemad911@gmail.com>
Date: Sun, 11 Jan 2026 21:42:52 +1100
Subject: [PATCH] RK3326 soc_thermal
---
src/cpu.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/cpu.cpp b/src/cpu.cpp
index 6307766..e476b34 100644
--- a/src/cpu.cpp
+++ b/src/cpu.cpp
@@ -606,6 +606,9 @@ bool CPUStats::GetCpuFile() {
} else if (name == "apm_xgene") {
find_input(path, "temp", input, "SoC Temperature");
break;
+ } else if (name == "soc_thermal") {
+ find_fallback_input(path, "temp1", input);
+ break;
} else {
path.clear();
}
--
2.47.3

View File

@@ -0,0 +1,25 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2025 ROCKNIX (https://github.com/ROCKNIX)
. /etc/profile
GPUDRIVER=$(/usr/bin/gpudriver)
MANGOHUD_ENABLED=$(get_setting "rocknix.mangohud.enabled")
# Init setting to 'disabled'
if [ ! -n "${MANGOHUD_ENABLED}" ]; then
set_setting "rocknix.mangohud.enabled" "0"
fi
# Enable / disable MangoHud support (panfrost / libmali)
if [ "${GPUDRIVER}" == "panfrost" ]; then
cat <<EOF >/storage/.config/profile.d/075-mangohud-supported
DEVICE_MANGOHUD_SUPPORT="true"
EOF
else
cat <<EOF >/storage/.config/profile.d/075-mangohud-supported
DEVICE_MANGOHUD_SUPPORT="false"
EOF
fi

View File

@@ -6,15 +6,18 @@ function gpu_profiling() {
local profiling_state=${1}
case "${HW_DEVICE}" in
S922X)
case "${profiling_state}" in
"on")
echo 1 > /sys/bus/platform/drivers/panfrost/[a-f0-9]*.gpu/profiling
;;
"off")
echo 0 > /sys/bus/platform/drivers/panfrost/[a-f0-9]*.gpu/profiling
;;
esac
S922X|RK3326)
# Enable Panfrost profiling - see https://docs.kernel.org/gpu/panfrost.html
if [[ -e "/sys/bus/platform/drivers/panfrost" ]]; then
case "${profiling_state}" in
"on")
echo 1 > /sys/bus/platform/drivers/panfrost/[a-f0-9]*.gpu/profiling
;;
"off")
echo 0 > /sys/bus/platform/drivers/panfrost/[a-f0-9]*.gpu/profiling
;;
esac
fi
;;
esac
}

View File

@@ -10,7 +10,7 @@ PKG_LONGDESC="Game support software metapackage."
PKG_GAMESUPPORT="sixaxis rocknix-hotkey jstest-sdl gamecontrollerdb sdljoytest sdltouchtest control-gen sdl2text"
case ${DEVICE} in
SM8250|SM8550|SM8650|SDM845|S922X)
SM8250|SM8550|SM8650|SDM845|S922X|RK3326)
PKG_GAMESUPPORT+=" mangohud"
;;
esac