diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libxcb/libxcb-dpms/shlib_version | 2 | ||||
-rw-r--r-- | lib/libxcb/libxcb-dri3/shlib_version | 2 | ||||
-rw-r--r-- | lib/libxcb/libxcb-present/shlib_version | 2 | ||||
-rw-r--r-- | lib/libxcb/src/Makefile | 4 | ||||
-rw-r--r-- | lib/libxcb/src/bigreq.h | 12 | ||||
-rw-r--r-- | lib/libxcb/src/composite.h | 96 | ||||
-rw-r--r-- | lib/libxcb/src/damage.h | 108 | ||||
-rw-r--r-- | lib/libxcb/src/dpms.c | 53 | ||||
-rw-r--r-- | lib/libxcb/src/dpms.h | 68 | ||||
-rw-r--r-- | lib/libxcb/src/dri3.c | 134 | ||||
-rw-r--r-- | lib/libxcb/src/dri3.h | 121 | ||||
-rw-r--r-- | lib/libxcb/src/present.c | 182 | ||||
-rw-r--r-- | lib/libxcb/src/present.h | 113 | ||||
-rw-r--r-- | lib/libxcb/src/randr.c | 8 | ||||
-rw-r--r-- | lib/libxcb/src/shm.h | 176 | ||||
-rw-r--r-- | lib/libxcb/src/xfixes.h | 16 | ||||
-rw-r--r-- | lib/libxcb/src/xinput.c | 16 |
17 files changed, 1050 insertions, 63 deletions
diff --git a/lib/libxcb/libxcb-dpms/shlib_version b/lib/libxcb/libxcb-dpms/shlib_version index 1edea46de..893819d18 100644 --- a/lib/libxcb/libxcb-dpms/shlib_version +++ b/lib/libxcb/libxcb-dpms/shlib_version @@ -1,2 +1,2 @@ major=1 -minor=0 +minor=1 diff --git a/lib/libxcb/libxcb-dri3/shlib_version b/lib/libxcb/libxcb-dri3/shlib_version index dea2b62ca..97247abae 100644 --- a/lib/libxcb/libxcb-dri3/shlib_version +++ b/lib/libxcb/libxcb-dri3/shlib_version @@ -1,2 +1,2 @@ major=0 -minor=2 +minor=3 diff --git a/lib/libxcb/libxcb-present/shlib_version b/lib/libxcb/libxcb-present/shlib_version index 3d7c908e4..dea2b62ca 100644 --- a/lib/libxcb/libxcb-present/shlib_version +++ b/lib/libxcb/libxcb-present/shlib_version @@ -1,2 +1,2 @@ major=0 -minor=1 +minor=2 diff --git a/lib/libxcb/src/Makefile b/lib/libxcb/src/Makefile index 99063e2f9..a1c4e33e9 100644 --- a/lib/libxcb/src/Makefile +++ b/lib/libxcb/src/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2022/07/17 08:31:10 matthieu Exp $ +# $OpenBSD: Makefile,v 1.14 2024/07/11 08:05:32 matthieu Exp $ # This Makefile is used to generate the sources files with xcbgen # The x11/py-xcbgen package needs to be installed @@ -6,7 +6,7 @@ DATADIR= ${X11BASE}/share PYTHON= python${PYTHON_VERSION} -MANOPTIONS= -c 'libxcb 1.15' -l 'X Version 11' -s 3 +MANOPTIONS= -c 'libxcb 1.17.0' -l 'X Version 11' -s 3 SRCS= \ bigreq.c \ diff --git a/lib/libxcb/src/bigreq.h b/lib/libxcb/src/bigreq.h index bfb9527ba..becd16de8 100644 --- a/lib/libxcb/src/bigreq.h +++ b/lib/libxcb/src/bigreq.h @@ -54,22 +54,30 @@ typedef struct xcb_big_requests_enable_reply_t { } xcb_big_requests_enable_reply_t; /** + * @brief Enable the BIG-REQUESTS extension * * @param c The connection * @return A cookie * - * Delivers a request to the X server. + * This enables the BIG-REQUESTS extension, which allows for requests larger than + * 262140 bytes in length. When enabled, if the 16-bit length field is zero, it + * is immediately followed by a 32-bit length field specifying the length of the + * request in 4-byte units. * */ xcb_big_requests_enable_cookie_t xcb_big_requests_enable (xcb_connection_t *c); /** + * @brief Enable the BIG-REQUESTS extension * * @param c The connection * @return A cookie * - * Delivers a request to the X server. + * This enables the BIG-REQUESTS extension, which allows for requests larger than + * 262140 bytes in length. When enabled, if the 16-bit length field is zero, it + * is immediately followed by a 32-bit length field specifying the length of the + * request in 4-byte units. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be diff --git a/lib/libxcb/src/composite.h b/lib/libxcb/src/composite.h index 6daddeab8..d05d0729d 100644 --- a/lib/libxcb/src/composite.h +++ b/lib/libxcb/src/composite.h @@ -198,11 +198,15 @@ typedef struct xcb_composite_release_overlay_window_request_t { } xcb_composite_release_overlay_window_request_t; /** + * @brief Negotiate the version of Composite * * @param c The connection + * @param client_major_version The major version supported by the client. + * @param client_minor_version The minor version supported by the client. * @return A cookie * - * Delivers a request to the X server. + * This negotiates the version of the Composite extension. It must be precede all + * other requests using Composite. Failure to do so will cause a BadRequest error. * */ xcb_composite_query_version_cookie_t @@ -211,11 +215,15 @@ xcb_composite_query_version (xcb_connection_t *c, uint32_t client_minor_version); /** + * @brief Negotiate the version of Composite * * @param c The connection + * @param client_major_version The major version supported by the client. + * @param client_minor_version The minor version supported by the client. * @return A cookie * - * Delivers a request to the X server. + * This negotiates the version of the Composite extension. It must be precede all + * other requests using Composite. Failure to do so will cause a BadRequest error. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be @@ -246,11 +254,22 @@ xcb_composite_query_version_reply (xcb_connection_t *c, xcb_generic_error_t **e); /** + * @brief Redirect the hierarchy starting at "window" to off-screen storage. * * @param c The connection + * @param window The root of the hierarchy to redirect to off-screen storage. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update Whether contents are automatically mirrored to the parent window. If one client + * already specifies an update type of Manual, any attempt by another to specify a + * mode of Manual so will result in an Access error. * @return A cookie * - * Delivers a request to the X server. + * The hierarchy starting at 'window' is directed to off-screen + * storage. When all clients enabling redirection terminate, + * the redirection will automatically be disabled. + * + * The root window may not be redirected. Doing so results in a Match + * error. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -262,11 +281,22 @@ xcb_composite_redirect_window_checked (xcb_connection_t *c, uint8_t update); /** + * @brief Redirect the hierarchy starting at "window" to off-screen storage. * * @param c The connection + * @param window The root of the hierarchy to redirect to off-screen storage. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update Whether contents are automatically mirrored to the parent window. If one client + * already specifies an update type of Manual, any attempt by another to specify a + * mode of Manual so will result in an Access error. * @return A cookie * - * Delivers a request to the X server. + * The hierarchy starting at 'window' is directed to off-screen + * storage. When all clients enabling redirection terminate, + * the redirection will automatically be disabled. + * + * The root window may not be redirected. Doing so results in a Match + * error. * */ xcb_void_cookie_t @@ -275,11 +305,20 @@ xcb_composite_redirect_window (xcb_connection_t *c, uint8_t update); /** + * @brief Redirect all current and future children of ‘window’ * * @param c The connection + * @param window The root of the hierarchy to redirect to off-screen storage. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update Whether contents are automatically mirrored to the parent window. If one client + * already specifies an update type of Manual, any attempt by another to specify a + * mode of Manual so will result in an Access error. * @return A cookie * - * Delivers a request to the X server. + * Hierarchies starting at all current and future children of window + * will be redirected as in RedirectWindow. If update is Manual, + * then painting of the window background during window manipulation + * and ClearArea requests is inhibited. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -291,11 +330,20 @@ xcb_composite_redirect_subwindows_checked (xcb_connection_t *c, uint8_t update); /** + * @brief Redirect all current and future children of ‘window’ * * @param c The connection + * @param window The root of the hierarchy to redirect to off-screen storage. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update Whether contents are automatically mirrored to the parent window. If one client + * already specifies an update type of Manual, any attempt by another to specify a + * mode of Manual so will result in an Access error. * @return A cookie * - * Delivers a request to the X server. + * Hierarchies starting at all current and future children of window + * will be redirected as in RedirectWindow. If update is Manual, + * then painting of the window background during window manipulation + * and ClearArea requests is inhibited. * */ xcb_void_cookie_t @@ -304,11 +352,18 @@ xcb_composite_redirect_subwindows (xcb_connection_t *c, uint8_t update); /** + * @brief Terminate redirection of the specified window. * * @param c The connection + * @param window The window to terminate redirection of. Must be redirected by the + * current client, or a Value error results. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update The update type passed to RedirectWindows. If this does not match the + * previously requested update type, a Value error results. * @return A cookie * - * Delivers a request to the X server. + * Redirection of the specified window will be terminated. This cannot be + * used if the window was redirected with RedirectSubwindows. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -320,11 +375,18 @@ xcb_composite_unredirect_window_checked (xcb_connection_t *c, uint8_t update); /** + * @brief Terminate redirection of the specified window. * * @param c The connection + * @param window The window to terminate redirection of. Must be redirected by the + * current client, or a Value error results. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update The update type passed to RedirectWindows. If this does not match the + * previously requested update type, a Value error results. * @return A cookie * - * Delivers a request to the X server. + * Redirection of the specified window will be terminated. This cannot be + * used if the window was redirected with RedirectSubwindows. * */ xcb_void_cookie_t @@ -333,11 +395,18 @@ xcb_composite_unredirect_window (xcb_connection_t *c, uint8_t update); /** + * @brief Terminate redirection of the specified window’s children * * @param c The connection + * @param window The window to terminate redirection of. Must have previously been + * selected for sub-redirection by the current client, or a Value error + * results. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update The update type passed to RedirectSubWindows. If this does not match + * the previously requested update type, a Value error results. * @return A cookie * - * Delivers a request to the X server. + * Redirection of all children of window will be terminated. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -349,11 +418,18 @@ xcb_composite_unredirect_subwindows_checked (xcb_connection_t *c, uint8_t update); /** + * @brief Terminate redirection of the specified window’s children * * @param c The connection + * @param window The window to terminate redirection of. Must have previously been + * selected for sub-redirection by the current client, or a Value error + * results. + * @param update A bitmask of #xcb_composite_redirect_t values. + * @param update The update type passed to RedirectSubWindows. If this does not match + * the previously requested update type, a Value error results. * @return A cookie * - * Delivers a request to the X server. + * Redirection of all children of window will be terminated. * */ xcb_void_cookie_t diff --git a/lib/libxcb/src/damage.h b/lib/libxcb/src/damage.h index ff99ccbc3..0f432b9ad 100644 --- a/lib/libxcb/src/damage.h +++ b/lib/libxcb/src/damage.h @@ -191,11 +191,16 @@ xcb_generic_iterator_t xcb_damage_damage_end (xcb_damage_damage_iterator_t i); /** + * @brief Negotiate the version of the DAMAGE extension * * @param c The connection + * @param client_major_version The major version supported by the client. + * @param client_minor_version The minor version supported by the client. * @return A cookie * - * Delivers a request to the X server. + * This negotiates the version of the DAMAGE extension. It must precede any other + * request using the DAMAGE extension. Failure to do so will cause a BadRequest + * error for those requests. * */ xcb_damage_query_version_cookie_t @@ -204,11 +209,16 @@ xcb_damage_query_version (xcb_connection_t *c, uint32_t client_minor_version); /** + * @brief Negotiate the version of the DAMAGE extension * * @param c The connection + * @param client_major_version The major version supported by the client. + * @param client_minor_version The minor version supported by the client. * @return A cookie * - * Delivers a request to the X server. + * This negotiates the version of the DAMAGE extension. It must precede any other + * request using the DAMAGE extension. Failure to do so will cause a BadRequest + * error for those requests. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be @@ -239,11 +249,40 @@ xcb_damage_query_version_reply (xcb_connection_t *c, xcb_generic_error_t **e); /** + * @brief Creates a Damage object to monitor changes to a drawable. * * @param c The connection + * @param damage The ID with which you will refer to the new Damage object, created by + * `xcb_generate_id`. + * @param drawable The ID of the drawable to be monitored. + * @param level A bitmask of #xcb_damage_report_level_t values. + * @param level The level of detail to be provided in Damage events. * @return A cookie * - * Delivers a request to the X server. + * This creates a Damage object to monitor changes to a drawable, and specifies + * the level of detail to be reported for changes. + * + * We call changes made to pixel contents of windows and pixmaps 'damage' + * throughout this extension. + * + * Damage accumulates as drawing occurs in the drawable. Each drawing operation + * 'damages' one or more rectangular areas within the drawable. The rectangles + * are guaranteed to include the set of pixels modified by each operation, but + * may include significantly more than just those pixels. The desire is for + * the damage to strike a balance between the number of rectangles reported and + * the extraneous area included. A reasonable goal is for each primitive + * object drawn (line, string, rectangle) to be represented as a single + * rectangle and for the damage area of the operation to be the union of these + * rectangles. + * + * The DAMAGE extension allows applications to either receive the raw + * rectangles as a stream of events, or to have them partially processed within + * the X server to reduce the amount of data transmitted as well as reduce the + * processing latency once the repaint operation has started. + * + * The Damage object holds any accumulated damage region and reflects the + * relationship between the drawable selected for damage notification and the + * drawable for which damage is tracked. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -256,11 +295,40 @@ xcb_damage_create_checked (xcb_connection_t *c, uint8_t level); /** + * @brief Creates a Damage object to monitor changes to a drawable. * * @param c The connection + * @param damage The ID with which you will refer to the new Damage object, created by + * `xcb_generate_id`. + * @param drawable The ID of the drawable to be monitored. + * @param level A bitmask of #xcb_damage_report_level_t values. + * @param level The level of detail to be provided in Damage events. * @return A cookie * - * Delivers a request to the X server. + * This creates a Damage object to monitor changes to a drawable, and specifies + * the level of detail to be reported for changes. + * + * We call changes made to pixel contents of windows and pixmaps 'damage' + * throughout this extension. + * + * Damage accumulates as drawing occurs in the drawable. Each drawing operation + * 'damages' one or more rectangular areas within the drawable. The rectangles + * are guaranteed to include the set of pixels modified by each operation, but + * may include significantly more than just those pixels. The desire is for + * the damage to strike a balance between the number of rectangles reported and + * the extraneous area included. A reasonable goal is for each primitive + * object drawn (line, string, rectangle) to be represented as a single + * rectangle and for the damage area of the operation to be the union of these + * rectangles. + * + * The DAMAGE extension allows applications to either receive the raw + * rectangles as a stream of events, or to have them partially processed within + * the X server to reduce the amount of data transmitted as well as reduce the + * processing latency once the repaint operation has started. + * + * The Damage object holds any accumulated damage region and reflects the + * relationship between the drawable selected for damage notification and the + * drawable for which damage is tracked. * */ xcb_void_cookie_t @@ -270,11 +338,14 @@ xcb_damage_create (xcb_connection_t *c, uint8_t level); /** + * @brief Destroys a previously created Damage object. * * @param c The connection + * @param damage The ID you provided to `xcb_create_damage`. * @return A cookie * - * Delivers a request to the X server. + * This destroys a Damage object and requests the X server stop reporting + * the changes it was tracking. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -285,11 +356,14 @@ xcb_damage_destroy_checked (xcb_connection_t *c, xcb_damage_damage_t damage); /** + * @brief Destroys a previously created Damage object. * * @param c The connection + * @param damage The ID you provided to `xcb_create_damage`. * @return A cookie * - * Delivers a request to the X server. + * This destroys a Damage object and requests the X server stop reporting + * the changes it was tracking. * */ xcb_void_cookie_t @@ -297,11 +371,15 @@ xcb_damage_destroy (xcb_connection_t *c, xcb_damage_damage_t damage); /** + * @brief Remove regions from a previously created Damage object. * * @param c The connection + * @param damage The ID you provided to `xcb_create_damage`. * @return A cookie * - * Delivers a request to the X server. + * This updates the regions of damage recorded in a a Damage object. + * See https://www.x.org/releases/current/doc/damageproto/damageproto.txt + * for details. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -314,11 +392,15 @@ xcb_damage_subtract_checked (xcb_connection_t *c, xcb_xfixes_region_t parts); /** + * @brief Remove regions from a previously created Damage object. * * @param c The connection + * @param damage The ID you provided to `xcb_create_damage`. * @return A cookie * - * Delivers a request to the X server. + * This updates the regions of damage recorded in a a Damage object. + * See https://www.x.org/releases/current/doc/damageproto/damageproto.txt + * for details. * */ xcb_void_cookie_t @@ -328,11 +410,14 @@ xcb_damage_subtract (xcb_connection_t *c, xcb_xfixes_region_t parts); /** + * @brief Add a region to a previously created Damage object. * * @param c The connection * @return A cookie * - * Delivers a request to the X server. + * This updates the regions of damage recorded in a a Damage object. + * See https://www.x.org/releases/current/doc/damageproto/damageproto.txt + * for details. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -344,11 +429,14 @@ xcb_damage_add_checked (xcb_connection_t *c, xcb_xfixes_region_t region); /** + * @brief Add a region to a previously created Damage object. * * @param c The connection * @return A cookie * - * Delivers a request to the X server. + * This updates the regions of damage recorded in a a Damage object. + * See https://www.x.org/releases/current/doc/damageproto/damageproto.txt + * for details. * */ xcb_void_cookie_t diff --git a/lib/libxcb/src/dpms.c b/lib/libxcb/src/dpms.c index e1020d4df..7155a69a2 100644 --- a/lib/libxcb/src/dpms.c +++ b/lib/libxcb/src/dpms.c @@ -14,6 +14,7 @@ #include "dpms.h" #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) +#include "xproto.h" xcb_extension_t xcb_dpms_id = { "DPMS", 0 }; @@ -457,3 +458,55 @@ xcb_dpms_info_reply (xcb_connection_t *c, return (xcb_dpms_info_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); } +xcb_void_cookie_t +xcb_dpms_select_input_checked (xcb_connection_t *c, + uint32_t event_mask) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 2, + .ext = &xcb_dpms_id, + .opcode = XCB_DPMS_SELECT_INPUT, + .isvoid = 1 + }; + + struct iovec xcb_parts[4]; + xcb_void_cookie_t xcb_ret; + xcb_dpms_select_input_request_t xcb_out; + + xcb_out.event_mask = event_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_dpms_select_input (xcb_connection_t *c, + uint32_t event_mask) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 2, + .ext = &xcb_dpms_id, + .opcode = XCB_DPMS_SELECT_INPUT, + .isvoid = 1 + }; + + struct iovec xcb_parts[4]; + xcb_void_cookie_t xcb_ret; + xcb_dpms_select_input_request_t xcb_out; + + xcb_out.event_mask = event_mask; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + diff --git a/lib/libxcb/src/dpms.h b/lib/libxcb/src/dpms.h index 95aa91d78..42c56e985 100644 --- a/lib/libxcb/src/dpms.h +++ b/lib/libxcb/src/dpms.h @@ -13,13 +13,14 @@ #define __DPMS_H #include "xcb.h" +#include "xproto.h" #ifdef __cplusplus extern "C" { #endif -#define XCB_DPMS_MAJOR_VERSION 0 -#define XCB_DPMS_MINOR_VERSION 0 +#define XCB_DPMS_MAJOR_VERSION 1 +#define XCB_DPMS_MINOR_VERSION 2 extern xcb_extension_t xcb_dpms_id; @@ -211,6 +212,42 @@ typedef struct xcb_dpms_info_reply_t { uint8_t pad1[21]; } xcb_dpms_info_reply_t; +typedef enum xcb_dpms_event_mask_t { + XCB_DPMS_EVENT_MASK_INFO_NOTIFY = 1 +} xcb_dpms_event_mask_t; + +/** Opcode for xcb_dpms_select_input. */ +#define XCB_DPMS_SELECT_INPUT 8 + +/** + * @brief xcb_dpms_select_input_request_t + **/ +typedef struct xcb_dpms_select_input_request_t { + uint8_t major_opcode; + uint8_t minor_opcode; + uint16_t length; + uint32_t event_mask; +} xcb_dpms_select_input_request_t; + +/** Opcode for xcb_dpms_info_notify. */ +#define XCB_DPMS_INFO_NOTIFY 0 + +/** + * @brief xcb_dpms_info_notify_event_t + **/ +typedef struct xcb_dpms_info_notify_event_t { + uint8_t response_type; + uint8_t extension; + uint16_t sequence; + uint32_t length; + uint16_t event_type; + uint8_t pad0[2]; + xcb_timestamp_t timestamp; + uint16_t power_level; + uint8_t state; + uint8_t pad1[21]; +} xcb_dpms_info_notify_event_t; + /** * * @param c The connection @@ -499,6 +536,33 @@ xcb_dpms_info_reply (xcb_connection_t *c, xcb_dpms_info_cookie_t cookie /**< */, xcb_generic_error_t **e); +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_dpms_select_input_checked (xcb_connection_t *c, + uint32_t event_mask); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_dpms_select_input (xcb_connection_t *c, + uint32_t event_mask); + #ifdef __cplusplus } diff --git a/lib/libxcb/src/dri3.c b/lib/libxcb/src/dri3.c index d42393505..ad33aa60f 100644 --- a/lib/libxcb/src/dri3.c +++ b/lib/libxcb/src/dri3.c @@ -18,6 +18,24 @@ xcb_extension_t xcb_dri3_id = { "DRI3", 0 }; +void +xcb_dri3_syncobj_next (xcb_dri3_syncobj_iterator_t *i) +{ + --i->rem; + ++i->data; + i->index += sizeof(xcb_dri3_syncobj_t); +} + +xcb_generic_iterator_t +xcb_dri3_syncobj_end (xcb_dri3_syncobj_iterator_t i) +{ + xcb_generic_iterator_t ret; + ret.data = i.data + i.rem; + ret.index = i.index + ((char *) ret.data - (char *) i.data); + ret.rem = 0; + return ret; +} + xcb_dri3_query_version_cookie_t xcb_dri3_query_version (xcb_connection_t *c, uint32_t major_version, @@ -977,3 +995,119 @@ xcb_dri3_set_drm_device_in_use (xcb_connection_t *c, return xcb_ret; } +xcb_void_cookie_t +xcb_dri3_import_syncobj_checked (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj, + xcb_drawable_t drawable, + int32_t syncobj_fd) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 2, + .ext = &xcb_dri3_id, + .opcode = XCB_DRI3_IMPORT_SYNCOBJ, + .isvoid = 1 + }; + + struct iovec xcb_parts[4]; + xcb_void_cookie_t xcb_ret; + xcb_dri3_import_syncobj_request_t xcb_out; + int fds[1]; + int fd_index = 0; + + xcb_out.syncobj = syncobj; + xcb_out.drawable = drawable; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + + fds[fd_index++] = syncobj_fd; + xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_dri3_import_syncobj (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj, + xcb_drawable_t drawable, + int32_t syncobj_fd) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 2, + .ext = &xcb_dri3_id, + .opcode = XCB_DRI3_IMPORT_SYNCOBJ, + .isvoid = 1 + }; + + struct iovec xcb_parts[4]; + xcb_void_cookie_t xcb_ret; + xcb_dri3_import_syncobj_request_t xcb_out; + int fds[1]; + int fd_index = 0; + + xcb_out.syncobj = syncobj; + xcb_out.drawable = drawable; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + + fds[fd_index++] = syncobj_fd; + xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_dri3_free_syncobj_checked (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 2, + .ext = &xcb_dri3_id, + .opcode = XCB_DRI3_FREE_SYNCOBJ, + .isvoid = 1 + }; + + struct iovec xcb_parts[4]; + xcb_void_cookie_t xcb_ret; + xcb_dri3_free_syncobj_request_t xcb_out; + + xcb_out.syncobj = syncobj; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_dri3_free_syncobj (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 2, + .ext = &xcb_dri3_id, + .opcode = XCB_DRI3_FREE_SYNCOBJ, + .isvoid = 1 + }; + + struct iovec xcb_parts[4]; + xcb_void_cookie_t xcb_ret; + xcb_dri3_free_syncobj_request_t xcb_out; + + xcb_out.syncobj = syncobj; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + diff --git a/lib/libxcb/src/dri3.h b/lib/libxcb/src/dri3.h index a4038f6d6..0968a1e1a 100644 --- a/lib/libxcb/src/dri3.h +++ b/lib/libxcb/src/dri3.h @@ -20,10 +20,21 @@ extern "C" { #endif #define XCB_DRI3_MAJOR_VERSION 1 -#define XCB_DRI3_MINOR_VERSION 3 +#define XCB_DRI3_MINOR_VERSION 4 extern xcb_extension_t xcb_dri3_id; +typedef uint32_t xcb_dri3_syncobj_t; + +/** + * @brief xcb_dri3_syncobj_iterator_t + **/ +typedef struct xcb_dri3_syncobj_iterator_t { + xcb_dri3_syncobj_t *data; + int rem; + int index; +} xcb_dri3_syncobj_iterator_t; + /** * @brief xcb_dri3_query_version_cookie_t **/ @@ -312,6 +323,56 @@ typedef struct xcb_dri3_set_drm_device_in_use_request_t { uint32_t drmMinor; } xcb_dri3_set_drm_device_in_use_request_t; +/** Opcode for xcb_dri3_import_syncobj. */ +#define XCB_DRI3_IMPORT_SYNCOBJ 10 + +/** + * @brief xcb_dri3_import_syncobj_request_t + **/ +typedef struct xcb_dri3_import_syncobj_request_t { + uint8_t major_opcode; + uint8_t minor_opcode; + uint16_t length; + xcb_dri3_syncobj_t syncobj; + xcb_drawable_t drawable; +} xcb_dri3_import_syncobj_request_t; + +/** Opcode for xcb_dri3_free_syncobj. */ +#define XCB_DRI3_FREE_SYNCOBJ 11 + +/** + * @brief xcb_dri3_free_syncobj_request_t + **/ +typedef struct xcb_dri3_free_syncobj_request_t { + uint8_t major_opcode; + uint8_t minor_opcode; + uint16_t length; + xcb_dri3_syncobj_t syncobj; +} xcb_dri3_free_syncobj_request_t; + +/** + * Get the next element of the iterator + * @param i Pointer to a xcb_dri3_syncobj_iterator_t + * + * Get the next element in the iterator. The member rem is + * decreased by one. The member data points to the next + * element. The member index is increased by sizeof(xcb_dri3_syncobj_t) + */ +void +xcb_dri3_syncobj_next (xcb_dri3_syncobj_iterator_t *i); + +/** + * Return the iterator pointing to the last element + * @param i An xcb_dri3_syncobj_iterator_t + * @return The iterator pointing to the last element + * + * Set the current element in the iterator to the last element. + * The member rem is set to 0. The member data points to the + * last element. + */ +xcb_generic_iterator_t +xcb_dri3_syncobj_end (xcb_dri3_syncobj_iterator_t i); + /** * * @param c The connection @@ -872,6 +933,64 @@ xcb_dri3_set_drm_device_in_use (xcb_connection_t *c, uint32_t drmMajor, uint32_t drmMinor); +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_dri3_import_syncobj_checked (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj, + xcb_drawable_t drawable, + int32_t syncobj_fd); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_dri3_import_syncobj (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj, + xcb_drawable_t drawable, + int32_t syncobj_fd); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_dri3_free_syncobj_checked (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_dri3_free_syncobj (xcb_connection_t *c, + xcb_dri3_syncobj_t syncobj); + #ifdef __cplusplus } diff --git a/lib/libxcb/src/present.c b/lib/libxcb/src/present.c index 27aeecc47..4228d7624 100644 --- a/lib/libxcb/src/present.c +++ b/lib/libxcb/src/present.c @@ -18,6 +18,7 @@ #include "randr.h" #include "xfixes.h" #include "sync.h" +#include "dri3.h" xcb_extension_t xcb_present_id = { "Present", 0 }; @@ -485,6 +486,187 @@ xcb_present_query_capabilities_reply (xcb_connection_t * } int +xcb_present_pixmap_synced_sizeof (const void *_buffer, + uint32_t notifies_len) +{ + char *xcb_tmp = (char *)_buffer; + unsigned int xcb_buffer_len = 0; + unsigned int xcb_block_len = 0; + unsigned int xcb_pad = 0; + unsigned int xcb_align_to = 0; + + + xcb_block_len += sizeof(xcb_present_pixmap_synced_request_t); + xcb_tmp += xcb_block_len; + xcb_buffer_len += xcb_block_len; + xcb_block_len = 0; + /* notifies */ + xcb_block_len += notifies_len * sizeof(xcb_present_notify_t); + xcb_tmp += xcb_block_len; + xcb_align_to = ALIGNOF(xcb_present_notify_t); + /* insert padding */ + xcb_pad = -xcb_block_len & (xcb_align_to - 1); + xcb_buffer_len += xcb_block_len + xcb_pad; + if (0 != xcb_pad) { + xcb_tmp += xcb_pad; + xcb_pad = 0; + } + xcb_block_len = 0; + + return xcb_buffer_len; +} + +xcb_void_cookie_t +xcb_present_pixmap_synced_checked (xcb_connection_t *c, + xcb_window_t window, + xcb_pixmap_t pixmap, + uint32_t serial, + xcb_xfixes_region_t valid, + xcb_xfixes_region_t update, + int16_t x_off, + int16_t y_off, + xcb_randr_crtc_t target_crtc, + xcb_dri3_syncobj_t acquire_syncobj, + xcb_dri3_syncobj_t release_syncobj, + uint64_t acquire_point, + uint64_t release_point, + uint32_t options, + uint64_t target_msc, + uint64_t divisor, + uint64_t remainder, + uint32_t notifies_len, + const xcb_present_notify_t *notifies) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 4, + .ext = &xcb_present_id, + .opcode = XCB_PRESENT_PIXMAP_SYNCED, + .isvoid = 1 + }; + + struct iovec xcb_parts[6]; + xcb_void_cookie_t xcb_ret; + xcb_present_pixmap_synced_request_t xcb_out; + + xcb_out.window = window; + xcb_out.pixmap = pixmap; + xcb_out.serial = serial; + xcb_out.valid = valid; + xcb_out.update = update; + xcb_out.x_off = x_off; + xcb_out.y_off = y_off; + xcb_out.target_crtc = target_crtc; + xcb_out.acquire_syncobj = acquire_syncobj; + xcb_out.release_syncobj = release_syncobj; + xcb_out.acquire_point = acquire_point; + xcb_out.release_point = release_point; + xcb_out.options = options; + memset(xcb_out.pad0, 0, 4); + xcb_out.target_msc = target_msc; + xcb_out.divisor = divisor; + xcb_out.remainder = remainder; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_present_notify_t notifies */ + xcb_parts[4].iov_base = (char *) notifies; + xcb_parts[4].iov_len = notifies_len * sizeof(xcb_present_notify_t); + xcb_parts[5].iov_base = 0; + xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + + xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_void_cookie_t +xcb_present_pixmap_synced (xcb_connection_t *c, + xcb_window_t window, + xcb_pixmap_t pixmap, + uint32_t serial, + xcb_xfixes_region_t valid, + xcb_xfixes_region_t update, + int16_t x_off, + int16_t y_off, + xcb_randr_crtc_t target_crtc, + xcb_dri3_syncobj_t acquire_syncobj, + xcb_dri3_syncobj_t release_syncobj, + uint64_t acquire_point, + uint64_t release_point, + uint32_t options, + uint64_t target_msc, + uint64_t divisor, + uint64_t remainder, + uint32_t notifies_len, + const xcb_present_notify_t *notifies) +{ + static const xcb_protocol_request_t xcb_req = { + .count = 4, + .ext = &xcb_present_id, + .opcode = XCB_PRESENT_PIXMAP_SYNCED, + .isvoid = 1 + }; + + struct iovec xcb_parts[6]; + xcb_void_cookie_t xcb_ret; + xcb_present_pixmap_synced_request_t xcb_out; + + xcb_out.window = window; + xcb_out.pixmap = pixmap; + xcb_out.serial = serial; + xcb_out.valid = valid; + xcb_out.update = update; + xcb_out.x_off = x_off; + xcb_out.y_off = y_off; + xcb_out.target_crtc = target_crtc; + xcb_out.acquire_syncobj = acquire_syncobj; + xcb_out.release_syncobj = release_syncobj; + xcb_out.acquire_point = acquire_point; + xcb_out.release_point = release_point; + xcb_out.options = options; + memset(xcb_out.pad0, 0, 4); + xcb_out.target_msc = target_msc; + xcb_out.divisor = divisor; + xcb_out.remainder = remainder; + + xcb_parts[2].iov_base = (char *) &xcb_out; + xcb_parts[2].iov_len = sizeof(xcb_out); + xcb_parts[3].iov_base = 0; + xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; + /* xcb_present_notify_t notifies */ + xcb_parts[4].iov_base = (char *) notifies; + xcb_parts[4].iov_len = notifies_len * sizeof(xcb_present_notify_t); + xcb_parts[5].iov_base = 0; + xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; + + xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); + return xcb_ret; +} + +xcb_present_notify_t * +xcb_present_pixmap_synced_notifies (const xcb_present_pixmap_synced_request_t *R) +{ + return (xcb_present_notify_t *) (R + 1); +} + +int +xcb_present_pixmap_synced_notifies_length (const xcb_present_pixmap_synced_request_t *R) +{ + return (((R->length * 4) - sizeof(xcb_present_pixmap_synced_request_t))/sizeof(xcb_present_notify_t)); +} + +xcb_present_notify_iterator_t +xcb_present_pixmap_synced_notifies_iterator (const xcb_present_pixmap_synced_request_t *R) +{ + xcb_present_notify_iterator_t i; + i.data = (xcb_present_notify_t *) (R + 1); + i.rem = (((R->length * 4) - sizeof(xcb_present_pixmap_synced_request_t))/sizeof(xcb_present_notify_t)); + i.index = (char *) i.data - (char *) R; + return i; +} + +int xcb_present_redirect_notify_sizeof (const void *_buffer, uint32_t notifies_len) { diff --git a/lib/libxcb/src/present.h b/lib/libxcb/src/present.h index e366330a0..963f03591 100644 --- a/lib/libxcb/src/present.h +++ b/lib/libxcb/src/present.h @@ -17,13 +17,14 @@ #include "randr.h" #include "xfixes.h" #include "sync.h" +#include "dri3.h" #ifdef __cplusplus extern "C" { #endif #define XCB_PRESENT_MAJOR_VERSION 1 -#define XCB_PRESENT_MINOR_VERSION 2 +#define XCB_PRESENT_MINOR_VERSION 4 extern xcb_extension_t xcb_present_id; @@ -47,14 +48,17 @@ typedef enum xcb_present_option_t { XCB_PRESENT_OPTION_ASYNC = 1, XCB_PRESENT_OPTION_COPY = 2, XCB_PRESENT_OPTION_UST = 4, - XCB_PRESENT_OPTION_SUBOPTIMAL = 8 + XCB_PRESENT_OPTION_SUBOPTIMAL = 8, + XCB_PRESENT_OPTION_ASYNC_MAY_TEAR = 16 } xcb_present_option_t; typedef enum xcb_present_capability_t { XCB_PRESENT_CAPABILITY_NONE = 0, XCB_PRESENT_CAPABILITY_ASYNC = 1, XCB_PRESENT_CAPABILITY_FENCE = 2, - XCB_PRESENT_CAPABILITY_UST = 4 + XCB_PRESENT_CAPABILITY_UST = 4, + XCB_PRESENT_CAPABILITY_ASYNC_MAY_TEAR = 8, + XCB_PRESENT_CAPABILITY_SYNCOBJ = 16 } xcb_present_capability_t; typedef enum xcb_present_complete_kind_t { @@ -221,6 +225,35 @@ typedef struct xcb_present_query_capabilities_reply_t { uint32_t capabilities; } xcb_present_query_capabilities_reply_t; +/** Opcode for xcb_present_pixmap_synced. */ +#define XCB_PRESENT_PIXMAP_SYNCED 5 + +/** + * @brief xcb_present_pixmap_synced_request_t + **/ +typedef struct xcb_present_pixmap_synced_request_t { + uint8_t major_opcode; + uint8_t minor_opcode; + uint16_t length; + xcb_window_t window; + xcb_pixmap_t pixmap; + uint32_t serial; + xcb_xfixes_region_t valid; + xcb_xfixes_region_t update; + int16_t x_off; + int16_t y_off; + xcb_randr_crtc_t target_crtc; + xcb_dri3_syncobj_t acquire_syncobj; + xcb_dri3_syncobj_t release_syncobj; + uint64_t acquire_point; + uint64_t release_point; + uint32_t options; + uint8_t pad0[4]; + uint64_t target_msc; + uint64_t divisor; + uint64_t remainder; +} xcb_present_pixmap_synced_request_t; + /** Opcode for xcb_present_generic. */ #define XCB_PRESENT_GENERIC 0 @@ -620,6 +653,80 @@ xcb_present_query_capabilities_reply (xcb_connection_t * xcb_generic_error_t **e); int +xcb_present_pixmap_synced_sizeof (const void *_buffer, + uint32_t notifies_len); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + * This form can be used only if the request will not cause + * a reply to be generated. Any returned error will be + * saved for handling by xcb_request_check(). + */ +xcb_void_cookie_t +xcb_present_pixmap_synced_checked (xcb_connection_t *c, + xcb_window_t window, + xcb_pixmap_t pixmap, + uint32_t serial, + xcb_xfixes_region_t valid, + xcb_xfixes_region_t update, + int16_t x_off, + int16_t y_off, + xcb_randr_crtc_t target_crtc, + xcb_dri3_syncobj_t acquire_syncobj, + xcb_dri3_syncobj_t release_syncobj, + uint64_t acquire_point, + uint64_t release_point, + uint32_t options, + uint64_t target_msc, + uint64_t divisor, + uint64_t remainder, + uint32_t notifies_len, + const xcb_present_notify_t *notifies); + +/** + * + * @param c The connection + * @return A cookie + * + * Delivers a request to the X server. + * + */ +xcb_void_cookie_t +xcb_present_pixmap_synced (xcb_connection_t *c, + xcb_window_t window, + xcb_pixmap_t pixmap, + uint32_t serial, + xcb_xfixes_region_t valid, + xcb_xfixes_region_t update, + int16_t x_off, + int16_t y_off, + xcb_randr_crtc_t target_crtc, + xcb_dri3_syncobj_t acquire_syncobj, + xcb_dri3_syncobj_t release_syncobj, + uint64_t acquire_point, + uint64_t release_point, + uint32_t options, + uint64_t target_msc, + uint64_t divisor, + uint64_t remainder, + uint32_t notifies_len, + const xcb_present_notify_t *notifies); + +xcb_present_notify_t * +xcb_present_pixmap_synced_notifies (const xcb_present_pixmap_synced_request_t *R); + +int +xcb_present_pixmap_synced_notifies_length (const xcb_present_pixmap_synced_request_t *R); + +xcb_present_notify_iterator_t +xcb_present_pixmap_synced_notifies_iterator (const xcb_present_pixmap_synced_request_t *R); + +int xcb_present_redirect_notify_sizeof (const void *_buffer, uint32_t notifies_len); diff --git a/lib/libxcb/src/randr.c b/lib/libxcb/src/randr.c index efff1aa6c..24679746f 100644 --- a/lib/libxcb/src/randr.c +++ b/lib/libxcb/src/randr.c @@ -5326,13 +5326,13 @@ xcb_randr_set_monitor_checked (xcb_connection_t *c, xcb_randr_monitor_info_t *monitorinfo) { static const xcb_protocol_request_t xcb_req = { - .count = 4, + .count = 3, .ext = &xcb_randr_id, .opcode = XCB_RANDR_SET_MONITOR, .isvoid = 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_randr_set_monitor_request_t xcb_out; @@ -5357,13 +5357,13 @@ xcb_randr_set_monitor (xcb_connection_t *c, xcb_randr_monitor_info_t *monitorinfo) { static const xcb_protocol_request_t xcb_req = { - .count = 4, + .count = 3, .ext = &xcb_randr_id, .opcode = XCB_RANDR_SET_MONITOR, .isvoid = 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_randr_set_monitor_request_t xcb_out; diff --git a/lib/libxcb/src/shm.h b/lib/libxcb/src/shm.h index 248e0f447..1d22d3bdb 100644 --- a/lib/libxcb/src/shm.h +++ b/lib/libxcb/src/shm.h @@ -284,22 +284,28 @@ xcb_generic_iterator_t xcb_shm_seg_end (xcb_shm_seg_iterator_t i); /** + * @brief Query the version of the MIT-SHM extension. * * @param c The connection * @return A cookie * - * Delivers a request to the X server. + * This is used to determine the version of the MIT-SHM extension supported by the + * X server. Clients MUST NOT make other requests in this extension until a reply + * to this requests indicates the X server supports them. * */ xcb_shm_query_version_cookie_t xcb_shm_query_version (xcb_connection_t *c); /** + * @brief Query the version of the MIT-SHM extension. * * @param c The connection * @return A cookie * - * Delivers a request to the X server. + * This is used to determine the version of the MIT-SHM extension supported by the + * X server. Clients MUST NOT make other requests in this extension until a reply + * to this requests indicates the X server supports them. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be @@ -328,11 +334,18 @@ xcb_shm_query_version_reply (xcb_connection_t *c, xcb_generic_error_t **e); /** + * @brief Attach a System V shared memory segment. * * @param c The connection + * @param shmseg A shared memory segment ID created with xcb_generate_id(). + * @param shmid The System V shared memory segment the server should map. + * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false. * @return A cookie * - * Delivers a request to the X server. + * Attach a System V shared memory segment to the server. This will fail unless + * the server has permission to map the segment. The client may destroy the segment + * as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value in this + * request and with the appropriate serial number. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -345,11 +358,18 @@ xcb_shm_attach_checked (xcb_connection_t *c, uint8_t read_only); /** + * @brief Attach a System V shared memory segment. * * @param c The connection + * @param shmseg A shared memory segment ID created with xcb_generate_id(). + * @param shmid The System V shared memory segment the server should map. + * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false. * @return A cookie * - * Delivers a request to the X server. + * Attach a System V shared memory segment to the server. This will fail unless + * the server has permission to map the segment. The client may destroy the segment + * as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value in this + * request and with the appropriate serial number. * */ xcb_void_cookie_t @@ -359,11 +379,14 @@ xcb_shm_attach (xcb_connection_t *c, uint8_t read_only); /** + * @brief Destroys the specified shared memory segment. * * @param c The connection + * @param shmseg The segment to be destroyed. * @return A cookie * - * Delivers a request to the X server. + * Destroys the specified shared memory segment. This will never fail unless the + * segment number is incorrect. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -374,11 +397,14 @@ xcb_shm_detach_checked (xcb_connection_t *c, xcb_shm_seg_t shmseg); /** + * @brief Destroys the specified shared memory segment. * * @param c The connection + * @param shmseg The segment to be destroyed. * @return A cookie * - * Delivers a request to the X server. + * Destroys the specified shared memory segment. This will never fail unless the + * segment number is incorrect. * */ xcb_void_cookie_t @@ -386,11 +412,37 @@ xcb_shm_detach (xcb_connection_t *c, xcb_shm_seg_t shmseg); /** + * @brief Copy data from the shared memory to the specified drawable. * * @param c The connection + * @param drawable The drawable to draw to. + * @param gc The graphics context to use. + * @param total_width The total width of the source image. + * @param total_height The total height of the source image. + * @param src_x The source X coordinate of the sub-image to copy. + * @param src_y The source Y coordinate of the sub-image to copy. + * @param src_width The width, in source image coordinates, of the data to copy from the source. + * The X server will use this to determine the amount of data to copy. The amount + * of the destination image that is overwritten is determined automatically. + * @param src_height The height, in source image coordinates, of the data to copy from the source. + * The X server will use this to determine the amount of data to copy. The amount + * of the destination image that is overwritten is determined automatically. + * @param dst_x The X coordinate on the destination drawable to copy to. + * @param dst_y The Y coordinate on the destination drawable to copy to. + * @param depth The depth to use. + * @param format The format of the image being drawn. If it is XYBitmap, depth must be 1, or a + * "BadMatch" error results. The foreground pixel in the GC determines the source + * for the one bits in the image, and the background pixel determines the source + * for the zero bits. For XYPixmap and ZPixmap, the depth must match the depth of + * the drawable, or a "BadMatch" error results. + * @param send_event True if the server should send an XCB_SHM_COMPLETION event when the blit + * completes. + * @param offset The offset that the source image starts at. * @return A cookie * - * Delivers a request to the X server. + * Copy data from the shared memory to the specified drawable. The amount of bytes + * written to the destination image is always equal to the number of bytes read + * from the shared memory segment. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -415,11 +467,37 @@ xcb_shm_put_image_checked (xcb_connection_t *c, uint32_t offset); /** + * @brief Copy data from the shared memory to the specified drawable. * * @param c The connection + * @param drawable The drawable to draw to. + * @param gc The graphics context to use. + * @param total_width The total width of the source image. + * @param total_height The total height of the source image. + * @param src_x The source X coordinate of the sub-image to copy. + * @param src_y The source Y coordinate of the sub-image to copy. + * @param src_width The width, in source image coordinates, of the data to copy from the source. + * The X server will use this to determine the amount of data to copy. The amount + * of the destination image that is overwritten is determined automatically. + * @param src_height The height, in source image coordinates, of the data to copy from the source. + * The X server will use this to determine the amount of data to copy. The amount + * of the destination image that is overwritten is determined automatically. + * @param dst_x The X coordinate on the destination drawable to copy to. + * @param dst_y The Y coordinate on the destination drawable to copy to. + * @param depth The depth to use. + * @param format The format of the image being drawn. If it is XYBitmap, depth must be 1, or a + * "BadMatch" error results. The foreground pixel in the GC determines the source + * for the one bits in the image, and the background pixel determines the source + * for the zero bits. For XYPixmap and ZPixmap, the depth must match the depth of + * the drawable, or a "BadMatch" error results. + * @param send_event True if the server should send an XCB_SHM_COMPLETION event when the blit + * completes. + * @param offset The offset that the source image starts at. * @return A cookie * - * Delivers a request to the X server. + * Copy data from the shared memory to the specified drawable. The amount of bytes + * written to the destination image is always equal to the number of bytes read + * from the shared memory segment. * */ xcb_void_cookie_t @@ -441,11 +519,23 @@ xcb_shm_put_image (xcb_connection_t *c, uint32_t offset); /** + * @brief Copies data from the specified drawable to the shared memory segment. * * @param c The connection + * @param drawable The drawable to copy the image out of. + * @param x The X coordinate in the drawable to begin copying at. + * @param y The Y coordinate in the drawable to begin copying at. + * @param width The width of the image to copy. + * @param height The height of the image to copy. + * @param plane_mask A mask that determines which planes are used. + * @param format The format to use for the copy (???). + * @param shmseg The destination shared memory segment. + * @param offset The offset in the shared memory segment to copy data to. * @return A cookie * - * Delivers a request to the X server. + * Copy data from the specified drawable to the shared memory segment. The amount + * of bytes written to the destination image is always equal to the number of bytes + * read from the shared memory segment. * */ xcb_shm_get_image_cookie_t @@ -461,11 +551,23 @@ xcb_shm_get_image (xcb_connection_t *c, uint32_t offset); /** + * @brief Copies data from the specified drawable to the shared memory segment. * * @param c The connection + * @param drawable The drawable to copy the image out of. + * @param x The X coordinate in the drawable to begin copying at. + * @param y The Y coordinate in the drawable to begin copying at. + * @param width The width of the image to copy. + * @param height The height of the image to copy. + * @param plane_mask A mask that determines which planes are used. + * @param format The format to use for the copy (???). + * @param shmseg The destination shared memory segment. + * @param offset The offset in the shared memory segment to copy data to. * @return A cookie * - * Delivers a request to the X server. + * Copy data from the specified drawable to the shared memory segment. The amount + * of bytes written to the destination image is always equal to the number of bytes + * read from the shared memory segment. * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be @@ -503,11 +605,21 @@ xcb_shm_get_image_reply (xcb_connection_t *c, xcb_generic_error_t **e); /** + * @brief Create a pixmap backed by shared memory. * * @param c The connection + * @param pid A pixmap ID created with xcb_generate_id(). + * @param drawable The drawable to create the pixmap in. + * @param width The width of the pixmap to create. Must be nonzero, or a Value error results. + * @param height The height of the pixmap to create. Must be nonzero, or a Value error results. + * @param depth The depth of the pixmap to create. Must be nonzero, or a Value error results. + * @param shmseg The shared memory segment to use to create the pixmap. + * @param offset The offset in the segment to create the pixmap at. * @return A cookie * - * Delivers a request to the X server. + * Create a pixmap backed by shared memory. Writes to the shared memory will be + * reflected in the contents of the pixmap, and writes to the pixmap will be + * reflected in the contents of the shared memory. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -524,11 +636,21 @@ xcb_shm_create_pixmap_checked (xcb_connection_t *c, uint32_t offset); /** + * @brief Create a pixmap backed by shared memory. * * @param c The connection + * @param pid A pixmap ID created with xcb_generate_id(). + * @param drawable The drawable to create the pixmap in. + * @param width The width of the pixmap to create. Must be nonzero, or a Value error results. + * @param height The height of the pixmap to create. Must be nonzero, or a Value error results. + * @param depth The depth of the pixmap to create. Must be nonzero, or a Value error results. + * @param shmseg The shared memory segment to use to create the pixmap. + * @param offset The offset in the segment to create the pixmap at. * @return A cookie * - * Delivers a request to the X server. + * Create a pixmap backed by shared memory. Writes to the shared memory will be + * reflected in the contents of the pixmap, and writes to the pixmap will be + * reflected in the contents of the shared memory. * */ xcb_void_cookie_t @@ -542,11 +664,17 @@ xcb_shm_create_pixmap (xcb_connection_t *c, uint32_t offset); /** + * @brief Create a shared memory segment * * @param c The connection + * @param shmseg A shared memory segment ID created with xcb_generate_id(). + * @param shm_fd The file descriptor the server should mmap(). + * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false. * @return A cookie * - * Delivers a request to the X server. + * Create a shared memory segment. The file descriptor will be mapped at offset + * zero, and the size will be obtained using fstat(). A zero size will result in a + * Value error. * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -559,11 +687,17 @@ xcb_shm_attach_fd_checked (xcb_connection_t *c, uint8_t read_only); /** + * @brief Create a shared memory segment * * @param c The connection + * @param shmseg A shared memory segment ID created with xcb_generate_id(). + * @param shm_fd The file descriptor the server should mmap(). + * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false. * @return A cookie * - * Delivers a request to the X server. + * Create a shared memory segment. The file descriptor will be mapped at offset + * zero, and the size will be obtained using fstat(). A zero size will result in a + * Value error. * */ xcb_void_cookie_t @@ -573,11 +707,16 @@ xcb_shm_attach_fd (xcb_connection_t *c, uint8_t read_only); /** + * @brief Asks the server to allocate a shared memory segment. * * @param c The connection + * @param shmseg A shared memory segment ID created with xcb_generate_id(). + * @param size The size of the segment to create. + * @param read_only True if the server should map the segment read-only; otherwise false. * @return A cookie * - * Delivers a request to the X server. + * Asks the server to allocate a shared memory segment. The server’s reply will + * include a file descriptor for the client to pass to mmap(). * */ xcb_shm_create_segment_cookie_t @@ -587,11 +726,16 @@ xcb_shm_create_segment (xcb_connection_t *c, uint8_t read_only); /** + * @brief Asks the server to allocate a shared memory segment. * * @param c The connection + * @param shmseg A shared memory segment ID created with xcb_generate_id(). + * @param size The size of the segment to create. + * @param read_only True if the server should map the segment read-only; otherwise false. * @return A cookie * - * Delivers a request to the X server. + * Asks the server to allocate a shared memory segment. The server’s reply will + * include a file descriptor for the client to pass to mmap(). * * This form can be used only if the request will cause * a reply to be generated. Any returned error will be diff --git a/lib/libxcb/src/xfixes.h b/lib/libxcb/src/xfixes.h index cf95f63c7..574b15def 100644 --- a/lib/libxcb/src/xfixes.h +++ b/lib/libxcb/src/xfixes.h @@ -739,7 +739,15 @@ typedef struct xcb_xfixes_delete_pointer_barrier_request_t { typedef enum xcb_xfixes_client_disconnect_flags_t { XCB_XFIXES_CLIENT_DISCONNECT_FLAGS_DEFAULT = 0, +/**< The default behavior for regular clients: the X11 server won't terminate as long +as such clients are still connected, and should this client disconnect, the +server will continue running so long as other clients (that have not set +XFixesClientDisconnectFlagTerminate) are connected. */ + XCB_XFIXES_CLIENT_DISCONNECT_FLAGS_TERMINATE = 1 +/**< Indicates to the X11 server that it can ignore the client and terminate itself +even though the client is still connected to the X11 server. */ + } xcb_xfixes_client_disconnect_flags_t; /** Opcode for xcb_xfixes_set_client_disconnect_mode. */ @@ -2046,11 +2054,13 @@ xcb_xfixes_delete_pointer_barrier (xcb_connection_t *c, xcb_xfixes_barrier_t barrier); /** + * @brief Sets the disconnect mode for the client. * * @param c The connection + * @param disconnect_mode The new disconnect mode. * @return A cookie * - * Delivers a request to the X server. + * No description yet * * This form can be used only if the request will not cause * a reply to be generated. Any returned error will be @@ -2061,11 +2071,13 @@ xcb_xfixes_set_client_disconnect_mode_checked (xcb_connection_t *c, uint32_t disconnect_mode); /** + * @brief Sets the disconnect mode for the client. * * @param c The connection + * @param disconnect_mode The new disconnect mode. * @return A cookie * - * Delivers a request to the X server. + * No description yet * */ xcb_void_cookie_t diff --git a/lib/libxcb/src/xinput.c b/lib/libxcb/src/xinput.c index 38fc6c486..159521a77 100644 --- a/lib/libxcb/src/xinput.c +++ b/lib/libxcb/src/xinput.c @@ -4325,13 +4325,13 @@ xcb_input_change_feedback_control_checked (xcb_connection_t *c, xcb_input_feedback_ctl_t *feedback) { static const xcb_protocol_request_t xcb_req = { - .count = 4, + .count = 3, .ext = &xcb_input_id, .opcode = XCB_INPUT_CHANGE_FEEDBACK_CONTROL, .isvoid = 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_input_change_feedback_control_request_t xcb_out; @@ -4361,13 +4361,13 @@ xcb_input_change_feedback_control (xcb_connection_t *c, xcb_input_feedback_ctl_t *feedback) { static const xcb_protocol_request_t xcb_req = { - .count = 4, + .count = 3, .ext = &xcb_input_id, .opcode = XCB_INPUT_CHANGE_FEEDBACK_CONTROL, .isvoid = 1 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_void_cookie_t xcb_ret; xcb_input_change_feedback_control_request_t xcb_out; @@ -7311,13 +7311,13 @@ xcb_input_change_device_control (xcb_connection_t *c, xcb_input_device_ctl_t *control) { static const xcb_protocol_request_t xcb_req = { - .count = 4, + .count = 3, .ext = &xcb_input_id, .opcode = XCB_INPUT_CHANGE_DEVICE_CONTROL, .isvoid = 0 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_input_change_device_control_cookie_t xcb_ret; xcb_input_change_device_control_request_t xcb_out; @@ -7345,13 +7345,13 @@ xcb_input_change_device_control_unchecked (xcb_connection_t *c, xcb_input_device_ctl_t *control) { static const xcb_protocol_request_t xcb_req = { - .count = 4, + .count = 3, .ext = &xcb_input_id, .opcode = XCB_INPUT_CHANGE_DEVICE_CONTROL, .isvoid = 0 }; - struct iovec xcb_parts[6]; + struct iovec xcb_parts[5]; xcb_input_change_device_control_cookie_t xcb_ret; xcb_input_change_device_control_request_t xcb_out; |