All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] drm/loongson: Create blend mode property for cursor plane
@ 2026-09-02 13:21 Huacai Chen
  2026-09-02 13:32 ` sashiko-bot
  2026-09-02 15:29 ` Icenowy Zheng
  0 siblings, 2 replies; 5+ messages in thread
From: Huacai Chen @ 2026-09-02 13:21 UTC (permalink / raw)
  To: David Airlie, Simona Vetter, Huacai Chen, Jianmin Lv, Qianhai Wu,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Mingcong Bai,
	Xi Ruoyao
  Cc: Icenowy Zheng, dri-devel, Huacai Chen

After commit 860e748bddcc929 ("drm: ensure blend mode supported if pixel
format with alpha exposed") we get warnings at boot:

loongson 0000:00:06.1: [drm] [PLANE:41:ls-cursor-plane-0] pixel format with alpha exposed but blend mode not setup. Please fix.
loongson 0000:00:06.1: [drm] [PLANE:46:ls-cursor-plane-1] pixel format with alpha exposed but blend mode not setup. Please fix.

The reason is the cursor plane supports color formats with alpha but the
driver doesn't create blend mode property, which triggers the warning in
validate_blend_mode_for_alpha_formats().

The loongson DC HW doesn't support DRM_MODE_BLEND_PREMULTI, so create
a blend mode with "DRM_MODE_BLEND_PIXEL_NONE | DRM_MODE_BLEND_COVERAGE"
for cursor planes.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/gpu/drm/loongson/lsdc_plane.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
index bea42215796d..969b2aaa4fd0 100644
--- a/drivers/gpu/drm/loongson/lsdc_plane.c
+++ b/drivers/gpu/drm/loongson/lsdc_plane.c
@@ -7,6 +7,7 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_print.h>
@@ -747,8 +748,9 @@ int ls7a1000_cursor_plane_init(struct drm_device *ddev,
 			       struct drm_plane *plane,
 			       unsigned int index)
 {
-	struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
 	int ret;
+	unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_COVERAGE);
+	struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
 
 	ret = drm_universal_plane_init(ddev, plane, 1 << index,
 				       &lsdc_plane_funcs,
@@ -765,15 +767,16 @@ int ls7a1000_cursor_plane_init(struct drm_device *ddev,
 
 	drm_plane_helper_add(plane, &ls7a1000_cursor_plane_helper_funcs);
 
-	return 0;
+	return drm_plane_create_blend_mode_property(plane, blend_caps);
 }
 
 int ls7a2000_cursor_plane_init(struct drm_device *ddev,
 			       struct drm_plane *plane,
 			       unsigned int index)
 {
-	struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
 	int ret;
+	unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_COVERAGE);
+	struct lsdc_cursor *cursor = to_lsdc_cursor(plane);
 
 	ret = drm_universal_plane_init(ddev, plane, 1 << index,
 				       &lsdc_plane_funcs,
@@ -790,5 +793,5 @@ int ls7a2000_cursor_plane_init(struct drm_device *ddev,
 
 	drm_plane_helper_add(plane, &ls7a2000_cursor_plane_helper_funcs);
 
-	return 0;
+	return drm_plane_create_blend_mode_property(plane, blend_caps);
 }
-- 
2.52.0


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

end of thread, other threads:[~2026-09-03  6:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 13:21 [PATCH V2] drm/loongson: Create blend mode property for cursor plane Huacai Chen
2026-09-02 13:32 ` sashiko-bot
2026-09-02 15:29 ` Icenowy Zheng
2026-09-03  2:27   ` Jianmin Lv
2026-09-03  6:05     ` Huacai Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.