From: Daniel Vetter <daniel@ffwll.ch>
To: Greg Hackmann <ghackmann@google.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 00/16] Atomic/nuclear modeset/pageflip
Date: Wed, 26 Mar 2014 11:08:12 +0100 [thread overview]
Message-ID: <20140326100812.GS26878@phenom.ffwll.local> (raw)
In-Reply-To: <CAJKQeMZMVJxaJmd72saWQcLgfB7eh6pR5vU5mnP+oCUp8g7ngg@mail.gmail.com>
On Thu, Mar 20, 2014 at 03:34:19PM -0700, Greg Hackmann wrote:
> On Wed, Mar 19, 2014 at 5:23 AM, Rob Clark <robdclark@gmail.com> wrote:
>
> > > Hm, do you have some pointers to read up on this? I still think a more
> > > elaborate fail scheme is overkill, but maybe reading a bit of android
> > code
> > > convinces me differently ;-)
> >
> > sadly no pointers to anything to read (but ofc would be interested if
> > anyone else does)..
> >
>
> The hardware composer HAL is probably the best reference for what Android
> needs from display. It's defined and documented here (see struct
> hwc_composer_device_1):
>
> *https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hwcomposer.h
> <https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/hwcomposer.h>*
>
> (You can disregard any HWC 1.0 specific behavior in that documentation,
> that's only around for legacy reasons and we strongly encourage vendors not
> to implement HWC 1.0 anymore.)
>
> Vendors need to ship a compliant HWC HAL implementation on their devices.
> We don't mandate anything about their userspace/kernel interface beyond
> that.
>
>
> > * I kinda would still like to add to the atomic ioctl some way to indicate
> > ok/error on a bit finer granularity than per-ioctl. Ie. perhaps an
> > array where userspace can ask for results per KMS object (crtc/plane)?
> > Something along these lines would give the kernel a bit more flexibility
> > to deal with some of the edge cases which come up when you gang crtcs
> > for ultra high resolution displays. In short, it would let the driver
> > "steal" some of the planes if needed from userspace.
> >
> > This would also, conveniently, be pretty similar to how (AFAIU) hw
> > compositor and ADF work on android. Which seems like it would be useful
> > to eventually enable android devices to use an upstream display driver.
> >
> > For this we could pretty easily just throw in a placeholder that we
> > could replace later with an optional ptr to __user array. I think
> > that would be fine for an initial version, but I just wanted to throw
> > this idea out there, because I think it will become important.
> >
>
> SurfaceFlinger needs the HWC HAL to return a retire fence fd on each flip,
> for each display. Per-interface return data would be a good fit for this,
> but per-CRTC or per-plane would work too (userspace could assemble a
> per-interface fence by merging finer-grained fences).
>
> It's up to the vendor whether their HWC HAL does fine-grained error
> handling and renegotiation like you're describing. Typically they don't,
> they just push that complexity into userspace instead. e.g. if the display
> controller needs to gang together two planes for a given configuration, the
> HWC HAL's prepare() op will already know to set aside that extra plane and
> plan accordingly.
I've read through the hwc interface stuff and some question only
marginally related to atomic pageflips poppped up.
- You have an explicit callback for vblank events (well, just the
interrupt, afaics no support to get a vblank event for a specific frame
in the future). Any reason not to use android syncpoint fences for this
like everywhere else? Or is the idea behind all the fences hwc throws
around just to synchronize read/write access from
cpu/render/codec/whatever and not so much timing?
- If I read this correct you mandate that the fences fields gets filled
out in the prepare hook, i.e. before we commit the new state to
hardware. You also mandate that the fences get eventually signalled even
when surfaceflinger decides to not commit the new state. I see two
consequences from that:
- You create fences before the kernel is committed to execute the
relevant event which will trigger the fence.
- Userspace seems to be required to trigger fences manually to unblock
things in case the hw state isn't committed.
This seems to be squarely at odds with the hw fences Maarten Lankhorst,
which currently have two guarantees:
- Fences can only be created when the kernel commits to execute the
event that will trigger the fence.
- A global ordering is imposed upon all fence updates (and so scheduled
depencies when one fences needs to wait for another).
Together this ensures that we never schedule a deadlock in hw fences and
that no hw fence ever depends upon userspace signalling some fences.
How do you tackle these issues with surfaceflinger/hwc? Or if this blows
up and the hw deadlocks it's the integrates problem to track it down (or
just reset the gpu and everything else to get unstuck)?
Cheers, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-03-26 10:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 21:22 [PATCH 00/16] Atomic/nuclear modeset/pageflip Rob Clark
2014-03-18 21:22 ` [PATCH 01/16] drm: fix typo Rob Clark
2014-03-18 21:22 ` [PATCH 02/16] drm: add atomic fxns Rob Clark
2014-03-18 21:22 ` [PATCH 03/16] drm: convert crtc to ww_mutex Rob Clark
2014-03-18 21:22 ` [PATCH 04/16] drm: add object property type Rob Clark
2014-03-18 21:22 ` [PATCH 05/16] drm: add signed-range " Rob Clark
2014-03-18 21:22 ` [PATCH 06/16] drm: helpers to find mode objects Rob Clark
2014-03-18 21:22 ` [PATCH 07/16] drm: split propvals out and blob property support Rob Clark
2014-03-18 21:22 ` [PATCH 08/16] drm: Allow drm_mode_object_find() to look up an object of any type Rob Clark
2014-03-18 21:22 ` [PATCH 09/16] drm: Refactor object property check code Rob Clark
2014-03-18 21:22 ` [PATCH 10/16] drm: allow FB's in drm_mode_object_find Rob Clark
2014-03-18 21:22 ` [PATCH 11/16] drm: convert plane to properties/state Rob Clark
2014-03-18 21:22 ` [PATCH 12/16] drm: convert crtc " Rob Clark
2014-03-18 21:22 ` [PATCH 13/16] drm: push locking down into restore_fbdev_mode Rob Clark
2014-03-18 21:22 ` [PATCH 14/16] drm: Atomic modeset ioctl Rob Clark
2014-03-18 21:22 ` [PATCH 15/16] drm/msm: add atomic support Rob Clark
2014-03-18 21:22 ` [PATCH 16/16] drm: spiff out FB refcnting traces Rob Clark
2014-03-19 11:07 ` [PATCH 00/16] Atomic/nuclear modeset/pageflip Daniel Vetter
2014-03-19 12:23 ` Rob Clark
2014-03-19 13:39 ` Daniel Vetter
2014-03-20 22:34 ` Greg Hackmann
2014-03-21 0:28 ` Rob Clark
2014-03-26 21:21 ` Greg Hackmann
2014-03-26 10:08 ` Daniel Vetter [this message]
2014-03-26 21:33 ` Greg Hackmann
2014-03-26 22:33 ` Daniel Vetter
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=20140326100812.GS26878@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=ghackmann@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox