mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Leandro Ribeiro <leandro.ribeiro@collabora.com>,
	Dave Airlie <airlied@redhat.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Jocelyn Falempe <jfalempe@redhat.com>
Cc: dri-devel@lists.freedesktop.org, airlied@gmail.com,
	daniels@collabora.com, jani.nikula@linux.intel.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	pekka.paalanen@collabora.com, simona@ffwll.ch,
	ville.syrjala@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] drm: ensure blend mode supported if pixel format with alpha exposed
Date: Tue, 21 Jul 2026 16:48:02 -0700	[thread overview]
Message-ID: <20260721234802.GA439272@ax162> (raw)
In-Reply-To: <20260526181700.25310-3-leandro.ribeiro@collabora.com>

Hi Leandro,

+ ast folks

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@collabora.com>
> ---
>  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 ]---

If there is any other information I can provide or patches I can test, I
am more than happy to do so.

-- 
Cheers,
Nathan

  reply	other threads:[~2026-07-21 23:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 18:16 [PATCH v4 0/2] drm/drm_blend: allow blend mode property without PREMULTI Leandro Ribeiro
2026-05-26 18:16 ` [PATCH v4 1/2] " Leandro Ribeiro
2026-05-26 18:17 ` [PATCH v4 2/2] drm: ensure blend mode supported if pixel format with alpha exposed Leandro Ribeiro
2026-07-21 23:48   ` Nathan Chancellor [this message]
2026-07-22 12:05     ` Jon Hunter
2026-08-04  9:07       ` Geert Uytterhoeven
2026-08-04 12:49         ` Geert Uytterhoeven
2026-06-16 10:16 ` [PATCH v4 0/2] drm/drm_blend: allow blend mode property without PREMULTI Pekka Paalanen
2026-07-14 18:21 ` Daniel Stone

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=20260721234802.GA439272@ax162 \
    --to=nathan@kernel.org \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jfalempe@redhat.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=pekka.paalanen@collabora.com \
    --cc=simona@ffwll.ch \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome