[Xcb] [PATCH 0/3] Support lists of FDs

Daniel Stone daniels at collabora.com
Wed Apr 26 16:05:43 UTC 2017

This patchset adds support for lists containing file descriptors, which
are otherwise only currently available as direct children of

This creates new API from xcbgen, which the consumer (e.g. c_client) is
required to implement.

The immediaate usecase for this was extending DRI3 to support
multi-planar buffers (e.g. RGB with auxiliary compression buffers),
which would otherwise require creating multiple requests/replies for
each of the [1..4] buffer cases.

The following becomes possible:
  <request name="FDsInAList">
    <field type=CARD32" name="num_fds" />
    <list type="fd" name="fds">

The XCB client code correctly serialises this, taking a pointer to
an array of ints, placing num_fds from that array on the wire. Replies
do not require any special handling, as clients just get a pointer to
the full array containing all the FDs for that reply.

I'd welcome any feedback on these. I don't feel the way this is
implemented is particularly clean; given that 'fd' is currently not a
real type but a punch-through special case, I couldn't immediately see
how to do it differently.


More information about the Xcb mailing list