Skip to content

Commit c255d84

Browse files
pavelmachekLinus Torvalds
authored andcommitted
[PATCH] suspend-to-ram: allow video options to be set at runtime
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 just before suspend (according to the whitelist). This implements sysctl to allow setting suspend video options without reboot. (akpm: Documentation updates for this new sysctl are pending..) Signed-off-by: Pavel Machek <pavel@suse.cz> Cc: "Brown, Len" <len.brown@intel.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 6303dbf commit c255d84

4 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎Documentation/sysctl/kernel.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ before actually making adjustments.
1616

1717
Currently, these files might (depending on your configuration)
1818
show up in /proc/sys/kernel:
19+
- acpi_video_flags
1920
- acct
2021
- core_pattern
2122
- core_uses_pid
@@ -57,6 +58,15 @@ show up in /proc/sys/kernel:
5758

5859
==============================================================
5960

61+
acpi_video_flags:
62+
63+
flags
64+
65+
See Doc*/kernel/power/video.txt, it allows mode of video boot to be
66+
set during run time.
67+
68+
==============================================================
69+
6070
acct:
6171

6272
highwater lowwater frequency

‎include/linux/acpi.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ extern int acpi_mp_config;
427427
extern struct acpi_table_mcfg_config *pci_mmcfg_config;
428428
extern int pci_mmcfg_config_num;
429429

430-
extern int sbf_port ;
430+
extern int sbf_port;
431+
extern unsigned long acpi_video_flags;
431432

432433
#else /* !CONFIG_ACPI */
433434

‎include/linux/sysctl.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ enum
146146
KERN_RANDOMIZE=68, /* int: randomize virtual address space */
147147
KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
148148
KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
149+
KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
149150
};
150151

151152

‎kernel/sysctl.c‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@
4444
#include <linux/limits.h>
4545
#include <linux/dcache.h>
4646
#include <linux/syscalls.h>
47+
#include <linux/nfs_fs.h>
48+
#include <linux/acpi.h>
4749

4850
#include <asm/uaccess.h>
4951
#include <asm/processor.h>
5052

51-
#ifdef CONFIG_ROOT_NFS
52-
#include <linux/nfs_fs.h>
53-
#endif
54-
5553
#if defined(CONFIG_SYSCTL)
5654

5755
/* External variables not in a header file. */
@@ -655,6 +653,16 @@ static ctl_table kern_table[] = {
655653
.mode = 0644,
656654
.proc_handler = &proc_dointvec,
657655
},
656+
#endif
657+
#ifdef CONFIG_ACPI_SLEEP
658+
{
659+
.ctl_name = KERN_ACPI_VIDEO_FLAGS,
660+
.procname = "acpi_video_flags",
661+
.data = &acpi_video_flags,
662+
.maxlen = sizeof (unsigned long),
663+
.mode = 0644,
664+
.proc_handler = &proc_dointvec,
665+
},
658666
#endif
659667
{ .ctl_name = 0 }
660668
};

0 commit comments

Comments
 (0)