linux/drivers/gpu/drm/tiny
Thomas Zimmermann b8bc58515a drm/panic: Display panic screen via per-plane callback
Add display_panic_screen to struct drm_plane_funcs. If set on a plane,
register a panic handler for the plane from the DRM core's panic
handling. Invoke this helper from the core to display a panic screen.

The new callback replaces get_scanout_buffer as signal for panic
support in a plane. Using get_scanout_buffer is now merely a detail
of the implementation. This will also free struct drm_scanout_buffer
for use cases besides panic handling.

With display_panic_screen in place, rename draw_panic_plane() to
drm_plane_helper_display_panic_screen() and make it available to DRM
drivers via drm_panic_helper.h. Do not change the implementation or
functionality of this code. drm_plane_helper_display_panic_screen()
still supports kernel messages, user messages and QR codes on various
color formats.

Then update all drivers that implement panic support. Provide the
initializer macro DRM_PANIC_PLANE_FUNCS that sets display_panic_screen
to drm_plane_helper_display_panic_screen(). If panic handling has
been disabled, it instead clears the callback. There's again no change
in functionality.

This logically splits panic handling into a set of entry points in the
DRM code and a set of helper functions provided by drivers. The core
invokes the driver's helper via callback, while the driver can tailor
the implementation to its needs. Panic handling now works like most
other interfaces in the DRM framework.

Locking and state-handling happens in the DRM core or helpers. Drivers
that receive a call to display_panic_screen can assume that no concurrent
modeset takes place on the plane or its CRTC.

Also update the documentation. Move information about locking and state
guarantees from drm_panic_trylock() to display_panic_screen, where
drivers authors can find it easily. Move information about the features
of the current implementation to drm_panic_helper_display_panic_screen().

v4:
- remove obsolete comment about fbcon interference (Jocelyn)
v2:
- only consider planes with get_scanout_buffer (Sashiko)
- set callback for planes create with drm_crtc_init() (Sashiko)
- return errno code from display_panic_screen

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patch.msgid.link/20260911124540.279841-12-tzimmermann@suse.de
2026-09-17 09:16:31 +02:00
..
appletbdrm.c drm/tiny: appletbdrm: Switch to drm_atomic_helper_crtc_create_state 2026-08-31 15:11:10 +02:00
arcpgu.c drm/arcgpu: Switch to drm_atomic_helper_plane_create_state 2026-09-16 17:21:52 +02:00
bochs.c drm/panic: Display panic screen via per-plane callback 2026-09-17 09:16:31 +02:00
cirrus-qemu.c Merge drm/drm-next into drm-misc-next 2026-09-07 13:44:24 +02:00
gm12u320.c drm/gm12u320: Switch to drm_atomic_helper_crtc_create_state 2026-09-16 09:23:36 +02:00
hx8357d.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
ili9163.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
ili9225.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
ili9341.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
ili9486.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
Kconfig drm/tiny: pixpaper: add explicit dependency on MMU 2025-11-06 13:47:29 +01:00
Makefile drm: tiny: Add support for Mayqueen Pixpaper e-ink panel 2025-09-05 14:53:07 +02:00
mi0283qt.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
panel-mipi-dbi.c drm: Rename struct drm_atomic_state to drm_atomic_commit 2026-05-04 14:05:04 +10:00
pixpaper.c drm/tiny: pixpaper: Switch to drm_atomic_helper_crtc_create_state 2026-08-31 15:11:11 +02:00
repaper.c drm/repaper: Switch to drm_atomic_helper_crtc_create_state 2026-09-16 09:24:22 +02:00
sharp-memory.c drm/tiny: sharp: Switch to drm_atomic_helper_crtc_create_state 2026-08-31 15:11:12 +02:00