summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-04-09 21:38:37 -0700
committerKeith Packard <keithp@keithp.com>2013-04-09 21:39:54 -0700
commit92135eefc5d452f8d4f1921a778af238e6b5d1a5 (patch)
treeb2fd7e89ddd9a46952c9a9c3bf4cf4f8259ea995
parent9ab4a811fe9174cad10854da626102a64a0d5ece (diff)
Initial DRI3 protocol headers
Just getting started Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--.gitignore12
-rw-r--r--Makefile.am19
-rwxr-xr-xautogen.sh12
-rw-r--r--configure.ac13
-rw-r--r--dri3proto.h121
-rw-r--r--dri3proto.pc.in9
-rw-r--r--dri3proto.txt11
-rw-r--r--dri3tokens.h30
8 files changed, 223 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b0e3523
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache/
+config.guess
+config.log
+config.status
+config.sub
+configure
+dri3proto.pc
+install-sh
+missing
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..e989cc2
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,19 @@
+dri3dir = $(includedir)/X11/extensions
+dri3_HEADERS = dri3proto.h dri3tokens.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dri3proto.pc
+
+dist_doc_DATA = dri3proto.txt
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/autogen.sh
@@ -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 100644
index 0000000..1671e6c
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,13 @@
+AC_PREREQ([2.60])
+AC_INIT([DRI3Proto], [1.0], [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
+ dri3proto.pc])
diff --git a/dri3proto.h b/dri3proto.h
new file mode 100644
index 0000000..2f63f88
--- /dev/null
+++ b/dri3proto.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL 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 PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _DRI3_PROTO_H_
+#define _DRI3_PROTO_H_
+
+#define DRI3_NAME "DRI3"
+#define DRI3_MAJOR 1
+#define DRI3_MINOR 0
+
+#define DRI3NumberErrors 0
+#define DRI3NumberEvents 1
+#define DRI3NumberRequests 3
+
+#define X_DRI3QueryVersion 0
+#define X_DRI3Connect 1
+#define X_DRI3SelectInput 2
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri3ReqType;
+ CARD16 length B16;
+ CARD32 majorVersion B32;
+ CARD32 minorVersion B32;
+} xDRI3QueryVersionReq;
+#define sz_xDRI3QueryVersionReq 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;
+} xDRI3QueryVersionReply;
+#define sz_xDRI3QueryVersionReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri3ReqType;
+ CARD16 length B16;
+ CARD32 window B32;
+ CARD32 driverType B32;
+} xDRI3ConnectReq;
+#define sz_xDRI3ConnectReq 12
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 driverNameLength B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xDRI3ConnectReply;
+#define sz_xDRI3ConnectReply 32
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 dri3ReqType;
+ CARD16 length B16;
+ CARD32 window B32;
+ CARD32 eventMask B32;
+} xDRI3SelectInputReq;
+#define sz_xDRI3SelectInputReq 12
+
+#define DRI3AllEvents (1 << DRI3ConfigureNotify)
+
+/*
+ * Events
+ */
+#define DRI3_ConfigureNotify 0
+
+/* All DRI3 events are X Generic Events */
+
+typedef struct {
+ CARD8 type;
+ CARD8 extension;
+ CARD16 sequenceNumber B16;
+ CARD32 length;
+ CARD16 evtype B16;
+ CARD16 pad2;
+ CARD32 window B32;
+ INT16 x B16;
+ INT16 y B16;
+ CARD16 width B16;
+ CARD16 height B16;
+ INT16 off_x B16;
+ INT16 off_y B16;
+ CARD16 pixmap_width B16;
+ CARD16 pixmap_height B16;
+} xDRI3ConfigureNotify;
+#define sz_xDRI3ConfigureNotify 32
+
+#endif
diff --git a/dri3proto.pc.in b/dri3proto.pc.in
new file mode 100644
index 0000000..be8c7c6
--- /dev/null
+++ b/dri3proto.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: DRI3Proto
+Description: DRI3 extension headers
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/dri3proto.txt b/dri3proto.txt
index 085f5fb..b633d3c 100644
--- a/dri3proto.txt
+++ b/dri3proto.txt
@@ -26,8 +26,8 @@ Kristian Høgsberg <krh@bitplanet.net>
2. Data Types
-The DRI3 extension doesn't use or define any datatypes beyond the
-core X protocol.
+The DRI3 extension uses the RandR extension Provider to select among
+multiple GPUs on a single screen.
❄ ❄ ❄ ❄ ❄ ❄ ❄
@@ -87,6 +87,7 @@ The name of this extension is "DRI3" (third time is the charm?).
DRI3Open
drawable: DRAWABLE
driverType: DRI3DRIVER
+ provider: PROVIDER
driver: STRING
device: FD
@@ -94,7 +95,8 @@ The name of this extension is "DRI3" (third time is the charm?).
Errors: Drawable, Value, Match
This requests that the X server open the direct rendering
- device associated with drawable and driverType.
+ device associated with drawable, driverType and RandR
+ provider. The provider must support SourceOutput or SourceOffload.
The direct rendering library used to implement the specified
driverType is returned in the driver value. The file
@@ -233,8 +235,9 @@ A.2 Protocol Requests
DRI3Open
1 CARD8 major opcode
1 1 DRI3 opcode
- 2 3 length
+ 2 4 length
4 DRAWABLE drawable
+ 4 PROVIDER provider
4 CARD32 driver type
1 1 Reply
diff --git a/dri3tokens.h b/dri3tokens.h
new file mode 100644
index 0000000..fe93bca
--- /dev/null
+++ b/dri3tokens.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL 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 PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _DRI3_TOKENS_H_
+#define _DRI3_TOKENS_H_
+
+#define DRI3DriverDRI 0
+#define DRI3DriverVDPAU 1
+
+#define DRI3ConfigureNotify 0
+#endif