[igt-dev] [PATCH] tests/kms_plane_alpha_blend: skip coverage tests on missing enum
Harry Wentland
harry.wentland at amd.com
Wed Nov 10 16:24:05 UTC 2021
On 2021-11-10 03:25, Pekka Paalanen wrote:
> 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
>
Makes sense. There is actually a de-alpha block on AMD HW that
multiplies each rgb value with 1/alpha to remove the pre-multiplied
alpha. It's not hooked up currently but I guess the intention is
to allow HW to scan out planes with pre-multiplied alpha. We could
theoretically use this if we get pre-multiplied planes and want to
do per-plane degamma, ctm, etc.
Nick and I looked at our HW regarding "coverage" a bit more and it
does seem supported, but again, not plumbed, and probably not well
tested.
Simon, are you specifically interested in getting "coverage" support
on AMD HW or is intention just to fix up the IGT test? I assume this
is somewhat related to https://gitlab.freedesktop.org/drm/amd/-/issues/1769
Harry
>
> Thanks,
> pq
>
More information about the igt-dev
mailing list