* [PATCH v2 0/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats()
@ 2026-07-31 15:42 Leandro Ribeiro
2026-07-31 15:42 ` [PATCH v2 1/1] " Leandro Ribeiro
0 siblings, 1 reply; 3+ messages in thread
From: Leandro Ribeiro @ 2026-07-31 15:42 UTC (permalink / raw)
To: dri-devel
Cc: airlied, broonie, daniels, jani.nikula, maarten.lankhorst,
miguel.ojeda.sandonis, mripard, pekka.paalanen, simona,
penguin-kernel, tytso, tzimmermann, ville.syrjala, linux-kernel
This replaces a WARN() with drm_warn() in
validate_blend_mode_for_alpha_formats().
The condition is expected to be triggered by existing drivers while they
adapt to the new blend mode requirement, so it should not use the kernel
warning report mechanism. WARN() output can cause fuzzers to stop when
they encounter a "WARNING:" message.
drm_warn() keeps the warning visible to driver developers without
triggering a WARN().
Changes in v2:
- Make the warning message more explicit
- Add a "Fixes" tag to commit
Leandro Ribeiro (1):
drm: use drm_warn() in validate_blend_mode_for_alpha_formats()
drivers/gpu/drm/drm_mode_config.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats()
2026-07-31 15:42 [PATCH v2 0/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats() Leandro Ribeiro
@ 2026-07-31 15:42 ` Leandro Ribeiro
2026-07-31 15:49 ` sashiko-bot
0 siblings, 1 reply; 3+ messages in thread
From: Leandro Ribeiro @ 2026-07-31 15:42 UTC (permalink / raw)
To: dri-devel
Cc: airlied, broonie, daniels, jani.nikula, maarten.lankhorst,
miguel.ojeda.sandonis, mripard, pekka.paalanen, simona,
penguin-kernel, tytso, tzimmermann, ville.syrjala, linux-kernel
Commit 860e748bddcc ("drm: ensure blend mode supported if pixel format
with alpha exposed") introduced a WARN() to let driver developers know
that a previously valid behavior should now be changed.
But WARN() should not be used for that, as it's a kernel warning report
mechanism for conditions that are not expected to happen. It also
produces a stack trace. Instead, a simple warning-level log message
should have been used, as drivers were expected to trigger the
condition.
This is causing problems for fuzzers, as they may stop when encountering
a "BUG:" or "WARNING:" in the logs.
Replace WARN() with drm_warn() in this function, avoiding these issues.
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
---
drivers/gpu/drm/drm_mode_config.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index 3bcc7bf0900c..cff347c723ef 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -869,8 +869,9 @@ static void validate_blend_mode_for_alpha_formats(struct drm_plane *plane)
for (i = 0; i < plane->format_count; i++) {
fmt = drm_format_info(plane->format_types[i]);
if (fmt->has_alpha) {
- WARN(1, "[PLANE:%d:%s] pixel format with alpha exposed but blend mode not setup",
- plane->base.id, plane->name);
+ drm_warn(plane->dev,
+ "[PLANE:%d:%s] pixel format with alpha exposed but blend mode not setup. Please fix.",
+ plane->base.id, plane->name);
break;
}
}
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2 1/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats()
2026-07-31 15:42 ` [PATCH v2 1/1] " Leandro Ribeiro
@ 2026-07-31 15:49 ` sashiko-bot
0 siblings, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-31 15:49 UTC (permalink / raw)
To: Leandro Ribeiro; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Low] Missing trailing newline in drm_warn() format string.
Pre-existing issues:
- [High] Missing NULL check on the return value of drm_format_info() before dereferencing it.
--
--- Patch [1]: [PATCH v2 1/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats() ---
commit e7f907e9d21d7af4bbeb8c955471b68c362de2e1
Author: Leandro Ribeiro <leandro.ribeiro@collabora.com>
drm: use drm_warn() in validate_blend_mode_for_alpha_formats()
This commit replaces a WARN() with drm_warn() in
validate_blend_mode_for_alpha_formats() to prevent fuzzers from stopping when
drivers encounter a pixel format with alpha exposed but no blend mode setup.
> diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> index 3bcc7bf0900c4..cff347c723ef0 100644
> --- a/drivers/gpu/drm/drm_mode_config.c
> +++ b/drivers/gpu/drm/drm_mode_config.c
> @@ -869,8 +869,9 @@ static void validate_blend_mode_for_alpha_formats(struct drm_plane *plane)
> for (i = 0; i < plane->format_count; i++) {
> fmt = drm_format_info(plane->format_types[i]);
> if (fmt->has_alpha) {
[Severity: High]
This isn't a bug introduced by this patch, but is it possible for
drm_format_info() to return NULL here?
If a driver exposes an unknown or unsupported format in the format_types
array, drm_format_info() returns NULL, and this line will trigger a NULL
pointer dereference during plane validation.
> - WARN(1, "[PLANE:%d:%s] pixel format with alpha exposed but blend mode not setup",
> - plane->base.id, plane->name);
> + drm_warn(plane->dev,
> + "[PLANE:%d:%s] pixel format with alpha exposed but blend mode not setup. Please fix.",
[Severity: Low]
Should this format string end with a newline character?
Without a trailing \n, this warning message might remain buffered or get
concatenated with subsequent unrelated kernel log messages.
> + plane->base.id, plane->name);
> break;
> }
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260731154232.37020-2-leandro.ribeiro@collabora.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-31 15:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 15:42 [PATCH v2 0/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats() Leandro Ribeiro
2026-07-31 15:42 ` [PATCH v2 1/1] " Leandro Ribeiro
2026-07-31 15:49 ` sashiko-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.