Package: hibernate
Version: 1.94-2
Severity: normal
Tags: patch

My laptop, a P7120 lifebook, generally reports a value of 0 in
/proc/acpi/video/GFX0/LCD/brightness, unless the brightness has been
changed using that file. The current gfx_brightness scriptlet reads the
value and writes it back, which works for values other than 0, but is a
no-op for 0. My LCD brightness is not restored and it remains black on
resume.

The attached patch checks for this, and if the value is 0, defaults to
4 instead.

-- Package-specific info:

--- configuration
==> /etc/hibernate/common.conf <==
Verbosity 0
LogFile /var/log/hibernate.log
LogVerbosity 1
Distribution debian
XDisplay :0
SaveClock restore-only
Runi915resolution yes
UnloadModules ata_piix mmc_core
UnloadBlacklistedModules yes
LoadModules auto
PauseAudio yes
SwitchToTextMode yes
XStatus x
XmessageDisable yes
XosdSettings --font '-misc-fixed-medium-r-semicondensed--*-120-*-*-c-*-*-*' 
--colour=Green --shadow 1 --pos top --align center --offset 0
==> /etc/hibernate/disk.conf <==
TryMethod ususpend-disk.conf
TryMethod sysfs-disk.conf
==> /etc/hibernate/hibernate.conf <==
TryMethod ram.conf
==> /etc/hibernate/ram.conf <==
RestoreGFXBrightness yes
TryMethod sysfs-ram.conf
EnableVbetool yes
==> /etc/hibernate/suspend2.conf <==
UseSuspend2 yes
Reboot no
EnableEscape yes
DefaultConsoleLevel 1
Compressor lzf
Encryptor none
FullSpeedCPU yes
Include common.conf
==> /etc/hibernate/sysfs-disk.conf <==
UseSysfsPowerState disk
Include common.conf
==> /etc/hibernate/sysfs-ram.conf <==
UseSysfsPowerState mem
Include common.conf
==> /etc/hibernate/ususpend-both.conf <==
USuspendMethod both
Include common.conf
==> /etc/hibernate/ususpend-disk.conf <==
USuspendMethod disk
Include common.conf
==> /etc/hibernate/ususpend-ram.conf <==
USuspendMethod ram
Include common.conf

--- /sys/power
==> /sys/power/disk <==
shutdown
==> /sys/power/image_size <==
524288000
==> /sys/power/resume <==
0:0
==> /sys/power/state <==
mem disk 

--- s2ram -n
Usage: s2ram [-nhi] [-fspmra]

Options:
    -h, --help:       this text.
    -n, --test:       test if the machine is in the database.
                      returns 0 if known and supported
    -i, --identify:   prints a string that identifies the machine.
    -f, --force:      force suspending, even on unknown machines.

the following options are only available with --force:
    -s, --vbe_save:   save VBE state before suspending and restore after resume.
    -p, --vbe_post:   VBE POST the graphics card after resume
    -m, --vbe_mode:   get VBE mode before suspend and set it after resume
    -r, --radeontool: turn off the backlight on radeons before suspending.
    -a, --acpi_sleep: set the acpi_sleep parameter before suspend
                      1=s3_bios, 2=s3_mode, 3=both

--- log
hibernate.log file not readable.

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages hibernate depends on:
ii  console-tools              1:0.2.3dbs-65 Linux console and font utilities

Versions of packages hibernate recommends:
ii  dash                          0.5.3-7    The Debian Almquist Shell
ii  hdparm                        6.9-1      tune hard disk parameters for high
ii  uswsusp                       0.5-1      tools to use userspace software su
ii  vbetool                       0.7-1.1    run real-mode video BIOS code to a

-- no debconf information

-- 
see shy jo
--- /home/joey/gfx_brightness	2007-02-12 19:17:01.000000000 -0500
+++ gfx_brightness	2007-02-12 19:15:36.000000000 -0500
@@ -13,7 +13,7 @@
 	return 1
     fi
     LEVEL="$(while read key value rest; do [ "$key" = current: ] && echo $value; done < $gfx_brightness_acpifile)"
-    if [ -z "$LEVEL" ]; then
+    if [ -z "$LEVEL" ] || [ "$LEVEL" = 0 ]; then
 	vecho 0 "could not determine current brightness level, using default (4)"
 	LEVEL=4
     fi

Attachment: signature.asc
Description: Digital signature

Reply via email to