# ATI + kernel

## martin1512

Hello, can someone please help me to set my kernel for ATI card ?

I'm fresh new Gentoo user, I installed it from minimal CD - well everything went ok, until I rebooted to new system and wanted to install X server.

During installation I used genekernel to set up my kernel, but it havent set it properly. So I recompilled kernel (using genkernel) with --menuconfig option and i constumized it how it's written in this guide : http://www.gentoo.org/doc/en/xorg-config.xml

```

Device Drivers --->

  Input device support --->

  <*>  Event interface

Device Drivers --->

  Graphics support --->

    Support for frame buffer devices --->

    (Disable all drivers, including VGA, Intel, nVidia, and ATI)

    (Further down, enable basic console support. KMS uses this.)

    Console display driver support --->

      <*>  Framebuffer Console Support

(Setup the kernel to use the radeon-ucode firmware)

Device Drivers --->

  Generic Driver Options --->

  [*]  Include in-kernel firmware blobs in kernel binary

  # RadeonHD 2000, 3000, and 4000 series cards:

  (radeon/R600_rlc.bin radeon/R700_rlc.bin) External firmware blobs

  # RadeonHD 5000, a.k.a Evergreen, and newer cards:

  (radeon/CEDAR_me.bin radeon/CEDAR_pfp.bin radeon/CEDAR_rlc.bin

   radeon/CYPRESS_me.bin radeon/CYPRESS_pfp.bin radeon/CYPRESS_rlc.bin

   radeon/JUNIPER_me.bin radeon/JUNIPER_pfp.bin radeon/JUNIPER_rlc.bin

   radeon/REDWOOD_me.bin radeon/REDWOOD_pfp.bin 

   radeon/REDWOOD_rlc.bin) External firmware blobs

   (/lib/firmware/) Firmware blobs root directory

(Enable Radeon KMS support)

Device Drivers --->

  Graphics support --->

  <*>  Direct Rendering Manager --->

  <*>    ATI Radeon

  [*]      Enable modesetting on radeon by default

```

Then i quit configuration and kernel compiled. When I rebooted, i got this while booting :

```
platform radeon-cp.0: firmware: using built-in firmware radeon/RV620_pfp.bin

platform radeon-cp.0: firmware: using built-in firmware radeon/RV620_me.bin

platform radeon-cp.0: firmware: requesting radeon/R600_rlc.bin

```

Those are 3 last lines in "boot-console", after 5 minutes screen turns black and stays like that. I tried to switch between screens with Alt+Fn also Ctrl+Alt+Fn but screen remains black so I cannot get even console.

My graphics card is ATI Mobility Radeon HD3450. Has someone idea how to solve this problem ?

Thanks

----------

## ssteinberg

Did you actually emerge radeon-ucode?

----------

## martin1512

oh no, I totally overlooked that  :Sad: ...

But, I just chrooted my Gentoo via minimal CD and executed 'emerge radeon-ucode' and it did not help...

----------

## ssteinberg

Rebuild kernel after that.

----------

## martin1512

I rebuilt it, same problem...

----------

## NeddySeagoon

martin1512,

```
emerge wgetpaste

wgetpaste /var/log/Xorg.0.log
```

and post the URL you get back.

That will show what Xorg did as it started.

----------

## martin1512

http://paste.pocoo.org/show/266145/

----------

## NeddySeagoon

martin1512,

Your log tells that Xorg started but with no hardware 3D acceleration. I suspect that you don't have a window manager to make Xorg do anything after it starts.

Please tell us how you are starting Xorg and post the URL from 

```
emerge --info | wgetpaste
```

so we can see your settings.

If you want a WAG, while you wait for replies, do 

```
emerge -1 twm xterm
```

then try the startx command.

----------

## hedmo

martin1512

have you got a desktop enviroment like kde and have you set the command to start it  :Question: 

----------

## martin1512

I installed WAG, its working good after executing startx. I havent installed any windows manager cos I choosed gnome-desktop option during installation so I tought its alredy installed... I found gentoo-gnome howto so i will try it tommorow... 

Here is URL:

http://paste.pocoo.org/show/266392

----------

## NeddySeagoon

martin1512,

Your Xorg was starting but it had nothing to do, so it showed you a black screen.

Your original Xorg.0.log file shows that your kernel is not quite right to support 3D hardware acceleration but we can fix that when you have gnome running.

Keep in mind gentoo gives you two things.

1. The packages you request

2. The packages needed to support the packages you request.

This means that if you haven't asked for it yet, its not installed.

----------

## martin1512

Great news! I followed gentoo-gnome howto and after 22hour gnome compilation my startx emitted fully working X environment  :Smile: ))

But I am little confused, I am running my X on kernel which was generated by genkernel and I am not sure if it was set for my ATI card.

I executed lsmod and found line : CONFIG_VGA_ARB=y does it mean that my ATI is not set ?

----------

## NeddySeagoon

martin1512,

Now everything opertates, its time to make it better. Please post the content of /var/log/Xorg.0.log as it is now.

I have a feeling you don't have dri and dri2 support, which is probably a kernel issue.

We will also need your lspci output.

----------

## martin1512

/var/log/Xorg.0.log:

http://paste.pocoo.org/show/267226/

lspci:

http://paste.pocoo.org/show/267228/

----------

## NeddySeagoon

martin1512,

```
drmOpenDevice: node name is /dev/dri/card0

[drm] failed to load kernel module "radeon"

(EE) RADEON(0): [dri] RADEONDRIGetVersion failed to open the DRM

[dri] Disabling DRI.

...

(WW) RADEON(0): Direct rendering disabled

(EE) RADEON(0): Acceleration initialization failed

```

Shows that your kernel is missing Direct Rendering Support.

You need  

```
<*> /dev/agpgart (AGP Support)  --->
```

and in that menu, choose  

```
<*>   AMD Opteron/Athlon64 on-CPU GART support
```

You also need  

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

and in its submenu choose

```
  │ │     <*>   ATI Radeon                                                            │ │  

  │ │     [ ]     Enable modesetting on radeon by default - NEW DRIVER (NEW) 
```

I know nothing about the modesetting.

I've shown evrything as built in but modules should work too.

Under 

```
-*- Support for frame buffer devices  ---> 
```

 you must not choose 

```
< >   ATI Radeon display support 
```

as the kernel driver and Xorg driver often fight over the hardware, with the result that neither work properly.  I don't use Raden so I don't know if its true for you but it is best left as an experiment for another day.

If you want a framebuffer console, choose either  

```
[*]   VESA VGA graphics support 
```

or 

```
<*>   Userspace VESA VGA graphics support
```

 both are hardware agnostic.

Lastly, you will need a minimal /etc/X11/xorg.conf file. it needs to contain

```
Section "DRI"

   Mode 660

EndSection
```

Users will need to be in the video group to use direct rendering

----------

## martin1512

I found everything except 

```
<*> /dev/agpgart (AGP Support)  --->
```

Its not in Device Drivers --> Graphics Support -->, why ?

----------

## NeddySeagoon

martin1512,

The help says

```

 ...

  │ You should say Y here if you want to use GLX or DRI.                                                                                                                                       │  

  │                                                                                                                                                                                            │  

  │ If unsure, say N.                                                                                                                                                                          │  

  │                                                                                                                                                                                            │  

  │ Symbol: AGP [=y]                                                                                                                                                                           │  

  │ Prompt: /dev/agpgart (AGP Support)                                                                                                                                                         │  

  │   Defined at drivers/char/agp/Kconfig:1                                                                                                                                                    │  

  │   Depends on: HAS_IOMEM [=y] && (ALPHA [=ALPHA] || IA64 [=IA64] || PARISC [=PARISC] || PPC [=PPC] || X86 [=y]) && \                                                                        │  

  │ PCI [=y]                                                                                                                                                                                   │  

  │   Location:                                                                                                                                                                                │  

  │     -> Device Drivers                                                                                                                                                                      │  

  │       -> Graphics support  
```

So its hidden until the Depends on is satisfiled

----------

## rickythesk8r

To turn 

```
platform radeon-cp.0: firmware: using built-in firmware radeon/RV620_pfp.bin

platform radeon-cp.0: firmware: using built-in firmware radeon/RV620_me.bin

platform radeon-cp.0: firmware: requesting radeon/R600_rlc.bin 
```

into

```

[    0.281876] platform radeon_cp.0: firmware: using built-in firmware radeon/RS780_pfp.bin

[    0.281986] platform radeon_cp.0: firmware: using built-in firmware radeon/RS780_me.bin

[    0.282095] platform radeon_cp.0: firmware: using built-in firmware radeon/R600_rlc.bin
```

you should try the instructions https://forums.gentoo.org/viewtopic-t-845142-highlight-r600rlc+bin.html

```
CONFIG_STANDALONE=y

CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_FW_LOADER=y

CONFIG_FIRMWARE_IN_KERNEL=y

CONFIG_EXTRA_FIRMWARE="radeon/R600_rlc.bin"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

```

For me, the key was the line CONFIG_PREVENT_FIRMWARE_BUILD=y. Otherwise the name of the file R600_rlc.bin gets mangled into R600_rlc.bin.gen.{S,o}. I also made sure to observe the division between "/lib/firmware" and "radeon/R600_rlc.bin" but I don't actually know whether that's important or not.

----------

