Go Back   Rage3D » Rage3D Discussion Area » Computing Forums » Operating Systems » Linux » Drivers
Rage3D Subscribe Register FAQ Members List Calendar Mark Forums Read

Drivers Discussion forum for Linux drivers.

"
Reply
 
Thread Tools Display Modes
Old Jan 22, 2004, 08:52 AM   #1
Advertisement (Guests Only)

Login or Register to remove this ad
WhO_KnOwS
The lurker mod
 
Join Date: Dec 2002
Location: Slovenia Slovenia, Europe
Posts: 3,227
WhO_KnOwS is still being judged by the masses


Default Driver patches

In this thread all the patches needed will be collected. If you feel any other should be here go ahead. To use them simply copy&paste the text and save it as whatever.patch. Then just copy it to /lib/modules/fglrx and execute:

Code:
cd /lib/modules/fglrx/build_mod
patch -p1 < ../PATCH_NAME.patch
If you want to reverse the patch use -R.

VMALLOC:

Code:
diff -ruN build_mod.orig/firegl_public.c build_mod/firegl_public.c
--- build_mod.orig/firegl_public.c	2003-09-05 00:45:33.539384168 +0200
+++ build_mod/firegl_public.c	2003-09-05 00:47:13.193234480 +0200
@@ -129,7 +129,9 @@
         #define pte_offset  pte_offset_map
     #endif
 #endif
-
+#ifndef VMALLOC_VMADDR
+#define VMALLOC_VMADDR(x)  ((unsigned long)(x))
+#endif
 // ============================================================
 #ifndef TRUE
 #define TRUE 1
Now the AMD one (should anyone need it) is the following:

Code:
--- firegl_public.c_orig        2004-01-23 12:38:00.000000000 +0000
+++ firegl_public.c     2004-01-23 12:51:13.000000000 +0000
@@ -3120,7 +3120,7 @@

 int __ke_amd_adv_spec_cache_feature(void)
 {
-#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,19)) )
+#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)) )
 /* the kernel already does provide a fix for the AMD Athlon
    big page attribute / cache flush data consistency system bug on its own.
    (AMD claimed that CPU cache behaviour for such pages is not specified.)
The old (and mostly unneeded) AMD patch is this:

Code:
diff -Nurp ../fglrx-orig/build_mod/firegl_public.c build_mod/firegl_public.c
--- ../fglrx-orig/build_mod/firegl_public.c	2003-07-11 11:42:06.000000000 +0000
+++ build_mod/firegl_public.c	2003-08-03 16:15:57.447117216 +0000
@@ -3050,33 +3050,6 @@ static int __init have_cpuid_p(void)
 
 int __ke_amd_adv_spec_cache_feature(void)
 {
-        char vendor_id[16];
-        int ident;
-        int family, model;
- 
-        /* Must have CPUID */
-        if(!have_cpuid_p())
-                goto donthave;
-        if(cpuid_eax(0)<1)
-                goto donthave;
-        
-        /* Must be x86 architecture */
-        cpuid(0, &ident,  
-                (int *)&vendor_id[0],
-                (int *)&vendor_id[8],
-                (int *)&vendor_id[4]);
-
-        if (memcmp(vendor_id, "AuthenticAMD", 12)) 
-               goto donthave;
-
-        ident = cpuid_eax(1);
-        family = (ident >> 8) & 0xf;
-        model  = (ident >> 4) & 0xf;
-        if (((family == 6)  && (model >= 6)) || (family == 15)) {
-                return 1;
-        }
-
-donthave:
         return 0;
 }
To fix the panel compilation problem in 3.7.0 use (note: instead of -p1 use -p0):

Code:
--- ATITVOExtensions.c.orig	2003-11-11 17:32:14.000000000 +0000
+++ ATITVOExtensions.c	2003-12-29 19:09:46.790701616 +0000
@@ -33,68 +33,15 @@
 #include <stdlib.h>
 
 #include "ATITVOExtensions.h"
-#include "Radeon_extension_tvout.h"
+#include "TVOExt.h"
 
 static XExtensionInfo _atitvo_info_data;
-static XExtensionInfo *atitvo_info = &_atitvo_info_data;
-static char *atitvo_extension_name = ATITVOUT_EXTENSION_NAME;
-
 
 //////////////////////////////////////////////////////////////////////////////
 // private functions
 
 XExtDisplayInfo *info;
 
-// X shutdown hook function that will cleanup the opened extension
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display_atitvo, 
-                                    atitvo_info)
-
-// table with X hooks
-static /* const */ XExtensionHooks atitvo_extension_hooks = {
-    NULL,                   /* create_gc */
-    NULL,                   /* copy_gc */
-    NULL,                   /* flush_gc */
-    NULL,                   /* free_gc */
-    NULL,                   /* create_font */
-    NULL,                   /* free_font */
-    close_display_atitvo,   /* close_display */
-    NULL,                   /* wire_to_event */
-    NULL,                   /* event_to_wire */
-    NULL,                   /* error */
-    NULL,                   /* error_string */
-};
-
-// find_display_atitvo - get the display info block for atitvo extension
-static XEXT_GENERATE_FIND_DISPLAY (find_display_atitvo, 
-                                   atitvo_info,
-                                   atitvo_extension_name, 
-                                   &atitvo_extension_hooks, 
-                                   ATITVOUT_NUMBER_EVENTS, 
-                                   NULL)
-
-
-
-static int 
-answerisyes(char *s)
-{
-    if (s[0] == '\'')   /* For fools that type the ' literally. */
-        return tolower(s[1]) == 'y';
-    return tolower(s[0]) == 'y';
-}
-
-
-static void 
-getstring(char *s)
-{
-    char *cp;
-    fgets(s, 80, stdin);
-    cp = strchr(s, '\n');
-    if (cp)
-        *cp=0;
-}
-
-
-
 //////////////////////////////////////////////////////////////////////////////
 // type defines
For the patch above to work you need the followint qt one:

Code:
--- Makefile_orig       2004-01-24 00:00:41.000000000 +0000
+++ Makefile    2004-01-23 23:59:29.000000000 +0000
@@ -44,7 +44,7 @@
 else
 ifneq ($(findstring $(PLATFORMTYPE), i386 i486 i586 i686), )
 LIBQT_STATIC = libqt.a
-LIBQT_DYN = qt
+LIBQT_DYN = qt-mt
 LIB_DIR = lib
 else
 ifeq ($(PLATFORMTYPE), x86_64)
This patch fixes the "bad address" error when loading fglrx.ko
Apply it with:
Code:
cd /lib/modules/fglrx/build_mod; patch -p1 < /path/to/fglrx-3.7.6-regparm.patch
Then build the module.

This patch is needed to compile 3.7.6 with regparm patch applied and gcc-3.4.0:

Code:
--- ../build_mod/firegl_public.h        2004-05-09 01:42:38.000000000 +0300
+++ firegl_public.h     2004-05-09 02:23:21.000000000 +0300
@@ -146,7 +146,7 @@ extern int IP_LINKAGE __ke_signal_pendin
 extern void IP_LINKAGE __ke_set_current_state_task_interruptible(void);
 extern void IP_LINKAGE __ke_set_current_state_task_running(void);
 extern void IP_LINKAGE __ke_configure_sigmask(__ke_sigset_t *pSigMask);
-extern void IP_LINKAGE __ke_block_all_signals(int (*IP_LINKAGE notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask);
+extern void IP_LINKAGE __ke_block_all_signals(int (* notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask);
 extern void IP_LINKAGE __ke_unblock_all_signals(void);

 extern unsigned long IP_LINKAGE __ke__cmpxchg(volatile void *ptr, unsigned long old,
@@ -318,7 +318,7 @@ extern int IP_LINKAGE __ke_in(unsigned s

 extern void IP_LINKAGE __ke_enable_irq(int irq);
 extern void IP_LINKAGE __ke_disable_irq(int irq);
-extern int IP_LINKAGE __ke_request_irq(unsigned int irq, void (*IP_LINKAGE handler)(int, void *, void *), const char *dev_name, void *dev_id);
+extern int IP_LINKAGE __ke_request_irq(unsigned int irq, void (* handler)(int, void *, void *), const char *dev_name, void *dev_id);
 extern void IP_LINKAGE __ke_free_irq(unsigned int irq, void *dev_id);

 /*****************************************************************************/
@@ -395,7 +395,7 @@ unsigned long IP_LINKAGE __ke_agp_memory
 int IP_LINKAGE __ke_is_athlon(void);
 int IP_LINKAGE __ke_has_PSE(void);
 int IP_LINKAGE __ke_amd_adv_spec_cache_feature(void);
-void IP_LINKAGE __ke_smp_call_function( void (*IP_LINKAGE func)(void *info) );
+void IP_LINKAGE __ke_smp_call_function( void (* func)(void *info) );
 int IP_LINKAGE __ke_smp_processor_id(void);

 /*****************************************************************************/
Patch to build 3.7.6 with 2.6.6-mm2 and recent (includes regparm - probably not needed)

Code:
diff -uprN build_mod-mreg_new/agpgart_be.c build_mod-mreg_new-mm/agpgart_be.c
--- build_mod-mreg_new/agpgart_be.c     2004-05-15 03:45:48.000000000 +0300
+++ build_mod-mreg_new-mm/agpgart_be.c  2004-05-15 03:18:30.000000000 +0300
@@ -1402,7 +1402,8 @@ unsigned long agp_generic_alloc_page(voi
     }
 #endif

-    atomic_inc(&page->count);
+    //atomic_inc(&page->count);
+    get_page(page);
     set_bit(PG_locked, &page->flags);
     atomic_inc(&agp_bridge.current_memory_agp);

@@ -4413,7 +4414,8 @@ static unsigned long ali_alloc_page(void
     if (page == NULL)
         return 0;

-    atomic_inc(&page->count);
+    //atomic_inc(&page->count);
+    get_page(page);
     set_bit(PG_locked, &page->flags);
     atomic_inc(&agp_bridge.current_memory_agp);

diff -uprN build_mod-mreg_new/firegl_public.c build_mod-mreg_new-mm/firegl_public.c
--- build_mod-mreg_new/firegl_public.c  2004-05-15 03:45:06.000000000 +0300
+++ build_mod-mreg_new-mm/firegl_public.c       2004-05-15 03:25:13.000000000 +0300
@@ -2066,7 +2066,8 @@ static vm_nopage_ret_t vm_shm_nopage(str
     pMmPage = virt_to_page(kaddr);
 #endif /* LINUX_VERSION_CODE < 0x020400 */

-    atomic_inc(&(pMmPage->count));  /* inc usage count of page */
+    //atomic_inc(&(pMmPage->count));  /* inc usage count of page */
+    get_page(pMmPage);

 #if LINUX_VERSION_CODE >= 0x020400
   //  __KE_DEBUG3("vm-address 0x%08lx => kernel-page-address 0x%p\n",
Patch for adding support of the i875g in to the internal agpgart (not tested yet):

Code:
diff -u --recursive build_mod.old/agp.h build_mod/agp.h
--- build_mod.old/agp.h 2004-03-17 23:00:29.000000000 +0100
+++ build_mod/agp.h     2004-07-26 10:52:04.737992976 +0200
@@ -656,6 +656,9 @@
     #ifndef PCI_DEVICE_ID_INTEL_865_G_1
     #define PCI_DEVICE_ID_INTEL_865_G_1         0x2572  // alternate macro
     #endif
+    #ifndef PCI_DEVICE_ID_INTEL_875_P_0
+    #define PCI_DEVICE_ID_INTEL_875_P_0        0x2578
+    #endif
     #ifndef PCI_DEVICE_ID_INTEL_875_G_0
     #define PCI_DEVICE_ID_INTEL_875_G_0         0x2578
     #endif
diff -u --recursive build_mod.old/agp_backend.h build_mod/agp_backend.h
--- build_mod.old/agp_backend.h 2004-03-17 23:00:29.000000000 +0100
+++ build_mod/agp_backend.h     2004-07-26 10:52:04.737992976 +0200
@@ -119,6 +119,7 @@
     _X(INTEL_I820),
     _X(INTEL_I830_M),
        _X(INTEL_I865_G),
+       _X(INTEL_I875_P),
        _X(INTEL_I875_G),
        _X(INTEL_I840),
        _X(INTEL_I845),
diff -u --recursive build_mod.old/agpgart_be.c build_mod/agpgart_be.c
--- build_mod.old/agpgart_be.c  2004-07-26 10:49:19.054180744 +0200
+++ build_mod/agpgart_be.c      2004-07-26 10:52:04.739992672 +0200
@@ -5800,6 +5800,12 @@
         "Intel",
         "i865G",
         intel_845_setup },
+    { PCI_DEVICE_ID_INTEL_875_P_0,
+       PCI_VENDOR_ID_INTEL,
+       INTEL_I875_P,
+       "Intel(R)",
+       "875P",
+       intel_845_setup },
     { PCI_DEVICE_ID_INTEL_875_G_1,
         PCI_VENDOR_ID_INTEL,
         INTEL_I875_G,
__________________
  • Intel Core 2 Quad Q6600 @ 3Ghz
  • GigaByte P35-DS4
  • 4 GB OCZ Gold 800Mhz DDR2 Dual Channel
  • XFX GeForce 280 GTX XXX
  • Dell 2407WFP monitor
  • CoolerMaster Cosmos S case


Other hardware: MacBook Pro 2.53GHz 13", Xbox360, iPhone 3GS 32GB

Last edited by WhO_KnOwS : Jul 26, 2004 at 04:57 AM.
WhO_KnOwS is offline   Reply With Quote
Old Jan 22, 2004, 09:13 AM   #2
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default

The AMD patch you have is the old one.
Now I think that for the AMD problem you only have to apply the following:

--- firegl_public.c_orig 2004-01-22 17:21:18.000000000 +0000
+++ firegl_public.c 2004-01-22 17:22:17.000000000 +0000
@@ -3120,7 +3120,7 @@

int __ke_amd_adv_spec_cache_feature(void)
{
-#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,19)) )
+#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)) )
/* the kernel already does provide a fix for the AMD Athlon
big page attribute / cache flush data consistency system bug on its own.
(AMD claimed that CPU cache behaviour for such pages is not specified.)

Edit: Also maybe we should say that in case someone wants to reverse a patch, he has to use -R option.
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis

Last edited by Mythos : Jan 22, 2004 at 09:29 AM.
Mythos is offline   Reply With Quote
Old Jan 22, 2004, 09:42 AM   #3
WhO_KnOwS
The lurker mod
 
Join Date: Dec 2002
Location: Slovenia Slovenia, Europe
Posts: 3,227
WhO_KnOwS is still being judged by the masses


Default

Done
__________________
  • Intel Core 2 Quad Q6600 @ 3Ghz
  • GigaByte P35-DS4
  • 4 GB OCZ Gold 800Mhz DDR2 Dual Channel
  • XFX GeForce 280 GTX XXX
  • Dell 2407WFP monitor
  • CoolerMaster Cosmos S case


Other hardware: MacBook Pro 2.53GHz 13", Xbox360, iPhone 3GS 32GB
WhO_KnOwS is offline   Reply With Quote
Advertisement (Guests Only)
Login or Register to remove this ad
Old Jan 23, 2004, 01:33 AM   #4
Kombatant
K to the max!™
 
Join Date: Nov 2002
Location: Greece Nikaia, Greece
Posts: 16,693
Kombatant knows why the caged bird singsKombatant knows why the caged bird singsKombatant knows why the caged bird singsKombatant knows why the caged bird singsKombatant knows why the caged bird sings


Subscriber
Default

I will leave it sticky for a while and then I will add it to the important threads of this forum post. Thx guys
__________________
There is no spoon...
Rage3D // Digital Lair // Twitter
Kombatant is offline   Reply With Quote
Old Jan 23, 2004, 05:01 AM   #5
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Angry Sorry

The previous AMD patch wasn't applying cleanly,
here is another one from a clean 3.7 firegl_public.c:
Code:
--- firegl_public.c_orig        2004-01-23 12:38:00.000000000 +0000
+++ firegl_public.c     2004-01-23 12:51:13.000000000 +0000
@@ -3120,7 +3120,7 @@

 int __ke_amd_adv_spec_cache_feature(void)
 {
-#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,19)) )
+#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)) )
 /* the kernel already does provide a fix for the AMD Athlon
    big page attribute / cache flush data consistency system bug on its own.
    (AMD claimed that CPU cache behaviour for such pages is not specified.)
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old Jan 23, 2004, 07:43 AM   #6
WhO_KnOwS
The lurker mod
 
Join Date: Dec 2002
Location: Slovenia Slovenia, Europe
Posts: 3,227
WhO_KnOwS is still being judged by the masses


Thumbs up

Replaced, although I don't see the difference Must be going blind...
__________________
  • Intel Core 2 Quad Q6600 @ 3Ghz
  • GigaByte P35-DS4
  • 4 GB OCZ Gold 800Mhz DDR2 Dual Channel
  • XFX GeForce 280 GTX XXX
  • Dell 2407WFP monitor
  • CoolerMaster Cosmos S case


Other hardware: MacBook Pro 2.53GHz 13", Xbox360, iPhone 3GS 32GB
WhO_KnOwS is offline   Reply With Quote
Old Jan 23, 2004, 08:17 AM   #7
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default

Quote:
Originally posted by WhO_KnOwS
Replaced, although I don't see the difference Must be going blind...
Well I didn't use the code tags with the previous patch, and so the headers were wrong...

Old:
Code:
--- firegl_public.c_orig 2004-01-22 17:21:18.000000000 +0000
+++ firegl_public.c 2004-01-22 17:22:17.000000000 +0000
New:
Code:
--- firegl_public.c_orig        2004-01-23 12:38:00.000000000 +0000
+++ firegl_public.c     2004-01-23 12:51:13.000000000 +0000
Edit: Don't forget to use the CODE tag whenever it is appropriate..!
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis

Last edited by Mythos : Jan 23, 2004 at 08:35 AM.
Mythos is offline   Reply With Quote
Old Jan 23, 2004, 03:39 PM   #8
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default ATITVOExtensions.c patch

Also found http://gentoo.kems.net/gentoo-x86-po...includes.patch
It is for fglrx_panel_sources.tgz in /usr/src/ATI and it fixes a compilation problem of 3.7.0.
Needs patch -p0...
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old Jan 23, 2004, 03:56 PM   #9
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default Re: ATITVOExtensions.c patch

Quote:
Originally posted by Mythos
Also found http://gentoo.kems.net/gentoo-x86-po...includes.patch
It is for fglrx_panel_sources.tgz in /usr/src/ATI and it fixes a compilation problem of 3.7.0.
Needs patch -p0...
Also needed the following patch, to link with QT. I think since QT-3.0 the lib name is libqt-mt.so and not
libqt.so
Code:
--- Makefile_orig       2004-01-24 00:00:41.000000000 +0000
+++ Makefile    2004-01-23 23:59:29.000000000 +0000
@@ -44,7 +44,7 @@
 else
 ifneq ($(findstring $(PLATFORMTYPE), i386 i486 i586 i686), )
 LIBQT_STATIC = libqt.a
-LIBQT_DYN = qt
+LIBQT_DYN = qt-mt
 LIB_DIR = lib
 else
 ifeq ($(PLATFORMTYPE), x86_64)
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old Mar 17, 2004, 09:40 AM   #10
Anders
Newbie
 
Join Date: Mar 2004
Posts: 2
Anders is still being judged by the masses


Default Patch to make fglrx work with regparm kernels (incl. Fedora 2)

(I originally posted this here.)

If you're getting the "bad address" error when loading fglrx.ko like I was, this might help. Download this patch, and apply it to the /lib/modules/fglrx/build_mod directory with:
Code:
cd /lib/modules/fglrx/build_mod; patch -p1 < /path/to/fglrx-3.7.6-regparm.patch
Then build and install the module as normal.

(The patch just defines all functions that are called to or from the binary part with __attribute__((__regparm__(0))), to ensure they use the right calling convention whether or not -mregparm=3 is being used. There's also a trivial fix to make.sh so it actually stops if the build fails.)
Anders is offline   Reply With Quote
Old Mar 17, 2004, 09:54 AM   #11
WhO_KnOwS
The lurker mod
 
Join Date: Dec 2002
Location: Slovenia Slovenia, Europe
Posts: 3,227
WhO_KnOwS is still being judged by the masses


Default

Added to the first post.
__________________
  • Intel Core 2 Quad Q6600 @ 3Ghz
  • GigaByte P35-DS4
  • 4 GB OCZ Gold 800Mhz DDR2 Dual Channel
  • XFX GeForce 280 GTX XXX
  • Dell 2407WFP monitor
  • CoolerMaster Cosmos S case


Other hardware: MacBook Pro 2.53GHz 13", Xbox360, iPhone 3GS 32GB
WhO_KnOwS is offline   Reply With Quote
Old Apr 11, 2004, 05:11 AM   #12
linuZman
Radeon HD 6670
 
Join Date: Mar 2004
Posts: 26
linuZman is still being judged by the masses


Default fglrx-3.2.8-regparm.patch

Using the patch from Anders for 2.6.x kernels with the REGPARM optimization, the patch was back ported to the fglrx 3.2.8 driver.

It can be obtained here.

Do not use with any other driver other than 3.2.8 or kernel 2.6.x
linuZman is offline   Reply With Quote
Old May 9, 2004, 06:46 PM   #13
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default Gcc-3.4.0 error compiling 3.7.6 module with regparm patch applied

This patch is needed to compile 3.7.6 with regparm patch applied and gcc-3.4.0:
Code:
--- ../build_mod/firegl_public.h        2004-05-09 01:42:38.000000000 +0300
+++ firegl_public.h     2004-05-09 02:23:21.000000000 +0300
@@ -146,7 +146,7 @@ extern int IP_LINKAGE __ke_signal_pendin
 extern void IP_LINKAGE __ke_set_current_state_task_interruptible(void);
 extern void IP_LINKAGE __ke_set_current_state_task_running(void);
 extern void IP_LINKAGE __ke_configure_sigmask(__ke_sigset_t *pSigMask);
-extern void IP_LINKAGE __ke_block_all_signals(int (*IP_LINKAGE notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask);
+extern void IP_LINKAGE __ke_block_all_signals(int (* notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask);
 extern void IP_LINKAGE __ke_unblock_all_signals(void);

 extern unsigned long IP_LINKAGE __ke__cmpxchg(volatile void *ptr, unsigned long old,
@@ -318,7 +318,7 @@ extern int IP_LINKAGE __ke_in(unsigned s

 extern void IP_LINKAGE __ke_enable_irq(int irq);
 extern void IP_LINKAGE __ke_disable_irq(int irq);
-extern int IP_LINKAGE __ke_request_irq(unsigned int irq, void (*IP_LINKAGE handler)(int, void *, void *), const char *dev_name, void *dev_id);
+extern int IP_LINKAGE __ke_request_irq(unsigned int irq, void (* handler)(int, void *, void *), const char *dev_name, void *dev_id);
 extern void IP_LINKAGE __ke_free_irq(unsigned int irq, void *dev_id);

 /*****************************************************************************/
@@ -395,7 +395,7 @@ unsigned long IP_LINKAGE __ke_agp_memory
 int IP_LINKAGE __ke_is_athlon(void);
 int IP_LINKAGE __ke_has_PSE(void);
 int IP_LINKAGE __ke_amd_adv_spec_cache_feature(void);
-void IP_LINKAGE __ke_smp_call_function( void (*IP_LINKAGE func)(void *info) );
+void IP_LINKAGE __ke_smp_call_function( void (* func)(void *info) );
 int IP_LINKAGE __ke_smp_processor_id(void);

 /*****************************************************************************/
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old May 14, 2004, 07:51 PM   #14
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default Patch to build 3.7.6 with 2.6.6-mm2 and 2.6.7 or recent kernels!

This is with the regparm applied but you should be able to apply it also without it...
Code:
diff -uprN build_mod-mreg_new/agpgart_be.c build_mod-mreg_new-mm/agpgart_be.c
--- build_mod-mreg_new/agpgart_be.c     2004-05-15 03:45:48.000000000 +0300
+++ build_mod-mreg_new-mm/agpgart_be.c  2004-05-15 03:18:30.000000000 +0300
@@ -1402,7 +1402,8 @@ unsigned long agp_generic_alloc_page(voi
     }
 #endif

-    atomic_inc(&page->count);
+    //atomic_inc(&page->count);
+    get_page(page);
     set_bit(PG_locked, &page->flags);
     atomic_inc(&agp_bridge.current_memory_agp);

@@ -4413,7 +4414,8 @@ static unsigned long ali_alloc_page(void
     if (page == NULL)
         return 0;

-    atomic_inc(&page->count);
+    //atomic_inc(&page->count);
+    get_page(page);
     set_bit(PG_locked, &page->flags);
     atomic_inc(&agp_bridge.current_memory_agp);

diff -uprN build_mod-mreg_new/firegl_public.c build_mod-mreg_new-mm/firegl_public.c
--- build_mod-mreg_new/firegl_public.c  2004-05-15 03:45:06.000000000 +0300
+++ build_mod-mreg_new-mm/firegl_public.c       2004-05-15 03:25:13.000000000 +0300
@@ -2066,7 +2066,8 @@ static vm_nopage_ret_t vm_shm_nopage(str
     pMmPage = virt_to_page(kaddr);
 #endif /* LINUX_VERSION_CODE < 0x020400 */

-    atomic_inc(&(pMmPage->count));  /* inc usage count of page */
+    //atomic_inc(&(pMmPage->count));  /* inc usage count of page */
+    get_page(pMmPage);

 #if LINUX_VERSION_CODE >= 0x020400
   //  __KE_DEBUG3("vm-address 0x%08lx => kernel-page-address 0x%p\n",
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis

Last edited by Mythos : Aug 3, 2004 at 08:10 PM.
Mythos is offline   Reply With Quote
Old May 16, 2004, 07:35 AM   #15
argasek
A replica of me
 
Join Date: Dec 2003
Location: Poland Sol [0,0], Poland, Kraków
Posts: 485
argasek is still being judged by the masses


Default

I have recently found this patch at Gentoo forums. It fixes compile problems with 2.6.6-mm2 kernel tree.

Code:
--- agpgart_be.c.orig   2004-05-14 21:39:19.943584512 +0000
+++ agpgart_be.c        2004-05-14 21:39:28.140338416 +0000
@@ -1402,7 +1402,7 @@ unsigned long agp_generic_alloc_page(voi
     }
 #endif
 
-    atomic_inc(&page->count);
+    get_page(page);
     set_bit(PG_locked, &page->flags);
     atomic_inc(&agp_bridge.current_memory_agp);
 
@@ -4413,7 +4413,7 @@ static unsigned long ali_alloc_page(void
     if (page == NULL)
         return 0;
 
-    atomic_inc(&page->count);
+        get_page(page);
     set_bit(PG_locked, &page->flags);
     atomic_inc(&agp_bridge.current_memory_agp);
 
--- firegl_public.c.orig        2004-05-14 21:38:53.296635464 +0000
+++ firegl_public.c     2004-05-14 21:40:28.492163544 +0000
@@ -2052,7 +2052,7 @@ static vm_nopage_ret_t vm_shm_nopage(str
     pMmPage = virt_to_page(kaddr);
 #endif /* LINUX_VERSION_CODE < 0x020400 */
 
-    atomic_inc(&(pMmPage->count));  /* inc usage count of page */
+    get_page(pMmPage);  /* inc usage count of page */
 
 #if LINUX_VERSION_CODE >= 0x020400
   //  __KE_DEBUG3("vm-address 0x%08lx => kernel-page-address 0x%p\n",
__________________
Argasek's blog | RLU #137109
Physics is like sex. Of course it can give some practical results, but that's not why we do it. (Richard Feynman)
argasek is offline   Reply With Quote
Old May 16, 2004, 08:09 AM   #16
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default

It is the same as the one I posted, don't you think?
The only difference is that I have putted in comments the code that should be removed!
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old May 17, 2004, 01:16 PM   #17
argasek
A replica of me
 
Join Date: Dec 2003
Location: Poland Sol [0,0], Poland, Kraków
Posts: 485
argasek is still being judged by the masses


Default

Ups, I have missed it!? I had to be blind or such... Sorry Mythos!
__________________
Argasek's blog | RLU #137109
Physics is like sex. Of course it can give some practical results, but that's not why we do it. (Richard Feynman)
argasek is offline   Reply With Quote
Old May 17, 2004, 01:56 PM   #18
WhO_KnOwS
The lurker mod
 
Join Date: Dec 2002
Location: Slovenia Slovenia, Europe
Posts: 3,227
WhO_KnOwS is still being judged by the masses


Default

Added the patches to the first post. Sorry for the delay guys (I was, am and will be lurking until further notice )
__________________
  • Intel Core 2 Quad Q6600 @ 3Ghz
  • GigaByte P35-DS4
  • 4 GB OCZ Gold 800Mhz DDR2 Dual Channel
  • XFX GeForce 280 GTX XXX
  • Dell 2407WFP monitor
  • CoolerMaster Cosmos S case


Other hardware: MacBook Pro 2.53GHz 13", Xbox360, iPhone 3GS 32GB
WhO_KnOwS is offline   Reply With Quote
Old May 18, 2004, 07:31 AM   #19
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default

The above patch for mm kernels, will also be needed to compile the driver for 2.6.7!
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old Jun 16, 2004, 12:38 PM   #20
venemousbunny
Newbie
 
Join Date: Jun 2004
Posts: 2
venemousbunny is still being judged by the masses


Default

Sorry for sounding so stupid, but I can't seem to get the 3d acceleration working. I have a fresh install of FC2, and I can't find any drivers for my Radeon 9600. I've tried to force the ATI drivers to install, but the kernel module won't build.
Running 'sh make.sh' gives me the following :
"
ATI module generator V 2.0
==========================
initializing...
Error:
XFree86 drm includes at /lib/modules/2.6.5-1.358/build/include/../drivers/char/drm do not fit this driver.
This driver is designed to only work with X4.1.0 or higher.
You can match this by getting Linux kernel 2.4.8 or higher.
"

Could somebody please help me ?

Thanks.
venemousbunny is offline   Reply With Quote
Old Jun 16, 2004, 04:45 PM   #21
mroy
Radeon HD 6770
 
Join Date: Jan 2004
Posts: 68
mroy is still being judged by the masses


Default


Last edited by mroy : Jul 26, 2004 at 06:29 PM.
mroy is offline   Reply With Quote
Old Jul 26, 2004, 04:17 AM   #22
JonSvenJonsson
Radeon HD 6970
 
Join Date: Mar 2004
Posts: 581
JonSvenJonsson is still being judged by the masses


Default

Hi
while surfing the gentoo-forums i encounterd that the internal agpgart does not support i875p, instead it treats it as an i875g (with integrated graphics). So i used google and found one person who had backported 2.6 i875p support to 2.4 agpgart.
http://jrfonseca.dyndns.org/misc/pat...gart-i875p.txt
http://jrfonseca.dyndns.org/misc/pat...art-i875p.diff

I did take a look on the patch and adopted it for fglrx (as it has 2.4 agpgart). i haven't tested it, as i don't have an intel-chipset. So please could someone with an i875p test this patch ? if it works people will be able to play nwn without an memleak with an i875p ;-).

Code:
diff -u --recursive build_mod.old/agp.h build_mod/agp.h
--- build_mod.old/agp.h 2004-03-17 23:00:29.000000000 +0100
+++ build_mod/agp.h     2004-07-26 12:41:26.361474584 +0200
@@ -656,6 +656,9 @@
     #ifndef PCI_DEVICE_ID_INTEL_865_G_1
     #define PCI_DEVICE_ID_INTEL_865_G_1         0x2572  // alternate macro
     #endif
+    #ifndef PCI_DEVICE_ID_INTEL_875_P_0
+    #define PCI_DEVICE_ID_INTEL_875_P_0        0x2578
+    #endif
     #ifndef PCI_DEVICE_ID_INTEL_875_G_0
     #define PCI_DEVICE_ID_INTEL_875_G_0         0x2578
     #endif
diff -u --recursive build_mod.old/agp_backend.h build_mod/agp_backend.h
--- build_mod.old/agp_backend.h 2004-03-17 23:00:29.000000000 +0100
+++ build_mod/agp_backend.h     2004-07-26 12:41:26.389470328 +0200
@@ -119,6 +119,7 @@
     _X(INTEL_I820),
     _X(INTEL_I830_M),
        _X(INTEL_I865_G),
+       _X(INTEL_I875_P),
        _X(INTEL_I875_G),
        _X(INTEL_I840),
        _X(INTEL_I845),
diff -u --recursive build_mod.old/agpgart_be.c build_mod/agpgart_be.c
--- build_mod.old/agpgart_be.c  2004-07-26 12:41:01.540247984 +0200
+++ build_mod/agpgart_be.c      2004-07-26 12:41:26.390470176 +0200
@@ -5800,6 +5800,12 @@
         "Intel",
         "i865G",
         intel_845_setup },
+    { PCI_DEVICE_ID_INTEL_875_P_0,
+       PCI_VENDOR_ID_INTEL,
+       INTEL_I875_P,
+       "Intel(R)",
+       "875P",
+       intel_845_setup },
     { PCI_DEVICE_ID_INTEL_875_G_1,
         PCI_VENDOR_ID_INTEL,
         INTEL_I875_G,
Only in build_mod.old/: firegl_public.c.orig

Last edited by JonSvenJonsson : Jul 26, 2004 at 05:48 AM. Reason: typo in patch ?!
JonSvenJonsson is offline   Reply With Quote
Old Aug 5, 2004, 04:16 PM   #23
mroy
Radeon HD 6770
 
Join Date: Jan 2004
Posts: 68
mroy is still being judged by the masses


Default Patch for ATI driver 3.11.1 and Fedora Core 2 with 2.6.7 kernel

Here is a patch to make the 3.11.1 ATI driver compile with Fedora Core 2 and its 2.6.7-1.494.2.2 official kernel:
Code:
diff -Nru build_mod.orig/2.6.x/Makefile build_mod/2.6.x/Makefile
--- build_mod.orig/2.6.x/Makefile	2004-08-05 23:06:07.709571464 +0200
+++ build_mod/2.6.x/Makefile	2004-08-05 23:06:35.673320328 +0200
@@ -11,7 +11,7 @@
 endif
 
 EXTRA_CFLAGS    += \
-                -Idrivers/char/drm/ \
+                -I$(DRMINCLUDES) \
                 -D__AGP__ \
                 -DFGL \
                 -DFGL_LINUX \
diff -Nru build_mod.orig/make.sh build_mod/make.sh
--- build_mod.orig/make.sh	2004-08-05 23:06:07.708571616 +0200
+++ build_mod/make.sh	2004-08-05 23:06:37.253080168 +0200
@@ -180,6 +180,11 @@
 drmincludes=${linuxincludes}/../drivers/char/drm
 #drmincludes=/usr/local/src/dripkg/drm
 
+# Fedora Core 2 work around
+if [ ! -e "/usr/src/linux" ] && [ -d "/usr/src/linux-${uname_r}" ]; then
+  drmincludes=/usr/src/linux-${uname_r}/drivers/char/drm
+fi
+
 # since kernel 2.4.8 the X4.1.0 drm kernel module headers are part
 # of the kernel build environment - check dir and expected files.
 
@@ -993,7 +998,7 @@
 if [ $kernel_is_26x -gt 0 ]; then
     echo "doing Makefile based build for kernel 2.6.x and higher"   | tee -a $logfile
     cd 2.6.x
-    make PAGE_ATTR_FIX=$PAGE_ATTR_FIX 2>&1                          | tee -a $logfile
+    make PAGE_ATTR_FIX=$PAGE_ATTR_FIX DRMINCLUDES=$drmincludes 2>&1 | tee -a $logfile
     res=$?
     cd ..
     if [ $res -eq 0 ]; then
mroy is offline   Reply With Quote
Old Aug 21, 2004, 06:56 AM   #24
Krazibon3
Newbie
 
Join Date: Aug 2004
Posts: 9
Krazibon3 is still being judged by the masses


Unhappy

Hey anders i just downloaded the patch at the following like and attempted to compile the module it gave me a hunks error which looked like this:


Code:
  patching file firegl_public.c
  Hunk #48 succeeded at 2195 with fuzz 2 (offset 61 lines).
  Hunk #50 succeeded at 2231 (offset 61 lines).
  Hunk #52 succeeded at 2311 (offset 61 lines).
  Hunk #54 succeeded at 2337 (offset 61 lines).
  Hunk #56 succeeded at 2652 (offset 61 lines).
  Hunk #58 succeeded at 2783 (offset 61 lines).
  Hunk #60 succeeded at 2828 (offset 61 lines).
  Hunk #62 succeeded at 2852 (offset 61 lines).
  Hunk #64 succeeded at 2874 (offset 61 lines).
  Hunk #66 succeeded at 2902 (offset 61 lines).
  Hunk #68 succeeded at 2944 (offset 61 lines).
  Hunk #70 succeeded at 3041 (offset 61 lines).
  Hunk #72 succeeded at 3073 (offset 61 lines).
  Hunk #74 succeeded at 3196 (offset 61 lines).
  patching file firegl_public.h
  Hunk #2 succeeded at 77 (offset 4 lines).
  Hunk #3 FAILED at 107.
  Hunk #5 succeeded at 200 (offset 4 lines).
  Hunk #7 succeeded at 340 (offset 4 lines).
  Hunk #8 FAILED at 377.
  2 out of 8 hunks FAILED -- saving rejects to file firegl_public.h.rej
  patching file make.sh
  Hunk #1 FAILED at 993.
  1 out of 1 hunk FAILED -- saving rejects to file make.sh.rej
Anyone know why it does it? its like day 3 trying to get 3d acceleration to work, can't seem to get the kernels agp to work.
Krazibon3 is offline   Reply With Quote
Old Oct 7, 2004, 04:35 PM   #25
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default Patch for 3.14.1 and 2.6.9-rc2-mm3 and later mm trees

EDIT: I am not able to insert the patch correctly with the tags. There seems to be a problem because of the many tabs...
Try and download it from either http://homepages.pathfinder.gr/mytho...3.14.1-mm.diff
or http://www.oalex.net/~ernstp/fglrx-3.14.1-mm.diff which was kindly uploaded by ernstp.
I would suggest the second link...
Code:
Common subdirectories: build_mod/2.6.x and build_mod-mm/2.6.x
diff -u build_mod/agpgart_be.c build_mod-mm/agpgart_be.c
--- build_mod/agpgart_be.c 2004-10-03 13:18:54.000000000 +0000
+++ build_mod-mm/agpgart_be.c 2004-10-08 00:48:53.000000000 +0000
@@ -718,7 +718,7 @@
   *        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 @@
   *        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 @@
   *        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 @@
   *        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 @@
  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 @@
                     &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;
  }
Only in build_mod: fglrx.ko
diff -u build_mod/firegl_public.c build_mod-mm/firegl_public.c
--- build_mod/firegl_public.c 2004-08-21 15:25:05.000000000 +0000
+++ build_mod-mm/firegl_public.c 2004-10-08 00:36:00.000000000 +0000
@@ -2577,13 +2577,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 */
@@ -2642,15 +2642,15 @@
 #else
    //   else
    {
-    if (__ke_vm_offset(vma) >= __pa(high_memory))
+    if (vma->vm_pgoff >= __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_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;
     }
 #ifdef __x86_64__
@@ -2679,15 +2679,15 @@
 //   else
 #else
    {
-    if (__ke_vm_offset(vma) >= __pa(high_memory))
+    if (vma->vm_pgoff >= __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_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;
     }
 #ifdef __x86_64__
Only in build_mod: make.log
Common subdirectories: build_mod/patch and build_mod-mm/patch
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis

Last edited by Mythos : Oct 8, 2004 at 07:24 AM.
Mythos is offline   Reply With Quote
Old Oct 7, 2004, 05:36 PM   #26
Twiggy794
Radeon HD 6770
 
Join Date: Aug 2004
Location: Phildalphia, Pennsylvania
Posts: 80
Twiggy794 is still being judged by the masses


Default

Is there a patch for 3.14.1 on Fedora Core 2?
Twiggy794 is offline   Reply With Quote
Old Oct 8, 2004, 10:07 AM   #27
Mythos
Don't worry - Be happy!
 
Join Date: Oct 2003
Location: Crete, Hellas
Posts: 1,909
Mythos is still being judged by the masses


Default

Quote:
Originally Posted by Twiggy794
Is there a patch for 3.14.1 on Fedora Core 2?
Please start a new thread. This thread is only for sending patches...
__________________
Radeon 9500 PRO - Mobility Radeon X700 - fglrx Beta driver - Xorg head CVS
Linux Santorini 2.6.16-rc2
GCC-4.1 CVS Branch
In real life Papadakos Panagiotis
Mythos is offline   Reply With Quote
Old Mar 22, 2005, 04:02 AM   #28
belcampo
Newbie
 
Join Date: Mar 2005
Posts: 2
belcampo is still being judged by the masses


Default Patch 3.12.0 for 2.6.11 kernel

Hi all,

Looking for a patch to compile 3.12.0 with a 2.6.11 kernel. Need the 3.12 version for a Pundit-R to be able to use TV-OUT.

It now says:
---------------------
XFree86 drm includes at /lib/modules/2.6.11drm/build/include/../drivers/char/drm do not fit this driver.
This driver is designed to only work with X4.1.0 or higher.
You can match this by getting Linux kernel 2.4.8 or higher.
-------------------

Henk Schoneveld
belcampo is offline   Reply With Quote
Old Apr 8, 2005, 12:03 AM   #29
Jenseitsmaschine
Newbie
 
Join Date: Apr 2005
Posts: 2
Jenseitsmaschine is still being judged by the masses


Default modified Patch for driver 8.12.10 and kernel 2.6.11

Hi,

I just managed it to install the new drivers on my system with 2.6.11 kernel and hope I can help others too. I took the two patches for 8.10.19 (p1.patch and p2.patch) which can be found here too. p1.patch could stay as it was, in p2.patch the line numbers had to be changed.

p1.patch :

Code:
--- or.c
+++ agpgart_be.c
@@ -261,6 +261,12 @@
 #define firegl_pci_find_class(class,from) pci_find_class(class,from)
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) 
+#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) {
@@ -4075,6 +4081,13 @@
 			}
 		}
 	}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) 
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device); 
+#endif
+
 	/*
 	 * PASS3: Figure out the 8X/4X setting and enable the
 	 *        target (our motherboard chipset).
@@ -5283,6 +5296,12 @@
             pci_dev_put(device); 
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) 
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device); 
+#endif
+
     return(0); /* success */
 }
 
@@ -7428,6 +7447,11 @@
 		return rc;
 	}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+        // decrease the reference count.
+        pci_dev_put(agp_bridge.dev);
+#endif
+
 	if (agp_bridge.needs_scratch_page == TRUE) {
 		agp_bridge.scratch_page = agp_bridge.agp_alloc_page();
p2.patch :

Code:
--- 2.c
+++ firegl_public.c
@@ -1663,13 +1663,22 @@
 {
     unsigned long pte_linear;
     pgd_t* pgd_p;
+#if LINUX_VERSION_CODE > 0x02060a     /* KERNEL_VERSION(2,6,11) */
+    pud_t* pud_p;
+#endif
     pmd_t* pmd_p;
     pte_t* pte_p;
     pte_t  pte;
 
     pte_linear = VMALLOC_VMADDR(virtual_addr);  // convert to pte linear address (x86 => nop)
     pgd_p = pgd_offset(mm, pte_linear);
+#if LINUX_VERSION_CODE > 0x02060a     /* KERNEL_VERSION(2,6,11) */
+    pud_p = pud_offset(pgd_p, pte_linear);
+    pmd_p = pmd_offset(pud_p, pte_linear);
+#else
     pmd_p = pmd_offset(pgd_p, pte_linear);
+#endif
+
 #ifndef FGL_ATOMIC_PTE
 #if LINUX_VERSION_CODE > 0x020500
     pte_p = pte_offset_kernel(pmd_p, pte_linear);
@@ -2099,6 +2108,9 @@
                                                    unsigned long address)
 {
     pgd_t* pgd_p;
+#if LINUX_VERSION_CODE > 0x02060a     /* KERNEL_VERSION(2,6,11) */
+    pud_t* pud_p;
+#endif
     pmd_t* pmd_p;
     pte_t* pte_p;
     pte_t  pte;
@@ -2199,7 +2211,12 @@
         /* alternatively we could generate a NOPAGE_OOM "out of memory" */
     }
     /*  locate medium level page table (x86 => nop) */
+#if LINUX_VERSION_CODE > 0x02060a     /* KERNEL_VERSION(2,6,11) */
+    pud_p = pud_offset(pgd_p, pte_linear);
+    pmd_p = pmd_offset(pud_p, pte_linear);
+#else
     pmd_p = pmd_offset(pgd_p, pte_linear);
+#endif
     if (!pmd_present(*pmd_p))
     {
         __KE_ERROR("FATAL ERROR: User queue buffer not present! (pmd)\n");
@@ -2563,13 +2580,21 @@
 {
     unsigned long pte_linear;
     pgd_t* pgd_p;
+#if LINUX_VERSION_CODE > 0x02060a     /* KERNEL_VERSION(2,6,11) */
+    pud_t* pud_p;
+#endif
     pmd_t* pmd_p;
     pte_t* pte_p;
     pte_t  pte;
 
     pte_linear = VMALLOC_VMADDR(virtual_addr);  // convert to pte linear address (x86 => nop)
     pgd_p = pgd_offset(vma->vm_mm, pte_linear);
+#if LINUX_VERSION_CODE > 0x02060a     /* KERNEL_VERSION(2,6,11) */
+    pud_p = pud_offset(pgd_p, pte_linear);
+    pmd_p = pmd_offset(pud_p, pte_linear);
+#else
     pmd_p = pmd_offset(pgd_p, pte_linear);
+#endif
 #ifndef FGL_ATOMIC_PTE
 #if LINUX_VERSION_CODE > 0x020500
     pte_p = pte_offset_kernel(pmd_p, pte_linear);
@@ -2718,13 +2743,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 */
@@ -2785,13 +2810,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__
@@ -2822,13 +2847,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__
@@ -2872,6 +2897,37 @@
 
 #if LINUX_VERSION_CODE >= 0x020400
 
+#if LINUX_VERSION_CODE >= 0x02060b
+
+typedef struct {
+       void                    (*free_memory)(struct agp_memory *);
+       struct agp_memory *     (*allocate_memory)(size_t, u32);
+       int                     (*bind_memory)(struct agp_memory *, off_t);
+       int                     (*unbind_memory)(struct agp_memory *);
+       void                    (*enable)(u32);
+       int                     (*acquire)(void);
+       void                    (*release)(void);
+       int                     (*copy_info)(struct agp_kern_info *);
+} drm_agp_t;
+
+static const drm_agp_t drm_agp = {
+       &agp_free_memory,
+       &agp_allocate_memory,
+       &agp_bind_memory,
+       &agp_unbind_memory,
+       &agp_enable,
+       &agp_backend_acquire,
+       &agp_backend_release,
+       &agp_copy_info
+};
+#undef DRM_AGP_MODULE_GET
+#undef DRM_AGP_MODULE_PUT
+
+#define DRM_AGP_MODULE_GET      &drm_agp
+#define DRM_AGP_MODULE_PUT 
+
+#endif
+
 static const drm_agp_t  *drm_agp_module_stub = NULL;
 
 #define AGP_FUNCTIONS		8
Hope it helps!
Jenseitsmaschine is offline   Reply With Quote
Old Apr 8, 2005, 08:08 AM   #30
-=RatMann=-
Newbie
 
Join Date: Mar 2005
Posts: 19
-=RatMann=- is still being judged by the masses


Default

Jenseitsmaschine, sorry, your patches didn't work for me.

[root@localhost build_mod]# patch -p0 < p1.patch
patching file agpgart_be.c
Hunk #1 succeeded at 261 with fuzz 1.
Hunk #2 FAILED at 4081.
Hunk #4 FAILED at 7447.
2 out of 4 hunks FAILED -- saving rejects to file agpgart_be.c.rej

[root@localhost build_mod]# patch -p0 < p2.patch
patching file firegl_public.c
Hunk #6 FAILED at 2810.
Hunk #7 FAILED at 2847.
Hunk #8 succeeded at 2897 with fuzz 1.
2 out of 8 hunks FAILED -- saving rejects to file firegl_public.c.rej

Vanilla kernel 2.6.11.
-=RatMann=- is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
N-Patches Scorched Radeon Technical Support 4 Dec 26, 2002 09:35 PM
NFS: PU patches HELP PLZ!! CompuGeek PC Gaming 8 Oct 27, 2002 08:59 PM
Are driver patches, application specific? Coyote General Radeon Discussion 2 Dec 6, 2001 03:29 AM
Radeon 8500 supports Rt-Patches! Quinic Beizer & B-Spline Patches? RadeonMAXX General Radeon Discussion 14 Oct 28, 2001 02:34 PM
nvidia has rt-patches , ati has n-patches shadow_QWTF General Radeon Discussion 4 May 30, 2001 04:46 PM


All times are GMT -5. The time now is 03:52 PM.



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