open-src/app/xset/xsetfbpm.patch
changeset 1068 0dc26c96a5af
parent 943 294f64612d23
child 1179 4ad971e180c3
equal deleted inserted replaced
1067:0eff33524aac 1068:0dc26c96a5af
     1 # Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
     1 # Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     2 #
     2 #
     3 # Permission is hereby granted, free of charge, to any person obtaining a
     3 # Permission is hereby granted, free of charge, to any person obtaining a
     4 # copy of this software and associated documentation files (the "Software"),
     4 # copy of this software and associated documentation files (the "Software"),
     5 # to deal in the Software without restriction, including without limitation
     5 # to deal in the Software without restriction, including without limitation
     6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
     6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
    19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    20 # DEALINGS IN THE SOFTWARE.
    20 # DEALINGS IN THE SOFTWARE.
    21 Adds support for Sun's Frame Buffer Power Management (fbpm) extension
    21 Adds support for Sun's Frame Buffer Power Management (fbpm) extension
    22 
    22 
    23 diff -urp -x '*~' -x '*.orig' xset.c xset.c
    23 diff -urp -x '*~' -x '*.orig' xset.c xset.c
    24 --- xset.c	2008-03-06 14:28:40.000000000 -0800
    24 --- xset.c	2010-11-09 18:15:26.000000000 -0800
    25 +++ xset.c	2008-03-19 09:53:30.880805000 -0700
    25 +++ xset.c	2011-01-28 20:59:48.793243393 -0800
    26 @@ -74,6 +74,10 @@ in this Software without prior written a
    26 @@ -65,6 +65,10 @@ in this Software without prior written a
    27  #endif
    27  #endif
    28  #ifdef DPMSExtension
    28  #ifdef DPMSExtension
    29  # include <X11/extensions/dpms.h>
    29  # include <X11/extensions/dpms.h>
    30 +# define FBPM /* need to check for fbpm.h in autoconf if we push upstream */
    30 +# define FBPM /* need to check for fbpm.h in autoconf if we push upstream */
    31 +# ifdef FBPM
    31 +# ifdef FBPM
    32 +#  include <X11/extensions/fbpm.h>
    32 +#  include <X11/extensions/fbpm.h>
    33 +# endif
    33 +# endif
    34  # ifdef WIN32
    34  # ifdef WIN32
    35  #  define BOOL wBOOL
    35  #  define BOOL wBOOL
    36  #  ifdef Status
    36  #  ifdef Status
    37 @@ -650,6 +654,62 @@ main(int argc, char *argv[])
    37 @@ -639,6 +643,62 @@ main(int argc, char *argv[])
    38  	    }
    38  	    }
    39  	}
    39  	}
    40  #endif /* DPMSExtension */
    40  #endif /* DPMSExtension */
    41 +#ifdef FBPM
    41 +#ifdef FBPM
    42 +	else if (strcmp(arg, "+fbpm") == 0) {	/* turn on FBPM */
    42 +	else if (strcmp(arg, "+fbpm") == 0) {	/* turn on FBPM */
    95 +	}
    95 +	}
    96 +#endif
    96 +#endif
    97  	else if (strcmp(arg, "s") == 0) {
    97  	else if (strcmp(arg, "s") == 0) {
    98  	    if (i >= argc) {
    98  	    if (i >= argc) {
    99  		set_saver(dpy, ALL, 0);	/* Set everything to default  */
    99  		set_saver(dpy, ALL, 0);	/* Set everything to default  */
   100 @@ -1421,6 +1481,46 @@ query(Display *dpy)
   100 @@ -1522,6 +1582,46 @@ query(Display *dpy)
   101  	}
   101  	}
   102      }
   102      }
   103  #endif
   103  #endif
   104 +#ifdef FBPM
   104 +#ifdef FBPM
   105 +    {
   105 +    {
   142 +    }
   142 +    }
   143 +#endif   
   143 +#endif   
   144  #ifdef FONTCACHE
   144  #ifdef FONTCACHE
   145      {
   145      {
   146  	int dummy;
   146  	int dummy;
   147 @@ -1551,6 +1651,16 @@ usage(char *fmt, ...)
   147 @@ -1652,6 +1752,16 @@ usage(char *fmt, ...)
   148      fprintf(stderr, "\t      (also implicitly enables DPMS features) \n");
   148      fprintf(stderr, "\t      (also implicitly enables DPMS features) \n");
   149      fprintf(stderr, "\t      a timeout value of zero disables the mode \n");
   149      fprintf(stderr, "\t      a timeout value of zero disables the mode \n");
   150  #endif
   150  #endif
   151 +#ifdef FBPM
   151 +#ifdef FBPM
   152 +    fprintf(stderr, "    To control Frame Buffer Power Management (FBPM) features:\n");
   152 +    fprintf(stderr, "    To control Frame Buffer Power Management (FBPM) features:\n");
   159 +    fprintf(stderr, "\t      (also implicitly enables FBPM features) \n");
   159 +    fprintf(stderr, "\t      (also implicitly enables FBPM features) \n");
   160 +#endif  
   160 +#endif  
   161  #ifdef FONTCACHE
   161  #ifdef FONTCACHE
   162      fprintf(stderr, "    To control font cache:\n");
   162      fprintf(stderr, "    To control font cache:\n");
   163      fprintf(stderr, "\t fc [hi-mark [low-mark [balance]]]\n");
   163      fprintf(stderr, "\t fc [hi-mark [low-mark [balance]]]\n");
       
   164 diff -urp -x '*~' -x '*.orig' xset.man xset.man
       
   165 --- xset.man	2010-11-09 18:15:26.000000000 -0800
       
   166 +++ xset.man	2011-01-28 20:59:48.793541415 -0800
       
   167 @@ -1,4 +1,5 @@
       
   168  .\" Copyright 1988, 1998  The Open Group
       
   169 +.\" Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
       
   170  .\"
       
   171  .\" Permission to use, copy, modify, distribute, and sell this software and its
       
   172  .\" documentation for any purpose is hereby granted without fee, provided that
       
   173 @@ -40,6 +41,10 @@ xset - user preference utility for X
       
   174  	[dpms \fIstandby\fP [\fI suspend\fP [\fI off\fP]]]
       
   175  	[dpms force {standby|suspend|off|on}]
       
   176  .br
       
   177 +[+fbpm] [-fbpm]
       
   178 +.br
       
   179 +	[fbpm force {standby|suspend|off|on}]
       
   180 +.br
       
   181  [fp=\fIpathlist\fP]
       
   182  [-fp=\fIpathlist\fP]
       
   183  [+fp=\fIpathlist\fP]
       
   184 @@ -121,7 +126,9 @@ the volume to the nearest value that the
       
   185  The \fB\-dpms\fP option disables DPMS (Energy Star) features.
       
   186  .TP 8
       
   187  .B +dpms
       
   188 -The \fB+dpms\fP option enables DPMS (Energy Star) features.
       
   189 +Enable Energy Star mode. Default times are standby = 1440, suspend = 1620, and
       
   190 +off = 1800 seconds.
       
   191 +.PP
       
   192  .TP 8
       
   193  .B dpms \fIflags...\fP
       
   194  The \fBdpms\fP option allows the DPMS (Energy Star) parameters to be
       
   195 @@ -136,6 +143,32 @@ The first value given is for the `standb
       
   196  `suspend' mode, and the third is for the `off' mode.  Setting these
       
   197  values implicitly enables the DPMS features.  A value of zero disables
       
   198  a particular mode.
       
   199 +Note that standby is less than suspend is less than off, if this condition is not met, an error is produced.
       
   200 +.PP
       
   201 +.TP 8
       
   202 +.B +fbpm
       
   203 +Enable frame buffer power management. NOTE: FBPM timing is linked to DPMS, See DPMS for default timeout values.
       
   204 +.PP
       
   205 +.TP 8
       
   206 +.B -fbpm
       
   207 +Disable frame buffer power management. NOTE: Does not affect DPMS timeouts.
       
   208 +.PP
       
   209 +.TP 8
       
   210 +.B fbpm force standby
       
   211 +Force to standby power level.
       
   212 +.PP
       
   213 +.TP 8
       
   214 +.B fbpm force suspend
       
   215 +Force to suspend power level.
       
   216 +.PP
       
   217 +.TP 8
       
   218 +.B fbpm force off
       
   219 +Force power to off.
       
   220 +.PP
       
   221 +.TP 8
       
   222 +.B fbpm force on
       
   223 +Force power to on.
       
   224 +.PP
       
   225  .TP 8
       
   226  .B fp= \fIpath,...\fP
       
   227  The \fBfp=\fP sets the font path to the entries given in the path argument.