illumos-gate: omit tagged pointers on SPARC, causes panic on UltraI/II systems
[oi-userland.git] / components / x11 / xset / patches / xsetfbpm.patch
blob67d2033d99532421f0db608442a3cdf92545da9b
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
12 # Software.
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
26 @@ -1,4 +1,5 @@
27 .\" Copyright 1988, 1998 The Open Group
28 +.\" Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
29 .\"
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
32 @@ -41,6 +42,10 @@
33 .br
34 [dpms force {standby|suspend|off|on}]
35 .br
36 +[+fbpm] [-fbpm]
37 +.br
38 + [fbpm force {standby|suspend|off|on}]
39 +.br
40 [fp=\fIpathlist\fP]
41 [-fp=\fIpathlist\fP]
42 [+fp=\fIpathlist\fP]
43 @@ -141,6 +146,32 @@
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
46 a particular mode.
47 +Note that standby is less than suspend is less than off, if this condition is not met, an error is produced.
48 +.PP
49 +.TP 8
50 +.B +fbpm
51 +Enable frame buffer power management. NOTE: FBPM timing is linked to DPMS, See DPMS for default timeout values.
52 +.PP
53 +.TP 8
54 +.B -fbpm
55 +Disable frame buffer power management. NOTE: Does not affect DPMS timeouts.
56 +.PP
57 +.TP 8
58 +.B fbpm force standby
59 +Force to standby power level.
60 +.PP
61 +.TP 8
62 +.B fbpm force suspend
63 +Force to suspend power level.
64 +.PP
65 +.TP 8
66 +.B fbpm force off
67 +Force power to off.
68 +.PP
69 +.TP 8
70 +.B fbpm force on
71 +Force power to on.
72 +.PP
73 .TP 8
74 .B fp= \fIpath,...\fP
75 The \fBfp=\fP sets the font path to the entries given in the path argument.
76 --- xset-1.2.5/xset.c.orig
77 +++ xset-1.2.5/xset.c
78 @@ -68,6 +68,10 @@
79 #endif
80 #ifdef DPMSExtension
81 # include <X11/extensions/dpms.h>
82 +# define FBPM /* need to check for fbpm.h in autoconf if we push upstream */
83 +# ifdef FBPM
84 +# include <X11/extensions/fbpm.h>
85 +# endif
86 #endif /* DPMSExtension */
88 #ifdef XF86MISC
89 @@ -585,6 +589,62 @@
92 #endif /* DPMSExtension */
93 +#ifdef FBPM
94 + else if (strcmp(arg, "+fbpm") == 0) { /* turn on FBPM */
95 + int dummy;
97 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
98 + FBPMEnable(dpy, 0);
99 + } else {
100 + fprintf(stderr,
101 + "server does not have extension for +fbpm option\n");
103 + } else if (strcmp(arg, "-fbpm") == 0) { /* shut off FBPM */
104 + int dummy;
106 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
107 + FBPMDisable(dpy);
108 + } else {
109 + fprintf(stderr,
110 + "server does not have extension for -fbpm option\n");
112 + } else if (strcmp(arg, "fbpm") == 0) { /* planing for force fbpm */
113 + int dummy;
115 + if ((i + 1) >= argc) {
116 + usage("missing arguments to -fpbm", NULL);
117 + } else {
118 + /*
119 + * we are skipping the word 'force'... just
120 + * check to make sure its there
121 + */
122 + arg = nextarg(i, argv);
123 + if (strcmp(arg, "force") != 0) { /* ack ! */
124 + fprintf(stderr, "bad parameter %s [needs force]\n", arg);
125 + break;
128 + i++;
129 + arg = nextarg(i, argv);
130 + i++;
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);
140 + } else {
141 + fprintf(stderr, "bad parameter %s\n", arg);
143 + } else {
144 + fprintf(stderr,
145 + "server does not have extension for fbpm option\n");
148 +#endif
149 else if (strcmp(arg, "s") == 0) {
150 if (i >= argc) {
151 set_saver(dpy, ALL, 0); /* Set everything to default */
152 @@ -1470,6 +1530,46 @@
155 #endif
156 +#ifdef FBPM
158 + int dummy;
159 + CARD16 standby, suspend, off;
160 + BOOL onoff;
161 + CARD16 state;
163 + printf("FBPM (Frame Buffer Power Management):\n");
164 + if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
165 + if (FBPMCapable(dpy)) {
166 + FBPMInfo(dpy, &state, &onoff);
167 + if (onoff) {
168 + printf(" FBPM is enabled\n");
169 + switch (state) {
170 + case FBPMModeOn:
171 + printf(" Frame Buffer is on\n");
172 + break;
173 + case FBPMModeStandby:
174 + printf(" Frame Buffer is in standby\n");
175 + break;
176 + case FBPMModeSuspend:
177 + printf(" Frame Buffer is in suspend\n");
178 + break;
179 + case FBPMModeOff:
180 + printf(" Frame Buffer is off\n");
181 + break;
182 + default:
183 + printf(" Unrecognized response from server\n");
185 + } else {
186 + printf(" FBPM is disabled\n");
188 + } else {
189 + printf(" System is not capable of FBPM\n");
191 + } else {
192 + printf(" Server does not have the FBPM Extension\n");
195 +#endif
196 #ifdef FONTCACHE
198 int dummy;
199 @@ -1602,6 +1702,16 @@
200 "\t (also implicitly enables DPMS features) \n"
201 "\t a timeout value of zero disables the mode \n"
202 #endif
203 +#ifdef FBPM
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"
210 + "\t force off \n"
211 + "\t (also implicitly enables FBPM features) \n"
212 +#endif
213 #ifdef FONTCACHE
214 " To control font cache:\n"
215 "\t fc [hi-mark [low-mark [balance]]]\n"