Skip to content

Commit

Permalink
fbcon: Add an option to disable fbcon in panic
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jocelyn Falempe committed Jul 19, 2024
1 parent 9f774c4 commit d20a9f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/video/fbdev/core/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions include/linux/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ struct fb_info {
void *par;

bool skip_vt_switch; /* no VT switch on suspend/resume required */
bool skip_panic; /* Do not write to the fb after a panic */
};

/* This will go away
Expand Down

0 comments on commit d20a9f5

Please sign in to comment.