# 2.6.9-rc1-mm2 breaks ati-drivers

## Tronil

Just an FYI: seems to be the same problem as for the nvidia-drivers (pci_find_class being renamed) however it only breaks the direct rendering (so X should still work).

----------

## danone

Replace in the driver source the pci_find_class to pci_get_class it works for nvidia driver breakage

----------

## Tronil

Yep, that fixed it   :Smile: 

----------

## DaMouse

Anyone want me to make an overlay with a patch for this?

-DaMouse

----------

## miseiler

 *DaMouse wrote:*   

> Anyone want me to make an overlay with a patch for this?
> 
> -DaMouse

 

Yes, that would be quite helpful, especially for those of us that compile lots of different kernel versions for testing purposes.

----------

## luqas

Could someone point me in the more specific direction as to which file to change?  Thanks.

----------

## DaMouse

Portage overlay coming tonight, school now. Don't worry folks of manhatten.

-DaMouse

----------

## Tronil

 *Dryre wrote:*   

> Could someone point me in the more specific direction as to which file to change?  Thanks.

 

The file is

```
lib/modules/fglrx/build_mod/agpgart_be.c
```

----------

## DaMouse

See http://ck.dbdfleet.net/ati-drivers-3.9.0.tar.bz2 for overlay  :Smile:  I can't test these so any response is helpful.

-DaMouse

----------

## syscrash

I'm not sure if DaMouse's overlay has the 3.11.1 drivers in it, so I made my own patch and overlay:

http://syscrash2k.hopto.org/stuff/ati-mm2-overlay-3.11.1.tar.bz2

Just untar to /usr/local/portage and emerge ati-drivers.

----------

## DaMouse

can you say "ooops", i made these in a rush before school :/

-DaMouse

----------

## dencar

Thank you, syscrash2k, that worked fine with fglrx. Do you feel like doing one for svgalib-helper? 

<g>

----------

## iplayfast

Syscrash, could you explain to us how you did it? (I know programming, but don't know patches). 

Alternatively give overlay for 3.12 ati-drivers?

Thanks in advance

----------

## DaMouse

http://svn.esuna.co.uk/esuna/damouse-portage/media-video/ati-drivers/

Those are 3.12.0 drivers..  :Smile: 

cd root_of_said_portage

svn co http://svn.esuna.co.uk/esuna/damouse-portage/media-video/

-DaMouse

----------

## infirit

Had to edit the ebuild manualy for it to work. Damouse: either add a

```
cd ${WORKDIR}
```

betweenepatch ${FILESDIR}/fglrx-2.6-vmalloc-vmaddr.patch

epatch ${FILESDIR}/fglrx-3.12.0-pci_find_class.patch or rediff from ${WORKDIR}/lib/modules/fglrx

 :Wink: 

Thanks for the ebuild + patch   :Very Happy: 

[edit]

fixed patch

```
diff -uNp --exclude='*.orig' --exclude='*.rej' --exclude='*.dmn' -r build_mod/agpgart_be.c build_mod/agpgart_be.c

--- build_mod/agpgart_be.c      2004-07-15 20:30:05.000000000 +0100

+++ build_mod/agpgart_be.c      2004-09-11 16:11:25.258552352 +0100

@@ -718,7 +718,7 @@ int agp_generic_agp_v2_enable(u32 mode)

         *        AGP devices and collect their data.

         */

-       while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,

+       while ((device = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8,

                                        device)) != NULL) {

                pci_read_config_dword(device, 0x04, &scratch);

@@ -839,7 +839,7 @@ int agp_generic_agp_v2_enable(u32 mode)

         *        command registers.

         */

-       while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,

+       while ((device = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8,

                                        device)) != NULL) {

                pci_read_config_dword(device, 0x04, &scratch);

@@ -5068,7 +5068,7 @@ static int serverworks_agp_enable(u32 mo

         *        AGP devices and collect their data.

         */

-       while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,

+       while ((device = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8,

                                        device)) != NULL) {

                pci_read_config_dword(device, 0x04, &scratch);

@@ -5166,7 +5166,7 @@ static int serverworks_agp_enable(u32 mo

         *        command registers.

         */

-       while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,

+       while ((device = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8,

                                        device)) != NULL) {

                pci_read_config_dword(device, 0x04, &scratch);

@@ -6418,7 +6418,7 @@ static int __init agp_find_supported_dev

        struct pci_dev *dev = NULL;

     // locate host bridge device

-       if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)

+       if ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)

                return -ENODEV;

        agp_bridge.dev = dev;

@@ -6935,7 +6935,7 @@ static int __init agp_find_supported_dev

                     &agp_bridge.mode);

                                return hp_zx1_setup(dev);

                        }

-                       dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);

+                       dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, dev);

                } while (dev);

                return -ENODEV;

        }
```

----------

## syscrash

 *danone wrote:*   

> Replace in the driver source the pci_find_class to pci_get_class it works for nvidia driver breakage

 

That's exactly what I did  :Razz: 

----------

## Antioch

DaMouse's patch doesn't work. I copied the ebuild and the 3 patchfiles from his portage to my repsective portage directories, then I tried copying the code provided by infirit over my pci_find_class.patch, then digested the ebuild and emerged. I recieved:

>>> emerge (1 of 1) media-video/ati-drivers-3.12.0-r2 to /

>>> md5 src_uri  :Wink:  fglrx-4.3.0-3.12.0.i386.rpm

 * X11 implementation is xorg-x11.

>>> Unpacking source...

>>> Unpacking fglrx-4.3.0-3.12.0.i386.rpm

 * Applying fglrx-2.6-vmalloc-vmaddr.patch...                             [ ok ] * Applying fglrx-3.12.0-pci_find_class.patch...

 * Failed Patch: fglrx-3.12.0-pci_find_class.patch!

 *

 * Include in your bugreport the contents of:

 *

 *   /var/tmp/portage/ati-drivers-3.12.0-r2/temp/fglrx-3.12.0-pci_find_class.patch-14537.out

!!! ERROR: media-video/ati-drivers-3.12.0-r2 failed.

!!! Function epatch, Line 402, Exitcode 0

!!! Failed Patch: fglrx-3.12.0-pci_find_class.patch!

----------

## Antioch

couldnt get syscrashs to work either. Copied over the files, emerged "=ati-drivers-3.11.1" it did its thing. I then modprobed fglrx and still recieved the pci_find_class error.

----------

