brightness can't be adjusted on Baytrail-M. We will call ACPI _BCM method to notify BIOS and BIOS generate ASLE interrupt to VGA controller offset 0xE4. but there is no method to receive and handle this interrupt in i915. this only happens on Baytrail-M platform. please help to check. Thanks! kernel: 3.13-RC6
Did you compile in support for acpi and opregion?
Yes, but we didn't find any handle for ASLE interrupt in i915_irq.c and i915_opregion.c. could you help to check it? Thanks!
I couldn't find it either. Looks like we need to implement it.
See intel_opregion_asle_intr(). However, the asle interrupt is no longer within pipestat and it is not clear which spec the display engine interrupts actually follow. It could be as simple as diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index e95ec8d..69996ca 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1499,6 +1499,9 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg) if (pm_iir) gen6_rps_irq_handler(dev_priv, pm_iir); + if (iir & DE_GSE_IVB) + intel_opregion_asle_intr(dev); + I915_WRITE(GTIIR, gt_iir); I915_WRITE(GEN6_PMIIR, pm_iir); I915_WRITE(VLV_IIR, iir); but it probably requires the guilty party to come forward with the actual information.
Adding Todd since he's on a quest to find the correct BYT interrupt specs.
Or this: diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 1d44c793bdf4..b27878784ebf 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1479,6 +1479,9 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg) I915_READ(PORT_HOTPLUG_STAT); } + if (iir & I915_ASLE_INTERRUPT) + intel_opregion_asle_intr(dev); + if (pipe_stats[0] & PIPE_GMBUS_INTERRUPT_STATUS) gmbus_irq_handler(dev); Please test both Chris' and my batch and see what happens.
Side note, the world is moving towards backlight buttons generating input events (via ACPI or otherwise) to userspace, and userspace using kernel interfaces to adjust brightness. Eventually there will be no short circuit from BIOS back to the kernel for backlight; indeed this is already non-functional on some machines targeted at Windows 8.
Afaik we need this at least on some machines since the ACPI backlight uses OpRegion request to adjust the real hw backlight. So the flow on these machines is: 1. button press 2. ACPI button converted to input key event 3. Userspace calculates new backlight and frobs the ACPI backlight 4. ACPI stores request value in OpRegion and generates the special OpRegeion interrupt. 5. drm/i915 updates the backlight. 6. User is happy Do not ask, won't tell.
Tested patches in comment 4 and 6 separately but they still can't fix the issue.
Any other ideas on this one besides comment #4 and comment #6? I sprinkled some DRM_DEBUG_DRIVER in there and neither one ever gets hit.
Which device was this originally tested on? I tested with a Baytrail-M based Chromebook and the brightness adjustment buttons work.
Presumed fixed on latest -nightly. Please reopen if that's not the case.
OK, we will try. BTW, Whether the solution only related to the file drivers/gpu/drm/i915/i915_irq.c ? If yes, we will make a patch to 3.14 kernel, if not, could you help to provide the patch? due to we can't use latest nightly for the project.
Created attachment 99466 [details] dmesg_0520.log The brightness still can't be adjusted with 5/20 drm-intel nightly attached dmesg_0520.log
(In reply to comment #14) > Created attachment 99466 [details] > dmesg_0520.log Please add drm.debug=0xe and drop loglevel=0. > The brightness still can't be adjusted with 5/20 drm-intel nightly > attached dmesg_0520.log Is this what you keep getting in dmesg when you hit the hotkeys? [ 52.186865] ideapad_laptop: Unknown event: 15 Are you supposed to be using ideapad-laptop.c? For some reason it doesn't recognize your the events being generated. What do you have under /sys/class/backlight? Do the backlight interfaces work by echoing values to the brightness files?
(In reply to comment #15) > Is this what you keep getting in dmesg when you hit the hotkeys? > > [ 52.186865] ideapad_laptop: Unknown event: 15 CC David, perhaps he has ideas what ideapad-laptop is good for.
Created attachment 99939 [details] dmesg with drm.debug=0xe and removed loglevel=0 when press the brightness hotkey, it shows ideapad_laptop: Unkown event:15 ls /sys/class/backlight > acpi_video0 intel_backlight echo value to acpi_video0/brightness, brightness no change.(this is used for OS.) echo value to intel_backlight/brightness, brightness can be modified.
(In reply to comment #17) > Created attachment 99939 [details] > dmesg with drm.debug=0xe and removed loglevel=0 I don't see drm.debug=0xe nor debug messages. > when press the brightness hotkey, it shows ideapad_laptop: Unkown event:15 That's a problem, and one I can't help with. > ls /sys/class/backlight > > acpi_video0 intel_backlight > > echo value to acpi_video0/brightness, brightness no change.(this is used for > OS.) This is another problem. Aaron (CC), how does the asle irq get triggered? Can you debug this part please? > echo value to intel_backlight/brightness, brightness can be modified.
Created attachment 99991 [details] dmesg with drm.debug=0xe and removed loglevel=0 0528 Sorry, attached dmesg with drm.debug=0xe and removed loglevel=0 0528
We will check "when press the brightness hotkey, it shows ideapad_laptop: Unkown event:15" Thanks!
(In reply to comment #18) > (In reply to comment #17) > > Created attachment 99939 [details] > > dmesg with drm.debug=0xe and removed loglevel=0 > > I don't see drm.debug=0xe nor debug messages. > > > when press the brightness hotkey, it shows ideapad_laptop: Unkown event:15 > > That's a problem, and one I can't help with. > > > ls /sys/class/backlight > > > acpi_video0 intel_backlight > > > > echo value to acpi_video0/brightness, brightness no change.(this is used for > > OS.) > > This is another problem. Aaron (CC), how does the asle irq get triggered? > Can you debug this part please? By firmware ASL code to write 1 to the PCI ASLE register(0xe4) I suppose, which is done after firmware has set some appropriate value in some operation region registers(so that the i915 irq handler knows what service the firmware has requested). The problem is, firmware may not use operation region to control backlight in this system(acpidump should tell us this) and if i915 irq will handle that or not(I don't know much about this). Another problem for this system is that if it could receive any event on backlight hotkey press, the 'Unknown event: 15' looks problematic and should be taken care by the platform driver ideapad_laptop or udev's keymapping. Eva, if you run acpi_listen on cmdline and then press the backlight hotkey, did you see any output?
apci_listen result: video/brightnessdown BRTDN 00000087 00000000 video/brightnessdown BRTDN 00000087 00000000 K video/brightnessup BRTUP 00000086 00000000 video/brightnessup BRTUP 00000086 00000000 K
(In reply to comment #22) > apci_listen result: > > video/brightnessdown BRTDN 00000087 00000000 > video/brightnessdown BRTDN 00000087 00000000 K > video/brightnessup BRTUP 00000086 00000000 > video/brightnessup BRTUP 00000086 00000000 K OK, you get the event. I think the only thing you need is to add: video.use_native_backlight=1 to kernel cmdline and then your hotkey should work. But of course, if the i915 irq handler can be modified to handle opregion requests, the acpi video interface could probably also work.
Added video.use_native_backlight=1 to kernel cmdline, hotkey still can't adjust brightness. There is only intel_backlight in /sys/class/backlight
(In reply to comment #24) > Added video.use_native_backlight=1 to kernel cmdline, hotkey still can't > adjust brightness. > > There is only intel_backlight in /sys/class/backlight The working interface is there and events are sent out, I don't get why hotkey doesn't work. Which GUI environment are you using?
Gnome based on Fedora 17
(In reply to comment #26) > Gnome based on Fedora 17 Please turn on backlight debug messages by: # cd /sys/kernel/debug/dynamic_debug # echo 'module backlight +fpc' > control And then run acpi_listen and press hotkey, see if any events are printed out and check dmesg for any brightness related messages.
when run the command: echo 'module backlight +fpc' > control It shows: bash: echo: write error: Invalid argument
(In reply to comment #28) > when run the command: echo 'module backlight +fpc' > control Sorry, should be +fpt, not +fpc > It shows: bash: echo: write error: Invalid argument
apci_listen result is the same as before: video/brightnessdown BRTDN 00000087 00000000 video/brightnessdown BRTDN 00000087 00000000 K video/brightnessup BRTUP 00000086 00000000 video/brightnessup BRTUP 00000086 00000000 K
(In reply to comment #30) > apci_listen result is the same as before: > > video/brightnessdown BRTDN 00000087 00000000 > video/brightnessdown BRTDN 00000087 00000000 K > video/brightnessup BRTUP 00000086 00000000 > video/brightnessup BRTUP 00000086 00000000 K And what about the dmesg, any new lines related to brightness appeared?
(In reply to comment #31) > (In reply to comment #30) > > apci_listen result is the same as before: > > > > video/brightnessdown BRTDN 00000087 00000000 > > video/brightnessdown BRTDN 00000087 00000000 K > > video/brightnessup BRTUP 00000086 00000000 > > video/brightnessup BRTUP 00000086 00000000 K > > And what about the dmesg, any new lines related to brightness appeared? [20123.114901] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20123.118474] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20123.122418] [drm:drm_mode_addfb] [FB:31] [20123.174964] [drm:drm_mode_addfb] [FB:32] [20123.277038] ideapad_laptop: Unknown event: 15 [20123.693979] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20124.294834] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20124.902229] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20125.496200] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20127.231195] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 400 MHz (201) [20127.236489] [drm:valleyview_set_rps] GPU freq request from 400 MHz (201) to 844 MHz (221) [20127.765270] [drm:drm_mode_addfb] [FB:31] [20128.297023] ideapad_laptop: Unknown event: 15 [20128.338821] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20128.714335] [drm:drm_mode_addfb] [FB:32] [20129.288751] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20129.889476] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221) [20130.225780] [drm:drm_mode_addfb] [FB:31] [20130.378385] [drm:drm_mode_addfb] [FB:32] [20130.515744] [drm:drm_mode_addfb] [FB:31] [20130.522115] [drm:valleyview_set_rps] GPU freq request from 844 MHz (221) to 844 MHz (221)
OK, no any messages about brightness appeared. I think this is a GUI bug(user space).
(In reply to comment #33) > OK, no any messages about brightness appeared. I think this is a GUI > bug(user space). Closing accordingly.
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.