Зачесалось — написалось.
Проверено на Lightmark2008 и Unigine Heaven 2.5
diff -ur NVIDIA-Linux-x86_64-319.49/kernel/nv.c 319.49/kernel/nv.c --- NVIDIA-Linux-x86_64-319.49/kernel/nv.c 2013-08-14 06:33:23.000000000 +0400 +++ 319.49/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 NVIDIA-Linux-x86_64-319.49/kernel/nv-drm.c 319.49/kernel/nv-drm.c --- NVIDIA-Linux-x86_64-319.49/kernel/nv-drm.c 2013-08-14 06:33:23.000000000 +0400 +++ 319.49/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 NVIDIA-Linux-x86_64-319.49/kernel/nv-linux.h 319.49/kernel/nv-linux.h --- NVIDIA-Linux-x86_64-319.49/kernel/nv-linux.h 2013-08-14 06:33:23.000000000 +0400 +++ 319.49/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()
ссылка на оригинал статьи http://habrahabr.ru/post/195284/
Добавить комментарий