[Wayland-bugs] [Bug 99332] call eglSwapBuffers causes app execution block

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 9 17:24:19 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=99332

--- Comment #3 from Daniel Stone <daniel at fooishbar.org> ---
(In reply to Sergey Stepanov from comment #2)
> wl_resource_queue_event(ref->buffer->resource, WL_BUFFER_RELEASE); is
> calling in weston_buffer_reference. Pay attention that
> wl_resource_QUEUE_event used, not wl_resource_POST_event. wl_buffer.release
> event is not sent at this point.
> 
> And, client will NOT receive this event until weston flushes event queue for
> this client. It will happen on wl_resource_post_event (another event posted)
> or wl_client_flush. And there is no proper wl_client_flush. I suppose it is
> some kind of mistake because it is not complies with the protocol.

It's not a mistake, it's a very deliberate choice of behaviour. It's not always
the most optimal behaviour, but it's the behaviour Weston does have, and has
had for years now. Anyone writing an EGL driver must take this into account:
even if it does change in future (and it may), then old versions will still
always behave the same way. And as you are on either version 1.6 or 1.9, any
change upstream would take quite a long time to trickle down to you.

> It works with frame callback because it force to flush events to client
> (wl_resource_post_event flushes queue ). And it works with
> wl_display_roundtrip_queue in the same way.

I'm aware of this.

> I don't think it's a EGL vendor error don't use a frame callback. According
> to wayland protocol it is not obligatory.

Using a frame callback is the only sensible way to implement an EGL swap
interval of 1. A swap interval of 0 does not require frame events, but then it
also requires something to flush the compositor's event queue.

> I'm not sure, but I suppose if we
> use Mesa EGL implementation
> create surface which will not mapped (IVI surface with wrong id for example)
> call eglSwapBuffer twice
> it will block app on eglSwapBuffer call because frame calback will not be
> sent (surface is unmapped), and event queue on the server side will not be
> flushed (and buffer release will not be sent)

That's correct, yes. Sending roundtrips down will provoke the queue being
flushed.

Like I say, it's not necessarily the best behaviour (I argued against it at the
time), but it is well-established behaviour, and any EGL implementation needs
to cope with this if it wants to work with Weston. Even if it were to change in
future, the fact you're using 1.6 means that such a change would take at least
2.5 years to propagate down to you; your EGL implementation could surely be
changed in that time.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20170109/b0c5be85/attachment-0001.html>


More information about the wayland-bugs mailing list