suspend-utils KMS Full Support
cover suspend-utils KMS Full Support
From: "Rodolfo García Peñas (kix)" <[email protected]>
These patches makes s2ram KMS support usable in command line and config file. The first patch removes a issue with the option --no_kms, because the option requires an argument, but this argument is not needed.
The second patch add support for no_mks option in the config file.
The third patch is only documentation, with the option table to reach all possible cases to suspend to ram (user quirks, database and KMS).
These patches should be applied before the patches about UUID support.
Saludos,
kix
Rodolfo García Peñas (kix) (3):
The flag "no_kms" doesn't need arguments
Support to disable KMS using config file
README: Documentation for s2ram options
README | 50 ++++++++++++++++++++++++++++++++++++++++++++------ s2ram-main.c | 6 +++--- s2ram-x86.h | 2 +- s2ram.c | 11 ++++++++++- 4 files changed, 58 insertions(+), 11 deletions(-)
Signature · 1 line
1.7.10.4
PATCH 1/3 The flag "no_kms" doesn't need arguments
From: "Rodolfo García Peñas (kix)" <[email protected]>
The flag "no_kms" doesn't need arguments, but --no_kms ask for it. With this patch, no_kms doesn't ask for it.
--- s2ram-x86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
s2ram-x86.h +1 -1
@@ -57,5 +57,5 @@ int flags, force, fb_nosuspend, no_kms_flag; },\ {\"no_kms\0\tdo not set KMS (Kernel Mode Set)." ,\ - required_argument,NULL ,9 \ + no_argument,NULL ,9 \ },
Signature · 1 line
1.7.10.4
PATCH 2/3 Support to disable KMS using config file
In reply to Rodolfo García Peñas (kix)From: "Rodolfo García Peñas (kix)" <[email protected]>
This patch adds support to disable the KMS via config file.
The user can add "s2ram_disable_kms = y" to the configuration file to avoid the use of KMS.
We need move up the call to read the config file for s2ram (get_s2ram_config()) because the test for the "no_kms_flag" [line 90: "if (!no_kms_flag) {"].
In s2ram.c, the function to read the config file search for s2ram_disable_kms" and assign the value to s2ram_disable_kms variable.
--- s2ram-main.c | 6 +++--- s2ram.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-)
s2ram-main.c +3 -3
@@ -84,6 +84,9 @@ int main(int argc, char *argv[]) } } +/* Test if s2ram will use quirks from the configuration file */ + ret =get_s2ram_config (); +/* Check if the KMS support is disabled by user */ if (!no_kms_flag) {/* KMS */
@@ -96,9 +99,6 @@ int main(int argc, char *argv[])printf ("KMS disabled by user.\n" ); } -/* Test if s2ram will use quirks from the configuration file */ - ret =get_s2ram_config (); -if (ret) {/* No configuration file, using quirks form database */ ret =s2ram_is_supported ();
s2ram.c +10 -1
@@ -23,11 +23,16 @@#include "s2ram.h" #include "config_parser.h" -static char s2ram_force; +static char s2ram_force, s2ram_disable_kms;static char s2ram_quirks[MAX_STR_LEN ];static struct config_par s2ram_parameters[] = { { + .name ="s2ram_disable_kms" , + .fmt ="%c" , + .ptr = &s2ram_disable_kms, + }, + { .name ="s2ram_force" , .fmt ="%c" , .ptr = &s2ram_force,
@@ -110,6 +115,10 @@ int get_s2ram_config(void)fprintf (stderr,"%s: Could not parse config file\n" , ret_name);return error; } + +if (s2ram_disable_kms =='y' ) + no_kms_flag =1 ; +if (s2ram_force =='y' ) { force =1 ;
Signature · 1 line
1.7.10.4
PATCH 3/3 README: Documentation for s2ram options
In reply to Rodolfo García Peñas (kix)From: "Rodolfo García Peñas (kix)" <[email protected]>
This patch includes the documentation to use the s2ram options, for the configuration file and the command line.
--- README | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-)
README +44 -6
@@ -45,10 +45,48 @@ three different methods to suspend the machine: The flow of options is: 1. If the kernel supports KMS, then use it. This option can be overriding - using the argument "-k" in s2ram (s2ram -k). + using the argument "-k" in s2ram (s2ram -k). Is possible test if the + kernel supports KMS using the argument "-K". 2. If the kernel don't support KMS, or the user override it, then s2ram checks if the configuration file has the parameters. If the parameters - are included, s2ram use them, else, the whitelist is used. + are included, s2ram use them, else, the whitelist is used. Is possible + test if the machine is in the whitelist using the argument "-n". + +The full table of options is: + +User want = What the user needs for their machine (KMS, Whitelist or their + own specific quirks). +KMS support? = If the kernel has KMS support enabled. +In WL? = If the machine is included in the whitelist. +Command Line = What should do the user in the command line (s2ram options). +Config File = What should include the user in the configuration file. +N/A = Yes and No, for both cases. +Not possible = This option cannot be used!. +Nothing = The user must not include s2ram_force, s2ram_quirks and + s2ram_quirks lines in the configuration file. +"<quirks>" = Quirks options to be used. In command line these options are + --vbe_save, --vbe_post,... and in the config file are + vbe_save, vb_post (same options, without the "--"). + +User want | KMS support? | In WL? | Command Line | Config File +==========+==============+========+================+======================== + | No | N/A | Not possible | Not possible +KMS (-K) +--------------+--------+----------------+------------------------ + | Yes | N/A | No arguments | Nothing +==========+==============+========+================+======================== + | N/A | No | Not possible | Not possible + +--------------+--------+----------------+------------------------ +WL (-n) | No | Yes | No arguments | Nothing + +--------------+--------+----------------+------------------------ + | Yes | Yes | -k | s2ram_disable_kms = y +==========+==============+========+================+======================== + | No | N/A | -f <quirks> | s2ram_force = y + | | | | s2ram_quirks = <quirks> +User +--------------+--------+----------------+------------------------ +Quirks | Yes | N/A | -k -f <quirks> | s2ram_disable_kms = y + | | | | s2ram_force = y + | | | | s2ram_quirks = <quirks> +----------+--------------+--------+----------------+------------------------ You need libx86 installed to build s2ram, the HOWTO document explains how to install it.
@@ -61,16 +99,16 @@ can resume the system from disk using the resume tool otherwise However, this is only possible if your box is present in the s2ram whitelist. To build the s2ram and s2both tools you will need the pciutils-devel -(pciutils-dev) package and the libx86-dev package (which you can get from -http://www.codon.org.uk/~mjg59/libx86/downloads/). They are necessary to -compile the vbetool code (the vbetool code is based on vbetool-1.0 from +(pciutils-dev) package and the libx86-dev package (which you can get from +http://www.codon.org.uk/~mjg59/libx86/downloads/). They are necessary to +compile the vbetool code (the vbetool code is based on vbetool-1.0 from http://www.codon.org.uk/~mjg59/vbetool/). With newer pciutils (2.2.4 and above) you also have to install the zlib development package (zlib-devel on SUSE, zlib1g-dev on Debian). For debugging, see http://suspend.sf.net/s2ram-support.html. -acpi-support package from Ubuntu has *very* long whitelist of machines: +acpi-support package from Ubuntu has *very* long whitelist of machines: http://packages.ubuntu.org.cn/dapper/admin/acpi-support that are likely to work with s2ram.
Signature · 1 line
1.7.10.4