xcb_query_extension_reply_t的解释

xcb_query_extension

今天定位问题时发现, Xorg配置文件中配置了DRI3,但是应用程序通过xcb_query_extension查找却没有找到,根据xcb_query_extension的返回值xcb_query_extension_reply_t可以确定是否存在extension。

// request function
xcb_query_extension_cookie_t xcb_query_extension(xcb_connection_t *conn, uint16_t name_len, const char *name);
//reply function
xcb_query_extension_reply_t *xcb_query_extension_reply(xcb_connection_t *conn, xcb_query_extension_cookie_t cookie, xcb_generic_error_t **e);

xcb_query_extension_reply_t 各个字段的含义:

  • response_type
    The type of this reply, in this case XCB_QUERY_EXTENSION. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other.
  • sequence
    The sequence number of the last request processed by the X11 server.
  • length
    The length of the reply, in words (a word is 4 bytes).
  • present
    Whether the extension is present on this X11 server.
  • major_opcode
    The major opcode for requests.
  • first_event
    The first event code, if any.
  • first_error
    The first error code, if any.

为什么Xorg配置了DRI3扩展,却没有查找到呢?

应该是我当前的显卡没有/dev/dri/renderDxxx设备节点,不支持直接渲染

参考:https://manpages.debian.org/testing/libxcb-doc/xcb_query_extension_reply.3.en.html