--- /dev/null
+Copyright (c) 1995 Kaleb S. KEITHLEY
+
+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 shall be
+included in all copies or substantial portions of the Software.
+
+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 Kaleb S. KEITHLEY 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.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY.
--- /dev/null
+commit a0bd361fe688590b7d62ffb3ad1c1648a22096d4
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Wed Mar 7 21:39:46 2012 -0800
+
+ libXxf86vm 1.1.2
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 2bac2e232f56836faeab016ab44fe45a3f055fd0
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Nov 10 21:51:52 2011 -0800
+
+ Fix gcc -Wwrite-strings warning
+
+commit 78b0baf7872234c7e0e5753be76a662e34d87984
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Sep 16 22:58:12 2011 -0700
+
+ Strip trailing whitespace
+
+ Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
+ git diff -w & git diff -b show no diffs from this change
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit ad5a4792e35b63c5b193f09303bcc41b322750d0
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Feb 2 11:43:45 2011 -0500
+
+ config: comment, minor upgrade, quote and layout configure.ac
+
+ Group statements per section as per Autoconf standard layout
+ Quote statements where appropriate.
+ Autoconf recommends not using dnl instead of # for comments
+
+ Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters.
+ Add AC_CONFIG_SRCDIR([Makefile.am])
+
+ This helps automated maintenance and release activities.
+ Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines
+
+commit 97d7aa6c8108800d3ccd30ce907ef32e769370a9
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Jan 28 19:41:38 2011 -0500
+
+ config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 353b988717d474a77322a541a6ab56661cc0bedb
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Jan 27 18:50:15 2011 -0500
+
+ config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
+
+ XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls
+ AC_PROG_C_C99. This sets gcc with -std=gnu99.
+ If AC_PROG_CC macro is called afterwards, it resets CC to gcc.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 6f22da39b65983a582d2055e9e43f5dbc0412f1f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Oct 29 18:04:50 2010 -0700
+
+ libXxf86vm 1.1.1
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit fe0659724002e65af6a68be53f57bb8ba85324fe
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Oct 29 18:03:51 2010 -0700
+
+ Sun's copyrights now belong to Oracle
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 84c7286a799d2368ce868afb31b373f8486724c2
+Author: Jesse Adkins <jesserayadkins@gmail.com>
+Date: Tue Sep 28 13:30:04 2010 -0700
+
+ Purge cvs tags.
+
+ Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b6d645596f284550350d8c690cfcce89d019ab60
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Aug 17 19:53:37 2010 -0400
+
+ man: store shadow man pages in git rather than generating them
+
+ Simplify the build process and the makefile.
+
+ Local fix in CVS for bug 5628 is not required
+ as the problem has been fixed in
+ util-macros d9062e4077ebfd0985baf8418f3d0f111b9ddbba
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 01df17daf923b7eeeb3476149d189c5dc8da3bf8
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 8 15:50:02 2010 -0700
+
+ Use make rules instead of shell for loops to generate shadow man pages
+
+ Allows parallel make and simpler build logs/error reporting
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit a3603591f3086f7aeb92b193b2736733b4e79047
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 8 15:37:15 2010 -0700
+
+ config: upgrade to util-macros 1.8 for additional man page support
+
+ Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
+ The value of MAN_SUBST is the same for all X.Org packages.
+
+ Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
+ The existing statement can now be removed from the configuration file.
+
+ Use automake provided $(AM_V_GEN) and XORG_DEFAULT_OPTIONS provided $(SED)
+ Enables silent rule and use platform appropriate version of sed.
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 6be94fa76ef3e2c41c7cb8487e639f0312d3b369
+Author: Fernando Carrijo <fcarrijo@yahoo.com.br>
+Date: Thu Jul 1 07:10:51 2010 -0300
+
+ Purge macros NEED_EVENTS and NEED_REPLIES
+
+ Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
+ Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com>
+ Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 15319d63a389bd9af1819f53a2d021edcd6180f2
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Mar 29 16:50:34 2010 -0400
+
+ config: update AC_PREREQ statement to 2.60
+
+ Unrelated to the previous patches, the new value simply reflects
+ the reality that the minimum level for autoconf to configure
+ all x.org modules is 2.60 dated June 2006.
+
+ ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit a3ed63ba72d767371174d1442c810144b0d2f8b7
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Mar 29 14:53:49 2010 -0400
+
+ config: remove the pkgconfig pc.in file from EXTRA_DIST
+
+ Automake always includes it in the tarball.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 02155a7f70ad94026a7c138081c4249cffbc25a7
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Jan 14 10:15:23 2010 -0500
+
+ COPYING: fix copyright notice incorrect format
+
+ Refer to: XF86VMode.c
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit eba6628379b65326453ea12ddd8cb33b144f3049
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jan 14 20:55:56 2010 -0800
+
+ Update Sun license notices to current X.Org standard form
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 0d976427d1229b65baa489275c62e47762b2803e
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Nov 27 20:56:05 2009 -0500
+
+ Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+
+ Now that the INSTALL file is generated.
+ Allows running make maintainer-clean.
+
+commit e9fd67ec28d4402a498af78f34815cc9d22d6c73
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Wed Oct 28 14:09:10 2009 -0400
+
+ INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+
+ Add missing INSTALL file. Use standard GNU file on building tarball
+ README may have been updated
+ Remove AUTHORS file as it is empty and no content available yet.
+ Remove NEWS file as it is empty and no content available yet.
+
+commit d7cc1a08bfc5c780d0a4f3e0193ff91d0076713c
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Oct 27 15:07:26 2009 -0400
+
+ Deploy the new XORG_DEFAULT_OPTIONS #24242
+
+ This macro aggregate a number of existing macros that sets commmon
+ X.Org components configuration options. It shields the configuration file from
+ future changes.
+
+commit 2bb8c8fcabebf00fdc12b2649459b920e816f382
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon Oct 26 22:08:43 2009 -0400
+
+ Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+
+ ChangeLog filename is known to Automake and requires no further
+ coding in the makefile.
+
+commit 9888ab7cf91cc4c7bf2a545ebc3b8bf0a002aa39
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Oct 22 12:34:19 2009 -0400
+
+ .gitignore: use common defaults with custom section # 24239
+
+ Using common defaults will reduce errors and maintenance.
+ Only the very small or inexistent custom section need periodic maintenance
+ when the structure of the component changes. Do not edit defaults.
+
+commit b4d998a026f03aa2fea74a909f3edea4e4aed5a1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Oct 2 09:43:30 2009 +1000
+
+ libXxf86vm 1.1.0
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8f518e80716915cfb8234a18836ad95121a7d6db
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri Oct 2 08:58:19 2009 +1000
+
+ Require macros 1.3 for XORG_DEFAULT_OPTIONS
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3951e96ddfefa5f3007895002528e713618a60ab
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu Aug 27 11:18:38 2009 +1000
+
+ libXxf86vm 1.0.99.1
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7c7ab2076420a883e827509da0e8a0989a786000
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu Aug 27 11:17:45 2009 +1000
+
+ Include xf86vmproto instead of xf86vmstr.h
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b49fcb355eb1469352eb25ba3dbcf2863cfe5642
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Wed Aug 26 16:09:15 2009 +1000
+
+ Move the xf86vmode.h header from the proto package to here.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f2a1073b3027c508e01beca9ca34bbc6c90f5e6b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Mon Feb 2 20:34:37 2009 -0800
+
+ Add README with pointers to mailing list, bugzilla & git repos
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit e316211692ab7c882be6e89f5c6311160882375f
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Mon Feb 2 14:43:19 2009 -0200
+
+ Janitor: ansification, make distcheck, compiler warnings, .gitignore.
+
+commit 2cba02334e948e215ab32635763e739c8c4a2f56
+Author: Adam Jackson <ajax@redhat.com>
+Date: Wed Jul 2 15:37:20 2008 -0400
+
+ libXxf86vm 1.0.2
+
+commit 31cb01986bc3527152d0e3501b38d1b5cfad3155
+Author: Adam Jackson <ajax@redhat.com>
+Date: Fri Jun 13 13:07:49 2008 -0400
+
+ Don't terminate zero-length strings.
+
+ Just leave vendor and model NULL if the response didn't include them.
+
+commit 0aa2ae83518b14e927fb5b8ced182a4f25cecc76
+Author: Adam Jackson <ajax@redhat.com>
+Date: Mon Mar 24 15:13:14 2008 -0400
+
+ Bug #10846: Fix XF86VidModeGetMonitor when vendor or model are null.
+
+commit 230197a970aec8d5550c2697249ba2e351b2de0b
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date: Sun Mar 9 08:50:55 2008 +0100
+
+ nuke RCS Ids
+
+commit a3bf552ea28f6275f604f114190b0c69d9bf4ef8
+Author: James Cloos <cloos@jhcloos.com>
+Date: Thu Dec 6 16:38:47 2007 -0500
+
+ Replace static ChangeLog with dist-hook to generate from git log
+
+commit 89dd6f2e9f0322001bcc9f5b42705e150414c37d
+Author: James Cloos <cloos@jhcloos.com>
+Date: Mon Sep 3 05:53:52 2007 -0400
+
+ Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 52a0ff653601e603faa9c994a240814f9ddc277c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jul 13 14:59:14 2006 -0700
+
+ renamed: .cvsignore -> .gitignore
+
+commit 3e980bb302befb4c463fa861ab08034c83208622
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Thu Apr 27 00:26:53 2006 +0000
+
+ Bump to 1.0.1
+
+commit 227f7dc999517fc477b63327372fc846e5f44b7d
+Author: Jeremy C. Reed <reed@reedmedia.net>
+Date: Thu Apr 20 23:44:33 2006 +0000
+
+ Fixed typo. Library was spell wrong.
+
+commit 789ff24df047508e04a40fd4b9605e6f40f86638
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Sun Feb 12 18:19:23 2006 +0000
+
+ Bug #5628 <https://bugs.freedesktop.org/show_bug.cgi?id=5628> Shadow pages
+ not created correctly when MANDIR & MANSUFFIX don't match.
+
+commit 6455000546cf8fd14f165a4f13590f94fc9948dc
+Author: Kevin E Martin <kem@kem.org>
+Date: Thu Dec 15 00:24:35 2005 +0000
+
+ Update package version number for final X11R7 release candidate.
+
+commit 22c88452663d7c0b4f854f056968527298b412d2
+Author: Kevin E Martin <kem@kem.org>
+Date: Tue Dec 6 22:48:45 2005 +0000
+
+ Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 5898da0a5deed350973064bf446c97831e42d575
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 05:49:46 2005 +0000
+
+ Update package version number for X11R7 RC3 release.
+
+commit 914624d1fb3924c76e5dc358bb43b4dff800280c
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 04:41:52 2005 +0000
+
+ Add check and cflags for malloc(0) returning NULL.
+
+commit 0f0572fd4b9de8747741ff81d668edfe23db0e15
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Nov 28 22:03:07 2005 +0000
+
+ Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
+ update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)
+
+commit 3d042fdd3fb1d2d30ede743741698589e868701b
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Nov 19 07:15:44 2005 +0000
+
+ Update pkgconfig files to separate library build-time dependencies from
+ application build-time dependencies, and update package deps to work
+ with separate build roots.
+
+commit eb9d4a646a4dfc30fde31deb926a954c2c41ec98
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Oct 19 02:48:12 2005 +0000
+
+ Update package version number for RC1 release.
+
+commit b46825c7ec5c50be0309b52759a2fba05fd2f350
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Tue Oct 18 00:00:09 2005 +0000
+
+ Use @LIB_MAN_SUFFIX@ instead of $(LIB_MAN_SUFFIX) in macro substitutions to
+ work better with BSD make
+
+commit 736aad1287fa65e82cbcb12073ba99ca8d63c0db
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Oct 17 21:13:23 2005 +0000
+
+ Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a
+ suffix rule (reported by Matthieu Herrb)
+
+commit 5735da3f59d36568cfe198eeb1579e51b105491d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Thu Oct 13 04:25:46 2005 +0000
+
+ Add generated man pages to .cvsignores
+
+commit d0f4698f0cf843f6dfdba11eae687ada11e3d4f0
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Thu Oct 13 01:20:52 2005 +0000
+
+ [lib/Xxf86vm manpage cleanup]
+ Use sed to fill in variables in man page Add shadow man pages for man pages
+ that document multiple functions.
+
+commit 72995528798d388422e6e09ee26a0edaffadb779
+Author: Kristian Høgsberg <krh@redhat.com>
+Date: Mon Sep 26 20:55:17 2005 +0000
+
+ Simple whitespace change to change ownership of ,v file on server. Required
+ so that I can change permissions of file.
+
+commit 8f19f14ada44daf9d85f4d65f0bc130ae5b2f4bf
+Author: Kevin E Martin <kem@kem.org>
+Date: Fri Jul 29 21:22:53 2005 +0000
+
+ Various changes preparing packages for RC0:
+ - Verify and update package version numbers as needed
+ - Implement versioning scheme
+ - Change bug address to point to bugzilla bug entry form
+ - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
+ reenable it)
+ - Fix makedepend to use pkgconfig and pass distcheck
+ - Update build script to build macros first
+ - Update modular Xorg version
+
+commit 417a69a7e9ad4df9b3a7f03b09e4694ad5c2bcbc
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Jul 9 21:10:32 2005 +0000
+
+ Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory
+
+commit 4b8ad01b53792d4220579a259290e6bf59eb3d8b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Fri Jul 1 16:16:15 2005 +0000
+
+ spell freedesktop.org correctly
+
+commit a26154988a9367521a15e0876939d8ff7810cd81
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date: Fri Jun 10 22:38:47 2005 +0000
+
+ Apply patch from Jeff Smith (whydoubt@yahoo.com):
+ - Add file linking for Xxf86misc, Xxf86dga, and Xxf86vm.
+ - Check in build system for Xxf86misc, Xxf86dga, and Xxf86vm.
+
+commit c421f84a2d14fbf2995cba23d2ea614b59eadfd5
+Author: Egbert Eich <eich@suse.de>
+Date: Fri Apr 23 19:23:08 2004 +0000
+
+ Merging XORG-CURRENT into trunk
+
+commit 045fa2a95d6eac5db1c6d8781ef48f86d00b655f
+Author: Egbert Eich <eich@suse.de>
+Date: Sun Mar 14 08:33:12 2004 +0000
+
+ Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit d8913570296903c3686969f8c6dbeaf70064f23e
+Author: Egbert Eich <eich@suse.de>
+Date: Wed Mar 3 12:12:14 2004 +0000
+
+ Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 2e3edee344aee8f8cebe139541ebecccec570d8b
+Author: Egbert Eich <eich@suse.de>
+Date: Thu Feb 26 13:35:46 2004 +0000
+
+ readding XFree86's cvs IDs
+
+commit 44926b9d3066d939b66aef57d091b8a878591e1e
+Author: Egbert Eich <eich@suse.de>
+Date: Thu Feb 26 09:23:14 2004 +0000
+
+ Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 56ddf834f4d3cca8afd7d36a63d7b825d1d7ffc0
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Thu Dec 4 22:03:15 2003 +0000
+
+ XFree86 4.3.99.901 (RC 1)
+
+commit db365c73e467868938ad5b15343c3b79b87994d5
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Tue Nov 25 19:28:33 2003 +0000
+
+ XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit ed50d6847a012bef0bf7274626bb0ed8018d5e23
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 16:48:54 2003 +0000
+
+ XFree86 4.3.0.1
+
+commit 252d1a944ccf5ebfc2c7e0c349254be055402c17
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 16:48:49 2003 +0000
+
+ Initial revision
+
+commit 83bc8003b46b0602c36a84ee5b44665887400305
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 15:54:49 2003 +0000
+
+ R6.6 is the Xorg base-line
--- /dev/null
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *Note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
--- /dev/null
+SUBDIRS = src man
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xxf86vm.pc
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
--- /dev/null
+libXxf86vm - Extension library for the XFree86-VidMode X extension
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+ https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+ git://anongit.freedesktop.org/git/xorg/lib/libXxf86vm
+
+ http://cgit.freedesktop.org/xorg/lib/libXxf86vm
+
+For patch submission instructions, see:
+
+ http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+ http://wiki.x.org/wiki/GitPage
+
--- /dev/null
+
+# Initialize Autoconf
+AC_PREREQ([2.60])
+AC_INIT([libXxf86vm], [1.1.2],
+ [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXxf86vm])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS(src/config.h)
+
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Initialize libtool
+AC_PROG_LIBTOOL
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+XORG_CHECK_MALLOC_ZERO
+
+# Obtain compiler/linker options for depedencies
+PKG_CHECK_MODULES(XXF86VM, xproto x11 xextproto xext [xf86vidmodeproto >= 2.2.99.1])
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ man/Makefile
+ xxf86vm.pc])
+AC_OUTPUT
--- /dev/null
+/*
+
+Copyright 1995 Kaleb S. KEITHLEY
+
+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 shall be
+included in all copies or substantial portions of the Software.
+
+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 Kaleb S. KEITHLEY 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.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _XF86VIDMODE_H_
+#define _XF86VIDMODE_H_
+
+#include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
+#include <X11/extensions/xf86vm.h>
+
+#define CLKFLAG_PROGRAMABLE 1
+
+#ifdef XF86VIDMODE_EVENTS
+#define XF86VidModeNotify 0
+#define XF86VidModeNumberEvents (XF86VidModeNotify + 1)
+
+#define XF86VidModeNotifyMask 0x00000001
+
+#define XF86VidModeNonEvent 0
+#define XF86VidModeModeChange 1
+#else
+#define XF86VidModeNumberEvents 0
+#endif
+
+#define XF86VidModeBadClock 0
+#define XF86VidModeBadHTimings 1
+#define XF86VidModeBadVTimings 2
+#define XF86VidModeModeUnsuitable 3
+#define XF86VidModeExtensionDisabled 4
+#define XF86VidModeClientNotLocal 5
+#define XF86VidModeZoomLocked 6
+#define XF86VidModeNumberErrors (XF86VidModeZoomLocked + 1)
+
+#define XF86VM_READ_PERMISSION 1
+#define XF86VM_WRITE_PERMISSION 2
+
+#ifndef _XF86VIDMODE_SERVER_
+
+typedef struct {
+ unsigned short hdisplay;
+ unsigned short hsyncstart;
+ unsigned short hsyncend;
+ unsigned short htotal;
+ unsigned short hskew;
+ unsigned short vdisplay;
+ unsigned short vsyncstart;
+ unsigned short vsyncend;
+ unsigned short vtotal;
+ unsigned int flags;
+ int privsize;
+#if defined(__cplusplus) || defined(c_plusplus)
+ /* private is a C++ reserved word */
+ INT32 *c_private;
+#else
+ INT32 *private;
+#endif
+} XF86VidModeModeLine;
+
+typedef struct {
+ unsigned int dotclock;
+ unsigned short hdisplay;
+ unsigned short hsyncstart;
+ unsigned short hsyncend;
+ unsigned short htotal;
+ unsigned short hskew;
+ unsigned short vdisplay;
+ unsigned short vsyncstart;
+ unsigned short vsyncend;
+ unsigned short vtotal;
+ unsigned int flags;
+ int privsize;
+#if defined(__cplusplus) || defined(c_plusplus)
+ /* private is a C++ reserved word */
+ INT32 *c_private;
+#else
+ INT32 *private;
+#endif
+} XF86VidModeModeInfo;
+
+typedef struct {
+ float hi;
+ float lo;
+} XF86VidModeSyncRange;
+
+typedef struct {
+ char* vendor;
+ char* model;
+ float EMPTY;
+ unsigned char nhsync;
+ XF86VidModeSyncRange* hsync;
+ unsigned char nvsync;
+ XF86VidModeSyncRange* vsync;
+} XF86VidModeMonitor;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent req */
+ Display *display; /* Display the event was read from */
+ Window root; /* root window of event screen */
+ int state; /* What happened */
+ int kind; /* What happened */
+ Bool forced; /* extents of new region */
+ Time time; /* event timestamp */
+} XF86VidModeNotifyEvent;
+
+typedef struct {
+ float red; /* Red Gamma value */
+ float green; /* Green Gamma value */
+ float blue; /* Blue Gamma value */
+} XF86VidModeGamma;
+
+
+#define XF86VidModeSelectNextMode(disp, scr) \
+ XF86VidModeSwitchMode(disp, scr, 1)
+#define XF86VidModeSelectPrevMode(disp, scr) \
+ XF86VidModeSwitchMode(disp, scr, -1)
+
+_XFUNCPROTOBEGIN
+
+Bool XF86VidModeQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */
+);
+
+Bool XF86VidModeQueryExtension(
+ Display* /* dpy */,
+ int* /* event_base */,
+ int* /* error_base */
+);
+
+Bool XF86VidModeSetClientVersion(
+ Display* /* dpy */
+);
+
+Bool XF86VidModeGetModeLine(
+ Display* /* dpy */,
+ int /* screen */,
+ int* /* dotclock */,
+ XF86VidModeModeLine* /* modeline */
+);
+
+Bool XF86VidModeGetAllModeLines(
+ Display* /* dpy */,
+ int /* screen */,
+ int* /* modecount */,
+ XF86VidModeModeInfo*** /* modelinesPtr */
+);
+
+Bool XF86VidModeAddModeLine(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeModeInfo* /* new modeline */,
+ XF86VidModeModeInfo* /* after modeline */
+);
+
+Bool XF86VidModeDeleteModeLine(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeModeInfo* /* modeline */
+);
+
+Bool XF86VidModeModModeLine(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeModeLine* /* modeline */
+);
+
+Status XF86VidModeValidateModeLine(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeModeInfo* /* modeline */
+);
+
+Bool XF86VidModeSwitchMode(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* zoom */
+);
+
+Bool XF86VidModeSwitchToMode(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeModeInfo* /* modeline */
+);
+
+Bool XF86VidModeLockModeSwitch(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* lock */
+);
+
+Bool XF86VidModeGetMonitor(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeMonitor* /* monitor */
+);
+
+Bool XF86VidModeGetViewPort(
+ Display* /* dpy */,
+ int /* screen */,
+ int* /* x return */,
+ int* /* y return */
+);
+
+Bool XF86VidModeSetViewPort(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* x */,
+ int /* y */
+);
+
+Bool XF86VidModeGetDotClocks(
+ Display* /* dpy */,
+ int /* screen */,
+ int* /* flags return */,
+ int* /* number of clocks return */,
+ int* /* max dot clock return */,
+ int** /* clocks return */
+);
+
+Bool XF86VidModeGetGamma(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeGamma* /* Gamma */
+);
+
+Bool XF86VidModeSetGamma(
+ Display* /* dpy */,
+ int /* screen */,
+ XF86VidModeGamma* /* Gamma */
+);
+
+Bool XF86VidModeSetGammaRamp(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* size */,
+ unsigned short* /* red array */,
+ unsigned short* /* green array */,
+ unsigned short* /* blue array */
+);
+
+Bool XF86VidModeGetGammaRamp(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* size */,
+ unsigned short* /* red array */,
+ unsigned short* /* green array */,
+ unsigned short* /* blue array */
+);
+
+Bool XF86VidModeGetGammaRampSize(
+ Display* /* dpy */,
+ int /* screen */,
+ int* /* size */
+);
+
+Bool XF86VidModeGetPermissions(
+ Display* /* dpy */,
+ int /* screen */,
+ int* /* permissions */
+);
+
+_XFUNCPROTOEND
+
+#endif
+
+#endif
--- /dev/null
+#
+# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+# Software.
+#
+# 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.
+#
+
+libmandir = $(LIB_MAN_DIR)
+
+libman_PRE = \
+ XF86VM.man \
+ $(XF86VM_shadows:=.man)
+
+XF86VM_shadows = \
+ XF86VidModeQueryExtension \
+ XF86VidModeQueryVersion \
+ XF86VidModeGetModeLine \
+ XF86VidModeGetAllModeLines \
+ XF86VidModeDeleteModeLine \
+ XF86VidModeModModeLine \
+ XF86VidModeSwitchMode \
+ XF86VidModeSwitchToMode \
+ XF86VidModeLockModeSwitch \
+ XF86VidModeGetMonitor \
+ XF86VidModeGetViewPort \
+ XF86VidModeSetViewPort \
+ XF86VidModeValidateModeLine \
+ XF86VidModeSetClientVersion \
+ XF86VidModeGetDotClocks \
+ XF86VidModeGetGamma \
+ XF86VidModeSetGamma \
+ XF86VidModeSetGammaRamp \
+ XF86VidModeGetGammaRamp \
+ XF86VidModeGetGammaRampSize \
+ XF86VidModeGetPermissions
+
+EXTRA_DIST = $(libman_PRE)
+CLEANFILES = $(libman_DATA)
+
+libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+SUFFIXES = .$(LIB_MAN_SUFFIX) .man
+
+.man.$(LIB_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
--- /dev/null
+.\"
+.\" Copyright (c) 1996 Joe Moss, The XFree86 Project
+.\"
+.de ZN
+.ie t \fB\^\\$1\^\fR\\$2
+.el \fI\^\\$1\^\fP\\$2
+..
+.TH XF86VIDMODE __libmansuffix__ __vendorversion__
+.SH NAME
+XF86VidModeQueryExtension, XF86VidModeQueryVersion, XF86VidModeSetClientVersion, XF86VidModeGetModeLine, XF86VidModeGetAllModeLines, XF86VidModeDeleteModeLine, XF86VidModeModModeLine, XF86VidModeValidateModeLine, XF86VidModeSwitchMode, XF86VidModeSwitchToMode, XF86VidModeLockModeSwitch, XF86VidModeGetMonitor, XF86VidModeGetViewPort, XF86VidModeSetViewPort, XF86VidModeGetDotClocks, XF86VidModeGetGamma, XF86VidModeSetGamma, XF86VidModeGetGammaRamp, XF86VidModeSetGammaRamp, XF86VidModeGetGammaRampSize, XF86VidModeGetPermissions \- Extension library for the XFree86-VidMode X extension
+.SH SYNTAX
+.nf
+.LP
+\&#include <X11/extensions/xf86vmode.h>
+.LP
+Bool XF86VidModeQueryExtension(
+ Display *\fIdisplay\fP\^,
+ int *\fIevent_base_return\fP\^,
+ int *\fIerror_base_return\fP\^);
+.LP
+Bool XF86VidModeQueryVersion(
+ Display *\fIdisplay\fP\^,
+ int *\fImajor_version_return\fP\^,
+ int *\fIminor_version_return\fP\^);
+.LP
+Bool XF86VidModeSetClientVersion(
+ Display *\fIdisplay\fP\^);
+.LP
+Bool XF86VidModeGetModeLine(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int *\fIdotclock_return\fP\^,
+ XF86VidModeModeLine *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeGetAllModeLines(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int *\fImodecount_return\fP\^,
+ XF86VidModeModeInfo ***\fImodesinfo\fP\^);
+.ig
+.LP
+Bool XF86VidModeAddModeLine(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeModeInfo *\fImodeline\fP\,
+ XF86VidModeModeInfo *\fIaftermode\fP\^);
+..
+.LP
+Bool XF86VidModeDeleteModeLine(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeModeInfo *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeModModeLine(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeModeLine *\fImodeline\fP\^);
+.LP
+Status XF86VidModeValidateModeLine(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeModeLine *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeSwitchMode(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int \fIzoom\fP\^);
+.LP
+Bool XF86VidModeSwitchToMode(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeModeInfo *\fImodeline\fP\^);
+.LP
+Bool XF86VidModeLockModeSwitch(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int \fIlock\fP\^);
+.LP
+Bool XF86VidModeGetMonitor(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeMonitor *\fImonitor\fP\^);
+.LP
+Bool XF86VidModeGetViewPort(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int *\fIx_return\fP\^,
+ int *\fIy_return\fP\^);
+.LP
+Bool XF86VidModeSetViewPort(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int \fIx\fP\^,
+ int \fIy\fP\^);
+.LP
+XF86VidModeGetDotClocks(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int *\fIflags return\fP\^,
+ int *\fInumber of clocks return\fP\^,
+ int *\fImax dot clock return\fP\^,
+ int **\fIclocks return\fP\^);
+.LP
+XF86VidModeGetGamma(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeGamma *\fIGamma\fP\^);
+.LP
+XF86VidModeSetGamma(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ XF86VidModeGamma *\fIGamma\fP\^);
+.LP
+XF86VidModeGetGammaRamp(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int \fIsize\fP\^,
+ unsigned short *\fIred array\fP\^,
+ unsigned short *\fIgreen array\fP\^,
+ unsigned short *\fIblue array\fP\^);
+.LP
+XF86VidModeSetGammaRamp(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int \fIsize\fP\^,
+ unsigned short *\fIred array\fP\^,
+ unsigned short *\fIgreen array\fP\^,
+ unsigned short *\fIblue array\fP\^);
+.LP
+XF86VidModeGetGammaRampSize(
+ Display *\fIdisplay\fP\^,
+ int \fIscreen\fP\^,
+ int *\fIsize\fP\^);
+.fi
+.SH ARGUMENTS
+.IP \fIdisplay\fP 2i
+Specifies the connection to the X server.
+.IP \fIscreen\fP 2i
+Specifies which screen number the setting apply to.
+.IP \fIevent_base_return\fP 2i
+Returns the base event number for the extension.
+.IP \fIerror_base_return\fP 2i
+Returns the base error number for the extension.
+.IP \fImajor_version_return\fP 2i
+Returns the major version number of the extension.
+.IP \fIminor_version_return\fP 2i
+Returns the minor version number of the extension.
+.IP \fIdotclock_return\fP 2i
+Returns the clock for the mode line.
+.IP \fImodecount_return\fP 2i
+Returns the number of video modes available in the server.
+.IP \fIzoom\fP 2i
+If greater than zero, indicates that the server should switch to
+the next mode, otherwise switch to the previous mode.
+.IP \fIlock\fP 2i
+Indicates that mode switching should be locked, if non-zero.
+.IP \fImodeline\fP 2i
+Specifies or returns the timing values for a video mode.
+.ig
+.IP \fIaftermode\fP 2i
+Specifies the timing values for the video mode after which the
+new mode will added.
+..
+.IP \fImodesinfo\fP 2i
+Returns the timing values and dotclocks for all of the available
+video modes.
+.IP \fImonitor\fP 2i
+Returns information about the monitor.
+.IP \fIx\fP 2i
+Specifies the desired X location for the viewport.
+.IP \fIx_return\fP 2i
+Returns the current X location of the viewport.
+.IP \fIy\fP 2i
+Specifies the desired Y location for the viewport.
+.IP \fIy_return\fP 2i
+Returns the current Y location of the viewport.
+.SH STRUCTURES
+.nf
+.ta 2.25i 3.5i
+\fIVideo Mode Settings:\fP
+typedef struct {
+ unsigned short hdisplay; /\(** Number of display pixels horizontally */
+ unsigned short hsyncstart; /\(** Horizontal sync start */
+ unsigned short hsyncend; /\(** Horizontal sync end */
+ unsigned short htotal; /\(** Total horizontal pixels */
+ unsigned short vdisplay; /\(** Number of display pixels vertically */
+ unsigned short vsyncstart; /\(** Vertical sync start */
+ unsigned short vsyncend; /\(** Vertical sync start */
+ unsigned short vtotal; /\(** Total vertical pixels */
+ unsigned int flags; /\(** Mode flags */
+ int privsize; /\(** Size of private */
+ INT32 *private; /\(** Server privates */
+} XF86VidModeModeLine;
+.sp
+typedef struct {
+ unsigned int dotclock; /\(** Pixel clock */
+ unsigned short hdisplay; /\(** Number of display pixels horizontally */
+ unsigned short hsyncstart; /\(** Horizontal sync start */
+ unsigned short hsyncend; /\(** Horizontal sync end */
+ unsigned short htotal; /\(** Total horizontal pixels */
+ unsigned short vdisplay; /\(** Number of display pixels vertically */
+ unsigned short vsyncstart; /\(** Vertical sync start */
+ unsigned short vsyncend; /\(** Vertical sync start */
+ unsigned short vtotal; /\(** Total vertical pixels */
+ unsigned int flags; /\(** Mode flags */
+ int privsize; /\(** Size of private */
+ INT32 *private; /\(** Server privates */
+} XF86VidModeModeInfo;
+.LP
+\fIMonitor information:\fP
+typedef struct {
+ char* vendor; /\(** Name of manufacturer */
+ char* model; /\(** Model name */
+ float EMPTY; /\(** unused, for backward compatibility */
+ unsigned char nhsync; /\(** Number of horiz sync ranges */
+ XF86VidModeSyncRange* hsync; /\(** Horizontal sync ranges */
+ unsigned char nvsync; /\(** Number of vert sync ranges */
+ XF86VidModeSyncRange* vsync; /\(** Vertical sync ranges */
+} XF86VidModeMonitor;
+.sp
+typedef struct {
+ float hi; /\(** Top of range */
+ float lo; /\(** Bottom of range */
+} XF86VidModeSyncRange;
+.LP
+typedef struct {
+ int type; /\(** of event */
+ unsigned long serial; /\(** # of last request processed by server */
+ Bool send_event; /\(** true if this came from a SendEvent req */
+ Display *display; /\(** Display the event was read from */
+ Window root; /\(** root window of event screen */
+ int state; /\(** What happened */
+ int kind; /\(** What happened */
+ Bool forced; /\(** extents of new region */
+ Time time; /\(** event timestamp */
+} XF86VidModeNotifyEvent;
+.LP
+typedef struct {
+ float red; /\(** Red Gamma value */
+ float green; /\(** Green Gamma value */
+ float blue; /\(** Blue Gamma value */
+} XF86VidModeGamma;
+.fi
+.SH DESCRIPTION
+These functions provide an interface to the server extension
+\fIXFree86-VidModeExtension\fP
+which allows the video modes to be
+queried and adjusted dynamically and mode switching to be controlled.
+Applications that use these functions must be linked with
+.ZN -lXxf86vm
+.SS "MODELINE FUNCTIONS"
+The
+.ZN XF86VidModeGetModeLine
+function is used to query the settings for the currently selected
+video mode. The calling program should pass a pointer to a
+.ZN XF86VidModeModeLine
+structure that it has already allocated. The function fills in
+the fields of the structure.
+.PP
+If there are any server private values (currently only applicable to
+the S3 server) the function will allocate storage for them.
+Therefore, if the
+.ZN privsize
+field is non-zero, the calling program should call
+.ZN Xfree(private)
+to free the storage.
+.PP
+.ZN XF86VidModeGetAllModeLines
+returns the settings for all video modes.
+The calling program supplies the address of a pointer which will be
+set by the function to point to an array of
+.ZN XF86VidModeModeInfo
+structures. The memory occupied by the array is dynamically allocated
+by the
+.ZN XF86VidModeGetAllModeLines
+function and should be freed by the caller.
+The first element of the array corresponds to the current video mode.
+.PP
+The
+.ZN XF86VidModeModModeLine
+function can be used to change the settings of the current video mode
+provided the requested settings are valid (e.g. they don't exceed the
+capabilities of the monitor).
+.PP
+.ig
+To add a mode to the list of available modes, the
+.ZN XF86VidModeAddModeLine
+function can be used.
+Assuming the settings are valid, the video mode will be added after
+the existing mode which matches the timings specified by the
+.ZN aftermode
+parameter.
+To be considered a match, all of the fields of the given
+.ZN XF86VidModeModeInfo
+structure must match, except the
+.ZN privsize
+and
+.ZN private
+fields.
+If the
+.ZN aftermode
+parameter is zero, the mode will be added
+after the current mode.
+.PP
+..
+Modes can be deleted with the
+.ZN XF86VidModeDeleteModeLine
+function. The specified mode must match an existing mode.
+To be considered a match, all of the fields of the given
+.ZN XF86VidModeModeInfo
+structure must match, except the
+.ZN privsize
+and
+.ZN private
+fields.
+If the mode to be deleted is the current mode, a mode switch
+to the next mode will occur first. The last remaining mode can not
+be deleted.
+.PP
+The validity of a mode can be checked with the
+.ZN XF86VidModeValidateModeLine
+function.
+If the specified mode can be used by the server (i.e. meets all the
+constraints placed upon a mode by the combination of the server, card,
+and monitor) the function returns
+.ZN MODE_OK ,
+otherwise it returns a value indicating the reason why the mode is
+invalid (as defined in \fIxf86.h\fP)
+.SS "MODE SWITCH FUNCTIONS"
+When the function
+.ZN XF86VidModeSwitchMode
+is called, the server will change the video mode to next (or previous)
+video mode. The
+.ZN XF86VidModeSwitchToMode
+function can be used to switch directly to the specified mode.
+Matching is as specified in the description of the
+.ZN XF86VidModeAddModeLine
+function above.
+The
+.ZN XF86VidModeLockModeSwitch
+function can be used to allow or disallow mode switching whether
+the request to switch modes comes from a call to the
+.ZN XF86VidModeSwitchMode
+or
+.ZN XF86VidModeSwitchToMode
+functions or from one of the mode switch key sequences.
+.PP
+.RB Note:
+Because of the asynchronous nature of the X protocol, a call to
+.ZN XFlush
+is needed if the application wants to see the mode change immediately.
+To be informed of the execution status of the request, a
+custom error handler should be installed using
+.ZN XSetErrorHandler
+before calling the mode switching function.
+.SS "MONITOR FUNCTIONS"
+Information known to the server about the monitor is returned by the
+.ZN XF86VidModeGetMonitor
+function. The
+.ZN hsync
+and
+.ZN vsync
+fields each point to an array of
+.ZN XF86VidModeSyncRange
+structures. The arrays contain
+.ZN nhsync
+and
+.ZN nvsync
+elements, respectively.
+The
+.ZN hi
+and
+.ZN low
+values will be equal if a discreate value was given in the
+.ZN XF86Config
+file.
+.PP
+The
+.ZN vendor ,
+.ZN model ,
+.ZN hsync ,
+and
+.ZN vsync
+fields point to dynamically allocated storage that should be freed
+by the caller.
+.SS "VIEWPORT FUNCTIONS"
+The
+.ZN XF86VidModeGetViewPort
+and
+.ZN XF86VidModeSetViewPort
+functions can be used to, respectively, query and change the location
+of the upper left corner of the viewport into the virtual screen.
+.SS "OTHER FUNCTIONS"
+The
+.ZN XF86VidModeQueryVersion
+function can be used to determine the version of the extension
+built into the server.
+.PP
+The function
+.ZN XF86VidModeQueryExtension
+returns the lowest numbered error and event values
+assigned to the extension.
+.SH BUGS
+The
+XF86VidModeSetClientVersion,
+XF86VidModeGetDotClocks,
+XF86VidModeGetGamma,
+XF86VidModeSetGamma,
+XF86VidModeSetGammaRamp,
+XF86VidModeGetGammaRamp,
+XF86VidModeGetGammaRampSize,
+and
+XF86VidModeGetPermissions
+functions need to be documented. In the meantime, check the source
+code for information about how to use them.
+.SH SEE ALSO
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), XFlush(__libmansuffix__), XSetErrorHandler(__libmansuffix__), xvidtune(__appmansuffix__)
+.SH AUTHORS
+Kaleb Keithley, Jon Tombs, David Dawes, and Joe Moss
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XF86VM.__libmansuffix__
--- /dev/null
+Summary: X.Org X11 libXxf86vm runtime library
+Name: libXxf86vm
+Version: 1.1.2
+Release: 1
+License: MIT
+Group: System Environment/Libraries
+URL: http://www.x.org
+Source0: %{name}-%{version}.tar.gz
+
+BuildRequires: pkgconfig(xext) pkgconfig(xf86vidmodeproto)
+BuildRequires: pkgconfig(xorg-macros)
+
+%description
+X.Org X11 libXxf86vm runtime library
+
+%package devel
+Summary: X.Org X11 libXxf86vm development package
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Provides: libxxf86vm-devel
+
+%description devel
+X.Org X11 libXxf86vm development package
+
+%prep
+%setup -q
+
+%build
+%reconfigure --disable-static \
+ LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p %{buildroot}/usr/share/license
+cp -af COPYING %{buildroot}/usr/share/license/%{name}
+make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+
+%remove_docs
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+/usr/share/license/%{name}
+%doc README COPYING ChangeLog
+%{_libdir}/libXxf86vm.so.1
+%{_libdir}/libXxf86vm.so.1.0.0
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/libXxf86vm.so
+%{_libdir}/pkgconfig/xxf86vm.pc
+#%{_mandir}/man3/*.3*
+%{_includedir}/X11/extensions/xf86vmode.h
--- /dev/null
+lib_LTLIBRARIES = libXxf86vm.la
+
+libXxf86vm_la_SOURCES = XF86VMode.c
+
+AM_CFLAGS = $(XXF86VM_CFLAGS) $(MALLOC_ZERO_CFLAGS)
+libXxf86vm_la_LIBADD = $(XXF86VM_LIBS)
+libXxf86vm_la_LDFLAGS = -version-number 1:0:0
+
+INCLUDES = -I$(top_srcdir)/include
+
+libXxf86vmincludedir = $(includedir)/X11/extensions
+libXxf86vminclude_HEADERS = $(top_srcdir)/include/X11/extensions/xf86vmode.h
--- /dev/null
+/*
+
+Copyright (c) 1995 Kaleb S. KEITHLEY
+
+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 shall be
+included in all copies or substantial portions of the Software.
+
+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 Kaleb S. KEITHLEY 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.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY.
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/xf86vmproto.h>
+#include <X11/extensions/xf86vmode.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#ifndef MODE_BAD
+#define MODE_BAD 255
+#endif
+
+static XExtensionInfo _xf86vidmode_info_data;
+static XExtensionInfo *xf86vidmode_info = &_xf86vidmode_info_data;
+static const char *xf86vidmode_extension_name = XF86VIDMODENAME;
+
+#define XF86VidModeCheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, xf86vidmode_extension_name, val)
+
+/*****************************************************************************
+ * *
+ * private utility routines *
+ * *
+ *****************************************************************************/
+
+static XEXT_CLOSE_DISPLAY_PROTO(close_display);
+static /* const */ XExtensionHooks xf86vidmode_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ close_display, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86vidmode_info,
+ xf86vidmode_extension_name,
+ &xf86vidmode_extension_hooks,
+ 0, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86vidmode_info)
+
+
+/*****************************************************************************
+ * *
+ * public XFree86-VidMode Extension routines *
+ * *
+ *****************************************************************************/
+
+Bool
+XF86VidModeQueryExtension(Display *dpy, int *event_basep, int *error_basep)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+Bool
+XF86VidModeQueryVersion(Display* dpy, int* majorVersion, int* minorVersion)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeQueryVersionReply rep;
+ xXF86VidModeQueryVersionReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeQueryVersion;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *majorVersion = rep.majorVersion;
+ *minorVersion = rep.minorVersion;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ if (*majorVersion >= 2)
+ XF86VidModeSetClientVersion(dpy);
+ return True;
+}
+
+Bool
+XF86VidModeSetClientVersion(Display *dpy)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xXF86VidModeSetClientVersionReq *req;
+
+ XF86VidModeCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetClientVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetClientVersion;
+ req->major = XF86VIDMODE_MAJOR_VERSION;
+ req->minor = XF86VIDMODE_MINOR_VERSION;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeSetGamma(Display *dpy, int screen, XF86VidModeGamma *Gamma)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xXF86VidModeSetGammaReq *req;
+
+ XF86VidModeCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetGamma, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetGamma;
+ req->screen = screen;
+ req->red = (CARD32)(Gamma->red * 10000.);
+ req->green = (CARD32)(Gamma->green * 10000.);
+ req->blue = (CARD32)(Gamma->blue * 10000.);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeGetGamma(Display *dpy, int screen, XF86VidModeGamma *Gamma)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetGammaReply rep;
+ xXF86VidModeGetGammaReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetGamma, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetGamma;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ Gamma->red = ((float)rep.red) / 10000.;
+ Gamma->green = ((float)rep.green) / 10000.;
+ Gamma->blue = ((float)rep.blue) / 10000.;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeGetModeLine(Display* dpy, int screen, int* dotclock,
+ XF86VidModeModeLine* modeline)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetModeLineReply rep;
+ xXF86OldVidModeGetModeLineReply oldrep;
+ xXF86VidModeGetModeLineReq *req;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetModeLine;
+ req->screen = screen;
+
+ if (majorVersion < 2) {
+ if (!_XReply(dpy, (xReply *)&oldrep,
+ (SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *dotclock = oldrep.dotclock;
+ modeline->hdisplay = oldrep.hdisplay;
+ modeline->hsyncstart = oldrep.hsyncstart;
+ modeline->hsyncend = oldrep.hsyncend;
+ modeline->htotal = oldrep.htotal;
+ modeline->hskew = 0;
+ modeline->vdisplay = oldrep.vdisplay;
+ modeline->vsyncstart = oldrep.vsyncstart;
+ modeline->vsyncend = oldrep.vsyncend;
+ modeline->vtotal = oldrep.vtotal;
+ modeline->flags = oldrep.flags;
+ modeline->privsize = oldrep.privsize;
+ } else {
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *dotclock = rep.dotclock;
+ modeline->hdisplay = rep.hdisplay;
+ modeline->hsyncstart = rep.hsyncstart;
+ modeline->hsyncend = rep.hsyncend;
+ modeline->htotal = rep.htotal;
+ modeline->hskew = rep.hskew;
+ modeline->vdisplay = rep.vdisplay;
+ modeline->vsyncstart = rep.vsyncstart;
+ modeline->vsyncend = rep.vsyncend;
+ modeline->vtotal = rep.vtotal;
+ modeline->flags = rep.flags;
+ modeline->privsize = rep.privsize;
+ }
+
+ if (modeline->privsize > 0) {
+ if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
+ _XEatData(dpy, (modeline->privsize) * sizeof(INT32));
+ Xfree(modeline->private);
+ return False;
+ }
+ _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
+ } else {
+ modeline->private = NULL;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeGetAllModeLines(Display* dpy, int screen, int* modecount,
+ XF86VidModeModeInfo ***modelinesPtr)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetAllModeLinesReply rep;
+ xXF86VidModeGetAllModeLinesReq *req;
+ XF86VidModeModeInfo *mdinfptr, **modelines;
+ xXF86VidModeModeInfo xmdline;
+ xXF86OldVidModeModeInfo oldxmdline;
+ int i;
+ int majorVersion, minorVersion;
+ Bool protocolBug = False;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ /*
+ * Note: There was a bug in the protocol implementation in versions
+ * 0.x with x < 8 (the .private field wasn't being passed over the wire).
+ * Check the server's version, and accept the old format if appropriate.
+ */
+
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+ if (majorVersion == 0 && minorVersion < 8) {
+ protocolBug = True;
+#ifdef DEBUG
+ fprintf(stderr, "XF86VidModeGetAllModeLines: Warning: Xserver is"
+ "running an old version (%d.%d)\n", majorVersion,
+ minorVersion);
+#endif
+ }
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetAllModeLines, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *modecount = rep.modecount;
+
+ if (!(modelines = (XF86VidModeModeInfo **) Xcalloc(rep.modecount,
+ sizeof(XF86VidModeModeInfo *)
+ +sizeof(XF86VidModeModeInfo)))) {
+ if (majorVersion < 2)
+ _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
+ else
+ _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
+ Xfree(modelines);
+ return False;
+ }
+ mdinfptr = (XF86VidModeModeInfo *) (
+ (char *) modelines
+ + rep.modecount*sizeof(XF86VidModeModeInfo *)
+ );
+
+ for (i = 0; i < rep.modecount; i++) {
+ modelines[i] = mdinfptr++;
+ if (majorVersion < 2) {
+ _XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
+ modelines[i]->dotclock = oldxmdline.dotclock;
+ modelines[i]->hdisplay = oldxmdline.hdisplay;
+ modelines[i]->hsyncstart = oldxmdline.hsyncstart;
+ modelines[i]->hsyncend = oldxmdline.hsyncend;
+ modelines[i]->htotal = oldxmdline.htotal;
+ modelines[i]->hskew = 0;
+ modelines[i]->vdisplay = oldxmdline.vdisplay;
+ modelines[i]->vsyncstart = oldxmdline.vsyncstart;
+ modelines[i]->vsyncend = oldxmdline.vsyncend;
+ modelines[i]->vtotal = oldxmdline.vtotal;
+ modelines[i]->flags = oldxmdline.flags;
+ if (protocolBug) {
+ modelines[i]->privsize = 0;
+ modelines[i]->private = NULL;
+ } else {
+ modelines[i]->privsize = oldxmdline.privsize;
+ if (oldxmdline.privsize > 0) {
+ if (!(modelines[i]->private =
+ Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
+ _XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
+ Xfree(modelines[i]->private);
+ } else {
+ _XRead(dpy, (char*)modelines[i]->private,
+ oldxmdline.privsize * sizeof(INT32));
+ }
+ } else {
+ modelines[i]->private = NULL;
+ }
+ }
+ } else {
+ _XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo));
+ modelines[i]->dotclock = xmdline.dotclock;
+ modelines[i]->hdisplay = xmdline.hdisplay;
+ modelines[i]->hsyncstart = xmdline.hsyncstart;
+ modelines[i]->hsyncend = xmdline.hsyncend;
+ modelines[i]->htotal = xmdline.htotal;
+ modelines[i]->hskew = xmdline.hskew;
+ modelines[i]->vdisplay = xmdline.vdisplay;
+ modelines[i]->vsyncstart = xmdline.vsyncstart;
+ modelines[i]->vsyncend = xmdline.vsyncend;
+ modelines[i]->vtotal = xmdline.vtotal;
+ modelines[i]->flags = xmdline.flags;
+ if (protocolBug) {
+ modelines[i]->privsize = 0;
+ modelines[i]->private = NULL;
+ } else {
+ modelines[i]->privsize = xmdline.privsize;
+ if (xmdline.privsize > 0) {
+ if (!(modelines[i]->private =
+ Xcalloc(xmdline.privsize, sizeof(INT32)))) {
+ _XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
+ Xfree(modelines[i]->private);
+ } else {
+ _XRead(dpy, (char*)modelines[i]->private,
+ xmdline.privsize * sizeof(INT32));
+ }
+ } else {
+ modelines[i]->private = NULL;
+ }
+ }
+ }
+ }
+ *modelinesPtr = modelines;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/*
+ * GetReq replacement for use with VidMode protocols earlier than 2.0
+ */
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetOldReq(name, oldname, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = (SIZEOF(x##oldname##Req))>>2;\
+ dpy->bufptr += SIZEOF(x##oldname##Req);\
+ dpy->request++
+
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#define GetOldReq(name, oldname, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\
+ dpy->bufptr += SIZEOF(x/**/oldname/**/Req);\
+ dpy->request++
+#endif
+
+Bool
+XF86VidModeAddModeLine(Display *dpy, int screen,
+ XF86VidModeModeInfo* newmodeline,
+ XF86VidModeModeInfo* aftermodeline)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeAddModeLineReq *req;
+ xXF86OldVidModeAddModeLineReq *oldreq;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
+ oldreq->screen = screen;
+ oldreq->dotclock = newmodeline->dotclock;
+ oldreq->hdisplay = newmodeline->hdisplay;
+ oldreq->hsyncstart = newmodeline->hsyncstart;
+ oldreq->hsyncend = newmodeline->hsyncend;
+ oldreq->htotal = newmodeline->htotal;
+ oldreq->vdisplay = newmodeline->vdisplay;
+ oldreq->vsyncstart = newmodeline->vsyncstart;
+ oldreq->vsyncend = newmodeline->vsyncend;
+ oldreq->vtotal = newmodeline->vtotal;
+ oldreq->flags = newmodeline->flags;
+ oldreq->privsize = newmodeline->privsize;
+ if (aftermodeline != NULL) {
+ oldreq->after_dotclock = aftermodeline->dotclock;
+ oldreq->after_hdisplay = aftermodeline->hdisplay;
+ oldreq->after_hsyncstart = aftermodeline->hsyncstart;
+ oldreq->after_hsyncend = aftermodeline->hsyncend;
+ oldreq->after_htotal = aftermodeline->htotal;
+ oldreq->after_vdisplay = aftermodeline->vdisplay;
+ oldreq->after_vsyncstart = aftermodeline->vsyncstart;
+ oldreq->after_vsyncend = aftermodeline->vsyncend;
+ oldreq->after_vtotal = aftermodeline->vtotal;
+ oldreq->after_flags = aftermodeline->flags;
+ } else {
+ oldreq->after_dotclock = 0;
+ oldreq->after_hdisplay = 0;
+ oldreq->after_hsyncstart = 0;
+ oldreq->after_hsyncend = 0;
+ oldreq->after_htotal = 0;
+ oldreq->after_vdisplay = 0;
+ oldreq->after_vsyncstart = 0;
+ oldreq->after_vsyncend = 0;
+ oldreq->after_vtotal = 0;
+ oldreq->after_flags = 0;
+ }
+ if (newmodeline->privsize) {
+ oldreq->length += newmodeline->privsize;
+ Data32(dpy, (long *) newmodeline->private,
+ newmodeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeAddModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
+ req->screen = screen;
+ req->dotclock = newmodeline->dotclock;
+ req->hdisplay = newmodeline->hdisplay;
+ req->hsyncstart = newmodeline->hsyncstart;
+ req->hsyncend = newmodeline->hsyncend;
+ req->htotal = newmodeline->htotal;
+ req->hskew = newmodeline->hskew;
+ req->vdisplay = newmodeline->vdisplay;
+ req->vsyncstart = newmodeline->vsyncstart;
+ req->vsyncend = newmodeline->vsyncend;
+ req->vtotal = newmodeline->vtotal;
+ req->flags = newmodeline->flags;
+ req->privsize = newmodeline->privsize;
+ if (aftermodeline != NULL) {
+ req->after_dotclock = aftermodeline->dotclock;
+ req->after_hdisplay = aftermodeline->hdisplay;
+ req->after_hsyncstart = aftermodeline->hsyncstart;
+ req->after_hsyncend = aftermodeline->hsyncend;
+ req->after_htotal = aftermodeline->htotal;
+ req->after_hskew = aftermodeline->hskew;
+ req->after_vdisplay = aftermodeline->vdisplay;
+ req->after_vsyncstart = aftermodeline->vsyncstart;
+ req->after_vsyncend = aftermodeline->vsyncend;
+ req->after_vtotal = aftermodeline->vtotal;
+ req->after_flags = aftermodeline->flags;
+ } else {
+ req->after_dotclock = 0;
+ req->after_hdisplay = 0;
+ req->after_hsyncstart = 0;
+ req->after_hsyncend = 0;
+ req->after_htotal = 0;
+ req->after_hskew = 0;
+ req->after_vdisplay = 0;
+ req->after_vsyncstart = 0;
+ req->after_vsyncend = 0;
+ req->after_vtotal = 0;
+ req->after_flags = 0;
+ }
+ if (newmodeline->privsize) {
+ req->length += newmodeline->privsize;
+ Data32(dpy, (long *) newmodeline->private,
+ newmodeline->privsize * sizeof(INT32));
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeDeleteModeLine(Display *dpy, int screen,
+ XF86VidModeModeInfo* modeline)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeDeleteModeLineReq *req;
+ xXF86OldVidModeDeleteModeLineReq *oldreq;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, 0);
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
+ oldreq->screen = screen;
+ oldreq->dotclock = modeline->dotclock;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeDeleteModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
+ req->screen = screen;
+ req->dotclock = modeline->dotclock;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeModModeLine(Display *dpy, int screen, XF86VidModeModeLine* modeline)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeModModeLineReq *req;
+ xXF86OldVidModeModModeLineReq *oldreq;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, 0);
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
+ oldreq->screen = screen;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeModModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeModModeLine;
+ req->screen = screen;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Status
+XF86VidModeValidateModeLine(Display *dpy, int screen,
+ XF86VidModeModeInfo* modeline)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeValidateModeLineReq *req;
+ xXF86OldVidModeValidateModeLineReq *oldreq;
+ xXF86VidModeValidateModeLineReply rep;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, 0);
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
+ oldreq->screen = screen;
+ oldreq->dotclock = modeline->dotclock;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeValidateModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
+ req->screen = screen;
+ req->dotclock = modeline->dotclock;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return MODE_BAD;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status;
+}
+
+Bool
+XF86VidModeSwitchMode(Display* dpy, int screen, int zoom)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSwitchModeReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSwitchMode, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSwitchMode;
+ req->screen = screen;
+ req->zoom = zoom;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeSwitchToMode(Display* dpy, int screen, XF86VidModeModeInfo* modeline)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSwitchToModeReq *req;
+ xXF86OldVidModeSwitchToModeReq *oldreq;
+ int majorVersion, minorVersion;
+ Bool protocolBug = False;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ /*
+ * Note: There was a bug in the protocol implementation in versions
+ * 0.x with x < 8 (the .private field wasn't expected to be sent over
+ * the wire). Check the server's version, and accept the old format
+ * if appropriate.
+ */
+
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+ if (majorVersion == 0 && minorVersion < 8) {
+ protocolBug = True;
+#ifdef DEBUG
+ fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is"
+ "running an old version (%d.%d)\n", majorVersion,
+ minorVersion);
+#endif
+ }
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
+ oldreq->screen = screen;
+ oldreq->dotclock = modeline->dotclock;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ if (protocolBug) {
+ oldreq->privsize = 0;
+ } else {
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ } else {
+ GetReq(XF86VidModeSwitchToMode, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
+ req->screen = screen;
+ req->dotclock = modeline->dotclock;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ if (protocolBug) {
+ req->privsize = 0;
+ } else {
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeLockModeSwitch(Display* dpy, int screen, int lock)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeLockModeSwitchReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeLockModeSwitch, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeLockModeSwitch;
+ req->screen = screen;
+ req->lock = lock;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeGetMonitor(Display* dpy, int screen, XF86VidModeMonitor* monitor)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetMonitorReply rep;
+ xXF86VidModeGetMonitorReq *req;
+ CARD32 syncrange;
+ int i;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetMonitor, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetMonitor;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ monitor->nhsync = rep.nhsync;
+ monitor->nvsync = rep.nvsync;
+#if 0
+ monitor->bandwidth = (float)rep.bandwidth / 1e6;
+#endif
+ if (rep.vendorLength) {
+ if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+ return False;
+ }
+ } else {
+ monitor->vendor = NULL;
+ }
+ if (rep.modelLength) {
+ if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+ if (monitor->vendor)
+ Xfree(monitor->vendor);
+ return False;
+ }
+ } else {
+ monitor->model = NULL;
+ }
+ if (!(monitor->hsync = Xcalloc(rep.nhsync, sizeof(XF86VidModeSyncRange)))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+
+ if (monitor->vendor)
+ Xfree(monitor->vendor);
+ if (monitor->model)
+ Xfree(monitor->model);
+ return False;
+ }
+ if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(XF86VidModeSyncRange)))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+ if (monitor->vendor)
+ Xfree(monitor->vendor);
+ if (monitor->model)
+ Xfree(monitor->model);
+ Xfree(monitor->hsync);
+ return False;
+ }
+ for (i = 0; i < rep.nhsync; i++) {
+ _XRead(dpy, (char *)&syncrange, 4);
+ monitor->hsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
+ monitor->hsync[i].hi = (float)(syncrange >> 16) / 100.0;
+ }
+ for (i = 0; i < rep.nvsync; i++) {
+ _XRead(dpy, (char *)&syncrange, 4);
+ monitor->vsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
+ monitor->vsync[i].hi = (float)(syncrange >> 16) / 100.0;
+ }
+ if (rep.vendorLength)
+ _XReadPad(dpy, monitor->vendor, rep.vendorLength);
+ if (rep.modelLength)
+ _XReadPad(dpy, monitor->model, rep.modelLength);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeGetViewPort(Display* dpy, int screen, int *x, int *y)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetViewPortReply rep;
+ xXF86VidModeGetViewPortReq *req;
+ int majorVersion, minorVersion;
+ Bool protocolBug = False;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ /*
+ * Note: There was a bug in the protocol implementation in versions
+ * 0.x with x < 8 (no reply was sent, so the client would hang)
+ * Check the server's version, and don't wait for a reply with older
+ * versions.
+ */
+
+ XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
+ if (majorVersion == 0 && minorVersion < 8) {
+ protocolBug = True;
+#ifdef DEBUG
+ fprintf(stderr, "XF86VidModeGetViewPort: Warning: Xserver is"
+ "running an old version (%d.%d)\n", majorVersion,
+ minorVersion);
+#endif
+ }
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetViewPort, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetViewPort;
+ req->screen = screen;
+ if (protocolBug) {
+ *x = 0;
+ *y = 0;
+ } else {
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *x = rep.x;
+ *y = rep.y;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeSetViewPort(Display* dpy, int screen, int x, int y)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSetViewPortReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetViewPort, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetViewPort;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeGetDotClocks(Display* dpy, int screen, int *flagsPtr,
+ int *numclocksPtr, int *maxclocksPtr, int *clocksPtr[])
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetDotClocksReply rep;
+ xXF86VidModeGetDotClocksReq *req;
+ int i, *dotclocks;
+ CARD32 dotclk;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetDotClocks, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xReply)) >> 2, xFalse))
+ {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *numclocksPtr = rep.clocks;
+ *maxclocksPtr = rep.maxclocks;
+ *flagsPtr = rep.flags;
+
+ if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
+ _XEatData(dpy, (rep.clocks) * 4);
+ Xfree(dotclocks);
+ return False;
+ }
+
+ for (i = 0; i < rep.clocks; i++) {
+ _XRead(dpy, (char*)&dotclk, 4);
+ dotclocks[i] = dotclk;
+ }
+ *clocksPtr = dotclocks;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+XF86VidModeSetGammaRamp (
+ Display *dpy,
+ int screen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+)
+{
+ int length = (size + 1) & ~1;
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSetGammaRampReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetGammaRamp, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp;
+ req->screen = screen;
+ req->length += (length >> 1) * 3;
+ req->size = size;
+ _XSend(dpy, (char*)red, size * 2);
+ _XSend(dpy, (char*)green, size * 2);
+ _XSend(dpy, (char*)blue, size * 2);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool
+XF86VidModeGetGammaRamp (
+ Display *dpy,
+ int screen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetGammaRampReq *req;
+ xXF86VidModeGetGammaRampReply rep;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetGammaRamp, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp;
+ req->screen = screen;
+ req->size = size;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ if(rep.size) {
+ _XRead(dpy, (char*)red, rep.size << 1);
+ _XRead(dpy, (char*)green, rep.size << 1);
+ _XRead(dpy, (char*)blue, rep.size << 1);
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool XF86VidModeGetGammaRampSize(
+ Display *dpy,
+ int screen,
+ int *size
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetGammaRampSizeReq *req;
+ xXF86VidModeGetGammaRampSizeReply rep;
+
+ *size = 0;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetGammaRampSize, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize;
+ req->screen = screen;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ *size = rep.size;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool XF86VidModeGetPermissions(
+ Display *dpy,
+ int screen,
+ int *permissions
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetPermissionsReq *req;
+ xXF86VidModeGetPermissionsReply rep;
+
+ *permissions = 0;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetPermissions, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetPermissions;
+ req->screen = screen;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ *permissions = rep.permissions;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Xxf86vm
+Description: XFree86 Video Mode Extension Library
+Version: @VERSION@
+Requires: xf86vidmodeproto
+Requires.private: x11 xext
+Cflags: -I${includedir}
+Libs: -L${libdir} -lXxf86vm