Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

dri_interface.h 36KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. /*
  2. * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
  3. * Copyright 2007-2008 Red Hat, Inc.
  4. * (C) Copyright IBM Corporation 2004
  5. * All Rights Reserved.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a
  8. * copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation
  10. * on the rights to use, copy, modify, merge, publish, distribute, sub
  11. * license, and/or sell copies of the Software, and to permit persons to whom
  12. * the Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice (including the next
  15. * paragraph) shall be included in all copies or substantial portions of the
  16. * Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  21. * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
  22. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  23. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24. * USE OR OTHER DEALINGS IN THE SOFTWARE.
  25. */
  26. /**
  27. * \file dri_interface.h
  28. *
  29. * This file contains all the types and functions that define the interface
  30. * between a DRI driver and driver loader. Currently, the most common driver
  31. * loader is the XFree86 libGL.so. However, other loaders do exist, and in
  32. * the future the server-side libglx.a will also be a loader.
  33. *
  34. * \author Kevin E. Martin <kevin@precisioninsight.com>
  35. * \author Ian Romanick <idr@us.ibm.com>
  36. * \author Kristian Høgsberg <krh@redhat.com>
  37. */
  38. #ifndef DRI_INTERFACE_H
  39. #define DRI_INTERFACE_H
  40. /* For archs with no drm.h */
  41. #if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
  42. #ifndef __NOT_HAVE_DRM_H
  43. #define __NOT_HAVE_DRM_H
  44. #endif
  45. #endif
  46. #ifndef __NOT_HAVE_DRM_H
  47. #include <drm.h>
  48. #else
  49. typedef unsigned int drm_context_t;
  50. typedef unsigned int drm_drawable_t;
  51. typedef struct drm_clip_rect drm_clip_rect_t;
  52. #endif
  53. /**
  54. * \name DRI interface structures
  55. *
  56. * The following structures define the interface between the GLX client
  57. * side library and the DRI (direct rendering infrastructure).
  58. */
  59. /*@{*/
  60. typedef struct __DRIdisplayRec __DRIdisplay;
  61. typedef struct __DRIscreenRec __DRIscreen;
  62. typedef struct __DRIcontextRec __DRIcontext;
  63. typedef struct __DRIdrawableRec __DRIdrawable;
  64. typedef struct __DRIconfigRec __DRIconfig;
  65. typedef struct __DRIframebufferRec __DRIframebuffer;
  66. typedef struct __DRIversionRec __DRIversion;
  67. typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
  68. typedef struct __DRIextensionRec __DRIextension;
  69. typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
  70. typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
  71. typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
  72. typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
  73. typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
  74. typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
  75. typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
  76. typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
  77. typedef struct __DRIbufferRec __DRIbuffer;
  78. typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
  79. typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
  80. typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
  81. typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
  82. /*@}*/
  83. /**
  84. * Extension struct. Drivers 'inherit' from this struct by embedding
  85. * it as the first element in the extension struct.
  86. *
  87. * We never break API in for a DRI extension. If we need to change
  88. * the way things work in a non-backwards compatible manner, we
  89. * introduce a new extension. During a transition period, we can
  90. * leave both the old and the new extension in the driver, which
  91. * allows us to move to the new interface without having to update the
  92. * loader(s) in lock step.
  93. *
  94. * However, we can add entry points to an extension over time as long
  95. * as we don't break the old ones. As we add entry points to an
  96. * extension, we increase the version number. The corresponding
  97. * #define can be used to guard code that accesses the new entry
  98. * points at compile time and the version field in the extension
  99. * struct can be used at run-time to determine how to use the
  100. * extension.
  101. */
  102. struct __DRIextensionRec {
  103. const char *name;
  104. int version;
  105. };
  106. /**
  107. * The first set of extension are the screen extensions, returned by
  108. * __DRIcore::getExtensions(). This entry point will return a list of
  109. * extensions and the loader can use the ones it knows about by
  110. * casting them to more specific extensions and advertising any GLX
  111. * extensions the DRI extensions enables.
  112. */
  113. /**
  114. * Used by drivers to indicate support for setting the read drawable.
  115. */
  116. #define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
  117. #define __DRI_READ_DRAWABLE_VERSION 1
  118. /**
  119. * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
  120. */
  121. #define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
  122. #define __DRI_COPY_SUB_BUFFER_VERSION 1
  123. struct __DRIcopySubBufferExtensionRec {
  124. __DRIextension base;
  125. void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
  126. };
  127. /**
  128. * Used by drivers that implement the GLX_SGI_swap_control or
  129. * GLX_MESA_swap_control extension.
  130. */
  131. #define __DRI_SWAP_CONTROL "DRI_SwapControl"
  132. #define __DRI_SWAP_CONTROL_VERSION 1
  133. struct __DRIswapControlExtensionRec {
  134. __DRIextension base;
  135. void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
  136. unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
  137. };
  138. /**
  139. * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
  140. */
  141. #define __DRI_FRAME_TRACKING "DRI_FrameTracking"
  142. #define __DRI_FRAME_TRACKING_VERSION 1
  143. struct __DRIframeTrackingExtensionRec {
  144. __DRIextension base;
  145. /**
  146. * Enable or disable frame usage tracking.
  147. *
  148. * \since Internal API version 20030317.
  149. */
  150. int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
  151. /**
  152. * Retrieve frame usage information.
  153. *
  154. * \since Internal API version 20030317.
  155. */
  156. int (*queryFrameTracking)(__DRIdrawable *drawable,
  157. int64_t * sbc, int64_t * missedFrames,
  158. float * lastMissedUsage, float * usage);
  159. };
  160. /**
  161. * Used by drivers that implement the GLX_SGI_video_sync extension.
  162. */
  163. #define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
  164. #define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
  165. struct __DRImediaStreamCounterExtensionRec {
  166. __DRIextension base;
  167. /**
  168. * Wait for the MSC to equal target_msc, or, if that has already passed,
  169. * the next time (MSC % divisor) is equal to remainder. If divisor is
  170. * zero, the function will return as soon as MSC is greater than or equal
  171. * to target_msc.
  172. */
  173. int (*waitForMSC)(__DRIdrawable *drawable,
  174. int64_t target_msc, int64_t divisor, int64_t remainder,
  175. int64_t * msc, int64_t * sbc);
  176. /**
  177. * Get the number of vertical refreshes since some point in time before
  178. * this function was first called (i.e., system start up).
  179. */
  180. int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
  181. int64_t *msc);
  182. };
  183. #define __DRI_TEX_OFFSET "DRI_TexOffset"
  184. #define __DRI_TEX_OFFSET_VERSION 1
  185. struct __DRItexOffsetExtensionRec {
  186. __DRIextension base;
  187. /**
  188. * Method to override base texture image with a driver specific 'offset'.
  189. * The depth passed in allows e.g. to ignore the alpha channel of texture
  190. * images where the non-alpha components don't occupy a whole texel.
  191. *
  192. * For GLX_EXT_texture_from_pixmap with AIGLX.
  193. */
  194. void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
  195. unsigned long long offset, GLint depth, GLuint pitch);
  196. };
  197. /* Valid values for format in the setTexBuffer2 function below. These
  198. * values match the GLX tokens for compatibility reasons, but we
  199. * define them here since the DRI interface can't depend on GLX. */
  200. #define __DRI_TEXTURE_FORMAT_NONE 0x20D8
  201. #define __DRI_TEXTURE_FORMAT_RGB 0x20D9
  202. #define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
  203. #define __DRI_TEX_BUFFER "DRI_TexBuffer"
  204. #define __DRI_TEX_BUFFER_VERSION 2
  205. struct __DRItexBufferExtensionRec {
  206. __DRIextension base;
  207. /**
  208. * Method to override base texture image with the contents of a
  209. * __DRIdrawable.
  210. *
  211. * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
  212. * setTexBuffer2 in version 2 of this interface
  213. */
  214. void (*setTexBuffer)(__DRIcontext *pDRICtx,
  215. GLint target,
  216. __DRIdrawable *pDraw);
  217. /**
  218. * Method to override base texture image with the contents of a
  219. * __DRIdrawable, including the required texture format attribute.
  220. *
  221. * For GLX_EXT_texture_from_pixmap with AIGLX.
  222. */
  223. void (*setTexBuffer2)(__DRIcontext *pDRICtx,
  224. GLint target,
  225. GLint format,
  226. __DRIdrawable *pDraw);
  227. /**
  228. * Method to release texture buffer in case some special platform
  229. * need this.
  230. *
  231. * For GLX_EXT_texture_from_pixmap with AIGLX.
  232. */
  233. void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
  234. GLint target,
  235. __DRIdrawable *pDraw);
  236. };
  237. /**
  238. * Used by drivers that implement DRI2
  239. */
  240. #define __DRI2_FLUSH "DRI2_Flush"
  241. #define __DRI2_FLUSH_VERSION 3
  242. struct __DRI2flushExtensionRec {
  243. __DRIextension base;
  244. void (*flush)(__DRIdrawable *drawable);
  245. /**
  246. * Ask the driver to call getBuffers/getBuffersWithFormat before
  247. * it starts rendering again.
  248. *
  249. * \param drawable the drawable to invalidate
  250. *
  251. * \since 3
  252. */
  253. void (*invalidate)(__DRIdrawable *drawable);
  254. };
  255. /**
  256. * Extension that the driver uses to request
  257. * throttle callbacks.
  258. */
  259. #define __DRI2_THROTTLE "DRI2_Throttle"
  260. #define __DRI2_THROTTLE_VERSION 1
  261. enum __DRI2throttleReason {
  262. __DRI2_THROTTLE_SWAPBUFFER,
  263. __DRI2_THROTTLE_COPYSUBBUFFER,
  264. __DRI2_THROTTLE_FLUSHFRONT
  265. };
  266. struct __DRI2throttleExtensionRec {
  267. __DRIextension base;
  268. void (*throttle)(__DRIcontext *ctx,
  269. __DRIdrawable *drawable,
  270. enum __DRI2throttleReason reason);
  271. };
  272. /**
  273. * XML document describing the configuration options supported by the
  274. * driver.
  275. */
  276. extern const char __driConfigOptions[];
  277. /*@}*/
  278. /**
  279. * The following extensions describe loader features that the DRI
  280. * driver can make use of. Some of these are mandatory, such as the
  281. * getDrawableInfo extension for DRI and the DRI Loader extensions for
  282. * DRI2, while others are optional, and if present allow the driver to
  283. * expose certain features. The loader pass in a NULL terminated
  284. * array of these extensions to the driver in the createNewScreen
  285. * constructor.
  286. */
  287. typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
  288. typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
  289. typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
  290. typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
  291. typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
  292. /**
  293. * Callback to getDrawableInfo protocol
  294. */
  295. #define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
  296. #define __DRI_GET_DRAWABLE_INFO_VERSION 1
  297. struct __DRIgetDrawableInfoExtensionRec {
  298. __DRIextension base;
  299. /**
  300. * This function is used to get information about the position, size, and
  301. * clip rects of a drawable.
  302. */
  303. GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
  304. unsigned int * index, unsigned int * stamp,
  305. int * x, int * y, int * width, int * height,
  306. int * numClipRects, drm_clip_rect_t ** pClipRects,
  307. int * backX, int * backY,
  308. int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
  309. void *loaderPrivate);
  310. };
  311. /**
  312. * Callback to get system time for media stream counter extensions.
  313. */
  314. #define __DRI_SYSTEM_TIME "DRI_SystemTime"
  315. #define __DRI_SYSTEM_TIME_VERSION 1
  316. struct __DRIsystemTimeExtensionRec {
  317. __DRIextension base;
  318. /**
  319. * Get the 64-bit unadjusted system time (UST).
  320. */
  321. int (*getUST)(int64_t * ust);
  322. /**
  323. * Get the media stream counter (MSC) rate.
  324. *
  325. * Matching the definition in GLX_OML_sync_control, this function returns
  326. * the rate of the "media stream counter". In practical terms, this is
  327. * the frame refresh rate of the display.
  328. */
  329. GLboolean (*getMSCRate)(__DRIdrawable *draw,
  330. int32_t * numerator, int32_t * denominator,
  331. void *loaderPrivate);
  332. };
  333. /**
  334. * Damage reporting
  335. */
  336. #define __DRI_DAMAGE "DRI_Damage"
  337. #define __DRI_DAMAGE_VERSION 1
  338. struct __DRIdamageExtensionRec {
  339. __DRIextension base;
  340. /**
  341. * Reports areas of the given drawable which have been modified by the
  342. * driver.
  343. *
  344. * \param drawable which the drawing was done to.
  345. * \param rects rectangles affected, with the drawable origin as the
  346. * origin.
  347. * \param x X offset of the drawable within the screen (used in the
  348. * front_buffer case)
  349. * \param y Y offset of the drawable within the screen.
  350. * \param front_buffer boolean flag for whether the drawing to the
  351. * drawable was actually done directly to the front buffer (instead
  352. * of backing storage, for example)
  353. * \param loaderPrivate the data passed in at createNewDrawable time
  354. */
  355. void (*reportDamage)(__DRIdrawable *draw,
  356. int x, int y,
  357. drm_clip_rect_t *rects, int num_rects,
  358. GLboolean front_buffer,
  359. void *loaderPrivate);
  360. };
  361. #define __DRI_SWRAST_IMAGE_OP_DRAW 1
  362. #define __DRI_SWRAST_IMAGE_OP_CLEAR 2
  363. #define __DRI_SWRAST_IMAGE_OP_SWAP 3
  364. /**
  365. * SWRast Loader extension.
  366. */
  367. #define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
  368. #define __DRI_SWRAST_LOADER_VERSION 1
  369. struct __DRIswrastLoaderExtensionRec {
  370. __DRIextension base;
  371. /*
  372. * Drawable position and size
  373. */
  374. void (*getDrawableInfo)(__DRIdrawable *drawable,
  375. int *x, int *y, int *width, int *height,
  376. void *loaderPrivate);
  377. /**
  378. * Put image to drawable
  379. */
  380. void (*putImage)(__DRIdrawable *drawable, int op,
  381. int x, int y, int width, int height,
  382. char *data, void *loaderPrivate);
  383. /**
  384. * Get image from readable
  385. */
  386. void (*getImage)(__DRIdrawable *readable,
  387. int x, int y, int width, int height,
  388. char *data, void *loaderPrivate);
  389. };
  390. /**
  391. * Invalidate loader extension. The presence of this extension
  392. * indicates to the DRI driver that the loader will call invalidate in
  393. * the __DRI2_FLUSH extension, whenever the needs to query for new
  394. * buffers. This means that the DRI driver can drop the polling in
  395. * glViewport().
  396. *
  397. * The extension doesn't provide any functionality, it's only use to
  398. * indicate to the driver that it can use the new semantics. A DRI
  399. * driver can use this to switch between the different semantics or
  400. * just refuse to initialize if this extension isn't present.
  401. */
  402. #define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
  403. #define __DRI_USE_INVALIDATE_VERSION 1
  404. typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
  405. struct __DRIuseInvalidateExtensionRec {
  406. __DRIextension base;
  407. };
  408. /**
  409. * The remaining extensions describe driver extensions, immediately
  410. * available interfaces provided by the driver. To start using the
  411. * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
  412. * the extension you need in the array.
  413. */
  414. #define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
  415. /**
  416. * Tokens for __DRIconfig attribs. A number of attributes defined by
  417. * GLX or EGL standards are not in the table, as they must be provided
  418. * by the loader. For example, FBConfig ID or visual ID, drawable type.
  419. */
  420. #define __DRI_ATTRIB_BUFFER_SIZE 1
  421. #define __DRI_ATTRIB_LEVEL 2
  422. #define __DRI_ATTRIB_RED_SIZE 3
  423. #define __DRI_ATTRIB_GREEN_SIZE 4
  424. #define __DRI_ATTRIB_BLUE_SIZE 5
  425. #define __DRI_ATTRIB_LUMINANCE_SIZE 6
  426. #define __DRI_ATTRIB_ALPHA_SIZE 7
  427. #define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
  428. #define __DRI_ATTRIB_DEPTH_SIZE 9
  429. #define __DRI_ATTRIB_STENCIL_SIZE 10
  430. #define __DRI_ATTRIB_ACCUM_RED_SIZE 11
  431. #define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
  432. #define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
  433. #define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
  434. #define __DRI_ATTRIB_SAMPLE_BUFFERS 15
  435. #define __DRI_ATTRIB_SAMPLES 16
  436. #define __DRI_ATTRIB_RENDER_TYPE 17
  437. #define __DRI_ATTRIB_CONFIG_CAVEAT 18
  438. #define __DRI_ATTRIB_CONFORMANT 19
  439. #define __DRI_ATTRIB_DOUBLE_BUFFER 20
  440. #define __DRI_ATTRIB_STEREO 21
  441. #define __DRI_ATTRIB_AUX_BUFFERS 22
  442. #define __DRI_ATTRIB_TRANSPARENT_TYPE 23
  443. #define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
  444. #define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
  445. #define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
  446. #define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
  447. #define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
  448. #define __DRI_ATTRIB_FLOAT_MODE 29
  449. #define __DRI_ATTRIB_RED_MASK 30
  450. #define __DRI_ATTRIB_GREEN_MASK 31
  451. #define __DRI_ATTRIB_BLUE_MASK 32
  452. #define __DRI_ATTRIB_ALPHA_MASK 33
  453. #define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
  454. #define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
  455. #define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
  456. #define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
  457. #define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
  458. #define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
  459. #define __DRI_ATTRIB_SWAP_METHOD 40
  460. #define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
  461. #define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
  462. #define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
  463. #define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
  464. #define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
  465. #define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
  466. #define __DRI_ATTRIB_YINVERTED 47
  467. #define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE 48
  468. /* __DRI_ATTRIB_RENDER_TYPE */
  469. #define __DRI_ATTRIB_RGBA_BIT 0x01
  470. #define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
  471. #define __DRI_ATTRIB_LUMINANCE_BIT 0x04
  472. /* __DRI_ATTRIB_CONFIG_CAVEAT */
  473. #define __DRI_ATTRIB_SLOW_BIT 0x01
  474. #define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
  475. /* __DRI_ATTRIB_TRANSPARENT_TYPE */
  476. #define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
  477. #define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
  478. /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
  479. #define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
  480. #define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
  481. #define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
  482. /**
  483. * This extension defines the core DRI functionality.
  484. */
  485. #define __DRI_CORE "DRI_Core"
  486. #define __DRI_CORE_VERSION 1
  487. struct __DRIcoreExtensionRec {
  488. __DRIextension base;
  489. __DRIscreen *(*createNewScreen)(int screen, int fd,
  490. unsigned int sarea_handle,
  491. const __DRIextension **extensions,
  492. const __DRIconfig ***driverConfigs,
  493. void *loaderPrivate);
  494. void (*destroyScreen)(__DRIscreen *screen);
  495. const __DRIextension **(*getExtensions)(__DRIscreen *screen);
  496. int (*getConfigAttrib)(const __DRIconfig *config,
  497. unsigned int attrib,
  498. unsigned int *value);
  499. int (*indexConfigAttrib)(const __DRIconfig *config, int index,
  500. unsigned int *attrib, unsigned int *value);
  501. __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
  502. const __DRIconfig *config,
  503. unsigned int drawable_id,
  504. unsigned int head,
  505. void *loaderPrivate);
  506. void (*destroyDrawable)(__DRIdrawable *drawable);
  507. void (*swapBuffers)(__DRIdrawable *drawable);
  508. __DRIcontext *(*createNewContext)(__DRIscreen *screen,
  509. const __DRIconfig *config,
  510. __DRIcontext *shared,
  511. void *loaderPrivate);
  512. int (*copyContext)(__DRIcontext *dest,
  513. __DRIcontext *src,
  514. unsigned long mask);
  515. void (*destroyContext)(__DRIcontext *context);
  516. int (*bindContext)(__DRIcontext *ctx,
  517. __DRIdrawable *pdraw,
  518. __DRIdrawable *pread);
  519. int (*unbindContext)(__DRIcontext *ctx);
  520. };
  521. /**
  522. * Stored version of some component (i.e., server-side DRI module, kernel-side
  523. * DRM, etc.).
  524. *
  525. * \todo
  526. * There are several data structures that explicitly store a major version,
  527. * minor version, and patch level. These structures should be modified to
  528. * have a \c __DRIversionRec instead.
  529. */
  530. struct __DRIversionRec {
  531. int major; /**< Major version number. */
  532. int minor; /**< Minor version number. */
  533. int patch; /**< Patch-level. */
  534. };
  535. /**
  536. * Framebuffer information record. Used by libGL to communicate information
  537. * about the framebuffer to the driver's \c __driCreateNewScreen function.
  538. *
  539. * In XFree86, most of this information is derrived from data returned by
  540. * calling \c XF86DRIGetDeviceInfo.
  541. *
  542. * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
  543. * __driUtilCreateNewScreen CallCreateNewScreen
  544. *
  545. * \bug This structure could be better named.
  546. */
  547. struct __DRIframebufferRec {
  548. unsigned char *base; /**< Framebuffer base address in the CPU's
  549. * address space. This value is calculated by
  550. * calling \c drmMap on the framebuffer handle
  551. * returned by \c XF86DRIGetDeviceInfo (or a
  552. * similar function).
  553. */
  554. int size; /**< Framebuffer size, in bytes. */
  555. int stride; /**< Number of bytes from one line to the next. */
  556. int width; /**< Pixel width of the framebuffer. */
  557. int height; /**< Pixel height of the framebuffer. */
  558. int dev_priv_size; /**< Size of the driver's dev-priv structure. */
  559. void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
  560. };
  561. /**
  562. * This extension provides alternative screen, drawable and context
  563. * constructors for legacy DRI functionality. This is used in
  564. * conjunction with the core extension.
  565. */
  566. #define __DRI_LEGACY "DRI_Legacy"
  567. #define __DRI_LEGACY_VERSION 1
  568. struct __DRIlegacyExtensionRec {
  569. __DRIextension base;
  570. __DRIscreen *(*createNewScreen)(int screen,
  571. const __DRIversion *ddx_version,
  572. const __DRIversion *dri_version,
  573. const __DRIversion *drm_version,
  574. const __DRIframebuffer *frame_buffer,
  575. void *pSAREA, int fd,
  576. const __DRIextension **extensions,
  577. const __DRIconfig ***driver_configs,
  578. void *loaderPrivate);
  579. __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
  580. const __DRIconfig *config,
  581. drm_drawable_t hwDrawable,
  582. int renderType, const int *attrs,
  583. void *loaderPrivate);
  584. __DRIcontext *(*createNewContext)(__DRIscreen *screen,
  585. const __DRIconfig *config,
  586. int render_type,
  587. __DRIcontext *shared,
  588. drm_context_t hwContext,
  589. void *loaderPrivate);
  590. };
  591. /**
  592. * This extension provides alternative screen, drawable and context
  593. * constructors for swrast DRI functionality. This is used in
  594. * conjunction with the core extension.
  595. */
  596. #define __DRI_SWRAST "DRI_SWRast"
  597. #define __DRI_SWRAST_VERSION 3
  598. struct __DRIswrastExtensionRec {
  599. __DRIextension base;
  600. __DRIscreen *(*createNewScreen)(int screen,
  601. const __DRIextension **extensions,
  602. const __DRIconfig ***driver_configs,
  603. void *loaderPrivate);
  604. __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
  605. const __DRIconfig *config,
  606. void *loaderPrivate);
  607. /* Since version 2 */
  608. __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
  609. int api,
  610. const __DRIconfig *config,
  611. __DRIcontext *shared,
  612. void *data);
  613. /**
  614. * Create a context for a particular API with a set of attributes
  615. *
  616. * \since version 3
  617. *
  618. * \sa __DRIdri2ExtensionRec::createContextAttribs
  619. */
  620. __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
  621. int api,
  622. const __DRIconfig *config,
  623. __DRIcontext *shared,
  624. unsigned num_attribs,
  625. const uint32_t *attribs,
  626. unsigned *error,
  627. void *loaderPrivate);
  628. };
  629. /**
  630. * DRI2 Loader extension.
  631. */
  632. #define __DRI_BUFFER_FRONT_LEFT 0
  633. #define __DRI_BUFFER_BACK_LEFT 1
  634. #define __DRI_BUFFER_FRONT_RIGHT 2
  635. #define __DRI_BUFFER_BACK_RIGHT 3
  636. #define __DRI_BUFFER_DEPTH 4
  637. #define __DRI_BUFFER_STENCIL 5
  638. #define __DRI_BUFFER_ACCUM 6
  639. #define __DRI_BUFFER_FAKE_FRONT_LEFT 7
  640. #define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
  641. #define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
  642. #define __DRI_BUFFER_HIZ 10
  643. /* Inofficial and for internal use. Increase when adding a new buffer token. */
  644. #define __DRI_BUFFER_COUNT 11
  645. struct __DRIbufferRec {
  646. unsigned int attachment;
  647. unsigned int name;
  648. unsigned int pitch;
  649. unsigned int cpp;
  650. unsigned int flags;
  651. };
  652. #define __DRI_DRI2_LOADER "DRI_DRI2Loader"
  653. #define __DRI_DRI2_LOADER_VERSION 3
  654. struct __DRIdri2LoaderExtensionRec {
  655. __DRIextension base;
  656. __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
  657. int *width, int *height,
  658. unsigned int *attachments, int count,
  659. int *out_count, void *loaderPrivate);
  660. /**
  661. * Flush pending front-buffer rendering
  662. *
  663. * Any rendering that has been performed to the
  664. * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
  665. * \c __DRI_BUFFER_FRONT_LEFT.
  666. *
  667. * \param driDrawable Drawable whose front-buffer is to be flushed
  668. * \param loaderPrivate Loader's private data that was previously passed
  669. * into __DRIdri2ExtensionRec::createNewDrawable
  670. */
  671. void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
  672. /**
  673. * Get list of buffers from the server
  674. *
  675. * Gets a list of buffer for the specified set of attachments. Unlike
  676. * \c ::getBuffers, this function takes a list of attachments paired with
  677. * opaque \c unsigned \c int value describing the format of the buffer.
  678. * It is the responsibility of the caller to know what the service that
  679. * allocates the buffers will expect to receive for the format.
  680. *
  681. * \param driDrawable Drawable whose buffers are being queried.
  682. * \param width Output where the width of the buffers is stored.
  683. * \param height Output where the height of the buffers is stored.
  684. * \param attachments List of pairs of attachment ID and opaque format
  685. * requested for the drawable.
  686. * \param count Number of attachment / format pairs stored in
  687. * \c attachments.
  688. * \param loaderPrivate Loader's private data that was previously passed
  689. * into __DRIdri2ExtensionRec::createNewDrawable.
  690. */
  691. __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
  692. int *width, int *height,
  693. unsigned int *attachments, int count,
  694. int *out_count, void *loaderPrivate);
  695. };
  696. /**
  697. * This extension provides alternative screen, drawable and context
  698. * constructors for DRI2.
  699. */
  700. #define __DRI_DRI2 "DRI_DRI2"
  701. #define __DRI_DRI2_VERSION 3
  702. #define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
  703. #define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
  704. #define __DRI_API_GLES2 2 /**< OpenGL ES 2.0 or 3.0 */
  705. #define __DRI_API_OPENGL_CORE 3 /**< OpenGL 3.2+ core profile */
  706. #define __DRI_CTX_ATTRIB_MAJOR_VERSION 0
  707. #define __DRI_CTX_ATTRIB_MINOR_VERSION 1
  708. #define __DRI_CTX_ATTRIB_FLAGS 2
  709. /**
  710. * \requires __DRI2_ROBUSTNESS.
  711. */
  712. #define __DRI_CTX_ATTRIB_RESET_STRATEGY 3
  713. #define __DRI_CTX_FLAG_DEBUG 0x00000001
  714. #define __DRI_CTX_FLAG_FORWARD_COMPATIBLE 0x00000002
  715. /**
  716. * \requires __DRI2_ROBUSTNESS.
  717. */
  718. #define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS 0x00000004
  719. /**
  720. * \name Context reset strategies.
  721. */
  722. /*@{*/
  723. #define __DRI_CTX_RESET_NO_NOTIFICATION 0
  724. #define __DRI_CTX_RESET_LOSE_CONTEXT 1
  725. /*@}*/
  726. /**
  727. * \name Reasons that __DRIdri2Extension::createContextAttribs might fail
  728. */
  729. /*@{*/
  730. /** Success! */
  731. #define __DRI_CTX_ERROR_SUCCESS 0
  732. /** Memory allocation failure */
  733. #define __DRI_CTX_ERROR_NO_MEMORY 1
  734. /** Client requested an API (e.g., OpenGL ES 2.0) that the driver can't do. */
  735. #define __DRI_CTX_ERROR_BAD_API 2
  736. /** Client requested an API version that the driver can't do. */
  737. #define __DRI_CTX_ERROR_BAD_VERSION 3
  738. /** Client requested a flag or combination of flags the driver can't do. */
  739. #define __DRI_CTX_ERROR_BAD_FLAG 4
  740. /** Client requested an attribute the driver doesn't understand. */
  741. #define __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE 5
  742. /** Client requested a flag the driver doesn't understand. */
  743. #define __DRI_CTX_ERROR_UNKNOWN_FLAG 6
  744. /*@}*/
  745. struct __DRIdri2ExtensionRec {
  746. __DRIextension base;
  747. __DRIscreen *(*createNewScreen)(int screen, int fd,
  748. const __DRIextension **extensions,
  749. const __DRIconfig ***driver_configs,
  750. void *loaderPrivate);
  751. __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
  752. const __DRIconfig *config,
  753. void *loaderPrivate);
  754. __DRIcontext *(*createNewContext)(__DRIscreen *screen,
  755. const __DRIconfig *config,
  756. __DRIcontext *shared,
  757. void *loaderPrivate);
  758. /* Since version 2 */
  759. unsigned int (*getAPIMask)(__DRIscreen *screen);
  760. __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
  761. int api,
  762. const __DRIconfig *config,
  763. __DRIcontext *shared,
  764. void *data);
  765. __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
  766. unsigned int attachment,
  767. unsigned int format,
  768. int width,
  769. int height);
  770. void (*releaseBuffer)(__DRIscreen *screen,
  771. __DRIbuffer *buffer);
  772. /**
  773. * Create a context for a particular API with a set of attributes
  774. *
  775. * \since version 3
  776. *
  777. * \sa __DRIswrastExtensionRec::createContextAttribs
  778. */
  779. __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
  780. int api,
  781. const __DRIconfig *config,
  782. __DRIcontext *shared,
  783. unsigned num_attribs,
  784. const uint32_t *attribs,
  785. unsigned *error,
  786. void *loaderPrivate);
  787. };
  788. /**
  789. * This extension provides functionality to enable various EGLImage
  790. * extensions.
  791. */
  792. #define __DRI_IMAGE "DRI_IMAGE"
  793. #define __DRI_IMAGE_VERSION 5
  794. /**
  795. * These formats correspond to the similarly named MESA_FORMAT_*
  796. * tokens, except in the native endian of the CPU. For example, on
  797. * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
  798. * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
  799. *
  800. * __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
  801. * by the driver (YUV planar formats) but serve as a base image for
  802. * creating sub-images for the different planes within the image.
  803. *
  804. * R8, GR88 and NONE should not be used with createImageFormName or
  805. * createImage, and are returned by query from sub images created with
  806. * createImageFromNames (NONE, see above) and fromPlane (R8 & GR88).
  807. */
  808. #define __DRI_IMAGE_FORMAT_RGB565 0x1001
  809. #define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
  810. #define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
  811. #define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
  812. #define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
  813. #define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
  814. #define __DRI_IMAGE_FORMAT_GR88 0x1007
  815. #define __DRI_IMAGE_FORMAT_NONE 0x1008
  816. #define __DRI_IMAGE_USE_SHARE 0x0001
  817. #define __DRI_IMAGE_USE_SCANOUT 0x0002
  818. #define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
  819. /**
  820. * Four CC formats that matches with WL_DRM_FORMAT_* from wayland_drm.h
  821. * and GBM_FORMAT_* from gbm.h, used with createImageFromNames.
  822. *
  823. * \since 5
  824. */
  825. #define __DRI_IMAGE_FOURCC_RGB565 0x36314752
  826. #define __DRI_IMAGE_FOURCC_ARGB8888 0x34325241
  827. #define __DRI_IMAGE_FOURCC_XRGB8888 0x34325258
  828. #define __DRI_IMAGE_FOURCC_ABGR8888 0x34324241
  829. #define __DRI_IMAGE_FOURCC_XBGR8888 0x34324258
  830. #define __DRI_IMAGE_FOURCC_YUV410 0x39565559
  831. #define __DRI_IMAGE_FOURCC_YUV411 0x31315559
  832. #define __DRI_IMAGE_FOURCC_YUV420 0x32315559
  833. #define __DRI_IMAGE_FOURCC_YUV422 0x36315559
  834. #define __DRI_IMAGE_FOURCC_YUV444 0x34325559
  835. #define __DRI_IMAGE_FOURCC_NV12 0x3231564e
  836. #define __DRI_IMAGE_FOURCC_NV16 0x3631564e
  837. #define __DRI_IMAGE_FOURCC_YUYV 0x56595559
  838. /**
  839. * Queryable on images created by createImageFromNames.
  840. *
  841. * RGB and RGBA are may be usable directly as images but its still
  842. * recommended to call fromPlanar with plane == 0.
  843. *
  844. * Y_U_V, Y_UV and Y_XUXV all requires call to fromPlanar to create
  845. * usable sub-images, sampling from images return raw YUV data and
  846. * color conversion needs to be done in the shader.
  847. *
  848. * \since 5
  849. */
  850. #define __DRI_IMAGE_COMPONENTS_RGB 0x3001
  851. #define __DRI_IMAGE_COMPONENTS_RGBA 0x3002
  852. #define __DRI_IMAGE_COMPONENTS_Y_U_V 0x3003
  853. #define __DRI_IMAGE_COMPONENTS_Y_UV 0x3004
  854. #define __DRI_IMAGE_COMPONENTS_Y_XUXV 0x3005
  855. /**
  856. * queryImage attributes
  857. */
  858. #define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
  859. #define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
  860. #define __DRI_IMAGE_ATTRIB_NAME 0x2002
  861. #define __DRI_IMAGE_ATTRIB_FORMAT 0x2003 /* available in versions 3+ */
  862. #define __DRI_IMAGE_ATTRIB_WIDTH 0x2004 /* available in versions 4+ */
  863. #define __DRI_IMAGE_ATTRIB_HEIGHT 0x2005
  864. #define __DRI_IMAGE_ATTRIB_COMPONENTS 0x2006 /* available in versions 5+ */
  865. typedef struct __DRIimageRec __DRIimage;
  866. typedef struct __DRIimageExtensionRec __DRIimageExtension;
  867. struct __DRIimageExtensionRec {
  868. __DRIextension base;
  869. __DRIimage *(*createImageFromName)(__DRIscreen *screen,
  870. int width, int height, int format,
  871. int name, int pitch,
  872. void *loaderPrivate);
  873. __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
  874. int renderbuffer,
  875. void *loaderPrivate);
  876. void (*destroyImage)(__DRIimage *image);
  877. __DRIimage *(*createImage)(__DRIscreen *screen,
  878. int width, int height, int format,
  879. unsigned int use,
  880. void *loaderPrivate);
  881. GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
  882. /**
  883. * The new __DRIimage will share the content with the old one, see dup(2).
  884. */
  885. __DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
  886. /**
  887. * Validate that a __DRIimage can be used a certain way.
  888. *
  889. * \since 2
  890. */
  891. GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
  892. /**
  893. * Unlike createImageFromName __DRI_IMAGE_FORMAT is not but instead
  894. * __DRI_IMAGE_FOURCC and strides are in bytes not pixels. Stride is
  895. * also per block and not per pixel (for non-RGB, see gallium blocks).
  896. *
  897. * \since 5
  898. */
  899. __DRIimage *(*createImageFromNames)(__DRIscreen *screen,
  900. int width, int height, int fourcc,
  901. int *names, int num_names,
  902. int *strides, int *offsets,
  903. void *loaderPrivate);
  904. /**
  905. * Create an image out of a sub-region of a parent image. This
  906. * entry point lets us create individual __DRIimages for different
  907. * planes in a planar buffer (typically yuv), for example. While a
  908. * sub-image shares the underlying buffer object with the parent
  909. * image and other sibling sub-images, the life times of parent and
  910. * sub-images are not dependent. Destroying the parent or a
  911. * sub-image doesn't affect other images. The underlying buffer
  912. * object is free when no __DRIimage remains that references it.
  913. *
  914. * Sub-images may overlap, but rendering to overlapping sub-images
  915. * is undefined.
  916. *
  917. * \since 5
  918. */
  919. __DRIimage *(*fromPlanar)(__DRIimage *image, int plane,
  920. void *loaderPrivate);
  921. };
  922. /**
  923. * This extension must be implemented by the loader and passed to the
  924. * driver at screen creation time. The EGLImage entry points in the
  925. * various client APIs take opaque EGLImage handles and use this
  926. * extension to map them to a __DRIimage. At version 1, this
  927. * extensions allows mapping EGLImage pointers to __DRIimage pointers,
  928. * but future versions could support other EGLImage-like, opaque types
  929. * with new lookup functions.
  930. */
  931. #define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
  932. #define __DRI_IMAGE_LOOKUP_VERSION 1
  933. typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
  934. struct __DRIimageLookupExtensionRec {
  935. __DRIextension base;
  936. __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
  937. void *loaderPrivate);
  938. };
  939. /**
  940. * This extension allows for common DRI2 options
  941. */
  942. #define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
  943. #define __DRI2_CONFIG_QUERY_VERSION 1
  944. typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
  945. struct __DRI2configQueryExtensionRec {
  946. __DRIextension base;
  947. int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
  948. int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
  949. int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
  950. };
  951. /**
  952. * Robust context driver extension.
  953. *
  954. * Existence of this extension means the driver can accept the
  955. * \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
  956. * \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
  957. * \c __DRIdri2ExtensionRec::createContextAttribs.
  958. */
  959. #define __DRI2_ROBUSTNESS "DRI_Robustness"
  960. #define __DRI2_ROBUSTNESS_VERSION 1
  961. typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
  962. struct __DRIrobustnessExtensionRec {
  963. __DRIextension base;
  964. };
  965. #endif