My *nix world

Linux ATI radeon KMS

These days I had to install a Gentoo on a Compaq 6820s laptop that comes with a ATI Mobility Radeon X1350 (chipset RV515).

Although I followed all the guidelines from the following resources:

I have encountered an unexpected error while loading the Linux ATI Radeon KMS that was related to the Kernel Mode Setting (when KMS was disabled I've got no error but no KMS too).

My steps:

First I configured the Linux kernel to embed the radeon driver within the kernel:

linux ati radeon kms

Linux ATI Radeon KMS kernel configuration - Graphics support

and thus the system freeze at boot time, exactly when the kernel tried to initialize the ATI GPU.

A bit later I have changed the kernel configuration so that the "ATI Radeon" has to be built as a kernel module. I have also blacklisted the radeon module to make sure it won't get loaded, so I would load the module manually after the kernel would boot successfully. So I have booted the kernel with the KMS set "off" by default:

then, after everything loaded successfully I was trying to load the radeon module with the modeset option set "on":

when the system completely froze (no CPU activity or I/O responsiveness whatsoever).

Later, I un-blacklisted the radeon module in order to get it loaded automatically. The kernel have been loaded successfully and everything was just fine, except the fact that I had no KMS whatsoever (of course, I booted the system with radeon.modeset=0).

What I've done later was really tricky and that fixed my problem. I've unloaded the radeon module from memory and loaded back with modeset=1:

If you do this while you're on X then I'm pretty sure your screen will turn into black. What I did to avoid that was to logoff from X session, kill the SLIM login manager then to stop the XDM service. After that I unloaded/loaded back the radeon module (as shown above) and then started XDM (which in turn started automatically the login manager) so that I got an wonderful X session with a full support of framebuffer that improved both the screen resolution and the user experience.

Now the thing is: "how to automate this" so that I won't do that every time I boot the system?

You could try to create a simple BASH script that, in principle, would do the trick shown above then would do what your /etc/inittab would normally is doing in the last step (like loading the login/window manager).

In my case I just hack the /etc/X11/startDM.sh script that would normally load the X session (whatever it is: xfce4, gnome, lxde, ...,etc). So just before that script (startDM.sh) executes the default desktop environment I've inserted that "modprobe" thing.

Now, every time I boot the system, just when the xdm service is started, the system switchs automatically to a framebuffer-enabled graphic, resulting in a higher resolution graphic and a better user experience.

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

 
The following two tabs change content below.
Linux ATI radeon KMS

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in IT projects.
Linux ATI radeon KMS

Latest posts by Eugen Mihailescu (see all)

Tagged on: , ,

6 thoughts on “Linux ATI radeon KMS

  1. jay

    thanks for the reply, I am looking for the "startDM.sh" alternative in Cruchbang/Debian to make the same changes as you have done in startDM.sh. Could you please point me in the right direction. thanks.

    1. Eugen Mihailescu

      Just check your /etc/inittab to see which is the script that is run automatically by the INIT process that in turn launches your default display manager (i.e. XDM, SLIM, GDM, KDM, LXDM or whatever comes with your distro). In my case, the last line of /etc/inittab is something like this:
      x:a:once:/etc/X11/startDM.sh
      so I decided to inject those "modprobe" commands into startDM.sh.
      You might follow a similar approach, just determine your display manager starting script then inject those "modprobe" commands at the beginning or alike. If your distro does not work like this then try to create a simple daemon script(http://wiki.debian.org/Daemon) that automatically starts at boot-time and which runs those modprobe commands.

  2. jay

    many thanks for your comments. I really appreciate. But being a linux noob, I may need more time to fix this. It looks like my linux distro (Crunchbang) does not have a script at /etc/inittab directing me to process which starts GDM (my default display manager). I will keep looking and I am sure I will find it. As for a daemon script, I would need a similar example without which I am likely to mess up. But I am positive that I need to borrow from your clever idea. Cheers and thanks again from the help.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers:

Optimization WordPress Plugins & Solutions by W3 EDGE