svga3d_cmd.h 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184
  1. /* SPDX-License-Identifier: GPL-2.0 OR MIT */
  2. /**********************************************************
  3. * Copyright 1998-2015 VMware, Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person
  6. * obtaining a copy of this software and associated documentation
  7. * files (the "Software"), to deal in the Software without
  8. * restriction, including without limitation the rights to use, copy,
  9. * modify, merge, publish, distribute, sublicense, and/or sell copies
  10. * of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be
  14. * included in all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  20. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  21. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  23. * SOFTWARE.
  24. *
  25. **********************************************************/
  26. /*
  27. * svga3d_cmd.h --
  28. *
  29. * SVGA 3d hardware cmd definitions
  30. */
  31. #ifndef _SVGA3D_CMD_H_
  32. #define _SVGA3D_CMD_H_
  33. #define INCLUDE_ALLOW_MODULE
  34. #define INCLUDE_ALLOW_USERLEVEL
  35. #define INCLUDE_ALLOW_VMCORE
  36. #include "includeCheck.h"
  37. #include "svga3d_types.h"
  38. /*
  39. * Identifiers for commands in the command FIFO.
  40. *
  41. * IDs between 1000 and 1039 (inclusive) were used by obsolete versions of
  42. * the SVGA3D protocol and remain reserved; they should not be used in the
  43. * future.
  44. *
  45. * IDs between 1040 and 2999 (inclusive) are available for use by the
  46. * current SVGA3D protocol.
  47. *
  48. * FIFO clients other than SVGA3D should stay below 1000, or at 3000
  49. * and up.
  50. */
  51. typedef enum {
  52. SVGA_3D_CMD_LEGACY_BASE = 1000,
  53. SVGA_3D_CMD_BASE = 1040,
  54. SVGA_3D_CMD_SURFACE_DEFINE = 1040,
  55. SVGA_3D_CMD_SURFACE_DESTROY = 1041,
  56. SVGA_3D_CMD_SURFACE_COPY = 1042,
  57. SVGA_3D_CMD_SURFACE_STRETCHBLT = 1043,
  58. SVGA_3D_CMD_SURFACE_DMA = 1044,
  59. SVGA_3D_CMD_CONTEXT_DEFINE = 1045,
  60. SVGA_3D_CMD_CONTEXT_DESTROY = 1046,
  61. SVGA_3D_CMD_SETTRANSFORM = 1047,
  62. SVGA_3D_CMD_SETZRANGE = 1048,
  63. SVGA_3D_CMD_SETRENDERSTATE = 1049,
  64. SVGA_3D_CMD_SETRENDERTARGET = 1050,
  65. SVGA_3D_CMD_SETTEXTURESTATE = 1051,
  66. SVGA_3D_CMD_SETMATERIAL = 1052,
  67. SVGA_3D_CMD_SETLIGHTDATA = 1053,
  68. SVGA_3D_CMD_SETLIGHTENABLED = 1054,
  69. SVGA_3D_CMD_SETVIEWPORT = 1055,
  70. SVGA_3D_CMD_SETCLIPPLANE = 1056,
  71. SVGA_3D_CMD_CLEAR = 1057,
  72. SVGA_3D_CMD_PRESENT = 1058,
  73. SVGA_3D_CMD_SHADER_DEFINE = 1059,
  74. SVGA_3D_CMD_SHADER_DESTROY = 1060,
  75. SVGA_3D_CMD_SET_SHADER = 1061,
  76. SVGA_3D_CMD_SET_SHADER_CONST = 1062,
  77. SVGA_3D_CMD_DRAW_PRIMITIVES = 1063,
  78. SVGA_3D_CMD_SETSCISSORRECT = 1064,
  79. SVGA_3D_CMD_BEGIN_QUERY = 1065,
  80. SVGA_3D_CMD_END_QUERY = 1066,
  81. SVGA_3D_CMD_WAIT_FOR_QUERY = 1067,
  82. SVGA_3D_CMD_PRESENT_READBACK = 1068,
  83. SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN = 1069,
  84. SVGA_3D_CMD_SURFACE_DEFINE_V2 = 1070,
  85. SVGA_3D_CMD_GENERATE_MIPMAPS = 1071,
  86. SVGA_3D_CMD_DEAD4 = 1072,
  87. SVGA_3D_CMD_DEAD5 = 1073,
  88. SVGA_3D_CMD_DEAD6 = 1074,
  89. SVGA_3D_CMD_DEAD7 = 1075,
  90. SVGA_3D_CMD_DEAD8 = 1076,
  91. SVGA_3D_CMD_DEAD9 = 1077,
  92. SVGA_3D_CMD_DEAD10 = 1078,
  93. SVGA_3D_CMD_DEAD11 = 1079,
  94. SVGA_3D_CMD_ACTIVATE_SURFACE = 1080,
  95. SVGA_3D_CMD_DEACTIVATE_SURFACE = 1081,
  96. SVGA_3D_CMD_SCREEN_DMA = 1082,
  97. SVGA_3D_CMD_DEAD1 = 1083,
  98. SVGA_3D_CMD_DEAD2 = 1084,
  99. SVGA_3D_CMD_LOGICOPS_BITBLT = 1085,
  100. SVGA_3D_CMD_LOGICOPS_TRANSBLT = 1086,
  101. SVGA_3D_CMD_LOGICOPS_STRETCHBLT = 1087,
  102. SVGA_3D_CMD_LOGICOPS_COLORFILL = 1088,
  103. SVGA_3D_CMD_LOGICOPS_ALPHABLEND = 1089,
  104. SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND = 1090,
  105. SVGA_3D_CMD_SET_OTABLE_BASE = 1091,
  106. SVGA_3D_CMD_READBACK_OTABLE = 1092,
  107. SVGA_3D_CMD_DEFINE_GB_MOB = 1093,
  108. SVGA_3D_CMD_DESTROY_GB_MOB = 1094,
  109. SVGA_3D_CMD_DEAD3 = 1095,
  110. SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING = 1096,
  111. SVGA_3D_CMD_DEFINE_GB_SURFACE = 1097,
  112. SVGA_3D_CMD_DESTROY_GB_SURFACE = 1098,
  113. SVGA_3D_CMD_BIND_GB_SURFACE = 1099,
  114. SVGA_3D_CMD_COND_BIND_GB_SURFACE = 1100,
  115. SVGA_3D_CMD_UPDATE_GB_IMAGE = 1101,
  116. SVGA_3D_CMD_UPDATE_GB_SURFACE = 1102,
  117. SVGA_3D_CMD_READBACK_GB_IMAGE = 1103,
  118. SVGA_3D_CMD_READBACK_GB_SURFACE = 1104,
  119. SVGA_3D_CMD_INVALIDATE_GB_IMAGE = 1105,
  120. SVGA_3D_CMD_INVALIDATE_GB_SURFACE = 1106,
  121. SVGA_3D_CMD_DEFINE_GB_CONTEXT = 1107,
  122. SVGA_3D_CMD_DESTROY_GB_CONTEXT = 1108,
  123. SVGA_3D_CMD_BIND_GB_CONTEXT = 1109,
  124. SVGA_3D_CMD_READBACK_GB_CONTEXT = 1110,
  125. SVGA_3D_CMD_INVALIDATE_GB_CONTEXT = 1111,
  126. SVGA_3D_CMD_DEFINE_GB_SHADER = 1112,
  127. SVGA_3D_CMD_DESTROY_GB_SHADER = 1113,
  128. SVGA_3D_CMD_BIND_GB_SHADER = 1114,
  129. SVGA_3D_CMD_SET_OTABLE_BASE64 = 1115,
  130. SVGA_3D_CMD_BEGIN_GB_QUERY = 1116,
  131. SVGA_3D_CMD_END_GB_QUERY = 1117,
  132. SVGA_3D_CMD_WAIT_FOR_GB_QUERY = 1118,
  133. SVGA_3D_CMD_NOP = 1119,
  134. SVGA_3D_CMD_ENABLE_GART = 1120,
  135. SVGA_3D_CMD_DISABLE_GART = 1121,
  136. SVGA_3D_CMD_MAP_MOB_INTO_GART = 1122,
  137. SVGA_3D_CMD_UNMAP_GART_RANGE = 1123,
  138. SVGA_3D_CMD_DEFINE_GB_SCREENTARGET = 1124,
  139. SVGA_3D_CMD_DESTROY_GB_SCREENTARGET = 1125,
  140. SVGA_3D_CMD_BIND_GB_SCREENTARGET = 1126,
  141. SVGA_3D_CMD_UPDATE_GB_SCREENTARGET = 1127,
  142. SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL = 1128,
  143. SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL = 1129,
  144. SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE = 1130,
  145. SVGA_3D_CMD_GB_SCREEN_DMA = 1131,
  146. SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH = 1132,
  147. SVGA_3D_CMD_GB_MOB_FENCE = 1133,
  148. SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 = 1134,
  149. SVGA_3D_CMD_DEFINE_GB_MOB64 = 1135,
  150. SVGA_3D_CMD_REDEFINE_GB_MOB64 = 1136,
  151. SVGA_3D_CMD_NOP_ERROR = 1137,
  152. SVGA_3D_CMD_SET_VERTEX_STREAMS = 1138,
  153. SVGA_3D_CMD_SET_VERTEX_DECLS = 1139,
  154. SVGA_3D_CMD_SET_VERTEX_DIVISORS = 1140,
  155. SVGA_3D_CMD_DRAW = 1141,
  156. SVGA_3D_CMD_DRAW_INDEXED = 1142,
  157. /*
  158. * DX10 Commands
  159. */
  160. SVGA_3D_CMD_DX_MIN = 1143,
  161. SVGA_3D_CMD_DX_DEFINE_CONTEXT = 1143,
  162. SVGA_3D_CMD_DX_DESTROY_CONTEXT = 1144,
  163. SVGA_3D_CMD_DX_BIND_CONTEXT = 1145,
  164. SVGA_3D_CMD_DX_READBACK_CONTEXT = 1146,
  165. SVGA_3D_CMD_DX_INVALIDATE_CONTEXT = 1147,
  166. SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER = 1148,
  167. SVGA_3D_CMD_DX_SET_SHADER_RESOURCES = 1149,
  168. SVGA_3D_CMD_DX_SET_SHADER = 1150,
  169. SVGA_3D_CMD_DX_SET_SAMPLERS = 1151,
  170. SVGA_3D_CMD_DX_DRAW = 1152,
  171. SVGA_3D_CMD_DX_DRAW_INDEXED = 1153,
  172. SVGA_3D_CMD_DX_DRAW_INSTANCED = 1154,
  173. SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED = 1155,
  174. SVGA_3D_CMD_DX_DRAW_AUTO = 1156,
  175. SVGA_3D_CMD_DX_SET_INPUT_LAYOUT = 1157,
  176. SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS = 1158,
  177. SVGA_3D_CMD_DX_SET_INDEX_BUFFER = 1159,
  178. SVGA_3D_CMD_DX_SET_TOPOLOGY = 1160,
  179. SVGA_3D_CMD_DX_SET_RENDERTARGETS = 1161,
  180. SVGA_3D_CMD_DX_SET_BLEND_STATE = 1162,
  181. SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE = 1163,
  182. SVGA_3D_CMD_DX_SET_RASTERIZER_STATE = 1164,
  183. SVGA_3D_CMD_DX_DEFINE_QUERY = 1165,
  184. SVGA_3D_CMD_DX_DESTROY_QUERY = 1166,
  185. SVGA_3D_CMD_DX_BIND_QUERY = 1167,
  186. SVGA_3D_CMD_DX_SET_QUERY_OFFSET = 1168,
  187. SVGA_3D_CMD_DX_BEGIN_QUERY = 1169,
  188. SVGA_3D_CMD_DX_END_QUERY = 1170,
  189. SVGA_3D_CMD_DX_READBACK_QUERY = 1171,
  190. SVGA_3D_CMD_DX_SET_PREDICATION = 1172,
  191. SVGA_3D_CMD_DX_SET_SOTARGETS = 1173,
  192. SVGA_3D_CMD_DX_SET_VIEWPORTS = 1174,
  193. SVGA_3D_CMD_DX_SET_SCISSORRECTS = 1175,
  194. SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW = 1176,
  195. SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW = 1177,
  196. SVGA_3D_CMD_DX_PRED_COPY_REGION = 1178,
  197. SVGA_3D_CMD_DX_PRED_COPY = 1179,
  198. SVGA_3D_CMD_DX_PRESENTBLT = 1180,
  199. SVGA_3D_CMD_DX_GENMIPS = 1181,
  200. SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE = 1182,
  201. SVGA_3D_CMD_DX_READBACK_SUBRESOURCE = 1183,
  202. SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE = 1184,
  203. SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW = 1185,
  204. SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW = 1186,
  205. SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW = 1187,
  206. SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW = 1188,
  207. SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW = 1189,
  208. SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW = 1190,
  209. SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT = 1191,
  210. SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT = 1192,
  211. SVGA_3D_CMD_DX_DEFINE_BLEND_STATE = 1193,
  212. SVGA_3D_CMD_DX_DESTROY_BLEND_STATE = 1194,
  213. SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE = 1195,
  214. SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE = 1196,
  215. SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE = 1197,
  216. SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE = 1198,
  217. SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE = 1199,
  218. SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE = 1200,
  219. SVGA_3D_CMD_DX_DEFINE_SHADER = 1201,
  220. SVGA_3D_CMD_DX_DESTROY_SHADER = 1202,
  221. SVGA_3D_CMD_DX_BIND_SHADER = 1203,
  222. SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT = 1204,
  223. SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT = 1205,
  224. SVGA_3D_CMD_DX_SET_STREAMOUTPUT = 1206,
  225. SVGA_3D_CMD_DX_SET_COTABLE = 1207,
  226. SVGA_3D_CMD_DX_READBACK_COTABLE = 1208,
  227. SVGA_3D_CMD_DX_BUFFER_COPY = 1209,
  228. SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER = 1210,
  229. SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK = 1211,
  230. SVGA_3D_CMD_DX_MOVE_QUERY = 1212,
  231. SVGA_3D_CMD_DX_BIND_ALL_QUERY = 1213,
  232. SVGA_3D_CMD_DX_READBACK_ALL_QUERY = 1214,
  233. SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER = 1215,
  234. SVGA_3D_CMD_DX_MOB_FENCE_64 = 1216,
  235. SVGA_3D_CMD_DX_BIND_ALL_SHADER = 1217,
  236. SVGA_3D_CMD_DX_HINT = 1218,
  237. SVGA_3D_CMD_DX_BUFFER_UPDATE = 1219,
  238. SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET = 1220,
  239. SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET = 1221,
  240. SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET = 1222,
  241. /*
  242. * Reserve some IDs to be used for the SM5 shader types.
  243. */
  244. SVGA_3D_CMD_DX_RESERVED1 = 1223,
  245. SVGA_3D_CMD_DX_RESERVED2 = 1224,
  246. SVGA_3D_CMD_DX_RESERVED3 = 1225,
  247. SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER = 1226,
  248. SVGA_3D_CMD_DX_MAX = 1227,
  249. SVGA_3D_CMD_SCREEN_COPY = 1227,
  250. /*
  251. * Reserve some IDs to be used for video.
  252. */
  253. SVGA_3D_CMD_VIDEO_RESERVED1 = 1228,
  254. SVGA_3D_CMD_VIDEO_RESERVED2 = 1229,
  255. SVGA_3D_CMD_VIDEO_RESERVED3 = 1230,
  256. SVGA_3D_CMD_VIDEO_RESERVED4 = 1231,
  257. SVGA_3D_CMD_VIDEO_RESERVED5 = 1232,
  258. SVGA_3D_CMD_VIDEO_RESERVED6 = 1233,
  259. SVGA_3D_CMD_VIDEO_RESERVED7 = 1234,
  260. SVGA_3D_CMD_VIDEO_RESERVED8 = 1235,
  261. SVGA_3D_CMD_GROW_OTABLE = 1236,
  262. SVGA_3D_CMD_DX_GROW_COTABLE = 1237,
  263. SVGA_3D_CMD_INTRA_SURFACE_COPY = 1238,
  264. SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 = 1239,
  265. SVGA_3D_CMD_DX_RESOLVE_COPY = 1240,
  266. SVGA_3D_CMD_DX_PRED_RESOLVE_COPY = 1241,
  267. SVGA_3D_CMD_DX_PRED_CONVERT_REGION = 1242,
  268. SVGA_3D_CMD_DX_PRED_CONVERT = 1243,
  269. SVGA_3D_CMD_WHOLE_SURFACE_COPY = 1244,
  270. SVGA_3D_CMD_MAX = 1245,
  271. SVGA_3D_CMD_FUTURE_MAX = 3000
  272. } SVGAFifo3dCmdId;
  273. #define SVGA_NUM_3D_CMD (SVGA_3D_CMD_MAX - SVGA_3D_CMD_BASE)
  274. /*
  275. * FIFO command format definitions:
  276. */
  277. /*
  278. * The data size header following cmdNum for every 3d command
  279. */
  280. typedef
  281. #include "vmware_pack_begin.h"
  282. struct {
  283. uint32 id;
  284. uint32 size;
  285. }
  286. #include "vmware_pack_end.h"
  287. SVGA3dCmdHeader;
  288. typedef
  289. #include "vmware_pack_begin.h"
  290. struct {
  291. uint32 numMipLevels;
  292. }
  293. #include "vmware_pack_end.h"
  294. SVGA3dSurfaceFace;
  295. typedef
  296. #include "vmware_pack_begin.h"
  297. struct {
  298. uint32 sid;
  299. SVGA3dSurface1Flags surfaceFlags;
  300. SVGA3dSurfaceFormat format;
  301. /*
  302. * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
  303. * structures must have the same value of numMipLevels field.
  304. * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
  305. * numMipLevels set to 0.
  306. */
  307. SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
  308. /*
  309. * Followed by an SVGA3dSize structure for each mip level in each face.
  310. *
  311. * A note on surface sizes: Sizes are always specified in pixels,
  312. * even if the true surface size is not a multiple of the minimum
  313. * block size of the surface's format. For example, a 3x3x1 DXT1
  314. * compressed texture would actually be stored as a 4x4x1 image in
  315. * memory.
  316. */
  317. }
  318. #include "vmware_pack_end.h"
  319. SVGA3dCmdDefineSurface; /* SVGA_3D_CMD_SURFACE_DEFINE */
  320. typedef
  321. #include "vmware_pack_begin.h"
  322. struct {
  323. uint32 sid;
  324. SVGA3dSurface1Flags surfaceFlags;
  325. SVGA3dSurfaceFormat format;
  326. /*
  327. * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
  328. * structures must have the same value of numMipLevels field.
  329. * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
  330. * numMipLevels set to 0.
  331. */
  332. SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
  333. uint32 multisampleCount;
  334. SVGA3dTextureFilter autogenFilter;
  335. /*
  336. * Followed by an SVGA3dSize structure for each mip level in each face.
  337. *
  338. * A note on surface sizes: Sizes are always specified in pixels,
  339. * even if the true surface size is not a multiple of the minimum
  340. * block size of the surface's format. For example, a 3x3x1 DXT1
  341. * compressed texture would actually be stored as a 4x4x1 image in
  342. * memory.
  343. */
  344. }
  345. #include "vmware_pack_end.h"
  346. SVGA3dCmdDefineSurface_v2; /* SVGA_3D_CMD_SURFACE_DEFINE_V2 */
  347. typedef
  348. #include "vmware_pack_begin.h"
  349. struct {
  350. uint32 sid;
  351. }
  352. #include "vmware_pack_end.h"
  353. SVGA3dCmdDestroySurface; /* SVGA_3D_CMD_SURFACE_DESTROY */
  354. typedef
  355. #include "vmware_pack_begin.h"
  356. struct {
  357. uint32 cid;
  358. }
  359. #include "vmware_pack_end.h"
  360. SVGA3dCmdDefineContext; /* SVGA_3D_CMD_CONTEXT_DEFINE */
  361. typedef
  362. #include "vmware_pack_begin.h"
  363. struct {
  364. uint32 cid;
  365. }
  366. #include "vmware_pack_end.h"
  367. SVGA3dCmdDestroyContext; /* SVGA_3D_CMD_CONTEXT_DESTROY */
  368. typedef
  369. #include "vmware_pack_begin.h"
  370. struct {
  371. uint32 cid;
  372. SVGA3dClearFlag clearFlag;
  373. uint32 color;
  374. float depth;
  375. uint32 stencil;
  376. /* Followed by variable number of SVGA3dRect structures */
  377. }
  378. #include "vmware_pack_end.h"
  379. SVGA3dCmdClear; /* SVGA_3D_CMD_CLEAR */
  380. typedef
  381. #include "vmware_pack_begin.h"
  382. struct {
  383. SVGA3dLightType type;
  384. SVGA3dBool inWorldSpace;
  385. float diffuse[4];
  386. float specular[4];
  387. float ambient[4];
  388. float position[4];
  389. float direction[4];
  390. float range;
  391. float falloff;
  392. float attenuation0;
  393. float attenuation1;
  394. float attenuation2;
  395. float theta;
  396. float phi;
  397. }
  398. #include "vmware_pack_end.h"
  399. SVGA3dLightData;
  400. typedef
  401. #include "vmware_pack_begin.h"
  402. struct {
  403. uint32 sid;
  404. /* Followed by variable number of SVGA3dCopyRect structures */
  405. }
  406. #include "vmware_pack_end.h"
  407. SVGA3dCmdPresent; /* SVGA_3D_CMD_PRESENT */
  408. typedef
  409. #include "vmware_pack_begin.h"
  410. struct {
  411. SVGA3dRenderStateName state;
  412. union {
  413. uint32 uintValue;
  414. float floatValue;
  415. };
  416. }
  417. #include "vmware_pack_end.h"
  418. SVGA3dRenderState;
  419. typedef
  420. #include "vmware_pack_begin.h"
  421. struct {
  422. uint32 cid;
  423. /* Followed by variable number of SVGA3dRenderState structures */
  424. }
  425. #include "vmware_pack_end.h"
  426. SVGA3dCmdSetRenderState; /* SVGA_3D_CMD_SETRENDERSTATE */
  427. typedef
  428. #include "vmware_pack_begin.h"
  429. struct {
  430. uint32 cid;
  431. SVGA3dRenderTargetType type;
  432. SVGA3dSurfaceImageId target;
  433. }
  434. #include "vmware_pack_end.h"
  435. SVGA3dCmdSetRenderTarget; /* SVGA_3D_CMD_SETRENDERTARGET */
  436. typedef
  437. #include "vmware_pack_begin.h"
  438. struct {
  439. SVGA3dSurfaceImageId src;
  440. SVGA3dSurfaceImageId dest;
  441. /* Followed by variable number of SVGA3dCopyBox structures */
  442. }
  443. #include "vmware_pack_end.h"
  444. SVGA3dCmdSurfaceCopy; /* SVGA_3D_CMD_SURFACE_COPY */
  445. /*
  446. * Perform a surface copy within the same image.
  447. * The src/dest boxes are allowed to overlap.
  448. */
  449. typedef
  450. #include "vmware_pack_begin.h"
  451. struct {
  452. SVGA3dSurfaceImageId surface;
  453. SVGA3dCopyBox box;
  454. }
  455. #include "vmware_pack_end.h"
  456. SVGA3dCmdIntraSurfaceCopy; /* SVGA_3D_CMD_INTRA_SURFACE_COPY */
  457. typedef
  458. #include "vmware_pack_begin.h"
  459. struct {
  460. uint32 srcSid;
  461. uint32 destSid;
  462. }
  463. #include "vmware_pack_end.h"
  464. SVGA3dCmdWholeSurfaceCopy; /* SVGA_3D_CMD_WHOLE_SURFACE_COPY */
  465. typedef
  466. #include "vmware_pack_begin.h"
  467. struct {
  468. SVGA3dSurfaceImageId src;
  469. SVGA3dSurfaceImageId dest;
  470. SVGA3dBox boxSrc;
  471. SVGA3dBox boxDest;
  472. SVGA3dStretchBltMode mode;
  473. }
  474. #include "vmware_pack_end.h"
  475. SVGA3dCmdSurfaceStretchBlt; /* SVGA_3D_CMD_SURFACE_STRETCHBLT */
  476. typedef
  477. #include "vmware_pack_begin.h"
  478. struct {
  479. /*
  480. * If the discard flag is present in a surface DMA operation, the host may
  481. * discard the contents of the current mipmap level and face of the target
  482. * surface before applying the surface DMA contents.
  483. */
  484. uint32 discard : 1;
  485. /*
  486. * If the unsynchronized flag is present, the host may perform this upload
  487. * without syncing to pending reads on this surface.
  488. */
  489. uint32 unsynchronized : 1;
  490. /*
  491. * Guests *MUST* set the reserved bits to 0 before submitting the command
  492. * suffix as future flags may occupy these bits.
  493. */
  494. uint32 reserved : 30;
  495. }
  496. #include "vmware_pack_end.h"
  497. SVGA3dSurfaceDMAFlags;
  498. typedef
  499. #include "vmware_pack_begin.h"
  500. struct {
  501. SVGAGuestImage guest;
  502. SVGA3dSurfaceImageId host;
  503. SVGA3dTransferType transfer;
  504. /*
  505. * Followed by variable number of SVGA3dCopyBox structures. For consistency
  506. * in all clipping logic and coordinate translation, we define the
  507. * "source" in each copyBox as the guest image and the
  508. * "destination" as the host image, regardless of transfer
  509. * direction.
  510. *
  511. * For efficiency, the SVGA3D device is free to copy more data than
  512. * specified. For example, it may round copy boxes outwards such
  513. * that they lie on particular alignment boundaries.
  514. */
  515. }
  516. #include "vmware_pack_end.h"
  517. SVGA3dCmdSurfaceDMA; /* SVGA_3D_CMD_SURFACE_DMA */
  518. /*
  519. * SVGA3dCmdSurfaceDMASuffix --
  520. *
  521. * This is a command suffix that will appear after a SurfaceDMA command in
  522. * the FIFO. It contains some extra information that hosts may use to
  523. * optimize performance or protect the guest. This suffix exists to preserve
  524. * backwards compatibility while also allowing for new functionality to be
  525. * implemented.
  526. */
  527. typedef
  528. #include "vmware_pack_begin.h"
  529. struct {
  530. uint32 suffixSize;
  531. /*
  532. * The maximum offset is used to determine the maximum offset from the
  533. * guestPtr base address that will be accessed or written to during this
  534. * surfaceDMA. If the suffix is supported, the host will respect this
  535. * boundary while performing surface DMAs.
  536. *
  537. * Defaults to MAX_UINT32
  538. */
  539. uint32 maximumOffset;
  540. /*
  541. * A set of flags that describes optimizations that the host may perform
  542. * while performing this surface DMA operation. The guest should never rely
  543. * on behaviour that is different when these flags are set for correctness.
  544. *
  545. * Defaults to 0
  546. */
  547. SVGA3dSurfaceDMAFlags flags;
  548. }
  549. #include "vmware_pack_end.h"
  550. SVGA3dCmdSurfaceDMASuffix;
  551. /*
  552. * SVGA_3D_CMD_DRAW_PRIMITIVES --
  553. *
  554. * This command is the SVGA3D device's generic drawing entry point.
  555. * It can draw multiple ranges of primitives, optionally using an
  556. * index buffer, using an arbitrary collection of vertex buffers.
  557. *
  558. * Each SVGA3dVertexDecl defines a distinct vertex array to bind
  559. * during this draw call. The declarations specify which surface
  560. * the vertex data lives in, what that vertex data is used for,
  561. * and how to interpret it.
  562. *
  563. * Each SVGA3dPrimitiveRange defines a collection of primitives
  564. * to render using the same vertex arrays. An index buffer is
  565. * optional.
  566. */
  567. typedef
  568. #include "vmware_pack_begin.h"
  569. struct {
  570. /*
  571. * A range hint is an optional specification for the range of indices
  572. * in an SVGA3dArray that will be used. If 'last' is zero, it is assumed
  573. * that the entire array will be used.
  574. *
  575. * These are only hints. The SVGA3D device may use them for
  576. * performance optimization if possible, but it's also allowed to
  577. * ignore these values.
  578. */
  579. uint32 first;
  580. uint32 last;
  581. }
  582. #include "vmware_pack_end.h"
  583. SVGA3dArrayRangeHint;
  584. typedef
  585. #include "vmware_pack_begin.h"
  586. struct {
  587. /*
  588. * Define the origin and shape of a vertex or index array. Both
  589. * 'offset' and 'stride' are in bytes. The provided surface will be
  590. * reinterpreted as a flat array of bytes in the same format used
  591. * by surface DMA operations. To avoid unnecessary conversions, the
  592. * surface should be created with the SVGA3D_BUFFER format.
  593. *
  594. * Index 0 in the array starts 'offset' bytes into the surface.
  595. * Index 1 begins at byte 'offset + stride', etc. Array indices may
  596. * not be negative.
  597. */
  598. uint32 surfaceId;
  599. uint32 offset;
  600. uint32 stride;
  601. }
  602. #include "vmware_pack_end.h"
  603. SVGA3dArray;
  604. typedef
  605. #include "vmware_pack_begin.h"
  606. struct {
  607. /*
  608. * Describe a vertex array's data type, and define how it is to be
  609. * used by the fixed function pipeline or the vertex shader. It
  610. * isn't useful to have two VertexDecls with the same
  611. * VertexArrayIdentity in one draw call.
  612. */
  613. SVGA3dDeclType type;
  614. SVGA3dDeclMethod method;
  615. SVGA3dDeclUsage usage;
  616. uint32 usageIndex;
  617. }
  618. #include "vmware_pack_end.h"
  619. SVGA3dVertexArrayIdentity;
  620. typedef
  621. #include "vmware_pack_begin.h"
  622. struct SVGA3dVertexDecl {
  623. SVGA3dVertexArrayIdentity identity;
  624. SVGA3dArray array;
  625. SVGA3dArrayRangeHint rangeHint;
  626. }
  627. #include "vmware_pack_end.h"
  628. SVGA3dVertexDecl;
  629. typedef
  630. #include "vmware_pack_begin.h"
  631. struct SVGA3dPrimitiveRange {
  632. /*
  633. * Define a group of primitives to render, from sequential indices.
  634. *
  635. * The value of 'primitiveType' and 'primitiveCount' imply the
  636. * total number of vertices that will be rendered.
  637. */
  638. SVGA3dPrimitiveType primType;
  639. uint32 primitiveCount;
  640. /*
  641. * Optional index buffer. If indexArray.surfaceId is
  642. * SVGA3D_INVALID_ID, we render without an index buffer. Rendering
  643. * without an index buffer is identical to rendering with an index
  644. * buffer containing the sequence [0, 1, 2, 3, ...].
  645. *
  646. * If an index buffer is in use, indexWidth specifies the width in
  647. * bytes of each index value. It must be less than or equal to
  648. * indexArray.stride.
  649. *
  650. * (Currently, the SVGA3D device requires index buffers to be tightly
  651. * packed. In other words, indexWidth == indexArray.stride)
  652. */
  653. SVGA3dArray indexArray;
  654. uint32 indexWidth;
  655. /*
  656. * Optional index bias. This number is added to all indices from
  657. * indexArray before they are used as vertex array indices. This
  658. * can be used in multiple ways:
  659. *
  660. * - When not using an indexArray, this bias can be used to
  661. * specify where in the vertex arrays to begin rendering.
  662. *
  663. * - A positive number here is equivalent to increasing the
  664. * offset in each vertex array.
  665. *
  666. * - A negative number can be used to render using a small
  667. * vertex array and an index buffer that contains large
  668. * values. This may be used by some applications that
  669. * crop a vertex buffer without modifying their index
  670. * buffer.
  671. *
  672. * Note that rendering with a negative bias value may be slower and
  673. * use more memory than rendering with a positive or zero bias.
  674. */
  675. int32 indexBias;
  676. }
  677. #include "vmware_pack_end.h"
  678. SVGA3dPrimitiveRange;
  679. typedef
  680. #include "vmware_pack_begin.h"
  681. struct {
  682. uint32 cid;
  683. uint32 numVertexDecls;
  684. uint32 numRanges;
  685. /*
  686. * There are two variable size arrays after the
  687. * SVGA3dCmdDrawPrimitives structure. In order,
  688. * they are:
  689. *
  690. * 1. SVGA3dVertexDecl, quantity 'numVertexDecls', but no more than
  691. * SVGA3D_MAX_VERTEX_ARRAYS;
  692. * 2. SVGA3dPrimitiveRange, quantity 'numRanges', but no more than
  693. * SVGA3D_MAX_DRAW_PRIMITIVE_RANGES;
  694. * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains
  695. * the frequency divisor for the corresponding vertex decl).
  696. */
  697. }
  698. #include "vmware_pack_end.h"
  699. SVGA3dCmdDrawPrimitives; /* SVGA_3D_CMD_DRAWPRIMITIVES */
  700. typedef
  701. #include "vmware_pack_begin.h"
  702. struct {
  703. uint32 cid;
  704. uint32 primitiveCount; /* How many primitives to render */
  705. uint32 startVertexLocation; /* Which vertex do we start rendering at. */
  706. uint8 primitiveType; /* SVGA3dPrimitiveType */
  707. uint8 padding[3];
  708. }
  709. #include "vmware_pack_end.h"
  710. SVGA3dCmdDraw;
  711. typedef
  712. #include "vmware_pack_begin.h"
  713. struct {
  714. uint32 cid;
  715. uint8 primitiveType; /* SVGA3dPrimitiveType */
  716. uint32 indexBufferSid; /* Valid index buffer sid. */
  717. uint32 indexBufferOffset; /* Byte offset into the vertex buffer, almost */
  718. /* always 0 for DX9 guests, non-zero for OpenGL */
  719. /* guests. We can't represent non-multiple of */
  720. /* stride offsets in D3D9Renderer... */
  721. uint8 indexBufferStride; /* Allowable values = 1, 2, or 4 */
  722. int32 baseVertexLocation; /* Bias applied to the index when selecting a */
  723. /* vertex from the streams, may be negative */
  724. uint32 primitiveCount; /* How many primitives to render */
  725. uint32 pad0;
  726. uint16 pad1;
  727. }
  728. #include "vmware_pack_end.h"
  729. SVGA3dCmdDrawIndexed;
  730. typedef
  731. #include "vmware_pack_begin.h"
  732. struct {
  733. /*
  734. * Describe a vertex array's data type, and define how it is to be
  735. * used by the fixed function pipeline or the vertex shader. It
  736. * isn't useful to have two VertexDecls with the same
  737. * VertexArrayIdentity in one draw call.
  738. */
  739. uint16 streamOffset;
  740. uint8 stream;
  741. uint8 type; /* SVGA3dDeclType */
  742. uint8 method; /* SVGA3dDeclMethod */
  743. uint8 usage; /* SVGA3dDeclUsage */
  744. uint8 usageIndex;
  745. uint8 padding;
  746. }
  747. #include "vmware_pack_end.h"
  748. SVGA3dVertexElement;
  749. /*
  750. * Should the vertex element respect the stream value? The high bit of the
  751. * stream should be set to indicate that the stream should be respected. If
  752. * the high bit is not set, the stream will be ignored and replaced by the index
  753. * of the position of the currently considered vertex element.
  754. *
  755. * All guests should set this bit and correctly specify the stream going
  756. * forward.
  757. */
  758. #define SVGA3D_VERTEX_ELEMENT_RESPECT_STREAM (1 << 7)
  759. typedef
  760. #include "vmware_pack_begin.h"
  761. struct {
  762. uint32 cid;
  763. uint32 numElements;
  764. /*
  765. * Followed by numElements SVGA3dVertexElement structures.
  766. *
  767. * If numElements < SVGA3D_MAX_VERTEX_ARRAYS, the remaining elements
  768. * are cleared and will not be used by following draws.
  769. */
  770. }
  771. #include "vmware_pack_end.h"
  772. SVGA3dCmdSetVertexDecls;
  773. typedef
  774. #include "vmware_pack_begin.h"
  775. struct {
  776. uint32 sid;
  777. uint32 stride;
  778. uint32 offset;
  779. }
  780. #include "vmware_pack_end.h"
  781. SVGA3dVertexStream;
  782. typedef
  783. #include "vmware_pack_begin.h"
  784. struct {
  785. uint32 cid;
  786. uint32 numStreams;
  787. /*
  788. * Followed by numStream SVGA3dVertexStream structures.
  789. *
  790. * If numStreams < SVGA3D_MAX_VERTEX_ARRAYS, the remaining streams
  791. * are cleared and will not be used by following draws.
  792. */
  793. }
  794. #include "vmware_pack_end.h"
  795. SVGA3dCmdSetVertexStreams;
  796. typedef
  797. #include "vmware_pack_begin.h"
  798. struct {
  799. uint32 cid;
  800. uint32 numDivisors;
  801. }
  802. #include "vmware_pack_end.h"
  803. SVGA3dCmdSetVertexDivisors;
  804. typedef
  805. #include "vmware_pack_begin.h"
  806. struct {
  807. uint32 stage;
  808. SVGA3dTextureStateName name;
  809. union {
  810. uint32 value;
  811. float floatValue;
  812. };
  813. }
  814. #include "vmware_pack_end.h"
  815. SVGA3dTextureState;
  816. typedef
  817. #include "vmware_pack_begin.h"
  818. struct {
  819. uint32 cid;
  820. /* Followed by variable number of SVGA3dTextureState structures */
  821. }
  822. #include "vmware_pack_end.h"
  823. SVGA3dCmdSetTextureState; /* SVGA_3D_CMD_SETTEXTURESTATE */
  824. typedef
  825. #include "vmware_pack_begin.h"
  826. struct {
  827. uint32 cid;
  828. SVGA3dTransformType type;
  829. float matrix[16];
  830. }
  831. #include "vmware_pack_end.h"
  832. SVGA3dCmdSetTransform; /* SVGA_3D_CMD_SETTRANSFORM */
  833. typedef
  834. #include "vmware_pack_begin.h"
  835. struct {
  836. float min;
  837. float max;
  838. }
  839. #include "vmware_pack_end.h"
  840. SVGA3dZRange;
  841. typedef
  842. #include "vmware_pack_begin.h"
  843. struct {
  844. uint32 cid;
  845. SVGA3dZRange zRange;
  846. }
  847. #include "vmware_pack_end.h"
  848. SVGA3dCmdSetZRange; /* SVGA_3D_CMD_SETZRANGE */
  849. typedef
  850. #include "vmware_pack_begin.h"
  851. struct {
  852. float diffuse[4];
  853. float ambient[4];
  854. float specular[4];
  855. float emissive[4];
  856. float shininess;
  857. }
  858. #include "vmware_pack_end.h"
  859. SVGA3dMaterial;
  860. typedef
  861. #include "vmware_pack_begin.h"
  862. struct {
  863. uint32 cid;
  864. SVGA3dFace face;
  865. SVGA3dMaterial material;
  866. }
  867. #include "vmware_pack_end.h"
  868. SVGA3dCmdSetMaterial; /* SVGA_3D_CMD_SETMATERIAL */
  869. typedef
  870. #include "vmware_pack_begin.h"
  871. struct {
  872. uint32 cid;
  873. uint32 index;
  874. SVGA3dLightData data;
  875. }
  876. #include "vmware_pack_end.h"
  877. SVGA3dCmdSetLightData; /* SVGA_3D_CMD_SETLIGHTDATA */
  878. typedef
  879. #include "vmware_pack_begin.h"
  880. struct {
  881. uint32 cid;
  882. uint32 index;
  883. uint32 enabled;
  884. }
  885. #include "vmware_pack_end.h"
  886. SVGA3dCmdSetLightEnabled; /* SVGA_3D_CMD_SETLIGHTENABLED */
  887. typedef
  888. #include "vmware_pack_begin.h"
  889. struct {
  890. uint32 cid;
  891. SVGA3dRect rect;
  892. }
  893. #include "vmware_pack_end.h"
  894. SVGA3dCmdSetViewport; /* SVGA_3D_CMD_SETVIEWPORT */
  895. typedef
  896. #include "vmware_pack_begin.h"
  897. struct {
  898. uint32 cid;
  899. SVGA3dRect rect;
  900. }
  901. #include "vmware_pack_end.h"
  902. SVGA3dCmdSetScissorRect; /* SVGA_3D_CMD_SETSCISSORRECT */
  903. typedef
  904. #include "vmware_pack_begin.h"
  905. struct {
  906. uint32 cid;
  907. uint32 index;
  908. float plane[4];
  909. }
  910. #include "vmware_pack_end.h"
  911. SVGA3dCmdSetClipPlane; /* SVGA_3D_CMD_SETCLIPPLANE */
  912. typedef
  913. #include "vmware_pack_begin.h"
  914. struct {
  915. uint32 cid;
  916. uint32 shid;
  917. SVGA3dShaderType type;
  918. /* Followed by variable number of DWORDs for shader bycode */
  919. }
  920. #include "vmware_pack_end.h"
  921. SVGA3dCmdDefineShader; /* SVGA_3D_CMD_SHADER_DEFINE */
  922. typedef
  923. #include "vmware_pack_begin.h"
  924. struct {
  925. uint32 cid;
  926. uint32 shid;
  927. SVGA3dShaderType type;
  928. }
  929. #include "vmware_pack_end.h"
  930. SVGA3dCmdDestroyShader; /* SVGA_3D_CMD_SHADER_DESTROY */
  931. typedef
  932. #include "vmware_pack_begin.h"
  933. struct {
  934. uint32 cid;
  935. uint32 reg; /* register number */
  936. SVGA3dShaderType type;
  937. SVGA3dShaderConstType ctype;
  938. uint32 values[4];
  939. /*
  940. * Followed by a variable number of additional values.
  941. */
  942. }
  943. #include "vmware_pack_end.h"
  944. SVGA3dCmdSetShaderConst; /* SVGA_3D_CMD_SET_SHADER_CONST */
  945. typedef
  946. #include "vmware_pack_begin.h"
  947. struct {
  948. uint32 cid;
  949. SVGA3dShaderType type;
  950. uint32 shid;
  951. }
  952. #include "vmware_pack_end.h"
  953. SVGA3dCmdSetShader; /* SVGA_3D_CMD_SET_SHADER */
  954. typedef
  955. #include "vmware_pack_begin.h"
  956. struct {
  957. uint32 cid;
  958. SVGA3dQueryType type;
  959. }
  960. #include "vmware_pack_end.h"
  961. SVGA3dCmdBeginQuery; /* SVGA_3D_CMD_BEGIN_QUERY */
  962. typedef
  963. #include "vmware_pack_begin.h"
  964. struct {
  965. uint32 cid;
  966. SVGA3dQueryType type;
  967. SVGAGuestPtr guestResult; /* Points to an SVGA3dQueryResult structure */
  968. }
  969. #include "vmware_pack_end.h"
  970. SVGA3dCmdEndQuery; /* SVGA_3D_CMD_END_QUERY */
  971. /*
  972. * SVGA3D_CMD_WAIT_FOR_QUERY --
  973. *
  974. * Will read the SVGA3dQueryResult structure pointed to by guestResult,
  975. * and if the state member is set to anything else than
  976. * SVGA3D_QUERYSTATE_PENDING, this command will always be a no-op.
  977. *
  978. * Otherwise, in addition to the query explicitly waited for,
  979. * All queries with the same type and issued with the same cid, for which
  980. * an SVGA_3D_CMD_END_QUERY command has previously been sent, will
  981. * be finished after execution of this command.
  982. *
  983. * A query will be identified by the gmrId and offset of the guestResult
  984. * member. If the device can't find an SVGA_3D_CMD_END_QUERY that has
  985. * been sent previously with an indentical gmrId and offset, it will
  986. * effectively end all queries with an identical type issued with the
  987. * same cid, and the SVGA3dQueryResult structure pointed to by
  988. * guestResult will not be written to. This property can be used to
  989. * implement a query barrier for a given cid and query type.
  990. */
  991. typedef
  992. #include "vmware_pack_begin.h"
  993. struct {
  994. uint32 cid; /* Same parameters passed to END_QUERY */
  995. SVGA3dQueryType type;
  996. SVGAGuestPtr guestResult;
  997. }
  998. #include "vmware_pack_end.h"
  999. SVGA3dCmdWaitForQuery; /* SVGA_3D_CMD_WAIT_FOR_QUERY */
  1000. typedef
  1001. #include "vmware_pack_begin.h"
  1002. struct {
  1003. uint32 totalSize; /* Set by guest before query is ended. */
  1004. SVGA3dQueryState state; /* Set by host or guest. See SVGA3dQueryState. */
  1005. union { /* Set by host on exit from PENDING state */
  1006. uint32 result32;
  1007. uint32 queryCookie; /* May be used to identify which QueryGetData this
  1008. result corresponds to. */
  1009. };
  1010. }
  1011. #include "vmware_pack_end.h"
  1012. SVGA3dQueryResult;
  1013. /*
  1014. * SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN --
  1015. *
  1016. * This is a blit from an SVGA3D surface to a Screen Object.
  1017. * This blit must be directed at a specific screen.
  1018. *
  1019. * The blit copies from a rectangular region of an SVGA3D surface
  1020. * image to a rectangular region of a screen.
  1021. *
  1022. * This command takes an optional variable-length list of clipping
  1023. * rectangles after the body of the command. If no rectangles are
  1024. * specified, there is no clipping region. The entire destRect is
  1025. * drawn to. If one or more rectangles are included, they describe
  1026. * a clipping region. The clip rectangle coordinates are measured
  1027. * relative to the top-left corner of destRect.
  1028. *
  1029. * The srcImage must be from mip=0 face=0.
  1030. *
  1031. * This supports scaling if the src and dest are of different sizes.
  1032. *
  1033. * Availability:
  1034. * SVGA_FIFO_CAP_SCREEN_OBJECT
  1035. */
  1036. typedef
  1037. #include "vmware_pack_begin.h"
  1038. struct {
  1039. SVGA3dSurfaceImageId srcImage;
  1040. SVGASignedRect srcRect;
  1041. uint32 destScreenId; /* Screen Object ID */
  1042. SVGASignedRect destRect;
  1043. /* Clipping: zero or more SVGASignedRects follow */
  1044. }
  1045. #include "vmware_pack_end.h"
  1046. SVGA3dCmdBlitSurfaceToScreen; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */
  1047. typedef
  1048. #include "vmware_pack_begin.h"
  1049. struct {
  1050. uint32 sid;
  1051. SVGA3dTextureFilter filter;
  1052. }
  1053. #include "vmware_pack_end.h"
  1054. SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
  1055. typedef
  1056. #include "vmware_pack_begin.h"
  1057. struct {
  1058. uint32 sid;
  1059. }
  1060. #include "vmware_pack_end.h"
  1061. SVGA3dCmdActivateSurface; /* SVGA_3D_CMD_ACTIVATE_SURFACE */
  1062. typedef
  1063. #include "vmware_pack_begin.h"
  1064. struct {
  1065. uint32 sid;
  1066. }
  1067. #include "vmware_pack_end.h"
  1068. SVGA3dCmdDeactivateSurface; /* SVGA_3D_CMD_DEACTIVATE_SURFACE */
  1069. /*
  1070. * Screen DMA command
  1071. *
  1072. * Available with SVGA_FIFO_CAP_SCREEN_OBJECT_2. The SVGA_CAP_3D device
  1073. * cap bit is not required.
  1074. *
  1075. * - refBuffer and destBuffer are 32bit BGRX; refBuffer and destBuffer could
  1076. * be different, but it is required that guest makes sure refBuffer has
  1077. * exactly the same contents that were written to when last time screen DMA
  1078. * command is received by host.
  1079. *
  1080. * - changemap is generated by lib/blit, and it has the changes from last
  1081. * received screen DMA or more.
  1082. */
  1083. typedef
  1084. #include "vmware_pack_begin.h"
  1085. struct SVGA3dCmdScreenDMA {
  1086. uint32 screenId;
  1087. SVGAGuestImage refBuffer;
  1088. SVGAGuestImage destBuffer;
  1089. SVGAGuestImage changeMap;
  1090. }
  1091. #include "vmware_pack_end.h"
  1092. SVGA3dCmdScreenDMA; /* SVGA_3D_CMD_SCREEN_DMA */
  1093. /*
  1094. * Logic ops
  1095. */
  1096. #define SVGA3D_LOTRANSBLT_HONORALPHA (0x01)
  1097. #define SVGA3D_LOSTRETCHBLT_MIRRORX (0x01)
  1098. #define SVGA3D_LOSTRETCHBLT_MIRRORY (0x02)
  1099. #define SVGA3D_LOALPHABLEND_SRCHASALPHA (0x01)
  1100. typedef
  1101. #include "vmware_pack_begin.h"
  1102. struct SVGA3dCmdLogicOpsBitBlt {
  1103. /*
  1104. * All LogicOps surfaces are one-level
  1105. * surfaces so mipmap & face should always
  1106. * be zero.
  1107. */
  1108. SVGA3dSurfaceImageId src;
  1109. SVGA3dSurfaceImageId dst;
  1110. SVGA3dLogicOp logicOp;
  1111. /* Followed by variable number of SVGA3dCopyBox structures */
  1112. }
  1113. #include "vmware_pack_end.h"
  1114. SVGA3dCmdLogicOpsBitBlt; /* SVGA_3D_CMD_LOGICOPS_BITBLT */
  1115. typedef
  1116. #include "vmware_pack_begin.h"
  1117. struct SVGA3dCmdLogicOpsTransBlt {
  1118. /*
  1119. * All LogicOps surfaces are one-level
  1120. * surfaces so mipmap & face should always
  1121. * be zero.
  1122. */
  1123. SVGA3dSurfaceImageId src;
  1124. SVGA3dSurfaceImageId dst;
  1125. uint32 color;
  1126. uint32 flags;
  1127. SVGA3dBox srcBox;
  1128. SVGA3dBox dstBox;
  1129. }
  1130. #include "vmware_pack_end.h"
  1131. SVGA3dCmdLogicOpsTransBlt; /* SVGA_3D_CMD_LOGICOPS_TRANSBLT */
  1132. typedef
  1133. #include "vmware_pack_begin.h"
  1134. struct SVGA3dCmdLogicOpsStretchBlt {
  1135. /*
  1136. * All LogicOps surfaces are one-level
  1137. * surfaces so mipmap & face should always
  1138. * be zero.
  1139. */
  1140. SVGA3dSurfaceImageId src;
  1141. SVGA3dSurfaceImageId dst;
  1142. uint16 mode;
  1143. uint16 flags;
  1144. SVGA3dBox srcBox;
  1145. SVGA3dBox dstBox;
  1146. }
  1147. #include "vmware_pack_end.h"
  1148. SVGA3dCmdLogicOpsStretchBlt; /* SVGA_3D_CMD_LOGICOPS_STRETCHBLT */
  1149. typedef
  1150. #include "vmware_pack_begin.h"
  1151. struct SVGA3dCmdLogicOpsColorFill {
  1152. /*
  1153. * All LogicOps surfaces are one-level
  1154. * surfaces so mipmap & face should always
  1155. * be zero.
  1156. */
  1157. SVGA3dSurfaceImageId dst;
  1158. uint32 color;
  1159. SVGA3dLogicOp logicOp;
  1160. /* Followed by variable number of SVGA3dRect structures. */
  1161. }
  1162. #include "vmware_pack_end.h"
  1163. SVGA3dCmdLogicOpsColorFill; /* SVGA_3D_CMD_LOGICOPS_COLORFILL */
  1164. typedef
  1165. #include "vmware_pack_begin.h"
  1166. struct SVGA3dCmdLogicOpsAlphaBlend {
  1167. /*
  1168. * All LogicOps surfaces are one-level
  1169. * surfaces so mipmap & face should always
  1170. * be zero.
  1171. */
  1172. SVGA3dSurfaceImageId src;
  1173. SVGA3dSurfaceImageId dst;
  1174. uint32 alphaVal;
  1175. uint32 flags;
  1176. SVGA3dBox srcBox;
  1177. SVGA3dBox dstBox;
  1178. }
  1179. #include "vmware_pack_end.h"
  1180. SVGA3dCmdLogicOpsAlphaBlend; /* SVGA_3D_CMD_LOGICOPS_ALPHABLEND */
  1181. #define SVGA3D_CLEARTYPE_INVALID_GAMMA_INDEX 0xFFFFFFFF
  1182. #define SVGA3D_CLEARTYPE_GAMMA_WIDTH 512
  1183. #define SVGA3D_CLEARTYPE_GAMMA_HEIGHT 16
  1184. typedef
  1185. #include "vmware_pack_begin.h"
  1186. struct SVGA3dCmdLogicOpsClearTypeBlend {
  1187. /*
  1188. * All LogicOps surfaces are one-level
  1189. * surfaces so mipmap & face should always
  1190. * be zero.
  1191. */
  1192. SVGA3dSurfaceImageId tmp;
  1193. SVGA3dSurfaceImageId dst;
  1194. SVGA3dSurfaceImageId gammaSurf;
  1195. SVGA3dSurfaceImageId alphaSurf;
  1196. uint32 gamma;
  1197. uint32 color;
  1198. uint32 color2;
  1199. int32 alphaOffsetX;
  1200. int32 alphaOffsetY;
  1201. /* Followed by variable number of SVGA3dBox structures */
  1202. }
  1203. #include "vmware_pack_end.h"
  1204. SVGA3dCmdLogicOpsClearTypeBlend; /* SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND */
  1205. /*
  1206. * Guest-backed objects definitions.
  1207. */
  1208. typedef
  1209. #include "vmware_pack_begin.h"
  1210. struct {
  1211. SVGAMobFormat ptDepth;
  1212. uint32 sizeInBytes;
  1213. PPN64 base;
  1214. }
  1215. #include "vmware_pack_end.h"
  1216. SVGAOTableMobEntry;
  1217. #define SVGA3D_OTABLE_MOB_ENTRY_SIZE (sizeof(SVGAOTableMobEntry))
  1218. typedef
  1219. #include "vmware_pack_begin.h"
  1220. struct {
  1221. SVGA3dSurfaceFormat format;
  1222. SVGA3dSurface1Flags surface1Flags;
  1223. uint32 numMipLevels;
  1224. uint32 multisampleCount;
  1225. SVGA3dTextureFilter autogenFilter;
  1226. SVGA3dSize size;
  1227. SVGAMobId mobid;
  1228. uint32 arraySize;
  1229. uint32 mobPitch;
  1230. SVGA3dSurface2Flags surface2Flags;
  1231. uint8 multisamplePattern;
  1232. uint8 qualityLevel;
  1233. uint8 pad0[2];
  1234. uint32 pad1[3];
  1235. }
  1236. #include "vmware_pack_end.h"
  1237. SVGAOTableSurfaceEntry;
  1238. #define SVGA3D_OTABLE_SURFACE_ENTRY_SIZE (sizeof(SVGAOTableSurfaceEntry))
  1239. typedef
  1240. #include "vmware_pack_begin.h"
  1241. struct {
  1242. uint32 cid;
  1243. SVGAMobId mobid;
  1244. }
  1245. #include "vmware_pack_end.h"
  1246. SVGAOTableContextEntry;
  1247. #define SVGA3D_OTABLE_CONTEXT_ENTRY_SIZE (sizeof(SVGAOTableContextEntry))
  1248. typedef
  1249. #include "vmware_pack_begin.h"
  1250. struct {
  1251. SVGA3dShaderType type;
  1252. uint32 sizeInBytes;
  1253. uint32 offsetInBytes;
  1254. SVGAMobId mobid;
  1255. }
  1256. #include "vmware_pack_end.h"
  1257. SVGAOTableShaderEntry;
  1258. #define SVGA3D_OTABLE_SHADER_ENTRY_SIZE (sizeof(SVGAOTableShaderEntry))
  1259. #define SVGA_STFLAG_PRIMARY (1 << 0)
  1260. #define SVGA_STFLAG_RESERVED (1 << 1) /* Added with cap SVGA_CAP_HP_CMD_QUEUE */
  1261. typedef uint32 SVGAScreenTargetFlags;
  1262. typedef
  1263. #include "vmware_pack_begin.h"
  1264. struct {
  1265. SVGA3dSurfaceImageId image;
  1266. uint32 width;
  1267. uint32 height;
  1268. int32 xRoot;
  1269. int32 yRoot;
  1270. SVGAScreenTargetFlags flags;
  1271. uint32 dpi;
  1272. uint32 pad[7];
  1273. }
  1274. #include "vmware_pack_end.h"
  1275. SVGAOTableScreenTargetEntry;
  1276. #define SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE \
  1277. (sizeof(SVGAOTableScreenTargetEntry))
  1278. typedef
  1279. #include "vmware_pack_begin.h"
  1280. struct {
  1281. float value[4];
  1282. }
  1283. #include "vmware_pack_end.h"
  1284. SVGA3dShaderConstFloat;
  1285. typedef
  1286. #include "vmware_pack_begin.h"
  1287. struct {
  1288. int32 value[4];
  1289. }
  1290. #include "vmware_pack_end.h"
  1291. SVGA3dShaderConstInt;
  1292. typedef
  1293. #include "vmware_pack_begin.h"
  1294. struct {
  1295. uint32 value;
  1296. }
  1297. #include "vmware_pack_end.h"
  1298. SVGA3dShaderConstBool;
  1299. typedef
  1300. #include "vmware_pack_begin.h"
  1301. struct {
  1302. uint16 streamOffset;
  1303. uint8 stream;
  1304. uint8 type;
  1305. uint8 methodUsage;
  1306. uint8 usageIndex;
  1307. }
  1308. #include "vmware_pack_end.h"
  1309. SVGAGBVertexElement;
  1310. typedef
  1311. #include "vmware_pack_begin.h"
  1312. struct {
  1313. uint32 sid;
  1314. uint16 stride;
  1315. uint32 offset;
  1316. }
  1317. #include "vmware_pack_end.h"
  1318. SVGAGBVertexStream;
  1319. typedef
  1320. #include "vmware_pack_begin.h"
  1321. struct {
  1322. SVGA3dRect viewport;
  1323. SVGA3dRect scissorRect;
  1324. SVGA3dZRange zRange;
  1325. SVGA3dSurfaceImageId renderTargets[SVGA3D_RT_MAX];
  1326. SVGAGBVertexElement decl1[4];
  1327. uint32 renderStates[SVGA3D_RS_MAX];
  1328. SVGAGBVertexElement decl2[18];
  1329. uint32 pad0[2];
  1330. struct {
  1331. SVGA3dFace face;
  1332. SVGA3dMaterial material;
  1333. } material;
  1334. float clipPlanes[SVGA3D_NUM_CLIPPLANES][4];
  1335. float matrices[SVGA3D_TRANSFORM_MAX][16];
  1336. SVGA3dBool lightEnabled[SVGA3D_NUM_LIGHTS];
  1337. SVGA3dLightData lightData[SVGA3D_NUM_LIGHTS];
  1338. /*
  1339. * Shaders currently bound
  1340. */
  1341. uint32 shaders[SVGA3D_NUM_SHADERTYPE_PREDX];
  1342. SVGAGBVertexElement decl3[10];
  1343. uint32 pad1[3];
  1344. uint32 occQueryActive;
  1345. uint32 occQueryValue;
  1346. /*
  1347. * Int/Bool Shader constants
  1348. */
  1349. SVGA3dShaderConstInt pShaderIValues[SVGA3D_CONSTINTREG_MAX];
  1350. SVGA3dShaderConstInt vShaderIValues[SVGA3D_CONSTINTREG_MAX];
  1351. uint16 pShaderBValues;
  1352. uint16 vShaderBValues;
  1353. SVGAGBVertexStream streams[SVGA3D_MAX_VERTEX_ARRAYS];
  1354. SVGA3dVertexDivisor divisors[SVGA3D_MAX_VERTEX_ARRAYS];
  1355. uint32 numVertexDecls;
  1356. uint32 numVertexStreams;
  1357. uint32 numVertexDivisors;
  1358. uint32 pad2[30];
  1359. /*
  1360. * Texture Stages
  1361. *
  1362. * SVGA3D_TS_INVALID through SVGA3D_TS_CONSTANT are in the
  1363. * textureStages array.
  1364. * SVGA3D_TS_COLOR_KEY is in tsColorKey.
  1365. */
  1366. uint32 tsColorKey[SVGA3D_NUM_TEXTURE_UNITS];
  1367. uint32 textureStages[SVGA3D_NUM_TEXTURE_UNITS][SVGA3D_TS_CONSTANT + 1];
  1368. uint32 tsColorKeyEnable[SVGA3D_NUM_TEXTURE_UNITS];
  1369. /*
  1370. * Float Shader constants.
  1371. */
  1372. SVGA3dShaderConstFloat pShaderFValues[SVGA3D_CONSTREG_MAX];
  1373. SVGA3dShaderConstFloat vShaderFValues[SVGA3D_CONSTREG_MAX];
  1374. }
  1375. #include "vmware_pack_end.h"
  1376. SVGAGBContextData;
  1377. #define SVGA3D_CONTEXT_DATA_SIZE (sizeof(SVGAGBContextData))
  1378. /*
  1379. * SVGA3dCmdSetOTableBase --
  1380. *
  1381. * This command allows the guest to specify the base PPN of the
  1382. * specified object table.
  1383. */
  1384. typedef
  1385. #include "vmware_pack_begin.h"
  1386. struct {
  1387. SVGAOTableType type;
  1388. PPN baseAddress;
  1389. uint32 sizeInBytes;
  1390. uint32 validSizeInBytes;
  1391. SVGAMobFormat ptDepth;
  1392. }
  1393. #include "vmware_pack_end.h"
  1394. SVGA3dCmdSetOTableBase; /* SVGA_3D_CMD_SET_OTABLE_BASE */
  1395. typedef
  1396. #include "vmware_pack_begin.h"
  1397. struct {
  1398. SVGAOTableType type;
  1399. PPN64 baseAddress;
  1400. uint32 sizeInBytes;
  1401. uint32 validSizeInBytes;
  1402. SVGAMobFormat ptDepth;
  1403. }
  1404. #include "vmware_pack_end.h"
  1405. SVGA3dCmdSetOTableBase64; /* SVGA_3D_CMD_SET_OTABLE_BASE64 */
  1406. /*
  1407. * Guests using SVGA_3D_CMD_GROW_OTABLE are promising that
  1408. * the new OTable contains the same contents as the old one, except possibly
  1409. * for some new invalid entries at the end.
  1410. *
  1411. * (Otherwise, guests should use one of the SetOTableBase commands.)
  1412. */
  1413. typedef
  1414. #include "vmware_pack_begin.h"
  1415. struct {
  1416. SVGAOTableType type;
  1417. PPN64 baseAddress;
  1418. uint32 sizeInBytes;
  1419. uint32 validSizeInBytes;
  1420. SVGAMobFormat ptDepth;
  1421. }
  1422. #include "vmware_pack_end.h"
  1423. SVGA3dCmdGrowOTable; /* SVGA_3D_CMD_GROW_OTABLE */
  1424. typedef
  1425. #include "vmware_pack_begin.h"
  1426. struct {
  1427. SVGAOTableType type;
  1428. }
  1429. #include "vmware_pack_end.h"
  1430. SVGA3dCmdReadbackOTable; /* SVGA_3D_CMD_READBACK_OTABLE */
  1431. /*
  1432. * Define a memory object (Mob) in the OTable.
  1433. */
  1434. typedef
  1435. #include "vmware_pack_begin.h"
  1436. struct SVGA3dCmdDefineGBMob {
  1437. SVGAMobId mobid;
  1438. SVGAMobFormat ptDepth;
  1439. PPN base;
  1440. uint32 sizeInBytes;
  1441. }
  1442. #include "vmware_pack_end.h"
  1443. SVGA3dCmdDefineGBMob; /* SVGA_3D_CMD_DEFINE_GB_MOB */
  1444. /*
  1445. * Destroys an object in the OTable.
  1446. */
  1447. typedef
  1448. #include "vmware_pack_begin.h"
  1449. struct SVGA3dCmdDestroyGBMob {
  1450. SVGAMobId mobid;
  1451. }
  1452. #include "vmware_pack_end.h"
  1453. SVGA3dCmdDestroyGBMob; /* SVGA_3D_CMD_DESTROY_GB_MOB */
  1454. /*
  1455. * Define a memory object (Mob) in the OTable with a PPN64 base.
  1456. */
  1457. typedef
  1458. #include "vmware_pack_begin.h"
  1459. struct SVGA3dCmdDefineGBMob64 {
  1460. SVGAMobId mobid;
  1461. SVGAMobFormat ptDepth;
  1462. PPN64 base;
  1463. uint32 sizeInBytes;
  1464. }
  1465. #include "vmware_pack_end.h"
  1466. SVGA3dCmdDefineGBMob64; /* SVGA_3D_CMD_DEFINE_GB_MOB64 */
  1467. /*
  1468. * Redefine an object in the OTable with PPN64 base.
  1469. */
  1470. typedef
  1471. #include "vmware_pack_begin.h"
  1472. struct SVGA3dCmdRedefineGBMob64 {
  1473. SVGAMobId mobid;
  1474. SVGAMobFormat ptDepth;
  1475. PPN64 base;
  1476. uint32 sizeInBytes;
  1477. }
  1478. #include "vmware_pack_end.h"
  1479. SVGA3dCmdRedefineGBMob64; /* SVGA_3D_CMD_REDEFINE_GB_MOB64 */
  1480. /*
  1481. * Notification that the page tables have been modified.
  1482. */
  1483. typedef
  1484. #include "vmware_pack_begin.h"
  1485. struct SVGA3dCmdUpdateGBMobMapping {
  1486. SVGAMobId mobid;
  1487. }
  1488. #include "vmware_pack_end.h"
  1489. SVGA3dCmdUpdateGBMobMapping; /* SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING */
  1490. /*
  1491. * Define a guest-backed surface.
  1492. */
  1493. typedef
  1494. #include "vmware_pack_begin.h"
  1495. struct SVGA3dCmdDefineGBSurface {
  1496. uint32 sid;
  1497. SVGA3dSurface1Flags surfaceFlags;
  1498. SVGA3dSurfaceFormat format;
  1499. uint32 numMipLevels;
  1500. uint32 multisampleCount;
  1501. SVGA3dTextureFilter autogenFilter;
  1502. SVGA3dSize size;
  1503. }
  1504. #include "vmware_pack_end.h"
  1505. SVGA3dCmdDefineGBSurface; /* SVGA_3D_CMD_DEFINE_GB_SURFACE */
  1506. /*
  1507. * Defines a guest-backed surface, adding the arraySize field.
  1508. */
  1509. typedef
  1510. #include "vmware_pack_begin.h"
  1511. struct SVGA3dCmdDefineGBSurface_v2 {
  1512. uint32 sid;
  1513. SVGA3dSurface1Flags surfaceFlags;
  1514. SVGA3dSurfaceFormat format;
  1515. uint32 numMipLevels;
  1516. uint32 multisampleCount;
  1517. SVGA3dTextureFilter autogenFilter;
  1518. SVGA3dSize size;
  1519. uint32 arraySize;
  1520. uint32 pad;
  1521. }
  1522. #include "vmware_pack_end.h"
  1523. SVGA3dCmdDefineGBSurface_v2; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 */
  1524. /*
  1525. * Defines a guest-backed surface, adding the larger flags.
  1526. */
  1527. typedef
  1528. #include "vmware_pack_begin.h"
  1529. struct SVGA3dCmdDefineGBSurface_v3 {
  1530. uint32 sid;
  1531. SVGA3dSurfaceAllFlags surfaceFlags;
  1532. SVGA3dSurfaceFormat format;
  1533. uint32 numMipLevels;
  1534. uint32 multisampleCount;
  1535. SVGA3dMSPattern multisamplePattern;
  1536. SVGA3dMSQualityLevel qualityLevel;
  1537. SVGA3dTextureFilter autogenFilter;
  1538. SVGA3dSize size;
  1539. uint32 arraySize;
  1540. }
  1541. #include "vmware_pack_end.h"
  1542. SVGA3dCmdDefineGBSurface_v3; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 */
  1543. /*
  1544. * Destroy a guest-backed surface.
  1545. */
  1546. typedef
  1547. #include "vmware_pack_begin.h"
  1548. struct SVGA3dCmdDestroyGBSurface {
  1549. uint32 sid;
  1550. }
  1551. #include "vmware_pack_end.h"
  1552. SVGA3dCmdDestroyGBSurface; /* SVGA_3D_CMD_DESTROY_GB_SURFACE */
  1553. /*
  1554. * Bind a guest-backed surface to a mob.
  1555. */
  1556. typedef
  1557. #include "vmware_pack_begin.h"
  1558. struct SVGA3dCmdBindGBSurface {
  1559. uint32 sid;
  1560. SVGAMobId mobid;
  1561. }
  1562. #include "vmware_pack_end.h"
  1563. SVGA3dCmdBindGBSurface; /* SVGA_3D_CMD_BIND_GB_SURFACE */
  1564. typedef
  1565. #include "vmware_pack_begin.h"
  1566. struct SVGA3dCmdBindGBSurfaceWithPitch {
  1567. uint32 sid;
  1568. SVGAMobId mobid;
  1569. uint32 baseLevelPitch;
  1570. }
  1571. #include "vmware_pack_end.h"
  1572. SVGA3dCmdBindGBSurfaceWithPitch; /* SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH */
  1573. /*
  1574. * Conditionally bind a mob to a guest-backed surface if testMobid
  1575. * matches the currently bound mob. Optionally issue a
  1576. * readback/update on the surface while it is still bound to the old
  1577. * mobid if the mobid is changed by this command.
  1578. */
  1579. #define SVGA3D_COND_BIND_GB_SURFACE_FLAG_READBACK (1 << 0)
  1580. #define SVGA3D_COND_BIND_GB_SURFACE_FLAG_UPDATE (1 << 1)
  1581. typedef
  1582. #include "vmware_pack_begin.h"
  1583. struct SVGA3dCmdCondBindGBSurface {
  1584. uint32 sid;
  1585. SVGAMobId testMobid;
  1586. SVGAMobId mobid;
  1587. uint32 flags;
  1588. }
  1589. #include "vmware_pack_end.h"
  1590. SVGA3dCmdCondBindGBSurface; /* SVGA_3D_CMD_COND_BIND_GB_SURFACE */
  1591. /*
  1592. * Update an image in a guest-backed surface.
  1593. * (Inform the device that the guest-contents have been updated.)
  1594. */
  1595. typedef
  1596. #include "vmware_pack_begin.h"
  1597. struct SVGA3dCmdUpdateGBImage {
  1598. SVGA3dSurfaceImageId image;
  1599. SVGA3dBox box;
  1600. }
  1601. #include "vmware_pack_end.h"
  1602. SVGA3dCmdUpdateGBImage; /* SVGA_3D_CMD_UPDATE_GB_IMAGE */
  1603. /*
  1604. * Update an entire guest-backed surface.
  1605. * (Inform the device that the guest-contents have been updated.)
  1606. */
  1607. typedef
  1608. #include "vmware_pack_begin.h"
  1609. struct SVGA3dCmdUpdateGBSurface {
  1610. uint32 sid;
  1611. }
  1612. #include "vmware_pack_end.h"
  1613. SVGA3dCmdUpdateGBSurface; /* SVGA_3D_CMD_UPDATE_GB_SURFACE */
  1614. /*
  1615. * Readback an image in a guest-backed surface.
  1616. * (Request the device to flush the dirty contents into the guest.)
  1617. */
  1618. typedef
  1619. #include "vmware_pack_begin.h"
  1620. struct SVGA3dCmdReadbackGBImage {
  1621. SVGA3dSurfaceImageId image;
  1622. }
  1623. #include "vmware_pack_end.h"
  1624. SVGA3dCmdReadbackGBImage; /* SVGA_3D_CMD_READBACK_GB_IMAGE */
  1625. /*
  1626. * Readback an entire guest-backed surface.
  1627. * (Request the device to flush the dirty contents into the guest.)
  1628. */
  1629. typedef
  1630. #include "vmware_pack_begin.h"
  1631. struct SVGA3dCmdReadbackGBSurface {
  1632. uint32 sid;
  1633. }
  1634. #include "vmware_pack_end.h"
  1635. SVGA3dCmdReadbackGBSurface; /* SVGA_3D_CMD_READBACK_GB_SURFACE */
  1636. /*
  1637. * Readback a sub rect of an image in a guest-backed surface. After
  1638. * issuing this command the driver is required to issue an update call
  1639. * of the same region before issuing any other commands that reference
  1640. * this surface or rendering is not guaranteed.
  1641. */
  1642. typedef
  1643. #include "vmware_pack_begin.h"
  1644. struct SVGA3dCmdReadbackGBImagePartial {
  1645. SVGA3dSurfaceImageId image;
  1646. SVGA3dBox box;
  1647. uint32 invertBox;
  1648. }
  1649. #include "vmware_pack_end.h"
  1650. SVGA3dCmdReadbackGBImagePartial; /* SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL */
  1651. /*
  1652. * Invalidate an image in a guest-backed surface.
  1653. * (Notify the device that the contents can be lost.)
  1654. */
  1655. typedef
  1656. #include "vmware_pack_begin.h"
  1657. struct SVGA3dCmdInvalidateGBImage {
  1658. SVGA3dSurfaceImageId image;
  1659. }
  1660. #include "vmware_pack_end.h"
  1661. SVGA3dCmdInvalidateGBImage; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE */
  1662. /*
  1663. * Invalidate an entire guest-backed surface.
  1664. * (Notify the device that the contents if all images can be lost.)
  1665. */
  1666. typedef
  1667. #include "vmware_pack_begin.h"
  1668. struct SVGA3dCmdInvalidateGBSurface {
  1669. uint32 sid;
  1670. }
  1671. #include "vmware_pack_end.h"
  1672. SVGA3dCmdInvalidateGBSurface; /* SVGA_3D_CMD_INVALIDATE_GB_SURFACE */
  1673. /*
  1674. * Invalidate a sub rect of an image in a guest-backed surface. After
  1675. * issuing this command the driver is required to issue an update call
  1676. * of the same region before issuing any other commands that reference
  1677. * this surface or rendering is not guaranteed.
  1678. */
  1679. typedef
  1680. #include "vmware_pack_begin.h"
  1681. struct SVGA3dCmdInvalidateGBImagePartial {
  1682. SVGA3dSurfaceImageId image;
  1683. SVGA3dBox box;
  1684. uint32 invertBox;
  1685. }
  1686. #include "vmware_pack_end.h"
  1687. SVGA3dCmdInvalidateGBImagePartial; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL */
  1688. /*
  1689. * Define a guest-backed context.
  1690. */
  1691. typedef
  1692. #include "vmware_pack_begin.h"
  1693. struct SVGA3dCmdDefineGBContext {
  1694. uint32 cid;
  1695. }
  1696. #include "vmware_pack_end.h"
  1697. SVGA3dCmdDefineGBContext; /* SVGA_3D_CMD_DEFINE_GB_CONTEXT */
  1698. /*
  1699. * Destroy a guest-backed context.
  1700. */
  1701. typedef
  1702. #include "vmware_pack_begin.h"
  1703. struct SVGA3dCmdDestroyGBContext {
  1704. uint32 cid;
  1705. }
  1706. #include "vmware_pack_end.h"
  1707. SVGA3dCmdDestroyGBContext; /* SVGA_3D_CMD_DESTROY_GB_CONTEXT */
  1708. /*
  1709. * Bind a guest-backed context.
  1710. *
  1711. * validContents should be set to 0 for new contexts,
  1712. * and 1 if this is an old context which is getting paged
  1713. * back on to the device.
  1714. *
  1715. * For new contexts, it is recommended that the driver
  1716. * issue commands to initialize all interesting state
  1717. * prior to rendering.
  1718. */
  1719. typedef
  1720. #include "vmware_pack_begin.h"
  1721. struct SVGA3dCmdBindGBContext {
  1722. uint32 cid;
  1723. SVGAMobId mobid;
  1724. uint32 validContents;
  1725. }
  1726. #include "vmware_pack_end.h"
  1727. SVGA3dCmdBindGBContext; /* SVGA_3D_CMD_BIND_GB_CONTEXT */
  1728. /*
  1729. * Readback a guest-backed context.
  1730. * (Request that the device flush the contents back into guest memory.)
  1731. */
  1732. typedef
  1733. #include "vmware_pack_begin.h"
  1734. struct SVGA3dCmdReadbackGBContext {
  1735. uint32 cid;
  1736. }
  1737. #include "vmware_pack_end.h"
  1738. SVGA3dCmdReadbackGBContext; /* SVGA_3D_CMD_READBACK_GB_CONTEXT */
  1739. /*
  1740. * Invalidate a guest-backed context.
  1741. */
  1742. typedef
  1743. #include "vmware_pack_begin.h"
  1744. struct SVGA3dCmdInvalidateGBContext {
  1745. uint32 cid;
  1746. }
  1747. #include "vmware_pack_end.h"
  1748. SVGA3dCmdInvalidateGBContext; /* SVGA_3D_CMD_INVALIDATE_GB_CONTEXT */
  1749. /*
  1750. * Define a guest-backed shader.
  1751. */
  1752. typedef
  1753. #include "vmware_pack_begin.h"
  1754. struct SVGA3dCmdDefineGBShader {
  1755. uint32 shid;
  1756. SVGA3dShaderType type;
  1757. uint32 sizeInBytes;
  1758. }
  1759. #include "vmware_pack_end.h"
  1760. SVGA3dCmdDefineGBShader; /* SVGA_3D_CMD_DEFINE_GB_SHADER */
  1761. /*
  1762. * Bind a guest-backed shader.
  1763. */
  1764. typedef
  1765. #include "vmware_pack_begin.h"
  1766. struct SVGA3dCmdBindGBShader {
  1767. uint32 shid;
  1768. SVGAMobId mobid;
  1769. uint32 offsetInBytes;
  1770. }
  1771. #include "vmware_pack_end.h"
  1772. SVGA3dCmdBindGBShader; /* SVGA_3D_CMD_BIND_GB_SHADER */
  1773. /*
  1774. * Destroy a guest-backed shader.
  1775. */
  1776. typedef
  1777. #include "vmware_pack_begin.h"
  1778. struct SVGA3dCmdDestroyGBShader {
  1779. uint32 shid;
  1780. }
  1781. #include "vmware_pack_end.h"
  1782. SVGA3dCmdDestroyGBShader; /* SVGA_3D_CMD_DESTROY_GB_SHADER */
  1783. typedef
  1784. #include "vmware_pack_begin.h"
  1785. struct {
  1786. uint32 cid;
  1787. uint32 regStart;
  1788. SVGA3dShaderType shaderType;
  1789. SVGA3dShaderConstType constType;
  1790. /*
  1791. * Followed by a variable number of shader constants.
  1792. *
  1793. * Note that FLOAT and INT constants are 4-dwords in length, while
  1794. * BOOL constants are 1-dword in length.
  1795. */
  1796. }
  1797. #include "vmware_pack_end.h"
  1798. SVGA3dCmdSetGBShaderConstInline; /* SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE */
  1799. typedef
  1800. #include "vmware_pack_begin.h"
  1801. struct {
  1802. uint32 cid;
  1803. SVGA3dQueryType type;
  1804. }
  1805. #include "vmware_pack_end.h"
  1806. SVGA3dCmdBeginGBQuery; /* SVGA_3D_CMD_BEGIN_GB_QUERY */
  1807. typedef
  1808. #include "vmware_pack_begin.h"
  1809. struct {
  1810. uint32 cid;
  1811. SVGA3dQueryType type;
  1812. SVGAMobId mobid;
  1813. uint32 offset;
  1814. }
  1815. #include "vmware_pack_end.h"
  1816. SVGA3dCmdEndGBQuery; /* SVGA_3D_CMD_END_GB_QUERY */
  1817. /*
  1818. * SVGA_3D_CMD_WAIT_FOR_GB_QUERY --
  1819. *
  1820. * The semantics of this command are identical to the
  1821. * SVGA_3D_CMD_WAIT_FOR_QUERY except that the results are written
  1822. * to a Mob instead of a GMR.
  1823. */
  1824. typedef
  1825. #include "vmware_pack_begin.h"
  1826. struct {
  1827. uint32 cid;
  1828. SVGA3dQueryType type;
  1829. SVGAMobId mobid;
  1830. uint32 offset;
  1831. }
  1832. #include "vmware_pack_end.h"
  1833. SVGA3dCmdWaitForGBQuery; /* SVGA_3D_CMD_WAIT_FOR_GB_QUERY */
  1834. typedef
  1835. #include "vmware_pack_begin.h"
  1836. struct {
  1837. SVGAMobId mobid;
  1838. uint32 mustBeZero;
  1839. uint32 initialized;
  1840. }
  1841. #include "vmware_pack_end.h"
  1842. SVGA3dCmdEnableGart; /* SVGA_3D_CMD_ENABLE_GART */
  1843. typedef
  1844. #include "vmware_pack_begin.h"
  1845. struct {
  1846. SVGAMobId mobid;
  1847. uint32 gartOffset;
  1848. }
  1849. #include "vmware_pack_end.h"
  1850. SVGA3dCmdMapMobIntoGart; /* SVGA_3D_CMD_MAP_MOB_INTO_GART */
  1851. typedef
  1852. #include "vmware_pack_begin.h"
  1853. struct {
  1854. uint32 gartOffset;
  1855. uint32 numPages;
  1856. }
  1857. #include "vmware_pack_end.h"
  1858. SVGA3dCmdUnmapGartRange; /* SVGA_3D_CMD_UNMAP_GART_RANGE */
  1859. /*
  1860. * Screen Targets
  1861. */
  1862. typedef
  1863. #include "vmware_pack_begin.h"
  1864. struct {
  1865. uint32 stid;
  1866. uint32 width;
  1867. uint32 height;
  1868. int32 xRoot;
  1869. int32 yRoot;
  1870. SVGAScreenTargetFlags flags;
  1871. /*
  1872. * The physical DPI that the guest expects this screen displayed at.
  1873. *
  1874. * Guests which are not DPI-aware should set this to zero.
  1875. */
  1876. uint32 dpi;
  1877. }
  1878. #include "vmware_pack_end.h"
  1879. SVGA3dCmdDefineGBScreenTarget; /* SVGA_3D_CMD_DEFINE_GB_SCREENTARGET */
  1880. typedef
  1881. #include "vmware_pack_begin.h"
  1882. struct {
  1883. uint32 stid;
  1884. }
  1885. #include "vmware_pack_end.h"
  1886. SVGA3dCmdDestroyGBScreenTarget; /* SVGA_3D_CMD_DESTROY_GB_SCREENTARGET */
  1887. typedef
  1888. #include "vmware_pack_begin.h"
  1889. struct {
  1890. uint32 stid;
  1891. SVGA3dSurfaceImageId image;
  1892. }
  1893. #include "vmware_pack_end.h"
  1894. SVGA3dCmdBindGBScreenTarget; /* SVGA_3D_CMD_BIND_GB_SCREENTARGET */
  1895. typedef
  1896. #include "vmware_pack_begin.h"
  1897. struct {
  1898. uint32 stid;
  1899. SVGA3dRect rect;
  1900. }
  1901. #include "vmware_pack_end.h"
  1902. SVGA3dCmdUpdateGBScreenTarget; /* SVGA_3D_CMD_UPDATE_GB_SCREENTARGET */
  1903. typedef
  1904. #include "vmware_pack_begin.h"
  1905. struct SVGA3dCmdGBScreenDMA {
  1906. uint32 screenId;
  1907. uint32 dead;
  1908. SVGAMobId destMobID;
  1909. uint32 destPitch;
  1910. SVGAMobId changeMapMobID;
  1911. }
  1912. #include "vmware_pack_end.h"
  1913. SVGA3dCmdGBScreenDMA; /* SVGA_3D_CMD_GB_SCREEN_DMA */
  1914. typedef
  1915. #include "vmware_pack_begin.h"
  1916. struct {
  1917. uint32 value;
  1918. uint32 mobId;
  1919. uint32 mobOffset;
  1920. }
  1921. #include "vmware_pack_end.h"
  1922. SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE */
  1923. typedef
  1924. #include "vmware_pack_begin.h"
  1925. struct {
  1926. uint32 stid;
  1927. SVGA3dSurfaceImageId dest;
  1928. uint32 statusMobId;
  1929. uint32 statusMobOffset;
  1930. /* Reserved fields */
  1931. uint32 mustBeInvalidId;
  1932. uint32 mustBeZero;
  1933. }
  1934. #include "vmware_pack_end.h"
  1935. SVGA3dCmdScreenCopy; /* SVGA_3D_CMD_SCREEN_COPY */
  1936. #define SVGA_SCREEN_COPY_STATUS_FAILURE 0x00
  1937. #define SVGA_SCREEN_COPY_STATUS_SUCCESS 0x01
  1938. #define SVGA_SCREEN_COPY_STATUS_INVALID 0xFFFFFFFF
  1939. #endif /* _SVGA3D_CMD_H_ */