osdir.com
mailing list archive

Subject: Nvidia Binary driver on Macbook V3, second way - msg#00109

List: linux.ports.mactel.user

Date: Prev Next Index Thread: Prev Next Index
I made a second way to enable the nvidia binary driver
on the Macbook Pro V3. The attached patch is for
the nvidia binary kernel driver.

happy penguin

Edgar ( gimli ) Hucek
diff -uNr nv.orig/nv.c nv/nv.c
--- nv.orig/nv.c 2007-07-26 08:35:00.000000000 +0200
+++ nv/nv.c 2007-07-26 12:40:11.000000000 +0200
@@ -1555,6 +1555,39 @@

__nv_init_sp = sp;

+ {
+ for (i = 0; i < num_nv_devices; i++) {
+ printk("Macbook Hack\n");
+ struct pci_dev *dev = nv_linux_devices[i].dev;
+ #define NV_WR32(p,i,d) (__raw_writel((d), (void
__iomem *)(p) + (i)))
+
+ unsigned long mmio_start;
+ __u32 mmio_len;
+
+ mmio_start = pci_resource_start(dev, 0);
+ mmio_len = pci_resource_len(dev, 0);
+ volatile u32 __iomem *REGS;
+
+ REGS = ioremap(mmio_start, mmio_len);
+
+ if(REGS) {
+ NV_WR32(REGS, 0x1708, 0);
+ NV_WR32(REGS, 0x1900, 0);
+ NV_WR32(REGS, 0x1901, 0);
+ NV_WR32(REGS, 0x1902, 0);
+ NV_WR32(REGS, 0x1903, 0);
+ NV_WR32(REGS, 0x1904, 0);
+ NV_WR32(REGS, 0x1905, 0);
+ NV_WR32(REGS, 0x1906, 0);
+ NV_WR32(REGS, 0x1907, 0);
+
+ iounmap(REGS);
+ } else {
+ printk("Error mapping memory\n");
+ }
+ }
+ }
+
return 0;

failed:
-------------------------------------------------------------------------
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-devel mailing list
Mactel-linux-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel
Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Nvidia Binary driver on Macbook V3

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-devel mailing list Mactel-linux-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel

Next Message by Date: click to view message preview

Re: Still no Microphone

> I backported these changes to mactel SVN, so you can test the new pin > configs on 2.6.22, would be good if everyone could test them. > > Best regards, > > Nicolas Hi, tested it on a MBP C1D: * mic works (without swapping input source!) * PCM and Front are now used for volume change of the speaker, not PCM and Master anymore Regards, Michael ------------------------------------------------------------------------- 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/

Previous Message by Thread: click to view message preview

Nvidia Binary driver on Macbook V3

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-devel mailing list Mactel-linux-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel

Next Message by Thread: click to view message preview

Re: [Mactel-linux-devel] Nvidia Binary driver on Macbook V3, second way

So I guess that are great news. Does this mean you have a fully hardware accelerated X ? I will go and buy a rev3-one. On 7/26/07, gimli <gimli@xxxxxxxxxxxxxx> wrote: > I made a second way to enable the nvidia binary driver > on the Macbook Pro V3. The attached patch is for > the nvidia binary kernel driver. > > happy penguin > > Edgar ( gimli ) Hucek > > ------------------------------------------------------------------------- > 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-devel mailing list > Mactel-linux-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel > > > ------------------------------------------------------------------------- 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/
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by