Hi,
today, I tried to build and setup Wayland according to [1].
I am using a Debian/sid i386 host with ATi/AMD Radeon RV250. Furthermore, I have an upstream Linux-Kernel (2.6.36-git14) and radeon DDX from GIT master (up to bf60af5). Both Kernel + DDX have Alex radeon-KMS pageflipping support from [2] built-in.
# lspci -nnvv | grep "VGA compatible controller" 01:00.0 VGA compatible controller [0300]: ATI Technologies Inc Radeon RV250 [Mobility FireGL 9000] [1002:4c66] (rev 02) (prog-if 00 [VGA controller])
# grep flip /var/log/Xorg.0.log [ 82.883] (II) RADEON(0): KMS Pageflipping: enabled
My libdrm is 2.4.22 and xorg-server is 1.9.1-rc2 (both from Debian/experimental repository).
NOTE: Below (see P.S.) I have listed the Wayland-relevant packages with git-log information.
[1] says in section Modesetting:
"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."
Thus, I am not sure if the website needs a refresh or radeon-KMS with Alex's patches is not "wayland-ready". Can you please enlighten? Thanks.
Furthermore some points to your "building" website from [1]:
[1] Section libxkbcommon: A hint for "requires kbproto >=1.0.5" would be nice. BTW, git://people.freedesktop.org/xorg/lib/libxkbcommon.git is not clone-able. I checked out from git://anongit.freedesktop.org/xorg/lib/libxkbcommon (see [3]) instead.
[2] Section Wayland (code-snippet): After "git clone git://people.freedesktop.org/~krh/wayland" is missing a "cd wayland"
[3] Section cairo-gl: In the build-log I saw "EGL functions: no (EGL headers not found)", but there are EGL headers installed in /opt/wayland (my $PREFIX, belonging to my user-account).
# ls -l /opt/wayland/include/EGL/ insgesamt 44 -rw-r--r-- 1 sd sd 18024 30. Okt 14:42 eglext.h -rw-r--r-- 1 sd sd 12353 30. Okt 14:42 egl.h -rw-r--r-- 1 sd sd 4216 30. Okt 14:42 eglplatform.h
Thus adding the following exports to all(!) packages (as code-snippets) makes more than sense to me:
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig export PATH=$PREFIX/bin:$PATH export LD_LIBRARY_PATH=$PREFIX/lib
Now, cairo is using EGL:
# grep EGL cairo-gl.log | head -3 checking for cairo's EGL functions feature... checking whether cairo's EGL functions feature could be enabled... yes EGL functions: yes
[4] Section Wayland: WTF (WhereTheF***) is those udev rules file I asked myself?
$ find wayland/ -name 70-wayland.rules wayland/compositor/70-wayland.rules
A code-snippet like that with some text would be helpful:
# cd wayland/ # cp -av compositor/70-wayland.rules /etc/udev/rules.d/
[5] Section Wayland:
Where shall wayland compositor find its libs? So there is a missing ld-config example, something like that would be great:
[ /etc/ld.so.conf.d/wayland.conf ] # wayland lib configuration /opt/wayland/lib
Do not forget to run ldconfig as root to update the linker cache.
# ldconfig
Below (see P.S.) you find a "ldconfig -p | grep wayland" output.
[6] Section Wayland: configure is not created, also there are missing *-sh and other files, why not use autogen.sh? IMHO "aclocal; autoconf;" can also be dropped in your snippet.
$ cd wayland $ ./autogen.sh --prefix=$PREFIX
[7] Missing Debian packages for my system (note to myself):
# apt-get install libffi-dev # apt-get install -t experimental libxcb-dri2-0-dev libxcb-xfixes0-dev # apt-get install libpoppler-glib-dev
[8] Section Wayland: Is that somehow outdated?
$ ./wayland-system-compositor -b my-image.jpg
$ find wayland/ -name compositor wayland/compositor wayland/compositor/compositor wayland/compositor/.libs/compositor
(Full find output below)
So how to test now the Wayland/compositor?
$ cd wayland/compositor $ LC_ALL=C ; LIBGL_DRIVERS_PATH=/opt/wayland/lib/dri ./compositor -b ../../backgrounds/dscn1843.jpg failed to initialize display Segmentation fault
BTW, a test JPG shipped with source would be nice. Must it be JPG, can it be PNG? Not sure.
$ ./compositor --help Usage: lt-compositor [OPTION...]
Help Options: -h, --help Show help options
Application Options: -b, --background Background image -c, --connector KMS connector
Can I force to use radeon-KMS as connector via --connector parameter? If YES, how?
As I already said I am not sure what is exactly wrong.
$ LIBGL_DRIVERS_PATH=/opt/wayland/lib/dri glxgears
# lsof | grep glxgears | grep wayland glxgears 19925 sd cwd DIR 8,3 4096 519169 /home/sd/src/wayland glxgears 19925 sd mem REG 8,5 16644192 260789 /opt/wayland/lib/dri/r200_dri.so
As you can see the mesa-dri driver is loaded from $PREFIX. Use LD_PRELOAD? Any other tricks?
Not sure if my RV250 gfcard is too weak, missing HW or GL requiremnets or radeon-KMS with pageflipping not ready for wayland. (glxinfo.txt attached).
I attached two strace outputs w/ and w/o LIBGL_DRIVERS_PATH:
$ cd wayland/compositor $ LC_ALL=C strace ./compositor -b ../../backgrounds/dscn1843.jpg 2> ../../strace_compositor.log $ LC_ALL=C ; LIBGL_DRIVERS_PATH=/opt/wayland/lib/dri strace ./compositor -b ../../backgrounds/dscn1843.jpg 2> ../../strace_compositor_LIBGL_DRIVERS_PATH.log
Last but not least, I have attached my build-scripts. If there is something wrong/missing, please let me know.
Any feedback and help appreciated.
Hope this helps to see Wayland on radeon-KMS.
Kind Regards, - Sedat -
References: [1] http://wayland.freedesktop.org/building.html [2] http://people.freedesktop.org/~agd5f/pflip/ [3] http://cgit.freedesktop.org/xorg/lib/libxkbcommon/
P.S.:
----- Packages with GIT log information -----
$ cd $HOME/src/wayland $ for i in mesa libxkbcommon cairo wayland ; do BASEDIR=$(pwd) ; echo $i ; cd $i ; git log --pretty=short -1 | cat ; cd $BASEDIR ; done mesa commit 156e955c25ad4acd78d683c4def83769f0bb3ddb Author: Chia-I Wu olv@lunarg.com
autoconf: st/vega requires --enable-openvg. libxkbcommon commit f94a64cc08b47cdbfdfea5b5756340246fc391ed Author: Jon TURNEY jon.turney@dronecode.org.uk
Link with -no-undefined cairo commit 5b2ed2422dffb407d80ec38ac0502ba951368ad2 Author: Uli Schlachter psychon@znc.in
xcb: Do not access flags directly wayland commit 012a00777129cbb84fa88ba1b02e1f3b2dd1b4f8 Author: Kristian Høgsberg krh@bitplanet.net
Add small client for testing shm surfaces
----- ldconfig output ------
# ldconfig -p | grep wayland libxkbcommon.so.0 (libc6) => /opt/wayland/lib/libxkbcommon.so.0 libxkbcommon.so (libc6) => /opt/wayland/lib/libxkbcommon.so libwayland-server.so.0 (libc6) => /opt/wayland/lib/libwayland-server.so.0 libwayland-server.so (libc6) => /opt/wayland/lib/libwayland-server.so libwayland-client.so.0 (libc6) => /opt/wayland/lib/libwayland-client.so.0 libwayland-client.so (libc6) => /opt/wayland/lib/libwayland-client.so libglut.so.3 (libc6) => /opt/wayland/lib/libglut.so.3 libglut.so (libc6) => /opt/wayland/lib/libglut.so libcairo.so.2 (libc6) => /opt/wayland/lib/libcairo.so.2 libcairo.so (libc6) => /opt/wayland/lib/libcairo.so libcairo-script-interpreter.so.2 (libc6) => /opt/wayland/lib/libcairo-script-interpreter.so.2 libcairo-script-interpreter.so (libc6) => /opt/wayland/lib/libcairo-script-interpreter.so libcairo-gobject.so.2 (libc6) => /opt/wayland/lib/libcairo-gobject.so.2 libcairo-gobject.so (libc6) => /opt/wayland/lib/libcairo-gobject.so libGLw.so.1 (libc6) => /opt/wayland/lib/libGLw.so.1 libGLw.so (libc6) => /opt/wayland/lib/libGLw.so libGLU.so.1 (libc6) => /opt/wayland/lib/libGLU.so.1 libGLU.so (libc6) => /opt/wayland/lib/libGLU.so libGLESv2.so.2 (libc6) => /opt/wayland/lib/libGLESv2.so.2 libGLESv2.so (libc6) => /opt/wayland/lib/libGLESv2.so libGLESv1_CM.so.1 (libc6) => /opt/wayland/lib/libGLESv1_CM.so.1 libGLESv1_CM.so (libc6) => /opt/wayland/lib/libGLESv1_CM.so libGL.so.1 (libc6) => /opt/wayland/lib/libGL.so.1 libGL.so (libc6) => /opt/wayland/lib/libGL.so libEGL.so.1 (libc6) => /opt/wayland/lib/libEGL.so.1 libEGL.so (libc6) => /opt/wayland/lib/libEGL.so
$ find wayland/ -name '*compositor*' wayland/compositor wayland/compositor/compositor wayland/compositor/compositor-x11.c wayland/compositor/compositor-x11.o wayland/compositor/.libs/lt-compositor wayland/compositor/.libs/compositor wayland/compositor/compositor-drm.o wayland/compositor/.deps/compositor-drm.Po wayland/compositor/.deps/compositor-x11.Po wayland/compositor/.deps/compositor.Po wayland/compositor/compositor.o wayland/compositor/compositor-drm.c wayland/compositor/compositor.c wayland/compositor/compositor.h
- EOT -