Bug 51035 - [GM965/GL960] backlight state should be restored during shutdown
Summary: [GM965/GL960] backlight state should be restored during shutdown
Status: CLOSED NOTOURBUG
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: XOrg git
Hardware: x86 (IA32) Linux (All)
: lowest enhancement
Assignee: Daniel Vetter
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-13 06:19 UTC by max
Modified: 2017-07-24 23:01 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmeg across hibernate/resume, time ~87. (138.02 KB, text/plain)
2012-06-13 20:47 UTC, max
no flags Details

Description max 2012-06-13 06:19:36 UTC
Let's consider the following case:
I switch to external monitor
xrandr --output LVDS1 --off --output VGA1 --auto
than shutdown the laptop.
Unplug VGA connector and boot again.
Grub menu is hardly visible
unless backlight is manually increased with [Fn+F6] key.

I am expecting normal backlight level during boot
(e.g. as it was before switching to external display).

It seems that some actions should be performed
during shutdown to prevent very dim image next boot.

System info:
lspci
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03)
00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (secondary) (rev 03)

system architecture: i386

Such behavior is common to any versions of kernel I have tried.
Now the configuration is the following:
Ubuntu 12.04 + xorg-edgers (precise) + drm-intel-experimental
(2012-06-13-quantal):

xserver-xorg-video-intel
Version: 2:2.19.0+git20120606.c433fb45-0ubuntu0sarvatt~precise
xserver-xorg-core
Version: 2:1.12.2+git20120605+server-1.12-branch.aaf48906-0ubuntu0ricotz~precise
libgl1-mesa-dri
Version: 8.1~git20120529.f92b2e5e-0ubuntu0sarvatt~precise
libdrm-intel1
Version: 2.4.35+git20120611.9e0026d3-0ubuntu0sarvatt~precise
kernel
3.4.0-994-generic #201206130406 SMP Wed Jun 13 08:15:01 UTC 2012 i686 i686 i386 GNU/Linux

Asus F80L laptop
Comment 1 Daniel Vetter 2012-06-13 06:22:02 UTC
Please try out my backlight confusion branch from my personal git repo at:

http://cgit.freedesktop.org/~danvet/drm

That /should/ help.
Comment 2 Chris Wilson 2012-06-13 08:13:57 UTC
More importantly attach the dmesg (with drm.debug=6) from across resume.
Comment 3 max 2012-06-13 20:47:00 UTC
Created attachment 63004 [details]
dmeg across hibernate/resume, time ~87.

I'm attaching dmesg taken with drm.debug=0x06
xserver-xorg-video-intel
Version: 2:2.19.0+git20120613.0db789e1-0ubuntu0sarvatt~precise
kernel
3.4.0-custom-d1f990f+ #1 SMP Tue Jun 12 11:59:44 NOVT 2012 i686 i686 i386 GNU/Linux
(Daniel's backlight-confusion branch,
commit d1f990f09d798c3ec040a73eb5eebcebaac665b0)

I started xterm with
startx /usr/bin/ck-launch-session xterm
connected VGA cable, switched to VGA1,
hibernated the laptop with
sudo pm-hibernate
and booted again. Hibernate/resume should occurred at time ~87 

I did not unplug VGA connector this time. During resume
boot Grub menu was very dim on LVDS1. At VGA1, as ususally,
left side of grub menu was out of screen.
As soon as resume finished, xterm appeared on VGA1.

Finally, I would draw your attention that reporting this
bug I do not mean (suspend|hibernate)/resume cycle.
I do not like that boot loader menu is almost invisible if
previous shutdown and power off is initiated from VGA1
with disabled LVDS1.
Comment 4 Daniel Vetter 2012-06-14 02:46:30 UTC
Ok, just to cross-check that I understand what's going on here:
- you boot your machine, switch to VGA and disable LVDS, everything is ok
- you hibernate with pm-hibernate
- the machine is completely off
- you boot the thing again, LVDS is dim throught BIOS, grub and kernel load
- also, VGA output seems to be misplaced
- as soon as the hibernated image is restored, VGA is restore correctly

And a few questions:
- when you switch on LVDS with xrandr afterr the resume completed, is the backlight ok?
- is there any difference in behaviour between mainline kernels and my backlight-confusion branch? Especially concerning whether the LVDS comes up again properly after hibernate is completed.
Comment 5 max 2012-06-14 04:39:39 UTC
Daniel, you are correct. I add some comments.

(In reply to comment #4)
> Ok, just to cross-check that I understand what's going on here:
> - you boot your machine, switch to VGA and disable LVDS, everything is ok

Strictly speaking, VGA1 may be blank before I press [Ctrl+Alt+F1] [Alt+F7],
see Bug 49688

> - you hibernate with pm-hibernate
> - the machine is completely off
> - you boot the thing again, LVDS is dim throught BIOS, grub and kernel load

That is very close to the cause why I reported the bug.
Since I do not expect any good consequences of disconnecting
VGA in between of hibernate and resume, dim screen in grub
during resume does not annoy me too much. (Ok, in my dreams
I can imagine that display can automatically switch to LVDS1
if VGA1 disappear while the laptop is hibernated.)
The actual point is low backlight level if I turn off the laptop
and later switch on it again (without hibernation).
I hope hibernate and resume with connected VGA1 can help
in debugging of the issue.

> - also, VGA output seems to be misplaced

Perhaps, buggy BIOS (native LVDS1 resolution is not supported
at all) in combination with different aspect ratio
of LVDS1 (1280x800) and VGA1 (1600x1200). Grub2 almost always
do not show the left side. When framebuffer is activated
the image can occupy only a part of the screen (e.g. 1280x800 rectangle
in top left angle of the full display for the older kernel) or
some part of image can be invisible (e.g. below the bottom edge of
the monitor). 

> - as soon as the hibernated image is restored, VGA is restore correctly

Sure.

> And a few questions:
> - when you switch on LVDS with xrandr afterr the resume completed, is the
> backlight ok?

If I remember correctly, it was not. I was need another [Ctrl+Alt+F1]
[Alt+F7] dance.

> - is there any difference in behaviour between mainline kernels and my
> backlight-confusion branch? Especially concerning whether the LVDS comes up
> again properly after hibernate is completed.

Are you interested in difference of backlight-confusion branch and
http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/
or drm-intel-experimental kernel?

Are you interested of intel_reg_dump's at certain points?
In my opinion bugzilla is not the best tool for plenty of
attachments.

I have impression that there are no significant difference
of backlight-confusion and drm-intel-experimental kernel
built yesterday. It seems that sequence of successful and
not so good switches LVDS1<->VGA1 varies from time to time
even for a certain kernel. I try to switch off (not reboot)
the laptop every time. I suspect that the driver does not
do full initialization of hardware (if it is possible at all).
Another problem that the drivers are quite unstable now
and it is not easy for me to attribute each error or warning
with the peace of software.
Comment 6 Daniel Vetter 2012-06-14 04:54:00 UTC
Ok, I guess the vt-switching to re-enable LVDS bug is already handled in #49688

For the dim screen that seems to be a BIOS bug - after completely shutting off our driver doesn't touch the hw. So I'll close this as not our bug.
Comment 7 max 2012-06-14 05:55:17 UTC
On power on BIOS, I think, sets backlight level that was
just before power off.

That is why I would insist that during kernel _shutdown_ the driver
should ensure a sane state of backlight level.
Comment 8 Daniel Vetter 2012-06-14 06:47:27 UTC
At shutdown, a sane state for the backlight is to shut it down. Otherwise you can get some nasty flickering if you just yank the power. No idea what your bios does, but until convinced otherwise I don't see anything that should be changed in our driver. After all, as long as our driver is in control things seem to work.
Comment 9 max 2012-07-08 09:09:16 UTC
(In reply to comment #8)
> At shutdown, a sane state for the backlight is to shut it down. Otherwise you
> can get some nasty flickering if you just yank the power. No idea what your
> bios does, but until convinced otherwise I don't see anything that should be
> changed in our driver. After all, as long as our driver is in control things
> seem to work.

Daniel, I do not see your point.

First of all, the BIOS is buggy in relation to video modes (native resolution 1280x800 unsupported). In my opinion, it works well with backlight state. Even before grub starts I can make the screen brighter or darker and switch laptop off. Next time on power on the backlight level is exactly as it was before power off. The laptop has [Fn+F7] key that disables backlight completely. This state is not preserved across power off/power on cycle. On the other hand backlight level is preserved.

I have no guess which kind of flickering is nasty.

If I initiate shutdown process from X session when LVDS1 is off and VGA1 is on, at certain moment splash screen appears on LVDS1. But the image is very dark. Do you think, it would be bad, if LVDS1 backlight brightness were as before switching from LVDS1 to VGA1?
Comment 10 Jesse Barnes 2012-12-12 18:56:11 UTC
I don't think there's anything we can do here.  At hibernate time, we shut everything off to save power, and also to honor the requirements for sequencing the LVDS panel power.  We can't simply turn on the backlight with the panel powered off as it may damage the panel.  We can't leave the panel running because the planes and pipes have been shut off as we have nothing to display.

So I think you're stuck with just using your hotkeys when you boot up again...


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.