Патч для драйвера 319.42 (stable) nvidia к ядру 3.12+ (testing)

в 22:52, , рубрики: kernel, linux, Nvidia, метки: ,

Зачесалось — написалось.

Проверено на Lightmark2008 и Unigine Heaven 2.5 и 4.0.
Конфиг: AMD64, Linux 3.12.0-rc2+, Geforce GTS250.

diff -ur a/kernel/nv.c b/kernel/nv.c
--- a/kernel/nv.c      2013-08-14 06:33:23.000000000 +0400
+++ b/kernel/nv.c  2013-09-16 15:53:55.000000000 +0400
@@ -16,7 +16,7 @@
 #include "rmil.h"
 
 #if defined(MODULE_LICENSE)
-MODULE_LICENSE("NVIDIA");
+MODULE_LICENSE("GPL v2"); /* Привычка :) */
 #endif
 #if defined(MODULE_INFO)
 MODULE_INFO(supported, "external");
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()

Автор: pavlinux

Источник


https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js