From: Kristian Høgsberg Date: Tue, 14 Sep 2010 15:25:55 +0000 (-0400) Subject: Copy over updated build instructions from the google group X-Git-Tag: 0.85.0~828 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a46dc06da7fdabde7311a33355fbe3dfa256a446;p=platform%2Fupstream%2Fweston.git Copy over updated build instructions from the google group --- diff --git a/README b/README index f44473c..17e4d6a 100644 --- a/README +++ b/README @@ -1,68 +1,105 @@ -This file describes how to build and run wayland. See NOTES for what -wayland is or maybe will be some day. There's a google group for -wayland/eagle discussion here: +These instructions assume some familiarity with git and building and +running experimental software. And be prepared that this project +isn't at all useful right now, it's still very much a prototype. When +the instructions suggest to clone a git repo, you can of course just +add a remote and fetch instead, if you have a clone of that repo +around already. I usually install all software I'm working on into +$HOME/install, so that's what I'll use in the instructions below, but +you can use your favorite directory of course or install over your +system copy (pass --prefix=/usr --sysconfdir=/etc, generally). - http://groups.google.com/group/wayland-display-server -Wayland requires the eagle EGL stack available from +Modesetting - git://people.freedesktop.org/~krh/eagle +At this point, kernel modesetting is upstream for Intel, AMD and +nVidia chipsets. Most distributions ship with kernel modesetting +enabled by default and will work with Wayland out of the box. The +modesetting driver must also support the page flip ioctl, which only +the intel driver does at this point. -and currently assumes that eagle is checked out in a sibling -directory, for example: - ~krh/src/wayland and - ~krh/src/eagle +Building mesa -Eagle should work with a recent DRI driver from mesa, but I have mesa -repo with an eagle branch here: +Wayland uses the mesa EGL stack, and all extensions required to run +EGL on KMS are now upstream on the master branch. The 7.9 release of +mesa will have all these extensions, but for now you'll need to build +mesa master: - git://people.freedesktop.org/~krh/mesa + $ git clone git://anongit.freedesktop.org/mesa/mesa + $ cd mesa + $ ./configure --prefix=$HOME/install --enable-egl --enable-gles2 + $ make && make install -which provides and experimental DRI CopyBuffer extension, that lets -wayland use the DRI driver and the hardware for implementing buffer -swaps. Eagle needs to be compiled against the dri_interface.h from -this branch to be able to use the CopyBuffer extension. +If you're using an intel chipset, it's best to also pass +--disable-gallium to ./configure, since otherwise libEGL will try to +load the gallium sw rasterizer before loading the Intel DRI driver. -To run wayland you currently need intel hardware, a kernel with gem -and kernel modesetting, and it is necessary to set a couple of -environment variables. First, set LD_LIBRARY_PATH: - export LD_LIBRARY_PATH=$PWD:$PWD/../eagle +libxkbcommon -Yes, this sucks, but libtool sucks more. Then to let eagle pick up -the custom dri driver, set +Wayland needs libxkbcommon for translating evdev keycodes to keysyms. +There's a couple of repos around, and we're trying to consolidate the +development, but for wayland you'll need the repo from my get +repository. For this you'll need development packages for xproto, +kbproto and libX11. - export EAGLE_DRIVER_PATH=$PWD/../mesa/lib + $ git clone git://people.freedesktop.org/~krh/libxkbcommon.git + $ cd libxkbcommon/ + $ ./autogen.sh --prefix=$HOME/install + $ make && make install -and finally set up the path to the evdev device to use as a pointer -device: - export WAYLAND_POINTER=/dev/by-id/whatever-it's-called-event-mouse +cairo-gl -If you haven't already, load the i915 driver with modesetting: +The Waland clients render using cairo-gl, which is an experimental +cairo backend. It has been available since cairo 1.10. Unless your +distribution ships cairo with the gl backend enabled, you'll need to +compile your own version of cairo: - modprobe i915 modeset=1 + $ git clone git://anongit.freedesktop.org/cairo + $ cd cairo + $ ./autogen.sh --prefix=$HOME/install --enable-gl + $ make && make install -You may need to unload it first, if it's loaded already. Also, on -Fedora, there may be a bogus /etc/modprobe.d/i915modeset preventing -the modeset paramater from reaching the module. Nuke it. -At this point you should be able to launch wayland and a couple of -clients. Try something like: +Wayland - ./wayland & - ./background & - ./flower & - ./flower & - ./flower & - ./window & - ./pointer & +With mesa and libxkbcommon in place, we can checkout and build +Wayland. Aside from mesa, Wayland needs development packages for +gdk-pixbuf-2.0, libudev, libdrm, xcb-dri2, xcb-fixes (for X +compositor) cairo-gl, glib-2.0, gdk-2.0 (for poppler) and +poppler-glib: -Maybe some day there'll be a script that does all this. Some day... + $ git clone git://people.freedesktop.org/~krh/wayland + $ aclocal; autoconf; ./configure --prefix=$HOME/install + $ make && make install -And after all this work it may still not work or even oops your -kernel. It's very much work in progress, so be prepared. +Installing into a non-/usr prefix is fine, but the 70-wayland.rules +udev rule file has to be installed in /etc/udev/rules.d. Once +installed, either reboot or run -cheers, -Kristian + $ sudo udevadm trigger --subsystem-match=drm --subsystem-match=input + +to make udev label the devices wayland will use. + +If DISPLAY is set, the wayland compositor will run under X in a window +and take input from X. Otherwise it will run on the KMS framebuffer +and take input from evdev devices. Pick a background image that you +like and copy it to the Wayland source directory as background.jpg or +use the -b command line option: + + $ ./wayland-system-compositor -b my-image.jpg + +To run clients, switch to a different VT and run the client from +there. Or run it under X and start up the clients from a terminal +window. There are a few demo clients available, but they are all +pretty simple and mostly for testing specific features in the wayland +protocol: 'terminal' is a simple terminal emulator, not very compliant +at all, but works well enough for bash + + 'flower' moves a flower around the screen, testing the frame protocol + 'gears' glxgears, but for wayland, currently broken + 'image' loads the image files passed on the command line and shows them + + 'view' does the same for pdf files, but needs file URIs + (file:///path/to/pdf)