* Re: [PATCH V3] drm/loongson: Create blend mode property for cursor plane
2026-09-03 8:42 [PATCH V3] drm/loongson: Create blend mode property for cursor plane Huacai Chen
@ 2026-09-03 8:56 ` sashiko-bot
2026-09-03 9:01 ` Icenowy Zheng
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-09-03 8:56 UTC (permalink / raw)
To: Huacai Chen; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] State mismatch between blend mode property and atomic state initialization rejects atomic commits.
--
commit e4c1ccbb76c983c05930b35bbb7291c8273016d7
Author: Huacai Chen <chenhuacai@kernel.org>
drm/loongson: Create blend mode property for cursor plane
This commit adds a blend mode property for cursor planes, exposing only
the DRM_MODE_BLEND_COVERAGE mode since the hardware does not support
DRM_MODE_BLEND_PREMULTI.
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bea42215796d4..bcc0ffa17bdf2 100644
> --- a/drivers/gpu/drm/loongson/lsdc_plane.c
> +++ b/drivers/gpu/drm/loongson/lsdc_plane.c
[ ... ]
> @@ -765,7 +766,7 @@ 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, BIT(DRM_MODE_BLEND_COVERAGE));
> }
[Severity: High]
Will this cause atomic commits to fail during modesetting?
This adds a blend mode property supporting only COVERAGE, but the driver's
plane functions use the default reset hook:
drivers/gpu/drm/loongson/lsdc_plane.c:lsdc_plane_funcs {
...
.reset = drm_atomic_helper_plane_reset,
...
}
The default drm_atomic_helper_plane_reset() unconditionally initializes
the plane state to PREMULTI.
Because PREMULTI is not registered as a supported enum value in the plane's
blend mode property mask, when compositors query the current properties and
submit them back, validation fails in drm_property_change_valid_get()
returning -EINVAL.
Should the driver provide a custom reset hook that initializes the state to
DRM_MODE_BLEND_COVERAGE instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260903084212.3621540-1-chenhuacai@loongson.cn?part=1
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH V3] drm/loongson: Create blend mode property for cursor plane
2026-09-03 8:42 [PATCH V3] drm/loongson: Create blend mode property for cursor plane Huacai Chen
2026-09-03 8:56 ` sashiko-bot
@ 2026-09-03 9:01 ` Icenowy Zheng
2026-09-04 8:39 ` Jianmin Lv
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Icenowy Zheng @ 2026-09-03 9:01 UTC (permalink / raw)
To: Huacai Chen, David Airlie, Simona Vetter, Huacai Chen, Jianmin Lv,
Qianhai Wu, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Mingcong Bai, Xi Ruoyao
Cc: dri-devel
在 2026-09-03四的 16:42 +0800,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
> blend mode property with DRM_MODE_BLEND_COVERAGE for cursor planes
> since
> it is the only one implemented in the driver.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Reviewed-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Thanks,
Icenowy
> ---
> drivers/gpu/drm/loongson/lsdc_plane.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
> b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bea42215796d..bcc0ffa17bdf 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>
> @@ -765,7 +766,7 @@ 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,
> BIT(DRM_MODE_BLEND_COVERAGE));
> }
>
> int ls7a2000_cursor_plane_init(struct drm_device *ddev,
> @@ -790,5 +791,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,
> BIT(DRM_MODE_BLEND_COVERAGE));
> }
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH V3] drm/loongson: Create blend mode property for cursor plane
2026-09-03 8:42 [PATCH V3] drm/loongson: Create blend mode property for cursor plane Huacai Chen
2026-09-03 8:56 ` sashiko-bot
2026-09-03 9:01 ` Icenowy Zheng
@ 2026-09-04 8:39 ` Jianmin Lv
2026-09-17 5:08 ` Icenowy Zheng
2026-09-17 7:16 ` Icenowy Zheng
4 siblings, 0 replies; 7+ messages in thread
From: Jianmin Lv @ 2026-09-04 8:39 UTC (permalink / raw)
To: Huacai Chen, David Airlie, Simona Vetter, Huacai Chen, Qianhai Wu,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Mingcong Bai,
Xi Ruoyao
Cc: Icenowy Zheng, dri-devel
On 2026/9/3 下午4:42, Huacai Chen wrote:
> 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
> blend mode property with DRM_MODE_BLEND_COVERAGE for cursor planes since
> it is the only one implemented in the driver.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
Reviewed-by: Jianmin Lv <lvjianmin@loongson.cn>
> drivers/gpu/drm/loongson/lsdc_plane.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bea42215796d..bcc0ffa17bdf 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>
> @@ -765,7 +766,7 @@ 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, BIT(DRM_MODE_BLEND_COVERAGE));
> }
>
> int ls7a2000_cursor_plane_init(struct drm_device *ddev,
> @@ -790,5 +791,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, BIT(DRM_MODE_BLEND_COVERAGE));
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH V3] drm/loongson: Create blend mode property for cursor plane
2026-09-03 8:42 [PATCH V3] drm/loongson: Create blend mode property for cursor plane Huacai Chen
` (2 preceding siblings ...)
2026-09-04 8:39 ` Jianmin Lv
@ 2026-09-17 5:08 ` Icenowy Zheng
2026-09-17 6:16 ` Thomas Zimmermann
2026-09-17 7:16 ` Icenowy Zheng
4 siblings, 1 reply; 7+ messages in thread
From: Icenowy Zheng @ 2026-09-17 5:08 UTC (permalink / raw)
To: Huacai Chen, David Airlie, Simona Vetter, Huacai Chen, Jianmin Lv,
Qianhai Wu, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Mingcong Bai, Xi Ruoyao
Cc: dri-devel
在 2026-09-03四的 16:42 +0800,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
> blend mode property with DRM_MODE_BLEND_COVERAGE for cursor planes
> since
> it is the only one implemented in the driver.
It looks like this patch is hanging here for weeks. Should I apply it
to drm-misc-fixes?
Thanks,
Icenowy
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
> drivers/gpu/drm/loongson/lsdc_plane.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
> b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bea42215796d..bcc0ffa17bdf 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>
> @@ -765,7 +766,7 @@ 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,
> BIT(DRM_MODE_BLEND_COVERAGE));
> }
>
> int ls7a2000_cursor_plane_init(struct drm_device *ddev,
> @@ -790,5 +791,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,
> BIT(DRM_MODE_BLEND_COVERAGE));
> }
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH V3] drm/loongson: Create blend mode property for cursor plane
2026-09-17 5:08 ` Icenowy Zheng
@ 2026-09-17 6:16 ` Thomas Zimmermann
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Zimmermann @ 2026-09-17 6:16 UTC (permalink / raw)
To: Icenowy Zheng, Huacai Chen, David Airlie, Simona Vetter,
Huacai Chen, Jianmin Lv, Qianhai Wu, Maarten Lankhorst,
Maxime Ripard, Mingcong Bai, Xi Ruoyao
Cc: dri-devel
Am 17.09.26 um 07:08 schrieb Icenowy Zheng:
> 在 2026-09-03四的 16:42 +0800,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
>> blend mode property with DRM_MODE_BLEND_COVERAGE for cursor planes
>> since
>> it is the only one implemented in the driver.
> It looks like this patch is hanging here for weeks. Should I apply it
> to drm-misc-fixes?
Go ahead
>
> Thanks,
> Icenowy
>
>> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
>> ---
>> drivers/gpu/drm/loongson/lsdc_plane.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
>> b/drivers/gpu/drm/loongson/lsdc_plane.c
>> index bea42215796d..bcc0ffa17bdf 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>
>> @@ -765,7 +766,7 @@ 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,
>> BIT(DRM_MODE_BLEND_COVERAGE));
>> }
>>
>> int ls7a2000_cursor_plane_init(struct drm_device *ddev,
>> @@ -790,5 +791,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,
>> BIT(DRM_MODE_BLEND_COVERAGE));
>> }
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V3] drm/loongson: Create blend mode property for cursor plane
2026-09-03 8:42 [PATCH V3] drm/loongson: Create blend mode property for cursor plane Huacai Chen
` (3 preceding siblings ...)
2026-09-17 5:08 ` Icenowy Zheng
@ 2026-09-17 7:16 ` Icenowy Zheng
4 siblings, 0 replies; 7+ messages in thread
From: Icenowy Zheng @ 2026-09-17 7:16 UTC (permalink / raw)
To: Huacai Chen, David Airlie, Simona Vetter, Huacai Chen, Jianmin Lv,
Qianhai Wu, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Mingcong Bai, Xi Ruoyao
Cc: dri-devel
在 2026-09-03四的 16:42 +0800,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
> blend mode property with DRM_MODE_BLEND_COVERAGE for cursor planes
> since
> it is the only one implemented in the driver.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Applied to drm-misc-fixes.
Thanks,
Icenowy
> ---
> drivers/gpu/drm/loongson/lsdc_plane.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c
> b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bea42215796d..bcc0ffa17bdf 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>
> @@ -765,7 +766,7 @@ 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,
> BIT(DRM_MODE_BLEND_COVERAGE));
> }
>
> int ls7a2000_cursor_plane_init(struct drm_device *ddev,
> @@ -790,5 +791,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,
> BIT(DRM_MODE_BLEND_COVERAGE));
> }
^ permalink raw reply [flat|nested] 7+ messages in thread