# Switching from ATI closed source to open source drivers

## Schwinni

Hi all,

I just emerged tuxonice-sources-2.6.26 and after compiling the new kernel ati-drivers failed to build.

Now I'm sick of the closed source drivers and want to switch to the open source drivers.

But I need some help since I'm not sure what I have to do exactly for a successful switch.

I want to try it with tuxonice-sources-2.6.26-r6 first.

I have the following hardware: (I stripped the network, USB and audio entries)

```
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 04)

00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 04)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d4)

00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 04)

00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04)

00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 04)

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X700 (PCIE)

```

For the closed source ATI drivers I used the following settings in kernel:

```
Device Drivers  --->

  Graphics support  --->

    <M> /dev/agpgart (AGP Support)  --->

      <M>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support

    < > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->

```

and in /etc/make.conf

```
VIDEO_CARDS="fglrx"

```

For using the open source driver, I will change /etc/make.conf to

```
VIDEO_CARDS="radeon"

```

This will result in rebuilding/emerging some packages:

```
[ebuild   R   ] media-libs/mesa-7.0.3  USE="-debug -doc -motif (-nptl) -pic -xcb" VIDEO_CARDS="radeon* ..."

[ebuild   R   ] sys-power/pm-utils-1.1.2.1  USE="alsa networkmanager -debug -ntp" VIDEO_CARDS="radeon*

[ebuild  N    ] x11-drivers/xf86-video-ati-6.9.0  USE="dri -debug"

[ebuild   R   ] x11-base/xorg-server-1.4.2  USE="dri hal ipv6 sdl xorg -3dfx -debug -dmx -kdrive -minimal (-nptl) -xprint"  VIDEO_CARDS="radeon* ... -fglrx* ..."

```

OK, this is clear so far.

Now my questions:

Do I have to enable

```
Device Drivers  --->

  Graphics support  --->

    <M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->

      <M>   ATI Radeon

```

also? (or is it like with ALSA drivers - that you have to decide for the in kernel drivers or the external modules)

If it is like with the ALSA drivers, should I use the in kernel module or the external module?

Should the entry "VIDEO_CARDS" in /etc/make.conf be deleted then?

Do I have to auto load some modules?

Do I need to rebuild xf86-video-ati every time I upgrade the kernel?

Many thanks in advance!

Chris

----------

## VoidMage

For me, every single module gets autoloaded.

I've got 

CONFIG_AGP=m

CONFIG_DRM=m

CONFIG_DRM_RADEON=m

CONFIG_FB_RADEON=m (this one may be unrelated, but I've set it anyway)

Be aware, that while some things will work better, other will get worse.

Some programs hate open driver+composite, cause for the time being

composite+dri clash violently occasionally.

Be sure to emerge driconf and turn off software fallback (it tends to happen 

in apps that need hardware most).

And be sure to read the man page, many important things are off by default.

----------

## Schwinni

Everything is working now, except one big thing:

The computer doesn't wake up from sleep (S3) anymore!

When trying to resume, the hard drive spins up, the fans start to turn, but the display stays black.

Pushing the power button doesn't do anything, so acpi doesn't react.

Switching to console 1 and logging in blindly in order to execute a clean shut down doesn't work also.

The only way to turn off the computer is pushing the power button for 4 seconds.

Does anybody have any ideas?

Best regards,

Chris

P.S.:

I already tried different settings in xorg.conf from loading the driver only to setting all the things for acceleration.

I also tried to append "acpi_sleep=s3_bios" to the kernel.

----------

## Schwinni

I tried gentoo-sources now also.

Same behavior:

Suspending to RAM works, but resuming fails.

Anyone got that working with xf86-video-ati?

I don't want to go back to ati-drivers...  :Sad: 

----------

## Schwinni

I got it working now:

First I tried pm-suspend with different quirk options and the display always stayed black.

Doing that from console at least gave me the chance to blindly type "halt".

hibernate-ram from the hibernate-scripts package instead worked out of the box. I only had to set 

```
EnableVbetool yes

VbetoolPost yes

```

in /etc/hibernate/ram.conf.

Since all tries with pm-utils failed I decided to kick the section out of /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux and to replace it with hibernate-ram:

```
# We only support pm-utils

#if [ -x "/usr/sbin/pm-suspend" ] ; then

#   /usr/sbin/pm-suspend $QUIRKS

#   RET=$?

#else

#   # TODO: add support

#   unsupported

#fi

# using hibernate-scripts

if [ -x "/usr/sbin/hibernate-ram" ] ; then

   sudo /usr/sbin/hibernate-ram

   RET=$?

else

   unsupported

fi

```

Now I'm happy again.  :Smile: 

BTW, "s2ram -f -p -m" and "s2ram -f -p -s" worked also - one more reason to wonder why pm-utils doesn't work...  :Rolling Eyes: 

Best regards,

Chris

----------

