[RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property

Johan Jonker posted 1 patch 1 month ago
There is a newer version of this series
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 ++
1 file changed, 2 insertions(+)
[RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
Posted by Johan Jonker 1 month ago
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.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---

https://lore.kernel.org/all/20260526181700.25310-3-leandro.ribeiro@collabora.com/
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 0090d8ff0c79..0bc5b606f021 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));
 }
 
 static int vop_create_crtc(struct vop *vop)
-- 
2.39.5
Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
Posted by Heiko Stübner 1 month ago
Hi Johan,

Am Sonntag, 23. August 2026, 14:29:09 Mitteleuropäische Sommerzeit schrieb Johan Jonker:
> 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.

This is missing explanation on why PIXEL_NONE is the correct value.

VOP2 seems to support all 3 blend modes? So a sentece explaining
the pixel_none value would be helpful.


Heiko

> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
> 
> https://lore.kernel.org/all/20260526181700.25310-3-leandro.ribeiro@collabora.com/
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 0090d8ff0c79..0bc5b606f021 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));
>  }
>  
>  static int vop_create_crtc(struct vop *vop)
> 
Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
Posted by Johan Jonker 1 month ago

On 8/23/26 21:19, Heiko Stübner wrote:
> Hi Johan,
> 
> Am Sonntag, 23. August 2026, 14:29:09 Mitteleuropäische Sommerzeit schrieb Johan Jonker:
>> 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.
> 

> This is missing explanation on why PIXEL_NONE is the correct value.
> 
> VOP2 seems to support all 3 blend modes? So a sentece explaining
> the pixel_none value would be helpful.
> 
> 

Hi,

In the vop_plane_atomic_update() function there's a comment with win0 blend broken:

	/*
	 * Blending win0 with the background color doesn't seem to work
	 * correctly. We only get the background color, no matter the contents
	 * of the win0 framebuffer.  However, blending pre-multiplied color
	 * with the default opaque black default background color is a no-op,
	 * so we can just disable blending to get the correct result.
	 */

In the function vop2_plane_init() there are these blends: 

	unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
				  BIT(DRM_MODE_BLEND_PREMULTI) |
				  BIT(DRM_MODE_BLEND_COVERAGE);

My question:
Could someone with more know-how tell us what VOP version 1 is capable of?
Is there anything that needs to be set like in other drivers?

For example:
		switch (pixel_blend_mode) {
		case DRM_MODE_BLEND_PREMULTI:
			break;
		case DRM_MODE_BLEND_COVERAGE:
			break;
		case DRM_MODE_BLEND_PIXEL_NONE:
		default:
			break;
		}

If someone comes up with another solution/patch that's also fine, as long the kernel warnings are gone.

Thanks!

Johan



> Heiko
> 
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>> ---
>>
>> https://lore.kernel.org/all/20260526181700.25310-3-leandro.ribeiro@collabora.com/
>> ---
>>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> index 0090d8ff0c79..0bc5b606f021 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));
>>  }
>>  
>>  static int vop_create_crtc(struct vop *vop)
>>
> 
> 
> 
> 

Re:Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
Posted by Andy Yan 3 weeks, 2 days ago

Helllo,

At 2026-08-24 05:06:45, "Johan Jonker" <jbx6244@gmail.com> wrote:
>
>
>On 8/23/26 21:19, Heiko Stübner wrote:
>> Hi Johan,
>> 
>> Am Sonntag, 23. August 2026, 14:29:09 Mitteleuropäische Sommerzeit schrieb Johan Jonker:
>>> 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.
>> 
>
>> This is missing explanation on why PIXEL_NONE is the correct value.
>> 
>> VOP2 seems to support all 3 blend modes? So a sentece explaining
>> the pixel_none value would be helpful.
>> 
>> 
>
>Hi,
>
>In the vop_plane_atomic_update() function there's a comment with win0 blend broken:
>
>	/*
>	 * Blending win0 with the background color doesn't seem to work
>	 * correctly. We only get the background color, no matter the contents
>	 * of the win0 framebuffer.  However, blending pre-multiplied color
>	 * with the default opaque black default background color is a no-op,
>	 * so we can just disable blending to get the correct result.
>	 */
>

     All VOP 1 do not support alpha blending with background.
    Also, some VOPs do not support alpha when scaling is enabled, except those marked with VOP_FEATURE_ALPHA_SCALE, see[0]

[0]https://github.com/rockchip-linux/kernel/blob/develop-6.12/drivers/gpu/drm/rockchip/rockchip_vop_reg.c

>In the function vop2_plane_init() there are these blends: 
>
>	unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
>				  BIT(DRM_MODE_BLEND_PREMULTI) |
>				  BIT(DRM_MODE_BLEND_COVERAGE);
>
>My question:
>Could someone with more know-how tell us what VOP version 1 is capable of?
>Is there anything that needs to be set like in other drivers?
>
>For example:
>		switch (pixel_blend_mode) {
>		case DRM_MODE_BLEND_PREMULTI:
>			break;
>		case DRM_MODE_BLEND_COVERAGE:
>			break;
>		case DRM_MODE_BLEND_PIXEL_NONE:
>		default:
>			break;
>		}
>
>If someone comes up with another solution/patch that's also fine, as long the kernel warnings are gone.
>
>Thanks!
>
>Johan
>
>
>
>> Heiko
>> 
>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>> ---
>>>
>>> https://lore.kernel.org/all/20260526181700.25310-3-leandro.ribeiro@collabora.com/
>>> ---
>>>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>>> index 0090d8ff0c79..0bc5b606f021 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));
>>>  }
>>>  
>>>  static int vop_create_crtc(struct vop *vop)
>>>
>> 
>> 
>> 
>> 
>