[igt-dev] [PATCH] tests/kms_plane_alpha_blend: skip coverage tests on missing enum

Pekka Paalanen ppaalanen at gmail.com
Wed Nov 10 08:25:09 UTC 2021


On Tue, 09 Nov 2021 22:16:25 +0000
Simon Ser <contact at emersion.fr> wrote:

> On Tuesday, November 9th, 2021 at 19:14, Harry Wentland <harry.wentland at amd.com> wrote:
> 
> > On 2021-11-04 12:27, Simon Ser wrote:  
> > > Some KMS drivers support the KMS "pixel blend mode" plane property,
> > > but don't support the "Coverage" mode. This enum entry is missing
> > > to indicate lack of support as seen in this drm_info exerpt:
> > >
> > >     "pixel blend mode": enum {None, Pre-multiplied} = Pre-multiplied
> > >
> > > Skip the coverage tests in this case.  
> >
> > Is "coverage" interesting for compositors? We have the ability to do
> > pre-multiplied or coverage in HW but it's not hooked up currently.  
> 
> I _think_ it'll be useful with the WIP color management Wayland protocol,
> because clients will be able to submit straight (non-premult) buffers?
> 
> CC Pekka
> 
> (In any case, it's good to have the skip since it's not AMD-specific.)

Thanks for the cc, Simon!

Yes, Coverage is the only usable blending mode in KMS when you have
an alpha channel and you don't want to mess up the colors.
Unfortunately, one would also need plane-DEGAMMA to not mess up colors
in blending, since blending with physical coverage semantics[1] only
works with linear color values.

This is regardless of color management or not, it's just one necessary
step towards better color. If one wanted to use pre-multiplied blending
mode, the pre-multiplication would need to happen after plane-DEGAMMA
(and plane-CTM if you use that). Then it's not really
pre-multiplication, it's just the Coverage mode.

And yes, Wayland with color management extensions will encourage
applications to use straight alpha instead of pre-multiplied, because
plane-DEGAMMA on pre-multiplied values makes no sense. A compositor
will need to undo pre-multiplication before it can do anything.

[1] http://ssp.impulsetrain.com/translucency.html


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20211110/914d63c5/attachment.sig>


More information about the igt-dev mailing list