"hosted" patch for nouveau - X under wayland

Darxus at chaosreigns.com Darxus at chaosreigns.com
Sat Nov 27 23:29:51 PST 2010

Warning:  What I did has broken X in a way that strangely persists across
reboots.  Might just be that my keyboard and mouse aren't responding, I
haven't fixed it yet (I'm booted off a CF card).  I also had a hard
drive crash last night, which probably wasn't directly related.

Am I correct in believing that I should be able to just run the wayland
compositor under X, and then run "./Xorg :1" with the "hosted" patches?  I
got that far with nouveau, and got a black screen and a hung system.  When
I ran that patched version outside of X it complained about not being able
to connect to wayland.

How do I get it to run rootless? 
"./Xorg :1 -rootless" ?

Oh, there's a -hosted flag.  Hmm.  So "./Xorg :1 -hosted -rootless"?


It's possible to run X.org as a client of wayland, rootless or not, if
you have an Intel video card:

This requires a modified X.org from here:

And a patch to the X.org video driver, here:

I attempted to port that patch to the nouveau driver:

Getting it to run goes something like this (assuming you have wayland and
all its dependencies in $HOME/install):

git clone git://anongit.freedesktop.org/git/mesa/drm
cd drm
./autogen.sh --prefix=$HOME/install --enable-nouveau-experimental-api
make install
cd ..

git clone git://anongit.freedesktop.org/~krh/xserver --branch hosted
cd xserver
./autogen.sh --prefix=$HOME/install --enable-nouveau-experimental-api
make install
cd ..

wget http://www.chaosreigns.com/wayland/nouveau.hosted.git.patch
git clone git://anongit.freedesktop.org/nouveau/xf86-video-nouveau
cd xf86-video-nouveau
patch -p1 < ../nouveau.hosted.git.patch
./autogen.sh --prefix=$HOME/install --enable-nouveau-experimental-api
make install
cd ..

mkdir -p $HOME/install/etc/X11
echo -e 'Section "Device"\nIdentifier "n"\nDriver "nouveau"\nEndSection' > $HOME/install/etc/X11/xorg.conf

wayland/compositor/compositor &
sleep 1
$HOME/install/bin/Xorg :1 -hosted -rootless & 
# Haven't gotten this last one to work.

I also rebuilt my kernel from the nouveau git repo, under ubuntu maverick:

git clone --depth 1 git://anongit.freedesktop.org/nouveau/linux-2.6
cd linux-2.6
cp /boot/config-`uname -r` .config # use .config of currently running kernel
yes "" | make oldconfig # use defaults of newer features
make clean && make && make modules && sudo make modules_install && sudo make install
mkinitramfs -o initrd.img `make kernelversion`+
sudo mv initrd.img /boot/initrd.img-`make kernelversion`+
sudo update-grub


Note that the "+"'s in the kernel build steps seem to be a peculiarity of
the nouveau kernel tree.  I was really amazed it worked that easily, once
I figured it out.  That kernel directory alone ended up being 6.6
gigabytes.  The kernel install is nice and clean, creating only two files
in /boot and a directory in /lib/modules.  

"Some people will tell you that slow is good - and it may be, on some
days - but I am here to tell you that fast is better....
That is why God made fast motorcycles...." - Hunter S. Thompson

More information about the wayland-devel mailing list