Bug 14216 - backlight does not work, either via hotkey or /proc/acpi/video - Compal NTUC0
Summary: backlight does not work, either via hotkey or /proc/acpi/video - Compal NTUC0
Status: CLOSED DUPLICATE of bug 19342
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Video (show other bugs)
Hardware: All Linux
: P1 blocking
Assignee: acpi_power-video
URL:
Keywords:
: 16036 16379 16391 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-23 19:51 UTC by Del
Modified: 2010-09-30 18:45 UTC (History)
12 users (show)

See Also:
Kernel Version: 2.6.31-10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
DSDT disassembled (204.75 KB, text/plain)
2009-09-23 19:51 UTC, Del
Details
output from acpidump (129.75 KB, text/x-log)
2010-03-11 21:22 UTC, Del
Details
lspci & acpidump (40.58 KB, application/gzip)
2010-03-24 07:03 UTC, Marek Lotke
Details
patch: evaluate EC _REG explicitly (1.58 KB, patch)
2010-03-25 02:04 UTC, Zhang Rui
Details | Diff
output of /sys/firmware/acpi/interrupts before & after (499 bytes, application/gzip)
2010-09-17 18:24 UTC, Marek Lotke
Details

Description Del 2009-09-23 19:51:13 UTC
Created attachment 23155 [details]
DSDT disassembled

Compal NTUC0 laptop leaves a lot to be desired under linux. As far as I have tracked it down it needs a DSDT patch. In particular /proc/acpi/fan and /proc/acpi/thermal_zone are empty and the wireless impossible to enable. I filed a more comprehensive report here:
https://wiki.ubuntu.com/LaptopTestingTeam/CompalNtuc0
I attached the DSDT.

Here is output from acpitool -e:

  Kernel version : 2.6.31-10-gener20090521   -    ACPI version : 20090521
  -----------------------------------------------------------
  Battery #1     : present
    Remaining capacity : 2200 mAh, 100.0%
    Design capacity    : 2200 mAh
    Last full capacity : 2200 mAh
    Present rate       : 0 mA
    Charging state     : charged
    Battery type       : rechargeable, Li-Ion
    Model number       : PA3534U 
    Serial number      : 3658Q

  AC adapter     : on-line 
  Fan            : <not available>

  CPU type               : Intel(R) Celeron(R) M CPU        723  @ 1.20GHz 
  CPU speed              : 1196.867 MHz 
  Cache size             : 1024 KB
  Bogomips               : 2393.73 
  Processor ID           : 0
  Bus mastering control  : yes
  Power management       : yes
  Throttling control     : yes
  Limit interface        : yes
  Active C-state         : C0
  C-states (incl. C0)    : 2
  Usage of state C1      : 588289 (99.7 %)
  T-state count          : 8
  Active T-state         : T0


  Thermal info   : <not available>

   Device	S-state	  Status   Sysfs node
  ---------------------------------------
  1. RP01	  S4	 disabled  pci:0000:00:1c.0
  2. PXSX	  S4	 disabled  pci:0000:02:00.0
Comment 1 ykzhao 2009-09-24 03:11:37 UTC
From the DSDT info it seems that no ACPI fan device can be found in DSDT table. In such case OS can do nothing. Maybe it is controlled by BIOS.

So IMO this is a BIOS bug instead of Linux bug.

thanks.
Comment 2 ykzhao 2009-09-24 03:15:10 UTC
For the another backlight issue: 
   From the DSDT info it seems that the _BCL object can be found. But unfortunately it is found in discrete graphics card instead of integrated intel graphics device. So if the integrated graphics card is used, the brightness can't be adjusted by using ACPI video backlight driver.
 
In such case it is a BIOS bug.

As this is a BIOS bug, this bug will be rejected.
Comment 3 Del 2009-09-24 06:37:05 UTC
As far as I am informed the custom DSDT patch was removed in kernel 2.6.30, and users encouraged to report problems as bugs to linux.

So are you saying that the problems cannot be fixed by a custom DSDT file? Can you confirm that the laptop is not ACPI compliant?
Comment 4 Len Brown 2009-11-25 05:26:20 UTC
"ACPI compliance" is somewhat of an academic concept,
as there exists no industry standard platform compliance test suite...

It is still possible to compile a custom DSDT into a build-from-source kernel
by following "How to Build a custom DSDT into the kernel" here:

http://lesswatts.org/projects/acpi/overridingDSDT.php

However, DSDT overrides are for debugging, rather than for supported systems,
as nobody except the owner of the DSDT code (the OEM) can support
the modified firmware.

Generally if the system is functional enough to work with Window's
ACPI implementation, we will make it work with Linux's ACPI implementation --
even if it means adding workarounds for brain-damaged systems.
However, we stop short of adding features that that the OEM
failed to implement.

It may be that you want to be looking into the compal-laptop driver
for help in supporting features that are not implemented via
standard ACPI methods.  I would not worry about thermal and fan --
they're probably handled by an EC, like they are on most systems.
Wireless (and rfkill) is not a feature standardized by ACPI.

LCD brightness is standardized by ACPI, do you have anything
in /proc/acpi/video or /sys/class/backlight?
Comment 5 Del 2009-11-25 13:48:58 UTC
Thanks for reopening the report Len, I highly appreciate all help on this issue!

I did dig further into the DSDT patch after I posted, helped by pointers from Andi Kleen, so if I get the opportunity I may get to it and try out some DSDT patches.

I have been in steady dialogue with Compal's Bios developers since this report, and I hope they will follow through with a Bios update. If so, I will make sure to update the information here immediately.

Before I posted this bug-report I contacted Cezary Jackiewicz, the developer of the compal-laptop module, this was his response on the issue:
"Sorry, this compal probably need some kernel stuff to recognize
hardware switch/buttons etc. My module based only on acpi structures;
hardware switches overwrite this."

One main issue that I haven't tracked down is that power saving features does not work. More precisely, the cpu does not seem to throttle down, and I am not sure about the gpu either. So the battery time is reduced to approximately half of expected.

The laptop is currently not in my possession, but I will acquire the /proc/acpi/video and /sys/class/backlight listing shortly anyway, and report back on those.

Cheers,
Del
Comment 6 Del 2009-11-25 17:41:34 UTC
Just got confirmation that a Bios update is available which seems to solve most of my issues. It is found here:
http://www.compal.com/download/nb/NTUC0/BIOS_030/
and here:
http://service1.marasst.com/compal.htm

Hence, I close this bug at least until I have the chance to test this new Bios. Thanks a lot for the support!

Cheers,
Del
Comment 7 Stefano Cavallari 2010-01-20 19:31:20 UTC
(In reply to comment #6)
> Just got confirmation that a Bios update is available which seems to solve
> most
> of my issues. It is found here:
> http://www.compal.com/download/nb/NTUC0/BIOS_030/
> and here:
> http://service1.marasst.com/compal.htm
> 
> Hence, I close this bug at least until I have the chance to test this new
> Bios.
> Thanks a lot for the support!
> 
Hi,
I already use that BIOS and it doesn't fix the issue for me. Hardware keys and ACPI do nothing.
Comment 8 Del 2010-01-24 22:50:25 UTC
You are right. I finally got to test the 1.05 Bios version, and it fixed a keyboard issue (<> buttons not working with 1.00 and 1.03 version), but the back-light issue and wireless switch are still not fixed. On top of that Compal has finally told me that they have no intention of supporting linux with this machine. This means that the only hope for a fix of these issues is a linux-patch.

To top it off, my test-machine died. I will need to RMA it, and that will probably take another couple of weeks. Once I get it back, I will try to enable the wireless power switch from windows. Once enabled, it should stay enabled according to another user.

Unfortunately, the machine was tricky to boot from USB too, so using unetbootin with freedos to flash the bios was a no-go. However, freedos from USB-stick works great installing it using qemu as explained here (second to last option):
http://wiki.fdos.org/Installation/BootDiskCreateUSB

Cheers,
Del
Comment 9 Littlejohn20 2010-02-26 19:52:49 UTC
Hi, I have this notebook Compal Ntuco and I have this problem with brightness hotkey. I have the 1.05 Bios.. Can you help me?
Comment 10 Zhang Rui 2010-03-09 09:04:49 UTC
could you please boot with kernel parameter "nomodeset" and see if it helps?
please attach the output of "grep . /proc/acpi/video/*/*/*" both with and without the boot option.
Comment 11 Del 2010-03-09 18:50:32 UTC
Same kernel as in the initial report, I got these outputs:
Without nomodeset:
/proc/acpi/video/GFX0/DD01/brightness:<not supported>
/proc/acpi/video/GFX0/DD01/EDID:<not supported>
/proc/acpi/video/GFX0/DD01/info:device_id:    0x0001
/proc/acpi/video/GFX0/DD01/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD01/info:known by bios: no
/proc/acpi/video/GFX0/DD01/state:state:     0x1d
/proc/acpi/video/GFX0/DD01/state:query:     0x00
/proc/acpi/video/GFX0/DD02/brightness:<not supported>
/proc/acpi/video/GFX0/DD02/EDID:<not supported>
/proc/acpi/video/GFX0/DD02/info:device_id:    0x0002
/proc/acpi/video/GFX0/DD02/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD02/info:known by bios: no
/proc/acpi/video/GFX0/DD02/state:state:     0x1d
/proc/acpi/video/GFX0/DD02/state:query:     0x00
/proc/acpi/video/GFX0/DD03/brightness:levels:  0 14 28 42 56 70 84 100
/proc/acpi/video/GFX0/DD03/brightness:current: 100
/proc/acpi/video/GFX0/DD03/EDID:<not supported>
/proc/acpi/video/GFX0/DD03/info:device_id:    0x0003
/proc/acpi/video/GFX0/DD03/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD03/info:known by bios: no
/proc/acpi/video/GFX0/DD03/state:state:     0x0b
/proc/acpi/video/GFX0/DD03/state:query:     0x00
/proc/acpi/video/GFX0/DD04/brightness:<not supported>
/proc/acpi/video/GFX0/DD04/EDID:<not supported>
/proc/acpi/video/GFX0/DD04/info:device_id:    0x0004
/proc/acpi/video/GFX0/DD04/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD04/info:known by bios: no
/proc/acpi/video/GFX0/DD04/state:state:     0x0b
/proc/acpi/video/GFX0/DD04/state:query:     0x00
/proc/acpi/video/GFX0/DD05/brightness:<not supported>
/proc/acpi/video/GFX0/DD05/EDID:<not supported>
/proc/acpi/video/GFX0/DD05/info:device_id:    0x0005
/proc/acpi/video/GFX0/DD05/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD05/info:known by bios: no
/proc/acpi/video/GFX0/DD05/state:state:     0x0b
/proc/acpi/video/GFX0/DD05/state:query:     0x00

nomodeset (assuming I got Grub2 right):
/proc/acpi/video/GFX0/DD01/brightness:<not supported>                             
/proc/acpi/video/GFX0/DD01/EDID:<not supported>                                   
/proc/acpi/video/GFX0/DD01/info:device_id:    0x0100                              
/proc/acpi/video/GFX0/DD01/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD01/info:known by bios: no
/proc/acpi/video/GFX0/DD01/state:state:     0x1d                                  
/proc/acpi/video/GFX0/DD01/state:query:     0x00                                  
/proc/acpi/video/GFX0/DD02/brightness:<not supported>
/proc/acpi/video/GFX0/DD02/EDID:<not supported>
/proc/acpi/video/GFX0/DD02/info:device_id:    0x0320
/proc/acpi/video/GFX0/DD02/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD02/info:known by bios: no                                     
/proc/acpi/video/GFX0/DD02/state:state:     0x1d
/proc/acpi/video/GFX0/DD02/state:query:     0x00
/proc/acpi/video/GFX0/DD03/brightness:levels:  0 14 28 42 56 70 84 100
/proc/acpi/video/GFX0/DD03/brightness:current: 100
/proc/acpi/video/GFX0/DD03/EDID:<not supported>
/proc/acpi/video/GFX0/DD03/info:device_id:    0x0410
/proc/acpi/video/GFX0/DD03/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD03/info:known by bios: no
/proc/acpi/video/GFX0/DD03/state:state:     0x1d
/proc/acpi/video/GFX0/DD03/state:query:     0x00
/proc/acpi/video/GFX0/DD04/brightness:<not supported>
/proc/acpi/video/GFX0/DD04/EDID:<not supported>
/proc/acpi/video/GFX0/DD04/info:device_id:    0x0004
/proc/acpi/video/GFX0/DD04/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD04/info:known by bios: no
/proc/acpi/video/GFX0/DD04/state:state:     0x1d
/proc/acpi/video/GFX0/DD04/state:query:     0x00
/proc/acpi/video/GFX0/DD05/brightness:<not supported>
/proc/acpi/video/GFX0/DD05/EDID:<not supported>
/proc/acpi/video/GFX0/DD05/info:device_id:    0x0005
/proc/acpi/video/GFX0/DD05/info:type:         UNKNOWN
/proc/acpi/video/GFX0/DD05/info:known by bios: no
/proc/acpi/video/GFX0/DD05/state:state:     0x1d
/proc/acpi/video/GFX0/DD05/state:query:     0x00

Cheers,
Del
Comment 12 Zhang Rui 2010-03-10 01:39:25 UTC
please attach the FULL acpidump of your laptop, e.g. ./acpidump > acpidump.log.
Comment 13 Zhang Rui 2010-03-10 01:42:05 UTC
del,
please verify that
1. does the /sys/class/backlight/acpi_video0/ work for you? i.e. can you change the backlight by echo different values to /sys/class/backlight/acpi_video0/brightness?
2. if the backlight sysfs I/F works for you, the hotkey should work as well when boot with nomodeset, can you make a double check?
Comment 14 Del 2010-03-11 21:22:53 UTC
Created attachment 25479 [details]
output from acpidump
Comment 15 Del 2010-03-11 21:36:23 UTC
Changing the value in /sys/class/backlight/acpi_video0/brightness from 1 through 7 does not change the backlight. The brightness is still at maximum on the screen. It does change the value as confirmed by running cat /sys/class/backlight/acpi_video0/brightness.

Without nomodeset, the hotkeys do nothing. With nomodeset the hotkeys work in the sense that the brightness indicator changes, but the screen stays at full brightness.

I see that the bug report title now is confined to the brightness issue, should I file a separate report for the wireless switch?
Comment 16 Stefano Cavallari 2010-03-11 23:04:48 UTC
FYI, wireless switch works for me. 
Brightness does not. This laptop is really special, the brightness keys do not work even inside the bios screen!
I tried talking directly to the EC by following the manufacturer specifications.
I can set the brightness from EC and read back the value from ACPI, but the hardware (backlight) stays at full power. Probably we have to reverse engineer the windows drivers :P
Comment 17 Del 2010-03-12 14:27:12 UTC
Strefano, please share bios version and kernel version. I would like to know the difference between our machines, explaining the wireless switch not working for me. Also if you could cross check running Ubuntu 9.10 (just from a USB-stick is fine) to see if the wireless switch works, that would be great.
Comment 18 Zhang Rui 2010-03-16 06:18:45 UTC
(In reply to comment #16)
> FYI, wireless switch works for me. 
> Brightness does not. This laptop is really special, the brightness keys do
> not
> work even inside the bios screen!
> I tried talking directly to the EC by following the manufacturer
> specifications.
> I can set the brightness from EC and read back the value from ACPI, but the
> hardware (backlight) stays at full power. Probably we have to reverse
> engineer
> the windows drivers :P

This seems like a firmware problem.
can anybody confirm that the brightness hotkeys works in windows?
Comment 19 Zhang Rui 2010-03-16 06:28:53 UTC
(In reply to comment #15)
> 
> I see that the bug report title now is confined to the brightness issue,
> should
> I file a separate report for the wireless switch?

Yes, please.
Comment 20 Marek Lotke 2010-03-22 17:25:02 UTC
Latest BIOS spotted: http://www.compal.com/download/nb/NTUC0/PE/BIOS107/ (old changelog talk about brightness fixes for Windows)
Also service manual talks about it: http://www.compal.com/download/nb/NTUC0/Service%20manual/NTUC0%20Service%20Manual%20ver3.0_090820.pdf
Comment 21 Zhang Rui 2010-03-23 07:05:26 UTC
Hi, Del,

will you please test the patch at https://bugzilla.kernel.org/show_bug.cgi?id=15054#c23
and see if it helps?
Comment 22 Marek Lotke 2010-03-23 17:26:31 UTC
The patch from 
https://bugzilla.kernel.org/show_bug.cgi?id=15054#c23
doesn't work for NTUC0.
But it improves the situation. Pressing the hotkeys is changing values in /sys/class/backlight/acpi_video0/brightness. The actual screen brightness is not changed though.
Comment 23 Zhang Rui 2010-03-24 06:25:30 UTC
Marek,
please attach the lspci and acpidump output of your laptop.
Comment 24 Marek Lotke 2010-03-24 07:03:12 UTC
Created attachment 25671 [details]
lspci & acpidump
Comment 25 Zhang Rui 2010-03-24 07:34:20 UTC
what if you boot with acpi_osi="!Windows 2009"?
Comment 26 Marek Lotke 2010-03-24 17:20:20 UTC
no change after acpi_osi="!Windows 2009", sorry
Comment 27 Zhang Rui 2010-03-25 02:04:26 UTC
Created attachment 25693 [details]
patch: evaluate EC _REG explicitly

please try this patch.
Comment 28 Marek Lotke 2010-03-25 06:58:16 UTC
it still didn't work. But I get this in dmesg now:
bio: create slab <bio-0> at 0
ACPI: EC: Look up EC in DSDT
ACPI: BIOS _OSI(Linux) query ignored
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
ACPI: Interpreter enabled
ACPI: (supports S0 S3 S4 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI: EC: GPE = 0x1c, I/O: command/status = 0x66, data = 0x62
ACPI: No dock devices found.
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci_root PNP0A08:00: ignoring host bridge windows from ACPI; boot with "pci=use_crs" to use them
Comment 29 Marek Lotke 2010-04-05 09:31:18 UTC
What I have tried so far and failed:
- many acpi_osi settings
- changing dsdt, method _INI where they test different _OSI strings to actually force the same value as is used for Windows 2001
- using compal-laptop module (with force=1). but as far as I can see the ntuc0 service manual (linked above) says that the register (0xB9) used by compal-laptop is actually read only 

Official compal support replied that "Compal would not support any Linux drivers/Aps.". Maybe we need to put some more pressure on Compal support? How about sending some emails from intel.com domain? :-)

BTW. Brightness keys work in Windows XP but because at reboot brightness level is reset to the max. value I could not find out what is changed in acpidump output. Is there a windows acpidump equivalent?
Comment 30 Robert Moore 2010-04-05 15:15:05 UTC
Use iASL -g to get the ACPI tables on Windows. For Win 7, you need the latest version of the compiler, 20100331.
Comment 31 Marek Lotke 2010-04-06 08:55:20 UTC
The 4 files created by iasl -g are identical before and after brightness change on windows xp.
I'm not sure if iasl -g exports 'EC region' data...
Comment 32 Zhang Rui 2010-06-22 08:27:23 UTC
                        Method (_BCM, 1, NotSerialized)
                        {
                            Divide (Arg0, 0x0A, Local0, Local1)
                            Store (Local1, ^^^^LPCB.EC0.BRTS)
                        }

Well, _BCM doesn't work on this platform. We have a couple of such bug reports. But it seems there is nothing we can do currently.

(In reply to comment #29)
> BTW. Brightness keys work in Windows XP but because at reboot brightness
> level
> is reset to the max.

can you change the backlight via Hotkeys in Windows XP?
Comment 33 Marek Lotke 2010-06-22 10:49:05 UTC
Zhang, good to hear you've managed to narrow down the problem!

Yes, changing backlight via hotkeys works in Windows XP. If I change the backlight in XP and reboot backlight is reset to maximum value.
Comment 34 Zhang Rui 2010-06-23 01:41:24 UTC
(In reply to comment #33)
> Zhang, good to hear you've managed to narrow down the problem!
> 
> Yes, changing backlight via hotkeys works in Windows XP.

so the backlight changes immediately after you pressing the hotkeys, right?
Comment 35 Marek Lotke 2010-06-23 08:39:30 UTC
(In reply to comment #34)
> (In reply to comment #33)
> > Zhang, good to hear you've managed to narrow down the problem!
> > 
> > Yes, changing backlight via hotkeys works in Windows XP.
> 
> so the backlight changes immediately after you pressing the hotkeys, right?
Yes, it is pretty much instant. There are 7 levels of brightness.
Comment 36 Zhang Rui 2010-09-03 03:22:03 UTC
please attach the output of "grep . /sys/firmware/acpi/interrupts/*" both before and after pressing the hotkey.
Comment 37 Marek Lotke 2010-09-17 18:24:22 UTC
Created attachment 30362 [details]
output of /sys/firmware/acpi/interrupts before & after

Output attached as requested. I've moved kubuntu now, kernel 2.6.32-24-generic. Thanks.
Comment 38 ykzhao 2010-09-20 06:49:12 UTC
Will you please use the following command and see whether the brightness can be changed?
    >setpci -s 0:0:02.0 f4.b=0x80
    >setpci -s 0:0:02.0 f4.b=0xF0

Will you please try the following boot option and see whether the brightness can be changed by using hotkey?
   >acpi_osi!="Linux" acpi_osi!="Windows 2006" acpi_osi!="Windows 2009"

thanks.
Comment 39 ykzhao 2010-09-20 06:50:44 UTC
Sorry for the typo. The boot option should be:
  acpi_osi="!Linux" acpi_osi="!Windows 2006" acpi_osi="!Windows 2009"

Thanks.
Comment 40 Marek Lotke 2010-09-21 12:18:18 UTC
I can confirm that the setpci commands above work - the brightness is changed!
Sorry, but I can't test the boot option right now since I don't have the hardware anymore. I'll let you know when I have the machine again in my hands and can check the boot option myself.
Thanks!
Comment 41 Stefano Cavallari 2010-09-21 14:01:43 UTC
I tried both the pci command and boot option, they work! 

The brightness buttons work, but I cannot change the brightness using /proc/acpi.
I see these directories in /proc:

/proc/acpi/video/GFX0/
DD01/ DD02/ DD03/ DD04/ DD05/

only DD03 has the "brightness" file but changing values does not work.
# cat /proc/acpi/video/GFX0/DD03/brightness 
levels:  0 14 28 42 56 70 84 100
current: 28

The "current" value updates, but the screen does not follow it.
Comment 42 Zhang Rui 2010-09-27 01:14:11 UTC
*** Bug 16036 has been marked as a duplicate of this bug. ***
Comment 43 Zhang Rui 2010-09-27 01:18:54 UTC
we have several bug reports that ACPI video driver controls the backlight correctly, but the backlight fails to change after evaluating the AML code.
We have no idea what is going wrong here, and how to fix it.
A alternative way is to disable ACPI video driver and control the backlight in other ways, like, platform specific control methods, the legacy PCI register, etc.

I'm planning to write a backlight generic driver which can switch between the backlight drivers when ACPI video driver, which is the default one, doesn't work.
Comment 44 Zhang Rui 2010-09-27 03:12:28 UTC
*** Bug 15513 has been marked as a duplicate of this bug. ***
Comment 45 Zhang Rui 2010-09-27 03:28:39 UTC
*** Bug 16379 has been marked as a duplicate of this bug. ***
Comment 46 Zhang Rui 2010-09-30 05:16:30 UTC
*** Bug 16391 has been marked as a duplicate of this bug. ***
Comment 47 Zhang Rui 2010-09-30 05:30:44 UTC

*** This bug has been marked as a duplicate of bug 19342 ***

Note You need to log in before you can comment on or make changes to this bug.