Initialize Tizen 2.3 tizen_2.3 2.3a_release submit/tizen_2.3/20140531.115111 submit/tizen_2.3/20150202.070209 tizen_2.3_release
authorSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 04:21:08 +0000 (13:21 +0900)
committerSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 04:21:08 +0000 (13:21 +0900)
12 files changed:
COPYING [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
INSTALL [new file with mode: 0644]
Makefile.am [new file with mode: 0755]
README [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0755]
dri2proto.h [new file with mode: 0755]
dri2proto.pc.in [new file with mode: 0644]
dri2proto.txt [new file with mode: 0644]
dri2tokens.h [new file with mode: 0644]
packaging/xorg-x11-proto-dri2.spec [new file with mode: 0644]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..a99b75a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,29 @@
+Copyright © 2007 Red Hat, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Soft-
+ware"), to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, provided that the above copyright
+notice(s) and this permission notice appear in all copies of the Soft-
+ware and that both the above copyright notice(s) and this permission
+notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
+MANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization of
+the copyright holder.
+
+Authors:
+  Kristian Høgsberg (krh@redhat.com)
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..258b9b8
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,361 @@
+commit 7fd18b15646a62bd82a4eb0eca60a34c1731813d
+Author: Chad Versace <chad@chad-versace.us>
+Date:   Wed May 11 12:50:11 2011 -0700
+
+    Add attachment token DRI2BufferHiz
+    
+    ... and bump version to 2.6.
+    
+    CC: Eric Anholt <eric@anholt.net>
+    CC: Ian Romanick <idr@freedesktop.org>
+    CC: Kristian Høgsberg <krh@bitplanet.net
+    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
+    Signed-off-by: Chad Versace <chad@chad-versace.us>
+
+commit 005096937e1da6f65f8ece77662a8db6102d933d
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Thu May 5 13:11:22 2011 -0700
+
+    dri2proto: add a new DRI2BufferSwapComplete struct that matches the spec
+    
+    Just add a new struct to remain compatible with existing code.
+    
+    Reviewed-by: Eric Anholt <eric@anholt.net>
+    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+
+commit f3c211e1ae183dab5c7529814c9f42af2c29fc6c
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Thu May 5 09:22:39 2011 -0700
+
+    Revert "dri2proto: make DRI2 swap event match GLX spec"
+    
+    This reverts commit 0ca3778de195a82087d0f07415a1cf8fc94f5b0a.
+    
+    This broke compatibility by renaming existing struct fields.  So revert
+    in favor of a new struct.
+
+commit 0ca3778de195a82087d0f07415a1cf8fc94f5b0a
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Tue May 3 12:14:58 2011 -0700
+
+    dri2proto: make DRI2 swap event match GLX spec
+    
+    We only spec a 32 bit sbc count, so drop the high bits.  Also make the
+    padding explicit.
+    
+    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+
+commit 2af5884ab0797f2872028a90fffd4155109cdc4d
+Author: Marcin Kościelnicki <koriakin@0x04.net>
+Date:   Thu May 13 21:05:56 2010 +0000
+
+    Fix DRI2Connect line encoding to match existing code
+    
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+
+commit c34ce137fdb21fc9a52bb8d5a0c25e3c5d79e687
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 19:25:52 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 1c1456e1517d28ffbd844b00090596c21d9a9d9b
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 19:00:30 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 70e5dee9a600e67057c55ab9b1b975f20a68682d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Mar 28 17:35:44 2010 -0400
+
+    config: install and distribute dri2proto.txt
+    
+    It will now be installed in $docdir in addition
+    to being distributed in the tarball.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 3e6dc6d72844bbc8e8752e2ac2e781cb7d0172f1
+Author: Mike Stroyan <mike@LunarG.com>
+Date:   Tue Feb 16 14:51:43 2010 -0700
+
+    Fix typo and obsolete reference in dri2proto.txt
+
+commit 1911ee62a552fae34c82c91b4deef523380fbfe1
+Author: Mike Stroyan <mike@LunarG.com>
+Date:   Tue Feb 16 14:47:21 2010 -0700
+
+    Add more info about dri2proto events
+
+commit 41045095bddfe460a76fb560e1d087430d8fd76f
+Author: Francisco Jerez <currojerez@riseup.net>
+Date:   Mon Feb 8 19:24:37 2010 +0100
+
+    Define an event to notify clients about the validity of their buffers.
+    
+    Bumps the protocol and package versions.
+    
+    Signed-off-by: Francisco Jerez <currojerez@riseup.net>
+
+commit bd6f2584d3d55746bb56bf923b35e85adfd0dc3b
+Merge: 84eac7f 9c1a8f1
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Tue Dec 8 16:03:11 2009 -0800
+
+    Merge branch 'dri2-swapbuffers'
+
+commit 84eac7f37646d36c2644b8f6880c10c249068450
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 22 19:24:47 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit 499241b74322b984bbbee0803513e32b6f83bb31
+Author: Aaron Plattner <aplattner@nvidia.com>
+Date:   Mon Oct 12 13:11:47 2009 -0700
+
+    Add a DRI2DriverVDPAU driver type.
+    
+    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
+    Acked-by: Kristian Høgsberg <krh@bitplanet.net>
+
+commit 0a5e388ae9c1306bb253c161071424e0282ea8f5
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Nov 16 11:13:29 2009 -0500
+
+    README: file created or updated #24206
+    
+    Contains a set of URLs to freedesktop.org.
+
+commit 1b648b29caea1540abcb0ea7c35c45f749e160b4
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 19:45:26 2009 -0500
+
+    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 77eefcd20b38392a75e7c71a7e182dcfcaf3e7c3
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 18:31:28 2009 -0500
+
+    Makefile.am: INSTALL file is missing or incorrect #24206
+    
+    The standard GNU file on building/installing  tarball is copied
+    using the XORG_INSTALL macro contained in XORG_DEFAULT_OPTIONS
+    Add INSTALL target
+
+commit 2ddb34caa23048083232e592300cfee7b8c2f04f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 18:11:36 2009 -0500
+
+    configure.ac: 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 363595cd28af5ff820e0790525108685bebf7275
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 15 13:55:25 2009 -0500
+
+    configure.ac: AM_MAINTAINER_MODE missing #24238
+    
+    This turns off maintainer mode build rules in tarballs.
+    Works in conjunction with autogen.sh --enable-maintainer-mode
+
+commit 9e8c94f5a55b0ba97cc1f8b34c1d58e50ea2c7f8
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Nov 14 18:26:46 2009 -0500
+
+    .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 9c1a8f1d074bd7b87c4edf8b689c13c93fba9aaa
+Author: Jesse Barnes <jbarnes@jbarnes-desktop.localdomain>
+Date:   Thu Nov 12 17:23:03 2009 +0000
+
+    Fix cut & paste error: Extension Requests -> Extension Events
+
+commit 7c7e9bbf4ab6177e9623f3c4d667ed83789167b4
+Author: Jesse Barnes <jbarnes@jbarnes-desktop.localdomain>
+Date:   Thu Nov 12 15:26:40 2009 +0000
+
+    Add DRI2 event support for DRI2BufferSwapComplete
+
+commit f9e6b17debd2f69821bd8d412cccf02dd9ba17af
+Author: Jesse Barnes <jbarnes@jbarnes-desktop.localdomain>
+Date:   Wed Nov 11 15:26:40 2009 -0800
+
+    Pad out DRI2 swap buffers reply
+
+commit 516a1ff1f8ceca9ddefce21303e65d873aeeba14
+Author: Jesse Barnes <jbarnes@jbarnes-desktop.localdomain>
+Date:   Tue Nov 10 12:12:07 2009 -0800
+
+    Add DRI2SwapInterval protocol
+    
+    Needed to handle swap interval in the direct rendered case.
+
+commit 5e059038a95b5bad7f41a2019beaad913ed29502
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Thu Oct 29 12:45:48 2009 -0700
+
+    Bump package version to 2.2
+
+commit 1102a9199db8aa08e891f808f8921a5d312e3197
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Fri Oct 2 22:23:09 2009 -0700
+
+    Fix DRI2SwapBuffers reply length
+    
+    Length should be a CARD32 and match the endianness annotation.
+    
+    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+
+commit 29c7fcbf10508ec822ad528928b72702e4c9af01
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Thu Oct 1 22:13:34 2009 -0700
+
+    Add swap interval and synchronization support
+    
+    Based on SGI_video_sync, SGI_swap_control and OML_sync_control, add swap
+    interval and synchronization support to DRI2.  Useful for throttling rendering
+    and basic performance metrics.
+    
+    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+
+commit 00c15f92c1f294d762f2052f1d775c393ebd2432
+Author: Jesse Barnes <jbarnes@jbarnes-x200.(none)>
+Date:   Mon Jun 8 16:12:50 2009 -0700
+
+    Update protocol description for swapbuffers
+
+commit aaee5f8af4f0fe63498cd8ae507f8d33edba280c
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Wed Jun 3 17:36:43 2009 -0400
+
+    Make swapbuffers an async request
+    
+    The protocol now require a DRI2GetBuffersWithFormat request to follow the
+    swapbuffer request so.
+
+commit 9b5ef83c0b9ef0239ac82adfa9a816f195074dcb
+Author: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date:   Fri May 1 14:41:55 2009 -0700
+
+    Add SwapBuffers request
+    
+    Add a SwapBuffers request for requesting a front<->back swap.  Returns a
+    whole new set of buffers to the client to allow for triple buffering
+    etc.
+
+commit 66c56ab10d917e3f47f93178d7eac6430970d3c4
+Author: Ian Romanick <idr@freedesktop.org>
+Date:   Mon Apr 20 21:16:24 2009 -0700
+
+    Add protocol for DRI2GetBuffersWithFormat
+    
+    This function replaces DRI2GetBuffers.
+    
+    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
+    Reviewed-by: Kristian Høgsberg <krh@redhat.com>
+
+commit a223ab5e6a215d86e4bf072369b331506f689f83
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Apr 20 14:08:19 2009 -0400
+
+    Bump to 2.0 and release
+
+commit f46b6ca29b2da54cf6e6db57d464bea9476594c6
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri Jan 9 06:07:59 2009 +0100
+
+    Distribute the protocol documentation
+
+commit ac787752bf67f8f1ea8167191e5fb9d7fbbe7c7f
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 27 20:06:28 2009 -0200
+
+    Janitor: Correct make distcheck and dont distribute autogen.sh
+
+commit 65c7097d549ada25d11738b15996b18c9e57a847
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Dec 1 20:57:40 2008 -0500
+
+    Bump to 1.99.3 and back out the value bitmask from the CopyRegion request.
+
+commit f7b737bef90df4430ac491d65accc7742bc6ca38
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Dec 1 14:01:42 2008 -0500
+
+    Bump version to 1.99.2.
+
+commit 8cab3f0e6f551220bd11074779f4ccec1e948e00
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Oct 14 23:19:15 2008 -0400
+
+    Add protocol documentation, update to DRI2CopyRegion request.
+
+commit abb1edc487543c26856afdbe6a7e2c088a1e82ee
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Aug 12 12:52:33 2008 -0400
+
+    Update to 1.99.1 - drop sarea and perform swap buffer in X server.
+    
+    Still to resolve is the swap buffer request.  It should probably be
+    broken into two requests, one to post the swap request and one to wait
+    for it to be completed.  Also, need to find a good solution to
+    CopySubBuffer that doesn't require a roundtrip per rectangle.
+    
+    Don't need to solve all this for 2.0, though, can add requests later on.
+
+commit b9d7a0c1b0f5b40dfe8ca7a33693198bf91244ca
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Wed Apr 2 19:11:32 2008 -0400
+
+    Adjust pkg-config cflags to match other proto modules.
+
+commit b515bee843d5ab91fc0fe30b8eb13aadd69b5131
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Wed Mar 26 16:00:05 2008 -0400
+
+    Add reemitDrawableInfo protocol.
+    
+    Also, remove the screen number where it's redundant and rename
+    drmDrawable in the create drawable request to just 'handle' now that
+    we don't rely on drm drawables.
+
+commit d2c2ffde8f3762af30ea6953d8a10b487f78733e
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Wed Mar 12 17:50:34 2008 -0400
+
+    Fix typo in xDRI2QueryVersionReq req type field.
+
+commit 672baf47cc5dfcdad4e70b4745e3316b209089a3
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Mar 11 00:12:55 2008 -0400
+
+    Initial commit.
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..8b82ade
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100755 (executable)
index 0000000..5990273
--- /dev/null
@@ -0,0 +1,20 @@
+dri2dir = $(includedir)/X11/extensions
+dri2_HEADERS = dri2proto.h dri2tokens.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dri2proto.pc
+
+dist_doc_DATA = dri2proto.txt
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..1115e51
--- /dev/null
+++ b/README
@@ -0,0 +1,30 @@
+                       Direct Rendering Infrastructure 2 Extension
+
+This extension defines a protocol to securely allow user applications to access
+the video hardware without requiring data to be passed through the X server.
+
+Extension name: DRI2
+
+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/proto/dri2proto
+
+        http://cgit.freedesktop.org/xorg/proto/dri2proto
+
+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
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..904cd67
--- /dev/null
@@ -0,0 +1,12 @@
+#! /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 "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100755 (executable)
index 0000000..6d1ebdb
--- /dev/null
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([DRI2Proto], [2.8], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_OUTPUT([Makefile
+           dri2proto.pc])
diff --git a/dri2proto.h b/dri2proto.h
new file mode 100755 (executable)
index 0000000..52ea6ac
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ *   Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_PROTO_H_
+#define _DRI2_PROTO_H_
+
+#define DRI2_NAME                      "DRI2"
+#define DRI2_MAJOR                     1
+#define DRI2_MINOR                     4
+
+#define DRI2NumberErrors               0
+#define DRI2NumberEvents               2
+#define DRI2NumberRequests             14
+
+#define X_DRI2QueryVersion             0
+#define X_DRI2Connect                  1
+#define X_DRI2Authenticate             2
+#define X_DRI2CreateDrawable           3
+#define X_DRI2DestroyDrawable          4
+#define X_DRI2GetBuffers               5
+#define X_DRI2CopyRegion               6
+#define X_DRI2GetBuffersWithFormat     7
+#define X_DRI2SwapBuffers              8
+#define X_DRI2GetMSC                   9
+#define X_DRI2WaitMSC                  10
+#define X_DRI2WaitSBC                  11
+#define X_DRI2SwapInterval             12
+#define X_DRI2GetParam                 13
+#define X_DRI2SwapBuffersWithRegion  50  /*Experimental protocol for TIZEN*/
+/*
+ * Events
+ */
+#define DRI2_BufferSwapComplete        0
+#define DRI2_InvalidateBuffers 1
+
+typedef struct {
+    CARD32  attachment B32;
+    CARD32  name B32;
+    CARD32  pitch B32;
+    CARD32  cpp B32;
+    CARD32  flags B32;
+} xDRI2Buffer;
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  majorVersion B32;
+    CARD32  minorVersion B32;
+} xDRI2QueryVersionReq;
+#define sz_xDRI2QueryVersionReq   12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  majorVersion B32;
+    CARD32  minorVersion B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+} xDRI2QueryVersionReply;
+#define sz_xDRI2QueryVersionReply      32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  window B32;
+    CARD32  driverType B32;
+} xDRI2ConnectReq;
+#define sz_xDRI2ConnectReq     12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  driverNameLength B32;
+    CARD32  deviceNameLength B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+} xDRI2ConnectReply;
+#define sz_xDRI2ConnectReply   32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  window B32;
+    CARD32  magic B32;
+} xDRI2AuthenticateReq;
+#define sz_xDRI2AuthenticateReq   12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  authenticated B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+} xDRI2AuthenticateReply;
+#define sz_xDRI2AuthenticateReply      32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2CreateDrawableReq;
+#define sz_xDRI2CreateDrawableReq   8
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2DestroyDrawableReq;
+#define sz_xDRI2DestroyDrawableReq   8
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  count B32;
+} xDRI2GetBuffersReq;
+#define sz_xDRI2GetBuffersReq   12
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  width B32;
+    CARD32  height B32;
+    CARD32  count B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+} xDRI2GetBuffersReply;
+#define sz_xDRI2GetBuffersReply        32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  region B32;
+    CARD32  dest B32;
+    CARD32  src B32;
+} xDRI2CopyRegionReq;
+#define sz_xDRI2CopyRegionReq   20
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+    CARD32  pad7 B32;
+} xDRI2CopyRegionReply;
+#define sz_xDRI2CopyRegionReply        32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_msc_hi B32;
+    CARD32  target_msc_lo B32;
+    CARD32  divisor_hi B32;
+    CARD32  divisor_lo B32;
+    CARD32  remainder_hi B32;
+    CARD32  remainder_lo B32;
+} xDRI2SwapBuffersReq;
+#define sz_xDRI2SwapBuffersReq  32
+
+/*Experimental protocol for TIZEN*/
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  region B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+    CARD32  pad6 B32;
+    CARD32  pad7 B32;
+} xDRI2SwapBuffersWithRegionReq;
+#define sz_xDRI2SwapBuffersWithRegionReq  32
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  swap_hi B32;
+    CARD32  swap_lo B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+    CARD32  pad5 B32;
+} xDRI2SwapBuffersReply;
+#define sz_xDRI2SwapBuffersReply 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+} xDRI2GetMSCReq;
+#define sz_xDRI2GetMSCReq 8
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_msc_hi B32;
+    CARD32  target_msc_lo B32;
+    CARD32  divisor_hi B32;
+    CARD32  divisor_lo B32;
+    CARD32  remainder_hi B32;
+    CARD32  remainder_lo B32;
+} xDRI2WaitMSCReq;
+#define sz_xDRI2WaitMSCReq 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  target_sbc_hi B32;
+    CARD32  target_sbc_lo B32;
+} xDRI2WaitSBCReq;
+#define sz_xDRI2WaitSBCReq 16
+
+typedef struct {
+    CARD8   type;
+    CARD8   pad1;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  ust_hi B32;
+    CARD32  ust_lo B32;
+    CARD32  msc_hi B32;
+    CARD32  msc_lo B32;
+    CARD32  sbc_hi B32;
+    CARD32  sbc_lo B32;
+} xDRI2MSCReply;
+#define sz_xDRI2MSCReply 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  interval B32;
+} xDRI2SwapIntervalReq;
+#define sz_xDRI2SwapIntervalReq 12
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;
+    CARD16 pad2;
+    CARD32 drawable B32;
+    CARD32 ust_hi B32;
+    CARD32 ust_lo B32;
+    CARD32 msc_hi B32;
+    CARD32 msc_lo B32;
+    CARD32 sbc_hi B32;
+    CARD32 sbc_lo B32;
+} xDRI2BufferSwapComplete;
+#define sz_xDRI2BufferSwapComplete 32
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;
+    CARD16 pad2;
+    CARD32 drawable B32;
+    CARD32 ust_hi B32;
+    CARD32 ust_lo B32;
+    CARD32 msc_hi B32;
+    CARD32 msc_lo B32;
+    CARD32 sbc B32;
+} xDRI2BufferSwapComplete2;
+#define sz_xDRI2BufferSwapComplete2 32
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD32 drawable B32;
+    CARD32 pad1 B32;
+    CARD32 pad2 B32;
+    CARD32 pad3 B32;
+    CARD32 pad4 B32;
+    CARD32 pad5 B32;
+    CARD32 pad6 B32;
+} xDRI2InvalidateBuffers;
+#define sz_xDRI2InvalidateBuffers 32
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   dri2ReqType;
+    CARD16  length B16;
+    CARD32  drawable B32;
+    CARD32  param B32;
+} xDRI2GetParamReq;
+#define sz_xDRI2GetParamReq 12
+
+typedef struct {
+    BYTE    type; /*X_Reply*/
+    BOOL    is_param_recognized;
+    CARD16  sequenceNumber B16;
+    CARD32  length B32;
+    CARD32  value_hi B32;
+    CARD32  value_lo B32;
+    CARD32  pad1 B32;
+    CARD32  pad2 B32;
+    CARD32  pad3 B32;
+    CARD32  pad4 B32;
+} xDRI2GetParamReply;
+#define sz_xDRI2GetParamReply 32
+
+#endif
diff --git a/dri2proto.pc.in b/dri2proto.pc.in
new file mode 100644 (file)
index 0000000..647416e
--- /dev/null
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+Name: DRI2Proto
+Description: DRI2 extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/dri2proto.txt b/dri2proto.txt
new file mode 100644 (file)
index 0000000..9921301
--- /dev/null
@@ -0,0 +1,927 @@
+                         The DRI2 Extension
+                             Version 2.0
+                             2008-09-04
+      
+                         Kristian Høgsberg
+                           krh@redhat.com
+                            Red Hat, Inc
+
+
+1. Introduction
+
+The DRI2 extension is designed to associate and access auxillary
+rendering buffers with an X drawable.
+
+DRI2 is a essentially a helper extension to support implementation of
+direct rendering drivers/libraries/technologies.
+
+The main consumer of this extension will be a direct rendering OpenGL
+driver, but the DRI2 extension is not designed to be OpenGL specific.
+Direct rendering implementations of OpenVG, Xv, cairo and other
+graphics APIs should find the functionality exposed by this extension
+helpful and hopefully sufficient.
+
+Relation to XF86DRI
+
+
+1.1. Acknowledgements
+
+Kevin E. Martin <kem@redhat.com>
+Keith Packard <keithp@keithp.com>
+Eric Anholt <eric@anholt.net>
+Keith Whitwell <keith@tungstengraphics.com>
+Jerome Glisse <glisse@freedesktop.org>
+Ian Romanick <ian.d.romanick@intel.com>
+Michel Dänzer <michel@tungstengraphics.com>
+Jesse Barnes <jbarnes@virtuousgeek.org>
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+2. DRI2 Concepts
+
+
+2.1. Attachment points
+
+Stolen from OpenGL FBOs, I guess.
+
+
+2.2. Kernel rendering manager
+
+This specification assumes a rendering architechture, where an
+underlying kernel rendering manager that can provide 32 bit integer
+handles to video memory buffers.  These handles can be passed between
+processes, which, through a direct rendering driver, submit rendering
+to the kernel rendering manager, targeting and/or sourcing from these
+buffers.  This extension provides a means to communicate about such
+buffers as associated with an X drawable.
+
+The details of how the a direct rendering driver use the buffer names
+and submit the rendering requests is outside the scope of this
+specification.  However, Appendix B does discuss implementation of
+this specification on the Graphics Execution Manager (GEM).
+
+
+2.3. Request ordering
+
+No ordering between swap buffers and X rendering.  X rendering to src
+buffers will block if they have a vblank pending.
+
+
+2.4 Authentication model
+
+The purpose of the DRM authentication scheme is to grant access to the
+kernel rendering manager buffers created by the X server if, and only
+if, the client has access to the X server.  This is achieved in a
+three-step protocol:
+
+       1) The client gets a token from the kernel rendering manager
+       that uniquely identifies it.  The token is a 32 bit integer.
+
+       2) The client passes the token to the X server in the
+       DRI2Authenticate request.  This request is a round trip to
+       make sure the X server has received and processed the
+       authentication before the client starts accessing the DRM.
+
+       3) The X server authorizes the client by passing the token to
+       the kernel rendering manager.
+
+A kernel rendering manager can choose not to implement any
+authentication and just allow access to all buffers.
+
+
+2.5 Rendering to the X front buffer
+
+OpenGL allows the client to render to the front buffer, either by
+using a single-buffered configuration or but explicitly setting the
+draw buffer to GL_FRONT_LEFT.  Not allowed!
+
+The client must ask for a fake front buffer, render to that and then
+use DRI2CopyRegion to copy contents back and forth between the fake
+front buffer and the real front buffer.  When X and direct rendering
+to a front buffer is interleaved, it is the responsibility of the
+application to synchronize access using glXWaitGL and glXWaitX.  A
+DRI2 implementation of direct rendering GLX, should use these enty
+points to copy contents back and forth to as necessary to ensure
+consistent rendering.
+
+The client may also use the DRI2SwapBuffers function to request a swap
+of the front and back buffers.  If the display server supports it, this
+operation may be preferred, since it may be easier and/or more performant
+for the server to perform a simple buffer swap rather than a blit.
+
+2.6 Synchronizing rendering
+
+DRI2 provides several methods for synchronizing drawing with various events.
+The protocol for these methods is based on the SGI_video_sync and
+OML_sync_control GLX extensions.  Using the DRI2WaitMSC request, a client
+can wait for a specific frame count or divisor/remainder before continuing
+its processing.  With the DRI2WaitSBC request, clients can block until a given
+swap count is reached (as incremented by DRI2SwapBuffers).  Finally, using
+DRI2SwapBuffers, clients can limit their frame rate by specifying a swap
+interval using the swap interval call (currently only available through GLX)
+or by using the OML swap buffers routine.
+
+2.7 Events
+
+DRI2 provides an event to indicate when a DRI2SwapBuffers request has
+been completed.  This can be used to throttle drawing on the client
+side and tie into application main loops.
+
+Another event is generated when the validity of the requested buffers
+changes.
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+3. Data Types
+
+The server side region support specified in the Xfixes extension
+version 2 is used in the CopyRegion request.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+4. Errors
+
+No errors are defined by the DRI2 extension.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+5. Events
+
+The only events provided by DRI2 are DRI2_BufferSwapComplete
+and DRI2InvalidateBuffers.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+6. Protocol Types
+
+DRI2DRIVER { DRI2DriverDRI
+            DRI2DriverVDPAU }
+
+       These values describe the type of driver the client will want
+       to load.  The server sends back the name of the driver to use
+       for the screen in question.
+
+DRI2ATTACHMENT { DRI2BufferFrontLeft
+                DRI2BufferBackLeft
+                DRI2BufferFrontRight
+                DRI2BufferBackRight
+                DRI2BufferDepth
+                DRI2BufferStencil
+                DRI2BufferAccum
+                DRI2BufferFakeFrontLeft
+                DRI2BufferFakeFrontRight
+                DRI2BufferDepthStencil
+                DRI2BufferHiz }
+
+       These values describe various attachment points for DRI2
+       buffers.
+
+DRI2BUFFER { attachment: CARD32
+            name: CARD32
+            pitch: CARD32
+            cpp: CARD32
+            flags: CARD32 }
+
+       The DRI2BUFFER describes an auxillary rendering buffer
+       associated with an X drawable.  'attachment' describes the
+       attachment point for the buffer, 'name' is the name of the
+       underlying kernel buffer,
+
+
+DRI2ATTACH_FORMAT { attachment: CARD32
+                   format:     CARD32 }
+
+       The DRI2ATTACH_FORMAT describes an attachment and the associated
+       format.  'attachment' describes the attachment point for the buffer,
+       'format' describes an opaque, device-dependent format for the buffer.
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+7. Extension Initialization
+
+The name of this extension is "DRI2".
+
+┌───
+    DRI2QueryVersion
+       client-major-version:   CARD32
+       client-minor-version:   CARD32
+      ▶
+       major-version:          CARD32
+       minor-version:          CARD32
+└───
+
+       The client sends the highest supported version to the server
+       and the server sends the highest version it supports, but no
+       higher than the requested version. Major versions changes can
+       introduce incompatibilities in existing functionality, minor
+       version changes introduce only backward compatible changes.
+       It is the clients responsibility to ensure that the server
+       supports a version which is compatible with its expectations.
+
+       Backwards compatible changes included addition of new
+       requests, but also new value types in the DRI2CopyRegion
+       request.  When new values are introduced, the minor version
+       will be increased so the client can know which values the X
+       server understands from the version number.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+8. Extension Requests
+
+┌───
+    DRI2Connect
+       window: WINDOW
+       driverType: DRI2DRIVER
+      ▶
+       driver: STRING
+       device: STRING
+└───
+
+       Returns the driver name and device file to use for the
+       specified driver type for the screen associated with 'window'.
+
+       'type' identifies the type of driver to query for.
+
+       'driver' is the name of the driver to load.  The client is
+       assumed to know where to look for the drivers and what to do
+       with it.
+
+       'device' is the filename of the DRM device file.
+
+       If the client is not local, or the request driver type is
+       unknown or not available, 'driver' and 'device' will be empty
+       strings.  We are not using an regular X
+       error here to indicate failure, which will allow the client
+       fall back to other options more easily.
+
+       ISSUE: We could add the list of supported attachments and the
+       supported DRI2CopyRegion values here (just the bitmask of all
+       supported values).
+       
+┌───
+    DRI2Authenticate
+       window: WINDOW
+       token: CARD32
+      ▶
+        authenticated: CARD32
+└───
+       Errors: Window
+
+       Request that the X server authenticates 'token', allowing the
+       client to access the DRM buffers created by the X server on
+       the screen associated with 'window'.
+
+       Authentication shouldn't fail at this point, except if an
+       invalid token is passed, in which case authenticated is False.
+
+┌───
+    DRI2GetBuffers
+       drawable: DRAWABLE
+       attachments: LISTofDRI2ATTACHMENTS
+      ▶      
+       width, height: CARD32
+       buffers: LISTofDRI2BUFFER
+└───
+       Errors: Window
+
+       Get buffers for the provided attachment points for the given
+       drawable.
+
+       If the DDX driver does not support one or more of the
+       specified attachment points, a Value error is generated, with
+       the first unsupported attachment point as the error value.
+
+       'width' and 'height' describes the dimensions of the drawable.
+
+       'buffers' is a list of DRI2BUFFER for the given DRI2
+       attachment points.
+
+┌───
+    DRI2CopyRegion
+       drawable: DRAWABLE
+       region: REGION
+       source: DRI2ATTACHMENT
+       destination: DRI2ATTACHMENT
+      ▶      
+└───
+       Errors: Window, Value
+
+       Schedule a copy from one DRI2 buffer to another.
+
+       The DRICopyRegion request has a reply but it is empty.  The
+       reply is there to let the direct rendering client wait until
+       the server has seen the request before proceeding with
+       rendering the next frame.
+
+┌───
+    DRI2SwapBuffers
+       drawable: DRAWABLE
+      ▶      
+       count: two CARD32s
+└───
+       Errors: Window
+
+       Schedule a swap of the front and back buffers with the display
+       server.
+
+       Returns the swap count value when the swap will actually occur (e.g.
+       the last queued swap count + (pending swap count * swap interval)).
+
+       This request is only available with protocol version 1.2 or
+       later.
+
+┌───
+    DRI2GetBuffersWithFormat
+       drawable: DRAWABLE
+       attachments: LISTofDRI2ATTACH_FORMAT
+      ▶
+       width, height: CARD32
+       buffers: LISTofDRI2BUFFER
+└───
+       Errors: Window
+
+       Get buffers for the provided attachment points with the specified
+       formats for the given drawable.
+
+       If the DDX driver does not support one or more of the
+       specified attachment points or formats, a Value error is generated,
+       with the first unsupported attachment point as the error value.
+
+       'width' and 'height' describes the dimensions of the drawable.
+
+       'buffers' is a list of DRI2BUFFER for the given DRI2
+       attachment points.
+
+       This request is only available with protocol version 1.1 or
+       later.
+
+┌───
+    DRI2GetMSC
+       drawable: DRAWABLE
+      ▶
+       ust, msc, sbc: CARD64
+└───
+       Errors: Window
+
+       Get the current media stamp counter (MSC) and swap buffer count (SBC)
+       along with the unadjusted system time (UST) when the MSC was last
+       incremented.
+
+       This request is only available with protocol version 1.2 or
+       later.
+
+┌───
+    DRI2WaitMSC
+       drawable: DRAWABLE
+       target_msc: two CARD32s
+       divisor: two CARD32s
+       remainder: two CARD32s
+      ▶
+       ust, msc, sbc: CARD64
+└───
+       Errors: Window
+
+       Blocks the client until either the frame count reaches target_msc or,
+       if the frame count is already greater than target_msc when the request
+       is received, until the frame count % divisor = remainder.  If divisor
+       is 0, the client will be unblocked if the frame count is greater than
+       or equal to the target_msc.
+
+       Returns the current media stamp counter (MSC) and swap buffer count
+       (SBC) along with the unadjusted system time (UST) when the MSC was last
+       incremented.
+
+       This request is only available with protocol version 1.2 or
+       later.
+
+┌───
+    DRI2WaitSBC
+       drawable: DRAWABLE
+       target_sbc: two CARD32s
+      ▶
+       ust, msc, sbc: CARD64
+└───
+       Errors: Window
+
+       Blocks the client until the swap buffer count reaches target_sbc.  If
+       the swap buffer count is already greater than or equal to target_sbc
+       when the request is recieved, this request will return immediately.
+
+       If target_sbc is 0, this request will block the client until all
+       previous DRI2SwapBuffers requests have completed.
+
+       Returns the current media stamp counter (MSC) and swap buffer count
+       (SBC) along with the unadjusted system time (UST) when the MSC was last
+       incremented.
+
+       This request is only available with protocol version 1.2 or
+       later.
+
+┌───
+    DRI2SwapInterval
+       drawable: DRAWABLE
+       interval: CARD32
+      ▶
+└───
+       Errors: Window
+
+       Sets the swap interval for DRAWABLE.  This will throttle
+       DRI2SwapBuffers requests to swap at most once per interval frames,
+       which is useful useful for limiting the frame rate.
+
+┌───
+    DRI2GetParam
+       drawable: DRAWABLE
+       param: CARD32
+      ▶
+       is_param_recognized: BOOL
+       value: CARD64
+└───
+       Errors: Drawable
+
+       Get the value of a parameter.  The parameter's value is looked up on
+       the screen associated with 'drawable'.
+
+       Parameter names in which the value of the most significant byte is
+       0 are reserved for the X server. Currently, no such parameter names
+       are defined. (When any such names are defined, they will be defined in
+       this extension specification and its associated headers).
+
+       Parameter names in which the byte's value is 1 are reserved for the
+       DDX. Such names are private to each driver and shall be defined in the
+       respective driver's headers.
+
+       Parameter names in which the byte's value is neither 0 nor 1 are
+       reserved for future use.
+
+       Possible values of 'is_param_recognized' are true (1) and false (0).
+       If false, then 'value' is undefined.
+
+       This request is only available with protocol version 1.4 or later.
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+9. Extension Events
+
+┌───
+    DRI2BufferSwapComplete
+      ▶
+       event_type: CARD16
+       drawable: CARD32
+       ust: CARD64
+       msc: CARD64
+       sbc: CARD64
+└───
+
+       This event reports the status of the last DRI2SwapBuffers event to
+       the client.  The event type should be one of DRI2_EXCHANGE_COMPLETE,
+       indicating a successful buffer exchange, DRI2_BLIT_COMPLETE, indicating
+       the swap was performed with a blit, and DRI2_FLIP_COMPLETE, indicating
+       a full page flip was completed.
+
+┌───
+    DRI2InvalidateBuffers
+      ▶
+       drawable: CARD32
+└───
+
+       This event is generated when the buffers the client had
+       requested for 'drawable' (with DRI2GetBuffers or
+       DRI2GetBuffersWithFormat) become inappropriate because they
+       don't match the drawable dimensions anymore, or a buffer swap
+       has been performed.
+
+       Note that the server is only required to warn the client once
+       about this condition, until the client takes care of bringing
+       them back up-to-date with another GetBuffers request.
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+10. Extension Versioning
+
+The DRI2 extension has undergone a number of revisions before
+
+       1.0: Released, but never used.  Relied on a number of
+               constructs from the XF86DRI extension, such as a
+               shared memory area (SAREA) to communicate changes in
+               cliprects and window sizes, and
+
+       1.99.1: Move the swap buffer functionality into the X server,
+               introduce SwapBuffer request to copy back buffer
+               contents to the X drawable.
+
+       1.99.2: Rethink the SwapBuffer request as an asynchronous
+               request to copy a region between DRI2 buffers.  Drop
+               CreateDrawable and DestroyDrawable, update Connect to
+               support different driver types and to send the
+               authentication group.
+
+       1.99.3: Drop the bitmask argument intended to indicate
+               presence of optional arguments for CopyRegion.
+
+       2.0: Awesomeness!
+
+       2.1: True excellence.  Added DRI2GetBuffersWithFormat to allow
+             more flexible object creation.
+
+       2.2: Approaching perfection.  Added requests for swapbuffers,
+             MSC and SBC related requests, and events.
+
+       2.3: Added the DRI2InvalidateBuffers event.
+
+       2.6: Enlightenment attained.  Added the DRI2BufferHiz attachment.
+
+       2.7: Added the DRI2GetParam request.
+
+Compatibility up to 2.0 is not preserved, but was also never released.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+11. Relationship with other extensions
+
+As an extension designed to support other extensions, there is
+naturally some interactions with other extensions.
+
+
+11.1 GLX
+
+The GL auxilary buffers map directly to the DRI2 buffers... eh
+
+
+11.2 DBE
+
+The DBE back buffer must correspond to the DRI2_BUFFER_FRONT_LEFT
+DRI2 buffer for servers that support both DBE and DRI2.
+
+
+11.3 XvMC / Xv
+
+We might add a DRI2_BUFFER_YUV to do vsynced colorspace conversion
+blits.  Maybe... not really sure.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+Appendix A. Protocol Encoding
+
+Syntactic Conventions
+
+This document uses the same syntactic conventions as the core X
+protocol encoding document.
+
+
+A.1 Common Types
+
+┌───
+    DRI2DRIVER
+       0x0     DRI2DriverDRI
+       0x1     DRI2DriverVDPAU
+└───
+
+┌───
+    DRI2ATTACHMENT
+       0x0     DRI2BufferFrontLeft
+       0x1     DRI2BufferBackLeft
+       0x2     DRI2BufferFrontRight
+       0x3     DRI2BufferBackRight
+       0x4     DRI2BufferDepth
+       0x5     DRI2BufferStencil
+       0x6     DRI2BufferAccum
+       0x7     DRI2BufferFakeFrontLeft
+       0x8     DRI2BufferFakeFrontRight
+       0x9     DRI2BufferDepthStencil
+       0xa     DRI2BufferHiz
+└───
+       Used to encode the possible attachment points.  The attachment
+       DRI2BufferDepthStencil is only available with protocol version 1.1 or
+       later.
+
+┌───
+    DRI2BUFFER
+       4       CARD32  attachment
+       4       CARD32  name
+       4       CARD32  pitch
+       4       CARD32  cpp
+       4       CARD32  flags
+└───
+       A DRI2 buffer specifies the attachment, the kernel memory
+       manager name, the pitch and chars per pixel for a buffer
+       attached to a given drawable.
+
+┌───
+    DRI2ATTACH_FORMAT
+       4       CARD32  attachment
+       4       CARD32  format
+└───
+       Used to describe the attachment and format requested from the server.
+       This data type is only available with protocol version 1.1 or
+       later.
+
+A.2 Protocol Requests
+
+┌───
+    DRI2QueryVersion
+       1       CARD8                   major opcode
+       1       0                       DRI2 opcode
+       2       3                       length
+       4       CARD32                  major version
+       4       CARD32                  minor version
+      ▶
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  major version
+        4      CARD32                  minor version
+       16                              unused  
+└───
+
+┌───
+    DRI2Connect
+       1       CARD8                   major opcode
+       1       1                       DRI2 opcode
+       2       3                       length
+       4       WINDOW                  window
+       4       CARD32                  driver type
+      ▶
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       (n+m+p+q)/4             reply length
+       4       n                       driver name length
+       4       m                       device name length
+       16                              unused
+       n       CARD8                   driver name
+       p                               unused, p=pad(n)
+       m       CARD8                   device name
+       q                               unused, q=pad(m)
+└───
+
+┌───
+    DRI2Authenticate
+       1       CARD8                   major opcode
+       1       2                       DRI2 opcode
+       2       3                       length
+       4       WINDOW                  window
+       4       CARD32                  authentication token
+      ▶
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  authenticated
+       20                              unused  
+└───
+
+┌───
+    DRI2GetBuffers
+       1       CARD8                   major opcode
+       1       5                       DRI2 opcode
+       2       3                       length
+       4       DRAWABLE                drawable
+       4       n                       number of attachments
+       4n      LISTofDRI2ATTACHMENTS   attachments
+      ▶      
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  width of drawable
+       4       CARD32                  height of drawable
+       4       CARD32                  buffer count
+       12                              unused  
+       5n      LISTofDRI2BUFFER        buffers
+└───
+
+┌───
+    DRI2CopyRegion
+       1       CARD8                   major opcode
+       1       6                       DRI2 opcode
+       2       3                       length
+       4       DRAWABLE                drawable
+       4       REGION                  region
+       4       DRI2ATTACHMENT          source
+       4       DRI2ATTACHMENT          destination
+      ▶      
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       24                              unused  
+└───
+
+┌───
+    DRI2GetBuffersWithFormat
+       1       CARD8                   major opcode
+       1       7                       DRI2 opcode
+       2       3                       length
+       4       DRAWABLE                drawable
+       4       n                       number of attachments
+       8n      LISTofDRI2ATTACH_FORMAT attachments and formats
+      ▶
+       1       1                       Reply
+       1                               unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  width of drawable
+       4       CARD32                  height of drawable
+       4       CARD32                  buffer count
+       12                              unused  
+       5n      LISTofDRI2BUFFER        buffers
+└───
+
+┌───
+    DRI2SwapBuffers
+       1       CARD8                   major opcode
+       1       8                       DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+      ▶      
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  buffer count
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       5n      LISTofDRI2BUFFER        buffers
+└───
+
+┌───
+    DRI2SwapBuffers
+       1       CARD8                   major opcode
+       1       8                       DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+       4       CARD32                  target_msc_hi
+       4       CARD32                  target_msc_lo
+       4       CARD32                  divisor_hi
+       4       CARD32                  divisor_lo
+       4       CARD32                  remainder_hi
+       4       CARD32                  remainder_lo
+      ▶      
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  swap_hi
+       4       CARD32                  swap_lo
+       5n      LISTofDRI2BUFFER        buffers
+└───
+
+┌───
+    DRI2GetMSC
+       1       CARD8                   major opcode
+       1       9                       DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+      ▶
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  ust_hi
+       4       CARD32                  ust_lo
+       4       CARD32                  msc_hi
+       4       CARD32                  msc_lo
+       4       CARD32                  sbc_hi
+       4       CARD32                  sbc_lo
+└───
+
+┌───
+    DRI2WaitMSC
+       1       CARD8                   major opcode
+       1       10                      DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+       4       CARD32                  target_msc_hi
+       4       CARD32                  target_msc_lo
+       4       CARD32                  divisor_hi
+       4       CARD32                  divisor_lo
+       4       CARD32                  remainder_hi
+       4       CARD32                  remainder_lo
+      ▶
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  ust_hi
+       4       CARD32                  ust_lo
+       4       CARD32                  msc_hi
+       4       CARD32                  msc_lo
+       4       CARD32                  sbc_hi
+       4       CARD32                  sbc_lo
+└───
+
+┌───
+    DRI2WaitSBC
+       1       CARD8                   major opcode
+       1       11                      DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+       4       CARD32                  swap_hi
+       4       CARD32                  swap_lo
+     ▶
+       1       1                       Reply
+        1                              unused
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  ust_hi
+       4       CARD32                  ust_lo
+       4       CARD32                  msc_hi
+       4       CARD32                  msc_lo
+       4       CARD32                  sbc_hi
+       4       CARD32                  sbc_lo
+└───
+
+┌───
+    DRI2SwapInterval
+       1       CARD8                   major opcode
+       1       12                      DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+       4       CARD32                  interval
+     ▶
+└───
+
+┌───
+    DRI2GetParam
+       1       CARD8                   major opcode
+       1       13                      DRI2 opcode
+       2       8                       length
+       4       DRAWABLE                drawable
+       4       CARD32                  param
+     ▶
+       1       1                       Reply
+       1       BOOL                    is_param_recognized
+       2       CARD16                  sequence number
+       4       0                       reply length
+       4       CARD32                  value_hi
+       4       CARD32                  value_lo
+       16                              unused
+└───
+
+A.3 Protocol Events
+
+The DRI2 extension specifies DRI2_BufferSwapComplete and
+DRI2_InvalidateBuffers events.
+
+┌───
+    DRI2_BufferSwapComplete
+       1       CARD8                   type
+       1       CARD8                   extension
+       2       CARD16                  sequenceNumber
+       2       CARD16                  event_type
+       4       DRAWABLE                drawable
+       4       CARD32                  ust_hi
+       4       CARD32                  ust_lo
+       4       CARD32                  msc_hi
+       4       CARD32                  msc_lo
+       4       CARD32                  sbc_hi
+       4       CARD32                  sbc_lo
+└───
+
+
+┌───
+    DRI2_InvalidateBuffers
+       1       CARD8                   type
+       1       CARD8                   extension
+       2       CARD16                  sequenceNumber
+       4       DRAWABLE                drawable
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+       4       CARD32                  unused
+└───
+
+A.4 Protocol Errors
+
+The DRI2 extension specifies no errors.
+
+
+                            ⚙ ⚙ ⚙  ⚙ ⚙ ⚙
+
+
+Appendix B. Implementation on GEM
+
+Where to begin...
diff --git a/dri2tokens.h b/dri2tokens.h
new file mode 100644 (file)
index 0000000..bdca866
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ *   Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_TOKENS_H_
+#define _DRI2_TOKENS_H_
+
+#define DRI2BufferFrontLeft            0
+#define DRI2BufferBackLeft             1
+#define DRI2BufferFrontRight           2
+#define DRI2BufferBackRight            3
+#define DRI2BufferDepth                        4
+#define DRI2BufferStencil              5
+#define DRI2BufferAccum                        6
+#define DRI2BufferFakeFrontLeft                7
+#define DRI2BufferFakeFrontRight       8
+#define DRI2BufferDepthStencil         9
+#define DRI2BufferHiz                  10
+
+/* keep bits 16 and above for prime IDs */
+#define DRI2DriverPrimeMask             7 /* 0 - 7 - allows for 6 devices*/
+#define DRI2DriverPrimeShift           16
+#define DRI2DriverPrimeId(x)         (((x) >> DRI2DriverPrimeShift) & (DRI2DriverPrimeMask))
+
+#define DRI2DriverDRI                  0
+#define DRI2DriverVDPAU                        1
+
+/* Event sub-types for the swap complete event */
+#define DRI2_EXCHANGE_COMPLETE         0x1
+#define DRI2_BLIT_COMPLETE             0x2
+#define DRI2_FLIP_COMPLETE             0x3
+
+#endif
diff --git a/packaging/xorg-x11-proto-dri2.spec b/packaging/xorg-x11-proto-dri2.spec
new file mode 100644 (file)
index 0000000..f474ea9
--- /dev/null
@@ -0,0 +1,46 @@
+Name:     xorg-x11-proto-dri2
+Summary:  X.Org X11 Protocol dri2proto
+Version:  2.8
+Release:  3
+Group:    Development/System
+License:  MIT
+URL:      http://www.x.org
+Source0:  %{name}-%{version}.tar.gz
+Provides: dri2proto
+
+BuildRequires: pkgconfig
+BuildRequires: pkgconfig(xorg-macros)
+
+# some file to be intalled can be ignored when rpm generates packages
+%define _unpackaged_files_terminate_build 0
+
+%description
+Description: %{summary}
+
+%prep
+%setup -q
+
+%build
+
+./autogen.sh
+%reconfigure --disable-static \
+             --libdir=%{_datadir} \
+             --without-xmlto
+
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%remove_docs
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{_includedir}/X11/extensions/*.h
+%{_datadir}/pkgconfig/*.pc
+