* [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
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 ` Qinyun Tan
2026-09-01 8:46 ` sashiko-bot
` (2 more replies)
2026-09-01 8:32 ` [PATCH v2 2/4] drm/qxl: create blend mode property on primary and cursor planes Qinyun Tan
` (2 subsequent siblings)
3 siblings, 3 replies; 16+ messages in thread
From: Qinyun Tan @ 2026-09-01 8:32 UTC (permalink / raw)
To: dri-devel
Cc: tzimmermann, airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel,
Qinyun Tan
Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
format with alpha exposed"), drm_mode_config_validate() warns when a
plane exposes an alpha pixel format but not the "pixel blend mode"
property. The ast cursor plane (ARGB4444, ARGB8888) trips this on
driver load:
[PLANE:37:plane-1] pixel format with alpha exposed but blend mode not setup
WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate+0x48f/0x510 [drm]
...
Call Trace:
drm_dev_register+0x1ce/0x290 [drm]
ast_pci_probe+0x19d/0x3f0 [ast]
local_pci_probe+0x41/0x90
Per Thomas Zimmermann's review, the ASPEED documentation describes the
hardware cursor as blending with straight (non-pre-multiplied) alpha,
which corresponds to DRM_MODE_BLEND_COVERAGE. Expose a "pixel blend
mode" property advertising only DRM_MODE_BLEND_COVERAGE to make the
hardware semantics explicit and silence the warning.
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
---
v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI, per Thomas
Zimmermann's review and the ASPEED documentation.
drivers/gpu/drm/ast/ast_cursor.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
index fd19c45f2abe2..690d4cd1db5ee 100644
--- a/drivers/gpu/drm/ast/ast_cursor.c
+++ b/drivers/gpu/drm/ast/ast_cursor.c
@@ -25,6 +25,7 @@
#include <linux/sizes.h>
#include <drm/drm_atomic.h>
+#include <drm/drm_blend.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_format_helper.h>
#include <drm/drm_gem_atomic_helper.h>
@@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
}
drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
drm_plane_enable_fb_damage_clips(cursor_plane);
+ drm_plane_create_blend_mode_property(cursor_plane,
+ BIT(DRM_MODE_BLEND_COVERAGE));
return 0;
}
--
2.43.7
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
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-03 7:01 ` Thomas Zimmermann
2 siblings, 0 replies; 16+ messages in thread
From: sashiko-bot @ 2026-09-01 8:46 UTC (permalink / raw)
To: Qinyun Tan; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The cursor plane's initial atomic state for the blend mode property is set to an unsupported value (`DRM_MODE_BLEND_PREMULTI`), which breaks atomic state restoration.
--
commit 1ab10188d3825ff30d7b2814879afdf8a8dc65e6
Author: Qinyun Tan <qinyuntan@linux.alibaba.com>
Subject: drm/ast: create blend mode property on cursor plane
This patch adds a blend mode property to the ast cursor plane to satisfy the
drm_mode_config_validate() warning about missing blend modes on planes
exposing an alpha pixel format. The newly created property only advertises
DRM_MODE_BLEND_COVERAGE.
> diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
> index fd19c45f2abe2..690d4cd1db5ee 100644
> --- a/drivers/gpu/drm/ast/ast_cursor.c
> +++ b/drivers/gpu/drm/ast/ast_cursor.c
[ ... ]
> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
> }
> drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
> drm_plane_enable_fb_damage_clips(cursor_plane);
> + drm_plane_create_blend_mode_property(cursor_plane,
> + BIT(DRM_MODE_BLEND_COVERAGE));
[Severity: High]
Does this mismatch with the default reset hook and break atomic state
restoration?
The cursor plane uses DRM_GEM_SHADOW_PLANE_FUNCS in ast_cursor_plane_funcs,
which defaults to drm_gem_reset_shadow_plane(). That function calls the
core DRM helper __drm_atomic_helper_plane_state_init(), which hardcodes
plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI. The driver does
not provide a custom .reset hook to override this default.
Since the blend mode property is created here to strictly support only
DRM_MODE_BLEND_COVERAGE, it doesn't support the DRM_MODE_BLEND_PREMULTI
value assigned by the default reset hook.
Because of this mismatch, userspace state queries will return an invalid
enum value that is not in the property's valid enum mask. If a compositor
attempts to save and restore this exact state using the atomic ioctl,
drm_property_change_valid_get() will reject it with -EINVAL. This could
break compositor initialization, virtual terminal switching, and
read-modify-write atomic commits on the cursor plane.
Could we add a custom reset hook to initialize the blend mode to
DRM_MODE_BLEND_COVERAGE, or include DRM_MODE_BLEND_PREMULTI in the
property's valid enum mask?
>
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260901083234.1828755-1-qinyuntan@linux.alibaba.com?part=1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
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-03 7:01 ` Thomas Zimmermann
2 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-01 11:54 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Hi,
thanks for the updated patch.
Did you see the review from the Sashiko bot? The default value is
PRE_MULTI, but the driver only supports COVERAGE. This needs to be
changed as part of this patch. The default assignment is at [1] in
__drm_atomic_helper_plane_state_init().
The ast driver needs to override drm_plane_funcs.atomic_create_state for
the cursor plane to update the value pixel_blend to COVERAGE for new
plane states. Same goes for vbox.
[1]
https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/drm_atomic_state_helper.c?ref_type=heads#L281
Best regards
Thomas
Am 01.09.26 um 10:32 schrieb Qinyun Tan:
> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
> format with alpha exposed"), drm_mode_config_validate() warns when a
> plane exposes an alpha pixel format but not the "pixel blend mode"
> property. The ast cursor plane (ARGB4444, ARGB8888) trips this on
> driver load:
>
> [PLANE:37:plane-1] pixel format with alpha exposed but blend mode not setup
> WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate+0x48f/0x510 [drm]
> ...
> Call Trace:
> drm_dev_register+0x1ce/0x290 [drm]
> ast_pci_probe+0x19d/0x3f0 [ast]
> local_pci_probe+0x41/0x90
>
> Per Thomas Zimmermann's review, the ASPEED documentation describes the
> hardware cursor as blending with straight (non-pre-multiplied) alpha,
> which corresponds to DRM_MODE_BLEND_COVERAGE. Expose a "pixel blend
> mode" property advertising only DRM_MODE_BLEND_COVERAGE to make the
> hardware semantics explicit and silence the warning.
>
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
> ---
> v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI, per Thomas
> Zimmermann's review and the ASPEED documentation.
>
> drivers/gpu/drm/ast/ast_cursor.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
> index fd19c45f2abe2..690d4cd1db5ee 100644
> --- a/drivers/gpu/drm/ast/ast_cursor.c
> +++ b/drivers/gpu/drm/ast/ast_cursor.c
> @@ -25,6 +25,7 @@
> #include <linux/sizes.h>
>
> #include <drm/drm_atomic.h>
> +#include <drm/drm_blend.h>
> #include <drm/drm_damage_helper.h>
> #include <drm/drm_format_helper.h>
> #include <drm/drm_gem_atomic_helper.h>
> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
> }
> drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
> drm_plane_enable_fb_damage_clips(cursor_plane);
> + drm_plane_create_blend_mode_property(cursor_plane,
> + BIT(DRM_MODE_BLEND_COVERAGE));
>
> return 0;
> }
--
--
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] 16+ messages in thread* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
2026-09-01 11:54 ` Thomas Zimmermann
@ 2026-09-01 12:30 ` Thomas Zimmermann
2026-09-01 12:51 ` Qinyun Tan
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-01 12:30 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Hi
Am 01.09.26 um 13:54 schrieb Thomas Zimmermann:
> Hi,
>
> thanks for the updated patch.
>
> Did you see the review from the Sashiko bot? The default value is
> PRE_MULTI, but the driver only supports COVERAGE. This needs to be
> changed as part of this patch. The default assignment is at [1] in
> __drm_atomic_helper_plane_state_init().
>
> The ast driver needs to override drm_plane_funcs.atomic_create_state
> for the cursor plane to update the value pixel_blend to COVERAGE for
> new plane states. Same goes for vbox.
Or even better: I just sent out a patch to pick the right default value
for the plane state. Let's first see what comes out of this. Patch is at
[1].
[1]
https://lore.kernel.org/dri-devel/20260901122731.83854-1-tzimmermann@suse.de/
Best regards
Thomas
>
> [1]
> https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/drm_atomic_state_helper.c?ref_type=heads#L281
>
> Best regards
> Thomas
>
>
> Am 01.09.26 um 10:32 schrieb Qinyun Tan:
>> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
>> format with alpha exposed"), drm_mode_config_validate() warns when a
>> plane exposes an alpha pixel format but not the "pixel blend mode"
>> property. The ast cursor plane (ARGB4444, ARGB8888) trips this on
>> driver load:
>>
>> [PLANE:37:plane-1] pixel format with alpha exposed but blend mode
>> not setup
>> WARNING: drivers/gpu/drm/drm_mode_config.c:872 at
>> drm_mode_config_validate+0x48f/0x510 [drm]
>> ...
>> Call Trace:
>> drm_dev_register+0x1ce/0x290 [drm]
>> ast_pci_probe+0x19d/0x3f0 [ast]
>> local_pci_probe+0x41/0x90
>>
>> Per Thomas Zimmermann's review, the ASPEED documentation describes the
>> hardware cursor as blending with straight (non-pre-multiplied) alpha,
>> which corresponds to DRM_MODE_BLEND_COVERAGE. Expose a "pixel blend
>> mode" property advertising only DRM_MODE_BLEND_COVERAGE to make the
>> hardware semantics explicit and silence the warning.
>>
>> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel
>> format with alpha exposed")
>> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
>> ---
>> v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI, per Thomas
>> Zimmermann's review and the ASPEED documentation.
>>
>> drivers/gpu/drm/ast/ast_cursor.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/ast/ast_cursor.c
>> b/drivers/gpu/drm/ast/ast_cursor.c
>> index fd19c45f2abe2..690d4cd1db5ee 100644
>> --- a/drivers/gpu/drm/ast/ast_cursor.c
>> +++ b/drivers/gpu/drm/ast/ast_cursor.c
>> @@ -25,6 +25,7 @@
>> #include <linux/sizes.h>
>> #include <drm/drm_atomic.h>
>> +#include <drm/drm_blend.h>
>> #include <drm/drm_damage_helper.h>
>> #include <drm/drm_format_helper.h>
>> #include <drm/drm_gem_atomic_helper.h>
>> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
>> }
>> drm_plane_helper_add(cursor_plane,
>> &ast_cursor_plane_helper_funcs);
>> drm_plane_enable_fb_damage_clips(cursor_plane);
>> + drm_plane_create_blend_mode_property(cursor_plane,
>> + BIT(DRM_MODE_BLEND_COVERAGE));
>> return 0;
>> }
>
--
--
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] 16+ messages in thread* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
2026-09-01 12:30 ` Thomas Zimmermann
@ 2026-09-01 12:51 ` Qinyun Tan
2026-09-03 7:05 ` Thomas Zimmermann
0 siblings, 1 reply; 16+ messages in thread
From: Qinyun Tan @ 2026-09-01 12:51 UTC (permalink / raw)
To: Thomas Zimmermann, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Hi Thomas,
On 9/1/26 8:30 PM, Thomas Zimmermann wrote:
> Hi
>
> Am 01.09.26 um 13:54 schrieb Thomas Zimmermann:
>> Hi,
>>
>> thanks for the updated patch.
>>
>> Did you see the review from the Sashiko bot? The default value is PRE_MULTI, but the driver only supports COVERAGE. This needs to be changed as part of this patch. The default assignment is at [1] in __drm_atomic_helper_plane_state_init().
>>
>> The ast driver needs to override drm_plane_funcs.atomic_create_state for the cursor plane to update the value pixel_blend to COVERAGE for new plane states. Same goes for vbox.
>
> Or even better: I just sent out a patch to pick the right default value for the plane state. Let's first see what comes out of this. Patch is at [1].
>
> [1] https://lore.kernel.org/dri-devel/20260901122731.83854-1-tzimmermann@suse.de/
>
> Best regards
> Thomas
>
Thanks! I did see the Sashiko bot report and had started on a v3 that
overrides drm_plane_funcs.atomic_create_state in ast and vboxvideo
(for vboxvideo on both the primary and cursor planes).
But your approach looks better to me: drm_plane_create_blend_mode_property()
already picks DRM_MODE_BLEND_COVERAGE as the property default when
PREMULTI is not supported, so initializing the plane state from the
property default fixes this for every COVERAGE-only plane without
per-driver boilerplate.
I'll hold off on v3 until your patch has settled.
Best regards,
Qinyun
>>
>> [1] https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/drm_atomic_state_helper.c?ref_type=heads#L281
>>
>> Best regards
>> Thomas
>>
>>
>> Am 01.09.26 um 10:32 schrieb Qinyun Tan:
>>> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
>>> format with alpha exposed"), drm_mode_config_validate() warns when a
>>> plane exposes an alpha pixel format but not the "pixel blend mode"
>>> property. The ast cursor plane (ARGB4444, ARGB8888) trips this on
>>> driver load:
>>>
>>> [PLANE:37:plane-1] pixel format with alpha exposed but blend mode not setup
>>> WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate+0x48f/0x510 [drm]
>>> ...
>>> Call Trace:
>>> drm_dev_register+0x1ce/0x290 [drm]
>>> ast_pci_probe+0x19d/0x3f0 [ast]
>>> local_pci_probe+0x41/0x90
>>>
>>> Per Thomas Zimmermann's review, the ASPEED documentation describes the
>>> hardware cursor as blending with straight (non-pre-multiplied) alpha,
>>> which corresponds to DRM_MODE_BLEND_COVERAGE. Expose a "pixel blend
>>> mode" property advertising only DRM_MODE_BLEND_COVERAGE to make the
>>> hardware semantics explicit and silence the warning.
>>>
>>> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
>>> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
>>> ---
>>> v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI, per Thomas
>>> Zimmermann's review and the ASPEED documentation.
>>>
>>> drivers/gpu/drm/ast/ast_cursor.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
>>> index fd19c45f2abe2..690d4cd1db5ee 100644
>>> --- a/drivers/gpu/drm/ast/ast_cursor.c
>>> +++ b/drivers/gpu/drm/ast/ast_cursor.c
>>> @@ -25,6 +25,7 @@
>>> #include <linux/sizes.h>
>>> #include <drm/drm_atomic.h>
>>> +#include <drm/drm_blend.h>
>>> #include <drm/drm_damage_helper.h>
>>> #include <drm/drm_format_helper.h>
>>> #include <drm/drm_gem_atomic_helper.h>
>>> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
>>> }
>>> drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
>>> drm_plane_enable_fb_damage_clips(cursor_plane);
>>> + drm_plane_create_blend_mode_property(cursor_plane,
>>> + BIT(DRM_MODE_BLEND_COVERAGE));
>>> return 0;
>>> }
>>
>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
2026-09-01 12:51 ` Qinyun Tan
@ 2026-09-03 7:05 ` Thomas Zimmermann
2026-09-04 5:31 ` Qinyun Tan
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-03 7:05 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Hi
Am 01.09.26 um 14:51 schrieb Qinyun Tan:
> Hi Thomas,
>
> On 9/1/26 8:30 PM, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 01.09.26 um 13:54 schrieb Thomas Zimmermann:
>>> Hi,
>>>
>>> thanks for the updated patch.
>>>
>>> Did you see the review from the Sashiko bot? The default value is PRE_MULTI, but the driver only supports COVERAGE. This needs to be changed as part of this patch. The default assignment is at [1] in __drm_atomic_helper_plane_state_init().
>>>
>>> The ast driver needs to override drm_plane_funcs.atomic_create_state for the cursor plane to update the value pixel_blend to COVERAGE for new plane states. Same goes for vbox.
>> Or even better: I just sent out a patch to pick the right default value for the plane state. Let's first see what comes out of this. Patch is at [1].
>>
>> [1] https://lore.kernel.org/dri-devel/20260901122731.83854-1-tzimmermann@suse.de/
>>
>> Best regards
>> Thomas
>>
>
> Thanks! I did see the Sashiko bot report and had started on a v3 that
> overrides drm_plane_funcs.atomic_create_state in ast and vboxvideo
> (for vboxvideo on both the primary and cursor planes).
>
> But your approach looks better to me: drm_plane_create_blend_mode_property()
> already picks DRM_MODE_BLEND_COVERAGE as the property default when
> PREMULTI is not supported, so initializing the plane state from the
> property default fixes this for every COVERAGE-only plane without
> per-driver boilerplate.
>
> I'll hold off on v3 until your patch has settled.
Another patch just landed that fixes the problem:
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/c3080b58d81d3699cbf4dfd5ba860630fca96f4a
So I acked the rest of your series and I'll merge it in a few days.
Thanks again for taking care of these drivers.
Best regards
Thomas
>
> Best regards,
> Qinyun
>
>
>>> [1] https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/drm_atomic_state_helper.c?ref_type=heads#L281
>>>
>>> Best regards
>>> Thomas
>>>
>>>
>>> Am 01.09.26 um 10:32 schrieb Qinyun Tan:
>>>> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
>>>> format with alpha exposed"), drm_mode_config_validate() warns when a
>>>> plane exposes an alpha pixel format but not the "pixel blend mode"
>>>> property. The ast cursor plane (ARGB4444, ARGB8888) trips this on
>>>> driver load:
>>>>
>>>> [PLANE:37:plane-1] pixel format with alpha exposed but blend mode not setup
>>>> WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate+0x48f/0x510 [drm]
>>>> ...
>>>> Call Trace:
>>>> drm_dev_register+0x1ce/0x290 [drm]
>>>> ast_pci_probe+0x19d/0x3f0 [ast]
>>>> local_pci_probe+0x41/0x90
>>>>
>>>> Per Thomas Zimmermann's review, the ASPEED documentation describes the
>>>> hardware cursor as blending with straight (non-pre-multiplied) alpha,
>>>> which corresponds to DRM_MODE_BLEND_COVERAGE. Expose a "pixel blend
>>>> mode" property advertising only DRM_MODE_BLEND_COVERAGE to make the
>>>> hardware semantics explicit and silence the warning.
>>>>
>>>> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
>>>> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
>>>> ---
>>>> v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI, per Thomas
>>>> Zimmermann's review and the ASPEED documentation.
>>>>
>>>> drivers/gpu/drm/ast/ast_cursor.c | 3 +++
>>>> 1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
>>>> index fd19c45f2abe2..690d4cd1db5ee 100644
>>>> --- a/drivers/gpu/drm/ast/ast_cursor.c
>>>> +++ b/drivers/gpu/drm/ast/ast_cursor.c
>>>> @@ -25,6 +25,7 @@
>>>> #include <linux/sizes.h>
>>>> #include <drm/drm_atomic.h>
>>>> +#include <drm/drm_blend.h>
>>>> #include <drm/drm_damage_helper.h>
>>>> #include <drm/drm_format_helper.h>
>>>> #include <drm/drm_gem_atomic_helper.h>
>>>> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
>>>> }
>>>> drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
>>>> drm_plane_enable_fb_damage_clips(cursor_plane);
>>>> + drm_plane_create_blend_mode_property(cursor_plane,
>>>> + BIT(DRM_MODE_BLEND_COVERAGE));
>>>> return 0;
>>>> }
--
--
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] 16+ messages in thread* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
2026-09-03 7:05 ` Thomas Zimmermann
@ 2026-09-04 5:31 ` Qinyun Tan
0 siblings, 0 replies; 16+ messages in thread
From: Qinyun Tan @ 2026-09-04 5:31 UTC (permalink / raw)
To: Thomas Zimmermann, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Hi,Thomas.
On 9/3/26 3:05 PM, Thomas Zimmermann wrote:
>
> Another patch just landed that fixes the problem:
>
> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/c3080b58d81d3699cbf4dfd5ba860630fca96f4a
>
> So I acked the rest of your series and I'll merge it in a few days. Thanks again for taking care of these drivers.
>
Great, that resolves the blend mode default concern.
Thanks for the reviews and for picking up the series! Glad I could
contribute a little to these drivers -- happy to help again next time
something comes up.
Best regards,
Qinyun
> Best regards
> Thomas
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/4] drm/ast: create blend mode property on cursor plane
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-03 7:01 ` Thomas Zimmermann
2 siblings, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-03 7:01 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Am 01.09.26 um 10:32 schrieb Qinyun Tan:
> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
> format with alpha exposed"), drm_mode_config_validate() warns when a
> plane exposes an alpha pixel format but not the "pixel blend mode"
> property. The ast cursor plane (ARGB4444, ARGB8888) trips this on
> driver load:
>
> [PLANE:37:plane-1] pixel format with alpha exposed but blend mode not setup
> WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate+0x48f/0x510 [drm]
> ...
> Call Trace:
> drm_dev_register+0x1ce/0x290 [drm]
> ast_pci_probe+0x19d/0x3f0 [ast]
> local_pci_probe+0x41/0x90
>
> Per Thomas Zimmermann's review, the ASPEED documentation describes the
> hardware cursor as blending with straight (non-pre-multiplied) alpha,
> which corresponds to DRM_MODE_BLEND_COVERAGE. Expose a "pixel blend
> mode" property advertising only DRM_MODE_BLEND_COVERAGE to make the
> hardware semantics explicit and silence the warning.
>
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI, per Thomas
> Zimmermann's review and the ASPEED documentation.
>
> drivers/gpu/drm/ast/ast_cursor.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/ast/ast_cursor.c b/drivers/gpu/drm/ast/ast_cursor.c
> index fd19c45f2abe2..690d4cd1db5ee 100644
> --- a/drivers/gpu/drm/ast/ast_cursor.c
> +++ b/drivers/gpu/drm/ast/ast_cursor.c
> @@ -25,6 +25,7 @@
> #include <linux/sizes.h>
>
> #include <drm/drm_atomic.h>
> +#include <drm/drm_blend.h>
> #include <drm/drm_damage_helper.h>
> #include <drm/drm_format_helper.h>
> #include <drm/drm_gem_atomic_helper.h>
> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
> }
> drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
> drm_plane_enable_fb_damage_clips(cursor_plane);
> + drm_plane_create_blend_mode_property(cursor_plane,
> + BIT(DRM_MODE_BLEND_COVERAGE));
>
> return 0;
> }
--
--
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] 16+ messages in thread
* [PATCH v2 2/4] drm/qxl: create blend mode property on primary and cursor planes
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:32 ` 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 8:32 ` [PATCH v2 4/4] drm/vboxvideo: create blend mode property on planes Qinyun Tan
3 siblings, 1 reply; 16+ messages in thread
From: Qinyun Tan @ 2026-09-01 8:32 UTC (permalink / raw)
To: dri-devel
Cc: tzimmermann, airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel,
Qinyun Tan
Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
format with alpha exposed"), drm_mode_config_validate() warns when a
plane exposes an alpha pixel format but not the "pixel blend mode"
property. Both the qxl primary and cursor planes expose ARGB8888 and
trip this on driver load.
qxl submits cursors as SPICE_CURSOR_TYPE_ALPHA, which the SPICE
protocol explicitly defines as a "pre-multiplied ARGB8888 pixmap"
(Spice Protocol, "Cursor channel definition" section [1]). This
matches the blend mode userspace has always assumed when the property
is not attached. Expose a "pixel blend mode" property advertising only
DRM_MODE_BLEND_PREMULTI to make these semantics explicit and silence
the warning. The primary plane is the bottom-most plane so its blend
mode has no visible effect; advertise the same value there for
consistency. No functional change.
[1] https://www.spice-space.org/spice-protocol.html
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
---
v2: no code change; cite the SPICE protocol definition of the ALPHA
cursor type in the commit message.
drivers/gpu/drm/qxl/qxl_display.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 7f4178800afd7..0cd1456cca347 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -30,6 +30,7 @@
#include <drm/drm_drv.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
#include <drm/drm_edid.h>
#include <drm/drm_encoder.h>
#include <drm/drm_framebuffer.h>
@@ -993,6 +994,9 @@ static struct drm_plane *qxl_create_plane(struct qxl_device *qdev,
drm_plane_helper_add(plane, helper_funcs);
+ drm_plane_create_blend_mode_property(plane,
+ BIT(DRM_MODE_BLEND_PREMULTI));
+
return plane;
free_plane:
--
2.43.7
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 2/4] drm/qxl: create blend mode property on primary and cursor planes
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
0 siblings, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-01 11:45 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Am 01.09.26 um 10:32 schrieb Qinyun Tan:
> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
> format with alpha exposed"), drm_mode_config_validate() warns when a
> plane exposes an alpha pixel format but not the "pixel blend mode"
> property. Both the qxl primary and cursor planes expose ARGB8888 and
> trip this on driver load.
>
> qxl submits cursors as SPICE_CURSOR_TYPE_ALPHA, which the SPICE
> protocol explicitly defines as a "pre-multiplied ARGB8888 pixmap"
> (Spice Protocol, "Cursor channel definition" section [1]). This
> matches the blend mode userspace has always assumed when the property
> is not attached. Expose a "pixel blend mode" property advertising only
> DRM_MODE_BLEND_PREMULTI to make these semantics explicit and silence
> the warning. The primary plane is the bottom-most plane so its blend
> mode has no visible effect; advertise the same value there for
> consistency. No functional change.
>
> [1] https://www.spice-space.org/spice-protocol.html
>
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> v2: no code change; cite the SPICE protocol definition of the ALPHA
> cursor type in the commit message.
>
> drivers/gpu/drm/qxl/qxl_display.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index 7f4178800afd7..0cd1456cca347 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -30,6 +30,7 @@
> #include <drm/drm_drv.h>
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_blend.h>
> #include <drm/drm_edid.h>
> #include <drm/drm_encoder.h>
> #include <drm/drm_framebuffer.h>
> @@ -993,6 +994,9 @@ static struct drm_plane *qxl_create_plane(struct qxl_device *qdev,
>
> drm_plane_helper_add(plane, helper_funcs);
>
> + drm_plane_create_blend_mode_property(plane,
> + BIT(DRM_MODE_BLEND_PREMULTI));
> +
> return plane;
>
> free_plane:
--
--
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] 16+ messages in thread
* [PATCH v2 3/4] drm/virtio: create blend mode property on cursor plane
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:32 ` [PATCH v2 2/4] drm/qxl: create blend mode property on primary and cursor planes Qinyun Tan
@ 2026-09-01 8:32 ` 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
3 siblings, 1 reply; 16+ messages in thread
From: Qinyun Tan @ 2026-09-01 8:32 UTC (permalink / raw)
To: dri-devel
Cc: tzimmermann, airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel,
Qinyun Tan
Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
format with alpha exposed"), drm_mode_config_validate() warns when a
plane exposes an alpha pixel format but not the "pixel blend mode"
property. The virtio-gpu cursor plane (HOST_ARGB8888) trips this.
The virtio-gpu specification does not define the cursor alpha
semantics. The host forwards the cursor pixels verbatim to its display
frontends, and the remote cursor protocols among them (SPICE alpha
cursors, the VNC "Cursor With Alpha" encoding) both define
pre-multiplied alpha, matching what userspace has always assumed when
the property is not attached. Expose a "pixel blend mode" property
advertising only DRM_MODE_BLEND_PREMULTI to make these semantics
explicit and silence the warning. The primary plane only exposes
HOST_XRGB8888, so the call is gated to the cursor. No functional
change.
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
---
v2: no code change; explain the protocol-level justification for
PREMULTI in the commit message.
drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 1d1b27ece62a7..640815af40980 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -24,6 +24,7 @@
*/
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_gem_atomic_helper.h>
@@ -609,6 +610,9 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
if (type == DRM_PLANE_TYPE_PRIMARY)
drm_plane_enable_fb_damage_clips(plane);
+ else if (type == DRM_PLANE_TYPE_CURSOR)
+ drm_plane_create_blend_mode_property(plane,
+ BIT(DRM_MODE_BLEND_PREMULTI));
return plane;
}
--
2.43.7
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 3/4] drm/virtio: create blend mode property on cursor plane
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
0 siblings, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-01 11:46 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Am 01.09.26 um 10:32 schrieb Qinyun Tan:
> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
> format with alpha exposed"), drm_mode_config_validate() warns when a
> plane exposes an alpha pixel format but not the "pixel blend mode"
> property. The virtio-gpu cursor plane (HOST_ARGB8888) trips this.
>
> The virtio-gpu specification does not define the cursor alpha
> semantics. The host forwards the cursor pixels verbatim to its display
> frontends, and the remote cursor protocols among them (SPICE alpha
> cursors, the VNC "Cursor With Alpha" encoding) both define
> pre-multiplied alpha, matching what userspace has always assumed when
> the property is not attached. Expose a "pixel blend mode" property
> advertising only DRM_MODE_BLEND_PREMULTI to make these semantics
> explicit and silence the warning. The primary plane only exposes
> HOST_XRGB8888, so the call is gated to the cursor. No functional
> change.
>
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> v2: no code change; explain the protocol-level justification for
> PREMULTI in the commit message.
>
> drivers/gpu/drm/virtio/virtgpu_plane.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
> index 1d1b27ece62a7..640815af40980 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_plane.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
> @@ -24,6 +24,7 @@
> */
>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_blend.h>
> #include <drm/drm_damage_helper.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_gem_atomic_helper.h>
> @@ -609,6 +610,9 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
>
> if (type == DRM_PLANE_TYPE_PRIMARY)
> drm_plane_enable_fb_damage_clips(plane);
> + else if (type == DRM_PLANE_TYPE_CURSOR)
> + drm_plane_create_blend_mode_property(plane,
> + BIT(DRM_MODE_BLEND_PREMULTI));
>
> return plane;
> }
--
--
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] 16+ messages in thread
* [PATCH v2 4/4] drm/vboxvideo: create blend mode property on planes
2026-09-01 8:32 [PATCH v2 0/4] drm: create blend mode property on alpha-capable planes of simple drivers Qinyun Tan
` (2 preceding siblings ...)
2026-09-01 8:32 ` [PATCH v2 3/4] drm/virtio: create blend mode property on cursor plane Qinyun Tan
@ 2026-09-01 8:32 ` Qinyun Tan
2026-09-01 8:46 ` sashiko-bot
2026-09-03 7:00 ` Thomas Zimmermann
3 siblings, 2 replies; 16+ messages in thread
From: Qinyun Tan @ 2026-09-01 8:32 UTC (permalink / raw)
To: dri-devel
Cc: tzimmermann, airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel,
Qinyun Tan
Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
format with alpha exposed"), drm_mode_config_validate() warns when a
plane exposes an alpha pixel format but not the "pixel blend mode"
property. Both the vboxvideo primary and cursor planes expose ARGB8888
and trip this on driver load.
VirtualBox draws the cursor through the host windowing system, which
treats the guest-supplied pointer shape as straight
(non-pre-multiplied) alpha: the host frontend loads the pixels
verbatim into an unpremultiplied ARGB image before handing them to the
host cursor APIs. This corresponds to DRM_MODE_BLEND_COVERAGE. Expose
a "pixel blend mode" property advertising only DRM_MODE_BLEND_COVERAGE
to make these semantics explicit and silence the warning. The primary
plane's alpha channel is ignored by the host (opaque blit) and it is
the bottom-most plane anyway; advertise the same value there for
consistency.
Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
---
v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI after
checking how the VirtualBox host composites the pointer shape.
drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 ++++
1 file changed, 4 insertions(+)
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
@@ -15,6 +15,7 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_blend.h>
#include <drm/drm_edid.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_fourcc.h>
@@ -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));
+
return plane;
free_plane:
--
2.43.7
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH v2 4/4] drm/vboxvideo: create blend mode property on planes
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
2026-09-03 7:00 ` Thomas Zimmermann
1 sibling, 0 replies; 16+ messages in thread
From: sashiko-bot @ 2026-09-01 8:46 UTC (permalink / raw)
To: Qinyun Tan; +Cc: dri-devel
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
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 4/4] drm/vboxvideo: create blend mode property on planes
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
@ 2026-09-03 7:00 ` Thomas Zimmermann
1 sibling, 0 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2026-09-03 7:00 UTC (permalink / raw)
To: Qinyun Tan, dri-devel
Cc: airlied, jfalempe, kraxel, dmitry.osipenko, hansg,
maarten.lankhorst, mripard, simona, leandro.ribeiro, daniels,
pekka.paalanen, virtualization, spice-devel, linux-kernel
Am 01.09.26 um 10:32 schrieb Qinyun Tan:
> Since commit 860e748bddcc ("drm: ensure blend mode supported if pixel
> format with alpha exposed"), drm_mode_config_validate() warns when a
> plane exposes an alpha pixel format but not the "pixel blend mode"
> property. Both the vboxvideo primary and cursor planes expose ARGB8888
> and trip this on driver load.
>
> VirtualBox draws the cursor through the host windowing system, which
> treats the guest-supplied pointer shape as straight
> (non-pre-multiplied) alpha: the host frontend loads the pixels
> verbatim into an unpremultiplied ARGB image before handing them to the
> host cursor APIs. This corresponds to DRM_MODE_BLEND_COVERAGE. Expose
> a "pixel blend mode" property advertising only DRM_MODE_BLEND_COVERAGE
> to make these semantics explicit and silence the warning. The primary
> plane's alpha channel is ignored by the host (opaque blit) and it is
> the bottom-most plane anyway; advertise the same value there for
> consistency.
>
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> v2: advertise DRM_MODE_BLEND_COVERAGE instead of PREMULTI after
> checking how the VirtualBox host composites the pointer shape.
>
> drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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
> @@ -15,6 +15,7 @@
>
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_blend.h>
> #include <drm/drm_edid.h>
> #include <drm/drm_fb_helper.h>
> #include <drm/drm_fourcc.h>
> @@ -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));
> +
> return plane;
>
> free_plane:
--
--
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] 16+ messages in thread