From ddbc641c717a1eeafc829e57d418f1b9af409e0e Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Mon, 21 Sep 2026 17:36:01 +0100 Subject: [PATCH] configs: Enable CONFIG_DRM_PANIC A panic often leaves whatever was on screen in place(*), so anyone without a serial console sees a machine that simply stops. With DRM_PANIC_SCREEN="kmsg" the tail of the kernel log, backtrace included, is painted over the display, which a user can photograph and attach to a bug report. (*) In testing a panic did show from a framebuffer console, but not from desktop (labwc) or other userspace owner of the DRM display (e.g. kodi). Cost, measured with the option on and off: vmlinux no change - DRM is a module in every config, and fbcon already selects FONT_SUPPORT drm.ko (arm64) +8873 bytes drm.ko (arm, bcmrpi) +8048 bytes That is drm_panic.o plus the drm_draw.o it selects. Nothing grows per device or per plane: drm_mode_config.panic_lock and drm_plane.kmsg_panic are unconditional struct members already. The only addition to normal operation is one raw_spin_lock_irqsave()/unlock pair per atomic commit, around the plane state swap in drm_atomic_helper_swap_state(); the rest runs only from the panic handler. The panic screen is not guaranteed to appear, which is worth knowing before relying on it. drm_fb_dma_get_scanout_buffer() only accepts a linear, CPU-mapped buffer that was not imported from another device, so a client scanning out a tiled or SAND buffer - Kodi playing video, say - gets no panic screen at all, and it fails silently. Tested on a Pi 500: a panic is displayed on the fbdev console, over the kodi gui (if video is not playing) and on a labwc desktop. With current settings the systemd watchdog reboots us after 30s. Signed-off-by: Dom Cobley --- arch/arm/configs/bcm2709_defconfig | 3 +++ arch/arm/configs/bcmrpi_defconfig | 3 +++ arch/arm64/configs/bcm2711_defconfig | 3 +++ arch/arm64/configs/bcm2711_rt_defconfig | 3 +++ arch/arm64/configs/bcm2712_defconfig | 3 +++ 5 files changed, 15 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig index 09c5082c770ec..69a08401f2c61 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -978,6 +978,9 @@ CONFIG_VIDEO_I2C=m CONFIG_AUXDISPLAY=y CONFIG_HD44780=m CONFIG_DRM=m +CONFIG_DRM_PANIC=y +CONFIG_DRM_PANIC_BACKGROUND_COLOR=0xc41949 +CONFIG_DRM_PANIC_SCREEN="kmsg" CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_ILITEK_ILI9806E=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig index 197ca950ee36e..cde744a826992 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -971,6 +971,9 @@ CONFIG_VIDEO_I2C=m CONFIG_AUXDISPLAY=y CONFIG_HD44780=m CONFIG_DRM=m +CONFIG_DRM_PANIC=y +CONFIG_DRM_PANIC_BACKGROUND_COLOR=0xc41949 +CONFIG_DRM_PANIC_SCREEN="kmsg" CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_ILITEK_ILI9806E=m diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig index 753fcdf918b4a..1b60ce5525549 100644 --- a/arch/arm64/configs/bcm2711_defconfig +++ b/arch/arm64/configs/bcm2711_defconfig @@ -1081,6 +1081,9 @@ CONFIG_VIDEO_I2C=m CONFIG_AUXDISPLAY=y CONFIG_HD44780=m CONFIG_DRM=m +CONFIG_DRM_PANIC=y +CONFIG_DRM_PANIC_BACKGROUND_COLOR=0xc41949 +CONFIG_DRM_PANIC_SCREEN="kmsg" CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_LVDS=m diff --git a/arch/arm64/configs/bcm2711_rt_defconfig b/arch/arm64/configs/bcm2711_rt_defconfig index 32da405f3223e..b7a94d5813b9e 100644 --- a/arch/arm64/configs/bcm2711_rt_defconfig +++ b/arch/arm64/configs/bcm2711_rt_defconfig @@ -1078,6 +1078,9 @@ CONFIG_VIDEO_I2C=m CONFIG_AUXDISPLAY=y CONFIG_HD44780=m CONFIG_DRM=m +CONFIG_DRM_PANIC=y +CONFIG_DRM_PANIC_BACKGROUND_COLOR=0xc41949 +CONFIG_DRM_PANIC_SCREEN="kmsg" CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_LVDS=m diff --git a/arch/arm64/configs/bcm2712_defconfig b/arch/arm64/configs/bcm2712_defconfig index 04aaa031f6b44..27199c580c77b 100644 --- a/arch/arm64/configs/bcm2712_defconfig +++ b/arch/arm64/configs/bcm2712_defconfig @@ -1083,6 +1083,9 @@ CONFIG_VIDEO_I2C=m CONFIG_AUXDISPLAY=y CONFIG_HD44780=m CONFIG_DRM=m +CONFIG_DRM_PANIC=y +CONFIG_DRM_PANIC_BACKGROUND_COLOR=0xc41949 +CONFIG_DRM_PANIC_SCREEN="kmsg" CONFIG_DRM_LOAD_EDID_FIRMWARE=y CONFIG_DRM_UDL=m CONFIG_DRM_PANEL_LVDS=m