From 9ab4a811fe9174cad10854da626102a64a0d5ece Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 19 Feb 2013 15:25:20 -0800 Subject: [PATCH 01/26] Initial DRI3 protocol specification Signed-off-by: Keith Packard --- dri3proto.txt | 296 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 dri3proto.txt diff --git a/dri3proto.txt b/dri3proto.txt new file mode 100644 index 0000000..085f5fb --- /dev/null +++ b/dri3proto.txt @@ -0,0 +1,296 @@ + The DRI3 Extension + Version 1.0 + 2013-2-19 + + Keith Packard + keithp@keithp.com + Intel Corporation + +1. Introduction + +The DRI3 extension provides mechanisms to translate between direct +rendered buffers and X pixmaps. When combined with the Swap extension, +a complete direct rendering solution for OpenGL is provided. + +The direct rendered buffers are passed across the protocol via +standard POSIX file descriptor passing mechanisms. On Linux, these +buffers are DMA-BUF objects. + +1.1. Acknowledgments + +Eric Anholt +Dave Airlie +Kristian Høgsberg + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +2. Data Types + +The DRI3 extension doesn't use or define any datatypes beyond the +core X protocol. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +4. Errors + +No errors are defined by the DRI3 extension. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +5. Events + +No events are defined by the DRI3 extension. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +6. Protocol Types + +DRI3DRIVER { DRI3DriverDRI + DRI3DriverVDPAU } + + 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. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +7. Extension Initialization + +The name of this extension is "DRI3" (third time is the charm?). + +┌─── + DRI3QueryVersion + 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. + + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +8. Extension Requests + +┌─── + DRI3Open + drawable: DRAWABLE + driverType: DRI3DRIVER + ▶ + driver: STRING + device: FD +└─── + Errors: Drawable, Value, Match + + This requests that the X server open the direct rendering + device associated with drawable and driverType. + + The direct rendering library used to implement the specified + driverType is returned in the driver value. The file + descriptor for the device is returned in FD. + +┌─── + DRI3PixmapFromBuffer + pixmap: PIXMAP + drawable: DRAWABLE + width, height, stride: CARD16 + depth, bpp: CARD8 + buffer: FD +└─── + Errors: Alloc, Drawable, IDChoice, Value, Match + + Creates a pixmap for the direct rendering object associated + with buffer. width, height and stride specify the geometry (in + pixels) of the underlying buffer. The pixels within the buffer + may not be arranged in a simple linear fashion, but the total + byte size of the buffer must be height * stride * bpp / + 8. Precisely how any additional information about the buffer + is shared is outside the scope of this extension. + + If buffer cannot be used with the screen associated with + drawable, a Match error is returned. + + If depth or bpp are not supported by the screen, a Value error + is returned. + +┌─── + DRI3BufferFromPixmap + pixmap: PIXMAP + ▶ + depth: CARD8 + width, height, stride: CARD16 + depth, bpp: CARD8 + buffer: FD +└─── + Errors: Pixmap, Match + + Pass back a direct rendering object associated with + pixmap. Future changes to pixmap will be visible in that + direct rendered object. + + The pixel format and geometry of the buffer are returned along + with a file descriptor referencing the underlying direct + rendering object. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +9. Extension Events + +The DRI3 extension defines no events + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +10. Extension Versioning + +The DRI3 extension is adapted from the DRI2 extension. + + 1.0: First published version + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + + +11. Relationship with other extensions + +As an extension designed to support other extensions, there is +naturally some interactions with other extensions. + +11.1 GLX + +GLX has no direct relation with DRI3, but a direct rendering OpenGL +application will presumably use both, and target + +11.2 Swap + +The Swap extension provides a way to synchronize the display of pixmap +contents to the screen. When used in conjunction with DRI3, they +provide a complete direct rendering solution for OpenGL or other APIs. + +11.3 DRI2 + +DRI3 provides similar functionality to the DRI2Connect and +DRI2GetBuffersWithFormat requests, however DRI3 uses file descriptors +to refer to the direct rendering device and buffers. + +Swap and DRI3 are designed in conjunction to replace DRI2 + +11.2 XvMC / Xv + +It might be nice to be able to reference YUV formatted direct rendered +objects from the X server. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +Appendix A. Protocol Encoding + +Syntactic Conventions + +This document uses the same syntactic conventions as the core X +protocol encoding document. + + +A.1 Common Types + +┌─── + DRI3DRIVER + 0x0 DRI3DriverDRI + 0x1 DRI3DriverVDPAU +└─── + + Note that these match the DRI2 values. + +A.2 Protocol Requests + +┌─── + DRI3QueryVersion + 1 CARD8 major opcode + 1 0 DRI3 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 +└─── + + +┌─── + DRI3Open + 1 CARD8 major opcode + 1 1 DRI3 opcode + 2 3 length + 4 DRAWABLE drawable + 4 CARD32 driver type + ▶ + 1 1 Reply + 1 CARD8 n + 2 CARD16 sequence number + 4 (n + p) / 4 reply length + n CARD8 driver name + p unused, p=pad(n) + + 0 FD device +└─── + +┌─── + DRI3PixmapFromBuffer + 1 CARD8 major opcode + 1 2 DRI3 opcode + 2 5 length + 4 Pixmap pixmap + 4 Drawable drawable + 2 CARD16 width + 2 CARD16 height + 2 CARD16 stride + 1 CARD8 depth + 1 CARD8 bpp + + 0 FD buffer +└─── + +┌─── + DRI3BufferFromPixmap + 1 CARD8 major opcode + 1 3 DRI3 opcode + 2 length + 4 Pixmap pixmap + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 width + 2 CARD16 height + 2 CARD16 stride + 1 CARD8 depth + 1 CARD8 bpp + 16 unused + + 0 FD buffer +└─── + + +A.3 Protocol Events + +The DRI3 extension defines no events + +A.4 Protocol Errors + +The Swap extension defines no errors. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ From 92135eefc5d452f8d4f1921a778af238e6b5d1a5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 9 Apr 2013 21:38:37 -0700 Subject: [PATCH 02/26] Initial DRI3 protocol headers Just getting started Signed-off-by: Keith Packard --- .gitignore | 12 +++++ Makefile.am | 19 ++++++++ autogen.sh | 12 +++++ configure.ac | 13 ++++++ dri3proto.h | 121 ++++++++++++++++++++++++++++++++++++++++++++++++ dri3proto.pc.in | 9 ++++ dri3proto.txt | 11 +++-- dri3tokens.h | 30 ++++++++++++ 8 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 dri3proto.h create mode 100644 dri3proto.pc.in create mode 100644 dri3tokens.h 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 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 From 9998b10076e98e04188cb28dea13252dfae2757d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 11 Apr 2013 19:06:58 -0700 Subject: [PATCH 03/26] Add 'event id' to DRI3 configure notify events This allows multiple subsystems within the application to all separately control event delivery. Yes, it could be done client-side, but it's way easier in the server. Signed-off-by: Keith Packard --- dri3proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dri3proto.h b/dri3proto.h index 2f63f88..6fb2cc9 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -85,6 +85,7 @@ typedef struct { CARD8 reqType; CARD8 dri3ReqType; CARD16 length B16; + CARD32 eid B32; CARD32 window B32; CARD32 eventMask B32; } xDRI3SelectInputReq; @@ -106,6 +107,7 @@ typedef struct { CARD32 length; CARD16 evtype B16; CARD16 pad2; + CARD32 eid B32; CARD32 window B32; INT16 x B16; INT16 y B16; @@ -116,6 +118,6 @@ typedef struct { CARD16 pixmap_width B16; CARD16 pixmap_height B16; } xDRI3ConfigureNotify; -#define sz_xDRI3ConfigureNotify 32 +#define sz_xDRI3ConfigureNotify 36 #endif From ef3eca70549719bd30b35f5d703727dd29b849b1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 8 May 2013 12:30:22 -0700 Subject: [PATCH 04/26] Add GetSyncShmFD request Returns a file descriptor for a shared memory segment containing a sync fence object. Signed-off-by: Keith Packard --- dri3proto.h | 30 ++++++++++++++++++++++++++++-- dri3tokens.h | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dri3proto.h b/dri3proto.h index 6fb2cc9..7e8eae8 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -28,12 +28,14 @@ #define DRI3_MINOR 0 #define DRI3NumberErrors 0 -#define DRI3NumberEvents 1 -#define DRI3NumberRequests 3 +#define DRI3NumberEvents 0 #define X_DRI3QueryVersion 0 #define X_DRI3Connect 1 #define X_DRI3SelectInput 2 +#define X_DRI3GetSyncShmFD 3 + +#define DRI3NumberRequests 4 typedef struct { CARD8 reqType; @@ -93,6 +95,30 @@ typedef struct { #define DRI3AllEvents (1 << DRI3ConfigureNotify) +typedef struct { + CARD8 reqType; + CARD8 dri3ReqType; + CARD16 length B16; + CARD32 syncFence B32; + CARD32 window B32; +} xDRI3GetSyncFenceFd; + +#define sz_xDRI3GetSyncFenceFd 12 + +typedef struct { + BYTE type; /* X_Reply */ + CARD8 nfd; /* Number of file descriptors returned (1) */ + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; + CARD32 pad7 B32; +} xDRI3GetSyncFenceFdReply; +#define sz_xDRI3GetSyncFenceFdReply 32 + /* * Events */ diff --git a/dri3tokens.h b/dri3tokens.h index fe93bca..82c1409 100644 --- a/dri3tokens.h +++ b/dri3tokens.h @@ -27,4 +27,5 @@ #define DRI3DriverVDPAU 1 #define DRI3ConfigureNotify 0 + #endif From f078e7fe0685573268f8d2cf5a473ff2d2344d1d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 13 May 2013 16:35:04 -0700 Subject: [PATCH 05/26] Rename Connect as Open, make it work. Add SHM SyncFences Signed-off-by: Keith Packard --- dri3proto.h | 15 ++++++++------- dri3proto.txt | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/dri3proto.h b/dri3proto.h index 7e8eae8..3d44388 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -31,7 +31,7 @@ #define DRI3NumberEvents 0 #define X_DRI3QueryVersion 0 -#define X_DRI3Connect 1 +#define X_DRI3Open 1 #define X_DRI3SelectInput 2 #define X_DRI3GetSyncShmFD 3 @@ -64,14 +64,15 @@ typedef struct { CARD8 reqType; CARD8 dri3ReqType; CARD16 length B16; - CARD32 window B32; + CARD32 drawable B32; CARD32 driverType B32; -} xDRI3ConnectReq; -#define sz_xDRI3ConnectReq 12 + CARD32 provider B32; +} xDRI3OpenReq; +#define sz_xDRI3OpenReq 16 typedef struct { BYTE type; /* X_Reply */ - BYTE pad1; + CARD8 nfd; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 driverNameLength B32; @@ -80,8 +81,8 @@ typedef struct { CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; -} xDRI3ConnectReply; -#define sz_xDRI3ConnectReply 32 +} xDRI3OpenReply; +#define sz_xDRI3OpenReply 32 typedef struct { CARD8 reqType; diff --git a/dri3proto.txt b/dri3proto.txt index b633d3c..bc3d0bf 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -89,6 +89,7 @@ The name of this extension is "DRI3" (third time is the charm?). driverType: DRI3DRIVER provider: PROVIDER ▶ + nfd: CARD8 driver: STRING device: FD └─── @@ -145,6 +146,21 @@ The name of this extension is "DRI3" (third time is the charm?). with a file descriptor referencing the underlying direct rendering object. +┌─── + DRI3GetSyncFenceFd + fence: FENCE + window: WINDOW + ▶ + nfd: CARD8 + fd: FD +└─── + Errors: Fence, Match + + Pass back a shared memory segment associated with a sync fence + object. Pass this fd to the XShmFence library to map and + manipulate the fence. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ 9. Extension Events From 7fd74d6ad8c76d50dc347edc083a921a87d7ab0d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 31 May 2013 12:02:16 -0700 Subject: [PATCH 06/26] Add PixmapFromBuffer and BufferFromPixmap encodings Signed-off-by: Keith Packard --- dri3proto.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- dri3tokens.h | 4 ++++ 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/dri3proto.h b/dri3proto.h index 3d44388..77ee8e9 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -32,10 +32,12 @@ #define X_DRI3QueryVersion 0 #define X_DRI3Open 1 -#define X_DRI3SelectInput 2 -#define X_DRI3GetSyncShmFD 3 +#define X_DRI3PixmapFromBuffer 2 +#define X_DRI3BufferFromPixmap 3 +#define X_DRI3SelectInput 4 +#define X_DRI3GetSyncFenceFD 5 -#define DRI3NumberRequests 4 +#define DRI3NumberRequests 6 typedef struct { CARD8 reqType; @@ -84,6 +86,46 @@ typedef struct { } xDRI3OpenReply; #define sz_xDRI3OpenReply 32 +typedef struct { + CARD8 reqType; + CARD8 dri3ReqType; + CARD16 length B16; + CARD32 pixmap B32; + CARD32 drawable B32; + CARD16 width B16; + CARD16 height B16; + CARD16 stride B16; + CARD8 depth; + CARD8 bpp; +} xDRI3PixmapFromBufferReq; + +#define sz_xDRI3PixmapFromBufferReq 20 + +typedef struct { + CARD8 reqType; + CARD8 dri3ReqType; + CARD16 length B16; + CARD32 pixmap B32; +} xDRI3BufferFromPixmapReq; +#define sz_xDRI3BufferFromPixmapReq 8 + +typedef struct { + BYTE type; /* X_Reply */ + CARD8 nfd; /* Number of file descriptors returned (1) */ + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 width B16; + CARD16 height B16; + CARD16 stride B16; + CARD8 depth; + CARD8 bpp; + CARD32 pad16; + CARD32 pad20; + CARD32 pad24; + CARD32 pad28; +} xDRI3BufferFromPixmapReply; +#define sz_xDRI3BufferFromPixmapReply 32 + typedef struct { CARD8 reqType; CARD8 dri3ReqType; @@ -144,7 +186,8 @@ typedef struct { INT16 off_y B16; CARD16 pixmap_width B16; CARD16 pixmap_height B16; + CARD32 pixmap_flags B32; } xDRI3ConfigureNotify; -#define sz_xDRI3ConfigureNotify 36 +#define sz_xDRI3ConfigureNotify 40 #endif diff --git a/dri3tokens.h b/dri3tokens.h index 82c1409..fab7143 100644 --- a/dri3tokens.h +++ b/dri3tokens.h @@ -28,4 +28,8 @@ #define DRI3ConfigureNotify 0 +#define DRI3PixmapScanout 0x00000001 + +#define DRI3PixmapDriverMask 0xffff0000 + #endif From 58ece91deea5fcfaae9ecc098d53294171f5acb8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 2 Jun 2013 16:29:08 -0700 Subject: [PATCH 07/26] Return buffer size in BufferFromPixmap reply The kernel doesn't provide an API to discover the size, so just pass it back in the protocol Signed-off-by: Keith Packard --- dri3proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dri3proto.h b/dri3proto.h index 77ee8e9..ec58ec0 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -119,7 +119,7 @@ typedef struct { CARD16 stride B16; CARD8 depth; CARD8 bpp; - CARD32 pad16; + CARD32 size; CARD32 pad20; CARD32 pad24; CARD32 pad28; From fbb449d411888ce09cae452c823db054cfef2ccd Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 4 Jun 2013 13:28:29 -0700 Subject: [PATCH 08/26] Switch direction of FD passing for Sync Fences Pass FD from client to server to avoid a round trip. Signed-off-by: Keith Packard --- dri3proto.h | 38 ++++++--------- dri3proto.txt | 126 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 119 insertions(+), 45 deletions(-) diff --git a/dri3proto.h b/dri3proto.h index ec58ec0..2b7821c 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -35,7 +35,7 @@ #define X_DRI3PixmapFromBuffer 2 #define X_DRI3BufferFromPixmap 3 #define X_DRI3SelectInput 4 -#define X_DRI3GetSyncFenceFD 5 +#define X_DRI3FenceFromFD 5 #define DRI3NumberRequests 6 @@ -92,6 +92,7 @@ typedef struct { CARD16 length B16; CARD32 pixmap B32; CARD32 drawable B32; + CARD32 size B32; CARD16 width B16; CARD16 height B16; CARD16 stride B16; @@ -99,7 +100,7 @@ typedef struct { CARD8 bpp; } xDRI3PixmapFromBufferReq; -#define sz_xDRI3PixmapFromBufferReq 20 +#define sz_xDRI3PixmapFromBufferReq 24 typedef struct { CARD8 reqType; @@ -114,15 +115,15 @@ typedef struct { CARD8 nfd; /* Number of file descriptors returned (1) */ CARD16 sequenceNumber B16; CARD32 length B32; + CARD32 size B32; CARD16 width B16; CARD16 height B16; CARD16 stride B16; CARD8 depth; CARD8 bpp; - CARD32 size; - CARD32 pad20; - CARD32 pad24; - CARD32 pad28; + CARD32 pad20 B32; + CARD32 pad24 B32; + CARD32 pad28 B32; } xDRI3BufferFromPixmapReply; #define sz_xDRI3BufferFromPixmapReply 32 @@ -142,25 +143,14 @@ typedef struct { CARD8 reqType; CARD8 dri3ReqType; CARD16 length B16; - CARD32 syncFence B32; - CARD32 window B32; -} xDRI3GetSyncFenceFd; + CARD32 drawable B32; + CARD32 fence B32; + BOOL initially_triggered; + CARD8 pad13; + CARD16 pad14 B16; +} xDRI3FenceFromFDReq; -#define sz_xDRI3GetSyncFenceFd 12 - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 nfd; /* Number of file descriptors returned (1) */ - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; - CARD32 pad7 B32; -} xDRI3GetSyncFenceFdReply; -#define sz_xDRI3GetSyncFenceFdReply 32 +#define sz_xDRI3FenceFromFDReq 16 /* * Events diff --git a/dri3proto.txt b/dri3proto.txt index bc3d0bf..38b92e5 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -16,18 +16,32 @@ The direct rendered buffers are passed across the protocol via standard POSIX file descriptor passing mechanisms. On Linux, these buffers are DMA-BUF objects. +DRI3 also includes a mechanism to translate between Linux Futexes +and X Sync extension Fences. This provides a synchronization mechanism +which can be used to serialize access to shared render buffers. + 1.1. Acknowledgments Eric Anholt Dave Airlie Kristian Høgsberg +James Jones ❄ ❄ ❄ ❄ ❄ ❄ ❄ 2. Data Types -The DRI3 extension uses the RandR extension Provider to select among -multiple GPUs on a single screen. +DRI3EVENTID { XID } + + Defines a unique event delivery target for DRI3 + events. Multiple event IDs can be allocated to provide + multiple distinct event delivery contexts. + +DRI3EVENTMASK { DRI3ConfigureNotifyMask } + +The DRI3 extension also uses the RandR extension Provider data type to +select among multiple GPUs on a single screen and the Sync extension +fence object to provide graphics object synchronization. ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -39,7 +53,9 @@ No errors are defined by the DRI3 extension. 5. Events -No events are defined by the DRI3 extension. +DRI3 adds a ConfigureNotify event to inform clients about window +configuration changes which can affect the allocation of +window-related direct rendered buffers. ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -56,7 +72,7 @@ DRI3DRIVER { DRI3DriverDRI 7. Extension Initialization -The name of this extension is "DRI3" (third time is the charm?). +The name of this extension is "DRI3" ┌─── DRI3QueryVersion @@ -100,13 +116,17 @@ The name of this extension is "DRI3" (third time is the charm?). 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 - descriptor for the device is returned in FD. + 'driverType' is returned in 'driver'. The file + descriptor for the device is returned in 'device'. 'nfd' will + be set to one (this is strictly a convenience for XCB which + otherwise would need request-specific information about how + many file descriptors were associated with this reply). ┌─── DRI3PixmapFromBuffer pixmap: PIXMAP drawable: DRAWABLE + size: CARD32 width, height, stride: CARD16 depth, bpp: CARD8 buffer: FD @@ -114,12 +134,19 @@ The name of this extension is "DRI3" (third time is the charm?). Errors: Alloc, Drawable, IDChoice, Value, Match Creates a pixmap for the direct rendering object associated - with buffer. width, height and stride specify the geometry (in - pixels) of the underlying buffer. The pixels within the buffer - may not be arranged in a simple linear fashion, but the total - byte size of the buffer must be height * stride * bpp / - 8. Precisely how any additional information about the buffer - is shared is outside the scope of this extension. + with 'buffer'. Changes to pixmap will be visible in that + direct rendered object and changes to the direct rendered + object will be visible in the pixmap. + + 'size' specifies the total size of the buffer bytes. 'width', + 'height' describe the geometry (in pixels) of the underlying + buffer. 'stride' specifies the number of bytes per scanline in + the buffer. The pixels within the buffer may not be arranged + in a simple linear fashion, but 'size' will be at least + 'height' * 'stride'. + + Precisely how any additional information about the buffer is + shared is outside the scope of this extension. If buffer cannot be used with the screen associated with drawable, a Match error is returned. @@ -132,6 +159,7 @@ The name of this extension is "DRI3" (third time is the charm?). pixmap: PIXMAP ▶ depth: CARD8 + size: CARD32 width, height, stride: CARD16 depth, bpp: CARD8 buffer: FD @@ -139,12 +167,45 @@ The name of this extension is "DRI3" (third time is the charm?). Errors: Pixmap, Match Pass back a direct rendering object associated with - pixmap. Future changes to pixmap will be visible in that - direct rendered object. + pixmap. Changes to pixmap will be visible in that + direct rendered object and changes to the direct rendered + object will be visible in the pixmap. - The pixel format and geometry of the buffer are returned along - with a file descriptor referencing the underlying direct - rendering object. + 'size' specifies the total size of the buffer bytes. 'width', + 'height' describe the geometry (in pixels) of the underlying + buffer. 'stride' specifies the number of bytes per scanline in + the buffer. The pixels within the buffer may not be arranged + in a simple linear fashion, but 'size' will be at least + 'height' * 'stride'. + + Precisely how any additional information about the buffer is + shared is outside the scope of this extension. + + If buffer cannot be used with the screen associated with + drawable, a Match error is returned. + +┌─── + DRI3SelectInput + eventContext: DRI3EVENTID + window: WINDOW + eventMask: SETofDRI3EVENT +└─── + Errors: Window, Value, Match, IDchoice + + Selects the set of DRI3 events to be delivered for the + specified window and event context. DRI3SelectInput can + create, modifiy or delete event contexts. An event context is + associated with a specific window; using an existing event + context with a different window generates a Match error. + + If eventContext specifies an existing event context, then if + eventMask is empty, DRI3SelectInput deletes the specified + context, otherwise the specified event context is changed to + select a different set of events. + + If eventContext is an unused XID, then if eventMask is empty + no operation is performed. Otherwise, a new event context is + created selecting the specified events. ┌─── DRI3GetSyncFenceFd @@ -156,16 +217,39 @@ The name of this extension is "DRI3" (third time is the charm?). └─── Errors: Fence, Match - Pass back a shared memory segment associated with a sync fence - object. Pass this fd to the XShmFence library to map and - manipulate the fence. + Pass back a device-specific file descriptor associated with an + X Sync extension fence object. Details about the mechanism + used with this file are outside the scope of the DRI3 extension. ❄ ❄ ❄ ❄ ❄ ❄ ❄ 9. Extension Events -The DRI3 extension defines no events +DRI3ConfigureNotify is sent if DRI3SelectInput has requested it. +DRI3ConfigureNotify events are XGE events and so do not have a unique +event ID. + +┌─── + DRI3ConfigureNotify + type: CARD8 XGE event type (35) + extension: CARD8 DRI3 extension request number + length: CARD16 2 + evtype: CARD16 DRI3_ConfigureNotify + eventID: DRI3EVENTID + window: WINDOW + x: INT16 + y: INT16 + width: CARD16 + height: CARD16 + off_x: INT16 + off_y: INT16 + pixmap_width: CARD16 + pixmap_height: CARD16 + pixmap_flags: CARD32 +└─── + + 'x' and 'y' are the parent-relative location of 'window'. ❄ ❄ ❄ ❄ ❄ ❄ ❄ From bf7c7d373e326276dc59554fb2e3a60c384c4270 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 4 Jun 2013 15:19:34 -0700 Subject: [PATCH 09/26] Pass Fence FDS from client. Clean up encoding. Signed-off-by: Keith Packard --- dri3proto.txt | 78 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/dri3proto.txt b/dri3proto.txt index 38b92e5..2c1c8b3 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -158,7 +158,7 @@ The name of this extension is "DRI3" DRI3BufferFromPixmap pixmap: PIXMAP ▶ - depth: CARD8 + nfd: CARD8 size: CARD32 width, height, stride: CARD16 depth, bpp: CARD8 @@ -208,18 +208,19 @@ The name of this extension is "DRI3" created selecting the specified events. ┌─── - DRI3GetSyncFenceFd + DRI3FenceFromFD + drawable: DRAWABLE fence: FENCE - window: WINDOW - ▶ - nfd: CARD8 + initially-triggered: BOOL fd: FD └─── - Errors: Fence, Match + Errors: IDchoice, Drawable - Pass back a device-specific file descriptor associated with an - X Sync extension fence object. Details about the mechanism - used with this file are outside the scope of the DRI3 extension. + Creates a Sync extension Fence that provides the regular Sync + extension semantics along with a file descriptor that provides + a device-specific mechanism to manipulate the fence directly. + Details about the mechanism used with this file descriptor are + outside the scope of the DRI3 extension. ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -337,13 +338,15 @@ A.2 Protocol Requests 1 1 DRI3 opcode 2 4 length 4 DRAWABLE drawable - 4 PROVIDER provider 4 CARD32 driver type + 4 PROVIDER provider ▶ 1 1 Reply - 1 CARD8 n + 1 1 nfd 2 CARD16 sequence number 4 (n + p) / 4 reply length + 4 n driver name length (n) + 20 unused n CARD8 driver name p unused, p=pad(n) @@ -354,9 +357,10 @@ A.2 Protocol Requests DRI3PixmapFromBuffer 1 CARD8 major opcode 1 2 DRI3 opcode - 2 5 length + 2 6 length 4 Pixmap pixmap 4 Drawable drawable + 4 CARD32 size 2 CARD16 width 2 CARD16 height 2 CARD16 stride @@ -370,27 +374,69 @@ A.2 Protocol Requests DRI3BufferFromPixmap 1 CARD8 major opcode 1 3 DRI3 opcode - 2 length + 2 2 length 4 Pixmap pixmap ▶ 1 1 Reply - 1 unused + 1 1 nfd 2 CARD16 sequence number 4 0 reply length + 4 CARD32 size 2 CARD16 width 2 CARD16 height 2 CARD16 stride 1 CARD8 depth 1 CARD8 bpp - 16 unused + 12 unused 0 FD buffer └─── +┌─── + DRI3SelectInput + 1 CARD8 major opcode + 1 4 DRI3 opcode + 2 3 length + 4 Window window + 4 CARD32 eid + 4 CARD32 event mask +└─── + +┌─── + DRI3FenceFromFD + 1 CARD8 major opcode + 1 5 DRI3 opcode + 2 4 length + 4 Drawable drawable + 4 Fence fence + 1 BOOL initially triggered + 3 unused + + 0 FD fence fd +└─── A.3 Protocol Events -The DRI3 extension defines no events +┌─── + RRScreenChangeNotify + 1 35 XGE + 1 CARD8 DRI3 extension opcode + 2 CARD16 sequence number + 4 2 length + 2 0 DRI3ConfigureNotify + 2 unused + 4 CARD32 event id + 4 Window window + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 INT16 off x + 2 INT16 off y + 2 CARD16 pixmap width + 2 CARD16 pixmap height + 4 CARD32 pixmap flags +└─── A.4 Protocol Errors From 1694dc2781e6979de1654592bc72ef1782e485ec Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 4 Jun 2013 16:49:39 -0700 Subject: [PATCH 10/26] Rename Swap to Present Signed-off-by: Keith Packard --- dri3proto.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dri3proto.txt b/dri3proto.txt index 2c1c8b3..c9a7676 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -9,7 +9,7 @@ 1. Introduction The DRI3 extension provides mechanisms to translate between direct -rendered buffers and X pixmaps. When combined with the Swap extension, +rendered buffers and X pixmaps. When combined with the Present extension, a complete direct rendering solution for OpenGL is provided. The direct rendered buffers are passed across the protocol via @@ -273,9 +273,9 @@ naturally some interactions with other extensions. GLX has no direct relation with DRI3, but a direct rendering OpenGL application will presumably use both, and target -11.2 Swap +11.2 Present -The Swap extension provides a way to synchronize the display of pixmap +The Present extension provides a way to synchronize the display of pixmap contents to the screen. When used in conjunction with DRI3, they provide a complete direct rendering solution for OpenGL or other APIs. @@ -285,7 +285,7 @@ DRI3 provides similar functionality to the DRI2Connect and DRI2GetBuffersWithFormat requests, however DRI3 uses file descriptors to refer to the direct rendering device and buffers. -Swap and DRI3 are designed in conjunction to replace DRI2 +Present and DRI3 are designed in conjunction to replace DRI2 11.2 XvMC / Xv @@ -440,6 +440,6 @@ A.3 Protocol Events A.4 Protocol Errors -The Swap extension defines no errors. +The DRI3 extension defines no errors. ❄ ❄ ❄ ❄ ❄ ❄ ❄ From c8eb5c651f39fcedb725c8868def75906a400b64 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 4 Jun 2013 16:51:05 -0700 Subject: [PATCH 11/26] Re-center the version and date lines Signed-off-by: Keith Packard --- dri3proto.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dri3proto.txt b/dri3proto.txt index c9a7676..236dab1 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -1,6 +1,6 @@ The DRI3 Extension - Version 1.0 - 2013-2-19 + Version 1.0 + 2013-6-4 Keith Packard keithp@keithp.com From ac4071c916fb91ac125d9495d57e4d9656f14afb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 4 Jun 2013 17:34:23 -0700 Subject: [PATCH 12/26] Clarify relationship with GLX Signed-off-by: Keith Packard --- dri3proto.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dri3proto.txt b/dri3proto.txt index 236dab1..0c5f7d8 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -270,8 +270,9 @@ naturally some interactions with other extensions. 11.1 GLX -GLX has no direct relation with DRI3, but a direct rendering OpenGL -application will presumably use both, and target +GLX is both an application interface and an X extension. OpenGL +applications using the GLX API will use the GLX extension, DRI3 and +Present when doing direct rendering. 11.2 Present From d40b6e0297ee54919f654b905853d389ff766de1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 7 Jun 2013 09:48:55 -0700 Subject: [PATCH 13/26] Re-word the caution about pixmap image formats non linearity Suggested by Arthur Huillet Signed-off-by: Keith Packard --- dri3proto.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dri3proto.txt b/dri3proto.txt index 0c5f7d8..3489a5c 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -26,6 +26,7 @@ Eric Anholt Dave Airlie Kristian Høgsberg James Jones +Arthur Huillet ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -141,9 +142,9 @@ The name of this extension is "DRI3" 'size' specifies the total size of the buffer bytes. 'width', 'height' describe the geometry (in pixels) of the underlying buffer. 'stride' specifies the number of bytes per scanline in - the buffer. The pixels within the buffer may not be arranged - in a simple linear fashion, but 'size' will be at least - 'height' * 'stride'. + the buffer. The pixels within the buffer are not required to + be arranged in a simple linear fashion, but 'size' will be at + least 'height' * 'stride'. Precisely how any additional information about the buffer is shared is outside the scope of this extension. @@ -174,9 +175,9 @@ The name of this extension is "DRI3" 'size' specifies the total size of the buffer bytes. 'width', 'height' describe the geometry (in pixels) of the underlying buffer. 'stride' specifies the number of bytes per scanline in - the buffer. The pixels within the buffer may not be arranged - in a simple linear fashion, but 'size' will be at least - 'height' * 'stride'. + the buffer. The pixels within the buffer are not required to + be arranged in a simple linear fashion, but 'size' will be at + least 'height' * 'stride'. Precisely how any additional information about the buffer is shared is outside the scope of this extension. @@ -419,7 +420,7 @@ A.2 Protocol Requests A.3 Protocol Events ┌─── - RRScreenChangeNotify + DRI3ConfigureNotify 1 35 XGE 1 CARD8 DRI3 extension opcode 2 CARD16 sequence number From 66d339c11281b88212d55b4017e1fc7ca549e314 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 20 Jun 2013 12:09:46 -0700 Subject: [PATCH 14/26] Eliminate driverType and driverName from Open request Make application figure out the right driver on its own. Signed-off-by: Keith Packard --- dri3proto.h | 5 ++--- dri3proto.txt | 17 +++++++---------- dri3tokens.h | 3 --- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/dri3proto.h b/dri3proto.h index 2b7821c..8abf0be 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -67,22 +67,21 @@ typedef struct { CARD8 dri3ReqType; CARD16 length B16; CARD32 drawable B32; - CARD32 driverType B32; CARD32 provider B32; } xDRI3OpenReq; -#define sz_xDRI3OpenReq 16 +#define sz_xDRI3OpenReq 12 typedef struct { BYTE type; /* X_Reply */ CARD8 nfd; CARD16 sequenceNumber B16; CARD32 length B32; - CARD32 driverNameLength B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; + CARD32 pad7 B32; } xDRI3OpenReply; #define sz_xDRI3OpenReply 32 diff --git a/dri3proto.txt b/dri3proto.txt index 3489a5c..b73e9bb 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -103,25 +103,22 @@ The name of this extension is "DRI3" ┌─── DRI3Open drawable: DRAWABLE - driverType: DRI3DRIVER provider: PROVIDER ▶ nfd: CARD8 - driver: STRING device: FD └─── Errors: Drawable, Value, Match This requests that the X server open the direct rendering - device associated with drawable, driverType and RandR - provider. The provider must support SourceOutput or SourceOffload. + device associated with drawable and RandR provider. The + provider must support SourceOutput or SourceOffload. - The direct rendering library used to implement the specified - 'driverType' is returned in 'driver'. The file - descriptor for the device is returned in 'device'. 'nfd' will - be set to one (this is strictly a convenience for XCB which - otherwise would need request-specific information about how - many file descriptors were associated with this reply). + The file descriptor for the device is returned in + 'device'. 'nfd' will be set to one (this is strictly a + convenience for XCB which otherwise would need + request-specific information about how many file descriptors + were associated with this reply). ┌─── DRI3PixmapFromBuffer diff --git a/dri3tokens.h b/dri3tokens.h index fab7143..5eebe4d 100644 --- a/dri3tokens.h +++ b/dri3tokens.h @@ -23,9 +23,6 @@ #ifndef _DRI3_TOKENS_H_ #define _DRI3_TOKENS_H_ -#define DRI3DriverDRI 0 -#define DRI3DriverVDPAU 1 - #define DRI3ConfigureNotify 0 #define DRI3PixmapScanout 0x00000001 From a5392ea74a9b9e39de7b5c8107e68d0bb3724d77 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 Jul 2013 10:26:44 -0700 Subject: [PATCH 15/26] Remove events and other unused elements This renumbers the FenceFromFD request from 5 to 4 as well Signed-off-by: Keith Packard --- Makefile.am | 2 +- dri3proto.h | 45 +------------------- dri3proto.txt | 112 ++++---------------------------------------------- dri3tokens.h | 32 --------------- 4 files changed, 11 insertions(+), 180 deletions(-) delete mode 100644 dri3tokens.h diff --git a/Makefile.am b/Makefile.am index e989cc2..7a85bf1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ dri3dir = $(includedir)/X11/extensions -dri3_HEADERS = dri3proto.h dri3tokens.h +dri3_HEADERS = dri3proto.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = dri3proto.pc diff --git a/dri3proto.h b/dri3proto.h index 8abf0be..02ea929 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -34,10 +34,9 @@ #define X_DRI3Open 1 #define X_DRI3PixmapFromBuffer 2 #define X_DRI3BufferFromPixmap 3 -#define X_DRI3SelectInput 4 -#define X_DRI3FenceFromFD 5 +#define X_DRI3FenceFromFD 4 -#define DRI3NumberRequests 6 +#define DRI3NumberRequests 5 typedef struct { CARD8 reqType; @@ -126,18 +125,6 @@ typedef struct { } xDRI3BufferFromPixmapReply; #define sz_xDRI3BufferFromPixmapReply 32 -typedef struct { - CARD8 reqType; - CARD8 dri3ReqType; - CARD16 length B16; - CARD32 eid B32; - CARD32 window B32; - CARD32 eventMask B32; -} xDRI3SelectInputReq; -#define sz_xDRI3SelectInputReq 12 - -#define DRI3AllEvents (1 << DRI3ConfigureNotify) - typedef struct { CARD8 reqType; CARD8 dri3ReqType; @@ -151,32 +138,4 @@ typedef struct { #define sz_xDRI3FenceFromFDReq 16 -/* - * 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 eid B32; - 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; - CARD32 pixmap_flags B32; -} xDRI3ConfigureNotify; -#define sz_xDRI3ConfigureNotify 40 - #endif diff --git a/dri3proto.txt b/dri3proto.txt index b73e9bb..fbc0fed 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -32,15 +32,7 @@ Arthur Huillet 2. Data Types -DRI3EVENTID { XID } - - Defines a unique event delivery target for DRI3 - events. Multiple event IDs can be allocated to provide - multiple distinct event delivery contexts. - -DRI3EVENTMASK { DRI3ConfigureNotifyMask } - -The DRI3 extension also uses the RandR extension Provider data type to +The DRI3 extension uses the RandR extension Provider data type to select among multiple GPUs on a single screen and the Sync extension fence object to provide graphics object synchronization. @@ -48,26 +40,19 @@ fence object to provide graphics object synchronization. 4. Errors -No errors are defined by the DRI3 extension. +DRI3 defines no errors. ❄ ❄ ❄ ❄ ❄ ❄ ❄ 5. Events -DRI3 adds a ConfigureNotify event to inform clients about window -configuration changes which can affect the allocation of -window-related direct rendered buffers. +DRI3 defines no events. ❄ ❄ ❄ ❄ ❄ ❄ ❄ 6. Protocol Types -DRI3DRIVER { DRI3DriverDRI - DRI3DriverVDPAU } - - 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. +DRI3 defines no new protocol types. ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -182,29 +167,6 @@ The name of this extension is "DRI3" If buffer cannot be used with the screen associated with drawable, a Match error is returned. -┌─── - DRI3SelectInput - eventContext: DRI3EVENTID - window: WINDOW - eventMask: SETofDRI3EVENT -└─── - Errors: Window, Value, Match, IDchoice - - Selects the set of DRI3 events to be delivered for the - specified window and event context. DRI3SelectInput can - create, modifiy or delete event contexts. An event context is - associated with a specific window; using an existing event - context with a different window generates a Match error. - - If eventContext specifies an existing event context, then if - eventMask is empty, DRI3SelectInput deletes the specified - context, otherwise the specified event context is changed to - select a different set of events. - - If eventContext is an unused XID, then if eventMask is empty - no operation is performed. Otherwise, a new event context is - created selecting the specified events. - ┌─── DRI3FenceFromFD drawable: DRAWABLE @@ -225,30 +187,7 @@ The name of this extension is "DRI3" 9. Extension Events -DRI3ConfigureNotify is sent if DRI3SelectInput has requested it. -DRI3ConfigureNotify events are XGE events and so do not have a unique -event ID. - -┌─── - DRI3ConfigureNotify - type: CARD8 XGE event type (35) - extension: CARD8 DRI3 extension request number - length: CARD16 2 - evtype: CARD16 DRI3_ConfigureNotify - eventID: DRI3EVENTID - window: WINDOW - x: INT16 - y: INT16 - width: CARD16 - height: CARD16 - off_x: INT16 - off_y: INT16 - pixmap_width: CARD16 - pixmap_height: CARD16 - pixmap_flags: CARD32 -└─── - - 'x' and 'y' are the parent-relative location of 'window'. +DRI3 defines no events. ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -303,13 +242,7 @@ protocol encoding document. A.1 Common Types -┌─── - DRI3DRIVER - 0x0 DRI3DriverDRI - 0x1 DRI3DriverVDPAU -└─── - - Note that these match the DRI2 values. +None. A.2 Protocol Requests @@ -391,20 +324,10 @@ A.2 Protocol Requests 0 FD buffer └─── -┌─── - DRI3SelectInput - 1 CARD8 major opcode - 1 4 DRI3 opcode - 2 3 length - 4 Window window - 4 CARD32 eid - 4 CARD32 event mask -└─── - ┌─── DRI3FenceFromFD 1 CARD8 major opcode - 1 5 DRI3 opcode + 1 4 DRI3 opcode 2 4 length 4 Drawable drawable 4 Fence fence @@ -416,26 +339,7 @@ A.2 Protocol Requests A.3 Protocol Events -┌─── - DRI3ConfigureNotify - 1 35 XGE - 1 CARD8 DRI3 extension opcode - 2 CARD16 sequence number - 4 2 length - 2 0 DRI3ConfigureNotify - 2 unused - 4 CARD32 event id - 4 Window window - 2 INT16 x - 2 INT16 y - 2 CARD16 width - 2 CARD16 height - 2 INT16 off x - 2 INT16 off y - 2 CARD16 pixmap width - 2 CARD16 pixmap height - 4 CARD32 pixmap flags -└─── +The DRI3 extension defines no events. A.4 Protocol Errors diff --git a/dri3tokens.h b/dri3tokens.h deleted file mode 100644 index 5eebe4d..0000000 --- a/dri3tokens.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 DRI3ConfigureNotify 0 - -#define DRI3PixmapScanout 0x00000001 - -#define DRI3PixmapDriverMask 0xffff0000 - -#endif From b79a809d29cf9a5cf0715e59e5f0ce0a2dcc410b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 8 Oct 2013 16:16:21 -0700 Subject: [PATCH 16/26] Add FDFromFence request This lets DRI clients convert a fence back into a local object. Signed-off-by: Keith Packard --- dri3proto.h | 28 +++++++++++++++++++++++++++- dri3proto.txt | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/dri3proto.h b/dri3proto.h index 02ea929..ceddee8 100644 --- a/dri3proto.h +++ b/dri3proto.h @@ -35,8 +35,9 @@ #define X_DRI3PixmapFromBuffer 2 #define X_DRI3BufferFromPixmap 3 #define X_DRI3FenceFromFD 4 +#define X_DRI3FDFromFence 5 -#define DRI3NumberRequests 5 +#define DRI3NumberRequests 6 typedef struct { CARD8 reqType; @@ -138,4 +139,29 @@ typedef struct { #define sz_xDRI3FenceFromFDReq 16 +typedef struct { + CARD8 reqType; + CARD8 dri3ReqType; + CARD16 length B16; + CARD32 drawable B32; + CARD32 fence B32; +} xDRI3FDFromFenceReq; + +#define sz_xDRI3FDFromFenceReq 12 + +typedef struct { + BYTE type; /* X_Reply */ + CARD8 nfd; /* Number of file descriptors returned (1) */ + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 pad08 B32; + CARD32 pad12 B32; + CARD32 pad16 B32; + CARD32 pad20 B32; + CARD32 pad24 B32; + CARD32 pad28 B32; +} xDRI3FDFromFenceReply; + +#define sz_xDRI3FDFromFenceReply 32 + #endif diff --git a/dri3proto.txt b/dri3proto.txt index fbc0fed..3f516f7 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -182,6 +182,23 @@ The name of this extension is "DRI3" Details about the mechanism used with this file descriptor are outside the scope of the DRI3 extension. +┌─── + DRI3FDFromFence + drawable: DRAWABLE + fence: FENCE + ▶ + fd: FD +└─── + Errors: IDchoice, Drawable, Match + + Given a Sync extension Fence that provides the regular Sync + extension semantics, returns a file descriptor that provides a + device-specific mechanism to manipulate the fence directly. + Details about the mechanism used with this file descriptor are + outside the scope of the DRI3 extension. 'drawable' must be + associated with a direct rendering device that 'fence' can + work with, otherwise a Match error results. + ❄ ❄ ❄ ❄ ❄ ❄ ❄ @@ -337,6 +354,23 @@ A.2 Protocol Requests 0 FD fence fd └─── +┌─── + DRI3FDFromFence + 1 CARD8 major opcode + 1 5 DRI3 opcode + 2 3 length + 4 Drawable drawable + 4 Fence fence + ▶ + 1 1 Reply + 1 1 nfd + 2 CARD16 sequence number + 4 0 reply length + 24 unused + + 0 FD fence fd +└─── + A.3 Protocol Events The DRI3 extension defines no events. From 4325ee749aa2d7983be9e3a10db42902f9db7266 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Fri, 1 Nov 2013 14:08:48 -0700 Subject: [PATCH 17/26] Copy the standard .gitignore from other proto packages Signed-off-by: Aaron Plattner Reviewed-by: Gaetan Nadon --- .gitignore | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b0e3523..2f471ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,78 @@ -Makefile -Makefile.in +# +# X.Org module default exclusion patterns +# The next section if for module specific patterns +# +# Do not edit the following section +# GNU Build System (Autotools) aclocal.m4 autom4te.cache/ +autoscan.log +ChangeLog +compile config.guess +config.h +config.h.in config.log +config-ml.in +config.py config.status +config.status.lineno config.sub configure -dri3proto.pc +configure.scan +depcomp +.deps/ +INSTALL install-sh +.libs/ +libtool +libtool.m4 +ltmain.sh +lt~obsolete.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +Makefile +Makefile.in +mdate-sh missing +mkinstalldirs +*.pc +py-compile +stamp-h? +symlink-tree +texinfo.tex +ylwrap + +# Do not edit the following section +# Edit Compile Debug Document Distribute +*~ +*.[0-9] +*.[0-9]x +*.bak +*.bin +core +*.dll +*.exe +*-ISO*.bdf +*-JIS*.bdf +*-KOI8*.bdf +*.kld +*.ko +*.ko.cmd +*.lai +*.l[oa] +*.[oa] +*.obj +*.patch +*.so +*.pcf.gz +*.pdb +*.tar.bz2 +*.tar.gz +# +# Add & Override patterns for dri3proto +# +# Edit the following section as needed +# For example, !report.pc overrides *.pc. See 'man gitignore' +# From 8d2c54d41f2444bbf7c14b678059881483c49903 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 6 Nov 2013 12:35:01 -0500 Subject: [PATCH 18/26] Add COPYING Text taken from the header file. Signed-off-by: Adam Jackson --- COPYING | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 COPYING diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..8dcf1d4 --- /dev/null +++ b/COPYING @@ -0,0 +1,19 @@ +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. From 8257a60f2896e298715b6110ca9683da9904d711 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 6 Nov 2013 10:18:53 -0800 Subject: [PATCH 19/26] Update DRI3Open encoding spec to remove driver name The specification for the encoding of DRI3Open didn't get fixed when the driver name was removed. Signed-off-by: Keith Packard --- dri3proto.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dri3proto.txt b/dri3proto.txt index 3f516f7..dac11d3 100644 --- a/dri3proto.txt +++ b/dri3proto.txt @@ -287,17 +287,13 @@ A.2 Protocol Requests 1 1 DRI3 opcode 2 4 length 4 DRAWABLE drawable - 4 CARD32 driver type 4 PROVIDER provider ▶ 1 1 Reply 1 1 nfd 2 CARD16 sequence number - 4 (n + p) / 4 reply length - 4 n driver name length (n) - 20 unused - n CARD8 driver name - p unused, p=pad(n) + 4 0 reply length + 24 unused 0 FD device └─── From 11232941756bad24f51ef38d6519e1b779e8f6fa Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Mon, 4 Nov 2013 18:30:48 -0500 Subject: [PATCH 20/26] Add the required README file. Signed-off-by: Gaetan Nadon --- README | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..1dedd46 --- /dev/null +++ b/README @@ -0,0 +1,31 @@ + Direct Rendering Infrastructure 3 Extension + +The DRI3 extension provides mechanisms to translate between direct +rendered buffers and X pixmaps. When combined with the Present extension, +a complete direct rendering solution for OpenGL is provided. + +Extension name: DRI3 + +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/dri3proto + + http://cgit.freedesktop.org/xorg/proto/dri3proto + +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 + From e392d40182bc23a2a6e2202c59ee2afd26328a0a Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Mon, 4 Nov 2013 18:34:59 -0500 Subject: [PATCH 21/26] config: replace deprecated use of AC_OUTPUT with AC_CONFIG_FILES Fix Automake warning: AC_OUTPUT should be used without arguments. www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Files Signed-off-by: Gaetan Nadon --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1671e6c..2f30db6 100644 --- a/configure.ac +++ b/configure.ac @@ -9,5 +9,6 @@ m4_ifndef([XORG_MACROS_VERSION], XORG_MACROS_VERSION(1.3) XORG_DEFAULT_OPTIONS -AC_OUTPUT([Makefile +AC_CONFIG_FILES([Makefile dri3proto.pc]) +AC_OUTPUT From c32c10124ff4fca14956c286e8d8a31291f41ffc Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 26 May 2014 17:26:06 +1000 Subject: [PATCH 22/26] autogen: use standard autogen so gnome can build this. Signed-off-by: Dave Airlie --- autogen.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 904cd67..fc34bd5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -9,4 +9,6 @@ cd $srcdir autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? -$srcdir/configure --enable-maintainer-mode "$@" +if test -z "$NOCONFIGURE"; then + $srcdir/configure "$@" +fi From 91df0f88b70c268f3580385a7b37543ab8c544c8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 31 May 2014 21:38:41 -0700 Subject: [PATCH 23/26] configure: Drop AM_MAINTAINER_MODE Signed-off-by: Alan Coopersmith --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2f30db6..d7abd0a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,6 @@ 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], From 3ec5a3488d1afb4199d626ca250e6789daa2b7ec Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Jan 2017 10:32:07 +1000 Subject: [PATCH 24/26] autogen.sh: use exec instead of waiting for configure to finish Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index fc34bd5..fd9c59a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -10,5 +10,5 @@ autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? if test -z "$NOCONFIGURE"; then - $srcdir/configure "$@" + exec $srcdir/configure "$@" fi From 085bd7f626bfc2bd1a4e182ae4e86c877e4f067d Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 9 Mar 2015 12:00:52 +0000 Subject: [PATCH 25/26] autogen.sh: use quoted string variables Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- autogen.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autogen.sh b/autogen.sh index fd9c59a..0006de8 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,14 +1,14 @@ #! /bin/sh -srcdir=`dirname $0` +srcdir=`dirname "$0"` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` -cd $srcdir +cd "$srcdir" autoreconf -v --install || exit 1 -cd $ORIGDIR || exit $? +cd "$ORIGDIR" || exit $? if test -z "$NOCONFIGURE"; then - exec $srcdir/configure "$@" + exec "$srcdir"/configure "$@" fi From 3937f72040b79c7245b261da880364177cc40a6e Mon Sep 17 00:00:00 2001 From: Mihail Konev Date: Thu, 26 Jan 2017 13:52:48 +1000 Subject: [PATCH 26/26] autogen: add default patch prefix Signed-off-by: Mihail Konev --- autogen.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autogen.sh b/autogen.sh index 0006de8..7abdaac 100755 --- a/autogen.sh +++ b/autogen.sh @@ -9,6 +9,9 @@ cd "$srcdir" autoreconf -v --install || exit 1 cd "$ORIGDIR" || exit $? +git config --local --get format.subjectPrefix >/dev/null 2>&1 || + git config --local format.subjectPrefix "PATCH dri3proto" + if test -z "$NOCONFIGURE"; then exec "$srcdir"/configure "$@" fi