Re: [PATCH v4 2/2] drm: ensure blend mode supported if pixel format with alpha exposed
From: Geert Uytterhoeven
Date: Tue Aug 04 2026 - 09:04:14 EST
On Tue, 4 Aug 2026 at 11:07, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> On Wed, 22 Jul 2026 at 14:08, Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
> > On 22/07/2026 00:48, Nathan Chancellor wrote:
> > > On Tue, May 26, 2026 at 03:17:00PM -0300, Leandro Ribeiro wrote:
> > >> Before "drm/drm_blend: allow blend mode property without PREMULTI",
> > >> userspace would have to assume that only PREMULTI was supported by
> > >> drivers that didn't expose the blend mode property. But now userspace
> > >> shouldn't rely on that, as they can't count with drivers always
> > >> supporting PREMULTI.
> > >>
> > >> Warn if a driver exposes pixel formats with alpha but doesn't expose the
> > >> blend mode property. This way userspace doesn't have to guess. Drivers
> > >> triggering this warning must be fixed.
> > >>
> > >> Signed-off-by: Leandro Ribeiro <leandro.ribeiro@xxxxxxxxxxxxx>
> > >> ---
> > >> drivers/gpu/drm/drm_mode_config.c | 21 +++++++++++++++++++++
> > >> 1 file changed, 21 insertions(+)
> > >>
> > >> diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> > >> index 66f7dc37b597..8cca1dea3b3d 100644
> > >> --- a/drivers/gpu/drm/drm_mode_config.c
> > >> +++ b/drivers/gpu/drm/drm_mode_config.c
> > >> @@ -674,6 +674,25 @@ static void validate_encoder_possible_crtcs(struct drm_encoder *encoder)
> > >> encoder->possible_crtcs, crtc_mask);
> > >> }
> > >>
> > >> +static void validate_blend_mode_for_alpha_formats(struct drm_plane *plane)
> > >> +{
> > >> + const struct drm_format_info *fmt;
> > >> + u32 i;
> > >> +
> > >> + /* blend mode property supported, no need to check anything */
> > >> + if (plane->blend_mode_property)
> > >> + return;
> > >> +
> > >> + 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);
> > >
> > > I am seeing this warning trigger on a few of my machines in -next. A
> > > couple of those use amdgpu, which I see has already been reported in a
> > > separate thread. Another one uses ast, which I do not see reported
> > > (apologies if I missed it).
> > >
> > > [ +0.000137] ------------[ cut here ]------------
> > > [ +0.000004] [PLANE:37:plane-1] pixel format with alpha exposed but blend mode not setup
> Same on R-Car Gen2 (R-Car DU without VSP).
And on R-Mobile A1 (shmob_drm).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds