dri2proto.txt 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  1. The DRI2 Extension
  2. Version 2.0
  3. 2008-09-04
  4. Kristian Høgsberg
  5. krh@redhat.com
  6. Red Hat, Inc
  7. 1. Introduction
  8. The DRI2 extension is designed to associate and access auxillary
  9. rendering buffers with an X drawable.
  10. DRI2 is a essentially a helper extension to support implementation of
  11. direct rendering drivers/libraries/technologies.
  12. The main consumer of this extension will be a direct rendering OpenGL
  13. driver, but the DRI2 extension is not designed to be OpenGL specific.
  14. Direct rendering implementations of OpenVG, Xv, cairo and other
  15. graphics APIs should find the functionality exposed by this extension
  16. helpful and hopefully sufficient.
  17. Relation to XF86DRI
  18. 1.1. Acknowledgements
  19. Kevin E. Martin <kem@redhat.com>
  20. Keith Packard <keithp@keithp.com>
  21. Eric Anholt <eric@anholt.net>
  22. Keith Whitwell <keith@tungstengraphics.com>
  23. Jerome Glisse <glisse@freedesktop.org>
  24. Ian Romanick <ian.d.romanick@intel.com>
  25. Michel Dänzer <michel@tungstengraphics.com>
  26. Jesse Barnes <jbarnes@virtuousgeek.org>
  27. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  28. 2. DRI2 Concepts
  29. 2.1. Attachment points
  30. Stolen from OpenGL FBOs, I guess.
  31. 2.2. Kernel rendering manager
  32. This specification assumes a rendering architechture, where an
  33. underlying kernel rendering manager that can provide 32 bit integer
  34. handles to video memory buffers. These handles can be passed between
  35. processes, which, through a direct rendering driver, submit rendering
  36. to the kernel rendering manager, targeting and/or sourcing from these
  37. buffers. This extension provides a means to communicate about such
  38. buffers as associated with an X drawable.
  39. The details of how the a direct rendering driver use the buffer names
  40. and submit the rendering requests is outside the scope of this
  41. specification. However, Appendix B does discuss implementation of
  42. this specification on the Graphics Execution Manager (GEM).
  43. 2.3. Request ordering
  44. No ordering between swap buffers and X rendering. X rendering to src
  45. buffers will block if they have a vblank pending.
  46. 2.4 Authentication model
  47. The purpose of the DRM authentication scheme is to grant access to the
  48. kernel rendering manager buffers created by the X server if, and only
  49. if, the client has access to the X server. This is achieved in a
  50. three-step protocol:
  51. 1) The client gets a token from the kernel rendering manager
  52. that uniquely identifies it. The token is a 32 bit integer.
  53. 2) The client passes the token to the X server in the
  54. DRI2Authenticate request. This request is a round trip to
  55. make sure the X server has received and processed the
  56. authentication before the client starts accessing the DRM.
  57. 3) The X server authorizes the client by passing the token to
  58. the kernel rendering manager.
  59. A kernel rendering manager can choose not to implement any
  60. authentication and just allow access to all buffers.
  61. 2.5 Rendering to the X front buffer
  62. OpenGL allows the client to render to the front buffer, either by
  63. using a single-buffered configuration or but explicitly setting the
  64. draw buffer to GL_FRONT_LEFT. Not allowed!
  65. The client must ask for a fake front buffer, render to that and then
  66. use DRI2CopyRegion to copy contents back and forth between the fake
  67. front buffer and the real front buffer. When X and direct rendering
  68. to a front buffer is interleaved, it is the responsibility of the
  69. application to synchronize access using glXWaitGL and glXWaitX. A
  70. DRI2 implementation of direct rendering GLX, should use these enty
  71. points to copy contents back and forth to as necessary to ensure
  72. consistent rendering.
  73. The client may also use the DRI2SwapBuffers function to request a swap
  74. of the front and back buffers. If the display server supports it, this
  75. operation may be preferred, since it may be easier and/or more performant
  76. for the server to perform a simple buffer swap rather than a blit.
  77. 2.6 Synchronizing rendering
  78. DRI2 provides several methods for synchronizing drawing with various events.
  79. The protocol for these methods is based on the SGI_video_sync and
  80. OML_sync_control GLX extensions. Using the DRI2WaitMSC request, a client
  81. can wait for a specific frame count or divisor/remainder before continuing
  82. its processing. With the DRI2WaitSBC request, clients can block until a given
  83. swap count is reached (as incremented by DRI2SwapBuffers). Finally, using
  84. DRI2SwapBuffers, clients can limit their frame rate by specifying a swap
  85. interval using the swap interval call (currently only available through GLX)
  86. or by using the OML swap buffers routine.
  87. 2.7 Events
  88. DRI2 provides an event to indicate when a DRI2SwapBuffers request has
  89. been completed. This can be used to throttle drawing on the client
  90. side and tie into application main loops.
  91. Another event is generated when the validity of the requested buffers
  92. changes.
  93. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  94. 3. Data Types
  95. The server side region support specified in the Xfixes extension
  96. version 2 is used in the CopyRegion request.
  97. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  98. 4. Errors
  99. No errors are defined by the DRI2 extension.
  100. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  101. 5. Events
  102. The only events provided by DRI2 are DRI2_BufferSwapComplete
  103. and DRI2InvalidateBuffers.
  104. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  105. 6. Protocol Types
  106. DRI2DRIVER { DRI2DriverDRI
  107. DRI2DriverVDPAU }
  108. These values describe the type of driver the client will want
  109. to load. The server sends back the name of the driver to use
  110. for the screen in question.
  111. DRI2ATTACHMENT { DRI2BufferFrontLeft
  112. DRI2BufferBackLeft
  113. DRI2BufferFrontRight
  114. DRI2BufferBackRight
  115. DRI2BufferDepth
  116. DRI2BufferStencil
  117. DRI2BufferAccum
  118. DRI2BufferFakeFrontLeft
  119. DRI2BufferFakeFrontRight
  120. DRI2BufferDepthStencil
  121. DRI2BufferHiz }
  122. These values describe various attachment points for DRI2
  123. buffers.
  124. DRI2BUFFER { attachment: CARD32
  125. name: CARD32
  126. pitch: CARD32
  127. cpp: CARD32
  128. flags: CARD32 }
  129. The DRI2BUFFER describes an auxillary rendering buffer
  130. associated with an X drawable. 'attachment' describes the
  131. attachment point for the buffer, 'name' is the name of the
  132. underlying kernel buffer,
  133. DRI2ATTACH_FORMAT { attachment: CARD32
  134. format: CARD32 }
  135. The DRI2ATTACH_FORMAT describes an attachment and the associated
  136. format. 'attachment' describes the attachment point for the buffer,
  137. 'format' describes an opaque, device-dependent format for the buffer.
  138. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  139. 7. Extension Initialization
  140. The name of this extension is "DRI2".
  141. ┌───
  142. DRI2QueryVersion
  143. client-major-version: CARD32
  144. client-minor-version: CARD32
  145. major-version: CARD32
  146. minor-version: CARD32
  147. └───
  148. The client sends the highest supported version to the server
  149. and the server sends the highest version it supports, but no
  150. higher than the requested version. Major versions changes can
  151. introduce incompatibilities in existing functionality, minor
  152. version changes introduce only backward compatible changes.
  153. It is the clients responsibility to ensure that the server
  154. supports a version which is compatible with its expectations.
  155. Backwards compatible changes included addition of new
  156. requests, but also new value types in the DRI2CopyRegion
  157. request. When new values are introduced, the minor version
  158. will be increased so the client can know which values the X
  159. server understands from the version number.
  160. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  161. 8. Extension Requests
  162. ┌───
  163. DRI2Connect
  164. window: WINDOW
  165. driverType: DRI2DRIVER
  166. driver: STRING
  167. device: STRING
  168. └───
  169. Returns the driver name and device file to use for the
  170. specified driver type for the screen associated with 'window'.
  171. 'type' identifies the type of driver to query for.
  172. 'driver' is the name of the driver to load. The client is
  173. assumed to know where to look for the drivers and what to do
  174. with it.
  175. 'device' is the filename of the DRM device file.
  176. If the client is not local, or the request driver type is
  177. unknown or not available, 'driver' and 'device' will be empty
  178. strings. We are not using an regular X
  179. error here to indicate failure, which will allow the client
  180. fall back to other options more easily.
  181. ISSUE: We could add the list of supported attachments and the
  182. supported DRI2CopyRegion values here (just the bitmask of all
  183. supported values).
  184. ┌───
  185. DRI2Authenticate
  186. window: WINDOW
  187. token: CARD32
  188. authenticated: CARD32
  189. └───
  190. Errors: Window
  191. Request that the X server authenticates 'token', allowing the
  192. client to access the DRM buffers created by the X server on
  193. the screen associated with 'window'.
  194. Authentication shouldn't fail at this point, except if an
  195. invalid token is passed, in which case authenticated is False.
  196. ┌───
  197. DRI2GetBuffers
  198. drawable: DRAWABLE
  199. attachments: LISTofDRI2ATTACHMENTS
  200. width, height: CARD32
  201. buffers: LISTofDRI2BUFFER
  202. └───
  203. Errors: Window
  204. Get buffers for the provided attachment points for the given
  205. drawable.
  206. If the DDX driver does not support one or more of the
  207. specified attachment points, a Value error is generated, with
  208. the first unsupported attachment point as the error value.
  209. 'width' and 'height' describes the dimensions of the drawable.
  210. 'buffers' is a list of DRI2BUFFER for the given DRI2
  211. attachment points.
  212. ┌───
  213. DRI2CopyRegion
  214. drawable: DRAWABLE
  215. region: REGION
  216. source: DRI2ATTACHMENT
  217. destination: DRI2ATTACHMENT
  218. └───
  219. Errors: Window, Value
  220. Schedule a copy from one DRI2 buffer to another.
  221. The DRICopyRegion request has a reply but it is empty. The
  222. reply is there to let the direct rendering client wait until
  223. the server has seen the request before proceeding with
  224. rendering the next frame.
  225. ┌───
  226. DRI2SwapBuffers
  227. drawable: DRAWABLE
  228. count: two CARD32s
  229. └───
  230. Errors: Window
  231. Schedule a swap of the front and back buffers with the display
  232. server.
  233. Returns the swap count value when the swap will actually occur (e.g.
  234. the last queued swap count + (pending swap count * swap interval)).
  235. This request is only available with protocol version 1.2 or
  236. later.
  237. ┌───
  238. DRI2GetBuffersWithFormat
  239. drawable: DRAWABLE
  240. attachments: LISTofDRI2ATTACH_FORMAT
  241. width, height: CARD32
  242. buffers: LISTofDRI2BUFFER
  243. └───
  244. Errors: Window
  245. Get buffers for the provided attachment points with the specified
  246. formats for the given drawable.
  247. If the DDX driver does not support one or more of the
  248. specified attachment points or formats, a Value error is generated,
  249. with the first unsupported attachment point as the error value.
  250. 'width' and 'height' describes the dimensions of the drawable.
  251. 'buffers' is a list of DRI2BUFFER for the given DRI2
  252. attachment points.
  253. This request is only available with protocol version 1.1 or
  254. later.
  255. ┌───
  256. DRI2GetMSC
  257. drawable: DRAWABLE
  258. ust, msc, sbc: CARD64
  259. └───
  260. Errors: Window
  261. Get the current media stamp counter (MSC) and swap buffer count (SBC)
  262. along with the unadjusted system time (UST) when the MSC was last
  263. incremented.
  264. This request is only available with protocol version 1.2 or
  265. later.
  266. ┌───
  267. DRI2WaitMSC
  268. drawable: DRAWABLE
  269. target_msc: two CARD32s
  270. divisor: two CARD32s
  271. remainder: two CARD32s
  272. ust, msc, sbc: CARD64
  273. └───
  274. Errors: Window
  275. Blocks the client until either the frame count reaches target_msc or,
  276. if the frame count is already greater than target_msc when the request
  277. is received, until the frame count % divisor = remainder. If divisor
  278. is 0, the client will be unblocked if the frame count is greater than
  279. or equal to the target_msc.
  280. Returns the current media stamp counter (MSC) and swap buffer count
  281. (SBC) along with the unadjusted system time (UST) when the MSC was last
  282. incremented.
  283. This request is only available with protocol version 1.2 or
  284. later.
  285. ┌───
  286. DRI2WaitSBC
  287. drawable: DRAWABLE
  288. target_sbc: two CARD32s
  289. ust, msc, sbc: CARD64
  290. └───
  291. Errors: Window
  292. Blocks the client until the swap buffer count reaches target_sbc. If
  293. the swap buffer count is already greater than or equal to target_sbc
  294. when the request is recieved, this request will return immediately.
  295. If target_sbc is 0, this request will block the client until all
  296. previous DRI2SwapBuffers requests have completed.
  297. Returns the current media stamp counter (MSC) and swap buffer count
  298. (SBC) along with the unadjusted system time (UST) when the MSC was last
  299. incremented.
  300. This request is only available with protocol version 1.2 or
  301. later.
  302. ┌───
  303. DRI2SwapInterval
  304. drawable: DRAWABLE
  305. interval: CARD32
  306. └───
  307. Errors: Window
  308. Sets the swap interval for DRAWABLE. This will throttle
  309. DRI2SwapBuffers requests to swap at most once per interval frames,
  310. which is useful useful for limiting the frame rate.
  311. ┌───
  312. DRI2GetParam
  313. drawable: DRAWABLE
  314. param: CARD32
  315. is_param_recognized: BOOL
  316. value: CARD64
  317. └───
  318. Errors: Drawable
  319. Get the value of a parameter. The parameter's value is looked up on
  320. the screen associated with 'drawable'.
  321. Parameter names in which the value of the most significant byte is
  322. 0 are reserved for the X server. Currently, no such parameter names
  323. are defined. (When any such names are defined, they will be defined in
  324. this extension specification and its associated headers).
  325. Parameter names in which the byte's value is 1 are reserved for the
  326. DDX. Such names are private to each driver and shall be defined in the
  327. respective driver's headers.
  328. Parameter names in which the byte's value is neither 0 nor 1 are
  329. reserved for future use.
  330. Possible values of 'is_param_recognized' are true (1) and false (0).
  331. If false, then 'value' is undefined.
  332. This request is only available with protocol version 1.4 or later.
  333. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  334. 9. Extension Events
  335. ┌───
  336. DRI2BufferSwapComplete
  337. event_type: CARD16
  338. drawable: CARD32
  339. ust: CARD64
  340. msc: CARD64
  341. sbc: CARD64
  342. └───
  343. This event reports the status of the last DRI2SwapBuffers event to
  344. the client. The event type should be one of DRI2_EXCHANGE_COMPLETE,
  345. indicating a successful buffer exchange, DRI2_BLIT_COMPLETE, indicating
  346. the swap was performed with a blit, and DRI2_FLIP_COMPLETE, indicating
  347. a full page flip was completed.
  348. ┌───
  349. DRI2InvalidateBuffers
  350. drawable: CARD32
  351. └───
  352. This event is generated when the buffers the client had
  353. requested for 'drawable' (with DRI2GetBuffers or
  354. DRI2GetBuffersWithFormat) become inappropriate because they
  355. don't match the drawable dimensions anymore, or a buffer swap
  356. has been performed.
  357. Note that the server is only required to warn the client once
  358. about this condition, until the client takes care of bringing
  359. them back up-to-date with another GetBuffers request.
  360. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  361. 10. Extension Versioning
  362. The DRI2 extension has undergone a number of revisions before
  363. 1.0: Released, but never used. Relied on a number of
  364. constructs from the XF86DRI extension, such as a
  365. shared memory area (SAREA) to communicate changes in
  366. cliprects and window sizes, and
  367. 1.99.1: Move the swap buffer functionality into the X server,
  368. introduce SwapBuffer request to copy back buffer
  369. contents to the X drawable.
  370. 1.99.2: Rethink the SwapBuffer request as an asynchronous
  371. request to copy a region between DRI2 buffers. Drop
  372. CreateDrawable and DestroyDrawable, update Connect to
  373. support different driver types and to send the
  374. authentication group.
  375. 1.99.3: Drop the bitmask argument intended to indicate
  376. presence of optional arguments for CopyRegion.
  377. 2.0: Awesomeness!
  378. 2.1: True excellence. Added DRI2GetBuffersWithFormat to allow
  379. more flexible object creation.
  380. 2.2: Approaching perfection. Added requests for swapbuffers,
  381. MSC and SBC related requests, and events.
  382. 2.3: Added the DRI2InvalidateBuffers event.
  383. 2.6: Enlightenment attained. Added the DRI2BufferHiz attachment.
  384. 2.7: Added the DRI2GetParam request.
  385. Compatibility up to 2.0 is not preserved, but was also never released.
  386. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  387. 11. Relationship with other extensions
  388. As an extension designed to support other extensions, there is
  389. naturally some interactions with other extensions.
  390. 11.1 GLX
  391. The GL auxilary buffers map directly to the DRI2 buffers... eh
  392. 11.2 DBE
  393. The DBE back buffer must correspond to the DRI2_BUFFER_FRONT_LEFT
  394. DRI2 buffer for servers that support both DBE and DRI2.
  395. 11.3 XvMC / Xv
  396. We might add a DRI2_BUFFER_YUV to do vsynced colorspace conversion
  397. blits. Maybe... not really sure.
  398. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  399. Appendix A. Protocol Encoding
  400. Syntactic Conventions
  401. This document uses the same syntactic conventions as the core X
  402. protocol encoding document.
  403. A.1 Common Types
  404. ┌───
  405. DRI2DRIVER
  406. 0x0 DRI2DriverDRI
  407. 0x1 DRI2DriverVDPAU
  408. └───
  409. ┌───
  410. DRI2ATTACHMENT
  411. 0x0 DRI2BufferFrontLeft
  412. 0x1 DRI2BufferBackLeft
  413. 0x2 DRI2BufferFrontRight
  414. 0x3 DRI2BufferBackRight
  415. 0x4 DRI2BufferDepth
  416. 0x5 DRI2BufferStencil
  417. 0x6 DRI2BufferAccum
  418. 0x7 DRI2BufferFakeFrontLeft
  419. 0x8 DRI2BufferFakeFrontRight
  420. 0x9 DRI2BufferDepthStencil
  421. 0xa DRI2BufferHiz
  422. └───
  423. Used to encode the possible attachment points. The attachment
  424. DRI2BufferDepthStencil is only available with protocol version 1.1 or
  425. later.
  426. ┌───
  427. DRI2BUFFER
  428. 4 CARD32 attachment
  429. 4 CARD32 name
  430. 4 CARD32 pitch
  431. 4 CARD32 cpp
  432. 4 CARD32 flags
  433. └───
  434. A DRI2 buffer specifies the attachment, the kernel memory
  435. manager name, the pitch and chars per pixel for a buffer
  436. attached to a given drawable.
  437. ┌───
  438. DRI2ATTACH_FORMAT
  439. 4 CARD32 attachment
  440. 4 CARD32 format
  441. └───
  442. Used to describe the attachment and format requested from the server.
  443. This data type is only available with protocol version 1.1 or
  444. later.
  445. A.2 Protocol Requests
  446. ┌───
  447. DRI2QueryVersion
  448. 1 CARD8 major opcode
  449. 1 0 DRI2 opcode
  450. 2 3 length
  451. 4 CARD32 major version
  452. 4 CARD32 minor version
  453. 1 1 Reply
  454. 1 unused
  455. 2 CARD16 sequence number
  456. 4 0 reply length
  457. 4 CARD32 major version
  458. 4 CARD32 minor version
  459. 16 unused
  460. └───
  461. ┌───
  462. DRI2Connect
  463. 1 CARD8 major opcode
  464. 1 1 DRI2 opcode
  465. 2 3 length
  466. 4 WINDOW window
  467. 4 CARD32 driver type
  468. 1 1 Reply
  469. 1 unused
  470. 2 CARD16 sequence number
  471. 4 (n+m+p+q)/4 reply length
  472. 4 n driver name length
  473. 4 m device name length
  474. 16 unused
  475. n CARD8 driver name
  476. p unused, p=pad(n)
  477. m CARD8 device name
  478. q unused, q=pad(m)
  479. └───
  480. ┌───
  481. DRI2Authenticate
  482. 1 CARD8 major opcode
  483. 1 2 DRI2 opcode
  484. 2 3 length
  485. 4 WINDOW window
  486. 4 CARD32 authentication token
  487. 1 1 Reply
  488. 1 unused
  489. 2 CARD16 sequence number
  490. 4 0 reply length
  491. 4 CARD32 authenticated
  492. 20 unused
  493. └───
  494. ┌───
  495. DRI2GetBuffers
  496. 1 CARD8 major opcode
  497. 1 5 DRI2 opcode
  498. 2 3 length
  499. 4 DRAWABLE drawable
  500. 4 n number of attachments
  501. 4n LISTofDRI2ATTACHMENTS attachments
  502. 1 1 Reply
  503. 1 unused
  504. 2 CARD16 sequence number
  505. 4 0 reply length
  506. 4 CARD32 width of drawable
  507. 4 CARD32 height of drawable
  508. 4 CARD32 buffer count
  509. 12 unused
  510. 5n LISTofDRI2BUFFER buffers
  511. └───
  512. ┌───
  513. DRI2CopyRegion
  514. 1 CARD8 major opcode
  515. 1 6 DRI2 opcode
  516. 2 3 length
  517. 4 DRAWABLE drawable
  518. 4 REGION region
  519. 4 DRI2ATTACHMENT source
  520. 4 DRI2ATTACHMENT destination
  521. 1 1 Reply
  522. 1 unused
  523. 2 CARD16 sequence number
  524. 4 0 reply length
  525. 24 unused
  526. └───
  527. ┌───
  528. DRI2GetBuffersWithFormat
  529. 1 CARD8 major opcode
  530. 1 7 DRI2 opcode
  531. 2 3 length
  532. 4 DRAWABLE drawable
  533. 4 n number of attachments
  534. 8n LISTofDRI2ATTACH_FORMAT attachments and formats
  535. 1 1 Reply
  536. 1 unused
  537. 2 CARD16 sequence number
  538. 4 0 reply length
  539. 4 CARD32 width of drawable
  540. 4 CARD32 height of drawable
  541. 4 CARD32 buffer count
  542. 12 unused
  543. 5n LISTofDRI2BUFFER buffers
  544. └───
  545. ┌───
  546. DRI2SwapBuffers
  547. 1 CARD8 major opcode
  548. 1 8 DRI2 opcode
  549. 2 8 length
  550. 4 DRAWABLE drawable
  551. 1 1 Reply
  552. 1 unused
  553. 2 CARD16 sequence number
  554. 4 0 reply length
  555. 4 CARD32 buffer count
  556. 4 CARD32 unused
  557. 4 CARD32 unused
  558. 4 CARD32 unused
  559. 4 CARD32 unused
  560. 4 CARD32 unused
  561. 4 CARD32 unused
  562. 5n LISTofDRI2BUFFER buffers
  563. └───
  564. ┌───
  565. DRI2SwapBuffers
  566. 1 CARD8 major opcode
  567. 1 8 DRI2 opcode
  568. 2 8 length
  569. 4 DRAWABLE drawable
  570. 4 CARD32 target_msc_hi
  571. 4 CARD32 target_msc_lo
  572. 4 CARD32 divisor_hi
  573. 4 CARD32 divisor_lo
  574. 4 CARD32 remainder_hi
  575. 4 CARD32 remainder_lo
  576. 1 1 Reply
  577. 1 unused
  578. 2 CARD16 sequence number
  579. 4 0 reply length
  580. 4 CARD32 swap_hi
  581. 4 CARD32 swap_lo
  582. 5n LISTofDRI2BUFFER buffers
  583. └───
  584. ┌───
  585. DRI2GetMSC
  586. 1 CARD8 major opcode
  587. 1 9 DRI2 opcode
  588. 2 8 length
  589. 4 DRAWABLE drawable
  590. 1 1 Reply
  591. 1 unused
  592. 2 CARD16 sequence number
  593. 4 0 reply length
  594. 4 CARD32 ust_hi
  595. 4 CARD32 ust_lo
  596. 4 CARD32 msc_hi
  597. 4 CARD32 msc_lo
  598. 4 CARD32 sbc_hi
  599. 4 CARD32 sbc_lo
  600. └───
  601. ┌───
  602. DRI2WaitMSC
  603. 1 CARD8 major opcode
  604. 1 10 DRI2 opcode
  605. 2 8 length
  606. 4 DRAWABLE drawable
  607. 4 CARD32 target_msc_hi
  608. 4 CARD32 target_msc_lo
  609. 4 CARD32 divisor_hi
  610. 4 CARD32 divisor_lo
  611. 4 CARD32 remainder_hi
  612. 4 CARD32 remainder_lo
  613. 1 1 Reply
  614. 1 unused
  615. 2 CARD16 sequence number
  616. 4 0 reply length
  617. 4 CARD32 ust_hi
  618. 4 CARD32 ust_lo
  619. 4 CARD32 msc_hi
  620. 4 CARD32 msc_lo
  621. 4 CARD32 sbc_hi
  622. 4 CARD32 sbc_lo
  623. └───
  624. ┌───
  625. DRI2WaitSBC
  626. 1 CARD8 major opcode
  627. 1 11 DRI2 opcode
  628. 2 8 length
  629. 4 DRAWABLE drawable
  630. 4 CARD32 swap_hi
  631. 4 CARD32 swap_lo
  632. 1 1 Reply
  633. 1 unused
  634. 2 CARD16 sequence number
  635. 4 0 reply length
  636. 4 CARD32 ust_hi
  637. 4 CARD32 ust_lo
  638. 4 CARD32 msc_hi
  639. 4 CARD32 msc_lo
  640. 4 CARD32 sbc_hi
  641. 4 CARD32 sbc_lo
  642. └───
  643. ┌───
  644. DRI2SwapInterval
  645. 1 CARD8 major opcode
  646. 1 12 DRI2 opcode
  647. 2 8 length
  648. 4 DRAWABLE drawable
  649. 4 CARD32 interval
  650. └───
  651. ┌───
  652. DRI2GetParam
  653. 1 CARD8 major opcode
  654. 1 13 DRI2 opcode
  655. 2 8 length
  656. 4 DRAWABLE drawable
  657. 4 CARD32 param
  658. 1 1 Reply
  659. 1 BOOL is_param_recognized
  660. 2 CARD16 sequence number
  661. 4 0 reply length
  662. 4 CARD32 value_hi
  663. 4 CARD32 value_lo
  664. 16 unused
  665. └───
  666. A.3 Protocol Events
  667. The DRI2 extension specifies DRI2_BufferSwapComplete and
  668. DRI2_InvalidateBuffers events.
  669. ┌───
  670. DRI2_BufferSwapComplete
  671. 1 CARD8 type
  672. 1 CARD8 extension
  673. 2 CARD16 sequenceNumber
  674. 2 CARD16 event_type
  675. 4 DRAWABLE drawable
  676. 4 CARD32 ust_hi
  677. 4 CARD32 ust_lo
  678. 4 CARD32 msc_hi
  679. 4 CARD32 msc_lo
  680. 4 CARD32 sbc_hi
  681. 4 CARD32 sbc_lo
  682. └───
  683. ┌───
  684. DRI2_InvalidateBuffers
  685. 1 CARD8 type
  686. 1 CARD8 extension
  687. 2 CARD16 sequenceNumber
  688. 4 DRAWABLE drawable
  689. 4 CARD32 unused
  690. 4 CARD32 unused
  691. 4 CARD32 unused
  692. 4 CARD32 unused
  693. 4 CARD32 unused
  694. 4 CARD32 unused
  695. └───
  696. A.4 Protocol Errors
  697. The DRI2 extension specifies no errors.
  698. ⚙ ⚙ ⚙ ⚙ ⚙ ⚙
  699. Appendix B. Implementation on GEM
  700. Where to begin...