Re: ThinkPad X61 backlight brightness glitches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's the results of a first inspection of X61 BIOS 1.10 AML code:

Once *anything* calls either one of the _BCL methods, the display control
switches to "ACPI mode", and the keys will just generate an ACPI brightness
event (standard event, not a ibm-acpi HKEY event).

Thinkpad-acpi doesn't do it (execute _BCL) on purpose. A bug in
thinkpad-acpi's use of ACPICA or a bug in ACPICA might cause thinkpad-acpi
to execute _BCL.

video.c executes _BCL.  If it is ever loaded, the thinkpad will switch to
ACPI brightness mode, it doesn't matter if it is unloaded later.

Here's a patch that will cause thinkpad-acpi 0.18-20071203 (for 2.6.23, but
should apply on others too) to print the contents of NBCF, which is the
"brightness in ACPI mode" variable.  Please tell me what it says.

If NBCF is zero, then the problem is inside some contrieved logic in the AML
code, or even worse, inside the ACPI BIOS.  In that case, it might be best
to just teach thinkpad-acpi to always place the thinkpad in ACPI video
brightness mode, where its behaviour is at least more predictable...
(depends only on video.c behaviour, and the events are always the same).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index e35cbbf..36ea79b 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -4219,6 +4219,16 @@ static int __init brightness_check_std_acpi_support(void)
 	return (ACPI_SUCCESS(status) && found_node != NULL);
 }
 
+static int __init brightness_read_nbcf(void)
+{
+	int nbcf;
+
+	if (!acpi_evalf(root_handle, &nbcf, "NBCF", "d"))
+		nbcf = -1;
+	
+	return nbcf;
+}
+
 static int __init brightness_init(struct ibm_init_struct *iibm)
 {
 	int b;
@@ -4232,10 +4242,16 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
 		           "brightness support disabled by module parameter\n");
 		return 1;
 	} else if (brightness_enable > 1) {
+		printk(TPACPI_NOTICE
+		       "The ThinkPad reports NBCF (before probe) is %d\n",
+		       brightness_read_nbcf());
 		if (brightness_check_std_acpi_support()) {
 			printk(TPACPI_NOTICE
 			       "standard ACPI backlight interface "
 			       "available, not loading native one...\n");
+			printk(TPACPI_NOTICE
+			       "The ThinkPad reports NBCF (after probe) is %d\n",
+			       brightness_read_nbcf());
 			return 1;
 		}
 	}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux