dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/panic: Add kunit tests for drm_panic
@ 2025-08-21  9:49 Jocelyn Falempe
  2025-08-21  9:49 ` [PATCH 1/3] drm/panic: Rename draw_panic_static_* to draw_panic_screen_* Jocelyn Falempe
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jocelyn Falempe @ 2025-08-21  9:49 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Jocelyn Falempe, Javier Martinez Canillas,
	linux-kernel, dri-devel

This series adds some kunit tests to drm_panic.

This tests draws the panic screens to different framebuffer size and
format, and ensure it doesn't crash or draw outside of the buffer.
However it doesn't check the resulting image, because it depends on
other Kconfig options, like logo, fonts, or panic colors.

The last patch is optional and a bit hacky.
It allows to dump the generated images to the logs, and then a python
script can convert it to .png files. It makes it handy to check how
the panic screen will look on different resolutions, without having
to crash a VM.
To not pollute the logs, it uses a monochrome framebuffer, compress
it with zlib, and base64 encode it.

Jocelyn Falempe (3):
  drm/panic: Rename draw_panic_static_* to draw_panic_screen_*
  drm/panic: Add kunit tests for drm_panic
  drm/panic: Add a kconfig option to dump kunits results to png

 MAINTAINERS                            |   1 +
 drivers/gpu/drm/Kconfig.debug          |  14 ++
 drivers/gpu/drm/drm_panic.c            |  33 +--
 drivers/gpu/drm/tests/drm_panic_test.c | 275 +++++++++++++++++++++++++
 scripts/kunitpanic2png.py              |  53 +++++
 5 files changed, 361 insertions(+), 15 deletions(-)
 create mode 100644 drivers/gpu/drm/tests/drm_panic_test.c
 create mode 100755 scripts/kunitpanic2png.py


base-commit: 043d9c6928b010be7902a01b5cdfa7d754535b1a
-- 
2.50.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-09-03  8:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21  9:49 [PATCH 0/3] drm/panic: Add kunit tests for drm_panic Jocelyn Falempe
2025-08-21  9:49 ` [PATCH 1/3] drm/panic: Rename draw_panic_static_* to draw_panic_screen_* Jocelyn Falempe
2025-08-21  9:49 ` [PATCH 2/3] drm/panic: Add kunit tests for drm_panic Jocelyn Falempe
2025-08-27  9:44   ` Maxime Ripard
2025-09-01 12:59     ` Jocelyn Falempe
2025-08-21  9:49 ` [PATCH 3/3] drm/panic: Add a kconfig option to dump kunits results to png Jocelyn Falempe
2025-08-27  9:52   ` Maxime Ripard
2025-09-01 13:16     ` Jocelyn Falempe
2025-08-27 10:45   ` Thomas Zimmermann
2025-09-01 13:04     ` Jocelyn Falempe
2025-09-02 16:58       ` Maxime Ripard
2025-09-03  7:30         ` Jocelyn Falempe
2025-09-03  8:19           ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).