View Single Post
Old 02-19-07, 12:19 PM   #1
zzzhong
Registered User
 
Join Date: Feb 2007
Posts: 2
Default Compile problem of 7184 driver in 2.6.20 (patch included)

For some reason I must use driver version 7184 instead of 9631 on my MX440 with TV out. But 7184 won't compile well on 2.6.20. If you have the same situation you may get the error like "incompatible pointer type of argument 2 of request_irq...", you can use the patch below, that is back-port from 9631. Now I can use 7184 on 2.6.20 and watch mplayer with nice TV-out.


Code:
diff -ur NVIDIA-Linux-x86-1.0-7184-pkg1.orig/usr/src/nv/Makefile.kbuild NVIDIA-Linux-x86-1.0-7184-pkg1/usr/src/nv/Makefile.kbuild
--- NVIDIA-Linux-x86-1.0-7184-pkg1.orig/usr/src/nv/Makefile.kbuild      Wed Aug  2 10:07:27 2006
+++ NVIDIA-Linux-x86-1.0-7184-pkg1/usr/src/nv/Makefile.kbuild   Tue Feb 20 01:26:55 2007
@@ -186,6 +186,9 @@
     EXTRA_CFLAGS += -DNV_PM_MESSAGE_T_PRESENT
   endif

+  ifeq ($(shell $(CONFTEST) irq_handler_ptregs), 1)
+    EXTRA_CFLAGS += -DNV_IRQ_HANDLER_WITH_PTREGS_PRESENT
+  endif
   ifeq ($(shell $(CONFTEST) pci_choose_state), 1)
     EXTRA_CFLAGS += -DNV_PCI_CHOOSE_STATE_PRESENT
   endif
diff -ur NVIDIA-Linux-x86-1.0-7184-pkg1.orig/usr/src/nv/nv-linux.h NVIDIA-Linux-x86-1.0-7184-pkg1/usr/src/nv/nv-linux.h
--- NVIDIA-Linux-x86-1.0-7184-pkg1.orig/usr/src/nv/nv-linux.h   Wed Aug  2 10:07:27 2006
+++ NVIDIA-Linux-x86-1.0-7184-pkg1/usr/src/nv/nv-linux.h        Tue Feb 20 01:26:55 2007
@@ -14,7 +14,7 @@

 #include "nv.h"

-#include <linux/config.h>
+#include <linux/autoconf.h>
 #include <linux/version.h>
 #include <linux/utsname.h>

@@ -672,6 +672,10 @@
 #define NV_PM_SUPPORT_OLD_STYLE_APM
 #endif

+#if defined(KERNEL_2_4)
+#define NV_IRQ_HANDLER_WITH_PTREGS_PRESENT
+#endif
+
 #ifndef minor
 # define minor(x) MINOR(x)
 #endif
diff -ur NVIDIA-Linux-x86-1.0-7184-pkg1.orig/usr/src/nv/nv.c NVIDIA-Linux-x86-1.0-7184-pkg1/usr/src/nv/nv.c
--- NVIDIA-Linux-x86-1.0-7184-pkg1.orig/usr/src/nv/nv.c Wed Aug  2 10:07:26 2006
+++ NVIDIA-Linux-x86-1.0-7184-pkg1/usr/src/nv/nv.c      Tue Feb 20 01:26:55 2007
@@ -242,7 +242,11 @@
 int           nv_kern_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
 long          nv_kern_compat_ioctl(struct file *, unsigned int, unsigned long);
 void          nv_kern_isr_bh(unsigned long);
+#if defined(NV_IRQ_HANDLER_WITH_PTREGS_PRESENT)
 irqreturn_t   nv_kern_isr(int, void *, struct pt_regs *);
+#else
+irqreturn_t   nv_kern_isr(int, void *);
+#endif
 void          nv_kern_rc_timer(unsigned long);
 #if defined(NV_PM_SUPPORT_OLD_STYLE_APM)
 static int    nv_kern_apm_event(struct pm_dev *, pm_request_t, void *);
@@ -2482,8 +2486,10 @@
  */
 irqreturn_t nv_kern_isr(
     int   irq,
-    void *arg,
-    struct pt_regs *regs
+    void *arg
+#if defined(NV_IRQ_HANDLER_WITH_PTREGS_PRESENT)
+    ,struct pt_regs *regs
+#endif
 )
 {
     nv_linux_state_t *nvl = (void *) arg;
zzzhong is offline   Reply With Quote