Remove outdated nvidia-drivers

This commit is contained in:
Stefan Reimer 2021-01-11 11:35:57 +00:00
parent bb4a1ddc60
commit d0877b1cde
13 changed files with 0 additions and 1100 deletions

View File

@ -1,18 +0,0 @@
AUX 95-nvidia-settings-r1 54 SHA256 cbc6e8cae863b768b2ec570390e409476ec3ca1137006888810a9ec7f0029eb0 SHA512 de9edf678c64ca3d10c912397800b2cb651ef9108b33ece97a4cc1e86dad0a9e81986cca6b96cfe80740d9cb433de7ef93f29be45178db714ee408c7f6570ac7 WHIRLPOOL 032fbfd24378659f30b0ca2d653dff8fa09106aa55803740f22f82515251c099e9637310d420d909135e9f7850cb2890cf4abeac9d6a4b5e390a7d061462b13a
AUX nvidia-169.07 639 SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 SHA512 3af295c026280dc3a2b73c2cc7772254686b09cad15f1333ab0b4de8cb0ccf78e725ced2a399b10edcf8af6ba42ab1485dc0661af67461b0c3789f786357772f WHIRLPOOL 626ae3c01c879e0cfe05bd373e0b9dfd6f462dd9ef6ae94a7d60276fe2d17c57fbb20aaa4d2a186a0ffc2a860076692aac854d00a3545bc9736e7bb8d0581055
AUX nvidia-drivers-375.26-pax.patch 15901 SHA256 165ba19d91e3ea0bc01dc3ec730ea0bb13f8176fb21db4111da1fcd8f3d6892b SHA512 65ad102cc3c28c6e2d67c4f24c8fe6ca3b9b4b4f57eca6fdf437127ce9caccabebd3049af53b30ba808e68529b5627a7e3add31b42cffb09d648a69bedfa55d9 WHIRLPOOL 7e47edbd0413cc72e72be2272b92c2b913f8329b97d5eb6325686c1b3c68c7ab8be4cdde748bfa44a170a86d7376bad3188e0c7fc4f6e9efc35d3db1d8caf225
AUX nvidia-drivers-375.26-profiles-rc.patch 299 SHA256 293569431fdac59e0f08103bd135cc0148b03500740a5b0fddc0c60a479da74c SHA512 2bb1cf65a91d10265b3aaa9e69b4e03d7b955f5403f47910b5c9fb4778ec2bd4355e338bc63be0b413e906ef4681ffa379fb4df46a3c732bbfc2b3042718975a WHIRLPOOL 0768d2eb9aaebcee8fb17fa1d08c42b19f4dabbbfc256207e8b1eea668b5a54366ad30507beadef7ba98136c1440269667a8c5b4a8d3aeea7575b142ecf318ef
AUX nvidia-persistenced.conf 250 SHA256 347437868119e8ae12852a574597936e855f534a9ad290fef3f62b4083a38516 SHA512 9c9562bb15bf4552754dd50a1b01dec5df76f7f5666fba2fff642a169f87e9ed421a260f2258ab469f7e4cd9ef8161653355795624387fe7ad5ae6a0d71e5f46 WHIRLPOOL 1422504c6688fce28719146c7d95fe196ca617556942e8dc04c7f8c1412fa80b5b8289c0f86b835eece90eed4b4017093d686779f88d44cd41fa3de1a10e9bbe
AUX nvidia-persistenced.init 657 SHA256 ff23bac5419456c41771056be52b763740652043fdd7239086889a43c6a2ab18 SHA512 4933d39dcfb05eae9e143eb549e297114aa306b15395634797e80d0a213b2df5ec2b8c32fd64c634dbe5dc859a8ffebb75729c03c0c8c7155f1bece08b1f3265 WHIRLPOOL 0948e1e38bec773da9bcc0ff04cae421e4935181ce40a9db33eee1acaff95f59a242300bdf3581ba7031d5b8fee24e8d5e1cf4fa54aec111992590a1629047ba
AUX nvidia-rmmod.conf 97 SHA256 7b8912f9865958755aa26c2e32930f7c6e6f7eb5e5d0d075059b93e0e5b824f0 SHA512 517e7daf74496f2ec0cca9aa2654ef26eb9f07ee942f03f6e6b97b1b311c0d9915d56ccdd2acd73680dc39373a8090c993b16d5cb9329024609a52027757c240 WHIRLPOOL 586a30a716201820d762e9715b2ef1a7bb729664900ebf18ab2c8a4347ae2add0defe4d6ed76972864a0e986cd257bb51753c5152c52e42708ed05bcac5d1e85
AUX nvidia-settings.desktop 185 SHA256 a402fc441e27b6279e38d227d650916a6aa0f872605ade6c539971c70284204f SHA512 30cab269daf282b9716e53ecf2f8993289e8d4ad05c40d6ddaad3ea6e95477c36a4d65a28d0ec3c1c9c7e845fde140df9012944306f70131a02c9ffef0a9f523 WHIRLPOOL 2bea14aed79de7905b41768ca4c4ccd608c41353335607fbc23236471e5b755eb0c0d8d99611949969bf2511ca8d003ce7ed405be0078c2bcf24070ee40a46ec
AUX nvidia-smi.init 552 SHA256 1f1481ae98a506a7d249e87654aab9d3975b6a88b9abe7b58ebbd337babbc47c SHA512 e95d20a111be5ae19990c84b4c393e3845916458966e624bf6865cedf9be3ebfdf10f1359f3cf5f9447e7d78638dc5284cab43b78cd7f8b96cf2189d91fcf1ea WHIRLPOOL 23f73a5efd2639bcb98cec13b4c18d2b204846a95400ec33e8c18cf398fd886740af75760bfeb8ba5dac0af7a474fd8412781d02a3879d4ef2d40ad2b6c6c35b
AUX nvidia-udev.sh-r1 285 SHA256 5ca08a5329cccd9e32dd3cd573525f510edf7b12d8c531cbe781a70b2ceade63 SHA512 493b0d5f2698d299e3b8d5782ac7fb8174e7ee93f1dae66bc1161eb4dd16d4db91048444dc6e7bea344960936c0a5c825041f6909af004438d8009a3d3fe71c9 WHIRLPOOL 14c2d01d8280dc9c4afaacc75b8ef97875553b5ed50e6dba6209280ebea5cd9c607505870ee37d719530428a9f57034511cd080ba0ab3a1d831b767b4cd15305
AUX nvidia.udev-rule 462 SHA256 37b152a5055a16d1947171567178e2841679ddf03dba9d48e7d30f1e3b469ac6 SHA512 96f9edaa0b46bea5fce17596f868bea5265b303d7185af6ba81527bbd7b8fdf92de9311317cbde51a29d222083d451c25ab77c3d6837cbc4072a50d9af89aa86 WHIRLPOOL 89ed95f33db7485a3a1acd91df33ecdfb7d0a249db2d7674f134fb85b35a54653d0458e478503315ce506ae5d3c8dcd4ac20420711fdbdd087ea4bd779627d13
DIST NVIDIA-FreeBSD-x86-375.26.tar.gz 59091851 SHA256 5249d01a21bb846a08975c4f3a90935b6dc8fd33ec8e5faa0d624ef15bcf2b88 SHA512 281f41f341ccf7f7c1e0de9a6519813c7fd2d13ef59001c0a6f126cd5b8f2b67848c780ddaf6647e0c8b9a79c12ff77493c07203510084e741746834b26f5fdb WHIRLPOOL 48e5f810f41337f6b8f5db419288ae5050c3efd71d0b4b7f7b64251612860d5c7e83cb78885a73f6752160ca8dce852560db7d95ce93d5d86dba21e59bae5e77
DIST NVIDIA-FreeBSD-x86_64-375.26.tar.gz 58287080 SHA256 c7d32cb434f9a7e84903a1305d7577705f991fdb6eb4ab3ff79d41b2df82265d SHA512 514c92636eeffa68cea5140819a9ad14888c18c1c60b0865e5cc9f9896b503f22c1236f76e65ed5e11cf3685ceb483c78d2a442b4e9bf274ae3ab399cf40ed9e WHIRLPOOL aa4eb254a6f3c5b0a9b2aaab12a011a92763e7a966b31840a595c18e24d82935dbe0ab3faa4c9aeb7ae24ec7505cb60c20c1e117396cf0527161a2aa1face296
DIST NVIDIA-Linux-armv7l-gnueabihf-375.26.run 26735389 SHA256 8d2b7b36e74ceb1c439b2a5f8d2cdf009fda4f668509bb5d45171455abc774b9 SHA512 f18031c9b9ca6825f93f433d3f59b76a380a12b55e2f4556c2a1725fcdbea58176f22dcdb322f20e27d524f3fda75dd4f5a2a9263268411e0f5e361c580d865d WHIRLPOOL 4ecd41bebae3df91a39612849eb6f7e926398e906d2cb878aa788571976fb1cdfeabd47ac0cd3db26c4a0408608b8dfbc3815d10cdd1acd8eeaba6ed5824bb73
DIST NVIDIA-Linux-x86-375.26.run 44541069 SHA256 7c79cfaae5512f34ff14cf0fe76632c7c720600d4bbae71d90ff73f1674e617b SHA512 3bc859a95469a45f3c627018248d83e178d160385c3d17d9f890b0d142ecd1220fb21c442e4fe7755b831227a9c820736f447b162acd9699819c6e8145d6d841 WHIRLPOOL 33ad62f7021f38fd9dfa6b0fcfbc0b69a263409bd5b3b8da8eea6aa9af84299f0d5318bbc8b54139b1744b96fa08114029f8cc70b4f80b0fbd2d76efc47d0462
DIST NVIDIA-Linux-x86_64-375.26.run 75869960 SHA256 4f42b2c3709dc2f11a1deca89628582062f4e9bca87f28a4fde50d25bd4a1ecf SHA512 0990ac2e7b045bf62a8c58eb7acf91458756de91887d43486d9754bfc1493b28193072a9687d2d892cc98aaa4e584a8b2a8471756d4f19965da904d51e437dd1 WHIRLPOOL b9890e705dbc3e967a978c5f823f71a418b03aa1b36669c1763559ed81a6a103e9d011246ffe049eda899425e254e8955b921ea9132a8d36530dc4a230cb4832
DIST nvidia-settings-375.26.tar.bz2 1615459 SHA256 beb0d88e2f63427239fd2014299ef7bf780e70800f68be5d011575e858711fe9 SHA512 e575670ccf7e3ef0089ee6a969f107f6f43d742a60cc325c6d95efc4773f34a6e013fd2c4e38b5f90054e24146a05c2300c0cf6a9b7013b556bacc1402956f49 WHIRLPOOL 854e4444beb330c97b29ebc00936c9d2f2522165ef2ca86f68ae28abadef516aedb341e2b2bf6d7a762decaeac4d5c3084bddaa21492b0a60607a2bbf541c301
EBUILD nvidia-drivers-375.26-r1.ebuild 15424 SHA256 4ff9cc1a73bdecdfe726ccc24175d405f756320d54043ec5e36080915d0dd60b SHA512 415ead3b7be4594a57606b6391595b829170be50116983f1b5f469016339407129ae8892c1a18bd0d88ab860ee4fe649c58491c8a418d9896b1d9a3b38d6f5da WHIRLPOOL f2bdb798ea1a3c0238a2ae95c1a2ef9315232c32281b445fe33043cb38c8a233c86a760eb3d2e3b1a9b681199949e4e9e49601eacda62bf87eb913e772423adc

View File

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

View File

@ -1,14 +0,0 @@
# 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

@ -1,406 +0,0 @@
diff -urp work.orig/kernel/common/inc/nv-linux.h work/kernel/common/inc/nv-linux.h
--- work.orig/kernel/common/inc/nv-linux.h 2016-11-27 21:56:50.391617167 +0100
+++ work/kernel/common/inc/nv-linux.h 2016-11-27 22:04:14.045516163 +0100
@@ -1310,7 +1310,8 @@ extern void *nvidia_stack_t_cache;
#if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
#define NV_KMEM_CACHE_CREATE_FULL(name, size, align, flags, ctor) \
kmem_cache_create(name, size, align, flags, ctor)
-
+#define NV_KMEM_CACHE_CREATE_FULL_USERCOPY(name, size, align, flags, useroffset, usersize, ctor) \
+ kmem_cache_create_usercopy(name, size, align, flags, useroffset, usersize, ctor)
#else
#define NV_KMEM_CACHE_CREATE_FULL(name, size, align, flags, ctor) \
kmem_cache_create(name, size, align, flags, ctor, NULL)
@@ -1319,6 +1320,14 @@ extern void *nvidia_stack_t_cache;
#define NV_KMEM_CACHE_CREATE(name, type) \
NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, 0, NULL)
+#ifdef SLAB_USERCOPY
+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type) \
+ NV_KMEM_CACHE_CREATE_FULL(name, sizeof(type), 0, SLAB_USERCOPY, NULL)
+#else
+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type) \
+ NV_KMEM_CACHE_CREATE_FULL_USERCOPY(name, sizeof(type), 0, 0, 0, sizeof(type), NULL)
+#endif
+
#define NV_KMEM_CACHE_DESTROY(kmem_cache) \
kmem_cache_destroy(kmem_cache)
diff -urp work.orig/kernel/common/inc/nv-modeset-interface.h work/kernel/common/inc/nv-modeset-interface.h
--- work.orig/kernel/common/inc/nv-modeset-interface.h 2016-11-27 21:56:50.391617167 +0100
+++ work/kernel/common/inc/nv-modeset-interface.h 2016-11-27 21:54:23.971706350 +0100
@@ -72,7 +72,7 @@ typedef struct {
* mix nvidia and nvidia-modeset kernel modules from different
* releases.
*/
- const char *version_string;
+// const char *version_string;
/*
* Return system information.
@@ -117,6 +117,6 @@ typedef struct {
} nvidia_modeset_rm_ops_t;
-NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops);
+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string);
#endif /* _NV_MODESET_INTERFACE_H_ */
diff -urp work.orig/kernel/common/inc/nv-register-module.h work/kernel/common/inc/nv-register-module.h
--- work.orig/kernel/common/inc/nv-register-module.h 2016-11-27 21:56:50.391617167 +0100
+++ work/kernel/common/inc/nv-register-module.h 2016-11-27 21:54:23.971706350 +0100
@@ -34,7 +34,7 @@ typedef struct nvidia_module_s {
int (*ioctl)(struct inode *, struct file * file, unsigned int cmd, unsigned long arg);
unsigned int (*poll)(struct file * file, poll_table *wait);
-} nvidia_module_t;
+} __do_const nvidia_module_t;
int nvidia_register_module(nvidia_module_t *);
int nvidia_unregister_module(nvidia_module_t *);
diff -urp work.orig/kernel/nvidia/nv.c work/kernel/nvidia/nv.c
--- work.orig/kernel/nvidia/nv.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia/nv.c 2016-11-27 21:54:23.971706350 +0100
@@ -666,7 +666,7 @@ int __init nvidia_init_module(void)
NV_SPIN_LOCK_INIT(&km_lock);
#endif
- nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
+ nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE_USERCOPY(nvidia_stack_cache_name,
nvidia_stack_t);
if (nvidia_stack_t_cache == NULL)
{
diff -urp work.orig/kernel/nvidia/nv-chrdev.c work/kernel/nvidia/nv-chrdev.c
--- work.orig/kernel/nvidia/nv-chrdev.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia/nv-chrdev.c 2016-11-27 21:54:23.971706350 +0100
@@ -20,8 +20,6 @@ int nv_register_chrdev(void *param)
{
nvidia_module_t *module = (nvidia_module_t *)param;
- module->instance = nv_module_instance;
-
return (nvidia_register_module(module));
}
diff -urp work.orig/kernel/nvidia/nv-instance.c work/kernel/nvidia/nv-instance.c
--- work.orig/kernel/nvidia/nv-instance.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia/nv-instance.c 2016-11-27 21:54:23.971706350 +0100
@@ -51,6 +51,7 @@ struct pci_driver nv_pci_driver = {
nvidia_module_t nv_fops = {
.owner = THIS_MODULE,
.module_name = MODULE_NAME,
+ .instance = MODULE_INSTANCE_NUMBER,
.open = nvidia_open,
.close = nvidia_close,
.ioctl = nvidia_ioctl,
diff -urp work.orig/kernel/nvidia/nv-mmap.c work/kernel/nvidia/nv-mmap.c
--- work.orig/kernel/nvidia/nv-mmap.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia/nv-mmap.c 2016-11-27 21:54:23.971706350 +0100
@@ -102,12 +102,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 work.orig/kernel/nvidia/nv-modeset-interface.c work/kernel/nvidia/nv-modeset-interface.c
--- work.orig/kernel/nvidia/nv-modeset-interface.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia/nv-modeset-interface.c 2016-11-27 21:54:23.971706350 +0100
@@ -100,10 +100,9 @@ static NvU32 nvidia_modeset_enumerate_gp
return count;
}
-NV_STATUS nvidia_get_rm_ops(nvidia_modeset_rm_ops_t *rm_ops)
+NV_STATUS nvidia_get_rm_ops(const nvidia_modeset_rm_ops_t **rm_ops, const char **version_string)
{
- const nvidia_modeset_rm_ops_t local_rm_ops = {
- .version_string = NV_VERSION_STRING,
+ static const nvidia_modeset_rm_ops_t local_rm_ops = {
.system_info = {
.allow_write_combining = NV_FALSE,
},
@@ -116,17 +115,26 @@ NV_STATUS nvidia_get_rm_ops(nvidia_modes
.set_callbacks = nvidia_modeset_set_callbacks,
};
- if (strcmp(rm_ops->version_string, NV_VERSION_STRING) != 0)
+ static const nvidia_modeset_rm_ops_t local_rm_ops_wc = {
+ .system_info = {
+ .allow_write_combining = NV_TRUE,
+ },
+ .alloc_stack = nvidia_modeset_rm_ops_alloc_stack,
+ .free_stack = nvidia_modeset_rm_ops_free_stack,
+ .enumerate_gpus = nvidia_modeset_enumerate_gpus,
+ .open_gpu = nvidia_dev_get,
+ .close_gpu = nvidia_dev_put,
+ .op = rm_kernel_rmapi_op, /* provided by nv-kernel.o */
+ .set_callbacks = nvidia_modeset_set_callbacks,
+ };
+
+ if (strcmp(*version_string, NV_VERSION_STRING) != 0)
{
- rm_ops->version_string = NV_VERSION_STRING;
+ *version_string = NV_VERSION_STRING;
return NV_ERR_GENERIC;
}
- *rm_ops = local_rm_ops;
-
- if (NV_ALLOW_WRITE_COMBINING(NV_MEMORY_TYPE_FRAMEBUFFER)) {
- rm_ops->system_info.allow_write_combining = NV_TRUE;
- }
+ *rm_ops = NV_ALLOW_WRITE_COMBINING(NV_MEMORY_TYPE_FRAMEBUFFER) ? &local_rm_ops_wc : &local_rm_ops;
return NV_OK;
}
diff -urp work.orig/kernel/nvidia-drm/nvidia-drm-drv.c work/kernel/nvidia-drm/nvidia-drm-drv.c
--- work.orig/kernel/nvidia-drm/nvidia-drm-drv.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia-drm/nvidia-drm-drv.c 2016-11-27 21:54:23.971706350 +0100
@@ -594,7 +594,7 @@ static const struct drm_ioctl_desc nv_dr
DRM_CONTROL_ALLOW|DRM_RENDER_ALLOW|DRM_UNLOCKED),
};
-static struct drm_driver nv_drm_driver = {
+static drm_driver_no_const nv_drm_driver __read_only = {
.driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
@@ -654,6 +654,7 @@ static void nvidia_update_drm_driver_fea
return;
}
+ pax_open_kernel();
nv_drm_driver.driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
nv_drm_driver.master_set = nvidia_drm_master_set;
@@ -664,6 +665,7 @@ static void nvidia_update_drm_driver_fea
nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy;
nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops;
+ pax_close_kernel();
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
}
diff -urp work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c work/kernel/nvidia-modeset/nvidia-modeset-linux.c
--- work.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c 2016-11-27 21:56:50.395629748 +0100
+++ work/kernel/nvidia-modeset/nvidia-modeset-linux.c 2016-11-27 21:54:23.971706350 +0100
@@ -335,29 +335,28 @@ static void nvkms_resume(NvU32 gpuId)
* Interface with resman.
*************************************************************************/
-static nvidia_modeset_rm_ops_t __rm_ops = { 0 };
+static const nvidia_modeset_rm_ops_t *__rm_ops;
static nvidia_modeset_callbacks_t nvkms_rm_callbacks = {
- nvkms_suspend,
- nvkms_resume
+ .suspend = nvkms_suspend,
+ .resume = nvkms_resume
};
static int nvkms_alloc_rm(void)
{
NV_STATUS nvstatus;
int ret;
+ const char *version_string = NV_VERSION_STRING;
- __rm_ops.version_string = NV_VERSION_STRING;
-
- nvstatus = nvidia_get_rm_ops(&__rm_ops);
+ nvstatus = nvidia_get_rm_ops(&__rm_ops, &version_string);
if (nvstatus != NV_OK) {
printk(KERN_ERR NVKMS_LOG_PREFIX "Version mismatch: "
"nvidia.ko(%s) nvidia-modeset.ko(%s)\n",
- __rm_ops.version_string, NV_VERSION_STRING);
+ version_string, NV_VERSION_STRING);
return -EINVAL;
}
- ret = __rm_ops.set_callbacks(&nvkms_rm_callbacks);
+ ret = __rm_ops->set_callbacks(&nvkms_rm_callbacks);
if (ret < 0) {
printk(KERN_ERR NVKMS_LOG_PREFIX "Failed to register callbacks\n");
return ret;
@@ -368,20 +367,20 @@ static int nvkms_alloc_rm(void)
static void nvkms_free_rm(void)
{
- __rm_ops.set_callbacks(NULL);
+ __rm_ops->set_callbacks(NULL);
}
void NVKMS_API_CALL nvkms_call_rm(void *ops)
{
nvidia_modeset_stack_ptr stack = NULL;
- if (__rm_ops.alloc_stack(&stack) != 0) {
+ if (__rm_ops->alloc_stack(&stack) != 0) {
return;
}
- __rm_ops.op(stack, ops);
+ __rm_ops->op(stack, ops);
- __rm_ops.free_stack(stack);
+ __rm_ops->free_stack(stack);
}
/*************************************************************************
@@ -705,13 +704,13 @@ NvBool NVKMS_API_CALL nvkms_open_gpu(NvU
nvidia_modeset_stack_ptr stack = NULL;
NvBool ret;
- if (__rm_ops.alloc_stack(&stack) != 0) {
+ if (__rm_ops->alloc_stack(&stack) != 0) {
return NV_FALSE;
}
- ret = __rm_ops.open_gpu(gpuId, stack) == 0;
+ ret = __rm_ops->open_gpu(gpuId, stack) == 0;
- __rm_ops.free_stack(stack);
+ __rm_ops->free_stack(stack);
return ret;
}
@@ -720,23 +719,23 @@ void NVKMS_API_CALL nvkms_close_gpu(NvU3
{
nvidia_modeset_stack_ptr stack = NULL;
- if (__rm_ops.alloc_stack(&stack) != 0) {
+ if (__rm_ops->alloc_stack(&stack) != 0) {
return;
}
- __rm_ops.close_gpu(gpuId, stack);
+ __rm_ops->close_gpu(gpuId, stack);
- __rm_ops.free_stack(stack);
+ __rm_ops->free_stack(stack);
}
NvU32 NVKMS_API_CALL nvkms_enumerate_gpus(nv_gpu_info_t *gpu_info)
{
- return __rm_ops.enumerate_gpus(gpu_info);
+ return __rm_ops->enumerate_gpus(gpu_info);
}
NvBool NVKMS_API_CALL nvkms_allow_write_combining(void)
{
- return __rm_ops.system_info.allow_write_combining;
+ return __rm_ops->system_info.allow_write_combining;
}
/*************************************************************************
diff -urp work.orig/kernel/nvidia-uvm/uvm8_global.c work/kernel/nvidia-uvm/uvm8_global.c
--- work.orig/kernel/nvidia-uvm/uvm8_global.c 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm8_global.c 2016-11-27 21:54:23.975709978 +0100
@@ -35,17 +35,17 @@
#include "nv_uvm_interface.h"
uvm_global_t g_uvm_global;
-static struct UvmOpsUvmEvents g_exported_uvm8_ops;
+static struct UvmOpsUvmEvents g_exported_uvm8_ops = {
+ .startDevice = NULL,
+ .stopDevice = NULL,
+ .isrTopHalf = uvm8_isr_top_half,
+};
static bool g_ops_registered = false;
static NV_STATUS uvm8_register_callbacks(void)
{
NV_STATUS status = NV_OK;
- g_exported_uvm8_ops.startDevice = NULL;
- g_exported_uvm8_ops.stopDevice = NULL;
- g_exported_uvm8_ops.isrTopHalf = uvm8_isr_top_half;
-
// Register the UVM callbacks with the main GPU driver:
status = uvm_rm_locked_call(nvUvmInterfaceRegisterUvmCallbacks(&g_exported_uvm8_ops));
if (status != NV_OK)
diff -urp work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c
--- work.orig/kernel/nvidia-uvm/uvm8_gpu_semaphore.c 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm8_gpu_semaphore.c 2016-11-27 21:54:23.975709978 +0100
@@ -368,7 +368,7 @@ void uvm_gpu_semaphore_set_payload(uvm_g
// being optimized out on non-SMP configs (we need them for interacting with
// the GPU correctly even on non-SMP).
mb();
- ACCESS_ONCE(*semaphore->payload) = payload;
+ ACCESS_ONCE_RW(*semaphore->payload) = payload;
}
// This function is intended to catch channels which have been left dangling in
diff -urp work.orig/kernel/nvidia-uvm/uvm8_hal.h work/kernel/nvidia-uvm/uvm8_hal.h
--- work.orig/kernel/nvidia-uvm/uvm8_hal.h 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm8_hal.h 2016-11-27 21:54:23.975709978 +0100
@@ -316,7 +316,7 @@ typedef struct
// fault_buffer_ops: id is a hardware class
uvm_fault_buffer_hal_t fault_buffer_ops;
} u;
-} uvm_hal_class_ops_t;
+} __do_const uvm_hal_class_ops_t;
// When UVM next support is enabled support for future chips in the hal is
// enabled by providing additional hal table entries below.
diff -urp work.orig/kernel/nvidia-uvm/uvm8_mmu.h work/kernel/nvidia-uvm/uvm8_mmu.h
--- work.orig/kernel/nvidia-uvm/uvm8_mmu.h 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm8_mmu.h 2016-11-27 21:54:23.975709978 +0100
@@ -24,7 +24,6 @@
#ifndef __UVM8_MMU_H__
#define __UVM8_MMU_H__
-#include "uvm8_forward_decl.h"
#include "uvm8_hal_types.h"
#include "uvm8_pmm_gpu.h"
#include "uvmtypes.h"
diff -urp work.orig/kernel/nvidia-uvm/uvm_common.c work/kernel/nvidia-uvm/uvm_common.c
--- work.orig/kernel/nvidia-uvm/uvm_common.c 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm_common.c 2016-11-27 21:54:23.975709978 +0100
@@ -42,7 +42,6 @@
#define UVM_SPIN_LOOP_PRINT_TIMEOUT_SEC 30ULL
static dev_t g_uvmBaseDev;
-struct UvmOpsUvmEvents g_exportedUvmOps;
static char* uvm_driver_mode = "8";
diff -urp work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h work/kernel/nvidia-uvm/uvm_full_fault_buffer.h
--- work.orig/kernel/nvidia-uvm/uvm_full_fault_buffer.h 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm_full_fault_buffer.h 2016-11-27 21:54:23.975709978 +0100
@@ -31,6 +31,7 @@
#define _UVM_FULL_FAULT_BUFFER_H_
#include "uvmtypes.h"
+#include "linux/compiler.h"
#define MAXWELL_FAULT_BUFFER_A (0xb069)
#define MEM_RD32(a) (*(const volatile NvU32 *)(a))
@@ -303,7 +304,7 @@ typedef struct
NvUvmControlPrefetch_t controlPrefetch;
NvUvmTestFaultBufferOverflow_t testFaultBufferOverflow;
NvUvmClearFaultBufferOverflow_t clearFaultBufferOverflow;
-} UvmFaultBufferOps;
+} __no_const UvmFaultBufferOps;
/******************************************************************************
uvmfull_fault_buffer_init
diff -urp work.orig/kernel/nvidia-uvm/uvm_linux.h work/kernel/nvidia-uvm/uvm_linux.h
--- work.orig/kernel/nvidia-uvm/uvm_linux.h 2016-11-27 21:56:50.399642330 +0100
+++ work/kernel/nvidia-uvm/uvm_linux.h 2016-11-27 21:54:23.975709978 +0100
@@ -420,7 +420,7 @@ static inline NvU64 NV_GETTIME(void)
// WRITE_ONCE/READ_ONCE have incompatible definitions across versions, which produces warnings.
// Therefore, we define our own macros
-#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE(x) = (val))
+#define UVM_WRITE_ONCE(x, val) (ACCESS_ONCE_RW(x) = (val))
#define UVM_READ_ONCE(x) ACCESS_ONCE(x)
// Added in 3.11

View File

@ -1,11 +0,0 @@
--- a/nvidia-application-profiles-375.26-rc
+++ b/nvidia-application-profiles-375.26-rc
@@ -48,7 +48,7 @@
{
"name" : "NoEnforceShaderInputOutputMatching",
"settings" : [ "GLShaderPortabilityWarnings", false ]
- },
+ }
],
"rules" : [
{

View File

@ -1,8 +0,0 @@
# 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=""

View File

@ -1,25 +0,0 @@
#!/sbin/openrc-run
# 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 $?
}

View File

@ -1,3 +0,0 @@
# Nvidia UVM support
remove nvidia modprobe -r --ignore-remove nvidia-modeset nvidia-uvm nvidia

View File

@ -1,7 +0,0 @@
[Desktop Entry]
Type=Application
Name=NVIDIA X Server Settings
Comment=Configure NVIDIA X Server Settings
Exec=/usr/bin/nvidia-settings
Icon=nvidia-settings
Categories=System;Settings;

View File

@ -1,25 +0,0 @@
#!/sbin/openrc-run
# 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 $?
}

View File

@ -1,20 +0,0 @@
#!/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

View File

@ -1,6 +0,0 @@
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

@ -1,555 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
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}"
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
DESCRIPTION="NVIDIA Accelerated Graphics Driver"
HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
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 )
arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_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 )
tools? (
ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
)
"
LICENSE="GPL-2 NVIDIA-r2"
SLOT="0/${PV%.*}"
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
RESTRICT="bindist mirror"
EMULTILIB_PKG="true"
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
REQUIRED_USE="
tools? ( X )
static-libs? ( tools )
"
COMMON="
app-eselect/eselect-opencl
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
tools? (
dev-libs/atk
dev-libs/glib:2
dev-libs/jansson
gtk3? ( x11-libs/gtk+:3 )
x11-libs/cairo
x11-libs/gdk-pixbuf[X]
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXext
x11-libs/libXrandr
x11-libs/libXv
x11-libs/libXxf86vm
x11-libs/pango[X]
)
X? (
>=app-eselect/eselect-opengl-1.0.9
app-misc/pax-utils
)
"
DEPEND="
${COMMON}
kernel_linux? ( virtual/linux-sources )
"
RDEPEND="
${COMMON}
acpi? ( sys-power/acpid )
tools? ( !media-video/nvidia-settings )
wayland? ( dev-libs/wayland )
X? (
<x11-base/xorg-server-1.19.99:=
>=x11-libs/libvdpau-1.0
multilib? (
>=x11-libs/libX11-1.6.2[abi_x86_32]
>=x11-libs/libXext-1.3.2[abi_x86_32]
)
)
"
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 4 10; then
ewarn "Gentoo supports kernels which are supported by NVIDIA"
ewarn "which are limited to the following kernels:"
ewarn "<sys-kernel/gentoo-sources-4.10"
ewarn "<sys-kernel/vanilla-sources-4.10"
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."
ewarn ""
fi
# Since Nvidia ships many 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 driver && use kernel_linux; then
MODULE_NAMES="nvidia(video:${S}/kernel)"
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
# This needs to run after MODULE_NAMES (so that the eclass checks
# whether the kernel supports loadable modules) but before BUILD_PARAMS
# is set (so that KV_DIR is populated).
linux-mod_pkg_setup
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
# 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
if use kernel_linux && kernel_is lt 2 6 9; then
eerror "You must build this against 2.6.9 or higher kernels."
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_prepare() {
eapply "${FILESDIR}"/${P}-profiles-rc.patch
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."
eapply "${FILESDIR}"/${P}-pax.patch
fi
# Allow user patches so they can support RC kernels and whatever else
eapply_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 driver && use kernel_linux; then
MAKEOPTS=-j1 linux-mod_src_compile
fi
if use tools; then
emake -C "${S}"/nvidia-settings-${PV}/src \
AR="$(tc-getAR)" \
CC="$(tc-getCC)" \
LIBDIR="$(get_libdir)" \
NV_VERBOSE=1 \
RANLIB="$(tc-getRANLIB)" \
DO_STRIP= \
build-xnvctrl
emake -C "${S}"/nvidia-settings-${PV}/src \
CC="$(tc-getCC)" \
GTK3_AVAILABLE=$(usex gtk3 1 0) \
LD="$(tc-getCC)" \
LIBDIR="$(get_libdir)" \
NVML_ENABLED=0 \
NV_USE_BUNDLED_LIBJANSSON=0 \
NV_VERBOSE=1 \
DO_STRIP=
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 it is not /usr/lib
donvidia() {
# Full path to library
nv_LIB="${1}"
# SOVER to use
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
# Where to install
nv_DEST="${2}"
# Get just the library name
nv_LIBNAME=$(basename "${nv_LIB}")
if [[ "${nv_DEST}" ]]; then
exeinto ${nv_DEST}
action="doexe"
else
nv_DEST="/usr/$(get_libdir)"
action="dolib.so"
fi
# Install the library
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
# If the library has a SONAME and SONAME does not match the library name,
# then we need to create a symlink
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
fi
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
}
src_install() {
if use driver && use kernel_linux; then
linux-mod_src_install
# Add the aliases
# This file is tweaked with the appropriate video group in
# pkg_preinst, see bug #491414
insinto /etc/modprobe.d
newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
doins "${FILESDIR}"/nvidia-rmmod.conf
# Ensures that our device nodes are created when not using X
exeinto "$(get_udevdir)"
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
donvidia ${NV_OBJ}/libnvidia-fbc.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
# Xorg nvidia.conf
if has_version '>=x11-base/xorg-server-1.16'; then
insinto /usr/share/X11/xorg.conf.d
newins {,50-}nvidia-drm-outputclass.conf
fi
fi
# OpenCL ICD for NVIDIA
if use kernel_linux; then
insinto /etc/OpenCL/vendors
doins ${NV_OBJ}/nvidia.icd
fi
# Documentation
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
docinto html
dodoc -r ${NV_DOC}/html/*
# Helper Apps
exeinto /opt/bin/
if use X; then
doexe ${NV_OBJ}/nvidia-xconfig
insinto /etc/vulkan/icd.d
doins nvidia_icd.json
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-persistenced
doexe ${NV_OBJ}/nvidia-smi
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
doexe ${NV_OBJ}/nvidia-modprobe
fowners root:video /opt/bin/nvidia-modprobe
fperms 4710 /opt/bin/nvidia-modprobe
dosym /{opt,usr}/bin/nvidia-modprobe
doman nvidia-cuda-mps-control.1.gz
doman nvidia-modprobe.1.gz
doman nvidia-persistenced.1.gz
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
fi
if use tools; then
emake -C "${S}"/nvidia-settings-${PV}/src/ \
DESTDIR="${D}" \
GTK3_AVAILABLE=$(usex gtk3 1 0) \
LIBDIR="${D}/usr/$(get_libdir)" \
NV_USE_BUNDLED_LIBJANSSON=0 \
NV_VERBOSE=1 \
PREFIX=/usr \
DO_STRIP= \
install
if use static-libs; then
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
insinto /usr/include/NVCtrl
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
fi
insinto /usr/share/nvidia/
doins nvidia-application-profiles-${PV}-key-documentation
insinto /etc/nvidia
newins \
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
# There is no icon in the FreeBSD tarball.
use kernel_FreeBSD || \
doicon ${NV_OBJ}/nvidia-settings.png
domenu "${FILESDIR}"/nvidia-settings.desktop
exeinto /etc/X11/xinit/xinitrc.d
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
fi
dobin ${NV_OBJ}/nvidia-bug-report.sh
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
NV_GLX_LIBRARIES=(
"libEGL.so.1 ${GL_ROOT}"
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
"libGLESv1_CM.so.1 ${GL_ROOT}"
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
"libGLESv2.so.2 ${GL_ROOT}"
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
"libGLX.so.0 ${GL_ROOT}"
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
"libGLdispatch.so.0 ${GL_ROOT}"
"libOpenCL.so.1.0.0 ${CL_ROOT}"
"libOpenGL.so.0 ${GL_ROOT}"
"libcuda.so.${NV_SOVER}"
"libnvcuvid.so.${NV_SOVER}"
"libnvidia-compiler.so.${NV_SOVER}"
"libnvidia-eglcore.so.${NV_SOVER}"
"libnvidia-encode.so.${NV_SOVER}"
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
"libnvidia-fbc.so.${NV_SOVER}"
"libnvidia-glcore.so.${NV_SOVER}"
"libnvidia-glsi.so.${NV_SOVER}"
"libnvidia-ifr.so.${NV_SOVER}"
"libnvidia-opencl.so.${NV_SOVER}"
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
"libvdpau_nvidia.so.${NV_SOVER}"
)
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
then
NV_GLX_LIBRARIES+=(
"libnvidia-egl-wayland.so.${NV_SOVER}"
)
fi
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
then
NV_GLX_LIBRARIES+=(
"libnvidia-wfb.so.${NV_SOVER}"
)
fi
if use kernel_FreeBSD; then
NV_GLX_LIBRARIES+=(
"libnvidia-tls.so.${NV_SOVER}"
)
fi
if use kernel_linux; then
NV_GLX_LIBRARIES+=(
"libnvidia-ml.so.${NV_SOVER}"
"tls/libnvidia-tls.so.${NV_SOVER}"
)
fi
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
donvidia ${libdir}/${NV_LIB}
done
fi
}
pkg_preinst() {
if use driver && use kernel_linux; then
linux-mod_pkg_preinst
local 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"
else
sed -i \
-e "s:PACKAGE:${PF}:g" \
-e "s:VIDEOGID:${videogroup}:" \
"${D}"/etc/modprobe.d/nvidia.conf || die
fi
fi
# 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
}