dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qinyun Tan" <qinyuntan@linux.alibaba.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 4/4] drm/vboxvideo: create blend mode property on planes
Date: Tue, 01 Sep 2026 08:46:08 +0000	[thread overview]
Message-ID: <20260901084609.211F41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901083234.1828755-5-qinyuntan@linux.alibaba.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The plane's pixel_blend_mode atomic state defaults to DRM_MODE_BLEND_PREMULTI, but the driver only exposes DRM_MODE_BLEND_COVERAGE, resulting in an invalid initial atomic state that causes atomic commits to fail.
--

commit e1e7e08f37513293cd7928eb76a6d3c06de1c985
Author: Qinyun Tan <qinyuntan@linux.alibaba.com>

drm/vboxvideo: create blend mode property on planes

This commit exposes a "pixel blend mode" property advertising only
DRM_MODE_BLEND_COVERAGE for vboxvideo primary and cursor planes to match
host compositing semantics and silence a DRM core warning.

> diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c
> index 8e4e5fc9d3c5a..3c41238a82685 100644
> --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
> +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
[ ... ]
> @@ -540,6 +541,9 @@ static struct drm_plane *vbox_create_plane(struct vbox_private *vbox,
>  
>  	drm_plane_helper_add(plane, helper_funcs);
>  
> +	drm_plane_create_blend_mode_property(plane,
> +					     BIT(DRM_MODE_BLEND_COVERAGE));
> +

[Severity: High]
Will this cause atomic commits to fail with -EINVAL due to an invalid
initial atomic state?

The blend mode property is restricted here to allow only
DRM_MODE_BLEND_COVERAGE. However, the primary plane uses
drm_atomic_helper_plane_reset() and the cursor plane uses
DRM_GEM_SHADOW_PLANE_FUNCS (which provides drm_gem_reset_shadow_plane()).

Both of these default reset hooks rely on
__drm_atomic_helper_plane_state_reset(), which unconditionally hardcodes
the initial state to PREMULTI:

__drm_atomic_helper_plane_state_reset() {
    ...
    state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI;
    ...
}

Since the driver does not provide a custom reset hook to override this
default and explicitly set plane_state->pixel_blend_mode to
DRM_MODE_BLEND_COVERAGE, does this leave the initial atomic state set to a
mode (PREMULTI) that isn't supported by the property? 

If generic compositors read this initial state and pass it back during
commits, will the DRM core's validation reject it because the property
only exposes COVERAGE?

>  	return plane;
>  
>  free_plane:

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901083234.1828755-1-qinyuntan@linux.alibaba.com?part=4

  reply	other threads:[~2026-09-01  8:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  8:32 [PATCH v2 0/4] drm: create blend mode property on alpha-capable planes of simple drivers Qinyun Tan
2026-09-01  8:32 ` [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane Qinyun Tan
2026-09-01  8:46   ` sashiko-bot
2026-09-01 11:54   ` Thomas Zimmermann
2026-09-01 12:30     ` Thomas Zimmermann
2026-09-01 12:51       ` Qinyun Tan
2026-09-03  7:05         ` Thomas Zimmermann
2026-09-04  5:31           ` Qinyun Tan
2026-09-03  7:01   ` Thomas Zimmermann
2026-09-01  8:32 ` [PATCH v2 2/4] drm/qxl: create blend mode property on primary and cursor planes Qinyun Tan
2026-09-01 11:45   ` Thomas Zimmermann
2026-09-01  8:32 ` [PATCH v2 3/4] drm/virtio: create blend mode property on cursor plane Qinyun Tan
2026-09-01 11:46   ` Thomas Zimmermann
2026-09-01  8:32 ` [PATCH v2 4/4] drm/vboxvideo: create blend mode property on planes Qinyun Tan
2026-09-01  8:46   ` sashiko-bot [this message]
2026-09-03  7:00   ` Thomas Zimmermann

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=20260901084609.211F41F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=qinyuntan@linux.alibaba.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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