how to deal with the last video frame buffer (wl_buffer)?

Ander Conselvan de Oliveira conselvan2 at gmail.com
Wed Sep 4 02:11:51 PDT 2013


On 09/03/2013 03:26 AM, Zhao, Halley wrote:
> More questions:
>
> 1.I searched inside mesa code, there is wl_display_create_queue(), but
> no wl_event_queue_destroy(), is it a bug?

That seems to be missing from the clean up path. However, before 
destroying the queue, we need to make sure there is no proxy that uses 
that queue, otherwise a crash would happen if the proxy received an 
event after the queue was destroyed.

> 2.I searched inside Weston code, there is no wl_buffer_send_release(),
> is there other way to send the event of WL_BUFFER_RELEASE?

Look at weston_buffer_reference() in compositor.c. That function uses 
wl_resource_queue_event() to add the event to the connection buffer 
without flushing it and causing a context switch().

> 3.What’s the design philosophy of wl_buffer_send_release?
>
> a)I had thought the event is sent when server doesn’t use wl_buffer any
> longer

That is correct.

> i.when a new wl_buffer is committed (release previous committed buffer)
>
> ii.When the corresponding wl_surface is destroying (release the
> committed buffer)
>
> iii.When a second wl_buffer is attached before commit (release the
> previous attached one)

For the case of SHM buffers, the release event is sent after a texture 
upload, because at that moment a copy of the buffer is created. However, 
EGL buffers aren't copied so the release event is only sent when the 
buffer is replaced by a new one.

> b)However, the above assumption doesn’t work well with mesa. With nested
> server in webkit.
>
> Seems mesa requires wayland server send wl_buffer_send_release upon attach.

Could you elaborate on that?


Cheers,
Ander



More information about the wayland-devel mailing list