|
|
Log in / Subscribe / Register

drm/panic: Add a qr_code panic screen

From:  Jocelyn Falempe <jfalempe-AT-redhat.com>
To:  Maarten Lankhorst <maarten.lankhorst-AT-linux.intel.com>, Maxime Ripard <mripard-AT-kernel.org>, Thomas Zimmermann <tzimmermann-AT-suse.de>, David Airlie <airlied-AT-gmail.com>, Daniel Vetter <daniel-AT-ffwll.ch>, Miguel Ojeda <ojeda-AT-kernel.org>, Alex Gaynor <alex.gaynor-AT-gmail.com>, Wedson Almeida Filho <wedsonaf-AT-gmail.com>, Boqun Feng <boqun.feng-AT-gmail.com>, Gary Guo <gary-AT-garyguo.net>, "Bjorn Roy Baron" <bjorn3_gh-AT-protonmail.com>, Benno Lossin <benno.lossin-AT-proton.me>, Andreas Hindborg <a.hindborg-AT-samsung.com>, Alice Ryhl <aliceryhl-AT-google.com>, linux-kernel-AT-vger.kernel.org, dri-devel-AT-lists.freedesktop.org, rust-for-linux-AT-vger.kernel.org, Danilo Krummrich <dakr-AT-redhat.com>
Subject:  [PATCH v2 0/4] drm/panic: Add a qr_code panic screen
Date:  Tue, 09 Jul 2024 10:40:06 +0200
Message-ID:  <20240709084458.158659-1-jfalempe@redhat.com>
Cc:  Jocelyn Falempe <jfalempe-AT-redhat.com>
Archive-link:  Article

This series adds a new panic screen, with the kmsg data embedded in a QR-code.

The main advantage of QR-code, is that you can copy/paste the debug data to a bug report.

The QR-code encoder is written in rust, and is very specific to drm_panic.
The reason is that it is called in a panic handler, and thus can't allocate memory, or use locking.
The rust code uses a few rust core API, and provides only two C entry points.
There is no particular reason to do it in rust, I just wanted to learn rust, and see if it can work in the kernel.

If you want to see what it looks like, I've put a few screenshots here:
https://github.com/kdj0c/panic_report/issues/1

v2:
 * Rewrite the rust comments with Markdown (Alice Ryhl)
 * Mark drm_panic_qr_generate() as unsafe (Alice Ryhl)
 * Use CStr directly, and remove the call to as_str_unchecked()
   (Alice Ryhl)
 * Add a check for data_len <= data_size (Greg KH)

Jocelyn Falempe (4):
  drm/panic: Add integer scaling to blit()
  drm/rect: add drm_rect_overlap()
  drm/panic: simplify logo handling
  drm/panic: Add a qr_code panic screen

 drivers/gpu/drm/Kconfig         |   29 +
 drivers/gpu/drm/Makefile        |    1 +
 drivers/gpu/drm/drm_drv.c       |    3 +
 drivers/gpu/drm/drm_panic.c     |  338 +++++++++--
 drivers/gpu/drm/drm_panic_qr.rs | 1004 +++++++++++++++++++++++++++++++
 include/drm/drm_panic.h         |    4 +
 include/drm/drm_rect.h          |   15 +
 7 files changed, 1355 insertions(+), 39 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_panic_qr.rs


base-commit: 5a716b06b329bd2108c95a4f04c71bbe491729f2
-- 
2.45.2




Copyright © 2024, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds