linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] suspend-to-ram: allow video options to be set at runtime
@ 2006-01-24 17:11 Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2006-01-24 17:11 UTC (permalink / raw)
  To: kernel list, Andrew Morton

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 <pavel@suse.cz>

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 7f47212..164e096 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -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 --git a/kernel/sysctl.c b/kernel/sysctl.c
index f5d69b6..692b56c 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -44,14 +44,12 @@
 #include <linux/limits.h>
 #include <linux/dcache.h>
 #include <linux/syscalls.h>
+#include <linux/nfs_fs.h>
+#include <linux/acpi.h>
 
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 
-#ifdef CONFIG_ROOT_NFS
-#include <linux/nfs_fs.h>
-#endif
-
 #if defined(CONFIG_SYSCTL)
 
 /* External variables not in a header file. */
@@ -658,6 +656,16 @@ static ctl_table kern_table[] = {
 		.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 }
 };
 

-- 
Thanks, Sharp!

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-24 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-24 17:11 [patch] suspend-to-ram: allow video options to be set at runtime Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).