diff options
Diffstat (limited to 'x11-drivers/nvidia-drivers/files')
21 files changed, 477 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist b/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist new file mode 100644 index 0000000..5e139de --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist @@ -0,0 +1 @@ +PRELINK_PATH_MASK="/usr/lib{,64}/tls/libnvidia-tls*:/usr/lib{,64}/libnvidia*:/usr/lib{,64}/libGL*:/usr/lib{,64}/opengl/nvidia/*:/usr/lib{,64}/OpenCL/vendors/nvidia/*:/usr/lib{,64}/xorg/modules/drivers/nvidia*:/usr/lib{,64}/libvdpau_nvidia*:/usr/lib{,64}/libXvMCNVIDIA*:/usr/lib{,64}/libcuda*:/usr/lib{,64}/libnvcuvid*" diff --git a/x11-drivers/nvidia-drivers/files/95-nvidia-settings b/x11-drivers/nvidia-drivers/files/95-nvidia-settings new file mode 100644 index 0000000..e9d6274 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/95-nvidia-settings @@ -0,0 +1,2 @@ +#!/bin/sh +/opt/bin/nvidia-settings --load-config-only diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch new file mode 100644 index 0000000..da9933f --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch @@ -0,0 +1,11 @@ +diff -ur NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h +--- NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h 2002-12-09 21:26:55.000000000 +0100 ++++ NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h 2003-01-30 18:20:23.000000000 +0100 +@@ -39,6 +39,7 @@ + typedef XID GLXPixmap; + typedef XID GLXDrawable; + typedef XID GLXPbuffer; ++typedef XID GLXPbufferSGIX; + typedef XID GLXWindow; + typedef XID GLXFBConfigID; + diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch new file mode 100644 index 0000000..e0393e1 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch @@ -0,0 +1,13 @@ +--- usr/include/GL/gl.g.orig 2004-07-17 19:56:59.789410584 +1000 ++++ usr/include/GL/gl.h 2004-07-17 19:59:08.844791184 +1000 +@@ -66,6 +66,10 @@ + typedef double GLclampd; + typedef void GLvoid; + ++/* Patching for some better defines in the global system */ ++#ifndef GL_GLEXT_LEGACY ++#include <GL/glext.h> ++#endif + + /*************************************************************/ + diff --git a/x11-drivers/nvidia-drivers/files/nvidia-169.07 b/x11-drivers/nvidia-drivers/files/nvidia-169.07 new file mode 100644 index 0000000..a96b0cd --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-169.07 @@ -0,0 +1,14 @@ +# Nvidia drivers support +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 + +# To tweak the driver the following options can be used, note that +# you should be careful, as it could cause instability!! For more +# options see /usr/share/doc/PACKAGE/README +# +# !!! SECURITY WARNING !!! +# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW +# WHAT YOU ARE DOING. +# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, +# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. +options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1 diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch new file mode 100644 index 0000000..9777ce6 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch @@ -0,0 +1,52 @@ +--- a/kernel/nv-linux.h ++++ b/kernel/nv-linux.h +@@ -757,16 +757,16 @@ + + #if defined(NV_KMEM_CACHE_CREATE_PRESENT) + #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL, NULL); \ ++ 0, flags, NULL, NULL); \ + } + #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL); \ ++ 0, flags, NULL); \ + } + #else + #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!" +--- a/kernel/nv.c ++++ b/kernel/nv.c +@@ -794,7 +794,7 @@ + NV_SPIN_LOCK_INIT(&km_lock); + #endif + +- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t); ++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t, SLAB_USERCOPY); + if (nv_stack_t_cache == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); +@@ -924,7 +924,7 @@ + nv->os_state = (void *) &nv_ctl_device; + nv_lock_init_locks(nv); + +- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, NV_PTE_CACHE_STR, nv_pte_t); ++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, NV_PTE_CACHE_STR, nv_pte_t, 0); + if (nv_pte_t_cache == NULL) + { + rc = -ENOMEM; +@@ -935,7 +935,7 @@ + if (NV_BUILD_MODULE_INSTANCES == 0) + { + NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t", +- nvidia_p2p_page_t); ++ nvidia_p2p_page_t, 0); + if (nvidia_p2p_page_t_cache == NULL) + { + rc = -ENOMEM; diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch new file mode 100644 index 0000000..0ec9edf --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch @@ -0,0 +1,25 @@ +--- a/kernel/uvm/nvidia_uvm_common.c ++++ b/kernel/uvm/nvidia_uvm_common.c +@@ -95,7 +95,6 @@ static RM_STATUS uvmnext_gpu_event_stop_ + #endif // NVIDIA_UVM_NEXT_ENABLED + + static dev_t g_uvmBaseDev; +-struct UvmOpsUvmEvents g_exportedUvmOps; + + // TODO: This would be easier if RM allowed for multiple registrations, since we + // could register UVM-Lite and UVM-Next separately (bug 1372835). +@@ -147,9 +146,11 @@ static RM_STATUS uvmSetupGpuProvider(voi + RM_STATUS status = RM_OK; + + #ifdef NVIDIA_UVM_RM_ENABLED +- g_exportedUvmOps.startDevice = uvm_gpu_event_start_device; +- g_exportedUvmOps.stopDevice = uvm_gpu_event_stop_device; +- g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half; ++ static struct UvmOpsUvmEvents g_exportedUvmOps = { ++ .startDevice = uvm_gpu_event_start_device, ++ .stopDevice = uvm_gpu_event_stop_device, ++ .isrTopHalf = uvmnext_isr_top_half, ++ }; + + // call RM to exchange the function pointers. + status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps); diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch new file mode 100644 index 0000000..9b9f53e --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch @@ -0,0 +1,25 @@ +--- a/kernel/uvm/uvm_common.c ++++ b/kernel/uvm/uvm_common.c +@@ -95,7 +95,6 @@ static RM_STATUS uvmnext_gpu_event_stop_ + #endif // NVIDIA_UVM_NEXT_ENABLED + + static dev_t g_uvmBaseDev; +-struct UvmOpsUvmEvents g_exportedUvmOps; + + // TODO: This would be easier if RM allowed for multiple registrations, since we + // could register UVM-Lite and UVM-Next separately (bug 1372835). +@@ -147,9 +146,11 @@ static RM_STATUS uvmSetupGpuProvider(voi + RM_STATUS status = RM_OK; + + #ifdef NVIDIA_UVM_RM_ENABLED +- g_exportedUvmOps.startDevice = uvm_gpu_event_start_device; +- g_exportedUvmOps.stopDevice = uvm_gpu_event_stop_device; +- g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half; ++ static struct UvmOpsUvmEvents g_exportedUvmOps = { ++ .startDevice = uvm_gpu_event_start_device, ++ .stopDevice = uvm_gpu_event_stop_device, ++ .isrTopHalf = uvmnext_isr_top_half, ++ }; + + // call RM to exchange the function pointers. + status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps); diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch new file mode 100644 index 0000000..d1a440c --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch @@ -0,0 +1,47 @@ +--- a/kernel/nv.c ++++ b/kernel/nv.c +@@ -705,7 +705,7 @@ int __init nvidia_init_module(void) + #endif + + nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name, +- nvidia_stack_t); ++ nvidia_stack_t, SLAB_USERCOPY); + if (nvidia_stack_t_cache == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); +@@ -846,7 +846,7 @@ int __init nvidia_init_module(void) + nv_lock_init_locks(nv); + + nvidia_pte_t_cache = NV_KMEM_CACHE_CREATE(nvidia_pte_cache_name, +- nvidia_pte_t); ++ nvidia_pte_t, 0); + if (nvidia_pte_t_cache == NULL) + { + rc = -ENOMEM; +@@ -857,7 +857,7 @@ int __init nvidia_init_module(void) + if (!nv_multiple_kernel_modules) + { + nvidia_p2p_page_t_cache = NV_KMEM_CACHE_CREATE(nvidia_p2p_page_cache_name, +- nvidia_p2p_page_t); ++ nvidia_p2p_page_t, 0); + if (nvidia_p2p_page_t_cache == NULL) + { + rc = -ENOMEM; +--- a/kernel/nv-linux.h ++++ b/kernel/nv-linux.h +@@ -1431,11 +1431,11 @@ extern void *nvidia_stack_t_cache; + + #if !defined(NV_VMWARE) + #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) +-#define NV_KMEM_CACHE_CREATE(name, type) \ +- kmem_cache_create(name, sizeof(type), 0, 0, NULL) ++#define NV_KMEM_CACHE_CREATE(name, type, flags) \ ++ kmem_cache_create(name, sizeof(type), 0, flags, NULL) + #else +-#define NV_KMEM_CACHE_CREATE(name, type) \ +- kmem_cache_create(name, sizeof(type), 0, 0, NULL, \ ++#define NV_KMEM_CACHE_CREATE(name, type, flags) \ ++ kmem_cache_create(name, sizeof(type), 0, flags, NULL, \ + NULL) + #endif + #define NV_KMEM_CACHE_DESTROY(kmem_cache) \ diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-355.06-pax.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-355.06-pax.patch new file mode 100644 index 0000000..cc5ebdf --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-355.06-pax.patch @@ -0,0 +1,102 @@ +diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-355.06/kernel/common/inc/nv-linux.h +--- NVIDIA-Linux-x86_64-355.06.orig/kernel/common/inc/nv-linux.h 2015-07-29 05:13:57.000000000 +0200 ++++ NVIDIA-Linux-x86_64-355.06/kernel/common/inc/nv-linux.h 2015-08-21 16:45:55.624336728 +0200 +@@ -1408,11 +1408,11 @@ extern void *nvidia_stack_t_cache; + + #if !defined(NV_VMWARE) + #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) +-#define NV_KMEM_CACHE_CREATE(name, type) \ +- kmem_cache_create(name, sizeof(type), 0, 0, NULL) ++#define NV_KMEM_CACHE_CREATE(name, type, flags) \ ++ kmem_cache_create(name, sizeof(type), 0, flags, NULL) + #else +-#define NV_KMEM_CACHE_CREATE(name, type) \ +- kmem_cache_create(name, sizeof(type), 0, 0, NULL, \ ++#define NV_KMEM_CACHE_CREATE(name, type, flags) \ ++ kmem_cache_create(name, sizeof(type), 0, flags, NULL, \ + NULL) + #endif + #define NV_KMEM_CACHE_DESTROY(kmem_cache) \ +diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv.c NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv.c +--- NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv.c 2015-07-29 05:13:57.000000000 +0200 ++++ NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv.c 2015-08-21 16:44:51.008340178 +0200 +@@ -719,7 +719,7 @@ int __init nvidia_init_module(void) + #endif + + nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name, +- nvidia_stack_t); ++ nvidia_stack_t, SLAB_USERCOPY); + if (nvidia_stack_t_cache == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); +@@ -861,7 +861,7 @@ int __init nvidia_init_module(void) + nv_state_init_gpu_uuid_cache(nv); + + nvidia_pte_t_cache = NV_KMEM_CACHE_CREATE(nvidia_pte_cache_name, +- nvidia_pte_t); ++ nvidia_pte_t, 0); + if (nvidia_pte_t_cache == NULL) + { + rc = -ENOMEM; +@@ -872,7 +872,7 @@ int __init nvidia_init_module(void) + if (!nv_multiple_kernel_modules) + { + nvidia_p2p_page_t_cache = NV_KMEM_CACHE_CREATE(nvidia_p2p_page_cache_name, +- nvidia_p2p_page_t); ++ nvidia_p2p_page_t, 0); + if (nvidia_p2p_page_t_cache == NULL) + { + rc = -ENOMEM; +diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv-mmap.c NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv-mmap.c +--- NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia/nv-mmap.c 2015-07-29 05:13:57.000000000 +0200 ++++ NVIDIA-Linux-x86_64-355.06/kernel/nvidia/nv-mmap.c 2015-08-21 16:58:15.968297199 +0200 +@@ -113,12 +113,12 @@ nvidia_vma_release(struct vm_area_struct + } + + #if defined(NV_VM_OPERATIONS_STRUCT_HAS_ACCESS) +-static int ++static ssize_t + nvidia_vma_access( + struct vm_area_struct *vma, + unsigned long addr, + void *buffer, +- int length, ++ size_t length, + int write + ) + { +diff -urp NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia-uvm/uvm_common.c NVIDIA-Linux-x86_64-355.06/kernel/nvidia-uvm/uvm_common.c +--- NVIDIA-Linux-x86_64-355.06.orig/kernel/nvidia-uvm/uvm_common.c 2015-07-29 05:10:08.000000000 +0200 ++++ NVIDIA-Linux-x86_64-355.06/kernel/nvidia-uvm/uvm_common.c 2015-08-21 17:00:33.788289841 +0200 +@@ -60,7 +60,7 @@ static void uvmnext_exit(void) + { + + } +-static NV_STATUS uvmnext_isr_top_half(void) ++static NV_STATUS uvmnext_isr_top_half(UvmGpuUuid *gpuUuidStruct) + { + return NV_ERR_NO_INTR_PENDING; + } +@@ -79,7 +79,6 @@ NvBool uvmnext_activated(void) + #endif // NVIDIA_UVM_NEXT_ENABLED + + static dev_t g_uvmBaseDev; +-struct UvmOpsUvmEvents g_exportedUvmOps; + + // TODO: This would be easier if RM allowed for multiple registrations, since we + // could register UVM-Lite and UVM-Next separately (bug 1372835). +@@ -112,9 +111,11 @@ static NV_STATUS uvmSetupGpuProvider(voi + NV_STATUS status = NV_OK; + + #ifdef NVIDIA_UVM_RM_ENABLED +- g_exportedUvmOps.startDevice = uvm_gpu_event_start_device; +- g_exportedUvmOps.stopDevice = uvm_gpu_event_stop_device; +- g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half; ++ static struct UvmOpsUvmEvents g_exportedUvmOps = { ++ .startDevice = uvm_gpu_event_start_device, ++ .stopDevice = uvm_gpu_event_stop_device, ++ .isrTopHalf = uvmnext_isr_top_half, ++ }; + + // call RM to exchange the function pointers. + status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps); diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch new file mode 100644 index 0000000..f3b8259 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch @@ -0,0 +1,17 @@ +Binary files kernel.orig/.nv-procfs.c.swp and kernel/.nv-procfs.c.swp differ +diff -urp kernel.orig/nv-procfs.c kernel/nv-procfs.c +--- kernel.orig/nv-procfs.c 2011-07-13 03:29:30.000000000 +0200 ++++ kernel/nv-procfs.c 2011-07-19 15:45:27.982993911 +0200 +@@ -707,8 +707,10 @@ int nv_register_procfs(void) + * However, in preparation for this, we need to preserve + * the procfs read() and write() operations. + */ +- nv_procfs_registry_fops.read = entry->proc_fops->read; +- nv_procfs_registry_fops.write = entry->proc_fops->write; ++ pax_open_kernel(); ++ *(void **)&nv_procfs_registry_fops.read = entry->proc_fops->read; ++ *(void **)&nv_procfs_registry_fops.write = entry->proc_fops->write; ++ pax_close_kernel(); + + entry = NV_CREATE_PROC_FILE("registry", proc_nvidia, + nv_procfs_read_registry, diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch new file mode 100644 index 0000000..ce8c201 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch @@ -0,0 +1,54 @@ +diff -urp kernel.orig/nv.c kernel/nv.c +--- kernel.orig/nv.c 2011-09-24 02:32:09.000000000 +0200 ++++ kernel/nv.c 2011-10-05 19:13:41.474242252 +0200 +@@ -1105,7 +1105,7 @@ static int __init nvidia_init_module(voi + NV_SPIN_LOCK_INIT(&km_lock); + #endif + +- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t); ++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY); + if (nv_stack_t_cache == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); +@@ -1220,7 +1220,7 @@ static int __init nvidia_init_module(voi + } + #endif + +- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t); ++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0); + if (nv_pte_t_cache == NULL) + { + rc = -ENOMEM; +@@ -1229,7 +1229,7 @@ static int __init nvidia_init_module(voi + } + + NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t", +- nvidia_p2p_page_t); ++ nvidia_p2p_page_t, 0); + if (nvidia_p2p_page_t_cache == NULL) + { + rc = -ENOMEM; +diff -urp kernel.orig/nv-linux.h kernel/nv-linux.h +--- kernel.orig/nv-linux.h 2011-09-24 02:32:09.000000000 +0200 ++++ kernel/nv-linux.h 2011-10-05 19:14:42.522238996 +0200 +@@ -695,16 +695,16 @@ extern nv_spinlock_t km_lock; + + #if defined(NV_KMEM_CACHE_CREATE_PRESENT) + #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL, NULL); \ ++ 0, flags, NULL, NULL); \ + } + #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL); \ ++ 0, flags, NULL); \ + } + #else + #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!" diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop new file mode 100644 index 0000000..773a5af --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=NVIDIA X Server Settings +Comment=Configure NVIDIA X Server Settings +Exec=/opt/bin/nvidia-settings +Icon=nvidia-drivers-settings +Categories=System;Settings; diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf new file mode 100644 index 0000000..637ac1a --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf @@ -0,0 +1,8 @@ +# run-time configuration file for /etc/init.d/nvidia-persistenced + +# NVPD_USER: The user nvidia-persistenced is intended to run for +NVPD_USER="" + +# ARGS: Additional arguments to set the default persistence mode +# (see nvidia-persistenced(1)) +ARGS="" diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init new file mode 100644 index 0000000..07f6905 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +pidfile="/var/run/nvidia-persistenced/nvidia-persistenced.pid" + +start() { + if ! [ "${NVPD_USER}x" = x ]; then + ebegin "Starting nvidia-persistenced for ${NVPD_USER}" + NVPD_USER_ARG="--user ${NVPD_USER}" + else + ebegin "Starting nvidia-persistenced" + fi + start-stop-daemon --start --quiet --pidfile ${pidfile} \ + --background --exec /opt/bin/nvidia-persistenced \ + -- ${NVPD_USER_ARG} ${ARGS} + eend $? +} + +stop() { + ebegin "Stopping nvidia-persistenced" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} diff --git a/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf b/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf new file mode 100644 index 0000000..48a8273 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-rmmod.conf @@ -0,0 +1,3 @@ +# Nvidia UVM support + +remove nvidia modprobe -r --ignore-remove nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-smi.init b/x11-drivers/nvidia-drivers/files/nvidia-smi.init new file mode 100644 index 0000000..6dce4e8 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-smi.init @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +pidfile="/run/nvidia-smi.pid" + +depend() { + after modules +} + +start() { + ebegin "Starting NVIDIA System Management Interface" + rm -f ${pidfile} + start-stop-daemon --start --quiet --pidfile ${pidfile} \ + --make-pidfile --background --exec /opt/bin/nvidia-smi -- \ + -q -l 300 + eend $? +} + +stop() { + ebegin "Stopping NVIDIA System Management Interface" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} diff --git a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh new file mode 100644 index 0000000..9487b08 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Invalid args" >&2 + exit 1 +fi + +case $1 in + add|ADD) + /opt/bin/nvidia-smi > /dev/null + ;; + remove|REMOVE) + rm -f /dev/nvidia* + ;; +esac + +exit 0 diff --git a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1 b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1 new file mode 100644 index 0000000..6579bf7 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh-r1 @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Invalid args" >&2 + exit 1 +fi + +case $1 in + add|ADD) + #hopefully this prevents infinite loops like bug #454740 + if lsmod | grep -iq nvidia; then + /opt/bin/nvidia-smi > /dev/null + fi + ;; + remove|REMOVE) + rm -f /dev/nvidia* + ;; +esac + +exit 0 diff --git a/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf b/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf new file mode 100644 index 0000000..222c5ba --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf @@ -0,0 +1,3 @@ +# Nvidia UVM support + +remove nvidia modprobe -r --ignore-remove nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule new file mode 100644 index 0000000..2eb30bb --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule @@ -0,0 +1,6 @@ +ACTION=="add", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}" +# Previously the ACTION was "add|remove" but one user on bug #376527 had a +# problem until he recompiled udev-171-r5, which is one of the versions I +# tested with and it was fine. I'm breaking the rules out just to be safe +# so someone else doesn't have an issue +ACTION=="remove", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}" |