Skip to contentSkip to conversation

drm: document pre-multiplied assumptions

PATCH In review Simon Ser 4 participants 4 messages Sep 29, 2021 – Sep 30, 2021

Subsystems (2)
lore
Share & tools
lore

Simon Ser

author
#0 lore raw

PATCH 1/1 drm: document pre-multiplied assumptions

When a plane is missing the "alpha blend mode" property, KMS drivers will use the pre-multiplied mode.

Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_blend.c +3 -0
index ec37cbfabb50..eebb32ba84d7 100644
@@ -185,6 +185,9 @@
  *		 plane does not expose the "alpha" property, then this is
  *		 assumed to be 1.0
  *
+ *	When a plane is missing this property, the plane uses the
+ *	"Pre-multiplied" equation.
+ *
  * Note that all the property extensions described here apply either to the
  * plane or the CRTC (e.g. for the background color, which currently is not
  * exposed and assumed to be black).
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Simon Ser

When a plane is missing the "alpha blend mode" property, KMS drivers will use the pre-multiplied mode.

Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>

Another option would be to sprinkle immutable props to all drivers that claim to do alpha blending and don't currently expose the property.

Quoted 21 lines
---
 drivers/gpu/drm/drm_blend.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_blend.c +3 -0
index ec37cbfabb50..eebb32ba84d7 100644
@@ -185,6 +185,9 @@
  *		 plane does not expose the "alpha" property, then this is
  *		 assumed to be 1.0
  *
+ *	When a plane is missing this property, the plane uses the
+ *	"Pre-multiplied" equation.
+ *
  * Note that all the property extensions described here apply either to the
  * plane or the CRTC (e.g. for the background color, which currently is not
  * exposed and assumed to be black).
Signature · 1 line
2.33.0
Signature · 2 lines
Ville Syrjälä
Intel
Acked-by on v1 1/1
#2 lore raw
In reply to Simon Ser
Quoted 15 lines · On Wed, 29 Sep 2021 09:54:14 +0000 Simon Ser <[email protected]> wrote:

When a plane is missing the "alpha blend mode" property, KMS drivers will use the pre-multiplied mode.

Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_blend.c +0 -0
index ec37cbfabb50..eebb32ba84d7 100644

drivers/gpu/drm/drm_blend.c line 193

Quoted 9 lines
drivers/gpu/drm/drm_blend.c +3 -0
@@ -185,6 +185,9 @@
  *		 plane does not expose the "alpha" property, then this is
  *		 assumed to be 1.0
  *
+ *	When a plane is missing this property, the plane uses the
+ *	"Pre-multiplied" equation.
+ *
  * Note that all the property extensions described here apply either to the
  * plane or the CRTC (e.g. for the background color, which currently is not
  * exposed and assumed to be black).

Hi Simon,

thank you! :-D

I have no idea if that's correct though, but also nothing against it, and it does help with what I ranted about in
https://lists.freedesktop.org/archives/wayland-devel/2021-September/041993.html
so is it appropriate to offer my

?

Thanks,
pq

#3 lore raw
Quoted 30 lines · Pekka Paalanen
Quoted 15 lines · On Wed, 29 Sep 2021 09:54:14 +0000 Simon Ser <[email protected]> wrote:

When a plane is missing the "alpha blend mode" property, KMS drivers will use the pre-multiplied mode.

Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_blend.c +0 -0
index ec37cbfabb50..eebb32ba84d7 100644

drivers/gpu/drm/drm_blend.c line 193

Quoted 9 lines
drivers/gpu/drm/drm_blend.c +3 -0
@@ -185,6 +185,9 @@
  *		 plane does not expose the "alpha" property, then this is
  *		 assumed to be 1.0
  *
+ *	When a plane is missing this property, the plane uses the
+ *	"Pre-multiplied" equation.
+ *
  * Note that all the property extensions described here apply either to the
  * plane or the CRTC (e.g. for the background color, which currently is not
  * exposed and assumed to be black).

Hi Simon,

Quoted 8 lines

thank you! :-D

I have no idea if that's correct though, but also nothing against it, and it does help with what I ranted about in
https://lists.freedesktop.org/archives/wayland-devel/2021-September/041993.html
so is it appropriate to offer my

I think if it's not correct we can add an immutable prop like Ville suggested for that driver.
-Daniel

Quoted 6 lines

?

Thanks,
pq

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch