Disable the framebuffer emulation when a panic occurs, to avoid fbcon to overwrite the panic screen. So it's now safe to enable DRM_PANIC and FRAMEBUFFER_CONSOLE.
Signed-off-by: Jocelyn Falempe <jfale...@redhat.com> --- drivers/gpu/drm/Kconfig | 2 +- drivers/gpu/drm/drm_panic.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 959b19a041018..7a8b1ef4c6bcf 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -106,7 +106,7 @@ config DRM_KMS_HELPER config DRM_PANIC bool "Display a user-friendly message when a kernel panic occurs" - depends on DRM && !FRAMEBUFFER_CONSOLE + depends on DRM select DRM_KMS_HELPER select FONT_SUPPORT help diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index 7ece67086cecb..c46a2b878e759 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -15,6 +15,7 @@ #include <linux/types.h> #include <drm/drm_drv.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_format_helper.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> @@ -470,6 +471,9 @@ static void draw_panic_plane(struct drm_plane *plane) int ret; unsigned long flags; + /* Prevent fbcon from overwriting the panic screen */ + drm_fb_helper_emergency_disable(plane->dev->fb_helper); + if (!drm_panic_trylock(plane->dev, flags)) return; -- 2.44.0