radeon_drm.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. /* radeon_drm.h -- Public header for the radeon driver -*- linux-c -*-
  2. *
  3. * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
  4. * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
  5. * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
  6. * All rights reserved.
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a
  9. * copy of this software and associated documentation files (the "Software"),
  10. * to deal in the Software without restriction, including without limitation
  11. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  12. * and/or sell copies of the Software, and to permit persons to whom the
  13. * Software is furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice (including the next
  16. * paragraph) shall be included in all copies or substantial portions of the
  17. * Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  22. * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  23. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  24. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  25. * DEALINGS IN THE SOFTWARE.
  26. *
  27. * Authors:
  28. * Kevin E. Martin <martin@valinux.com>
  29. * Gareth Hughes <gareth@valinux.com>
  30. * Keith Whitwell <keith@tungstengraphics.com>
  31. */
  32. #ifndef __RADEON_DRM_H__
  33. #define __RADEON_DRM_H__
  34. #include "drm.h"
  35. /* WARNING: If you change any of these defines, make sure to change the
  36. * defines in the X server file (radeon_sarea.h)
  37. */
  38. #ifndef __RADEON_SAREA_DEFINES__
  39. #define __RADEON_SAREA_DEFINES__
  40. /* Old style state flags, required for sarea interface (1.1 and 1.2
  41. * clears) and 1.2 drm_vertex2 ioctl.
  42. */
  43. #define RADEON_UPLOAD_CONTEXT 0x00000001
  44. #define RADEON_UPLOAD_VERTFMT 0x00000002
  45. #define RADEON_UPLOAD_LINE 0x00000004
  46. #define RADEON_UPLOAD_BUMPMAP 0x00000008
  47. #define RADEON_UPLOAD_MASKS 0x00000010
  48. #define RADEON_UPLOAD_VIEWPORT 0x00000020
  49. #define RADEON_UPLOAD_SETUP 0x00000040
  50. #define RADEON_UPLOAD_TCL 0x00000080
  51. #define RADEON_UPLOAD_MISC 0x00000100
  52. #define RADEON_UPLOAD_TEX0 0x00000200
  53. #define RADEON_UPLOAD_TEX1 0x00000400
  54. #define RADEON_UPLOAD_TEX2 0x00000800
  55. #define RADEON_UPLOAD_TEX0IMAGES 0x00001000
  56. #define RADEON_UPLOAD_TEX1IMAGES 0x00002000
  57. #define RADEON_UPLOAD_TEX2IMAGES 0x00004000
  58. #define RADEON_UPLOAD_CLIPRECTS 0x00008000 /* handled client-side */
  59. #define RADEON_REQUIRE_QUIESCENCE 0x00010000
  60. #define RADEON_UPLOAD_ZBIAS 0x00020000 /* version 1.2 and newer */
  61. #define RADEON_UPLOAD_ALL 0x003effff
  62. #define RADEON_UPLOAD_CONTEXT_ALL 0x003e01ff
  63. /* New style per-packet identifiers for use in cmd_buffer ioctl with
  64. * the RADEON_EMIT_PACKET command. Comments relate new packets to old
  65. * state bits and the packet size:
  66. */
  67. #define RADEON_EMIT_PP_MISC 0 /* context/7 */
  68. #define RADEON_EMIT_PP_CNTL 1 /* context/3 */
  69. #define RADEON_EMIT_RB3D_COLORPITCH 2 /* context/1 */
  70. #define RADEON_EMIT_RE_LINE_PATTERN 3 /* line/2 */
  71. #define RADEON_EMIT_SE_LINE_WIDTH 4 /* line/1 */
  72. #define RADEON_EMIT_PP_LUM_MATRIX 5 /* bumpmap/1 */
  73. #define RADEON_EMIT_PP_ROT_MATRIX_0 6 /* bumpmap/2 */
  74. #define RADEON_EMIT_RB3D_STENCILREFMASK 7 /* masks/3 */
  75. #define RADEON_EMIT_SE_VPORT_XSCALE 8 /* viewport/6 */
  76. #define RADEON_EMIT_SE_CNTL 9 /* setup/2 */
  77. #define RADEON_EMIT_SE_CNTL_STATUS 10 /* setup/1 */
  78. #define RADEON_EMIT_RE_MISC 11 /* misc/1 */
  79. #define RADEON_EMIT_PP_TXFILTER_0 12 /* tex0/6 */
  80. #define RADEON_EMIT_PP_BORDER_COLOR_0 13 /* tex0/1 */
  81. #define RADEON_EMIT_PP_TXFILTER_1 14 /* tex1/6 */
  82. #define RADEON_EMIT_PP_BORDER_COLOR_1 15 /* tex1/1 */
  83. #define RADEON_EMIT_PP_TXFILTER_2 16 /* tex2/6 */
  84. #define RADEON_EMIT_PP_BORDER_COLOR_2 17 /* tex2/1 */
  85. #define RADEON_EMIT_SE_ZBIAS_FACTOR 18 /* zbias/2 */
  86. #define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT 19 /* tcl/11 */
  87. #define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED 20 /* material/17 */
  88. #define R200_EMIT_PP_TXCBLEND_0 21 /* tex0/4 */
  89. #define R200_EMIT_PP_TXCBLEND_1 22 /* tex1/4 */
  90. #define R200_EMIT_PP_TXCBLEND_2 23 /* tex2/4 */
  91. #define R200_EMIT_PP_TXCBLEND_3 24 /* tex3/4 */
  92. #define R200_EMIT_PP_TXCBLEND_4 25 /* tex4/4 */
  93. #define R200_EMIT_PP_TXCBLEND_5 26 /* tex5/4 */
  94. #define R200_EMIT_PP_TXCBLEND_6 27 /* /4 */
  95. #define R200_EMIT_PP_TXCBLEND_7 28 /* /4 */
  96. #define R200_EMIT_TCL_LIGHT_MODEL_CTL_0 29 /* tcl/7 */
  97. #define R200_EMIT_TFACTOR_0 30 /* tf/7 */
  98. #define R200_EMIT_VTX_FMT_0 31 /* vtx/5 */
  99. #define R200_EMIT_VAP_CTL 32 /* vap/1 */
  100. #define R200_EMIT_MATRIX_SELECT_0 33 /* msl/5 */
  101. #define R200_EMIT_TEX_PROC_CTL_2 34 /* tcg/5 */
  102. #define R200_EMIT_TCL_UCP_VERT_BLEND_CTL 35 /* tcl/1 */
  103. #define R200_EMIT_PP_TXFILTER_0 36 /* tex0/6 */
  104. #define R200_EMIT_PP_TXFILTER_1 37 /* tex1/6 */
  105. #define R200_EMIT_PP_TXFILTER_2 38 /* tex2/6 */
  106. #define R200_EMIT_PP_TXFILTER_3 39 /* tex3/6 */
  107. #define R200_EMIT_PP_TXFILTER_4 40 /* tex4/6 */
  108. #define R200_EMIT_PP_TXFILTER_5 41 /* tex5/6 */
  109. #define R200_EMIT_PP_TXOFFSET_0 42 /* tex0/1 */
  110. #define R200_EMIT_PP_TXOFFSET_1 43 /* tex1/1 */
  111. #define R200_EMIT_PP_TXOFFSET_2 44 /* tex2/1 */
  112. #define R200_EMIT_PP_TXOFFSET_3 45 /* tex3/1 */
  113. #define R200_EMIT_PP_TXOFFSET_4 46 /* tex4/1 */
  114. #define R200_EMIT_PP_TXOFFSET_5 47 /* tex5/1 */
  115. #define R200_EMIT_VTE_CNTL 48 /* vte/1 */
  116. #define R200_EMIT_OUTPUT_VTX_COMP_SEL 49 /* vtx/1 */
  117. #define R200_EMIT_PP_TAM_DEBUG3 50 /* tam/1 */
  118. #define R200_EMIT_PP_CNTL_X 51 /* cst/1 */
  119. #define R200_EMIT_RB3D_DEPTHXY_OFFSET 52 /* cst/1 */
  120. #define R200_EMIT_RE_AUX_SCISSOR_CNTL 53 /* cst/1 */
  121. #define R200_EMIT_RE_SCISSOR_TL_0 54 /* cst/2 */
  122. #define R200_EMIT_RE_SCISSOR_TL_1 55 /* cst/2 */
  123. #define R200_EMIT_RE_SCISSOR_TL_2 56 /* cst/2 */
  124. #define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */
  125. #define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */
  126. #define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */
  127. #define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */
  128. #define R200_EMIT_PP_CUBIC_FACES_0 61
  129. #define R200_EMIT_PP_CUBIC_OFFSETS_0 62
  130. #define R200_EMIT_PP_CUBIC_FACES_1 63
  131. #define R200_EMIT_PP_CUBIC_OFFSETS_1 64
  132. #define R200_EMIT_PP_CUBIC_FACES_2 65
  133. #define R200_EMIT_PP_CUBIC_OFFSETS_2 66
  134. #define R200_EMIT_PP_CUBIC_FACES_3 67
  135. #define R200_EMIT_PP_CUBIC_OFFSETS_3 68
  136. #define R200_EMIT_PP_CUBIC_FACES_4 69
  137. #define R200_EMIT_PP_CUBIC_OFFSETS_4 70
  138. #define R200_EMIT_PP_CUBIC_FACES_5 71
  139. #define R200_EMIT_PP_CUBIC_OFFSETS_5 72
  140. #define RADEON_EMIT_PP_TEX_SIZE_0 73
  141. #define RADEON_EMIT_PP_TEX_SIZE_1 74
  142. #define RADEON_EMIT_PP_TEX_SIZE_2 75
  143. #define R200_EMIT_RB3D_BLENDCOLOR 76
  144. #define R200_EMIT_TCL_POINT_SPRITE_CNTL 77
  145. #define RADEON_EMIT_PP_CUBIC_FACES_0 78
  146. #define RADEON_EMIT_PP_CUBIC_OFFSETS_T0 79
  147. #define RADEON_EMIT_PP_CUBIC_FACES_1 80
  148. #define RADEON_EMIT_PP_CUBIC_OFFSETS_T1 81
  149. #define RADEON_EMIT_PP_CUBIC_FACES_2 82
  150. #define RADEON_EMIT_PP_CUBIC_OFFSETS_T2 83
  151. #define R200_EMIT_PP_TRI_PERF_CNTL 84
  152. #define R200_EMIT_PP_AFS_0 85
  153. #define R200_EMIT_PP_AFS_1 86
  154. #define R200_EMIT_ATF_TFACTOR 87
  155. #define R200_EMIT_PP_TXCTLALL_0 88
  156. #define R200_EMIT_PP_TXCTLALL_1 89
  157. #define R200_EMIT_PP_TXCTLALL_2 90
  158. #define R200_EMIT_PP_TXCTLALL_3 91
  159. #define R200_EMIT_PP_TXCTLALL_4 92
  160. #define R200_EMIT_PP_TXCTLALL_5 93
  161. #define R200_EMIT_VAP_PVS_CNTL 94
  162. #define RADEON_MAX_STATE_PACKETS 95
  163. /* Commands understood by cmd_buffer ioctl. More can be added but
  164. * obviously these can't be removed or changed:
  165. */
  166. #define RADEON_CMD_PACKET 1 /* emit one of the register packets above */
  167. #define RADEON_CMD_SCALARS 2 /* emit scalar data */
  168. #define RADEON_CMD_VECTORS 3 /* emit vector data */
  169. #define RADEON_CMD_DMA_DISCARD 4 /* discard current dma buf */
  170. #define RADEON_CMD_PACKET3 5 /* emit hw packet */
  171. #define RADEON_CMD_PACKET3_CLIP 6 /* emit hw packet wrapped in cliprects */
  172. #define RADEON_CMD_SCALARS2 7 /* r200 stopgap */
  173. #define RADEON_CMD_WAIT 8 /* emit hw wait commands -- note:
  174. * doesn't make the cpu wait, just
  175. * the graphics hardware */
  176. #define RADEON_CMD_VECLINEAR 9 /* another r200 stopgap */
  177. typedef union {
  178. int i;
  179. struct {
  180. unsigned char cmd_type, pad0, pad1, pad2;
  181. } header;
  182. struct {
  183. unsigned char cmd_type, packet_id, pad0, pad1;
  184. } packet;
  185. struct {
  186. unsigned char cmd_type, offset, stride, count;
  187. } scalars;
  188. struct {
  189. unsigned char cmd_type, offset, stride, count;
  190. } vectors;
  191. struct {
  192. unsigned char cmd_type, addr_lo, addr_hi, count;
  193. } veclinear;
  194. struct {
  195. unsigned char cmd_type, buf_idx, pad0, pad1;
  196. } dma;
  197. struct {
  198. unsigned char cmd_type, flags, pad0, pad1;
  199. } wait;
  200. } drm_radeon_cmd_header_t;
  201. #define RADEON_WAIT_2D 0x1
  202. #define RADEON_WAIT_3D 0x2
  203. /* Allowed parameters for R300_CMD_PACKET3
  204. */
  205. #define R300_CMD_PACKET3_CLEAR 0
  206. #define R300_CMD_PACKET3_RAW 1
  207. /* Commands understood by cmd_buffer ioctl for R300.
  208. * The interface has not been stabilized, so some of these may be removed
  209. * and eventually reordered before stabilization.
  210. */
  211. #define R300_CMD_PACKET0 1
  212. #define R300_CMD_VPU 2 /* emit vertex program upload */
  213. #define R300_CMD_PACKET3 3 /* emit a packet3 */
  214. #define R300_CMD_END3D 4 /* emit sequence ending 3d rendering */
  215. #define R300_CMD_CP_DELAY 5
  216. #define R300_CMD_DMA_DISCARD 6
  217. #define R300_CMD_WAIT 7
  218. # define R300_WAIT_2D 0x1
  219. # define R300_WAIT_3D 0x2
  220. /* these two defines are DOING IT WRONG - however
  221. * we have userspace which relies on using these.
  222. * The wait interface is backwards compat new
  223. * code should use the NEW_WAIT defines below
  224. * THESE ARE NOT BIT FIELDS
  225. */
  226. # define R300_WAIT_2D_CLEAN 0x3
  227. # define R300_WAIT_3D_CLEAN 0x4
  228. # define R300_NEW_WAIT_2D_3D 0x3
  229. # define R300_NEW_WAIT_2D_2D_CLEAN 0x4
  230. # define R300_NEW_WAIT_3D_3D_CLEAN 0x6
  231. # define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8
  232. #define R300_CMD_SCRATCH 8
  233. #define R300_CMD_R500FP 9
  234. typedef union {
  235. unsigned int u;
  236. struct {
  237. unsigned char cmd_type, pad0, pad1, pad2;
  238. } header;
  239. struct {
  240. unsigned char cmd_type, count, reglo, reghi;
  241. } packet0;
  242. struct {
  243. unsigned char cmd_type, count, adrlo, adrhi;
  244. } vpu;
  245. struct {
  246. unsigned char cmd_type, packet, pad0, pad1;
  247. } packet3;
  248. struct {
  249. unsigned char cmd_type, packet;
  250. unsigned short count; /* amount of packet2 to emit */
  251. } delay;
  252. struct {
  253. unsigned char cmd_type, buf_idx, pad0, pad1;
  254. } dma;
  255. struct {
  256. unsigned char cmd_type, flags, pad0, pad1;
  257. } wait;
  258. struct {
  259. unsigned char cmd_type, reg, n_bufs, flags;
  260. } scratch;
  261. struct {
  262. unsigned char cmd_type, count, adrlo, adrhi_flags;
  263. } r500fp;
  264. } drm_r300_cmd_header_t;
  265. #define RADEON_FRONT 0x1
  266. #define RADEON_BACK 0x2
  267. #define RADEON_DEPTH 0x4
  268. #define RADEON_STENCIL 0x8
  269. #define RADEON_CLEAR_FASTZ 0x80000000
  270. #define RADEON_USE_HIERZ 0x40000000
  271. #define RADEON_USE_COMP_ZBUF 0x20000000
  272. #define R500FP_CONSTANT_TYPE (1 << 1)
  273. #define R500FP_CONSTANT_CLAMP (1 << 2)
  274. /* Primitive types
  275. */
  276. #define RADEON_POINTS 0x1
  277. #define RADEON_LINES 0x2
  278. #define RADEON_LINE_STRIP 0x3
  279. #define RADEON_TRIANGLES 0x4
  280. #define RADEON_TRIANGLE_FAN 0x5
  281. #define RADEON_TRIANGLE_STRIP 0x6
  282. /* Vertex/indirect buffer size
  283. */
  284. #define RADEON_BUFFER_SIZE 65536
  285. /* Byte offsets for indirect buffer data
  286. */
  287. #define RADEON_INDEX_PRIM_OFFSET 20
  288. #define RADEON_SCRATCH_REG_OFFSET 32
  289. #define R600_SCRATCH_REG_OFFSET 256
  290. #define RADEON_NR_SAREA_CLIPRECTS 12
  291. /* There are 2 heaps (local/GART). Each region within a heap is a
  292. * minimum of 64k, and there are at most 64 of them per heap.
  293. */
  294. #define RADEON_LOCAL_TEX_HEAP 0
  295. #define RADEON_GART_TEX_HEAP 1
  296. #define RADEON_NR_TEX_HEAPS 2
  297. #define RADEON_NR_TEX_REGIONS 64
  298. #define RADEON_LOG_TEX_GRANULARITY 16
  299. #define RADEON_MAX_TEXTURE_LEVELS 12
  300. #define RADEON_MAX_TEXTURE_UNITS 3
  301. #define RADEON_MAX_SURFACES 8
  302. /* Blits have strict offset rules. All blit offset must be aligned on
  303. * a 1K-byte boundary.
  304. */
  305. #define RADEON_OFFSET_SHIFT 10
  306. #define RADEON_OFFSET_ALIGN (1 << RADEON_OFFSET_SHIFT)
  307. #define RADEON_OFFSET_MASK (RADEON_OFFSET_ALIGN - 1)
  308. #endif /* __RADEON_SAREA_DEFINES__ */
  309. typedef struct {
  310. unsigned int red;
  311. unsigned int green;
  312. unsigned int blue;
  313. unsigned int alpha;
  314. } radeon_color_regs_t;
  315. typedef struct {
  316. /* Context state */
  317. unsigned int pp_misc; /* 0x1c14 */
  318. unsigned int pp_fog_color;
  319. unsigned int re_solid_color;
  320. unsigned int rb3d_blendcntl;
  321. unsigned int rb3d_depthoffset;
  322. unsigned int rb3d_depthpitch;
  323. unsigned int rb3d_zstencilcntl;
  324. unsigned int pp_cntl; /* 0x1c38 */
  325. unsigned int rb3d_cntl;
  326. unsigned int rb3d_coloroffset;
  327. unsigned int re_width_height;
  328. unsigned int rb3d_colorpitch;
  329. unsigned int se_cntl;
  330. /* Vertex format state */
  331. unsigned int se_coord_fmt; /* 0x1c50 */
  332. /* Line state */
  333. unsigned int re_line_pattern; /* 0x1cd0 */
  334. unsigned int re_line_state;
  335. unsigned int se_line_width; /* 0x1db8 */
  336. /* Bumpmap state */
  337. unsigned int pp_lum_matrix; /* 0x1d00 */
  338. unsigned int pp_rot_matrix_0; /* 0x1d58 */
  339. unsigned int pp_rot_matrix_1;
  340. /* Mask state */
  341. unsigned int rb3d_stencilrefmask; /* 0x1d7c */
  342. unsigned int rb3d_ropcntl;
  343. unsigned int rb3d_planemask;
  344. /* Viewport state */
  345. unsigned int se_vport_xscale; /* 0x1d98 */
  346. unsigned int se_vport_xoffset;
  347. unsigned int se_vport_yscale;
  348. unsigned int se_vport_yoffset;
  349. unsigned int se_vport_zscale;
  350. unsigned int se_vport_zoffset;
  351. /* Setup state */
  352. unsigned int se_cntl_status; /* 0x2140 */
  353. /* Misc state */
  354. unsigned int re_top_left; /* 0x26c0 */
  355. unsigned int re_misc;
  356. } drm_radeon_context_regs_t;
  357. typedef struct {
  358. /* Zbias state */
  359. unsigned int se_zbias_factor; /* 0x1dac */
  360. unsigned int se_zbias_constant;
  361. } drm_radeon_context2_regs_t;
  362. /* Setup registers for each texture unit
  363. */
  364. typedef struct {
  365. unsigned int pp_txfilter;
  366. unsigned int pp_txformat;
  367. unsigned int pp_txoffset;
  368. unsigned int pp_txcblend;
  369. unsigned int pp_txablend;
  370. unsigned int pp_tfactor;
  371. unsigned int pp_border_color;
  372. } drm_radeon_texture_regs_t;
  373. typedef struct {
  374. unsigned int start;
  375. unsigned int finish;
  376. unsigned int prim:8;
  377. unsigned int stateidx:8;
  378. unsigned int numverts:16; /* overloaded as offset/64 for elt prims */
  379. unsigned int vc_format; /* vertex format */
  380. } drm_radeon_prim_t;
  381. typedef struct {
  382. drm_radeon_context_regs_t context;
  383. drm_radeon_texture_regs_t tex[RADEON_MAX_TEXTURE_UNITS];
  384. drm_radeon_context2_regs_t context2;
  385. unsigned int dirty;
  386. } drm_radeon_state_t;
  387. typedef struct {
  388. /* The channel for communication of state information to the
  389. * kernel on firing a vertex buffer with either of the
  390. * obsoleted vertex/index ioctls.
  391. */
  392. drm_radeon_context_regs_t context_state;
  393. drm_radeon_texture_regs_t tex_state[RADEON_MAX_TEXTURE_UNITS];
  394. unsigned int dirty;
  395. unsigned int vertsize;
  396. unsigned int vc_format;
  397. /* The current cliprects, or a subset thereof.
  398. */
  399. struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
  400. unsigned int nbox;
  401. /* Counters for client-side throttling of rendering clients.
  402. */
  403. unsigned int last_frame;
  404. unsigned int last_dispatch;
  405. unsigned int last_clear;
  406. struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
  407. 1];
  408. unsigned int tex_age[RADEON_NR_TEX_HEAPS];
  409. int ctx_owner;
  410. int pfState; /* number of 3d windows (0,1,2ormore) */
  411. int pfCurrentPage; /* which buffer is being displayed? */
  412. int crtc2_base; /* CRTC2 frame offset */
  413. int tiling_enabled; /* set by drm, read by 2d + 3d clients */
  414. } drm_radeon_sarea_t;
  415. /* WARNING: If you change any of these defines, make sure to change the
  416. * defines in the Xserver file (xf86drmRadeon.h)
  417. *
  418. * KW: actually it's illegal to change any of this (backwards compatibility).
  419. */
  420. /* Radeon specific ioctls
  421. * The device specific ioctl range is 0x40 to 0x79.
  422. */
  423. #define DRM_RADEON_CP_INIT 0x00
  424. #define DRM_RADEON_CP_START 0x01
  425. #define DRM_RADEON_CP_STOP 0x02
  426. #define DRM_RADEON_CP_RESET 0x03
  427. #define DRM_RADEON_CP_IDLE 0x04
  428. #define DRM_RADEON_RESET 0x05
  429. #define DRM_RADEON_FULLSCREEN 0x06
  430. #define DRM_RADEON_SWAP 0x07
  431. #define DRM_RADEON_CLEAR 0x08
  432. #define DRM_RADEON_VERTEX 0x09
  433. #define DRM_RADEON_INDICES 0x0A
  434. #define DRM_RADEON_NOT_USED
  435. #define DRM_RADEON_STIPPLE 0x0C
  436. #define DRM_RADEON_INDIRECT 0x0D
  437. #define DRM_RADEON_TEXTURE 0x0E
  438. #define DRM_RADEON_VERTEX2 0x0F
  439. #define DRM_RADEON_CMDBUF 0x10
  440. #define DRM_RADEON_GETPARAM 0x11
  441. #define DRM_RADEON_FLIP 0x12
  442. #define DRM_RADEON_ALLOC 0x13
  443. #define DRM_RADEON_FREE 0x14
  444. #define DRM_RADEON_INIT_HEAP 0x15
  445. #define DRM_RADEON_IRQ_EMIT 0x16
  446. #define DRM_RADEON_IRQ_WAIT 0x17
  447. #define DRM_RADEON_CP_RESUME 0x18
  448. #define DRM_RADEON_SETPARAM 0x19
  449. #define DRM_RADEON_SURF_ALLOC 0x1a
  450. #define DRM_RADEON_SURF_FREE 0x1b
  451. /* KMS ioctl */
  452. #define DRM_RADEON_GEM_INFO 0x1c
  453. #define DRM_RADEON_GEM_CREATE 0x1d
  454. #define DRM_RADEON_GEM_MMAP 0x1e
  455. #define DRM_RADEON_GEM_PREAD 0x21
  456. #define DRM_RADEON_GEM_PWRITE 0x22
  457. #define DRM_RADEON_GEM_SET_DOMAIN 0x23
  458. #define DRM_RADEON_GEM_WAIT_IDLE 0x24
  459. #define DRM_RADEON_CS 0x26
  460. #define DRM_RADEON_INFO 0x27
  461. #define DRM_RADEON_GEM_SET_TILING 0x28
  462. #define DRM_RADEON_GEM_GET_TILING 0x29
  463. #define DRM_RADEON_GEM_BUSY 0x2a
  464. #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
  465. #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
  466. #define DRM_IOCTL_RADEON_CP_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
  467. #define DRM_IOCTL_RADEON_CP_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
  468. #define DRM_IOCTL_RADEON_CP_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
  469. #define DRM_IOCTL_RADEON_RESET DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_RESET)
  470. #define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
  471. #define DRM_IOCTL_RADEON_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_SWAP)
  472. #define DRM_IOCTL_RADEON_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
  473. #define DRM_IOCTL_RADEON_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
  474. #define DRM_IOCTL_RADEON_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
  475. #define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
  476. #define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
  477. #define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
  478. #define DRM_IOCTL_RADEON_VERTEX2 DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
  479. #define DRM_IOCTL_RADEON_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
  480. #define DRM_IOCTL_RADEON_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
  481. #define DRM_IOCTL_RADEON_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_FLIP)
  482. #define DRM_IOCTL_RADEON_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
  483. #define DRM_IOCTL_RADEON_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
  484. #define DRM_IOCTL_RADEON_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
  485. #define DRM_IOCTL_RADEON_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
  486. #define DRM_IOCTL_RADEON_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
  487. #define DRM_IOCTL_RADEON_CP_RESUME DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
  488. #define DRM_IOCTL_RADEON_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
  489. #define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
  490. #define DRM_IOCTL_RADEON_SURF_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
  491. /* KMS */
  492. #define DRM_IOCTL_RADEON_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info)
  493. #define DRM_IOCTL_RADEON_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create)
  494. #define DRM_IOCTL_RADEON_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
  495. #define DRM_IOCTL_RADEON_GEM_PREAD DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread)
  496. #define DRM_IOCTL_RADEON_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
  497. #define DRM_IOCTL_RADEON_GEM_SET_DOMAIN DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
  498. #define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
  499. #define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
  500. #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
  501. #define DRM_IOCTL_RADEON_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
  502. #define DRM_IOCTL_RADEON_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
  503. #define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
  504. typedef struct drm_radeon_init {
  505. enum {
  506. RADEON_INIT_CP = 0x01,
  507. RADEON_CLEANUP_CP = 0x02,
  508. RADEON_INIT_R200_CP = 0x03,
  509. RADEON_INIT_R300_CP = 0x04,
  510. RADEON_INIT_R600_CP = 0x05
  511. } func;
  512. unsigned long sarea_priv_offset;
  513. int is_pci;
  514. int cp_mode;
  515. int gart_size;
  516. int ring_size;
  517. int usec_timeout;
  518. unsigned int fb_bpp;
  519. unsigned int front_offset, front_pitch;
  520. unsigned int back_offset, back_pitch;
  521. unsigned int depth_bpp;
  522. unsigned int depth_offset, depth_pitch;
  523. unsigned long fb_offset;
  524. unsigned long mmio_offset;
  525. unsigned long ring_offset;
  526. unsigned long ring_rptr_offset;
  527. unsigned long buffers_offset;
  528. unsigned long gart_textures_offset;
  529. } drm_radeon_init_t;
  530. typedef struct drm_radeon_cp_stop {
  531. int flush;
  532. int idle;
  533. } drm_radeon_cp_stop_t;
  534. typedef struct drm_radeon_fullscreen {
  535. enum {
  536. RADEON_INIT_FULLSCREEN = 0x01,
  537. RADEON_CLEANUP_FULLSCREEN = 0x02
  538. } func;
  539. } drm_radeon_fullscreen_t;
  540. #define CLEAR_X1 0
  541. #define CLEAR_Y1 1
  542. #define CLEAR_X2 2
  543. #define CLEAR_Y2 3
  544. #define CLEAR_DEPTH 4
  545. typedef union drm_radeon_clear_rect {
  546. float f[5];
  547. unsigned int ui[5];
  548. } drm_radeon_clear_rect_t;
  549. typedef struct drm_radeon_clear {
  550. unsigned int flags;
  551. unsigned int clear_color;
  552. unsigned int clear_depth;
  553. unsigned int color_mask;
  554. unsigned int depth_mask; /* misnamed field: should be stencil */
  555. drm_radeon_clear_rect_t __user *depth_boxes;
  556. } drm_radeon_clear_t;
  557. typedef struct drm_radeon_vertex {
  558. int prim;
  559. int idx; /* Index of vertex buffer */
  560. int count; /* Number of vertices in buffer */
  561. int discard; /* Client finished with buffer? */
  562. } drm_radeon_vertex_t;
  563. typedef struct drm_radeon_indices {
  564. int prim;
  565. int idx;
  566. int start;
  567. int end;
  568. int discard; /* Client finished with buffer? */
  569. } drm_radeon_indices_t;
  570. /* v1.2 - obsoletes drm_radeon_vertex and drm_radeon_indices
  571. * - allows multiple primitives and state changes in a single ioctl
  572. * - supports driver change to emit native primitives
  573. */
  574. typedef struct drm_radeon_vertex2 {
  575. int idx; /* Index of vertex buffer */
  576. int discard; /* Client finished with buffer? */
  577. int nr_states;
  578. drm_radeon_state_t __user *state;
  579. int nr_prims;
  580. drm_radeon_prim_t __user *prim;
  581. } drm_radeon_vertex2_t;
  582. /* v1.3 - obsoletes drm_radeon_vertex2
  583. * - allows arbitrarily large cliprect list
  584. * - allows updating of tcl packet, vector and scalar state
  585. * - allows memory-efficient description of state updates
  586. * - allows state to be emitted without a primitive
  587. * (for clears, ctx switches)
  588. * - allows more than one dma buffer to be referenced per ioctl
  589. * - supports tcl driver
  590. * - may be extended in future versions with new cmd types, packets
  591. */
  592. typedef struct drm_radeon_cmd_buffer {
  593. int bufsz;
  594. char __user *buf;
  595. int nbox;
  596. struct drm_clip_rect __user *boxes;
  597. } drm_radeon_cmd_buffer_t;
  598. typedef struct drm_radeon_tex_image {
  599. unsigned int x, y; /* Blit coordinates */
  600. unsigned int width, height;
  601. const void __user *data;
  602. } drm_radeon_tex_image_t;
  603. typedef struct drm_radeon_texture {
  604. unsigned int offset;
  605. int pitch;
  606. int format;
  607. int width; /* Texture image coordinates */
  608. int height;
  609. drm_radeon_tex_image_t __user *image;
  610. } drm_radeon_texture_t;
  611. typedef struct drm_radeon_stipple {
  612. unsigned int __user *mask;
  613. } drm_radeon_stipple_t;
  614. typedef struct drm_radeon_indirect {
  615. int idx;
  616. int start;
  617. int end;
  618. int discard;
  619. } drm_radeon_indirect_t;
  620. /* enum for card type parameters */
  621. #define RADEON_CARD_PCI 0
  622. #define RADEON_CARD_AGP 1
  623. #define RADEON_CARD_PCIE 2
  624. /* 1.3: An ioctl to get parameters that aren't available to the 3d
  625. * client any other way.
  626. */
  627. #define RADEON_PARAM_GART_BUFFER_OFFSET 1 /* card offset of 1st GART buffer */
  628. #define RADEON_PARAM_LAST_FRAME 2
  629. #define RADEON_PARAM_LAST_DISPATCH 3
  630. #define RADEON_PARAM_LAST_CLEAR 4
  631. /* Added with DRM version 1.6. */
  632. #define RADEON_PARAM_IRQ_NR 5
  633. #define RADEON_PARAM_GART_BASE 6 /* card offset of GART base */
  634. /* Added with DRM version 1.8. */
  635. #define RADEON_PARAM_REGISTER_HANDLE 7 /* for drmMap() */
  636. #define RADEON_PARAM_STATUS_HANDLE 8
  637. #define RADEON_PARAM_SAREA_HANDLE 9
  638. #define RADEON_PARAM_GART_TEX_HANDLE 10
  639. #define RADEON_PARAM_SCRATCH_OFFSET 11
  640. #define RADEON_PARAM_CARD_TYPE 12
  641. #define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */
  642. #define RADEON_PARAM_FB_LOCATION 14 /* FB location */
  643. #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
  644. #define RADEON_PARAM_DEVICE_ID 16
  645. #define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */
  646. typedef struct drm_radeon_getparam {
  647. int param;
  648. void __user *value;
  649. } drm_radeon_getparam_t;
  650. /* 1.6: Set up a memory manager for regions of shared memory:
  651. */
  652. #define RADEON_MEM_REGION_GART 1
  653. #define RADEON_MEM_REGION_FB 2
  654. typedef struct drm_radeon_mem_alloc {
  655. int region;
  656. int alignment;
  657. int size;
  658. int __user *region_offset; /* offset from start of fb or GART */
  659. } drm_radeon_mem_alloc_t;
  660. typedef struct drm_radeon_mem_free {
  661. int region;
  662. int region_offset;
  663. } drm_radeon_mem_free_t;
  664. typedef struct drm_radeon_mem_init_heap {
  665. int region;
  666. int size;
  667. int start;
  668. } drm_radeon_mem_init_heap_t;
  669. /* 1.6: Userspace can request & wait on irq's:
  670. */
  671. typedef struct drm_radeon_irq_emit {
  672. int __user *irq_seq;
  673. } drm_radeon_irq_emit_t;
  674. typedef struct drm_radeon_irq_wait {
  675. int irq_seq;
  676. } drm_radeon_irq_wait_t;
  677. /* 1.10: Clients tell the DRM where they think the framebuffer is located in
  678. * the card's address space, via a new generic ioctl to set parameters
  679. */
  680. typedef struct drm_radeon_setparam {
  681. unsigned int param;
  682. __s64 value;
  683. } drm_radeon_setparam_t;
  684. #define RADEON_SETPARAM_FB_LOCATION 1 /* determined framebuffer location */
  685. #define RADEON_SETPARAM_SWITCH_TILING 2 /* enable/disable color tiling */
  686. #define RADEON_SETPARAM_PCIGART_LOCATION 3 /* PCI Gart Location */
  687. #define RADEON_SETPARAM_NEW_MEMMAP 4 /* Use new memory map */
  688. #define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5 /* PCI GART Table Size */
  689. #define RADEON_SETPARAM_VBLANK_CRTC 6 /* VBLANK CRTC */
  690. /* 1.14: Clients can allocate/free a surface
  691. */
  692. typedef struct drm_radeon_surface_alloc {
  693. unsigned int address;
  694. unsigned int size;
  695. unsigned int flags;
  696. } drm_radeon_surface_alloc_t;
  697. typedef struct drm_radeon_surface_free {
  698. unsigned int address;
  699. } drm_radeon_surface_free_t;
  700. #define DRM_RADEON_VBLANK_CRTC1 1
  701. #define DRM_RADEON_VBLANK_CRTC2 2
  702. /*
  703. * Kernel modesetting world below.
  704. */
  705. #define RADEON_GEM_DOMAIN_CPU 0x1
  706. #define RADEON_GEM_DOMAIN_GTT 0x2
  707. #define RADEON_GEM_DOMAIN_VRAM 0x4
  708. struct drm_radeon_gem_info {
  709. uint64_t gart_size;
  710. uint64_t vram_size;
  711. uint64_t vram_visible;
  712. };
  713. #define RADEON_GEM_NO_BACKING_STORE 1
  714. struct drm_radeon_gem_create {
  715. uint64_t size;
  716. uint64_t alignment;
  717. uint32_t handle;
  718. uint32_t initial_domain;
  719. uint32_t flags;
  720. };
  721. #define RADEON_TILING_MACRO 0x1
  722. #define RADEON_TILING_MICRO 0x2
  723. #define RADEON_TILING_SWAP_16BIT 0x4
  724. #define RADEON_TILING_SWAP_32BIT 0x8
  725. #define RADEON_TILING_SURFACE 0x10 /* this object requires a surface
  726. * when mapped - i.e. front buffer */
  727. #define RADEON_TILING_MICRO_SQUARE 0x20
  728. struct drm_radeon_gem_set_tiling {
  729. uint32_t handle;
  730. uint32_t tiling_flags;
  731. uint32_t pitch;
  732. };
  733. struct drm_radeon_gem_get_tiling {
  734. uint32_t handle;
  735. uint32_t tiling_flags;
  736. uint32_t pitch;
  737. };
  738. struct drm_radeon_gem_mmap {
  739. uint32_t handle;
  740. uint32_t pad;
  741. uint64_t offset;
  742. uint64_t size;
  743. uint64_t addr_ptr;
  744. };
  745. struct drm_radeon_gem_set_domain {
  746. uint32_t handle;
  747. uint32_t read_domains;
  748. uint32_t write_domain;
  749. };
  750. struct drm_radeon_gem_wait_idle {
  751. uint32_t handle;
  752. uint32_t pad;
  753. };
  754. struct drm_radeon_gem_busy {
  755. uint32_t handle;
  756. uint32_t domain;
  757. };
  758. struct drm_radeon_gem_pread {
  759. /** Handle for the object being read. */
  760. uint32_t handle;
  761. uint32_t pad;
  762. /** Offset into the object to read from */
  763. uint64_t offset;
  764. /** Length of data to read */
  765. uint64_t size;
  766. /** Pointer to write the data into. */
  767. /* void *, but pointers are not 32/64 compatible */
  768. uint64_t data_ptr;
  769. };
  770. struct drm_radeon_gem_pwrite {
  771. /** Handle for the object being written to. */
  772. uint32_t handle;
  773. uint32_t pad;
  774. /** Offset into the object to write to */
  775. uint64_t offset;
  776. /** Length of data to write */
  777. uint64_t size;
  778. /** Pointer to read the data from. */
  779. /* void *, but pointers are not 32/64 compatible */
  780. uint64_t data_ptr;
  781. };
  782. #define RADEON_CHUNK_ID_RELOCS 0x01
  783. #define RADEON_CHUNK_ID_IB 0x02
  784. struct drm_radeon_cs_chunk {
  785. uint32_t chunk_id;
  786. uint32_t length_dw;
  787. uint64_t chunk_data;
  788. };
  789. struct drm_radeon_cs_reloc {
  790. uint32_t handle;
  791. uint32_t read_domains;
  792. uint32_t write_domain;
  793. uint32_t flags;
  794. };
  795. struct drm_radeon_cs {
  796. uint32_t num_chunks;
  797. uint32_t cs_id;
  798. /* this points to uint64_t * which point to cs chunks */
  799. uint64_t chunks;
  800. /* updates to the limits after this CS ioctl */
  801. uint64_t gart_limit;
  802. uint64_t vram_limit;
  803. };
  804. #define RADEON_INFO_DEVICE_ID 0x00
  805. #define RADEON_INFO_NUM_GB_PIPES 0x01
  806. #define RADEON_INFO_NUM_Z_PIPES 0x02
  807. #define RADEON_INFO_ACCEL_WORKING 0x03
  808. #define RADEON_INFO_CRTC_FROM_ID 0x04
  809. #define RADEON_INFO_ACCEL_WORKING2 0x05
  810. #define RADEON_INFO_TILING_CONFIG 0x06
  811. #define RADEON_INFO_WANT_HYPERZ 0x07
  812. #define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */
  813. #define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09 /* clock crystal frequency */
  814. #define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */
  815. #define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */
  816. #define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */
  817. struct drm_radeon_info {
  818. uint32_t request;
  819. uint32_t pad;
  820. uint64_t value;
  821. };
  822. #endif