Bug 83816 - backlight maxed out when switching from X to a tty
Summary: backlight maxed out when switching from X to a tty
Status: CLOSED WONTFIX
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-13 13:38 UTC by Antonio Orefice
Modified: 2017-07-24 22:51 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log while switching VTs (4.96 KB, application/x-gzip)
2014-09-14 11:38 UTC, Antonio Orefice
no flags Details
dmesg with drm.debug=6 while switching Vts (22.40 KB, application/x-gzip)
2014-09-14 11:39 UTC, Antonio Orefice
no flags Details
More backlight debug (2.09 KB, patch)
2014-09-15 06:35 UTC, Chris Wilson
no flags Details | Splinter Review

Description Antonio Orefice 2014-09-13 13:38:38 UTC
the patch here: 
http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=5935c93ce77a5da09aab9b45b1a5710d681c171e

seems uneffective to me.
I just installed xf86-video-intel 2.99.916
but the issue is still present, ivybridge here.
Switching from sna to uxa made thing works as they should.
Comment 1 Chris Wilson 2014-09-13 15:30:57 UTC
Ineffective because it is not a ddx bug.
Comment 2 Antonio Orefice 2014-09-13 15:35:07 UTC
Thanks for answering.
Could you please point me in some direction? Maybe we need to file a bug report to the kernel?
Comment 3 Chris Wilson 2014-09-13 15:39:26 UTC
We just did file a bug report against the kernel. If you attach you Xorg.0.log we know if it is the intel backlight or acpi. If you attach a drm.debug=6 dmesg from across the VT switch, we should be able to see exactly what i915.ko sets the backlight to (if not why).
Comment 4 Chris Wilson 2014-09-13 15:40:28 UTC
Similarly if you compile with --enable-debug=full you can see exactly what the ddx thinks is happening.
Comment 5 Antonio Orefice 2014-09-14 11:38:11 UTC
Created attachment 106253 [details]
Xorg.0.log while switching VTs
Comment 6 Antonio Orefice 2014-09-14 11:39:37 UTC
Created attachment 106254 [details]
dmesg with drm.debug=6 while switching Vts
Comment 7 Chris Wilson 2014-09-15 06:14:48 UTC
After 32.8s (which is when X starts its VT switch), in the kernel we see the backlight set to 0 (for the modeswitch), then set to 100 (which I presume is the actual_level being restored), then the kernel sets it to max on the installation of the fbcon and intel_panel_enable_backlight().

The bug is that intel_panel_enable_backlight() always sets the max value ignoring the current user value.
Comment 8 Chris Wilson 2014-09-15 06:15:28 UTC
(A second bug that should be fixed with 3.17/universal planes is the need to switch of the CRTCs in the first place in order to uninstall the Xserver's framebuffer.)
Comment 9 Chris Wilson 2014-09-15 06:35:06 UTC
Created attachment 106300 [details] [review]
More backlight debug

A little more debugging to track changes in the backlight.level
Comment 10 Jani Nikula 2015-01-29 14:00:00 UTC
(In reply to Chris Wilson from comment #7)
> The bug is that intel_panel_enable_backlight() always sets the max value
> ignoring the current user value.

That's not really true. It sets the max value if the userspace set the level to minimum before the backlight was disabled. Why does the userspace insist on setting backlight to min before disable?
Comment 11 Chris Wilson 2015-01-29 14:03:01 UTC
Because we may not be using a backlight interface that interacts with i915.ko. E.g. a bunch of my pineview machines.
Comment 12 Chris Wilson 2015-01-29 14:05:11 UTC
(In reply to Jani Nikula from comment #10)
> (In reply to Chris Wilson from comment #7)
> > The bug is that intel_panel_enable_backlight() always sets the max value
> > ignoring the current user value.
> 
> That's not really true. It sets the max value if the userspace set the level
> to minimum before the backlight was disabled. Why does the userspace insist
> on setting backlight to min before disable?

To put it another way: Why does the kernel insist on providing policy that overrides userspace?
Comment 13 Jani Nikula 2015-01-29 14:49:49 UTC
(In reply to Chris Wilson from comment #12)
> (In reply to Jani Nikula from comment #10)
> > (In reply to Chris Wilson from comment #7)
> > > The bug is that intel_panel_enable_backlight() always sets the max value
> > > ignoring the current user value.
> > 
> > That's not really true. It sets the max value if the userspace set the level
> > to minimum before the backlight was disabled. Why does the userspace insist
> > on setting backlight to min before disable?
> 
> To put it another way: Why does the kernel insist on providing policy that
> overrides userspace?

Hysterical raisins, dating back to i915 mode setting support in 2008. I assume pretty much impossible to remove now, since too many use cases depend on being able to see something when the connector is enabled, regardless of the backlight setting.

For the record, I wince every time I look at that if (level == min) level = max; bit in the code.
Comment 14 Jesse Barnes 2015-03-25 22:04:59 UTC
So I guess this is a wontfix wart?  It can be worked around in userspace at least, by avoiding the set to a minimum backlight level before switching.


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.