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