Ubuntu

pm-suspend with quirks does not restore backlight anymore

Reported by Mahesh Asolkar on 2009-08-23
94
This bug affects 15 people
Affects Status Importance Assigned to Milestone
pm-utils (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: pm-utils

The problem I am trying to address is that when I suspend my laptop to RAM, backlight is not restored upon resume. I followed instructions on this thread comment until Jaunty to get the backlight back on resume:

  http://ubuntuforums.org/showpost.php?p=7675526&postcount=3

But in Karmic, the trick won't work anymore. The following command that worked in Jaunty does not work in Karmic:

  % sudo pm-suspend --quirk-s3-bios --quirk-s3-mode --quirk-dpms-on --quirk-vbe-post --quirk-vbestate-restore

I wonder what has changed. I tried to get help on ubuntuforums, but haven't got any yet.

ProblemType: Bug
Architecture: i386
Date: Sat Aug 22 17:58:12 2009
DistroRelease: Ubuntu 9.10
Package: pm-utils 1.2.5-2ubuntu4
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/usr/bin/tcsh
ProcVersionSignature: Ubuntu 2.6.31-6.26-generic
SourcePackage: pm-utils
Uname: Linux 2.6.31-6-generic i686

Mahesh Asolkar (asolkar) wrote :
Manuel Siggen (manuel-siggen) wrote :

I had the same problem (Karmic Alpha 4 on a Thinkpad X40 here), and I worked around the problem by adding the following line

    return 1

in /usr/lib/pm-utils/sleep.d/98smart-kernel-video :

# Test to see if the kernel has a video driver that is smart enough to
# handle quirks without external assistance. If it is, remove the quirks.
have_kms()
{
    return 1
    # if we are running with a KMS-enabled video driver, we should not
    # attempt to run any quirks
    [ -d /sys/class/drm/card0/device/graphics/fb0 ] || return 1
    remove_all_video_quirks
    add_parameters --quirk-no-chvt
}

-> it forces using quirks even with KMS enabled.

It worked for me, but I'm not by any mean knowledgeable in all that stuff...

Mahesh Asolkar (asolkar) wrote :

I can confirm that Manuel Siggen's work around works for me too - on top of the work around I was using until Karmic, as mentioned in the original bug report.

Is this a bug? Is there a plan to include a fix for that in the near future?

Mahesh Asolkar (asolkar) wrote :

Well, I now see that when I use the following command, it works:

    % sudo pm-suspend --quirk-s3-bios --quirk-s3-mode --quirk-dpms-on --quirk-vbe-post --quirk-vbestate-restore

The laptop suspends and resumes with backlight ON.

But if I try to make it persistent by adding the quirks to /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux, it does not. The laptop suspends, but still resumes with backlight OFF. This used to work pre-Karmic.

Stephan (resol) wrote :

Does this still work for you?
After an update this does not work any more. Without changing anything (all defaults), the backlight now works out of the box but the display remains black (with backlight on).

Can someone this confirm?

Mahesh Asolkar (asolkar) wrote :

@Stephan: I don't see the behavior changed since my last comment (#4). The pm-suspend command mentioned in the comment works, but is not persistent.

Stephan (resol) wrote :

I ran that command, but it does not work here. The Laptop (x40) starts but then there is a very dark "_" blinking. But the backlight is on! So this maybe some other bug?
Some days ago I had the exactly same problems as you did, but now (I think because of an update) the behavior is different.

Did you change some config files to do this?

Mahesh Asolkar (asolkar) wrote :

I had changed the /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux file to include the quirks in an effort to make them persistent. But since you wanted me to try with default files, I reverted my changes and tried. I still see that the pm-suspend command with command-line quirks works. Laptop resumes with backlight and proper desktop.

Erik Iohansson (erjohan) wrote :

This fix works for me too, So just placing the "return 1" in the function "have_kms()" in /usr/lib/pm-utils/sleep.d/98smart-kernel-video

I'm using an pretty old X40, please post your versions as well.

lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware

  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = '23717JG' (string)
  system.firmware.release_date = '07/20/2004' (string)
  system.firmware.vendor = 'IBM' (string)
  system.firmware.version = '1UET74WW (1.22 )' (string)

Stephan (resol) wrote :

This fix now works for me as well. (the combination of "return 1" and the special command line command)

Here is my system information:
lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware

  system.firmware.release_date = '03/01/2006' (string)
  system.firmware.vendor = 'IBM' (string)
  system.firmware.version = '1UETD1WW (2.06 )' (string)
  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = '2372WNS' (string)

Andrew Brown (seatrout) wrote :

The "return 1" fix works for me with an elderly X40, too:

lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware

  system.firmware.release_date = '06/15/2005' (string)
  system.firmware.vendor = 'IBM' (string)
  system.firmware.version = '1UETB6WW (1.66 )' (string)
  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = '2371GHG' (string)

Manuel Siggen (manuel-siggen) wrote :

Here is mine :

msi@x40:~$ lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware
  system.firmware.release_date = '09/16/2004' (string)
  system.firmware.vendor = 'IBM' (string)
  system.firmware.version = '1UET92WW (1.42 )' (string)
  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = '237179G' (string)

Mahesh Asolkar (asolkar) wrote :

Here's mine:

:) ~ > lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware
  system.firmware.release_date = '08/17/2004' (string)
  system.firmware.vendor = 'Phoenix Technologies LTD' (string)
  system.firmware.version = 'R0021G7' (string)
  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = 'VGN-T140P(UC)' (string)

return 1 worked for my X40 as well:

lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware
  system.firmware.release_date = '12/21/2006' (string)
  system.firmware.vendor = 'IBM' (string)
  system.firmware.version = '1UETD3WW (2.08 )' (string)
  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = '2371PG2' (string)

Changed in pm-utils (Ubuntu):
status: New → Confirmed

As an addition:
When i close my lid under AC power, the config says "Blank Screen".
At this moment happens the same for me as described above; the display stays black.

Valentijn Sessink (valentijn) wrote :

For me and my X40 laptop, I use

i915.modeset=0

as kernel command line. This turns off KMS and restores the backlight.

BTW, this (417599) is bug 292256 in a new form. Should they be merged?

Changed in pm-utils (Ubuntu):
importance: Undecided → Medium
Valentijn Sessink (valentijn) wrote :

This should fix it, according to the kernel devs: http://bugzilla.kernel.org/show_bug.cgi?id=10985

Valentijn Sessink (valentijn) wrote :

I tested the patch mentioned in my previous post: http://bugzilla.kernel.org/attachment.cgi?id=23409
This fixes the problem. As it is a trivial, three lines only patch, it shouldn't be too hard to get it submitted, right?

There is another problem with KMS for me. KMS breaks Xv on intel 855GM video (as in X40 thinkpad).
The fix for that is to disable KMS in GRUB, and that fixes the backlight on resume problem too.

https://wiki.ubuntu.com/KarmicKoala/ReleaseNotes#No%20Xv%20support%20for%20Intel%2082852/855GM%20video%20chips%20with%20KMS

Stephan (resol) wrote :

You are right. I did not think about this but 'xvinfo' turns out that its missing. Very bad.

Could someone else post his results on xvinfo?

Stephan (resol) wrote :

Ohh just saw your link to this being already an official bug, so it should be clear that everyone here is missing xv. Hope there will be a fix for this in karmic some day...

Mahesh Asolkar (asolkar) wrote :

I disabled KMS as suggested in the release notes (thanks Mike for the pointer). It did improve CPU utilization during video playback. But sadly, it did not fix my back-light problem on resume. My laptop still resumes without back-light.

Stephan (resol) wrote :

Here it's the same. No backlight after resuming. Still stuck to the workaround...

Max Afonov (max-bumnetworks) wrote :

Having put a "return 1" at the head of "have_kms()" in "/usr/lib/pm-utils/sleep.d/98smart-kernel-video" I do get my backlight back after resume from suspend to RAM.

max@upsight:~$ lshal | grep -e system.hardware.product -e system.hardware.primary -e system.firmware
  system.firmware.release_date = '09/28/2005' (string)
  system.firmware.vendor = 'IBM' (string)
  system.firmware.version = '1UETC8WW (2.03 )' (string)
  system.hardware.primary_video.product = 13698 (0x3582) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = '2386GHU' (string)
max@upsight:~$ glxinfo | grep -i renderer
OpenGL renderer string: Mesa DRI Intel(R) 852GM/855GM GEM 20090712 2009Q2 RC3 x86/MMX/SSE2

James Keating (jkeating) wrote :

I had one solution before, to edit /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux and change the quirks line to:
QUIRKS="--quirk-s3-bios --quirk-s3-mode --quirk-dpms-on --quirk-vbe-post --quirk-vbestate-restore"
(This needed to be redone after each update, since the file got overwritten.)

That stopped working in Karmic (9.10). Now I have found another solution, using one other person's suggestion and one idea of my own inspired by Manuel Siggen's suggestion.

Now the first time I suspend, resume works for a moment and then goes into hibernation. After coming out of hibernation, resuming works from the second time on. I think this is peculiar to my machine, but don't be surprised if it happens.

1. In /boot/grub/menu.lst, add i915.modeset=0 nomodeset to the defoptions line. This disables the new kernel mode-setting (KMS):
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash i915.modeset=0 nomodeset

1b) save and run the command update-grub (as root).

2. In /usr/lib/pm-utils/sleep.d/, I deleted the lines in the Intel section removing the quirks I need: --quirk-dpms-on --quirk-vbe-post --quirk-vbestate-restore. (Two others, --quirk-s3-bios and --quirk-s3-mode, weren't in the list.)

The Intel section of the file now reads:

have_smart_intel()
{
    # currently, intel kernel modesetting is not quite smart enough
    # we still need acpi s3 kernel modesetting hooks, so don't remove those
    # options if they were passed.
    [ -d /sys/module/i915 ] || return 1
    local kernel_rev="$(uname -r |awk -F '[_-]' '{print $1}')"
    [ "$kernel_rev" \> "2.6.26" -o "$kernel_rev" = "2.6.26" ] || return 1
    remove_parameters --quirk-dpms-suspend \
 --quirk-vga-mode3 \
 --quirk-vbemode-restore \
 --quirk-reset-brightness \
 --quirk-radeon-off \
 --quirk-no-fb \
 --quirk-pci-save
}

3) Reboot.

To find the particular quirks you may need, look at the man page for pm-suspend, and testing suspend from the command line (pm-suspend plus a series of quirk options). Try combining everything that looks likely, then removing some. Be patient.

James Keating (jkeating) wrote :

Wait -- that's incomplete. Originally I deleted all the non-Intel sections, and that worked. Looking for a solution easier for others to follow, I tried just removing the quirks lines, and thought it worked, but it didn't.

My solution, in short:

1. In /boot/grub/menu.lst
add i915.modeset=0 nomodeset to the defoptions line. This disables the new kernel mode-setting (KMS):
# defoptions=quiet splash i915.modeset=0 nomodeset

1b) Save and run update-grub.

2. In /usr/lib/pm-utils/sleep.d/98smart-kernel-video
delete all references to quirk options your machine needs to suspend.
In my case, three quirks are in the section have_smart_intel:
     --quirk-dpms-on --quirk-vbe-post --quirk-vbestate-restore
and two are in the section remove_all_video_quirks:
     --quirk-s3-bios --quirk-s3-mode

3) Save and reboot.

Joel Borggrén-Franck (jbf) wrote :

I can confirm James' latest workaround works for me on my X40 (although I changes /etc/default/grub instead).

Thx all that work on this.

Dave T. Johnson (hedgefighter) wrote :

I can confirm this bug and the same solution for my Intel 945GM.

I added i915.modeset=0 to the end of my GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub and ran update-grub and suspend and hibernate are working perfectly again.

jahok (puikku) wrote :

Same solution worked for me, thanks.

system.firmware.release_date = '03/01/2006' (string)
system.firmware.vendor = 'IBM' (string)
system.firmware.version = '1UETD1WW (2.06 )' (string)
system.hardware.primary_video.product = 13698 (0x3582) (int)
system.hardware.primary_video.vendor = 32902 (0x8086) (int)
system.hardware.product = '2371H8G' (string)

Benson Miller (benson-miller) wrote :

I followed hedgefighter's solution in #28 (which is really just the first part of James Keating's solution in comment #26). The addition of 'i915.modeset=0 nomodeset' to my kernel parameters eliminates the no-backlight-upon-resume problem for me.

system.firmware.release_date = '02/03/2004' (string)
system.firmware.vendor = 'IBM' (string)
system.firmware.version = '1UET63WW (1.14 )' (string)
system.hardware.primary_video.product = 13698 (0x3582) (int)
system.hardware.primary_video.vendor = 32902 (0x8086) (int)
system.hardware.product = '23718EU' (string)

Adding "i915.modeset=0" to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub and running update-grub did it for me on a ThinkPad X40 as well.

A real fix would be appreciated nevertheless! Thanks a lot!

adelisser (adelisser) wrote :

Steps 1, 1b, 3 from comment #26 worked for me. My Dell C400 with Karmic now activates the display after resuming from suspend. Yes! Thanks James!

$ lshal | grep -e system.hardware.product -e system.hardware.primary -e system.hardware.firmware
  system.hardware.primary_video.product = 13687 (0x3577) (int)
  system.hardware.primary_video.vendor = 32902 (0x8086) (int)
  system.hardware.product = 'Latitude C400' (string)

Allan Smith (arsuk) wrote :

I too have a wonderfull Dell c400 and the info in this bug helped me get suspend working. Thanks. However, my config of Ubuntu seems a bit different so the instructions that work for me are listed below. Note that the splash boot option caused the cosole video to core dump in combination with nomodeset so I removed it.

Fix for Ubuntu 9.10:

1a) In /etc/default/grub
add i915.modeset=0 nomodeset to GRUB_CMDLINE_LINUX_DEFAULTcat. This disables the new kernel mode-setting (KMS):
GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"
or
GRUB_CMDLINE_LINUX_DEFAULT="quiet i915.modeset=0"

1b) Save and run update-grub.

2. In /usr/lib/pm-utils/sleep.d/98smart-kernel-video
add return 1 in have have_smart_intel:

have_smart_intel()
{
    # Not sure which option cuses blank screen after suspend restore but
    # disabling this section works.
return 1

3) Save and reboot.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.