Skip to content

drm/panic: Add a QR code panic screen

Jocelyn Falempe dri-devel lkml rust-for-linux 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest4 patches 6 repliesIn review
  2. v64 patches 6 repliesSuperseded
  3. v54 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v44 patches5 repliesSuperseded
v34 patches2 repliesSuperseded
v24 patches10 repliesSuperseded
v14 patches10 repliesSuperseded

Changes in v7 from the cover letter

* rename r1/r2 to a/b in drm_rect_overlap() (Jani Nikula)

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4drm/panic: Add integer scaling to blit()drivers/gpu/drm/drm_panic.c+19 -141 reply
2/4drm/rect: Add drm_rect_overlap()drivers/gpu/drm/drm_panic.c include/drm/drm_rect.h+16 -22 replies
3/4drm/panic: Simplify logo handlingdrivers/gpu/drm/drm_panic.c+33 -252 replies
4/4drm/panic: Add a QR code panic screendrivers/gpu/drm/Kconfig drivers/gpu/drm/Makefile drivers/gpu/drm/drm_crtc_internal.h +3 more+1290 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchAlice RyhlThomas Zimmermann
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/4] drm/panic: Add a QR code panic screen

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)

v3:
* Fix all rust comments (typo, punctuation) (Miguel Ojeda)
* Change the wording of safety comments (Alice Ryhl)
* Add a link to the javascript decoder in the Kconfig (Greg KH)
* Fix data_size and tmp_size check in drm_panic_qr_generate()

v4:
* Fix the logic to find next line and skip the '\n' (Alic Ryhl)
* Remove __LOG_PREFIX as it's not used (Alice Ryhl)

v5:
* Move drm_panic_[init|exit]() prototype to drm_crtc_internal.h (Daniel Vetter)

v6:
* rebase, and handle conflict with 5d45c01dea6f ("drm/panic: Add panic description")
* Fix qr_width should be a signed int, to handle error code.

v7:
* rename r1/r2 to a/b in drm_rect_overlap() (Jani Nikula)

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             |   31 +
 drivers/gpu/drm/Makefile            |    1 +
 drivers/gpu/drm/drm_crtc_internal.h |    4 +
 drivers/gpu/drm/drm_drv.c           |    3 +
 drivers/gpu/drm/drm_panic.c         |  340 +++++++--
 drivers/gpu/drm/drm_panic_qr.rs     | 1003 +++++++++++++++++++++++++++
 include/drm/drm_rect.h              |   15 +
 7 files changed, 1357 insertions(+), 40 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_panic_qr.rs

base-commit: 04b5b362bc2a36f1dfe5cad52c83b1ea9d25b87c

Signature · 1 line
2.46.0