Pull to refresh

Патч для драйвера nvidia-319.49 под ядро Linux 3.12.0+

Configuring Linux *
Recovery mode
Для тех кто знает и кому нужно.

diff -ur a/kernel/nv-drm.c b/kernel/nv-drm.c
--- a/kernel/nv-drm.c   2013-08-14 06:33:23.000000000 +0400
+++ b/kernel/nv-drm.c   2013-09-26 02:46:03.528914493 +0400
@@ -106,7 +106,9 @@
     .unlocked_ioctl = drm_ioctl,
     .mmap = drm_gem_mmap,
     .poll = drm_poll,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
     .fasync = drm_fasync,
+#endif
     .read = drm_read,
     .llseek = noop_llseek,
 };
@@ -202,13 +204,6 @@
     memset(&nv_obj->base, 0, sizeof(nv_obj->base));
     nv_obj->pages = pages;
 
-    ret = drm_gem_private_object_init(nvl->drm, &nv_obj->base, size);
-    if (ret)
-    {
-        status = RM_ERR_OPERATING_SYSTEM;
-        goto done;
-    }
-
     ret = drm_gem_handle_create(file_priv, &nv_obj->base, handle);
     if (ret)
     {
@@ -216,6 +211,7 @@
         goto done;
     }
 
+    drm_gem_private_object_init(nvl->drm, &nv_obj->base, size);
     drm_gem_object_unreference_unlocked(&nv_obj->base);
 
     status = RM_OK;
diff -ur a/kernel/nv-linux.h b/kernel/nv-linux.h
--- a/kernel/nv-linux.h 2013-08-14 06:33:23.000000000 +0400
+++ b/kernel/nv-linux.h 2013-09-26 02:24:58.863000000 +0400
@@ -1037,7 +1037,11 @@
 #endif
 
 #if !defined(NV_VMWARE)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
 #define NV_NUM_PHYSPAGES                num_physpages
+#else
+#define NV_NUM_PHYSPAGES                get_num_physpages()
+#endif
 #define NV_GET_CURRENT_PROCESS()        current->tgid
 #define NV_IN_ATOMIC()                  in_atomic()
 #define NV_LOCAL_BH_DISABLE()           local_bh_disable()
Tags:
Hubs:
Total votes 35: ↑15 and ↓20 -5
Views 5.3K
Comments Comments 13