Skip to content

Build the vc4 driver into the arm64 kernel so a Pi has a console - #165

Merged
mastacontrola merged 2 commits into
masterfrom
arm64-vc4-display
Aug 27, 2026
Merged

Build the vc4 driver into the arm64 kernel so a Pi has a console#165
mastacontrola merged 2 commits into
masterfrom
arm64-vc4-display

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

A Raspberry Pi 4 booting FOS stopped on the firmware's four-raspberry splash with no text at all — no kernel messages, no FOS, nothing to type into. It was diagnosed as an early hang twice. It wasn't one: the kernel was running and had no way to say so.

Reported as forums topic 18229.

Why the existing approach doesn't reach a Pi

FOS builds no DRM on any architecture and attaches fbcon to a framebuffer the firmware set up — CONFIG_FB_EFI/FB_VESA off EFI GOP on a PC, where every UEFI implementation publishes a GOP so it is guaranteed. On a Pi it is not:

  • Our own DTB can't carry the node. arm_dtbs.tar.gz ships mainline's broadcom/bcm2711-rpi-4-b.dtb, which has brcm,bcm2711-hdmi0/1 — nodes only vc4 binds to — and zero simple-framebuffer nodes. The firmware injects that node into the DTB it hands the bootloader; a DTB fetched over TFTP has never been through the firmware.
  • The firmware's own DTB stops carrying it once KMS is on. The vc4-kms-v3d overlay tells the firmware not to set the display up. Current Raspberry Pi OS ships that overlay enabled.

Both directions fail silently, and a healthy boot renders identically to a dead one — which is what made the original report unreadable.

The change

CONFIG_DRM + CONFIG_DRM_VC4 + CONFIG_DRM_FBDEV_EMULATION, so the kernel programs the HDMI block itself and no longer depends on firmware cooperation.

Measured cost: Image 28,353,024 → 29,420,032 bytes, +1,067,008 (+3.8%), on matched local builds, same box and toolchain. The published CI pair moved 30,253,568 → 31,386,112, agreeing to within 0.1pp. CONFIG_DRM_V3D is deliberately off — it's the 3D accelerator and a console doesn't use it.

The dependency trap

CONFIG_DRM_VC4=y can't just be switched on. Per drivers/gpu/drm/vc4/Kconfig it depends on DRM, on SND && SND_SOC (HDMI audio is integral to the driver), and on PM — all three excluded by FOS. Miss any one and oldconfig drops it with no error, leaving a config that reads right in git and a kernel with no display driver. That's the ADR-0010 trap, and it fired twice here.

So the driver is asserted linked, not configured: 378 vc4_* symbols in vmlinux.

Verification

  • Real hardware, by the reporter, against EXP_20260827-114033: HDMI initialised, FOS reached userspace, Partclone captured /dev/sda to the server. First end-to-end FOS imaging run on a Raspberry Pi — and the first real-hardware exercise of ADR-0015's platform support and of the mount -t nfs fix, both previously only QEMU/VirtualBox.
  • CONFIG_DRM_VC4=y confirmed in the published arm_Image via extract-ikconfig, not just in the config file.
  • Guard proven to fail before being trusted — three mutations, each restored from a copy rather than git checkout: dropping DRM_VC4 from the committed config → red; dropping SND_SOC → red; dropping DRM_VC4 from the post-oldconfig .config under -b → red. That last mode is the one that catches the actual trap.
  • Full suite green: 15/15 tests/checks plus the golden fixture.

ADR-0017 records the decision and the trap.

mastacontrola and others added 2 commits August 27, 2026 06:17
FOS builds without DRM and relies on firmware handing over a framebuffer, the
way CONFIG_FB_EFI/FB_VESA works off EFI GOP on a PC. That assumption does not
hold on a Raspberry Pi. Our bcm2711-rpi-4-b.dtb carries brcm,bcm2711-hdmi0/1
nodes but no simple-framebuffer node, and the simple-framebuffer node the
VideoCore firmware would otherwise inject is suppressed whenever config.txt
enables the vc4-kms-v3d overlay -- which current Raspberry Pi OS ships on by
default. The result is a Pi that produces no console output at all, so a healthy
boot and an early hang are indistinguishable (forums topic 18229).

DRM_VC4 cannot simply be switched on. It depends on DRM, on SND && SND_SOC
because HDMI audio is integral to the driver, and on PM -- three subsystems this
config deliberately excludes. Enabling only CONFIG_DRM_VC4 is silently dropped
by oldconfig with no error, which is the ADR-0010 trap; it took two rounds of
adding a dependency and re-running olddefconfig before the symbol survived.
Verified linked rather than merely configured: 378 vc4_* symbols in vmlinux.

Cost measured on matched builds, same box and toolchain: Image grows from
28,353,024 to 29,420,032 bytes, +1,067,008 (+3.8%).

DRM_V3D is deliberately not enabled -- it is the 3D accelerator and buys nothing
for a console.

This is a branch build for hardware testing. It needs an ADR and a guard in
tests/checks/arm64-platform-config.sh before it belongs on master, since a
silently-dropped DRM_VC4 would reintroduce exactly the blank screen this fixes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Validated on real hardware 2026-08-27 (forums topic 18229): with
EXP_20260827-114033 the Pi 4 initialised HDMI, reached FOS userspace, and
Partclone captured /dev/sda to the server. First end-to-end FOS imaging run on a
Raspberry Pi, and the first real-hardware exercise of ADR-0015's platform
support and of the mount -t nfs fix, both of which had only ever run under QEMU
and VirtualBox.

ADR-0017 records why the firmware-framebuffer approach that works on every PC
does not reach a Pi: our shipped bcm2711-rpi-4-b.dtb has no simple-framebuffer
node, and the node the VideoCore firmware would inject into its own DTB is
suppressed once config.txt enables vc4-kms-v3d, which current Raspberry Pi OS
ships enabled. It also records the measured cost (+1,067,008 bytes, +3.8%) and
why DRM_V3D stays off.

The harness gains DRM, DRM_VC4, DRM_FBDEV_EMULATION and FRAMEBUFFER_CONSOLE, and
also PM, SND and SND_SOC -- the dependencies whose absence makes oldconfig drop
DRM_VC4 with no error, for the same reason SERIAL_8250_SHARE_IRQ is already
listed beside SERIAL_8250_BCM2835AUX. Proven to fail before being trusted: three
mutations, each restored from a copy rather than git checkout. Dropping
DRM_VC4 from the committed config goes red, dropping SND_SOC goes red, and
dropping DRM_VC4 from the post-oldconfig .config goes red under -b, which is the
mode that catches the actual trap.

Full suite green: 15/15 checks plus the golden fixture.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mastacontrola
mastacontrola merged commit 91d0e74 into master Aug 27, 2026
1 check passed
@mastacontrola
mastacontrola deleted the arm64-vc4-display branch August 27, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant