From: Pavel Machek Currently, acpi video options can only be set on kernel command line. That's little inflexible; I'd like userland s2ram application that just works, and modifying kernel command line according to whitelist is not fun. It is better to just allow s2ram application to set video options juts before suspend (according to the whitelist). This implements sysctl to allow setting suspend video options without reboot. Signed-off-by: Pavel Machek Cc: "Brown, Len" Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton --- include/linux/sysctl.h | 1 + kernel/sysctl.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff -puN include/linux/sysctl.h~suspend-to-ram-allow-video-options-to-be-set-at-runtime include/linux/sysctl.h --- 25/include/linux/sysctl.h~suspend-to-ram-allow-video-options-to-be-set-at-runtime Tue Jan 24 15:57:42 2006 +++ 25-akpm/include/linux/sysctl.h Tue Jan 24 15:58:01 2006 @@ -146,6 +146,7 @@ enum KERN_RANDOMIZE=68, /* int: randomize virtual address space */ KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */ KERN_SPIN_RETRY=70, /* int: number of spinlock retries */ + KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ }; diff -puN kernel/sysctl.c~suspend-to-ram-allow-video-options-to-be-set-at-runtime kernel/sysctl.c --- 25/kernel/sysctl.c~suspend-to-ram-allow-video-options-to-be-set-at-runtime Tue Jan 24 15:57:42 2006 +++ 25-akpm/kernel/sysctl.c Tue Jan 24 15:57:42 2006 @@ -44,14 +44,12 @@ #include #include #include +#include +#include #include #include -#ifdef CONFIG_ROOT_NFS -#include -#endif - #if defined(CONFIG_SYSCTL) /* External variables not in a header file. */ @@ -657,6 +655,16 @@ static ctl_table kern_table[] = { .mode = 0644, .proc_handler = &proc_dointvec, }, +#endif +#ifdef CONFIG_ACPI_SLEEP + { + .ctl_name = KERN_ACPI_VIDEO_FLAGS, + .procname = "acpi_video_flags", + .data = &acpi_video_flags, + .maxlen = sizeof (unsigned long), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, #endif { .ctl_name = 0 } }; _