# KMS + gentoo-sources-2.6.29 + xf86-video-ati

## sian

Hello, has anyone succeed to do KMS with gentoo-sources-2.6.29 + xf86-video-ati (radeon 9700pro).

What are the step followed ? What option for the kernel compilation ? Which version of xorg-server/xf86-video-ati did you use ?

----------

## Sadako

There isn't any support for kms on ATI in 2.6.29, it might be merged into .30, although .31 is probably more likely.

However, I did get it working on my r500 with a few packages from git a little while back, courtesy of a thread I started on phoronix to ask about it.

KMS worked beautifully, and unlike when I had tried it late last year xorg started up just fine, however X locked up when I tried running glxgears...

That was a couple of weeks ago though, so it might be worth trying again (and I think dri2 could have been the real cause of the lockup, which I didn't attempt to disable).

You'll need the specific branches of the git versions of mesa, xf86-video-ati, and libdrm (all of which I have ebuilds for, so I can tar them up and upload them if you want), as well as the drm-rawhide branch of Dave Airlie's kernel tree, which is a big bloody download and you'll have to fetch by yourself.

Also, I don't know if I needed it or not, but I used the xorg-server 1.6 and related ebuilds from the x11 overlay.

Personally I'm going to wait until I can get just the required modules from git, rather than the entire kernel...

HTH

----------

## timeBandit

Moved from Gentoo Chat to Kernel & Hardware. Kernel question so moved here.

----------

## sian

@Hopeless : is it worth trying it now ? Personally, I would wait until a get a howto.

----------

## Sadako

 *sian wrote:*   

> @Hopeless : is it worth trying it now ? Personally, I would wait until a get a howto.

 Sorry, kinda forgot about this...

Anyways, I'm using it at present, and am very happy with it.

Only two issues at present, xv is unusable with relatively high-res videos (but -vo gl works just fine in mplayer), and 3d performance is kinda poor, at least according to glxgears (~800 fps whereas I get ~5000 fps usually).

The latter is unsurprising, as it's still a WIP, and I think intel with KMS has seen something similar.

As for a howto...

 :Wink: 

Userland part;

Fetch these libdrm and xf86-video-ati git ebuilds from here, and place in an overlay (under x11-libs and x11-drivers, respectively).

Fetch the git ebuild for media-libs/mesa from the x11 overlay (here) and add it to your local overlay, and add MESA_LIVE_BRANCH="radeon-rewrite" to /etc/make.conf.

Optional, but if you also want xorg-server 1.6 (I haven't actually tried it with 1.5...) get the 1.6.0 ebuild from the x11 overlay too, along with x11-libs/libXfont 1.4 and x11-proto/randrproto 1.3 ebuilds.

And within the x11-base/xorg-server directory, you can run `cp -a xorg-server-1.6.0.ebuild xorg-server-1.6.1.ebuild && ebuild xorg-server-1.6.1.ebuild manifest` to get xorg-server 1.6.1 (which is what I'm currently using).

Then just emerge all of the above (ie `emerge -1 libdrm mesa xorg-server xf86-video-ati`), along with all x11-drivers packages just to be on the safe side.

Re-emerging xorg-server probably isn't necessary if you're staying with 1.5, but I do it anyways.

For the kernel part, to make things easy I've been making diffs of the drm-rawhide tree with the tree it's based on (or forked from), which is 2.6.29 rc8, and the resulting patch applies cleanly to gentoo-sources 2.6.29-r1 (which is a 2.6.29.1 kernel).

So grab the latest patch from here, unpack (say in /tmp, for example), switch to the above gentoo-sources kernel source directory and run `patch -p1 < /tmp/linux-2.6.29-rc8_radeonkms-*.patch`.

As for configuartion, all you should need to enable is the following (presuming you want a fbcon driver);

```
CONFIG_DRM_RADEON=y

CONFIG_DRM_RADEON_KMS=y

CONFIG_FB=y

CONFIG_FRAMEBUFFER_CONSOLE=y
```

You won't need any of the drivers under CONFIG_FB at all.

HTH anyone interested in trying it out, it looks like this won't actually make it into the kernel until 2.6.31, so as soon as hardened-sources 2.6.29 are out I'll be relying this method.

----------

## sian

Hello,

Yes it works.

I still have one question : what option do you pass to grub ? We do not have image like in Plymouth., do we ?

----------

## nephros

Hi,

first of all thanks for the guide, Hopeless.

Compiling mesa today (2009-08-02), I get this:

```

radeon_screen.c: In function ‘radeonCreateScreen’:

radeon_screen.c:1030: error: ‘R600_SCRATCH_REG_OFFSET’ undeclared (first use in this function)

radeon_screen.c:1030: error: (Each undeclared identifier is reported only once

radeon_screen.c:1030: error: for each function it appears in.)

gmake[5]: *** [radeon_screen.o] Error 1

```

Any pointers?

[edit:] retrying with the ebuilds from the tarball in this post  - lets see how that goes.

----------

## _sil

 *nephros wrote:*   

> Hi,
> 
> first of all thanks for the guide, Hopeless.
> 
> Compiling mesa today (2009-08-02), I get this:
> ...

 

had same problem, reemerging libdrm-9999 solved it for me.

----------

