[pkg-nvidia-devel] Patch to enable 2.6.31 support.

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Thu Jul 16 16:09:32 UTC 2009


Here is a patch that makes the current driver compile and work with
2.6.31 kernel (at least as of -rc2).  I had to modify it slightly from
the one I found on the nv forums to actually be backwards compatible
with 2.6.30 and prior.  Just imagine, we could support a new kernel
before it even hits unstable for once.  I should check if the legacy
packages can be fixed in a similar manner.

I am using it on my laptop so far.

--- usr/src/nv/os-agp.c.orig 2009-06-22 15:54:48.000000000 +0200
+++ usr/src/nv/os-agp.c 2009-06-22 15:40:13.000000000 +0200
@@ -293,7 +293,11 @@ RM_STATUS KernLoadAGPPages(
     {
          nv_pte_t *page_ptr = at->page_table[i];
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
          page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK);
+#else
+         page_ptr->phys_addr = (page_to_phys(ptr->pages[i]) & PAGE_MASK);
+#endif
          page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr);
          page_ptr->dma_addr  = page_ptr->phys_addr;
     }
--- usr/src/nv/nv-i2c.c.orig 2009-06-22 16:21:57.000000000 +0200
+++ usr/src/nv/nv-i2c.c 2009-06-22 16:24:12.000000000 +0200
@@ -218,8 +218,6 @@
 #if defined(NV_I2C_ADAPTER_HAS_DEC_USE)
     .dec_use           = nv_i2c_adapter_dec_use,
 #endif
-    .client_register   = nv_i2c_adapter_register_client,
-    .client_unregister = nv_i2c_adapter_unregister_client,
     .data              = NULL,
 };
 
@@ -241,8 +239,6 @@
     .owner             = THIS_MODULE,
     .algo              = &nv_i2c_algo,
     .algo_data         = NULL,
-    .client_register   = nv_i2c_adapter_register_client,
-    .client_unregister = nv_i2c_adapter_unregister_client,
 };
 
 #endif // defined(KERNEL_2_4)

-- 
Len Sorensen



More information about the Pkg-nvidia-devel mailing list