Hi Jonas,

On 29 December 2015 at 02:10, Jonas Ådahl <[email protected]> wrote:
> @@ -1485,27 +1500,28 @@ WL_EXPORT int
>  wl_display_dispatch_queue(struct wl_display *display,
>                           struct wl_event_queue *queue)
>  {
> -       struct pollfd pfd[2];
>         int ret;
>
>         if (wl_display_prepare_read_queue(display, queue) == -1)
>                 return wl_display_dispatch_queue_pending(display, queue);
>
> +       do {
> +               if (wl_display_poll(display, POLLOUT) == -1) {
> +                       wl_display_cancel_read(display);
> +                       return -1;
> +               }
> +
> +               ret = wl_display_flush(display);
> +       } while (ret == -1 && errno == EAGAIN);

Hm, this now unconditionally incurs an extra syscall for the poll.
Could you please flip those so we try to flush first and then only
poll if we couldn't complete the flush, avoiding the extra poll for
the common case of the output buffer not being full?

Cheers,
Daniel
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to