Add x11-drivers/nvidia-drivers again with PAX patches

This commit is contained in:
Stefan Reimer 2013-11-07 20:40:57 -08:00
parent 7c779316ad
commit 2abec1f330
17 changed files with 3364 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
AUX 50nvidia-prelink-blacklist 319 SHA256 61adce61498451898c22fb538151379438729957418eacf4f69195b3e03ec1f4 SHA512 7252b464c45669bb402859ddb2c95f4553a37027870b6aeada3e1dd58fefe7b4713d3486d301177efdcd7559dbc31ceb6078220d5c0187bdc636d817a98e1a41 WHIRLPOOL 93e14ed7c8fb5dba87295c87e1e8906afac290f63dc6ea023fa6c387ed47ff13d488b3b24c400aee42a22737856a7782925d9a3a412ddcd1984dbbd7e51579a5
AUX 95-nvidia-settings 54 SHA256 c4b293c6c2659bebcbad9cffc1e237c6908a3763599e432aba89d07bc2826ba0 SHA512 0fdaff8701598081eeb78defcd140b78f75309ace998df67569a15d0ff653aca7ad0576912bf9a619f42990e6fb35cdb79e21f8181d3cd04dea719d912da8be9 WHIRLPOOL d71fef01f8c346089ef2556ffe62c5094f89582b73500711a7f18f25424e59baa12f6b0861bd8efd9bf4c5bbf794642927ca322cee218fd2da9fc7baa50fa827
AUX NVIDIA_glx-defines.patch 437 SHA256 0007f3d962edb87da4788ce58869679c1b10f28223a6bf1c23696fede57305da SHA512 a9cbbe5d5d362db0eb92d5b9fe87f28cccb600df9b44ae2b323ed08da97c32d6a4a0553c7c82ea3777ab91a1a4bf6b74f04d89b6ec28e60565e677cc4af48351 WHIRLPOOL a826b11c86803530346a65612ebd1a12f77f6c6ba1d93af597435993086451648b825fbc245a2c5850e0680c58129924843744d7e29013d5087c3b4dd9fefb14
AUX NVIDIA_glx-glheader.patch 380 SHA256 f630e24067bf6199a64f8fe8c5d6fc158cb4b153bda65ffc3f97b36a9cb08faf SHA512 366ebbe967001f4d694e9d6ae61fbd8b57e2946bba495894936809634bb87bd6ba6b10689969977e4d0eaba6983c16fe8d78830112b5b28f01c78381a0a095d6 WHIRLPOOL 8609fcedb439299189d9d05606a290a63de8b207bab855f874faa36e892396f41159d26e505dfead89fdac9d7e61aeeb50b16877aa14ad62dc3cd617353d7d60
AUX nvidia-169.07 639 SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 SHA512 3af295c026280dc3a2b73c2cc7772254686b09cad15f1333ab0b4de8cb0ccf78e725ced2a399b10edcf8af6ba42ab1485dc0661af67461b0c3789f786357772f WHIRLPOOL 626ae3c01c879e0cfe05bd373e0b9dfd6f462dd9ef6ae94a7d60276fe2d17c57fbb20aaa4d2a186a0ffc2a860076692aac854d00a3545bc9736e7bb8d0581055
AUX nvidia-drivers-331.13-pax-usercopy.patch 2127 SHA256 669ffcab77432f116c2b9bc7ed55e2a1f4e208ff19b63d43003af2b346f7c0c0 SHA512 c6ebd534d1e88fe5c1b71ef5ccced8957e34931cab72d1adb4017c703fc2e285f6e36a778bb36a319f505cfe6408be098569944aa5d78c00c8837ffe880d006a WHIRLPOOL 798d3f3edeae2361f039372f5fe13cf9df5aef20ee63c7cdc83e806cbad097b0ddccd6b30968c2b2ceb768ad0425b02aaefe1ba41709e3f0fb79a82f908579a6
AUX nvidia-drivers-331.17-pax-const.patch 2668 SHA256 b5c2cacfaa10d769cebf9e9c6370c173b8f078545cc5df9ea3eb56a7c8460375 SHA512 59e233138363f50951dc2b87eecaa72ae72c99a66fd0a5c3d7b16b112875b6c685cf5d7309924cbaaeaf6fec7206ac599c3ee5c637584486716594e3b66957bb WHIRLPOOL f0f083d5e4b6cd3fc7c7cea4abf6a8a49033530f51d3dd3a2ade99d39353e86c678716d54804ab25070e3b22dd322f623b56d163f3acbbb33b9051d462fa7f0c
AUX nvidia-drivers-pax-const.patch 833 SHA256 74ba8aa3b03e1b4a0515fd84c159eaeb7635fa1364e77544b01ff6f571f0e6d8 SHA512 6ef94db71cab2dd47273eaed1857209d03ef648d268c7645f3ca4caf6b894590e42a8e716e4354f2eed656e7d55a4c1774b1e6a4be215fbf59fc9d0b1a5762a0 WHIRLPOOL 1b2d737ee7ccee831c85bd8af9605c0633fd025bb209e6d76c13f49a5664aa490bd5b6ce48855e541fe87380cd7b723162e1965b803e1ed630f239bf4dbd0d19
AUX nvidia-drivers-pax-usercopy.patch 2350 SHA256 56980f43db38d582bc6a9bfd881973fce6e3e056b77ce4f4005bdcf79526a863 SHA512 54a1354ba008d014a608044610027b4d808120f8e77cc7d5ac855c3dcf4f487b0a4c0870ae4e727db0643cb56ee21513b803976e9a30c6838adf2f5414232804 WHIRLPOOL 78ac54bfe52cc3b6dfa28e17020991dfb7056984d667b0fefa41d23372b03e1a8e6d66c74e1dee234733d5b2b36e2c0813f507a89716ae2d8f1f6db917fdf01d
AUX nvidia-drivers-settings.desktop 193 SHA256 31c062449b8bcc8adcd3ee649d8aebf0bef502400bcbbbb46124217e1efb17a3 SHA512 fbb81d2520e9025fbffb2a8e7b3647f621ddc9d36c79d063d49e901286e8d1ea45de1274f42e33ff1aece5cebd547a42829d65b421db39d808947554b0f57453 WHIRLPOOL c797eb0ec1044ecaaa979ca5180f840d9c82c5c040dd81b2d86ca4afade9f0c006fb8951f04cc4d2b206110d38b339690386d291ff8f625a22b38178a3cd970b
AUX nvidia-smi.init 664 SHA256 c996033b81cc1512d8370d62575a0ea0c694f6e1b91cc948b4529625130601a7 SHA512 f7cc27d6cce7c13adecb0b927680979ca6a398bc742a93492ab7f85702e4442d8fc00c476f381a0177ae031a9ae45c5cbb6777f20c545d5cd695150f9551a4ce WHIRLPOOL 66bf1a70fa0038a54ca9254cd5543f61bdc69a4c070544660f4ef9b2a004d28f1defdb26b1bc102b1eabd24e679f36fec14c9b313fba4b54c7a9a51a73ca021e
AUX nvidia-udev.sh 185 SHA256 120c0af2b64fbcbd7032217a78eec8b104874c1ca68726367bce22c57944e07e SHA512 166df3a4e7c1862ca2e0f634bf5eed7aad1bdd7e55764ca42371b91a7077c59f0bc243de5616fd38dac9694159d1695d54fbd08ac89d4d3f3649c70c7db5977e WHIRLPOOL cb9995029cdb2fe1bc7fe5ae54041ee5de8da86bf5eb3616d062475e56c44d436e1e66683ecddd986fc5bca5723d88da4b1a42f65f3cd7e15636928bd21fce14
AUX nvidia.udev-rule 462 SHA256 37b152a5055a16d1947171567178e2841679ddf03dba9d48e7d30f1e3b469ac6 SHA512 96f9edaa0b46bea5fce17596f868bea5265b303d7185af6ba81527bbd7b8fdf92de9311317cbde51a29d222083d451c25ab77c3d6837cbc4072a50d9af89aa86 WHIRLPOOL 89ed95f33db7485a3a1acd91df33ecdfb7d0a249db2d7674f134fb85b35a54653d0458e478503315ce506ae5d3c8dcd4ac20420711fdbdd087ea4bd779627d13
DIST NVIDIA-FreeBSD-x86-331.20.tar.gz 55524337 SHA256 dca5c90a99ab151d97c1cbb23f37c7834867ce32f88c6916b2295b3945363b7e SHA512 56135d442c6404a2802e3c47a6b3ffbf11066ceb43bb4f3151e94ad802ea5b20fa007d68e2b0736207c8def988bfc8c522a04cf37efeeea8b8f32c78feaa13bb WHIRLPOOL 10d071ba491eb1f74398fc6ab7ecc80bc910950f0710abb25e7a97d9d43f65ddd4d67abef1dc7d939105de374ce14aa71640ac62cd0e2d7d3005fcf400d97fc3
DIST NVIDIA-FreeBSD-x86_64-331.20.tar.gz 46616176 SHA256 6a0396e828427fb928f18faa72288208702c3067c25c29ed3815a68a06e244c5 SHA512 29a3dfc4e4cd88c64c5ff9cd268494344ca0f56f7af79a57f1cdae8565f1199b7c577c795e986d3a8c223b640d559c8201b4c9dcab105d2ffe99035400ac2260 WHIRLPOOL 126e4320e8fb3500b09a28889af5155a75122c59f502da08f01f037adadb1cc3f08200831eb4b1da896c0a09f645ad8c40ae3ceafb93fb84f13d2fbb0bc79e6b
DIST NVIDIA-Linux-x86-331.20.run 37034614 SHA256 7ad6b05d31e790a938474ce832488f3c68e2f388503b20f7995bdb7bb5ab9745 SHA512 e42cfdcceba7f590e0fa6d8a99bf0c80143dc5bf5af21f26ce65274426c4eb3dbd1ec6864bf4edfcfd6f463453f06f44fd67acfcdd545764741a9620381865d2 WHIRLPOOL 4045a81ea985ae95f414fa2954f281e1e0608ba0e43d35613ff667adf3e8f266886dc4de25ecdc153be8f7087bcbae8ba0d1c484473083a3c2ce9a07f5c3e515
DIST NVIDIA-Linux-x86_64-331.20.run 60012677 SHA256 b8803906402354d201d3b9bc21938a0fe8a7d76e93e486fddaab340df18092ec SHA512 96c2858fcfca05e68683dbc3c677194d1ad30d179cb88df445f32bc68e98b5964315336154f4a693ef1e385e809adfc3795e19b2337f4c1e93908825ee7792c1 WHIRLPOOL 66386d85ab40dd0a20a81f44e7e45b94d94bf4cebe01eb13467a6d6eed27df758d69559e069d479e888374d695290468fb15ff60159346a00e2bbe726d471866
EBUILD nvidia-drivers-331.20-r1.ebuild 12284 SHA256 6df4269b5fa9dc48da6be8fcfb7d092eb808eb6963105607b865e328fac2103b SHA512 1cf7bea089c2e87da34664001854ea5baf91e049dba8044ac90c34f8d0c7420baa53359a39b43b2fc3f5ef1e1535c7db2c454642d8347574caa6fe2d20915f9d WHIRLPOOL 07bd6ff22457b0ae0024f4497d44f1285d567eb36b1383b946af4d5cb7937aced4434540c53adc1f1af39daaa2ba3fac575bd44eb3fdfbe24fbac2a6d3d73d62
MISC ChangeLog 100536 SHA256 0c1e43cd0f2734126f39bf73a625230f58fc9134b7b8eea696bcec48ff22ff08 SHA512 f114e00a45c489a9c33c60b3bcb9b6553360b310ad588eb03e7c7532b57df9ce32a15bd2e5df3185948a29b2419b1af61f6fb0c627c64cf3aebffe328f6e3d14 WHIRLPOOL 20e9c9d18d6f57ccb7c6c8b093f2cfaec5ce6a5677d61ee4329f4d93fb5d7b2dae3e49b77cbe05536f02166542f5d5bdee0b63b48ca6ffe6261672a34f712a77
MISC metadata.xml 678 SHA256 02f45452a129ba14ad5ef0f6bf0031887aead328a7bfaa6977949bc6e8969e61 SHA512 dfc9494e01db7ee3e7ef64dc67c5e26b1a3b0c90ed2850f75c904a76a11df8b3cb137959fe471c788b7a33f555090a9c764af5cfff7f24253127484d4e518e84 WHIRLPOOL 2940677faa8b8183237d9797025079a68164584d2afd09b6e3846cdbbd5824f3c56da545b2f7d1c7d1e72746f540048e4256bde939a28ac785fa598ee2017abd

View File

@ -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*"

View File

@ -0,0 +1,2 @@
#!/bin/sh
/opt/bin/nvidia-settings --load-config-only

View File

@ -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;

View File

@ -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
/*************************************************************/

View File

@ -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

View File

@ -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;

View File

@ -0,0 +1,41 @@
--- 1/kernel/nv_uvm_interface.c
+++ 1/kernel/nv_uvm_interface.c
@@ -384,21 +384,23 @@
return UVM_ERR_INVALID_ARGUMENT;
}
- g_nvKernelProvider.sessionCreate = nvUvmInterfaceSessionCreate;
- g_nvKernelProvider.sessionDestroy = nvUvmInterfaceSessionDestroy;
- g_nvKernelProvider.addressSpaceCreate = nvUvmInterfaceAddressSpaceCreate;
- g_nvKernelProvider.addressSpaceCreateMirrored = nvUvmInterfaceAddressSpaceCreateMirrored;
- g_nvKernelProvider.addressSpaceDestroy = nvUvmInterfaceAddressSpaceDestroy;
- g_nvKernelProvider.allocGpuMemoryFB = nvUvmInterfaceMemoryAllocFB;
- g_nvKernelProvider.allocGpuMemorySys = nvUvmInterfaceMemoryAllocSys;
- g_nvKernelProvider.freeGpuMemory = nvUvmInterfaceMemoryFree;
- g_nvKernelProvider.cpuMap = nvUvmInterfaceMemoryCpuMap;
- g_nvKernelProvider.cpuUnmap = nvUvmInterfaceMemoryCpuUnMap;
- g_nvKernelProvider.channelAllocate = nvUvmInterfaceChannelAllocate;
- g_nvKernelProvider.channelDestroy = nvUvmInterfaceChannelDestroy;
- g_nvKernelProvider.channelTranslateError = nvUvmInterfaceChannelTranslateError;
- g_nvKernelProvider.copyEngineAllocate = nvUvmInterfaceCopyEngineAllocate;
- g_nvKernelProvider.getAttachedUuids = nvUvmInterfaceGetAttachedUuids;
+ pax_open_kernel();
+ *(void **)&g_nvKernelProvider.sessionCreate = nvUvmInterfaceSessionCreate;
+ *(void **)&g_nvKernelProvider.sessionDestroy = nvUvmInterfaceSessionDestroy;
+ *(void **)&g_nvKernelProvider.addressSpaceCreate = nvUvmInterfaceAddressSpaceCreate;
+ *(void **)&g_nvKernelProvider.addressSpaceCreateMirrored = nvUvmInterfaceAddressSpaceCreateMirrored;
+ *(void **)&g_nvKernelProvider.addressSpaceDestroy = nvUvmInterfaceAddressSpaceDestroy;
+ *(void **)&g_nvKernelProvider.allocGpuMemoryFB = nvUvmInterfaceMemoryAllocFB;
+ *(void **)&g_nvKernelProvider.allocGpuMemorySys = nvUvmInterfaceMemoryAllocSys;
+ *(void **)&g_nvKernelProvider.freeGpuMemory = nvUvmInterfaceMemoryFree;
+ *(void **)&g_nvKernelProvider.cpuMap = nvUvmInterfaceMemoryCpuMap;
+ *(void **)&g_nvKernelProvider.cpuUnmap = nvUvmInterfaceMemoryCpuUnMap;
+ *(void **)&g_nvKernelProvider.channelAllocate = nvUvmInterfaceChannelAllocate;
+ *(void **)&g_nvKernelProvider.channelDestroy = nvUvmInterfaceChannelDestroy;
+ *(void **)&g_nvKernelProvider.channelTranslateError = nvUvmInterfaceChannelTranslateError;
+ *(void **)&g_nvKernelProvider.copyEngineAllocate = nvUvmInterfaceCopyEngineAllocate;
+ *(void **)&g_nvKernelProvider.getAttachedUuids = nvUvmInterfaceGetAttachedUuids;
+ pax_close_kernel();
*ppGpuProvider = &g_nvKernelProvider;
g_pNvUvmEvents = importedUvmOps;

View File

@ -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,

View File

@ -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!"

View File

@ -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;

View File

@ -0,0 +1,25 @@
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-smi.init,v 1.2 2013/05/09 16:32:00 jer Exp $
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 $?
}

View File

@ -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

View File

@ -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}"

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>jer@gentoo.org</email>
</maintainer>
<maintainer>
<email>xarthisius@gentoo.org</email>
<description>Blame me on all OpenCL issues</description>
</maintainer>
<longdescription>NVIDIA X11 driver and GLX libraries</longdescription>
<use>
<flag name='tools'>Installs additional tools such as nvidia-settings</flag>
<flag name='X'>Controls whether the X.org driver, OpenGL libraries,
XvMC libraries, and VDPAU libraries are installed</flag>
<flag name='pax_kernel'>PaX patches from the PaX project</flag>
</use>
</pkgmetadata>

View File

@ -0,0 +1,455 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.20.ebuild,v 1.1 2013/11/06 16:52:59 jer Exp $
EAPI=5
inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
portability toolchain-funcs unpacker user udev
NV_URI="http://us.download.nvidia.com/XFree86/"
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
DESCRIPTION="NVIDIA X11 driver and GLX libraries"
HOMEPAGE="http://www.nvidia.com/"
SRC_URI="
amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
"
LICENSE="GPL-2 NVIDIA-r1"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X"
RESTRICT="bindist mirror strip"
EMULTILIB_PKG="true"
COMMON="
app-admin/eselect-opencl
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
X? (
>=app-admin/eselect-opengl-1.0.9
)
"
DEPEND="
${COMMON}
app-arch/xz-utils
kernel_linux? ( virtual/linux-sources )
"
RDEPEND="
${COMMON}
acpi? ( sys-power/acpid )
tools? (
dev-libs/atk
dev-libs/glib
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXext
x11-libs/pango[X]
)
X? (
<x11-base/xorg-server-1.14.99
>=x11-libs/libvdpau-0.3-r1
multilib? (
|| (
(
x11-libs/libX11[abi_x86_32]
x11-libs/libXext[abi_x86_32]
)
app-emulation/emul-linux-x86-xlibs
)
)
)
"
REQUIRED_USE="tools? ( X )"
QA_PREBUILT="opt/* usr/lib*"
S=${WORKDIR}/
pkg_pretend() {
if use amd64 && has_multilib_profile && \
[ "${DEFAULT_ABI}" != "amd64" ]; then
eerror "This ebuild doesn't currently support changing your default ABI"
die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
fi
if use kernel_linux && kernel_is ge 3 13 ; then
ewarn "Gentoo supports kernels which are supported by NVIDIA"
ewarn "which are limited to the following kernels:"
ewarn "<sys-kernel/gentoo-sources-3.13"
ewarn "<sys-kernel/vanilla-sources-3.13"
ewarn ""
ewarn "You are free to utilize epatch_user to provide whatever"
ewarn "support you feel is appropriate, but will not receive"
ewarn "support as a result of those changes."
ewarn ""
ewarn "Do not file a bug report about this."
fi
# Since Nvidia ships 3 different series of drivers, we need to give the user
# some kind of guidance as to what version they should install. This tries
# to point the user in the right direction but can't be perfect. check
# nvidia-driver.eclass
nvidia-driver-check-warning
# Kernel features/options to check for
CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
# Now do the above checks
use kernel_linux && check_extra_config
}
pkg_setup() {
# try to turn off distcc and ccache for people that have a problem with it
export DISTCC_DISABLE=1
export CCACHE_DISABLE=1
if use kernel_linux; then
linux-mod_pkg_setup
MODULE_NAMES="nvidia(video:${S}/kernel)"
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
# linux-mod_src_compile calls set_arch_to_kernel, which
# sets the ARCH to x86 but NVIDIA's wrapping Makefile
# expects x86_64 or i386 and then converts it to x86
# later on in the build process
BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
fi
# set variables to where files are in the package structure
if use kernel_FreeBSD; then
use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
NV_DOC="${S}/doc"
NV_OBJ="${S}/obj"
NV_SRC="${S}/src"
NV_MAN="${S}/x11/man"
NV_X11="${S}/obj"
NV_SOVER=1
elif use kernel_linux; then
NV_DOC="${S}"
NV_OBJ="${S}"
NV_SRC="${S}/kernel"
NV_MAN="${S}"
NV_X11="${S}"
NV_SOVER=${PV}
else
die "Could not determine proper NVIDIA package"
fi
}
src_unpack() {
if ! use kernel_FreeBSD; then
cd "${S}"
unpack_makeself
else
unpack ${A}
fi
}
src_prepare() {
# Please add a brief description for every added patch
if use kernel_linux; then
if kernel_is lt 2 6 9 ; then
eerror "You must build this against 2.6.9 or higher kernels."
fi
# If greater than 2.6.5 use M= instead of SUBDIR=
# convert_to_m "${NV_SRC}"/Makefile.kbuild
fi
if use pax_kernel; then
ewarn "Using PAX patches is not supported. You will be asked to"
ewarn "use a standard kernel should you have issues. Should you"
ewarn "need support with these patches, contact the PaX team."
epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
epatch "${FILESDIR}"/${PN}-331.17-pax-const.patch
fi
# Allow user patches so they can support RC kernels and whatever else
epatch_user
}
src_compile() {
# This is already the default on Linux, as there's no toplevel Makefile, but
# on FreeBSD there's one and triggers the kernel module build, as we install
# it by itself, pass this.
cd "${NV_SRC}"
if use kernel_FreeBSD; then
MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
elif use kernel_linux; then
linux-mod_src_compile
fi
}
# Install nvidia library:
# the first parameter is the library to install
# the second parameter is the provided soversion
# the third parameter is the target directory if its not /usr/lib
donvidia() {
# Full path to library minus SOVER
MY_LIB="$1"
# SOVER to use
MY_SOVER="$2"
# Where to install
MY_DEST="$3"
if [[ -z "${MY_DEST}" ]]; then
MY_DEST="/usr/$(get_libdir)"
action="dolib.so"
else
exeinto ${MY_DEST}
action="doexe"
fi
# Get just the library name
libname=$(basename $1)
# Install the library with the correct SOVER
${action} ${MY_LIB}.${MY_SOVER} || \
die "failed to install ${libname}"
# If SOVER wasn't 1, then we need to create a .1 symlink
if [[ "${MY_SOVER}" != "1" ]]; then
dosym ${libname}.${MY_SOVER} \
${MY_DEST}/${libname}.1 || \
die "failed to create ${libname} symlink"
fi
# Always create the symlink from the raw lib to the .1
dosym ${libname}.1 \
${MY_DEST}/${libname} || \
die "failed to create ${libname} symlink"
}
src_install() {
if use kernel_linux; then
linux-mod_src_install
VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
if [ -z "$VIDEOGROUP" ]; then
eerror "Failed to determine the video group gid."
die "Failed to determine the video group gid."
fi
# Add the aliases
[ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR"
sed -e 's:PACKAGE:'${PF}':g' \
-e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
"${WORKDIR}"/nvidia
insinto /etc/modprobe.d
newins "${WORKDIR}"/nvidia nvidia.conf
# Ensures that our device nodes are created when not using X
exeinto "$(udev_get_udevdir)"
doexe "${FILESDIR}"/nvidia-udev.sh
udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
elif use kernel_FreeBSD; then
if use x86-fbsd; then
insinto /boot/modules
doins "${S}/src/nvidia.kld"
fi
exeinto /boot/modules
doexe "${S}/src/nvidia.ko"
fi
# NVIDIA kernel <-> userspace driver config lib
donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
# NVIDIA video encode/decode <-> CUDA
if use kernel_linux; then
donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
fi
if use X; then
# Xorg DDX driver
insinto /usr/$(get_libdir)/xorg/modules/drivers
doins ${NV_X11}/nvidia_drv.so
# Xorg GLX driver
donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
/usr/$(get_libdir)/opengl/nvidia/extensions
fi
# OpenCL ICD for NVIDIA
if use kernel_linux; then
insinto /etc/OpenCL/vendors
doins ${NV_OBJ}/nvidia.icd
fi
# Documentation
dohtml ${NV_DOC}/html/*
if use kernel_FreeBSD; then
dodoc "${NV_DOC}/README"
use X && doman "${NV_MAN}/nvidia-xconfig.1"
use tools && doman "${NV_MAN}/nvidia-settings.1"
else
# Docs
newdoc "${NV_DOC}/README.txt" README
dodoc "${NV_DOC}/NVIDIA_Changelog"
doman "${NV_MAN}/nvidia-smi.1.gz"
use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
fi
# Helper Apps
exeinto /opt/bin/
if use X; then
doexe ${NV_OBJ}/nvidia-xconfig
fi
if use kernel_linux ; then
doexe ${NV_OBJ}/nvidia-cuda-mps-control
doexe ${NV_OBJ}/nvidia-cuda-mps-server
doexe ${NV_OBJ}/nvidia-debugdump
doexe ${NV_OBJ}/nvidia-modprobe
doexe ${NV_OBJ}/nvidia-persistenced
doexe ${NV_OBJ}/nvidia-smi
doman nvidia-cuda-mps-control.1.gz
doman nvidia-modprobe.1.gz
doman nvidia-persistenced.1.gz
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
fi
if use tools; then
doexe ${NV_OBJ}/nvidia-settings
fi
exeinto /usr/bin/
doexe ${NV_OBJ}/nvidia-bug-report.sh
# Desktop entries for nvidia-settings
if use tools ; then
# There is no icon in the FreeBSD tarball.
use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
domenu "${FILESDIR}"/${PN}-settings.desktop
exeinto /etc/X11/xinit/xinitrc.d
doexe "${FILESDIR}"/95-nvidia-settings
fi
#doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
if has_multilib_profile && use multilib ; then
local OABI=${ABI}
for ABI in $(get_install_abis) ; do
src_install-libs
done
ABI=${OABI}
unset OABI
else
src_install-libs
fi
is_final_abi || die "failed to iterate through all ABIs"
readme.gentoo_create_doc
}
src_install-libs() {
local inslibdir=$(get_libdir)
local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
local libdir=${NV_OBJ}
if use kernel_linux && has_multilib_profile && \
[[ ${ABI} == "x86" ]] ; then
libdir=${NV_OBJ}/32
fi
if use X; then
# The GLX libraries
donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
if use kernel_FreeBSD; then
donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
else
donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
fi
# VDPAU
donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
fi
# NVIDIA monitoring library
if use kernel_linux ; then
donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
fi
# CUDA & OpenCL
if use kernel_linux; then
donvidia ${libdir}/libcuda.so ${NV_SOVER}
donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
fi
}
pkg_preinst() {
use kernel_linux && linux-mod_pkg_preinst
# Clean the dynamic libGL stuff's home to ensure
# we dont have stale libs floating around
if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
fi
# Make sure we nuke the old nvidia-glx's env.d file
if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
rm -f "${ROOT}"/etc/env.d/09nvidia
fi
}
pkg_postinst() {
use kernel_linux && linux-mod_pkg_postinst
# Switch to the nvidia implementation
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
readme.gentoo_print_elog
if ! use X; then
elog "You have elected to not install the X.org driver. Along with"
elog "this the OpenGL libraries and VDPAU libraries were not"
elog "installed. Additionally, once the driver is loaded your card"
elog "and fan will run at max speed which may not be desirable."
elog "Use the 'nvidia-smi' init script to have your card and fan"
elog "speed scale appropriately."
elog
fi
if ! use tools; then
elog "USE=tools controls whether the nvidia-settings application"
elog "is installed. If you would like to use it, enable that"
elog "flag and re-emerge this ebuild. Optionally you can install"
elog "media-video/nvidia-settings"
elog
fi
}
pkg_prerm() {
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
}
pkg_postrm() {
use kernel_linux && linux-mod_pkg_postrm
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
}