Hi,

reading the nvnews.net forum i came to the following workaround to make the
nvidia binary drivers usable.
I took the latest cvs nvclock tool from http://sourceforge.net/projects/nvclock
Changed it to set some registers like the oss nv driver. As you can see in the
attached patch.
I just added "/usr/local/bin/nvclock -M" to my gdm init script and now i'm able
to use the nvidia driver.

happy penguin

Edgar ( gimli ) Hucek
diff -uNr nvclock/src/backend/info.c nvclock.macbook/src/backend/info.c
--- nvclock/src/backend/info.c	2007-07-22 12:24:23.000000000 +0200
+++ nvclock.macbook/src/backend/info.c	2007-07-26 09:09:19.000000000 +0200
@@ -25,6 +25,17 @@
 #include "backend.h"
 #include "nvclock.h"
 
+/* Macbook Pro Magic, this was taken from the nvidia xorg driver */
+/* This should be a temporary workaround until nvidia releases a new driver */
+void macbook_magic() {
+	int i;
+
+	nv_card->PMC[0x1708/4] = 0;
+	for(i = 0; i < 8;i++) {
+		nv_card->PMC[0x1900/4 + i] = 0;
+	}
+}
+
 /* This list isn't used much for the speed ranges anymore */
 /* Mainly mobile gpu speeds are missing */
 const static struct pci_ids ids[] =
diff -uNr nvclock/src/nvclock.c nvclock.macbook/src/nvclock.c
--- nvclock/src/nvclock.c	2007-05-26 21:45:19.000000000 +0200
+++ nvclock.macbook/src/nvclock.c	2007-07-26 08:22:43.000000000 +0200
@@ -56,6 +56,7 @@
 	{"Debug", 0, 0, 'D'},
 	{"help", 0, 0, 'h'},
 	{"version", 0, 0, 'v'},
+	{"macbook", 0, 0, 'M'},
 	{0, 0, 0, 0}
 };
 
@@ -90,6 +91,7 @@
 	printf("   -x  --xdisplay\t\tChoose another X display\n");
 #endif
 	printf("Other options:\n");
+	printf("   -M --macbook  \t\t\tMacbook Pro magic\n");
 	printf("   -h  --help\t\t\tShow this help info\n");
 	return 0;
 }
@@ -558,7 +560,7 @@
 {
 	int backend, card_number, deviceid, opt;
 	float memclk, nvclk;
-	short backend_opt, card_opt, debug_opt, fanspeed_opt, force_opt, deviceid_opt, reset_opt, smartdimmer_opt, speeds_opt, temp_opt;
+	short backend_opt, card_opt, debug_opt, fanspeed_opt, force_opt, deviceid_opt, reset_opt, smartdimmer_opt, speeds_opt, temp_opt, macbook_opt;
 	short assign_opt, info_opt, list_opt, query_opt;
 	short punit_opt, vunit_opt;
 	char *fanspeed = NULL;
@@ -585,6 +587,7 @@
 	smartdimmer_opt = 0;
 	temp_opt = 0;
 	vunit_opt = 0;
+	macbook_opt = 0;
 
 	backend = 0;
 	card_number = 0;
@@ -611,9 +614,9 @@
 
 /* We don't advertise the OpenGL options if we are building without X */
 #ifndef HAVE_NVCONTROL
-	while ( ( opt = getopt_long (argc, argv, "m:n:b:c:F:P:Q:S:V:fidDrsTh", long_options, NULL)) != -1 )
+	while ( ( opt = getopt_long (argc, argv, "m:n:b:c:F:P:Q:S:V:fidDrsTh:M", long_options, NULL)) != -1 )
 #else
-		while ( ( opt = getopt_long (argc, argv, "m:n:b:a:q:c:F:P:Q:S:V:x:lfidDrsTh", long_options, NULL)) != -1 )
+		while ( ( opt = getopt_long (argc, argv, "m:n:b:a:q:c:F:P:Q:S:V:x:lfidDrsTh:M", long_options, NULL)) != -1 )
 #endif
 	{
 		switch (opt)
@@ -779,6 +782,10 @@
 				usage();
 				break;
 
+			case 'M':
+				macbook_opt = 1;
+				break;
+
 			default:
 				return 0;
 		}
@@ -830,7 +837,7 @@
 #endif										  /* HAVE_NVCONTROL */
 
 	/* Quit if we don't have anything more to do */
-	if(!(backend_opt || debug_opt || deviceid_opt || fanspeed_opt || force_opt || info_opt || punit_opt || reset_opt || smartdimmer_opt || speeds_opt || temp_opt || vunit_opt || memclk || nvclk))
+	if(!(backend_opt || debug_opt || deviceid_opt || fanspeed_opt || force_opt || info_opt || punit_opt || reset_opt || smartdimmer_opt || speeds_opt || temp_opt || vunit_opt || memclk || nvclk || macbook_opt))
 		return 0;
 
 #ifdef HAVE_NVCONTROL
@@ -1343,6 +1350,12 @@
 		return 0;
 	}
 
+	if(macbook_opt)
+	{
+		extern void macbook_magic();
+		macbook_magic();
+	}
+
 	if(reset_opt)
 	{
 		if(nv_card->gpu == MOBILE && !force_opt)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mactel-linux-users mailing list
Mactel-linux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mactel-linux-users

Reply via email to