diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2008-05-29 14:44:30 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2008-05-29 14:44:30 +0000 |
commit | e621176759c399f17e4c743f3cb2edd4526a4449 (patch) | |
tree | 32c7ae83ab5a22ad72058c2f18bfe444c151da20 /x11-drivers | |
parent | Fixed python_mod_optimize. (diff) | |
download | historical-e621176759c399f17e4c743f3cb2edd4526a4449.tar.gz historical-e621176759c399f17e4c743f3cb2edd4526a4449.tar.bz2 historical-e621176759c399f17e4c743f3cb2edd4526a4449.zip |
Version bump. Supported release, upstream release highlights are at http://www.nvnews.net/vbulletin/showthread.php?t=113919.
Package-Manager: portage-2.1.5.2
Diffstat (limited to 'x11-drivers')
-rw-r--r-- | x11-drivers/nvidia-drivers/ChangeLog | 10 | ||||
-rw-r--r-- | x11-drivers/nvidia-drivers/Manifest | 13 | ||||
-rw-r--r-- | x11-drivers/nvidia-drivers/files/NVIDIA_kernel-173.14.05-2419292.diff | 624 | ||||
-rw-r--r-- | x11-drivers/nvidia-drivers/nvidia-drivers-173.14.05.ebuild | 513 |
4 files changed, 1155 insertions, 5 deletions
diff --git a/x11-drivers/nvidia-drivers/ChangeLog b/x11-drivers/nvidia-drivers/ChangeLog index 4b0a0cffc942..d5690e85b02a 100644 --- a/x11-drivers/nvidia-drivers/ChangeLog +++ b/x11-drivers/nvidia-drivers/ChangeLog @@ -1,6 +1,14 @@ # 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.98 2008/05/21 15:09:11 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/ChangeLog,v 1.99 2008/05/29 14:44:30 chainsaw Exp $ + +*nvidia-drivers-173.14.05 (28 May 2008) + + 28 May 2008; <chainsaw@gentoo.org> + +files/NVIDIA_kernel-173.14.05-2419292.diff, + +nvidia-drivers-173.14.05.ebuild: + Version bump. Supported release, upstream release highlights are at + http://www.nvnews.net/vbulletin/showthread.php?t=113919. 21 May 2008; <chainsaw@gentoo.org> +files/NVIDIA_kernel-71.86.04-2305230.diff, diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index b4f6588246c2..5009410c5611 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -8,6 +8,7 @@ AUX NVIDIA_glx-makefile.patch 602 RMD160 6c92e177c7a551ee43dc9bb0a58790d18497fef AUX NVIDIA_i2c-hwmon.patch 669 RMD160 812e7081d8f31116031edb0d8eb9c570b09caf89 SHA1 b0f132851cb1a7d8bdd9f205b4f187fcaf9e87d8 SHA256 0aaa05e1167bd722e00fcb90bd9853413ceb4ce3b00b308c314330f47c82f21a 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 @@ -20,6 +21,7 @@ DIST NVIDIA-FreeBSD-x86-100.14.23.tar.gz 11150297 RMD160 d6c3ac9d4dd812176169398 DIST NVIDIA-FreeBSD-x86-169.07.tar.gz 13751526 RMD160 d38d9081ac3d870788be4bbdee84f66c43d66c06 SHA1 56c3cb3f28ee26132faba6bde79b7b8fd8f002c2 SHA256 9eb417d164bfa6ee53f10227b23e6fae8270bd9890b9777495460c2bbe8e332d DIST NVIDIA-FreeBSD-x86-169.12.tar.gz 13862817 RMD160 bc600a8cb270d1ac0e51bd9ee836ca2ca5034ad6 SHA1 f75b54554a00fa3baba6e0ff3c59844830965e14 SHA256 a237da7664ddcfd2f68336765734ac84de2a2ce0f6535063534b3e6f32f0ac3b DIST NVIDIA-FreeBSD-x86-173.08.tar.gz 15735811 RMD160 44c9844105f2c29f725316d51d385fd025fb85ae SHA1 53b6e783c181c83f817cd3f7a794584875a6d074 SHA256 bf77023363065fe1ba090847d8bdcb37f5c0a984cd7ce28ec522594b30a74ba1 +DIST NVIDIA-FreeBSD-x86-173.14.05.tar.gz 15856727 RMD160 cc5f41ee785adadfcd0d3d689a9b477dfc49c848 SHA1 37871cb844b0b52d919886b351ae98e30e606dae SHA256 a8b1782656ee0faaa1e60f7f49a5d922c126785273de642deac3ae935dcc2556 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 @@ -30,6 +32,7 @@ DIST NVIDIA-Linux-x86-169.07-pkg0.run 10105925 RMD160 8cdf4f5b3cd90fdaf83fcd4213 DIST NVIDIA-Linux-x86-169.09-pkg0.run 10190968 RMD160 f89353a2e97939983183d66f7f698f3deaba99c9 SHA1 c516b580baceb730d855b7eacdebe2d6eb093363 SHA256 cd63f52d5d5346d8c1bf83c42f24042bcb1f2404b93aa4d2f9f4642bf5d21106 DIST NVIDIA-Linux-x86-169.12-pkg0.run 10190818 RMD160 9d22a0529bb7d0a4664c3068f6c19e4546fb3173 SHA1 0cf75b9f01d28b11fbd63d1606a8dcec138f1d66 SHA256 bc2768c46d4f8caae60ba30ed1d6907247c083619e3f57ae71f0a26c84357545 DIST NVIDIA-Linux-x86-173.08-pkg0.run 11489268 RMD160 e82578df8fdf08d615e6c03d9b2f41730e694358 SHA1 319cb2d6a82249922b42c187ad6f0e25b5691a0b SHA256 931dadcf7aacdb6378f03d5bb25b9a133e9f6119774bde27bfd11456acc5eb8d +DIST NVIDIA-Linux-x86-173.14.05-pkg0.run 11552082 RMD160 2d322a9969e59733725c6c748976eec9360ff6ef SHA1 5a9238ef276813ac71b4c3be6689e8e45b27b436 SHA256 2b1aa7b4dc1388d64dbeca8d7362b647cb6adf47c0a5020af46d2fc46b3509da 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-96.43.01-pkg0.run 6597242 RMD160 0a698d55925d5e44a01b5a5089b228dacfcb0af2 SHA1 02ce7a76d9ac1df5f9ec5b805ebdbd13eb42c4aa SHA256 777bb1b7eb5ea1ead80c31e516615e44ba198ff782da4df3bead3c31db4de8ba @@ -42,6 +45,7 @@ DIST NVIDIA-Linux-x86_64-169.07-pkg2.run 15426910 RMD160 df77e0b527998364c9ba603 DIST NVIDIA-Linux-x86_64-169.09-pkg2.run 15629147 RMD160 f16fba6ffcbd99a515054dba380328ea48c6d457 SHA1 18ff8301461bd496e7305052aea5f7f652b15e76 SHA256 2bc39df072453e0ca5275570aebdd8c12e71d2eb8de1c07312ef87b5eff8973b DIST NVIDIA-Linux-x86_64-169.12-pkg2.run 15628910 RMD160 f9022317be683dce17d622210de050354ecce9ac SHA1 62f9e1055ce6cd4d7806757ece0a144695ef12ff SHA256 8ef5a78d6be3bcc3d2f99e6ba1ff52d46a9aa5692657b115e0aafdf115e050bb DIST NVIDIA-Linux-x86_64-173.08-pkg2.run 17930205 RMD160 25b9d94f7a94a2e4ea5885f5717453454958d914 SHA1 09726ccfde1d2e543659be7464e5f0e45154def6 SHA256 d5bd59993971afe334e47704b43a057355b59104da6c522eca935da8b894bdf0 +DIST NVIDIA-Linux-x86_64-173.14.05-pkg2.run 17959744 RMD160 ad603536e99ee232fb95bf916d9aa54c9738ef26 SHA1 5912aa5b481e2b94641e1751e9153e1b11e369e4 SHA256 3ee8aabc824fac1d5c917979aca288ad600da0d0bd34001f9c5f0c0254b1af36 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-96.43.01-pkg2.run 10245900 RMD160 02b5ef36ae55a5901ada43c5cffca36128d652ba SHA1 d0dc8d61c32631eb397a8348630eadbae2744e96 SHA256 187d40c0bbcceba5c78f9f49ebb526989a7670bcfd7f5f38f2201fba29c98bbf @@ -55,16 +59,17 @@ EBUILD nvidia-drivers-169.09-r1.ebuild 14794 RMD160 9152c4cc2e70f91e01c25d36dbfd EBUILD nvidia-drivers-169.09.ebuild 13501 RMD160 7e6d779d8db3d5988b79ddd2da44a9586893f401 SHA1 d59cee3a96fe64c5e9040351a9f6d16420b6b4d8 SHA256 f46eb4b931c87b1915361d82d92814c0a91296f2b74cf56d1a1ef0d765dbc635 EBUILD nvidia-drivers-169.12.ebuild 14974 RMD160 8345f5c357173d953fc94a156b5b01bb6ccced19 SHA1 2779da36fae81d682a3c1189c6a84e03963387cc SHA256 00409c9adadb8485e57b46fc31b1d24c2655b07be522799615d751424aefb82e EBUILD nvidia-drivers-173.08.ebuild 14966 RMD160 241b3c667fb22575f0705b7464bd411555b87235 SHA1 404dbc982378bb027f71ba6a9b870d7f23567a7f SHA256 dcc90354d0cf9eb8e4573906506b59fc356537a23c58ab9a2adb4a3dfc5375fa +EBUILD nvidia-drivers-173.14.05.ebuild 15089 RMD160 14ac3ee3a884b3314f3e8482d3fab47beec4b2a8 SHA1 526db4a7e7f6bd9272d7a12ad8cdf39660ce4be2 SHA256 adf871196301e1490a6f456526a6b34bd9be69e097e30c2242faea9f3c241132 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-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 -MISC ChangeLog 21060 RMD160 f9b5ded726255edecbd30be48d4ebe64c6e7c84e SHA1 902f99a1fc9163c4e39fe56d6fcf3aaef984a91a SHA256 0643101b4c6affd1553009b22ddfd785a028390473eff8622ad4668a36570c14 +MISC ChangeLog 21351 RMD160 a5c9a457cb4528ff4e3257deddbd4befbeb8a46e SHA1 4a8d03a637dcf12cbf20bd1d33655224b67e9aae SHA256 8aa9a02862a26827c6d4512f65de5c078d07db5144d5b971da209f1c18a18f22 MISC metadata.xml 292 RMD160 f5979fce13f28cf69ea0ce27655361d3a399d73e SHA1 f98b700a2945e5b0a256b0aad118b7e08880c4a8 SHA256 9e76022e1a4ab0c738f94b9109e4f509f1a416dc63b71e03e1f0735c82ca9fb4 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) -iEYEARECAAYFAkg0OvgACgkQp5vW4rUFj5q1uwCeJG3a3iaaOsUazm8EMzEBwy+l -X/kAn2ZR7Edm6mRL86XiLryTyGLOkq+c -=gkbA +iEYEARECAAYFAkg+wS0ACgkQp5vW4rUFj5oBVwCcC7DVMmfOlKqmDxm+G8uhIBn5 +baAAoMG2fphtBBEbMlQEiVxARNVSB6vI +=HMnd -----END PGP SIGNATURE----- diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-173.14.05-2419292.diff b/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-173.14.05-2419292.diff new file mode 100644 index 000000000000..1c10533f234f --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/NVIDIA_kernel-173.14.05-2419292.diff @@ -0,0 +1,624 @@ +diff -ru usr/src/nv/Makefile.kbuild usr/src/nv.2419292/Makefile.kbuild +--- usr/src/nv/Makefile.kbuild 2008-05-19 00:37:02.000000000 -0700 ++++ usr/src/nv.2419292/Makefile.kbuild 2008-05-21 12:07:57.551201274 -0700 +@@ -166,10 +166,6 @@ + CFLAGS += -DNV_MAP_REGISTERS_EARLY + endif + +-ifeq ($(shell echo $(NV_BUILD_NV_PAT_SUPPORT)),1) +-CFLAGS += -DNV_BUILD_NV_PAT_SUPPORT +-endif +- + ifneq ($(PATCHLEVEL), 4) + COMPILE_TESTS = \ + remap_page_range \ +diff -ru usr/src/nv/Makefile.nvidia usr/src/nv.2419292/Makefile.nvidia +--- usr/src/nv/Makefile.nvidia 2008-05-19 00:37:02.000000000 -0700 ++++ usr/src/nv.2419292/Makefile.nvidia 2008-05-21 12:08:08.771840702 -0700 +@@ -56,10 +56,6 @@ + CFLAGS += -DNV_MAP_REGISTERS_EARLY + endif + +-ifeq ($(shell echo $(NV_BUILD_NV_PAT_SUPPORT)),1) +-CFLAGS += -DNV_BUILD_NV_PAT_SUPPORT +-endif +- + INCLUDES += -I$(KERNEL_HEADERS) + + COMPILE_TESTS = \ +diff -ru usr/src/nv/nv-linux.h usr/src/nv.2419292/nv-linux.h +--- usr/src/nv/nv-linux.h 2008-05-19 00:37:01.000000000 -0700 ++++ usr/src/nv.2419292/nv-linux.h 2008-05-21 12:07:19.741046595 -0700 +@@ -145,16 +145,19 @@ + #endif + + #if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) && !defined(CONFIG_XEN) +-#define NV_BUILD_NV_PAT_SUPPORT 1 ++#define NV_ENABLE_PAT_SUPPORT + #endif + +-#if defined(NV_BUILD_NV_PAT_SUPPORT) +-#include "pat.h" ++#define NV_PAT_MODE_DISABLED 0 ++#define NV_PAT_MODE_KERNEL 1 ++#define NV_PAT_MODE_BUILTIN 2 ++ ++extern int nv_pat_mode; ++ + #if defined(CONFIG_HOTPLUG_CPU) + #include <linux/cpu.h> /* CPU hotplug support */ + #include <linux/notifier.h> /* struct notifier_block, etc */ + #endif +-#endif + + #if (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) + #include <linux/i2c.h> +@@ -681,6 +684,13 @@ + #define nv_down(lock) down(&lock) + #define nv_up(lock) up(&lock) + ++#define NV_INIT_MUTEX(mutex) \ ++ { \ ++ struct semaphore __mutex = \ ++ __SEMAPHORE_INITIALIZER(*(mutex), 1); \ ++ *(mutex) = __mutex; \ ++ } ++ + #if defined (KERNEL_2_4) + # define NV_IS_SUSER() suser() + # define NV_PCI_DEVICE_NAME(dev) ((dev)->name) +@@ -1029,20 +1039,6 @@ + return new_prot; + } + #endif +- +-#if defined(NV_BUILD_NV_PAT_SUPPORT) && !defined (pgprot_writecombined) +-static inline pgprot_t pgprot_writecombined(pgprot_t old_prot) +- { +- pgprot_t new_prot = old_prot; +- if (boot_cpu_data.x86 > 3) +- { +- pgprot_val(old_prot) &= ~(_PAGE_PCD | _PAGE_PWT); +- new_prot = __pgprot(pgprot_val(old_prot) | _PAGE_WRTCOMB); +- } +- return new_prot; +- } +-#endif +- + #endif /* defined(NVCPU_X86) || defined(NVCPU_X86_64) */ + + #if defined(KERNEL_2_4) && defined(NVCPU_X86) && !defined(pfn_to_page) +@@ -1142,8 +1138,6 @@ + struct semaphore at_lock; + } nv_linux_state_t; + +-extern int nv_pat_enabled; +- + #if defined(NV_LINUX_ACPI_EVENTS_SUPPORTED) + /* + * acpi data storage structure +diff -ru usr/src/nv/nv-reg.h usr/src/nv.2419292/nv-reg.h +--- usr/src/nv/nv-reg.h 2008-05-19 00:37:01.000000000 -0700 ++++ usr/src/nv.2419292/nv-reg.h 2008-05-21 12:07:23.313250167 -0700 +@@ -471,6 +471,37 @@ + #define __NV_RM_EDGE_INTR_CHECK RMEdgeIntrCheck + #define NV_REG_RM_EDGE_INTR_CHECK NV_REG_STRING(__NV_RM_EDGE_INTR_CHECK) + ++/* ++ * Option: UsePageAttributeTable ++ * ++ * Description: ++ * ++ * Enable/disable use of the page attribute table (PAT) available in ++ * modern x86/x86-64 processors to set the effective memory type of memory ++ * mappings to write-combining (WC). If disabled, the driver will fall ++ * back to using MTRRs, if possible. ++ * ++ * If enabled, an x86 processor with PAT support is present and the host ++ * system's Linux kernel did not configure one of the PAT entries to ++ * indicate the WC memory type, the driver will change the second entry in ++ * the PAT from its default (write-through (WT)) to WC at module load ++ * time. If the kernel did update one of the PAT entries, the driver will ++ * not modify the PAT. ++ * ++ * In both cases, the driver will honor attempts to map memory with the WC ++ * memory type by selecting the appropriate PAT entry using the correct ++ * set of PTE flags. ++ * ++ * Possible values: ++ * ++ * ~0 = use the NVIDIA driver's default logic (default) ++ * 1 = enable use of the PAT for WC mappings. ++ * 0 = disable use of the PAT for WC mappings. ++ */ ++ ++#define __NV_USE_PAGE_ATTRIBUTE_TABLE UsePageAttributeTable ++#define NV_USE_PAGE_ATTRIBUTE_TABLE NV_REG_STRING(__NV_USE_PAGE_ATTRIBUTE_TABLE) ++ + + + #if defined(NV_DEFINE_REGISTRY_KEY_TABLE) +@@ -495,6 +526,7 @@ + NV_DEFINE_REG_ENTRY(__NV_UPDATE_MEMORY_TYPES, ~0); + NV_DEFINE_REG_ENTRY(__NV_USE_VBIOS, 1); + NV_DEFINE_REG_ENTRY(__NV_RM_EDGE_INTR_CHECK, 1); ++NV_DEFINE_REG_ENTRY(__NV_USE_PAGE_ATTRIBUTE_TABLE, ~0); + + #if defined(NV_LINUX) + NV_DEFINE_REG_STRING_ENTRY(__NV_REGISTRY_DWORDS, NULL); +@@ -540,6 +572,7 @@ + NV_DEFINE_PARAMS_TABLE_ENTRY(__NV_UPDATE_MEMORY_TYPES), + NV_DEFINE_PARAMS_TABLE_ENTRY(__NV_USE_VBIOS), + NV_DEFINE_PARAMS_TABLE_ENTRY(__NV_RM_EDGE_INTR_CHECK), ++ NV_DEFINE_PARAMS_TABLE_ENTRY(__NV_USE_PAGE_ATTRIBUTE_TABLE), + {NULL, NULL, NULL} + }; + +diff -ru usr/src/nv/nv.c usr/src/nv.2419292/nv.c +--- usr/src/nv/nv.c 2008-05-19 00:37:01.000000000 -0700 ++++ usr/src/nv.2419292/nv.c 2008-05-21 12:07:28.313535114 -0700 +@@ -22,10 +22,9 @@ + #endif + + #if defined(KERNEL_2_4) && (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) +-// weak linking? + extern int i2c_add_adapter (struct i2c_adapter *) __attribute__ ((weak)); + extern int i2c_del_adapter (struct i2c_adapter *) __attribute__ ((weak)); +-#endif // defined(KERNEL_2_4) && (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) ++#endif + + /* + * our global state; one per device +@@ -41,14 +40,7 @@ + static struct pm_dev *apm_nv_dev[NV_MAX_DEVICES] = { 0 }; + #endif + +-int nv_pat_enabled = 0; +- +-#if !defined(NV_BUILD_NV_PAT_SUPPORT) +-static int nv_disable_pat = 1; +-#else +-static int nv_disable_pat = 0; +-NV_MODULE_PARAMETER(nv_disable_pat); +-#endif ++int nv_pat_mode = NV_PAT_MODE_DISABLED; + + #if defined(NVCPU_X86) || defined(NVCPU_X86_64) + NvU64 __nv_supported_pte_mask = ~_PAGE_NX; +@@ -611,7 +603,7 @@ + nv_state_t *nv; + nv_linux_state_t *nvl; + +- proc_nvidia = create_proc_entry("nvidia", d_flags, proc_root_driver); ++ proc_nvidia = create_proc_entry("driver/nvidia", d_flags, NULL); + if (!proc_nvidia) + goto failed; + +@@ -863,18 +855,20 @@ + static int __nv_enable_pat_support (void); + static void __nv_disable_pat_support (void); + +-#if defined(NV_BUILD_NV_PAT_SUPPORT) ++#if defined(NV_ENABLE_PAT_SUPPORT) + /* +- * Private PAT support for use by the NVIDIA driver. This is an +- * interim solution until the kernel offers PAT support. ++ * Private PAT support for use by the NVIDIA driver. This is used on ++ * kernels that do not modify the PAT to include a write-combining ++ * entry. + */ +-static int __check_pat_support (void); ++static int __determine_pat_mode (void); + static void __nv_setup_pat_entries (void *); + static void __nv_restore_pat_entries (void *); + +-#define NV_READ_PAT_ENTRIES(pat1, pat2) rdmsr(IA32_CR_PAT, (pat1), (pat2)) +-#define NV_WRITE_PAT_ENTRIES(pat1, pat2) wrmsr(IA32_CR_PAT, (pat1), (pat2)) +-#define NV_PAT_ENTRY(pat, index) (((pat) & (0xff<<((index)*8)))>>((index)*8)) ++#define NV_READ_PAT_ENTRIES(pat1, pat2) rdmsr(0x277, (pat1), (pat2)) ++#define NV_WRITE_PAT_ENTRIES(pat1, pat2) wrmsr(0x277, (pat1), (pat2)) ++#define NV_PAT_ENTRY(pat, index) \ ++ (((pat) & (0xff << ((index)*8))) >> ((index)*8)) + + static inline void __nv_disable_caches(unsigned long *cr4) + { +@@ -895,39 +889,47 @@ + if (cr4 & 0x80) write_cr4(cr4); + } + +-static int __check_pat_support() ++static int __determine_pat_mode() + { + unsigned int pat1, pat2, i; ++ U008 PAT_WC_index; + +- if (!test_bit(X86_FEATURE_PAT, (volatile unsigned long *)&boot_cpu_data.x86_capability)) ++ if (!test_bit(X86_FEATURE_PAT, ++ (volatile unsigned long *)&boot_cpu_data.x86_capability)) + { + nv_printf(NV_DBG_ERRORS, + "NVRM: CPU does not support the PAT, falling back to MTRRs.\n"); +- return 0; ++ return NV_PAT_MODE_DISABLED; + } + + NV_READ_PAT_ENTRIES(pat1, pat2); ++ PAT_WC_index = 0xf; + + for (i = 0; i < 4; i++) + { +- // we plan to mark PAT entry 1 as WC. if it's already marked such, +- // that's fine, since it would be no different than us setting it. +- 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; +- } +- +- if (NV_PAT_ENTRY(pat2, i) == 1) +- { +- nv_printf(NV_DBG_ERRORS, "NVRM: PAT index %d already configured for Write-Combining!\n", i + 4); +- nv_printf(NV_DBG_ERRORS, "NVRM: Aborting, due to PAT already being configured\n"); +- return 0; +- } ++ if (NV_PAT_ENTRY(pat1, i) == 0x01) ++ { ++ PAT_WC_index = i; ++ break; ++ } ++ ++ if (NV_PAT_ENTRY(pat2, i) == 0x01) ++ { ++ PAT_WC_index = (i + 4); ++ break; ++ } + } + +- return 1; ++ if (PAT_WC_index == 1) ++ return NV_PAT_MODE_KERNEL; ++ else if (PAT_WC_index != 0xf) ++ { ++ nv_printf(NV_DBG_ERRORS, ++ "NVRM: PAT configuration unsupported, falling back to MTRRs.\n"); ++ return NV_PAT_MODE_DISABLED; ++ } ++ else ++ return NV_PAT_MODE_BUILTIN; + } + + static unsigned long orig_pat1, orig_pat2; +@@ -978,19 +980,30 @@ + __nv_enable_caches(cr4); + NV_RESTORE_FLAGS(eflags); + } +- +-#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ ++#endif + + static int __nv_enable_pat_support() + { +-#if defined(NV_BUILD_NV_PAT_SUPPORT) ++#if defined(NV_ENABLE_PAT_SUPPORT) + unsigned long pat1, pat2; + +- if (nv_pat_enabled) ++ if (nv_pat_mode != NV_PAT_MODE_DISABLED) + return 1; + +- if (!__check_pat_support()) +- return 0; ++ nv_pat_mode = __determine_pat_mode(); ++ ++ switch (nv_pat_mode) ++ { ++ case NV_PAT_MODE_DISABLED: ++ /* avoid the PAT if unavailable/unusable */ ++ return 0; ++ case NV_PAT_MODE_KERNEL: ++ /* inherit the kernel's PAT layout */ ++ return 1; ++ case NV_PAT_MODE_BUILTIN: ++ /* use builtin code to modify the PAT layout */ ++ break; ++ } + + NV_READ_PAT_ENTRIES(orig_pat1, orig_pat2); + nv_printf(NV_DBG_SETUP, "saved orig pats as 0x%lx 0x%lx\n", orig_pat1, orig_pat2); +@@ -1001,31 +1014,28 @@ + return 0; + } + +- nv_pat_enabled = 1; +- + NV_READ_PAT_ENTRIES(pat1, pat2); + nv_printf(NV_DBG_SETUP, "changed pats to 0x%lx 0x%lx\n", pat1, pat2); +-#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ +- ++#endif + return 1; + } + + static void __nv_disable_pat_support() + { +-#if defined(NV_BUILD_NV_PAT_SUPPORT) ++#if defined(NV_ENABLE_PAT_SUPPORT) + unsigned long pat1, pat2; + +- if (!nv_pat_enabled) ++ if (nv_pat_mode != NV_PAT_MODE_BUILTIN) + return; + + if (nv_execute_on_all_cpus(__nv_restore_pat_entries, NULL) != 0) + return; + +- nv_pat_enabled = 0; ++ nv_pat_mode = NV_PAT_MODE_DISABLED; + + NV_READ_PAT_ENTRIES(pat1, pat2); + nv_printf(NV_DBG_SETUP, "restored orig pats as 0x%lx 0x%lx\n", pat1, pat2); +-#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */ ++#endif + } + + #if defined(NV_CHANGE_PAGE_ATTR_BUG_PRESENT) +@@ -1273,7 +1283,7 @@ + #endif + } + +-#if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) ++#if defined(NV_ENABLE_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) + static int + nv_kern_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) + { +@@ -1305,8 +1315,7 @@ + .notifier_call = nv_kern_cpu_callback, + .priority = 0 + }; +- +-#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) */ ++#endif + + + /*** +@@ -1315,7 +1324,7 @@ + + static int __init nvidia_init_module(void) + { +- int rc; ++ int rc, disable_pat = 0; + U032 i, count, data; + nv_state_t *nv = NV_STATE_PTR(&nv_ctl_device); + nv_stack_t *sp = NULL; +@@ -1443,18 +1452,6 @@ + nv_printf(NV_DBG_ERRORS, "NVRM: pte cache allocation failed\n"); + goto failed; + } +- +-#if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) +- if (!nv_disable_pat) +- { +- if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0) +- { +- rc = -EIO; +- nv_printf(NV_DBG_ERRORS, "NVRM: CPU hotplug notifier registration failed!\n"); +- goto failed; +- } +- } +-#endif + + #if defined(NV_SG_MAP_BUFFERS) + rm_read_registry_dword(sp, nv, "NVreg", "RemapLimit", &nv_remap_limit); +@@ -1532,8 +1529,30 @@ + + nvos_proc_add_warning_file("README", __README_warning); + +- if (!nv_disable_pat) ++ rc = rm_read_registry_dword(sp, nv, ++ "NVreg", NV_USE_PAGE_ATTRIBUTE_TABLE, &data); ++ if ((rc == 0) && ((int)data != ~0)) ++ { ++ disable_pat = (data == 0); ++ } ++ ++ if (!disable_pat) ++ { + __nv_enable_pat_support(); ++#if defined(NV_ENABLE_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) ++ if (nv_pat_mode == NV_PAT_MODE_BUILTIN) ++ { ++ if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0) ++ { ++ __nv_disable_pat_support(); ++ rc = -EIO; ++ nv_printf(NV_DBG_ERRORS, ++ "NVRM: CPU hotplug notifier registration failed!\n"); ++ goto failed; ++ } ++ } ++#endif ++ } + else + { + nv_printf(NV_DBG_ERRORS, +@@ -1686,10 +1705,10 @@ + rm_unregister_compatible_ioctls(sp); + #endif + +- if (nv_pat_enabled) ++ if (nv_pat_mode == NV_PAT_MODE_BUILTIN) + { + __nv_disable_pat_support(); +-#if defined(NV_BUILD_NV_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) ++#if defined(NV_ENABLE_PAT_SUPPORT) && defined(CONFIG_HOTPLUG_CPU) + unregister_hotcpu_notifier(&nv_hotcpu_nfb); + #endif + } +@@ -1825,6 +1844,8 @@ + } + } + ++#if !defined(NV_VM_INSERT_PAGE_PRESENT) ++static + struct page *nv_kern_vma_nopage( + struct vm_area_struct *vma, + unsigned long address, +@@ -1835,22 +1856,21 @@ + #endif + ) + { +-#if !defined(NV_VM_INSERT_PAGE_PRESENT) + struct page *page; + + page = pfn_to_page(vma->vm_pgoff); + get_page(page); + + return page; +-#else +- return NOPAGE_SIGBUS; +-#endif + } ++#endif + + struct vm_operations_struct nv_vm_ops = { + .open = nv_kern_vma_open, + .close = nv_kern_vma_release, /* "close" */ ++#if !defined(NV_VM_INSERT_PAGE_PRESENT) + .nopage = nv_kern_vma_nopage, ++#endif + }; + + static nv_file_private_t * +@@ -1864,7 +1884,7 @@ + + memset(nvfp, 0, sizeof(nv_file_private_t)); + +- sema_init(&nvfp->sp_lock, 1); ++ NV_INIT_MUTEX(&nvfp->sp_lock); + + // initialize this file's event queue + init_waitqueue_head(&nvfp->waitqueue); +@@ -2214,11 +2234,12 @@ + break; + #if defined(NVCPU_X86) || defined(NVCPU_X86_64) + case NV_MEMORY_WRITECOMBINED: +-#if defined(NV_BUILD_NV_PAT_SUPPORT) +- if (nv_pat_enabled && +- (memory_type != NV_MEMORY_TYPE_REGISTERS)) ++#if defined(NV_ENABLE_PAT_SUPPORT) ++ if ((nv_pat_mode != NV_PAT_MODE_DISABLED) && ++ (memory_type != NV_MEMORY_TYPE_REGISTERS)) + { +- *prot = pgprot_writecombined(*prot); ++ pgprot_val(*prot) &= ~(_PAGE_PSE | _PAGE_PCD | _PAGE_PWT); ++ *prot = __pgprot(pgprot_val(*prot) | _PAGE_PWT); + break; + } + #endif +@@ -2242,7 +2263,6 @@ + return 1; + #endif + case NV_MEMORY_CACHED: +- //case NV_MEMORY_WRITEBACK: + #if !defined(NVCPU_X86) && !defined(NVCPU_X86_64) + if (memory_type != NV_MEMORY_TYPE_REGISTERS) + break; +@@ -2264,8 +2284,6 @@ + if (memory_type == NV_MEMORY_TYPE_SYSTEM) + break; + #endif +- //case NV_MEMORY_WRITETHRU: +- //case NV_MEMORY_WRITEPROTECT: + default: + if(nv_ext_encode_caching(prot, cache_type, memory_type) == 0) + return 0; +@@ -3502,6 +3520,10 @@ + BOOL kern + ) + { ++#if defined(NV_SET_PAGES_UC_PRESENT) && defined(NVCPU_X86) ++ nv_printf(NV_DBG_ERRORS, ++ "NVRM: can't translate address in nv_get_phys_address()!\n"); ++#else + struct mm_struct *mm; + pgd_t *pgd = NULL; + pmd_t *pmd = NULL; +@@ -3514,15 +3536,7 @@ + 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)) +@@ -3550,6 +3564,7 @@ + failed: + if (!kern) + up_read(&mm->mmap_sem); ++#endif + return 0; + } + +@@ -3790,8 +3805,9 @@ + + nv_init_lock(nvl->rm_lock); + +- sema_init(&nvl->ldata_lock, 1); +- sema_init(&nvl->at_lock, 1); ++ NV_INIT_MUTEX(&nvl->ldata_lock); ++ NV_INIT_MUTEX(&nvl->at_lock); ++ + NV_ATOMIC_SET(nvl->usage_count, 0); + + nvl->rm_lock_cpu = -1; +diff -ru usr/src/nv/os-agp.c usr/src/nv.2419292/os-agp.c +--- usr/src/nv/os-agp.c 2008-05-19 00:37:01.000000000 -0700 ++++ usr/src/nv.2419292/os-agp.c 2008-05-21 12:07:30.437656163 -0700 +@@ -115,7 +115,7 @@ + goto release; + } + +- if (!nv_pat_enabled) ++ if (nv_pat_mode == NV_PAT_MODE_DISABLED) + { + #ifdef CONFIG_MTRR + /* +@@ -175,7 +175,7 @@ + + failed: + #ifdef CONFIG_MTRR +- if (!nv_pat_enabled) ++ if (nv_pat_mode == NV_PAT_MODE_DISABLED) + mtrr_del(-1, agp_info.aper_base, agp_info.aper_size << 20); + #endif + release: +@@ -205,7 +205,7 @@ + nvl = NV_GET_NVL_FROM_NV_STATE(nv); + + #ifdef CONFIG_MTRR +- if (!nv_pat_enabled) ++ if (nv_pat_mode == NV_PAT_MODE_DISABLED) + mtrr_del(-1, nv->agp.address, nv->agp.size); + #endif + +diff -ru usr/src/nv/os-interface.c usr/src/nv.2419292/os-interface.c +--- usr/src/nv/os-interface.c 2008-05-19 00:37:01.000000000 -0700 ++++ usr/src/nv.2419292/os-interface.c 2008-05-21 12:07:33.365823028 -0700 +@@ -1355,7 +1355,7 @@ + + BOOL NV_API_CALL os_pat_supported(void) + { +- return nv_pat_enabled; ++ return (nv_pat_mode != NV_PAT_MODE_DISABLED); + } + + void NV_API_CALL os_dump_stack() diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.05.ebuild new file mode 100644 index 000000000000..def807b0183b --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.05.ebuild @@ -0,0 +1,513 @@ +# 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-173.14.05.ebuild,v 1.1 2008/05/29 14:44:30 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 custom-cflags gtk multilib kernel_linux" +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/libXvMCNVIDIA.so.${PV} + usr/lib/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/tls/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-cfg.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libcuda.so.${PV}" + +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.1 + 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_TEXTRELS_amd64="usr/lib32/opengl/nvidia/tls/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-cfg.so.${PV} + usr/lib32/libcuda.so.${PV}" + +QA_EXECSTACK_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_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + 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/bin/nvidia-xconfig" + +QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so" + +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}" + +mtrr_check() { + ebegin "Checking for MTRR support" + linux_chkconfig_present MTRR + eend $? + + if [[ $? -ne 0 ]] ; then + 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 +} + +paravirt_check() { + ebegin "Checking for Paravirtualized guest support" + linux_chkconfig_present PARAVIRT + + if [[ $? -eq 0 ]]; then + eerror "Please disable PARAVIRT in your kernel config, found at:" + eerror + eerror " Processor type and features" + eerror " [*] Paravirtualized guest support" + eerror + eerror "or XEN support" + eerror + eerror "and recompile your kernel .." + die "PARAVIRT support detected!" + fi +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/usr/src/nv)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} HOST_CC=$(tc-getBUILD_CC)" + mtrr_check + paravirt_check + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # 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 + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_SRC="${S}/src" + elif use kernel_linux; then + NV_DOC="${S}/usr/share/doc" + NV_EXEC="${S}/usr/bin" + NV_SRC="${S}/usr/src/nv" + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if use kernel_linux && kernel_is lt 2 6 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 + + 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 + cd "${S}" + use x86-fbsd && cd doc + + # 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 + if use kernel_linux; then + epatch "${FILESDIR}"/NVIDIA_i2c-hwmon.patch + + kernel_is ge 2 6 26 && epatch "${FILESDIR}"/NVIDIA_kernel-173.14.05-2419292.diff + fi + + if use kernel_linux; then + # Quiet down warnings the user does not need to see + sed -i \ + -e 's:-Wpointer-arith::g' \ + -e 's:-Wsign-compare::g' \ + "${NV_SRC}"/Makefile.kbuild + + # If you set this then it's your own fault when stuff breaks :) + use custom-cflags && sed -i "s:-O:${CFLAGS}:" Makefile.* + + # If greater than 2.6.5 use M= instead of SUBDIR= + convert_to_m "${NV_SRC}"/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. + + cd "${NV_SRC}" + if use x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + elif use kernel_linux; then + linux-mod_src_compile + fi +} + +src_install() { + local MLTEST=$(type dyn_unpack) + + cd "${S}" + + if use kernel_linux; then + linux-mod_src_install + + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + doins "${WORKDIR}"/nvidia || die + elif use x86-fbsd; then + insinto /boot/modules + doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die + + exeinto /boot/modules + doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko" || die + fi + + if 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 + + # Documentation + dodoc "${NV_DOC}"/{XF86Config.sample,Copyrights} + dohtml "${NV_DOC}"/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || 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) + + # libnvidia-cfg.so is no longer supplied in lib32; step over it gracefully + if [ -e $2.$3 ] ; then + doexe $2.$3 + dosym ${libname}.$3 $1/${libname} + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 + fi +} + +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 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 + + #cuda + if [[ -f usr/include/cuda/cuda.h ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h + + dolib.so usr/${pkglibdir}/libcuda.so.${PV} + dosym libcuda.so.${PV} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi +} + +pkg_preinst() { + + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + if use kernel_linux; then + linux-mod_pkg_postinst + fi + + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + echo + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + + elog "This ebuild installs a kernel module and X driver. Both must" + elog "match explicitly in their version. This means, if you restart" + elog "X, you most modprobe -r nvidia before starting it back up" + elog + + 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 + + if use x86 ; then + case ${CHOST/-*} in + i486|i586|i686) ;; + *) return 1 ;; + esac + fi + + # 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 kernel_linux; then + linux-mod_pkg_postrm + fi + eselect opengl set --use-old xorg-x11 +} |