1 # Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 # DEALINGS IN THE SOFTWARE.
22 Adds support for Solaris's Frame Buffer Power Management (fbpm) extension
24 --- xset-1.2.5/man/xset.man.orig
25 +++ xset-1.2.5/man/xset.man
27 .\" Copyright 1988, 1998 The Open Group
28 +.\" Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
30 .\" Permission to use, copy, modify, distribute, and sell this software and its
31 .\" documentation for any purpose is hereby granted without fee, provided that
34 [dpms force {standby|suspend|off|on}]
38 + [fbpm force {standby|suspend|off|on}]
44 `suspend' mode, and the third is for the `off' mode. Setting these
45 values implicitly enables the DPMS features. A value of zero disables
47 +Note that standby is less than suspend is less than off, if this condition is not met, an error is produced.
51 +Enable frame buffer power management. NOTE: FBPM timing is linked to DPMS, See DPMS for default timeout values.
55 +Disable frame buffer power management. NOTE: Does not affect DPMS timeouts.
58 +.B fbpm force standby
59 +Force to standby power level.
62 +.B fbpm force suspend
63 +Force to suspend power level.
75 The \fBfp=\fP sets the font path to the entries given in the path argument.
76 --- xset-1.2.5/xset.c.orig
81 # include <X11/extensions/dpms.h>
82 +# define FBPM /* need to check for fbpm.h in autoconf if we push upstream */
84 +# include <X11/extensions/fbpm.h>
86 #endif /* DPMSExtension */
92 #endif /* DPMSExtension */
94 + else if (strcmp(arg, "+fbpm") == 0) { /* turn on FBPM */
97 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
101 + "server does not have extension for +fbpm option\n");
103 + } else if (strcmp(arg, "-fbpm") == 0) { /* shut off FBPM */
106 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
110 + "server does not have extension for -fbpm option\n");
112 + } else if (strcmp(arg, "fbpm") == 0) { /* planing for force fbpm */
115 + if ((i + 1) >= argc) {
116 + usage("missing arguments to -fpbm", NULL);
119 + * we are skipping the word 'force'... just
120 + * check to make sure its there
122 + arg = nextarg(i, argv);
123 + if (strcmp(arg, "force") != 0) { /* ack ! */
124 + fprintf(stderr, "bad parameter %s [needs force]\n", arg);
129 + arg = nextarg(i, argv);
131 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
132 + if (strcmp(arg, "on") == 0) {
133 + FBPMEnable(dpy, FBPMModeOn);
134 + } else if (strcmp(arg, "standby") == 0) {
135 + FBPMEnable(dpy, FBPMModeStandby);
136 + } else if (strcmp(arg, "suspend") == 0) {
137 + FBPMEnable(dpy, FBPMModeSuspend);
138 + } else if (strcmp(arg, "off") == 0) {
139 + FBPMEnable(dpy, FBPMModeOff);
141 + fprintf(stderr, "bad parameter %s\n", arg);
145 + "server does not have extension for fbpm option\n");
149 else if (strcmp(arg, "s") == 0) {
151 set_saver(dpy, ALL, 0); /* Set everything to default */
152 @@ -1470,6 +1530,46 @@
159 + CARD16 standby, suspend, off;
163 + printf("FBPM (Frame Buffer Power Management):\n");
164 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
165 + if (FBPMCapable(dpy)) {
166 + FBPMInfo(dpy, &state, &onoff);
168 + printf(" FBPM is enabled\n");
171 + printf(" Frame Buffer is on\n");
173 + case FBPMModeStandby:
174 + printf(" Frame Buffer is in standby\n");
176 + case FBPMModeSuspend:
177 + printf(" Frame Buffer is in suspend\n");
180 + printf(" Frame Buffer is off\n");
183 + printf(" Unrecognized response from server\n");
186 + printf(" FBPM is disabled\n");
189 + printf(" System is not capable of FBPM\n");
192 + printf(" Server does not have the FBPM Extension\n");
199 @@ -1602,6 +1702,16 @@
200 "\t (also implicitly enables DPMS features) \n"
201 "\t a timeout value of zero disables the mode \n"
204 + " To control Frame Buffer Power Management (FBPM) features:\n"
205 + "\t-fbpm Frame Buffer Power Management features off\n"
206 + "\t+fbpm Frame Buffer Power Management features on\n"
207 + "\t fbpm force on \n"
208 + "\t force standby \n"
209 + "\t force suspend \n"
211 + "\t (also implicitly enables FBPM features) \n"
214 " To control font cache:\n"
215 "\t fc [hi-mark [low-mark [balance]]]\n"