blob: 5b168d4351d1b64166821444d5ab81e2f38e9af2 [file] [log] [blame]
Kristian Høgsberga6f69992010-09-14 12:41:26 -04001What is Wayland
2
3Wayland is a project to define a protocol for a compositor to talk to
4its clients as well as a library implementation of the protocol. The
5compositor can be a standalone display server running on Linux kernel
6modesetting and evdev input devices, an X applications, or a wayland
7client itself. The clients can be traditional appliactions, X servers
8(rootless or fullscreen) or other display servers.
9
10The wayland protocol is essentially only about input handling and
11buffer management. The compositor receives input events and forwards
12them to the relevant client. The clients creates buffers and renders
13into them and notifies the compositor when it needs to redraw. The
14protocol also handles drag and drop, selections, window management and
15other interactions that must go throught the compositor. However, the
16protocol does not handle rendering, which is one of the features that
17makes wayland so simple. All clients are expected to handle rendering
18themselves, typically through cairo or OpenGL.
19
20The wayland repository includes a compositor and a few clients, but
21both the compositor and clients are essentially test cases.
22
23
24Building Instructions
25
26The instructions below assume some familiarity with git and building
27and running experimental software. And be prepared that this project
Kristian Høgsberga46dc062010-09-14 11:25:55 -040028isn't at all useful right now, it's still very much a prototype. When
29the instructions suggest to clone a git repo, you can of course just
30add a remote and fetch instead, if you have a clone of that repo
31around already. I usually install all software I'm working on into
32$HOME/install, so that's what I'll use in the instructions below, but
33you can use your favorite directory of course or install over your
34system copy (pass --prefix=/usr --sysconfdir=/etc, generally).
Kristian Høgsberg61ba8982008-11-05 10:37:20 -050035
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050036
Kristian Høgsberga46dc062010-09-14 11:25:55 -040037Modesetting
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050038
Kristian Høgsberga46dc062010-09-14 11:25:55 -040039At this point, kernel modesetting is upstream for Intel, AMD and
40nVidia chipsets. Most distributions ship with kernel modesetting
41enabled by default and will work with Wayland out of the box. The
42modesetting driver must also support the page flip ioctl, which only
43the intel driver does at this point.
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050044
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050045
Kristian Høgsberga46dc062010-09-14 11:25:55 -040046Building mesa
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050047
Kristian Høgsberga46dc062010-09-14 11:25:55 -040048Wayland uses the mesa EGL stack, and all extensions required to run
49EGL on KMS are now upstream on the master branch. The 7.9 release of
50mesa will have all these extensions, but for now you'll need to build
51mesa master:
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050052
Kristian Høgsberga46dc062010-09-14 11:25:55 -040053 $ git clone git://anongit.freedesktop.org/mesa/mesa
54 $ cd mesa
55 $ ./configure --prefix=$HOME/install --enable-egl --enable-gles2
56 $ make && make install
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050057
Kristian Høgsberga46dc062010-09-14 11:25:55 -040058If you're using an intel chipset, it's best to also pass
59--disable-gallium to ./configure, since otherwise libEGL will try to
60load the gallium sw rasterizer before loading the Intel DRI driver.
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050061
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050062
Kristian Høgsberga46dc062010-09-14 11:25:55 -040063libxkbcommon
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050064
Kristian Høgsberga46dc062010-09-14 11:25:55 -040065Wayland needs libxkbcommon for translating evdev keycodes to keysyms.
66There's a couple of repos around, and we're trying to consolidate the
67development, but for wayland you'll need the repo from my get
68repository. For this you'll need development packages for xproto,
69kbproto and libX11.
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050070
Kristian Høgsberga46dc062010-09-14 11:25:55 -040071 $ git clone git://people.freedesktop.org/~krh/libxkbcommon.git
72 $ cd libxkbcommon/
73 $ ./autogen.sh --prefix=$HOME/install
74 $ make && make install
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050075
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050076
Kristian Høgsberga46dc062010-09-14 11:25:55 -040077cairo-gl
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050078
Kristian Høgsberga46dc062010-09-14 11:25:55 -040079The Waland clients render using cairo-gl, which is an experimental
80cairo backend. It has been available since cairo 1.10. Unless your
81distribution ships cairo with the gl backend enabled, you'll need to
82compile your own version of cairo:
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050083
Kristian Høgsberga46dc062010-09-14 11:25:55 -040084 $ git clone git://anongit.freedesktop.org/cairo
85 $ cd cairo
86 $ ./autogen.sh --prefix=$HOME/install --enable-gl
87 $ make && make install
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050088
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050089
Kristian Høgsberga46dc062010-09-14 11:25:55 -040090Wayland
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050091
Kristian Høgsberga46dc062010-09-14 11:25:55 -040092With mesa and libxkbcommon in place, we can checkout and build
93Wayland. Aside from mesa, Wayland needs development packages for
94gdk-pixbuf-2.0, libudev, libdrm, xcb-dri2, xcb-fixes (for X
95compositor) cairo-gl, glib-2.0, gdk-2.0 (for poppler) and
96poppler-glib:
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -050097
Kristian Høgsberga46dc062010-09-14 11:25:55 -040098 $ git clone git://people.freedesktop.org/~krh/wayland
99 $ aclocal; autoconf; ./configure --prefix=$HOME/install
100 $ make && make install
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -0500101
Kristian Høgsberga46dc062010-09-14 11:25:55 -0400102Installing into a non-/usr prefix is fine, but the 70-wayland.rules
103udev rule file has to be installed in /etc/udev/rules.d. Once
104installed, either reboot or run
Kristian Høgsberg33a52bd2008-11-03 15:31:30 -0500105
Kristian Høgsberga46dc062010-09-14 11:25:55 -0400106 $ sudo udevadm trigger --subsystem-match=drm --subsystem-match=input
107
108to make udev label the devices wayland will use.
109
110If DISPLAY is set, the wayland compositor will run under X in a window
111and take input from X. Otherwise it will run on the KMS framebuffer
112and take input from evdev devices. Pick a background image that you
113like and copy it to the Wayland source directory as background.jpg or
114use the -b command line option:
115
116 $ ./wayland-system-compositor -b my-image.jpg
117
118To run clients, switch to a different VT and run the client from
119there. Or run it under X and start up the clients from a terminal
120window. There are a few demo clients available, but they are all
121pretty simple and mostly for testing specific features in the wayland
122protocol: 'terminal' is a simple terminal emulator, not very compliant
123at all, but works well enough for bash
124
125 'flower' moves a flower around the screen, testing the frame protocol
126 'gears' glxgears, but for wayland, currently broken
127 'image' loads the image files passed on the command line and shows them
128
129 'view' does the same for pdf files, but needs file URIs
130 (file:///path/to/pdf)