Re: [PATCH v4 2/2] drm: ensure blend mode supported if pixel format with alpha exposed

Geert Uytterhoeven <[email protected]> Tue, 4 Aug 2026 11:07:54 +0200
Newsgroups org.kernel.vger.linux-tegra,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-renesas-soc
Message-ID <CAMuHMdXXbPUkyOy0R0s58ayBK0mFFjZa4BKMUBwsnwr-oCQ08Q@mail.gmail.com>
On Wed, 22 Jul 2026 at 14:08, Jon Hunter <[email protected]> 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 <[email protected]>
> >> ---
> >>   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
> >    [  +0.000019] WARNING: drivers/gpu/drm/drm_mode_config.c:873 at drm_mode_config_validate+0xa24/0xad0, CPU#0: kworker/0:2/507
> >    [  +0.000010] Modules linked in: ghash_ce gf128mul nvme ast(+) nvme_core sbsa_gwdt i2c_algo_bit nvme_keyring nvme_auth xgene_hwmon gpio_dwapb fuse scsi_dh_alua scsi_dh_rdac i2c_dev scsi_dh_emc
> >    [  +0.000014] CPU: 0 UID: 0 PID: 507 Comm: kworker/0:2 Not tainted 7.2.0-rc4-next-20260721-00002-g17fa9b81f4c4 #1 PREEMPT(lazy)
> >    [  +0.000003] Hardware name: To be filled by O.E.M Ampere Altra Developer Platform/Ampere Altra Developer Platform, BIOS TianoCore 2.10.100.02 (SYS: 2.10.20
> >    [  +0.000002] Workqueue: sync_wq local_pci_probe_callback
> >    [  +0.000004] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> >    [  +0.000003] pc : drm_mode_config_validate+0xa24/0xad0
> >    [  +0.000002] lr : drm_mode_config_validate+0xa24/0xad0
> >    [  +0.000002] sp : ffff800082df3c30
> >    [  +0.000001] x29: ffff800082df3c60 x28: ffffde7ac3633fc2 x27: 0000000000000001
> >    [  +0.000004] x26: 0000000000000001 x25: 0000000000000002 x24: 0000000000000000
> >    [  +0.000003] x23: ffff07ffb54b0290 x22: ffff07ffb54b0be0 x21: ffffde7ac36ebb13
> >    [  +0.000003] x20: 0000000000000001 x19: ffff07ffb54b0000 x18: ffff800082dd5038
> >    [  +0.000003] x17: 00000000d949c370 x16: 00000000d949c370 x15: ffffde7ac358f156
> >    [  +0.000002] x14: 0000000000000386 x13: ffff081eeebf2850 x12: 0000000000000000
> >    [  +0.000003] x11: 0000000000000000 x10: ffffde7ac44b5850 x9 : 738b2a5f3c615c00
> >    [  +0.000003] x8 : 738b2a5f3c615c00 x7 : 0000000000000000 x6 : 206c65786970205d
> >    [  +0.000003] x5 : ffff081f6fcc917b x4 : ffffde7ac36ebb59 x3 : ffffffffffff0a00
> >    [  +0.000002] x2 : 0000000000000001 x1 : 0000000000000000 x0 : 000000000000004b
> >    [  +0.000003] Call trace:
> >    [  +0.000001]  drm_mode_config_validate+0xa24/0xad0 (P)
> >    [  +0.000003]  drm_dev_register+0x44/0x3d8
> >    [  +0.000004]  ast_pci_probe+0x330/0x354 [ast]
> >    [  +0.000016]  local_pci_probe_callback+0x68/0xc0
> >    [  +0.000002]  process_scheduled_works+0x23c/0x668
> >    [  +0.000003]  worker_thread+0x218/0x324
> >    [  +0.000003]  kthread+0x130/0x180
> >    [  +0.000002]  ret_from_fork+0x10/0x20
> >    [  +0.000004] ---[ end trace 0000000000000000 ]---
>
> I am also seeing the same warning on -next for Tegra194 based devices.
>
> > If there is any other information I can provide or patches I can test, I
> > am more than happy to do so.
>
> Same. Happy to provide any more information or test any other changes.

Same on R-Car Gen2 (R-Car DU without VSP).

I don't see the warning on R-Car Gen3 and Gen4, but I don't have
a display connecting to those boards (meh), and rcar_du_vsp.c does
call drm_plane_create_blend_mode_property() (yup ;-).

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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