Re: [PATCH v9 0/9] drm/panic: Add a drm panic handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,


On 2024/3/7 17:14, Jocelyn Falempe wrote:
This introduces a new drm panic handler, which displays a message when a panic occurs.
So when fbcon is disabled, you can still see a kernel panic.

This is one of the missing feature, when disabling VT/fbcon in the kernel:
https://www.reddit.com/r/linux/comments/10eccv9/config_vtn_in_2023/
Fbcon can be replaced by a userspace kms console, but the panic screen must be done in the kernel.

This is a proof of concept, and works with simpledrm, mgag200, ast, and imx.

To test it, make sure you're using one of the supported driver, and trigger a panic:
echo c > /proc/sysrq-trigger

or you can enable CONFIG_DRM_PANIC_DEBUG and echo 1 > /sys/kernel/debug/dri/0/drm_panic_plane_0

Yes, the whole series works for me! I have tested with drm/loongson,
Are you willing to add a implement for drm/loongson driver?
If you do please add the fallowing code snippet info drm/loongson/lsdc_plane.c.
Thanks you.


static int
lsdc_primary_plane_get_scanout_buffer(struct drm_plane *plane,
                      struct drm_scanout_buffer *scanout)
{
    struct drm_framebuffer *fb;

    if (!plane->state || !plane->state->fb)
        return -ENODEV;

    fb = plane->state->fb;
    if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
        return -ENODEV;

    scanout->format = fb->format;
    scanout->width = fb->width;
    scanout->height = fb->height;
    scanout->pitch = fb->pitches[0];

    return drm_gem_vmap_unlocked(fb->obj[0], &scanout->map);
}

hook this lsdc_primary_plane_get_scanout_buffer() up to the .get_scanout_buffer
member of lsdc_primary_helper_funcs, and include the #include <drm/drm_panic.h>
Thanks you in advance!




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux