summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJocelyn Falempe <jfalempe@redhat.com>2024-07-17 10:48:40 +0200
committerJocelyn Falempe <jfalempe@redhat.com>2024-07-19 11:38:23 +0200
commitd20a9f568f99591886ec73b80ff7283486710643 (patch)
tree7a51e561822542d6078b7922da0fae872252d84e /drivers
parentdrm/panic: Add drm_panic_is_enabled() (diff)
downloadlinux-d20a9f568f99591886ec73b80ff7283486710643.tar.xz
linux-d20a9f568f99591886ec73b80ff7283486710643.zip
fbcon: Add an option to disable fbcon in panic
This is required to avoid conflict between DRM_PANIC, and fbcon. If a drm device already handle panic with drm_panic, it should set the skip_panic field in fb_info, so that fbcon will stay quiet, and not overwrite the panic_screen. Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20240717090102.968152-3-jfalempe@redhat.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbdev/core/fbcon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 3f7333dca508..498d9c07df80 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -270,12 +270,17 @@ static int fbcon_get_rotate(struct fb_info *info)
return (ops) ? ops->rotate : 0;
}
+static bool fbcon_skip_panic(struct fb_info *info)
+{
+ return (info->skip_panic && unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID));
+}
+
static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)
{
struct fbcon_ops *ops = info->fbcon_par;
return (info->state != FBINFO_STATE_RUNNING ||
- vc->vc_mode != KD_TEXT || ops->graphics);
+ vc->vc_mode != KD_TEXT || ops->graphics || fbcon_skip_panic(info));
}
static int get_color(struct vc_data *vc, struct fb_info *info,