board: rk3588: switch reComputer RK3588 to Panthor open-source GPU stack - #10320
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe RK3588 board configuration now supports the Panthor GPU stack. It selects the Panthor overlay, configures the kernel driver, installs Mesa packages, removes conflicting Mali userspace files, selects Mesa GBM, and installs the required firmware. ChangesPanthor GPU stack
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR changes the default GPU stack and keeps an explicit boot-time fallback, with no actionable merge-blocking risk identified in the supplied evidence; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant BoardConfig as RK3588 board configuration
participant KernelConfig as RK3588 kernel configuration
participant DebianBackports as Debian Bookworm backports
participant Rootfs as RK35xx root filesystem
participant KernelSources as Configured kernel sources
BoardConfig->>KernelConfig: Configure Panthor and related Mali options
BoardConfig->>BoardConfig: Select the Panthor device-tree overlay
BoardConfig->>DebianBackports: Configure backports and install Mesa/Vulkan packages
BoardConfig->>Rootfs: Remove conflicting Mali files and select Mesa GBM
BoardConfig->>KernelSources: Search for mali_csffw.bin
KernelSources-->>BoardConfig: Return Panthor firmware
BoardConfig->>Rootfs: Install firmware in the ARM Mali firmware path
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/boards/recomputer-rk3588-devkit.conf`:
- Around line 97-108: Update the generated panthor-firmware hook script to
handle the mkinitramfs prereqs invocation before sourcing hook functions or
copying firmware: when $1 is prereqs, print the hook’s prerequisites (none) and
exit successfully. Keep the existing firmware installation flow for normal
invocations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e61d6e40-a5fd-4a90-8bf0-763282c830b1
📒 Files selected for processing (3)
config/boards/recomputer-rk3588-devkit.confconfig/kernel/linux-seeed-rk3588-vendor.configconfig/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
✅ This PR has been reviewed and approved — all set for merge! |
The proprietary Mali/Bifrost GPU driver (mali-valhall-g610 / libmali)
has poor compatibility with newer Debian releases and desktop
environments, causing the desktop to fail to start. Switch the
reComputer RK3588 DevKit to the upstream Panthor DRM driver + Mesa
userspace stack.
Changes:
- Kernel: enable CONFIG_DRM_PANTHOR, disable all Mali/Bifrost configs
- Boot: add RECOMPUTER_GPU_STACK="panthor" and load the panthor DT overlay
- Rootfs: skip proprietary libmali, install Mesa from bookworm-backports
- Firmware: ship mali_csffw.bin required by Panthor
- Cleanup: remove Mali EGL/GBM wrapper leftovers when using Panthor
board: rk3588: handle prereqs invocation in panthor-firmware hook
mkinitramfs calls each hook first with $1=prereqs to query
dependencies, then again to perform the actual work. Add the
standard prereqs guard so the hook prints an empty dependency
list and exits before running mkdir/cp.
The previous form worked in practice — mkinitramfs exports
DESTDIR before the prereqs query (verified against
initramfs-tools 0.151, and confirmed by the built initrd
containing mali_csffw.bin), so the cp did not fail. But it
relied on that invariant and ran side effects during a
metadata-only call. Following the documented hook contract
makes the behavior explicit and forward-compatible.
board: rk3588: keep Mali KMD, switch GPU stacks via panthor overlay
Per review feedback, don't disable the vendor Mali KMD at compile time:
users then can't switch back to libmali for OpenCL/Vulkan compute. The
base DTB carries two mutually exclusive GPU nodes for the same hardware
(gpu@fb000000 for the Mali KMD, gpu-panthor@fb000000 for Panthor), and
the rockchip-rk3588-panthor-gpu overlay disables one and enables the
other, so with both KMDs present exactly one driver binds, chosen per
boot by the overlay.
CONFIG_DRM_PANTHOR=m and CONFIG_MALI_BIFROST=m: both modules autoload
via OF modalias from the enabled node only. Device-verified on a
reComputer RK3588 (dual-driver kernel):
overlay on (default): panthor.ko loaded, bifrost_kbase not loaded,
gpu-panthor@fb000000 => okay, G610 probes fine
overlay off: bifrost_kbase.ko loaded, panthor not loaded,
gpu@fb000000 => okay, kbase platform probes
The default image still ships overlays=rockchip-rk3588-panthor-gpu plus
the Mesa userspace (on trixie+ libmali is ABI-incompatible with the
newer desktop stack), so nothing changes for the out-of-the-box desktop.
Building Panthor as a module also means the firmware is requested after
the rootfs is mounted, so the initramfs hook copying mali_csffw.bin is
no longer needed; the firmware file itself is still installed to
/lib/firmware.
Signed-off-by: Mkirin <haohao.wang@seeed.cc>
6f2b6b6 to
36ceb7c
Compare
| function pre_update_initramfs__recomputer_rk3588_install_panthor_firmware() { | ||
| [[ "${RECOMPUTER_GPU_STACK}" == "panthor" ]] || return 0 | ||
|
|
||
| local root_dir="${MOUNT:-${SDCARD}}" | ||
| local fw_src="" | ||
| local -a fw_candidates=( | ||
| "${SRC}/cache/sources/${LINUXSOURCEDIR:-}/drivers/gpu/arm/bifrost/mali_csffw.bin" | ||
| "${SRC}/../linux-rockchip/drivers/gpu/arm/bifrost/mali_csffw.bin" | ||
| ) | ||
| fw_candidates+=("${SRC}"/cache/sources/linux-kernel-worktree/*/drivers/gpu/arm/bifrost/mali_csffw.bin) | ||
|
|
||
| for candidate in "${fw_candidates[@]}"; do | ||
| if [[ -f "${candidate}" ]]; then | ||
| fw_src="${candidate}" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| [[ -n "${fw_src}" ]] || exit_with_error "Panthor firmware not found" "mali_csffw.bin" | ||
|
|
||
| display_alert "Panthor firmware" "Installing ${fw_src}" "info" | ||
| install -Dm0644 "${fw_src}" "${root_dir}/lib/firmware/arm/mali/arch10.8/mali_csffw.bin" | ||
| } |
There was a problem hiding this comment.
Hey @Mkiring this causes breakage; not all image-builders (which build the initramfs) have the cache/sources of the kernel (in CI for example the kernel is built by dedicated runners).
Also, the mali blobs are in armbian-firmware package. Why this?
There was a problem hiding this comment.
I'll send a PR dropping this hook as it doesn't seem to be necessary at all.
There was a problem hiding this comment.
@igorpecovnik had already sent #10487 -- either is good
Summary
rockchip-rk3588-panthor-gpuDT overlay instead of compile-time kernel changes.CONFIG_MALI_BIFROST=m, everything else restored to previous values) and addCONFIG_DRM_PANTHOR=m. The base DTB carries two mutually exclusive GPU nodes for the same hardware (gpu@fb000000for the Mali KMD,gpu-panthor@fb000000for Panthor); the overlay disables one and enables the other, so exactly one KMD binds per boot — flipping stacks needs no rebuild.overlays=rockchip-rk3588-panthor-gpuby default (RECOMPUTER_GPU_STACK=panthor), skip the libmali userspace and install Mesa instead (bookworm: from backports). Removing the overlay from armbianEnv.txt switches back to the Mali KMD; libmali userspace for that path (OpenCL/Vulkan compute) is installed separately.mali_csffw.binafter the rootfs is mounted; the firmware is still installed to/lib/firmware).Testing (reComputer RK3588 DevKit, dual-driver 6.1.115 kernel)
panthor.koautoloads,bifrost_kbasestays unloaded,gpu-panthor@fb000000 => okay,panthor fb000000.gpu-panthor: [drm] mali-g610 id 0xa867, Mesa render nodes presentbifrost_kbase.koautoloads,panthorstays unloaded,gpu@fb000000 => okay, rk kbase platform init in dmesgSummary by CodeRabbit