multiple wl surfaces commit in one client

Pekka Paalanen ppaalanen at gmail.com
Thu Nov 5 09:50:58 UTC 2020


On Thu, 05 Nov 2020 07:35:04 +0000
Simon Ser <contact at emersion.fr> wrote:

> Hi,
> 
> On Thursday, November 5, 2020 3:26 AM, zou lan <nancy.lan.zou at gmail.com> wrote:
> 
> > Hi pekka
> >
> > I want to ask if in one client have created many wl surfaces, and commit all of them to weston in one frame, could weston guarantee to handle these surface update commands in one repaint?
> >
> > The sample code may like this:
> > redraw() {
> > wl_surface_commit(surface1);
> > wl_surface_commit(surface2);
> > wl_display_dispatch();
> > }
> >
> > I think weston will handle the commit of surface1 and surface2 before next repaint because surface1 and surface2 are belong to one client, is that correct? Thank you!  
> 
> No, there's no such guarantee. The OS could pre-empt the client after
> the first wl_surface_commit is flushed on the wire and before the
> second one is. The request reads on the compositor side could also be
> split between these two requests. (This is still pretty unlikely, I
> think in practice you'll get the two surfaces updated at the same
> repaint "by chance" almost systematically.)
> 
> There's a WIP protocol to allow to synchronize multiple surfaces [1].
> 
> Simon
> 
> [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/26

Indeed.

Also sub-surfaces can be synchronized with their parent, but that
doesn't help you if you need the surfaces to have other roles.


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/20201105/a534b874/attachment.sig>


More information about the wayland-devel mailing list