# Switching between radeon and fglrx drivers at-will/reboot

## depontius

I have a new install, my first time buying ATI video in some time.  It's an AMD785-family chipset with HD4200 embedded graphics. (R600, I bellieve)

I have it all running and doing 3D with the radeon drivers.  It works with glxgears, Extreme Tuxracer, and Doomsday, (Doom/Heretic/Hexen source-port) though the latter shows that the radeon driver performance really isn't quite up there, yet.  Most of the time, I'm perfectly happy with the radeon performance, because it's adequate for my normal usage, and I'd generally prefer to run the OSS driver.

But every now and then I'd like to play a game or two.

With a combination of scripting, blackboxing, xorg.conf.d/*, etc is it reasonable to switch between radeon and fglrx at will - presumably with a reboot?

What radeon kernel modules do I need to blacklist in order to run fglrx?

What (if any) fglrx kernel modules do I need to blacklist in order to run radeon?

----------

## Ant P.

```
#!/bin/bash

if [[ ati = $1 ]]; then

    eselect opengl set ati

    eselect xvmc set ati

    mv -nv /etc/X11/xorg.conf.d/fglrx.{disabled,conf}

    printf "blacklist radeon\nblacklist fbcon" > /etc/modprobe.d/fglrx-blacklist.tmp

elif [[ xorg = $1 ]]; then

    eselect opengl set xorg-x11

    eselect xvmc set xorg-x11

    mv -nv /etc/X11/xorg.conf.d/fglrx.{conf,disabled}

    printf "blacklist fglrx" > /etc/modprobe.d/fglrx-blacklist.tmp

else

    echo "$0 [ati|xorg]"

    exit 1

fi

mv /etc/modprobe.d/fglrx-blacklist.{tmp,conf}
```

Should do most of the work.

----------

## depontius

Thanks, that's the kind of thing I was looking for.  I simply wasn't sure what all of the pieces I needed to switch would be, and what they were called.  Using "eselect xvmc" is a new one to me, I'm used to using it for opengl, profiles, etc.  I guess to get this stuff into place and get fglrx installed, I should either switch to the "vesa" xorg driver, or just do it in text mode.  I might want to add "vesa" as an option to your script, for that matter.

On the side, I see you blacklisting "fbcon".  In the Gentoo Radeon/KMS wiki I saw something about turning framebuffer stuff off, so I did.  In my /var/log/Xorg.0.log I see a brief bit of hate-mail about fbcon not being loaded, but it doesn't seem to have hurt, so I've ignored it.  Now you talk of blacklisting it when switching to fglrx, so I'm wondering if I should go back and enable it.  Running a quick xconfig I see that CONFIG_FRAMEBUFFER_CONSOLE (which I presume controls building of fbcon.ko) is over in the "Console Display Driver Support" page instead of the "Display Device Support" section where the Wiki explicitely had me turning stuff off.  I take it I should turn that item back on?

EDIT...  I double-checked last night, and I do have FRAMEBUFFER_CONSOLE enabled.  The small piece of hate-mail was about fbdev, not fbcon, and from what I can tell, that's a red herring, and I'm correctly set up.

Next to try the fglrx switcheroo.

----------

## olek

Hi.

I really would like to know if this worked for anyone.

Cheers

----------

## jerith

This is great info -- thanks!

But ... What do I set VIDEO_CARDS to?  What packages do I need to have emerged?  What goes in the two xorg conf files?

----------

## Ant P.

 *jerith wrote:*   

> This is great info -- thanks!
> 
> But ... What do I set VIDEO_CARDS to?  What packages do I need to have emerged?  What goes in the two xorg conf files?

 

You need VIDEO_CARDS="radeon r600 fglrx" and an "emerge -aDNtu world" should pull in the correct ones. The config files just need a minimal Device section each.

----------

## DaggyStyle

 *Ant P. wrote:*   

> 
> 
> ```
> #!/bin/bash
> 
> ...

 

what's fbcon? where is kms in the mixture?

----------

## Ant P.

fbcon is the framebuffer driver. radeon.ko provides radeondrmfb. Blacklisting them both allows fglrx to load.

----------

## DaggyStyle

 *Ant P. wrote:*   

> fbcon is the framebuffer driver. radeon.ko provides radeondrmfb. Blacklisting them both allows fglrx to load.

 

using kms here without fbcon and it works, infact, afaik, kms + fb is a no no.

also your script won't blacklist kms and I've seen situations in which modules that were needed to for other modules and were blacklisted were loaded.

----------

## Ant P.

 *DaggyStyle wrote:*   

> using kms here without fbcon and it works, infact, afaik, kms + fb is a no no.

 

That's interesting, I'd always thought that it was the likes of vesafb and radeonfb, the pre-KMS framebuffer drivers (which I never mentioned), that were a problem - not simply switching to a high-res VT using the radeondrmfb driver.

Without fbcon.ko my console runs in 80x25 VGA mode, so is there a more "correct" way to use it while keeping the KMS + native screen resolution + fast VT switching I've been using for years?

----------

## DaggyStyle

 *Ant P. wrote:*   

>  *DaggyStyle wrote:*   using kms here without fbcon and it works, infact, afaik, kms + fb is a no no. 
> 
> That's interesting, I'd always thought that it was the likes of vesafb and radeonfb, the pre-KMS framebuffer drivers (which I never mentioned), that were a problem - not simply switching to a high-res VT using the radeondrmfb driver.
> 
> Without fbcon.ko my console runs in 80x25 VGA mode, so is there a more "correct" way to use it while keeping the KMS + native screen resolution + fast VT switching I've been using for years?

 

I don't know what is the right way, you'll need to ask wiser people than me.

since the introduction of kms, I've always seen problems when running kms and fb, you can always try and see which suits you better.

----------

## equaeghe

 *Ant P. wrote:*   

> 
> 
> ```
> #!/bin/bash
> 
> ...

 

How do I setup my bootloader to get an entry that runs the script with 'ati' as a parameter and one that runs it with 'xorg'?

----------

