# Ati + New kernel = problems

## darren3m

I'm using the newest vanilla kernel, 2.6.19-r3, and it seems to have broken my video drivers.  I know I should use a more stable kernel - but I'm using the sky2 driver for my lan board and it's broken from 2.6.16-2.6.19r1 ...  So when I try to emerge ati-drivers i get the errors listed below.  Any help would be appreciated.  I've also tried the ati drivers that I download from their site - and it still doesn't work, /var/log/Xorg.0.log shows that it detects that I'm using a x600 but:

 (II) Reloading /usr/lib64/xorg/modules/linux/libdrm.so

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device or address)

drmOpenDevice: open result is -1, (No such device or address)

drmOpenDevice: Open failed

[drm] failed to load kernel module "fglrx"

and

(EE) fglrx(0): DRIScreenInit failed!

(WW) fglrx(0): ***********************************************

(WW) fglrx(0): * DRI initialization failed!                  *

(WW) fglrx(0): * (maybe driver kernel module missing or bad) *

(WW) fglrx(0): * 2D acceleraton available (MMIO)             *

(WW) fglrx(0): * no 3D acceleration available                *

(WW) fglrx(0): ********************************************* *

Error messages from the EBUILD

make: Entering directory `/usr/src/linux-2.6.19-rc3'

  CC [M]  /var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.o

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:89:26: error: linux/config.h: No such file or directory

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:456: warning: initialization from incompatible pointer type

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c: In function 'firegl_stub_open':

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:579: warning: assignment discards qualifiers from pointer target type

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c: In function 'firegl_put_user_ptr':

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:1339: warning: cast from pointer to integer of different size

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:1339: warning: cast from pointer to integer of different size

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:1339: warning: cast from pointer to integer of different size

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:1339: warning: cast from pointer to integer of different size

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c: In function '__ke_request_irq':

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:2501: warning: passing argument 2 of 'request_irq' from incompatible pointer type

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c: In function '__ke_unregister_ioctl32_conversion':

/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:2524: warning: 'return' with a value, in function returning void

make[1]: *** [/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.o] Error 1

make: *** [_module_/var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod] Error 2

make: Leaving directory `/usr/src/linux-2.6.19-rc3'

 * DRM module not built

>>> Source compiled.

>>> Test phase [not enabled]: x11-drivers/ati-drivers-8.29.6

>>> Install ati-drivers-8.29.6 into /var/tmp/portage/ati-drivers-8.29.6/image/ category x11-drivers

 * Installing fglrx module

install: cannot stat `fglrx.ko': No such file or directory

!!! ERROR: x11-drivers/ati-drivers-8.29.6 failed.

Call stack:

  ebuild.sh, line 1546:   Called dyn_install

  ebuild.sh, line 1020:   Called src_install

  ati-drivers-8.29.6.ebuild, line 204:   Called linux-mod_src_install

  linux-mod.eclass, line 510:   Called die

!!! doins fglrx.ko failed

!!! If you need support, post the topmost build error, and the call stack if relevant.

----------

## wynn

 * wrote:*   

> /var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:89:26: error: linux/config.h: No such file or directory

 This is the only error and seems to be because /usr/src/linux points to a kernel source directory which hasn't been used for a compilation.

Above this, in the compilation messages, there are usually a few lines saying that it has found the kernel source directory pointed at by /usr/src/linux. There's no errors or warnings there, are there?

----------

## TheX

I had similar problems when i updated my kernel.

You just have to ..

```
emerge ati-drivers ati-drivers-extra
```

again.

 :Wink:   TheX

----------

## darren3m

 *wynn wrote:*   

>  * wrote:*   /var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.c:89:26: error: linux/config.h: No such file or directory This is the only error and seems to be because /usr/src/linux points to a kernel source directory which hasn't been used for a compilation.
> 
> Above this, in the compilation messages, there are usually a few lines saying that it has found the kernel source directory pointed at by /usr/src/linux. There's no errors or warnings there, are there?

 

This is the full ebuild messages above that point :

>>> Emerging (1 of 1) x11-drivers/ati-drivers-8.29.6 to /

 * ati-driver-installer-8.29.6.run MD5  :Wink:  ...                                                    [ ok ]

 * ati-driver-installer-8.29.6.run RMD160  :Wink:  ...                                                 [ ok ]

 * ati-driver-installer-8.29.6.run SHA1  :Wink:  ...                                                   [ ok ]

 * ati-driver-installer-8.29.6.run SHA256  :Wink:  ...                                                 [ ok ]

 * ati-driver-installer-8.29.6.run size  :Wink:  ...                                                   [ ok ]

 * checking ebuild checksums  :Wink:  ...                                                              [ ok ]

 * checking auxfile checksums  :Wink:  ...                                                             [ ok ]

 * checking miscfile checksums  :Wink:  ...                                                            [ ok ]

 * checking ati-driver-installer-8.29.6.run  :Wink:  ...                                               [ ok ]

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.19-rc3

 * Checking for MTRR support enabled ...                                                          [ ok ]

 * Checking for AGP support enabled ...                                                           [ ok ]

 * Checking for DRM support disabled ...                                                          [ ok ]

 * X11 implementation is xorg-x11.

>>> Unpacking source...

 * Unpacking Ati drivers ...                                                                      [ ok ]

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/ati-drivers-8.29.6 ...

 * Building the DRM module...

make: Entering directory `/usr/src/linux-2.6.19-rc3'

  CC [M]  /var/tmp/portage/ati-drivers-8.29.6/work/common/lib/modules/fglrx/build_mod/firegl_public.o

----------

## darren3m

 *TheX wrote:*   

> I had similar problems when i updated my kernel.
> 
> You just have to ..
> 
> ```
> ...

 

Wish it was that simple...   :Rolling Eyes: 

----------

## darren3m

I've also tried manually installing the drivers from ATI's website - it gives me a similar error which makes me think that this is kernel related.  I'm posting /usr/share/fglrx/fglrx-install.log for the ATI installer

[Message] Kernel Module : Trying to install a precompiled kernel module.

[Message] Kernel Module : Precompiled kernel module version mismatched.

[Message] Kernel Module : Found kernel module build environment, generating kernel module now.

ATI module generator V 2.0

==========================

initializing...

cleaning...

patching 'highmem.h'...

assuming new VMA API since we do have kernel 2.6.x...

 Assuming default VMAP API

doing Makefile based build for kernel 2.6.x and higher

make -C /lib/modules/2.6.19-rc3/build SUBDIRS=/lib64/modules/fglrx/build_mod/2.6.x modules

make[1]: Entering directory `/usr/src/linux-2.6.19-rc3'

  CC [M]  /lib64/modules/fglrx/build_mod/2.6.x/firegl_public.o

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:89:26: error: linux/config.h: No such file or direc

tory

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:456: warning: initialization from incompatible poin

ter type

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function 'firegl_stub_open':

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:579: warning: assignment discards qualifiers from p

ointer target type

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function 'firegl_put_user_ptr':

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:1339: warning: cast from pointer to integer of diff

erent size

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:1339: warning: cast from pointer to integer of diff

erent size

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:1339: warning: cast from pointer to integer of diff

erent size

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:1339: warning: cast from pointer to integer of diff

erent size

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function '__ke_request_irq':

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:2501: warning: passing argument 2 of 'request_irq'

from incompatible pointer type

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function '__ke_unregister_ioctl32_conversion':

/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.c:2524: warning: 'return' with a value, in function r

eturning void

make[2]: *** [/lib64/modules/fglrx/build_mod/2.6.x/firegl_public.o] Error 1

make[1]: *** [_module_/lib64/modules/fglrx/build_mod/2.6.x] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.19-rc3'

make: *** [kmod_build] Error 2

build failed with return value 2

[Error] Kernel Module : Failed to compile kernel module - please consult readme.

----------

## emo_tr

I voted for Aaron Shi's design over gencorps because I found the darker shade of purple to be more powerful. I disliked the lavendar colour for gencorp but really liked the design. Iris was clean, and I might have voted for it if it wasn't green. I don't know about others, but when I see green in regards to linux, I think Suse. 

Nice work from all finalists.

----------

## emo_tr

Ooops, I made mistake.

sorry

----------

## emo_tr

 :Very Happy:  *emo_tr wrote:*   

> Ooops, I made mistake.
> 
> sorry

 

----------

## darren3m

 *emo_tr wrote:*   

>  *emo_tr wrote:*   Ooops, I made mistake.
> 
> sorry 

 

Yep - not once, but thrice.   :Razz: 

So - anyone else have any thoughts on this?  I'd love to not have make a choice between internet and 3D

----------

## K T A

Well, I have no options for you - but to tell you you are not alone. I have the same problem with the latest mm-sources (2.6.19-rc3-mm1) which I need to access my build-in card reader... I guess we have to wait for a driver update...

KTA

----------

## wynn

The previous post suggesting that the error "seems to be because /usr/src/linux points to a kernel source directory which hasn't been used for a compilation" was wrong.

There is a thread here and here discussing it and this fix says *Quote:*   

> This problem is due to the firegl_public code relying upon linux/config.h, which has been removed from Fedora Core 6. This configuration header file is no longer used by the kernel and was only included to maintain backward compatibility.

 The quoted fix also has a suggestion for edits to firegl_public.c, drm.h, and drmP.h (removing the #include <linux/config.h>) to workaround the problem.

Alternatively 8.30.3 is now available from http://ati.amd.com/ which may have fixed the problem.

----------

## darren3m

 *wynn wrote:*   

> The previous post suggesting that the error "seems to be because /usr/src/linux points to a kernel source directory which hasn't been used for a compilation" was wrong.
> 
> There is a thread here and here discussing it and this fix says *Quote:*   This problem is due to the firegl_public code relying upon linux/config.h, which has been removed from Fedora Core 6. This configuration header file is no longer used by the kernel and was only included to maintain backward compatibility. The quoted fix also has a suggestion for edits to firegl_public.c, drm.h, and drmP.h (removing the #include <linux/config.h>) to workaround the problem.
> 
> Alternatively 8.30.3 is now available from http://ati.amd.com/ which may have fixed the problem.

 

Nice work!  Well the 8.30.3 revision still does not work but if I place the new config.h into my /lib64/modules/.../ directory that they montion (I'm running an AMD64 so /lib64/ instead of /lib/) it compiles with tons of warnings, however - it still compiles. On a quick reboot of the X-server it works like a charm.  Thanks for the help and great sleuthing!

----------

## mimosinnet

I have upgraded gentoo-sources kernel-2.6.18-r2 and I am getting the same problem. 

```
mimosinnet mimosinnet # emerge -av ati-drivers

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] x11-drivers/ati-drivers-8.27.10-r1  USE="doc opengl -acpi" 0 kB
```

...

```
make[1]: *** [/var/tmp/portage/ati-drivers-8.27.10-r1/work/common/lib/modules/fg

lrx/build_mod/firegl_public.o] Error 1

make: *** [_module_/var/tmp/portage/ati-drivers-8.27.10-r1/work/common/lib/modul                                                            es/fglrx/build_mod] Error 2

make: Leaving directory `/usr/src/linux-2.6.18-gentoo-r2'

 * DRM module not built

>>> Source compiled.

>>> Test phase [not enabled]: x11-drivers/ati-drivers-8.27.10-r1

>>> Install ati-drivers-8.27.10-r1 into /var/tmp/portage/ati-drivers-8.27.10-r1/                                                            image/ category x11-drivers

 * Installing fglrx module

install: ha fallat stat() sobre «fglrx.ko»: El fitxer o directori no existeix

!!! ERROR: x11-drivers/ati-drivers-8.27.10-r1 failed.

Call stack:

  ebuild.sh, line 1546:   Called dyn_install

  ebuild.sh, line 1020:   Called src_install

  ati-drivers-8.27.10-r1.ebuild, line 205:   Called linux-mod_src_install

  linux-mod.eclass, line 510:   Called die

!!! doins fglrx.ko failed
```

----------

## meyert

There are several patches in 2.6.19 that prevent the newest ati-driver-8.30.3 from building:

1.) removal of config.h

2.) removal of pt_regs structure from all interrupt handlers.

this patch fixes all errors:

diff --git a/common/lib/modules/fglrx/build_mod/agp3.c b/common/lib/modules/fglrx/build_mod/agp3.c

index c82ce9d..626c2a5 100644

--- a/common/lib/modules/fglrx/build_mod/agp3.c

+++ b/common/lib/modules/fglrx/build_mod/agp3.c

@@ -61,7 +61,6 @@

 #include <linux/modversions.h>

 #endif

 #endif

-#include <linux/config.h>

 #include <linux/module.h>

 #include <linux/pci.h>

 #include <linux/init.h>

diff --git a/common/lib/modules/fglrx/build_mod/agp_backend.h b/common/lib/modules/fglrx/build_mod/agp_backend.h

diff --git a/common/lib/modules/fglrx/build_mod/agpgart.h b/common/lib/modules/fglrx/build_mod/agpgart.h

diff --git a/common/lib/modules/fglrx/build_mod/agpgart_be.c b/common/lib/modules/fglrx/build_mod/agpgart_be.c

index de5e61b..829ca09 100644

--- a/common/lib/modules/fglrx/build_mod/agpgart_be.c

+++ b/common/lib/modules/fglrx/build_mod/agpgart_be.c

@@ -99,7 +99,6 @@

 #endif

 #endif

-#include <linux/config.h>

 #include <linux/module.h>

diff --git a/common/lib/modules/fglrx/build_mod/drm.h b/common/lib/modules/fglrx/build_mod/drm.h

index 84e97fa..3083eb2 100644

--- a/common/lib/modules/fglrx/build_mod/drm.h

+++ b/common/lib/modules/fglrx/build_mod/drm.h

@@ -38,7 +38,6 @@

 #define _DRM_H_

 #if defined(__linux__)

-#include <linux/config.h>

 #include <asm/ioctl.h>		/* For _IO* macros */

 #define DRM_IOCTL_NR(n)		_IOC_NR(n)

 #define DRM_IOC_VOID		_IOC_NONE

diff --git a/common/lib/modules/fglrx/build_mod/drmP.h b/common/lib/modules/fglrx/build_mod/drmP.h

index 41cccd6..f18e0df 100644

--- a/common/lib/modules/fglrx/build_mod/drmP.h

+++ b/common/lib/modules/fglrx/build_mod/drmP.h

@@ -42,7 +42,6 @@

  * can build the DRM (part of PI DRI). 4/21/2000 S + B */

 #include <asm/current.h>

 #endif /* __alpha__ */

-#include <linux/config.h>

 #include <linux/module.h>

 #include <linux/kernel.h>

 #include <linux/miscdevice.h>

diff --git a/common/lib/modules/fglrx/build_mod/drm_compat.h b/common/lib/modules/fglrx/build_mod/drm_compat.h

diff --git a/common/lib/modules/fglrx/build_mod/drm_os_linux.h b/common/lib/modules/fglrx/build_mod/drm_os_linux.h

diff --git a/common/lib/modules/fglrx/build_mod/drm_proc.h b/common/lib/modules/fglrx/build_mod/drm_proc.h

diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c

index 807cf91..0c2e6fc 100644

--- a/common/lib/modules/fglrx/build_mod/firegl_public.c

+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c

@@ -69,7 +69,6 @@

 #ifdef CONFIG_MEM_MIRROR

 /* Prevent linux/config.h from being included again in subsequent

  * kernel headers as that would redefine CONFIG_MEM_MIRROR. */

-#include <linux/config.h>

 #warning "Disabling CONFIG_MEM_MIRROR because it does not work with non-GPL modules."

 #warning "This will break page tracking when the fglrx kernel module is used."

 #undef CONFIG_MEM_MIRROR

@@ -86,7 +85,6 @@

 #include <asm/unistd.h> /* for installing the patch wrapper */

 #include <linux/module.h>

-#include <linux/config.h>

 #include <linux/kernel.h>

 #include <linux/fs.h>

 #include <linux/proc_fs.h>

@@ -2494,14 +2492,15 @@ void ATI_API_CALL __ke_free_irq(unsigned

 #else

 static void ATI_API_CALL (*irq_handler_func)(int, void*, void*); /* function pointer variable */

-static irqreturn_t ke_irq_handler_wrap(int irq, void *arg1, struct pt_regs *regs)

+static irqreturn_t ke_irq_handler_wrap(int irq, void *arg1)

 {

+    struct pt_regs *regs=get_irq_regs();

     irq_handler_func(irq, arg1, regs);

     return IRQ_HANDLED;

 }

 int ATI_API_CALL __ke_request_irq(unsigned int irq, 

-    void (*ATI_API_CALL handler)(int, void *, void *),

+    void (*ATI_API_CALL handler)(int, void *),

     const char *dev_name, void *dev_id)

 {

     irq_handler_func = handler;

diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.h b/common/lib/modules/fglrx/build_mod/firegl_public.h

index 2f50a72..d86e854 100644

--- a/common/lib/modules/fglrx/build_mod/firegl_public.h

+++ b/common/lib/modules/fglrx/build_mod/firegl_public.h

@@ -569,7 +569,7 @@ extern int ATI_API_CALL __ke_in(unsigned

 extern void ATI_API_CALL __ke_enable_irq(int irq);

 extern void ATI_API_CALL __ke_disable_irq(int irq);

-extern int ATI_API_CALL __ke_request_irq(unsigned int irq, void (*ATI_API_CALL handler)(int, void *, void *), const char *dev_name, void *dev_id);

+extern int ATI_API_CALL __ke_request_irq(unsigned int irq, void (*ATI_API_CALL handler)(int, void *), const char *dev_name, void *dev_id);

 extern void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id);

 /*****************************************************************************/

----------

