All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: Stefan Schake <stschake@gmail.com>, Eric Anholt <eric@anholt.net>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [RFC PATCH hwc] drm_hwcomposer: set CRTC background color when available
Date: Wed, 28 Feb 2018 11:53:31 +0100	[thread overview]
Message-ID: <dfc0bbb4-8393-b915-5679-6b1aec54b232@collabora.com> (raw)
In-Reply-To: <CAOZHkRwqeXLgeidS72MnToBfEDds=g+6VZcLfz2Umw45xB6e9w@mail.gmail.com>

Hey,

On 02/23/2018 03:34 PM, Stefan Schake wrote:
> Hey Eric,
> 
> On Thu, Feb 22, 2018 at 9:47 PM, Eric Anholt <eric@anholt.net> wrote:
>> Stefan Schake <stschake@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@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.
> 
> That would work, too (for a black background anyway). Though the easiest place
> to spoof this is presumably in the kernel. From what I have seen, everything in
> Android is already premultiplied, but technically it can specify
> either. Not sure if this
> is correctly handled in drm_hwcomposer yet.
> 

To me Erics solution sounds pragmatic, and would be easy to reason about going 
forward. Making sure that all of the kernel drivers behave the same way might be 
the hardest part.

Stefan: Are you looking at an entirely kernel side fix now, or are you pushing 
this series forward?


Rob.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-02-28 10:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22  3:54 [RFC PATCH hwc] drm_hwcomposer: set CRTC background color when available Stefan Schake
2018-02-22 10:04 ` Robert Foss
2018-02-22 12:23   ` Stefan Schake
2018-02-22 20:47 ` Eric Anholt
2018-02-23 14:34   ` Stefan Schake
2018-02-28 10:53     ` Robert Foss [this message]
2018-03-02  0:41       ` Stefan Schake
2018-03-02 14:34         ` Robert Foss
2018-03-06  7:46 ` Daniel Vetter
2018-06-29 10:05 ` Maarten Lankhorst
2018-06-29 10:27   ` Stefan Schake
2018-07-02 12:22     ` Maarten Lankhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfc0bbb4-8393-b915-5679-6b1aec54b232@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=stschake@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.