Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vmwgfx: Sync virtual device headers for new feature

Get the latest device headers for SM5 and other features development.

v2: sync to newer bits (merge later commits)
v3: sync to even newer bits

Co-developed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Deepak Rawat <drawat.floss@gmail.com>
Signed-off-by: Neha Bhende <bhenden@vmware.com>
Signed-off-by: Charmaine Lee <charmainel@vmware.com>
Signed-off-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Thomas Hellström (VMware) <thomas_os@shipmail.org>

authored by

Deepak Rawat and committed by
Roland Scheidegger
0651dfab 878c6ecd

+1615 -554
+120 -29
drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 2 /********************************************************** 3 - * Copyright 1998-2015 VMware, Inc. 3 + * Copyright 1998-2020 VMware, Inc. 4 4 * 5 5 * Permission is hereby granted, free of charge, to any person 6 6 * obtaining a copy of this software and associated documentation ··· 261 261 SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET = 1220, 262 262 SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET = 1221, 263 263 SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET = 1222, 264 - 265 - /* 266 - * Reserve some IDs to be used for the SM5 shader types. 267 - */ 268 - SVGA_3D_CMD_DX_RESERVED1 = 1223, 269 - SVGA_3D_CMD_DX_RESERVED2 = 1224, 270 - SVGA_3D_CMD_DX_RESERVED3 = 1225, 264 + SVGA_3D_CMD_DX_SET_HS_CONSTANT_BUFFER_OFFSET = 1223, 265 + SVGA_3D_CMD_DX_SET_DS_CONSTANT_BUFFER_OFFSET = 1224, 266 + SVGA_3D_CMD_DX_SET_CS_CONSTANT_BUFFER_OFFSET = 1225, 271 267 272 268 SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER = 1226, 273 269 SVGA_3D_CMD_DX_MAX = 1227, 274 270 275 271 SVGA_3D_CMD_SCREEN_COPY = 1227, 276 272 277 - /* 278 - * Reserve some IDs to be used for video. 279 - */ 280 - SVGA_3D_CMD_VIDEO_RESERVED1 = 1228, 281 - SVGA_3D_CMD_VIDEO_RESERVED2 = 1229, 282 - SVGA_3D_CMD_VIDEO_RESERVED3 = 1230, 283 - SVGA_3D_CMD_VIDEO_RESERVED4 = 1231, 284 - SVGA_3D_CMD_VIDEO_RESERVED5 = 1232, 285 - SVGA_3D_CMD_VIDEO_RESERVED6 = 1233, 286 - SVGA_3D_CMD_VIDEO_RESERVED7 = 1234, 287 - SVGA_3D_CMD_VIDEO_RESERVED8 = 1235, 273 + SVGA_3D_CMD_RESERVED1 = 1228, 274 + SVGA_3D_CMD_RESERVED2 = 1229, 275 + SVGA_3D_CMD_RESERVED3 = 1230, 276 + SVGA_3D_CMD_RESERVED4 = 1231, 277 + SVGA_3D_CMD_RESERVED5 = 1232, 278 + SVGA_3D_CMD_RESERVED6 = 1233, 279 + SVGA_3D_CMD_RESERVED7 = 1234, 280 + SVGA_3D_CMD_RESERVED8 = 1235, 288 281 289 282 SVGA_3D_CMD_GROW_OTABLE = 1236, 290 283 SVGA_3D_CMD_DX_GROW_COTABLE = 1237, ··· 291 298 SVGA_3D_CMD_DX_PRED_CONVERT = 1243, 292 299 SVGA_3D_CMD_WHOLE_SURFACE_COPY = 1244, 293 300 294 - SVGA_3D_CMD_MAX = 1245, 301 + SVGA_3D_CMD_DX_DEFINE_UA_VIEW = 1245, 302 + SVGA_3D_CMD_DX_DESTROY_UA_VIEW = 1246, 303 + SVGA_3D_CMD_DX_CLEAR_UA_VIEW_UINT = 1247, 304 + SVGA_3D_CMD_DX_CLEAR_UA_VIEW_FLOAT = 1248, 305 + SVGA_3D_CMD_DX_COPY_STRUCTURE_COUNT = 1249, 306 + SVGA_3D_CMD_DX_SET_UA_VIEWS = 1250, 307 + 308 + SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED_INDIRECT = 1251, 309 + SVGA_3D_CMD_DX_DRAW_INSTANCED_INDIRECT = 1252, 310 + SVGA_3D_CMD_DX_DISPATCH = 1253, 311 + SVGA_3D_CMD_DX_DISPATCH_INDIRECT = 1254, 312 + 313 + SVGA_3D_CMD_WRITE_ZERO_SURFACE = 1255, 314 + SVGA_3D_CMD_HINT_ZERO_SURFACE = 1256, 315 + SVGA_3D_CMD_DX_TRANSFER_TO_BUFFER = 1257, 316 + SVGA_3D_CMD_DX_SET_STRUCTURE_COUNT = 1258, 317 + 318 + SVGA_3D_CMD_LOGICOPS_BITBLT = 1259, 319 + SVGA_3D_CMD_LOGICOPS_TRANSBLT = 1260, 320 + SVGA_3D_CMD_LOGICOPS_STRETCHBLT = 1261, 321 + SVGA_3D_CMD_LOGICOPS_COLORFILL = 1262, 322 + SVGA_3D_CMD_LOGICOPS_ALPHABLEND = 1263, 323 + SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND = 1264, 324 + 325 + SVGA_3D_CMD_RESERVED2_1 = 1265, 326 + 327 + SVGA_3D_CMD_RESERVED2_2 = 1266, 328 + SVGA_3D_CMD_DEFINE_GB_SURFACE_V4 = 1267, 329 + SVGA_3D_CMD_DX_SET_CS_UA_VIEWS = 1268, 330 + SVGA_3D_CMD_DX_SET_MIN_LOD = 1269, 331 + SVGA_3D_CMD_RESERVED2_3 = 1270, 332 + SVGA_3D_CMD_RESERVED2_4 = 1271, 333 + SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW_V2 = 1272, 334 + SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT_WITH_MOB = 1273, 335 + SVGA_3D_CMD_DX_SET_SHADER_IFACE = 1274, 336 + SVGA_3D_CMD_DX_BIND_STREAMOUTPUT = 1275, 337 + SVGA_3D_CMD_SURFACE_STRETCHBLT_NON_MS_TO_MS = 1276, 338 + SVGA_3D_CMD_DX_BIND_SHADER_IFACE = 1277, 339 + 340 + SVGA_3D_CMD_MAX = 1278, 295 341 SVGA_3D_CMD_FUTURE_MAX = 3000 296 342 } SVGAFifo3dCmdId; 297 343 ··· 366 334 uint32 sid; 367 335 SVGA3dSurface1Flags surfaceFlags; 368 336 SVGA3dSurfaceFormat format; 337 + 369 338 /* 370 339 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace 371 340 * structures must have the same value of numMipLevels field. ··· 374 341 * numMipLevels set to 0. 375 342 */ 376 343 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES]; 344 + 377 345 /* 378 346 * Followed by an SVGA3dSize structure for each mip level in each face. 379 347 * ··· 394 360 uint32 sid; 395 361 SVGA3dSurface1Flags surfaceFlags; 396 362 SVGA3dSurfaceFormat format; 363 + 397 364 /* 398 365 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace 399 366 * structures must have the same value of numMipLevels field. ··· 404 369 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES]; 405 370 uint32 multisampleCount; 406 371 SVGA3dTextureFilter autogenFilter; 372 + 407 373 /* 408 374 * Followed by an SVGA3dSize structure for each mip level in each face. 409 375 * ··· 553 517 struct { 554 518 SVGA3dSurfaceImageId src; 555 519 SVGA3dSurfaceImageId dest; 520 + SVGA3dBox boxSrc; 521 + SVGA3dBox boxDest; 522 + } 523 + #include "vmware_pack_end.h" 524 + SVGA3dCmdSurfaceStretchBltNonMSToMS; 525 + /* SVGA_3D_CMD_SURFACE_STRETCHBLT_NON_MS_TO_MS */ 526 + 527 + typedef 528 + #include "vmware_pack_begin.h" 529 + struct { 530 + SVGA3dSurfaceImageId src; 531 + SVGA3dSurfaceImageId dest; 556 532 SVGA3dBox boxSrc; 557 533 SVGA3dBox boxDest; 558 534 SVGA3dStretchBltMode mode; ··· 603 555 SVGAGuestImage guest; 604 556 SVGA3dSurfaceImageId host; 605 557 SVGA3dTransferType transfer; 558 + 606 559 /* 607 560 * Followed by variable number of SVGA3dCopyBox structures. For consistency 608 561 * in all clipping logic and coordinate translation, we define the ··· 838 789 839 790 uint32 indexBufferSid; /* Valid index buffer sid. */ 840 791 uint32 indexBufferOffset; /* Byte offset into the vertex buffer, almost */ 841 - /* always 0 for DX9 guests, non-zero for OpenGL */ 792 + /* always 0 for pre SM guests, non-zero for OpenGL */ 842 793 /* guests. We can't represent non-multiple of */ 843 794 /* stride offsets in D3D9Renderer... */ 844 795 uint8 indexBufferStride; /* Allowable values = 1, 2, or 4 */ ··· 1277 1228 SVGA3dSurfaceImageId src; 1278 1229 SVGA3dSurfaceImageId dst; 1279 1230 SVGA3dLogicOp logicOp; 1231 + SVGA3dLogicOpRop3 logicOpRop3; 1280 1232 /* Followed by variable number of SVGA3dCopyBox structures */ 1281 1233 } 1282 1234 #include "vmware_pack_end.h" ··· 1297 1247 uint32 color; 1298 1248 uint32 flags; 1299 1249 SVGA3dBox srcBox; 1300 - SVGA3dBox dstBox; 1250 + SVGA3dSignedBox dstBox; 1251 + SVGA3dBox clipBox; 1301 1252 } 1302 1253 #include "vmware_pack_end.h" 1303 1254 SVGA3dCmdLogicOpsTransBlt; /* SVGA_3D_CMD_LOGICOPS_TRANSBLT */ ··· 1317 1266 uint16 mode; 1318 1267 uint16 flags; 1319 1268 SVGA3dBox srcBox; 1320 - SVGA3dBox dstBox; 1269 + SVGA3dSignedBox dstBox; 1270 + SVGA3dBox clipBox; 1321 1271 } 1322 1272 #include "vmware_pack_end.h" 1323 1273 SVGA3dCmdLogicOpsStretchBlt; /* SVGA_3D_CMD_LOGICOPS_STRETCHBLT */ ··· 1335 1283 SVGA3dSurfaceImageId dst; 1336 1284 uint32 color; 1337 1285 SVGA3dLogicOp logicOp; 1286 + SVGA3dLogicOpRop3 logicOpRop3; 1338 1287 /* Followed by variable number of SVGA3dRect structures. */ 1339 1288 } 1340 1289 #include "vmware_pack_end.h" ··· 1355 1302 uint32 alphaVal; 1356 1303 uint32 flags; 1357 1304 SVGA3dBox srcBox; 1358 - SVGA3dBox dstBox; 1305 + SVGA3dSignedBox dstBox; 1306 + SVGA3dBox clipBox; 1359 1307 } 1360 1308 #include "vmware_pack_end.h" 1361 1309 SVGA3dCmdLogicOpsAlphaBlend; /* SVGA_3D_CMD_LOGICOPS_ALPHABLEND */ ··· 1419 1365 SVGA3dSurface2Flags surface2Flags; 1420 1366 uint8 multisamplePattern; 1421 1367 uint8 qualityLevel; 1422 - uint8 pad0[2]; 1423 - uint32 pad1[3]; 1368 + uint16 bufferByteStride; 1369 + float minLOD; 1370 + uint32 pad0[2]; 1424 1371 } 1425 1372 #include "vmware_pack_end.h" 1426 1373 SVGAOTableSurfaceEntry; ··· 1598 1543 #include "vmware_pack_begin.h" 1599 1544 struct { 1600 1545 SVGAOTableType type; 1601 - PPN baseAddress; 1546 + PPN32 baseAddress; 1602 1547 uint32 sizeInBytes; 1603 1548 uint32 validSizeInBytes; 1604 1549 SVGAMobFormat ptDepth; ··· 1654 1599 struct SVGA3dCmdDefineGBMob { 1655 1600 SVGAMobId mobid; 1656 1601 SVGAMobFormat ptDepth; 1657 - PPN base; 1602 + PPN32 base; 1658 1603 uint32 sizeInBytes; 1659 1604 } 1660 1605 #include "vmware_pack_end.h" ··· 1672 1617 } 1673 1618 #include "vmware_pack_end.h" 1674 1619 SVGA3dCmdDestroyGBMob; /* SVGA_3D_CMD_DESTROY_GB_MOB */ 1675 - 1676 1620 1677 1621 /* 1678 1622 * Define a memory object (Mob) in the OTable with a PPN64 base. ··· 1771 1717 } 1772 1718 #include "vmware_pack_end.h" 1773 1719 SVGA3dCmdDefineGBSurface_v3; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 */ 1720 + 1721 + /* 1722 + * Defines a guest-backed surface, adding buffer byte stride. 1723 + */ 1724 + typedef 1725 + #include "vmware_pack_begin.h" 1726 + struct SVGA3dCmdDefineGBSurface_v4 { 1727 + uint32 sid; 1728 + SVGA3dSurfaceAllFlags surfaceFlags; 1729 + SVGA3dSurfaceFormat format; 1730 + uint32 numMipLevels; 1731 + uint32 multisampleCount; 1732 + SVGA3dMSPattern multisamplePattern; 1733 + SVGA3dMSQualityLevel qualityLevel; 1734 + SVGA3dTextureFilter autogenFilter; 1735 + SVGA3dSize size; 1736 + uint32 arraySize; 1737 + uint32 bufferByteStride; 1738 + } 1739 + #include "vmware_pack_end.h" 1740 + SVGA3dCmdDefineGBSurface_v4; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V4 */ 1774 1741 1775 1742 /* 1776 1743 * Destroy a guest-backed surface. ··· 2255 2180 #define SVGA_SCREEN_COPY_STATUS_FAILURE 0x00 2256 2181 #define SVGA_SCREEN_COPY_STATUS_SUCCESS 0x01 2257 2182 #define SVGA_SCREEN_COPY_STATUS_INVALID 0xFFFFFFFF 2183 + 2184 + typedef 2185 + #include "vmware_pack_begin.h" 2186 + struct { 2187 + uint32 sid; 2188 + } 2189 + #include "vmware_pack_end.h" 2190 + SVGA3dCmdWriteZeroSurface; /* SVGA_3D_CMD_WRITE_ZERO_SURFACE */ 2191 + 2192 + typedef 2193 + #include "vmware_pack_begin.h" 2194 + struct { 2195 + uint32 sid; 2196 + } 2197 + #include "vmware_pack_end.h" 2198 + SVGA3dCmdHintZeroSurface; /* SVGA_3D_CMD_HINT_ZERO_SURFACE */ 2258 2199 2259 2200 #endif /* _SVGA3D_CMD_H_ */
+380 -356
drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 2 /********************************************************** 3 - * Copyright 1998-2015 VMware, Inc. 3 + * Copyright 1998-2019 VMware, Inc. 4 4 * 5 5 * Permission is hereby granted, free of charge, to any person 6 6 * obtaining a copy of this software and associated documentation ··· 39 39 40 40 #include "includeCheck.h" 41 41 42 + #include "svga3d_types.h" 43 + 42 44 /* 43 45 * 3D Hardware Version 44 46 * ··· 71 69 * DevCap indexes. 72 70 */ 73 71 74 - typedef enum { 75 - SVGA3D_DEVCAP_INVALID = ((uint32)-1), 76 - SVGA3D_DEVCAP_3D = 0, 77 - SVGA3D_DEVCAP_MAX_LIGHTS = 1, 72 + typedef uint32 SVGA3dDevCapIndex; 78 73 79 - /* 80 - * SVGA3D_DEVCAP_MAX_TEXTURES reflects the maximum number of 81 - * fixed-function texture units available. Each of these units 82 - * work in both FFP and Shader modes, and they support texture 83 - * transforms and texture coordinates. The host may have additional 84 - * texture image units that are only usable with shaders. 85 - */ 86 - SVGA3D_DEVCAP_MAX_TEXTURES = 2, 87 - SVGA3D_DEVCAP_MAX_CLIP_PLANES = 3, 88 - SVGA3D_DEVCAP_VERTEX_SHADER_VERSION = 4, 89 - SVGA3D_DEVCAP_VERTEX_SHADER = 5, 90 - SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION = 6, 91 - SVGA3D_DEVCAP_FRAGMENT_SHADER = 7, 92 - SVGA3D_DEVCAP_MAX_RENDER_TARGETS = 8, 93 - SVGA3D_DEVCAP_S23E8_TEXTURES = 9, 94 - SVGA3D_DEVCAP_S10E5_TEXTURES = 10, 95 - SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND = 11, 96 - SVGA3D_DEVCAP_D16_BUFFER_FORMAT = 12, 97 - SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT = 13, 98 - SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT = 14, 99 - SVGA3D_DEVCAP_QUERY_TYPES = 15, 100 - SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING = 16, 101 - SVGA3D_DEVCAP_MAX_POINT_SIZE = 17, 102 - SVGA3D_DEVCAP_MAX_SHADER_TEXTURES = 18, 103 - SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH = 19, 104 - SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT = 20, 105 - SVGA3D_DEVCAP_MAX_VOLUME_EXTENT = 21, 106 - SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT = 22, 107 - SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO = 23, 108 - SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY = 24, 109 - SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT = 25, 110 - SVGA3D_DEVCAP_MAX_VERTEX_INDEX = 26, 111 - SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS = 27, 112 - SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS = 28, 113 - SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS = 29, 114 - SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS = 30, 115 - SVGA3D_DEVCAP_TEXTURE_OPS = 31, 116 - SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8 = 32, 117 - SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8 = 33, 118 - SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10 = 34, 119 - SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5 = 35, 120 - SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5 = 36, 121 - SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4 = 37, 122 - SVGA3D_DEVCAP_SURFACEFMT_R5G6B5 = 38, 123 - SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16 = 39, 124 - SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8 = 40, 125 - SVGA3D_DEVCAP_SURFACEFMT_ALPHA8 = 41, 126 - SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8 = 42, 127 - SVGA3D_DEVCAP_SURFACEFMT_Z_D16 = 43, 128 - SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8 = 44, 129 - SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8 = 45, 130 - SVGA3D_DEVCAP_SURFACEFMT_DXT1 = 46, 131 - SVGA3D_DEVCAP_SURFACEFMT_DXT2 = 47, 132 - SVGA3D_DEVCAP_SURFACEFMT_DXT3 = 48, 133 - SVGA3D_DEVCAP_SURFACEFMT_DXT4 = 49, 134 - SVGA3D_DEVCAP_SURFACEFMT_DXT5 = 50, 135 - SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8 = 51, 136 - SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10 = 52, 137 - SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8 = 53, 138 - SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8 = 54, 139 - SVGA3D_DEVCAP_SURFACEFMT_CxV8U8 = 55, 140 - SVGA3D_DEVCAP_SURFACEFMT_R_S10E5 = 56, 141 - SVGA3D_DEVCAP_SURFACEFMT_R_S23E8 = 57, 142 - SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5 = 58, 143 - SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8 = 59, 144 - SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5 = 60, 145 - SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8 = 61, 74 + #define SVGA3D_DEVCAP_INVALID ((uint32)-1) 75 + #define SVGA3D_DEVCAP_3D 0 76 + #define SVGA3D_DEVCAP_MAX_LIGHTS 1 146 77 147 - /* 148 - * There is a hole in our devcap definitions for 149 - * historical reasons. 150 - * 151 - * Define a constant just for completeness. 152 - */ 153 - SVGA3D_DEVCAP_MISSING62 = 62, 78 + /* 79 + * SVGA3D_DEVCAP_MAX_TEXTURES reflects the maximum number of 80 + * fixed-function texture units available. Each of these units 81 + * work in both FFP and Shader modes, and they support texture 82 + * transforms and texture coordinates. The host may have additional 83 + * texture image units that are only usable with shaders. 84 + */ 85 + #define SVGA3D_DEVCAP_MAX_TEXTURES 2 86 + #define SVGA3D_DEVCAP_MAX_CLIP_PLANES 3 87 + #define SVGA3D_DEVCAP_VERTEX_SHADER_VERSION 4 88 + #define SVGA3D_DEVCAP_VERTEX_SHADER 5 89 + #define SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION 6 90 + #define SVGA3D_DEVCAP_FRAGMENT_SHADER 7 91 + #define SVGA3D_DEVCAP_MAX_RENDER_TARGETS 8 92 + #define SVGA3D_DEVCAP_S23E8_TEXTURES 9 93 + #define SVGA3D_DEVCAP_S10E5_TEXTURES 10 94 + #define SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND 11 95 + #define SVGA3D_DEVCAP_D16_BUFFER_FORMAT 12 96 + #define SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT 13 97 + #define SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT 14 98 + #define SVGA3D_DEVCAP_QUERY_TYPES 15 99 + #define SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING 16 100 + #define SVGA3D_DEVCAP_MAX_POINT_SIZE 17 101 + #define SVGA3D_DEVCAP_MAX_SHADER_TEXTURES 18 102 + #define SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH 19 103 + #define SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT 20 104 + #define SVGA3D_DEVCAP_MAX_VOLUME_EXTENT 21 105 + #define SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT 22 106 + #define SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO 23 107 + #define SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY 24 108 + #define SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT 25 109 + #define SVGA3D_DEVCAP_MAX_VERTEX_INDEX 26 110 + #define SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS 27 111 + #define SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS 28 112 + #define SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS 29 113 + #define SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS 30 114 + #define SVGA3D_DEVCAP_TEXTURE_OPS 31 115 + #define SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8 32 116 + #define SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8 33 117 + #define SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10 34 118 + #define SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5 35 119 + #define SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5 36 120 + #define SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4 37 121 + #define SVGA3D_DEVCAP_SURFACEFMT_R5G6B5 38 122 + #define SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16 39 123 + #define SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8 40 124 + #define SVGA3D_DEVCAP_SURFACEFMT_ALPHA8 41 125 + #define SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8 42 126 + #define SVGA3D_DEVCAP_SURFACEFMT_Z_D16 43 127 + #define SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8 44 128 + #define SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8 45 129 + #define SVGA3D_DEVCAP_SURFACEFMT_DXT1 46 130 + #define SVGA3D_DEVCAP_SURFACEFMT_DXT2 47 131 + #define SVGA3D_DEVCAP_SURFACEFMT_DXT3 48 132 + #define SVGA3D_DEVCAP_SURFACEFMT_DXT4 49 133 + #define SVGA3D_DEVCAP_SURFACEFMT_DXT5 50 134 + #define SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8 51 135 + #define SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10 52 136 + #define SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8 53 137 + #define SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8 54 138 + #define SVGA3D_DEVCAP_SURFACEFMT_CxV8U8 55 139 + #define SVGA3D_DEVCAP_SURFACEFMT_R_S10E5 56 140 + #define SVGA3D_DEVCAP_SURFACEFMT_R_S23E8 57 141 + #define SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5 58 142 + #define SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8 59 143 + #define SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5 60 144 + #define SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8 61 154 145 155 - SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES = 63, 146 + /* 147 + * There is a hole in our devcap definitions for 148 + * historical reasons. 149 + * 150 + * Define a constant just for completeness. 151 + */ 152 + #define SVGA3D_DEVCAP_MISSING62 62 156 153 157 - /* 158 - * Note that MAX_SIMULTANEOUS_RENDER_TARGETS is a maximum count of color 159 - * render targets. This does not include the depth or stencil targets. 160 - */ 161 - SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS = 64, 154 + #define SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES 63 162 155 163 - SVGA3D_DEVCAP_SURFACEFMT_V16U16 = 65, 164 - SVGA3D_DEVCAP_SURFACEFMT_G16R16 = 66, 165 - SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16 = 67, 166 - SVGA3D_DEVCAP_SURFACEFMT_UYVY = 68, 167 - SVGA3D_DEVCAP_SURFACEFMT_YUY2 = 69, 156 + /* 157 + * Note that MAX_SIMULTANEOUS_RENDER_TARGETS is a maximum count of color 158 + * render targets. This does not include the depth or stencil targets. 159 + */ 160 + #define SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS 64 168 161 169 - /* 170 - * Deprecated. 171 - */ 172 - SVGA3D_DEVCAP_DEAD4 = 70, 173 - SVGA3D_DEVCAP_DEAD5 = 71, 174 - SVGA3D_DEVCAP_DEAD7 = 72, 175 - SVGA3D_DEVCAP_DEAD6 = 73, 162 + #define SVGA3D_DEVCAP_SURFACEFMT_V16U16 65 163 + #define SVGA3D_DEVCAP_SURFACEFMT_G16R16 66 164 + #define SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16 67 165 + #define SVGA3D_DEVCAP_SURFACEFMT_UYVY 68 166 + #define SVGA3D_DEVCAP_SURFACEFMT_YUY2 69 176 167 177 - SVGA3D_DEVCAP_AUTOGENMIPMAPS = 74, 178 - SVGA3D_DEVCAP_SURFACEFMT_NV12 = 75, 179 - SVGA3D_DEVCAP_SURFACEFMT_AYUV = 76, 168 + /* 169 + * Deprecated. 170 + */ 171 + #define SVGA3D_DEVCAP_DEAD4 70 172 + #define SVGA3D_DEVCAP_DEAD5 71 173 + #define SVGA3D_DEVCAP_DEAD7 72 174 + #define SVGA3D_DEVCAP_DEAD6 73 180 175 181 - /* 182 - * This is the maximum number of SVGA context IDs that the guest 183 - * can define using SVGA_3D_CMD_CONTEXT_DEFINE. 184 - */ 185 - SVGA3D_DEVCAP_MAX_CONTEXT_IDS = 77, 176 + #define SVGA3D_DEVCAP_AUTOGENMIPMAPS 74 177 + #define SVGA3D_DEVCAP_SURFACEFMT_NV12 75 178 + #define SVGA3D_DEVCAP_DEAD10 76 186 179 187 - /* 188 - * This is the maximum number of SVGA surface IDs that the guest 189 - * can define using SVGA_3D_CMD_SURFACE_DEFINE*. 190 - */ 191 - SVGA3D_DEVCAP_MAX_SURFACE_IDS = 78, 180 + /* 181 + * This is the maximum number of SVGA context IDs that the guest 182 + * can define using SVGA_3D_CMD_CONTEXT_DEFINE. 183 + */ 184 + #define SVGA3D_DEVCAP_MAX_CONTEXT_IDS 77 192 185 193 - SVGA3D_DEVCAP_SURFACEFMT_Z_DF16 = 79, 194 - SVGA3D_DEVCAP_SURFACEFMT_Z_DF24 = 80, 195 - SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT = 81, 186 + /* 187 + * This is the maximum number of SVGA surface IDs that the guest 188 + * can define using SVGA_3D_CMD_SURFACE_DEFINE*. 189 + */ 190 + #define SVGA3D_DEVCAP_MAX_SURFACE_IDS 78 196 191 197 - SVGA3D_DEVCAP_SURFACEFMT_ATI1 = 82, 198 - SVGA3D_DEVCAP_SURFACEFMT_ATI2 = 83, 192 + #define SVGA3D_DEVCAP_SURFACEFMT_Z_DF16 79 193 + #define SVGA3D_DEVCAP_SURFACEFMT_Z_DF24 80 194 + #define SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT 81 199 195 200 - /* 201 - * Deprecated. 202 - */ 203 - SVGA3D_DEVCAP_DEAD1 = 84, 196 + #define SVGA3D_DEVCAP_SURFACEFMT_ATI1 82 197 + #define SVGA3D_DEVCAP_SURFACEFMT_ATI2 83 204 198 205 - /* 206 - * This contains several SVGA_3D_CAPS_VIDEO_DECODE elements 207 - * ored together, one for every type of video decoding supported. 208 - */ 209 - SVGA3D_DEVCAP_VIDEO_DECODE = 85, 199 + /* 200 + * Deprecated. 201 + */ 202 + #define SVGA3D_DEVCAP_DEAD1 84 203 + #define SVGA3D_DEVCAP_DEAD8 85 204 + #define SVGA3D_DEVCAP_DEAD9 86 210 205 211 - /* 212 - * This contains several SVGA_3D_CAPS_VIDEO_PROCESS elements 213 - * ored together, one for every type of video processing supported. 214 - */ 215 - SVGA3D_DEVCAP_VIDEO_PROCESS = 86, 206 + #define SVGA3D_DEVCAP_LINE_AA 87 /* boolean */ 207 + #define SVGA3D_DEVCAP_LINE_STIPPLE 88 /* boolean */ 208 + #define SVGA3D_DEVCAP_MAX_LINE_WIDTH 89 /* float */ 209 + #define SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH 90 /* float */ 216 210 217 - SVGA3D_DEVCAP_LINE_AA = 87, /* boolean */ 218 - SVGA3D_DEVCAP_LINE_STIPPLE = 88, /* boolean */ 219 - SVGA3D_DEVCAP_MAX_LINE_WIDTH = 89, /* float */ 220 - SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH = 90, /* float */ 211 + #define SVGA3D_DEVCAP_SURFACEFMT_YV12 91 221 212 222 - SVGA3D_DEVCAP_SURFACEFMT_YV12 = 91, 213 + /* 214 + * Deprecated. 215 + */ 216 + #define SVGA3D_DEVCAP_DEAD3 92 223 217 224 - /* 225 - * Does the host support the SVGA logic ops commands? 226 - */ 227 - SVGA3D_DEVCAP_LOGICOPS = 92, 218 + /* 219 + * Are TS_CONSTANT, TS_COLOR_KEY, and TS_COLOR_KEY_ENABLE supported? 220 + */ 221 + #define SVGA3D_DEVCAP_TS_COLOR_KEY 93 /* boolean */ 228 222 229 - /* 230 - * Are TS_CONSTANT, TS_COLOR_KEY, and TS_COLOR_KEY_ENABLE supported? 231 - */ 232 - SVGA3D_DEVCAP_TS_COLOR_KEY = 93, /* boolean */ 223 + /* 224 + * Deprecated. 225 + */ 226 + #define SVGA3D_DEVCAP_DEAD2 94 233 227 234 - /* 235 - * Deprecated. 236 - */ 237 - SVGA3D_DEVCAP_DEAD2 = 94, 228 + /* 229 + * Does the device support DXContexts? 230 + */ 231 + #define SVGA3D_DEVCAP_DXCONTEXT 95 238 232 239 - /* 240 - * Does the device support DXContexts? 241 - */ 242 - SVGA3D_DEVCAP_DXCONTEXT = 95, 233 + /* 234 + * Deprecated. 235 + */ 236 + #define SVGA3D_DEVCAP_DEAD11 96 243 237 244 - /* 245 - * What is the maximum size of a texture array? 246 - * 247 - * (Even if this cap is zero, cubemaps are still allowed.) 248 - */ 249 - SVGA3D_DEVCAP_MAX_TEXTURE_ARRAY_SIZE = 96, 238 + /* 239 + * What is the maximum number of vertex buffers or vertex input registers 240 + * that can be expected to work correctly with a DXContext? 241 + * 242 + * The guest is allowed to set up to SVGA3D_DX_MAX_VERTEXBUFFERS, but 243 + * anything in excess of this cap is not guaranteed to render correctly. 244 + * 245 + * Similarly, the guest can set up to SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 246 + * input registers without the SVGA3D_DEVCAP_SM4_1 cap, or 247 + * SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS with the SVGA3D_DEVCAP_SM4_1, 248 + * but only the registers up to this cap value are guaranteed to render 249 + * correctly. 250 + * 251 + * If guest-drivers are able to expose a lower-limit, it's recommended 252 + * that they clamp to this value. Otherwise, the host will make a 253 + * best-effort on case-by-case basis if guests exceed this. 254 + */ 255 + #define SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS 97 250 256 251 - /* 252 - * What is the maximum number of vertex buffers or vertex input registers 253 - * that can be expected to work correctly with a DXContext? 254 - * 255 - * The guest is allowed to set up to SVGA3D_DX_MAX_VERTEXBUFFERS, but 256 - * anything in excess of this cap is not guaranteed to render correctly. 257 - * 258 - * Similarly, the guest can set up to SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 259 - * input registers without the SVGA3D_DEVCAP_SM4_1 cap, or 260 - * SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS with the SVGA3D_DEVCAP_SM4_1, 261 - * but only the registers up to this cap value are guaranteed to render 262 - * correctly. 263 - * 264 - * If guest-drivers are able to expose a lower-limit, it's recommended 265 - * that they clamp to this value. Otherwise, the host will make a 266 - * best-effort on case-by-case basis if guests exceed this. 267 - */ 268 - SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS = 97, 257 + /* 258 + * What is the maximum number of constant buffers that can be expected to 259 + * work correctly with a DX context? 260 + * 261 + * The guest is allowed to set up to SVGA3D_DX_MAX_CONSTBUFFERS, but 262 + * anything in excess of this cap is not guaranteed to render correctly. 263 + * 264 + * If guest-drivers are able to expose a lower-limit, it's recommended 265 + * that they clamp to this value. Otherwise, the host will make a 266 + * best-effort on case-by-case basis if guests exceed this. 267 + */ 268 + #define SVGA3D_DEVCAP_DX_MAX_CONSTANT_BUFFERS 98 269 269 270 - /* 271 - * What is the maximum number of constant buffers that can be expected to 272 - * work correctly with a DX context? 273 - * 274 - * The guest is allowed to set up to SVGA3D_DX_MAX_CONSTBUFFERS, but 275 - * anything in excess of this cap is not guaranteed to render correctly. 276 - * 277 - * If guest-drivers are able to expose a lower-limit, it's recommended 278 - * that they clamp to this value. Otherwise, the host will make a 279 - * best-effort on case-by-case basis if guests exceed this. 280 - */ 281 - SVGA3D_DEVCAP_DX_MAX_CONSTANT_BUFFERS = 98, 270 + /* 271 + * Does the device support provoking vertex control? 272 + * 273 + * If this cap is present, the provokingVertexLast field in the 274 + * rasterizer state is enabled. (Guests can then set it to FALSE, 275 + * meaning that the first vertex is the provoking vertex, or TRUE, 276 + * meaning that the last verteix is the provoking vertex.) 277 + * 278 + * If this cap is FALSE, then guests should set the provokingVertexLast 279 + * to FALSE, otherwise rendering behavior is undefined. 280 + */ 281 + #define SVGA3D_DEVCAP_DX_PROVOKING_VERTEX 99 282 282 283 - /* 284 - * Does the device support provoking vertex control? 285 - * 286 - * If this cap is present, the provokingVertexLast field in the 287 - * rasterizer state is enabled. (Guests can then set it to FALSE, 288 - * meaning that the first vertex is the provoking vertex, or TRUE, 289 - * meaning that the last verteix is the provoking vertex.) 290 - * 291 - * If this cap is FALSE, then guests should set the provokingVertexLast 292 - * to FALSE, otherwise rendering behavior is undefined. 293 - */ 294 - SVGA3D_DEVCAP_DX_PROVOKING_VERTEX = 99, 283 + #define SVGA3D_DEVCAP_DXFMT_X8R8G8B8 100 284 + #define SVGA3D_DEVCAP_DXFMT_A8R8G8B8 101 285 + #define SVGA3D_DEVCAP_DXFMT_R5G6B5 102 286 + #define SVGA3D_DEVCAP_DXFMT_X1R5G5B5 103 287 + #define SVGA3D_DEVCAP_DXFMT_A1R5G5B5 104 288 + #define SVGA3D_DEVCAP_DXFMT_A4R4G4B4 105 289 + #define SVGA3D_DEVCAP_DXFMT_Z_D32 106 290 + #define SVGA3D_DEVCAP_DXFMT_Z_D16 107 291 + #define SVGA3D_DEVCAP_DXFMT_Z_D24S8 108 292 + #define SVGA3D_DEVCAP_DXFMT_Z_D15S1 109 293 + #define SVGA3D_DEVCAP_DXFMT_LUMINANCE8 110 294 + #define SVGA3D_DEVCAP_DXFMT_LUMINANCE4_ALPHA4 111 295 + #define SVGA3D_DEVCAP_DXFMT_LUMINANCE16 112 296 + #define SVGA3D_DEVCAP_DXFMT_LUMINANCE8_ALPHA8 113 297 + #define SVGA3D_DEVCAP_DXFMT_DXT1 114 298 + #define SVGA3D_DEVCAP_DXFMT_DXT2 115 299 + #define SVGA3D_DEVCAP_DXFMT_DXT3 116 300 + #define SVGA3D_DEVCAP_DXFMT_DXT4 117 301 + #define SVGA3D_DEVCAP_DXFMT_DXT5 118 302 + #define SVGA3D_DEVCAP_DXFMT_BUMPU8V8 119 303 + #define SVGA3D_DEVCAP_DXFMT_BUMPL6V5U5 120 304 + #define SVGA3D_DEVCAP_DXFMT_BUMPX8L8V8U8 121 305 + #define SVGA3D_DEVCAP_DXFMT_FORMAT_DEAD1 122 306 + #define SVGA3D_DEVCAP_DXFMT_ARGB_S10E5 123 307 + #define SVGA3D_DEVCAP_DXFMT_ARGB_S23E8 124 308 + #define SVGA3D_DEVCAP_DXFMT_A2R10G10B10 125 309 + #define SVGA3D_DEVCAP_DXFMT_V8U8 126 310 + #define SVGA3D_DEVCAP_DXFMT_Q8W8V8U8 127 311 + #define SVGA3D_DEVCAP_DXFMT_CxV8U8 128 312 + #define SVGA3D_DEVCAP_DXFMT_X8L8V8U8 129 313 + #define SVGA3D_DEVCAP_DXFMT_A2W10V10U10 130 314 + #define SVGA3D_DEVCAP_DXFMT_ALPHA8 131 315 + #define SVGA3D_DEVCAP_DXFMT_R_S10E5 132 316 + #define SVGA3D_DEVCAP_DXFMT_R_S23E8 133 317 + #define SVGA3D_DEVCAP_DXFMT_RG_S10E5 134 318 + #define SVGA3D_DEVCAP_DXFMT_RG_S23E8 135 319 + #define SVGA3D_DEVCAP_DXFMT_BUFFER 136 320 + #define SVGA3D_DEVCAP_DXFMT_Z_D24X8 137 321 + #define SVGA3D_DEVCAP_DXFMT_V16U16 138 322 + #define SVGA3D_DEVCAP_DXFMT_G16R16 139 323 + #define SVGA3D_DEVCAP_DXFMT_A16B16G16R16 140 324 + #define SVGA3D_DEVCAP_DXFMT_UYVY 141 325 + #define SVGA3D_DEVCAP_DXFMT_YUY2 142 326 + #define SVGA3D_DEVCAP_DXFMT_NV12 143 327 + #define SVGA3D_DEVCAP_DXFMT_FORMAT_DEAD2 144 328 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32A32_TYPELESS 145 329 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32A32_UINT 146 330 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32A32_SINT 147 331 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32_TYPELESS 148 332 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32_FLOAT 149 333 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32_UINT 150 334 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32_SINT 151 335 + #define SVGA3D_DEVCAP_DXFMT_R16G16B16A16_TYPELESS 152 336 + #define SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UINT 153 337 + #define SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SNORM 154 338 + #define SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SINT 155 339 + #define SVGA3D_DEVCAP_DXFMT_R32G32_TYPELESS 156 340 + #define SVGA3D_DEVCAP_DXFMT_R32G32_UINT 157 341 + #define SVGA3D_DEVCAP_DXFMT_R32G32_SINT 158 342 + #define SVGA3D_DEVCAP_DXFMT_R32G8X24_TYPELESS 159 343 + #define SVGA3D_DEVCAP_DXFMT_D32_FLOAT_S8X24_UINT 160 344 + #define SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24 161 345 + #define SVGA3D_DEVCAP_DXFMT_X32_G8X24_UINT 162 346 + #define SVGA3D_DEVCAP_DXFMT_R10G10B10A2_TYPELESS 163 347 + #define SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UINT 164 348 + #define SVGA3D_DEVCAP_DXFMT_R11G11B10_FLOAT 165 349 + #define SVGA3D_DEVCAP_DXFMT_R8G8B8A8_TYPELESS 166 350 + #define SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM 167 351 + #define SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM_SRGB 168 352 + #define SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UINT 169 353 + #define SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SINT 170 354 + #define SVGA3D_DEVCAP_DXFMT_R16G16_TYPELESS 171 355 + #define SVGA3D_DEVCAP_DXFMT_R16G16_UINT 172 356 + #define SVGA3D_DEVCAP_DXFMT_R16G16_SINT 173 357 + #define SVGA3D_DEVCAP_DXFMT_R32_TYPELESS 174 358 + #define SVGA3D_DEVCAP_DXFMT_D32_FLOAT 175 359 + #define SVGA3D_DEVCAP_DXFMT_R32_UINT 176 360 + #define SVGA3D_DEVCAP_DXFMT_R32_SINT 177 361 + #define SVGA3D_DEVCAP_DXFMT_R24G8_TYPELESS 178 362 + #define SVGA3D_DEVCAP_DXFMT_D24_UNORM_S8_UINT 179 363 + #define SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8 180 364 + #define SVGA3D_DEVCAP_DXFMT_X24_G8_UINT 181 365 + #define SVGA3D_DEVCAP_DXFMT_R8G8_TYPELESS 182 366 + #define SVGA3D_DEVCAP_DXFMT_R8G8_UNORM 183 367 + #define SVGA3D_DEVCAP_DXFMT_R8G8_UINT 184 368 + #define SVGA3D_DEVCAP_DXFMT_R8G8_SINT 185 369 + #define SVGA3D_DEVCAP_DXFMT_R16_TYPELESS 186 370 + #define SVGA3D_DEVCAP_DXFMT_R16_UNORM 187 371 + #define SVGA3D_DEVCAP_DXFMT_R16_UINT 188 372 + #define SVGA3D_DEVCAP_DXFMT_R16_SNORM 189 373 + #define SVGA3D_DEVCAP_DXFMT_R16_SINT 190 374 + #define SVGA3D_DEVCAP_DXFMT_R8_TYPELESS 191 375 + #define SVGA3D_DEVCAP_DXFMT_R8_UNORM 192 376 + #define SVGA3D_DEVCAP_DXFMT_R8_UINT 193 377 + #define SVGA3D_DEVCAP_DXFMT_R8_SNORM 194 378 + #define SVGA3D_DEVCAP_DXFMT_R8_SINT 195 379 + #define SVGA3D_DEVCAP_DXFMT_P8 196 380 + #define SVGA3D_DEVCAP_DXFMT_R9G9B9E5_SHAREDEXP 197 381 + #define SVGA3D_DEVCAP_DXFMT_R8G8_B8G8_UNORM 198 382 + #define SVGA3D_DEVCAP_DXFMT_G8R8_G8B8_UNORM 199 383 + #define SVGA3D_DEVCAP_DXFMT_BC1_TYPELESS 200 384 + #define SVGA3D_DEVCAP_DXFMT_BC1_UNORM_SRGB 201 385 + #define SVGA3D_DEVCAP_DXFMT_BC2_TYPELESS 202 386 + #define SVGA3D_DEVCAP_DXFMT_BC2_UNORM_SRGB 203 387 + #define SVGA3D_DEVCAP_DXFMT_BC3_TYPELESS 204 388 + #define SVGA3D_DEVCAP_DXFMT_BC3_UNORM_SRGB 205 389 + #define SVGA3D_DEVCAP_DXFMT_BC4_TYPELESS 206 390 + #define SVGA3D_DEVCAP_DXFMT_ATI1 207 391 + #define SVGA3D_DEVCAP_DXFMT_BC4_SNORM 208 392 + #define SVGA3D_DEVCAP_DXFMT_BC5_TYPELESS 209 393 + #define SVGA3D_DEVCAP_DXFMT_ATI2 210 394 + #define SVGA3D_DEVCAP_DXFMT_BC5_SNORM 211 395 + #define SVGA3D_DEVCAP_DXFMT_R10G10B10_XR_BIAS_A2_UNORM 212 396 + #define SVGA3D_DEVCAP_DXFMT_B8G8R8A8_TYPELESS 213 397 + #define SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM_SRGB 214 398 + #define SVGA3D_DEVCAP_DXFMT_B8G8R8X8_TYPELESS 215 399 + #define SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM_SRGB 216 400 + #define SVGA3D_DEVCAP_DXFMT_Z_DF16 217 401 + #define SVGA3D_DEVCAP_DXFMT_Z_DF24 218 402 + #define SVGA3D_DEVCAP_DXFMT_Z_D24S8_INT 219 403 + #define SVGA3D_DEVCAP_DXFMT_YV12 220 404 + #define SVGA3D_DEVCAP_DXFMT_R32G32B32A32_FLOAT 221 405 + #define SVGA3D_DEVCAP_DXFMT_R16G16B16A16_FLOAT 222 406 + #define SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UNORM 223 407 + #define SVGA3D_DEVCAP_DXFMT_R32G32_FLOAT 224 408 + #define SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UNORM 225 409 + #define SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SNORM 226 410 + #define SVGA3D_DEVCAP_DXFMT_R16G16_FLOAT 227 411 + #define SVGA3D_DEVCAP_DXFMT_R16G16_UNORM 228 412 + #define SVGA3D_DEVCAP_DXFMT_R16G16_SNORM 229 413 + #define SVGA3D_DEVCAP_DXFMT_R32_FLOAT 230 414 + #define SVGA3D_DEVCAP_DXFMT_R8G8_SNORM 231 415 + #define SVGA3D_DEVCAP_DXFMT_R16_FLOAT 232 416 + #define SVGA3D_DEVCAP_DXFMT_D16_UNORM 233 417 + #define SVGA3D_DEVCAP_DXFMT_A8_UNORM 234 418 + #define SVGA3D_DEVCAP_DXFMT_BC1_UNORM 235 419 + #define SVGA3D_DEVCAP_DXFMT_BC2_UNORM 236 420 + #define SVGA3D_DEVCAP_DXFMT_BC3_UNORM 237 421 + #define SVGA3D_DEVCAP_DXFMT_B5G6R5_UNORM 238 422 + #define SVGA3D_DEVCAP_DXFMT_B5G5R5A1_UNORM 239 423 + #define SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM 240 424 + #define SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM 241 425 + #define SVGA3D_DEVCAP_DXFMT_BC4_UNORM 242 426 + #define SVGA3D_DEVCAP_DXFMT_BC5_UNORM 243 295 427 296 - SVGA3D_DEVCAP_DXFMT_X8R8G8B8 = 100, 297 - SVGA3D_DEVCAP_DXFMT_A8R8G8B8 = 101, 298 - SVGA3D_DEVCAP_DXFMT_R5G6B5 = 102, 299 - SVGA3D_DEVCAP_DXFMT_X1R5G5B5 = 103, 300 - SVGA3D_DEVCAP_DXFMT_A1R5G5B5 = 104, 301 - SVGA3D_DEVCAP_DXFMT_A4R4G4B4 = 105, 302 - SVGA3D_DEVCAP_DXFMT_Z_D32 = 106, 303 - SVGA3D_DEVCAP_DXFMT_Z_D16 = 107, 304 - SVGA3D_DEVCAP_DXFMT_Z_D24S8 = 108, 305 - SVGA3D_DEVCAP_DXFMT_Z_D15S1 = 109, 306 - SVGA3D_DEVCAP_DXFMT_LUMINANCE8 = 110, 307 - SVGA3D_DEVCAP_DXFMT_LUMINANCE4_ALPHA4 = 111, 308 - SVGA3D_DEVCAP_DXFMT_LUMINANCE16 = 112, 309 - SVGA3D_DEVCAP_DXFMT_LUMINANCE8_ALPHA8 = 113, 310 - SVGA3D_DEVCAP_DXFMT_DXT1 = 114, 311 - SVGA3D_DEVCAP_DXFMT_DXT2 = 115, 312 - SVGA3D_DEVCAP_DXFMT_DXT3 = 116, 313 - SVGA3D_DEVCAP_DXFMT_DXT4 = 117, 314 - SVGA3D_DEVCAP_DXFMT_DXT5 = 118, 315 - SVGA3D_DEVCAP_DXFMT_BUMPU8V8 = 119, 316 - SVGA3D_DEVCAP_DXFMT_BUMPL6V5U5 = 120, 317 - SVGA3D_DEVCAP_DXFMT_BUMPX8L8V8U8 = 121, 318 - SVGA3D_DEVCAP_DXFMT_FORMAT_DEAD1 = 122, 319 - SVGA3D_DEVCAP_DXFMT_ARGB_S10E5 = 123, 320 - SVGA3D_DEVCAP_DXFMT_ARGB_S23E8 = 124, 321 - SVGA3D_DEVCAP_DXFMT_A2R10G10B10 = 125, 322 - SVGA3D_DEVCAP_DXFMT_V8U8 = 126, 323 - SVGA3D_DEVCAP_DXFMT_Q8W8V8U8 = 127, 324 - SVGA3D_DEVCAP_DXFMT_CxV8U8 = 128, 325 - SVGA3D_DEVCAP_DXFMT_X8L8V8U8 = 129, 326 - SVGA3D_DEVCAP_DXFMT_A2W10V10U10 = 130, 327 - SVGA3D_DEVCAP_DXFMT_ALPHA8 = 131, 328 - SVGA3D_DEVCAP_DXFMT_R_S10E5 = 132, 329 - SVGA3D_DEVCAP_DXFMT_R_S23E8 = 133, 330 - SVGA3D_DEVCAP_DXFMT_RG_S10E5 = 134, 331 - SVGA3D_DEVCAP_DXFMT_RG_S23E8 = 135, 332 - SVGA3D_DEVCAP_DXFMT_BUFFER = 136, 333 - SVGA3D_DEVCAP_DXFMT_Z_D24X8 = 137, 334 - SVGA3D_DEVCAP_DXFMT_V16U16 = 138, 335 - SVGA3D_DEVCAP_DXFMT_G16R16 = 139, 336 - SVGA3D_DEVCAP_DXFMT_A16B16G16R16 = 140, 337 - SVGA3D_DEVCAP_DXFMT_UYVY = 141, 338 - SVGA3D_DEVCAP_DXFMT_YUY2 = 142, 339 - SVGA3D_DEVCAP_DXFMT_NV12 = 143, 340 - SVGA3D_DEVCAP_DXFMT_AYUV = 144, 341 - SVGA3D_DEVCAP_DXFMT_R32G32B32A32_TYPELESS = 145, 342 - SVGA3D_DEVCAP_DXFMT_R32G32B32A32_UINT = 146, 343 - SVGA3D_DEVCAP_DXFMT_R32G32B32A32_SINT = 147, 344 - SVGA3D_DEVCAP_DXFMT_R32G32B32_TYPELESS = 148, 345 - SVGA3D_DEVCAP_DXFMT_R32G32B32_FLOAT = 149, 346 - SVGA3D_DEVCAP_DXFMT_R32G32B32_UINT = 150, 347 - SVGA3D_DEVCAP_DXFMT_R32G32B32_SINT = 151, 348 - SVGA3D_DEVCAP_DXFMT_R16G16B16A16_TYPELESS = 152, 349 - SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UINT = 153, 350 - SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SNORM = 154, 351 - SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SINT = 155, 352 - SVGA3D_DEVCAP_DXFMT_R32G32_TYPELESS = 156, 353 - SVGA3D_DEVCAP_DXFMT_R32G32_UINT = 157, 354 - SVGA3D_DEVCAP_DXFMT_R32G32_SINT = 158, 355 - SVGA3D_DEVCAP_DXFMT_R32G8X24_TYPELESS = 159, 356 - SVGA3D_DEVCAP_DXFMT_D32_FLOAT_S8X24_UINT = 160, 357 - SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24 = 161, 358 - SVGA3D_DEVCAP_DXFMT_X32_G8X24_UINT = 162, 359 - SVGA3D_DEVCAP_DXFMT_R10G10B10A2_TYPELESS = 163, 360 - SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UINT = 164, 361 - SVGA3D_DEVCAP_DXFMT_R11G11B10_FLOAT = 165, 362 - SVGA3D_DEVCAP_DXFMT_R8G8B8A8_TYPELESS = 166, 363 - SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM = 167, 364 - SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM_SRGB = 168, 365 - SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UINT = 169, 366 - SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SINT = 170, 367 - SVGA3D_DEVCAP_DXFMT_R16G16_TYPELESS = 171, 368 - SVGA3D_DEVCAP_DXFMT_R16G16_UINT = 172, 369 - SVGA3D_DEVCAP_DXFMT_R16G16_SINT = 173, 370 - SVGA3D_DEVCAP_DXFMT_R32_TYPELESS = 174, 371 - SVGA3D_DEVCAP_DXFMT_D32_FLOAT = 175, 372 - SVGA3D_DEVCAP_DXFMT_R32_UINT = 176, 373 - SVGA3D_DEVCAP_DXFMT_R32_SINT = 177, 374 - SVGA3D_DEVCAP_DXFMT_R24G8_TYPELESS = 178, 375 - SVGA3D_DEVCAP_DXFMT_D24_UNORM_S8_UINT = 179, 376 - SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8 = 180, 377 - SVGA3D_DEVCAP_DXFMT_X24_G8_UINT = 181, 378 - SVGA3D_DEVCAP_DXFMT_R8G8_TYPELESS = 182, 379 - SVGA3D_DEVCAP_DXFMT_R8G8_UNORM = 183, 380 - SVGA3D_DEVCAP_DXFMT_R8G8_UINT = 184, 381 - SVGA3D_DEVCAP_DXFMT_R8G8_SINT = 185, 382 - SVGA3D_DEVCAP_DXFMT_R16_TYPELESS = 186, 383 - SVGA3D_DEVCAP_DXFMT_R16_UNORM = 187, 384 - SVGA3D_DEVCAP_DXFMT_R16_UINT = 188, 385 - SVGA3D_DEVCAP_DXFMT_R16_SNORM = 189, 386 - SVGA3D_DEVCAP_DXFMT_R16_SINT = 190, 387 - SVGA3D_DEVCAP_DXFMT_R8_TYPELESS = 191, 388 - SVGA3D_DEVCAP_DXFMT_R8_UNORM = 192, 389 - SVGA3D_DEVCAP_DXFMT_R8_UINT = 193, 390 - SVGA3D_DEVCAP_DXFMT_R8_SNORM = 194, 391 - SVGA3D_DEVCAP_DXFMT_R8_SINT = 195, 392 - SVGA3D_DEVCAP_DXFMT_P8 = 196, 393 - SVGA3D_DEVCAP_DXFMT_R9G9B9E5_SHAREDEXP = 197, 394 - SVGA3D_DEVCAP_DXFMT_R8G8_B8G8_UNORM = 198, 395 - SVGA3D_DEVCAP_DXFMT_G8R8_G8B8_UNORM = 199, 396 - SVGA3D_DEVCAP_DXFMT_BC1_TYPELESS = 200, 397 - SVGA3D_DEVCAP_DXFMT_BC1_UNORM_SRGB = 201, 398 - SVGA3D_DEVCAP_DXFMT_BC2_TYPELESS = 202, 399 - SVGA3D_DEVCAP_DXFMT_BC2_UNORM_SRGB = 203, 400 - SVGA3D_DEVCAP_DXFMT_BC3_TYPELESS = 204, 401 - SVGA3D_DEVCAP_DXFMT_BC3_UNORM_SRGB = 205, 402 - SVGA3D_DEVCAP_DXFMT_BC4_TYPELESS = 206, 403 - SVGA3D_DEVCAP_DXFMT_ATI1 = 207, 404 - SVGA3D_DEVCAP_DXFMT_BC4_SNORM = 208, 405 - SVGA3D_DEVCAP_DXFMT_BC5_TYPELESS = 209, 406 - SVGA3D_DEVCAP_DXFMT_ATI2 = 210, 407 - SVGA3D_DEVCAP_DXFMT_BC5_SNORM = 211, 408 - SVGA3D_DEVCAP_DXFMT_R10G10B10_XR_BIAS_A2_UNORM = 212, 409 - SVGA3D_DEVCAP_DXFMT_B8G8R8A8_TYPELESS = 213, 410 - SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM_SRGB = 214, 411 - SVGA3D_DEVCAP_DXFMT_B8G8R8X8_TYPELESS = 215, 412 - SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM_SRGB = 216, 413 - SVGA3D_DEVCAP_DXFMT_Z_DF16 = 217, 414 - SVGA3D_DEVCAP_DXFMT_Z_DF24 = 218, 415 - SVGA3D_DEVCAP_DXFMT_Z_D24S8_INT = 219, 416 - SVGA3D_DEVCAP_DXFMT_YV12 = 220, 417 - SVGA3D_DEVCAP_DXFMT_R32G32B32A32_FLOAT = 221, 418 - SVGA3D_DEVCAP_DXFMT_R16G16B16A16_FLOAT = 222, 419 - SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UNORM = 223, 420 - SVGA3D_DEVCAP_DXFMT_R32G32_FLOAT = 224, 421 - SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UNORM = 225, 422 - SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SNORM = 226, 423 - SVGA3D_DEVCAP_DXFMT_R16G16_FLOAT = 227, 424 - SVGA3D_DEVCAP_DXFMT_R16G16_UNORM = 228, 425 - SVGA3D_DEVCAP_DXFMT_R16G16_SNORM = 229, 426 - SVGA3D_DEVCAP_DXFMT_R32_FLOAT = 230, 427 - SVGA3D_DEVCAP_DXFMT_R8G8_SNORM = 231, 428 - SVGA3D_DEVCAP_DXFMT_R16_FLOAT = 232, 429 - SVGA3D_DEVCAP_DXFMT_D16_UNORM = 233, 430 - SVGA3D_DEVCAP_DXFMT_A8_UNORM = 234, 431 - SVGA3D_DEVCAP_DXFMT_BC1_UNORM = 235, 432 - SVGA3D_DEVCAP_DXFMT_BC2_UNORM = 236, 433 - SVGA3D_DEVCAP_DXFMT_BC3_UNORM = 237, 434 - SVGA3D_DEVCAP_DXFMT_B5G6R5_UNORM = 238, 435 - SVGA3D_DEVCAP_DXFMT_B5G5R5A1_UNORM = 239, 436 - SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM = 240, 437 - SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM = 241, 438 - SVGA3D_DEVCAP_DXFMT_BC4_UNORM = 242, 439 - SVGA3D_DEVCAP_DXFMT_BC5_UNORM = 243, 428 + /* 429 + * Advertises shaderModel 4.1 support, independent blend-states, 430 + * cube-map arrays, and a higher vertex input registers limit. 431 + * 432 + * (See documentation on SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS.) 433 + */ 434 + #define SVGA3D_DEVCAP_SM41 244 435 + #define SVGA3D_DEVCAP_MULTISAMPLE_2X 245 436 + #define SVGA3D_DEVCAP_MULTISAMPLE_4X 246 440 437 441 - /* 442 - * Advertises shaderModel 4.1 support, independent blend-states, 443 - * cube-map arrays, and a higher vertex input registers limit. 444 - * 445 - * (See documentation on SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS.) 446 - */ 447 - SVGA3D_DEVCAP_SM41 = 244, 438 + /* 439 + * Indicates that the device has rendering support for 440 + * the full multisample quality. If this cap is not present, 441 + * the host may or may not support full quality rendering. 442 + * 443 + * See also SVGA_REG_MS_HINT_RESOLVED. 444 + */ 445 + #define SVGA3D_DEVCAP_MS_FULL_QUALITY 247 448 446 449 - SVGA3D_DEVCAP_MULTISAMPLE_2X = 245, 450 - SVGA3D_DEVCAP_MULTISAMPLE_4X = 246, 447 + /* 448 + * Advertises support for the SVGA3D LogicOps commands. 449 + */ 450 + #define SVGA3D_DEVCAP_LOGICOPS 248 451 451 452 - SVGA3D_DEVCAP_MAX /* This must be the last index. */ 453 - } SVGA3dDevCapIndex; 452 + /* 453 + * Advertises support for using logicOps in the DXBlendStates. 454 + */ 455 + #define SVGA3D_DEVCAP_LOGIC_BLENDOPS 249 456 + 457 + /* 458 + * Note DXFMT range is now non-contiguous. 459 + */ 460 + #define SVGA3D_DEVCAP_RESERVED_1 250 461 + #define SVGA3D_DEVCAP_DXFMT_BC6H_TYPELESS 251 462 + #define SVGA3D_DEVCAP_DXFMT_BC6H_UF16 252 463 + #define SVGA3D_DEVCAP_DXFMT_BC6H_SF16 253 464 + #define SVGA3D_DEVCAP_DXFMT_BC7_TYPELESS 254 465 + #define SVGA3D_DEVCAP_DXFMT_BC7_UNORM 255 466 + #define SVGA3D_DEVCAP_DXFMT_BC7_UNORM_SRGB 256 467 + #define SVGA3D_DEVCAP_RESERVED_2 257 468 + 469 + #define SVGA3D_DEVCAP_SM5 258 470 + #define SVGA3D_DEVCAP_MULTISAMPLE_8X 259 471 + 472 + /* This must be the last index. */ 473 + #define SVGA3D_DEVCAP_MAX 260 454 474 455 475 /* 456 476 * Bit definitions for DXFMT devcaps ··· 501 477 #define SVGA3D_DXFMT_MAX (1 << 10) 502 478 503 479 typedef union { 504 - Bool b; 480 + SVGA3dBool b; 505 481 uint32 u; 506 - int32 i; 507 - float f; 482 + int32 i; 483 + float f; 508 484 } SVGA3dDevCapResult; 509 485 510 486 #endif /* _SVGA3D_DEVCAPS_H_ */
+449 -17
drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 2 /********************************************************** 3 - * Copyright 2012-2015 VMware, Inc. 3 + * Copyright 2012-2019 VMware, Inc. 4 4 * 5 5 * Permission is hereby granted, free of charge, to any person 6 6 * obtaining a copy of this software and associated documentation ··· 118 118 #define SVGA3D_DX_MAX_SRVIEWS 128 119 119 #define SVGA3D_DX_MAX_CONSTBUFFERS 16 120 120 #define SVGA3D_DX_MAX_SAMPLERS 16 121 + #define SVGA3D_DX_MAX_CLASS_INSTANCES 253 121 122 122 123 #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32)) 123 124 124 125 typedef uint32 SVGA3dShaderResourceViewId; 125 126 typedef uint32 SVGA3dRenderTargetViewId; 126 127 typedef uint32 SVGA3dDepthStencilViewId; 128 + typedef uint32 SVGA3dUAViewId; 127 129 128 130 typedef uint32 SVGA3dShaderId; 129 131 typedef uint32 SVGA3dElementLayoutId; ··· 146 144 147 145 float value[4]; 148 146 } SVGA3dRGBAFloat; 147 + 148 + typedef union { 149 + struct { 150 + uint32 r; 151 + uint32 g; 152 + uint32 b; 153 + uint32 a; 154 + }; 155 + 156 + uint32 value[4]; 157 + } SVGA3dRGBAUint32; 149 158 150 159 typedef 151 160 #include "vmware_pack_begin.h" ··· 262 249 #include "vmware_pack_end.h" 263 250 SVGA3dCmdDXSetShader; /* SVGA_3D_CMD_DX_SET_SHADER */ 264 251 252 + typedef union { 253 + struct { 254 + uint32 cbOffset : 12; 255 + uint32 cbId : 4; 256 + uint32 baseSamp : 4; 257 + uint32 baseTex : 7; 258 + uint32 reserved : 5; 259 + }; 260 + uint32 value; 261 + } SVGA3dIfaceData; 262 + 263 + typedef 264 + #include "vmware_pack_begin.h" 265 + struct SVGA3dCmdDXSetShaderIface { 266 + SVGA3dShaderType type; 267 + uint32 numClassInstances; 268 + uint32 index; 269 + uint32 iface; 270 + SVGA3dIfaceData data; 271 + } 272 + #include "vmware_pack_end.h" 273 + SVGA3dCmdDXSetShaderIface; /* SVGA_3D_CMD_DX_SET_SHADER_IFACE */ 274 + 275 + typedef 276 + #include "vmware_pack_begin.h" 277 + struct SVGA3dCmdDXBindShaderIface { 278 + uint32 cid; 279 + SVGAMobId mobid; 280 + uint32 offsetInBytes; 281 + } 282 + #include "vmware_pack_end.h" 283 + SVGA3dCmdDXBindShaderIface; /* SVGA_3D_CMD_DX_BIND_SHADER_IFACE */ 284 + 265 285 typedef 266 286 #include "vmware_pack_begin.h" 267 287 struct SVGA3dCmdDXSetSamplers { ··· 352 306 353 307 typedef 354 308 #include "vmware_pack_begin.h" 309 + struct SVGA3dCmdDXDrawIndexedInstancedIndirect { 310 + SVGA3dSurfaceId argsBufferSid; 311 + uint32 byteOffsetForArgs; 312 + } 313 + #include "vmware_pack_end.h" 314 + SVGA3dCmdDXDrawIndexedInstancedIndirect; 315 + /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED_INDIRECT */ 316 + 317 + typedef 318 + #include "vmware_pack_begin.h" 319 + struct SVGA3dCmdDXDrawInstancedIndirect { 320 + SVGA3dSurfaceId argsBufferSid; 321 + uint32 byteOffsetForArgs; 322 + } 323 + #include "vmware_pack_end.h" 324 + SVGA3dCmdDXDrawInstancedIndirect; 325 + /* SVGA_3D_CMD_DX_DRAW_INSTANCED_INDIRECT */ 326 + 327 + typedef 328 + #include "vmware_pack_begin.h" 355 329 struct SVGA3dCmdDXDrawAuto { 356 330 uint32 pad0; 357 331 } 358 332 #include "vmware_pack_end.h" 359 333 SVGA3dCmdDXDrawAuto; /* SVGA_3D_CMD_DX_DRAW_AUTO */ 334 + 335 + typedef 336 + #include "vmware_pack_begin.h" 337 + struct SVGA3dCmdDXDispatch { 338 + uint32 threadGroupCountX; 339 + uint32 threadGroupCountY; 340 + uint32 threadGroupCountZ; 341 + } 342 + #include "vmware_pack_end.h" 343 + SVGA3dCmdDXDispatch; 344 + /* SVGA_3D_CMD_DX_DISPATCH */ 345 + 346 + typedef 347 + #include "vmware_pack_begin.h" 348 + struct SVGA3dCmdDXDispatchIndirect { 349 + SVGA3dSurfaceId argsBufferSid; 350 + uint32 byteOffsetForArgs; 351 + } 352 + #include "vmware_pack_end.h" 353 + SVGA3dCmdDXDispatchIndirect; 354 + /* SVGA_3D_CMD_DX_DISPATCH_INDIRECT */ 360 355 361 356 typedef 362 357 #include "vmware_pack_begin.h" ··· 612 525 uint32 offset; /* Starting offset */ 613 526 uint32 intOffset; /* Internal offset */ 614 527 uint32 vertexCount; /* vertices written */ 615 - uint32 sizeInBytes; /* max bytes to write */ 528 + uint32 dead; 616 529 } 617 530 #include "vmware_pack_end.h" 618 531 SVGA3dDXSOState; ··· 873 786 SVGA3dCmdDXTransferFromBuffer; /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */ 874 787 875 788 789 + #define SVGA3D_TRANSFER_TO_BUFFER_READBACK (1 << 0) 790 + #define SVGA3D_TRANSFER_TO_BUFFER_FLAGS_MASK (1 << 0) 791 + typedef uint32 SVGA3dTransferToBufferFlags; 792 + 793 + /* 794 + * Raw byte wise transfer to a buffer surface from another surface 795 + * of the requested box. Supported if SVGA_CAP_DX2 is set. This 796 + * command does not take a context. 797 + */ 798 + typedef 799 + #include "vmware_pack_begin.h" 800 + struct SVGA3dCmdDXTransferToBuffer { 801 + SVGA3dSurfaceId srcSid; 802 + uint32 srcSubResource; 803 + SVGA3dBox srcBox; 804 + SVGA3dSurfaceId destSid; 805 + uint32 destOffset; 806 + uint32 destPitch; 807 + uint32 destSlicePitch; 808 + SVGA3dTransferToBufferFlags flags; 809 + } 810 + #include "vmware_pack_end.h" 811 + SVGA3dCmdDXTransferToBuffer; /* SVGA_3D_CMD_DX_TRANSFER_TO_BUFFER */ 812 + 813 + 876 814 /* 877 815 * Raw byte wise transfer from a buffer surface into another surface 878 816 * of the requested box. Supported if SVGA3D_DEVCAP_DXCONTEXT is set. ··· 1017 905 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset; 1018 906 /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */ 1019 907 908 + typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetHSConstantBufferOffset; 909 + /* SVGA_3D_CMD_DX_SET_HS_CONSTANT_BUFFER_OFFSET */ 910 + 911 + typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetDSConstantBufferOffset; 912 + /* SVGA_3D_CMD_DX_SET_DS_CONSTANT_BUFFER_OFFSET */ 913 + 914 + typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetCSConstantBufferOffset; 915 + /* SVGA_3D_CMD_DX_SET_CS_CONSTANT_BUFFER_OFFSET */ 916 + 917 + 918 + #define SVGA3D_BUFFEREX_SRV_RAW (1 << 0) 919 + #define SVGA3D_BUFFEREX_SRV_FLAGS_MAX (1 << 1) 920 + #define SVGA3D_BUFFEREX_SRV_FLAGS_MASK (SVGA3D_BUFFEREX_SRV_FLAGS_MAX - 1) 921 + typedef uint32 SVGA3dBufferExFlags; 1020 922 1021 923 typedef 1022 924 #include "vmware_pack_begin.h" ··· 1051 925 struct { 1052 926 uint32 firstElement; 1053 927 uint32 numElements; 1054 - uint32 flags; 928 + SVGA3dBufferExFlags flags; 1055 929 uint32 pad0; 1056 930 } bufferex; 1057 931 }; ··· 1198 1072 SVGA3dCmdDXDefineDepthStencilView; 1199 1073 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */ 1200 1074 1075 + /* 1076 + * Version 2 needed in order to start validating and using the flags 1077 + * field. Unfortunately the device wasn't validating or using the 1078 + * flags field and the driver wasn't initializing it in shipped code, 1079 + * so a new version of the command is needed to allow that code to 1080 + * continue to work. 1081 + */ 1082 + typedef 1083 + #include "vmware_pack_begin.h" 1084 + struct SVGA3dCmdDXDefineDepthStencilView_v2 { 1085 + SVGA3dDepthStencilViewId depthStencilViewId; 1086 + 1087 + SVGA3dSurfaceId sid; 1088 + SVGA3dSurfaceFormat format; 1089 + SVGA3dResourceType resourceDimension; 1090 + uint32 mipSlice; 1091 + uint32 firstArraySlice; 1092 + uint32 arraySize; 1093 + SVGA3DCreateDSViewFlags flags; 1094 + uint8 pad0; 1095 + uint16 pad1; 1096 + } 1097 + #include "vmware_pack_end.h" 1098 + SVGA3dCmdDXDefineDepthStencilView_v2; 1099 + /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW_V2 */ 1100 + 1201 1101 typedef 1202 1102 #include "vmware_pack_begin.h" 1203 1103 struct SVGA3dCmdDXDestroyDepthStencilView { ··· 1232 1080 #include "vmware_pack_end.h" 1233 1081 SVGA3dCmdDXDestroyDepthStencilView; 1234 1082 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */ 1083 + 1084 + 1085 + #define SVGA3D_UABUFFER_RAW (1 << 0) 1086 + #define SVGA3D_UABUFFER_APPEND (1 << 1) 1087 + #define SVGA3D_UABUFFER_COUNTER (1 << 2) 1088 + typedef uint32 SVGA3dUABufferFlags; 1089 + 1090 + typedef 1091 + #include "vmware_pack_begin.h" 1092 + struct { 1093 + union { 1094 + struct { 1095 + uint32 firstElement; 1096 + uint32 numElements; 1097 + SVGA3dUABufferFlags flags; 1098 + uint32 padding0; 1099 + uint32 padding1; 1100 + } buffer; 1101 + struct { 1102 + uint32 mipSlice; 1103 + uint32 firstArraySlice; 1104 + uint32 arraySize; 1105 + uint32 padding0; 1106 + uint32 padding1; 1107 + } tex; /* 1d, 2d */ 1108 + struct { 1109 + uint32 mipSlice; 1110 + uint32 firstW; 1111 + uint32 wSize; 1112 + uint32 padding0; 1113 + uint32 padding1; 1114 + } tex3D; 1115 + }; 1116 + } 1117 + #include "vmware_pack_end.h" 1118 + SVGA3dUAViewDesc; 1119 + 1120 + typedef 1121 + #include "vmware_pack_begin.h" 1122 + struct { 1123 + SVGA3dSurfaceId sid; 1124 + SVGA3dSurfaceFormat format; 1125 + SVGA3dResourceType resourceDimension; 1126 + SVGA3dUAViewDesc desc; 1127 + uint32 structureCount; 1128 + uint32 pad[7]; 1129 + } 1130 + #include "vmware_pack_end.h" 1131 + SVGACOTableDXUAViewEntry; 1132 + 1133 + typedef 1134 + #include "vmware_pack_begin.h" 1135 + struct SVGA3dCmdDXDefineUAView { 1136 + SVGA3dUAViewId uaViewId; 1137 + 1138 + SVGA3dSurfaceId sid; 1139 + SVGA3dSurfaceFormat format; 1140 + SVGA3dResourceType resourceDimension; 1141 + 1142 + SVGA3dUAViewDesc desc; 1143 + } 1144 + #include "vmware_pack_end.h" 1145 + SVGA3dCmdDXDefineUAView; 1146 + /* SVGA_3D_CMD_DX_DEFINE_UA_VIEW */ 1147 + 1148 + typedef 1149 + #include "vmware_pack_begin.h" 1150 + struct SVGA3dCmdDXDestroyUAView { 1151 + SVGA3dUAViewId uaViewId; 1152 + } 1153 + #include "vmware_pack_end.h" 1154 + SVGA3dCmdDXDestroyUAView; 1155 + /* SVGA_3D_CMD_DX_DESTROY_UA_VIEW */ 1156 + 1157 + typedef 1158 + #include "vmware_pack_begin.h" 1159 + struct SVGA3dCmdDXClearUAViewUint { 1160 + SVGA3dUAViewId uaViewId; 1161 + SVGA3dRGBAUint32 value; 1162 + } 1163 + #include "vmware_pack_end.h" 1164 + SVGA3dCmdDXClearUAViewUint; 1165 + /* SVGA_3D_CMD_DX_CLEAR_UA_VIEW_UINT */ 1166 + 1167 + typedef 1168 + #include "vmware_pack_begin.h" 1169 + struct SVGA3dCmdDXClearUAViewFloat { 1170 + SVGA3dUAViewId uaViewId; 1171 + SVGA3dRGBAFloat value; 1172 + } 1173 + #include "vmware_pack_end.h" 1174 + SVGA3dCmdDXClearUAViewFloat; 1175 + /* SVGA_3D_CMD_DX_CLEAR_UA_VIEW_FLOAT */ 1176 + 1177 + typedef 1178 + #include "vmware_pack_begin.h" 1179 + struct SVGA3dCmdDXCopyStructureCount { 1180 + SVGA3dUAViewId srcUAViewId; 1181 + SVGA3dSurfaceId destSid; 1182 + uint32 destByteOffset; 1183 + } 1184 + #include "vmware_pack_end.h" 1185 + SVGA3dCmdDXCopyStructureCount; 1186 + /* SVGA_3D_CMD_DX_COPY_STRUCTURE_COUNT */ 1187 + 1188 + typedef 1189 + #include "vmware_pack_begin.h" 1190 + struct SVGA3dCmdDXSetStructureCount { 1191 + SVGA3dUAViewId uaViewId; 1192 + uint32 structureCount; 1193 + } 1194 + #include "vmware_pack_end.h" 1195 + SVGA3dCmdDXSetStructureCount; 1196 + /* SVGA_3D_CMD_DX_SET_STRUCTURE_COUNT */ 1197 + 1198 + typedef 1199 + #include "vmware_pack_begin.h" 1200 + struct SVGA3dCmdDXSetUAViews { 1201 + uint32 uavSpliceIndex; 1202 + /* Followed by a variable number of SVGA3dUAViewId's. */ 1203 + } 1204 + #include "vmware_pack_end.h" 1205 + SVGA3dCmdDXSetUAViews; /* SVGA_3D_CMD_DX_SET_UA_VIEWS */ 1206 + 1207 + typedef 1208 + #include "vmware_pack_begin.h" 1209 + struct SVGA3dCmdDXSetCSUAViews { 1210 + uint32 startIndex; 1211 + /* Followed by a variable number of SVGA3dUAViewId's. */ 1212 + } 1213 + #include "vmware_pack_end.h" 1214 + SVGA3dCmdDXSetCSUAViews; /* SVGA_3D_CMD_DX_SET_CS_UA_VIEWS */ 1235 1215 1236 1216 typedef 1237 1217 #include "vmware_pack_begin.h" ··· 1383 1099 struct { 1384 1100 uint32 elid; 1385 1101 uint32 numDescs; 1386 - SVGA3dInputElementDesc desc[32]; 1102 + SVGA3dInputElementDesc descs[32]; 1387 1103 uint32 pad[62]; 1388 1104 } 1389 1105 #include "vmware_pack_end.h" ··· 1545 1261 uint8 lineStippleEnable; 1546 1262 uint8 lineStippleFactor; 1547 1263 uint16 lineStipplePattern; 1548 - uint32 forcedSampleCount; 1264 + uint8 forcedSampleCount; 1265 + uint8 mustBeZero[3]; 1549 1266 } 1550 1267 #include "vmware_pack_end.h" 1551 1268 SVGACOTableDXRasterizerStateEntry; ··· 1637 1352 #include "vmware_pack_end.h" 1638 1353 SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */ 1639 1354 1355 + 1356 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED 0 1357 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_POSITION 1 1358 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_CLIP_DISTANCE 2 1359 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_CULL_DISTANCE 3 1360 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_RENDER_TARGET_ARRAY_INDEX 4 1361 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_VIEWPORT_ARRAY_INDEX 5 1362 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_VERTEX_ID 6 1363 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_PRIMITIVE_ID 7 1364 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_INSTANCE_ID 8 1365 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_IS_FRONT_FACE 9 1366 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_SAMPLE_INDEX 10 1367 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR 11 1368 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR 12 1369 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR 13 1370 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR 14 1371 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR 15 1372 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR 16 1373 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR 17 1374 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR 18 1375 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR 19 1376 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_INSIDE_TESSFACTOR 20 1377 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DETAIL_TESSFACTOR 21 1378 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DENSITY_TESSFACTOR 22 1379 + #define SVGADX_SIGNATURE_SEMANTIC_NAME_MAX 23 1380 + typedef uint32 SVGA3dDXSignatureSemanticName; 1381 + 1382 + #define SVGADX_SIGNATURE_REGISTER_COMPONENT_UNKNOWN 0 1383 + typedef uint32 SVGA3dDXSignatureRegisterComponentType; 1384 + 1385 + #define SVGADX_SIGNATURE_MIN_PRECISION_DEFAULT 0 1386 + typedef uint32 SVGA3dDXSignatureMinPrecision; 1387 + 1388 + typedef 1389 + #include "vmware_pack_begin.h" 1390 + struct SVGA3dDXSignatureEntry { 1391 + uint32 registerIndex; 1392 + SVGA3dDXSignatureSemanticName semanticName; 1393 + uint32 mask; /* Lower 4 bits represent X, Y, Z, W channels */ 1394 + SVGA3dDXSignatureRegisterComponentType componentType; 1395 + SVGA3dDXSignatureMinPrecision minPrecision; 1396 + } 1397 + #include "vmware_pack_end.h" 1398 + SVGA3dDXShaderSignatureEntry; 1399 + 1400 + #define SVGADX_SIGNATURE_HEADER_VERSION_0 0x08a92d12 1401 + 1402 + /* 1403 + * The SVGA3dDXSignatureHeader structure is added after the shader 1404 + * body in the mob that is bound to the shader. It is followed by the 1405 + * specified number of SVGA3dDXSignatureEntry structures for each of 1406 + * the three types of signatures in the order (input, output, patch 1407 + * constants). 1408 + */ 1409 + typedef 1410 + #include "vmware_pack_begin.h" 1411 + struct SVGA3dDXSignatureHeader { 1412 + uint32 headerVersion; 1413 + uint32 numInputSignatures; 1414 + uint32 numOutputSignatures; 1415 + uint32 numPatchConstantSignatures; 1416 + } 1417 + #include "vmware_pack_end.h" 1418 + SVGA3dDXShaderSignatureHeader; 1419 + 1640 1420 typedef 1641 1421 #include "vmware_pack_begin.h" 1642 1422 struct SVGA3dCmdDXDefineShader { ··· 1765 1415 /* 1766 1416 * The maximum number of streamout decl's in each streamout entry. 1767 1417 */ 1768 - #define SVGA3D_MAX_STREAMOUT_DECLS 64 1418 + #define SVGA3D_MAX_DX10_STREAMOUT_DECLS 64 1419 + #define SVGA3D_MAX_STREAMOUT_DECLS 512 1769 1420 1770 1421 typedef 1771 1422 #include "vmware_pack_begin.h" ··· 1785 1434 #include "vmware_pack_begin.h" 1786 1435 struct SVGAOTableStreamOutputEntry { 1787 1436 uint32 numOutputStreamEntries; 1788 - SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS]; 1437 + SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS]; 1789 1438 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS]; 1790 1439 uint32 rasterizedStream; 1791 - uint32 pad[250]; 1440 + uint32 numOutputStreamStrides; 1441 + uint32 mobid; 1442 + uint32 offsetInBytes; 1443 + uint8 usesMob; 1444 + uint8 pad0; 1445 + uint16 pad1; 1446 + uint32 pad2[246]; 1792 1447 } 1793 1448 #include "vmware_pack_end.h" 1794 1449 SVGACOTableDXStreamOutputEntry; ··· 1804 1447 struct SVGA3dCmdDXDefineStreamOutput { 1805 1448 SVGA3dStreamOutputId soid; 1806 1449 uint32 numOutputStreamEntries; 1807 - SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS]; 1450 + SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS]; 1808 1451 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS]; 1809 1452 uint32 rasterizedStream; 1810 1453 } 1811 1454 #include "vmware_pack_end.h" 1812 1455 SVGA3dCmdDXDefineStreamOutput; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */ 1456 + 1457 + /* 1458 + * Version 2 needed in order to start validating and using the 1459 + * rasterizedStream field. Unfortunately the device wasn't validating 1460 + * or using this field and the driver wasn't initializing it in shipped 1461 + * code, so a new version of the command is needed to allow that code 1462 + * to continue to work. Also added new numOutputStreamStrides field. 1463 + */ 1464 + 1465 + #define SVGA3D_DX_SO_NO_RASTERIZED_STREAM 0xFFFFFFFF 1466 + 1467 + typedef 1468 + #include "vmware_pack_begin.h" 1469 + struct SVGA3dCmdDXDefineStreamOutputWithMob { 1470 + SVGA3dStreamOutputId soid; 1471 + uint32 numOutputStreamEntries; 1472 + uint32 numOutputStreamStrides; 1473 + uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS]; 1474 + uint32 rasterizedStream; 1475 + } 1476 + #include "vmware_pack_end.h" 1477 + SVGA3dCmdDXDefineStreamOutputWithMob; 1478 + /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT_WITH_MOB */ 1479 + 1480 + typedef 1481 + #include "vmware_pack_begin.h" 1482 + struct SVGA3dCmdDXBindStreamOutput { 1483 + SVGA3dStreamOutputId soid; 1484 + uint32 mobid; 1485 + uint32 offsetInBytes; 1486 + uint32 sizeInBytes; 1487 + } 1488 + #include "vmware_pack_end.h" 1489 + SVGA3dCmdDXBindStreamOutput; /* SVGA_3D_CMD_DX_BIND_STREAMOUTPUT */ 1813 1490 1814 1491 typedef 1815 1492 #include "vmware_pack_begin.h" ··· 1860 1469 } 1861 1470 #include "vmware_pack_end.h" 1862 1471 SVGA3dCmdDXSetStreamOutput; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */ 1472 + 1473 + typedef 1474 + #include "vmware_pack_begin.h" 1475 + struct SVGA3dCmdDXSetMinLOD { 1476 + SVGA3dSurfaceId sid; 1477 + float minLOD; 1478 + } 1479 + #include "vmware_pack_end.h" 1480 + SVGA3dCmdDXSetMinLOD; /* SVGA_3D_CMD_DX_SET_MIN_LOD */ 1863 1481 1864 1482 typedef 1865 1483 #include "vmware_pack_begin.h" ··· 1981 1581 uint32 rasterizerStateId; 1982 1582 uint32 depthStencilViewId; 1983 1583 uint32 renderTargetViewIds[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS]; 1984 - uint32 unorderedAccessViewIds[SVGA3D_MAX_UAVIEWS]; 1985 1584 } renderState; 1585 + 1586 + uint32 pad0[8]; 1986 1587 1987 1588 struct { 1988 1589 uint32 targets[SVGA3D_DX_MAX_SOTARGETS]; 1989 1590 uint32 soid; 1990 1591 } streamOut; 1991 - uint32 pad0[11]; 1592 + 1593 + uint32 pad1[10]; 1594 + 1595 + uint32 uavSpliceIndex; 1992 1596 1993 1597 uint8 numViewports; 1994 1598 uint8 numScissorRects; 1995 - uint16 pad1[1]; 1599 + uint16 pad2[1]; 1996 1600 1997 - uint32 pad2[3]; 1601 + uint32 pad3[3]; 1998 1602 1999 1603 SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS]; 2000 - uint32 pad3[32]; 1604 + uint32 pad4[32]; 2001 1605 2002 1606 SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS]; 2003 - uint32 pad4[64]; 1607 + uint32 pad5[64]; 2004 1608 2005 1609 struct { 2006 1610 uint32 queryID; 2007 1611 uint32 value; 2008 1612 } predication; 2009 - uint32 pad5[2]; 2010 1613 1614 + SVGAMobId shaderIfaceMobid; 1615 + uint32 shaderIfaceOffset; 2011 1616 struct { 2012 1617 uint32 shaderId; 2013 1618 SVGA3dConstantBufferBinding constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS]; ··· 2024 1619 SVGA3dQueryId queryID[SVGA3D_MAX_QUERY]; 2025 1620 2026 1621 SVGA3dCOTableData cotables[SVGA_COTABLE_MAX]; 2027 - uint32 pad7[380]; 1622 + 1623 + uint32 pad7[64]; 1624 + 1625 + uint32 uaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS]; 1626 + uint32 csuaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS]; 1627 + 1628 + uint32 pad8[188]; 2028 1629 } 2029 1630 #include "vmware_pack_end.h" 2030 1631 SVGADXContextMobFormat; 1632 + 1633 + /* 1634 + * There is conflicting documentation on max class instances (253 vs 256). The 1635 + * lower value is the one used throughout the device, but since mob format is 1636 + * more involved to increase if needed, conservatively use the higher one here. 1637 + */ 1638 + #define SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED 256 1639 + 1640 + typedef 1641 + #include "vmware_pack_begin.h" 1642 + struct SVGADXShaderIfaceMobFormat { 1643 + struct { 1644 + uint32 numClassInstances; 1645 + uint32 iface[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED]; 1646 + SVGA3dIfaceData data[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED]; 1647 + } shaderIfaceState[SVGA3D_NUM_SHADERTYPE]; 1648 + 1649 + uint32 pad0[1018]; 1650 + } 1651 + #include "vmware_pack_end.h" 1652 + SVGADXShaderIfaceMobFormat; 2031 1653 2032 1654 typedef 2033 1655 #include "vmware_pack_begin.h"
+32 -4
drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 2 /********************************************************** 3 - * Copyright 2007-2015 VMware, Inc. 3 + * Copyright 2007-2019 VMware, Inc. 4 4 * 5 5 * Permission is hereby granted, free of charge, to any person 6 6 * obtaining a copy of this software and associated documentation ··· 40 40 #include "includeCheck.h" 41 41 42 42 #define SVGA3D_NUM_CLIPPLANES 6 43 + #define SVGA3D_MAX_CONTEXT_IDS 256 44 + #define SVGA3D_MAX_SURFACE_IDS (32 * 1024) 45 + 46 + /* 47 + * While there are separate bind-points for RenderTargetViews and 48 + * UnorderedAccessViews in a DXContext, there is in fact one shared 49 + * semantic space that the guest-driver can use on any given draw call. 50 + * So there are really only 8 slots that can be spilt up between them, with the 51 + * spliceIndex controlling where the UAV's sit in the collapsed array. 52 + */ 43 53 #define SVGA3D_MAX_RENDER_TARGETS 8 44 54 #define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS (SVGA3D_MAX_RENDER_TARGETS) 45 55 #define SVGA3D_MAX_UAVIEWS 8 46 - #define SVGA3D_MAX_CONTEXT_IDS 256 47 - #define SVGA3D_MAX_SURFACE_IDS (32 * 1024) 56 + #define SVGA3D_DX11_1_MAX_UAVIEWS 64 57 + 58 + /* 59 + * Maximum canonical size of a surface in host-backed mode (pre-GBObjects). 60 + */ 61 + #define SVGA3D_HB_MAX_SURFACE_SIZE MBYTES_2_BYTES(128) 48 62 49 63 /* 50 64 * Maximum ID a shader can be assigned on a given context. ··· 73 59 #define SVGA3D_NUM_TEXTURE_UNITS 32 74 60 #define SVGA3D_NUM_LIGHTS 8 75 61 62 + #define SVGA3D_MAX_VIDEOPROCESSOR_SAMPLERS 32 63 + 76 64 /* 77 65 * Maximum size in dwords of shader text the SVGA device will allow. 78 66 * Currently 8 MB. ··· 82 66 #define SVGA3D_MAX_SHADER_MEMORY_BYTES (8 * 1024 * 1024) 83 67 #define SVGA3D_MAX_SHADER_MEMORY (SVGA3D_MAX_SHADER_MEMORY_BYTES / \ 84 68 sizeof(uint32)) 69 + 70 + /* 71 + * The maximum value of threadGroupCount in each dimension 72 + */ 73 + #define SVGA3D_MAX_SHADER_THREAD_GROUPS 65535 85 74 86 75 #define SVGA3D_MAX_CLIP_PLANES 6 87 76 ··· 106 85 /* 107 86 * Maximum number of array indexes in a GB surface (with DX enabled). 108 87 */ 109 - #define SVGA3D_MAX_SURFACE_ARRAYSIZE 512 88 + #define SVGA3D_SM4_MAX_SURFACE_ARRAYSIZE 512 89 + #define SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE 2048 90 + #define SVGA3D_MAX_SURFACE_ARRAYSIZE SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE 110 91 111 92 /* 112 93 * The maximum number of vertex arrays we're guaranteed to support in ··· 121 98 * in SVGA_3D_CMD_DRAWPRIMITIVES. 122 99 */ 123 100 #define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32 101 + 102 + /* 103 + * The maximum number of samples that can be contained in a surface. 104 + */ 105 + #define SVGA3D_MAX_SAMPLES 8 124 106 125 107 #endif /* _SVGA3D_LIMITS_H_ */
+56 -2
drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h
··· 131 131 SVGA3DBLOCKDESC_BC3 = 1 << 26, 132 132 SVGA3DBLOCKDESC_BC4 = 1 << 27, 133 133 SVGA3DBLOCKDESC_BC5 = 1 << 28, 134 + SVGA3DBLOCKDESC_BC6H = 1 << 29, 135 + SVGA3DBLOCKDESC_BC7 = 1 << 30, 134 136 135 137 SVGA3DBLOCKDESC_A_UINT = SVGA3DBLOCKDESC_ALPHA | 136 138 SVGA3DBLOCKDESC_UINT | ··· 292 290 SVGA3DBLOCKDESC_COMP_UNORM, 293 291 SVGA3DBLOCKDESC_BC5_COMP_SNORM = SVGA3DBLOCKDESC_BC5 | 294 292 SVGA3DBLOCKDESC_COMP_SNORM, 293 + SVGA3DBLOCKDESC_BC6H_COMP_TYPELESS = SVGA3DBLOCKDESC_BC6H | 294 + SVGA3DBLOCKDESC_COMP_TYPELESS, 295 + SVGA3DBLOCKDESC_BC6H_COMP_UF16 = SVGA3DBLOCKDESC_BC6H | 296 + SVGA3DBLOCKDESC_COMPRESSED, 297 + SVGA3DBLOCKDESC_BC6H_COMP_SF16 = SVGA3DBLOCKDESC_BC6H | 298 + SVGA3DBLOCKDESC_COMPRESSED, 299 + SVGA3DBLOCKDESC_BC7_COMP_TYPELESS = SVGA3DBLOCKDESC_BC7 | 300 + SVGA3DBLOCKDESC_COMP_TYPELESS, 301 + SVGA3DBLOCKDESC_BC7_COMP_UNORM = SVGA3DBLOCKDESC_BC7 | 302 + SVGA3DBLOCKDESC_COMP_UNORM, 303 + SVGA3DBLOCKDESC_BC7_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC7_COMP_UNORM | 304 + SVGA3DBLOCKDESC_SRGB, 295 305 296 306 SVGA3DBLOCKDESC_NV12 = SVGA3DBLOCKDESC_YUV_VIDEO | 297 307 SVGA3DBLOCKDESC_PLANAR_YUV | ··· 508 494 {{8}, {8}, {8}, {0}}, 509 495 {{16}, {8}, {0}, {0}}}, 510 496 511 - {SVGA3D_FORMAT_DEAD1, SVGA3DBLOCKDESC_UVL, 497 + {SVGA3D_FORMAT_DEAD1, SVGA3DBLOCKDESC_NONE, 512 498 {1, 1, 1}, 3, 3, 513 499 {{8}, {8}, {8}, {0}}, 514 500 {{16}, {8}, {0}, {0}}}, ··· 618 604 {{0}, {0}, {48}, {0}}, 619 605 {{0}, {0}, {0}, {0}}}, 620 606 621 - {SVGA3D_AYUV, SVGA3DBLOCKDESC_AYUV, 607 + {SVGA3D_FORMAT_DEAD2, SVGA3DBLOCKDESC_NONE, 622 608 {1, 1, 1}, 4, 4, 623 609 {{8}, {8}, {8}, {8}}, 624 610 {{0}, {8}, {16}, {24}}}, ··· 1117 1103 {4, 4, 1}, 16, 16, 1118 1104 {{0}, {0}, {128}, {0}}, 1119 1105 {{0}, {0}, {0}, {0}}}, 1106 + 1107 + {SVGA3D_B4G4R4A4_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 1108 + {1, 1, 1}, 2, 2, 1109 + {{4}, {4}, {4}, {4}}, 1110 + {{0}, {4}, {8}, {12}}}, 1111 + 1112 + {SVGA3D_BC6H_TYPELESS, SVGA3DBLOCKDESC_BC6H_COMP_TYPELESS, 1113 + {4, 4, 1}, 16, 16, 1114 + {{0}, {0}, {128}, {0}}, 1115 + {{0}, {0}, {0}, {0}}}, 1116 + 1117 + {SVGA3D_BC6H_UF16, SVGA3DBLOCKDESC_BC6H_COMP_UF16, 1118 + {4, 4, 1}, 16, 16, 1119 + {{0}, {0}, {128}, {0}}, 1120 + {{0}, {0}, {0}, {0}}}, 1121 + 1122 + {SVGA3D_BC6H_SF16, SVGA3DBLOCKDESC_BC6H_COMP_SF16, 1123 + {4, 4, 1}, 16, 16, 1124 + {{0}, {0}, {128}, {0}}, 1125 + {{0}, {0}, {0}, {0}}}, 1126 + 1127 + {SVGA3D_BC7_TYPELESS, SVGA3DBLOCKDESC_BC7_COMP_TYPELESS, 1128 + {4, 4, 1}, 16, 16, 1129 + {{0}, {0}, {128}, {0}}, 1130 + {{0}, {0}, {0}, {0}}}, 1131 + 1132 + {SVGA3D_BC7_UNORM, SVGA3DBLOCKDESC_BC7_COMP_UNORM, 1133 + {4, 4, 1}, 16, 16, 1134 + {{0}, {0}, {128}, {0}}, 1135 + {{0}, {0}, {0}, {0}}}, 1136 + 1137 + {SVGA3D_BC7_UNORM_SRGB, SVGA3DBLOCKDESC_BC7_COMP_UNORM_SRGB, 1138 + {4, 4, 1}, 16, 16, 1139 + {{0}, {0}, {128}, {0}}, 1140 + {{0}, {0}, {0}, {0}}}, 1141 + 1142 + {SVGA3D_AYUV, SVGA3DBLOCKDESC_AYUV, 1143 + {1, 1, 1}, 4, 4, 1144 + {{8}, {8}, {8}, {8}}, 1145 + {{0}, {8}, {16}, {24}}}, 1120 1146 }; 1121 1147 1122 1148 static inline u32 clamped_umul32(u32 a, u32 b)
+301 -46
drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h
··· 116 116 typedef 117 117 #include "vmware_pack_begin.h" 118 118 struct { 119 + int32 x; 120 + int32 y; 121 + int32 z; 122 + int32 w; 123 + int32 h; 124 + int32 d; 125 + } 126 + #include "vmware_pack_end.h" 127 + SVGA3dSignedBox; 128 + 129 + typedef 130 + #include "vmware_pack_begin.h" 131 + struct { 119 132 uint32 x; 120 133 uint32 y; 121 134 uint32 z; ··· 211 198 /* Planar video formats */ 212 199 SVGA3D_NV12 = 44, 213 200 214 - /* Video format with alpha */ 215 - SVGA3D_AYUV = 45, 201 + SVGA3D_FORMAT_DEAD2 = 45, 216 202 217 203 SVGA3D_R32G32B32A32_TYPELESS = 46, 218 204 SVGA3D_R32G32B32A32_UINT = 47, ··· 317 305 SVGA3D_B8G8R8X8_UNORM = 142, 318 306 SVGA3D_BC4_UNORM = 143, 319 307 SVGA3D_BC5_UNORM = 144, 308 + SVGA3D_B4G4R4A4_UNORM = 145, 309 + 310 + /* DX11 compressed formats */ 311 + SVGA3D_BC6H_TYPELESS = 146, 312 + SVGA3D_BC6H_UF16 = 147, 313 + SVGA3D_BC6H_SF16 = 148, 314 + SVGA3D_BC7_TYPELESS = 149, 315 + SVGA3D_BC7_UNORM = 150, 316 + SVGA3D_BC7_UNORM_SRGB = 151, 317 + 318 + /* Video format with alpha */ 319 + SVGA3D_AYUV = 152, 320 320 321 321 SVGA3D_FORMAT_MAX 322 322 } SVGA3dSurfaceFormat; ··· 350 326 #define SVGA3D_SURFACE_HINT_RENDERTARGET (CONST64U(1) << 6) 351 327 #define SVGA3D_SURFACE_HINT_DEPTHSTENCIL (CONST64U(1) << 7) 352 328 #define SVGA3D_SURFACE_HINT_WRITEONLY (CONST64U(1) << 8) 353 - #define SVGA3D_SURFACE_MASKABLE_ANTIALIAS (CONST64U(1) << 9) 329 + #define SVGA3D_SURFACE_DEAD2 (CONST64U(1) << 9) 354 330 #define SVGA3D_SURFACE_AUTOGENMIPMAPS (CONST64U(1) << 10) 355 331 356 - #define SVGA3D_SURFACE_DECODE_RENDERTARGET (CONST64U(1) << 11) 332 + #define SVGA3D_SURFACE_DEAD1 (CONST64U(1) << 11) 357 333 358 334 /* 359 335 * Is this surface using a base-level pitch for it's mob backing? ··· 411 387 * Setting this flag allow this surface to be used with the 412 388 * SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER command. It is only valid for 413 389 * buffer surfaces, and no bind flags are allowed to be set on surfaces 414 - * with this flag. 390 + * with this flag except SVGA3D_SURFACE_TRANSFER_TO_BUFFER. 415 391 */ 416 392 #define SVGA3D_SURFACE_TRANSFER_FROM_BUFFER (CONST64U(1) << 30) 417 393 ··· 426 402 */ 427 403 #define SVGA3D_SURFACE_MULTISAMPLE (CONST64U(1) << 32) 428 404 429 - #define SVGA3D_SURFACE_FLAG_MAX (CONST64U(1) << 33) 405 + /* 406 + * Specified that the surface is allowed to be bound to a UAView. 407 + */ 408 + #define SVGA3D_SURFACE_BIND_UAVIEW (CONST64U(1) << 33) 409 + 410 + /* 411 + * Setting this flag allow this surface to be used with the 412 + * SVGA_3D_CMD_DX_TRANSFER_TO_BUFFER command. It is only valid for 413 + * buffer surfaces, and no bind flags are allowed to be set on surfaces 414 + * with this flag except SVGA3D_SURFACE_TRANSFER_FROM_BUFFER. 415 + */ 416 + #define SVGA3D_SURFACE_TRANSFER_TO_BUFFER (CONST64U(1) << 34) 417 + 418 + #define SVGA3D_SURFACE_BIND_LOGICOPS (CONST64U(1) << 35) 419 + 420 + /* 421 + * Optional flags for use with SVGA3D_SURFACE_BIND_UAVIEW 422 + */ 423 + #define SVGA3D_SURFACE_BIND_RAW_VIEWS (CONST64U(1) << 36) 424 + #define SVGA3D_SURFACE_BUFFER_STRUCTURED (CONST64U(1) << 37) 425 + 426 + #define SVGA3D_SURFACE_DRAWINDIRECT_ARGS (CONST64U(1) << 38) 427 + #define SVGA3D_SURFACE_RESOURCE_CLAMP (CONST64U(1) << 39) 428 + 429 + #define SVGA3D_SURFACE_FLAG_MAX (CONST64U(1) << 40) 430 430 431 431 /* 432 432 * Surface flags types: ··· 476 428 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 477 429 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 478 430 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 479 - SVGA3D_SURFACE_MULTISAMPLE \ 431 + SVGA3D_SURFACE_RESERVED1 | \ 432 + SVGA3D_SURFACE_MULTISAMPLE | \ 433 + SVGA3D_SURFACE_BIND_UAVIEW | \ 434 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 435 + SVGA3D_SURFACE_BIND_LOGICOPS | \ 436 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 437 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 438 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 439 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 480 440 ) 481 441 482 442 #define SVGA3D_SURFACE_HB_PRESENT_DISALLOWED_MASK \ 483 443 ( SVGA3D_SURFACE_1D | \ 444 + SVGA3D_SURFACE_RESERVED1 | \ 484 445 SVGA3D_SURFACE_MULTISAMPLE \ 485 446 ) 486 447 487 448 #define SVGA3D_SURFACE_2D_DISALLOWED_MASK \ 488 449 ( SVGA3D_SURFACE_CUBEMAP | \ 489 - SVGA3D_SURFACE_MASKABLE_ANTIALIAS | \ 490 450 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 491 451 SVGA3D_SURFACE_VOLUME | \ 492 452 SVGA3D_SURFACE_1D | \ ··· 504 448 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 505 449 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 506 450 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 507 - SVGA3D_SURFACE_MULTISAMPLE \ 451 + SVGA3D_SURFACE_RESERVED1 | \ 452 + SVGA3D_SURFACE_MULTISAMPLE | \ 453 + SVGA3D_SURFACE_BIND_UAVIEW | \ 454 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 455 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 456 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 457 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 458 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 508 459 ) 509 460 510 461 #define SVGA3D_SURFACE_BASICOPS_DISALLOWED_MASK \ ··· 519 456 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 520 457 SVGA3D_SURFACE_VOLUME | \ 521 458 SVGA3D_SURFACE_1D | \ 459 + SVGA3D_SURFACE_RESERVED1 | \ 522 460 SVGA3D_SURFACE_MULTISAMPLE \ 523 461 ) 524 462 ··· 538 474 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 539 475 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 540 476 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 541 - SVGA3D_SURFACE_MULTISAMPLE \ 477 + SVGA3D_SURFACE_RESERVED1 | \ 478 + SVGA3D_SURFACE_MULTISAMPLE | \ 479 + SVGA3D_SURFACE_BIND_UAVIEW | \ 480 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 481 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 482 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 483 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 484 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 542 485 ) 543 486 544 487 #define SVGA3D_SURFACE_BUFFER_DISALLOWED_MASK \ ··· 553 482 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 554 483 SVGA3D_SURFACE_VOLUME | \ 555 484 SVGA3D_SURFACE_1D | \ 556 - SVGA3D_SURFACE_MASKABLE_ANTIALIAS | \ 485 + SVGA3D_SURFACE_DEAD2 | \ 557 486 SVGA3D_SURFACE_ARRAY | \ 558 487 SVGA3D_SURFACE_MULTISAMPLE | \ 559 - SVGA3D_SURFACE_MOB_PITCH \ 488 + SVGA3D_SURFACE_MOB_PITCH | \ 489 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 560 490 ) 561 491 562 492 #define SVGA3D_SURFACE_MULTISAMPLE_DISALLOWED_MASK \ ··· 566 494 SVGA3D_SURFACE_VOLUME | \ 567 495 SVGA3D_SURFACE_1D | \ 568 496 SVGA3D_SURFACE_SCREENTARGET | \ 569 - SVGA3D_SURFACE_MOB_PITCH \ 497 + SVGA3D_SURFACE_MOB_PITCH | \ 498 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 499 + SVGA3D_SURFACE_RESERVED1 | \ 500 + SVGA3D_SURFACE_BIND_UAVIEW | \ 501 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 502 + SVGA3D_SURFACE_BIND_LOGICOPS | \ 503 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 504 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 505 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS \ 570 506 ) 571 507 572 - #define SVGA3D_SURFACE_DX_ONLY_MASK \ 573 - ( SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 574 - SVGA3D_SURFACE_STAGING_UPLOAD | \ 575 - SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 576 - SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 508 + #define SVGA3D_SURFACE_DX_ONLY_MASK \ 509 + ( SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 510 + SVGA3D_SURFACE_STAGING_UPLOAD | \ 511 + SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 512 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 513 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER \ 577 514 ) 578 515 579 516 #define SVGA3D_SURFACE_STAGING_MASK \ ··· 597 516 SVGA3D_SURFACE_BIND_SHADER_RESOURCE | \ 598 517 SVGA3D_SURFACE_BIND_RENDER_TARGET | \ 599 518 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 600 - SVGA3D_SURFACE_BIND_STREAM_OUTPUT \ 519 + SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 520 + SVGA3D_SURFACE_BIND_UAVIEW | \ 521 + SVGA3D_SURFACE_BIND_LOGICOPS | \ 522 + SVGA3D_SURFACE_BIND_RAW_VIEWS \ 601 523 ) 602 524 525 + #define SVGA3D_SURFACE_VADECODE_DISALLOWED_MASK \ 526 + ( SVGA3D_SURFACE_CUBEMAP | \ 527 + SVGA3D_SURFACE_HINT_STATIC | \ 528 + SVGA3D_SURFACE_HINT_DYNAMIC | \ 529 + SVGA3D_SURFACE_HINT_INDEXBUFFER | \ 530 + SVGA3D_SURFACE_HINT_VERTEXBUFFER | \ 531 + SVGA3D_SURFACE_HINT_TEXTURE | \ 532 + SVGA3D_SURFACE_HINT_RENDERTARGET | \ 533 + SVGA3D_SURFACE_HINT_DEPTHSTENCIL | \ 534 + SVGA3D_SURFACE_HINT_WRITEONLY | \ 535 + SVGA3D_SURFACE_DEAD2 | \ 536 + SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 537 + SVGA3D_SURFACE_HINT_RT_LOCKABLE | \ 538 + SVGA3D_SURFACE_VOLUME | \ 539 + SVGA3D_SURFACE_SCREENTARGET | \ 540 + SVGA3D_SURFACE_1D | \ 541 + SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 542 + SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 543 + SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 544 + SVGA3D_SURFACE_BIND_RENDER_TARGET | \ 545 + SVGA3D_SURFACE_BIND_SHADER_RESOURCE | \ 546 + SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 547 + SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 548 + SVGA3D_SURFACE_INACTIVE | \ 549 + SVGA3D_SURFACE_STAGING_UPLOAD | \ 550 + SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 551 + SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 552 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 553 + SVGA3D_SURFACE_MULTISAMPLE | \ 554 + SVGA3D_SURFACE_BIND_UAVIEW | \ 555 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 556 + SVGA3D_SURFACE_BIND_LOGICOPS | \ 557 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 558 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 559 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 560 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 561 + ) 562 + 563 + #define SVGA3D_SURFACE_VAPROCESSFRAME_OUTPUT_DISALLOWED_MASK \ 564 + ( SVGA3D_SURFACE_HINT_INDEXBUFFER | \ 565 + SVGA3D_SURFACE_HINT_VERTEXBUFFER | \ 566 + SVGA3D_SURFACE_HINT_DEPTHSTENCIL | \ 567 + SVGA3D_SURFACE_DEAD2 | \ 568 + SVGA3D_SURFACE_VOLUME | \ 569 + SVGA3D_SURFACE_1D | \ 570 + SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 571 + SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 572 + SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 573 + SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 574 + SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 575 + SVGA3D_SURFACE_INACTIVE | \ 576 + SVGA3D_SURFACE_STAGING_UPLOAD | \ 577 + SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 578 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 579 + SVGA3D_SURFACE_VADECODE | \ 580 + SVGA3D_SURFACE_MULTISAMPLE | \ 581 + SVGA3D_SURFACE_BIND_UAVIEW | \ 582 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 583 + SVGA3D_SURFACE_BIND_LOGICOPS | \ 584 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 585 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 586 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 587 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 588 + ) 589 + 590 + #define SVGA3D_SURFACE_VAPROCESSFRAME_INPUT_DISALLOWED_MASK \ 591 + ( SVGA3D_SURFACE_CUBEMAP | \ 592 + SVGA3D_SURFACE_HINT_INDEXBUFFER | \ 593 + SVGA3D_SURFACE_HINT_VERTEXBUFFER | \ 594 + SVGA3D_SURFACE_HINT_DEPTHSTENCIL | \ 595 + SVGA3D_SURFACE_DEAD2 | \ 596 + SVGA3D_SURFACE_VOLUME | \ 597 + SVGA3D_SURFACE_SCREENTARGET | \ 598 + SVGA3D_SURFACE_1D | \ 599 + SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 600 + SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 601 + SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 602 + SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 603 + SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 604 + SVGA3D_SURFACE_STAGING_UPLOAD | \ 605 + SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 606 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 607 + SVGA3D_SURFACE_MULTISAMPLE | \ 608 + SVGA3D_SURFACE_BIND_UAVIEW | \ 609 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 610 + SVGA3D_SURFACE_BIND_LOGICOPS | \ 611 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 612 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 613 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 614 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 615 + ) 616 + 617 + #define SVGA3D_SURFACE_LOGICOPS_DISALLOWED_MASK \ 618 + ( SVGA3D_SURFACE_CUBEMAP | \ 619 + SVGA3D_SURFACE_DEAD2 | \ 620 + SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 621 + SVGA3D_SURFACE_VOLUME | \ 622 + SVGA3D_SURFACE_1D | \ 623 + SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 624 + SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 625 + SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 626 + SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 627 + SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 628 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 629 + SVGA3D_SURFACE_VADECODE | \ 630 + SVGA3D_SURFACE_MULTISAMPLE | \ 631 + SVGA3D_SURFACE_BIND_UAVIEW | \ 632 + SVGA3D_SURFACE_TRANSFER_TO_BUFFER | \ 633 + SVGA3D_SURFACE_BIND_RAW_VIEWS | \ 634 + SVGA3D_SURFACE_BUFFER_STRUCTURED | \ 635 + SVGA3D_SURFACE_DRAWINDIRECT_ARGS | \ 636 + SVGA3D_SURFACE_RESOURCE_CLAMP \ 637 + ) 638 + 639 + #define SVGA3D_BUFFER_STRUCTURED_STRIDE_MAX 2048 640 + 641 + 642 + /* 643 + * These are really the D3DFORMAT_OP defines from the wdk. We need 644 + * them so that we can query the host for what the supported surface 645 + * operations are (when we're using the D3D backend, in particular), 646 + * and so we can send those operations to the guest. 647 + */ 603 648 typedef enum { 604 649 SVGA3DFORMAT_OP_TEXTURE = 0x00000001, 605 650 SVGA3DFORMAT_OP_VOLUMETEXTURE = 0x00000002, ··· 1545 1338 SVGA3D_PRIMITIVE_LINESTRIP_ADJ = 8, 1546 1339 SVGA3D_PRIMITIVE_TRIANGLELIST_ADJ = 9, 1547 1340 SVGA3D_PRIMITIVE_TRIANGLESTRIP_ADJ = 10, 1548 - SVGA3D_PRIMITIVE_MAX 1341 + SVGA3D_PRIMITIVE_DX10_MAX = 11, 1342 + SVGA3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 11, 1343 + SVGA3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 12, 1344 + SVGA3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 13, 1345 + SVGA3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 14, 1346 + SVGA3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 15, 1347 + SVGA3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 16, 1348 + SVGA3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 17, 1349 + SVGA3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 18, 1350 + SVGA3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 19, 1351 + SVGA3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 20, 1352 + SVGA3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 21, 1353 + SVGA3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 22, 1354 + SVGA3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 23, 1355 + SVGA3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 24, 1356 + SVGA3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 25, 1357 + SVGA3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 26, 1358 + SVGA3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 27, 1359 + SVGA3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 28, 1360 + SVGA3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 29, 1361 + SVGA3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 30, 1362 + SVGA3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 31, 1363 + SVGA3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 32, 1364 + SVGA3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 33, 1365 + SVGA3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 34, 1366 + SVGA3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 35, 1367 + SVGA3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 36, 1368 + SVGA3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 37, 1369 + SVGA3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 38, 1370 + SVGA3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 39, 1371 + SVGA3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 40, 1372 + SVGA3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 41, 1373 + SVGA3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 42, 1374 + SVGA3D_PRIMITIVE_MAX = 43 1549 1375 } SVGA3dPrimitiveType; 1550 1376 1551 1377 typedef enum { ··· 1682 1442 SVGA3D_QUERYTYPE_STREAMOUTPUTSTATS = 5, 1683 1443 SVGA3D_QUERYTYPE_STREAMOVERFLOWPREDICATE = 6, 1684 1444 SVGA3D_QUERYTYPE_OCCLUSION64 = 7, 1685 - SVGA3D_QUERYTYPE_EVENT = 8, 1686 - SVGA3D_QUERYTYPE_DX10_MAX = 9, 1687 - SVGA3D_QUERYTYPE_SOSTATS_STREAM0 = 9, 1688 - SVGA3D_QUERYTYPE_SOSTATS_STREAM1 = 10, 1689 - SVGA3D_QUERYTYPE_SOSTATS_STREAM2 = 11, 1690 - SVGA3D_QUERYTYPE_SOSTATS_STREAM3 = 12, 1691 - SVGA3D_QUERYTYPE_SOP_STREAM0 = 13, 1692 - SVGA3D_QUERYTYPE_SOP_STREAM1 = 14, 1693 - SVGA3D_QUERYTYPE_SOP_STREAM2 = 15, 1694 - SVGA3D_QUERYTYPE_SOP_STREAM3 = 16, 1445 + SVGA3D_QUERYTYPE_DX10_MAX = 8, 1446 + SVGA3D_QUERYTYPE_SOSTATS_STREAM0 = 8, 1447 + SVGA3D_QUERYTYPE_SOSTATS_STREAM1 = 9, 1448 + SVGA3D_QUERYTYPE_SOSTATS_STREAM2 = 10, 1449 + SVGA3D_QUERYTYPE_SOSTATS_STREAM3 = 11, 1450 + SVGA3D_QUERYTYPE_SOP_STREAM0 = 12, 1451 + SVGA3D_QUERYTYPE_SOP_STREAM1 = 13, 1452 + SVGA3D_QUERYTYPE_SOP_STREAM2 = 14, 1453 + SVGA3D_QUERYTYPE_SOP_STREAM3 = 15, 1695 1454 SVGA3D_QUERYTYPE_MAX 1696 1455 } SVGA3dQueryType; 1697 1456 ··· 1823 1584 SVGA3D_READ_HOST_VRAM = 2, 1824 1585 } SVGA3dTransferType; 1825 1586 1826 - typedef enum { 1827 - SVGA3D_LOGICOP_INVALID = 0, 1828 - SVGA3D_LOGICOP_MIN = 1, 1829 - SVGA3D_LOGICOP_COPY = 1, 1830 - SVGA3D_LOGICOP_NOT = 2, 1831 - SVGA3D_LOGICOP_AND = 3, 1832 - SVGA3D_LOGICOP_OR = 4, 1833 - SVGA3D_LOGICOP_XOR = 5, 1834 - SVGA3D_LOGICOP_NXOR = 6, 1835 - SVGA3D_LOGICOP_ROP3MIN = 30, /* 7-29 are reserved for future logic ops. */ 1836 - SVGA3D_LOGICOP_ROP3MAX = (SVGA3D_LOGICOP_ROP3MIN + 255), 1837 - SVGA3D_LOGICOP_MAX = (SVGA3D_LOGICOP_ROP3MAX + 1), 1838 - } SVGA3dLogicOp; 1587 + #define SVGA3D_LOGICOP_INVALID 0 1588 + #define SVGA3D_LOGICOP_MIN 1 1589 + #define SVGA3D_LOGICOP_COPY 1 1590 + #define SVGA3D_LOGICOP_NOT 2 1591 + #define SVGA3D_LOGICOP_AND 3 1592 + #define SVGA3D_LOGICOP_OR 4 1593 + #define SVGA3D_LOGICOP_XOR 5 1594 + #define SVGA3D_LOGICOP_NXOR 6 1595 + #define SVGA3D_LOGICOP_ROP3 7 1596 + #define SVGA3D_LOGICOP_MAX 8 1597 + 1598 + typedef uint16 SVGA3dLogicOp; 1599 + 1600 + #define SVGA3D_LOGICOP_ROP3_INVALID ((uint16) -1) 1601 + #define SVGA3D_LOGICOP_ROP3_MIN 0 1602 + #define SVGA3D_LOGICOP_ROP3_MAX 256 1603 + 1604 + typedef uint16 SVGA3dLogicOpRop3; 1839 1605 1840 1606 typedef 1841 1607 #include "vmware_pack_begin.h" 1842 1608 struct { 1843 1609 union { 1844 1610 struct { 1845 - uint16 function; /* SVGA3dFogFunction */ 1846 - uint8 type; /* SVGA3dFogType */ 1847 - uint8 base; /* SVGA3dFogBase */ 1611 + uint16 function; // SVGA3dFogFunction 1612 + uint8 type; // SVGA3dFogType 1613 + uint8 base; // SVGA3dFogBase 1848 1614 }; 1849 1615 uint32 uintValue; 1850 1616 }; ··· 1985 1741 SVGA3D_MS_QUALITY_FULL = 1, 1986 1742 SVGA3D_MS_QUALITY_MAX = 2, 1987 1743 } SVGA3dMSQualityLevel; 1744 + 1745 + /* 1746 + * Screen Target Update Flags 1747 + */ 1748 + 1749 + typedef enum SVGA3dFrameUpdateType { 1750 + SVGA3D_FRAME_END = 0, 1751 + SVGA3D_FRAME_PARTIAL = 1, 1752 + SVGA3D_FRAME_UNKNOWN = 2, 1753 + SVGA3D_FRAME_MAX = 3, 1754 + } SVGA3dFrameUpdateType; 1988 1755 1989 1756 #endif /* _SVGA3D_TYPES_H_ */
+276 -100
drivers/gpu/drm/vmwgfx/device_include/svga_reg.h
··· 70 70 71 71 /* 72 72 * Legal values for the SVGA_REG_CURSOR_ON register in old-fashioned 73 - * cursor bypass mode. This is still supported, but no new guest 74 - * drivers should use it. 73 + * cursor bypass mode. 75 74 */ 76 75 #define SVGA_CURSOR_ON_HIDE 0x0 77 76 #define SVGA_CURSOR_ON_SHOW 0x1 ··· 136 137 #define SVGA_IRQFLAG_ERROR 0x10 /* Error while processing commands */ 137 138 138 139 /* 140 + * The byte-size is the size of the actual cursor data, 141 + * possibly after expanding it to the current bit depth. 142 + * 143 + * 40K is sufficient memory for two 32-bit planes for a 64 x 64 cursor. 144 + * 145 + * The dimension limit is a bound on the maximum width or height. 146 + */ 147 + #define SVGA_MAX_CURSOR_CMD_BYTES (40 * 1024) 148 + #define SVGA_MAX_CURSOR_CMD_DIMENSION 1024 149 + 150 + /* 139 151 * Registers 140 152 */ 141 153 ··· 179 169 SVGA_REG_SYNC = 21, /* See "FIFO Synchronization Registers" */ 180 170 SVGA_REG_BUSY = 22, /* See "FIFO Synchronization Registers" */ 181 171 SVGA_REG_GUEST_ID = 23, /* (Deprecated) */ 182 - SVGA_REG_CURSOR_ID = 24, /* (Deprecated) */ 172 + SVGA_REG_DEAD = 24, /* Drivers should never write this. */ 183 173 SVGA_REG_CURSOR_X = 25, /* (Deprecated) */ 184 174 SVGA_REG_CURSOR_Y = 26, /* (Deprecated) */ 185 175 SVGA_REG_CURSOR_ON = 27, /* (Deprecated) */ ··· 218 208 SVGA_REG_MAX_PRIMARY_MEM = 50, 219 209 SVGA_REG_MAX_PRIMARY_BOUNDING_BOX_MEM = 50, 220 210 221 - SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB = 51, /* Sugested limit on mob mem */ 211 + /* 212 + * Legacy version of SVGA_REG_GBOBJECT_MEM_SIZE_KB for drivers that 213 + * don't know how to convert to a 64-bit byte value without overflowing. 214 + * (See SVGA_REG_GBOBJECT_MEM_SIZE_KB). 215 + */ 216 + SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB = 51, 217 + 222 218 SVGA_REG_DEV_CAP = 52, /* Write dev cap index, read value */ 223 219 SVGA_REG_CMD_PREPEND_LOW = 53, 224 220 SVGA_REG_CMD_PREPEND_HIGH = 54, ··· 234 218 SVGA_REG_BLANK_SCREEN_TARGETS = 58, 235 219 SVGA_REG_CAP2 = 59, 236 220 SVGA_REG_DEVEL_CAP = 60, 237 - SVGA_REG_TOP = 61, /* Must be 1 more than the last register */ 221 + 222 + /* 223 + * Allow the guest to hint to the device which driver is running. 224 + * 225 + * This should not generally change device behavior, but might be 226 + * convenient to work-around specific bugs in guest drivers. 227 + * 228 + * Drivers should first write their id value into SVGA_REG_GUEST_DRIVER_ID, 229 + * and then fill out all of the version registers that they have defined. 230 + * 231 + * After the driver has written all of the registers, they should 232 + * then write the value SVGA_REG_GUEST_DRIVER_ID_SUBMIT to the 233 + * SVGA_REG_GUEST_DRIVER_ID register, to signal that they have finished. 234 + * 235 + * The SVGA_REG_GUEST_DRIVER_ID values are defined below by the 236 + * SVGARegGuestDriverId enum. 237 + * 238 + * The SVGA_REG_GUEST_DRIVER_VERSION fields are driver-specific, 239 + * but ideally should encode a monotonically increasing number that allows 240 + * the device to perform inequality checks against ranges of driver versions. 241 + */ 242 + SVGA_REG_GUEST_DRIVER_ID = 61, 243 + SVGA_REG_GUEST_DRIVER_VERSION1 = 62, 244 + SVGA_REG_GUEST_DRIVER_VERSION2 = 63, 245 + SVGA_REG_GUEST_DRIVER_VERSION3 = 64, 246 + SVGA_REG_CURSOR_MOBID = 65, 247 + SVGA_REG_CURSOR_MAX_BYTE_SIZE = 66, 248 + SVGA_REG_CURSOR_MAX_DIMENSION = 67, 249 + 250 + SVGA_REG_FIFO_CAPS = 68, 251 + SVGA_REG_FENCE = 69, 252 + 253 + SVGA_REG_RESERVED1 = 70, 254 + SVGA_REG_RESERVED2 = 71, 255 + SVGA_REG_RESERVED3 = 72, 256 + SVGA_REG_RESERVED4 = 73, 257 + SVGA_REG_RESERVED5 = 74, 258 + SVGA_REG_SCREENDMA = 75, 259 + 260 + /* 261 + * The maximum amount of guest-backed objects that the device can have 262 + * resident at a time. Guest-drivers should keep their working set size 263 + * below this limit for best performance. 264 + * 265 + * Note that this value is in kilobytes, and not bytes, because the actual 266 + * number of bytes might be larger than can fit in a 32-bit register. 267 + * 268 + * PLEASE USE A 64-BIT VALUE WHEN CONVERTING THIS INTO BYTES. 269 + * (See SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB). 270 + */ 271 + SVGA_REG_GBOBJECT_MEM_SIZE_KB = 76, 272 + 273 + SVGA_REG_TOP = 77, /* Must be 1 more than the last register */ 238 274 239 275 SVGA_PALETTE_BASE = 1024, /* Base of SVGA color map */ 240 276 /* Next 768 (== 256*3) registers exist for colormap */ ··· 296 228 First 4 are reserved for VESA BIOS Extension; any remaining are for 297 229 the use of the current SVGA driver. */ 298 230 }; 231 + 232 + 233 + /* 234 + * Values for SVGA_REG_GUEST_DRIVER_ID. 235 + */ 236 + typedef enum SVGARegGuestDriverId { 237 + SVGA_REG_GUEST_DRIVER_ID_UNKNOWN = 0, 238 + SVGA_REG_GUEST_DRIVER_ID_WDDM = 1, 239 + SVGA_REG_GUEST_DRIVER_ID_LINUX = 2, 240 + SVGA_REG_GUEST_DRIVER_ID_MAX, 241 + 242 + SVGA_REG_GUEST_DRIVER_ID_SUBMIT = MAX_UINT32, 243 + } SVGARegGuestDriverId; 244 + 299 245 300 246 /* 301 247 * Guest memory regions (GMRs): ··· 498 416 SVGA_CB_CONTEXT_0 = 0x0, 499 417 SVGA_CB_CONTEXT_1 = 0x1, /* Supported with SVGA_CAP_HP_CMD_QUEUE */ 500 418 SVGA_CB_CONTEXT_MAX = 0x2, 501 - SVGA_CB_CONTEXT_HP_MAX = 0x2, 502 419 } SVGACBContext; 503 420 504 421 ··· 814 733 * and must not be reused. Those capabilities will never be reported 815 734 * by new versions of the SVGA device. 816 735 * 817 - * XXX: Add longer descriptions for each capability, including a list 818 - * of the new features that each capability provides. 819 - * 820 736 * SVGA_CAP_IRQMASK -- 821 737 * Provides device interrupts. Adds device register SVGA_REG_IRQMASK 822 738 * to set interrupt mask and direct I/O port SVGA_IRQSTATUS_PORT to ··· 920 842 * Allow the IntraSurfaceCopy command. 921 843 * 922 844 * SVGA_CAP2_DX2 -- 923 - * Allow the DefineGBSurface_v3, WholeSurfaceCopy. 845 + * Allow the DefineGBSurface_v3, WholeSurfaceCopy, WriteZeroSurface, and 846 + * HintZeroSurface commands, and the SVGA_REG_GUEST_DRIVER_ID register. 847 + * 848 + * SVGA_CAP2_GB_MEMSIZE_2 -- 849 + * Allow the SVGA_REG_GBOBJECT_MEM_SIZE_KB register. 850 + * 851 + * SVGA_CAP2_SCREENDMA_REG -- 852 + * Allow the SVGA_REG_SCREENDMA register. 853 + * 854 + * SVGA_CAP2_OTABLE_PTDEPTH_2 -- 855 + * Allow 2 level page tables for OTable commands. 856 + * 857 + * SVGA_CAP2_NON_MS_TO_MS_STRETCHBLT -- 858 + * Allow a stretch blt from a non-multisampled surface to a multisampled 859 + * surface. 860 + * 861 + * SVGA_CAP2_CURSOR_MOB -- 862 + * Allow the SVGA_REG_CURSOR_MOBID register. 863 + * 864 + * SVGA_CAP2_MSHINT -- 865 + * Allow the SVGA_REG_MSHINT register. 866 + * 867 + * SVGA_CAP2_DX3 -- 868 + * Allows the DefineGBSurface_v4 command. 869 + * Allows the DXDefineDepthStencilView_v2, DXDefineStreamOutputWithMob, 870 + * and DXBindStreamOutput commands if 3D is also available. 871 + * Allows the DXPredStagingCopy and DXStagingCopy commands if SM41 872 + * is also available. 924 873 * 925 874 * SVGA_CAP2_RESERVED -- 926 875 * Reserve the last bit for extending the SVGA capabilities to some 927 876 * future mechanisms. 928 877 */ 929 - #define SVGA_CAP2_NONE 0x00000000 930 - #define SVGA_CAP2_GROW_OTABLE 0x00000001 931 - #define SVGA_CAP2_INTRA_SURFACE_COPY 0x00000002 932 - #define SVGA_CAP2_DX2 0x00000004 933 - #define SVGA_CAP2_RESERVED 0x80000000 878 + #define SVGA_CAP2_NONE 0x00000000 879 + #define SVGA_CAP2_GROW_OTABLE 0x00000001 880 + #define SVGA_CAP2_INTRA_SURFACE_COPY 0x00000002 881 + #define SVGA_CAP2_DX2 0x00000004 882 + #define SVGA_CAP2_GB_MEMSIZE_2 0x00000008 883 + #define SVGA_CAP2_SCREENDMA_REG 0x00000010 884 + #define SVGA_CAP2_OTABLE_PTDEPTH_2 0x00000020 885 + #define SVGA_CAP2_NON_MS_TO_MS_STRETCHBLT 0x00000040 886 + #define SVGA_CAP2_CURSOR_MOB 0x00000080 887 + #define SVGA_CAP2_MSHINT 0x00000100 888 + #define SVGA_CAP2_DX3 0x00000400 889 + #define SVGA_CAP2_RESERVED 0x80000000 934 890 935 891 936 892 /* ··· 987 875 SVGABackdoorCapFifoCaps = 1, 988 876 SVGABackdoorCap3dHWVersion = 2, 989 877 SVGABackdoorCapDeviceCaps2 = 3, 990 - SVGABackdoorCapMax = 4, 878 + SVGABackdoorCapDevelCaps = 4, 879 + SVGABackdoorDevelRenderer = 5, 880 + SVGABackdoorCapMax = 6, 991 881 } SVGABackdoorCapType; 992 882 993 883 ··· 1169 1055 /* 1170 1056 * FIFO Synchronization Registers 1171 1057 * 1172 - * This explains the relationship between the various FIFO 1173 - * sync-related registers in IOSpace and in FIFO space. 1174 - * 1175 1058 * SVGA_REG_SYNC -- 1176 1059 * 1177 - * The SYNC register can be used in two different ways by the guest: 1060 + * The SYNC register can be used by the guest driver to signal to the 1061 + * device that the guest driver is waiting for previously submitted 1062 + * commands to complete. 1178 1063 * 1179 - * 1. If the guest wishes to fully sync (drain) the FIFO, 1180 - * it will write once to SYNC then poll on the BUSY 1181 - * register. The FIFO is sync'ed once BUSY is zero. 1064 + * When the guest driver writes to the SYNC register, the device sets 1065 + * the BUSY register to TRUE, and starts processing the submitted commands 1066 + * (if it was not already doing so). When all previously submitted 1067 + * commands are finished and the device is idle again, it sets the BUSY 1068 + * register back to FALSE. (If the guest driver submits new commands 1069 + * after writing the SYNC register, the new commands are not guaranteed 1070 + * to have been procesesd.) 1182 1071 * 1183 - * 2. If the guest wants to asynchronously wake up the host, 1184 - * it will write once to SYNC without polling on BUSY. 1185 - * Ideally it will do this after some new commands have 1186 - * been placed in the FIFO, and after reading a zero 1187 - * from SVGA_FIFO_BUSY. 1072 + * When guest drivers are submitting commands using the FIFO, the device 1073 + * periodically polls to check for new FIFO commands when idle, which may 1074 + * introduce a delay in command processing. If the guest-driver wants 1075 + * the commands to be processed quickly (which it typically does), it 1076 + * should write SYNC after each batch of commands is committed to the 1077 + * FIFO to immediately wake up the device. For even better performance, 1078 + * the guest can use the SVGA_FIFO_BUSY register to avoid these extra 1079 + * SYNC writes if the device is already active, using the technique known 1080 + * as "Ringing the Doorbell" (described below). (Note that command 1081 + * buffer submission implicitly wakes up the device, and so doesn't 1082 + * suffer from this problem.) 1188 1083 * 1189 - * (1) is the original behaviour that SYNC was designed to 1190 - * support. Originally, a write to SYNC would implicitly 1191 - * trigger a read from BUSY. This causes us to synchronously 1192 - * process the FIFO. 1193 - * 1194 - * This behaviour has since been changed so that writing SYNC 1195 - * will *not* implicitly cause a read from BUSY. Instead, it 1196 - * makes a channel call which asynchronously wakes up the MKS 1197 - * thread. 1198 - * 1199 - * New guests can use this new behaviour to implement (2) 1200 - * efficiently. This lets guests get the host's attention 1201 - * without waiting for the MKS to poll, which gives us much 1202 - * better CPU utilization on SMP hosts and on UP hosts while 1203 - * we're blocked on the host GPU. 1204 - * 1205 - * Old guests shouldn't notice the behaviour change. SYNC was 1206 - * never guaranteed to process the entire FIFO, since it was 1207 - * bounded to a particular number of CPU cycles. Old guests will 1208 - * still loop on the BUSY register until the FIFO is empty. 1209 - * 1210 - * Writing to SYNC currently has the following side-effects: 1211 - * 1212 - * - Sets SVGA_REG_BUSY to TRUE (in the monitor) 1213 - * - Asynchronously wakes up the MKS thread for FIFO processing 1214 - * - The value written to SYNC is recorded as a "reason", for 1215 - * stats purposes. 1216 - * 1217 - * If SVGA_FIFO_BUSY is available, drivers are advised to only 1218 - * write to SYNC if SVGA_FIFO_BUSY is FALSE. Drivers should set 1219 - * SVGA_FIFO_BUSY to TRUE after writing to SYNC. The MKS will 1220 - * eventually set SVGA_FIFO_BUSY on its own, but this approach 1221 - * lets the driver avoid sending multiple asynchronous wakeup 1222 - * messages to the MKS thread. 1084 + * The SYNC register can also be used in combination with BUSY to 1085 + * synchronously ensure that all SVGA commands are processed (with both 1086 + * the FIFO and command-buffers). To do this, the guest driver should 1087 + * write to SYNC, and then loop reading BUSY until BUSY returns FALSE. 1088 + * This technique is known as a "Legacy Sync". 1223 1089 * 1224 1090 * SVGA_REG_BUSY -- 1225 1091 * 1226 1092 * This register is set to TRUE when SVGA_REG_SYNC is written, 1227 - * and it reads as FALSE when the FIFO has been completely 1228 - * drained. 1093 + * and is set back to FALSE when the device has finished processing 1094 + * all commands and is idle again. 1229 1095 * 1230 - * Every read from this register causes us to synchronously 1231 - * process FIFO commands. There is no guarantee as to how many 1232 - * commands each read will process. 1096 + * Every read from the BUSY reigster will block for an undefined 1097 + * amount of time (normally until the device finishes some interesting 1098 + * work unit), or the device is idle. 1233 1099 * 1234 - * CPU time spent processing FIFO commands will be billed to 1235 - * the guest. 1236 - * 1237 - * New drivers should avoid using this register unless they 1238 - * need to guarantee that the FIFO is completely drained. It 1239 - * is overkill for performing a sync-to-fence. Older drivers 1240 - * will use this register for any type of synchronization. 1100 + * Guest drivers can also do a partial Legacy Sync to check for some 1101 + * particular condition, for instance by stopping early when a fence 1102 + * passes before BUSY has been set back to FALSE. This is particularly 1103 + * useful if the guest-driver knows that it is blocked waiting on the 1104 + * device, because it will yield CPU time back to the host. 1241 1105 * 1242 1106 * SVGA_FIFO_BUSY -- 1243 1107 * 1244 - * This register is a fast way for the guest driver to check 1245 - * whether the FIFO is already being processed. It reads and 1246 - * writes at normal RAM speeds, with no monitor intervention. 1108 + * The SVGA_FIFO_BUSY register is a fast way for the guest driver to check 1109 + * whether the device is actively processing FIFO commands before writing 1110 + * the more expensive SYNC register. 1247 1111 * 1248 - * If this register reads as TRUE, the host is guaranteeing that 1249 - * any new commands written into the FIFO will be noticed before 1250 - * the MKS goes back to sleep. 1112 + * If this register reads as TRUE, the device is actively processing 1113 + * FIFO commands. 1251 1114 * 1252 - * If this register reads as FALSE, no such guarantee can be 1253 - * made. 1115 + * If this register reads as FALSE, the device may not be actively 1116 + * processing commands, and the guest driver should try 1117 + * "Ringing the Doorbell". 1254 1118 * 1255 - * The guest should use this register to quickly determine 1256 - * whether or not it needs to wake up the host. If the guest 1257 - * just wrote a command or group of commands that it would like 1258 - * the host to begin processing, it should: 1119 + * To Ring the Doorbell, the guest should: 1259 1120 * 1260 - * 1. Read SVGA_FIFO_BUSY. If it reads as TRUE, no further 1261 - * action is necessary. 1121 + * 1. Have already written their batch of commands into the FIFO. 1122 + * 2. Check if the SVGA_FIFO_BUSY register is available by reading 1123 + * SVGA_FIFO_MIN. 1124 + * 3. Read SVGA_FIFO_BUSY. If it reads as TRUE, the device is actively 1125 + * processing FIFO commands, and no further action is necessary. 1126 + * 4. If SVGA_FIFO_BUSY was FALSE, write TRUE to SVGA_REG_SYNC. 1262 1127 * 1263 - * 2. Write TRUE to SVGA_FIFO_BUSY. This informs future guest 1264 - * code that we've already sent a SYNC to the host and we 1265 - * don't need to send a duplicate. 1266 - * 1267 - * 3. Write a reason to SVGA_REG_SYNC. This will send an 1268 - * asynchronous wakeup to the MKS thread. 1128 + * For maximum performance, this procedure should be followed after 1129 + * every meaningful batch of commands has been written into the FIFO. 1130 + * (Normally when the underlying application signals it's finished a 1131 + * meaningful work unit by calling Flush.) 1269 1132 */ 1270 1133 1271 1134 ··· 1254 1163 * Pitch Lock -- Pitch lock register is supported 1255 1164 * Video -- SVGA Video overlay units are supported 1256 1165 * Escape -- Escape command is supported 1257 - * 1258 - * XXX: Add longer descriptions for each capability, including a list 1259 - * of the new features that each capability provides. 1260 1166 * 1261 1167 * SVGA_FIFO_CAP_SCREEN_OBJECT -- 1262 1168 * ··· 1365 1277 1366 1278 #define SVGA_FIFO_RESERVED_UNKNOWN 0xffffffff 1367 1279 1280 + 1281 + /* 1282 + * ScreenDMA Register Values 1283 + */ 1284 + 1285 + #define SVGA_SCREENDMA_REG_UNDEFINED 0 1286 + #define SVGA_SCREENDMA_REG_NOT_PRESENT 1 1287 + #define SVGA_SCREENDMA_REG_PRESENT 2 1288 + #define SVGA_SCREENDMA_REG_MAX 3 1368 1289 1369 1290 /* 1370 1291 * Video overlay support ··· 1759 1662 } 1760 1663 #include "vmware_pack_end.h" 1761 1664 SVGAFifoCmdDefineAlphaCursor; 1665 + 1666 + 1667 + /* 1668 + * Provide a new large cursor image, as an AND/XOR mask. 1669 + * 1670 + * Should only be used for CursorMob functionality 1671 + */ 1672 + 1673 + typedef 1674 + #include "vmware_pack_begin.h" 1675 + struct { 1676 + uint32 hotspotX; 1677 + uint32 hotspotY; 1678 + uint32 width; 1679 + uint32 height; 1680 + uint32 andMaskDepth; 1681 + uint32 xorMaskDepth; 1682 + /* 1683 + * Followed by scanline data for AND mask, then XOR mask. 1684 + * Each scanline is padded to a 32-bit boundary. 1685 + */ 1686 + } 1687 + #include "vmware_pack_end.h" 1688 + SVGAGBColorCursorHeader; 1689 + 1690 + 1691 + /* 1692 + * Provide a new large cursor image, in 32-bit BGRA format. 1693 + * 1694 + * Should only be used for CursorMob functionality 1695 + */ 1696 + 1697 + typedef 1698 + #include "vmware_pack_begin.h" 1699 + struct { 1700 + uint32 hotspotX; 1701 + uint32 hotspotY; 1702 + uint32 width; 1703 + uint32 height; 1704 + /* Followed by scanline data */ 1705 + } 1706 + #include "vmware_pack_end.h" 1707 + SVGAGBAlphaCursorHeader; 1708 + 1709 + /* 1710 + * Define the SVGA guest backed cursor types 1711 + */ 1712 + 1713 + typedef enum { 1714 + SVGA_COLOR_CURSOR = 0, 1715 + SVGA_ALPHA_CURSOR = 1, 1716 + } SVGAGBCursorType; 1717 + 1718 + /* 1719 + * Provide a new large cursor image. 1720 + * 1721 + * Should only be used for CursorMob functionality 1722 + */ 1723 + 1724 + typedef 1725 + #include "vmware_pack_begin.h" 1726 + struct { 1727 + SVGAGBCursorType type; 1728 + union { 1729 + SVGAGBColorCursorHeader colorHeader; 1730 + SVGAGBAlphaCursorHeader alphaHeader; 1731 + } header; 1732 + uint32 sizeInBytes; 1733 + /* 1734 + * Followed by the cursor data 1735 + */ 1736 + } 1737 + #include "vmware_pack_end.h" 1738 + SVGAGBCursorHeader; 1762 1739 1763 1740 1764 1741 /* ··· 2232 2061 #define SVGA_VRAM_MAX_SIZE (128 * 1024 * 1024) 2233 2062 #define SVGA_MEMORY_SIZE_MAX (1024 * 1024 * 1024) 2234 2063 #define SVGA_FIFO_SIZE_MAX (2 * 1024 * 1024) 2235 - #define SVGA_GRAPHICS_MEMORY_KB_MIN (32 * 1024) 2236 - #define SVGA_GRAPHICS_MEMORY_KB_MAX (2 * 1024 * 1024) 2237 - #define SVGA_GRAPHICS_MEMORY_KB_DEFAULT (256 * 1024) 2064 + #define SVGA_GRAPHICS_MEMORY_KB_MIN (32 * 1024) 2065 + #define SVGA_GRAPHICS_MEMORY_KB_MAX_2GB (2 * 1024 * 1024) 2066 + #define SVGA_GRAPHICS_MEMORY_KB_MAX_3GB (3 * 1024 * 1024) 2067 + #define SVGA_GRAPHICS_MEMORY_KB_MAX_4GB (4 * 1024 * 1024) 2068 + #define SVGA_GRAPHICS_MEMORY_KB_MAX_8GB (8 * 1024 * 1024) 2069 + #define SVGA_GRAPHICS_MEMORY_KB_DEFAULT (256 * 1024) 2238 2070 2239 2071 #define SVGA_VRAM_SIZE_W2K (64 * 1024 * 1024) /* 64 MB */ 2240 2072 ··· 2259 2085 2260 2086 #define SVGA_FIFO_SIZE_GBOBJECTS (256 * 1024) 2261 2087 #define SVGA_VRAM_SIZE_GBOBJECTS (4 * 1024 * 1024) 2088 + 2089 + #define SVGA_PCI_REGS_PAGES (1) 2262 2090 2263 2091 #endif
+1
drivers/gpu/drm/vmwgfx/device_include/svga_types.h
··· 37 37 38 38 typedef uint64 PA; 39 39 typedef uint32 PPN; 40 + typedef uint32 PPN32; 40 41 typedef uint64 PPN64; 41 42 42 43 typedef bool Bool;