dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Johan Jonker" <jbx6244@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm: rockchip: add drm_plane_create_blend_mode_property
Date: Wed, 09 Sep 2026 21:29:54 +0000	[thread overview]
Message-ID: <20260909212954.F14F31F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260909-blend-v2-1-37e27af4faee@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The patch advertises DRM_MODE_BLEND_PIXEL_NONE as the only supported blend mode for all planes. However, the driver internally hardcodes pre-multiplied alpha blending for overlay planes, contradicting the advertised property and causing performance regressions in compositors.
--

commit 7635dc169cfab0b1a798ba56a1baaa9f77713842
Author: Johan Jonker <jbx6244@gmail.com>

drm: rockchip: add drm_plane_create_blend_mode_property

A validate_blend_mode_for_alpha_formats() function was added that
fills the kernel log with warnings for Rockchip VOP version 1 SoCs.
Add a drm_plane_create_blend_mode_property() function as fix.
VOP version 1 doesn't support blending with a pixel alpha background
layer, only with a constant alpha. Advertise blending capability with
DRM_MODE_BLEND_PIXEL_NONE.

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 0090d8ff0c79e..0bc5b606f0213 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1850,6 +1850,8 @@ static void vop_plane_add_properties(struct drm_plane *plane,
>  	if (flags)
>  		drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
>  						   DRM_MODE_ROTATE_0 | flags);
> +	drm_plane_create_blend_mode_property(plane,
> +					     BIT(DRM_MODE_BLEND_PIXEL_NONE));

[Severity: High]
Does advertising only DRM_MODE_BLEND_PIXEL_NONE here cause a performance
regression for userspace compositors?

When compositors query this property and see only DRM_MODE_BLEND_PIXEL_NONE
is supported, they may assume the hardware cannot perform alpha blending at
all and fall back to software or GPU composition for translucent layers like
cursors and ARGB windows.

Also, does this contradict the blending mode currently programmed in the driver?
Looking at vop_plane_atomic_update(), the driver explicitly programs
pre-multiplied alpha blending for overlay planes if the format has alpha:

drivers/gpu/drm/rockchip/rockchip_drm_vop.c:vop_plane_atomic_update() {
    ...
    if (fb->format->has_alpha && win_index > 0) {
        ...
        val = SRC_ALPHA_EN(1) | SRC_COLOR_M0(ALPHA_SRC_PRE_MUL) |
              ...
        ...
        VOP_WIN_SET(vop, win, alpha_pre_mul, ALPHA_SRC_PRE_MUL);
        ...
    }
}

Since the driver hardcodes pre-multiplied alpha for these planes, does this
violate the advertised API contract of only supporting
DRM_MODE_BLEND_PIXEL_NONE?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260909-blend-v2-1-37e27af4faee@gmail.com?part=1

      reply	other threads:[~2026-09-09 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 21:20 [PATCH v2] drm: rockchip: add drm_plane_create_blend_mode_property Johan Jonker via B4 Relay
2026-09-09 21:29 ` sashiko-bot [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=20260909212954.F14F31F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jbx6244@gmail.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