Phoronix Forums  

Go Back   Phoronix Forums > Linux Graphics / X.Org Drivers > Open-Source AMD/ATI Linux

Open-Source AMD/ATI Linux Technical support and discussion of the open-source Radeon, RadeonHD, and Avivo drivers.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-05-2009, 03:08 PM
Neo_The_User Neo_The_User is offline
Junior Member
 
Join Date: Jun 2009
Location: Chicago, Illinois
Posts: 31
Default Getting Open Source 3D graphics on R6XX/R7XX cards (NO FGLRX)

NEW!!!: THIS GETS KERNEL MODESETTING WORKING AS WELL!

This guide will enable 3D acceleration on R6XX/R7XX (HD 2000 - HD 4000 series) graphics cards.

PLEASE NOTE: Do not run this source code on machines with old user space. If you are using Ubuntu 9.04, please check unsupported updates and proposed updates in System > Administration > Software Sources and run "sudo apt-get update && sudo apt-get dist-upgrade" without quotes.

PLEASE NOTE.. AGAIN: Compiling everything with GCC 4.4 latest snapshot or GCC 4.5 snapshot, the code runs faster. Please go to http://neo-technical.wikispaces.com/gcc-4.4 for instructions on how to fetch gcc code and compile it. Sorry for the external link.

1a.) Obtain the required development tools and programs to compile, install, and fetch the source code:

Ubuntu (9.04) / Debian (sid

sudo apt-get install git-core build-essential dh-make debconf debhelper automake autoconf libstdc++5 libstdc++6 xorg-dev gawk bison cdbs dkms && sudo apt-get build-dep libdrm mesa

Gentoo:

emerge -pv git automake autoconf xf86-video-ati mesa libdrm libpthread-stubs x11-proto/dri2proto x11-proto/glproto

Arch Linux:

sudo pacman -Syyu && sudo pacman -S xorg xf86-video-radeonhd base-devel ati-dri libgl dri2proto glproto

2a.) Obtain kernel source source code:

cd /usr/src && sudo git clone git:git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git && cd linux-2.6 && sudo git --global user.name "Neo"

You may replace "Neo" with whatever you like. "John Lennon," "Keanu Reeves," etc.

Pull from drm-linus:

sudo git pull git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-linus

Run any of the two commands to start editing the config. make xconfig looks nice but requires qt3 development headers and tools. make menuconfig uses the ncurses / screen interface.

sudo make xconfig
or
sudo make menuconfig

OPTIONAL: You may make changes to the config file regarding hard drives, firmware, wireless, bluetooth etc. to your preference.


REQUIRED SETTINGS: Under Graphics Support, compile "Lowlevel video output switch controls" INTO (Y) the kernel. "/dev/agpgart (AGP SUPPORT)" should be compiled INTO (Y) the kernel and your chipset (not graphics card) must be compiled INTO (Y) the kernel. Run lspci in a terminal to find out what chipset you have. If you can't tell, compile all the chipsets into the kernel (AGP_INTEL AGP_VIA etc.) Right below /dev/agpgart (AGP SUPPORT) is "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" and you want that compiled INTO (Y) the kernel as well along with your graphics card (not chipset) INTO (Y) the kernel which is ATi Radeon. Right below that is "Support for frame buffer devices" and you want that compiled INTO (Y) the kernel. Within that, compile "Enable Firmware EDID" INTO (Y) the kernel. DO NOT COMPILE ANY ATI FRAME BUFFER SUPPORT COMPILED AS A MODULE OR INTO THE KERNEL!!!! Now you must turn on "Staging drivers" which is below HID Devices and USB support and the second option above "Firmware Drivers." Compile "Staging drivers" INTO (Y) the kernel and turn off 'Exclude Staging drivers from being built." Look for "Enable modesetting on radeon by default." It should be the 5th from the bottom. Last, you must compile firmware. You must turn on "CONFIG_FIRMWARE_IN_KERNEL" as this is extremely mandatory.

3a.) Compile the kernel:

sudo make all && sudo make modules_install && sudo make firmware && sudo make firmware_install && sudo make headers_check && sudo make headers_install && sudo make install

If sudo make install (only the last command) does not work:

sudo cp arch/x86/boot/bzImage /boot/vmlinuz-kms

Edit /boot/grub/menu.lst or /boot/grub/grub.cfg (which ever one exists) accordingly. I will not cover editing the file. Sorry. Please visit http://grub.enbug.org/grub.cfg and http://www.gnu.org/software/grub/manual/grub.html for more info. There should be some comments in that file to help you. An example all the way at the bottom is provided.

4a.) Restart your computer:

sudo reboot

You may also do "sudo telinit 6" without quotes depending on your preference. "sudo shutdown -r now" without quotes also works.

5a.) Clone all the required git repositories and switch to the required branches:

Radeon DDX driver and mesa:

mkdir devel && cd devel && git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-ati && git clone git://anongit.freedesktop.org/mesa/mesa

6a.) Clone additional git repositories for compiling DDX:

git clone git://anongit.freedesktop.org/xorg/util/macros && cd macros && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

git clone git://anongit.freedesktop.org/xcb/pthread-stubs && cd pthread-stubs && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

1b.) dri2proto and glproto (Debian and Ubuntu only

git clone git://anongit.freedesktop.org/xorg/proto/dri2proto && cd dri2proto && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

git clone git://anongit.freedesktop.org/xorg/proto/glproto && cd glproto && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

7a.) Now you must compile and install libdrm_radeon:

git clone git:anongit.freedesktop.org/mesa/drm && cd drm && ./autogen.sh --prefix=/usr --enable-radeon-experimental-api && sudo make install && cd ..

So far, if you haven't gotten any errors, please proceed onto compiling the DDX and Mesa (the order of everything from here on out doesn't matter

8a.) Compiling radeon DDX:

cd xf86-video-ati && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

For Ubuntu, Debian, Gentoo, and Fedora:

cd mesa && ./autogen.sh --prefix=/usr --disable-gallium --with-dri-drivers=r600 && make && sudo make install

For ArchLinux and Slackware:

cd mesa && ./autogen.sh --prefix=/usr --with-dri-driverdir=/usr/lib/xorg/modules/dri --with-dri-drivers=r600 --disable-gallium && make && sudo make install

For some linux distributions, this will be needed in addition to get full 3D acceleration (Safe to do this just in case):

sudo mkdir /usr/local/lib/dri && sudo cp lib/*_dri.so /usr/local/lib/dri

10a.) Making your linux distribution use radeonhd over radeon:

You will need to generate an xorg.conf file that does not look very simple, so it is easier to modify:

If on KDE and on Kubuntu, Debian, or Gentoo (write all this down before proceeding on paper preferabbly
sudo /etc/init.d/kdm stop
Log in (If you see a black screen with white text, you're doing great)
sudo Xorg -configure
sudo mv xorg.conf.new /etc/X11/xorg.conf

If on KDE on ArchLinux:
sudo /etc/rc.d/kdm stop
Log in (Black screen blah blah blah)
sudo Xorg -configure
sudo mv xorg.conf.new /etc/X11/xorg.conf

If you are on Xfce, just do the above with your according linux distribution but replace "kdm" with "xdm" WITHOUT QUOTES!
If you are on gnome (Ubuntu by default) with GDM replace "kdm" with "gdm" without quotes.

1c.) Editing the config file:

Replace nano with kwrite, gedit, or whatever your favorite editor is (I perfer nano

sudo nano /etc/X11/xorg.conf

The config file should be relativley big now. Please take your time doing this to avoid problems. Find where the file says:

Section "Device"

Below those comments under that (lines that start with #) you should see the following:

Driver "radeonhd"

Where it says "radeonhd" it might already say "radeon" but if it does not say "radeon" change it now:

Driver "radeon"

Now hit Control O (its not a zero) to overwrite the /etc/X11/xorg.conf file. To exit, press Control X.

If you like to use vi or vim (I _LOVE_ vim) then you need to press, "i" with no quotes, and edit the file accordingly. To write and exit, press Escape (all the way on the top left of your keyboard) and press ":wq" without quotes.

I recommend that you restart your computer now using any of the following commands:

sudo telinit 6
sudo shutdown -r now
sudo reboot

You are now finished.

Last edited by Neo_The_User; 10-18-2009 at 10:26 PM. Reason: Fixed some stuff
Reply With Quote
  #2  
Old 06-05-2009, 03:42 PM
DanL DanL is offline
Senior Member
 
Join Date: Oct 2007
Posts: 247
Default

Thanks for the guide. I'm going to try it on a fresh Sidux install.
Reply With Quote
  #3  
Old 06-05-2009, 04:01 PM
Neo_The_User Neo_The_User is offline
Junior Member
 
Join Date: Jun 2009
Location: Chicago, Illinois
Posts: 31
Default

I didn't cover Sidux but you can try it. Your welcome.
Reply With Quote
  #4  
Old 06-05-2009, 04:13 PM
agd5f agd5f is offline
X.Org ATI Driver Developer
 
Join Date: Dec 2007
Posts: 738
Default

Also, both radeon and radeonhd will work.
Reply With Quote
  #5  
Old 06-05-2009, 04:23 PM
Neo_The_User Neo_The_User is offline
Junior Member
 
Join Date: Jun 2009
Location: Chicago, Illinois
Posts: 31
Default

Yes agd5f. You told me that in irc.
Reply With Quote
  #6  
Old 06-05-2009, 04:55 PM
Fran Fran is offline
Phoronix Member
 
Join Date: Apr 2008
Location: A Coruņa (Spain)
Posts: 93
Default

I'm trying to do it the Gentoo Way (tm).

First problem, /usr/lib64/pkgconfig/libdrm.pc has:
Code:
...
Version: 2.3.1
...
and mesa of course says
Code:
Requested 'libdrm >= 2.4.3' but version of libdrm is 2.3.1

ERROR: media-libs/mesa-9999 failed.
That can be easily fixed by modifying the version in libdrm.pc by hand. But then mesa complains again, this time with:
Code:
configure: error: state tracker 'dri' doesn't exist

ERROR: media-libs/mesa-9999 failed.
Any clue? I have compiled other branches without problems.

(edit) Ok, sorry, inspecting the ebuild it seems it has a --with-state-trackers=glx,dri,egl line. I assume "dri" is not a state tracker anymore. I'll try without that.

Last edited by Fran; 06-05-2009 at 04:59 PM.
Reply With Quote
  #7  
Old 06-05-2009, 05:14 PM
Neo_The_User Neo_The_User is offline
Junior Member
 
Join Date: Jun 2009
Location: Chicago, Illinois
Posts: 31
Default

Well I guess you could try merging libdrm master with agd5f's 3D branch. Try giving this a shot (this is just a wild guess)

git clone git://anongit.freedesktop.org/~agd5f/drm && cd drm && git checkout -b r6xx-r7xx-3d origin/r6xx-r7xx-3d && git pull git://anongit.freedesktop.org/mesa/drm master

Start following the guide then from step 5a.

edit: ^Disregard that.

found a typo in the drm compilation process.

Last edited by Neo_The_User; 06-05-2009 at 05:22 PM.
Reply With Quote
  #8  
Old 06-05-2009, 05:44 PM
nanonyme nanonyme is offline
Senior Member
 
Join Date: Aug 2008
Location: Finland
Posts: 844
Default

Quote:
Originally Posted by Fran View Post
Code:
Requested 'libdrm >= 2.4.3' but version of libdrm is 2.3.1

ERROR: media-libs/mesa-9999 failed.
(edit) Ok, sorry, inspecting the ebuild it seems it has a --with-state-trackers=glx,dri,egl line. I assume "dri" is not a state tracker anymore. I'll try without that.
You shouldn't be having any --with-state-trackers variables at all afaik. Libdrm from agd5f's repo should be enough. Be *very* careful that you don't have anything extra in the Mesa configure flags. Be minimal and it should work.
Reply With Quote
  #9  
Old 06-05-2009, 05:53 PM
lucky_ lucky_ is offline
Phoronix Member
 
Join Date: Dec 2007
Posts: 88
Default

And is it worth the run ?
What is it's status ?
Reply With Quote
  #10  
Old 06-05-2009, 05:56 PM
Neo_The_User Neo_The_User is offline
Junior Member
 
Join Date: Jun 2009
Location: Chicago, Illinois
Posts: 31
Default

I would say, yes. It is worth it. I don't know its status because I've never used it no have I looked into the source code that much. All I know is that if you want bleeding-edge code, this is your route.
Reply With Quote
Reply

Tags
compiling, git, guide, howto, radeonhd

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2009 by Phoronix Media.