[Pm-utils] [PATCH] parse video quirks in uswsusp sleep module

Victor Lowther victor.lowther at gmail.com
Mon Mar 17 17:15:46 PDT 2008


On Sun, 2008-03-16 at 20:56 -0500, Victor Lowther wrote:
> On Mon, 2008-03-17 at 02:31 +0100, Michael Biebl wrote: 
> > Color me stupid, but why does the s2ram code imply this logic?
> > s2ram simply has no --quirk-none option.
> 
> The logic I followed was "what does the s2ram_hacks() code do even if we
> called s2ram with --force and no other options?"  I then rewrote the
> 99video hook to match the apparent behaviour of s2ram in that case as
> closely as I could determine it.
> 
> > no quirks, stupid as it sounds, means no quirks for me.
> 
> It is entirely possible I misread the s2ram code. I am willing to make
> --quirk-none skip everything again, with the understanding that I will
> revert it if we start getting weird 99video-related bug reports. 

Patch attached to make 99video and uswsusp honor --quirk-none for all
quirks.

I do not want to get rid of using --quirk-none to skip video quirks for
now.  After patching pm-utils to capture the parameters passed to
pm-action and friends, something odd is happening in the interface
between hal and pm-utils (on my box, at least). More details to follow.

diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
index 9c59229..371bb04 100755
--- a/pm/module.d/uswsusp
+++ b/pm/module.d/uswsusp
@@ -27,9 +27,9 @@ get_quirks()
                        *) continue ;;
                esac
        done
+       [ $ACPI_SLEEP -ne 0 ] && OPTS="$OPTS --acpi_sleep $ACPI_SLEEP"
        # if we were told to ignore quirks, do so.
        [ "$QUIRK_NONE" = "true" ] && OPTS=""
-       [ $ACPI_SLEEP -ne 0 ] && OPTS="$OPTS --acpi_sleep $ACPI_SLEEP"
 }
 
 check_suspend()
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index c20c7fa..6e9bbda 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -89,9 +89,9 @@ suspend_video()
 {
        # 0=nothing, 1=s3_bios, 2=s3_mode, 3=both
        local acpi_flag=0
-       [ "${QUIRK_S3_BIOS}" = "true" ] && acpi_flag=$(($acpi_flag + 1))
-       [ "${QUIRK_S3_MODE}" = "true" ] && acpi_flag=$(($acpi_flag + 2))
-       sysctl -w kernel.acpi_video_flags=$acpi_flag
+       quirk "${QUIRK_S3_BIOS}" &&             acpi_flag=$(($acpi_flag + 1))
+       quirk "${QUIRK_S3_MODE}" &&             acpi_flag=$(($acpi_flag + 2))
+       [ 0 -ne $acpi_flag ] && sysctl -w kernel.acpi_video_flags=$acpi_flag
        
        quirk "${QUIRK_VBESTATE_RESTORE}" &&    vbe_savestate
        quirk "${QUIRK_VBEMODE_RESTORE}" &&     vbe_savemode

Patch also pushed upstream.

> > Michael
> > 
-- 
Victor Lowther
Ubuntu Certified Professional



More information about the Pm-utils mailing list