Eric Anholt <e...@anholt.net> writes:

> If there's a swap already outstanding, don't bother queueing another
> one until this one has completed.  The assumption here is that our
> screen paints are cheap compared to everything else going on, so we
> don't need to queue them up way ahead of time.  The swap events also
> give us information we can use to avoid full screen repaints when the
> swap is a copy.

Is there some reason not to use the xcb event all of the time? It looks
like that would simplify the logic quite a bit here.

The rest of this patch is
Reviewed-by: Keith Packard <kei...@keithp.com>

>      if (wire_to_event) {
>          XEvent processed_event;
> +        int x_response_type;
> +        Bool result;
>  
>          /* OK they had an event handler.  Plug it back in, and call
>           * through to it.
>           */
>          XESetWireToEvent(dpy, response_type, wire_to_event);
>          xev->sequence = LastKnownRequestProcessed(dpy);
> +        result = wire_to_event(dpy, &processed_event, (xEvent *)xev);
>          wire_to_event(dpy, &processed_event, (xEvent *)xev);
> +        XUnlockDisplay(dpy);
> +
> +        x_response_type = processed_event.type & 0x7f;
> +
> +        if (result) {
> +            if (x_response_type == glx_swap_event) {
> +                GLXBufferSwapComplete *swap =
> +                    (GLXBufferSwapComplete *)&processed_event;
> +                ephyr_glamor_handle_swap_event(swap->drawable,
> +                                               swap->event_type);
> +                return;
> +            }
> +        }
> +    } else {
> +        XUnlockDisplay(dpy);
> +    }
> +
> +    if (response_type == glx_swap_event) {
> +        xcb_glx_buffer_swap_complete_event_t *swap =
> +            (xcb_glx_buffer_swap_complete_event_t *)xev;
> +        ephyr_glamor_handle_swap_event(swap->drawable, swap->event_type);
>      }
> -    XUnlockDisplay(dpy);
>  }

-- 
keith.pack...@intel.com

Attachment: pgpcL8X6LM2x_.pgp
Description: PGP signature

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to