DEBUG_FS provides instrumentation needed by TODO items 1 and 6:
- /sys/kernel/debug/dri/*/name — GPU performance counters
- /sys/kernel/debug/cma/* — per-region CMA page accounting
- /sys/kernel/debug/block/* — I/O scheduler stats (BLK_DEBUG_FS)
- Detailed thermal zone introspection
Trade-off acknowledged: small runtime overhead from debugfs mount,
but the instrumentation granularity is essential while we're actively
benchmarking and tuning. Switch to DEBUG_FS=n or DISALLOW_MOUNT
for release-final builds once FASE 1-2 benchmarks are complete.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With CONFIG_IKCONFIG=n (correct for production), /proc/config.gz is not
available. The script now reads /boot/config-$(uname -r) as primary
source and falls back to /proc/config.gz only if IKCONFIG is enabled.
Also removed FRAME_POINTER check (ARM64 forces it via Kconfig select,
checking if it's disabled always fails) — now shown as informational.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Flycast-SA:
- Restore -Ofast sed (was incorrectly replaced with CMAKE_BUILD_TYPE=Release)
- -Ofast = -O3 + -ffast-math is INTENTIONAL for Flycast: the Dreamcast SH4
FPU doesn't use strict IEEE 754, and the hardware itself flushes denormals
- Validated by JELOS/AmberELEC/ROCKNIX upstream for years without issues
- On weak Cortex-A35, the extra optimization from -ffast-math is meaningful
Sysctl:
- vm.dirty_writeback_centisecs: 500→1500 (match ROCKNIX, reduce I/O wakeups
during gaming — read-heavy workload needs fewer writeback checks)
- vm.vfs_cache_pressure: 50→100 (restore kernel default — during gameplay
the same few files are reread (ROM, save, shader cache), so a large
inode/dentry cache provides no benefit on 1GB RAM. 50 is a desktop tuning
that favors metadata cache for build/compile workloads, not gaming.
Note: 200+ is what aggressively reclaims metadata; 100 is the neutral
kernel default, not an override.)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
FRAME_POINTER:
- ARM64 Kconfig unconditionally selects FRAME_POINTER (arch/arm64/Kconfig:136)
- Cannot be disabled regardless of defconfig value
- Overhead <1-2% on ARM64 (x29 designated as FP by ABI, STP saves FP+LR
in single store queue slot)
- Restored to y to match kernel reality
ZRAM compression lzo-rle (reverted from zstd):
- zstd is 3-4x slower than lzo-rle on in-order Cortex-A35
- Estimated: lzo-rle ~350 MB/s vs zstd ~100 MB/s compress on A35
- Each 4KB page swap: 11us (lzo-rle) vs 40us (zstd)
- Under memory pressure during gaming, zstd causes frame stutters
- ROCKNIX deliberately uses lzo-rle on ALL in-order cores (A35/A53/A55)
and only enables zstd on out-of-order big cores (A73/A76)
- The extra ~500MB virtual capacity from zstd's ratio is not worth the
latency penalty for latency-sensitive gaming workloads
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Kernel:
- BRIDGE_NETFILTER=n (was still =m after BRIDGE was disabled)
- BLK_DEBUG_FS=n (depends on DEBUG_FS which is off, explicit disable)
Flycast:
- Replace sed -Ofast hack with proper CMAKE_BUILD_TYPE=Release
(CMake Release mode applies -O3 with proper LTO support)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ZRAM compression: lzo-rle → zstd (better 1:3 ratio vs 1:2.5, saves
~50MB more RAM on 512MB ZRAM at cost of slightly more CPU)
- Add zswap.enabled=0 to kernel cmdline (zswap intercepts before ZRAM,
preventing efficient compressed swap)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ScreenUseGL=0: Skip GPU-accelerated display compositing. On Mali-G31
with Panfrost, the overhead of uploading software-rendered frames to
GPU for display is slower than direct software blit.
- ScreenFilter=0: Disable bilinear filtering (saves GPU cycles)
- JIT remains enabled (critical for Cortex-A35 performance)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
melonDS was crashing with "could not connect to display :0.0" because
QT_QPA_PLATFORM was hardcoded to xcb. On RK3326 with Sway (Wayland),
XWayland may not expose :0.0 for all apps.
Fix: detect WAYLAND_DISPLAY and use wayland platform automatically.
Also set UTF-8 locale (Qt6 requires it, system defaults to "C").
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously ROMs lived in /storage/games-internal/roms/ and were
bind-mounted to /storage/roms/ at runtime. When users mounted the
ROMS partition on PC, they had to navigate through games-internal/
to find their ROM folders.
Now /storage/roms/ is the actual ROM directory:
- Single SD: no bind mount needed, roms/ used directly
- Dual SD (merged storage): overlay still works as before
- Migration: if games-internal/roms has content, auto-moves to roms/
- Backwards compat: symlink games-internal/roms → roms
Users now see their 130 system folders directly in the roms/ directory
when they mount the ROMS partition on PC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ROOT CAUSE: The DTS patch removed ALL GPU OPPs (200/300/400/480 MHz)
and only kept 560/600 MHz. The GPU devfreq governor starts at the
LOWEST available OPP. Without 200 MHz, the GPU couldn't initialize
its clock, causing a black screen on boot.
Fix: Keep original 200/300/400 MHz OPPs, only replace 480 MHz with
560 MHz (overclock) and add 600 MHz. GPU can now initialize at 200 MHz
and scale up to 600 MHz.
Building Panfrost as built-in (=y) changes DRM probe order: GPU driver
initializes before the DSI panel driver completes, breaking the display
pipeline. As module (=m), panfrost loads after the display is already up.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Flasher verification:
- Move read-back SHA256 verification BEFORE boot partition modifications
(DTBO copy, variant write, extlinux switch). Previously verified AFTER
modifications, causing guaranteed hash mismatch (false positive).
- Remove duplicate verification block at end of script.
Kernel:
- Restore DRM_FBDEV_EMULATION=y (disabling it broke display on some setups
that depend on /dev/fb0 for initialization)
Panel overlays:
- Restore early return for odroidgo3-compatible devices in archr-dtbo.py.
R36S base DTS already has reset-gpios/power-supply/backlight - adding
them again in the overlay caused conflicts. Overlay only needs
panel-init-sequence and display timings.
- Regenerate all 32 DTBOs with correct behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Based on RK3399 config, optimized for 640x480:
- Window 640x480 (native R36S resolution)
- JIT enabled (performance critical on Cortex-A35)
- Software 3D renderer (Mali-G31 too weak for GL renderer)
- Threaded 3D enabled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The base package.mk expands PKG_URL with PKG_VERSION=3.9 before our
override changes it to 3.10. Adding explicit PKG_URL ensures the
correct version is downloaded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>