[PATCH] Revert "compositor: Queue buffer.release instead of sending immediately"

Kristian Høgsberg hoegsberg at gmail.com
Wed Sep 11 14:15:15 PDT 2013


On Wed, Sep 11, 2013 at 02:54:47PM -0400, Daniel Stone wrote:
> Hi,
> 
> On 11 September 2013 14:31, Neil Roberts <neil at linux.intel.com> wrote:
> > This reverts commit eccef6aadd142103ed151883e61c0e7a2fd98639.
> >
> > Queuing the buffer release event instead of posting it immediately
> > causes problems if the client is not installing a frame callback and
> > instead is waiting for the buffer release events to throttle its
> > rendering. This will happen in Mesa when eglSwapInterval is set to
> > zero so that the client will try to render faster than the compositor
> > can display the buffers. The client will still want to throttle itself
> > to the buffer release events in that case so that it doesn't end up
> > allocating endless amounts of buffers while waiting for the release
> > events. Without this patch nothing will cause the connection to be
> > flushed so the client will just block forever.
> 
> Yeah, this is good to me.  Media pipelines also really want release
> events ASAP, so they can reuse hardware-decoder buffers.

The problem is that this will introduce an immediate event back to the
client after it's done rendering.  The goal is to be able to have the
client render receive the frame event and input, update its state and
render the next frame, attach and commit and then sleep until the next
frame event.  Sending out the release event immediately will wake it
up one more time.  Would it work it make mesa send a wl_display.sync
request following the commit if swapinterval is 0?

Kristian

> Cheers,
> Daniel
> 
> > ---
> >  src/compositor.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/compositor.c b/src/compositor.c
> > index 74f0aab..3eb97e0 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -1113,8 +1113,8 @@ weston_buffer_reference(struct weston_buffer_reference *ref,
> >                 ref->buffer->busy_count--;
> >                 if (ref->buffer->busy_count == 0) {
> >                         assert(wl_resource_get_client(ref->buffer->resource));
> > -                       wl_resource_queue_event(ref->buffer->resource,
> > -                                               WL_BUFFER_RELEASE);
> > +                       wl_resource_post_event(ref->buffer->resource,
> > +                                              WL_BUFFER_RELEASE);
> >                 }
> >                 wl_list_remove(&ref->destroy_listener.link);
> >         }
> > --
> > 1.8.3.1
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list