[Intel-gfx] [PATCH] drm/i915: Android sync points for i915 v2
Jesse Barnes
jbarnes at virtuousgeek.org
Tue Aug 5 19:52:36 CEST 2014
On Tue, 5 Aug 2014 19:43:22 +0200
Daniel Vetter <daniel at ffwll.ch> wrote:
> On Tue, Aug 5, 2014 at 7:09 PM, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> >> >> >> Then we need similar flags for vblank events and pageflips to do the
> >> >> >> same (obviously those are drm core patches) and it's all there. That
> >> >> >> should probably integrated as a special type of drm_event, so that
> >> >> >> drivers don't need to change a single line of code.
> >> >> >
> >> >> > Except for actually using the fences...
> >> >>
> >> >> Actually no, nothing needed - drivers already signal drm_events in all
> >> >> the right places, so we really only need to change
> >> >> drm_send_vblank_event. And ofc we need to rework the code in the
> >> >> pageflip/atomic/vblank_wait ioctl code in the drm core to create a
> >> >> fence (and return it to userspace) instead of a normal drm event.
> >> >
> >> > Actually yes. You get back a fence object and want to do something
> >> > with it, right? That means new code. Plus modifying current execbuf
> >> > users that want fences to pass in a flag.
> >>
> >> This comment was specifically about vblank and pageflips, _not_ about
> >> execbuf. At least that's been what I've thought while writing the
> >> original mail and reading your reply. Looks like we have a
> >> misunderstanding here. Since for vblank and pageflip we really can do
> >> it all in the drm core.
> >
> > I was thinking of userspace drivers and userspace, not kernel
> > internals... that's the disconnect.
>
> Ah yeah, userspace needs to be adjusted of course to use fences as
> flip completion events instead of drm events received through the drm
> fd. But if we have a generic kms userspace (android hwc or wayland or
> whatever) that part shouldn't have any driver-specific logic either.
> And I've thought hwc expects fences for flip completion so that it
> knows when it can start to reuse buffers and render into them again.
> So at least on Android I think we need this, and I guess wayland
> wouldn't mind if it could deal with fences exclusively.
Yeah, Wayland doesn't currently use them, but it could for
synchronizing client buffers against what it wants to draw for the next
frame (i.e. if a client fence has passed when the compositor decides to
draw its next frame, it gets included, otherwise the previous frame is
included in the newly composed display buffer).
I think they can probably be made generic, either by adding a new flag
to mode sets/flips/vblank calls to return a fence, or by creating a
separate display timeline to be passed in to a fence ioctl call.
--
Jesse Barnes, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list