--- /dev/null
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995, 1996 The XFree86 Project, Inc
+
+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 fur-
+nished 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, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the XFree86 Project shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from the XFree86
+Project.
--- /dev/null
+commit 3eb0d49a8d673c79ba9714d027f1ee056cf4b0b9
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Oct 29 18:00:17 2010 -0700
+
+ libXxf86dga 1.1.2
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 967c47b8e431e1b4a25b3436ba4e130cc7eee5b5
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Fri Oct 29 17:58:37 2010 -0700
+
+ Sun's copyrights now belong to Oracle
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit a9cad8418292ee2291004d2c9ada7547120b53fd
+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 a8a764e1c41a8f261f768e9ac2ef24e23ba6eedd
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Aug 17 14:37:23 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 7395fb5197549ce048b9e759eb27cd7f4f284c66
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 8 15:28:39 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 30a8e2d18fe6dc9fac599e2570360ebb27207811
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 8 15:26:35 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 86ece63cf0d038eb36e80cc4836eb387c407b773
+Author: Fernando Carrijo <fcarrijo@yahoo.com.br>
+Date: Thu Jul 1 07:08:11 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 5c9d042d4450d28c50258895885836253fbf5e61
+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 e8483875af8417918ce99fac61982167f96acf17
+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 1ad4c147bbaf1523adba2e9f4b289c0fb4360097
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue Feb 16 10:37:21 2010 -0500
+
+ config: move CWARNFLAGS from configure.ac to Makefile.am
+
+ Compiler warning flags should be explicitly set in the makefile
+ rather than being merged with other packages compiler flags.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 253089a20d1496ef4102d06d603f1755e5e6e746
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Thu Jan 14 10:37:36 2010 -0500
+
+ COPYING: fix copyright notice format
+
+ Newlines and spaces.
+
+ Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 639c859ee3b74088a50bc0402f99261bd5c0f3e9
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jan 14 20:56:48 2010 -0800
+
+ Update Sun license notices to current X.Org standard form
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit cc8610353912c7002da001365cb9a27e1e02091a
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date: Fri Nov 27 20:56:04 2009 -0500
+
+ Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+
+ Now that the INSTALL file is generated.
+ Allows running make maintainer-clean.
+
+commit 6631f7b26574e665dfec6003ecc8d0bf77151ab4
+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 7c8e098dece92f8ac824c8e2eb3e737cacee57e7
+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 8255d46aafed7f7527360b7b1dbf2333ad41444a
+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 efd0fb6f31ee88887e16e98dca89473ff2bb56a1
+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 990b19154368d9a1733636367d6a99d863d558ee
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Oct 6 16:14:45 2009 +1000
+
+ libXxf86dga 1.1.1
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3cfcfc6246fb213bb0edf529b4f2b40907e5161c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Oct 6 15:38:27 2009 +1000
+
+ Include Xxf86dga.h, not xf86dga.
+
+ f78f3ed3571ab0bd75753a7ab388120a383d894a removed xf86dga.h and instead
+ provided Xxf86dga.h. Let's use it!
+
+ Also, remove two superfluous includes, including it once per file is enough.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0bd51760a0d92181faedbd52e7d7249c8179f95d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue Oct 6 15:34:22 2009 +1000
+
+ Actually use XORG_DEFAULT_OPTIONS
+
+ For some reason, this part didn't make it into
+ 8eab9123467b047f2b4ddec7df48a679c9254ca1.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5bf5c3c78963cec3cd22e445c62cc7cfd2a37df2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu Oct 1 22:34:39 2009 +1000
+
+ libXxf86dga 1.1
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8eab9123467b047f2b4ddec7df48a679c9254ca1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu Oct 1 22:33:10 2009 +1000
+
+ Require macros 1.3 for XORG_DEFAULT_OPTIONS
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9be294d7455ce5799b09bc6bb06c18bea80287be
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Sep 21 10:16:25 2009 +1000
+
+ Bump to 1.0.99.2
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f78f3ed3571ab0bd75753a7ab388120a383d894a
+Author: Carl Worth <cworth@cworth.org>
+Date: Wed Sep 16 17:08:17 2009 -0700
+
+ Rename xf86dga.h to Xxf86dga.h
+
+ The xf86dgaproto package (as of 2.0.99.2) now provides an include file
+ named xf86dga.h for compatibility. We now depend on that version.
+
+commit fd90936abab52caf163c83d114a22980adcc3ee0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Thu Aug 27 10:56:55 2009 +1000
+
+ Bump to 1.0.99.1
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e28cffbe48279a622b19cab1c83ab0a97e60ccef
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Wed Aug 26 16:41:04 2009 +1000
+
+ Move Xlib headers from xf86dgaproto to here.
+
+ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 66abdd3e52ef3071c7d89313cc95935a4ee7ba52
+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 11ff34f811737514ded5231b73407d63a1baf68d
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date: Mon Feb 2 14:22:44 2009 -0200
+
+ Janitor: make distcheck and .gitignore.
+
+commit d5bcd25affa9df2d937f57fac914de4b6f740ae6
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date: Sun Mar 9 08:47:58 2008 +0100
+
+ nuke RCS Ids
+
+commit 7acb8e34e19ca4ac3347cd42c31adf877397f23b
+Author: James Cloos <cloos@jhcloos.com>
+Date: Thu Dec 6 16:38:43 2007 -0500
+
+ Replace static ChangeLog with dist-hook to generate from git log
+
+commit 5968e0f1e992db63b003f2389657cd527a806efd
+Author: Eric Anholt <eric@anholt.net>
+Date: Wed Sep 5 10:17:57 2007 -0700
+
+ Bump to 1.0.2 and require updated xf86dgaproto for the prototype update.
+
+commit 625a9c61265cdd1de3da425843a1a8de80d67c78
+Author: James Cloos <cloos@jhcloos.com>
+Date: Mon Sep 3 05:53:50 2007 -0400
+
+ Add *~ to .gitignore to skip patch/emacs droppings
+
+commit b3d86af10895f30ffb2999c28c5864b2be8681f6
+Author: Wang Zhenyu <zhenyu.z.wang@intel.com>
+Date: Wed Apr 18 09:35:56 2007 +0800
+
+ Fix sign extension bug on x86_64 system.
+
+ In XF86DGAGetVideoLL(), we pass offset param as 'int' type, but
+ later we cast it to 'unsigned long' in calling MapPhysAddress().
+ This causes page table error on x86_64 system like below:
+
+ dga: Corrupted page table at address 2b9712b1b000
+ PGD 702a4067 PUD 6f830067 PMD 6f864067 PTE ffffffff80040027
+ Bad pagetable: 000f [1] SMP
+ CPU 0
+ Modules linked in: i915 drm dm_mirror dm_mod video button battery asus_acpi ac parport_pc parport nvram uhci_hcd ehci_hcd snd_hda_intel snd_hda_codec snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss pcspkr snd_pcm i2c_i801 i2c_core e1000 snd_timer snd soundcore snd_page_alloc
+ Pid: 2509, comm: dga Not tainted 2.6.21-rc6 #2
+ RIP: 0033:[<0000003d119754a0>] [<0000003d119754a0>]
+ RSP: 002b:00007fff98f0d4c8 EFLAGS: 00010202
+ RAX: 0000000000008000 RBX: 0000000000000001 RCX: 00002b9712b1b000
+ RDX: 0000000000200000 RSI: 0000000000000071 RDI: 00002b9712b1b000
+ RBP: 0000000000000000 R08: 7171717171717171 R09: 0000000000000000
+ R10: 0000000000000000 R11: 0000003d119753e0 R12: 0000000000000000
+ R13: 00007fff98f0d730 R14: 0000000000503010 R15: 0000000000000000
+ FS: 00002b9712b19f60(0000) GS:ffffffff8060d000(0000) knlGS:0000000000000000
+ CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+ CR2: 00002b9712b1b000 CR3: 000000006ffdb000 CR4: 00000000000006e0
+ Process dga (pid: 2509, threadinfo ffff8100718de000, task ffff81006ffd67a0)
+
+ RIP [<0000003d119754a0>]
+ RSP <00007fff98f0d4c8>
+
+ This patch requires latest xf86dgaproto to build.
+
+commit 316e02ab0bd590851c80e3028150f2a6a5a36708
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date: Thu Jul 13 14:59:12 2006 -0700
+
+ renamed: .cvsignore -> .gitignore
+
+commit b5be6bc7a5b5527f86dfd224e89a7c1561845131
+Author: Adam Jackson <ajax@nwnk.net>
+Date: Thu Apr 27 00:25:08 2006 +0000
+
+ Bump to 1.0.1
+
+commit 9ec9ba4c4539b27d819553fa4be73745b4fdfbf7
+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 5ab70ae500ec62fc89c7fa783f60db87d8b934a7
+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 a31ecfdc3fde5b217f06cf3351bb12b37f5f7882
+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 a3121e6147f16eb72c9df262c7735191c98626bd
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 05:49:45 2005 +0000
+
+ Update package version number for X11R7 RC3 release.
+
+commit 47a9625fe9e29c4ead2b7209c0d064aeff415eaf
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Dec 3 04:41:51 2005 +0000
+
+ Add check and cflags for malloc(0) returning NULL.
+
+commit dbd43adfb46efddc1380895e192d96982470cb4d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Nov 28 22:03:06 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 81f335d928ea693c6dff24c2a170010959b1cc1d
+Author: Kevin E Martin <kem@kem.org>
+Date: Sat Nov 19 07:15:43 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 a346dd66fdfe04d2cb41bd2f7869f1c6b90e5941
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Nov 9 21:19:13 2005 +0000
+
+ Update package version number for X11R7 RC2 release.
+
+commit 70330a9bf76526353725e50233faafa14efcde16
+Author: Kean Johnson <kean@armory.com>
+Date: Tue Nov 8 06:33:25 2005 +0000
+
+ See ChangeLog entry 2005-11-07 for details.
+
+commit 01d7b50a520e92449afaabaed5d331db9c49084e
+Author: Kevin E Martin <kem@kem.org>
+Date: Wed Oct 19 02:48:12 2005 +0000
+
+ Update package version number for RC1 release.
+
+commit b0171fe11db042bccc7eaf2c0a88c3640eba6974
+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 32bf677cabd0641aa6bdcfbf58ec782133cc97ff
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Mon Oct 17 21:13:22 2005 +0000
+
+ Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a
+ suffix rule (reported by Matthieu Herrb)
+
+commit 04020960fd2baa35a0e3546a536fe196f9e0d13d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Thu Oct 13 04:25:46 2005 +0000
+
+ Add generated man pages to .cvsignores
+
+commit 03c9007c310c8ca72d4c01a64f20c92bc581d688
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Wed Oct 12 01:18:25 2005 +0000
+
+ Use sed to put version number in man page Add shadow man pages for man
+ pages that document multiple functions.
+
+commit 4ce6461553712f7e966e874607225e57cd35e7eb
+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 b56facdddd0b07195082ca94f6745b890151ad7b
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Jul 9 21:05:22 2005 +0000
+
+ Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory
+
+commit 2343f1171cb1a36e47622395965d072a0ce78db7
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date: Fri Jul 1 16:16:15 2005 +0000
+
+ spell freedesktop.org correctly
+
+commit 139215564ee6e63101858b9481f3413361a6d4a7
+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 177b9f5cb3c9108d9547731721efb8cd6064b753
+Author: Egbert Eich <eich@suse.de>
+Date: Thu May 6 17:31:17 2004 +0000
+
+ BugZilla #601: Fixing makedepend choking on floating point exception
+ because CHAR_BIT is defined to __CHAR_BIT__ which is a compiler
+ intrinsic define. BugZilla #605: Fixing build on IA64 which is broken
+ due to the inclusion of the kernel header asm/page.h. Kernel headers
+ however don't work with
+ -ansi. The inclusion of asm/page.h can however savely be removed as it
+ there are plenty of other ways to determine the page size.
+
+commit a18b2a60c586926bf51e40aae0adf65c0b232184
+Author: Egbert Eich <eich@suse.de>
+Date: Fri Apr 23 18:43:55 2004 +0000
+
+ Merging XORG-CURRENT into trunk
+
+commit 5ac2ec8cdbfc35957cca371e11c7dad06d410f73
+Author: Egbert Eich <eich@suse.de>
+Date: Sun Mar 14 08:32:27 2004 +0000
+
+ Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 1abdebb927820b966ea5c4af7437666fef02ba77
+Author: Egbert Eich <eich@suse.de>
+Date: Wed Mar 3 12:11:33 2004 +0000
+
+ Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 2fdd9aa86fb54d85563b7a9cb5b232b3a47705c0
+Author: Egbert Eich <eich@suse.de>
+Date: Thu Feb 26 13:35:34 2004 +0000
+
+ readding XFree86's cvs IDs
+
+commit a102c89670006328f7ef0190385d72a5b1d52e5c
+Author: Egbert Eich <eich@suse.de>
+Date: Thu Feb 26 09:22:48 2004 +0000
+
+ Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 7c35b3f77af60ea304442f55ca5c665c0862da0a
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Thu Dec 4 22:02:57 2003 +0000
+
+ XFree86 4.3.99.901 (RC 1)
+
+commit dad8187051796d5dd318a4c324336344f80debab
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Thu Dec 4 22:02:57 2003 +0000
+
+ Initial revision
+
+commit 55019a1748a69f278dcc728e0db7ee79d426e695
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Tue Nov 25 19:28:16 2003 +0000
+
+ XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 2b92812979340a133c14336d4a87ea95a942b676
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 16:48:49 2003 +0000
+
+ XFree86 4.3.0.1
+
+commit ca572cb2f331b374c246b4435f5aeb036392e16f
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date: Fri Nov 14 16:48:49 2003 +0000
+
+ Initial revision
--- /dev/null
+SUBDIRS = src man
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xxf86dga.pc
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
--- /dev/null
+libXxf86dga - Client library for the XFree86-DGA 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/libXxf86dga
+
+ http://cgit.freedesktop.org/xorg/lib/libXxf86dga
+
+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
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
--- /dev/null
+AC_PREREQ([2.60])
+
+AC_INIT([libXxf86dga], [1.1.2],
+ [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
+ [libXxf86dga])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# 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
+AM_CONFIG_HEADER(src/config.h)
+
+# Check for progs
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XXF86DGA, xproto x11 xextproto xext [xf86dgaproto >= 2.0.99.2])
+
+XORG_CHECK_MALLOC_ZERO
+
+AC_OUTPUT([Makefile
+ src/Makefile
+ man/Makefile
+ xxf86dga.pc])
--- /dev/null
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit"
+ (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+ may be git'cherry-picked into the Debian repository. In this
+ case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+ with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+ git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
--- /dev/null
+libxxf86dga (2:1.1.2-1slp2) unstable; urgency=low
+
+ * [X11R7.6] upgrade package
+ * Git: 165.213.180.234:slp/pkgs/xorg/lib/libxxf86dga
+ * Tag: libxxf86dga_1.1.2-1slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com> Thu, 06 Jan 2011 12:02:12 +0900
+
+libxxf86dga (2:1.1.1-5slp2) unstable; urgency=low
+
+ * Add --as-needed
+ * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libxxf86dga
+ * Tag: libxxf86dga_1.1.1-5slp2
+
+ -- SooChan Lim <sc1.lim@samsung.com> Sat, 20 Nov 2010 16:24:55 +0900
+
+libxxf86dga (2:1.1.1-4slp2) unstable; urgency=low
+
+ * Update maintainer
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+ * Tag: libxxf86dga_1.1.1-4slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com> Wed, 21 Apr 2010 14:21:00 +0900
+
+libxxf86dga (2:1.1.1-3slp2) unstable; urgency=low
+
+ * modify the package name
+
+ -- SooChan Lim <sc1.lim@samsung.com> Thu, 25 Mar 2010 18:05:57 +0900
+
+libxxf86dga (2:1.1.1-2) unstable; urgency=low
+
+ * Upload to unstable.
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 06 Jan 2010 13:02:51 +0000
+
+libxxf86dga (2:1.1.1-1) experimental; urgency=low
+
+ [ Brice Goglin ]
+ * Bump Standards-Version to 3.7.3 (no changes).
+ * Drop the XS- prefix from Vcs-Git and Vcs-Browser fields in debian/control.
+ * Add a link to www.X.org and a reference to the upstream module
+ in the long description.
+ * Add upstream URL to debian/copyright.
+ * Add README.source, bump Standards-Version to 3.8.2.
+ * Use updated xsfbs, closes: #538601.
+ * Move -dbg package to section debug.
+ * Run autoreconf on build; add build-deps on automake, libtool, xutils-dev.
+ * Handle parallel builds.
+
+ [ Timo Aaltonen ]
+ * New upstream release.
+ * Bump the build-dep on xutils-dev (>= 1:7.5~1).
+ * Add includes in -dev, bump {Build-,}Depends, add Replaces on
+ x11proto-xf86dga-dev.
+ * Drop pre-dependency on x11-common from libxxf86dga-dev. This was needed
+ for upgrades from sarge.
+
+ [ Julien Cristau ]
+ * Sync debian/control 'Section' fields with the override.
+ * Drop -1 revisions from build-deps [lintian].
+ * Bump Standards-Version to 3.8.3.
+
+ -- Julien Cristau <jcristau@debian.org> Wed, 02 Dec 2009 16:08:15 +0100
+
+libxxf86dga (2:1.0.2-1) unstable; urgency=low
+
+ * Remove outdated cvs information from the package descriptions, and add
+ XS-Vcs-* headers.
+ * New upstream release.
+ + require x11proto-xf86dga-dev >= 2.0.3 to fix a sign-extension bug on
+ 64bit systems
+ * Install the upstream changelog.
+ * Remove Branden and Fabio from Uploaders with their permission; add myself.
+ * Use ${binary:Version} instead of ${Source-Version}.
+
+ -- Julien Cristau <jcristau@debian.org> Thu, 06 Sep 2007 00:55:13 +0200
+
+libxxf86dga (2:1.0.1-2) unstable; urgency=low
+
+ [ Andres Salomon ]
+ * Revert .la file addition.
+
+ [ Drew Parsons ]
+ * dbg package has priority extra.
+
+ -- David Nusinow <dnusinow@debian.org> Mon, 18 Sep 2006 22:10:02 -0400
+
+libxxf86dga (2:1.0.1-1) experimental; urgency=low
+
+ * New upstream release.
+ * Drop patches/01_manpage_location.diff; merged upstream.
+ * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
+ idempotency fix.
+ * Run dh_install w/ --list-missing.
+ * Drop duplicate x11-common dep in -dev package.
+ * Bump standards version to 3.7.2.0.
+ * Version x11-common pre-dep in -dev package to 1:7.0.0 to match
+ the rest of Debian.
+ * Bump debhelper compat to 5.
+ * Fix dh_strip call to skip the -dbg package.
+ * Include .la file in -dev package.
+ * Don't attempt to install (non-existent) usr/include/X11/* stuff.
+ * Autoreconf w/ an updated xutils-dev so that manpages have the 'x'
+ extension dropped.
+
+ -- Andres Salomon <dilinger@debian.org> Sun, 23 Jul 2006 22:04:05 -0400
+
+libxxf86dga (2:1.0.0-3) unstable; urgency=low
+
+ * Reorder makeshlib command in rules file so that ldconfig is run
+ properly. Thanks Drew Parsons and Steve Langasek.
+ * Add quilt to build-depends
+
+ -- David Nusinow <dnusinow@debian.org> Wed, 19 Apr 2006 02:45:24 -0400
+
+libxxf86dga (2:1.0.0-2) unstable; urgency=low
+
+ * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org> Thu, 23 Mar 2006 22:46:33 -0500
+
+libxxf86dga (2:1.0.0-1) experimental; urgency=low
+
+ * Backport manpage location fix
+
+ -- David Nusinow <dnusinow@debian.org> Sat, 11 Mar 2006 17:44:34 -0500
+
+libxxf86dga (1:1.0.1-1) experimental; urgency=low
+
+ * First modular upload to Debian
+
+ -- David Nusinow <dnusinow@debian.org> Wed, 25 Jan 2006 19:39:19 -0500
+
+libxxf86dga (7.0.0-3) breezy; urgency=low
+
+ * Bump Build-Depends on libx11-dev and libxext-dev to ones that will avoid
+ us getting the whole _XOPEN_SOURCE rash.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com> Sat, 23 Jul 2005 00:07:21 +1000
+
+libxxf86dga (7.0.0-2) breezy; urgency=low
+
+ * Descriptions: fix short descriptions to not refer to libXt.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com> Wed, 20 Jul 2005 21:40:09 +1000
+
+libxxf86dga (7.0.0-1) breezy; urgency=low
+
+ * First libxxf86dga release.
+
+ -- Daniel Stone <daniel.stone@ubuntu.com> Mon, 16 May 2005 22:10:17 +1000
--- /dev/null
+Source: libxxf86dga
+Section: x11
+Priority: optional
+Maintainer: Sung-Jin Park <sj76.park@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, Sung-Jin Park <sj76.park@samsung.com>, David Nusinow <dnusinow@debian.org>, Andres Salomon <dilinger@debian.org>, Julien Cristau <jcristau@debian.org>
+Build-Depends: debhelper (>= 5.0.0), libx11-dev (>= 1:0.99.2), x11proto-xf86dga-dev (>= 2.0.99.1), libxext-dev (>= 1:0.99.1), pkg-config, quilt, automake, libtool, xutils-dev (>= 1:7.5-1slp2)
+Standards-Version: 3.8.3
+Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libxxf86dga
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libxxf86dga.git
+
+Package: libxxf86dga1
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}, ${misc:Depends}, x11-common
+Description: X11 Direct Graphics Access extension library
+ libXxf86dga provides the XFree86-DGA extension, which allows direct
+ graphics access to a framebuffer-like region, and also allows relative
+ mouse reporting, et al. It is mainly used by games and emulators for
+ games.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libXxf86dga
+
+Package: libxxf86dga1-dbg
+Architecture: any
+Section: debug
+Priority: extra
+Depends: ${shlibs:Depends}, ${misc:Depends}, x11-common, libxxf86dga1 (= ${binary:Version})
+Description: X11 Direct Graphics Access extension library (debug package)
+ libXxf86dga provides the XFree86-DGA extension, which allows direct
+ graphics access to a framebuffer-like region, and also allows relative
+ mouse reporting, et al. It is mainly used by games and emulators for
+ games.
+ .
+ This package contains the debug versions of the library found in libxxf86dga1.
+ Non-developers likely have little use for this package.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libXxf86dga
+
+Package: libxxf86dga-dev
+Architecture: any
+Section: libdevel
+Depends: ${shlibs:Depends}, ${misc:Depends}, libxxf86dga1 (= ${binary:Version}), libx11-dev, x11proto-xf86dga-dev (>= 2.0.99.1)
+Replaces: x11proto-xf86dga-dev (<< 2.0.99.1)
+Description: X11 Direct Graphics Access extension library (development headers)
+ libXxf86dga provides the XFree86-DGA extension, which allows direct
+ graphics access to a framebuffer-like region, and also allows relative
+ mouse reporting, et al. It is mainly used by games and emulators for
+ games.
+ .
+ This package contains the development headers for the library found in
+ libxxf86dga1. Non-developers likely have little use for this package.
+ .
+ More information about X.Org can be found at:
+ <URL:http://www.X.org>
+ <URL:http://xorg.freedesktop.org>
+ <URL:http://lists.freedesktop.org/mailman/listinfo/xorg>
+ .
+ This module can be found at
+ git://anongit.freedesktop.org/git/xorg/lib/libXxf86dga
--- /dev/null
+This package was downloaded from
+http://xorg.freedesktop.org/releases/individual/lib/
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995, 1996 The XFree86 Project, Inc
+
+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, sublicence, 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 THE XFREE86 PROJECT 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 the XFree86 Project shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the XFree86 Project.
--- /dev/null
+usr/share/man/*
+usr/lib/libXxf86dga.a
+usr/lib/libXxf86dga.so
+usr/lib/libXxf86dga.la
+usr/lib/pkgconfig/xxf86dga.pc
+usr/include/X11/extensions/
--- /dev/null
+usr/lib/libXxf86dga.so.1*
--- /dev/null
+#!/usr/bin/make -f
+# debian/rules for the Debian libxxf86dga package.
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
+# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
+# Copyright © 2005 David Nusinow <dnusinow@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# set this to the name of the main shlib's binary package
+PACKAGE = libxxf86dga1
+
+include debian/xsfbs/xsfbs.mk
+
+CFLAGS = -Wall -g
+LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+ confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+ confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+configure: $(STAMP_DIR)/patch
+ dh_testdir
+ autoreconf -vfi
+
+build: build-stamp
+build-stamp: configure $(STAMP_DIR)/genscripts
+ dh_testdir
+
+ mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
+ cd obj-$(DEB_BUILD_GNU_TYPE) && \
+ ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
+ --infodir=\$${prefix}/share/info $(confflags) \
+ CFLAGS="$(CFLAGS)" \
+ LDFLAGS="$(LDFLAGS)"
+ cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+ >$@
+
+clean: xsfclean
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ rm -f config.cache config.log config.status
+ rm -f */config.cache */config.log */config.status
+ rm -f conftest* */conftest*
+ rm -rf autom4te.cache */autom4te.cache
+ rm -rf obj-*
+ rm -f aclocal.m4 compile config.guess config.sub configure
+ rm -f depcomp install-sh ltmain.sh missing mkinstalldirs
+ rm -f src/config.h.in
+ rm -f $$(find -name Makefile.in)
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+
+# dh_installdocs
+ dh_install --sourcedir=debian/tmp --list-missing
+# dh_installchangelogs ChangeLog
+ dh_link
+ dh_strip --dbg-package=$(PACKAGE)-dbg
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs
+ dh_shlibdeps
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture-independent files here.
+binary-indep: build install
+# Nothing to do
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- /dev/null
+version=3
+http://xorg.freedesktop.org/releases/individual/lib/ libXxf86dga-(.*)\.tar\.gz
--- /dev/null
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+ exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+ exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+ exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
--- /dev/null
+#!/usr/bin/make -f
+
+# Debian X Strike Force Build System (XSFBS): Make portion
+
+# Copyright 1996 Stephen Early
+# Copyright 1997 Mark Eichin
+# Copyright 1998-2005, 2007 Branden Robinson
+# Copyright 2005 David Nusinow
+#
+# Licensed under the GNU General Public License, version 2. See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# Originally by Stephen Early <sde1000@debian.org>
+# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
+# Modified by Adam Heath <doogie@debian.org>
+# Modified by Branden Robinson <branden@debian.org>
+# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
+# Modified by David Nusinow <dnusinow@debian.org>
+# Acknowledgements to Manoj Srivastava.
+
+# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
+export DH_OPTIONS
+
+# force quilt to not use ~/.quiltrc and to use debian/patches
+QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
+
+# Set up parameters for the upstream build environment.
+
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Source:' | awk '{print $$2}')
+
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Version:' | awk '{print $$2}')
+
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
+# Determine the source version without the epoch for make-orig-tar-gz
+NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
+
+# Figure out who's building this package.
+BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
+
+# Find out if this is an official build; an official build has nothing but
+# digits, dots, and/or the codename of a release in the Debian part of the
+# version number. Anything else indicates an unofficial build.
+OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
+
+# Set up parameters for the Debian build environment.
+
+# Determine our architecture.
+BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# Work around some old-time dpkg braindamage.
+BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
+# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
+ifdef DEB_HOST_ARCH
+ ARCH:=$(DEB_HOST_ARCH)
+else
+ # dpkg-cross sets the ARCH environment variable; if set, use it.
+ ifdef ARCH
+ ARCH:=$(ARCH)
+ else
+ ARCH:=$(BUILD_ARCH)
+ endif
+endif
+
+# $(STAMP_DIR) houses stamp files for complex targets.
+STAMP_DIR:=stampdir
+
+# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
+# their files.
+DEBTREEDIR:=$(CURDIR)/debian/tmp
+
+# All "important" targets have four lines:
+# 1) A target name that is invoked by a package-building tool or the user.
+# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
+# 2) A line delcaring 1) as a phony target (".PHONY:").
+# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
+# depend on other targets.
+# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
+# "$(STAMP_DIR)/" prefix is omitted.
+#
+# This indirection is needed so that the "stamp" files that signify when a rule
+# is done can be located in a separate "stampdir". Recall that make has no way
+# to know when a goal has been met for a phony target (like "build" or
+# "install").
+#
+# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
+# so that the target will not be run again. Removing the file will make Make
+# run the target over.
+
+# All phony targets should be declared as dependencies of .PHONY, even if they
+# do not have "($STAMP_DIR)/"-prefixed counterparts.
+
+# Define a harmless default rule to keep things from going nuts by accident.
+.PHONY: default
+default:
+
+# Set up the $(STAMP_DIR) directory.
+.PHONY: stampdir
+stampdir_targets+=stampdir
+stampdir: $(STAMP_DIR)/stampdir
+$(STAMP_DIR)/stampdir:
+ mkdir $(STAMP_DIR)
+ >$@
+
+# Set up the package build directory as quilt expects to find it.
+.PHONY: prepare
+stampdir_targets+=prepare
+prepare: $(STAMP_DIR)/prepare
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+ >$@
+
+.PHONY: log
+stampdir_targets+=log
+log: $(STAMP_DIR)/log
+$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+ mkdir -p $(STAMP_DIR)/log
+
+# Apply all patches to the upstream source.
+.PHONY: patch
+stampdir_targets+=patch
+patch: $(STAMP_DIR)/patch
+$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
+ if ! [ `which quilt` ]; then \
+ echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
+ exit 1; \
+ fi; \
+ if $(QUILT) next >/dev/null 2>&1; then \
+ echo -n "Applying patches..."; \
+ if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
+ cat $(STAMP_DIR)/log/patch; \
+ echo "successful."; \
+ else \
+ cat $(STAMP_DIR)/log/patch; \
+ echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "No patches to apply"; \
+ fi; \
+ >$@
+
+# Revert all patches to the upstream source.
+.PHONY: unpatch
+unpatch: $(STAMP_DIR)/log
+ rm -f $(STAMP_DIR)/patch
+ @echo -n "Unapplying patches..."; \
+ if $(QUILT) applied >/dev/null 2>/dev/null; then \
+ if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
+ cat $(STAMP_DIR)/log/unpatch; \
+ echo "successful."; \
+ else \
+ cat $(STAMP_DIR)/log/unpatch; \
+ echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "nothing to do."; \
+ fi
+
+# Clean the generated maintainer scripts.
+.PHONY: cleanscripts
+cleanscripts:
+ rm -f $(STAMP_DIR)/genscripts
+ rm -f debian/*.config \
+ debian/*.postinst \
+ debian/*.postrm \
+ debian/*.preinst \
+ debian/*.prerm
+
+# Clean the package build tree.
+.PHONY: xsfclean
+xsfclean: cleanscripts unpatch
+ dh_testdir
+ rm -rf .pc
+ rm -rf $(STAMP_DIR)
+ dh_clean
+
+# Remove files from the upstream source tree that we don't need, or which have
+# licensing problems. It must be run before creating the .orig.tar.gz.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: prune-upstream-tree
+prune-upstream-tree:
+ # Ensure we're in the correct directory.
+ dh_testdir
+ grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
+
+# Verify that there are no offsets or fuzz in the patches we apply.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: patch-audit
+patch-audit: prepare unpatch
+ @echo -n "Auditing patches..."; \
+ >$(STAMP_DIR)/log/patch; \
+ FUZZY=; \
+ while [ -n "$$($(QUILT) next)" ]; do \
+ RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
+ case "$$RESULT" in \
+ succeeded) \
+ echo "fuzzy patch: $$($(QUILT) top)" \
+ | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
+ FUZZY=yes; \
+ ;; \
+ FAILED) \
+ echo "broken patch: $$($(QUILT) next)" \
+ | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
+ exit 1; \
+ ;; \
+ esac; \
+ done; \
+ if [ -n "$$FUZZY" ]; then \
+ echo "there were fuzzy patches; please fix."; \
+ exit 1; \
+ else \
+ echo "done."; \
+ fi
+
+# Generate the maintainer scripts.
+.PHONY: genscripts
+stampdir_targets+=genscripts
+genscripts: $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
+ for FILE in debian/*.config.in \
+ debian/*.postinst.in \
+ debian/*.postrm.in \
+ debian/*.preinst.in \
+ debian/*.prerm.in; do \
+ if [ -e "$$FILE" ]; then \
+ MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
+ sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
+ | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
+ cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
+ sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
+ | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
+ sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
+ -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
+ <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
+ rm $$MAINTSCRIPT.tmp; \
+ fi; \
+ done
+ # Validate syntax of generated shell scripts.
+ #sh debian/scripts/validate-posix-sh debian/*.config \
+ # debian/*.postinst \
+ # debian/*.postrm \
+ # debian/*.preinst \
+ # debian/*.prerm
+ >$@
+
+SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
+INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
+SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+ifeq ($(PACKAGE),)
+PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
+endif
+
+.PHONY: serverabi
+serverabi: install
+ifeq ($(SERVERMINVERS),)
+ @echo error: xserver-xorg-dev needs to be installed
+ @exit 1
+else
+ echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+ echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+ echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+endif
+
+# vim:set noet ai sts=8 sw=8 tw=0:
--- /dev/null
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts. It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions. By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg/info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+ DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+ DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+ cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable. Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+ exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+ cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable. Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+ exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+ RECONFIGURE="true"
+else
+ RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+ FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+ UPGRADE="yes"
+fi
+
+trap "message;\
+ message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+ message;\
+ exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+ # syntax: reject_nondigits [ operand ... ]
+ #
+ # scan operands (typically shell variables whose values cannot be trusted) for
+ # characters other than decimal digits and barf if any are found
+ while [ -n "$1" ]; do
+ # does the operand contain anything but digits?
+ if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+ # can't use die(), because it wraps message() which wraps this function
+ echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+ "possibly malicious garbage \"$1\"" >&2
+ exit $SHELL_LIB_THROWN_ERROR
+ fi
+ shift
+ done
+}
+
+reject_unlikely_path_chars () {
+ # syntax: reject_unlikely_path_chars [ operand ... ]
+ #
+ # scan operands (typically shell variables whose values cannot be trusted) for
+ # characters unlikely to be seen in a path and which the shell might
+ # interpret and barf if any are found
+ while [ -n "$1" ]; do
+ # does the operand contain any funny characters?
+ if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+ # can't use die(), because I want to avoid forward references
+ echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+ "encountered possibly malicious garbage \"$1\"" >&2
+ exit $SHELL_LIB_THROWN_ERROR
+ fi
+ shift
+ done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user. This is used only as a fallback in the
+# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+ DEFCOLUMNS=80
+fi
+
+message () {
+ # pretty-print messages of arbitrary length
+ reject_nondigits "$COLUMNS"
+ echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+ # syntax: observe message ...
+ #
+ # issue observational message suitable for logging someday when support for
+ # it exists in dpkg
+ if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+ message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+ fi
+}
+
+warn () {
+ # syntax: warn message ...
+ #
+ # issue warning message suitable for logging someday when support for
+ # it exists in dpkg; also send to standard error
+ message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+ # syntax: die message ...
+ #
+ # exit script with error message
+ message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+ exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+ # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+ message "internal error: $*"
+ if [ -n "$OFFICIAL_BUILD" ]; then
+ message "Please report a bug in the $THIS_SCRIPT script of the" \
+ "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+ "Tracking System. Include all messages above that mention the" \
+ "$THIS_PACKAGE package. Visit " \
+ "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+ "instructions, read the file" \
+ "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+ "package, or install the reportbug package and use the command of" \
+ "the same name to file a report."
+ fi
+ exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+ message "usage error: $*"
+ message "Please report a bug in the $THIS_SCRIPT script of the" \
+ "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+ "Tracking System. Include all messages above that mention the" \
+ "$THIS_PACKAGE package. Visit " \
+ "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+ "instructions, read the file" \
+ "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+ "package, or install the reportbug package and use the command of" \
+ "the same name to file a report."
+ exit $SHELL_LIB_USAGE_ERROR
+}
+
+font_update () {
+ # run $UPDATECMDS in $FONTDIRS
+
+ local dir cmd shortcmd x_font_dir_prefix
+
+ x_font_dir_prefix="/usr/share/fonts/X11"
+
+ if [ -z "$UPDATECMDS" ]; then
+ usage_error "font_update() called but \$UPDATECMDS not set"
+ fi
+ if [ -z "$FONTDIRS" ]; then
+ usage_error "font_update() called but \$FONTDIRS not set"
+ fi
+
+ reject_unlikely_path_chars "$UPDATECMDS"
+ reject_unlikely_path_chars "$FONTDIRS"
+
+ for dir in $FONTDIRS; do
+ if [ -d "$x_font_dir_prefix/$dir" ]; then
+ for cmd in $UPDATECMDS; do
+ if which "$cmd" > /dev/null 2>&1; then
+ shortcmd=${cmd##*/}
+ observe "running $shortcmd in $dir font directory"
+ cmd_opts=
+ if [ "$shortcmd" = "update-fonts-alias" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ if [ "$shortcmd" = "update-fonts-dir" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ if [ "$shortcmd" = "update-fonts-scale" ]; then
+ cmd_opts=--x11r7-layout
+ fi
+ $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+ "failed; font directory data may not" \
+ "be up to date"
+ else
+ warn "$cmd not found; not updating corresponding $dir font" \
+ "directory data"
+ fi
+ done
+ else
+ warn "$dir is not a directory; not updating font directory data"
+ fi
+ done
+}
+
+remove_conffile_prepare () {
+ # syntax: remove_conffile_prepare filename official_md5sum ...
+ #
+ # Check a conffile "filename" against a list of canonical MD5 checksums.
+ # If the file's current MD5 checksum matches one of the "official_md5sum"
+ # operands provided, then prepare the conffile for removal from the system.
+ # We defer actual deletion until the package is configured so that we can
+ # roll this operation back if package installation fails.
+ #
+ # Call this function from a preinst script in the event $1 is "upgrade" or
+ # "install" and verify $2 to ensure the package is being upgraded from a
+ # version (or installed over a version removed-but-not-purged) prior to the
+ # one in which the conffile was obsoleted.
+
+ local conffile current_checksum
+
+ # validate arguments
+ if [ $# -lt 2 ]; then
+ usage_error "remove_conffile_prepare() called with wrong number of" \
+ "arguments; expected at least 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+ shift
+
+ # does the conffile even exist?
+ if [ -e "$conffile" ]; then
+ # calculate its checksum
+ current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+ # compare it to each supplied checksum
+ while [ -n "$1" ]; do
+ if [ "$current_checksum" = "$1" ]; then
+ # we found a match; move the confffile and stop looking
+ observe "preparing obsolete conffile $conffile for removal"
+ mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+ break
+ fi
+ shift
+ done
+ fi
+}
+
+remove_conffile_lookup () {
+ # syntax: remove_conffile_lookup package filename
+ #
+ # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+ # if it matches the actual file's md5sum.
+ #
+ # Call this function when you would call remove_conffile_prepare but only
+ # want to check against dpkg's status database instead of known checksums.
+
+ local package conffile old_md5sum
+
+ # validate arguments
+ if [ $# -ne 2 ]; then
+ usage_error "remove_conffile_lookup() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ package="$1"
+ conffile="$2"
+
+ if ! [ -e "$conffile" ]; then
+ return
+ fi
+ old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+ awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+ if [ -n "$old_md5sum" ]; then
+ remove_conffile_prepare "$conffile" "$old_md5sum"
+ fi
+}
+
+remove_conffile_commit () {
+ # syntax: remove_conffile_commit filename
+ #
+ # Complete the removal of a conffile "filename" that has become obsolete.
+ #
+ # Call this function from a postinst script after having used
+ # remove_conffile_prepare() in the preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "remove_conffile_commit() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ # if the temporary file created by remove_conffile_prepare() exists, remove it
+ if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+ observe "committing removal of obsolete conffile $conffile"
+ rm "$conffile.$THIS_PACKAGE-tmp"
+ fi
+}
+
+remove_conffile_rollback () {
+ # syntax: remove_conffile_rollback filename
+ #
+ # Roll back the removal of a conffile "filename".
+ #
+ # Call this function from a postrm script in the event $1 is "abort-upgrade"
+ # or "abort-install" is after having used remove_conffile_prepare() in the
+ # preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "remove_conffile_rollback() called with wrong number of" \
+ "arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ # if the temporary file created by remove_conffile_prepare() exists, move it
+ # back
+ if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+ observe "rolling back removal of obsolete conffile $conffile"
+ mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+ fi
+}
+
+replace_conffile_with_symlink_prepare () {
+ # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+ # official_md5sum ...
+ #
+ # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+ # If the file's current MD5 checksum matches one of the "official_md5sum"
+ # operands provided, then prepare the conffile for removal from the system.
+ # We defer actual deletion until the package is configured so that we can
+ # roll this operation back if package installation fails. Otherwise copy it
+ # to newfilename and let dpkg handle it through conffiles mechanism.
+ #
+ # Call this function from a preinst script in the event $1 is "upgrade" or
+ # "install" and verify $2 to ensure the package is being upgraded from a
+ # version (or installed over a version removed-but-not-purged) prior to the
+ # one in which the conffile was obsoleted.
+
+ local conffile current_checksum
+
+ # validate arguments
+ if [ $# -lt 3 ]; then
+ usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+ " number of arguments; expected at least 3, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ oldconffile="$1"
+ shift
+ newconffile="$1"
+ shift
+
+ remove_conffile_prepare "$_oldconffile" "$@"
+ # If $oldconffile still exists, then md5sums didn't match.
+ # Copy it to new one.
+ if [ -f "$oldconffile" ]; then
+ cp "$oldconffile" "$newconffile"
+ fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+ # syntax: replace_conffile_with_symlink_commit oldfilename
+ #
+ # Complete the removal of a conffile "oldfilename" that has been
+ # replaced by a symlink.
+ #
+ # Call this function from a postinst script after having used
+ # replace_conffile_with_symlink_prepare() in the preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 1 ]; then
+ usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+ "number of arguments; expected 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ conffile="$1"
+
+ remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+ # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+ #
+ # Roll back the replacing of a conffile "oldfilename" with symlink to
+ # "newfilename".
+ #
+ # Call this function from a postrm script in the event $1 is "abort-upgrade"
+ # or "abort-install" and verify $2 to ensure the package failed to upgrade
+ # from a version (or install over a version removed-but-not-purged) prior
+ # to the one in which the conffile was obsoleted.
+ # You should have used replace_conffile_with_symlink_prepare() in the
+ # preinst.
+
+ local conffile
+
+ # validate arguments
+ if [ $# -ne 2 ]; then
+ usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+ "number of arguments; expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ oldconffile="$1"
+ newconffile="$2"
+
+ remove_conffile_rollback "$_oldconffile"
+ if [ -f "$newconffile" ]; then
+ rm "$newconffile"
+ fi
+}
+
+run () {
+ # syntax: run command [ argument ... ]
+ #
+ # Run specified command with optional arguments and report its exit status.
+ # Useful for commands whose exit status may be nonzero, but still acceptable,
+ # or commands whose failure is not fatal to us.
+ #
+ # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+ # those cases the return value of the debconf command *must* be checked
+ # before the string returned by debconf is used for anything.
+
+ local retval
+
+ # validate arguments
+ if [ $# -lt 1 ]; then
+ usage_error "run() called with wrong number of arguments; expected at" \
+ "least 1, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ "$@" || retval=$?
+
+ if [ ${retval:-0} -ne 0 ]; then
+ observe "command \"$*\" exited with status $retval"
+ fi
+}
+
+make_symlink_sane () {
+ # syntax: make_symlink_sane symlink target
+ #
+ # Ensure that the symbolic link symlink exists, and points to target.
+ #
+ # If symlink does not exist, create it and point it at target.
+ #
+ # If symlink exists but is not a symbolic link, back it up.
+ #
+ # If symlink exists, is a symbolic link, but points to the wrong location, fix
+ # it.
+ #
+ # If symlink exists, is a symbolic link, and already points to target, do
+ # nothing.
+ #
+ # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+ # Validate arguments.
+ if [ $# -ne 2 ]; then
+ usage_error "make_symlink_sane() called with wrong number of arguments;" \
+ "expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ # We could just use the positional parameters as-is, but that makes things
+ # harder to follow.
+ local symlink target
+
+ symlink="$1"
+ target="$2"
+
+ if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+ observe "link from $symlink to $target already exists"
+ else
+ observe "creating symbolic link from $symlink to $target"
+ mkdir -p "${target%/*}" "${symlink%/*}"
+ ln -s -b -S ".dpkg-old" "$target" "$symlink"
+ fi
+}
+
+migrate_dir_to_symlink () {
+ # syntax: migrate_dir_to_symlink old_location new_location
+ #
+ # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+ # symbolic link to a directory or vice versa; instead, the existing state
+ # (symlink or not) will be left alone and dpkg will follow the symlink if
+ # there is one."
+ #
+ # We have to do it ourselves.
+ #
+ # This function moves the contents of old_location, a directory, into
+ # new_location, a directory, then makes old_location a symbolic link to
+ # new_location.
+ #
+ # old_location need not exist, but if it does, it must be a directory (or a
+ # symlink to a directory). If it is not, it is backed up. If new_location
+ # exists already and is not a directory, it is backed up.
+ #
+ # This function should be called from a package's preinst so that other
+ # packages unpacked after this one --- but before this package's postinst runs
+ # --- are unpacked into new_location even if their payloads contain
+ # old_location filespecs.
+
+ # Validate arguments.
+ if [ $# -ne 2 ]; then
+ usage_error "migrate_dir_to_symlink() called with wrong number of"
+ "arguments; expected 2, got $#"
+ exit $SHELL_LIB_USAGE_ERROR
+ fi
+
+ # We could just use the positional parameters as-is, but that makes things
+ # harder to follow.
+ local new old
+
+ old="$1"
+ new="$2"
+
+ # Is old location a symlink?
+ if [ -L "$old" ]; then
+ # Does it already point to new location?
+ if [ "$(readlink "$old")" = "$new" ]; then
+ # Nothing to do; migration has already been done.
+ observe "migration of $old to $new already done"
+ return 0
+ else
+ # Back it up.
+ warn "backing up symbolic link $old as $old.dpkg-old"
+ mv -b "$old" "$old.dpkg-old"
+ fi
+ fi
+
+ # Does old location exist, but is not a directory?
+ if [ -e "$old" ] && ! [ -d "$old" ]; then
+ # Back it up.
+ warn "backing up non-directory $old as $old.dpkg-old"
+ mv -b "$old" "$old.dpkg-old"
+ fi
+
+ observe "migrating $old to $new"
+
+ # Is new location a symlink?
+ if [ -L "$new" ]; then
+ # Does it point the wrong way, i.e., back to where we're migrating from?
+ if [ "$(readlink "$new")" = "$old" ]; then
+ # Get rid of it.
+ observe "removing symbolic link $new which points to $old"
+ rm "$new"
+ else
+ # Back it up.
+ warn "backing up symbolic link $new as $new.dpkg-old"
+ mv -b "$new" "$new.dpkg-old"
+ fi
+ fi
+
+ # Does new location exist, but is not a directory?
+ if [ -e "$new" ] && ! [ -d "$new" ]; then
+ warn "backing up non-directory $new as $new.dpkg-old"
+ mv -b "$new" "$new.dpkg-old"
+ fi
+
+ # Create new directory if it does not yet exist.
+ if ! [ -e "$new" ]; then
+ observe "creating $new"
+ mkdir -p "$new"
+ fi
+
+ # Copy files in old location to new location. Back up any filenames that
+ # already exist in the new location with the extension ".dpkg-old".
+ observe "copying files from $old to $new"
+ if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+ die "error(s) encountered while copying files from $old to $new"
+ fi
+
+ # Remove files at old location.
+ observe "removing $old"
+ rm -r "$old"
+
+ # Create symlink from old location to new location.
+ make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
--- /dev/null
+/*
+ Copyright (c) 1999 XFree86 Inc
+*/
+
+#ifndef _XF86DGA_H_
+#define _XF86DGA_H_
+
+#include <X11/Xfuncproto.h>
+#include <X11/extensions/xf86dgaconst.h>
+#include <X11/extensions/xf86dga1.h>
+
+_XFUNCPROTOBEGIN
+
+typedef struct {
+ int type;
+ unsigned long serial;
+ Display *display;
+ int screen;
+ Time time;
+ unsigned int state;
+ unsigned int button;
+} XDGAButtonEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial;
+ Display *display;
+ int screen;
+ Time time;
+ unsigned int state;
+ unsigned int keycode;
+} XDGAKeyEvent;
+
+typedef struct {
+ int type;
+ unsigned long serial;
+ Display *display;
+ int screen;
+ Time time;
+ unsigned int state;
+ int dx;
+ int dy;
+} XDGAMotionEvent;
+
+typedef union {
+ int type;
+ XDGAButtonEvent xbutton;
+ XDGAKeyEvent xkey;
+ XDGAMotionEvent xmotion;
+ long pad[24];
+} XDGAEvent;
+
+Bool XDGAQueryExtension(
+ Display *dpy,
+ int *eventBase,
+ int *erroBase
+);
+
+Bool XDGAQueryVersion(
+ Display *dpy,
+ int *majorVersion,
+ int *minorVersion
+);
+
+XDGAMode* XDGAQueryModes(
+ Display *dpy,
+ int screen,
+ int *num
+);
+
+XDGADevice* XDGASetMode(
+ Display *dpy,
+ int screen,
+ int mode
+);
+
+Bool XDGAOpenFramebuffer(
+ Display *dpy,
+ int screen
+);
+
+void XDGACloseFramebuffer(
+ Display *dpy,
+ int screen
+);
+
+void XDGASetViewport(
+ Display *dpy,
+ int screen,
+ int x,
+ int y,
+ int flags
+);
+
+void XDGAInstallColormap(
+ Display *dpy,
+ int screen,
+ Colormap cmap
+);
+
+Colormap XDGACreateColormap(
+ Display *dpy,
+ int screen,
+ XDGADevice *device,
+ int alloc
+);
+
+void XDGASelectInput(
+ Display *dpy,
+ int screen,
+ long event_mask
+);
+
+void XDGAFillRectangle(
+ Display *dpy,
+ int screen,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height,
+ unsigned long color
+);
+
+
+void XDGACopyArea(
+ Display *dpy,
+ int screen,
+ int srcx,
+ int srcy,
+ unsigned int width,
+ unsigned int height,
+ int dstx,
+ int dsty
+);
+
+
+void XDGACopyTransparentArea(
+ Display *dpy,
+ int screen,
+ int srcx,
+ int srcy,
+ unsigned int width,
+ unsigned int height,
+ int dstx,
+ int dsty,
+ unsigned long key
+);
+
+int XDGAGetViewportStatus(
+ Display *dpy,
+ int screen
+);
+
+void XDGASync(
+ Display *dpy,
+ int screen
+);
+
+Bool XDGASetClientVersion(
+ Display *dpy
+);
+
+void XDGAChangePixmapMode(
+ Display *dpy,
+ int screen,
+ int *x,
+ int *y,
+ int mode
+);
+
+
+void XDGAKeyEventToXKeyEvent(XDGAKeyEvent* dk, XKeyEvent* xk);
+
+
+_XFUNCPROTOEND
+#endif /* _XF86DGA_H_ */
--- /dev/null
+/*
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995 XFree86 Inc
+
+*/
+
+/************************************************************************
+
+ THIS IS THE OLD DGA API AND IS OBSOLETE. PLEASE DO NOT USE IT ANYMORE
+
+************************************************************************/
+
+#ifndef _XF86DGA1_H_
+#define _XF86DGA1_H_
+
+#include <X11/Xfuncproto.h>
+#include <X11/extensions/xf86dga1const.h>
+
+_XFUNCPROTOBEGIN
+
+Bool XF86DGAQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */
+);
+
+Bool XF86DGAQueryExtension(
+ Display* /* dpy */,
+ int* /* event_base */,
+ int* /* error_base */
+);
+
+Status XF86DGAGetVideoLL(
+ Display* /* dpy */,
+ int /* screen */,
+ unsigned int * /* base addr */,
+ int * /* width */,
+ int * /* bank_size */,
+ int * /* ram_size */
+);
+
+Status XF86DGAGetVideo(
+ Display* /* dpy */,
+ int /* screen */,
+ char ** /* base addr */,
+ int * /* width */,
+ int * /* bank_size */,
+ int * /* ram_size */
+);
+
+Status XF86DGADirectVideo(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* enable */
+);
+
+Status XF86DGADirectVideoLL(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* enable */
+);
+
+Status XF86DGAGetViewPortSize(
+ Display* /* dpy */,
+ int /* screen */,
+ int * /* width */,
+ int * /* height */
+);
+
+Status XF86DGASetViewPort(
+ Display* /* dpy */,
+ int /* screen */,
+ int x /* X */,
+ int y /* Y */
+);
+
+Status XF86DGAGetVidPage(
+ Display* /* dpy */,
+ int /* screen */,
+ int * /* vid page */
+);
+
+Status XF86DGASetVidPage(
+ Display* /* dpy */,
+ int /* screen */,
+ int /* vid page */
+);
+
+Status XF86DGAInstallColormap(
+ Display* /* dpy */,
+ int /* screen */,
+ Colormap /*Colormap */
+);
+
+int XF86DGAForkApp(
+ int screen
+);
+
+Status XF86DGAQueryDirectVideo(
+ Display * /* dpy */,
+ int /* screen */,
+ int * /* flags */
+);
+
+Bool XF86DGAViewPortChanged(
+ Display * /* dpy */,
+ int /* screen */,
+ int /* n */
+);
+
+
+_XFUNCPROTOEND
+
+#endif /* _XF86DGA1_H_ */
--- /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 = \
+ XDGA.man \
+ $(XDGA_shadows:=.man)
+
+XDGA_functions = \
+ XDGAQueryExtension \
+ XDGAQueryVersion \
+ XDGAQueryModes \
+ XDGASetMode \
+ XDGAOpenFramebuffer \
+ XDGACloseFramebuffer \
+ XDGASetViewport \
+ XDGAInstallColormap \
+ XDGACreateColormap \
+ XDGASelectInput \
+ XDGAFillRectangle \
+ XDGACopyArea \
+ XDGACopyTransparentArea \
+ XDGAGetViewportStatus \
+ XDGASync \
+ XDGASetClientVersion \
+ XDGAChangePixmapMode \
+ XDGAKeyEventToXKeyEvent
+
+XDGA_shadows = XF86DGA XFree86-DGA $(XDGA_functions)
+
+EXTRA_DIST = $(libman_PRE)
+CLEANFILES = $(libman_DATA)
+
+libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
+
+SUFFIXES = .$(LIB_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(LIB_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
--- /dev/null
+.\"
+.TH XDGA 3 __vendorversion__
+.SH NAME
+XDGA \- Client library for the XFree86-DGA extension.
+.SH SYNOPSIS
+.B #include <X11/extensions/xf86dga.h>
+.HP
+Bool
+.BR XDGAQueryExtension (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int *" eventBase ,
+.br
+.RI "int *" errorBase )
+.HP
+Bool
+.BR XDGAQueryVersion (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int *" majorVersion ,
+.br
+.RI "int *" minorVersion )
+.HP
+XDGAMode
+.RB * XDGAQueryModes (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int *" num )
+.HP
+XDGADevice
+.RB * XDGASetMode (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int " mode )
+.HP
+Bool
+.BR XDGAOpenFramebuffer (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen )
+.HP
+void
+.BR XDGACloseFramebuffer (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen )
+.HP
+void
+.BR XDGASetViewport (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int " x ,
+.br
+.RI "int " y ,
+.br
+.RI "int " flags )
+.HP
+void
+.BR XDGAInstallColormap (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "Colormap " cmap )
+.HP
+Colormap
+.BR XDGACreateColormap (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "XDGADevice *" device ,
+.br
+.RI "int " alloc )
+.HP
+void
+.BR XDGASelectInput (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "long " event_mask )
+.HP
+void
+.BR XDGAFillRectangle (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int " x ,
+.br
+.RI "int " y ,
+.br
+.RI "unsigned int " width ,
+.br
+.RI "unsigned int " height ,
+.br
+.RI "unsigned long " color )
+.HP
+void
+.BR XDGACopyArea (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int " srcx ,
+.br
+.RI "int " srcy ,
+.br
+.RI "unsigned int " width ,
+.br
+.RI "unsigned int " height ,
+.br
+.RI "int " dstx ,
+.br
+.RI "int " dsty )
+.HP
+void
+.BR XDGACopyTransparentArea (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int " srcx ,
+.br
+.RI "int " srcy ,
+.br
+.RI "unsigned int " width ,
+.br
+.RI "unsigned int " height ,
+.br
+.RI "int " dstx ,
+.br
+.RI "int " dsty ,
+.br
+.RI "unsigned long " key )
+.HP
+int
+.BR XDGAGetViewportStatus (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen )
+.HP
+void
+.BR XDGASync (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen )
+.HP
+Bool
+.BR XDGASetClientVersion (
+.br
+.RI "Display *" dpy )
+.HP
+void
+.BR XDGAChangePixmapMode (
+.br
+.RI "Display *" dpy ,
+.br
+.RI "int " screen ,
+.br
+.RI "int *" x ,
+.br
+.RI "int *" y ,
+.br
+.RI "int " mode )
+.HP
+void
+.BR XDGAKeyEventToXKeyEvent (
+.br
+.RI "XDGAKeyEvent *" dk ,
+.br
+.RI "XKeyEvent *" xk )
+
+.SH DESCRIPTION
+The
+.B XFree86-DGA
+extension is an X server extension for allowing client programs direct
+access to the video frame buffer. This is a brief description of the
+programming interface for version 2.0 of the
+.B XFree86-DGA
+extension.
+.PP
+.B XFree86-DGA
+is not intended as a direct rendering API, but rather, as a mechanism
+to "get the X Server out of the way" so that some other direct rendering
+API can have full access to the hardware. With this in mind, DGA does
+provide clients some direct access to the hardware without requiring a
+separate rendering API, but this access is limited to direct linear
+framebuffer access.
+.PP
+Most of the reasons for the
+.B XFree86-DGA
+extension's existence are now better served in other ways. Further
+development of this extension is not expected, and it may be deprecated
+in a future release. The features that continue to be useful will either
+be provided through other existing mechanisms, or through an extension
+that address those needs more specifically.
+.PP
+.B XFree86-DGA
+is initialized by passing a number corresponding to a valid
+.I XDGAMode
+to
+.BR XDGASetMode ().
+Clients can get a list of valid modes from
+.BR XDGAQueryModes ().
+Each
+.I XDGAMode
+corresponds to a different framebuffer layout.
+.PP
+.BR XDGAQueryModes ()
+returns a pointer to an array of
+.IR XDGAMode s
+which are valid for the given screen.
+.I num
+is the number of elements in the array. The returned array can be freed
+with XFree(3). The
+.I XDGAMode
+structure is as follows:
+.PP
+.nf
+.ta .5i 2i
+typedef struct {
+ int num;
+ char *name;
+ float verticalRefresh;
+ int flags;
+ int imageWidth;
+ int imageHeight;
+ int pixmapWidth;
+ int pixmapHeight;
+ int bytesPerScanline;
+ int byteOrder;
+ int depth;
+ int bitsPerPixel;
+ unsigned long redMask;
+ unsigned long greenMask;
+ unsigned long blueMask;
+ short visualClass;
+ int viewportWidth;
+ int viewportHeight;
+ int xViewportStep;
+ int yViewportStep;
+ int maxViewportX;
+ int maxViewportY;
+ int viewportFlags;
+ int reserved1;
+ int reserved2;
+.br
+} XDGAMode;
+.fi
+.TP 8
+.I num
+A unique identifying number
+.RI ( num
+> 0) for the mode. This is the number referenced when initializing the mode.
+.TP 8
+.I name
+The name of the corresponding modeline as given in the __xconfigfile__ file.
+.TP 8
+.I verticalRefresh
+The vertical refresh rate for the modeline (in Hz).
+.TP 8
+.I flags
+Any of the following may be OR'd together:
+.RS 8
+.TP 4
+.B XDGAConcurrentAccess
+Indicates that concurrent client/server access to the framebuffer is
+possible. If this flag is not set it is very important to call
+.BR XDGASync ()
+before directly accessing the framebuffer if a call to
+.BR XDGAFillRectangle (),
+.BR XDGACopyArea ()
+or
+.BR XDGACopyTransparentArea ()
+or any Xlib rendering function has been made prior to such accesses.
+.TP 4
+.B XDGASolidFillRect
+Indicates that
+.BR XDGAFillRectangle ()
+is supported.
+.TP 4
+.B XDGABlitRect
+Indicates that
+.BR XDGACopyArea ()
+is supported.
+.TP 4
+.B XDGABlitTransRect
+Indicates that
+.BR XDGACopyTransparentArea ()
+is supported.
+.TP 4
+.B XDGAPixmap
+Indicates that a Pixmap will be returned when the mode is initialized.
+This means that rendering with Xlib is possible for this mode.
+.TP 4
+.B XDGAInterlaced
+.TP 4
+.B XDGADoublescan
+Indicates that the mode is an interlaced or doublescan mode.
+.RE
+.TP 8
+.I imageWidth
+.TP 8
+.I imageHeight
+The width and height of the framebuffer area accessible by the client.
+This rectangle is always justified to the upper left-hand corner.
+.TP 8
+.I pixmapWidth
+.TP 8
+.I pixmapHeight
+The width and height of the framebuffer area accessible by Xlib. This
+rectangle is always justified to the upper left-hand corner. These
+fields are only valid if the
+.B XDGAPixmap
+flag is set in the
+.I flags
+field.
+.TP 8
+.I bytesPerScanline
+The pitch of the framebuffer in bytes.
+.TP 8
+.I byteOrder
+.B MSBFirst
+or
+.BR LSBFirst .
+.TP 8
+.I depth
+The number of bits in each pixel which contain usable data.
+.TP 8
+.I bitsPerPixel
+The number of bits taken up by each pixel.
+.TP 8
+.I redMask
+.TP 8
+.I greenMask
+.TP 8
+.I blueMask
+The RGB masks. These do not apply to color-indexed modes.
+.TP 8
+.I visualClass
+.BR TrueColor ,
+.BR PseudoColor ,
+.BR DirectColor ,
+etc.
+.TP 8
+.I viewportWidth
+.TP 8
+.I viewportHeight
+The dimensions of the portion of the framebuffer which will be displayed
+on the screen.
+.TP 8
+.I xViewPortStep
+.TP 8
+.I yViewPortStep
+The granularity of the x,y viewport positioning possible with the
+.BR XDGASetViewport ()
+function.
+.TP 8
+.I maxViewportX
+.TP 8
+.I maxViewportY
+The maximum x and y positions possible with the
+.BR XDGASetViewport ()
+function.
+.TP 8
+.I viewportFlags
+Any of the following may be OR'd together
+.RS 8
+.TP 4
+.B XDGAFlipRetrace
+Indicates that the hardware can switch viewports during the vertical
+retrace.
+.TP 4
+.B XDGAFlipImmediate
+Indicates that the hardware can switch viewports immediately without
+waiting for the vertical retrace.
+.RE
+.PP
+.BR XDGASetMode ()
+initialises the
+.I XDGAMode
+corresponding to
+.IR num .
+To exit DGA mode and return to normal server operation, call
+.BR XDGASetMode ()
+with
+.I num
+set to zero.
+.BR XDGASetMode ()
+returns a pointer to an
+.I XDGADevice
+if successful. The XDGADevice can be freed with XFree(3). The
+.I XDGADevice
+structure is as follows:
+.PP
+.nf
+.ta .5i 2i
+typedef struct {
+ XDGAMode mode;
+ unsigned char *data;
+ Pixmap pixmap;
+.br
+} XDGADevice;
+.fi
+.TP 8
+.I mode
+The
+.I XDGAMode
+structure, identical to the information returned by
+.BR XDGAQueryModes ().
+.TP 8
+.I data
+If direct framebuffer access is desired and possible, this field will
+contain a pointer to the mapped framebuffer memory. Generally, this
+field will be zero unless a call to
+.BR XDGAOpenFramebuffer ()
+is made prior to initialization of the mode.
+.TP 8
+.I pixmap
+If the mode supports Xlib rendering as indicated by
+.B XDGAPixmap
+in the
+.I flags
+field, this will contain a Pixmap handle suitable for passing as the
+drawable argument to Xlib functions. This field will be zero if Xlib
+rendering is not supported.
+.PP
+.BR XDGAQueryExtension ()
+checks for the presence of the extension and returns the event and error bases.
+.PP
+.BR XDGAQueryVersion ()
+returns the
+.B XFree86-DGA
+major and minor version numbers.
+.PP
+.BR XDGAOpenFramebuffer ()
+maps the framebuffer memory. The client needs sufficient privileges to be
+able to do this.
+.BR XDGAOpenFramebuffer ()
+should be called prior to initializing a DGA mode if direct framebuffer
+access is desired for that mode.
+.BR XDGAOpenFramebuffer ()
+does not need to be called if direct framebuffer access is not required.
+If the framebuffer is opened,
+.PP
+.BR XDGACloseFramebuffer ()
+should be called prior to client exit to unmap the memory.
+.PP
+.BR XDGAChangePixmapMode ()
+can be used to change between two pixmap sizes in cases where a Pixmap is
+available for Xlib rendering. The following values for the
+.I mode
+parameter are available:
+.RS 8
+.TP 4
+.B XDGAPixmapModeLarge
+The pixmap size is defined by the
+.I pixmapWidth
+and
+.I pixmapHeight
+fields in the
+.I XDGAMode
+structure. The
+.I x
+and
+.I y
+values are ignored in this case.
+.TP 4
+.B XDGAPixmapModeSmall
+The pixmap size is defined by the
+.I viewportWidth
+and
+.I viewportHeight
+fields in the
+.I XDGAMode
+structure. In this mode, the
+.I x
+and
+.I y
+values specify where in the framebuffer this pixmap rectangle is located.
+It may be placed anywhere within the Xlib renderable region described
+by the
+.I pixmapWidth
+and
+.I pixmapHeight
+fields in the
+.IR XDGAMode .
+The
+.I x
+and
+.I y
+values returned are the resultant location of the pixmap and may be
+different from the requested x,y location due to platform specific
+alignment constraints. All Xlib rendering is clipped to this pixmap
+rectangle.
+.RE
+.PP
+.BR XDGASetViewport ()
+sets the upper left-hand corner of the rectangle of framebuffer that is
+to be displayed on the screen. Not all locations may be supported by
+the hardware and requested locations will be adjusted according to the
+.I xViewPortStep
+and
+.I yViewPortStep
+fields in the
+.IR XDGAMode .
+.PP
+.I flags
+can be
+.B XDGAFlipRetrace
+or
+.B XDGAFlipImmediate
+to adjust the viewport location at the next vertical retrace or
+immediately. Values other than the supported values advertised in the
+mode's
+.I viewportFlags
+field will result in hardware-specific default behavior.
+.B XDGAFlipImmediate
+will block until the flip is completed.
+.B XDGAFlipRetrace
+will generally NOT block so it is necessary to monitor the viewport
+status with
+.BR XDGAGetViewportStatus ().
+.B XDGAFlipImmediate
+requests during pending
+.B XDGAFlipRetrace
+requests will be ignored.
+.PP
+.BR XDGAGetViewportStatus ()
+keeps track of the
+.BR XDGASetViewport ()
+requests still pending. The return value of the function will have
+consecutive bits set (LSB justified), each bit representing a pending
+viewport change. For example:
+.PP
+.nf
+ while(XDGAGetViewportStatus(dpy, screen));
+.fi
+.PP
+waits for all pending viewport changes to finish.
+.PP
+.nf
+ while(0x2 & XDGAGetViewportStatus(dpy, screen));
+.fi
+.PP
+waits until all but the last viewport changes have completed.
+.PP
+.BR XDGACreateColormap ()
+is similar to the Xlib function XCreateColormap(3) except that it takes
+an
+.I XDGADevice
+as an argument instead of a Window and Visual. Though XCreateColormap(3)
+may create usable colormaps in some cases,
+.BR XDGACreateColormap ()
+is the preferred method for creating colormaps in DGA since there may
+not be an advertised visual compatible with the DGA device.
+.PP
+.BR XDGAInstallColormap ()
+must be used to install colormaps in DGA mode. XInstallColormap(3) will
+not work.
+.PP
+.BR XDGASelectInput ()
+enables DGA's own event mechanism. This function is similar to
+XSelectInput(3), and all Xlib Key, Button and Motion masks are supported.
+The following DGA events are defined:
+.PP
+.nf
+.ta .5i 2i
+typedef struct {
+ int type; /\(** ButtonPress or ButtonRelease + the DGA event base*/
+ unsigned long serial; /\(** # or last request processed by the server */
+ Display *display; /\(** Display the event was read from */
+ int screen; /\(** The screen number the event came from */
+ Time time; /\(** milliseconds */
+ unsigned int state; /\(** key or button mask */
+ unsigned int button; /\(** detail */
+.br
+} XDGAButtonEvent;
+.fi
+.PP
+.nf
+.ta .5i 2i
+typedef struct {
+ int type; /\(** KeyPress or KeyRelease + the DGA event base*/
+ unsigned long serial; /\(** # or last request processed by the server */
+ Display *display; /\(** Display the event was read from */
+ int screen; /\(** The screen number the event came from */
+ Time time; /\(** milliseconds */
+ unsigned int state; /\(** key or button mask */
+ unsigned int keycode; /\(** detail */
+.br
+} XDGAKeyEvent;
+.fi
+.PP
+.nf
+.ta .5i 2i
+typedef struct {
+ int type; /\(** MotionNotify + the DGA event base*/
+ unsigned long serial; /\(** # or last request processed by the server */
+ Display *display; /\(** Display the event was read from */
+ int screen; /\(** The screen number the event came from */
+ Time time; /\(** milliseconds */
+ unsigned int state; /\(** key or button mask */
+ int dx; /\(** relative pointer motion */
+ int dy; /\(** relative pointer motion */
+.br
+} XDGAMotionEvent;
+.fi
+.PP
+.BR XDGAKeyEventToXKeyEvent ()
+is a helper function to translate
+.IR XDGAKeyEvent s
+into
+.IR XKeyEvent s
+suitable for use with XLookupKeysym(3).
+.PP
+.BR XDGAFillRectangle (),
+.BR XDGACopyArea (),
+and
+.BR XDGACopyTransparentArea ()
+are included with some reservation since DGA is not intended as a
+rendering API. These are merely convenience routines and are optionally
+supported. The associated flags will be set in the
+.IR XDGAMode 's
+.I flags
+field if these functions are supported. These functions will be no-ops
+otherwise. they do not provide direct access to the hardware, but are
+simply context-less operations performed by the server.
+.PP
+.BR XDGASync ()
+blocks until all server rendering to the framebuffer completes. If Xlib
+or the 3 rendering functions above are used,
+.BR XDGASync ()
+must be called before the client directly accesses the framebuffer as
+the server rendering is asynchronous with the client and may have not
+completed. This is especially important if the
+.B XDGAConcurrentAccess
+flag is not set in the
+.IR XDGAMode 's
+.I flags
+field since concurrent access by the server and client may result in a
+system lockup.
+.SH SEE ALSO
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__)
+.SH AUTHORS
+.B XFree86-DGA
+version 2 was written by Mark Vojkovich. Version 1 was written by Jon
+Tombs, Harm Hanemaayer, Mark Vojkovich.
+
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+.so man__libmansuffix__/XDGA.__libmansuffix__
--- /dev/null
+
+Name: libXxf86dga
+Summary: X.Org X11 libXxf86dga runtime library
+Version: 1.1.2
+Release: 1
+Group: System/Libraries
+License: MIT
+URL: http://www.x.org/
+Source0: http://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.gz
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(xorg-macros)
+BuildRequires: pkgconfig(xproto)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xextproto)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xf86dgaproto) >= 2.0.99.2
+
+
+%description
+Client library for the XFree86-DGA extension.
+
+
+
+%package devel
+Summary: Development components for the libXxf86dga library
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Client development library for the XFree86-DGA extension.
+
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+
+%reconfigure --disable-static
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING ChangeLog
+%{_libdir}/libXxf86dga.so.1
+%{_libdir}/libXxf86dga.so.1.0.0
+
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/libXxf86dga.so
+%{_libdir}/pkgconfig/xxf86dga.pc
+%{_includedir}/X11/extensions/Xxf86dga.h
+%{_includedir}/X11/extensions/xf86dga1.h
+%doc %{_mandir}/man3/*.3*
+
--- /dev/null
+lib_LTLIBRARIES = libXxf86dga.la
+
+libXxf86dga_la_SOURCES = XF86DGA.c XF86DGA2.c
+
+AM_CFLAGS = -I $(top_srcdir)/include \
+ $(XXF86DGA_CFLAGS) \
+ $(MALLOC_ZERO_CFLAGS) \
+ $(CWARNFLAGS)
+
+libXxf86dga_la_LIBADD = $(XXF86DGA_LIBS)
+libXxf86dga_la_LDFLAGS = -version-number 1:0:0
+
+libXxf86dgaincludedir = $(includedir)/X11/extensions
+libXxf86dgainclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xxf86dga.h \
+ $(top_srcdir)/include/X11/extensions/xf86dga1.h
--- /dev/null
+/* $XFree86: xc/lib/Xxf86dga/XF86DGA.c,v 3.23tsi Exp $ */
+/*
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995,1996 The XFree86 Project, Inc
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#ifdef __UNIXOS2__ /* needed here to override certain constants in X headers */
+#define INCL_DOS
+#define INCL_DOSIOCTL
+#define I_NEED_OS2_H
+#include <os2.h>
+#endif
+
+#if defined(linux)
+#define HAS_MMAP_ANON
+#include <sys/types.h>
+#include <sys/mman.h>
+/* kernel header doesn't work with -ansi */
+/* #include <asm/page.h> */ /* PAGE_SIZE */
+#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
+#define HAS_GETPAGESIZE
+#endif /* linux */
+
+#if defined(CSRG_BASED)
+#define HAS_MMAP_ANON
+#define HAS_GETPAGESIZE
+#include <sys/types.h>
+#include <sys/mman.h>
+#endif /* CSRG_BASED */
+
+#if defined(DGUX)
+#define HAS_GETPAGESIZE
+#define MMAP_DEV_ZERO
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#endif /* DGUX */
+
+#if defined(SVR4) && !defined(DGUX)
+#define MMAP_DEV_ZERO
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#endif /* SVR4 && !DGUX */
+
+#if defined(sun) && !defined(SVR4) /* SunOS */
+#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */
+#define HAS_GETPAGESIZE
+#include <sys/types.h>
+#include <sys/mman.h>
+#endif /* sun && !SVR4 */
+
+#ifdef XNO_SYSCONF
+#undef _SC_PAGESIZE
+#endif
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/Xxf86dga.h>
+#include <X11/extensions/xf86dgaproto.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+
+extern XExtDisplayInfo* xdga_find_display(Display*);
+extern char *xdga_extension_name;
+
+#define XF86DGACheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, xdga_extension_name, val)
+
+/*****************************************************************************
+ * *
+ * public XFree86-DGA Extension routines *
+ * *
+ *****************************************************************************/
+
+Bool XF86DGAQueryExtension (
+ Display *dpy,
+ int *event_basep,
+ int *error_basep
+){
+ return XDGAQueryExtension(dpy, event_basep, error_basep);
+}
+
+Bool XF86DGAQueryVersion(
+ Display* dpy,
+ int* majorVersion,
+ int* minorVersion
+){
+ return XDGAQueryVersion(dpy, majorVersion, minorVersion);
+}
+
+Bool XF86DGAGetVideoLL(
+ Display* dpy,
+ int screen,
+ unsigned int *offset,
+ int *width,
+ int *bank_size,
+ int *ram_size
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGAGetVideoLLReply rep;
+ xXF86DGAGetVideoLLReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAGetVideoLL, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAGetVideoLL;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *offset = rep.offset;
+ *width = rep.width;
+ *bank_size = rep.bank_size;
+ *ram_size = rep.ram_size;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool XF86DGADirectVideoLL(
+ Display* dpy,
+ int screen,
+ int enable
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGADirectVideoReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGADirectVideo, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGADirectVideo;
+ req->screen = screen;
+ req->enable = enable;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+Bool XF86DGAGetViewPortSize(
+ Display* dpy,
+ int screen,
+ int *width,
+ int *height
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGAGetViewPortSizeReply rep;
+ xXF86DGAGetViewPortSizeReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAGetViewPortSize, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAGetViewPortSize;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *width = rep.width;
+ *height = rep.height;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool XF86DGASetViewPort(
+ Display* dpy,
+ int screen,
+ int x,
+ int y
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGASetViewPortReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGASetViewPort, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGASetViewPort;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+
+Bool XF86DGAGetVidPage(
+ Display* dpy,
+ int screen,
+ int *vpage
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGAGetVidPageReply rep;
+ xXF86DGAGetVidPageReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAGetVidPage, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAGetVidPage;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *vpage = rep.vpage;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool XF86DGASetVidPage(
+ Display* dpy,
+ int screen,
+ int vpage
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGASetVidPageReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGASetVidPage, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGASetVidPage;
+ req->screen = screen;
+ req->vpage = vpage;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+Bool XF86DGAInstallColormap(
+ Display* dpy,
+ int screen,
+ Colormap cmap
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGAInstallColormapReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAInstallColormap, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAInstallColormap;
+ req->screen = screen;
+ req->id = cmap;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+Bool XF86DGAQueryDirectVideo(
+ Display *dpy,
+ int screen,
+ int *flags
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGAQueryDirectVideoReply rep;
+ xXF86DGAQueryDirectVideoReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAQueryDirectVideo, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAQueryDirectVideo;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *flags = rep.flags;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool XF86DGAViewPortChanged(
+ Display *dpy,
+ int screen,
+ int n
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXF86DGAViewPortChangedReply rep;
+ xXF86DGAViewPortChangedReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAViewPortChanged, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAViewPortChanged;
+ req->screen = screen;
+ req->n = n;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.result;
+}
+
+
+
+/* Helper functions */
+
+#include <X11/Xmd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#if defined(ISC)
+# define HAS_SVR3_MMAP
+# include <sys/types.h>
+# include <errno.h>
+
+# include <sys/at_ansi.h>
+# include <sys/kd.h>
+
+# include <sys/sysmacros.h>
+# include <sys/immu.h>
+# include <sys/region.h>
+
+# include <sys/mmap.h>
+#else
+# if defined(Lynx) && defined(NO_MMAP)
+# include <sys/types.h>
+# include <errno.h>
+# include <smem.h>
+# else
+# if !defined(__UNIXOS2__)
+# include <sys/mman.h>
+# endif
+# endif
+#endif
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+
+#if defined(SVR4) && !defined(sun)
+#define DEV_MEM "/dev/pmem"
+#elif defined(SVR4) && defined(sun)
+#define DEV_MEM "/dev/xsvc"
+#elif defined(HAS_APERTURE_DRV)
+#define DEV_MEM "/dev/xf86"
+#else
+#define DEV_MEM "/dev/mem"
+#endif
+
+typedef struct {
+ unsigned long physaddr; /* actual requested physical address */
+ unsigned long size; /* actual requested map size */
+ unsigned long delta; /* delta to account for page alignment */
+ void * vaddr; /* mapped address, without the delta */
+ int refcount; /* reference count */
+} MapRec, *MapPtr;
+
+typedef struct {
+ Display * display;
+ int screen;
+ MapPtr map;
+} ScrRec, *ScrPtr;
+
+static int mapFd = -1;
+static int numMaps = 0;
+static int numScrs = 0;
+static MapPtr *mapList = NULL;
+static ScrPtr *scrList = NULL;
+
+static MapPtr
+AddMap(void)
+{
+ MapPtr *old;
+
+ old = mapList;
+ mapList = realloc(mapList, sizeof(MapPtr) * (numMaps + 1));
+ if (!mapList) {
+ mapList = old;
+ return NULL;
+ }
+ mapList[numMaps] = malloc(sizeof(MapRec));
+ if (!mapList[numMaps])
+ return NULL;
+ return mapList[numMaps++];
+}
+
+static ScrPtr
+AddScr(void)
+{
+ ScrPtr *old;
+
+ old = scrList;
+ scrList = realloc(scrList, sizeof(ScrPtr) * (numScrs + 1));
+ if (!scrList) {
+ scrList = old;
+ return NULL;
+ }
+ scrList[numScrs] = malloc(sizeof(ScrRec));
+ if (!scrList[numScrs])
+ return NULL;
+ return scrList[numScrs++];
+}
+
+static MapPtr
+FindMap(unsigned long address, unsigned long size)
+{
+ int i;
+
+ for (i = 0; i < numMaps; i++) {
+ if (mapList[i]->physaddr == address &&
+ mapList[i]->size == size)
+ return mapList[i];
+ }
+ return NULL;
+}
+
+static ScrPtr
+FindScr(Display *display, int screen)
+{
+ int i;
+
+ for (i = 0; i < numScrs; i++) {
+ if (scrList[i]->display == display &&
+ scrList[i]->screen == screen)
+ return scrList[i];
+ }
+ return NULL;
+}
+
+static void *
+MapPhysAddress(unsigned long address, unsigned long size)
+{
+ unsigned long offset, delta;
+ int pagesize = -1;
+ void *vaddr;
+ MapPtr mp;
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ struct kd_memloc mloc;
+#elif defined(__UNIXOS2__)
+ APIRET rc;
+ ULONG action;
+ HFILE hfd;
+#endif
+
+ if ((mp = FindMap(address, size))) {
+ mp->refcount++;
+ return (void *)((unsigned long)mp->vaddr + mp->delta);
+ }
+
+#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE)
+ pagesize = sysconf(_SC_PAGESIZE);
+#endif
+#ifdef _SC_PAGE_SIZE
+ if (pagesize == -1)
+ pagesize = sysconf(_SC_PAGE_SIZE);
+#endif
+#ifdef HAS_GETPAGESIZE
+ if (pagesize == -1)
+ pagesize = getpagesize();
+#endif
+#ifdef PAGE_SIZE
+ if (pagesize == -1)
+ pagesize = PAGE_SIZE;
+#endif
+ if (pagesize == -1)
+ pagesize = 4096;
+
+ delta = address % pagesize;
+ offset = address - delta;
+
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ if (mapFd < 0) {
+ if ((mapFd = open("/dev/mmap", O_RDWR)) < 0)
+ return NULL;
+ }
+ mloc.vaddr = (char *)0;
+ mloc.physaddr = (char *)offset;
+ mloc.length = size + delta;
+ mloc.ioflg=1;
+
+ if ((vaddr = (void *)ioctl(mapFd, MAP, &mloc)) == (void *)-1)
+ return NULL;
+#elif defined (__UNIXOS2__)
+ /*
+ * Dragon warning here! /dev/pmap$ is never closed, except on progam exit.
+ * Consecutive calling of this routine will make PMAP$ driver run out
+ * of memory handles. Some umap/close mechanism should be provided
+ */
+
+ rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
+ OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
+ if (rc != 0)
+ return NULL;
+ {
+ struct map_ioctl {
+ union {
+ ULONG phys;
+ void* user;
+ } a;
+ ULONG size;
+ } pmap,dmap;
+ ULONG plen,dlen;
+#define XFREE86_PMAP 0x76
+#define PMAP_MAP 0x44
+
+ pmap.a.phys = offset;
+ pmap.size = size + delta;
+ rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
+ (PULONG)&pmap, sizeof(pmap), &plen,
+ (PULONG)&dmap, sizeof(dmap), &dlen);
+ if (rc == 0) {
+ vaddr = dmap.a.user;
+ }
+ }
+ if (rc != 0)
+ return NULL;
+#elif defined(Lynx) && defined(NO_MMAP)
+ vaddr = (void *)smem_create("XF86DGA", (char *)offset,
+ size + delta, SM_READ|SM_WRITE);
+#else
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+ if (mapFd < 0) {
+ if ((mapFd = open(DEV_MEM, O_RDWR)) < 0)
+ return NULL;
+ }
+ vaddr = (void *)mmap(NULL, size + delta, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, mapFd, (off_t)offset);
+ if (vaddr == (void *)-1)
+ return NULL;
+#endif
+
+ if (!vaddr) {
+ if (!(mp = AddMap()))
+ return NULL;
+ mp->physaddr = address;
+ mp->size = size;
+ mp->delta = delta;
+ mp->vaddr = vaddr;
+ mp->refcount = 1;
+ }
+ return (void *)((unsigned long)vaddr + delta);
+}
+
+/*
+ * Still need to find a clean way of detecting the death of a DGA app
+ * and returning things to normal - Jon
+ * This is here to help debugging without rebooting... Also C-A-BS
+ * should restore text mode.
+ */
+
+int
+XF86DGAForkApp(int screen)
+{
+ pid_t pid;
+ int status;
+ int i;
+
+ /* fork the app, parent hangs around to clean up */
+ if ((pid = fork()) > 0) {
+ ScrPtr sp;
+
+ waitpid(pid, &status, 0);
+ for (i = 0; i < numScrs; i++) {
+ sp = scrList[i];
+ XF86DGADirectVideoLL(sp->display, sp->screen, 0);
+ XSync(sp->display, False);
+ }
+ if (WIFEXITED(status))
+ _exit(0);
+ else
+ _exit(-1);
+ }
+ return pid;
+}
+
+
+Bool
+XF86DGADirectVideo(
+ Display *dis,
+ int screen,
+ int enable
+){
+ ScrPtr sp;
+ MapPtr mp = NULL;
+
+ if ((sp = FindScr(dis, screen)))
+ mp = sp->map;
+
+ if (enable & XF86DGADirectGraphics) {
+#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \
+ && !(defined(Lynx) && defined(NO_MMAP)) \
+ && !defined(__UNIXOS2__)
+ if (mp && mp->vaddr)
+ mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ | PROT_WRITE);
+#endif
+ } else {
+#if !defined(ISC) && !defined(HAS_SVR3_MMAP) \
+ && !(defined(Lynx) && defined(NO_MMAP)) \
+ && !defined(__UNIXOS2__)
+ if (mp && mp->vaddr)
+ mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ);
+#elif defined(Lynx) && defined(NO_MMAP)
+ /* XXX this doesn't allow enable after disable */
+ smem_create(NULL, mp->vaddr, mp->size + mp->delta, SM_DETACH);
+ smem_remove("XF86DGA");
+#endif
+ }
+
+ XF86DGADirectVideoLL(dis, screen, enable);
+ return 1;
+}
+
+
+static void
+XF86cleanup(int sig)
+{
+ ScrPtr sp;
+ int i;
+ static char beenhere = 0;
+
+ if (beenhere)
+ _exit(3);
+ beenhere = 1;
+
+ for (i = 0; i < numScrs; i++) {
+ sp = scrList[i];
+ XF86DGADirectVideo(sp->display, sp->screen, 0);
+ XSync(sp->display, False);
+ }
+ _exit(3);
+}
+
+Bool
+XF86DGAGetVideo(
+ Display *dis,
+ int screen,
+ char **addr,
+ int *width,
+ int *bank,
+ int *ram
+){
+ unsigned int offset;
+ static int beenHere = 0;
+ ScrPtr sp;
+ MapPtr mp;
+
+ if (!(sp = FindScr(dis, screen))) {
+ if (!(sp = AddScr())) {
+ fprintf(stderr, "XF86DGAGetVideo: malloc failure\n");
+ exit(-2);
+ }
+ sp->display = dis;
+ sp->screen = screen;
+ sp->map = NULL;
+ }
+
+ XF86DGAGetVideoLL(dis, screen , &offset, width, bank, ram);
+
+ *addr = MapPhysAddress(offset, *bank);
+ if (*addr == NULL) {
+ fprintf(stderr, "XF86DGAGetVideo: failed to map video memory (%s)\n",
+ strerror(errno));
+ exit(-2);
+ }
+
+ if ((mp = FindMap(offset, *bank)))
+ sp->map = mp;
+
+ if (!beenHere) {
+ beenHere = 1;
+ atexit((void(*)(void))XF86cleanup);
+ /* one shot XF86cleanup attempts */
+ signal(SIGSEGV, XF86cleanup);
+#ifdef SIGBUS
+ signal(SIGBUS, XF86cleanup);
+#endif
+ signal(SIGHUP, XF86cleanup);
+ signal(SIGFPE, XF86cleanup);
+ }
+
+ return 1;
+}
+
--- /dev/null
+/*
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995,1996 The XFree86 Project, Inc
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#ifdef __UNIXOS2__ /* needed here to override certain constants in X headers */
+#define INCL_DOS
+#define INCL_DOSIOCTL
+#define I_NEED_OS2_H
+#include <os2.h>
+#endif
+
+#include <X11/Xlibint.h>
+#include <X11/extensions/Xxf86dga.h>
+#include <X11/extensions/xf86dgaproto.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+#include <stdio.h>
+
+
+/* If you change this, change the Bases[] array below as well */
+#define MAX_HEADS 16
+
+char *xdga_extension_name = XF86DGANAME;
+
+static XExtensionInfo _xdga_info_data;
+static XExtensionInfo *xdga_info = &_xdga_info_data;
+
+
+Bool XDGAMapFramebuffer(int, char *, unsigned char*, CARD32, CARD32, CARD32);
+void XDGAUnmapFramebuffer(int);
+unsigned char* XDGAGetMappedMemory(int);
+
+#define XDGACheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, xdga_extension_name, val)
+
+/*****************************************************************************
+ * *
+ * private utility routines *
+ * *
+ *****************************************************************************/
+
+static int xdga_close_display(Display *dpy, XExtCodes *codes);
+static Bool xdga_wire_to_event(Display *dpy, XEvent *event, xEvent *wire_ev);
+static Status xdga_event_to_wire(Display *dpy, XEvent *event, xEvent *wire_ev);
+
+static XExtensionHooks xdga_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ xdga_close_display, /* close_display */
+ xdga_wire_to_event, /* wire_to_event */
+ xdga_event_to_wire, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info)
+
+
+XExtDisplayInfo* xdga_find_display(Display*);
+XEXT_GENERATE_FIND_DISPLAY (xdga_find_display, xdga_info,
+ "XFree86-DGA",
+ &xdga_extension_hooks,
+ 0, NULL)
+
+
+static Status
+xdga_event_to_wire(
+ Display *dpy,
+ XEvent *event,
+ xEvent *wire_ev
+){
+ return True;
+}
+
+static Bool
+xdga_wire_to_event(
+ Display *dpy,
+ XEvent *event,
+ xEvent *wire_ev
+){
+ dgaEvent *wire = (dgaEvent *) wire_ev;
+ XDGAButtonEvent *bevent;
+ XDGAKeyEvent *kevent;
+ XDGAMotionEvent *mevent;
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+
+ XDGACheckExtension (dpy, info, False);
+
+ switch((wire->u.u.type & 0x7f) - info->codes->first_event) {
+ case MotionNotify:
+ mevent = (XDGAMotionEvent*)event;
+ mevent->type = wire->u.u.type & 0x7F;
+ mevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
+ mevent->display = dpy;
+ mevent->screen = wire->u.event.screen;
+ mevent->time = wire->u.event.time;
+ mevent->state = wire->u.event.state;
+ mevent->dx = wire->u.event.dx;
+ mevent->dy = wire->u.event.dy;
+ return True;
+ case ButtonPress:
+ case ButtonRelease:
+ bevent = (XDGAButtonEvent*)event;
+ bevent->type = wire->u.u.type & 0x7F;
+ bevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
+ bevent->display = dpy;
+ bevent->screen = wire->u.event.screen;
+ bevent->time = wire->u.event.time;
+ bevent->state = wire->u.event.state;
+ bevent->button = wire->u.u.detail;
+ return True;
+ case KeyPress:
+ case KeyRelease:
+ kevent = (XDGAKeyEvent*)event;
+ kevent->type = wire->u.u.type & 0x7F;
+ kevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
+ kevent->display = dpy;
+ kevent->screen = wire->u.event.screen;
+ kevent->time = wire->u.event.time;
+ kevent->state = wire->u.event.state;
+ kevent->keycode = wire->u.u.detail;
+ return True;
+ }
+
+ return False;
+}
+
+
+Bool XDGAQueryExtension (
+ Display *dpy,
+ int *event_basep,
+ int *error_basep
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+
+Bool XDGAQueryVersion(
+ Display *dpy,
+ int *majorVersion,
+ int *minorVersion
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGAQueryVersionReply rep;
+ xXDGAQueryVersionReq *req;
+
+ XDGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XDGAQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAQueryVersion;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *majorVersion = rep.majorVersion;
+ *minorVersion = rep.minorVersion;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ if (*majorVersion >= 2)
+ {
+ int i, j;
+
+ for (i = 0, j = info->codes->first_event;
+ i < XF86DGANumberEvents;
+ i++, j++)
+ {
+ XESetWireToEvent (dpy, j, xdga_wire_to_event);
+ XESetEventToWire (dpy, j, xdga_event_to_wire);
+ }
+ XDGASetClientVersion(dpy);
+ }
+ return True;
+}
+
+Bool XDGASetClientVersion(
+ Display *dpy
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGASetClientVersionReq *req;
+
+ XDGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XDGASetClientVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASetClientVersion;
+ req->major = XDGA_MAJOR_VERSION;
+ req->minor = XDGA_MINOR_VERSION;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool XDGAOpenFramebuffer(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGAOpenFramebufferReply rep;
+ xXDGAOpenFramebufferReq *req;
+ char *deviceName = NULL;
+ Bool ret;
+
+ XDGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XDGAOpenFramebuffer, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAOpenFramebuffer;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ if(rep.length) {
+ deviceName = Xmalloc(rep.length << 2);
+ _XRead(dpy, deviceName, rep.length << 2);
+ }
+
+ ret = XDGAMapFramebuffer(screen, deviceName,
+ (unsigned char*)(long)rep.mem1,
+ rep.size, rep.offset, rep.extra);
+
+ if(deviceName)
+ Xfree(deviceName);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return ret;
+}
+
+void XDGACloseFramebuffer(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGACloseFramebufferReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ XDGAUnmapFramebuffer(screen);
+
+ LockDisplay(dpy);
+ GetReq(XDGACloseFramebuffer, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACloseFramebuffer;
+ req->screen = screen;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+
+XDGAMode* XDGAQueryModes(
+ Display *dpy,
+ int screen,
+ int *num
+){
+ XExtDisplayInfo *dinfo = xdga_find_display (dpy);
+ xXDGAQueryModesReply rep;
+ xXDGAQueryModesReq *req;
+ XDGAMode *modes = NULL;
+
+ *num = 0;
+
+ XDGACheckExtension (dpy, dinfo, NULL);
+
+ LockDisplay(dpy);
+ GetReq(XDGAQueryModes, req);
+ req->reqType = dinfo->codes->major_opcode;
+ req->dgaReqType = X_XDGAQueryModes;
+ req->screen = screen;
+
+ if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ if(rep.length) {
+ xXDGAModeInfo info;
+ int i, size;
+ char *offset;
+
+ size = rep.length << 2;
+ size -= rep.number * sz_xXDGAModeInfo; /* find text size */
+ modes = (XDGAMode*)Xmalloc((rep.number * sizeof(XDGAMode)) + size);
+ offset = (char*)(&modes[rep.number]); /* start of text */
+
+
+ if(modes) {
+ for(i = 0; i < rep.number; i++) {
+ _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
+
+ modes[i].num = info.num;
+ modes[i].verticalRefresh =
+ (float)info.vsync_num / (float)info.vsync_den;
+ modes[i].flags = info.flags;
+ modes[i].imageWidth = info.image_width;
+ modes[i].imageHeight = info.image_height;
+ modes[i].pixmapWidth = info.pixmap_width;
+ modes[i].pixmapHeight = info.pixmap_height;
+ modes[i].bytesPerScanline = info.bytes_per_scanline;
+ modes[i].byteOrder = info.byte_order;
+ modes[i].depth = info.depth;
+ modes[i].bitsPerPixel = info.bpp;
+ modes[i].redMask = info.red_mask;
+ modes[i].greenMask = info.green_mask;
+ modes[i].blueMask = info.blue_mask;
+ modes[i].visualClass = info.visual_class;
+ modes[i].viewportWidth = info.viewport_width;
+ modes[i].viewportHeight = info.viewport_height;
+ modes[i].xViewportStep = info.viewport_xstep;
+ modes[i].yViewportStep = info.viewport_ystep;
+ modes[i].maxViewportX = info.viewport_xmax;
+ modes[i].maxViewportY = info.viewport_ymax;
+ modes[i].viewportFlags = info.viewport_flags;
+ modes[i].reserved1 = info.reserved1;
+ modes[i].reserved2 = info.reserved2;
+
+ _XRead(dpy, offset, info.name_size);
+ modes[i].name = offset;
+ offset += info.name_size;
+ }
+ *num = rep.number;
+ } else
+ _XEatData(dpy, rep.length << 2);
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return modes;
+}
+
+
+XDGADevice *
+XDGASetMode(
+ Display *dpy,
+ int screen,
+ int mode
+){
+ XExtDisplayInfo *dinfo = xdga_find_display (dpy);
+ xXDGASetModeReply rep;
+ xXDGASetModeReq *req;
+ XDGADevice *dev = NULL;
+ Pixmap pid;
+
+ XDGACheckExtension (dpy, dinfo, NULL);
+
+ LockDisplay(dpy);
+ GetReq(XDGASetMode, req);
+ req->reqType = dinfo->codes->major_opcode;
+ req->dgaReqType = X_XDGASetMode;
+ req->screen = screen;
+ req->mode = mode;
+ req->pid = pid = XAllocID(dpy);
+
+ if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ if(rep.length) {
+ xXDGAModeInfo info;
+ int size;
+
+ size = rep.length << 2;
+ size -= sz_xXDGAModeInfo; /* get text size */
+
+ dev = (XDGADevice*)Xmalloc(sizeof(XDGADevice) + size);
+
+ if(dev) {
+ _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
+
+ dev->mode.num = info.num;
+ dev->mode.verticalRefresh =
+ (float)info.vsync_num / (float)info.vsync_den;
+ dev->mode.flags = info.flags;
+ dev->mode.imageWidth = info.image_width;
+ dev->mode.imageHeight = info.image_height;
+ dev->mode.pixmapWidth = info.pixmap_width;
+ dev->mode.pixmapHeight = info.pixmap_height;
+ dev->mode.bytesPerScanline = info.bytes_per_scanline;
+ dev->mode.byteOrder = info.byte_order;
+ dev->mode.depth = info.depth;
+ dev->mode.bitsPerPixel = info.bpp;
+ dev->mode.redMask = info.red_mask;
+ dev->mode.greenMask = info.green_mask;
+ dev->mode.blueMask = info.blue_mask;
+ dev->mode.visualClass = info.visual_class;
+ dev->mode.viewportWidth = info.viewport_width;
+ dev->mode.viewportHeight = info.viewport_height;
+ dev->mode.xViewportStep = info.viewport_xstep;
+ dev->mode.yViewportStep = info.viewport_ystep;
+ dev->mode.maxViewportX = info.viewport_xmax;
+ dev->mode.maxViewportY = info.viewport_ymax;
+ dev->mode.viewportFlags = info.viewport_flags;
+ dev->mode.reserved1 = info.reserved1;
+ dev->mode.reserved2 = info.reserved2;
+
+ dev->mode.name = (char*)(&dev[1]);
+ _XRead(dpy, dev->mode.name, info.name_size);
+
+ dev->pixmap = (rep.flags & XDGAPixmap) ? pid : 0;
+ dev->data = XDGAGetMappedMemory(screen);
+
+ if(dev->data)
+ dev->data += rep.offset;
+ }
+ /* not sure what to do if the allocation fails */
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return dev;
+}
+
+
+void XDGASetViewport(
+ Display *dpy,
+ int screen,
+ int x,
+ int y,
+ int flags
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGASetViewportReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGASetViewport, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASetViewport;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+ req->flags = flags;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+void XDGAInstallColormap(
+ Display *dpy,
+ int screen,
+ Colormap cmap
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGAInstallColormapReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGAInstallColormap, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAInstallColormap;
+ req->screen = screen;
+ req->cmap = cmap;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void XDGASelectInput(
+ Display *dpy,
+ int screen,
+ long mask
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGASelectInputReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGASelectInput, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASelectInput;
+ req->screen = screen;
+ req->mask = mask;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void XDGAFillRectangle(
+ Display *dpy,
+ int screen,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height,
+ unsigned long color
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGAFillRectangleReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGAFillRectangle, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAFillRectangle;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+ req->width = width;
+ req->height = height;
+ req->color = color;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void XDGACopyArea(
+ Display *dpy,
+ int screen,
+ int srcx,
+ int srcy,
+ unsigned int width,
+ unsigned int height,
+ int dstx,
+ int dsty
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGACopyAreaReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGACopyArea, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACopyArea;
+ req->screen = screen;
+ req->srcx = srcx;
+ req->srcy = srcy;
+ req->width = width;
+ req->height = height;
+ req->dstx = dstx;
+ req->dsty = dsty;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void XDGACopyTransparentArea(
+ Display *dpy,
+ int screen,
+ int srcx,
+ int srcy,
+ unsigned int width,
+ unsigned int height,
+ int dstx,
+ int dsty,
+ unsigned long key
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGACopyTransparentAreaReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGACopyTransparentArea, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACopyTransparentArea;
+ req->screen = screen;
+ req->srcx = srcx;
+ req->srcy = srcy;
+ req->width = width;
+ req->height = height;
+ req->dstx = dstx;
+ req->dsty = dsty;
+ req->key = key;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+int XDGAGetViewportStatus(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGAGetViewportStatusReply rep;
+ xXDGAGetViewportStatusReq *req;
+ int status = 0;
+
+ XDGACheckExtension (dpy, info, 0);
+
+ LockDisplay(dpy);
+ GetReq(XDGAGetViewportStatus, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAGetViewportStatus;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse))
+ status = rep.status;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return status;
+}
+
+void XDGASync(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGASyncReply rep;
+ xXDGASyncReq *req;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGASync, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASync;
+ req->screen = screen;
+ _XReply(dpy, (xReply *)&rep, 0, xFalse);
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+void XDGAChangePixmapMode(
+ Display *dpy,
+ int screen,
+ int *x,
+ int *y,
+ int mode
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGAChangePixmapModeReq *req;
+ xXDGAChangePixmapModeReply rep;
+
+ XextSimpleCheckExtension (dpy, info, xdga_extension_name);
+
+ LockDisplay(dpy);
+ GetReq(XDGAChangePixmapMode, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAChangePixmapMode;
+ req->screen = screen;
+ req->x = *x;
+ req->y = *y;
+ req->flags = mode;
+ _XReply(dpy, (xReply *)&rep, 0, xFalse);
+ *x = rep.x;
+ *y = rep.y;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+Colormap XDGACreateColormap(
+ Display *dpy,
+ int screen,
+ XDGADevice *dev,
+ int alloc
+){
+ XExtDisplayInfo *info = xdga_find_display (dpy);
+ xXDGACreateColormapReq *req;
+ Colormap cid;
+
+ XDGACheckExtension (dpy, info, -1);
+
+ LockDisplay(dpy);
+ GetReq(XDGACreateColormap, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACreateColormap;
+ req->screen = screen;
+ req->mode = dev->mode.num;
+ req->alloc = alloc;
+ cid = req->id = XAllocID(dpy);
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return cid;
+}
+
+
+void XDGAKeyEventToXKeyEvent(
+ XDGAKeyEvent* dk,
+ XKeyEvent* xk
+){
+ xk->type = dk->type;
+ xk->serial = dk->serial;
+ xk->send_event = False;
+ xk->display = dk->display;
+ xk->window = RootWindow(dk->display, dk->screen);
+ xk->root = xk->window;
+ xk->subwindow = None;
+ xk->time = dk->time;
+ xk->x = xk->y = xk->x_root = xk->y_root = 0;
+ xk->state = dk->state;
+ xk->keycode = dk->keycode;
+ xk->same_screen = True;
+}
+
+#include <X11/Xmd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#if defined(ISC)
+# define HAS_SVR3_MMAP
+# include <sys/types.h>
+# include <errno.h>
+
+# include <sys/at_ansi.h>
+# include <sys/kd.h>
+
+# include <sys/sysmacros.h>
+# include <sys/immu.h>
+# include <sys/region.h>
+
+# include <sys/mmap.h>
+#else
+# if defined(Lynx) && defined(NO_MMAP)
+# include <sys/types.h>
+# include <errno.h>
+# include <smem.h>
+# else
+# if !defined(__UNIXOS2__)
+# include <sys/mman.h>
+# endif
+# endif
+#endif
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+
+#if defined(SVR4) && !defined(sun)
+#define DEV_MEM "/dev/pmem"
+#elif defined(SVR4) && defined(sun)
+#define DEV_MEM "/dev/xsvc"
+#elif defined(HAS_APERTURE_DRV)
+#define DEV_MEM "/dev/xf86"
+#else
+#define DEV_MEM "/dev/mem"
+#endif
+
+
+
+typedef struct _DGAMapRec{
+ unsigned char *physical;
+ unsigned char *virtual;
+ CARD32 size;
+ int fd;
+ int screen;
+ struct _DGAMapRec *next;
+} DGAMapRec, *DGAMapPtr;
+
+static Bool
+DGAMapPhysical(int, char*, unsigned char*, CARD32, CARD32, CARD32, DGAMapPtr);
+static void DGAUnmapPhysical(DGAMapPtr);
+
+static DGAMapPtr _Maps = NULL;
+
+
+unsigned char*
+XDGAGetMappedMemory(int screen)
+{
+ DGAMapPtr pMap = _Maps;
+ unsigned char *pntr = NULL;
+
+ while(pMap != NULL) {
+ if(pMap->screen == screen) {
+ pntr = pMap->virtual;
+ break;
+ }
+ pMap = pMap->next;
+ }
+
+ return pntr;
+}
+
+Bool
+XDGAMapFramebuffer(
+ int screen,
+ char *name, /* optional device name */
+ unsigned char* base, /* physical memory */
+ CARD32 size, /* size */
+ CARD32 offset, /* optional offset */
+ CARD32 extra /* optional extra data */
+){
+ DGAMapPtr pMap = _Maps;
+ Bool result;
+
+ /* is it already mapped ? */
+ while(pMap != NULL) {
+ if(pMap->screen == screen)
+ return True;
+ pMap = pMap->next;
+ }
+
+ if(extra & XDGANeedRoot) {
+ /* we should probably check if we have root permissions and
+ return False here */
+
+ }
+
+ pMap = (DGAMapPtr)Xmalloc(sizeof(DGAMapRec));
+
+ result = DGAMapPhysical(screen, name, base, size, offset, extra, pMap);
+
+ if(result) {
+ pMap->next = _Maps;
+ _Maps = pMap;
+ } else
+ Xfree(pMap);
+
+ return result;
+}
+
+void
+XDGAUnmapFramebuffer(int screen)
+{
+ DGAMapPtr pMap = _Maps;
+ DGAMapPtr pPrev = NULL;
+
+ /* is it already mapped */
+ while(pMap != NULL) {
+ if(pMap->screen == screen)
+ break;
+ pPrev = pMap;
+ pMap = pMap->next;
+ }
+
+ if(!pMap)
+ return;
+
+ DGAUnmapPhysical(pMap);
+
+ if(!pPrev)
+ _Maps = pMap->next;
+ else
+ pPrev->next = pMap->next;
+
+ Xfree(pMap);
+}
+
+
+static Bool
+DGAMapPhysical(
+ int screen,
+ char *name, /* optional device name */
+ unsigned char* base, /* physical memory */
+ CARD32 size, /* size */
+ CARD32 offset, /* optional offset */
+ CARD32 extra, /* optional extra data */
+ DGAMapPtr pMap
+) {
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ struct kd_memloc mloc;
+#elif defined(__UNIXOS2__)
+ APIRET rc;
+ ULONG action;
+ HFILE hfd;
+#endif
+
+ base += offset;
+
+ pMap->screen = screen;
+ pMap->physical = base;
+ pMap->size = size;
+
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ if ((pMap->fd = open("/dev/mmap", O_RDWR)) < 0)
+ return False;
+ mloc.vaddr = (char *)0;
+ mloc.physaddr = (char *)base;
+ mloc.length = size;
+ mloc.ioflg=1;
+
+ if ((pMap->virtual = (void *)ioctl(pMap->fd, MAP, &mloc)) == (void *)-1)
+ return False;
+#elif defined (__UNIXOS2__)
+ /*
+ * Dragon warning here! /dev/pmap$ is never closed, except on progam exit.
+ * Consecutive calling of this routine will make PMAP$ driver run out
+ * of memory handles. Some umap/close mechanism should be provided
+ */
+
+ rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
+ OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
+ if (rc != 0)
+ return False;
+ {
+ struct map_ioctl {
+ union {
+ ULONG phys;
+ void* user;
+ } a;
+ ULONG size;
+ } pmap,dmap;
+ ULONG plen,dlen;
+#define XFREE86_PMAP 0x76
+#define PMAP_MAP 0x44
+
+ pmap.a.phys = base;
+ pmap.size = size;
+ rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
+ (PULONG)&pmap, sizeof(pmap), &plen,
+ (PULONG)&dmap, sizeof(dmap), &dlen);
+ if (rc == 0) {
+ pMap->virtual = dmap.a.user;
+ }
+ }
+ if (rc != 0)
+ return False;
+#elif defined (Lynx) && defined(NO_MMAP)
+ pMap->virtual = smem_create("XF86DGA", (char*)base, size, SM_READ|SM_WRITE);
+#else
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+ if (!name)
+ name = DEV_MEM;
+ if ((pMap->fd = open(name, O_RDWR)) < 0)
+ return False;
+ pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base);
+ if (pMap->virtual == (void *)-1)
+ return False;
+ mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);
+#endif
+
+ return True;
+}
+
+
+
+static void
+DGAUnmapPhysical(DGAMapPtr pMap)
+{
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ /* XXX Add unmapping code here. */
+#elif defined (__UNIXOS2__)
+ /* XXX Add unmapping code here. */
+#elif defined(Lynx) && defined(NO_MMAP)
+ /* XXX this doesn't allow enable after disable */
+ smem_create(NULL, pMap->virtual, pMap->size, SM_DETACH);
+ smem_remove("XF86DGA");
+#else
+ if (pMap->virtual && pMap->virtual != (void *)-1) {
+ mprotect(pMap->virtual,pMap->size, PROT_READ);
+ munmap(pMap->virtual, pMap->size);
+ pMap->virtual = 0;
+ }
+ if (pMap->fd >= 0) {
+ close(pMap->fd);
+ pMap->fd = -1;
+ }
+#endif
+}
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Xxf86dga
+Description: XFree86 Direct Graphics Access Extension Library
+Version: @VERSION@
+Requires: xf86dgaproto
+Requires.private: x11 xext
+Cflags: -I${includedir}
+Libs: -L${libdir} -lXxf86dga