[RFC PATCH hwc] drm_hwcomposer: set CRTC background color when available

Eric Anholt eric at anholt.net
Thu Feb 22 20:47:43 UTC 2018


Stefan Schake <stschake at gmail.com> writes:

> Android assumes an implicit black background layer is always present
> behind all layers it specifies for composition. drm_hwcomposer currently
> punts responsibility for this to the kernel/DRM platform and puts layers
> with per-pixel alpha content on the primary plane when requested.
>
> On some platforms (e.g. VC4) a background color fill has a cycle cost for
> the hardware composer and is not enabled by default. Instead, userland can
> request a background color through a CRTC property. Use this property to
> specify the implicit black background Android expects.
>
> Signed-off-by: Stefan Schake <stschake at gmail.com>
> ---
> Kernel changes for this (background_color) are available here:
>
> https://github.com/stschake/linux/commits/background-upstream
>
> Sending as RFC because I'm not entirely clear on whose responsibility
> this should be, on most DRM drivers it seems to be implicit. I think
> a case could also be made that VC4 should not accept alpha formats on
> the lowest layer or enable background color fill when given one anyway.
> On the other hand, userland control over background color seems desirable
> regardless and is a feature of multiple hardware composers (i915, vc4, omap).

Couldn't we just ignore the alpha channel on the primary plane, on the
assumption that it's supposed to be all zeroes below it?  Or are we not
premultiplied, so we do still need to multiply the primary plane's
colors by the alpha value?  I couldn't find any obvious DRM
documentation about whether alpha is premultiplied.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180222/af5b87c2/attachment.sig>


More information about the dri-devel mailing list