Bug 25901 - Backlight property nonexistant for Macbook4,1
Summary: Backlight property nonexistant for Macbook4,1
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: Other All
: medium normal
Assignee: ykzhao
QA Contact:
URL:
Whiteboard:
Keywords:
: 27484 27885 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-05 07:29 UTC by Sebastian@SSpaeth.de
Modified: 2017-07-24 23:08 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
grep . /sys/devices/virtual/dmi/id/* (1.13 KB, text/plain)
2010-01-05 07:29 UTC, Sebastian@SSpaeth.de
no flags Details
acpidump (106.70 KB, text/plain)
2010-01-05 07:30 UTC, Sebastian@SSpaeth.de
no flags Details
Add DMI_MATCH information for early MacBook models (1.49 KB, patch)
2010-02-24 22:31 UTC, Evan McClain
no flags Details | Splinter Review
Add mbp_backlight support (642 bytes, patch)
2010-02-24 23:11 UTC, Evan McClain
no flags Details | Splinter Review

Description Sebastian@SSpaeth.de 2010-01-05 07:29:52 UTC
Created attachment 32457 [details]
grep . /sys/devices/virtual/dmi/id/*

As requested in bug 20963 #c89, I am opening a new bug.

Using KMS my backlight keys stopped working. Disabling KMS via "nomodeset" kernel parameter makes them working again.

My /sys/class/backlight is empty

This is a Macbook4,1 with:
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03)

Attaching the acpidump and the output of "grep . /sys/devices/virtual/dmi/id/*"
Comment 1 Sebastian@SSpaeth.de 2010-01-05 07:30:18 UTC
Created attachment 32458 [details]
acpidump
Comment 2 Sebastian@SSpaeth.de 2010-01-05 07:33:45 UTC
This is a stock Ubuntu installation (karmic):
Linux spaetz-macbook 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux

xorg-video-intel driver: 2.9.0-1ubuntu2
xorg-server 7.4:+3ubuntu10

Let me know if there is more I can do.
Comment 3 Jesse Barnes 2010-02-05 15:05:29 UTC
I guess ACPI backlight isn't supported on MacBook (you'd need to build in the ACPI video driver)?  Not sure what the right backlight driver is for that platform.  Any ideas Yakui?
Comment 4 ykzhao 2010-02-07 21:20:49 UTC
(In reply to comment #3)
> I guess ACPI backlight isn't supported on MacBook (you'd need to build in the
> ACPI video driver)?  Not sure what the right backlight driver is for that
> platform.  Any ideas Yakui?

Hi, Jesse
    I look at the acpidump on this box and there is no _BCL/_BCM/_BQC object, which is required by ACPI video driver. As there is no generic ACPI backlight or platform backlight  interface, we will have no way to create backlight property.

   In fact Grep submitted a patch, which used the legacy control method to create the platform backlight interface. But we don't know why it is shipped by upstream kernel.
   How about pushing the patch to upstream kernel?

Thanks
   Yakui  
> 

Comment 5 Evan McClain 2010-02-19 16:44:45 UTC
This looks similar to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/511965
and
https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/417770
and
https://bugzilla.novell.com/show_bug.cgi?id=581474

I am also hitting this bug on my MacBook3,1 and OpenSUSE Factory. If any other information would be helpful just let me know.
Comment 6 Evan McClain 2010-02-24 22:31:37 UTC
Created attachment 33549 [details] [review]
Add DMI_MATCH information for early MacBook models

The attached patch adds backlight support for older MacBooks using intel graphics (list of models from wikipedia...). I believe a second patch would be required for xorg-video-intel to actually let X use the mbp_backlight, but backlight control does work (on my MacBook3,1) with echo 12 > /sys/class/backlight/mbp_backlight/brightness.

(Note: Only tested with MacBook3,1)
Comment 7 Evan McClain 2010-02-24 23:11:32 UTC
Created attachment 33550 [details] [review]
Add mbp_backlight support

The attached patch lets X use the mbp_backlight backlight class.

(Again, only tested on my Macbook3,1)
Comment 8 Sebastian@SSpaeth.de 2010-03-18 03:04:20 UTC
Would that patch be acceptable? It would be nice to be get my brightness keys back...
Comment 9 Evan McClain 2010-03-18 12:44:26 UTC
A cleaned up version of my kernel patch is now in Richard Purdie's linux-rpurdie-backlight branch:
http://git.o-hand.com/cgit.cgi/linux-rpurdie-backlight/commit/?id=36bc5ee6a8d13333980fa54e97d3469d3d4cda98

So it should be pulled into Linus' tree soon.
Comment 10 Evan McClain 2010-03-24 16:42:44 UTC
Okay, my kernel patch is currently in 2.6.34-rc2, but my one line diff to xf86-video-intel is still required to get X to play with /sys/class/backlight/mbp_backlight.

Should I open a new bug? It would be nice to hear from one of the intel guys....
Comment 11 Gordon Jin 2010-04-08 00:31:57 UTC
*** Bug 27484 has been marked as a duplicate of this bug. ***
Comment 12 Steffen Röcker 2010-04-08 01:22:41 UTC
The kernel patch needs a small fix for MacBook1,1.
When the MacBook1,1 came out Apple was still named Apple Computer.
I am not sure if this applies to older MacBook2,1 versions aswell.

I submitted the fix to Richard Purdie and LKML: http://lkml.org/lkml/2010/3/23/412
Comment 13 Evan McClain 2010-04-22 13:33:30 UTC
According to:
http://www.mail-archive.com/linux-acpi@vger.kernel.org/msg07914.html
and http://www.mail-archive.com/linux-acpi@vger.kernel.org/msg09304.html the MacBook2,1 should report as Apple Inc. while the MacBook1,1 is as you reported.

I guess I made a faulty assumption thinking the system manufacturer wouldn't change :(
Comment 14 Gordon Jin 2010-05-04 01:07:09 UTC
*** Bug 27885 has been marked as a duplicate of this bug. ***
Comment 15 Christophe Fergeau 2010-05-04 01:14:42 UTC
I can confirm that with a recent mbp_nividia_bl and the xorg-driver-video-intel one-liner from comment #7, backlight works again on my MacBook 4,1 with KMS.
Comment 16 Chris Wilson 2010-07-05 09:13:12 UTC
Julien Cristau pointed out that the one-liner had been overlooked for too long, and so I've pushed the patch upstream.

Is everything now in place for backlight to work on all MacBooks (and 4.1 in particular)?
Comment 17 Christophe Fergeau 2010-07-05 09:27:00 UTC
(In reply to comment #16)
> Is everything now in place for backlight to work on all MacBooks (and 4.1 in
> particular)?

Support in the kernel module is upstream, and you just pushed the needed change for the x.org driver, so everything is in place (until all of this changes again ;)
Comment 18 Julien Cristau 2010-07-05 09:33:51 UTC
(In reply to comment #17)
> Support in the kernel module is upstream, and you just pushed the needed change
> for the x.org driver, so everything is in place (until all of this changes
> again ;)

closing accordingly.  thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.