Rage3D Discussion Area

Rage3D Discussion Area (http://www.rage3d.com/board/index.php)
-   Drivers (http://www.rage3d.com/board/forumdisplay.php?f=88)
-   -   Patch for drivers against 2.6.10 (http://www.rage3d.com/board/showthread.php?t=33798874)

mtippett Jan 8, 2005 03:29 AM

Patch for drivers against 2.6.10
 
Hi.

Find attached a patch against the upcoming drivers that will be required for 2.6.10 kernels. It should apply with warnings against older drivers - but I will leave that as an exercise for the reader. This will not be present in the soon to be released drivers (8.8) - they have already gone 'gold' so to speak, but will be in subsequent releases (8.10 and beyond).

It handles the API change - both syntactic and semantic regarding the pci_find_class call as well as some header file movements regarding lock_page.

Regards,

Matthew

PS you may have noticed that the version major.minor is now predictable... We will always talk about a driver in the 8.8, 8.10, etc stream... The patch level carries little information apart from the fact that patches have been applied.
Code:

--- agpgart_be.c 2005-01-06 9:05:02.000000000 +0100
+++ agpgart_be.c 2005-01-06 9:19:16.000000000 +0100

@@ -255,6 +255,12 @@
 }
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+#define firegl_pci_find_class(class,from) pci_get_class(class,from)
+#else
+#define firegl_pci_find_class(class,from) pci_find_class(class,from)
+#endif
+
 int agp_backend_acquire(void)
 {
        if (agp_bridge.type == NOT_SUPPORTED) {
@@ -718,7 +724,7 @@
          *        AGP devices and collect their data.
          */
 
-        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
+        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                        device)) != NULL) {
                pci_read_config_dword(device, 0x04, &scratch);
 
@@ -794,6 +800,13 @@
                                command &= ~0x00000001;
                }
        }
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device);
+#endif
+
        /*
          * PASS2: Figure out the 4X/2X/1X setting and enable the
          *        target (our motherboard chipset).
@@ -839,8 +852,9 @@
          *        command registers.
          */
 
-        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
+        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                        device)) != NULL) {
+
                pci_read_config_dword(device, 0x04, &scratch);
 
                if (!(scratch & 0x00100000))
@@ -871,6 +885,12 @@
        }
        }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device);
+#endif
+
    return 0; /* success */
 }
 
@@ -5119,8 +5139,9 @@
          *        AGP devices and collect their data.
          */
 
-        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
+        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                        device)) != NULL) {
+
                pci_read_config_dword(device, 0x04, &scratch);
 
                if (!(scratch & 0x00100000))
@@ -5187,6 +5208,13 @@
                                command &= ~0x00000001;
                }
        }
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device);
+#endif
+
        /*
          * PASS2: Figure out the 4X/2X/1X setting and enable the
          *        target (our motherboard chipset).
@@ -5217,8 +5245,9 @@
          *        command registers.
          */
 
-        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
+        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                        device)) != NULL) {
+
                pci_read_config_dword(device, 0x04, &scratch);
 
                if (!(scratch & 0x00100000))
@@ -5249,6 +5278,12 @@
        }
        }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device);
+#endif
+
    return(0); /* success */
 }
 
@@ -6494,10 +6529,10 @@
    // locate host bridge device
 #ifdef __x86_64__
    do {
-        dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
+        dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
    } while((dev) && !agp_check_supported_device(dev));
 #else
-    if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
+    if ((dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
        return -ENODEV;
 #endif
 
@@ -7040,8 +7075,12 @@
                    &agp_bridge.mode);
                                return hp_zx1_setup(dev);
                        }
-                        dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
+                        dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
                } while (dev);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+                if(dev) pci_dev_put(dev);
+#endif
                return -ENODEV;
        }
 #endif        /* __ia64__ */
@@ -7462,6 +7501,11 @@
        agp_bridge.free_gatt_table();
        vfree(agp_bridge.key_list);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+        // decrease the reference count.
+        pci_dev_put(agp_bridge.dev);
+#endif
+
        if (agp_bridge.needs_scratch_page == TRUE) {
                agp_bridge.scratch_page &= ~(0x00000fff);
                agp_bridge.agp_destroy_page((unsigned long)


--- firegl_public.c 2005-01-06 9:05:02.000000000 +0100
+++ firegl_public.c 2005-01-06 9:19:16.000000000 +0100
@@ -88,6 +88,7 @@
 #include <linux/smp_lock.h>
 // newer SuSE kernels need this
 #include <linux/highmem.h>
+#include <linux/pagemap.h> // for lock_page and unlock_page
 
 #if defined(__ia64__)
 #include <linux/vmalloc.h>


Exxtreme Jan 8, 2005 04:46 AM

That's the reason why i love Gentoo linux. All you need is an "emerge ati-drivers" and all necessary patches will be applied before the installation. :)

FCA Jan 8, 2005 05:15 AM

Ah good. I assume we need a seperate patch for this driver to work on 2.6.10-mmX kernels?
I get a compile error with it, someone moved some stuff around. Note that the offending patch is in the linus.patch part of mm, making it a virtual certainty that it will be in 2.6.11...

Error:
Code:

make: Entering directory `/usr/src/linux-2.6.10-mm2'
  CC [M]  /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/agp3.o
  CC [M]  /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/nvidia-agp.o
  CC [M]  /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/agpgart_be.o
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/agpgart_be.c: In function `__fgl_agp_init':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/agpgart_be.c:7470: warning: `pm_register' is deprecated (declared at include/linux/pm.h:106)
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/agpgart_be.c: In function `__fgl_agp_cleanup':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/agpgart_be.c:7480: warning: `pm_unregister_all' is deprecated (declared at include/linux/pm.h:116)
  CC [M]  /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/i7505-agp.o
  CC [M]  /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.o
In file included from drivers/char/drm/drm_proc.h:40,
                from /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:311:
drivers/char/drm/drmP.h:786: error: conflicting types for 'drm_vm_open'
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.h:123: error: previous declaration of 'drm_vm_open' was here
drivers/char/drm/drmP.h:786: error: conflicting types for 'drm_vm_open'
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.h:123: error: previous declaration of 'drm_vm_open' was here
drivers/char/drm/drmP.h:787: error: conflicting types for 'drm_vm_close'
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.h:124: error: previous declaration of 'drm_vm_close' was here
drivers/char/drm/drmP.h:787: error: conflicting types for 'drm_vm_close'
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.h:124: error: previous declaration of 'drm_vm_close' was here
In file included from /var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:311:
drivers/char/drm/drm_proc.h: In function `FGLDRM_name_info':
drivers/char/drm/drm_proc.h:186: error: structure has no member named `name'
drivers/char/drm/drm_proc.h:189: error: structure has no member named `name'
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_stub_putminor':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:519: warning: `inter_module_put' is deprecated (declared at include/linux/module.h:577)
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:521: warning: `inter_module_unregister' is deprecated (declared at include/linux/module.h:573)
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_stub_register':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:541: warning: `inter_module_register' is deprecated (declared at include/linux/module.h:572)
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:572: warning: `inter_module_put' is deprecated (declared at include/linux/module.h:577)
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_block_all_signals':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:815: warning: passing arg 1 of `block_all_signals' from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_get_vm_phys_addr':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:1598: warning: passing arg 1 of `pmd_offset' from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_request_irq':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:1908: warning: assignment from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `do_vm_shm_nopage':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:2069: warning: passing arg 1 of `pmd_offset' from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_vm_phys_addr_str':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:2440: warning: passing arg 1 of `pmd_offset' from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: At top level:
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:2528: warning: initialization from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_vm_map':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:2589: warning: implicit declaration of function `remap_page_range'
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_uninit':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3014: warning: `inter_module_put' is deprecated (declared at include/linux/module.h:577)
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_allocate_memory':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3058: warning: passing arg 1 of pointer to function makes pointer from integer without a cast
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3058: error: too few arguments to function
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_enable':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3092: warning: passing arg 1 of pointer to function makes pointer from integer without a cast
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3092: error: too few arguments to function
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_acquire':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3139: error: too few arguments to function
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3139: warning: return makes integer from pointer without a cast
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_release':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3150: error: too few arguments to function
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_copy_info':
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3170: warning: passing arg 1 of pointer to function from incompatible pointer type
/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.c:3170: error: too few arguments to function
make[1]: *** [/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod/firegl_public.o] Error 1
make: *** [_module_/var/tmp/portage/ati-drivers-3.14.6/work/lib/modules/fglrx/build_mod] Error 2
make: Leaving directory `/usr/src/linux-2.6.10-mm2'

I have no clue where to start patching this. The deprecations are only warnings, but those will be errors in the future I guess. The incompatible pointer type warnings seem harmless, but I have no clue how they influence the drivers behaviour.

d4rk74m4 Jan 8, 2005 09:31 AM

FCA, you need to copy drm.h drmP.h and drm_proc.h from a vanilla kernel to compile 3.14.6 against 2.6.10-mm1, see this post for how I got it to work:
http://www.rage3d.com/board/showpost...9&postcount=11

Swoosh Jan 8, 2005 12:10 PM

Does this mean that the new drivers (8.8) may be coming very soon? :lol:

arokh- Jan 8, 2005 02:17 PM

Excellent! Just knowing that the new drivers will run well on my bleeding edge system gives me some comfort. Right now working drivers are most important to me.

Thanks for the patch and update mr Tippett!

mtippett Jan 8, 2005 02:37 PM

Quote:

Originally Posted by arokh-
Excellent! Just knowing that the new drivers will run well on my bleeding edge system gives me some comfort. Right now working drivers are most important to me.

Thanks for the patch and update mr Tippett!

Don't thank me, it is the team that works for me that does the real work. So thank ATI's Linux team.

Regards,

Matthew

black hole sun Jan 17, 2005 03:23 PM

I am an idiot, nevermind

EVAPilot Jan 17, 2005 06:15 PM

Nitro/CK/2.6.11 users should refer to:
http://www.rage3d.com/board/showpost...6&postcount=52

Exxtreme Jan 17, 2005 06:17 PM

mtippett's patch works very well for me. I have installed the driver without any problem on the 2.6.10 kernel.

nik1982 Jan 17, 2005 06:41 PM

mm-sources
 
With mm-sources i always get this errors:



CC [M] /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agp3.o
CC [M] /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/nvidia-agp.o
CC [M] /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.o
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c: In function `x86_64_insert_memory':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c:3791: Warnung: Ganzzahlkonstante ist zu groß für »long«-Typ
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c: In function `agp_find_supported_device':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c:6499: Warnung: Variable »cap_ptr« wird nicht verwendet
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c: In function `__fgl_agp_init':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c:7575: Warnung: »pm_register« ist veraltet (deklariert bei include
/linux/pm.h:106)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c: In function `__fgl_agp_cleanup':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c:7585: Warnung: »pm_unregister_all« ist veraltet (deklariert bei i
nclude/linux/pm.h:116)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c: At top level:
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.c:6480: Warnung: »agp_check_supported_device« definiert, aber nicht
verwendet
CC [M] /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/i7505-agp.o
CC [M] /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.o
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_stub_putminor':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:503: Warnung: »inter_module_put« ist veraltet (deklariert bei
include/linux/module.h:578)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:505: Warnung: »inter_module_unregister« ist veraltet (deklarie
rt bei include/linux/module.h:574)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_stub_register':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:525: Warnung: »inter_module_register« ist veraltet (deklariert
bei include/linux/module.h:573)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:556: Warnung: »inter_module_put« ist veraltet (deklariert bei
include/linux/module.h:578)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_get_vm_phys_addr':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1578: Warnung: Verarbeiten des Argumentes 1 von »pmd_offset« v
on inkompatiblem Zeigertyp
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `do_vm_shm_nopage':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:2073: Warnung: Verarbeiten des Argumentes 1 von »pmd_offset« v
on inkompatiblem Zeigertyp
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_vm_phys_addr_str':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:2444: Warnung: Verarbeiten des Argumentes 1 von »pmd_offset« v
on inkompatiblem Zeigertyp
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: At top level:
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:2532: Warnung: Initialisierung von inkompatiblem Zeigertyp
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_uninit':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3018: Warnung: »inter_module_put« ist veraltet (deklariert bei
include/linux/module.h:578)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_allocate_memory':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3062: Warnung: Verarbeiten des Argumentes 1 von Zeiger auf Fun
ktion erzeugt Zeiger von Ganzzahl ohne Typkonvertierung
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3062: Fehler: zu wenige Argumente für Funktion
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_enable':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3096: Warnung: Verarbeiten des Argumentes 1 von Zeiger auf Fun
ktion erzeugt Zeiger von Ganzzahl ohne Typkonvertierung
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3096: Fehler: zu wenige Argumente für Funktion
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_acquire':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3143: Fehler: zu wenige Argumente für Funktion
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3143: Warnung: return erzeugt Ganzzahl von Zeiger ohne Typkonv
ertierung
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_release':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3154: Fehler: zu wenige Argumente für Funktion
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_copy_info':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3174: Warnung: Verarbeiten des Argumentes 1 von Zeiger auf Fun
ktion von inkompatiblem Zeigertyp
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3174: Fehler: zu wenige Argumente für Funktion
make[1]: *** [/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.o] Fehler 1
make: *** [_module_/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod] Fehler 2
make: Leaving directory `/usr/src/linux-2.6.11-rc1-mm1'
* DRM module not built


Nik

black hole sun Jan 17, 2005 06:56 PM

AFAIK the current drivers don't work with the 2.6.11-rc1 release. They need a patch, someone posted it somewhere, I'll find it.

nik1982 Jan 17, 2005 07:02 PM

I've applied the 8.8.25-kernel-2.6.11+.patch patch. but the same error messages again. nik

BFCool Jan 17, 2005 07:12 PM

hi everyone - anyone else here (with FC3, kernel 2.6.10, and this patch) get a completely blank screen when "startx"-ing? It sounds like the cpu is working, but nothing ever loads up. Other than that the driver seems to be installed - in fact, the last line in the X log file (once I reboot) claims "DRI loaded successfully" but thats it. Usually it loads the keyboard, mouse, whatever. Anyone else seeing this?

Ben

black hole sun Jan 17, 2005 07:15 PM

Quote:

Originally Posted by BFCool
hi everyone - anyone else here (with FC3, kernel 2.6.10, and this patch) get a completely blank screen when "startx"-ing? It sounds like the cpu is working, but nothing ever loads up. Other than that the driver seems to be installed - in fact, the last line in the X log file (once I reboot) claims "DRI loaded successfully" but thats it. Usually it loads the keyboard, mouse, whatever. Anyone else seeing this?

Ben

Yeah actually. I messed around in my BIOS and changed by AGP Aperture to 128MB and the next boot it went away :nuts:

YMMV of course, but it worked for me.

Diffie Jan 17, 2005 07:24 PM

this patch for vanilla 2.6.10 works for me

Code:

  diffstat:
 
  agpgart_be.c        |  65 +++++++++++++++++++++++++++++++++++++++++++++++++-------
  firegl_public.c |        1
  2 files changed, 59 insertions(+), 7 deletions(-)
 
  diff -Nur fglrx-orig/build_mod/agpgart_be.c fglrx-o/build_mod/agpgart_be.c
  --- fglrx-orig/build_mod/agpgart_be.c        2005-01-17 19:28:36.000000000 -0500
  +++ fglrx-o/build_mod/agpgart_be.c        2005-01-17 19:33:45.000000000 -0500
  @@ -116,7 +116,14 @@
  #include <linux/pagemap.h>
  #include <linux/miscdevice.h>
  #include <linux/pm.h>
  +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  +#define pci_find_class pci_get_class
 
  +
  +
  +
  +
  +#endif
  #if (LINUX_VERSION_CODE >= 0x020400)
  #define FGL_PM_PRESENT
  #else
  @@ -255,6 +262,12 @@
  }
  #endif
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +#define firegl_pci_find_class(class,from) pci_get_class(class,from)
  +#else
  +#define firegl_pci_find_class(class,from) pci_find_class(class,from)
  +#endif
  +
  int agp_backend_acquire(void)
  {
          if (agp_bridge.type == NOT_SUPPORTED) {
  @@ -718,7 +731,7 @@
            *                AGP devices and collect their data.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
                  pci_read_config_dword(device, 0x04, &scratch);
 
  @@ -794,6 +807,13 @@
                                  command &= ~0x00000001;
                  }
          }
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          /*
            * PASS2: Figure out the 4X/2X/1X setting and enable the
            *                target (our motherboard chipset).
  @@ -839,8 +859,9 @@
            *                command registers.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                  pci_read_config_dword(device, 0x04, &scratch);
 
                  if (!(scratch & 0x00100000))
  @@ -871,6 +892,12 @@
                  }
          }
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          return 0; /* success */
  }
 
  @@ -5119,8 +5146,9 @@
            *                AGP devices and collect their data.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                  pci_read_config_dword(device, 0x04, &scratch);
 
                  if (!(scratch & 0x00100000))
  @@ -5187,6 +5215,13 @@
                                  command &= ~0x00000001;
                  }
          }
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          /*
            * PASS2: Figure out the 4X/2X/1X setting and enable the
            *                target (our motherboard chipset).
  @@ -5217,8 +5252,9 @@
            *                command registers.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                  pci_read_config_dword(device, 0x04, &scratch);
 
                  if (!(scratch & 0x00100000))
  @@ -5249,6 +5285,12 @@
                  }
          }
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          return(0); /* success */
  }
 
  @@ -6494,10 +6536,10 @@
          // locate host bridge device
  #ifdef __x86_64__
          do {
  -                dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
  +                dev = firegl_pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
          } while((dev) && !agp_check_supported_device(dev));
  #else
  -        if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
  +        if ((dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
                  return -ENODEV;
  #endif
 
  @@ -7040,8 +7082,12 @@
                                          &agp_bridge.mode);
                                  return hp_zx1_setup(dev);
                          }
 -                        dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
 +                        dev = firegl_pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
                  } while (dev);
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +                                if(dev) pci_dev_put(dev);
  +#endif
                  return -ENODEV;
          }
  #endif        /* __ia64__ */
  @@ -7462,6 +7508,11 @@
          agp_bridge.free_gatt_table();
          vfree(agp_bridge.key_list);
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +                // decrease the reference count.
  +                pci_dev_put(agp_bridge.dev);
  +#endif
  +
          if (agp_bridge.needs_scratch_page == TRUE) {
                  agp_bridge.scratch_page &= ~(0x00000fff);
                  agp_bridge.agp_destroy_page((unsigned long)
  diff -Nur fglrx-orig/build_mod/firegl_public.c fglrx-o/build_mod/firegl_public.c
  --- fglrx-orig/build_mod/firegl_public.c        2005-01-17 19:28:36.000000000 -0500
  +++ fglrx-o/build_mod/firegl_public.c        2005-01-17 19:29:08.000000000 -0500
  @@ -88,6 +88,7 @@
  #include <linux/smp_lock.h>
  // newer SuSE kernels need this
  #include <linux/highmem.h>
  +#include <linux/pagemap.h> // for lock_page and unlock_page
 
  #if defined(__ia64__)
  #include <linux/vmalloc.h>


Diffie Jan 17, 2005 07:27 PM

patch for 2.6.11-rc1-mm1 (module loads but did not work for me)

Code:

  diffstat:
 
  agpgart_be.c        |  65 +++++++++++++++++++++++++++++++++++++++++++++++++-------
  firegl_public.c |  51 ++++++++++++++++++++++---------------------
  2 files changed, 84 insertions(+), 32 deletions(-)
 
  diff -Nur fglrx-o/build_mod/agpgart_be.c fglrx/build_mod/agpgart_be.c
  --- fglrx-o/build_mod/agpgart_be.c        2004-12-14 12:55:47.000000000 -0500
  +++ fglrx/build_mod/agpgart_be.c        2005-01-17 17:26:57.000000000 -0500
  @@ -116,7 +116,14 @@
    #include <linux/pagemap.h>
    #include <linux/miscdevice.h>
    #include <linux/pm.h>
  +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  +#define pci_find_class pci_get_class
   
  +
  +
  +
  +
  +#endif
    #if (LINUX_VERSION_CODE >= 0x020400)
    #define FGL_PM_PRESENT
    #else
  @@ -255,6 +262,12 @@
    }
    #endif
   
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +#define firegl_pci_find_class(class,from) pci_get_class(class,from)
  +#else
  +#define firegl_pci_find_class(class,from) pci_find_class(class,from)
  +#endif
  +
    int agp_backend_acquire(void)
    {
            if (agp_bridge.type == NOT_SUPPORTED) {
  @@ -718,7 +731,7 @@
            *                AGP devices and collect their data.
            */
   
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
                    pci_read_config_dword(device, 0x04, &scratch);
   
  @@ -794,6 +807,13 @@
                                    command &= ~0x00000001;
                    }
            }
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
            /*
            * PASS2: Figure out the 4X/2X/1X setting and enable the
            *                target (our motherboard chipset).
  @@ -839,8 +859,9 @@
            *                command registers.
            */
   
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                    pci_read_config_dword(device, 0x04, &scratch);
   
                    if (!(scratch & 0x00100000))
  @@ -871,6 +892,12 @@
                    }
            }
   
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
            return 0; /* success */
    }
   
  @@ -5119,8 +5146,9 @@
            *                AGP devices and collect their data.
            */
   
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                    pci_read_config_dword(device, 0x04, &scratch);
   
                    if (!(scratch & 0x00100000))
  @@ -5187,6 +5215,13 @@
                                    command &= ~0x00000001;
                    }
            }
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
            /*
            * PASS2: Figure out the 4X/2X/1X setting and enable the
            *                target (our motherboard chipset).
  @@ -5217,8 +5252,9 @@
            *                command registers.
            */
   
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                    pci_read_config_dword(device, 0x04, &scratch);
   
                    if (!(scratch & 0x00100000))
  @@ -5249,6 +5285,12 @@
                    }
            }
   
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
            return(0); /* success */
    }
   
  @@ -6494,10 +6536,10 @@
            // locate host bridge device
    #ifdef __x86_64__
            do {
  -                dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
  +                dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
            } while((dev) && !agp_check_supported_device(dev));
    #else
  -        if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
  +        if ((dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
                    return -ENODEV;
    #endif
   
  @@ -7040,8 +7082,12 @@
                                          &agp_bridge.mode);
                                    return hp_zx1_setup(dev);
                            }
 -                        dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
 +                        dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
                    } while (dev);
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +                                if(dev) pci_dev_put(dev);
  +#endif
                    return -ENODEV;
            }
    #endif        /* __ia64__ */
  @@ -7462,6 +7508,11 @@
            agp_bridge.free_gatt_table();
            vfree(agp_bridge.key_list);
   
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +                // decrease the reference count.
  +                pci_dev_put(agp_bridge.dev);
  +#endif
  +
            if (agp_bridge.needs_scratch_page == TRUE) {
                    agp_bridge.scratch_page &= ~(0x00000fff);
                    agp_bridge.agp_destroy_page((unsigned long)
  diff -Nur fglrx-o/build_mod/firegl_public.c fglrx/build_mod/firegl_public.c
  --- fglrx-o/build_mod/firegl_public.c        2005-01-04 20:05:05.000000000 -0500
  +++ fglrx/build_mod/firegl_public.c        2005-01-17 17:30:44.000000000 -0500
  @@ -88,6 +88,7 @@
    #include <linux/smp_lock.h>
    // newer SuSE kernels need this
    #include <linux/highmem.h>
  +#include <linux/pagemap.h> // for lock_page and unlock_page
   
    #if defined(__ia64__)
    #include <linux/vmalloc.h>
  @@ -2590,13 +2591,13 @@
    #endif /* __ia64__ */
                                  vma->vm_flags |= VM_IO; /* not in core dump */
                            }
  -                        if (remap_page_range(FGL_VMA_API_PASS
  +                        if (remap_pfn_range(FGL_VMA_API_PASS
                                                                  vma->vm_start,
 -                                                                __ke_vm_offset(vma),
 +                                                                vma->vm_pgoff,
                                                                  vma->vm_end - vma->vm_start,
                                                                  vma->vm_page_prot))
                            {
  -                            __KE_DEBUG("remap_page_range failed\n");
  +                            __KE_DEBUG("remap_pfn_range failed\n");
                                    return -EAGAIN;
                            }
                          vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
  @@ -2657,7 +2658,7 @@
                            {
                                  if (__ke_vm_offset(vma) >= __pa(high_memory))
                                          vma->vm_flags |= VM_IO; /* not in core dump */
 -                                if (remap_page_range(FGL_VMA_API_PASS
 +                                if (remap_pfn_range(FGL_VMA_API_PASS
                                                            vma->vm_start,
                                                            __ke_vm_offset(vma),
                                                            vma->vm_end - vma->vm_start,
  @@ -2694,7 +2695,7 @@
                            {
                                  if (__ke_vm_offset(vma) >= __pa(high_memory))
                                          vma->vm_flags |= VM_IO; /* not in core dump */
 -                                if (remap_page_range(FGL_VMA_API_PASS
 +                                if (remap_pfn_range(FGL_VMA_API_PASS
                                                            vma->vm_start,
                                                            __ke_vm_offset(vma),
                                                            vma->vm_end - vma->vm_start,
  @@ -3057,10 +3058,10 @@
   
    struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory(__ke_size_t pages, unsigned long type)
    {
  -#ifdef __AGP__
  -        if (AGP_AVAILABLE(allocate_memory))
  -                return AGP_FUNC(allocate_memory)(pages, type);
  -#endif /* __AGP__ */
  +//#ifdef __AGP__
  +//        if (AGP_AVAILABLE(allocate_memory))
  +//                return AGP_FUNC(allocate_memory)(pages, type);
  +//#endif /* __AGP__ */
            if (firegl_agp)
                    return (struct _agp_memory*)FIREGL_agp_allocate_memory(pages, type);
            return NULL;
  @@ -3090,13 +3091,13 @@
   
    int ATI_API_CALL __ke_agp_enable(unsigned long mode)
    {
  -#ifdef __AGP__
  -        if (AGP_AVAILABLE(enable))
  -        {
  -                AGP_FUNC(enable)(mode);
  -                return 0;
  -        }
  -#endif /* __AGP__ */
  +//#ifdef __AGP__
  +//        if (AGP_AVAILABLE(enable))
  +//        {
  +//                AGP_FUNC(enable)(mode);
  +//                return 0;
  +//        }
  +//#endif /* __AGP__ */
            if (firegl_agp)
            {
                    FIREGL_agp_enable(mode);
  @@ -3138,10 +3139,10 @@
   
    int ATI_API_CALL __ke_agp_acquire(void)
    {
  -#ifdef __AGP__
  -        if (AGP_AVAILABLE(acquire))
  -                return AGP_FUNC(acquire)();
  -#endif /* __AGP__ */
  +//#ifdef __AGP__
  +//        if (AGP_AVAILABLE(acquire))
  +//                return AGP_FUNC(acquire)();
  +//#endif /* __AGP__ */
            if (firegl_agp)
                    return FIREGL_agp_backend_acquire();
            return -EINVAL;
  @@ -3149,10 +3150,10 @@
   
    void ATI_API_CALL __ke_agp_release(void)
    {
  -#ifdef __AGP__
  -        if (AGP_AVAILABLE(release))
  -                AGP_FUNC(release)();
  -#endif /* __AGP__ */
  +//#ifdef __AGP__
  +//        if (AGP_AVAILABLE(release))
  +//                AGP_FUNC(release)();
  +//#endif /* __AGP__ */
            if (firegl_agp)
                    FIREGL_agp_backend_release();
    }
  @@ -3171,7 +3172,7 @@
    #endif
                    agp_kern_info kern;       
   
  -                AGP_FUNC(copy_info)(&kern);
  +//                AGP_FUNC(copy_info)(&kern);
                    device = kern.device;
   
                    info->version.major = kern.version.major;


Bezzer Jan 17, 2005 10:17 PM

Hey,

I'm sorry if this sounds stupid, but would somebody be able to tell me how to apply this patch?

Diffie Jan 17, 2005 10:20 PM

Try

Code:

  patch -p0 < patch_file
  or
  patch -p1 < patch_file

Hope this helps

Triggerdeft Jan 17, 2005 11:23 PM

I'm also a newb.... -what- does you code-snippet mean? I need some hand-holding here. If I go into the console and type "patch -p0 < patch_file" I'm pretty sure it's not going to do anything, let alone what we're trying to accomplish. What patch-file? Where is the patch-file? Who do I have to bribe to get the patch-file? What do I do when I get the patch_file. Exactly. It's like this: I'm a Linux idiot at this point, but I'm not a computer idiot... I just need some step-by-step instruction. Thanks.

black hole sun Jan 17, 2005 11:24 PM

Trigger see your thread.

Triggerdeft Jan 17, 2005 11:30 PM

Gotcha, thanks.

Triggerdeft Jan 17, 2005 11:34 PM

Have an issue.. please see my thread.

TheOneKEA Jan 18, 2005 02:18 AM

Quote:

Originally Posted by Diffie
this patch for vanilla 2.6.10 works for me

Code:

  diffstat:
 
  agpgart_be.c        |  65 +++++++++++++++++++++++++++++++++++++++++++++++++-------
  firegl_public.c |        1
  2 files changed, 59 insertions(+), 7 deletions(-)
 
  diff -Nur fglrx-orig/build_mod/agpgart_be.c fglrx-o/build_mod/agpgart_be.c
  --- fglrx-orig/build_mod/agpgart_be.c        2005-01-17 19:28:36.000000000 -0500
  +++ fglrx-o/build_mod/agpgart_be.c        2005-01-17 19:33:45.000000000 -0500
  @@ -116,7 +116,14 @@
  #include <linux/pagemap.h>
  #include <linux/miscdevice.h>
  #include <linux/pm.h>
  +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
  +#define pci_find_class pci_get_class
 
  +
  +
  +
  +
  +#endif
  #if (LINUX_VERSION_CODE >= 0x020400)
  #define FGL_PM_PRESENT
  #else
  @@ -255,6 +262,12 @@
  }
  #endif
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +#define firegl_pci_find_class(class,from) pci_get_class(class,from)
  +#else
  +#define firegl_pci_find_class(class,from) pci_find_class(class,from)
  +#endif
  +
  int agp_backend_acquire(void)
  {
          if (agp_bridge.type == NOT_SUPPORTED) {
  @@ -718,7 +731,7 @@
            *                AGP devices and collect their data.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
                  pci_read_config_dword(device, 0x04, &scratch);
 
  @@ -794,6 +807,13 @@
                                  command &= ~0x00000001;
                  }
          }
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          /*
            * PASS2: Figure out the 4X/2X/1X setting and enable the
            *                target (our motherboard chipset).
  @@ -839,8 +859,9 @@
            *                command registers.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                  pci_read_config_dword(device, 0x04, &scratch);
 
                  if (!(scratch & 0x00100000))
  @@ -871,6 +892,12 @@
                  }
          }
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          return 0; /* success */
  }
 
  @@ -5119,8 +5146,9 @@
            *                AGP devices and collect their data.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                  pci_read_config_dword(device, 0x04, &scratch);
 
                  if (!(scratch & 0x00100000))
  @@ -5187,6 +5215,13 @@
                                  command &= ~0x00000001;
                  }
          }
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          /*
            * PASS2: Figure out the 4X/2X/1X setting and enable the
            *                target (our motherboard chipset).
  @@ -5217,8 +5252,9 @@
            *                command registers.
            */
 
  -        while ((device = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
  +        while ((device = firegl_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8,
                                          device)) != NULL) {
  +
                  pci_read_config_dword(device, 0x04, &scratch);
 
                  if (!(scratch & 0x00100000))
  @@ -5249,6 +5285,12 @@
                  }
          }
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 +                        // the reference count has been increased in agp_backend_initialize.
  +                if (device)
  +                        pci_dev_put(device);
  +#endif
  +
          return(0); /* success */
  }
 
  @@ -6494,10 +6536,10 @@
          // locate host bridge device
  #ifdef __x86_64__
          do {
  -                dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
  +                dev = firegl_pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
          } while((dev) && !agp_check_supported_device(dev));
  #else
  -        if ((dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
  +        if ((dev = firegl_pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) == NULL)
                  return -ENODEV;
  #endif
 
  @@ -7040,8 +7082,12 @@
                                          &agp_bridge.mode);
                                  return hp_zx1_setup(dev);
                          }
 -                        dev = pci_find_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
 +                        dev = firegl_pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, dev);
                  } while (dev);
  +
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +                                if(dev) pci_dev_put(dev);
  +#endif
                  return -ENODEV;
          }
  #endif        /* __ia64__ */
  @@ -7462,6 +7508,11 @@
          agp_bridge.free_gatt_table();
          vfree(agp_bridge.key_list);
 
  +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
  +                // decrease the reference count.
  +                pci_dev_put(agp_bridge.dev);
  +#endif
  +
          if (agp_bridge.needs_scratch_page == TRUE) {
                  agp_bridge.scratch_page &= ~(0x00000fff);
                  agp_bridge.agp_destroy_page((unsigned long)
  diff -Nur fglrx-orig/build_mod/firegl_public.c fglrx-o/build_mod/firegl_public.c
  --- fglrx-orig/build_mod/firegl_public.c        2005-01-17 19:28:36.000000000 -0500
  +++ fglrx-o/build_mod/firegl_public.c        2005-01-17 19:29:08.000000000 -0500
  @@ -88,6 +88,7 @@
  #include <linux/smp_lock.h>
  // newer SuSE kernels need this
  #include <linux/highmem.h>
  +#include <linux/pagemap.h> // for lock_page and unlock_page
 
  #if defined(__ia64__)
  #include <linux/vmalloc.h>



I wonder if I should switch to this patch, to see if it solves my triple Oops on shutdown.

Diffie Jan 18, 2005 02:26 AM

Hey i was a n00b at one time too :D

Basically you copy all the text in the code window from the post to a text editor and save it as patch_file (patch_file name was a exapmle, you can name it patch_for_b0rken_ati_driver.diff for all i care) then you use patch -p0 < patch_file to apply the diff with the changes. Try man patch or google.com for patch or diff

Hope this helps

sk3ptic Jan 18, 2005 04:19 PM

Quote:

Originally Posted by BFCool
hi everyone - anyone else here (with FC3, kernel 2.6.10, and this patch) get a completely blank screen when "startx"-ing? It sounds like the cpu is working, but nothing ever loads up. Other than that the driver seems to be installed - in fact, the last line in the X log file (once I reboot) claims "DRI loaded successfully" but thats it. Usually it loads the keyboard, mouse, whatever. Anyone else seeing this?

Ben

I am running FC3, kernel 2.6.10. I loaded the drivers last night without the patch and got exactly the same behavior. As soon as X starts the screen goes black. I was geeked about trying the patch when I get home tonight, but it doesn't sound like it will help. I thought the sync rate was getting messed up, but hte log files look fine.

My card is PCI (9200SE) not AGP, so I don't know if there is anything like the memory aperature setting in the BIOS.

Anyone get this working with FC3?
Larry

bilko5000 Jan 18, 2005 04:21 PM

working 2.6.11-rc1 patch
 
i've got a working patch for using 2.6.11-rc1 kernels, you need to apply the 2.6.10 patch that mtippet posted first, and then this on top.

it just uses remap_pfn_range instead of remap_page_range which is unavailable in 2.6.11.

Code:

--- firegl_public.orig        2005-01-18 22:13:16.000000000 +0000
+++ firegl_public.c        2005-01-18 22:06:54.000000000 +0000
@@ -2591,13 +2591,13 @@
 #endif /* __ia64__ */
                vma->vm_flags |= VM_IO; /* not in core dump */
            }
-            if (remap_page_range(FGL_VMA_API_PASS
+            if (remap_pfn_range(FGL_VMA_API_PASS
                                  vma->vm_start,
-                                __ke_vm_offset(vma),
+                                __ke_vm_offset(vma) >> PAGE_SHIFT,
                                  vma->vm_end - vma->vm_start,
                                  vma->vm_page_prot))
            {
-                __KE_DEBUG("remap_page_range failed\n");
+                __KE_DEBUG("remap_pfn_range failed\n");
                return -EAGAIN;
            }
            vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
@@ -2658,13 +2658,13 @@
                        {
                                if (__ke_vm_offset(vma) >= __pa(high_memory))
                                        vma->vm_flags |= VM_IO; /* not in core dump */
-                                if (remap_page_range(FGL_VMA_API_PASS
+                                if (remap_pfn_range(FGL_VMA_API_PASS
                                                                          vma->vm_start,
-                                                                        __ke_vm_offset(vma),
+                                                                        __ke_vm_offset(vma) >> PAGE_SHIFT,
                                                                          vma->vm_end - vma->vm_start,
                                                                          vma->vm_page_prot))
                                {
-                                        __KE_DEBUG("remap_page_range failed\n");
+                                        __KE_DEBUG("remap_pfn_range failed\n");
                                        return -EAGAIN;
                                }
 #ifdef __x86_64__
@@ -2695,13 +2695,13 @@
                        {
                                if (__ke_vm_offset(vma) >= __pa(high_memory))
                                        vma->vm_flags |= VM_IO; /* not in core dump */
-                                if (remap_page_range(FGL_VMA_API_PASS
+                                if (remap_pfn_range(FGL_VMA_API_PASS
                                                                          vma->vm_start,
-                                                                        __ke_vm_offset(vma),
+                                                                        __ke_vm_offset(vma) >> PAGE_SHIFT,
                                                                          vma->vm_end - vma->vm_start,
                                                                          vma->vm_page_prot))
                                {
-                                        __KE_DEBUG("remap_page_range failed\n");
+                                        __KE_DEBUG("remap_pfn_range failed\n");
                                        return -EAGAIN;
                                }
 #ifdef __x86_64__


BFCool Jan 18, 2005 07:29 PM

Quote:

Originally Posted by sk3ptic
I am running FC3, kernel 2.6.10. I loaded the drivers last night without the patch and got exactly the same behavior. As soon as X starts the screen goes black. I was geeked about trying the patch when I get home tonight, but it doesn't sound like it will help. I thought the sync rate was getting messed up, but hte log files look fine.

My card is PCI (9200SE) not AGP, so I don't know if there is anything like the memory aperature setting in the BIOS.

Anyone get this working with FC3?
Larry

Hmm my card is a PCI version as well, so that could be the problem. Also maybe its due to running X.org 6.8.1 instead of 6.8.0? Still no luck over here, having tried both "UseInternalAGP" = no and yes (not at the same time of course). Diffie's patch wouldn't even run for me - don't know what that's about either. Thanks guys!

B3lg4ri0n Jan 20, 2005 07:33 AM

i've copied tho code into a file, but get this message when i try to apply the patch
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
[[email protected] build_mod]# patch -p0 -i /home/belgarion/Downloads/rpms/8.8.25-kernel-2.6.10+.patch
patching file agpgart_be.c
patch: **** malformed patch at line 6: }
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

anyone an idea what went wrong?

EvilDarkArchon Jan 20, 2005 06:37 PM

Code:

make: Entering directory `/usr/src/linux-2.6.11-rc1-xx2'
  CC [M]  /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agp3.o
  CC [M]  /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/nvidia-agp.o
  CC [M]  /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/agpgart_be.o
  CC [M]  /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/i7505-agp.o
  CC [M]  /var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.o
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_stub_putminor':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:510: warning: `inter_module_put' is deprecated (declared at include/linux/module.h:578)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:512: warning: `inter_module_unregister' is deprecated (declared at include/linux/module.h:574)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_stub_register':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:532: warning: `inter_module_register' is deprecated (declared at include/linux/module.h:573)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:563: warning: `inter_module_put' is deprecated (declared at include/linux/module.h:578)
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_get_user_ptr':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1072: warning: assignment makes pointer from integer without a cast
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `firegl_put_user_ptr':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1104: warning: cast from pointer to integer of different size
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1104: warning: cast from pointer to integer of different size
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1104: warning: cast from pointer to integer of different size
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1104: warning: cast from pointer to integer of different size
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_get_vm_phys_addr':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:1667: error: structure has no member named `pud'
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `do_vm_shm_nopage':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:2187: error: structure has no member named `pud'
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_vm_phys_addr_str':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:2557: error: structure has no member named `pud'
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: At top level:
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:2645: warning: initialization from incompatible pointer type
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c: In function `__ke_agp_uninit':
/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.c:3131: warning: `inter_module_put' is deprecated (declared at include/linux/module.h:578)
make[1]: *** [/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod/firegl_public.o] Error 1
make: *** [_module_/var/tmp/portage/ati-drivers-8.8.25/work/lib/modules/fglrx/build_mod] Error 2

this seems to happen with any 2.6.11-rc1-mm1 based kernel and that's with the patch from http://www.gehirn.org.uk/wiki/images...-2.6.11+.patch, it only happens on x86_64, it seems to compile fine on x86.


All times are GMT -5. The time now is 08:41 AM.

Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
All trademarks used are properties of their respective owners. Copyright ©1998-2011 Rage3D.com