summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-09-11 14:44:07 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2026-09-17 09:16:41 +0200
commitefb67f52fb36186935a56bc2ceda6567dfd97c47 (patch)
treeb4e48c68b8ff9af6079e6ad5eb9e7981886c2106 /include
parent5c3d323984fd140108d527a920de8553ff6504b1 (diff)
downloadlinux-next-efb67f52fb36186935a56bc2ceda6567dfd97c47.tar.gz
linux-next-efb67f52fb36186935a56bc2ceda6567dfd97c47.zip
drm/panic: Compile KUnit tests as module
Fix dependency of the panic-helper KUnit tests on CONFIG_DRM_KUNIT_TEST=y and make them build as a module. Export the necessary interfaces from the panic helpers iff the KUnit framework has been enabled. Select DRM_PANIC_HELPER from DRM_KUNIT_TEST to meet the dependencies of the panic-helper tests. It is now possible to run the tests by modprobe-ing drm_panic_helper_test at runtime. v5: - clear test description with drm_panic_helper_clear_description() (Sashiko) v3: - clean up after each test case (Sashiko) v2: - fix parameter order in decl of drm_panic_helper_draw_screen_qr() (Sashiko) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patch.msgid.link/20260911124540.279841-15-tzimmermann@suse.de
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_panic_helper.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/drm/drm_panic_helper.h b/include/drm/drm_panic_helper.h
index 6cc9a0eba077..fbfe51161aef 100644
--- a/include/drm/drm_panic_helper.h
+++ b/include/drm/drm_panic_helper.h
@@ -8,6 +8,7 @@
enum drm_panic_type;
struct drm_plane;
+struct drm_scanout_buffer;
/* drm_panic_helper.c */
int drm_plane_helper_display_panic_screen(struct drm_plane *plane,
@@ -15,6 +16,14 @@ int drm_plane_helper_display_panic_screen(struct drm_plane *plane,
enum drm_panic_type panic_type,
u32 fg_color, u32 bg_color,
unsigned int qr_version);
+#if IS_ENABLED(CONFIG_KUNIT)
+int drm_panic_helper_draw_screen_user(struct drm_scanout_buffer *sb, u32 fg_color, u32 bg_color);
+int drm_panic_helper_draw_screen_kmsg(struct drm_scanout_buffer *sb, u32 fg_color, u32 bg_color);
+int drm_panic_helper_draw_screen_qr_code(struct drm_scanout_buffer *sb,
+ u32 fg_color, u32 bg_color, unsigned int qr_version);
+void drm_panic_helper_set_description(const char *description);
+void drm_panic_helper_clear_description(void);
+#endif
/* drm_panic_helper_qr.rs */
size_t drm_panic_helper_qr_max_data_size(u8 version, size_t url_len);