# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
#
and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
Adds support for Sun's Frame Buffer Power Management (fbpm) extension
---
xset.c 2008-03-06 14:28:40.000000000 -0800
+++
xset.c 2008-03-19 09:53:30.880805000 -0700
@@ -74,6 +74,10 @@ in this Software without prior written a
+# define FBPM /* need to check for
fbpm.h in autoconf if we push upstream */
@@ -650,6 +654,62 @@ main(int argc, char *argv[])
#endif /* DPMSExtension */
+ else if (strcmp(arg, "+fbpm") == 0) { /* turn on FBPM */
+ if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
+ "server does not have extension for +fbpm option\n");
+ } else if (strcmp(arg, "-fbpm") == 0) { /* shut off FBPM */
+ if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
+ "server does not have extension for -fbpm option\n");
+ } else if (strcmp(arg, "fbpm") == 0) { /* planing for force fbpm */
+ usage("missing arguments to -fpbm", NULL);
+ * we are skipping the word 'force'... just
+ * check to make sure its there
+ arg = nextarg(i, argv);
+ if (strcmp(arg, "force") != 0) { /* ack ! */
+ fprintf(stderr, "bad parameter %s [needs force]\n", arg);
+ arg = nextarg(i, argv);
+ if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
+ if (strcmp(arg, "on") == 0) {
+ FBPMEnable(dpy, FBPMModeOn);
+ } else if (strcmp(arg, "standby") == 0) {
+ FBPMEnable(dpy, FBPMModeStandby);
+ } else if (strcmp(arg, "suspend") == 0) {
+ FBPMEnable(dpy, FBPMModeSuspend);
+ } else if (strcmp(arg, "off") == 0) {
+ FBPMEnable(dpy, FBPMModeOff);
+ fprintf(stderr, "bad parameter %s\n", arg);
+ "server does not have extension for fbpm option\n");
else if (strcmp(arg, "s") == 0) {
set_saver(dpy, ALL, 0); /* Set everything to default */
@@ -1421,6 +1481,46 @@ query(Display *dpy)
+ CARD16 standby, suspend, off;
+ printf("FBPM (Frame Buffer Power Management):\n");
+ if (FBPMQueryExtension(dpy, &dummy, &dummy)) {
+ if (FBPMCapable(dpy)) {
+ FBPMInfo(dpy, &state, &onoff);
+ printf(" FBPM is enabled\n");
+ printf(" Frame Buffer is on\n");
+ printf(" Frame Buffer is in standby\n");
+ printf(" Frame Buffer is in suspend\n");
+ printf(" Frame Buffer is off\n");
+ printf(" Unrecognized response from server\n");
+ printf(" FBPM is disabled\n");
+ printf(" System is not capable of FBPM\n");
+ printf(" Server does not have the FBPM Extension\n");
@@ -1551,6 +1651,16 @@ usage(char *fmt, ...)
fprintf(stderr, "\t (also implicitly enables DPMS features) \n");
fprintf(stderr, "\t a timeout value of zero disables the mode \n");
+ fprintf(stderr, " To control Frame Buffer Power Management (FBPM) features:\n");
+ fprintf(stderr, "\t-fbpm Frame Buffer Power Management features off\n");
+ fprintf(stderr, "\t+fbpm Frame Buffer Power Management features on\n");
+ fprintf(stderr, "\t fbpm force on \n");
+ fprintf(stderr, "\t force standby \n");
+ fprintf(stderr, "\t force suspend \n");
+ fprintf(stderr, "\t force off \n");
+ fprintf(stderr, "\t (also implicitly enables FBPM features) \n");
fprintf(stderr, " To control font cache:\n");
fprintf(stderr, "\t fc [hi-mark [low-mark [balance]]]\n");