[PATCH 0/2] Add New XWayland API

Axel Davy axel.davy at ens.fr
Thu Oct 17 00:16:57 CEST 2013

The current XWayland API has no functionality to help the DDXs 
implement ScheduleSwap. This new API proposal introduces functions
to manipulate the frame event, the release event, and to manipulate 
the buffers that the Wayland compositor sees.

The first patch is not linked directly to XWayland,
it is a patch initially written by Chris Wilson, that 
enables some useful optimisations DDX side when swap_interval=0

The new XWayland API enables to do an efficient implementation
of AsyncSwap. 

I have implemented ScheduleSwap and AsyncSwap in the wlglamor DDX to
test the API.

For XWayland, applications which benefit from AsyncSwap are applications 
with no decoration window, like fullscreen applications.

For example with an intel hd4000, with a fullscreen glmark2(1920x1080),
the terrain benchmark goes from 49 fps to 53 fps, and the ideas benchmark
goes from 397 fps to 645 fps. All this because we avoid a copy. Moreover,
AsyncSwap allows suppress tearings for fullscreen applications because we 
can respect the Wayland buffer release semantic.  

The new function xwl_add_frame_todo_visible_window allows to implement
ScheduleSwap, and xwl_display_get allows to get the wl_display used by 

The API introduces a new object: xwl_buffer, which is use to manipulate
the buffers linked with Wayland and the buffer exposed by the 
windows shown to the Wayland compositor.

Axel Davy (2):
  Patch to the Xserver to support AsyncSwap
  Add new XWayland API.

 hw/xfree86/dri2/dri2.c                 |  36 ++++--
 hw/xfree86/dri2/dri2.h                 |   8 +-
 hw/xfree86/xwayland/Makefile.am        |   2 +
 hw/xfree86/xwayland/xwayland-buffers.c | 114 +++++++++++++++++
 hw/xfree86/xwayland/xwayland-drm.c     |  10 +-
 hw/xfree86/xwayland/xwayland-events.c  | 222 +++++++++++++++++++++++++++++++++
 hw/xfree86/xwayland/xwayland-private.h |  20 ++-
 hw/xfree86/xwayland/xwayland-window.c  |  21 ++--
 hw/xfree86/xwayland/xwayland.c         |  23 +++-
 hw/xfree86/xwayland/xwayland.h         |  68 ++++++++++
 10 files changed, 496 insertions(+), 28 deletions(-)
 create mode 100644 hw/xfree86/xwayland/xwayland-buffers.c
 create mode 100644 hw/xfree86/xwayland/xwayland-events.c


More information about the wayland-devel mailing list