All pastes #733108 Raw Edit

Untitled

public text v1 · immutable
·published 2007-10-11 15:07 UTC
rendered paste body
Index: 20video
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/hooks/20video,v
retrieving revision 1.12
diff -u -p -r1.12 20video
--- 20video     4 Jun 2007 15:50:30 -0000       1.12
+++ 20video     11 Oct 2007 15:06:19 -0000
@@ -29,16 +29,18 @@ radeon() {
 
 suspend_video()
 {
-       # 0=nothing, 1=s3_bios, 2=s3_mode, 3=both
-       if [ "${DISPLAY_QUIRK_S3_BIOS}" == "true" -a \
-                       "${DISPLAY_QUIRK_S3_MODE}" == "true" ]; then
-               sysctl -w kernel.acpi_video_flags=3
-       elif [ "${DISPLAY_QUIRK_S3_BIOS}" == "true" ]; then
-               sysctl -w kernel.acpi_video_flags=1
-       elif [ "${DISPLAY_QUIRK_S3_MODE}" == "true" ]; then
-               sysctl -w kernel.acpi_video_flags=2
-       else
-               sysctl -w kernel.acpi_video_flags=0
+       if [ -e /proc/sys/kernel/acpi_video_flags ]; then
+               # 0=nothing, 1=s3_bios, 2=s3_mode, 3=both
+               if [ "${DISPLAY_QUIRK_S3_BIOS}" == "true" -a \
+                               "${DISPLAY_QUIRK_S3_MODE}" == "true" ]; then
+                       sysctl -w kernel.acpi_video_flags=3
+               elif [ "${DISPLAY_QUIRK_S3_BIOS}" == "true" ]; then
+                       sysctl -w kernel.acpi_video_flags=1
+               elif [ "${DISPLAY_QUIRK_S3_MODE}" == "true" ]; then
+                       sysctl -w kernel.acpi_video_flags=2
+               else
+                       sysctl -w kernel.acpi_video_flags=0
+               fi
        fi
 
        # We might need to do one or many of these quirks