svga3d_cmd.h 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072
  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 1999 (inclusive) are available for use by the
  46. * current SVGA3D protocol.
  47. *
  48. * FIFO clients other than SVGA3D should stay below 1000, or at 2000
  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_VIDEO_CREATE_DECODER = 1072,
  87. SVGA_3D_CMD_VIDEO_DESTROY_DECODER = 1073,
  88. SVGA_3D_CMD_VIDEO_CREATE_PROCESSOR = 1074,
  89. SVGA_3D_CMD_VIDEO_DESTROY_PROCESSOR = 1075,
  90. SVGA_3D_CMD_VIDEO_DECODE_START_FRAME = 1076,
  91. SVGA_3D_CMD_VIDEO_DECODE_RENDER = 1077,
  92. SVGA_3D_CMD_VIDEO_DECODE_END_FRAME = 1078,
  93. SVGA_3D_CMD_VIDEO_PROCESS_FRAME = 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_SET_UNITY_SURFACE_COOKIE = 1083,
  98. SVGA_3D_CMD_OPEN_CONTEXT_SURFACE = 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_STRETCHBLT = 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_SHADER_ON_CONTEXT = 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 DX11 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_MAX = 1226,
  248. SVGA_3D_CMD_MAX = 1226,
  249. SVGA_3D_CMD_FUTURE_MAX = 3000
  250. } SVGAFifo3dCmdId;
  251. /*
  252. * FIFO command format definitions:
  253. */
  254. /*
  255. * The data size header following cmdNum for every 3d command
  256. */
  257. typedef
  258. #include "vmware_pack_begin.h"
  259. struct {
  260. uint32 id;
  261. uint32 size;
  262. }
  263. #include "vmware_pack_end.h"
  264. SVGA3dCmdHeader;
  265. typedef
  266. #include "vmware_pack_begin.h"
  267. struct {
  268. uint32 numMipLevels;
  269. }
  270. #include "vmware_pack_end.h"
  271. SVGA3dSurfaceFace;
  272. typedef
  273. #include "vmware_pack_begin.h"
  274. struct {
  275. uint32 sid;
  276. SVGA3dSurfaceFlags surfaceFlags;
  277. SVGA3dSurfaceFormat format;
  278. /*
  279. * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
  280. * structures must have the same value of numMipLevels field.
  281. * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
  282. * numMipLevels set to 0.
  283. */
  284. SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
  285. /*
  286. * Followed by an SVGA3dSize structure for each mip level in each face.
  287. *
  288. * A note on surface sizes: Sizes are always specified in pixels,
  289. * even if the true surface size is not a multiple of the minimum
  290. * block size of the surface's format. For example, a 3x3x1 DXT1
  291. * compressed texture would actually be stored as a 4x4x1 image in
  292. * memory.
  293. */
  294. }
  295. #include "vmware_pack_end.h"
  296. SVGA3dCmdDefineSurface; /* SVGA_3D_CMD_SURFACE_DEFINE */
  297. typedef
  298. #include "vmware_pack_begin.h"
  299. struct {
  300. uint32 sid;
  301. SVGA3dSurfaceFlags surfaceFlags;
  302. SVGA3dSurfaceFormat format;
  303. /*
  304. * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
  305. * structures must have the same value of numMipLevels field.
  306. * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
  307. * numMipLevels set to 0.
  308. */
  309. SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
  310. uint32 multisampleCount;
  311. SVGA3dTextureFilter autogenFilter;
  312. /*
  313. * Followed by an SVGA3dSize structure for each mip level in each face.
  314. *
  315. * A note on surface sizes: Sizes are always specified in pixels,
  316. * even if the true surface size is not a multiple of the minimum
  317. * block size of the surface's format. For example, a 3x3x1 DXT1
  318. * compressed texture would actually be stored as a 4x4x1 image in
  319. * memory.
  320. */
  321. }
  322. #include "vmware_pack_end.h"
  323. SVGA3dCmdDefineSurface_v2; /* SVGA_3D_CMD_SURFACE_DEFINE_V2 */
  324. typedef
  325. #include "vmware_pack_begin.h"
  326. struct {
  327. uint32 sid;
  328. }
  329. #include "vmware_pack_end.h"
  330. SVGA3dCmdDestroySurface; /* SVGA_3D_CMD_SURFACE_DESTROY */
  331. typedef
  332. #include "vmware_pack_begin.h"
  333. struct {
  334. uint32 cid;
  335. }
  336. #include "vmware_pack_end.h"
  337. SVGA3dCmdDefineContext; /* SVGA_3D_CMD_CONTEXT_DEFINE */
  338. typedef
  339. #include "vmware_pack_begin.h"
  340. struct {
  341. uint32 cid;
  342. }
  343. #include "vmware_pack_end.h"
  344. SVGA3dCmdDestroyContext; /* SVGA_3D_CMD_CONTEXT_DESTROY */
  345. typedef
  346. #include "vmware_pack_begin.h"
  347. struct {
  348. uint32 cid;
  349. SVGA3dClearFlag clearFlag;
  350. uint32 color;
  351. float depth;
  352. uint32 stencil;
  353. /* Followed by variable number of SVGA3dRect structures */
  354. }
  355. #include "vmware_pack_end.h"
  356. SVGA3dCmdClear; /* SVGA_3D_CMD_CLEAR */
  357. typedef
  358. #include "vmware_pack_begin.h"
  359. struct {
  360. SVGA3dLightType type;
  361. SVGA3dBool inWorldSpace;
  362. float diffuse[4];
  363. float specular[4];
  364. float ambient[4];
  365. float position[4];
  366. float direction[4];
  367. float range;
  368. float falloff;
  369. float attenuation0;
  370. float attenuation1;
  371. float attenuation2;
  372. float theta;
  373. float phi;
  374. }
  375. #include "vmware_pack_end.h"
  376. SVGA3dLightData;
  377. typedef
  378. #include "vmware_pack_begin.h"
  379. struct {
  380. uint32 sid;
  381. /* Followed by variable number of SVGA3dCopyRect structures */
  382. }
  383. #include "vmware_pack_end.h"
  384. SVGA3dCmdPresent; /* SVGA_3D_CMD_PRESENT */
  385. typedef
  386. #include "vmware_pack_begin.h"
  387. struct {
  388. SVGA3dRenderStateName state;
  389. union {
  390. uint32 uintValue;
  391. float floatValue;
  392. };
  393. }
  394. #include "vmware_pack_end.h"
  395. SVGA3dRenderState;
  396. typedef
  397. #include "vmware_pack_begin.h"
  398. struct {
  399. uint32 cid;
  400. /* Followed by variable number of SVGA3dRenderState structures */
  401. }
  402. #include "vmware_pack_end.h"
  403. SVGA3dCmdSetRenderState; /* SVGA_3D_CMD_SETRENDERSTATE */
  404. typedef
  405. #include "vmware_pack_begin.h"
  406. struct {
  407. uint32 cid;
  408. SVGA3dRenderTargetType type;
  409. SVGA3dSurfaceImageId target;
  410. }
  411. #include "vmware_pack_end.h"
  412. SVGA3dCmdSetRenderTarget; /* SVGA_3D_CMD_SETRENDERTARGET */
  413. typedef
  414. #include "vmware_pack_begin.h"
  415. struct {
  416. SVGA3dSurfaceImageId src;
  417. SVGA3dSurfaceImageId dest;
  418. /* Followed by variable number of SVGA3dCopyBox structures */
  419. }
  420. #include "vmware_pack_end.h"
  421. SVGA3dCmdSurfaceCopy; /* SVGA_3D_CMD_SURFACE_COPY */
  422. typedef
  423. #include "vmware_pack_begin.h"
  424. struct {
  425. SVGA3dSurfaceImageId src;
  426. SVGA3dSurfaceImageId dest;
  427. SVGA3dBox boxSrc;
  428. SVGA3dBox boxDest;
  429. SVGA3dStretchBltMode mode;
  430. }
  431. #include "vmware_pack_end.h"
  432. SVGA3dCmdSurfaceStretchBlt; /* SVGA_3D_CMD_SURFACE_STRETCHBLT */
  433. typedef
  434. #include "vmware_pack_begin.h"
  435. struct {
  436. /*
  437. * If the discard flag is present in a surface DMA operation, the host may
  438. * discard the contents of the current mipmap level and face of the target
  439. * surface before applying the surface DMA contents.
  440. */
  441. uint32 discard : 1;
  442. /*
  443. * If the unsynchronized flag is present, the host may perform this upload
  444. * without syncing to pending reads on this surface.
  445. */
  446. uint32 unsynchronized : 1;
  447. /*
  448. * Guests *MUST* set the reserved bits to 0 before submitting the command
  449. * suffix as future flags may occupy these bits.
  450. */
  451. uint32 reserved : 30;
  452. }
  453. #include "vmware_pack_end.h"
  454. SVGA3dSurfaceDMAFlags;
  455. typedef
  456. #include "vmware_pack_begin.h"
  457. struct {
  458. SVGAGuestImage guest;
  459. SVGA3dSurfaceImageId host;
  460. SVGA3dTransferType transfer;
  461. /*
  462. * Followed by variable number of SVGA3dCopyBox structures. For consistency
  463. * in all clipping logic and coordinate translation, we define the
  464. * "source" in each copyBox as the guest image and the
  465. * "destination" as the host image, regardless of transfer
  466. * direction.
  467. *
  468. * For efficiency, the SVGA3D device is free to copy more data than
  469. * specified. For example, it may round copy boxes outwards such
  470. * that they lie on particular alignment boundaries.
  471. */
  472. }
  473. #include "vmware_pack_end.h"
  474. SVGA3dCmdSurfaceDMA; /* SVGA_3D_CMD_SURFACE_DMA */
  475. /*
  476. * SVGA3dCmdSurfaceDMASuffix --
  477. *
  478. * This is a command suffix that will appear after a SurfaceDMA command in
  479. * the FIFO. It contains some extra information that hosts may use to
  480. * optimize performance or protect the guest. This suffix exists to preserve
  481. * backwards compatibility while also allowing for new functionality to be
  482. * implemented.
  483. */
  484. typedef
  485. #include "vmware_pack_begin.h"
  486. struct {
  487. uint32 suffixSize;
  488. /*
  489. * The maximum offset is used to determine the maximum offset from the
  490. * guestPtr base address that will be accessed or written to during this
  491. * surfaceDMA. If the suffix is supported, the host will respect this
  492. * boundary while performing surface DMAs.
  493. *
  494. * Defaults to MAX_UINT32
  495. */
  496. uint32 maximumOffset;
  497. /*
  498. * A set of flags that describes optimizations that the host may perform
  499. * while performing this surface DMA operation. The guest should never rely
  500. * on behaviour that is different when these flags are set for correctness.
  501. *
  502. * Defaults to 0
  503. */
  504. SVGA3dSurfaceDMAFlags flags;
  505. }
  506. #include "vmware_pack_end.h"
  507. SVGA3dCmdSurfaceDMASuffix;
  508. /*
  509. * SVGA_3D_CMD_DRAW_PRIMITIVES --
  510. *
  511. * This command is the SVGA3D device's generic drawing entry point.
  512. * It can draw multiple ranges of primitives, optionally using an
  513. * index buffer, using an arbitrary collection of vertex buffers.
  514. *
  515. * Each SVGA3dVertexDecl defines a distinct vertex array to bind
  516. * during this draw call. The declarations specify which surface
  517. * the vertex data lives in, what that vertex data is used for,
  518. * and how to interpret it.
  519. *
  520. * Each SVGA3dPrimitiveRange defines a collection of primitives
  521. * to render using the same vertex arrays. An index buffer is
  522. * optional.
  523. */
  524. typedef
  525. #include "vmware_pack_begin.h"
  526. struct {
  527. /*
  528. * A range hint is an optional specification for the range of indices
  529. * in an SVGA3dArray that will be used. If 'last' is zero, it is assumed
  530. * that the entire array will be used.
  531. *
  532. * These are only hints. The SVGA3D device may use them for
  533. * performance optimization if possible, but it's also allowed to
  534. * ignore these values.
  535. */
  536. uint32 first;
  537. uint32 last;
  538. }
  539. #include "vmware_pack_end.h"
  540. SVGA3dArrayRangeHint;
  541. typedef
  542. #include "vmware_pack_begin.h"
  543. struct {
  544. /*
  545. * Define the origin and shape of a vertex or index array. Both
  546. * 'offset' and 'stride' are in bytes. The provided surface will be
  547. * reinterpreted as a flat array of bytes in the same format used
  548. * by surface DMA operations. To avoid unnecessary conversions, the
  549. * surface should be created with the SVGA3D_BUFFER format.
  550. *
  551. * Index 0 in the array starts 'offset' bytes into the surface.
  552. * Index 1 begins at byte 'offset + stride', etc. Array indices may
  553. * not be negative.
  554. */
  555. uint32 surfaceId;
  556. uint32 offset;
  557. uint32 stride;
  558. }
  559. #include "vmware_pack_end.h"
  560. SVGA3dArray;
  561. typedef
  562. #include "vmware_pack_begin.h"
  563. struct {
  564. /*
  565. * Describe a vertex array's data type, and define how it is to be
  566. * used by the fixed function pipeline or the vertex shader. It
  567. * isn't useful to have two VertexDecls with the same
  568. * VertexArrayIdentity in one draw call.
  569. */
  570. SVGA3dDeclType type;
  571. SVGA3dDeclMethod method;
  572. SVGA3dDeclUsage usage;
  573. uint32 usageIndex;
  574. }
  575. #include "vmware_pack_end.h"
  576. SVGA3dVertexArrayIdentity;
  577. typedef
  578. #include "vmware_pack_begin.h"
  579. struct SVGA3dVertexDecl {
  580. SVGA3dVertexArrayIdentity identity;
  581. SVGA3dArray array;
  582. SVGA3dArrayRangeHint rangeHint;
  583. }
  584. #include "vmware_pack_end.h"
  585. SVGA3dVertexDecl;
  586. typedef
  587. #include "vmware_pack_begin.h"
  588. struct SVGA3dPrimitiveRange {
  589. /*
  590. * Define a group of primitives to render, from sequential indices.
  591. *
  592. * The value of 'primitiveType' and 'primitiveCount' imply the
  593. * total number of vertices that will be rendered.
  594. */
  595. SVGA3dPrimitiveType primType;
  596. uint32 primitiveCount;
  597. /*
  598. * Optional index buffer. If indexArray.surfaceId is
  599. * SVGA3D_INVALID_ID, we render without an index buffer. Rendering
  600. * without an index buffer is identical to rendering with an index
  601. * buffer containing the sequence [0, 1, 2, 3, ...].
  602. *
  603. * If an index buffer is in use, indexWidth specifies the width in
  604. * bytes of each index value. It must be less than or equal to
  605. * indexArray.stride.
  606. *
  607. * (Currently, the SVGA3D device requires index buffers to be tightly
  608. * packed. In other words, indexWidth == indexArray.stride)
  609. */
  610. SVGA3dArray indexArray;
  611. uint32 indexWidth;
  612. /*
  613. * Optional index bias. This number is added to all indices from
  614. * indexArray before they are used as vertex array indices. This
  615. * can be used in multiple ways:
  616. *
  617. * - When not using an indexArray, this bias can be used to
  618. * specify where in the vertex arrays to begin rendering.
  619. *
  620. * - A positive number here is equivalent to increasing the
  621. * offset in each vertex array.
  622. *
  623. * - A negative number can be used to render using a small
  624. * vertex array and an index buffer that contains large
  625. * values. This may be used by some applications that
  626. * crop a vertex buffer without modifying their index
  627. * buffer.
  628. *
  629. * Note that rendering with a negative bias value may be slower and
  630. * use more memory than rendering with a positive or zero bias.
  631. */
  632. int32 indexBias;
  633. }
  634. #include "vmware_pack_end.h"
  635. SVGA3dPrimitiveRange;
  636. typedef
  637. #include "vmware_pack_begin.h"
  638. struct {
  639. uint32 cid;
  640. uint32 numVertexDecls;
  641. uint32 numRanges;
  642. /*
  643. * There are two variable size arrays after the
  644. * SVGA3dCmdDrawPrimitives structure. In order,
  645. * they are:
  646. *
  647. * 1. SVGA3dVertexDecl, quantity 'numVertexDecls', but no more than
  648. * SVGA3D_MAX_VERTEX_ARRAYS;
  649. * 2. SVGA3dPrimitiveRange, quantity 'numRanges', but no more than
  650. * SVGA3D_MAX_DRAW_PRIMITIVE_RANGES;
  651. * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains
  652. * the frequency divisor for the corresponding vertex decl).
  653. */
  654. }
  655. #include "vmware_pack_end.h"
  656. SVGA3dCmdDrawPrimitives; /* SVGA_3D_CMD_DRAWPRIMITIVES */
  657. typedef
  658. #include "vmware_pack_begin.h"
  659. struct {
  660. uint32 cid;
  661. uint32 primitiveCount; /* How many primitives to render */
  662. uint32 startVertexLocation; /* Which vertex do we start rendering at. */
  663. uint8 primitiveType; /* SVGA3dPrimitiveType */
  664. uint8 padding[3];
  665. }
  666. #include "vmware_pack_end.h"
  667. SVGA3dCmdDraw;
  668. typedef
  669. #include "vmware_pack_begin.h"
  670. struct {
  671. uint32 cid;
  672. uint8 primitiveType; /* SVGA3dPrimitiveType */
  673. uint32 indexBufferSid; /* Valid index buffer sid. */
  674. uint32 indexBufferOffset; /* Byte offset into the vertex buffer, almost */
  675. /* always 0 for DX9 guests, non-zero for OpenGL */
  676. /* guests. We can't represent non-multiple of */
  677. /* stride offsets in D3D9Renderer... */
  678. uint8 indexBufferStride; /* Allowable values = 1, 2, or 4 */
  679. int32 baseVertexLocation; /* Bias applied to the index when selecting a */
  680. /* vertex from the streams, may be negative */
  681. uint32 primitiveCount; /* How many primitives to render */
  682. uint32 pad0;
  683. uint16 pad1;
  684. }
  685. #include "vmware_pack_end.h"
  686. SVGA3dCmdDrawIndexed;
  687. typedef
  688. #include "vmware_pack_begin.h"
  689. struct {
  690. /*
  691. * Describe a vertex array's data type, and define how it is to be
  692. * used by the fixed function pipeline or the vertex shader. It
  693. * isn't useful to have two VertexDecls with the same
  694. * VertexArrayIdentity in one draw call.
  695. */
  696. uint16 streamOffset;
  697. uint8 stream;
  698. uint8 type; /* SVGA3dDeclType */
  699. uint8 method; /* SVGA3dDeclMethod */
  700. uint8 usage; /* SVGA3dDeclUsage */
  701. uint8 usageIndex;
  702. uint8 padding;
  703. }
  704. #include "vmware_pack_end.h"
  705. SVGA3dVertexElement;
  706. typedef
  707. #include "vmware_pack_begin.h"
  708. struct {
  709. uint32 cid;
  710. uint32 numElements;
  711. /*
  712. * Followed by numElements SVGA3dVertexElement structures.
  713. *
  714. * If numElements < SVGA3D_MAX_VERTEX_ARRAYS, the remaining elements
  715. * are cleared and will not be used by following draws.
  716. */
  717. }
  718. #include "vmware_pack_end.h"
  719. SVGA3dCmdSetVertexDecls;
  720. typedef
  721. #include "vmware_pack_begin.h"
  722. struct {
  723. uint32 sid;
  724. uint32 stride;
  725. uint32 offset;
  726. }
  727. #include "vmware_pack_end.h"
  728. SVGA3dVertexStream;
  729. typedef
  730. #include "vmware_pack_begin.h"
  731. struct {
  732. uint32 cid;
  733. uint32 numStreams;
  734. /*
  735. * Followed by numStream SVGA3dVertexStream structures.
  736. *
  737. * If numStreams < SVGA3D_MAX_VERTEX_ARRAYS, the remaining streams
  738. * are cleared and will not be used by following draws.
  739. */
  740. }
  741. #include "vmware_pack_end.h"
  742. SVGA3dCmdSetVertexStreams;
  743. typedef
  744. #include "vmware_pack_begin.h"
  745. struct {
  746. uint32 cid;
  747. uint32 numDivisors;
  748. }
  749. #include "vmware_pack_end.h"
  750. SVGA3dCmdSetVertexDivisors;
  751. typedef
  752. #include "vmware_pack_begin.h"
  753. struct {
  754. uint32 stage;
  755. SVGA3dTextureStateName name;
  756. union {
  757. uint32 value;
  758. float floatValue;
  759. };
  760. }
  761. #include "vmware_pack_end.h"
  762. SVGA3dTextureState;
  763. typedef
  764. #include "vmware_pack_begin.h"
  765. struct {
  766. uint32 cid;
  767. /* Followed by variable number of SVGA3dTextureState structures */
  768. }
  769. #include "vmware_pack_end.h"
  770. SVGA3dCmdSetTextureState; /* SVGA_3D_CMD_SETTEXTURESTATE */
  771. typedef
  772. #include "vmware_pack_begin.h"
  773. struct {
  774. uint32 cid;
  775. SVGA3dTransformType type;
  776. float matrix[16];
  777. }
  778. #include "vmware_pack_end.h"
  779. SVGA3dCmdSetTransform; /* SVGA_3D_CMD_SETTRANSFORM */
  780. typedef
  781. #include "vmware_pack_begin.h"
  782. struct {
  783. float min;
  784. float max;
  785. }
  786. #include "vmware_pack_end.h"
  787. SVGA3dZRange;
  788. typedef
  789. #include "vmware_pack_begin.h"
  790. struct {
  791. uint32 cid;
  792. SVGA3dZRange zRange;
  793. }
  794. #include "vmware_pack_end.h"
  795. SVGA3dCmdSetZRange; /* SVGA_3D_CMD_SETZRANGE */
  796. typedef
  797. #include "vmware_pack_begin.h"
  798. struct {
  799. float diffuse[4];
  800. float ambient[4];
  801. float specular[4];
  802. float emissive[4];
  803. float shininess;
  804. }
  805. #include "vmware_pack_end.h"
  806. SVGA3dMaterial;
  807. typedef
  808. #include "vmware_pack_begin.h"
  809. struct {
  810. uint32 cid;
  811. SVGA3dFace face;
  812. SVGA3dMaterial material;
  813. }
  814. #include "vmware_pack_end.h"
  815. SVGA3dCmdSetMaterial; /* SVGA_3D_CMD_SETMATERIAL */
  816. typedef
  817. #include "vmware_pack_begin.h"
  818. struct {
  819. uint32 cid;
  820. uint32 index;
  821. SVGA3dLightData data;
  822. }
  823. #include "vmware_pack_end.h"
  824. SVGA3dCmdSetLightData; /* SVGA_3D_CMD_SETLIGHTDATA */
  825. typedef
  826. #include "vmware_pack_begin.h"
  827. struct {
  828. uint32 cid;
  829. uint32 index;
  830. uint32 enabled;
  831. }
  832. #include "vmware_pack_end.h"
  833. SVGA3dCmdSetLightEnabled; /* SVGA_3D_CMD_SETLIGHTENABLED */
  834. typedef
  835. #include "vmware_pack_begin.h"
  836. struct {
  837. uint32 cid;
  838. SVGA3dRect rect;
  839. }
  840. #include "vmware_pack_end.h"
  841. SVGA3dCmdSetViewport; /* SVGA_3D_CMD_SETVIEWPORT */
  842. typedef
  843. #include "vmware_pack_begin.h"
  844. struct {
  845. uint32 cid;
  846. SVGA3dRect rect;
  847. }
  848. #include "vmware_pack_end.h"
  849. SVGA3dCmdSetScissorRect; /* SVGA_3D_CMD_SETSCISSORRECT */
  850. typedef
  851. #include "vmware_pack_begin.h"
  852. struct {
  853. uint32 cid;
  854. uint32 index;
  855. float plane[4];
  856. }
  857. #include "vmware_pack_end.h"
  858. SVGA3dCmdSetClipPlane; /* SVGA_3D_CMD_SETCLIPPLANE */
  859. typedef
  860. #include "vmware_pack_begin.h"
  861. struct {
  862. uint32 cid;
  863. uint32 shid;
  864. SVGA3dShaderType type;
  865. /* Followed by variable number of DWORDs for shader bycode */
  866. }
  867. #include "vmware_pack_end.h"
  868. SVGA3dCmdDefineShader; /* SVGA_3D_CMD_SHADER_DEFINE */
  869. typedef
  870. #include "vmware_pack_begin.h"
  871. struct {
  872. uint32 cid;
  873. uint32 shid;
  874. SVGA3dShaderType type;
  875. }
  876. #include "vmware_pack_end.h"
  877. SVGA3dCmdDestroyShader; /* SVGA_3D_CMD_SHADER_DESTROY */
  878. typedef
  879. #include "vmware_pack_begin.h"
  880. struct {
  881. uint32 cid;
  882. uint32 reg; /* register number */
  883. SVGA3dShaderType type;
  884. SVGA3dShaderConstType ctype;
  885. uint32 values[4];
  886. /*
  887. * Followed by a variable number of additional values.
  888. */
  889. }
  890. #include "vmware_pack_end.h"
  891. SVGA3dCmdSetShaderConst; /* SVGA_3D_CMD_SET_SHADER_CONST */
  892. typedef
  893. #include "vmware_pack_begin.h"
  894. struct {
  895. uint32 cid;
  896. SVGA3dShaderType type;
  897. uint32 shid;
  898. }
  899. #include "vmware_pack_end.h"
  900. SVGA3dCmdSetShader; /* SVGA_3D_CMD_SET_SHADER */
  901. typedef
  902. #include "vmware_pack_begin.h"
  903. struct {
  904. uint32 cid;
  905. SVGA3dQueryType type;
  906. }
  907. #include "vmware_pack_end.h"
  908. SVGA3dCmdBeginQuery; /* SVGA_3D_CMD_BEGIN_QUERY */
  909. typedef
  910. #include "vmware_pack_begin.h"
  911. struct {
  912. uint32 cid;
  913. SVGA3dQueryType type;
  914. SVGAGuestPtr guestResult; /* Points to an SVGA3dQueryResult structure */
  915. }
  916. #include "vmware_pack_end.h"
  917. SVGA3dCmdEndQuery; /* SVGA_3D_CMD_END_QUERY */
  918. /*
  919. * SVGA3D_CMD_WAIT_FOR_QUERY --
  920. *
  921. * Will read the SVGA3dQueryResult structure pointed to by guestResult,
  922. * and if the state member is set to anything else than
  923. * SVGA3D_QUERYSTATE_PENDING, this command will always be a no-op.
  924. *
  925. * Otherwise, in addition to the query explicitly waited for,
  926. * All queries with the same type and issued with the same cid, for which
  927. * an SVGA_3D_CMD_END_QUERY command has previously been sent, will
  928. * be finished after execution of this command.
  929. *
  930. * A query will be identified by the gmrId and offset of the guestResult
  931. * member. If the device can't find an SVGA_3D_CMD_END_QUERY that has
  932. * been sent previously with an indentical gmrId and offset, it will
  933. * effectively end all queries with an identical type issued with the
  934. * same cid, and the SVGA3dQueryResult structure pointed to by
  935. * guestResult will not be written to. This property can be used to
  936. * implement a query barrier for a given cid and query type.
  937. */
  938. typedef
  939. #include "vmware_pack_begin.h"
  940. struct {
  941. uint32 cid; /* Same parameters passed to END_QUERY */
  942. SVGA3dQueryType type;
  943. SVGAGuestPtr guestResult;
  944. }
  945. #include "vmware_pack_end.h"
  946. SVGA3dCmdWaitForQuery; /* SVGA_3D_CMD_WAIT_FOR_QUERY */
  947. typedef
  948. #include "vmware_pack_begin.h"
  949. struct {
  950. uint32 totalSize; /* Set by guest before query is ended. */
  951. SVGA3dQueryState state; /* Set by host or guest. See SVGA3dQueryState. */
  952. union { /* Set by host on exit from PENDING state */
  953. uint32 result32;
  954. uint32 queryCookie; /* May be used to identify which QueryGetData this
  955. result corresponds to. */
  956. };
  957. }
  958. #include "vmware_pack_end.h"
  959. SVGA3dQueryResult;
  960. /*
  961. * SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN --
  962. *
  963. * This is a blit from an SVGA3D surface to a Screen Object.
  964. * This blit must be directed at a specific screen.
  965. *
  966. * The blit copies from a rectangular region of an SVGA3D surface
  967. * image to a rectangular region of a screen.
  968. *
  969. * This command takes an optional variable-length list of clipping
  970. * rectangles after the body of the command. If no rectangles are
  971. * specified, there is no clipping region. The entire destRect is
  972. * drawn to. If one or more rectangles are included, they describe
  973. * a clipping region. The clip rectangle coordinates are measured
  974. * relative to the top-left corner of destRect.
  975. *
  976. * The srcImage must be from mip=0 face=0.
  977. *
  978. * This supports scaling if the src and dest are of different sizes.
  979. *
  980. * Availability:
  981. * SVGA_FIFO_CAP_SCREEN_OBJECT
  982. */
  983. typedef
  984. #include "vmware_pack_begin.h"
  985. struct {
  986. SVGA3dSurfaceImageId srcImage;
  987. SVGASignedRect srcRect;
  988. uint32 destScreenId; /* Screen Object ID */
  989. SVGASignedRect destRect;
  990. /* Clipping: zero or more SVGASignedRects follow */
  991. }
  992. #include "vmware_pack_end.h"
  993. SVGA3dCmdBlitSurfaceToScreen; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */
  994. typedef
  995. #include "vmware_pack_begin.h"
  996. struct {
  997. uint32 sid;
  998. SVGA3dTextureFilter filter;
  999. }
  1000. #include "vmware_pack_end.h"
  1001. SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
  1002. typedef
  1003. #include "vmware_pack_begin.h"
  1004. struct {
  1005. uint32 sid;
  1006. }
  1007. #include "vmware_pack_end.h"
  1008. SVGA3dCmdActivateSurface; /* SVGA_3D_CMD_ACTIVATE_SURFACE */
  1009. typedef
  1010. #include "vmware_pack_begin.h"
  1011. struct {
  1012. uint32 sid;
  1013. }
  1014. #include "vmware_pack_end.h"
  1015. SVGA3dCmdDeactivateSurface; /* SVGA_3D_CMD_DEACTIVATE_SURFACE */
  1016. /*
  1017. * Screen DMA command
  1018. *
  1019. * Available with SVGA_FIFO_CAP_SCREEN_OBJECT_2. The SVGA_CAP_3D device
  1020. * cap bit is not required.
  1021. *
  1022. * - refBuffer and destBuffer are 32bit BGRX; refBuffer and destBuffer could
  1023. * be different, but it is required that guest makes sure refBuffer has
  1024. * exactly the same contents that were written to when last time screen DMA
  1025. * command is received by host.
  1026. *
  1027. * - changemap is generated by lib/blit, and it has the changes from last
  1028. * received screen DMA or more.
  1029. */
  1030. typedef
  1031. #include "vmware_pack_begin.h"
  1032. struct SVGA3dCmdScreenDMA {
  1033. uint32 screenId;
  1034. SVGAGuestImage refBuffer;
  1035. SVGAGuestImage destBuffer;
  1036. SVGAGuestImage changeMap;
  1037. }
  1038. #include "vmware_pack_end.h"
  1039. SVGA3dCmdScreenDMA; /* SVGA_3D_CMD_SCREEN_DMA */
  1040. /*
  1041. * Set Unity Surface Cookie
  1042. *
  1043. * Associates the supplied cookie with the surface id for use with
  1044. * Unity. This cookie is a hint from guest to host, there is no way
  1045. * for the guest to readback the cookie and the host is free to drop
  1046. * the cookie association at will. The default value for the cookie
  1047. * on all surfaces is 0.
  1048. */
  1049. typedef
  1050. #include "vmware_pack_begin.h"
  1051. struct SVGA3dCmdSetUnitySurfaceCookie {
  1052. uint32 sid;
  1053. uint64 cookie;
  1054. }
  1055. #include "vmware_pack_end.h"
  1056. SVGA3dCmdSetUnitySurfaceCookie; /* SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE */
  1057. /*
  1058. * Open a context-specific surface in a non-context-specific manner.
  1059. */
  1060. typedef
  1061. #include "vmware_pack_begin.h"
  1062. struct SVGA3dCmdOpenContextSurface {
  1063. uint32 sid;
  1064. }
  1065. #include "vmware_pack_end.h"
  1066. SVGA3dCmdOpenContextSurface; /* SVGA_3D_CMD_OPEN_CONTEXT_SURFACE */
  1067. /*
  1068. * Logic ops
  1069. */
  1070. #define SVGA3D_LOTRANSBLT_HONORALPHA (0x01)
  1071. #define SVGA3D_LOSTRETCHBLT_MIRRORX (0x01)
  1072. #define SVGA3D_LOSTRETCHBLT_MIRRORY (0x02)
  1073. #define SVGA3D_LOALPHABLEND_SRCHASALPHA (0x01)
  1074. typedef
  1075. #include "vmware_pack_begin.h"
  1076. struct SVGA3dCmdLogicOpsBitBlt {
  1077. /*
  1078. * All LogicOps surfaces are one-level
  1079. * surfaces so mipmap & face should always
  1080. * be zero.
  1081. */
  1082. SVGA3dSurfaceImageId src;
  1083. SVGA3dSurfaceImageId dst;
  1084. SVGA3dLogicOp logicOp;
  1085. /* Followed by variable number of SVGA3dCopyBox structures */
  1086. }
  1087. #include "vmware_pack_end.h"
  1088. SVGA3dCmdLogicOpsBitBlt; /* SVGA_3D_CMD_LOGICOPS_BITBLT */
  1089. typedef
  1090. #include "vmware_pack_begin.h"
  1091. struct SVGA3dCmdLogicOpsTransBlt {
  1092. /*
  1093. * All LogicOps surfaces are one-level
  1094. * surfaces so mipmap & face should always
  1095. * be zero.
  1096. */
  1097. SVGA3dSurfaceImageId src;
  1098. SVGA3dSurfaceImageId dst;
  1099. uint32 color;
  1100. uint32 flags;
  1101. SVGA3dBox srcBox;
  1102. SVGA3dBox dstBox;
  1103. }
  1104. #include "vmware_pack_end.h"
  1105. SVGA3dCmdLogicOpsTransBlt; /* SVGA_3D_CMD_LOGICOPS_TRANSBLT */
  1106. typedef
  1107. #include "vmware_pack_begin.h"
  1108. struct SVGA3dCmdLogicOpsStretchBlt {
  1109. /*
  1110. * All LogicOps surfaces are one-level
  1111. * surfaces so mipmap & face should always
  1112. * be zero.
  1113. */
  1114. SVGA3dSurfaceImageId src;
  1115. SVGA3dSurfaceImageId dst;
  1116. uint16 mode;
  1117. uint16 flags;
  1118. SVGA3dBox srcBox;
  1119. SVGA3dBox dstBox;
  1120. }
  1121. #include "vmware_pack_end.h"
  1122. SVGA3dCmdLogicOpsStretchBlt; /* SVGA_3D_CMD_LOGICOPS_STRETCHBLT */
  1123. typedef
  1124. #include "vmware_pack_begin.h"
  1125. struct SVGA3dCmdLogicOpsColorFill {
  1126. /*
  1127. * All LogicOps surfaces are one-level
  1128. * surfaces so mipmap & face should always
  1129. * be zero.
  1130. */
  1131. SVGA3dSurfaceImageId dst;
  1132. uint32 color;
  1133. SVGA3dLogicOp logicOp;
  1134. /* Followed by variable number of SVGA3dRect structures. */
  1135. }
  1136. #include "vmware_pack_end.h"
  1137. SVGA3dCmdLogicOpsColorFill; /* SVGA_3D_CMD_LOGICOPS_COLORFILL */
  1138. typedef
  1139. #include "vmware_pack_begin.h"
  1140. struct SVGA3dCmdLogicOpsAlphaBlend {
  1141. /*
  1142. * All LogicOps surfaces are one-level
  1143. * surfaces so mipmap & face should always
  1144. * be zero.
  1145. */
  1146. SVGA3dSurfaceImageId src;
  1147. SVGA3dSurfaceImageId dst;
  1148. uint32 alphaVal;
  1149. uint32 flags;
  1150. SVGA3dBox srcBox;
  1151. SVGA3dBox dstBox;
  1152. }
  1153. #include "vmware_pack_end.h"
  1154. SVGA3dCmdLogicOpsAlphaBlend; /* SVGA_3D_CMD_LOGICOPS_ALPHABLEND */
  1155. #define SVGA3D_CLEARTYPE_INVALID_GAMMA_INDEX 0xFFFFFFFF
  1156. #define SVGA3D_CLEARTYPE_GAMMA_WIDTH 512
  1157. #define SVGA3D_CLEARTYPE_GAMMA_HEIGHT 16
  1158. typedef
  1159. #include "vmware_pack_begin.h"
  1160. struct SVGA3dCmdLogicOpsClearTypeBlend {
  1161. /*
  1162. * All LogicOps surfaces are one-level
  1163. * surfaces so mipmap & face should always
  1164. * be zero.
  1165. */
  1166. SVGA3dSurfaceImageId tmp;
  1167. SVGA3dSurfaceImageId dst;
  1168. SVGA3dSurfaceImageId gammaSurf;
  1169. SVGA3dSurfaceImageId alphaSurf;
  1170. uint32 gamma;
  1171. uint32 color;
  1172. uint32 color2;
  1173. int32 alphaOffsetX;
  1174. int32 alphaOffsetY;
  1175. /* Followed by variable number of SVGA3dBox structures */
  1176. }
  1177. #include "vmware_pack_end.h"
  1178. SVGA3dCmdLogicOpsClearTypeBlend; /* SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND */
  1179. /*
  1180. * Guest-backed objects definitions.
  1181. */
  1182. typedef
  1183. #include "vmware_pack_begin.h"
  1184. struct {
  1185. SVGAMobFormat ptDepth;
  1186. uint32 sizeInBytes;
  1187. PPN64 base;
  1188. }
  1189. #include "vmware_pack_end.h"
  1190. SVGAOTableMobEntry;
  1191. #define SVGA3D_OTABLE_MOB_ENTRY_SIZE (sizeof(SVGAOTableMobEntry))
  1192. typedef
  1193. #include "vmware_pack_begin.h"
  1194. struct {
  1195. SVGA3dSurfaceFormat format;
  1196. SVGA3dSurfaceFlags surfaceFlags;
  1197. uint32 numMipLevels;
  1198. uint32 multisampleCount;
  1199. SVGA3dTextureFilter autogenFilter;
  1200. SVGA3dSize size;
  1201. SVGAMobId mobid;
  1202. uint32 arraySize;
  1203. uint32 mobPitch;
  1204. uint32 pad[5];
  1205. }
  1206. #include "vmware_pack_end.h"
  1207. SVGAOTableSurfaceEntry;
  1208. #define SVGA3D_OTABLE_SURFACE_ENTRY_SIZE (sizeof(SVGAOTableSurfaceEntry))
  1209. typedef
  1210. #include "vmware_pack_begin.h"
  1211. struct {
  1212. uint32 cid;
  1213. SVGAMobId mobid;
  1214. }
  1215. #include "vmware_pack_end.h"
  1216. SVGAOTableContextEntry;
  1217. #define SVGA3D_OTABLE_CONTEXT_ENTRY_SIZE (sizeof(SVGAOTableContextEntry))
  1218. typedef
  1219. #include "vmware_pack_begin.h"
  1220. struct {
  1221. SVGA3dShaderType type;
  1222. uint32 sizeInBytes;
  1223. uint32 offsetInBytes;
  1224. SVGAMobId mobid;
  1225. }
  1226. #include "vmware_pack_end.h"
  1227. SVGAOTableShaderEntry;
  1228. #define SVGA3D_OTABLE_SHADER_ENTRY_SIZE (sizeof(SVGAOTableShaderEntry))
  1229. #define SVGA_STFLAG_PRIMARY (1 << 0)
  1230. typedef uint32 SVGAScreenTargetFlags;
  1231. typedef
  1232. #include "vmware_pack_begin.h"
  1233. struct {
  1234. SVGA3dSurfaceImageId image;
  1235. uint32 width;
  1236. uint32 height;
  1237. int32 xRoot;
  1238. int32 yRoot;
  1239. SVGAScreenTargetFlags flags;
  1240. uint32 dpi;
  1241. uint32 pad[7];
  1242. }
  1243. #include "vmware_pack_end.h"
  1244. SVGAOTableScreenTargetEntry;
  1245. #define SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE \
  1246. (sizeof(SVGAOTableScreenTargetEntry))
  1247. typedef
  1248. #include "vmware_pack_begin.h"
  1249. struct {
  1250. float value[4];
  1251. }
  1252. #include "vmware_pack_end.h"
  1253. SVGA3dShaderConstFloat;
  1254. typedef
  1255. #include "vmware_pack_begin.h"
  1256. struct {
  1257. int32 value[4];
  1258. }
  1259. #include "vmware_pack_end.h"
  1260. SVGA3dShaderConstInt;
  1261. typedef
  1262. #include "vmware_pack_begin.h"
  1263. struct {
  1264. uint32 value;
  1265. }
  1266. #include "vmware_pack_end.h"
  1267. SVGA3dShaderConstBool;
  1268. typedef
  1269. #include "vmware_pack_begin.h"
  1270. struct {
  1271. uint16 streamOffset;
  1272. uint8 stream;
  1273. uint8 type;
  1274. uint8 methodUsage;
  1275. uint8 usageIndex;
  1276. }
  1277. #include "vmware_pack_end.h"
  1278. SVGAGBVertexElement;
  1279. typedef
  1280. #include "vmware_pack_begin.h"
  1281. struct {
  1282. uint32 sid;
  1283. uint16 stride;
  1284. uint32 offset;
  1285. }
  1286. #include "vmware_pack_end.h"
  1287. SVGAGBVertexStream;
  1288. typedef
  1289. #include "vmware_pack_begin.h"
  1290. struct {
  1291. SVGA3dRect viewport;
  1292. SVGA3dRect scissorRect;
  1293. SVGA3dZRange zRange;
  1294. SVGA3dSurfaceImageId renderTargets[SVGA3D_RT_MAX];
  1295. SVGAGBVertexElement decl1[4];
  1296. uint32 renderStates[SVGA3D_RS_MAX];
  1297. SVGAGBVertexElement decl2[18];
  1298. uint32 pad0[2];
  1299. struct {
  1300. SVGA3dFace face;
  1301. SVGA3dMaterial material;
  1302. } material;
  1303. float clipPlanes[SVGA3D_NUM_CLIPPLANES][4];
  1304. float matrices[SVGA3D_TRANSFORM_MAX][16];
  1305. SVGA3dBool lightEnabled[SVGA3D_NUM_LIGHTS];
  1306. SVGA3dLightData lightData[SVGA3D_NUM_LIGHTS];
  1307. /*
  1308. * Shaders currently bound
  1309. */
  1310. uint32 shaders[SVGA3D_NUM_SHADERTYPE_PREDX];
  1311. SVGAGBVertexElement decl3[10];
  1312. uint32 pad1[3];
  1313. uint32 occQueryActive;
  1314. uint32 occQueryValue;
  1315. /*
  1316. * Int/Bool Shader constants
  1317. */
  1318. SVGA3dShaderConstInt pShaderIValues[SVGA3D_CONSTINTREG_MAX];
  1319. SVGA3dShaderConstInt vShaderIValues[SVGA3D_CONSTINTREG_MAX];
  1320. uint16 pShaderBValues;
  1321. uint16 vShaderBValues;
  1322. SVGAGBVertexStream streams[SVGA3D_MAX_VERTEX_ARRAYS];
  1323. SVGA3dVertexDivisor divisors[SVGA3D_MAX_VERTEX_ARRAYS];
  1324. uint32 numVertexDecls;
  1325. uint32 numVertexStreams;
  1326. uint32 numVertexDivisors;
  1327. uint32 pad2[30];
  1328. /*
  1329. * Texture Stages
  1330. *
  1331. * SVGA3D_TS_INVALID through SVGA3D_TS_CONSTANT are in the
  1332. * textureStages array.
  1333. * SVGA3D_TS_COLOR_KEY is in tsColorKey.
  1334. */
  1335. uint32 tsColorKey[SVGA3D_NUM_TEXTURE_UNITS];
  1336. uint32 textureStages[SVGA3D_NUM_TEXTURE_UNITS][SVGA3D_TS_CONSTANT + 1];
  1337. uint32 tsColorKeyEnable[SVGA3D_NUM_TEXTURE_UNITS];
  1338. /*
  1339. * Float Shader constants.
  1340. */
  1341. SVGA3dShaderConstFloat pShaderFValues[SVGA3D_CONSTREG_MAX];
  1342. SVGA3dShaderConstFloat vShaderFValues[SVGA3D_CONSTREG_MAX];
  1343. }
  1344. #include "vmware_pack_end.h"
  1345. SVGAGBContextData;
  1346. #define SVGA3D_CONTEXT_DATA_SIZE (sizeof(SVGAGBContextData))
  1347. /*
  1348. * SVGA3dCmdSetOTableBase --
  1349. *
  1350. * This command allows the guest to specify the base PPN of the
  1351. * specified object table.
  1352. */
  1353. typedef
  1354. #include "vmware_pack_begin.h"
  1355. struct {
  1356. SVGAOTableType type;
  1357. PPN baseAddress;
  1358. uint32 sizeInBytes;
  1359. uint32 validSizeInBytes;
  1360. SVGAMobFormat ptDepth;
  1361. }
  1362. #include "vmware_pack_end.h"
  1363. SVGA3dCmdSetOTableBase; /* SVGA_3D_CMD_SET_OTABLE_BASE */
  1364. typedef
  1365. #include "vmware_pack_begin.h"
  1366. struct {
  1367. SVGAOTableType type;
  1368. PPN64 baseAddress;
  1369. uint32 sizeInBytes;
  1370. uint32 validSizeInBytes;
  1371. SVGAMobFormat ptDepth;
  1372. }
  1373. #include "vmware_pack_end.h"
  1374. SVGA3dCmdSetOTableBase64; /* SVGA_3D_CMD_SET_OTABLE_BASE64 */
  1375. typedef
  1376. #include "vmware_pack_begin.h"
  1377. struct {
  1378. SVGAOTableType type;
  1379. }
  1380. #include "vmware_pack_end.h"
  1381. SVGA3dCmdReadbackOTable; /* SVGA_3D_CMD_READBACK_OTABLE */
  1382. /*
  1383. * Define a memory object (Mob) in the OTable.
  1384. */
  1385. typedef
  1386. #include "vmware_pack_begin.h"
  1387. struct SVGA3dCmdDefineGBMob {
  1388. SVGAMobId mobid;
  1389. SVGAMobFormat ptDepth;
  1390. PPN base;
  1391. uint32 sizeInBytes;
  1392. }
  1393. #include "vmware_pack_end.h"
  1394. SVGA3dCmdDefineGBMob; /* SVGA_3D_CMD_DEFINE_GB_MOB */
  1395. /*
  1396. * Destroys an object in the OTable.
  1397. */
  1398. typedef
  1399. #include "vmware_pack_begin.h"
  1400. struct SVGA3dCmdDestroyGBMob {
  1401. SVGAMobId mobid;
  1402. }
  1403. #include "vmware_pack_end.h"
  1404. SVGA3dCmdDestroyGBMob; /* SVGA_3D_CMD_DESTROY_GB_MOB */
  1405. /*
  1406. * Define a memory object (Mob) in the OTable with a PPN64 base.
  1407. */
  1408. typedef
  1409. #include "vmware_pack_begin.h"
  1410. struct SVGA3dCmdDefineGBMob64 {
  1411. SVGAMobId mobid;
  1412. SVGAMobFormat ptDepth;
  1413. PPN64 base;
  1414. uint32 sizeInBytes;
  1415. }
  1416. #include "vmware_pack_end.h"
  1417. SVGA3dCmdDefineGBMob64; /* SVGA_3D_CMD_DEFINE_GB_MOB64 */
  1418. /*
  1419. * Redefine an object in the OTable with PPN64 base.
  1420. */
  1421. typedef
  1422. #include "vmware_pack_begin.h"
  1423. struct SVGA3dCmdRedefineGBMob64 {
  1424. SVGAMobId mobid;
  1425. SVGAMobFormat ptDepth;
  1426. PPN64 base;
  1427. uint32 sizeInBytes;
  1428. }
  1429. #include "vmware_pack_end.h"
  1430. SVGA3dCmdRedefineGBMob64; /* SVGA_3D_CMD_REDEFINE_GB_MOB64 */
  1431. /*
  1432. * Notification that the page tables have been modified.
  1433. */
  1434. typedef
  1435. #include "vmware_pack_begin.h"
  1436. struct SVGA3dCmdUpdateGBMobMapping {
  1437. SVGAMobId mobid;
  1438. }
  1439. #include "vmware_pack_end.h"
  1440. SVGA3dCmdUpdateGBMobMapping; /* SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING */
  1441. /*
  1442. * Define a guest-backed surface.
  1443. */
  1444. typedef
  1445. #include "vmware_pack_begin.h"
  1446. struct SVGA3dCmdDefineGBSurface {
  1447. uint32 sid;
  1448. SVGA3dSurfaceFlags surfaceFlags;
  1449. SVGA3dSurfaceFormat format;
  1450. uint32 numMipLevels;
  1451. uint32 multisampleCount;
  1452. SVGA3dTextureFilter autogenFilter;
  1453. SVGA3dSize size;
  1454. }
  1455. #include "vmware_pack_end.h"
  1456. SVGA3dCmdDefineGBSurface; /* SVGA_3D_CMD_DEFINE_GB_SURFACE */
  1457. /*
  1458. * Destroy a guest-backed surface.
  1459. */
  1460. typedef
  1461. #include "vmware_pack_begin.h"
  1462. struct SVGA3dCmdDestroyGBSurface {
  1463. uint32 sid;
  1464. }
  1465. #include "vmware_pack_end.h"
  1466. SVGA3dCmdDestroyGBSurface; /* SVGA_3D_CMD_DESTROY_GB_SURFACE */
  1467. /*
  1468. * Bind a guest-backed surface to a mob.
  1469. */
  1470. typedef
  1471. #include "vmware_pack_begin.h"
  1472. struct SVGA3dCmdBindGBSurface {
  1473. uint32 sid;
  1474. SVGAMobId mobid;
  1475. }
  1476. #include "vmware_pack_end.h"
  1477. SVGA3dCmdBindGBSurface; /* SVGA_3D_CMD_BIND_GB_SURFACE */
  1478. typedef
  1479. #include "vmware_pack_begin.h"
  1480. struct SVGA3dCmdBindGBSurfaceWithPitch {
  1481. uint32 sid;
  1482. SVGAMobId mobid;
  1483. uint32 baseLevelPitch;
  1484. }
  1485. #include "vmware_pack_end.h"
  1486. SVGA3dCmdBindGBSurfaceWithPitch; /* SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH */
  1487. /*
  1488. * Conditionally bind a mob to a guest-backed surface if testMobid
  1489. * matches the currently bound mob. Optionally issue a
  1490. * readback/update on the surface while it is still bound to the old
  1491. * mobid if the mobid is changed by this command.
  1492. */
  1493. #define SVGA3D_COND_BIND_GB_SURFACE_FLAG_READBACK (1 << 0)
  1494. #define SVGA3D_COND_BIND_GB_SURFACE_FLAG_UPDATE (1 << 1)
  1495. typedef
  1496. #include "vmware_pack_begin.h"
  1497. struct{
  1498. uint32 sid;
  1499. SVGAMobId testMobid;
  1500. SVGAMobId mobid;
  1501. uint32 flags;
  1502. }
  1503. #include "vmware_pack_end.h"
  1504. SVGA3dCmdCondBindGBSurface; /* SVGA_3D_CMD_COND_BIND_GB_SURFACE */
  1505. /*
  1506. * Update an image in a guest-backed surface.
  1507. * (Inform the device that the guest-contents have been updated.)
  1508. */
  1509. typedef
  1510. #include "vmware_pack_begin.h"
  1511. struct SVGA3dCmdUpdateGBImage {
  1512. SVGA3dSurfaceImageId image;
  1513. SVGA3dBox box;
  1514. }
  1515. #include "vmware_pack_end.h"
  1516. SVGA3dCmdUpdateGBImage; /* SVGA_3D_CMD_UPDATE_GB_IMAGE */
  1517. /*
  1518. * Update an entire guest-backed surface.
  1519. * (Inform the device that the guest-contents have been updated.)
  1520. */
  1521. typedef
  1522. #include "vmware_pack_begin.h"
  1523. struct SVGA3dCmdUpdateGBSurface {
  1524. uint32 sid;
  1525. }
  1526. #include "vmware_pack_end.h"
  1527. SVGA3dCmdUpdateGBSurface; /* SVGA_3D_CMD_UPDATE_GB_SURFACE */
  1528. /*
  1529. * Readback an image in a guest-backed surface.
  1530. * (Request the device to flush the dirty contents into the guest.)
  1531. */
  1532. typedef
  1533. #include "vmware_pack_begin.h"
  1534. struct SVGA3dCmdReadbackGBImage {
  1535. SVGA3dSurfaceImageId image;
  1536. }
  1537. #include "vmware_pack_end.h"
  1538. SVGA3dCmdReadbackGBImage; /* SVGA_3D_CMD_READBACK_GB_IMAGE */
  1539. /*
  1540. * Readback an entire guest-backed surface.
  1541. * (Request the device to flush the dirty contents into the guest.)
  1542. */
  1543. typedef
  1544. #include "vmware_pack_begin.h"
  1545. struct SVGA3dCmdReadbackGBSurface {
  1546. uint32 sid;
  1547. }
  1548. #include "vmware_pack_end.h"
  1549. SVGA3dCmdReadbackGBSurface; /* SVGA_3D_CMD_READBACK_GB_SURFACE */
  1550. /*
  1551. * Readback a sub rect of an image in a guest-backed surface. After
  1552. * issuing this command the driver is required to issue an update call
  1553. * of the same region before issuing any other commands that reference
  1554. * this surface or rendering is not guaranteed.
  1555. */
  1556. typedef
  1557. #include "vmware_pack_begin.h"
  1558. struct SVGA3dCmdReadbackGBImagePartial {
  1559. SVGA3dSurfaceImageId image;
  1560. SVGA3dBox box;
  1561. uint32 invertBox;
  1562. }
  1563. #include "vmware_pack_end.h"
  1564. SVGA3dCmdReadbackGBImagePartial; /* SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL */
  1565. /*
  1566. * Invalidate an image in a guest-backed surface.
  1567. * (Notify the device that the contents can be lost.)
  1568. */
  1569. typedef
  1570. #include "vmware_pack_begin.h"
  1571. struct SVGA3dCmdInvalidateGBImage {
  1572. SVGA3dSurfaceImageId image;
  1573. }
  1574. #include "vmware_pack_end.h"
  1575. SVGA3dCmdInvalidateGBImage; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE */
  1576. /*
  1577. * Invalidate an entire guest-backed surface.
  1578. * (Notify the device that the contents if all images can be lost.)
  1579. */
  1580. typedef
  1581. #include "vmware_pack_begin.h"
  1582. struct SVGA3dCmdInvalidateGBSurface {
  1583. uint32 sid;
  1584. }
  1585. #include "vmware_pack_end.h"
  1586. SVGA3dCmdInvalidateGBSurface; /* SVGA_3D_CMD_INVALIDATE_GB_SURFACE */
  1587. /*
  1588. * Invalidate a sub rect of an image in a guest-backed surface. After
  1589. * issuing this command the driver is required to issue an update call
  1590. * of the same region before issuing any other commands that reference
  1591. * this surface or rendering is not guaranteed.
  1592. */
  1593. typedef
  1594. #include "vmware_pack_begin.h"
  1595. struct SVGA3dCmdInvalidateGBImagePartial {
  1596. SVGA3dSurfaceImageId image;
  1597. SVGA3dBox box;
  1598. uint32 invertBox;
  1599. }
  1600. #include "vmware_pack_end.h"
  1601. SVGA3dCmdInvalidateGBImagePartial; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL */
  1602. /*
  1603. * Define a guest-backed context.
  1604. */
  1605. typedef
  1606. #include "vmware_pack_begin.h"
  1607. struct SVGA3dCmdDefineGBContext {
  1608. uint32 cid;
  1609. }
  1610. #include "vmware_pack_end.h"
  1611. SVGA3dCmdDefineGBContext; /* SVGA_3D_CMD_DEFINE_GB_CONTEXT */
  1612. /*
  1613. * Destroy a guest-backed context.
  1614. */
  1615. typedef
  1616. #include "vmware_pack_begin.h"
  1617. struct SVGA3dCmdDestroyGBContext {
  1618. uint32 cid;
  1619. }
  1620. #include "vmware_pack_end.h"
  1621. SVGA3dCmdDestroyGBContext; /* SVGA_3D_CMD_DESTROY_GB_CONTEXT */
  1622. /*
  1623. * Bind a guest-backed context.
  1624. *
  1625. * validContents should be set to 0 for new contexts,
  1626. * and 1 if this is an old context which is getting paged
  1627. * back on to the device.
  1628. *
  1629. * For new contexts, it is recommended that the driver
  1630. * issue commands to initialize all interesting state
  1631. * prior to rendering.
  1632. */
  1633. typedef
  1634. #include "vmware_pack_begin.h"
  1635. struct SVGA3dCmdBindGBContext {
  1636. uint32 cid;
  1637. SVGAMobId mobid;
  1638. uint32 validContents;
  1639. }
  1640. #include "vmware_pack_end.h"
  1641. SVGA3dCmdBindGBContext; /* SVGA_3D_CMD_BIND_GB_CONTEXT */
  1642. /*
  1643. * Readback a guest-backed context.
  1644. * (Request that the device flush the contents back into guest memory.)
  1645. */
  1646. typedef
  1647. #include "vmware_pack_begin.h"
  1648. struct SVGA3dCmdReadbackGBContext {
  1649. uint32 cid;
  1650. }
  1651. #include "vmware_pack_end.h"
  1652. SVGA3dCmdReadbackGBContext; /* SVGA_3D_CMD_READBACK_GB_CONTEXT */
  1653. /*
  1654. * Invalidate a guest-backed context.
  1655. */
  1656. typedef
  1657. #include "vmware_pack_begin.h"
  1658. struct SVGA3dCmdInvalidateGBContext {
  1659. uint32 cid;
  1660. }
  1661. #include "vmware_pack_end.h"
  1662. SVGA3dCmdInvalidateGBContext; /* SVGA_3D_CMD_INVALIDATE_GB_CONTEXT */
  1663. /*
  1664. * Define a guest-backed shader.
  1665. */
  1666. typedef
  1667. #include "vmware_pack_begin.h"
  1668. struct SVGA3dCmdDefineGBShader {
  1669. uint32 shid;
  1670. SVGA3dShaderType type;
  1671. uint32 sizeInBytes;
  1672. }
  1673. #include "vmware_pack_end.h"
  1674. SVGA3dCmdDefineGBShader; /* SVGA_3D_CMD_DEFINE_GB_SHADER */
  1675. /*
  1676. * Bind a guest-backed shader.
  1677. */
  1678. typedef
  1679. #include "vmware_pack_begin.h"
  1680. struct SVGA3dCmdBindGBShader {
  1681. uint32 shid;
  1682. SVGAMobId mobid;
  1683. uint32 offsetInBytes;
  1684. }
  1685. #include "vmware_pack_end.h"
  1686. SVGA3dCmdBindGBShader; /* SVGA_3D_CMD_BIND_GB_SHADER */
  1687. /*
  1688. * Destroy a guest-backed shader.
  1689. */
  1690. typedef
  1691. #include "vmware_pack_begin.h"
  1692. struct SVGA3dCmdDestroyGBShader {
  1693. uint32 shid;
  1694. }
  1695. #include "vmware_pack_end.h"
  1696. SVGA3dCmdDestroyGBShader; /* SVGA_3D_CMD_DESTROY_GB_SHADER */
  1697. typedef
  1698. #include "vmware_pack_begin.h"
  1699. struct {
  1700. uint32 cid;
  1701. uint32 regStart;
  1702. SVGA3dShaderType shaderType;
  1703. SVGA3dShaderConstType constType;
  1704. /*
  1705. * Followed by a variable number of shader constants.
  1706. *
  1707. * Note that FLOAT and INT constants are 4-dwords in length, while
  1708. * BOOL constants are 1-dword in length.
  1709. */
  1710. }
  1711. #include "vmware_pack_end.h"
  1712. SVGA3dCmdSetGBShaderConstInline; /* SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE */
  1713. typedef
  1714. #include "vmware_pack_begin.h"
  1715. struct {
  1716. uint32 cid;
  1717. SVGA3dQueryType type;
  1718. }
  1719. #include "vmware_pack_end.h"
  1720. SVGA3dCmdBeginGBQuery; /* SVGA_3D_CMD_BEGIN_GB_QUERY */
  1721. typedef
  1722. #include "vmware_pack_begin.h"
  1723. struct {
  1724. uint32 cid;
  1725. SVGA3dQueryType type;
  1726. SVGAMobId mobid;
  1727. uint32 offset;
  1728. }
  1729. #include "vmware_pack_end.h"
  1730. SVGA3dCmdEndGBQuery; /* SVGA_3D_CMD_END_GB_QUERY */
  1731. /*
  1732. * SVGA_3D_CMD_WAIT_FOR_GB_QUERY --
  1733. *
  1734. * The semantics of this command are identical to the
  1735. * SVGA_3D_CMD_WAIT_FOR_QUERY except that the results are written
  1736. * to a Mob instead of a GMR.
  1737. */
  1738. typedef
  1739. #include "vmware_pack_begin.h"
  1740. struct {
  1741. uint32 cid;
  1742. SVGA3dQueryType type;
  1743. SVGAMobId mobid;
  1744. uint32 offset;
  1745. }
  1746. #include "vmware_pack_end.h"
  1747. SVGA3dCmdWaitForGBQuery; /* SVGA_3D_CMD_WAIT_FOR_GB_QUERY */
  1748. typedef
  1749. #include "vmware_pack_begin.h"
  1750. struct {
  1751. SVGAMobId mobid;
  1752. uint32 mustBeZero;
  1753. uint32 initialized;
  1754. }
  1755. #include "vmware_pack_end.h"
  1756. SVGA3dCmdEnableGart; /* SVGA_3D_CMD_ENABLE_GART */
  1757. typedef
  1758. #include "vmware_pack_begin.h"
  1759. struct {
  1760. SVGAMobId mobid;
  1761. uint32 gartOffset;
  1762. }
  1763. #include "vmware_pack_end.h"
  1764. SVGA3dCmdMapMobIntoGart; /* SVGA_3D_CMD_MAP_MOB_INTO_GART */
  1765. typedef
  1766. #include "vmware_pack_begin.h"
  1767. struct {
  1768. uint32 gartOffset;
  1769. uint32 numPages;
  1770. }
  1771. #include "vmware_pack_end.h"
  1772. SVGA3dCmdUnmapGartRange; /* SVGA_3D_CMD_UNMAP_GART_RANGE */
  1773. /*
  1774. * Screen Targets
  1775. */
  1776. typedef
  1777. #include "vmware_pack_begin.h"
  1778. struct {
  1779. uint32 stid;
  1780. uint32 width;
  1781. uint32 height;
  1782. int32 xRoot;
  1783. int32 yRoot;
  1784. SVGAScreenTargetFlags flags;
  1785. /*
  1786. * The physical DPI that the guest expects this screen displayed at.
  1787. *
  1788. * Guests which are not DPI-aware should set this to zero.
  1789. */
  1790. uint32 dpi;
  1791. }
  1792. #include "vmware_pack_end.h"
  1793. SVGA3dCmdDefineGBScreenTarget; /* SVGA_3D_CMD_DEFINE_GB_SCREENTARGET */
  1794. typedef
  1795. #include "vmware_pack_begin.h"
  1796. struct {
  1797. uint32 stid;
  1798. }
  1799. #include "vmware_pack_end.h"
  1800. SVGA3dCmdDestroyGBScreenTarget; /* SVGA_3D_CMD_DESTROY_GB_SCREENTARGET */
  1801. typedef
  1802. #include "vmware_pack_begin.h"
  1803. struct {
  1804. uint32 stid;
  1805. SVGA3dSurfaceImageId image;
  1806. }
  1807. #include "vmware_pack_end.h"
  1808. SVGA3dCmdBindGBScreenTarget; /* SVGA_3D_CMD_BIND_GB_SCREENTARGET */
  1809. typedef
  1810. #include "vmware_pack_begin.h"
  1811. struct {
  1812. uint32 stid;
  1813. SVGA3dRect rect;
  1814. }
  1815. #include "vmware_pack_end.h"
  1816. SVGA3dCmdUpdateGBScreenTarget; /* SVGA_3D_CMD_UPDATE_GB_SCREENTARGET */
  1817. typedef
  1818. #include "vmware_pack_begin.h"
  1819. struct SVGA3dCmdGBScreenDMA {
  1820. uint32 screenId;
  1821. uint32 dead;
  1822. SVGAMobId destMobID;
  1823. uint32 destPitch;
  1824. SVGAMobId changeMapMobID;
  1825. }
  1826. #include "vmware_pack_end.h"
  1827. SVGA3dCmdGBScreenDMA; /* SVGA_3D_CMD_GB_SCREEN_DMA */
  1828. typedef
  1829. #include "vmware_pack_begin.h"
  1830. struct {
  1831. uint32 value;
  1832. uint32 mobId;
  1833. uint32 mobOffset;
  1834. }
  1835. #include "vmware_pack_end.h"
  1836. SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE*/
  1837. #endif /* _SVGA3D_CMD_H_ */