From: Leandro Ribeiro <leandro.ribeiro@collabora.com>
To: oushixiong1025@163.com, Louis Chauvet <louis.chauvet@bootlin.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Melissa Wen <melissa.srw@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Shixiong Ou <oushixiong@kylinos.cn>, Ye Liu <liuye@kylinos.cn>
Subject: Re: [PATCH] drm/vkms: Add pixel blend mode property
Date: Tue, 8 Sep 2026 19:18:29 -0300 [thread overview]
Message-ID: <44c5ceae-4824-4b45-878c-1aac9e646116@collabora.com> (raw)
In-Reply-To: <20260828090257.788076-1-oushixiong1025@163.com>
On 8/28/26 6:02 AM, oushixiong1025@163.com wrote:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> The vkms planes expose formats with an alpha channel but do not
> create the pixel blend mode property. Since
> commit 860e748bddcc ("drm: ensure blend mode supported if pixel
> format with alpha exposed") this triggers a warning during
> drm_mode_config_validate():
>
> [ 993.538979] ------------[ cut here ]------------
> [ 993.539000] [PLANE:35:plane-0] pixel format with alpha exposed but blend mode not setup
> [ 993.539063] WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate
> ......
> [ 993.539578] Call trace:
> [ 993.539580] drm_mode_config_validate+0x398/0x558 [drm] (P)
> [ 993.539707] drm_dev_register+0x1cc/0x2a0 [drm]
> [ 993.539832] vkms_create+0x184/0x1d0 [vkms]
> [ 993.539854] vkms_init+0x78/0xff8 [vkms]
> ......
>
> The vkms composer only blends premultiplied alpha, see
> pre_mul_alpha_blend(), so create the property with
> DRM_MODE_BLEND_PREMULTI as the only supported mode.
>
> Reported-by: Ye Liu <liuye@kylinos.cn>
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
> ---
> drivers/gpu/drm/vkms/vkms_plane.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index 6ee5c3f3207c..c4272f5f0354 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -276,6 +276,7 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
> {
> struct drm_device *dev = &vkmsdev->drm;
> struct vkms_plane *plane;
> + int ret;
>
> plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 0,
> &vkms_plane_funcs,
> @@ -287,6 +288,15 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
>
> drm_plane_helper_add(&plane->base, &vkms_plane_helper_funcs);
>
> + /*
> + * The vkms composer only blends premultiplied alpha, see
> + * pre_mul_alpha_blend(), so that is the only supported mode.
> + */
> + ret = drm_plane_create_blend_mode_property(&plane->base,
> + BIT(DRM_MODE_BLEND_PREMULTI));
> + if (ret)
> + return ERR_PTR(ret);
> +
Hello,
This looks good to me! But I think the comment in pre_mul_alpha_blend()
could also be updated. It states:
"The current DRM assumption is that pixel color values have been already
pre-multiplied with the alpha channel values"
Which is not true anymore.
With this change:
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0,
> DRM_MODE_ROTATE_MASK | DRM_MODE_REFLECT_MASK);
>
--
Leandro Ribeiro
prev parent reply other threads:[~2026-09-08 22:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 9:02 oushixiong1025
2026-09-08 22:18 ` Leandro Ribeiro [this message]
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=44c5ceae-4824-4b45-878c-1aac9e646116@collabora.com \
--to=leandro.ribeiro@collabora.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liuye@kylinos.cn \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=melissa.srw@gmail.com \
--cc=mripard@kernel.org \
--cc=oushixiong1025@163.com \
--cc=oushixiong@kylinos.cn \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®