[PATCH weston v5 13/36] libweston: add heads_changed hook
Pekka Paalanen
ppaalanen at gmail.com
Mon Feb 5 10:47:41 UTC 2018
On Fri, 2 Feb 2018 14:31:59 -0600
Derek Foreman <derekf at osg.samsung.com> wrote:
> On 2017-12-14 05:40 AM, Pekka Paalanen wrote:
> > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> >
> > Add a hook for compositors to get a callback when heads are added or
> > their connection status changes, to which compositors likely want to
> > react to by enabling or disabling outputs (API for that to be added
> > later).
> >
> > As many head changes as possible should be coalesced into a single
> > heads_changed call. Therefore the callback is made from an idle task.
> > This anticipates a future atomic output configuration API, where the
> > global output configuration is tested and set atomically instead of one
> > by one.
> >
> > weston_pending_output_coldplug() needs to manually execute the
> > heads_changed call so that initial outputs are created before any
> > plugins get their start-up idle tasks ran. This is especially important
> > for ivi-shell which does not support output hotplug, and for tests to
> > guarantee the expected outputs.
>
> Thanks for explaining this here, as I would've been wondering why
> otherwise - perhaps a brief comment in the code?
Sure.
> >
> > Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > ---
> > libweston/compositor.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++-
> > libweston/compositor.h | 8 +++++
> > 2 files changed, 86 insertions(+), 1 deletion(-)
> > @@ -4457,6 +4492,30 @@ weston_compositor_add_head(struct weston_compositor *compositor,
> >
> > wl_list_insert(compositor->head_list.prev, &head->compositor_link);
> > head->compositor = compositor;
> > + weston_compositor_schedule_heads_changed(compositor);
> > +}
> > +
> > +/** Set the function to be called when heads change
> > + *
> > + * \param compositor The compositor.
> > + * \param cb The function to call, or NULL for none.
> > + *
> > + * Setting the function overrides any previous setting.
> > + *
> > + * The callback function will be called after heads are added or their
> > + * connection status has changed. Several changes may be accumulated into a
> > + * single call. The user is expected to iterate over the existing heads and
> > + * checking their status to find out what changed.
>
> check their statuses
>
> Reviewed-by: Derek Foreman <derekf at osg.samsung.com>
> as is patch 12
Yup.
Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180205/bee07680/attachment.sig>
More information about the wayland-devel
mailing list