All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
@ 2026-08-23 12:29 ` Johan Jonker
  0 siblings, 0 replies; 9+ messages in thread
From: Johan Jonker @ 2026-08-23 12:29 UTC (permalink / raw)
  To: heiko
  Cc: hjc, andy.yan, maarten.lankhorst, mripard, tzimmermann, airlied,
	simona, dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel

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


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
@ 2026-08-23 12:29 ` Johan Jonker
  0 siblings, 0 replies; 9+ messages in thread
From: Johan Jonker @ 2026-08-23 12:29 UTC (permalink / raw)
  To: heiko
  Cc: hjc, andy.yan, maarten.lankhorst, mripard, tzimmermann, airlied,
	simona, dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel

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


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

* Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
  2026-08-23 12:29 ` Johan Jonker
  (?)
@ 2026-08-23 12:35 ` sashiko-bot
  -1 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-08-23 12:35 UTC (permalink / raw)
  To: Johan Jonker; +Cc: dri-devel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch incorrectly advertises that all planes only support `DRM_MODE_BLEND_PIXEL_NONE`, but the driver unconditionally performs pre-multiplied alpha blending for formats with an alpha channel on non-primary planes.
--

--- Patch [1]: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property ---
commit b598208b3a4ac16667d04c601badf21d2ed2f848
Author: Johan Jonker <jbx6244@gmail.com>

drm: rockchip: add drm_plane_create_blend_mode_property

This commit fixes warnings in the kernel log by explicitly creating a blend
mode property for the planes. It restricts the supported blend mode to
DRM_MODE_BLEND_PIXEL_NONE.

Link: https://lore.kernel.org/all/20260526181700.25310-3-leandro.ribeiro@collabora.com/

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 0090d8ff0c79e..0bc5b606f0213 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));
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[Severity: Medium]
Does this incorrectly advertise that all planes only support
DRM_MODE_BLEND_PIXEL_NONE?

Looking at vop_plane_atomic_update() in
drivers/gpu/drm/rockchip/rockchip_drm_vop.c, the driver unconditionally
performs pre-multiplied alpha blending for formats with an alpha channel
on overlay planes:

    if (fb->format->has_alpha && win_index > 0) {
        VOP_WIN_SET(vop, win, dst_alpha_ctl,
                    DST_FACTOR_M0(ALPHA_SRC_INVERSE));
        val = SRC_ALPHA_EN(1) | SRC_COLOR_M0(ALPHA_SRC_PRE_MUL) |
            SRC_ALPHA_M0(ALPHA_STRAIGHT) |
            SRC_BLEND_M0(ALPHA_PER_PIX) |
            SRC_ALPHA_CAL_M0(ALPHA_NO_SATURATION) |
            SRC_FACTOR_M0(ALPHA_ONE);
        VOP_WIN_SET(vop, win, src_alpha_ctl, val);

        VOP_WIN_SET(vop, win, alpha_pre_mul, ALPHA_SRC_PRE_MUL);
        VOP_WIN_SET(vop, win, alpha_mode, ALPHA_PER_PIX);
        VOP_WIN_SET(vop, win, alpha_en, 1);

If userspace compositors query the blend mode property and see only
PIXEL_NONE is supported, they might assume the pixel alpha channel will be
ignored and the plane rendered completely opaque.

If they assign an ARGB8888 buffer to an overlay plane, will the driver
ignore the property's implied opaque semantics and configure the hardware
to perform alpha blending anyway?

>  }
>  
>  static int vop_create_crtc(struct vop *vop)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/1ab6fb88-3b84-49b5-aa05-202a84edbd3d@gmail.com?part=1

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

* Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
  2026-08-23 12:29 ` Johan Jonker
@ 2026-08-23 19:19   ` Heiko Stübner
  -1 siblings, 0 replies; 9+ messages in thread
From: Heiko Stübner @ 2026-08-23 19:19 UTC (permalink / raw)
  To: Johan Jonker, andy.yan
  Cc: hjc, maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel

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)
> 





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

* Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
@ 2026-08-23 19:19   ` Heiko Stübner
  0 siblings, 0 replies; 9+ messages in thread
From: Heiko Stübner @ 2026-08-23 19:19 UTC (permalink / raw)
  To: Johan Jonker, andy.yan
  Cc: hjc, maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel

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)
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
  2026-08-23 19:19   ` Heiko Stübner
@ 2026-08-23 21:06     ` Johan Jonker
  -1 siblings, 0 replies; 9+ messages in thread
From: Johan Jonker @ 2026-08-23 21:06 UTC (permalink / raw)
  To: Heiko Stübner, andy.yan
  Cc: hjc, maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel



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)
>>
> 
> 
> 
> 


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

* Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
@ 2026-08-23 21:06     ` Johan Jonker
  0 siblings, 0 replies; 9+ messages in thread
From: Johan Jonker @ 2026-08-23 21:06 UTC (permalink / raw)
  To: Heiko Stübner, andy.yan
  Cc: hjc, maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	dri-devel, linux-rockchip, linux-arm-kernel, linux-kernel



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)
>>
> 
> 
> 
> 


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re:Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
  2026-08-23 21:06     ` Johan Jonker
@ 2026-09-04 11:13       ` Andy Yan
  -1 siblings, 0 replies; 9+ messages in thread
From: Andy Yan @ 2026-09-04 11:13 UTC (permalink / raw)
  To: Johan Jonker
  Cc: Heiko Stübner, andy.yan, hjc, maarten.lankhorst, mripard,
	tzimmermann, airlied, simona, dri-devel, linux-rockchip,
	linux-arm-kernel, linux-kernel



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)
>>>
>> 
>> 
>> 
>> 
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re:Re: [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property
@ 2026-09-04 11:13       ` Andy Yan
  0 siblings, 0 replies; 9+ messages in thread
From: Andy Yan @ 2026-09-04 11:13 UTC (permalink / raw)
  To: Johan Jonker
  Cc: Heiko Stübner, andy.yan, hjc, maarten.lankhorst, mripard,
	tzimmermann, airlied, simona, dri-devel, linux-rockchip,
	linux-arm-kernel, linux-kernel



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)
>>>
>> 
>> 
>> 
>> 
>

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

end of thread, other threads:[~2026-09-04 11:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-23 12:29 [RFC PATCH v1] drm: rockchip: add drm_plane_create_blend_mode_property Johan Jonker
2026-08-23 12:29 ` Johan Jonker
2026-08-23 12:35 ` sashiko-bot
2026-08-23 19:19 ` Heiko Stübner
2026-08-23 19:19   ` Heiko Stübner
2026-08-23 21:06   ` Johan Jonker
2026-08-23 21:06     ` Johan Jonker
2026-09-04 11:13     ` Andy Yan
2026-09-04 11:13       ` Andy Yan

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.