Page 1 of 2 12 LastLast
Results 1 to 10 of 22

Thread: Testers wanted: Improved Backlight for 2010 MBPs

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Beans
    21

    Testers wanted: Improved Backlight for 2010 MBPs

    Hello everyone,

    while investigating gpu switching on a mbp 6,2 I discovered how apple does the backlight setting on the recent mbps.

    I added the new method to mbp_nvidia_bl, but as I have only access to one mbp it would be great if someone could test it on other models. Benefits include smooth transitions between brightness levels (like on osx) and doing stuff the right way.

    Please only test this if you have sufficient knowledge of installing kernel modules and general linux stuff. And as everything hardware related it's possibly dangerous, just in case.

    Howto: Remove all old backlight modules, download source, install it, modprobe mbp_nvidia_bl debug=1, cd /sys/devices/virtual/backlight/mbp_backlight, cat actual_brightness, echo 1 > brightness, echo 15 > brightness.
    Additional points for posting the relevant dmesg output from the module here, especially the mux version.

    This might also work for older mbps with graphics switching, for this edit /usr/src/mbp_nvidia_bl-0.24.3/mbp_nvidia_bl.c, find your model in the table and replace "nvidia_chipset_data" with "gmux_chipset_data".

    Thanks!
    Attached Files Attached Files
    Last edited by Sidolin; August 31st, 2010 at 04:14 AM.

  2. #2
    Join Date
    Jun 2006
    Beans
    108

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    Hi Sidolin,

    I shouldn't be doing this given my lack of kernel experience, but I'm incorrigible. I got stuck at package installation:
    Code:
    $ sudo dpkg -i mbp-nvidia-bl-dkms_0.24.3_all.deb 
    Selecting previously deselected package mbp-nvidia-bl-dkms.
    (Reading database ... 151409 files and directories currently installed.)
    Unpacking mbp-nvidia-bl-dkms (from mbp-nvidia-bl-dkms_0.24.3_all.deb) ...
    Setting up mbp-nvidia-bl-dkms (0.24.3) ...
    No packages found matching mbp_nvidia_bl-dkms.
    Need NAME, and VERSION defined
    ARCH is optional
    dpkg: error processing mbp-nvidia-bl-dkms (--install):
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     mbp-nvidia-bl-dkms

  3. #3
    Join Date
    Feb 2010
    Beans
    6

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    Quote Originally Posted by itismike View Post
    Hi Sidolin,

    I shouldn't be doing this given my lack of kernel experience, but I'm incorrigible. I got stuck at package installation:
    Code:
    $ sudo dpkg -i mbp-nvidia-bl-dkms_0.24.3_all.deb 
    Selecting previously deselected package mbp-nvidia-bl-dkms.
    (Reading database ... 151409 files and directories currently installed.)
    Unpacking mbp-nvidia-bl-dkms (from mbp-nvidia-bl-dkms_0.24.3_all.deb) ...
    Setting up mbp-nvidia-bl-dkms (0.24.3) ...
    No packages found matching mbp_nvidia_bl-dkms.
    Need NAME, and VERSION defined
    ARCH is optional
    dpkg: error processing mbp-nvidia-bl-dkms (--install):
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     mbp-nvidia-bl-dkms
    Hi, slightly off-topic, but this post is the top google response for "dkms Need NAME, and VERSION defined", so I'm putting my findings for it here:

    I managed to work out the problem is in the "debianisation" of the package-name. If you use underscores in your DKMS PACKAGE_NAME (eg source is in "mpb_nvidia_bl-0.24.3") you'll end up with a debianised package name mbp-nvidia-bl-dkms_0.24.3_all.deb, but internally the postinst script will be looking for a package named "mpb_nvidia_bl" to determine the VERSION. Since this doesn't exist the VERSION is empty and we hit this error. Change your PACKAGE_NAME (and source code directory) to eliminate the underscores and this should work.

    Cheers,

    Greg

  4. #4
    Join Date
    Oct 2007
    Beans
    13

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    I've kind of been lurking on this thread for quite some time now.
    Thought I'd try to give something back.

    I'm booting my MBP 5.x
    in efi mode
    My macbook has the dual nvidia setup
    9400GT
    9600GT



    Sidolin mentions that switching isn't support with the proprietary driver.
    I get it working using the proprietary driver.


    If you would like to try what I'm doing

    do it in the following steps:
    * boot in efi mode
    * make sure its single mode so X isn't started.
    * unload the nvidia driver
    * run gpupower to disable the 9600GT
    * load the nvidia driver
    * start X

    I'm using Ubuntu 11.04 with a stock kernel.
    No brightness support though. But haven't really understood where to put the custom c file to recompile support (dont have anything with the same name in my fs, eventhough i have the nvidia-bl dkms package installed)



    ~ tomodachi

  5. #5
    Join Date
    Aug 2005
    Beans
    21

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    It seems packaging a kernel module is a lot harder than writing one so i'm giving up trying to build a neat .deb. I attached the source to the first post, maybe someone is better at packaging than me. May be it works with loadtarball, probably works if you just install the old mbp_nvidia_bl and replace the .c in /usr/src/mbp_nvidia_bl with mine from the tar.bz2 and rebuild the kernel module with dkms.

  6. #6
    Join Date
    Jul 2008
    Beans
    245
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    Hi,

    I'm currently preparing an update of this package for maverick and I'd like to include your patches of course. Can your provide some more information?

    1. Where did you get the mechanism from?
    2. What is the formula while writing (outl(0x1af40 / 15 * intensity, 0x774)) and reading (intensity = inl(0x774) / 0x1cc0) used for? If it is to scale to 15 levels as the old interface provided, we can omit it. Scaling to a reasonable range should better be left to userland applications (i.e., g-p-m). The older inferfaces were just that limited. What's the true hardware range?
    3. .iostart and .iolen should reflect the true hardware resources being operated. Which ports exactly does the driver need? 0x704-0x707 to get the hardware version? And exactly 0x774 to read write the brightness?

    thanks & ciao,
    Mario

  7. #7
    Join Date
    Aug 2005
    Beans
    21

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    1. Where did you get the mechanism from?
    Putting
    Code:
    agclog=10000 agcdebug=4294967295
    in /Library/Preferences/SystemConfiguration/com.apple.Boot.plist enables logging for graphics switching and backlight control. It's quite verbose, output can be found in /var/log/kernel.log.

    2. What is the formula while writing (outl(0x1af40 / 15 * intensity, 0x774)) and reading (intensity = inl(0x774) / 0x1cc0) used for? If it is to scale to 15 levels as the old interface provided, we can omit it. Scaling to a reasonable range should better be left to userland applications (i.e., g-p-m). The older inferfaces were just that limited. What's the true hardware range?
    It's just for scaling, it's possible to use other values as well. I guess the hardware range is 0 - 0x1af40 since that seems to be what osx sets when at full brightness. Setting higher values is possible but i didn't notice any difference when going even higher.

    3. .iostart and .iolen should reflect the true hardware resources being operated. Which ports exactly does the driver need? 0x704-0x707 to get the hardware version?
    The real range is found in the acpi dsdt, search for gmux. It starts at 0x700 and is 0xff long.
    A problem is that the other ports in this region do things like switching the display or powering down the nvidia gpu so I started to write a general gmux driver which does all these things, among setting the brightness. But it's still under heavy development so it certainly won't be ready for maverick. You can find the current version at http://andreas.meetr.de/gmux/apple_gmux.c but it's not really ready yet.

    And exactly 0x774 to read write the brightness?
    0x774 works for my laptop (mbp 6,2) but if you look at the kernel log it also sets 0x724, I'm not sure why.

  8. #8
    Join Date
    Jul 2010
    Beans
    142

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    Sidolin,

    You are doing great progress !

    I have a few questions :
    - I tried to activate the "agcdebug" on my MBP 2009 but my kernel.log does not show anything. Is there an equivalent for these models ?
    - should the apple_gmux.c work on MBP 2009 with 2 graphic cards ?
    - do the brightness & graphic card controls work in EFI mode ?
    - in BIOS mode does "lspci" report both graphic cards ?
    - how do you find the address of the acpi dsdt ?

    Thanks,

    metatechbe
    Last edited by metatechbe; September 18th, 2010 at 08:28 PM.

  9. #9
    Join Date
    Aug 2005
    Beans
    21

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    Quote Originally Posted by metatechbe View Post
    - I tried to activate the "agcdebug" on my MBP 2009 but my kernel.log does not show anything. Is there an equivalent for these models ?
    Did you reboot afterwards? Can you paste your full Boot.plist?

    Quote Originally Posted by metatechbe View Post
    - should the apple_gmux.c work on MBP 2009 with 2 graphic cards ?
    Not at the moment, but after a few modifications it could work. At least if apple didn't change how the gmux works. But at least the detection which graphics card is the integrated one and the check for the gmux hardware revision have to be changed beforehand.

    Quote Originally Posted by metatechbe View Post
    - do the brightness & graphic card controls work in EFI mode ?
    Yes. If brightness control or apple_smc doesn't work for you in EFI mode it's probably because you use the noefi boot parameter which disables dmi (to check just run dmidecode, if it doesn't output your model etc. dmi doesn't work) which is used by some drivers to detect the model.
    This patch (not by me) let's you boot without noefi: http://140.211.166.79/mailarchive/li...4607435/thread

    Quote Originally Posted by metatechbe View Post
    - in BIOS mode does "lspci" report both graphic cards ?
    No, BIOS mode hides the integrated card. Maybe it's possible to somehow unhide it but for now the intel card requires efi.

    Quote Originally Posted by metatechbe View Post
    - how do you find the address of the acpi dsdt ?
    Code:
    sudo apt-get install acpidump iasl
    sudo acpidump > acpidump.txt && sudo acpixtract acpidump.txt && iasl -d DSDT.dat && ls -l DSDT.dsl

  10. #10
    Join Date
    Jul 2008
    Beans
    245
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Testers wanted: Improved Backlight for 2010 MBPs

    Quote Originally Posted by ayushiinfotech View Post
    i did not understand can explain briefly.................?
    advance thanks .........
    Sidolin's changes have been merged into the mactel PPA's version of mbp_nvidia_bl in the meantime. If you have a MacBook Pro 6,1 or 6,2, please confirm whether it is indeed working and report back.

    ciao,
    Mario

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •