* Takashi Iwai -- Thursday 05 May 2011:
Try the fixed patch below.
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 456f404..4c6e187 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -332,6 +332,7 @@ typedef struct drm_i915_private { struct intel_overlay *overlay;
/* LVDS info */
- int backlight_combination_mode; /* 0=unknown, -1=no, 1=yes */ int backlight_level; /* restore backlight to this value */ bool backlight_enabled; struct drm_display_mode *panel_fixed_mode;
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index f8f86e5..5a6be04 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -115,14 +115,24 @@ done: static int is_backlight_combination_mode(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private;
- if (INTEL_INFO(dev)->gen >= 4)
return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;
- if (IS_GEN2(dev))
return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;
- return 0;
- int combo_mode;
- u8 lbpc;
- if (dev_priv->backlight_combination_mode)
return dev_priv->backlight_combination_mode > 0;
- pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
- if (!lbpc)
combo_mode = 0;
- else if (INTEL_INFO(dev)->gen >= 4)
combo_mode = I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;
- else if (IS_GEN2(dev))
combo_mode = I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;
- else
combo_mode = 0;
- dev_priv->backlight_combination_mode = combo_mode ? 1 : -1;
- return combo_mode;
}
static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv)
The first patch had a problem. Without the lbpc check for zero the backlight still stayed off and could only be activated with the brightness-down key. This revised patch works correctly for me. Thanks!
m.
* Melchior FRANZ -- Thursday 05 May 2011:
This revised patch works correctly for me.
... and changing backlight brightness worked with acpi_osi=Linux, too. Unfortunately, that does no longer work now, although I haven't changed anything. Pressing the brightness buttons causes some ACPI debug output, but it doesn't adjust anything.
m.
Hi Melchior,
於 五,2011-05-06 於 10:52 +0200,Melchior FRANZ 提到:
- Melchior FRANZ -- Thursday 05 May 2011:
This revised patch works correctly for me.
... and changing backlight brightness worked with acpi_osi=Linux, too. Unfortunately, that does no longer work now, although I haven't changed anything. Pressing the brightness buttons causes some ACPI debug output, but it doesn't adjust anything.
m.
hmm........ Takashi's patch works before, but doesn't work now?
Does that because my new patch for bko#34142 ? Could you please add acer-wmi to /etc/modprobe.d/blacklist then reboot machine ?
Step: - add acer-wmi to /etc/modprobe.d/blacklist - shutdown your machine - remove AC power and notebook's battery - plugin AC power then boot your notebook - check the brightness control
Thank's Joey Lee
* Joey Lee -- Friday 06 May 2011:
於 五,2011-05-06 於 10:52 +0200,Melchior FRANZ 提到:
... and changing backlight brightness worked with acpi_osi=Linux, too. Unfortunately, that does no longer work now, although I haven't changed anything. Pressing the brightness buttons causes some ACPI debug output, but it doesn't adjust anything.
hmm........ Takashi's patch works before, but doesn't work now?
Argh ... sorry Takashi. Joey is right. I thought I had tested that, but apparently not. Indeed, your last patch prevents the backlight from being turned off, but it also breaks the brightness adjustment keys at runtime with acpi_osi=Linux. And without that it doesn't work, anyway, just like before. I'll add some more debug messages ...
Does that because my new patch for bko#34142 ? Could you please add acer-wmi to /etc/modprobe.d/blacklist then reboot machine ?
Done. No, your patch is not involved. But backing out Takashi's patch and re-applying confirmed that it's that patch.
m.
* Melchior FRANZ -- Friday 06 May 2011:
last patch prevents the backlight from being turned off, but it also breaks the brightness adjustment keys at runtime with acpi_osi=Linux.
It has turned out that acpi key events seem to be handled correctly and even the state of /sys/class/backlight/acer-wmi/brightness is updated accordingly. The only problem is that this maintained brightness state isn't applied to the actual backlight. It remains at highest level. Google pointed me to this workaround for another Acer notebook:
https://help.ubuntu.com/community/AspireTimeline/Fixes#Alternative%20fix%20f...
This uses the acpid to write the brightness value to the display using setpci. And this works on my notebook as well (Acer Travelmate 5735Z-452G32Mnss). Not pretty but better than nothing. Is Acer not able to build proper notebooks? Or is it a kernel bug?
m.
於 六,2011-05-07 於 22:22 +0200,Melchior FRANZ 提到:
- Melchior FRANZ -- Friday 06 May 2011:
last patch prevents the backlight from being turned off, but it also breaks the brightness adjustment keys at runtime with acpi_osi=Linux.
It has turned out that acpi key events seem to be handled correctly and even the state of /sys/class/backlight/acer-wmi/brightness is
That's interesting for acer-wmi generated brightness interface when this machine declare acpi brightness interface in DSDT.
updated accordingly. The only problem is that this maintained
Does it work to you direct control brightness by access by /sys/class/backlight/acer-wmi/brightness ?
brightness state isn't applied to the actual backlight. It remains at highest level. Google pointed me to this workaround for another Acer notebook:
https://help.ubuntu.com/community/AspireTimeline/Fixes#Alternative%20fix%20f...
This uses the acpid to write the brightness value to the display using setpci. And this works on my notebook as well (Acer Travelmate
As I remember, use setpci to control brightness is not recommended because BIOS or ACPI will also touch brightness level. That will be better control brightness by the function that was provided by BIOS. e.g. ACPI or WMI interface, or direct control by EC.
That means that will be better fix your Fn key control brightness like before, you just need press Fn key to change brightness and don't need have any workaround.
5735Z-452G32Mnss). Not pretty but better than nothing. Is Acer not able to build proper notebooks? Or is it a kernel bug?
m.
Looks like current status is we try to fix bko#31522 but the patch causes your brightness no work by press Fn key even with acpi_osi=Linux. Does it right?
Could you please also help to check: replace acpi_osi=Linux by acpi_osi="!Windows 2006"
Does it also works to you for backlight control?
Thank's Joey Lee
* Joey Lee -- Sunday 08 May 2011:
於 六,2011-05-07 於 22:22 +0200,Melchior FRANZ 提到:
It has turned out that acpi key events seem to be handled correctly and even the state of /sys/class/backlight/acer-wmi/brightness is
That's interesting for acer-wmi generated brightness interface when this machine declare acpi brightness interface in DSDT.
I'm sorry to give contradicting info. Yesterday I saw a subdir acer-wmi (or acer_wmi) in /sys/class/backlight/ during one of my tests (with/without acer_wmi, with/without acpi_osi=Linux). Now I left acpi_osi=Linux away and allow acer_wmi, and it's subdir acpi_video0. Next time I'll make notes.
Does it work to you direct control brightness by access by /sys/class/backlight/acer-wmi/brightness ?
No. A number written to this virtual file is accepted and remembered, but it doesn't actually change the brightness. It takes setpci to do that.
As I remember, use setpci to control brightness is not recommended because BIOS or ACPI will also touch brightness level. That will be better control brightness by the function that was provided by BIOS. e.g. ACPI or WMI interface, or direct control by EC.
Well, sounds plausible. And I wouldn't do it if it weren't the only way at the moment. :-)
That means that will be better fix your Fn key control brightness like before, you just need press Fn key to change brightness and don't need have any workaround.
OK. I have added a lot of debug messages to intel_panel.c yesterday. All it told me was that it seems to work correctly wiht acpi_osi=Linux. Except that it doesn't actually change the brightness. Without acpi_osi the functions aren't called at all and none of my messages showed up.
Looks like current status is we try to fix bko#31522 but the patch causes your brightness no work by press Fn key even with acpi_osi=Linux. Does it right?
The history is: with acpi_osi=Linux everything worked with 2.6.38-rc8. With 2.6.38 the screen stayed black. The patch that only ignored lbpc=0 worked (IIRC) including key adjustment. Later patches broke keys.
replace acpi_osi=Linux by acpi_osi="!Windows 2006"
Does it also works to you for backlight control?
No, doesn't work.
m.
Add Cc. Michael Chang for he is our i915 expert.
Hi Melchior,
於 日,2011-05-08 於 16:05 +0200,Melchior FRANZ 提到:
Does it work to you direct control brightness by access by /sys/class/backlight/acer-wmi/brightness ?
No. A number written to this virtual file is accepted and remembered, but it doesn't actually change the brightness. It takes setpci to do that.
I thought the video driver still is the KEY component for backlight issues, need fix the problem in video driver first.
As I remember, use setpci to control brightness is not recommended because BIOS or ACPI will also touch brightness level. That will be better control brightness by the function that was provided by BIOS. e.g. ACPI or WMI interface, or direct control by EC.
Well, sounds plausible. And I wouldn't do it if it weren't the only way at the moment. :-)
That means that will be better fix your Fn key control brightness like before, you just need press Fn key to change brightness and don't need have any workaround.
OK. I have added a lot of debug messages to intel_panel.c yesterday. All it told me was that it seems to work correctly wiht acpi_osi=Linux. Except that it doesn't actually change the brightness. Without acpi_osi the functions aren't called at all and none of my messages showed up.
I traced _Q event in your DSDT, when acpi_osi=Linux, it run the Intel OpRegion logic for change brightness. And, finally, intel_opregion will access the function the were provided by intel_panel. So, the problem still back to intel_panel.
After discuss with Michael chang, we thought there have problem in your brightness level after add combination mode:
vi driver/gpu/drm/i915/intel_panel.c
void intel_panel_set_backlight(struct drm_device *dev, u32 level) { struct drm_i915_private *dev_priv = dev->dev_private; u32 tmp;
DRM_DEBUG_DRIVER("set backlight PWM = %d\n", level);
if (HAS_PCH_SPLIT(dev)) return intel_pch_panel_set_backlight(dev, level);
if (is_backlight_combination_mode(dev)){ u32 max = intel_panel_get_max_backlight(dev); u8 lbpc;
lbpc = level * 0xfe / max + 1; level /= lbpc; /* maybe the level changed by lbpc */ pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); }
tmp = I915_READ(BLC_PWM_CTL); if (IS_PINEVIEW(dev)) { tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); level <<= 1; } else tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; I915_WRITE(BLC_PWM_CTL, tmp | level); }
We need to know some run time value when intel_panel_set_backlight call by funciton key. Please help to apply the attached debug patch to intel_panel.c then attached dmesg.
Looks like current status is we try to fix bko#31522 but the patch causes your brightness no work by press Fn key even with acpi_osi=Linux. Does it right?
The history is: with acpi_osi=Linux everything worked with 2.6.38-rc8. With 2.6.38 the screen stayed black. The patch that only ignored lbpc=0 worked (IIRC) including key adjustment. Later patches broke keys.
replace acpi_osi=Linux by acpi_osi="!Windows 2006"
Does it also works to you for backlight control?
No, doesn't work.
We can test the acpi_osi="!Windows 2006" again after we fix the i915's problem.
Thank's Joey Lee
The following is debug patch, and please add kernel parameter drm.debug=0x02 :
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index f8f86e5..f62dbd9 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -236,17 +236,22 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) u32 max = intel_panel_get_max_backlight(dev); u8 lbpc;
+ DRM_DEBUG_DRIVER("set backlight max = % lbpc = level * 0xfe / max + 1; + DRM_DEBUG_DRIVER("set backlight lbpc = %d\n", lbpc); level /= lbpc; pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); }
tmp = I915_READ(BLC_PWM_CTL); + DRM_DEBUG_DRIVER("set backlight tmp(1) = %d\n", tmp); if (IS_PINEVIEW(dev)) { tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); level <<= 1; } else tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; + DRM_DEBUG_DRIVER("set backlight tmp(2) = %d\n", tmp); + DRM_DEBUG_DRIVER("set backlight level = %d\n", level); I915_WRITE(BLC_PWM_CTL, tmp | level); }
At Mon, 09 May 2011 02:50:50 -0600, Joey Lee wrote:
Add Cc. Michael Chang for he is our i915 expert.
Hi Melchior,
於 日,2011-05-08 於 16:05 +0200,Melchior FRANZ 提到:
Does it work to you direct control brightness by access by /sys/class/backlight/acer-wmi/brightness ?
No. A number written to this virtual file is accepted and remembered, but it doesn't actually change the brightness. It takes setpci to do that.
I thought the video driver still is the KEY component for backlight issues, need fix the problem in video driver first.
As I remember, use setpci to control brightness is not recommended because BIOS or ACPI will also touch brightness level. That will be better control brightness by the function that was provided by BIOS. e.g. ACPI or WMI interface, or direct control by EC.
Well, sounds plausible. And I wouldn't do it if it weren't the only way at the moment. :-)
That means that will be better fix your Fn key control brightness like before, you just need press Fn key to change brightness and don't need have any workaround.
OK. I have added a lot of debug messages to intel_panel.c yesterday. All it told me was that it seems to work correctly wiht acpi_osi=Linux. Except that it doesn't actually change the brightness. Without acpi_osi the functions aren't called at all and none of my messages showed up.
I traced _Q event in your DSDT, when acpi_osi=Linux, it run the Intel OpRegion logic for change brightness. And, finally, intel_opregion will access the function the were provided by intel_panel. So, the problem still back to intel_panel.
After discuss with Michael chang, we thought there have problem in your brightness level after add combination mode:
vi driver/gpu/drm/i915/intel_panel.c
void intel_panel_set_backlight(struct drm_device *dev, u32 level) { struct drm_i915_private *dev_priv = dev->dev_private; u32 tmp;
DRM_DEBUG_DRIVER("set backlight PWM = %d\n", level); if (HAS_PCH_SPLIT(dev)) return intel_pch_panel_set_backlight(dev, level); if (is_backlight_combination_mode(dev)){ u32 max = intel_panel_get_max_backlight(dev); u8 lbpc; lbpc = level * 0xfe / max + 1; level /= lbpc; /* maybe the level changed by lbpc */ pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); } tmp = I915_READ(BLC_PWM_CTL); if (IS_PINEVIEW(dev)) { tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); level <<= 1; } else tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; I915_WRITE(BLC_PWM_CTL, tmp | level);
}
We need to know some run time value when intel_panel_set_backlight call by funciton key.
Yes, that'll help understanding.
Please help to apply the attached debug patch to intel_panel.c then attached dmesg.
The patch has an obvious typo :) Also, we should track the value in intel_panel_get_backlight(), too.
Takashi
Looks like current status is we try to fix bko#31522 but the patch causes your brightness no work by press Fn key even with acpi_osi=Linux. Does it right?
The history is: with acpi_osi=Linux everything worked with 2.6.38-rc8. With 2.6.38 the screen stayed black. The patch that only ignored lbpc=0 worked (IIRC) including key adjustment. Later patches broke keys.
replace acpi_osi=Linux by acpi_osi="!Windows 2006"
Does it also works to you for backlight control?
No, doesn't work.
We can test the acpi_osi="!Windows 2006" again after we fix the i915's problem.
Thank's Joey Lee
The following is debug patch, and please add kernel parameter drm.debug=0x02 :
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index f8f86e5..f62dbd9 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -236,17 +236,22 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) u32 max = intel_panel_get_max_backlight(dev); u8 lbpc;
DRM_DEBUG_DRIVER("set backlight max = % lbpc = level * 0xfe / max + 1;
DRM_DEBUG_DRIVER("set backlight lbpc = %d\n", lbpc);
level /= lbpc; pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); }
tmp = I915_READ(BLC_PWM_CTL);
DRM_DEBUG_DRIVER("set backlight tmp(1) = %d\n", tmp); if (IS_PINEVIEW(dev)) { tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); level <<= 1; } else tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK;
DRM_DEBUG_DRIVER("set backlight tmp(2) = %d\n", tmp);
DRM_DEBUG_DRIVER("set backlight level = %d\n", level); I915_WRITE(BLC_PWM_CTL, tmp | level);
}
於 一,2011-05-09 於 11:00 +0200,Takashi Iwai 提到:
At Mon, 09 May 2011 02:50:50 -0600, Joey Lee wrote:
We need to know some run time value when intel_panel_set_backlight call by funciton key.
Yes, that'll help understanding.
Please help to apply the attached debug patch to intel_panel.c then attached dmesg.
The patch has an obvious typo :) Also, we should track the value in intel_panel_get_backlight(), too.
Takashi
Thank's for Takashi's review and sorry for my typo. Follow Takashi's suggestion, I added a debug message in get_backlight, the following is new debug patch:
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index f8f86e5..9695840 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -199,6 +199,7 @@ u32 intel_panel_get_backlight(struct drm_device *dev) val = I915_READ(BLC_PWM_CPU_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; } else { val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; + DRM_DEBUG_DRIVER("get backlight val = %d\n", val); if (IS_PINEVIEW(dev)) val >>= 1;
@@ -236,17 +237,22 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) u32 max = intel_panel_get_max_backlight(dev); u8 lbpc;
+ DRM_DEBUG_DRIVER("set backlight max = %d\n", max); lbpc = level * 0xfe / max + 1; + DRM_DEBUG_DRIVER("set backlight lbpc = %d\n", lbpc); level /= lbpc; pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc); }
tmp = I915_READ(BLC_PWM_CTL); + DRM_DEBUG_DRIVER("set backlight tmp(1) = %d\n", tmp); if (IS_PINEVIEW(dev)) { tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); level <<= 1; } else tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK; + DRM_DEBUG_DRIVER("set backlight tmp(2) = %d\n", tmp); + DRM_DEBUG_DRIVER("set backlight level = %d\n", level); I915_WRITE(BLC_PWM_CTL, tmp | level); }
* Joey Lee -- Monday 09 May 2011:
The following is debug patch, and please add kernel parameter drm.debug=0x02 :
The result is with acpi_osi=Linux:
boot phase: [ 3.310274] [drm:intel_panel_get_backlight], get backlight val = 2890 [ 3.310280] [drm:intel_panel_get_backlight], get backlight PWM = 2890 [ 3.310615] [drm:intel_panel_get_backlight], get backlight val = 2890 [ 3.310617] [drm:intel_panel_get_backlight], get backlight PWM = 2890 [ 3.310619] [drm:intel_panel_set_backlight], set backlight PWM = 0 [ 3.310622] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401930 [ 3.310624] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 3.310626] [drm:intel_panel_set_backlight], set backlight level = 0
[ 3.641522] [drm:intel_panel_set_backlight], set backlight PWM = 2890 [ 3.641525] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040 [ 3.641527] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 3.641529] [drm:intel_panel_set_backlight], set backlight level = 2890
[ 11.410563] video LNXVIDEO:01: Restoring backlight state
brightness up: [no output]
brightness down: [ 152.697127] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 152.697136] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 152.697141] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401930 [ 152.697146] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 152.697150] [drm:intel_panel_set_backlight], set backlight level = 283
[ 166.720631] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 166.720640] [drm:intel_panel_set_backlight], set backlight PWM = 578 [ 166.720645] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 166.720649] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 166.720654] [drm:intel_panel_set_backlight], set backlight level = 578
[ 178.091776] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 178.091784] [drm:intel_panel_set_backlight], set backlight PWM = 861 [ 178.091789] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399618 [ 178.091793] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 178.091797] [drm:intel_panel_set_backlight], set backlight level = 861
[ 188.888370] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 188.888379] [drm:intel_panel_set_backlight], set backlight PWM = 1156 [ 188.888383] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399901 [ 188.888388] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 188.888392] [drm:intel_panel_set_backlight], set backlight level = 1156
[ 196.411657] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 196.411665] [drm:intel_panel_set_backlight], set backlight PWM = 1439 [ 196.411670] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400196 [ 196.411674] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 196.411678] [drm:intel_panel_set_backlight], set backlight level = 1439
[ 201.256229] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 201.256238] [drm:intel_panel_set_backlight], set backlight PWM = 1734 [ 201.256243] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400479 [ 201.256247] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 201.256252] [drm:intel_panel_set_backlight], set backlight level = 1734
[ 206.939838] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 206.939846] [drm:intel_panel_set_backlight], set backlight PWM = 2017 [ 206.939851] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400774 [ 206.939856] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 206.939860] [drm:intel_panel_set_backlight], set backlight level = 2017
[ 213.779732] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 213.779740] [drm:intel_panel_set_backlight], set backlight PWM = 2312 [ 213.779744] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401057 [ 213.779749] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 213.779753] [drm:intel_panel_set_backlight], set backlight level = 2312
[ 222.583806] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 222.583814] [drm:intel_panel_set_backlight], set backlight PWM = 2595 [ 222.583819] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401352 [ 222.583824] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 222.583828] [drm:intel_panel_set_backlight], set backlight level = 2595
[ 229.345860] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 229.345870] [drm:intel_panel_set_backlight], set backlight PWM = 2595 [ 229.345874] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401635 [ 229.345879] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 229.345883] [drm:intel_panel_set_backlight], set backlight level = 2595
brightness up: [ 240.594464] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.594474] [drm:intel_panel_set_backlight], set backlight PWM = 2312 [ 240.594479] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401635 [ 240.594483] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.594487] [drm:intel_panel_set_backlight], set backlight level = 2312
[ 240.816722] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.816730] [drm:intel_panel_set_backlight], set backlight PWM = 2017 [ 240.816734] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401352 [ 240.816739] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.816743] [drm:intel_panel_set_backlight], set backlight level = 2017
[ 240.999973] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.999981] [drm:intel_panel_set_backlight], set backlight PWM = 1734 [ 240.999985] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401057 [ 240.999990] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.999994] [drm:intel_panel_set_backlight], set backlight level = 1734
[ 241.212456] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 241.212464] [drm:intel_panel_set_backlight], set backlight PWM = 1439 [ 241.212469] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400774 [ 241.212473] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 241.212478] [drm:intel_panel_set_backlight], set backlight level = 1439
[ 241.395611] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 241.395619] [drm:intel_panel_set_backlight], set backlight PWM = 1156 [ 241.395624] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400479 [ 241.395628] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 241.395633] [drm:intel_panel_set_backlight], set backlight level = 1156
[ 242.039460] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.039470] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 242.039475] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400196 [ 242.039479] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.039484] [drm:intel_panel_set_backlight], set backlight level = 283
[ 242.044495] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.044502] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 242.044507] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 242.044511] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.044515] [drm:intel_panel_set_backlight], set backlight level = 283
[ 242.077032] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.077038] [drm:intel_panel_set_backlight], set backlight PWM = 0 [ 242.077043] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 242.077047] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.077052] [drm:intel_panel_set_backlight], set backlight level = 0
m.
From the log, it looks like is_backlight_combination_mode is evaluated false
which contradicts with the topic we are discussed. Regardless of the combination_mode, the log seems to work .. weird.
2011/5/9 Melchior FRANZ melchior.franz@gmail.com
- Joey Lee -- Monday 09 May 2011:
The following is debug patch, and please add kernel parameter drm.debug=0x02 :
The result is with acpi_osi=Linux:
boot phase: [ 3.310274] [drm:intel_panel_get_backlight], get backlight val = 2890 [ 3.310280] [drm:intel_panel_get_backlight], get backlight PWM = 2890 [ 3.310615] [drm:intel_panel_get_backlight], get backlight val = 2890 [ 3.310617] [drm:intel_panel_get_backlight], get backlight PWM = 2890 [ 3.310619] [drm:intel_panel_set_backlight], set backlight PWM = 0 [ 3.310622] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401930 [ 3.310624] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 3.310626] [drm:intel_panel_set_backlight], set backlight level = 0
[ 3.641522] [drm:intel_panel_set_backlight], set backlight PWM = 2890 [ 3.641525] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040 [ 3.641527] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 3.641529] [drm:intel_panel_set_backlight], set backlight level = 2890
[ 11.410563] video LNXVIDEO:01: Restoring backlight state
brightness up: [no output]
brightness down: [ 152.697127] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 152.697136] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 152.697141] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401930 [ 152.697146] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 152.697150] [drm:intel_panel_set_backlight], set backlight level = 283
[ 166.720631] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 166.720640] [drm:intel_panel_set_backlight], set backlight PWM = 578 [ 166.720645] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 166.720649] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 166.720654] [drm:intel_panel_set_backlight], set backlight level = 578
[ 178.091776] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 178.091784] [drm:intel_panel_set_backlight], set backlight PWM = 861 [ 178.091789] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399618 [ 178.091793] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 178.091797] [drm:intel_panel_set_backlight], set backlight level = 861
[ 188.888370] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 188.888379] [drm:intel_panel_set_backlight], set backlight PWM = 1156 [ 188.888383] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399901 [ 188.888388] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 188.888392] [drm:intel_panel_set_backlight], set backlight level = 1156
[ 196.411657] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 196.411665] [drm:intel_panel_set_backlight], set backlight PWM = 1439 [ 196.411670] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400196 [ 196.411674] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 196.411678] [drm:intel_panel_set_backlight], set backlight level = 1439
[ 201.256229] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 201.256238] [drm:intel_panel_set_backlight], set backlight PWM = 1734 [ 201.256243] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400479 [ 201.256247] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 201.256252] [drm:intel_panel_set_backlight], set backlight level = 1734
[ 206.939838] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 206.939846] [drm:intel_panel_set_backlight], set backlight PWM = 2017 [ 206.939851] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400774 [ 206.939856] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 206.939860] [drm:intel_panel_set_backlight], set backlight level = 2017
[ 213.779732] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 213.779740] [drm:intel_panel_set_backlight], set backlight PWM = 2312 [ 213.779744] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401057 [ 213.779749] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 213.779753] [drm:intel_panel_set_backlight], set backlight level = 2312
[ 222.583806] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 222.583814] [drm:intel_panel_set_backlight], set backlight PWM = 2595 [ 222.583819] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401352 [ 222.583824] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 222.583828] [drm:intel_panel_set_backlight], set backlight level = 2595
[ 229.345860] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 229.345870] [drm:intel_panel_set_backlight], set backlight PWM = 2595 [ 229.345874] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401635 [ 229.345879] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 229.345883] [drm:intel_panel_set_backlight], set backlight level = 2595
brightness up: [ 240.594464] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.594474] [drm:intel_panel_set_backlight], set backlight PWM = 2312 [ 240.594479] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401635 [ 240.594483] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.594487] [drm:intel_panel_set_backlight], set backlight level = 2312
[ 240.816722] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.816730] [drm:intel_panel_set_backlight], set backlight PWM = 2017 [ 240.816734] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401352 [ 240.816739] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.816743] [drm:intel_panel_set_backlight], set backlight level = 2017
[ 240.999973] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.999981] [drm:intel_panel_set_backlight], set backlight PWM = 1734 [ 240.999985] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401057 [ 240.999990] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.999994] [drm:intel_panel_set_backlight], set backlight level = 1734
[ 241.212456] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 241.212464] [drm:intel_panel_set_backlight], set backlight PWM = 1439 [ 241.212469] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400774 [ 241.212473] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 241.212478] [drm:intel_panel_set_backlight], set backlight level = 1439
[ 241.395611] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 241.395619] [drm:intel_panel_set_backlight], set backlight PWM = 1156 [ 241.395624] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400479 [ 241.395628] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 241.395633] [drm:intel_panel_set_backlight], set backlight level = 1156
[ 242.039460] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.039470] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 242.039475] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400196 [ 242.039479] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.039484] [drm:intel_panel_set_backlight], set backlight level = 283
[ 242.044495] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.044502] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 242.044507] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 242.044511] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.044515] [drm:intel_panel_set_backlight], set backlight level = 283
[ 242.077032] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.077038] [drm:intel_panel_set_backlight], set backlight PWM = 0 [ 242.077043] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 242.077047] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.077052] [drm:intel_panel_set_backlight], set backlight level = 0
m.
Melchior,
Could you please try this patch and get the log ? We wonder why is_backlight_combination_mode () returns false. We all knew that it returns true during booting (and takashi's fix works to fix the blackscreen for you) and it's unlikely to become false afterward. Perhaps it was changed wrongly ..
I speculate that if it returns true matters because it would touch the LPBC register and your problem might get fixed.
Thanks in advance. :)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index a06ff07..8f14bfa 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -116,12 +116,21 @@ static int Melchior(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private;
- if (INTEL_INFO(dev)->gen >= 4) - return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE; + if (INTEL_INFO(dev)->gen >= 4) {
- if (IS_GEN2(dev)) - return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE; + int ret = I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE; + DRM_DEBUG_DRIVER("BLM_COMBINATION_MODE = %d\n", ret); + return ret; + } + + if (IS_GEN2(dev)) {
+ int ret = I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE; + DRM_DEBUG_DRIVER("BLM_LEGACY_MODE = %d\n", ret); + return ret; + } + + DRM_DEBUG_DRIVER("Do nothing, return false\n"); return 0; }
2011/5/9 Michael Chang mchang@novell.com:
From the log, it looks like is_backlight_combination_mode is evaluated false which contradicts with the topic we are discussed. Regardless of the combination_mode, the log seems to work .. weird.
2011/5/9 Melchior FRANZ melchior.franz@gmail.com
- Joey Lee -- Monday 09 May 2011:
The following is debug patch, and please add kernel parameter drm.debug=0x02 :
The result is with acpi_osi=Linux:
boot phase: [ 3.310274] [drm:intel_panel_get_backlight], get backlight val = 2890 [ 3.310280] [drm:intel_panel_get_backlight], get backlight PWM = 2890 [ 3.310615] [drm:intel_panel_get_backlight], get backlight val = 2890 [ 3.310617] [drm:intel_panel_get_backlight], get backlight PWM = 2890 [ 3.310619] [drm:intel_panel_set_backlight], set backlight PWM = 0 [ 3.310622] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401930 [ 3.310624] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 3.310626] [drm:intel_panel_set_backlight], set backlight level = 0
[ 3.641522] [drm:intel_panel_set_backlight], set backlight PWM = 2890 [ 3.641525] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040 [ 3.641527] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 3.641529] [drm:intel_panel_set_backlight], set backlight level = 2890
[ 11.410563] video LNXVIDEO:01: Restoring backlight state
brightness up: [no output]
brightness down: [ 152.697127] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 152.697136] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 152.697141] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401930 [ 152.697146] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 152.697150] [drm:intel_panel_set_backlight], set backlight level = 283
[ 166.720631] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 166.720640] [drm:intel_panel_set_backlight], set backlight PWM = 578 [ 166.720645] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 166.720649] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 166.720654] [drm:intel_panel_set_backlight], set backlight level = 578
[ 178.091776] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 178.091784] [drm:intel_panel_set_backlight], set backlight PWM = 861 [ 178.091789] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399618 [ 178.091793] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 178.091797] [drm:intel_panel_set_backlight], set backlight level = 861
[ 188.888370] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 188.888379] [drm:intel_panel_set_backlight], set backlight PWM = 1156 [ 188.888383] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399901 [ 188.888388] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 188.888392] [drm:intel_panel_set_backlight], set backlight level = 1156
[ 196.411657] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 196.411665] [drm:intel_panel_set_backlight], set backlight PWM = 1439 [ 196.411670] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400196 [ 196.411674] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 196.411678] [drm:intel_panel_set_backlight], set backlight level = 1439
[ 201.256229] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 201.256238] [drm:intel_panel_set_backlight], set backlight PWM = 1734 [ 201.256243] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400479 [ 201.256247] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 201.256252] [drm:intel_panel_set_backlight], set backlight level = 1734
[ 206.939838] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 206.939846] [drm:intel_panel_set_backlight], set backlight PWM = 2017 [ 206.939851] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400774 [ 206.939856] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 206.939860] [drm:intel_panel_set_backlight], set backlight level = 2017
[ 213.779732] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 213.779740] [drm:intel_panel_set_backlight], set backlight PWM = 2312 [ 213.779744] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401057 [ 213.779749] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 213.779753] [drm:intel_panel_set_backlight], set backlight level = 2312
[ 222.583806] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 222.583814] [drm:intel_panel_set_backlight], set backlight PWM = 2595 [ 222.583819] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401352 [ 222.583824] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 222.583828] [drm:intel_panel_set_backlight], set backlight level = 2595
[ 229.345860] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 229.345870] [drm:intel_panel_set_backlight], set backlight PWM = 2595 [ 229.345874] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401635 [ 229.345879] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 229.345883] [drm:intel_panel_set_backlight], set backlight level = 2595
brightness up: [ 240.594464] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.594474] [drm:intel_panel_set_backlight], set backlight PWM = 2312 [ 240.594479] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401635 [ 240.594483] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.594487] [drm:intel_panel_set_backlight], set backlight level = 2312
[ 240.816722] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.816730] [drm:intel_panel_set_backlight], set backlight PWM = 2017 [ 240.816734] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401352 [ 240.816739] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.816743] [drm:intel_panel_set_backlight], set backlight level = 2017
[ 240.999973] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 240.999981] [drm:intel_panel_set_backlight], set backlight PWM = 1734 [ 240.999985] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189401057 [ 240.999990] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 240.999994] [drm:intel_panel_set_backlight], set backlight level = 1734
[ 241.212456] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 241.212464] [drm:intel_panel_set_backlight], set backlight PWM = 1439 [ 241.212469] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400774 [ 241.212473] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 241.212478] [drm:intel_panel_set_backlight], set backlight level = 1439
[ 241.395611] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 241.395619] [drm:intel_panel_set_backlight], set backlight PWM = 1156 [ 241.395624] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400479 [ 241.395628] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 241.395633] [drm:intel_panel_set_backlight], set backlight level = 1156
[ 242.039460] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.039470] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 242.039475] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189400196 [ 242.039479] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.039484] [drm:intel_panel_set_backlight], set backlight level = 283
[ 242.044495] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.044502] [drm:intel_panel_set_backlight], set backlight PWM = 283 [ 242.044507] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 242.044511] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.044515] [drm:intel_panel_set_backlight], set backlight level = 283
[ 242.077032] [drm:intel_panel_get_max_backlight], max backlight PWM = 2890 [ 242.077038] [drm:intel_panel_set_backlight], set backlight PWM = 0 [ 242.077043] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399323 [ 242.077047] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 242.077052] [drm:intel_panel_set_backlight], set backlight level = 0
m.
* Michael Chang -- Tuesday 10 May 2011:
Could you please try this patch and get the log ? We wonder why is_backlight_combination_mode () returns false.
This information was already buried in the bugzilla thread:
https://bugzilla.kernel.org/show_bug.cgi?id=31522 "It turned out that on this machine INTEL_INFO(dev)->gen equals 4, and is_backlight_combination_mode() returns 0x40000000."
But to say it again in your words: :-)
[drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 (0x40000000)
6x during boot-up, and several times later when changing the backlight brightness.
This was with 8b061610dac3a3b89770c85ad63b481a47b0c38e. And now I have a little shocker for you (and me): because this was a vanilla kernel (apart from these debug messages), the screen went black again, like I knew it. But pressing the "brightness down" key turns the backlight on! I can't believe that I haven't tested that. I guess I've only tried "brightness up" and "display toggle". Those don't turn backlight on. Or maybe somethine else relevant meanwhile changed in the i915 drivers. (I've regularly been updating to HEAD.)
So, the problem was just the initial state all the time?
m.
At Tue, 10 May 2011 13:08:23 +0200, Melchior FRANZ wrote:
- Michael Chang -- Tuesday 10 May 2011:
Could you please try this patch and get the log ? We wonder why is_backlight_combination_mode () returns false.
This information was already buried in the bugzilla thread:
https://bugzilla.kernel.org/show_bug.cgi?id=31522 "It turned out that on this machine INTEL_INFO(dev)->gen equals 4, and is_backlight_combination_mode() returns 0x40000000."
But to say it again in your words: :-)
[drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 (0x40000000)
6x during boot-up, and several times later when changing the backlight brightness.
This was with 8b061610dac3a3b89770c85ad63b481a47b0c38e. And now I have a little shocker for you (and me): because this was a vanilla kernel (apart from these debug messages), the screen went black again, like I knew it. But pressing the "brightness down" key turns the backlight on! I can't believe that I haven't tested that. I guess I've only tried "brightness up" and "display toggle". Those don't turn backlight on. Or maybe somethine else relevant meanwhile changed in the i915 drivers. (I've regularly been updating to HEAD.)
So, the problem was just the initial state all the time?
Looks so, indeed. Now, the question is what's the real cause.
IIRC, you reported that the backlight gets normal when you revert my commit in 2.6.38.x. So, this was regarded as a regression at first. But, one question remains: whether the backlight level control worked with the reverted kernel? Judging from the attempts so far, it looks like that only LBPC can adjust the level on your machine. If it's true, 2.6.38.0 shouldn't be able to adjust the level. If you can still change the level without LBPC, the former analysis was incorrect.
Also, with the latest 2.6.38.x, you found that the backlight gets back when you adjust the level down. Another question now is what happens if you again turn it up to the max level. Is the backlight still on?
If the backlight is kept on even with the max level, it implies that the problem is only the initial value; once when set correctly, it'll work fine after that. OTOH, if the backlight gets off again at max, it means that the max value (LBPC 0xfe) is a sort of out-of-range. Then LBPC calculation in the driver has to be modified.
thanks,
Takashi
* Takashi Iwai -- Sunday 15 May 2011:
IIRC, you reported that the backlight gets normal when you revert my commit in 2.6.38.x. So, this was regarded as a regression at first.
Yes. And it *is* a regression, which is the whole point of my initial complaint, as reported by Maciej in https://bugzilla.kernel.org/show_bug.cgi?id=31522
But, one question remains: whether the backlight level control worked with the reverted kernel?
Good point. Turns out it didn't work with 2.6.38-rc8 either. But it did work at some time before. (I use this notebook mainly as a terminal ATM, so I didn't care much for backlight level. This came up later during investigation.)
So the only thing that 2.6.38 broke was that the backlight was initially off. Adjustment had already been broken before (and works now again; sigh ... confused? I am! :-).
If you can still change the level without LBPC, the former analysis was incorrect.
I don't even know what an LBPC is, other than a variable named like that. So I'd need a hint for how to test that.
Also, with the latest 2.6.38.x, you found that the backlight gets back when you adjust the level down.
When I reported this, it was about 2.6.39-* and HEAD, not stable versions. But I tried now, and openSuSE's 2.6.38.6 behaves the same.
Another question now is what happens if you again turn it up to the max level. Is the backlight still on?
Yes. If the backlight was on at one point, then increasing the level to maximum never turned if off.
If the backlight is kept on even with the max level, it implies that the problem is only the initial value; once when set correctly, it'll work fine after that.
Yes, that's the case. (Except that after closing the lid it's off again.)
m.
2011/5/16 Melchior FRANZ melchior.franz@gmail.com:
I don't even know what an LBPC is, other than a variable named like that. So I'd need a hint for how to test that.
It resides at your vga adapter's pci configuration space, offset 0xf4.
You can know your LPBC value by: $ lspci -xxx -s 00:02.0 | awk '/^f0:/ {print $6}'
And alter it's value via setpci (assuming set it to max) $ setpci -s 00:02.0 F4.B=ff
I assume you've tried this .. as you report setpci works for you. :)
From your new attached log, In booting phase your LPBC is set to 255
and actual brightness is maximum (255*2890=736950). I see no other change after it until manual brightness change. This is a totally reversed to your problem.
Could you help to get the LPBC value in the initial dark condition? If it's not corresponds to 255, maybe something sneaks and changes it but not logged.
[ 3.125522] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 3.125525] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950 [ 3.125527] [drm:intel_panel_set_backlight], set backlight PWM = 736950 [ 3.125529] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 3.125531] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 3.125533] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950 [ 3.125535] [drm:intel_panel_set_backlight], set backlight max = 736950 [ 3.125537] [drm:intel_panel_set_backlight], set backlight lbpc = 255 [ 3.125544] [drm:intel_panel_set_backlight], set backlight level = 2890
Yes, that's the case. (Except that after closing the lid it's off again.)
Maybe this is another clue for root cause. Would it be convenient for you to gather the log?
1. $ dmesg -c 2. Close the lid 3. Open the lid 4. $ dmesg > dmesg.lid
Thanks a lot, Michael Chang
* Michael Chang -- Tuesday 17 May 2011: [LBPC]
You can know your LPBC value by: $ lspci -xxx -s 00:02.0 | awk '/^f0:/ {print $6}'
And alter it's value via setpci (assuming set it to max) $ setpci -s 00:02.0 F4.B=ff
I assume you've tried this .. as you report setpci works for you. :)
Ahh, yes, indeed. This lspci line (almost) always shows a value that corresponds with the actual backlight brightness, and both lines work with and without acpi_osi=Linux. (Whereas adjustment via keys only works *with* acpi_osi=Linux.) (Tested with 2.6.39-rc7/bd1a643e10)
Could you help to get the LPBC value in the initial dark condition? If it's not corresponds to 255, maybe something sneaks and changes it but not logged.
Initially (with acpi_osi=Linux) LPBC=0xff. After "brightness down" it's 0x19, and after then pressing "brightness up" it's 0x01. The lowest value I can achieve after pressing "brightness down" a few times is 0xe5, the highest is 0x01. Neither 0xff nor 0x00 can be reached via keys, but can (most of the time -- see below!) be set with the setpci line and give the expected results, backlight off and fully on. ("display toggle" has no effect on LBPC, btw.)
Setting 0xFF doesn't always turn the backlight off, though! If LBPC is at the (key) maximum 0x01, then setting 0xFF via setpci changes only the LBPC value as shown by lspci, but the backlight isn't actually turned off! If I then press "backlight darker" once (LBPC=0x19), then setting 0xFF via setpci works again.
- $ dmesg -c
- Close the lid
- Open the lid
- $ dmesg > dmesg.lid
The results are:
[ 188.571040] [drm:intel_panel_set_backlight], set backlight PWM = 736950 [ 188.571048] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 188.571054] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 188.571059] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950 [ 188.571064] [drm:intel_panel_set_backlight], set backlight max = 736950 [ 188.571069] [drm:intel_panel_set_backlight], set backlight lbpc = 255 [ 188.571075] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040 [ 188.571080] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 188.571084] [drm:intel_panel_set_backlight], [ 188.571088] [drm:intel_opregion_asle_intr], non asle set request?? [ 188.571093] set backlight level = 2890
The backlight is off now, as always after closing/reopening the lid, and LPBC=0xff.
m.
PS: I'd be willing to join an irc.freenode.net channel in case you or anyone else wants quicker ("live") responses to such queries.
Melchior,
I want to double check with you. If you change brightness from lowest to highest, the LPBC value changes this way
Highest Lowest 0x10 , 0x19 ...... 0xe5
And vice versa, from Lowest to Highest
Lowest Highest 0xe5 , ...... 0x19 0x10
If above is true, then you have a very particular notebook that reverse the sense of the LPBC values .... I don't know who ever came across such device. wow.
Regarding that your brightness control key, due to that it is controlled by acer_wmi and likely that BIOS aware this, it would do brightness in a reversed way. I think Joey would check DSDT and see any clue or evidence for this. OTOH the i915 driver didn't aware of this and operates as usual sense that means falling into the trap.
PS. I see your log always reverse the sense of this LPBC value, now I know why. :)
Regards, Michael Chang
2011/5/17 Melchior FRANZ melchior.franz@gmail.com:
- Michael Chang -- Tuesday 17 May 2011:
[LBPC]
You can know your LPBC value by: $ lspci -xxx -s 00:02.0 | awk '/^f0:/ {print $6}'
And alter it's value via setpci (assuming set it to max) $ setpci -s 00:02.0 F4.B=ff
I assume you've tried this .. as you report setpci works for you. :)
Ahh, yes, indeed. This lspci line (almost) always shows a value that corresponds with the actual backlight brightness, and both lines work with and without acpi_osi=Linux. (Whereas adjustment via keys only works *with* acpi_osi=Linux.) (Tested with 2.6.39-rc7/bd1a643e10)
Could you help to get the LPBC value in the initial dark condition? If it's not corresponds to 255, maybe something sneaks and changes it but not logged.
Initially (with acpi_osi=Linux) LPBC=0xff. After "brightness down" it's 0x19, and after then pressing "brightness up" it's 0x01. The lowest value I can achieve after pressing "brightness down" a few times is 0xe5, the highest is 0x01. Neither 0xff nor 0x00 can be reached via keys, but can (most of the time -- see below!) be set with the setpci line and give the expected results, backlight off and fully on. ("display toggle" has no effect on LBPC, btw.)
Setting 0xFF doesn't always turn the backlight off, though! If LBPC is at the (key) maximum 0x01, then setting 0xFF via setpci changes only the LBPC value as shown by lspci, but the backlight isn't actually turned off! If I then press "backlight darker" once (LBPC=0x19), then setting 0xFF via setpci works again.
1. $ dmesg -c 2. Close the lid 3. Open the lid 4. $ dmesg > dmesg.lid
The results are:
[ 188.571040] [drm:intel_panel_set_backlight], set backlight PWM = 736950 [ 188.571048] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 188.571054] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 [ 188.571059] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950 [ 188.571064] [drm:intel_panel_set_backlight], set backlight max = 736950 [ 188.571069] [drm:intel_panel_set_backlight], set backlight lbpc = 255 [ 188.571075] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040 [ 188.571080] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040 [ 188.571084] [drm:intel_panel_set_backlight], [ 188.571088] [drm:intel_opregion_asle_intr], non asle set request?? [ 188.571093] set backlight level = 2890
The backlight is off now, as always after closing/reopening the lid, and LPBC=0xff.
m.
PS: I'd be willing to join an irc.freenode.net channel in case you or anyone else wants quicker ("live") responses to such queries.
Hey,
* Michael Chang -- Tuesday 17 May 2011:
If you change brightness from lowest to highest, the LPBC value changes this way
Highest Lowest 0x10 , 0x19 ...... 0xe5
Yes. (Though it's 0x01, not 0x10.)
---0xFF ... initial value and after closing/reopening lid | 0xE5 \ ... dark | 0xCC | | 0xB2 | (1)| 0x99 | | 0x7F |_____key adjustable range | 0x66 | | 0x4C | | 0x33 | -->0x19 | 0x01 / ... bright 0x00 ... also bright, only settable with setpci
(1) is the jump that resurrects the backlight from darkness by pressing the "brightness down" key
And again, if fully turned up via keys (and therefore at 0x01), then setting to 0xff with setpci doesn't turn it off. At all other key steps it does. :-)
If above is true, then you have a very particular notebook that reverse the sense of the LPBC values .... I don't know who ever came across such device. wow.
Maybe they screwed it up and therefore sold it with Linux ("linpus") and a custom driver preinstalled ...
Regarding that your brightness control key, due to that it is controlled by acer_wmi and likely that BIOS aware this, it would do brightness in a reversed way.
acer_wmi doesn't do the brightness adjustment. But maybe under "linpus" some variant of it did. (BTW: there are two keys on this notebook that aren't handled by the kernel, by X11 or even acer_wmi. There are just no events for them. Looks like another ACER brain damage err.. "capability". :-)
m.
At Sat, 7 May 2011 22:22:40 +0200, Melchior FRANZ wrote:
- Melchior FRANZ -- Friday 06 May 2011:
last patch prevents the backlight from being turned off, but it also breaks the brightness adjustment keys at runtime with acpi_osi=Linux.
It has turned out that acpi key events seem to be handled correctly and even the state of /sys/class/backlight/acer-wmi/brightness is updated accordingly. The only problem is that this maintained brightness state isn't applied to the actual backlight. It remains at highest level. Google pointed me to this workaround for another Acer notebook:
https://help.ubuntu.com/community/AspireTimeline/Fixes#Alternative%20fix%20f...
This uses the acpid to write the brightness value to the display using setpci. And this works on my notebook as well (Acer Travelmate 5735Z-452G32Mnss).
Then we miss something. With the hack above, you are doing nothing but writing LBPC register value externally from setpci. It implies that the write to LBPC basically works on your machine.
Takashi
dri-devel@lists.freedesktop.org