summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests/drm_panic_test.c
AgeCommit message (Collapse)Author
2026-09-17drm/panic: Move panic display code into helper libraryThomas Zimmermann
Move drm_plane_helper_display_panic_screen() and the existing panic- display code into drm_panic_helper.c. Rename symbols accordingly. Also update the QR-related code and the bindings accordingly. Link the rsp. object file into drm_kms_helper.ko. Eventually the code will become a DRM drawing library, together with DRM's format and draw helpers. This requires more preparation. until then, KMS helpers serve as a module. All DRM drivers link it anyway. Add a new section about drawing helpers to the documentation of the KMS helpers. List format and panic helpers there. v2: - fix dependencies on other DRM modules (Randy, Sashiko) - provide placeholders for drm_panic_helper_{init,exit}() (Sashiko) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260911124540.279841-14-tzimmermann@suse.de
2026-09-17drm/panic: Retry in dispatch function if panic output failsThomas Zimmermann
On failed output of QR codes and kmsg buffers, fall back to a user message. QR-code output already did this internally, but now formally support it in drm_panic_dispatch(). Streamlines the existing logic. With the implicit fallback removed from QR-code support, the tests cases fail for thr smallest output size (300x200). This is because the QR code requires a minimal output size. Increase the size to 494x494, which is the minimum supported size for QR output. v3: - update outdated commit description (Sashiko) v2: - fix minimum test size (Sashiko) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260911124540.279841-9-tzimmermann@suse.de
2026-09-17drm/panic: Pass global module parameters to drm_panic_dispatch()Thomas Zimmermann
Set the panic type and QR version in draw_panic_plane() as a single point of truth. Pass the values into the individual drawing functions. In the test case, always create a QR code with version 40 (i.e., the highest supported version). Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260911124540.279841-7-tzimmermann@suse.de
2026-09-17drm/panic: Pass colors to draw_panic_dispatch()Thomas Zimmermann
Set the panic-screen colors in draw_panic_plane() as a single point of truth. Pass the values into the individual drawing functions. In the test cases, replace the Kconfig-defined colors with white and black. Allows for removal of the tests' limitations and dependency on the exact values. All tests now always verify the generated output. Hardcoding the test colors will later also allow for building the test case without having DRM panic handling enabled. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260911124540.279841-6-tzimmermann@suse.de
2026-09-17drm/panic: Return errno codes if panic output failsThomas Zimmermann
Return errno codes from the panic output helpers to detect invalid panic handling. Avoid flushing the display if an error ocured. The unflushed display output might be helpful in debugging. For now, test the result values in the panic test cases. A later patch will add support for retrying failed panic output. v2: - forward return value of draw_panic_screen_user() (Sashiko) - forward errno code from drm_panic_get_qr_code Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260911124540.279841-5-tzimmermann@suse.de
2026-02-21Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentLinus Torvalds
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21treewide: Replace kmalloc with kmalloc_obj for non-scalar typesKees Cook
This is the result of running the Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to avoid scalar types (which need careful case-by-case checking), and instead replace kmalloc-family calls that allocate struct or union object instances: Single allocations: kmalloc(sizeof(TYPE), ...) are replaced with: kmalloc_obj(TYPE, ...) Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...) are replaced with: kmalloc_objs(TYPE, COUNT, ...) Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...) are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...) (where TYPE may also be *VAR) The resulting allocations no longer return "void *", instead returning "TYPE *". Signed-off-by: Kees Cook <kees@kernel.org>
2026-01-05drm/panic: Add kunit tests for drm_panicJocelyn Falempe
Add kunit tests for drm_panic. They check that drawing the panic screen doesn't crash, but they don't check the correctness of the resulting image. Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20251216082524.115980-3-jfalempe@redhat.com Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>