[Xcb-commit] xcb/proto: 4 commits - src xcbgen
Keith Packard
keithp at kemper.freedesktop.org
Thu Nov 7 14:14:34 CET 2013
Rebased ref, commits from common ancestor:
commit 24df547b72d73fbb9704d342a1e5c4773f48cd38
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jul 11 15:59:08 2013 -0700
Add Present protocol specification
Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Peter Harris <pharris at opentext.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index 5804fff..d81d818 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,6 +9,7 @@ xcbinclude_HEADERS = \
dri3.xml \
ge.xml \
glx.xml \
+ present.xml \
randr.xml \
record.xml \
render.xml \
diff --git a/src/present.xml b/src/present.xml
new file mode 100644
index 0000000..d12ae48
--- /dev/null
+++ b/src/present.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+-->
+
+<xcb header="present" extension-xname="Present" extension-name="Present"
+ major-version="1" minor-version="0">
+ <import>xproto</import>
+ <import>randr</import>
+ <import>xfixes</import>
+ <import>sync</import>
+
+ <!-- Types -->
+
+ <enum name="Event">
+ <item name="ConfigureNotify"><value>0</value></item>
+ <item name="CompleteNotify"><value>1</value></item>
+ <item name="IdleNotify"><value>2</value></item>
+ <item name="RedirectNotify"><value>3</value></item>
+ </enum>
+
+ <enum name="EventMask">
+ <item name="NoEvent"><value>0</value></item>
+ <item name="ConfigureNotify"><bit>0</bit></item>
+ <item name="CompleteNotify"><bit>1</bit></item>
+ <item name="IdleNotify"><bit>2</bit></item>
+ <item name="RedirectNotify"><bit>3</bit></item>
+ </enum>
+
+ <enum name="Option">
+ <item name="None"><value>0</value></item>
+ <item name="Async"><bit>0</bit></item>
+ <item name="Copy"><bit>1</bit></item>
+ <item name="UST"><bit>2</bit></item>
+ </enum>
+
+ <enum name="Capability">
+ <item name="None"><value>0</value></item>
+ <item name="Async"><bit>0</bit></item>
+ <item name="Fence"><bit>1</bit></item>
+ <item name="UST"><bit>2</bit></item>
+ </enum>
+
+ <enum name="CompleteKind">
+ <item name="Pixmap"><value>0</value></item>
+ <item name="NotifyMSC"><value>1</value></item>
+ </enum>
+
+ <enum name="CompleteMode">
+ <item name="Copy"><value>0</value></item>
+ <item name="Flip"><value>1</value></item>
+ <item name="Skip"><value>2</value></item>
+ </enum>
+
+ <struct name="Notify">
+ <field type="WINDOW" name="window" />
+ <field type="CARD32" name="serial" />
+ </struct>
+
+ <!-- Requests -->
+ <request name="QueryVersion" opcode="0">
+ <field type="CARD32" name="major_version" />
+ <field type="CARD32" name="minor_version" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD32" name="major_version" />
+ <field type="CARD32" name="minor_version" />
+ </reply>
+ </request>
+
+ <request name="Pixmap" opcode="1">
+ <field type="WINDOW" name="window" />
+ <field type="PIXMAP" name="pixmap" />
+ <field type="CARD32" name="serial" />
+ <field type="REGION" name="valid" />
+ <field type="REGION" name="update" />
+ <field type="INT16" name="x_off" />
+ <field type="INT16" name="y_off" />
+ <field type="CRTC" name="target_crtc" />
+ <field type="FENCE" name="wait_fence" />
+ <field type="FENCE" name="idle_fence" />
+ <field type="CARD32" name="options" />
+ <pad bytes="4"/>
+ <field type="CARD64" name="target_msc" />
+ <field type="CARD64" name="divisor" />
+ <field type="CARD64" name="remainder" />
+ <list type="Notify" name="notifies"/>
+ </request>
+
+ <request name="NotifyMSC" opcode="2">
+ <field type="WINDOW" name="window" />
+ <field type="CARD32" name="serial" />
+ <pad bytes="4"/>
+ <field type="CARD64" name="target_msc" />
+ <field type="CARD64" name="divisor" />
+ <field type="CARD64" name="remainder" />
+ </request>
+
+ <xidtype name="EVENT"/>
+
+ <request name="SelectInput" opcode="3">
+ <field type="EVENT" name="eid"/>
+ <field type="WINDOW" name="window" />
+ <field type="CARD32" name="event_mask" mask="EventMask" />
+ </request>
+
+ <request name="QueryCapabilities" opcode="4">
+ <field type="CARD32" name="target" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD32" name="capabilities" />
+ </reply>
+ </request>
+
+ <!-- Events -->
+
+ <event name="Generic">
+ <field type="CARD8" name="extension" />
+ <field type="CARD32" name="length" />
+ <field type="CARD16" name="evtype" enum="EventType" />
+ <pad bytes="2" />
+ <field type="EVENT" name="event" />
+ </event>
+
+ <event name="ConfigureNotify" number="0" xge="true">
+ <pad bytes="2" />
+ <field type="EVENT" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="INT16" name="x" />
+ <field type="INT16" name="y" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="INT16" name="off_x" />
+ <field type="INT16" name="off_y" />
+ <field type="CARD16" name="pixmap_width" />
+ <field type="CARD16" name="pixmap_height" />
+ <field type="CARD32" name="pixmap_flags" />
+ </event>
+
+ <event name="CompleteNotify" number="1" xge="true">
+ <field type="CARD8" name="kind" enum="CompleteKind" />
+ <field type="CARD8" name="mode" enum="CompleteMode" />
+ <field type="EVENT" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="CARD32" name="serial" />
+ <field type="CARD64" name="ust" />
+ <field type="CARD64" name="msc" />
+ </event>
+
+ <event name="IdleNotify" number="2" xge="true">
+ <pad bytes="2"/>
+ <field type="EVENT" name="event" />
+ <field type="WINDOW" name="window" />
+ <field type="CARD32" name="serial" />
+ <field type="PIXMAP" name="pixmap" />
+ <field type="FENCE" name="idle_fence" />
+ </event>
+
+ <event name="RedirectNotify" number="3" xge="true">
+ <field type="BOOL" name="update_window"/>
+ <pad bytes="1"/>
+ <field type="EVENT" name="event" />
+ <field type="WINDOW" name="event_window" />
+ <field type="WINDOW" name="window" />
+ <field type="PIXMAP" name="pixmap" />
+ <field type="CARD32" name="serial" />
+
+ <field type="REGION" name="valid_region" />
+ <field type="REGION" name="update_region" />
+ <field type="RECTANGLE" name="valid_rect" />
+ <field type="RECTANGLE" name="update_rect" />
+
+ <field type="INT16" name="x_off" />
+ <field type="INT16" name="y_off" />
+ <field type="CRTC" name="target_crtc" />
+ <field type="FENCE" name="wait_fence" />
+ <field type="FENCE" name="idle_fence" />
+ <field type="CARD32" name="options" />
+ <pad bytes="4"/>
+ <field type="CARD64" name="target_msc" />
+ <field type="CARD64" name="divisor" />
+ <field type="CARD64" name="remainder" />
+ <list type="Notify" name="notifies"/>
+ </event>
+
+</xcb>
commit ae9c4710e75a967167388b7d3e0dbd6586946c91
Author: Keith Packard <keithp at keithp.com>
Date: Tue Apr 9 21:36:40 2013 -0700
Add DRI3
Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Peter Harris <pharris at opentext.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index eef2dbc..5804fff 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ xcbinclude_HEADERS = \
damage.xml \
dpms.xml \
dri2.xml \
+ dri3.xml \
ge.xml \
glx.xml \
randr.xml \
diff --git a/src/dri3.xml b/src/dri3.xml
new file mode 100644
index 0000000..608af31
--- /dev/null
+++ b/src/dri3.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+-->
+
+<xcb header="dri3" extension-xname="DRI3" extension-name="DRI3"
+ major-version="1" minor-version="0">
+ <import>xproto</import>
+
+ <!-- Types -->
+
+ <!-- Requests -->
+ <request name="QueryVersion" opcode="0">
+ <field type="CARD32" name="major_version" />
+ <field type="CARD32" name="minor_version" />
+ <reply>
+ <pad bytes="1" />
+ <field type="CARD32" name="major_version" />
+ <field type="CARD32" name="minor_version" />
+ </reply>
+ </request>
+
+ <request name="Open" opcode="1">
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD32" name="provider" />
+ <reply>
+ <field type="CARD8" name="nfd"/>
+ <fd name="device_fd" />
+ <pad bytes="24" />
+ </reply>
+ </request>
+
+ <request name="PixmapFromBuffer" opcode="2">
+ <field type="PIXMAP" name="pixmap" />
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD32" name="size" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="stride" />
+ <field type="CARD8" name="depth" />
+ <field type="CARD8" name="bpp" />
+ <fd name="pixmap_fd" />
+ </request>
+
+ <request name="BufferFromPixmap" opcode="3">
+ <field type="PIXMAP" name="pixmap" />
+ <reply>
+ <field type="CARD8" name="nfd"/>
+ <field type="CARD32" name="size" />
+ <field type="CARD16" name="width" />
+ <field type="CARD16" name="height" />
+ <field type="CARD16" name="stride" />
+ <field type="CARD8" name="depth" />
+ <field type="CARD8" name="bpp" />
+ <fd name="pixmap_fd" />
+ <pad bytes="12"/>
+ </reply>
+ </request>
+
+ <request name="FenceFromFD" opcode="4">
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD32" name="fence"/>
+ <field type="BOOL" name="initially_triggered"/>
+ <pad bytes="3"/>
+ <fd name="fence_fd"/>
+ </request>
+
+ <request name="FDFromFence" opcode="5">
+ <field type="DRAWABLE" name="drawable" />
+ <field type="CARD32" name="fence"/>
+ <reply>
+ <field type="CARD8" name="nfd"/>
+ <fd name="fence_fd" />
+ <pad bytes="24"/>
+ </reply>
+ </request>
+
+</xcb>
commit 2b6b7bb7baa57a5e89c8c7e01496aa3e67da5973
Author: Keith Packard <keithp at keithp.com>
Date: Fri Jan 18 01:28:10 2013 -0800
Add MIT-SHM AttachFd and CreateSegment requests
Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Peter Harris <pharris at opentext.com>
diff --git a/src/shm.xml b/src/shm.xml
index adda509..71fce14 100644
--- a/src/shm.xml
+++ b/src/shm.xml
@@ -26,7 +26,7 @@ sale, use or other dealings in this Software without prior written
authorization from the authors.
-->
<xcb header="shm" extension-xname="MIT-SHM" extension-name="Shm"
- major-version="1" minor-version="1">
+ major-version="1" minor-version="2">
<import>xproto</import>
<xidtype name="SEG" />
@@ -113,4 +113,23 @@ authorization from the authors.
<field type="SEG" name="shmseg" />
<field type="CARD32" name="offset" />
</request>
+
+ <request name="AttachFd" opcode="6">
+ <field type="SEG" name="shmseg" />
+ <fd name="shm_fd" />
+ <field type="BOOL" name="read_only" />
+ <pad bytes="3" />
+ </request>
+
+ <request name="CreateSegment" opcode="7">
+ <field type="SEG" name="shmseg" />
+ <field type="CARD32" name="size" />
+ <field type="BOOL" name="read_only" />
+ <pad bytes="3" />
+ <reply>
+ <field type="CARD8" name="nfd" />
+ <fd name="shm_fd" />
+ <pad bytes="24" />
+ </reply>
+ </request>
</xcb>
commit c57d265a90f4ed82acf72e0161b8d7bf35830884
Author: Keith Packard <keithp at keithp.com>
Date: Mon Jan 14 14:19:45 2013 -0800
Add support for file descriptor request fields
These are present in the API, but not present on the wire.
Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/xcbgen/expr.py b/xcbgen/expr.py
index 4f8af6f..f9d5179 100644
--- a/xcbgen/expr.py
+++ b/xcbgen/expr.py
@@ -13,7 +13,7 @@ class Field(object):
auto is true iff the field is on the wire but not in the request API (e.g. opcode)
enum is the enum name this field refers to, if any.
'''
- def __init__(self, type, field_type, field_name, visible, wire, auto, enum=None):
+ def __init__(self, type, field_type, field_name, visible, wire, auto, enum=None, isfd=False):
self.type = type
self.field_type = field_type
self.field_name = field_name
@@ -21,6 +21,7 @@ class Field(object):
self.visible = visible
self.wire = wire
self.auto = auto
+ self.isfd = isfd
class Expression(object):
diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
index 4b43957..951731a 100644
--- a/xcbgen/xtypes.py
+++ b/xcbgen/xtypes.py
@@ -75,6 +75,18 @@ class Type(object):
complex_type.fields.append(new_field)
+ def make_fd_of(self, module, complex_type, fd_name):
+ '''
+ Method for making a fd member of a structure.
+ '''
+ new_fd = Field(self, module.get_type_name('INT32'), fd_name, True, False, False, None, True)
+ # We dump the _placeholder_byte if any fields are added.
+ for (idx, field) in enumerate(complex_type.fields):
+ if field == _placeholder_byte:
+ complex_type.fields[idx] = new_fd
+ return
+
+ complex_type.fields.append(new_fd)
class SimpleType(Type):
'''
@@ -279,6 +291,7 @@ class ComplexType(Type):
self.nmemb = 1
self.size = 0
self.lenfield_parent = [self]
+ self.fds = []
def resolve(self, module):
if self.resolved:
@@ -324,9 +337,14 @@ class ComplexType(Type):
type.make_member_of(module, self, field_type, field_name, visible, True, False)
type.resolve(module)
continue
+ elif child.tag == 'fd':
+ fd_name = child.get('name')
+ type = module.get_type('INT32')
+ type.make_fd_of(module, self, fd_name)
+ continue
else:
# Hit this on Reply
- continue
+ continue
# Get the full type name for the field
field_type = module.get_type_name(fkey)
More information about the xcb-commit
mailing list