On Mon, Apr 04, 2016 at 04:27:56PM +0100, Daniel Stone wrote: > Hi, > > On 2 April 2016 at 01:28, Andy Ritger <[email protected]> wrote: > > On Tue, Mar 29, 2016 at 05:44:41PM +0100, Daniel Stone wrote: > >> On 23 March 2016 at 00:12, Andy Ritger <[email protected]> wrote: > >> > Also, mailbox mode versus FIFO mode should essentially equate to Vsync > >> > off versus Vsync on, respectively. It shouldn't have anything to do > >> > with the benefits of streams, but mailbox mode is a nice feature for > >> > benchmarking games/simulations or naively displaying your latest & > >> > greatest content without tearing. > >> > >> I agree it's definitely a nice thing to have, but it does bring up the > >> serialisation issue: we expect any configuration performed by the > >> client (say, wl_surface::set_opaque_area to let the compositor know > >> where it can disable blending) to be fully in-line with buffer > >> attachment. The extreme case of this is resize, but there are quite a > >> few valid cases where you need serialisation. > >> > >> I don't know quite off the top of my head how you'd support mailbox > >> mode with Streams, given this constraint - you need three-way feedback > >> between the compositor (recording all associated surface state, > >> including subsurfaces), clients (recording the surface state valid > >> when that buffer was posted), and the Streams implementation > >> (determining which frames to dequeue, which to discard and return to > >> the client, etc). > > > > It is possible we don't get that all completely right in our > > implementation, yet. > > Again this comes down to the synchronisation. In this case, assuming a > mailbox stream: > - wl_egl_surface_resize(w1, h1) > - gl*() > - eglSwapBuffers() <- commit 1 > - wl_egl_surface_resize(w2, h2) > - gl*() > - eglSwapBuffers() <- commit 2 > > For this, you would need some kind of synchronisation, to ensure that > processing commit 1 didn't pick up on the differently-sized frames for > commit 2.
Just to point out the obvious, using wl_egl_surface_resize as a barrier/separator/synchronization-triggerer is not enough for this. The mailbox vs FIFO mode needs to be tightly coupled with subsurface asynchronous/synchronous mode. For example, ignoring the resize calls in the above code, commit 1 and commit 2 might have drawn UI elements that are expected to be aligned with subsurface that were moved. Jonas _______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
