mbp-nvidia-bl: adding support for MacBook Pro 7,1

Bug #596641 reported by Panard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mactel Support
New
Undecided
Unassigned

Bug Description

MacBook Pro 7,1 has a nvidia chipset (MCP89 / graphics: Geforce 320 M)

I tried to add the following lines into mbp_nvidia_bl.c:

        {
                .callback = mbp_dmi_match,
                .ident = "MacBookPro 7,1",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
                        DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro7,1"),
                },
                .driver_data = (void *)&nvidia_chipset_data,
        },

At bootup,
$ cat /sys/class/backlight/mbp_backlight/brightness
15

but,
$ echo 3 > /sys/class/backlight/mbp_backlight/brightness
does nothing on the brightness, except that
$ cat /sys/class/backlight/mbp_backlight/brightness
3

If you need some command line outputs, I can provide them.

Thanks

Revision history for this message
Bernhard Froemel (froemel) wrote :

Hey,
On 06/20/2010 08:24 PM, Panard wrote:
> MacBook Pro 7,1 has a nvidia chipset (MCP89 / graphics: Geforce 320 M)
>
> I tried to add the following lines into mbp_nvidia_bl.c:
>
> {
> .callback = mbp_dmi_match,
> .ident = "MacBookPro 7,1",
> .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
> DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro7,1"),
> },
> .driver_data = (void *)&nvidia_chipset_data,
> },
>
>
Please try
> .driver_data = (void *)&intel_chipset_data,
instead of
> .driver_data = (void *)&nvidia_chipset_data,

and report back.

Cheers,
  Bernhard

Revision history for this message
Panard (panard) wrote :

Same behaviour with intel_chipset port... I guess the port has changed...

Revision history for this message
Bernhard Froemel (froemel) wrote :

On my 2010 (MBP 6,2) model the intel_chipset_data worked out of the box. I see now that your model is the 13'' Nvidia only MBP - I somehow assumed that a higher model number is the 17'' which is very similar to mine - sorry!

There exists a package called
> nvidia_bl-dkms
Did you try that too?

In case nothing works, the original author (Mario Schwalbe) extracted the backlight control interface from a Bootcamp driver:

> this is an Apple specific interface. to find that you'll have to
> disassemble Apple's Bootcap drivers, in particular the file MacHALDriver.sys.

Revision history for this message
Panard (panard) wrote :

I tried nvidia-bl without success...

I cannot install Bootcamp, and so cannot retrieve this MacHALDriver.sys file...
The work of disassembling may be useful as apple has released a patch related to the brightness handling for MacBook Pro 7,1 on windows [1].

If someone can provide MacHALDriver.sys from the latest bootcamp update, I can try to find the port, or perhaps, just ask Mario Schwalbe ;-)

[1] http://support.apple.com/kb/DL1044

Revision history for this message
Panard (panard) wrote :

Good news, nvidia-bl is working with the attached patch.
However, the maximum brightness is quite low, but perhaps tuning the max_level option should fix that?

Revision history for this message
Panard (panard) wrote :

max_level=44000 seems to be a good approximation of the maximal value...
Is there any real risk setting a too high value? (i.e. could my laptop take fire? =))

Revision history for this message
Mario Schwalbe (schwalbe) wrote :

@Panard:
(1) What is your machine? MacBook 7,1 or MacBookPro 7,1 ? The patch is named MBP, but adds support for an MB.

(2) The max_level parameter is used to compute a mask to only overwrite the necessary least significant bits of an (undocumented) register. Thus, it should preferably be a power of 2 minus 1, e.g., Ox3ff (hexadecimal). If you use other values, the mask will be the set of least significant bits required to represent this value. But you cannot set higher values than specified, which is mainly useful on Sony machines.

(3) Higher values shouldn't destroy your machine. But please note that there's no quarantee. There's isn't even an official documentation available. However, I'd highly appreciate a value as exact as possible.

(4) You can try to figure it out like this: Set max_value to some large value, e.g., 0xffffff (2^24-1) and increase brightness until you observe no change in visible brightness anymore. This should be more or less around a power of 2 depending on the method you choose. Most precisely is:
$ echo <value> | sudo tee /sys/class/backlight/nvidia_backlight/brightness

(5) Please also disable any hacks in your xorg.conf regarding display backlight.

Thanks & ciao,
Mario

Revision history for this message
Panard (panard) wrote :

@Mario
(1) s/MacBook/MacBookPro/ in my patch

(2-4) I found the max value of 44000 by using the method you suggested (by incrementing the level by step of 2000).
After 44000, I see no difference in the brightness of the screen.
However, 44000 is far from being a power of 2, I let you to decide to round up to the next power (2^16 - 1).

(5) I have no such hacks.

Cheers

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.