All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Leandro Ribeiro <leandro.ribeiro@collabora.com>,
	dri-devel@lists.freedesktop.org
Cc: airlied@gmail.com, broonie@kernel.org, daniels@collabora.com,
	maarten.lankhorst@linux.intel.com,
	miguel.ojeda.sandonis@gmail.com, mripard@kernel.org,
	pekka.paalanen@collabora.com, simona@ffwll.ch,
	penguin-kernel@I-love.SAKURA.ne.jp, tytso@mit.edu,
	tzimmermann@suse.de, ville.syrjala@linux.intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats()
Date: Thu, 30 Jul 2026 12:14:31 +0300	[thread overview]
Message-ID: <b2628133dfe020b9e3c74af27a3cfa2525f66223@intel.com> (raw)
In-Reply-To: <20260729214505.185776-2-leandro.ribeiro@collabora.com>

On Wed, 29 Jul 2026, Leandro Ribeiro <leandro.ribeiro@collabora.com> wrote:
> 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.

I should've chimed in way back when, but in retrospect it's a bit
presumptuous to add a commit that puts the burden of the change on the
driver developers, without so much as identifying which drivers or
getting an ack from them.

This is really not unlike the __deprecated attribute, see commit
771c035372a0 ("deprecate the '__deprecated' attribute warnings entirely
and for good"), but this one's runtime not build.

> 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..3d9c554e08a8 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",
> +				 plane->base.id, plane->name);
>  			break;
>  		}
>  	}

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2026-07-30  9:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 21:45 [PATCH 0/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats() Leandro Ribeiro
2026-07-29 21:45 ` [PATCH 1/1] " Leandro Ribeiro
2026-07-29 21:55   ` sashiko-bot
2026-07-29 22:13   ` Tetsuo Handa
2026-07-30 18:54     ` Leandro Ribeiro
2026-07-30 23:14       ` Tetsuo Handa
2026-07-30 23:18         ` Leandro Ribeiro
2026-07-30  9:14   ` Jani Nikula [this message]
2026-07-30 18:46     ` Leandro Ribeiro

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=b2628133dfe020b9e3c74af27a3cfa2525f66223@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=broonie@kernel.org \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=leandro.ribeiro@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mripard@kernel.org \
    --cc=pekka.paalanen@collabora.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=simona@ffwll.ch \
    --cc=tytso@mit.edu \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.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 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.