Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thomas Zimmermann" <tzimmermann@suse.de>
Cc: imx@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Frank.Li@kernel.org, intel-xe@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org,
	wsa+renesas@sang-engineering.com, linux-hyperv@vger.kernel.org,
	ojeda@kernel.org
Subject: Re: [PATCH 12/12] drm/panic: Compile KUnit tests as module
Date: Tue, 18 Aug 2026 13:18:39 +0000	[thread overview]
Message-ID: <20260818131840.0E7D31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818125012.468092-13-tzimmermann@suse.de>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Mismatched parameter order between declaration and definition for `drm_panic_helper_draw_screen_qr_code`.
- [Low] Unmet direct dependency warning when DRM_PANIC_HELPER is selected without DRM_TTM.
- [Low] Missing indirect dependencies on DRM_DRAW and FONT_SUPPORT leading to linker errors.
--

--- Patch [12]: [PATCH 12/12] drm/panic: Compile KUnit tests as module ---
commit a56a5f0ffd0c185768aecc54426d672e40b1b0ae
Author: Thomas Zimmermann <tzimmermann@suse.de>

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.

> diff --git a/drivers/gpu/drm/Kconfig.debug b/drivers/gpu/drm/Kconfig.debug
> index 1f4c98cbf0906..b909cd0a619fe 100644
> --- a/drivers/gpu/drm/Kconfig.debug
> +++ b/drivers/gpu/drm/Kconfig.debug
> @@ -69,6 +69,7 @@ config DRM_KUNIT_TEST
>  	select DRM_EXPORT_FOR_TESTS if m
>  	select DRM_GEM_SHMEM_HELPER
>  	select DRM_KUNIT_TEST_HELPERS
> +	select DRM_PANIC_HELPER

[Severity: Low]
When DRM_KUNIT_TEST is enabled on a configuration where DRM_TTM is disabled,
does this cause an unmet direct dependency warning? DRM_PANIC_HELPER has a
depends on DRM_TTM requirement in drivers/gpu/drm/Kconfig.

Also, does selecting DRM_PANIC_HELPER without ensuring DRM_DRAW and
FONT_SUPPORT are available cause linker errors? 

The drm_panic_helper.c file unconditionally calls functions from the DRM
draw library (drm_draw_color_from_xrgb8888) and the font library
(get_default_font). Normally, DRM_PANIC selects DRM_DRAW and FONT_SUPPORT,
ensuring these symbols are available, but selecting DRM_PANIC_HELPER
directly bypasses these.

[ ... ]

> diff --git a/include/drm/drm_panic_helper.h b/include/drm/drm_panic_helper.h
> index 6dc63288bc2ab..76ff3a83e07b7 100644
> --- a/include/drm/drm_panic_helper.h
> +++ b/include/drm/drm_panic_helper.h
[ ... ]
> @@ -15,6 +16,13 @@ void 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, unsigned int qr_version,
> +					 u32 fg_color, u32 bg_color);

[Severity: Medium]
Does this prototype match the definition in
drivers/gpu/drm/drm_panic_helper.c?

Here it is declared as:
int drm_panic_helper_draw_screen_qr_code(struct drm_scanout_buffer *sb,
                                         unsigned int qr_version,
                                         u32 fg_color,
                                         u32 bg_color);

But the implementation is defined as:
VISIBLE_IF_KUNIT int drm_panic_helper_draw_screen_qr_code(
                                         struct drm_scanout_buffer *sb,
                                         u32 fg_color,
                                         u32 bg_color,
                                         unsigned int qr_version)

Because u32 and unsigned int are functionally equivalent types, the compiler
silently accepts this mismatch without any warnings. Will any caller
relying on the header's parameter order inadvertently swap the qr_version
and fg_color arguments, causing the function to fail with -ENOSPC or render
with corrupted colors?

> +void drm_panic_helper_set_description(const char *description);
> +#endif

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260818125012.468092-1-tzimmermann@suse.de?part=12

  reply	other threads:[~2026-08-18 13:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 12:27 [PATCH 00/12] drm/panic: Split into core and helpers Thomas Zimmermann
2026-08-18 12:27 ` [PATCH 01/12] drm/panic: Allocate QR-code buffers statically Thomas Zimmermann
2026-08-18 13:09   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 02/12] drm/panic: Make allocation of zlib workspace more robust Thomas Zimmermann
2026-08-18 12:28 ` [PATCH 03/12] drm/panic: Return -EINVAL if font is not available Thomas Zimmermann
2026-08-18 13:04   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 04/12] drm/panic: Return errno codes if panic output fails Thomas Zimmermann
2026-08-18 13:03   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 05/12] drm/panic: Pass colors to draw_panic_dispatch() Thomas Zimmermann
2026-08-18 12:28 ` [PATCH 06/12] drm/panic: Pass global module parameters to drm_panic_dispatch() Thomas Zimmermann
2026-08-18 13:09   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 07/12] drm/panic: Retry in dispatch function if panic output fails Thomas Zimmermann
2026-08-18 13:05   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 08/12] drm/panic: Split draw_panic_plane() Thomas Zimmermann
2026-08-18 13:14   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 09/12] drm/panic: Display panic screen via per-plane callback Thomas Zimmermann
2026-08-18 13:19   ` sashiko-bot
2026-08-18 12:28 ` [PATCH 10/12] drm/panic: Internalize panic locking in DRM core and helpers Thomas Zimmermann
2026-08-18 12:28 ` [PATCH 11/12] drm/panic: Move panic display code into helper library Thomas Zimmermann
2026-08-18 13:13   ` sashiko-bot
2026-08-18 15:55   ` Randy Dunlap
2026-08-18 12:28 ` [PATCH 12/12] drm/panic: Compile KUnit tests as module Thomas Zimmermann
2026-08-18 13:18   ` sashiko-bot [this message]
2026-08-18 14:23 ` ✗ CI.checkpatch: warning for drm/panic: Split into core and helpers Patchwork
2026-08-18 14:24 ` ✗ CI.KUnit: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260818131840.0E7D31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imx@lists.linux.dev \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tzimmermann@suse.de \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox