[Intel-gfx] Legacy backlight control with KMS and BACKLIGHT property

Mike Lothian mike at fireburn.co.uk
Wed Aug 19 02:10:48 CEST 2009


2009/8/17 Greg KH <greg at kroah.com>:
> On Mon, Aug 17, 2009 at 01:41:03AM +0100, Mike Lothian wrote:
>> 2009/8/16 Greg KH <greg at kroah.com>:
>> > On Sat, Aug 15, 2009 at 01:33:13PM +0100, Mike Lothian wrote:
>> >> 2009/8/15 Jesse Barnes <jbarnes at virtuousgeek.org>:
>> >> > On Fri, 14 Aug 2009 12:28:47 -0700
>> >> > Greg KH <greg at kroah.com> wrote:
>> >> >
>> >> >> On Fri, Aug 14, 2009 at 12:08:21PM -0700, Greg KH wrote:
>> >> >> > Here's a first cut at such a driver.  It works for me on this
>> >> >> > laptop, but note that it will try to work on _any_ Intel-based
>> >> >> > system.  I'll figure out how to do this only for specific machines
>> >> >> > based on DMI data next.
>> >> >>
>> >> >> And here's one that is set for DMI data to only load on the proper
>> >> >> ones.
>> >> >>
>> >> >> I'll push this upstream now, if there are no objections.
>> >> >
>> >> > Yeah, looks fairly reasonable.  This code should work on most pre-965
>> >> > chipsets too, since they share the LBB regs.  There are a couple of
>> >> > other things to take into consideration: I think the VBIOS indicates
>> >> > whether the controls are inverted (i.e. a value of 0xff is minimum
>> >> > brightness) and there may also be some stepping info.
>> >> >
>> >> > So ultimately I'd like to see this be part of the i915 driver as one of
>> >> > a few different methods supported (hopefully we can autodetect them
>> >> > better than the 2D driver though, using the VBIOS and DMI in the
>> >> > kernel).
>> >> >
>> >> > The other three methods that need to export sysfs interfaces are
>> >> > OpRegion (already done), i2c (some machines have external controllers;
>> >> > the VBIOS describes how to interact with them) and PWM (the "native"
>> >> > power modulation regs).
>> >>
>> >> This is great news guys, hopefully I'll finally be able to control the
>> >> screen brightness of my GM45 in my Samsung R510
>> >>
>> >> If you want a guinea pig to test your code please feel free to forward patches
>> >
>> > A driver for other Samsung devices is below.  If you think your laptop
>> > also works this way (by changing the brightness value by reading and
>> > writing the 0xf4 pci config value directly), then we can add support for
>> > your laptop to this driver as well, just send me the output of:
>> >        lspci
>> >        lspci -n
>> >        grep . /sys/class/dmi/id/*
>> >
>> > thanks,
>> >
>>
>>
>> > +       {
>> > +               .ident = "NP-Q45",
>> > +               .matches = {
>> > +                       DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
>> > +                       DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
>> > +                       DMI_MATCH(DMI_BOARD_NAME, "SQ45S70S"),
>> > +               },
>> > +               .callback = dmi_check_cb,
>> > +       },
>>
>> > +        */
>> > +       pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x27ae, NULL);
>> > +       if (!pci_device) {
>> > +               pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x2a02, NULL);
>> > +               if (!pci_device)
>> > +                       return -ENODEV;
>>
>>
>> You are an absolute STAR Greg!!!
>>
>> Finally I have brightness control for this laptop on Linux
>>
>> I needed to set the DMI names to "R510/P510" and the pci device to
>> 0x2a42 but apart from that it works!!!
>
> Care to send me a patch for the driver to add support for this device?
>
> Or just send me the output of:
>        grep . /sys/class/dmi/id/*
> and I'll add it myself.
>
> thanks,
>
> greg k-h
>

tau fireburn # grep . /sys/class/dmi/id/*
/sys/class/dmi/id/bios_date:09/26/2008
/sys/class/dmi/id/bios_vendor:Phoenix Technologies Ltd.
/sys/class/dmi/id/bios_version:07LI.MP00.20080926.SCY
/sys/class/dmi/id/board_name:R510/P510
/sys/class/dmi/id/board_serial:123490EN400015
/sys/class/dmi/id/board_vendor:SAMSUNG ELECTRONICS CO., LTD.
/sys/class/dmi/id/board_version:Not Applicable
/sys/class/dmi/id/chassis_asset_tag:No Asset Tag
/sys/class/dmi/id/chassis_serial:None
/sys/class/dmi/id/chassis_type:10
/sys/class/dmi/id/chassis_vendor:SAMSUNG ELECTRONICS CO., LTD.
/sys/class/dmi/id/chassis_version:N/A
/sys/class/dmi/id/modalias:dmi:bvnPhoenixTechnologiesLtd.:bvr07LI.MP00.20080926.SCY:bd09/26/2008:svnSAMSUNGELECTRONICSCO.,LTD.:pnR510/P510:pvrNotApplicable:rvnSAMSUNGELECTRONICSCO.,LTD.:rnR510/P510:rvrNotApplicable:cvnSAMSUNGELECTRONICSCO.,LTD.:ct10:cvrN/A:
/sys/class/dmi/id/product_name:R510/P510
/sys/class/dmi/id/product_serial:EJ1893DQ700599
/sys/class/dmi/id/product_uuid:60B6C327-D21D-B211-8000-B5CE02D5709F
/sys/class/dmi/id/product_version:Not Applicable
/sys/class/dmi/id/sys_vendor:SAMSUNG ELECTRONICS CO., LTD.
/sys/class/dmi/id/uevent:MODALIAS=dmi:bvnPhoenixTechnologiesLtd.:bvr07LI.MP00.20080926.SCY:bd09/26/2008:svnSAMSUNGELECTRONICSCO.,LTD.:pnR510/P510:pvrNotApplicable:rvnSAMSUNGELECTRONICSCO.,LTD.:rnR510/P510:rvrNotApplicable:cvnSAMSUNGELECTRONICSCO.,LTD.:ct10:cvrN/A:



More information about the Intel-gfx mailing list