<div dir="ltr">On Thu, Jun 13, 2013 at 1:04 PM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, 13 Jun 2013 12:35:36 +0200<br>
John Kåre Alsaker <<a href="mailto:john.kare.alsaker@gmail.com">john.kare.alsaker@gmail.com</a>> wrote:<br>
<br>
> I propose the we should change the commit behavior to having commit<br>
> on the toplevel wl_surface<br>
> commit itself and all it's subsurfaces atomically. Commiting on<br>
> subsurfaces should be a no-op.<br>
<br>
</div>When a component is running asynchronously, constantly sending new<br>
state to a sub-surface, how do you guarantee, that a toplevel commit<br>
uses a consistent set of state for the sub-surface?<br></blockquote><div>We either introduce libwayland functions to send requests as a group (which basically just holds the wl_display mutex) or hold a mutex while we're playing with pending surface state.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> That is to allow eglSwapBuffers to be used in subsurfaces, should you<br>
> manage to get it to be non-blocking.<br>
> This isn't a huge loss since clients only need to atomically commit<br>
> all surfaces anyway.<br>
<br>
</div>No, they don't. We want a component to be able to run independently in<br>
normal circumstances when it does not absolutely require<br>
synchronization to any other surfaces forming the window.<br>
<br>
Playing a video should not require the decorations to be committed for<br>each video frame.<br></blockquote><div>We don't need to avoid synchronization. It's simply desirable. However you do realize that almost every call into libwayland requires synchronization anyway? All rendering, memory management, resizing will require synchronization. Why are you so reluctant to introduce some insignificant synchronization given how much it simplifies the protocol?</div>
<div>It's not for performance since libwayland is filled with synchronization and probably many other operations.</div><div>It's because it's too hard to use, since resizing will require much more complex and expensive synchronization to work.</div>
<div><br></div><div>If you absolutely can't tolerate any synchronization in that case (which we won't be able to avoid at the libwayland level anyway) a simpler solution is to let wl_surface.commit atomically commit itself and all children recursively. You then commit to two separate wl_surfaces in the main and the component thread both of which have the top-level wl_surface as a parent. However to do this we need a way to map a surface without a buffer (or use a transparent one...) since the top-level wl_surface can't have content. It also won't allow eglSwapBuffers to work in subsurfaces (if we could even guarantee that it's non-blocking), but that will be rectified by the wl_egl_window_* additions we discussed.</div>
<br></div>