diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2008-07-22 15:27:40 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2008-07-22 15:27:40 +0000 |
commit | f398e7b76f3da3c1dc75b0e42e736bc7723a6d0f (patch) | |
tree | 8723b9f49e8b485aa7165a199153ca009f9a239d /x11-drivers/nvidia-drivers | |
parent | cleaned 1.5.x releases - really old and dangerous, please upgrade (diff) | |
download | historical-f398e7b76f3da3c1dc75b0e42e736bc7723a6d0f.tar.gz historical-f398e7b76f3da3c1dc75b0e42e736bc7723a6d0f.tar.bz2 historical-f398e7b76f3da3c1dc75b0e42e736bc7723a6d0f.zip |
X86 following the AMD64 lead in fasttrack stable for 71 & 96 branch drivers. Arch testing by hoffie, permission granted by tsunam. Closes bug #232624 by Mike Hammill <michael@hammill.name>. Cleaned up old ebuilds.
Package-Manager: portage-2.2_rc1/cvs/Linux 2.6.26 x86_64
Diffstat (limited to 'x11-drivers/nvidia-drivers')
10 files changed, 21 insertions, 4042 deletions
diff --git a/x11-drivers/nvidia-drivers/ChangeLog b/x11-drivers/nvidia-drivers/ChangeLog index e2bbe91db23c..cfc50b4e94ef 100644 --- a/x11-drivers/nvidia-drivers/ChangeLog +++ b/x11-drivers/nvidia-drivers/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for x11-drivers/nvidia-drivers # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.105 2008/07/17 13:51:16 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.106 2008/07/22 15:27:39 chainsaw Exp $ + + 22 Jul 2008; <chainsaw@gentoo.org> + -files/NVIDIA_kernel-71.86.04-2305230.diff, + -files/NVIDIA_kernel-96.43.05-2290218.diff, + -nvidia-drivers-71.86.01.ebuild, -nvidia-drivers-71.86.04.ebuild, + nvidia-drivers-71.86.06.ebuild, -nvidia-drivers-96.43.01.ebuild, + -nvidia-drivers-96.43.05.ebuild, nvidia-drivers-96.43.07.ebuild: + X86 following the AMD64 lead in fasttrack stable for 71 & 96 branch + drivers. Arch testing by hoffie, permission granted by tsunam. Closes bug + #232624 by Mike Hammill <michael@hammill.name>. Cleaned up old ebuilds. 17 Jul 2008; <chainsaw@gentoo.org> nvidia-drivers-71.86.06.ebuild, nvidia-drivers-96.43.07.ebuild: diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index 3df2fd903bb4..f4e6edf26f01 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -9,8 +9,6 @@ AUX NVIDIA_i2c-hwmon.patch 669 RMD160 812e7081d8f31116031edb0d8eb9c570b09caf89 S AUX NVIDIA_kernel-169.12-2286310.diff 22442 RMD160 20d6473e2762d3fc5e65ccfeb529540ac50b1a71 SHA1 7e445a84b9d73ce7d6febbb04b1ebf8fee6d5ba2 SHA256 4cbd64d7606cbc759f903adabf050911da2a80415f1cef592efe5f2ecaaf2d4d AUX NVIDIA_kernel-173.08-2404825.diff 17473 RMD160 6ca02231d56a5f52275bff12b0f894b9992fe800 SHA1 b14349449aa59feb48b328e673d4e9efa6161948 SHA256 a1704f2acfdb59772df36e9677f792508e446b21f4465b743c9f1ed3bfc457d2 AUX NVIDIA_kernel-173.14.05-2419292.diff 18598 RMD160 f6874805f482776a47c87e18d9fa8545bb73b9bf SHA1 3941162a0f353a92b9c2db5ae10511ff73efbc92 SHA256 ad6c2da9a508fae7b8728628e1980319dc3c7f62694c34a80ddc0343a1361aec -AUX NVIDIA_kernel-71.86.04-2305230.diff 50508 RMD160 2e84efc9d955a7c6d6915db96d7a2349faae7ba8 SHA1 53601bba16ac56e0cf05e123cbf9a4035a2c2c24 SHA256 9a6450c2711f6618a364390d547914dbee80abba8a6259f0a94fd0b04135c921 -AUX NVIDIA_kernel-96.43.05-2290218.diff 22045 RMD160 3dceffdc2b37dbdb2535bf44e9025c0ed6844c5a SHA1 4762156dfe4c8a32063da1ed7399f21ffa3855d5 SHA256 79e16a0b9c2fa3804e376a06c095079430ec5932ceb789f39a061d88820884f4 AUX libGL.la-r2 733 RMD160 479612ab30c04ca0683c7d9edaf9ab3de783e4a9 SHA1 88656b7e7234ade4f5564373fd6eb5c040167655 SHA256 4856e7a2c31763ade41c93a395f3e80a2705ac2ab4dbd73e5161cdba132f407b AUX nvidia 1510 RMD160 ca0d0e5375109d9edf682d9bdda743b7c693e4d4 SHA1 85cf9bff167dcc063ba61426523973e9598085f7 SHA256 b193cc3f6d6f39138720a2282d9f161fc8f2e8a15bc43d183a30eb879add06c5 AUX nvidia-169.07 639 RMD160 8baddb6fd1bf7f0e2688870a78e8ace051d62e3f SHA1 b30487ba2a24a6b1359d1fd831eeb1705060953c SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 @@ -24,8 +22,6 @@ DIST NVIDIA-FreeBSD-x86-173.08.tar.gz 15735811 RMD160 44c9844105f2c29f725316d51d DIST NVIDIA-FreeBSD-x86-173.14.05.tar.gz 15856727 RMD160 cc5f41ee785adadfcd0d3d689a9b477dfc49c848 SHA1 37871cb844b0b52d919886b351ae98e30e606dae SHA256 a8b1782656ee0faaa1e60f7f49a5d922c126785273de642deac3ae935dcc2556 DIST NVIDIA-FreeBSD-x86-173.14.09.tar.gz 15858904 RMD160 4935e736e227f1107a70261b1228297365f8e73a SHA1 ccfa5e60e02dc71e340a7c241ab0aed80389127b SHA256 be69a164e60c48e8dc272dbf503a201256f374760d67e4fddca74b23e4aa2cee DIST NVIDIA-FreeBSD-x86-177.13.tar.gz 16216189 RMD160 26a8a88e7f1b5d71c49144be7372e400981ebafa SHA1 08f74ddcc53ac58b81340ff16ed1fc9e3ad9fe57 SHA256 e96f61970a1f3aa52f0189ad714b713583e612ca37fc803bc9f894c4bc6eb965 -DIST NVIDIA-FreeBSD-x86-71.86.01.tar.gz 8437426 RMD160 7dd8cc85fed09a9ad40d46b06b6eb1f8b916fabc SHA1 2b5c9ed04ad7c67200622f015a18445ccc3e6c6c SHA256 61f33f5735c91d7f700eaf12a586bd0ddfe12506869819e42a95c2dd2fd2b259 -DIST NVIDIA-FreeBSD-x86-96.43.01.tar.gz 9675336 RMD160 cc891f39011b6455207adfebe86a6819bcfc2aa0 SHA1 39ebbc578cb6b068f757ddde1a74d930f42a94ec SHA256 75b43958ba3331dec15cb3ca72d073c428bf58e6fe766852a1b98a0cd0a74908 DIST NVIDIA-Linux-x86-100.14.09-pkg0.run 7855581 RMD160 53f0a664dfb27488943697ffac618574ac388f03 SHA1 a71c46749e5ffa4e95473c13cb1183ca240cc381 SHA256 92ec9b407530018df14c7ccfef9c5e76ad8ba49ee7fd83a1324a5514a82a7b9a DIST NVIDIA-Linux-x86-100.14.11-pkg0.run 7862483 RMD160 5784e1323a4872fa56b43dd2946ec89c9b5b51c4 SHA1 95e101a5b1567bbcce91ce18f48e19d2c344ff05 SHA256 60b459b797d9fea16b4a804f71010c90bb516fe164370df488b0fdd31feab5a4 DIST NVIDIA-Linux-x86-100.14.19-pkg0.run 7592917 RMD160 717c168cbc78c804c540b813ef2bb634834446ec SHA1 d645b21dfd43e0c0640783f2336d51f2e3151353 SHA256 46c8629a0f07eaa3009df835cdeb51db8a24d3d17b114b04ec2eae1b3ab69a2f @@ -37,11 +33,7 @@ DIST NVIDIA-Linux-x86-173.08-pkg0.run 11489268 RMD160 e82578df8fdf08d615e6c03d9b DIST NVIDIA-Linux-x86-173.14.05-pkg0.run 11552082 RMD160 2d322a9969e59733725c6c748976eec9360ff6ef SHA1 5a9238ef276813ac71b4c3be6689e8e45b27b436 SHA256 2b1aa7b4dc1388d64dbeca8d7362b647cb6adf47c0a5020af46d2fc46b3509da DIST NVIDIA-Linux-x86-173.14.09-pkg0.run 11590266 RMD160 b61f4af4fc51b0f62983a13412b31c4bcb620b8b SHA1 941b4029dd677418a820a5bd90230116d6b6cfb9 SHA256 efa0f96b83c7163ab748321301234256ecc455475fce7d7d7c96a10a9236f874 DIST NVIDIA-Linux-x86-177.13-pkg0.run 11920970 RMD160 bbb60fb527befc3826f5855c8e1a9f8c5f2756a3 SHA1 a602e602af612b0190deb31890dda708cc479891 SHA256 2a063046137ca0a92c081b4d1d931f4bb7ba18e885e2713467aa72c2706609c4 -DIST NVIDIA-Linux-x86-71.86.01-pkg0.run 5581876 RMD160 2baa09b7e96d8c5ce4aba566ee985ddd309bbdbf SHA1 e99d273313958ce1629ff8188ed4e5eda3b1ca44 SHA256 9b6fbaf9af198544588e8f433e1d2a294db1f09b7db34e5e826503a4c6ef01f1 -DIST NVIDIA-Linux-x86-71.86.04-pkg0.run 5262138 RMD160 e8da0bab680cba8eba4c2e260ec4c36493283809 SHA1 a209fdb1340fcba33843ab94e35fe10ae58065dc SHA256 0236c77ebf9702c86f1c94b33bd16b680ac426e83c250ce28b6b7bc8baa2f2a5 DIST NVIDIA-Linux-x86-71.86.06-pkg0.run 5261179 RMD160 87541a06f384b567b5762bf5e01faee7c4983fc0 SHA1 744b7885dcb99b1cbc9d3f61a755644f149eb0c9 SHA256 bd89aa8656fbc49f0cf0b5e9d6975f2345d7363ca240f7b67d92690ad8e3e1d7 -DIST NVIDIA-Linux-x86-96.43.01-pkg0.run 6597242 RMD160 0a698d55925d5e44a01b5a5089b228dacfcb0af2 SHA1 02ce7a76d9ac1df5f9ec5b805ebdbd13eb42c4aa SHA256 777bb1b7eb5ea1ead80c31e516615e44ba198ff782da4df3bead3c31db4de8ba -DIST NVIDIA-Linux-x86-96.43.05-pkg0.run 6595250 RMD160 8b9c86f6210429d45df0d932e73d1551139f8837 SHA1 de8b015212bb5be09ee5c7ed096fa1e63bd793d2 SHA256 f62a51e376bfa0cb9e33b4aa3617867070dd39cc78ae04d4d2cc8b5721840b74 DIST NVIDIA-Linux-x86-96.43.07-pkg0.run 6595902 RMD160 beeb827c53dd8ad8712db9b39fda8219308ff05e SHA1 4820162119f81a30b665f37fd8d772545d921be4 SHA256 8a61ad352bc7f3aceebe3fd3fed39354fe13214bb13f7c4ddda557f5bc842515 DIST NVIDIA-Linux-x86_64-100.14.09-pkg2.run 11834257 RMD160 d8c7987c4053835ec4d23facee855ebc35d95da4 SHA1 001bce9cba1c8ba31b0e942e85b429a5533ca72c SHA256 554aa9e63f1ac9e5f2f218f8532a73b514783d5ea1c674bbf888500998877ec7 DIST NVIDIA-Linux-x86_64-100.14.11-pkg2.run 11838502 RMD160 d357c75e9043e1cb089b3136635af04c88420943 SHA1 d542b702fdf7835f5dc7ec767789b2c1ada60908 SHA256 3215f786838d2d05005ec53cc9e3a684d46939ae2ea8c8e6b3e20f092be3b5e1 @@ -54,11 +46,7 @@ DIST NVIDIA-Linux-x86_64-173.08-pkg2.run 17930205 RMD160 25b9d94f7a94a2e4ea5885f DIST NVIDIA-Linux-x86_64-173.14.05-pkg2.run 17959744 RMD160 ad603536e99ee232fb95bf916d9aa54c9738ef26 SHA1 5912aa5b481e2b94641e1751e9153e1b11e369e4 SHA256 3ee8aabc824fac1d5c917979aca288ad600da0d0bd34001f9c5f0c0254b1af36 DIST NVIDIA-Linux-x86_64-173.14.09-pkg2.run 16797261 RMD160 496e619f251fc1540b8e6b4063de9b4d3bb32b1a SHA1 54c63dee711ea9243fa9baa00d6ce74500508fa5 SHA256 21957e2b3825799232595b50ea69f3f95c8c1fcd5ba8762c2fae88e117492000 DIST NVIDIA-Linux-x86_64-177.13-pkg2.run 18711739 RMD160 066a4349c79183eb3bdfdc1c7539a291c03e18a4 SHA1 5572e005e30f766d406ba3391128f3fc22d38f65 SHA256 5cca2f0f135a311d230847e17556e65d0e49963991e9e7318d4fba4a58e8a84b -DIST NVIDIA-Linux-x86_64-71.86.01-pkg2.run 8779794 RMD160 f1811ed90a2a920f9cad11e722236ea077d066d7 SHA1 7b1e4dbad7347140ba5c67e0e074457588165b3f SHA256 1f5507852546bd7514f24d0337b2bd6972582f62f0eacd8c66b40d20985d9be0 -DIST NVIDIA-Linux-x86_64-71.86.04-pkg2.run 8375637 RMD160 237bca0486188f22526788ce76b19d654fb9213e SHA1 123e52d0b4340cc9a11da26d997acf84f67c269f SHA256 30f0b3fd5a40f31f5fa3b62a5995dd21fff0632da03fb234a03673c931eb6282 DIST NVIDIA-Linux-x86_64-71.86.06-pkg2.run 8380369 RMD160 dece285c6e02da8e788d977c2df114b3bbf8cc0f SHA1 518dd3e4d8ff484a6809184064d39afe0004ef45 SHA256 00f21f8ef75eeade437bb611fac98c4df6c4bef82293ad1d4506020f7004b57b -DIST NVIDIA-Linux-x86_64-96.43.01-pkg2.run 10245900 RMD160 02b5ef36ae55a5901ada43c5cffca36128d652ba SHA1 d0dc8d61c32631eb397a8348630eadbae2744e96 SHA256 187d40c0bbcceba5c78f9f49ebb526989a7670bcfd7f5f38f2201fba29c98bbf -DIST NVIDIA-Linux-x86_64-96.43.05-pkg2.run 10245467 RMD160 858e917abc5529f286250d845cd8694164321b69 SHA1 9f20838b33c54c3d54e7fdbe87a3b47d542d21f1 SHA256 58fdf6a7abeb60b31db7ac233db684b9cb279c97549d3ea93d994419ff213ec9 DIST NVIDIA-Linux-x86_64-96.43.07-pkg2.run 10201418 RMD160 a8001232a5f2108a7ed8f2816487873317ebf018 SHA1 7c6e4f8050f1a8221efb458d350b6853f00d2cb4 SHA256 37efff3be9404fc936a074ce2c9e9a189568a02c3893d75bf438d5b45682051e EBUILD nvidia-drivers-100.14.09.ebuild 14578 RMD160 1899b18d29723188c39cebd12ef5b00f0574798f SHA1 7fa7ce5dc76ae93a68737c067cf77fba51f8d35e SHA256 51f2864af118cd2d24dd8178c0d7f75c3a7da7d7304e5a6b39aa3d99f582c153 EBUILD nvidia-drivers-100.14.11.ebuild 14580 RMD160 b197ffe63f6a403471a6c00a686031ae8dfc6735 SHA1 2aab2ca8bfd89c724257dfe49f6f46a503b61d8e SHA256 3c829f7927a710d7cf95cddf953ec9b3baeb4f7a69d7f4936e5025fce9a6aea5 @@ -72,18 +60,14 @@ EBUILD nvidia-drivers-173.08.ebuild 14966 RMD160 241b3c667fb22575f0705b7464bd411 EBUILD nvidia-drivers-173.14.05.ebuild 15089 RMD160 14ac3ee3a884b3314f3e8482d3fab47beec4b2a8 SHA1 526db4a7e7f6bd9272d7a12ad8cdf39660ce4be2 SHA256 adf871196301e1490a6f456526a6b34bd9be69e097e30c2242faea9f3c241132 EBUILD nvidia-drivers-173.14.09.ebuild 15062 RMD160 a0778f68a0bc6a2f734f5196de0aea0601aec65a SHA1 752ad15a93119f8ced3572f42668fececaaa08d3 SHA256 749d5d746134cedb3533057217ae2e152a930d3d40765131c3fb9edd6f61bd04 EBUILD nvidia-drivers-177.13.ebuild 15064 RMD160 cde5df9ef55d811470c00bc27ead9f6969ecdc28 SHA1 af99ef57ba7a2eddf05410f42a62a37146b7910e SHA256 70b4ef2a3ac8bb5d8ecfc030b8cac9abc9eaf13fa9c29efdfcb9604eaf00e387 -EBUILD nvidia-drivers-71.86.01.ebuild 14231 RMD160 49d208c3fdc9b1f13bfec79a098c4f9493f7ce19 SHA1 f46f3971df37928329124b55b3bead9f572a2a1c SHA256 6f84e06dce07f610bcdfc95a300ea6d274000ab77bb6b03e39a028aabb61e61a -EBUILD nvidia-drivers-71.86.04.ebuild 14254 RMD160 20d997c621bd4c7f48a8c1b25b97e824e8d5e3f0 SHA1 9a1668688dc15f46f3347608d3773d2b8a2ba8dd SHA256 897ef81130bf95e1ce54dbae35e1db4c140732509e4577a0e1da8e19b6ac58dd -EBUILD nvidia-drivers-71.86.06.ebuild 14133 RMD160 8ad3450dfb1f3eea61b0e6450aa7c391d88d3fbe SHA1 1f169888ead6be29a734256085122c76ac185054 SHA256 8a1702ef650b4a9d28a4e8977fa4f490a6358c77f831105f31022a4774c6ea79 -EBUILD nvidia-drivers-96.43.01.ebuild 14568 RMD160 c436bb8f142d2cb39109dbb6e5c173dc1140f1a6 SHA1 e344039085ac27e11fc5d9c9f16b62c642dd24e0 SHA256 731e05ce94ae6cc4613955ecb736b1ede4371b02c31ce74cc8fe367edaf7575a -EBUILD nvidia-drivers-96.43.05.ebuild 14550 RMD160 79053e54d8baab3c5cc4b3391829d14e5b481565 SHA1 dfef82067f0d568a844c325c9de7d0b280932818 SHA256 fb9ff76607e7d1e9a1e73c856e147dc5b0c2d6af4c584144451b5e77e85d6f8a -EBUILD nvidia-drivers-96.43.07.ebuild 14470 RMD160 783c37ed94929ee0be4c580ceae1a439ebefb96c SHA1 4f82c38290d514144ef1da68142dabaae118ee6b SHA256 35461748533ff3588e4bf50417abb26f56d2adeb6dc60296549b520cc508b685 -MISC ChangeLog 22889 RMD160 d0f689ace7424ff7ef9ff8355b3cc5b0c851e2e2 SHA1 e5e4c7fe8e07831c78c5c11d015cccc246fbe6cc SHA256 31d97adcab9f2933ca6466c498bed83ca21f6a829d4cbf13f0f950fe1740dc89 +EBUILD nvidia-drivers-71.86.06.ebuild 14132 RMD160 e52046f2c5471457ef5260df884e267b8c884775 SHA1 0de445e4f489f40319ca395d7c3bf7737280dfc6 SHA256 15311716b75f6c731e7648f3dd5a7a44e21c24c2c6960f0e5fe52a733fd8a7e4 +EBUILD nvidia-drivers-96.43.07.ebuild 14469 RMD160 7ebec975d38c14fc9fc52be368421f3ab8fce507 SHA1 8b2897f1d3f887d7ebbc414e49a30e6b9b3e9975 SHA256 2ec6de95a771311999baa15b3f9b5336de4e039881c9c17b27b38b077a7b5dcd +MISC ChangeLog 23441 RMD160 0838782775e0ffc6ee500371d7b8927bead1d9c8 SHA1 085874df7b24a5fda9b25fdc818465ba1ed80f57 SHA256 7eda89fb9c808213cffc61f82341b2ec095e13e20c27b7fb50015967e68cdf49 MISC metadata.xml 292 RMD160 f5979fce13f28cf69ea0ce27655361d3a399d73e SHA1 f98b700a2945e5b0a256b0aad118b7e08880c4a8 SHA256 9e76022e1a4ab0c738f94b9109e4f509f1a416dc63b71e03e1f0735c82ca9fb4 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) -iEYEARECAAYFAkh/Th0ACgkQp5vW4rUFj5rQdgCgpazSLkNx++pTqp4p/iGt2XEK -f8oAnjab6c6Qucw46vvlqJQkgx9m6B/m -=hK33 +iEYEARECAAYFAkiF/DMACgkQp5vW4rUFj5qgewCgpAU9Cm2gYKGkTqXw1ANATQRv +gfYAoIp7azqM/Gft0hN+k3wMf3TMyURM +=Wrwu -----END PGP SIGNATURE----- diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-71.86.04-2305230.diff b/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-71.86.04-2305230.diff deleted file mode 100644 index 0dfcfd5aa9c8..000000000000 --- a/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-71.86.04-2305230.diff +++ /dev/null @@ -1,1471 +0,0 @@ -diff -ru usr/src/nv/Makefile.kbuild usr/src/nv.2305230/Makefile.kbuild ---- usr/src/nv/Makefile.kbuild 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/Makefile.kbuild 2008-03-18 12:55:25.461856977 -0700 -@@ -176,6 +176,7 @@ - vmap \ - signal_struct \ - agp_backend_acquire \ -+ set_pages_uc \ - change_page_attr \ - pci_get_class \ - sysctl_max_map_count \ -diff -ru usr/src/nv/conftest.sh usr/src/nv.2305230/conftest.sh ---- usr/src/nv/conftest.sh 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/conftest.sh 2008-03-18 12:55:28.782046180 -0700 -@@ -100,6 +100,32 @@ - fi - ;; - -+ set_pages_uc) -+ # -+ # Determine if the set_pages_uc() function is present. -+ # -+ echo "#include <linux/autoconf.h> -+ #include <asm/cacheflush.h> -+ void conftest_set_pages_uc(void) { -+ set_pages_uc(); -+ }" > conftest$$.c -+ -+ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 -+ rm -f conftest$$.c -+ -+ if [ -f conftest$$.o ]; then -+ rm -f conftest$$.o -+ echo "#undef NV_SET_PAGES_UC_PRESENT" >> conftest.h -+ return -+ else -+ echo "#ifdef NV_CHANGE_PAGE_ATTR_PRESENT" >> conftest.h -+ echo "#undef NV_CHANGE_PAGE_ATTR_PRESENT" >> conftest.h -+ echo "#endif" >> conftest.h -+ echo "#define NV_SET_PAGES_UC_PRESENT" >> conftest.h -+ return -+ fi -+ ;; -+ - change_page_attr) - # - # Determine if the change_page_attr() function is -@@ -124,7 +150,9 @@ - rm -f conftest$$.o - return - else -+ echo "#ifndef NV_SET_PAGES_UC_PRESENT" >> conftest.h - echo "#define NV_CHANGE_PAGE_ATTR_PRESENT" >> conftest.h -+ echo "#endif" >> conftest.h - return - fi - ;; -@@ -501,6 +529,8 @@ - return - fi - -+ rm -f conftest$$.o -+ - echo "#include <linux/autoconf.h> - #include <linux/interrupt.h> - irq_handler_t conftest_isr; -diff -ru usr/src/nv/nv-linux.h usr/src/nv.2305230/nv-linux.h ---- usr/src/nv/nv-linux.h 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/nv-linux.h 2008-03-18 12:57:26.340745475 -0700 -@@ -19,8 +19,8 @@ - #include <linux/utsname.h> - - --#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) --# error This driver does not support pre-2.4 kernels! -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 7) -+# error This driver does not support 2.4 kernels older than 2.4.7! - #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) - # define KERNEL_2_4 - #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) -@@ -51,6 +51,10 @@ - #include <linux/modversions.h> - #endif - -+#if defined(KERNEL_2_4) && !defined(EXPORT_SYMTAB) -+#define EXPORT_SYMTAB -+#endif -+ - #include <linux/kernel.h> - #include <linux/module.h> - -@@ -98,6 +102,7 @@ - - #include <linux/spinlock.h> - #include <asm/semaphore.h> -+#include <linux/completion.h> - #include <linux/highmem.h> - - #ifdef CONFIG_PROC_FS -@@ -118,8 +123,12 @@ - #endif - - #if defined(CONFIG_KGDB) -+#if defined(NV_OLD_MM_KGDB_BREAKPOINT_PRESENT) -+#include <asm/kgdb.h> -+#else - #include <linux/kgdb.h> - #endif -+#endif - - #if defined (CONFIG_AGP) || defined (CONFIG_AGP_MODULE) - #define AGPGART -@@ -516,19 +525,16 @@ - #define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type) \ - { \ - (ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL); \ -- KM_ALLOC_RECORD(ptr, sizeof(type), "km_cache_alloc"); \ - } - - #define NV_KMEM_CACHE_FREE(ptr, type, kmem_cache) \ - { \ -- KM_FREE_RECORD(ptr, sizeof(type), "km_cache_free"); \ - kmem_cache_free(kmem_cache, ptr); \ - } - --#if defined(NV_SG_MAP_BUFFERS) /* Linux/x86-64, only */ - #if defined(NV_VMAP_PRESENT) - #if (NV_VMAP_ARGUMENT_COUNT == 2) --#define NV_VMAP(ptr, pages, count, cached) \ -+#define NV_VMAP_KERNEL(ptr, pages, count, prot) \ - { \ - (ptr) = (unsigned long)vmap(pages, count); \ - VM_ALLOC_RECORD((void *)ptr, (count) * PAGE_SIZE, "vm_vmap"); \ -@@ -537,26 +543,35 @@ - #ifndef VM_MAP - #define VM_MAP 0 - #endif --#define NV_VMAP(ptr, pages, count, cached) \ -+#define NV_VMAP_KERNEL(ptr, pages, count, prot) \ - { \ -- pgprot_t __prot = (cached) ? PAGE_KERNEL : PAGE_KERNEL_NOCACHE; \ -- (ptr) = (unsigned long)vmap(pages, count, VM_MAP, __prot); \ -+ (ptr) = (unsigned long)vmap(pages, count, VM_MAP, prot); \ - VM_ALLOC_RECORD((void *)ptr, (count) * PAGE_SIZE, "vm_vmap"); \ - } - #else - #error "NV_VMAP_ARGUMENT_COUNT value unrecognized!" - #endif - #else -+#if defined(NV_SG_MAP_BUFFERS) - #error "NV_VMAP() undefined (vmap() unavailable)!" -+#endif - #endif /* NV_VMAP_PRESENT */ - --#define NV_VUNMAP(ptr, count) \ -+#define NV_VUNMAP_KERNEL(ptr, count) \ - { \ -- VM_FREE_RECORD((void *)ptr, (count) * PAGE_SIZE, "vm_vmap"); \ -+ VM_FREE_RECORD((void *)ptr, (count) * PAGE_SIZE, "vm_vunmap"); \ - vunmap((void *)(ptr)); \ - } - --#endif /* NV_SG_MAP_BUFFERS */ -+#define NV_VMAP(addr, pages, count, cached) \ -+ { \ -+ pgprot_t __prot = (cached) ? PAGE_KERNEL : PAGE_KERNEL_NOCACHE; \ -+ void *__ptr = nv_vmap(pages, count, __prot); \ -+ (addr) = (unsigned long)__ptr; \ -+ } -+ -+#define NV_VUNMAP(addr, count) nv_vunmap((void *)addr, count) -+ - - #endif /* !defined NVWATCH */ - -@@ -764,9 +779,10 @@ - - #define NV_PGD_OFFSET(address, kernel, mm) \ - ({ \ -+ struct mm_struct *__mm = (mm); \ - pgd_t *__pgd; \ - if (!kernel) \ -- __pgd = pgd_offset(mm, address); \ -+ __pgd = pgd_offset(__mm, address); \ - else \ - __pgd = pgd_offset_k(address); \ - __pgd; \ -@@ -968,9 +984,7 @@ - #define NV_ALLOC_TYPE_PCI (1<<0) - #define NV_ALLOC_TYPE_AGP (1<<1) - #define NV_ALLOC_TYPE_CONTIG (1<<2) --#define NV_ALLOC_TYPE_KERNEL (1<<3) --#define NV_ALLOC_TYPE_VMALLOC (1<<4) --#define NV_ALLOC_TYPE_VMAP (1<<5) -+#define NV_ALLOC_TYPE_VMAP (1<<3) - - #define NV_ALLOC_MAPPING_SHIFT 16 - #define NV_ALLOC_MAPPING(flags) (((flags)>>NV_ALLOC_MAPPING_SHIFT)&0xff) -@@ -980,7 +994,6 @@ - - #define NV_ALLOC_MAPPING_AGP(flags) ((flags) & NV_ALLOC_TYPE_AGP) - #define NV_ALLOC_MAPPING_CONTIG(flags) ((flags) & NV_ALLOC_TYPE_CONTIG) --#define NV_ALLOC_MAPPING_VMALLOC(flags) ((flags) & NV_ALLOC_TYPE_VMALLOC) - #define NV_ALLOC_MAPPING_VMAP(flags) ((flags) & NV_ALLOC_TYPE_VMAP) - - static inline U032 nv_alloc_init_flags(int cached, int agp, int contig, int kernel) -@@ -988,12 +1001,7 @@ - U032 flags = NV_ALLOC_ENC_MAPPING(cached); - if (agp) flags |= NV_ALLOC_TYPE_AGP; - else flags |= NV_ALLOC_TYPE_PCI; -- if (kernel) flags |= NV_ALLOC_TYPE_KERNEL; --#if defined(NV_SG_MAP_BUFFERS) - if (kernel && !contig) flags |= NV_ALLOC_TYPE_VMAP; --#else -- if (kernel && !contig) flags |= NV_ALLOC_TYPE_VMALLOC; --#endif - if (contig && !agp) flags |= NV_ALLOC_TYPE_CONTIG; - return flags; - } -@@ -1067,21 +1075,24 @@ - #define NV_ATOMIC_DEC_AND_TEST(data) atomic_dec_and_test(&(data)) - #define NV_ATOMIC_READ(data) atomic_read(&(data)) - -+extern int nv_update_memory_types; -+ - /* -- * a BUG() is triggered on early 2.6 x86_64 kernels. the underlying -- * problem actually exists on many architectures and kernels, but -- * these are the only kernels that check the condition and trigger -- * a BUG(). note that this is a problem of the core kernel, not an -- * nvidia bug (and can still be triggered by agpgart). let's avoid -- * change_page_attr on those kernels. -+ * Using change_page_attr() on early Linux/x86-64 2.6 kernels may -+ * result in a BUG() being triggered. The underlying problem -+ * actually exists on multiple architectures and kernels, but only -+ * the above check for the condition and trigger a BUG(). -+ * -+ * Note that this is a due to a bug in the Linux kernel, not an -+ * NVIDIA driver bug (it can also be triggered by AGPGART). -+ * -+ * We therefore need to determine at runtime if change_page_attr() -+ * can be used safely on these kernels. - */ --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) --extern int nv_use_cpa; -- --#if defined(NVCPU_X86_64) && !defined(KERNEL_2_4) && \ -- (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)) --#define NV_CHANGE_PAGE_ATTR_BUG_PRESENT 1 --#endif -+#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) && defined(NVCPU_X86_64) && \ -+ !defined(KERNEL_2_4) && \ -+ (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)) -+#define NV_CHANGE_PAGE_ATTR_BUG_PRESENT - #endif - - #if defined(NVCPU_X86) || defined(NVCPU_X86_64) -@@ -1093,7 +1104,7 @@ - * - * We need to be careful to mask out _PAGE_NX when the host system - * doesn't support this feature or when it's disabled: the kernel -- * may not do this in its implementation of the change_page_attr() -+ * may not do this in its implementation of the change_page_attr() - * interface. - */ - #ifndef X86_FEATURE_NX -diff -ru usr/src/nv/nv-vm.c usr/src/nv.2305230/nv-vm.c ---- usr/src/nv/nv-vm.c 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/nv-vm.c 2008-03-18 12:55:58.755754293 -0700 -@@ -43,42 +43,40 @@ - } - #endif - --/* -- * AMD Athlon processors expose a subtle bug in the Linux -- * kernel, that may lead to AGP memory corruption. Recent -- * kernel versions had a workaround for this problem, but -- * 2.4.20 is the first kernel to address it properly. The -- * page_attr API provides the means to solve the problem. -- */ -- - static inline void nv_set_page_attrib_uncached(nv_pte_t *page_ptr) - { --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- if (nv_use_cpa) -+ if (nv_update_memory_types) - { -- struct page *page = virt_to_page(__va(page_ptr->phys_addr)); -+#if defined(NV_SET_PAGES_UC_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); -+ set_pages_uc(page, 1); -+#elif defined(NV_CHANGE_PAGE_ATTR_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); - pgprot_t prot = PAGE_KERNEL_NOCACHE; - #if defined(NVCPU_X86) || defined(NVCPU_X86_64) - pgprot_val(prot) &= __nv_supported_pte_mask; - #endif - change_page_attr(page, 1, prot); -- } - #endif -+ } - } - - static inline void nv_set_page_attrib_cached(nv_pte_t *page_ptr) - { --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- if (nv_use_cpa) -+ if (nv_update_memory_types) - { -- struct page *page = virt_to_page(__va(page_ptr->phys_addr)); -+#if defined(NV_SET_PAGES_UC_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); -+ set_pages_wb(page, 1); -+#elif defined(NV_CHANGE_PAGE_ATTR_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); - pgprot_t prot = PAGE_KERNEL; - #if defined(NVCPU_X86) || defined(NVCPU_X86_64) - pgprot_val(prot) &= __nv_supported_pte_mask; - #endif - change_page_attr(page, 1, prot); -+#endif - } --#endif /* NV_CHANGE_PAGE_ATTR_PRESENT */ - } - - static inline void nv_lock_page(nv_pte_t *page_ptr) -@@ -360,8 +358,11 @@ - #if defined(NV_CPA_NEEDS_FLUSHING) - nv_execute_on_all_cpus(cache_flush, NULL); - #endif -+#if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) && \ -+ defined(NV_CHANGE_PAGE_ATTR_PRESENT) - global_flush_tlb(); - #endif -+#endif - } - - /* -@@ -409,11 +410,11 @@ - nv_pte_t *page_ptr = *at->page_table; - unsigned int i, j, gfp_mask; - unsigned long virt_addr = 0, phys_addr; -+ struct page **pages = 0; - #if defined(NV_SG_MAP_BUFFERS) - int ret = -1; - nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); - struct pci_dev *dev = nvl->dev; -- struct page **pages = 0; - #endif - - nv_printf(NV_DBG_MEMINFO, "NVRM: VM: nv_vm_malloc_pages: %d pages\n", -@@ -462,22 +463,7 @@ - } - #endif - } -- else if (NV_ALLOC_MAPPING_VMALLOC(at->flags)) -- { -- void *virt_kptr = NULL; -- at->size = at->num_pages * PAGE_SIZE; -- nv_printf(NV_DBG_MEMINFO, "NVRM: VM: vmalloc, size 0x%x\n", at->size); -- NV_VMALLOC(virt_kptr, at->size, NV_ALLOC_MAPPING_CACHED(at->flags)); -- virt_addr = (unsigned long) virt_kptr; -- if (virt_addr == 0) -- { -- nv_printf(NV_DBG_ERRORS, -- "NVRM: nv_vm_malloc failed to allocate vmalloc memory\n"); -- return -1; -- } -- } - --#if defined(NV_SG_MAP_BUFFERS) - if (NV_ALLOC_MAPPING_VMAP(at->flags)) - { - NV_KMALLOC(pages, sizeof(struct page *) * at->num_pages); -@@ -488,11 +474,10 @@ - return -1; - } - } --#endif - - for (i = 0; i < at->num_pages; i++) - { -- if (!NV_ALLOC_MAPPING_CONTIG(at->flags) && !NV_ALLOC_MAPPING_VMALLOC(at->flags)) -+ if (!NV_ALLOC_MAPPING_CONTIG(at->flags)) - { - NV_GET_FREE_PAGES(virt_addr, 0, gfp_mask); - if (virt_addr == 0) -@@ -553,10 +538,10 @@ - } - } - nv_sg_load(&page_ptr->sg_list, page_ptr); -+#endif - - if (NV_ALLOC_MAPPING_VMAP(at->flags)) - pages[i] = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); --#endif - - if (!NV_ALLOC_MAPPING_CACHED(at->flags)) - nv_set_page_attrib_uncached(page_ptr); -@@ -565,41 +550,21 @@ - virt_addr += PAGE_SIZE; - } - --#if defined(NV_SG_MAP_BUFFERS) - if (NV_ALLOC_MAPPING_VMAP(at->flags)) - { - NV_VMAP(virt_addr, pages, at->num_pages, NV_ALLOC_MAPPING_CACHED(at->flags)); --#if defined(KERNEL_2_4) -- if (virt_addr != 0) -- { -- unsigned int i; -- /* -- * XXX Linux 2.4's vmap() increments the pages' reference counts -- * in preparation for vfree(); the latter skips the calls to -- * __free_page() if the pages are marked reserved, however, so -- * that the underlying memory is effectively leaked when we free -- * it later. Decrement the count here to avoid this leak. -- */ -- for (i = 0; i < at->num_pages; i++) -- { -- if (PageReserved(pages[i])) -- atomic_dec(&pages[i]->count); -- } -- } --#endif -- NV_KFREE((void *)pages, sizeof(struct page *) * at->num_pages); - if (virt_addr == 0) - { - nv_printf(NV_DBG_ERRORS, - "NVRM: VM: nv_vm_malloc_pages: failed to vmap pages\n"); - goto failed; - } -+ NV_KFREE((void *)pages, sizeof(struct page *) * at->num_pages); - for (i = 0; i < at->num_pages; i++) - { - at->page_table[i]->virt_addr = virt_addr + i * PAGE_SIZE; - } - } --#endif /* NV_SG_MAP_BUFFERS */ - - nv_vm_list_page_count(at->page_table, at->num_pages); - -@@ -624,7 +589,7 @@ - nv_sg_unmap_buffer(dev, &page_ptr->sg_list, page_ptr); - #endif - nv_unlock_page(page_ptr); -- if (!NV_ALLOC_MAPPING_CONTIG(at->flags) && !NV_ALLOC_MAPPING_VMALLOC(at->flags)) -+ if (!NV_ALLOC_MAPPING_CONTIG(at->flags)) - NV_FREE_PAGES(page_ptr->virt_addr, 0); - } - } -@@ -638,16 +603,9 @@ - #endif - NV_FREE_PAGES(page_ptr->virt_addr, at->order); - } -- else if (NV_ALLOC_MAPPING_VMALLOC(at->flags)) -- { -- page_ptr = *at->page_table; -- NV_VFREE((void *) page_ptr->virt_addr, at->size); -- } - --#if defined(NV_SG_MAP_BUFFERS) - if (NV_ALLOC_MAPPING_VMAP(at->flags) && pages != 0) -- NV_VFREE((void *)pages, sizeof(struct page *) * at->num_pages); --#endif -+ NV_KFREE((void *)pages, sizeof(struct page *) * at->num_pages); - - return -1; - } -@@ -674,19 +632,17 @@ - } - nv_vm_list_page_count(at->page_table, at->num_pages); - --#if defined(NV_SG_MAP_BUFFERS) - if (NV_ALLOC_MAPPING_VMAP(at->flags)) - NV_VUNMAP((void *)at->page_table[0]->virt_addr, at->num_pages); // undo vmap() --#endif - - for (i = 0; i < at->num_pages; i++) - { - page_ptr = at->page_table[i]; - if (!NV_ALLOC_MAPPING_CACHED(at->flags)) - nv_set_page_attrib_cached(page_ptr); --#if defined(NV_SG_MAP_BUFFERS) - if (NV_ALLOC_MAPPING_VMAP(at->flags)) - page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr); -+#if defined(NV_SG_MAP_BUFFERS) - if (!NV_ALLOC_MAPPING_CONTIG(at->flags)) - nv_sg_unmap_buffer(dev, &page_ptr->sg_list, page_ptr); - #endif -@@ -701,7 +657,7 @@ - } - } - nv_unlock_page(page_ptr); -- if (!NV_ALLOC_MAPPING_CONTIG(at->flags) && !NV_ALLOC_MAPPING_VMALLOC(at->flags)) -+ if (!NV_ALLOC_MAPPING_CONTIG(at->flags)) - NV_FREE_PAGES(page_ptr->virt_addr, 0); - } - nv_flush_caches(); -@@ -714,9 +670,136 @@ - #endif - NV_FREE_PAGES(page_ptr->virt_addr, at->order); - } -- else if (NV_ALLOC_MAPPING_VMALLOC(at->flags)) -+} -+ -+#if defined(NV_VMAP_PRESENT) && defined(KERNEL_2_4) && defined(NVCPU_X86) -+static unsigned long -+nv_vmap_vmalloc( -+ int count, -+ struct page **pages, -+ pgprot_t prot -+) -+{ -+ void *virt_addr = NULL; -+ unsigned int i, size = count * PAGE_SIZE; -+ -+ NV_VMALLOC(virt_addr, size, TRUE); -+ if (virt_addr == NULL) -+ { -+ nv_printf(NV_DBG_ERRORS, -+ "NVRM: vmalloc() failed to allocate vmap() scratch pages!\n"); -+ return 0; -+ } -+ -+ for (i = 0; i < (unsigned int)count; i++) - { -- page_ptr = *at->page_table; -- NV_VFREE((void *) page_ptr->virt_addr, at->size); -+ pgd_t *pgd = NULL; -+ pmd_t *pmd = NULL; -+ pte_t *pte = NULL; -+ unsigned long address; -+ struct page *page; -+ -+ address = (unsigned long)virt_addr + i * PAGE_SIZE; -+ -+ pgd = NV_PGD_OFFSET(address, 1, NULL); -+ if (!NV_PGD_PRESENT(pgd)) -+ goto failed; -+ -+ pmd = NV_PMD_OFFSET(address, pgd); -+ if (!NV_PMD_PRESENT(pmd)) -+ goto failed; -+ -+ pte = NV_PTE_OFFSET(address, pmd); -+ if (!NV_PTE_PRESENT(pte)) -+ goto failed; -+ -+ page = NV_GET_PAGE_STRUCT(pte_val(*pte) & PAGE_MASK); -+ get_page(pages[i]); -+ set_pte(pte, mk_pte(pages[i], prot)); -+ put_page(page); -+ NV_PTE_UNMAP(pte); -+ } -+ nv_flush_caches(); -+ -+ return (unsigned long)virt_addr; -+ -+failed: -+ NV_VFREE(virt_addr, size); -+ -+ return 0; -+} -+ -+static void -+nv_vunmap_vmalloc( -+ void *address, -+ int count -+) -+{ -+ NV_VFREE(address, count * PAGE_SIZE); -+} -+#endif /* NV_VMAP_PRESENT && KERNEL_2_4 && NVCPU_X86 */ -+ -+void *nv_vmap( -+ struct page **pages, -+ int count, -+ pgprot_t prot -+) -+{ -+ unsigned long virt_addr = 0; -+#if defined(NV_VMAP_PRESENT) -+#if defined(KERNEL_2_4) && defined(NVCPU_X86) -+ /* -+ * XXX Linux 2.4's vmap() checks the requested mapping's size against -+ * the value of (max_mapnr << PAGESHIFT); since 'map_nr' is a 32-bit -+ * symbol, the checks fails given enough physical memory. We can't solve -+ * this problem by adjusting the value of 'map_nr', but we can avoid -+ * vmap() by going through vmalloc(). -+ */ -+ if (max_mapnr >= 0x100000) -+ virt_addr = nv_vmap_vmalloc(count, pages, prot); -+ else -+#endif -+ NV_VMAP_KERNEL(virt_addr, pages, count, prot); -+#if defined(KERNEL_2_4) -+ if (virt_addr) -+ { -+ int i; -+ /* -+ * XXX Linux 2.4's vmap() increments the pages' reference counts -+ * in preparation for vfree(); the latter skips the calls to -+ * __free_page() if the pages are marked reserved, however, so -+ * that the underlying memory is effectively leaked when we free -+ * it later. Decrement the count here to avoid this leak. -+ */ -+ for (i = 0; i < count; i++) -+ { -+ if (PageReserved(pages[i])) -+ atomic_dec(&pages[i]->count); -+ } - } -+#endif -+#endif /* NV_VMAP_PRESENT */ -+ return (void *)virt_addr; -+} -+ -+void nv_vunmap( -+ void *address, -+ int count -+) -+{ -+#if defined(NV_VMAP_PRESENT) -+#if defined(KERNEL_2_4) && defined(NVCPU_X86) -+ /* -+ * XXX Linux 2.4's vmap() checks the requested mapping's size against -+ * the value of (max_mapnr << PAGESHIFT); since 'map_nr' is a 32-bit -+ * symbol, the checks fails given enough physical memory. We can't solve -+ * this problem by adjusting the value of 'map_nr', but we can avoid -+ * vmap() by going through vmalloc(). -+ */ -+ if (max_mapnr >= 0x100000) -+ nv_vunmap_vmalloc(address, count); -+ else -+#endif -+ NV_VUNMAP_KERNEL(address, count); -+#endif /* NV_VMAP_PRESENT */ - } -diff -ru usr/src/nv/nv-vm.h usr/src/nv.2305230/nv-vm.h ---- usr/src/nv/nv-vm.h 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/nv-vm.h 2008-03-18 12:55:54.643519951 -0700 -@@ -11,6 +11,9 @@ - #ifndef _NV_VM_H_ - #define _NV_VM_H_ - -+void * nv_vmap(struct page **, int, pgprot_t); -+void nv_vunmap(void *, int); -+ - int nv_vm_malloc_pages(nv_state_t *, nv_alloc_t *); - void nv_vm_free_pages(nv_state_t *, nv_alloc_t *); - -diff -ru usr/src/nv/nv.c usr/src/nv.2305230/nv.c ---- usr/src/nv/nv.c 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/nv.c 2008-03-18 12:56:01.123889244 -0700 -@@ -97,9 +97,7 @@ - unsigned int nv_remap_limit; - #endif - --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) --int nv_use_cpa = 1; --#endif -+int nv_update_memory_types = 1; - - static void *nv_pte_t_cache = NULL; - -@@ -850,16 +848,13 @@ - - for (i = 0; i < 4; i++) - { -- if (NV_PAT_ENTRY(pat1, i) == 1) -+ if ((i != 1) && NV_PAT_ENTRY(pat1, i) == 1) - { - nv_printf(NV_DBG_ERRORS, "NVRM: PAT index %d already configured for Write-Combining!\n", i); - nv_printf(NV_DBG_ERRORS, "NVRM: Aborting, due to PAT already being configured\n"); - return 0; - } -- } - -- for (i = 0; i < 4; i++) -- { - if (NV_PAT_ENTRY(pat2, i) == 1) - { - nv_printf(NV_DBG_ERRORS, "NVRM: PAT index %d already configured for Write-Combining!\n", i + 4); -@@ -969,30 +964,26 @@ - #endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ - } - -- - #if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) -- --/* nv_verify_cpa_interface - determine if the change_page_attr bug is fixed -- * in this kernel. -+/* -+ * nv_verify_cpa_interface() - determine if the change_page_attr() large page -+ * management accounting bug known to exist in early Linux/x86-64 kernels -+ * is present in this kernel. - * -- * there's really not a good way to determine if change_page_attr is fixed. -- * we can't really use cpa on 2.6 x86_64 kernels < 2.6.11, as if we run into -- * the accounting bug, the kernel will throw a BUG. this isn't 100% accurate, -- * as it doesn't throw a bug until we try to restore the caching attributes -- * of the page. so if we can track down a 4M allocation, we can mark it -- * uncached and see if the accounting was done correctly. -- * -- * this is a little ugly, but the most accurate approach to determining if -- * this kernel is good. -+ * There's really no good way to determine if change_page_attr() is working -+ * correctly. We can't reliably use change_page_attr() on Linux/x86-64 2.6 -+ * kernels < 2.6.11: if we run into the accounting bug, the Linux kernel will -+ * trigger a BUG() if we attempt to restore the WB memory type of a page -+ * originally part of a large page. - * -- * why do we even bother? some distributions have back-ported the cpa fix to -- * kernels < 2.6.11. we want to use change_page_attr to avoid random corruption -- * and hangs, but need to make sure it's safe to do so. -+ * So if we can successfully allocate such a page, change its memory type to -+ * UC and check if the accounting was done correctly, we can determine if -+ * the change_page_attr() interface can be used safely. - * -- * return values: -- * 0 - test passed, interface works -- * 1 - test failed, status unclear -- * -1 - test failed, interface broken -+ * Return values: -+ * 0 - test passed, the change_page_attr() interface works -+ * 1 - test failed, the status is unclear -+ * -1 - test failed, the change_page_attr() interface is broken - */ - - static inline pte_t *check_large_page(unsigned long vaddr) -@@ -1000,7 +991,7 @@ - pgd_t *pgd = NULL; - pmd_t *pmd = NULL; - -- pgd = NV_PGD_OFFSET(vaddr, 1, &init_mm); -+ pgd = NV_PGD_OFFSET(vaddr, 1, NULL); - if (!NV_PGD_PRESENT(pgd)) - return NULL; - -@@ -1110,35 +1101,42 @@ - - return 1; - } -- - #endif /* defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) */ - -- --// verify that the kernel's mapping matches the requested type --// this is to protect against accidental cache aliasing problems -+/* -+ * nv_verify_page_mappings() - verify that the kernel mapping of the specified -+ * page matches the specified type. This is to help detect bugs in the Linux -+ * kernel's change_page_attr() interface, early. -+ * -+ * This function relies on the ability to perform kernel virtul address to PFN -+ * translations and therefore on 'init_mm'. Unfortunately, the latter is no -+ * longer exported in recent Linux/x86 2.6 kernels. The export was removed at -+ * roughtly the same time as the set_pages_{uc,wb}() change_page_attr() -+ * replacement interfaces were introduced; hopefully, it will be sufficient to -+ * check for their presence. -+ */ - int nv_verify_page_mappings( - nv_pte_t *page_ptr, - unsigned int cachetype - ) - { -- struct mm_struct *mm; -+#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) || \ -+ (defined(NV_SET_PAGES_UC_PRESENT) && !defined(NVCPU_X86)) -+ unsigned long retval = -1; -+#if defined(NVCPU_X86) || defined(NVCPU_X86_64) - pgd_t *pgd = NULL; - pmd_t *pmd = NULL; - pte_t *pte = NULL; -- unsigned long retval = -1; - unsigned int flags, expected; - unsigned long address; - static int count = 0; - --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- if (!nv_use_cpa) -+ if (!nv_update_memory_types) - return 0; --#endif - - address = (unsigned long)__va(page_ptr->phys_addr); -- mm = &init_mm; // always a kernel page - -- pgd = NV_PGD_OFFSET(address, 1, mm); -+ pgd = NV_PGD_OFFSET(address, 1, NULL); - if (!NV_PGD_PRESENT(pgd)) - { - nv_printf(NV_DBG_ERRORS, "NVRM: pgd not present for addr 0x%lx\n", address); -@@ -1204,7 +1202,11 @@ - } - - failed: -+#endif /* defined(NVCPU_X86) || defined(NVCPU_X86_64) */ - return retval; -+#else -+ return 0; -+#endif - } - - #if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) -@@ -1250,7 +1252,8 @@ - static int __init nvidia_init_module(void) - { - int rc; -- U032 i, count; -+ U032 i, count, data; -+ nv_state_t *nv = NV_STATE_PTR(&nv_ctl_device); - - #if defined(VM_CHECKER) - nv_init_lock(vm_lock); -@@ -1266,11 +1269,18 @@ - return -ENODEV; - } - -+ if (!rm_init_rm()) -+ { -+ nv_printf(NV_DBG_ERRORS, "NVRM: rm_init_rm() failed!\n"); -+ return -EIO; -+ } -+ - memset(nv_linux_devices, 0, sizeof(nv_linux_devices)); - - if (pci_register_driver(&nv_pci_driver) < 0) - { - pci_unregister_driver(&nv_pci_driver); // XXX ??? -+ rm_shutdown_rm(); - nv_printf(NV_DBG_ERRORS, "NVRM: No NVIDIA graphics adapter found!\n"); - return -ENODEV; - } -@@ -1293,6 +1303,7 @@ - if (num_probed_nv_devices == 0) - { - pci_unregister_driver(&nv_pci_driver); -+ rm_shutdown_rm(); - nv_printf(NV_DBG_ERRORS, "NVRM: No NVIDIA graphics adapter probed!\n"); - return -ENODEV; - } -@@ -1307,6 +1318,7 @@ - if (num_nv_devices == 0) - { - pci_unregister_driver(&nv_pci_driver); -+ rm_shutdown_rm(); - nv_printf(NV_DBG_ERRORS, - "NVRM: None of the NVIDIA graphics adapters were initialized!\n"); - return -ENODEV; -@@ -1317,8 +1329,9 @@ - rc = register_chrdev(nv_major, "nvidia", &nv_fops); - if (rc < 0) - { -- nv_printf(NV_DBG_ERRORS, "NVRM: register chrdev failed\n"); - pci_unregister_driver(&nv_pci_driver); -+ rm_shutdown_rm(); -+ nv_printf(NV_DBG_ERRORS, "NVRM: register_chrdev() failed!\n"); - return rc; - } - -@@ -1367,14 +1380,6 @@ - } - #endif - -- // Init the resource manager -- if (!rm_init_rm()) -- { -- nv_printf(NV_DBG_ERRORS, "NVRM: rm_init_rm() failed\n"); -- rc = -EIO; -- goto failed; -- } -- - #if defined(NV_SG_MAP_BUFFERS) - rm_read_registry_dword(NV_STATE_PTR(&nv_ctl_device), "NVreg", "RemapLimit", &nv_remap_limit); - -@@ -1407,48 +1412,41 @@ - /* create /proc/driver/nvidia */ - nvos_proc_create(); - --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -+ /* -+ * Give users an opportunity to disable the driver's use of -+ * the change_page_attr() and set_pages_{uc,wb}() kernel -+ * interfaces. -+ */ -+ rc = rm_read_registry_dword(nv, "NVreg", "UpdateMemoryTypes", &data); -+ if ((rc == 0) && ((int)data != ~0)) - { -- int data; -- -- // allow the user to override us with a registry key -- rc = rm_read_registry_dword(NV_STATE_PTR(&nv_ctl_device), "NVreg", "UseCPA", &data); -- if ((rc == 0) && (data != -1)) -- { -- nv_use_cpa = data; -- } -+ nv_update_memory_types = data; -+ } - #if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) -- else -+ /* -+ * Unless we explicitely detect that the change_page_attr() -+ * inteface is fixed, disable usage of the interface on -+ * this kernel. Notify the user of this problem using the -+ * driver's /proc warnings interface (read by the installer -+ * and the bug report script). -+ */ -+ else -+ { -+ rc = nv_verify_cpa_interface(); -+ if (rc < 0) - { -- /* -- * Unless we explicitely detect that the change_page_attr() -- * inteface is fixed, disable usage of the interface on -- * this kernel. Notify the user of this problem using the -- * driver's /proc warnings interface (read by the installer -- * and the bug report script). -- */ -- rc = nv_verify_cpa_interface(); -- if (rc < 0) -- { -- nv_prints(NV_DBG_ERRORS, __cpgattr_warning); -- nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning); -- nv_use_cpa = 0; -- } -- else if (rc != 0) -- { -- nv_prints(NV_DBG_ERRORS, __cpgattr_warning_2); -- nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning_2); -- nv_use_cpa = 0; -- } -+ nv_prints(NV_DBG_ERRORS, __cpgattr_warning); -+ nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning); -+ nv_update_memory_types = 0; -+ } -+ else if (rc != 0) -+ { -+ nv_prints(NV_DBG_ERRORS, __cpgattr_warning_2); -+ nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning_2); -+ nv_update_memory_types = 0; - } --#endif - } --#endif -- -- --#if defined(DEBUG) -- inter_module_register("nv_linux_devices", THIS_MODULE, nv_linux_devices); --#endif -+#endif /* defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) */ - - #if defined(NVCPU_X86_64) && defined(CONFIG_IA32_EMULATION) && !defined(HAVE_COMPAT_IOCTL) - /* Register ioctl conversions for 32 bit clients */ -@@ -1501,6 +1499,8 @@ - } - - pci_unregister_driver(&nv_pci_driver); -+ rm_shutdown_rm(); -+ - return rc; - } - -@@ -1532,10 +1532,6 @@ - /* remove /proc/driver/nvidia */ - nvos_proc_remove(); - --#if defined(DEBUG) -- inter_module_unregister("nv_linux_devices"); --#endif -- - #if defined(NV_PM_SUPPORT_OLD_STYLE_APM) - for (i = 0; i < num_nv_devices; i++) - { -@@ -2112,6 +2108,8 @@ - if (rm_validate_pfn_range(file, NV_VMA_PGOFF(vma), - NV_VMA_SIZE(vma)) == RM_OK) - { -+ if (vma->vm_flags & VM_WRITE) -+ return -EACCES; - vma->vm_flags |= (VM_IO | VM_LOCKED); - #if defined(NV_VM_INSERT_PAGE_PRESENT) - if (NV_VM_INSERT_PAGE(vma, vma->vm_start, pfn_to_page(NV_VMA_PGOFF(vma)))) -@@ -2240,6 +2238,8 @@ - if (rm_validate_pfn_range(file, NV_VMA_PGOFF(vma), - NV_VMA_SIZE(vma)) == RM_OK) - { -+ if (vma->vm_flags & VM_WRITE) -+ return -EACCES; - vma->vm_flags |= (VM_IO | VM_LOCKED); - #if defined(NV_VM_INSERT_PAGE_PRESENT) - if (NV_VM_INSERT_PAGE(vma, vma->vm_start, pfn_to_page(NV_VMA_PGOFF(vma)))) -@@ -3266,8 +3266,21 @@ - pte_t *pte = NULL; - unsigned long retval; - -- mm = (kern) ? &init_mm : current->mm; -- if (!kern) down_read(¤t->mm->mmap_sem); -+ if (!kern) -+ { -+ mm = current->mm; -+ down_read(&mm->mmap_sem); -+ } -+ else -+ { -+#if defined(NV_SET_PAGES_UC_PRESENT) && defined(NVCPU_X86) -+ /* nv_printf(NV_DBG_ERRORS, -+ "NVRM: can't translate KVA in nv_get_phys_address()!\n"); */ -+ return 0; -+#else -+ mm = NULL; -+#endif -+ } - - pgd = NV_PGD_OFFSET(address, kern, mm); - if (!NV_PGD_PRESENT(pgd)) -@@ -3288,11 +3301,13 @@ - retval &= ~_PAGE_NX; - #endif - -- if (!kern) up_read(¤t->mm->mmap_sem); -+ if (!kern) -+ up_read(&mm->mmap_sem); - return retval; - - failed: -- if (!kern) up_read(¤t->mm->mmap_sem); -+ if (!kern) -+ up_read(&mm->mmap_sem); - return 0; - } - -@@ -3300,12 +3315,19 @@ - unsigned long address - ) - { -- // make sure this address is a kernel pointer -+#if defined(NV_SET_PAGES_UC_PRESENT) && defined(NVCPU_X86) -+ nv_linux_state_t *nvl; -+ nv_alloc_t *at; -+ unsigned long virt_addr; -+ U032 i, j; -+#endif -+ -+ /* make sure this address is a kernel virtual address */ - #if defined(DEBUG) && !defined(CONFIG_X86_4G) - if (address < PAGE_OFFSET) - { - nv_printf(NV_DBG_WARNINGS, -- "NVRM: user address passed to get_kern_phys_address: 0x%lx\n", -+ "NVRM: user address passed to get_kern_phys_address: 0x%llx!\n", - address); - return 0; - } -@@ -3315,6 +3337,30 @@ - if ((address > PAGE_OFFSET) && (address < VMALLOC_START)) - return __pa(address); - -+#if defined(NV_SET_PAGES_UC_PRESENT) && defined(NVCPU_X86) -+ for (i = 0; i < num_nv_devices; i++) -+ { -+ nvl = &nv_linux_devices[i]; -+ -+ for (at = nvl->alloc_queue; (at != NULL); at = at->next) -+ { -+ if (!NV_ALLOC_MAPPING_VMAP(at->flags)) -+ continue; -+ -+ for (j = 0; j < at->num_pages; j++) -+ { -+ virt_addr = at->page_table[j]->virt_addr; -+ if ((address >= virt_addr) && -+ (address < (virt_addr + PAGE_SIZE))) -+ { -+ return (at->page_table[j]->phys_addr + -+ (address & ~PAGE_MASK)); -+ } -+ } -+ } -+ } -+#endif -+ - return _get_phys_address(address, 1); - } - -@@ -3322,12 +3368,12 @@ - unsigned long address - ) - { -- // make sure this address is not a kernel pointer -+ /* make sure this address is not a kernel virtual address */ - #if defined(DEBUG) && !defined(CONFIG_X86_4G) - if (address >= PAGE_OFFSET) - { - nv_printf(NV_DBG_WARNINGS, -- "NVRM: kernel address passed to get_user_phys_address: 0x%lx\n", -+ "NVRM: kernel address passed to get_user_phys_address: 0x%llx!\n", - address); - return 0; - } -@@ -3396,8 +3442,6 @@ - if (nv_vm_malloc_pages(nv, at)) - goto failed; - -- at->class = class; -- - // set our 'key' to the page_table. rm_alloc_agp_pages will call - // nv_translate_address below, which will look up pages using - // the value of *pAddress as a key, then index into the page_table -@@ -3952,7 +3996,8 @@ - - if (num_nv_devices == NV_MAX_DEVICES) - { -- nv_printf(NV_DBG_ERRORS, "NVRM: maximum device number (%d) reached!\n", num_nv_devices); -+ nv_printf(NV_DBG_ERRORS, "NVRM: maximum device number (%d) exceeded!\n", -+ (NV_MAX_DEVICES - 1)); - return -1; - } - -@@ -4085,13 +4130,10 @@ - return -1; - } - --int NV_API_CALL nv_no_incoherent_mappings --( -- void --) -+int NV_API_CALL nv_no_incoherent_mappings(void) - { --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- return 1; -+#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) || defined(NV_SET_PAGES_UC_PRESENT) -+ return (nv_update_memory_types); - #else - return 0; - #endif -diff -ru usr/src/nv/nv.h usr/src/nv.2305230/nv.h ---- usr/src/nv/nv.h 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/nv.h 2008-03-18 12:55:56.919649651 -0700 -@@ -335,15 +332,39 @@ - - #define NV_DEVICE_NAME_LENGTH 40 - -+#define NV_MAX_ISR_DELAY_US 20000 -+#define NV_MAX_ISR_DELAY_MS (NV_MAX_ISR_DELAY_US / 1000) -+ -+#define NV_TIMERCMP(a, b, CMP) \ -+ (((a)->tv_sec == (b)->tv_sec) ? \ -+ ((a)->tv_usec CMP (b)->tv_usec) : ((a)->tv_sec CMP (b)->tv_sec)) -+ -+#define NV_TIMERADD(a, b, result) \ -+ { \ -+ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ -+ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ -+ if ((result)->tv_usec >= 1000000) \ -+ { \ -+ ++(result)->tv_sec; \ -+ (result)->tv_usec -= 1000000; \ -+ } \ -+ } -+ -+#define NV_TIMERSUB(a, b, result) \ -+ { \ -+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ -+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ -+ if ((result)->tv_usec < 0) \ -+ { \ -+ --(result)->tv_sec; \ -+ (result)->tv_usec += 1000000; \ -+ } \ -+ } - - /* - * driver internal interfaces - */ - --/* need a fake device number for control device; just to flag it for msgs */ --#define NV_CONTROL_DEVICE_NUMBER 100 -- -- - #ifndef NVWATCH - - /* -diff -ru usr/src/nv/os-interface.c usr/src/nv.2305230/os-interface.c ---- usr/src/nv/os-interface.c 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/os-interface.c 2008-03-18 12:56:04.288069559 -0700 -@@ -25,7 +25,6 @@ - #include "os-interface.h" - #include "nv-linux.h" - -- - static volatile int os_block_on_smp_barrier; - - #ifdef CONFIG_SMP -@@ -63,7 +62,7 @@ - // - typedef struct os_sema_s - { -- struct semaphore wait; -+ struct completion completion; - spinlock_t lock; - S032 count; - } os_sema_t; -@@ -86,7 +85,7 @@ - return rmStatus; - - os_sema = (os_sema_t *)*ppSema; -- sema_init(&os_sema->wait, 0); -+ init_completion(&os_sema->completion); - spin_lock_init(&os_sema->lock); - os_sema->count = 1; - -@@ -131,7 +130,7 @@ - { - os_sema->count--; - spin_unlock_irqrestore(&os_sema->lock, old_irq); -- down(&os_sema->wait); -+ wait_for_completion(&os_sema->completion); - } - else - { -@@ -208,7 +207,7 @@ - spin_unlock_irqrestore(&os_sema->lock, old_irq); - - if (doWakeup) -- up(&os_sema->wait); -+ complete(&os_sema->completion); - - return RM_OK; - } -@@ -448,8 +447,6 @@ - // - //--------------------------------------------------------------------------- - --#define NV_MAX_ISR_UDELAY 20000 --#define NV_MAX_ISR_MDELAY (NV_MAX_ISR_UDELAY / 1000) - #define NV_MSECS_PER_JIFFIE (1000 / HZ) - #define NV_MSECS_TO_JIFFIES(msec) ((msec) * HZ / 1000) - #define NV_USECS_PER_JIFFIE (1000000 / HZ) -@@ -474,7 +471,7 @@ - do_gettimeofday(&tm1); - #endif - -- if (in_irq() && MicroSeconds > NV_MAX_ISR_UDELAY) -+ if (in_irq() && (MicroSeconds > NV_MAX_ISR_DELAY_US)) - return RM_ERROR; - - mdelay_safe_msec = MicroSeconds / 1000; -@@ -494,36 +491,6 @@ - return RM_OK; - } - --#ifndef timercmp --# define timercmp(a, b, CMP) \ -- (((a)->tv_sec == (b)->tv_sec) ? \ -- ((a)->tv_usec CMP (b)->tv_usec) : \ -- ((a)->tv_sec CMP (b)->tv_sec)) --#endif --#ifndef timeradd --# define timeradd(a, b, result) \ -- do { \ -- (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ -- (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ -- if ((result)->tv_usec >= 1000000) \ -- { \ -- ++(result)->tv_sec; \ -- (result)->tv_usec -= 1000000; \ -- } \ -- } while (0) --#endif --#ifndef timersub --# define timersub(a, b, result) \ -- do { \ -- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ -- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ -- if ((result)->tv_usec < 0) { \ -- --(result)->tv_sec; \ -- (result)->tv_usec += 1000000; \ -- } \ -- } while (0) --#endif -- - /* - * On Linux, a jiffie represents the time passed in between two timer - * interrupts. The number of jiffies per second (HZ) varies across the -@@ -549,7 +516,7 @@ - tm_start = tm_aux; - #endif - -- if (in_irq() && MilliSeconds > NV_MAX_ISR_MDELAY) -+ if (in_irq() && (MilliSeconds > NV_MAX_ISR_DELAY_MS)) - return RM_ERROR; - - if (!NV_MAY_SLEEP()) -@@ -561,7 +528,7 @@ - MicroSeconds = MilliSeconds * 1000; - tm_end.tv_usec = MicroSeconds; - tm_end.tv_sec = 0; -- timeradd(&tm_aux, &tm_end, &tm_end); -+ NV_TIMERADD(&tm_aux, &tm_end, &tm_end); - - /* do we have a full jiffie to wait? */ - jiffies = NV_USECS_TO_JIFFIES(MicroSeconds); -@@ -590,9 +557,9 @@ - schedule_timeout(jiffies); - /* catch the remainder, if any */ - do_gettimeofday(&tm_aux); -- if (timercmp(&tm_aux, &tm_end, <)) -+ if (NV_TIMERCMP(&tm_aux, &tm_end, <)) - { -- timersub(&tm_end, &tm_aux, &tm_aux); // tm_aux = tm_end - tm_aux -+ NV_TIMERSUB(&tm_end, &tm_aux, &tm_aux); // tm_aux = tm_end - tm_aux - MicroSeconds = tm_aux.tv_usec + tm_aux.tv_sec * 1000000; - } else - MicroSeconds = 0; -@@ -1109,6 +1076,18 @@ - { - void *vaddr; - -+ if (start == 0) -+ { -+ if (mode != NV_MEMORY_CACHED) -+ { -+ nv_printf(NV_DBG_ERRORS, -+ "NVRM: os_map_kernel_space: won't map address 0x%0llx UC!\n", start); -+ return NULL; -+ } -+ else -+ return (void *)PAGE_OFFSET; -+ } -+ - if (!NV_MAY_SLEEP()) - { - nv_printf(NV_DBG_ERRORS, -@@ -1131,6 +1110,9 @@ - U032 size_bytes - ) - { -+ if (addr == (void *)PAGE_OFFSET) -+ return; -+ - NV_IOUNMAP(addr, size_bytes); - } - -@@ -1176,7 +1158,11 @@ - #if defined(CONFIG_X86_REMOTE_DEBUG) - __asm__ __volatile__ ("int $3"); - #elif defined(CONFIG_KGDB) -+#if defined(NV_OLD_MM_KGDB_BREAKPOINT_PRESENT) -+ BREAKPOINT; -+#else - BREAKPOINT(); -+#endif - #elif defined(CONFIG_KDB) - KDB_ENTER(); - #else -diff -ru usr/src/nv/os-registry.c usr/src/nv.2305230/os-registry.c ---- usr/src/nv/os-registry.c 2008-01-21 11:48:11.000000000 -0800 -+++ usr/src/nv.2305230/os-registry.c 2008-03-18 12:56:07.492252151 -0700 -@@ -48,24 +48,6 @@ - * This could be changed to work on a per-device basis. - */ - --/* -- * The 2nd argument to MODULE_PARM is used to verify parameters passed -- * to the module at load time. It should be a string in the following -- * format: -- * -- * [min[-max]]{b,h,i,l,s} -- * -- * The MIN and MAX specifiers delimit the length of the array. If MAX -- * is omitted, it defaults to MIN; if both are omitted, the default is -- * 1. The final character is a type specifier. -- * -- * b byte -- * h short -- * i int -- * l long -- * s string -- */ -- - /* - * Option: VideoMemoryTypeOverride - * -@@ -360,9 +342,6 @@ - static int NVreg_DevicesConnected = 0; - NV_MODULE_PARAMETER(NVreg_DevicesConnected); - --static int NVreg_VideoEnhancement = 0; --NV_MODULE_PARAMETER(NVreg_VideoEnhancement); -- - static int NVreg_RmLogonRC = 1; - NV_MODULE_PARAMETER(NVreg_RmLogonRC); - -@@ -402,34 +381,36 @@ - NV_MODULE_PARAMETER(NVreg_RemapLimit); - - /* -- * Option: UseCPA -+ * Option: UpdateMemoryTypes - * - * Description: - * -- * Many kernels have a broken implementation of change_page_attr that leads -- * to cache aliasing problems. x86_64 kernels between 2.6.0 and 2.6.10 will -- * force a kernel BUG_ON() when this condition is encountered. For this -- * reason, the NVIDIA driver is very careful about not using the CPA kernel -- * interface on these kernels. -+ * Many kernels have broken implementations of the change_page_attr() -+ * kernel interface that may cause cache aliasing problems. Linux/x86-64 -+ * kernels between 2.6.0 and 2.6.10 may prompt kernel BUG()s due to -+ * improper accounting in the interface's large page management code, for -+ * example. For this reason, the NVIDIA Linux driver is very careful about -+ * not using the change_page_attr() kernel interface on these kernels. -+ * -+ * Due to the serious nature of the problems that can arise from bugs in -+ * the change_page_attr(), set_pages_{uc,wb}() and other kernel interfaces -+ * used to modify memory types, the NVIDIA driver implements a manual -+ * registry key override to allow forcibly enabling or disabling use of -+ * these APIs. - * -- * Some distributions have backported this fix to kernel versions that fall -- * within this version range. The NVIDIA driver attempts to automatically -- * detect these fixes and reenable usage of the change_page_attr interface. -+ * Possible values: - * -- * Due to the serious nature of the problems that can arise from this, the -- * NVIDIA driver implements a manual registry key to force usage of this API -- * to be enabled or disabled. This registry key can be used to force usage -- * of the API on a known fixed kernel if the NVIDIA driver fails to detect -- * the kernel as fixed. This registry key can also be used to disable usage -- * of the API on a bad kernel that is misdetected as a fixed kernel. -+ * ~0 = use the NVIDIA driver's default logic (default) -+ * 0 = enable use of change_page_attr(), etc. -+ * 1 = disable use of change_page_attr(), etc. - * -- * The default value is '-1' (use NVIDIA driver default logic) -- * A value of '0' will forcibly disable change_page_attr calls. -- * A value of '1' will forcibly enable change_page_attr calls. -+ * By default, the NVIDIA driver will attempt to auto-detect if it can -+ * safely use the change_page_attr() and other kernel interfaces to modify -+ * the memory types of kernel mappings. - */ - --static int NVreg_UseCPA = -1; --NV_MODULE_PARAMETER(NVreg_UseCPA); -+static int NVreg_UpdateMemoryTypes = ~0; -+NV_MODULE_PARAMETER(NVreg_UpdateMemoryTypes); - - // 1 - Force sourcing vbios from ROM - // 0 - business as usual -@@ -477,15 +458,14 @@ - { "NVreg", "ResmanDebugLevel", &NVreg_ResmanDebugLevel, 1 }, - { "NVreg", "FlatPanelMode", &NVreg_FlatPanelMode, 1 }, - { "NVreg", "DevicesConnected", &NVreg_DevicesConnected, 1 }, -- { "NVreg", "VideoEnhancement", &NVreg_VideoEnhancement, 1 }, - { "NVreg", "RmLogonRC", &NVreg_RmLogonRC, 1 }, -+ { "NVreg", "VbiosFromROM", &NVreg_VbiosFromROM, 1 }, - { "NVreg", "ModifyDeviceFiles", &NVreg_ModifyDeviceFiles, 1 }, - { "NVreg", "DeviceFileUID", &NVreg_DeviceFileUID, 1 }, - { "NVreg", "DeviceFileGID", &NVreg_DeviceFileGID, 1 }, - { "NVreg", "DeviceFileMode", &NVreg_DeviceFileMode, 1 }, -- { "NVreg", "VbiosFromROM", &NVreg_VbiosFromROM, 1 }, - { "NVreg", "RemapLimit", &NVreg_RemapLimit, 1 }, -- { "NVreg", "UseCPA", &NVreg_UseCPA, 1 }, -+ { "NVreg", "UpdateMemoryTypes", &NVreg_UpdateMemoryTypes, 1 }, - { "NVreg", "RMEdgeIntrCheck", &NVreg_RMEdgeIntrCheck, 1 }, - { NULL, NULL, NULL, 0 } - }; diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-96.43.05-2290218.diff b/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-96.43.05-2290218.diff deleted file mode 100644 index 47b721a34354..000000000000 --- a/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-96.43.05-2290218.diff +++ /dev/null @@ -1,622 +0,0 @@ -http://www.nvnews.net/vbulletin/showthread.php?t=110088 -http://bugs.gentoo.org/218178 - -diff -ru usr/src/nv/Makefile.kbuild usr/src/nv.2290218/Makefile.kbuild ---- usr/src/nv/Makefile.kbuild 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/Makefile.kbuild 2008-03-18 13:15:30.394522179 -0700 -@@ -177,6 +177,7 @@ - vmap \ - signal_struct \ - agp_backend_acquire \ -+ set_pages_uc \ - change_page_attr \ - pci_get_class \ - sysctl_max_map_count \ -diff -ru usr/src/nv/conftest.sh usr/src/nv.2290218/conftest.sh ---- usr/src/nv/conftest.sh 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/conftest.sh 2008-03-18 13:15:32.710654166 -0700 -@@ -100,6 +100,32 @@ - fi - ;; - -+ set_pages_uc) -+ # -+ # Determine if the set_pages_uc() function is present. -+ # -+ echo "#include <linux/autoconf.h> -+ #include <asm/cacheflush.h> -+ void conftest_set_pages_uc(void) { -+ set_pages_uc(); -+ }" > conftest$$.c -+ -+ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 -+ rm -f conftest$$.c -+ -+ if [ -f conftest$$.o ]; then -+ rm -f conftest$$.o -+ echo "#undef NV_SET_PAGES_UC_PRESENT" >> conftest.h -+ return -+ else -+ echo "#ifdef NV_CHANGE_PAGE_ATTR_PRESENT" >> conftest.h -+ echo "#undef NV_CHANGE_PAGE_ATTR_PRESENT" >> conftest.h -+ echo "#endif" >> conftest.h -+ echo "#define NV_SET_PAGES_UC_PRESENT" >> conftest.h -+ return -+ fi -+ ;; -+ - change_page_attr) - # - # Determine if the change_page_attr() function is -@@ -124,7 +150,9 @@ - rm -f conftest$$.o - return - else -+ echo "#ifndef NV_SET_PAGES_UC_PRESENT" >> conftest.h - echo "#define NV_CHANGE_PAGE_ATTR_PRESENT" >> conftest.h -+ echo "#endif" >> conftest.h - return - fi - ;; -@@ -501,6 +529,8 @@ - return - fi - -+ rm -f conftest$$.o -+ - echo "#include <linux/autoconf.h> - #include <linux/interrupt.h> - irq_handler_t conftest_isr; -diff -ru usr/src/nv/nv-linux.h usr/src/nv.2290218/nv-linux.h ---- usr/src/nv/nv-linux.h 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/nv-linux.h 2008-03-18 13:15:26.674310174 -0700 -@@ -808,9 +808,10 @@ - - #define NV_PGD_OFFSET(address, kernel, mm) \ - ({ \ -+ struct mm_struct *__mm = (mm); \ - pgd_t *__pgd; \ - if (!kernel) \ -- __pgd = pgd_offset(mm, address); \ -+ __pgd = pgd_offset(__mm, address); \ - else \ - __pgd = pgd_offset_k(address); \ - __pgd; \ -@@ -1097,21 +1098,24 @@ - #define NV_ATOMIC_DEC_AND_TEST(data) atomic_dec_and_test(&(data)) - #define NV_ATOMIC_READ(data) atomic_read(&(data)) - -+extern int nv_update_memory_types; -+ - /* -- * a BUG() is triggered on early 2.6 x86_64 kernels. the underlying -- * problem actually exists on many architectures and kernels, but -- * these are the only kernels that check the condition and trigger -- * a BUG(). note that this is a problem of the core kernel, not an -- * nvidia bug (and can still be triggered by agpgart). let's avoid -- * change_page_attr on those kernels. -+ * Using change_page_attr() on early Linux/x86-64 2.6 kernels may -+ * result in a BUG() being triggered. The underlying problem -+ * actually exists on multiple architectures and kernels, but only -+ * the above check for the condition and trigger a BUG(). -+ * -+ * Note that this is a due to a bug in the Linux kernel, not an -+ * NVIDIA driver bug (it can also be triggered by AGPGART). -+ * -+ * We therefore need to determine at runtime if change_page_attr() -+ * can be used safely on these kernels. - */ --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) --extern int nv_use_cpa; -- --#if defined(NVCPU_X86_64) && !defined(KERNEL_2_4) && \ -- (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)) --#define NV_CHANGE_PAGE_ATTR_BUG_PRESENT 1 --#endif -+#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) && defined(NVCPU_X86_64) && \ -+ !defined(KERNEL_2_4) && \ -+ (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)) -+#define NV_CHANGE_PAGE_ATTR_BUG_PRESENT - #endif - - #if defined(NVCPU_X86) || defined(NVCPU_X86_64) -@@ -1123,7 +1127,7 @@ - * - * We need to be careful to mask out _PAGE_NX when the host system - * doesn't support this feature or when it's disabled: the kernel -- * may not do this in its implementation of the change_page_attr() -+ * may not do this in its implementation of the change_page_attr() - * interface. - */ - #ifndef X86_FEATURE_NX -diff -ru usr/src/nv/nv-vm.c usr/src/nv.2290218/nv-vm.c ---- usr/src/nv/nv-vm.c 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/nv-vm.c 2008-03-18 13:15:34.806773619 -0700 -@@ -43,42 +43,40 @@ - } - #endif - --/* -- * AMD Athlon processors expose a subtle bug in the Linux -- * kernel, that may lead to AGP memory corruption. Recent -- * kernel versions had a workaround for this problem, but -- * 2.4.20 is the first kernel to address it properly. The -- * page_attr API provides the means to solve the problem. -- */ -- - static inline void nv_set_page_attrib_uncached(nv_pte_t *page_ptr) - { --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- if (nv_use_cpa) -+ if (nv_update_memory_types) - { -- struct page *page = virt_to_page(__va(page_ptr->phys_addr)); -+#if defined(NV_SET_PAGES_UC_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); -+ set_pages_uc(page, 1); -+#elif defined(NV_CHANGE_PAGE_ATTR_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); - pgprot_t prot = PAGE_KERNEL_NOCACHE; - #if defined(NVCPU_X86) || defined(NVCPU_X86_64) - pgprot_val(prot) &= __nv_supported_pte_mask; - #endif - change_page_attr(page, 1, prot); -- } - #endif -+ } - } - - static inline void nv_set_page_attrib_cached(nv_pte_t *page_ptr) - { --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- if (nv_use_cpa) -+ if (nv_update_memory_types) - { -- struct page *page = virt_to_page(__va(page_ptr->phys_addr)); -+#if defined(NV_SET_PAGES_UC_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); -+ set_pages_wb(page, 1); -+#elif defined(NV_CHANGE_PAGE_ATTR_PRESENT) -+ struct page *page = NV_GET_PAGE_STRUCT(page_ptr->phys_addr); - pgprot_t prot = PAGE_KERNEL; - #if defined(NVCPU_X86) || defined(NVCPU_X86_64) - pgprot_val(prot) &= __nv_supported_pte_mask; - #endif - change_page_attr(page, 1, prot); -+#endif - } --#endif /* NV_CHANGE_PAGE_ATTR_PRESENT */ - } - - static inline void nv_lock_page(nv_pte_t *page_ptr) -@@ -360,8 +358,11 @@ - #if defined(NV_CPA_NEEDS_FLUSHING) - nv_execute_on_all_cpus(cache_flush, NULL); - #endif -+#if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) && \ -+ defined(NV_CHANGE_PAGE_ATTR_PRESENT) - global_flush_tlb(); - #endif -+#endif - } - - /* -@@ -656,7 +657,7 @@ - - address = (unsigned long)virt_addr + i * PAGE_SIZE; - -- pgd = NV_PGD_OFFSET(address, 1, &init_mm); -+ pgd = NV_PGD_OFFSET(address, 1, NULL); - if (!NV_PGD_PRESENT(pgd)) - goto failed; - -diff -ru usr/src/nv/nv.c usr/src/nv.2290218/nv.c ---- usr/src/nv/nv.c 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/nv.c 2008-03-18 13:15:35.950838813 -0700 -@@ -112,10 +112,7 @@ - unsigned int nv_remap_limit; - #endif - --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) --int nv_use_cpa = 1; --#endif -- -+int nv_update_memory_types = 1; - static int nv_mmconfig_failure_detected = 0; - - static void *nv_pte_t_cache = NULL; -@@ -919,30 +916,26 @@ - #endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ - } - -- - #if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) -- --/* nv_verify_cpa_interface - determine if the change_page_attr bug is fixed -- * in this kernel. -+/* -+ * nv_verify_cpa_interface() - determine if the change_page_attr() large page -+ * management accounting bug known to exist in early Linux/x86-64 kernels -+ * is present in this kernel. - * -- * there's really not a good way to determine if change_page_attr is fixed. -- * we can't really use cpa on 2.6 x86_64 kernels < 2.6.11, as if we run into -- * the accounting bug, the kernel will throw a BUG. this isn't 100% accurate, -- * as it doesn't throw a bug until we try to restore the caching attributes -- * of the page. so if we can track down a 4M allocation, we can mark it -- * uncached and see if the accounting was done correctly. -- * -- * this is a little ugly, but the most accurate approach to determining if -- * this kernel is good. -+ * There's really no good way to determine if change_page_attr() is working -+ * correctly. We can't reliably use change_page_attr() on Linux/x86-64 2.6 -+ * kernels < 2.6.11: if we run into the accounting bug, the Linux kernel will -+ * trigger a BUG() if we attempt to restore the WB memory type of a page -+ * originally part of a large page. - * -- * why do we even bother? some distributions have back-ported the cpa fix to -- * kernels < 2.6.11. we want to use change_page_attr to avoid random corruption -- * and hangs, but need to make sure it's safe to do so. -+ * So if we can successfully allocate such a page, change its memory type to -+ * UC and check if the accounting was done correctly, we can determine if -+ * the change_page_attr() interface can be used safely. - * -- * return values: -- * 0 - test passed, interface works -- * 1 - test failed, status unclear -- * -1 - test failed, interface broken -+ * Return values: -+ * 0 - test passed, the change_page_attr() interface works -+ * 1 - test failed, the status is unclear -+ * -1 - test failed, the change_page_attr() interface is broken - */ - - static inline pte_t *check_large_page(unsigned long vaddr) -@@ -950,7 +943,7 @@ - pgd_t *pgd = NULL; - pmd_t *pmd = NULL; - -- pgd = NV_PGD_OFFSET(vaddr, 1, &init_mm); -+ pgd = NV_PGD_OFFSET(vaddr, 1, NULL); - if (!NV_PGD_PRESENT(pgd)) - return NULL; - -@@ -1060,35 +1053,42 @@ - - return 1; - } -- - #endif /* defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) */ - -- --// verify that the kernel's mapping matches the requested type --// this is to protect against accidental cache aliasing problems -+/* -+ * nv_verify_page_mappings() - verify that the kernel mapping of the specified -+ * page matches the specified type. This is to help detect bugs in the Linux -+ * kernel's change_page_attr() interface, early. -+ * -+ * This function relies on the ability to perform kernel virtul address to PFN -+ * translations and therefore on 'init_mm'. Unfortunately, the latter is no -+ * longer exported in recent Linux/x86 2.6 kernels. The export was removed at -+ * roughtly the same time as the set_pages_{uc,wb}() change_page_attr() -+ * replacement interfaces were introduced; hopefully, it will be sufficient to -+ * check for their presence. -+ */ - int nv_verify_page_mappings( - nv_pte_t *page_ptr, - unsigned int cachetype - ) - { -- struct mm_struct *mm; -+#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) || \ -+ (defined(NV_SET_PAGES_UC_PRESENT) && !defined(NVCPU_X86)) -+ unsigned long retval = -1; -+#if defined(NVCPU_X86) || defined(NVCPU_X86_64) - pgd_t *pgd = NULL; - pmd_t *pmd = NULL; - pte_t *pte = NULL; -- unsigned long retval = -1; - unsigned int flags, expected; - unsigned long address; - static int count = 0; - --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- if (!nv_use_cpa) -+ if (!nv_update_memory_types) - return 0; --#endif - - address = (unsigned long)__va(page_ptr->phys_addr); -- mm = &init_mm; // always a kernel page - -- pgd = NV_PGD_OFFSET(address, 1, mm); -+ pgd = NV_PGD_OFFSET(address, 1, NULL); - if (!NV_PGD_PRESENT(pgd)) - { - nv_printf(NV_DBG_ERRORS, "NVRM: pgd not present for addr 0x%lx\n", address); -@@ -1154,7 +1154,11 @@ - } - - failed: -+#endif /* defined(NVCPU_X86) || defined(NVCPU_X86_64) */ - return retval; -+#else -+ return 0; -+#endif - } - - #if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) -@@ -1200,7 +1204,8 @@ - static int __init nvidia_init_module(void) - { - int rc; -- U032 i, count; -+ U032 i, count, data; -+ nv_state_t *nv = NV_STATE_PTR(&nv_ctl_device); - - #if defined(VM_CHECKER) - nv_init_lock(vm_lock); -@@ -1359,43 +1364,41 @@ - /* create /proc/driver/nvidia */ - nvos_proc_create(); - --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -+ /* -+ * Give users an opportunity to disable the driver's use of -+ * the change_page_attr() and set_pages_{uc,wb}() kernel -+ * interfaces. -+ */ -+ rc = rm_read_registry_dword(nv, "NVreg", "UpdateMemoryTypes", &data); -+ if ((rc == 0) && ((int)data != ~0)) - { -- int data; -- -- // allow the user to override us with a registry key -- rc = rm_read_registry_dword(NV_STATE_PTR(&nv_ctl_device), "NVreg", "UseCPA", &data); -- if ((rc == 0) && (data != -1)) -- { -- nv_use_cpa = data; -- } -+ nv_update_memory_types = data; -+ } - #if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) -- else -+ /* -+ * Unless we explicitely detect that the change_page_attr() -+ * inteface is fixed, disable usage of the interface on -+ * this kernel. Notify the user of this problem using the -+ * driver's /proc warnings interface (read by the installer -+ * and the bug report script). -+ */ -+ else -+ { -+ rc = nv_verify_cpa_interface(); -+ if (rc < 0) - { -- /* -- * Unless we explicitely detect that the change_page_attr() -- * inteface is fixed, disable usage of the interface on -- * this kernel. Notify the user of this problem using the -- * driver's /proc warnings interface (read by the installer -- * and the bug report script). -- */ -- rc = nv_verify_cpa_interface(); -- if (rc < 0) -- { -- nv_prints(NV_DBG_ERRORS, __cpgattr_warning); -- nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning); -- nv_use_cpa = 0; -- } -- else if (rc != 0) -- { -- nv_prints(NV_DBG_ERRORS, __cpgattr_warning_2); -- nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning_2); -- nv_use_cpa = 0; -- } -+ nv_prints(NV_DBG_ERRORS, __cpgattr_warning); -+ nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning); -+ nv_update_memory_types = 0; -+ } -+ else if (rc != 0) -+ { -+ nv_prints(NV_DBG_ERRORS, __cpgattr_warning_2); -+ nvos_proc_add_warning_file("change_page_attr", __cpgattr_warning_2); -+ nv_update_memory_types = 0; - } --#endif - } --#endif -+#endif /* defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) */ - - #if defined(NVCPU_X86_64) && defined(CONFIG_IA32_EMULATION) && !defined(HAVE_COMPAT_IOCTL) - /* Register ioctl conversions for 32 bit clients */ -@@ -3230,8 +3233,21 @@ - pte_t *pte = NULL; - NvU64 retval; - -- mm = (kern) ? &init_mm : current->mm; -- if (!kern) down_read(¤t->mm->mmap_sem); -+ if (!kern) -+ { -+ mm = current->mm; -+ down_read(&mm->mmap_sem); -+ } -+ else -+ { -+#if defined(NV_SET_PAGES_UC_PRESENT) && defined(NVCPU_X86) -+ /* nv_printf(NV_DBG_ERRORS, -+ "NVRM: can't translate KVA in nv_get_phys_address()!\n"); */ -+ return 0; -+#else -+ mm = NULL; -+#endif -+ } - - pgd = NV_PGD_OFFSET(address, kern, mm); - if (!NV_PGD_PRESENT(pgd)) -@@ -3252,22 +3268,24 @@ - retval &= ~_PAGE_NX; - #endif - -- if (!kern) up_read(¤t->mm->mmap_sem); -+ if (!kern) -+ up_read(&mm->mmap_sem); - return retval; - - failed: -- if (!kern) up_read(¤t->mm->mmap_sem); -+ if (!kern) -+ up_read(&mm->mmap_sem); - return 0; - } - - NvU64 NV_API_CALL nv_get_kern_phys_address(NvU64 address) - { -- // make sure this address is a kernel pointer -+ /* make sure this address is a kernel virtual address */ - #if defined(DEBUG) && !defined(CONFIG_X86_4G) - if (address < PAGE_OFFSET) - { - nv_printf(NV_DBG_WARNINGS, -- "NVRM: user address passed to get_kern_phys_address: 0x%lx\n", -+ "NVRM: user address passed to get_kern_phys_address: 0x%llx!\n", - address); - return 0; - } -@@ -3282,12 +3300,12 @@ - - NvU64 NV_API_CALL nv_get_kern_user_address(NvU64 address) - { -- // make sure this address is not a kernel pointer -+ /* make sure this address is not a kernel virtual address */ - #if defined(DEBUG) && !defined(CONFIG_X86_4G) - if (address >= PAGE_OFFSET) - { - nv_printf(NV_DBG_WARNINGS, -- "NVRM: kernel address passed to get_user_phys_address: 0x%lx\n", -+ "NVRM: kernel address passed to get_user_phys_address: 0x%llx!\n", - address); - return 0; - } -@@ -3989,13 +4007,10 @@ - return -1; - } - --int NV_API_CALL nv_no_incoherent_mappings --( -- void --) -+int NV_API_CALL nv_no_incoherent_mappings(void) - { --#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) -- return 1; -+#if defined(NV_CHANGE_PAGE_ATTR_PRESENT) || defined(NV_SET_PAGES_UC_PRESENT) -+ return (nv_update_memory_types); - #else - return 0; - #endif -diff -ru usr/src/nv/os-interface.c usr/src/nv.2290218/os-interface.c ---- usr/src/nv/os-interface.c 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/os-interface.c 2008-03-18 13:15:38.098961229 -0700 -@@ -1130,6 +1130,18 @@ - { - void *vaddr; - -+ if (start == 0) -+ { -+ if (mode != NV_MEMORY_CACHED) -+ { -+ nv_printf(NV_DBG_ERRORS, -+ "NVRM: os_map_kernel_space: won't map address 0x%0llx UC!\n", start); -+ return NULL; -+ } -+ else -+ return (void *)PAGE_OFFSET; -+ } -+ - if (!NV_MAY_SLEEP()) - { - nv_printf(NV_DBG_ERRORS, -@@ -1162,6 +1174,9 @@ - NvU64 size_bytes - ) - { -+ if (addr == (void *)PAGE_OFFSET) -+ return; -+ - NV_IOUNMAP(addr, size_bytes); - } - -diff -ru usr/src/nv/os-registry.c usr/src/nv.2290218/os-registry.c ---- usr/src/nv/os-registry.c 2008-01-22 20:12:23.000000000 -0800 -+++ usr/src/nv.2290218/os-registry.c 2008-03-18 13:15:40.631105529 -0700 -@@ -381,34 +381,36 @@ - NV_MODULE_PARAMETER(NVreg_RemapLimit); - - /* -- * Option: UseCPA -+ * Option: UpdateMemoryTypes - * - * Description: - * -- * Many kernels have a broken implementation of change_page_attr that leads -- * to cache aliasing problems. x86_64 kernels between 2.6.0 and 2.6.10 will -- * force a kernel BUG_ON() when this condition is encountered. For this -- * reason, the NVIDIA driver is very careful about not using the CPA kernel -- * interface on these kernels. -- * -- * Some distributions have backported this fix to kernel versions that fall -- * within this version range. The NVIDIA driver attempts to automatically -- * detect these fixes and reenable usage of the change_page_attr interface. -- * -- * Due to the serious nature of the problems that can arise from this, the -- * NVIDIA driver implements a manual registry key to force usage of this API -- * to be enabled or disabled. This registry key can be used to force usage -- * of the API on a known fixed kernel if the NVIDIA driver fails to detect -- * the kernel as fixed. This registry key can also be used to disable usage -- * of the API on a bad kernel that is misdetected as a fixed kernel. -- * -- * The default value is '-1' (use NVIDIA driver default logic) -- * A value of '0' will forcibly disable change_page_attr calls. -- * A value of '1' will forcibly enable change_page_attr calls. -+ * Many kernels have broken implementations of the change_page_attr() -+ * kernel interface that may cause cache aliasing problems. Linux/x86-64 -+ * kernels between 2.6.0 and 2.6.10 may prompt kernel BUG()s due to -+ * improper accounting in the interface's large page management code, for -+ * example. For this reason, the NVIDIA Linux driver is very careful about -+ * not using the change_page_attr() kernel interface on these kernels. -+ * -+ * Due to the serious nature of the problems that can arise from bugs in -+ * the change_page_attr(), set_pages_{uc,wb}() and other kernel interfaces -+ * used to modify memory types, the NVIDIA driver implements a manual -+ * registry key override to allow forcibly enabling or disabling use of -+ * these APIs. -+ * -+ * Possible values: -+ * -+ * ~0 = use the NVIDIA driver's default logic (default) -+ * 0 = enable use of change_page_attr(), etc. -+ * 1 = disable use of change_page_attr(), etc. -+ * -+ * By default, the NVIDIA driver will attempt to auto-detect if it can -+ * safely use the change_page_attr() and other kernel interfaces to modify -+ * the memory types of kernel mappings. - */ - --static int NVreg_UseCPA = -1; --NV_MODULE_PARAMETER(NVreg_UseCPA); -+static int NVreg_UpdateMemoryTypes = ~0; -+NV_MODULE_PARAMETER(NVreg_UpdateMemoryTypes); - - /* - * Option: DetectPrimaryVga -@@ -511,7 +513,7 @@ - { "NVreg", "DeviceFileGID", &NVreg_DeviceFileGID, 1 }, - { "NVreg", "DeviceFileMode", &NVreg_DeviceFileMode, 1 }, - { "NVreg", "RemapLimit", &NVreg_RemapLimit, 1 }, -- { "NVreg", "UseCPA", &NVreg_UseCPA, 1 }, -+ { "NVreg", "UpdateMemoryTypes", &NVreg_UpdateMemoryTypes, 1 }, - { "NVreg", "DetectPrimaryVga", &NVreg_DetectPrimaryVga, 1 }, - { "NVreg", "EnableBrightnessControl", &NVreg_EnableBrightnessControl, 1 }, - { "NVreg", "PanelPWMFrequency", &NVreg_PanelPWMFrequency, 1 }, diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.01.ebuild deleted file mode 100644 index 06e4f71bf506..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.01.ebuild +++ /dev/null @@ -1,476 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.01.ebuild,v 1.6 2008/05/07 16:33:40 chainsaw Exp $ - -inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver - -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" - -DESCRIPTION="NVIDIA X11 driver and GLX libraries" -HOMEPAGE="http://www.nvidia.com/" -SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) - amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) - x86-fbsd? ( http://us.download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" - -LICENSE="NVIDIA" -SLOT="0" -KEYWORDS="-* amd64 x86 ~x86-fbsd" -IUSE="acpi gtk multilib" -RESTRICT="strip" -EMULTILIB_PKG="true" - -COMMON="x11-base/xorg-server - multilib? ( app-emulation/emul-linux-x86-xlibs ) - kernel_FreeBSD? ( !media-video/nvidia-freebsd ) - !app-emulation/emul-linux-x86-nvidia - !x11-drivers/nvidia-legacy-drivers" -DEPEND="${COMMON} - kernel_linux? ( virtual/linux-sources ) - app-admin/eselect-opengl" -RDEPEND="${COMMON} - kernel_linux? ( virtual/modutils ) - media-libs/mesa - acpi? ( sys-power/acpid )" -PDEPEND="gtk? ( media-video/nvidia-settings )" - -QA_TEXTRELS_x86="usr/lib/xorg/libXvMCNVIDIA.so.${PV} - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib/libXvMCNVIDIA.so.${PV} - usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko - usr/lib/opengl/nvidia/lib/libGL.so.1 - usr/lib/opengl/nvidia/lib/libGLcore.so.1 - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1 - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/xorg/modules/drivers/nvidia_drv.so" - -QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_amd64="usr/lib64/xorg/libXvMCNVIDIA.so.${PV} - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/xorg/libXvMCNVIDIA.so.${PV} - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib32/libXvMCNVIDIA.so.${PV} - usr/lib32/xorg/modules/drivers/nvidia_drv.so - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_WX_LOAD_amd64="usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_EXECSTACK_amd64="usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -QA_EXECSTACK_x86="usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -export _POSIX2_VERSION="199209" - -if use x86; then - PKG_V="-pkg0" - NV_PACKAGE="${X86_NV_PACKAGE}" -elif use amd64; then - PKG_V="-pkg2" - NV_PACKAGE="${AMD64_NV_PACKAGE}" -elif use x86-fbsd; then - PKG_V="" - NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" -fi - -S="${WORKDIR}/${NV_PACKAGE}${PKG_V}/usr/src/nv" - -# On BSD userland it wants real make command -MAKE="make" - -mtrr_check() { - ebegin "Checking for MTRR support" - linux_chkconfig_present MTRR - eend $? - - if [[ $? -ne 0 ]] ; then - eerror "This version needs MTRR support for most chipsets!" - eerror "Please enable MTRR support in your kernel config, found at:" - eerror - eerror " Processor type and features" - eerror " [*] MTRR (Memory Type Range Register) support" - eerror - eerror "and recompile your kernel ..." - die "MTRR support not detected!" - fi -} - -pkg_setup() { - 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 x86-fbsd; then - linux-mod_pkg_setup - MODULE_NAMES="nvidia(video:${S})" - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} SYSOUT=${KV_OUT_DIR}" - mtrr_check - 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 -} - -src_unpack() { - local NV_PATCH_PREFIX="${FILESDIR}/${PV}/NVIDIA-${PV}" - - if ! use x86-fbsd; then - if [[ ${KV_MINOR} -eq 6 && ${KV_PATCH} -lt 7 ]] ; then - echo - ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" - ewarn "This is not officially supported for ${P}. It is likely you" - ewarn "will not be able to compile or use the kernel module." - ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" - echo - ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." - fi - fi - - if ! use x86-fbsd; then - cd "${WORKDIR}" - bash "${DISTDIR}/${NV_PACKAGE}${PKG_V}.run" --extract-only - else - unpack ${A} - fi - - # Patches go below here, add brief description - use x86-fbsd \ - && cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/doc" \ - || cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}" - # Use the correct defines to make gtkglext build work - epatch "${FILESDIR}"/NVIDIA_glx-defines.patch - # Use some more sensible gl headers and make way for new glext.h - epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch - - if ! use x86-fbsd; then - # Quiet down warnings the user does not need to see - sed -i \ - -e 's:-Wpointer-arith::g' \ - -e 's:-Wsign-compare::g' \ - "${S}"/Makefile.kbuild - - # If you set this then it's your own fault when stuff breaks :) - [[ -n ${USE_CRAZY_OPTS} ]] && sed -i "s:-O:${CFLAGS}:" Makefile.* - - # If greater than 2.6.5 use M= instead of SUBDIR= - cd "${S}"; convert_to_m Makefile.kbuild - fi -} - -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. - if use x86-fbsd; then - cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/src" - echo LDFLAGS="$(raw-ldflags)" - MAKE="$(get_bmake)" emake CC="$(tc-getCC)" LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die - else - linux-mod_src_compile - fi -} - -src_install() { - local MLTEST=$(type dyn_unpack) - - cd "${WORKDIR}"/${NV_PACKAGE}${PKG_V} - - if ! use x86-fbsd; 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" ] || die "nvidia missing in FILESDIR" - sed -e 's:PACKAGE:'${PF}':g' \ - -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia > \ - "${WORKDIR}"/nvidia - insinto /etc/modules.d - doins "${WORKDIR}"/nvidia || die - else - insinto /boot/modules - doins "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.kld" || die - - exeinto /boot/modules - doexe "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.ko" || die - fi - - if [[ "${MLTEST/set_abi}" == "${MLTEST}" ]] && has_multilib_profile ; then - local OABI=${ABI} - for ABI in $(get_install_abis) ; do - src_install-libs - done - ABI=${OABI} - unset OABI - elif use amd64 ; then - src_install-libs lib32 $(get_multilibdir) - src_install-libs lib $(get_libdir) - - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions - else - src_install-libs - fi - - is_final_abi || return 0 - - if ! use x86-fbsd; then - # Docs - dodoc usr/share/doc/NVIDIA_Changelog - dodoc usr/share/doc/XF86Config.sample - dohtml usr/share/doc/html/* - - # nVidia want bug reports using this script - dobin usr/bin/nvidia-bug-report.sh || die - else - dodoc doc/{README,XF86Config.sample,Copyrights} - dohtml doc/html/* - fi -} - -# Install nvidia library: -# the first parameter is the place where to install it -# the second parameter is the base name of the library -# the third parameter is the provided soversion -donvidia() { - dodir $1 - exeinto $1 - - libname=$(basename $2) - - doexe $2.$3 - dosym ${libname}.$3 $1/${libname} - - [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 -} - -src_install-libs() { - local pkglibdir=lib - local inslibdir=$(get_libdir) - - if [[ ${#} -eq 2 ]] ; then - pkglibdir=${1} - inslibdir=${2} - elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then - pkglibdir=lib32 - fi - - local usrpkglibdir=usr/${pkglibdir} - local libdir=usr/X11R6/${pkglibdir} - local drvdir=${libdir}/modules/drivers - local extdir=${libdir}/modules/extensions - local incdir=usr/include/GL - local sover=${PV} - local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" - local NO_TLS_ROOT="${NV_ROOT}/no-tls" - local TLS_ROOT="${NV_ROOT}/tls" - local X11_LIB_DIR="/usr/${inslibdir}/xorg" - - if ! has_version x11-base/xorg-server ; then - X11_LIB_DIR="/usr/${inslibdir}" - fi - - if use x86-fbsd; then - # on FreeBSD everything is on obj/ - pkglibdir=obj - usrpkglibdir=obj - x11pkglibdir=obj - drvdir=obj - extdir=obj - - # don't ask me why the headers are there.. glxext.h is missing - incdir=doc - - # on FreeBSD it has just .1 suffix - sover=1 - fi - - # The GLX libraries - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover} - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover} - - dodir ${NO_TLS_ROOT} - donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover} - - if ! use x86-fbsd; then - donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover} - fi - - if want_tls ; then - dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - else - dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - fi - - if ! use x86-fbsd; then - # Install the .la file for libtool, to prevent e.g. bug #176423 - [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" - local ver1=$(get_version_component_range 1) - local ver2=$(get_version_component_range 2) - local ver3=$(get_version_component_range 3) - sed -e "s:\${PV}:${PV}:" \ - -e "s:\${ver1}:${ver1}:" \ - -e "s:\${ver2}:${ver2}:" \ - -e "s:\${ver3}:${ver3}:" \ - -e "s:\${libdir}:${inslibdir}:" \ - "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la - fi - - exeinto ${X11_LIB_DIR}/modules/drivers - - [[ -f ${drvdir}/nvidia_drv.so ]] && \ - doexe ${drvdir}/nvidia_drv.so - - insinto /usr/${inslibdir} - [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \ - doins ${libdir}/libXvMCNVIDIA.a - exeinto /usr/${inslibdir} - # fix Bug 131315 - [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \ - doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \ - dosym libXvMCNVIDIA.so.${PV} \ - /usr/${inslibdir}/libXvMCNVIDIA.so - - exeinto ${NV_ROOT}/extensions - [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \ - newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so - [[ -f ${extdir}/libglx.so.${sover} ]] && \ - newexe ${extdir}/libglx.so.${sover} libglx.so - - # Includes - insinto ${NV_ROOT}/include - doins ${incdir}/*.h -} - -pkg_preinst() { - # Can we make up our minds ?!?!? - local NV_D=${D} - - if ! has_version x11-base/xorg-server ; then - for dir in lib lib32 lib64 ; do - if [[ -d "${NV_D}/usr/${dir}/xorg" ]] ; then - mv "${NV_D}/usr/${dir}"/xorg/* "${NV_D}/usr/${dir}" - rmdir "${NV_D}/usr/${dir}/xorg" - fi - done - 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() { - if ! use x86-fbsd; then - linux-mod_pkg_postinst - fi - - # Switch to the nvidia implementation - eselect opengl set --use-old nvidia - - echo - elog "To use the Nvidia GLX, run \"eselect opengl set nvidia\"" - elog - elog "nVidia has requested that any bug reports submitted have the" - elog "output of /usr/bin/nvidia-bug-report.sh included." - elog - elog "To work with compiz, you must enable the AddARGBGLXVisuals option." - elog - elog "If you are having resolution problems, try disabling DynamicTwinView." - echo -} - -want_tls() { - # For uclibc or anything non glibc, return false - has_version sys-libs/glibc || return 1 - - # Old versions of glibc were lt/no-tls only - has_version '<sys-libs/glibc-2.3.2' && return 1 - - local valid_chost="true" - if use x86 ; then - case ${CHOST/-*} in - i486|i586|i686) ;; - *) valid_chost="false" - esac - fi - - [[ ${valid_chost} == "false" ]] && return 1 - - # If we've got nptl, we've got tls - built_with_use --missing true sys-libs/glibc nptl && return 0 - - # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586 - if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then - case ${CHOST/-*} in - i486|i586) return 1 ;; - esac - fi - - # These versions built linuxthreads version to support tls, too - has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0 - - return 1 -} - -pkg_postrm() { - if ! use x86-fbsd; then - linux-mod_pkg_postrm - fi - eselect opengl set --use-old xorg-x11 -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.04.ebuild deleted file mode 100644 index 89229b48e31a..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.04.ebuild +++ /dev/null @@ -1,478 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.04.ebuild,v 1.3 2008/05/21 15:09:11 chainsaw Exp $ - -inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver - -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" - -DESCRIPTION="NVIDIA X11 driver and GLX libraries" -HOMEPAGE="http://www.nvidia.com/" -SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) - amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run )" - -LICENSE="NVIDIA" -SLOT="0" -KEYWORDS="-* ~amd64 ~x86" -IUSE="acpi gtk multilib" -RESTRICT="strip" -EMULTILIB_PKG="true" - -COMMON="x11-base/xorg-server - multilib? ( app-emulation/emul-linux-x86-xlibs ) - kernel_FreeBSD? ( !media-video/nvidia-freebsd ) - !app-emulation/emul-linux-x86-nvidia - !x11-drivers/nvidia-legacy-drivers" -DEPEND="${COMMON} - kernel_linux? ( virtual/linux-sources ) - app-admin/eselect-opengl" -RDEPEND="${COMMON} - kernel_linux? ( virtual/modutils ) - media-libs/mesa - acpi? ( sys-power/acpid )" -PDEPEND="gtk? ( media-video/nvidia-settings )" - -QA_TEXTRELS_x86="usr/lib/xorg/libXvMCNVIDIA.so.${PV} - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib/libXvMCNVIDIA.so.${PV} - usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko - usr/lib/opengl/nvidia/lib/libGL.so.1 - usr/lib/opengl/nvidia/lib/libGLcore.so.1 - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1 - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/xorg/modules/drivers/nvidia_drv.so" - -QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_amd64="usr/lib64/xorg/libXvMCNVIDIA.so.${PV} - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/xorg/libXvMCNVIDIA.so.${PV} - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib32/libXvMCNVIDIA.so.${PV} - usr/lib32/xorg/modules/drivers/nvidia_drv.so - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_WX_LOAD_amd64="usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_EXECSTACK_amd64="usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -QA_EXECSTACK_x86="usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -export _POSIX2_VERSION="199209" - -if use x86; then - PKG_V="-pkg0" - NV_PACKAGE="${X86_NV_PACKAGE}" -elif use amd64; then - PKG_V="-pkg2" - NV_PACKAGE="${AMD64_NV_PACKAGE}" -elif use x86-fbsd; then - PKG_V="" - NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" -fi - -S="${WORKDIR}/${NV_PACKAGE}${PKG_V}/usr/src/nv" - -# On BSD userland it wants real make command -MAKE="make" - -mtrr_check() { - ebegin "Checking for MTRR support" - linux_chkconfig_present MTRR - eend $? - - if [[ $? -ne 0 ]] ; then - eerror "This version needs MTRR support for most chipsets!" - eerror "Please enable MTRR support in your kernel config, found at:" - eerror - eerror " Processor type and features" - eerror " [*] MTRR (Memory Type Range Register) support" - eerror - eerror "and recompile your kernel ..." - die "MTRR support not detected!" - fi -} - -pkg_setup() { - 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 x86-fbsd; then - linux-mod_pkg_setup - MODULE_NAMES="nvidia(video:${S})" - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} SYSOUT=${KV_OUT_DIR}" - mtrr_check - 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 -} - -src_unpack() { - local NV_PATCH_PREFIX="${FILESDIR}/${PV}/NVIDIA-${PV}" - - if ! use x86-fbsd; then - if [[ ${KV_MINOR} -eq 6 && ${KV_PATCH} -lt 7 ]] ; then - echo - ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" - ewarn "This is not officially supported for ${P}. It is likely you" - ewarn "will not be able to compile or use the kernel module." - ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" - echo - ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." - fi - fi - - if ! use x86-fbsd; then - cd "${WORKDIR}" - bash "${DISTDIR}/${NV_PACKAGE}${PKG_V}.run" --extract-only - else - unpack ${A} - fi - - # Patches go below here, add brief description - use x86-fbsd \ - && cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/doc" \ - || cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}" - # Use the correct defines to make gtkglext build work - epatch "${FILESDIR}"/NVIDIA_glx-defines.patch - # Use some more sensible gl headers and make way for new glext.h - epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch - - # Support 2.6.25 kernels; bug #223047 - kernel_is ge 2 6 25 && epatch "${FILESDIR}"/NVIDIA_kernel-71.86.04-2305230.diff - - if ! use x86-fbsd; then - # Quiet down warnings the user does not need to see - sed -i \ - -e 's:-Wpointer-arith::g' \ - -e 's:-Wsign-compare::g' \ - "${S}"/Makefile.kbuild - - # If you set this then it's your own fault when stuff breaks :) - [[ -n ${USE_CRAZY_OPTS} ]] && sed -i "s:-O:${CFLAGS}:" Makefile.* - - # If greater than 2.6.5 use M= instead of SUBDIR= - cd "${S}"; convert_to_m Makefile.kbuild - fi -} - -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. - if use x86-fbsd; then - cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/src" - echo LDFLAGS="$(raw-ldflags)" - MAKE="$(get_bmake)" emake CC="$(tc-getCC)" LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die - else - linux-mod_src_compile - fi -} - -src_install() { - local MLTEST=$(type dyn_unpack) - - cd "${WORKDIR}"/${NV_PACKAGE}${PKG_V} - - if ! use x86-fbsd; 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" ] || die "nvidia missing in FILESDIR" - sed -e 's:PACKAGE:'${PF}':g' \ - -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia > \ - "${WORKDIR}"/nvidia - insinto /etc/modules.d - doins "${WORKDIR}"/nvidia || die - else - insinto /boot/modules - doins "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.kld" || die - - exeinto /boot/modules - doexe "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.ko" || die - fi - - if [[ "${MLTEST/set_abi}" == "${MLTEST}" ]] && has_multilib_profile ; then - local OABI=${ABI} - for ABI in $(get_install_abis) ; do - src_install-libs - done - ABI=${OABI} - unset OABI - elif use amd64 ; then - src_install-libs lib32 $(get_multilibdir) - src_install-libs lib $(get_libdir) - - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions - else - src_install-libs - fi - - is_final_abi || return 0 - - if ! use x86-fbsd; then - # Docs - dodoc usr/share/doc/NVIDIA_Changelog - dodoc usr/share/doc/XF86Config.sample - dohtml usr/share/doc/html/* - - # nVidia want bug reports using this script - dobin usr/bin/nvidia-bug-report.sh || die - else - dodoc doc/{README,XF86Config.sample,Copyrights} - dohtml doc/html/* - fi -} - -# Install nvidia library: -# the first parameter is the place where to install it -# the second parameter is the base name of the library -# the third parameter is the provided soversion -donvidia() { - dodir $1 - exeinto $1 - - libname=$(basename $2) - - doexe $2.$3 - dosym ${libname}.$3 $1/${libname} - - [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 -} - -src_install-libs() { - local pkglibdir=lib - local inslibdir=$(get_libdir) - - if [[ ${#} -eq 2 ]] ; then - pkglibdir=${1} - inslibdir=${2} - elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then - pkglibdir=lib32 - fi - - local usrpkglibdir=usr/${pkglibdir} - local libdir=usr/X11R6/${pkglibdir} - local drvdir=${libdir}/modules/drivers - local extdir=${libdir}/modules/extensions - local incdir=usr/include/GL - local sover=${PV} - local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" - local NO_TLS_ROOT="${NV_ROOT}/no-tls" - local TLS_ROOT="${NV_ROOT}/tls" - local X11_LIB_DIR="/usr/${inslibdir}/xorg" - - if ! has_version x11-base/xorg-server ; then - X11_LIB_DIR="/usr/${inslibdir}" - fi - - if use x86-fbsd; then - # on FreeBSD everything is on obj/ - pkglibdir=obj - usrpkglibdir=obj - x11pkglibdir=obj - drvdir=obj - extdir=obj - - # don't ask me why the headers are there.. glxext.h is missing - incdir=doc - - # on FreeBSD it has just .1 suffix - sover=1 - fi - - # The GLX libraries - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover} - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover} - - dodir ${NO_TLS_ROOT} - donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover} - - if ! use x86-fbsd; then - donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover} - fi - - if want_tls ; then - dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - else - dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - fi - - if ! use x86-fbsd; then - # Install the .la file for libtool, to prevent e.g. bug #176423 - [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" - local ver1=$(get_version_component_range 1) - local ver2=$(get_version_component_range 2) - local ver3=$(get_version_component_range 3) - sed -e "s:\${PV}:${PV}:" \ - -e "s:\${ver1}:${ver1}:" \ - -e "s:\${ver2}:${ver2}:" \ - -e "s:\${ver3}:${ver3}:" \ - -e "s:\${libdir}:${inslibdir}:" \ - "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la - fi - - exeinto ${X11_LIB_DIR}/modules/drivers - - [[ -f ${drvdir}/nvidia_drv.so ]] && \ - doexe ${drvdir}/nvidia_drv.so - - insinto /usr/${inslibdir} - [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \ - doins ${libdir}/libXvMCNVIDIA.a - exeinto /usr/${inslibdir} - # fix Bug 131315 - [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \ - doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \ - dosym libXvMCNVIDIA.so.${PV} \ - /usr/${inslibdir}/libXvMCNVIDIA.so - - exeinto ${NV_ROOT}/extensions - [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \ - newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so - [[ -f ${extdir}/libglx.so.${sover} ]] && \ - newexe ${extdir}/libglx.so.${sover} libglx.so - - # Includes - insinto ${NV_ROOT}/include - doins ${incdir}/*.h -} - -pkg_preinst() { - # Can we make up our minds ?!?!? - local NV_D=${D} - - if ! has_version x11-base/xorg-server ; then - for dir in lib lib32 lib64 ; do - if [[ -d "${NV_D}/usr/${dir}/xorg" ]] ; then - mv "${NV_D}/usr/${dir}"/xorg/* "${NV_D}/usr/${dir}" - rmdir "${NV_D}/usr/${dir}/xorg" - fi - done - 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() { - if ! use x86-fbsd; then - linux-mod_pkg_postinst - fi - - # Switch to the nvidia implementation - eselect opengl set --use-old nvidia - - echo - elog "To use the Nvidia GLX, run \"eselect opengl set nvidia\"" - elog - elog "nVidia has requested that any bug reports submitted have the" - elog "output of /usr/bin/nvidia-bug-report.sh included." - elog - elog "To work with compiz, you must enable the AddARGBGLXVisuals option." - elog - elog "If you are having resolution problems, try disabling DynamicTwinView." - echo -} - -want_tls() { - # For uclibc or anything non glibc, return false - has_version sys-libs/glibc || return 1 - - # Old versions of glibc were lt/no-tls only - has_version '<sys-libs/glibc-2.3.2' && return 1 - - local valid_chost="true" - if use x86 ; then - case ${CHOST/-*} in - i486|i586|i686) ;; - *) valid_chost="false" - esac - fi - - [[ ${valid_chost} == "false" ]] && return 1 - - # If we've got nptl, we've got tls - built_with_use --missing true sys-libs/glibc nptl && return 0 - - # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586 - if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then - case ${CHOST/-*} in - i486|i586) return 1 ;; - esac - fi - - # These versions built linuxthreads version to support tls, too - has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0 - - return 1 -} - -pkg_postrm() { - if ! use x86-fbsd; then - linux-mod_pkg_postrm - fi - eselect opengl set --use-old xorg-x11 -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.06.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.06.ebuild index ed86c37791b4..7b2042e4d76d 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.06.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.06.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.06.ebuild,v 1.2 2008/07/17 13:51:16 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-71.86.06.ebuild,v 1.3 2008/07/22 15:27:39 chainsaw Exp $ inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver @@ -15,7 +15,7 @@ SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_P LICENSE="NVIDIA" SLOT="0" -KEYWORDS="-* amd64 ~x86" +KEYWORDS="-* amd64 x86" IUSE="acpi gtk multilib" RESTRICT="strip" EMULTILIB_PKG="true" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.01.ebuild deleted file mode 100644 index 5ac915d55e6f..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.01.ebuild +++ /dev/null @@ -1,484 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.01.ebuild,v 1.6 2008/05/07 16:33:40 chainsaw Exp $ - -inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver - -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" - -DESCRIPTION="NVIDIA X11 driver and GLX libraries" -HOMEPAGE="http://www.nvidia.com/" -SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) - amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) - x86-fbsd? ( http://us.download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" - -LICENSE="NVIDIA" -SLOT="0" -KEYWORDS="-* amd64 x86 ~x86-fbsd" -IUSE="acpi gtk multilib" -RESTRICT="strip" -EMULTILIB_PKG="true" - -COMMON="x11-base/xorg-server - multilib? ( app-emulation/emul-linux-x86-xlibs ) - kernel_FreeBSD? ( !media-video/nvidia-freebsd ) - !app-emulation/emul-linux-x86-nvidia - !x11-drivers/nvidia-legacy-drivers" -DEPEND="${COMMON} - kernel_linux? ( virtual/linux-sources ) - app-admin/eselect-opengl" -RDEPEND="${COMMON} - kernel_linux? ( virtual/modutils ) - media-libs/mesa - acpi? ( sys-power/acpid )" -PDEPEND="gtk? ( media-video/nvidia-settings )" - -QA_TEXTRELS_x86="usr/lib/xorg/libXvMCNVIDIA.so.${PV} - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib/libXvMCNVIDIA.so.${PV} - usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko - usr/lib/opengl/nvidia/lib/libGL.so.1 - usr/lib/opengl/nvidia/lib/libGLcore.so.1 - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1 - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/xorg/modules/drivers/nvidia_drv.so" - -QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_amd64="usr/lib64/xorg/libXvMCNVIDIA.so.${PV} - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/xorg/libXvMCNVIDIA.so.${PV} - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib32/libXvMCNVIDIA.so.${PV} - usr/lib32/xorg/modules/drivers/nvidia_drv.so - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_WX_LOAD_amd64="usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_EXECSTACK_amd64="usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -QA_EXECSTACK_x86="usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -export _POSIX2_VERSION="199209" - -if use x86; then - PKG_V="-pkg0" - NV_PACKAGE="${X86_NV_PACKAGE}" -elif use amd64; then - PKG_V="-pkg2" - NV_PACKAGE="${AMD64_NV_PACKAGE}" -elif use x86-fbsd; then - PKG_V="" - NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" -fi - -S="${WORKDIR}/${NV_PACKAGE}${PKG_V}/usr/src/nv" - -# On BSD userland it wants real make command -MAKE="make" - -mtrr_check() { - ebegin "Checking for MTRR support" - linux_chkconfig_present MTRR - eend $? - - if [[ $? -ne 0 ]] ; then - eerror "This version needs MTRR support for most chipsets!" - eerror "Please enable MTRR support in your kernel config, found at:" - eerror - eerror " Processor type and features" - eerror " [*] MTRR (Memory Type Range Register) support" - eerror - eerror "and recompile your kernel ..." - die "MTRR support not detected!" - fi -} - -pkg_setup() { - 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 x86-fbsd; then - linux-mod_pkg_setup - MODULE_NAMES="nvidia(video:${S})" - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} SYSOUT=${KV_OUT_DIR}" - mtrr_check - 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 -} - -src_unpack() { - local NV_PATCH_PREFIX="${FILESDIR}/${PV}/NVIDIA-${PV}" - - if ! use x86-fbsd; then - if [[ ${KV_MINOR} -eq 6 && ${KV_PATCH} -lt 7 ]] ; then - echo - ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" - ewarn "This is not officially supported for ${P}. It is likely you" - ewarn "will not be able to compile or use the kernel module." - ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" - echo - ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." - fi - fi - - if ! use x86-fbsd; then - cd "${WORKDIR}" - bash "${DISTDIR}/${NV_PACKAGE}${PKG_V}.run" --extract-only - else - unpack ${A} - fi - - # Patches go below here, add brief description - use x86-fbsd \ - && cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/doc" \ - || cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}" - # Use the correct defines to make gtkglext build work - epatch "${FILESDIR}"/NVIDIA_glx-defines.patch - # Use some more sensible gl headers and make way for new glext.h - epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch - # allow on board sensors to work with lm_sensors - epatch "${FILESDIR}"/NVIDIA_i2c-hwmon.patch - - if ! use x86-fbsd; then - # Quiet down warnings the user does not need to see - sed -i \ - -e 's:-Wpointer-arith::g' \ - -e 's:-Wsign-compare::g' \ - "${S}"/Makefile.kbuild - - # If you set this then it's your own fault when stuff breaks :) - [[ -n ${USE_CRAZY_OPTS} ]] && sed -i "s:-O:${CFLAGS}:" Makefile.* - - # If greater than 2.6.5 use M= instead of SUBDIR= - cd "${S}"; convert_to_m Makefile.kbuild - fi -} - -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. - if use x86-fbsd; then - cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/src" - echo LDFLAGS="$(raw-ldflags)" - MAKE="$(get_bmake)" emake CC="$(tc-getCC)" LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die - else - linux-mod_src_compile - fi -} - -src_install() { - local MLTEST=$(type dyn_unpack) - - cd "${WORKDIR}"/${NV_PACKAGE}${PKG_V} - - if ! use x86-fbsd; 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" ] || die "nvidia missing in FILESDIR" - sed -e 's:PACKAGE:'${PF}':g' \ - -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia > \ - "${WORKDIR}"/nvidia - insinto /etc/modules.d - doins "${WORKDIR}"/nvidia || die - else - insinto /boot/modules - doins "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.kld" || die - - exeinto /boot/modules - doexe "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.ko" || die - fi - - if [[ "${MLTEST/set_abi}" == "${MLTEST}" ]] && has_multilib_profile ; then - local OABI=${ABI} - for ABI in $(get_install_abis) ; do - src_install-libs - done - ABI=${OABI} - unset OABI - elif use amd64 ; then - src_install-libs lib32 $(get_multilibdir) - src_install-libs lib $(get_libdir) - - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions - else - src_install-libs - fi - - is_final_abi || return 0 - - if ! use x86-fbsd; then - # Docs - newdoc usr/share/doc/README.txt README - dodoc usr/share/doc/Copyrights usr/share/doc/NVIDIA_Changelog - dodoc usr/share/doc/XF86Config.sample - dohtml usr/share/doc/html/* - - # nVidia want bug reports using this script - dobin usr/bin/nvidia-bug-report.sh || die - else - dodoc doc/{README,XF86Config.sample,Copyrights} - dohtml doc/html/* - fi - - # Taking nvidia-xconfig from nvidia-drivers to help config xorg.conf - dobin usr/bin/nvidia-xconfig || die -} - -# Install nvidia library: -# the first parameter is the place where to install it -# the second parameter is the base name of the library -# the third parameter is the provided soversion -donvidia() { - dodir $1 - exeinto $1 - - libname=$(basename $2) - - doexe $2.$3 - dosym ${libname}.$3 $1/${libname} - - [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 -} - -src_install-libs() { - local pkglibdir=lib - local inslibdir=$(get_libdir) - - if [[ ${#} -eq 2 ]] ; then - pkglibdir=${1} - inslibdir=${2} - elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then - pkglibdir=lib32 - fi - - local usrpkglibdir=usr/${pkglibdir} - local libdir=usr/X11R6/${pkglibdir} - local drvdir=${libdir}/modules/drivers - local extdir=${libdir}/modules/extensions - local incdir=usr/include/GL - local sover=${PV} - local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" - local NO_TLS_ROOT="${NV_ROOT}/no-tls" - local TLS_ROOT="${NV_ROOT}/tls" - local X11_LIB_DIR="/usr/${inslibdir}/xorg" - - if ! has_version x11-base/xorg-server ; then - X11_LIB_DIR="/usr/${inslibdir}" - fi - - if use x86-fbsd; then - # on FreeBSD everything is on obj/ - pkglibdir=obj - usrpkglibdir=obj - x11pkglibdir=obj - drvdir=obj - extdir=obj - - # don't ask me why the headers are there.. glxext.h is missing - incdir=doc - - # on FreeBSD it has just .1 suffix - sover=1 - fi - - # The GLX libraries - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover} - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover} - - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libnvidia-cfg.so ${sover} - - dodir ${NO_TLS_ROOT} - donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover} - - if ! use x86-fbsd; then - donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover} - fi - - if want_tls ; then - dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - else - dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - fi - - if ! use x86-fbsd; then - # Install the .la file for libtool, to prevent e.g. bug #176423 - [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" - local ver1=$(get_version_component_range 1) - local ver2=$(get_version_component_range 2) - local ver3=$(get_version_component_range 3) - sed -e "s:\${PV}:${PV}:" \ - -e "s:\${ver1}:${ver1}:" \ - -e "s:\${ver2}:${ver2}:" \ - -e "s:\${ver3}:${ver3}:" \ - -e "s:\${libdir}:${inslibdir}:" \ - "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la - fi - - exeinto ${X11_LIB_DIR}/modules/drivers - - [[ -f ${drvdir}/nvidia_drv.so ]] && \ - doexe ${drvdir}/nvidia_drv.so - - insinto /usr/${inslibdir} - [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \ - doins ${libdir}/libXvMCNVIDIA.a - exeinto /usr/${inslibdir} - # fix Bug 131315 - [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \ - doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \ - dosym libXvMCNVIDIA.so.${PV} \ - /usr/${inslibdir}/libXvMCNVIDIA.so - - exeinto ${NV_ROOT}/extensions - [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \ - newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so - [[ -f ${extdir}/libglx.so.${sover} ]] && \ - newexe ${extdir}/libglx.so.${sover} libglx.so - - # Includes - insinto ${NV_ROOT}/include - doins ${incdir}/*.h -} - -pkg_preinst() { - # Can we make up our minds ?!?!? - local NV_D=${D} - - if ! has_version x11-base/xorg-server ; then - for dir in lib lib32 lib64 ; do - if [[ -d "${NV_D}/usr/${dir}/xorg" ]] ; then - mv "${NV_D}/usr/${dir}"/xorg/* "${NV_D}/usr/${dir}" - rmdir "${NV_D}/usr/${dir}/xorg" - fi - done - 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() { - if ! use x86-fbsd; then - linux-mod_pkg_postinst - fi - - # Switch to the nvidia implementation - eselect opengl set --use-old nvidia - - echo - elog "To use the Nvidia GLX, run \"eselect opengl set nvidia\"" - elog - elog "nVidia has requested that any bug reports submitted have the" - elog "output of /usr/bin/nvidia-bug-report.sh included." - elog - elog "To work with compiz, you must enable the AddARGBGLXVisuals option." - elog - elog "If you are having resolution problems, try disabling DynamicTwinView." - echo -} - -want_tls() { - # For uclibc or anything non glibc, return false - has_version sys-libs/glibc || return 1 - - # Old versions of glibc were lt/no-tls only - has_version '<sys-libs/glibc-2.3.2' && return 1 - - local valid_chost="true" - if use x86 ; then - case ${CHOST/-*} in - i486|i586|i686) ;; - *) valid_chost="false" - esac - fi - - [[ ${valid_chost} == "false" ]] && return 1 - - # If we've got nptl, we've got tls - built_with_use --missing true sys-libs/glibc nptl && return 0 - - # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586 - if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then - case ${CHOST/-*} in - i486|i586) return 1 ;; - esac - fi - - # These versions built linuxthreads version to support tls, too - has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0 - - return 1 -} - -pkg_postrm() { - if ! use x86-fbsd; then - linux-mod_pkg_postrm - fi - eselect opengl set --use-old xorg-x11 -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.05.ebuild deleted file mode 100644 index 64745332f163..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.05.ebuild +++ /dev/null @@ -1,484 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.05.ebuild,v 1.4 2008/05/07 16:33:40 chainsaw Exp $ - -inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver - -X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" -AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" -X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" - -DESCRIPTION="NVIDIA X11 driver and GLX libraries" -HOMEPAGE="http://www.nvidia.com/" -SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) - amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run )" - -LICENSE="NVIDIA" -SLOT="0" -KEYWORDS="-* ~amd64 x86" -IUSE="acpi gtk multilib" -RESTRICT="strip" -EMULTILIB_PKG="true" - -COMMON="x11-base/xorg-server - multilib? ( app-emulation/emul-linux-x86-xlibs ) - kernel_FreeBSD? ( !media-video/nvidia-freebsd ) - !app-emulation/emul-linux-x86-nvidia - !x11-drivers/nvidia-legacy-drivers" -DEPEND="${COMMON} - kernel_linux? ( virtual/linux-sources ) - app-admin/eselect-opengl" -RDEPEND="${COMMON} - kernel_linux? ( virtual/modutils ) - media-libs/mesa - acpi? ( sys-power/acpid )" -PDEPEND="gtk? ( media-video/nvidia-settings )" - -QA_TEXTRELS_x86="usr/lib/xorg/libXvMCNVIDIA.so.${PV} - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib/libXvMCNVIDIA.so.${PV} - usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko - usr/lib/opengl/nvidia/lib/libGL.so.1 - usr/lib/opengl/nvidia/lib/libGLcore.so.1 - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.1 - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/xorg/modules/drivers/nvidia_drv.so" - -QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so" - -QA_TEXTRELS_amd64="usr/lib64/xorg/libXvMCNVIDIA.so.${PV} - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/xorg/libXvMCNVIDIA.so.${PV} - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV} - usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} - usr/lib32/libXvMCNVIDIA.so.${PV} - usr/lib32/xorg/modules/drivers/nvidia_drv.so - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_WX_LOAD_amd64="usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib32/opengl/nvidia/lib/libGL.so.${PV} - usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} - usr/lib32/opengl/nvidia/extensions/libglx.so" - -QA_EXECSTACK_amd64="usr/lib64/xorg/modules/drivers/nvidia_drv.so - usr/lib64/opengl/nvidia/lib/libGL.so.${PV} - usr/lib64/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib64/opengl/nvidia/extensions/libglx.so - usr/lib64/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -QA_EXECSTACK_x86="usr/lib/xorg/modules/drivers/nvidia_drv.so - usr/lib/opengl/nvidia/lib/libGL.so.${PV} - usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} - usr/lib/opengl/nvidia/extensions/libglx.so - usr/lib/libXvMCNVIDIA.so.${PV} - usr/bin/nvidia-xconfig" - -export _POSIX2_VERSION="199209" - -if use x86; then - PKG_V="-pkg0" - NV_PACKAGE="${X86_NV_PACKAGE}" -elif use amd64; then - PKG_V="-pkg2" - NV_PACKAGE="${AMD64_NV_PACKAGE}" -elif use x86-fbsd; then - PKG_V="" - NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" -fi - -S="${WORKDIR}/${NV_PACKAGE}${PKG_V}/usr/src/nv" - -# On BSD userland it wants real make command -MAKE="make" - -mtrr_check() { - ebegin "Checking for MTRR support" - linux_chkconfig_present MTRR - eend $? - - if [[ $? -ne 0 ]] ; then - eerror "This version needs MTRR support for most chipsets!" - eerror "Please enable MTRR support in your kernel config, found at:" - eerror - eerror " Processor type and features" - eerror " [*] MTRR (Memory Type Range Register) support" - eerror - eerror "and recompile your kernel ..." - die "MTRR support not detected!" - fi -} - -pkg_setup() { - 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 x86-fbsd; then - linux-mod_pkg_setup - MODULE_NAMES="nvidia(video:${S})" - BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} SYSOUT=${KV_OUT_DIR}" - mtrr_check - 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 -} - -src_unpack() { - local NV_PATCH_PREFIX="${FILESDIR}/${PV}/NVIDIA-${PV}" - - if ! use x86-fbsd; then - if [[ ${KV_MINOR} -eq 6 && ${KV_PATCH} -lt 7 ]] ; then - echo - ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" - ewarn "This is not officially supported for ${P}. It is likely you" - ewarn "will not be able to compile or use the kernel module." - ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" - echo - ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." - fi - fi - - if ! use x86-fbsd; then - cd "${WORKDIR}" - bash "${DISTDIR}/${NV_PACKAGE}${PKG_V}.run" --extract-only - else - unpack ${A} - fi - - # Patches go below here, add brief description - use x86-fbsd \ - && cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/doc" \ - || cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}" - # Use the correct defines to make gtkglext build work - epatch "${FILESDIR}"/NVIDIA_glx-defines.patch - # Use some more sensible gl headers and make way for new glext.h - epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch - # allow on board sensors to work with lm_sensors - epatch "${FILESDIR}"/NVIDIA_i2c-hwmon.patch - kernel_is ge 2 6 25 && epatch "${FILESDIR}"/NVIDIA_kernel-96.43.05-2290218.diff - - if ! use x86-fbsd; then - # Quiet down warnings the user does not need to see - sed -i \ - -e 's:-Wpointer-arith::g' \ - -e 's:-Wsign-compare::g' \ - "${S}"/Makefile.kbuild - - # If you set this then it's your own fault when stuff breaks :) - [[ -n ${USE_CRAZY_OPTS} ]] && sed -i "s:-O:${CFLAGS}:" Makefile.* - - # If greater than 2.6.5 use M= instead of SUBDIR= - cd "${S}"; convert_to_m Makefile.kbuild - fi -} - -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. - if use x86-fbsd; then - cd "${WORKDIR}/${NV_PACKAGE}${PKG_V}/src" - echo LDFLAGS="$(raw-ldflags)" - MAKE="$(get_bmake)" emake CC="$(tc-getCC)" LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die - else - linux-mod_src_compile - fi -} - -src_install() { - local MLTEST=$(type dyn_unpack) - - cd "${WORKDIR}"/${NV_PACKAGE}${PKG_V} - - if ! use x86-fbsd; 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" ] || die "nvidia missing in FILESDIR" - sed -e 's:PACKAGE:'${PF}':g' \ - -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia > \ - "${WORKDIR}"/nvidia - insinto /etc/modules.d - doins "${WORKDIR}"/nvidia || die - else - insinto /boot/modules - doins "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.kld" || die - - exeinto /boot/modules - doexe "${WORKDIR}/${X86_FBSD_NV_PACKAGE}/src/nvidia.ko" || die - fi - - if [[ "${MLTEST/set_abi}" == "${MLTEST}" ]] && has_multilib_profile ; then - local OABI=${ABI} - for ABI in $(get_install_abis) ; do - src_install-libs - done - ABI=${OABI} - unset OABI - elif use amd64 ; then - src_install-libs lib32 $(get_multilibdir) - src_install-libs lib $(get_libdir) - - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/include - rm -rf "${D}"/usr/$(get_multilibdir)/opengl/nvidia/extensions - else - src_install-libs - fi - - is_final_abi || return 0 - - if ! use x86-fbsd; then - # Docs - newdoc usr/share/doc/README.txt README - dodoc usr/share/doc/Copyrights usr/share/doc/NVIDIA_Changelog - dodoc usr/share/doc/XF86Config.sample - dohtml usr/share/doc/html/* - - # nVidia want bug reports using this script - dobin usr/bin/nvidia-bug-report.sh || die - else - dodoc doc/{README,XF86Config.sample,Copyrights} - dohtml doc/html/* - fi - - # Taking nvidia-xconfig from nvidia-drivers to help config xorg.conf - dobin usr/bin/nvidia-xconfig || die -} - -# Install nvidia library: -# the first parameter is the place where to install it -# the second parameter is the base name of the library -# the third parameter is the provided soversion -donvidia() { - dodir $1 - exeinto $1 - - libname=$(basename $2) - - doexe $2.$3 - dosym ${libname}.$3 $1/${libname} - - [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 -} - -src_install-libs() { - local pkglibdir=lib - local inslibdir=$(get_libdir) - - if [[ ${#} -eq 2 ]] ; then - pkglibdir=${1} - inslibdir=${2} - elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then - pkglibdir=lib32 - fi - - local usrpkglibdir=usr/${pkglibdir} - local libdir=usr/X11R6/${pkglibdir} - local drvdir=${libdir}/modules/drivers - local extdir=${libdir}/modules/extensions - local incdir=usr/include/GL - local sover=${PV} - local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" - local NO_TLS_ROOT="${NV_ROOT}/no-tls" - local TLS_ROOT="${NV_ROOT}/tls" - local X11_LIB_DIR="/usr/${inslibdir}/xorg" - - if ! has_version x11-base/xorg-server ; then - X11_LIB_DIR="/usr/${inslibdir}" - fi - - if use x86-fbsd; then - # on FreeBSD everything is on obj/ - pkglibdir=obj - usrpkglibdir=obj - x11pkglibdir=obj - drvdir=obj - extdir=obj - - # don't ask me why the headers are there.. glxext.h is missing - incdir=doc - - # on FreeBSD it has just .1 suffix - sover=1 - fi - - # The GLX libraries - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover} - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover} - - donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libnvidia-cfg.so ${sover} - - dodir ${NO_TLS_ROOT} - donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover} - - if ! use x86-fbsd; then - donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover} - fi - - if want_tls ; then - dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - else - dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib - dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib - fi - - if ! use x86-fbsd; then - # Install the .la file for libtool, to prevent e.g. bug #176423 - [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" - local ver1=$(get_version_component_range 1) - local ver2=$(get_version_component_range 2) - local ver3=$(get_version_component_range 3) - sed -e "s:\${PV}:${PV}:" \ - -e "s:\${ver1}:${ver1}:" \ - -e "s:\${ver2}:${ver2}:" \ - -e "s:\${ver3}:${ver3}:" \ - -e "s:\${libdir}:${inslibdir}:" \ - "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la - fi - - exeinto ${X11_LIB_DIR}/modules/drivers - - [[ -f ${drvdir}/nvidia_drv.so ]] && \ - doexe ${drvdir}/nvidia_drv.so - - insinto /usr/${inslibdir} - [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \ - doins ${libdir}/libXvMCNVIDIA.a - exeinto /usr/${inslibdir} - # fix Bug 131315 - [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \ - doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \ - dosym libXvMCNVIDIA.so.${PV} \ - /usr/${inslibdir}/libXvMCNVIDIA.so - - exeinto ${NV_ROOT}/extensions - [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \ - newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so - [[ -f ${extdir}/libglx.so.${sover} ]] && \ - newexe ${extdir}/libglx.so.${sover} libglx.so - - # Includes - insinto ${NV_ROOT}/include - doins ${incdir}/*.h -} - -pkg_preinst() { - # Can we make up our minds ?!?!? - local NV_D=${D} - - if ! has_version x11-base/xorg-server ; then - for dir in lib lib32 lib64 ; do - if [[ -d "${NV_D}/usr/${dir}/xorg" ]] ; then - mv "${NV_D}/usr/${dir}"/xorg/* "${NV_D}/usr/${dir}" - rmdir "${NV_D}/usr/${dir}/xorg" - fi - done - 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() { - if ! use x86-fbsd; then - linux-mod_pkg_postinst - fi - - # Switch to the nvidia implementation - eselect opengl set --use-old nvidia - - echo - elog "To use the Nvidia GLX, run \"eselect opengl set nvidia\"" - elog - elog "nVidia has requested that any bug reports submitted have the" - elog "output of /usr/bin/nvidia-bug-report.sh included." - elog - elog "To work with compiz, you must enable the AddARGBGLXVisuals option." - elog - elog "If you are having resolution problems, try disabling DynamicTwinView." - echo -} - -want_tls() { - # For uclibc or anything non glibc, return false - has_version sys-libs/glibc || return 1 - - # Old versions of glibc were lt/no-tls only - has_version '<sys-libs/glibc-2.3.2' && return 1 - - local valid_chost="true" - if use x86 ; then - case ${CHOST/-*} in - i486|i586|i686) ;; - *) valid_chost="false" - esac - fi - - [[ ${valid_chost} == "false" ]] && return 1 - - # If we've got nptl, we've got tls - built_with_use --missing true sys-libs/glibc nptl && return 0 - - # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586 - if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then - case ${CHOST/-*} in - i486|i586) return 1 ;; - esac - fi - - # These versions built linuxthreads version to support tls, too - has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0 - - return 1 -} - -pkg_postrm() { - if ! use x86-fbsd; then - linux-mod_pkg_postrm - fi - eselect opengl set --use-old xorg-x11 -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.07.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.07.ebuild index 62c6fa989322..23548601b1b9 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.07.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.07.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.07.ebuild,v 1.2 2008/07/17 13:51:16 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.07.ebuild,v 1.3 2008/07/22 15:27:39 chainsaw Exp $ inherit eutils multilib versionator linux-mod flag-o-matic nvidia-driver @@ -15,7 +15,7 @@ SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_P LICENSE="NVIDIA" SLOT="0" -KEYWORDS="-* amd64 ~x86" +KEYWORDS="-* amd64 x86" IUSE="acpi gtk multilib" RESTRICT="strip" EMULTILIB_PKG="true" |