Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c255d844 authored by Pavel Machek's avatar Pavel Machek Committed by Linus Torvalds
Browse files

[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: default avatarPavel Machek <pavel@suse.cz>
Cc: "Brown, Len" <len.brown@intel.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6303dbf5
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@ before actually making adjustments.


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


==============================================================
==============================================================


acpi_video_flags:

flags

See Doc*/kernel/power/video.txt, it allows mode of video boot to be
set during run time.

==============================================================

acct:
acct:


highwater lowwater frequency
highwater lowwater frequency
+2 −1
Original line number Original line Diff line number Diff line
@@ -428,6 +428,7 @@ extern struct acpi_table_mcfg_config *pci_mmcfg_config;
extern int pci_mmcfg_config_num;
extern int pci_mmcfg_config_num;


extern int sbf_port;
extern int sbf_port;
extern unsigned long acpi_video_flags;


#else	/* !CONFIG_ACPI */
#else	/* !CONFIG_ACPI */


+1 −0
Original line number Original line Diff line number Diff line
@@ -146,6 +146,7 @@ enum
	KERN_RANDOMIZE=68, /* int: randomize virtual address space */
	KERN_RANDOMIZE=68, /* int: randomize virtual address space */
	KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
	KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
	KERN_SPIN_RETRY=70,	/* int: number of spinlock retries */
	KERN_SPIN_RETRY=70,	/* int: number of spinlock retries */
	KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
};
};




+12 −4
Original line number Original line Diff line number Diff line
@@ -44,14 +44,12 @@
#include <linux/limits.h>
#include <linux/limits.h>
#include <linux/dcache.h>
#include <linux/dcache.h>
#include <linux/syscalls.h>
#include <linux/syscalls.h>
#include <linux/nfs_fs.h>
#include <linux/acpi.h>


#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include <asm/processor.h>


#ifdef CONFIG_ROOT_NFS
#include <linux/nfs_fs.h>
#endif

#if defined(CONFIG_SYSCTL)
#if defined(CONFIG_SYSCTL)


/* External variables not in a header file. */
/* External variables not in a header file. */
@@ -655,6 +653,16 @@ static ctl_table kern_table[] = {
		.mode		= 0644,
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
		.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
#endif
	{ .ctl_name = 0 }
	{ .ctl_name = 0 }
};
};