Re: [PATCH 1/1] drm: use drm_warn() in validate_blend_mode_for_alpha_formats()

From: Leandro Ribeiro

Date: Thu Jul 30 2026 - 15:11:57 EST




On 7/29/26 7:13 PM, Tetsuo Handa wrote:
> On 2026/07/30 6:45, Leandro Ribeiro 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.
>>
>> 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.
>
> Thank you. But could something like
>
> pr_warn("[PLANE:%d:%s] pixel format with alpha exposed but blend mode not setup. Please fix.", plane->base.id, plane->name);
> dump_stack();
>
> be less prone to get oversighted (because of printing about 10+ lines)?
>

I see the point about making the message harder to overlook, but
honestly I feel like the stack trace would be overkill here.

The error message is more important than the stack trace itself in this
case, and I think the warning should be enough to draw attention to the
issue.

--
Leandro Ribeiro