dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/verisilicon: set blend mode for the cursor plane
@ 2026-09-10  9:49 Icenowy Zheng
  2026-09-10 10:01 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Icenowy Zheng @ 2026-09-10  9:49 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
  Cc: David Airlie, Simona Vetter, dri-devel, linux-kernel,
	Icenowy Zheng, Icenowy Zheng

Blend mode properties are now required to expose pixel formats w/ alpha.

Experiments show that the fixed blending mode for the cursor seems to be
COVERAGE:

- With a cursor plane filled with R=G=0, B=0xff, A=0x40, the cursor is
  visible on a pure-white background, which means the background is
  multiplied.
- With a cursor plane filled with R=G=B=0xff, A=0x40, the cursor isn't
  pure white and non-white patterns can be see through, which means the
  cursor is multiplied.

Add a fixed COVERAGE blend mode property for the cursor plane.

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/verisilicon/vs_cursor_plane.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/verisilicon/vs_cursor_plane.c b/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
index fa4f601dd0c87..da456dced88aa 100644
--- a/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
+++ b/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
@@ -11,6 +11,7 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -267,6 +268,7 @@ struct drm_plane *vs_cursor_plane_init(struct drm_device *drm_dev,
 		return plane;
 
 	drm_plane_helper_add(plane, &vs_cursor_plane_helper_funcs);
+	drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_COVERAGE));
 
 	return plane;
 }
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drm/verisilicon: set blend mode for the cursor plane
  2026-09-10  9:49 [PATCH v2] drm/verisilicon: set blend mode for the cursor plane Icenowy Zheng
@ 2026-09-10 10:01 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-10 10:01 UTC (permalink / raw)
  To: Icenowy Zheng; +Cc: dri-devel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Unchecked return value from drm_plane_create_blend_mode_property() may silently violate alpha format requirements and cause DRM core warnings.
--

commit d27ea97d91c1dff2b3f030af5cf9f066321653e6
Author: Icenowy Zheng <zhengxingda@iscas.ac.cn>

drm/verisilicon: set blend mode for the cursor plane

This commit adds a fixed COVERAGE blend mode property to the cursor plane.
This is required because blend mode properties must be exposed for pixel
formats with alpha.

> diff --git a/drivers/gpu/drm/verisilicon/vs_cursor_plane.c b/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
> index fa4f601dd0c87..da456dced88aa 100644
> --- a/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
> +++ b/drivers/gpu/drm/verisilicon/vs_cursor_plane.c

[ ... ]

> @@ -267,6 +268,7 @@ struct drm_plane *vs_cursor_plane_init(struct drm_device *drm_dev,
>  		return plane;
>  
>  	drm_plane_helper_add(plane, &vs_cursor_plane_helper_funcs);
> +	drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_COVERAGE));

[Severity: Low]
Should the return value of drm_plane_create_blend_mode_property() be checked
here?

If drm_plane_create_blend_mode_property() fails (for example, due to an
ENOMEM in drm_property_create()), the cursor plane is initialized without the
intended blend mode property.

Does this leave the plane in an incomplete state where the DRM core will emit
a warning during validation, since the pixel format exposes alpha but the
blend mode is not fully set up?

>  
>  	return plane;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260910094904.3502741-1-zhengxingda@iscas.ac.cn?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-10 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10  9:49 [PATCH v2] drm/verisilicon: set blend mode for the cursor plane Icenowy Zheng
2026-09-10 10:01 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox