Skip to contentSkip to conversation

Brightness control for MacBook Pro - Nvidia 9400

DISCUSSION Soeren Sonnenburg 3 participants 10 messages Feb 11, 2010 – Feb 12, 2010

lore
Share & tools
lore
#0 lore raw

Dear all,

I am booting a MacBookPro5,3 using elilo and efifb. Now I'd like to use pommed to control display brightness (which won't work). Digging around in mbp_nvidia_bl.c I figured out that tries to control the geforce 9600M instead of the currently active geforece 9400m

02:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1) 03:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M] (rev b1)

Does anyone have an idea which bytes to tweak to change brightness levels for the 9400? Seems like 0x52f does not work - at least setpci -s 03:00.0 0x52f.B=10 fails...

Thanks!
Soeren

Signature · 2 lines
For the one fact about the future of which we can be certain is that it
will be utterly fantastic. -- Arthur C. Clarke, 1962
#1 lore raw
Quoted 6 lines · Soeren Sonnenburg

Dear all,

I am booting a MacBookPro5,3 using elilo and efifb. Now I'd like to use pommed to control display brightness (which won't work). Digging around in mbp_nvidia_bl.c I figured out that tries to control the geforce 9600M instead of the currently active geforece 9400m

So, first of all, use nouveau instead. But moving on...

Quoted 6 lines

02:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1) 03:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M] (rev b1)

Does anyone have an idea which bytes to tweak to change brightness levels for the 9400? Seems like 0x52f does not work - at least setpci -s 03:00.0 0x52f.B=10 fails...

Those are mmio registers, not PCI config ones. You won't be able to change them with setpci.

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw
Quoted 2 lines · Matthew Garrett
Quoted 1 line · Soeren Sonnenburg

Dear all,

Hi Matthew,

thanks for the quick answer.

Quoted 6 lines
Quoted 4 lines

I am booting a MacBookPro5,3 using elilo and efifb. Now I'd like to use pommed to control display brightness (which won't work). Digging around in mbp_nvidia_bl.c I figured out that tries to control the geforce 9600M instead of the currently active geforece 9400m

So, first of all, use nouveau instead. But moving on...

Unfortunately nouveau (from kernel 2.6.33-rc7) just hangs after loading firmware and initialising fifo 1...

Quoted 9 lines
Quoted 6 lines

02:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1) 03:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M] (rev b1)

Does anyone have an idea which bytes to tweak to change brightness levels for the 9400? Seems like 0x52f does not work - at least setpci -s 03:00.0 0x52f.B=10 fails...

Those are mmio registers, not PCI config ones. You won't be able to change them with setpci.

I see...

Soeren

Signature · 2 lines
For the one fact about the future of which we can be certain is that it
will be utterly fantastic. -- Arthur C. Clarke, 1962
#3 lore raw
In reply to Soeren Sonnenburg

Soeren Sonnenburg <[email protected]> wrote:

Hi,

Quoted 4 lines

I am booting a MacBookPro5,3 using elilo and efifb. Now I'd like to use pommed to control display brightness (which won't work). Digging around in mbp_nvidia_bl.c I figured out that tries to control the geforce 9600M instead of the currently active geforece 9400m

If you know how one can determine which GPU is active, let me know. I don't have this information at the moment.

Quoted 3 lines

Does anyone have an idea which bytes to tweak to change brightness levels for the 9400? Seems like 0x52f does not work - at least setpci -s 03:00.0 0x52f.B=10 fails...

I'm not sure this method actually works without the legacy BIOS. IIRC that method was determined by reverse engineering the Windows drivers, which means the legacy BIOS was in use.

JB.

Signature · 2 lines
Julien BLACHE                                   <http://www.jblache.org> 
<[email protected]>                                  GPG KeyID 0xF5D65169
#4 lore raw
Quoted 11 lines · Julien BLACHE

Soeren Sonnenburg <[email protected]> wrote:

Hi,

Quoted 4 lines

I am booting a MacBookPro5,3 using elilo and efifb. Now I'd like to use pommed to control display brightness (which won't work). Digging around in mbp_nvidia_bl.c I figured out that tries to control the geforce 9600M instead of the currently active geforece 9400m

If you know how one can determine which GPU is active, let me know. I don't have this information at the moment.

There's a _DSM method in the ACPI tables that you need to execute.

Quoted 3 lines

I'm not sure this method actually works without the legacy BIOS. IIRC that method was determined by reverse engineering the Windows drivers, which means the legacy BIOS was in use.

Ah, yes - sorry, I'd forgotten that this used the smi horror. nouveau should drive the chip brightness natively, so it's probably better to figure out why it's breaking rather than worry about this...

Signature · 1 line
Matthew Garrett | [email protected]
#5 lore raw

Matthew Garrett <[email protected]> wrote:

Hi,

Quoted 4 lines
Quoted 2 lines

If you know how one can determine which GPU is active, let me know. I don't have this information at the moment.

There's a _DSM method in the ACPI tables that you need to execute.

Is it exposed to userspace in any way? Or, better yet, could we have an MBP backlight driver which would hide all of this from userspace?

JB.

Signature · 2 lines
Julien BLACHE                                   <http://www.jblache.org> 
<[email protected]>                                  GPG KeyID 0xF5D65169
#6 lore raw
Quoted 2 lines · Julien BLACHE

Is it exposed to userspace in any way? Or, better yet, could we have an MBP backlight driver which would hide all of this from userspace?

Sure, in nouveau.

Signature · 1 line
Matthew Garrett | [email protected]
#7 lore raw
Quoted 6 lines · Matthew Garrett
Quoted 2 lines · Julien BLACHE

Is it exposed to userspace in any way? Or, better yet, could we have an MBP backlight driver which would hide all of this from userspace?

Sure, in nouveau.

OK, great convinced. Any suggestions on where to add printk's to figure out the cause of the hang? The only thing I noticed was the fans turning on so the machine is either stuck in a busy loop or ???

Soeren

Signature · 2 lines
For the one fact about the future of which we can be certain is that it
will be utterly fantastic. -- Arthur C. Clarke, 1962
#8 lore raw
Quoted 11 lines · Soeren Sonnenburg
Quoted 6 lines · Matthew Garrett
Quoted 2 lines · Julien BLACHE

Is it exposed to userspace in any way? Or, better yet, could we have an MBP backlight driver which would hide all of this from userspace?

Sure, in nouveau.

OK, great convinced. Any suggestions on where to add printk's to figure out the cause of the hang? The only thing I noticed was the fans turning on so the machine is either stuck in a busy loop or ???

Best bet is probably to file a bug on bugs.freedesktop.org - I'm afraid I'm not too hot on the GPU bringup side of the driver.

Signature · 1 line
Matthew Garrett | [email protected]
#9 lore raw
Quoted 7 lines · Matthew Garrett
Quoted 6 lines · Soeren Sonnenburg
Quoted 5 lines · Matthew Garrett
Quoted 2 lines · Julien BLACHE

Is it exposed to userspace in any way? Or, better yet, could we have an MBP backlight driver which would hide all of this from userspace?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Sure, in nouveau.

OK, great convinced. Any suggestions on where to add printk's to figure out the cause of the hang? The only thing I noticed was the fans turning on so the machine is either stuck in a busy loop or ???

Best bet is probably to file a bug on bugs.freedesktop.org - I'm afraid I'm not too hot on the GPU bringup side of the driver.

OK, it is here
http://bugs.freedesktop.org/show_bug.cgi?id=26546

Soeren

Signature · 2 lines
For the one fact about the future of which we can be certain is that it
will be utterly fantastic. -- Arthur C. Clarke, 1962