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

drm/vmwgfx: Update the device headers

This change updates the device headers to the latest device version.
Where renaming affects the existing code, it's updated accordingly.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

authored by

Deepak Rawat and committed by
Thomas Hellstrom
dc75e733 812a954b

+1489 -829
+171 -59
drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h
··· 46 46 * the SVGA3D protocol and remain reserved; they should not be used in the 47 47 * future. 48 48 * 49 - * IDs between 1040 and 1999 (inclusive) are available for use by the 49 + * IDs between 1040 and 2999 (inclusive) are available for use by the 50 50 * current SVGA3D protocol. 51 51 * 52 - * FIFO clients other than SVGA3D should stay below 1000, or at 2000 52 + * FIFO clients other than SVGA3D should stay below 1000, or at 3000 53 53 * and up. 54 54 */ 55 55 ··· 89 89 SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN = 1069, 90 90 SVGA_3D_CMD_SURFACE_DEFINE_V2 = 1070, 91 91 SVGA_3D_CMD_GENERATE_MIPMAPS = 1071, 92 - SVGA_3D_CMD_VIDEO_CREATE_DECODER = 1072, 93 - SVGA_3D_CMD_VIDEO_DESTROY_DECODER = 1073, 94 - SVGA_3D_CMD_VIDEO_CREATE_PROCESSOR = 1074, 95 - SVGA_3D_CMD_VIDEO_DESTROY_PROCESSOR = 1075, 96 - SVGA_3D_CMD_VIDEO_DECODE_START_FRAME = 1076, 97 - SVGA_3D_CMD_VIDEO_DECODE_RENDER = 1077, 98 - SVGA_3D_CMD_VIDEO_DECODE_END_FRAME = 1078, 99 - SVGA_3D_CMD_VIDEO_PROCESS_FRAME = 1079, 92 + SVGA_3D_CMD_DEAD4 = 1072, 93 + SVGA_3D_CMD_DEAD5 = 1073, 94 + SVGA_3D_CMD_DEAD6 = 1074, 95 + SVGA_3D_CMD_DEAD7 = 1075, 96 + SVGA_3D_CMD_DEAD8 = 1076, 97 + SVGA_3D_CMD_DEAD9 = 1077, 98 + SVGA_3D_CMD_DEAD10 = 1078, 99 + SVGA_3D_CMD_DEAD11 = 1079, 100 100 SVGA_3D_CMD_ACTIVATE_SURFACE = 1080, 101 101 SVGA_3D_CMD_DEACTIVATE_SURFACE = 1081, 102 102 SVGA_3D_CMD_SCREEN_DMA = 1082, 103 - SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE = 1083, 104 - SVGA_3D_CMD_OPEN_CONTEXT_SURFACE = 1084, 103 + SVGA_3D_CMD_DEAD1 = 1083, 104 + SVGA_3D_CMD_DEAD2 = 1084, 105 105 106 106 SVGA_3D_CMD_LOGICOPS_BITBLT = 1085, 107 107 SVGA_3D_CMD_LOGICOPS_TRANSBLT = 1086, ··· 217 217 SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW = 1177, 218 218 SVGA_3D_CMD_DX_PRED_COPY_REGION = 1178, 219 219 SVGA_3D_CMD_DX_PRED_COPY = 1179, 220 - SVGA_3D_CMD_DX_STRETCHBLT = 1180, 220 + SVGA_3D_CMD_DX_PRESENTBLT = 1180, 221 221 SVGA_3D_CMD_DX_GENMIPS = 1181, 222 222 SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE = 1182, 223 223 SVGA_3D_CMD_DX_READBACK_SUBRESOURCE = 1183, ··· 254 254 SVGA_3D_CMD_DX_READBACK_ALL_QUERY = 1214, 255 255 SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER = 1215, 256 256 SVGA_3D_CMD_DX_MOB_FENCE_64 = 1216, 257 - SVGA_3D_CMD_DX_BIND_SHADER_ON_CONTEXT = 1217, 257 + SVGA_3D_CMD_DX_BIND_ALL_SHADER = 1217, 258 258 SVGA_3D_CMD_DX_HINT = 1218, 259 259 SVGA_3D_CMD_DX_BUFFER_UPDATE = 1219, 260 260 SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET = 1220, ··· 262 262 SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET = 1222, 263 263 264 264 /* 265 - * Reserve some IDs to be used for the DX11 shader types. 265 + * Reserve some IDs to be used for the SM5 shader types. 266 266 */ 267 267 SVGA_3D_CMD_DX_RESERVED1 = 1223, 268 268 SVGA_3D_CMD_DX_RESERVED2 = 1224, 269 269 SVGA_3D_CMD_DX_RESERVED3 = 1225, 270 270 271 - SVGA_3D_CMD_DX_MAX = 1226, 272 - SVGA_3D_CMD_MAX = 1226, 271 + SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER = 1226, 272 + SVGA_3D_CMD_DX_MAX = 1227, 273 + 274 + SVGA_3D_CMD_SCREEN_COPY = 1227, 275 + 276 + /* 277 + * Reserve some IDs to be used for video. 278 + */ 279 + SVGA_3D_CMD_VIDEO_RESERVED1 = 1228, 280 + SVGA_3D_CMD_VIDEO_RESERVED2 = 1229, 281 + SVGA_3D_CMD_VIDEO_RESERVED3 = 1230, 282 + SVGA_3D_CMD_VIDEO_RESERVED4 = 1231, 283 + SVGA_3D_CMD_VIDEO_RESERVED5 = 1232, 284 + SVGA_3D_CMD_VIDEO_RESERVED6 = 1233, 285 + SVGA_3D_CMD_VIDEO_RESERVED7 = 1234, 286 + SVGA_3D_CMD_VIDEO_RESERVED8 = 1235, 287 + 288 + SVGA_3D_CMD_GROW_OTABLE = 1236, 289 + SVGA_3D_CMD_DX_GROW_COTABLE = 1237, 290 + SVGA_3D_CMD_INTRA_SURFACE_COPY = 1238, 291 + 292 + SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 = 1239, 293 + 294 + SVGA_3D_CMD_DX_RESOLVE_COPY = 1240, 295 + SVGA_3D_CMD_DX_PRED_RESOLVE_COPY = 1241, 296 + SVGA_3D_CMD_DX_PRED_CONVERT_REGION = 1242, 297 + SVGA_3D_CMD_DX_PRED_CONVERT = 1243, 298 + SVGA_3D_CMD_WHOLE_SURFACE_COPY = 1244, 299 + 300 + SVGA_3D_CMD_MAX = 1245, 273 301 SVGA_3D_CMD_FUTURE_MAX = 3000 274 302 } SVGAFifo3dCmdId; 303 + 304 + #define SVGA_NUM_3D_CMD (SVGA_3D_CMD_MAX - SVGA_3D_CMD_BASE) 275 305 276 306 /* 277 307 * FIFO command format definitions: ··· 331 301 #include "vmware_pack_begin.h" 332 302 struct { 333 303 uint32 sid; 334 - SVGA3dSurfaceFlags surfaceFlags; 304 + SVGA3dSurface1Flags surfaceFlags; 335 305 SVGA3dSurfaceFormat format; 336 306 /* 337 307 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace ··· 357 327 #include "vmware_pack_begin.h" 358 328 struct { 359 329 uint32 sid; 360 - SVGA3dSurfaceFlags surfaceFlags; 330 + SVGA3dSurface1Flags surfaceFlags; 361 331 SVGA3dSurfaceFormat format; 362 332 /* 363 333 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace ··· 488 458 } 489 459 #include "vmware_pack_end.h" 490 460 SVGA3dCmdSurfaceCopy; /* SVGA_3D_CMD_SURFACE_COPY */ 461 + 462 + /* 463 + * Perform a surface copy within the same image. 464 + * The src/dest boxes are allowed to overlap. 465 + */ 466 + typedef 467 + #include "vmware_pack_begin.h" 468 + struct { 469 + SVGA3dSurfaceImageId surface; 470 + SVGA3dCopyBox box; 471 + } 472 + #include "vmware_pack_end.h" 473 + SVGA3dCmdIntraSurfaceCopy; /* SVGA_3D_CMD_INTRA_SURFACE_COPY */ 474 + 475 + typedef 476 + #include "vmware_pack_begin.h" 477 + struct { 478 + uint32 srcSid; 479 + uint32 destSid; 480 + } 481 + #include "vmware_pack_end.h" 482 + SVGA3dCmdWholeSurfaceCopy; /* SVGA_3D_CMD_WHOLE_SURFACE_COPY */ 491 483 492 484 typedef 493 485 #include "vmware_pack_begin.h" ··· 823 771 } 824 772 #include "vmware_pack_end.h" 825 773 SVGA3dVertexElement; 774 + 775 + /* 776 + * Should the vertex element respect the stream value? The high bit of the 777 + * stream should be set to indicate that the stream should be respected. If 778 + * the high bit is not set, the stream will be ignored and replaced by the index 779 + * of the position of the currently considered vertex element. 780 + * 781 + * All guests should set this bit and correctly specify the stream going 782 + * forward. 783 + */ 784 + #define SVGA3D_VERTEX_ELEMENT_RESPECT_STREAM (1 << 7) 826 785 827 786 typedef 828 787 #include "vmware_pack_begin.h" ··· 1165 1102 #include "vmware_pack_end.h" 1166 1103 SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */ 1167 1104 1168 - 1169 - 1170 1105 typedef 1171 1106 #include "vmware_pack_begin.h" 1172 1107 struct { ··· 1206 1145 } 1207 1146 #include "vmware_pack_end.h" 1208 1147 SVGA3dCmdScreenDMA; /* SVGA_3D_CMD_SCREEN_DMA */ 1209 - 1210 - /* 1211 - * Set Unity Surface Cookie 1212 - * 1213 - * Associates the supplied cookie with the surface id for use with 1214 - * Unity. This cookie is a hint from guest to host, there is no way 1215 - * for the guest to readback the cookie and the host is free to drop 1216 - * the cookie association at will. The default value for the cookie 1217 - * on all surfaces is 0. 1218 - */ 1219 - 1220 - typedef 1221 - #include "vmware_pack_begin.h" 1222 - struct SVGA3dCmdSetUnitySurfaceCookie { 1223 - uint32 sid; 1224 - uint64 cookie; 1225 - } 1226 - #include "vmware_pack_end.h" 1227 - SVGA3dCmdSetUnitySurfaceCookie; /* SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE */ 1228 - 1229 - /* 1230 - * Open a context-specific surface in a non-context-specific manner. 1231 - */ 1232 - 1233 - typedef 1234 - #include "vmware_pack_begin.h" 1235 - struct SVGA3dCmdOpenContextSurface { 1236 - uint32 sid; 1237 - } 1238 - #include "vmware_pack_end.h" 1239 - SVGA3dCmdOpenContextSurface; /* SVGA_3D_CMD_OPEN_CONTEXT_SURFACE */ 1240 - 1241 1148 1242 1149 /* 1243 1150 * Logic ops ··· 1353 1324 #include "vmware_pack_begin.h" 1354 1325 struct { 1355 1326 SVGA3dSurfaceFormat format; 1356 - SVGA3dSurfaceFlags surfaceFlags; 1327 + SVGA3dSurface1Flags surface1Flags; 1357 1328 uint32 numMipLevels; 1358 1329 uint32 multisampleCount; 1359 1330 SVGA3dTextureFilter autogenFilter; ··· 1361 1332 SVGAMobId mobid; 1362 1333 uint32 arraySize; 1363 1334 uint32 mobPitch; 1364 - uint32 pad[5]; 1335 + SVGA3dSurface2Flags surface2Flags; 1336 + uint8 multisamplePattern; 1337 + uint8 qualityLevel; 1338 + uint8 pad0[2]; 1339 + uint32 pad1[3]; 1365 1340 } 1366 1341 #include "vmware_pack_end.h" 1367 1342 SVGAOTableSurfaceEntry; ··· 1393 1360 SVGAOTableShaderEntry; 1394 1361 #define SVGA3D_OTABLE_SHADER_ENTRY_SIZE (sizeof(SVGAOTableShaderEntry)) 1395 1362 1396 - #define SVGA_STFLAG_PRIMARY (1 << 0) 1363 + #define SVGA_STFLAG_PRIMARY (1 << 0) 1364 + #define SVGA_STFLAG_RESERVED (1 << 1) /* Added with cap SVGA_CAP_HP_CMD_QUEUE */ 1397 1365 typedef uint32 SVGAScreenTargetFlags; 1398 1366 1399 1367 typedef ··· 1562 1528 #include "vmware_pack_end.h" 1563 1529 SVGA3dCmdSetOTableBase64; /* SVGA_3D_CMD_SET_OTABLE_BASE64 */ 1564 1530 1531 + /* 1532 + * Guests using SVGA_3D_CMD_GROW_OTABLE are promising that 1533 + * the new OTable contains the same contents as the old one, except possibly 1534 + * for some new invalid entries at the end. 1535 + * 1536 + * (Otherwise, guests should use one of the SetOTableBase commands.) 1537 + */ 1538 + typedef 1539 + #include "vmware_pack_begin.h" 1540 + struct { 1541 + SVGAOTableType type; 1542 + PPN64 baseAddress; 1543 + uint32 sizeInBytes; 1544 + uint32 validSizeInBytes; 1545 + SVGAMobFormat ptDepth; 1546 + } 1547 + #include "vmware_pack_end.h" 1548 + SVGA3dCmdGrowOTable; /* SVGA_3D_CMD_GROW_OTABLE */ 1549 + 1565 1550 typedef 1566 1551 #include "vmware_pack_begin.h" 1567 1552 struct { ··· 1668 1615 #include "vmware_pack_begin.h" 1669 1616 struct SVGA3dCmdDefineGBSurface { 1670 1617 uint32 sid; 1671 - SVGA3dSurfaceFlags surfaceFlags; 1618 + SVGA3dSurface1Flags surfaceFlags; 1672 1619 SVGA3dSurfaceFormat format; 1673 1620 uint32 numMipLevels; 1674 1621 uint32 multisampleCount; ··· 1677 1624 } 1678 1625 #include "vmware_pack_end.h" 1679 1626 SVGA3dCmdDefineGBSurface; /* SVGA_3D_CMD_DEFINE_GB_SURFACE */ 1627 + 1628 + /* 1629 + * Defines a guest-backed surface, adding the arraySize field. 1630 + */ 1631 + typedef 1632 + #include "vmware_pack_begin.h" 1633 + struct SVGA3dCmdDefineGBSurface_v2 { 1634 + uint32 sid; 1635 + SVGA3dSurface1Flags surfaceFlags; 1636 + SVGA3dSurfaceFormat format; 1637 + uint32 numMipLevels; 1638 + uint32 multisampleCount; 1639 + SVGA3dTextureFilter autogenFilter; 1640 + SVGA3dSize size; 1641 + uint32 arraySize; 1642 + uint32 pad; 1643 + } 1644 + #include "vmware_pack_end.h" 1645 + SVGA3dCmdDefineGBSurface_v2; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 */ 1646 + 1647 + /* 1648 + * Defines a guest-backed surface, adding the larger flags. 1649 + */ 1650 + typedef 1651 + #include "vmware_pack_begin.h" 1652 + struct SVGA3dCmdDefineGBSurface_v3 { 1653 + uint32 sid; 1654 + SVGA3dSurfaceAllFlags surfaceFlags; 1655 + SVGA3dSurfaceFormat format; 1656 + uint32 numMipLevels; 1657 + uint32 multisampleCount; 1658 + SVGA3dMSPattern multisamplePattern; 1659 + SVGA3dMSQualityLevel qualityLevel; 1660 + SVGA3dTextureFilter autogenFilter; 1661 + SVGA3dSize size; 1662 + uint32 arraySize; 1663 + } 1664 + #include "vmware_pack_end.h" 1665 + SVGA3dCmdDefineGBSurface_v3; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 */ 1680 1666 1681 1667 /* 1682 1668 * Destroy a guest-backed surface. ··· 1764 1672 1765 1673 typedef 1766 1674 #include "vmware_pack_begin.h" 1767 - struct{ 1675 + struct SVGA3dCmdCondBindGBSurface { 1768 1676 uint32 sid; 1769 1677 SVGAMobId testMobid; 1770 1678 SVGAMobId mobid; ··· 2158 2066 uint32 mobOffset; 2159 2067 } 2160 2068 #include "vmware_pack_end.h" 2161 - SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE*/ 2069 + SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE */ 2070 + 2071 + typedef 2072 + #include "vmware_pack_begin.h" 2073 + struct { 2074 + uint32 stid; 2075 + SVGA3dSurfaceImageId dest; 2076 + 2077 + uint32 statusMobId; 2078 + uint32 statusMobOffset; 2079 + 2080 + /* Reserved fields */ 2081 + uint32 mustBeInvalidId; 2082 + uint32 mustBeZero; 2083 + } 2084 + #include "vmware_pack_end.h" 2085 + SVGA3dCmdScreenCopy; /* SVGA_3D_CMD_SCREEN_COPY */ 2086 + 2087 + #define SVGA_SCREEN_COPY_STATUS_FAILURE 0x00 2088 + #define SVGA_SCREEN_COPY_STATUS_SUCCESS 0x01 2089 + #define SVGA_SCREEN_COPY_STATUS_INVALID 0xFFFFFFFF 2162 2090 2163 2091 #endif /* _SVGA3D_CMD_H_ */
+53 -30
drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h
··· 229 229 SVGA3D_DEVCAP_DEAD2 = 94, 230 230 231 231 /* 232 - * Does the device support the DX commands? 232 + * Does the device support DXContexts? 233 233 */ 234 - SVGA3D_DEVCAP_DX = 95, 234 + SVGA3D_DEVCAP_DXCONTEXT = 95, 235 235 236 236 /* 237 237 * What is the maximum size of a texture array? ··· 241 241 SVGA3D_DEVCAP_MAX_TEXTURE_ARRAY_SIZE = 96, 242 242 243 243 /* 244 - * What is the maximum number of vertex buffers that can 245 - * be used in the DXContext inputAssembly? 244 + * What is the maximum number of vertex buffers or vertex input registers 245 + * that can be expected to work correctly with a DXContext? 246 + * 247 + * The guest is allowed to set up to SVGA3D_DX_MAX_VERTEXBUFFERS, but 248 + * anything in excess of this cap is not guaranteed to render correctly. 249 + * 250 + * Similarly, the guest can set up to SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 251 + * input registers without the SVGA3D_DEVCAP_SM4_1 cap, or 252 + * SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS with the SVGA3D_DEVCAP_SM4_1, 253 + * but only the registers up to this cap value are guaranteed to render 254 + * correctly. 255 + * 256 + * If guest-drivers are able to expose a lower-limit, it's recommended 257 + * that they clamp to this value. Otherwise, the host will make a 258 + * best-effort on case-by-case basis if guests exceed this. 246 259 */ 247 260 SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS = 97, 248 261 249 262 /* 250 - * What is the maximum number of constant buffers 251 - * that can be expected to work correctly with a 252 - * DX context? 263 + * What is the maximum number of constant buffers that can be expected to 264 + * work correctly with a DX context? 265 + * 266 + * The guest is allowed to set up to SVGA3D_DX_MAX_CONSTBUFFERS, but 267 + * anything in excess of this cap is not guaranteed to render correctly. 268 + * 269 + * If guest-drivers are able to expose a lower-limit, it's recommended 270 + * that they clamp to this value. Otherwise, the host will make a 271 + * best-effort on case-by-case basis if guests exceed this. 253 272 */ 254 273 SVGA3D_DEVCAP_DX_MAX_CONSTANT_BUFFERS = 98, 255 274 256 275 /* 257 276 * Does the device support provoking vertex control? 258 - * If zero, the first vertex will always be the provoking vertex. 277 + * 278 + * If this cap is present, the provokingVertexLast field in the 279 + * rasterizer state is enabled. (Guests can then set it to FALSE, 280 + * meaning that the first vertex is the provoking vertex, or TRUE, 281 + * meaning that the last verteix is the provoking vertex.) 282 + * 283 + * If this cap is FALSE, then guests should set the provokingVertexLast 284 + * to FALSE, otherwise rendering behavior is undefined. 259 285 */ 260 286 SVGA3D_DEVCAP_DX_PROVOKING_VERTEX = 99, 261 287 ··· 307 281 SVGA3D_DEVCAP_DXFMT_BUMPU8V8 = 119, 308 282 SVGA3D_DEVCAP_DXFMT_BUMPL6V5U5 = 120, 309 283 SVGA3D_DEVCAP_DXFMT_BUMPX8L8V8U8 = 121, 310 - SVGA3D_DEVCAP_DXFMT_BUMPL8V8U8 = 122, 284 + SVGA3D_DEVCAP_DXFMT_FORMAT_DEAD1 = 122, 311 285 SVGA3D_DEVCAP_DXFMT_ARGB_S10E5 = 123, 312 286 SVGA3D_DEVCAP_DXFMT_ARGB_S23E8 = 124, 313 287 SVGA3D_DEVCAP_DXFMT_A2R10G10B10 = 125, ··· 346 320 SVGA3D_DEVCAP_DXFMT_R32G32_SINT = 158, 347 321 SVGA3D_DEVCAP_DXFMT_R32G8X24_TYPELESS = 159, 348 322 SVGA3D_DEVCAP_DXFMT_D32_FLOAT_S8X24_UINT = 160, 349 - SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24_TYPELESS = 161, 350 - SVGA3D_DEVCAP_DXFMT_X32_TYPELESS_G8X24_UINT = 162, 323 + SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24 = 161, 324 + SVGA3D_DEVCAP_DXFMT_X32_G8X24_UINT = 162, 351 325 SVGA3D_DEVCAP_DXFMT_R10G10B10A2_TYPELESS = 163, 352 326 SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UINT = 164, 353 327 SVGA3D_DEVCAP_DXFMT_R11G11B10_FLOAT = 165, ··· 365 339 SVGA3D_DEVCAP_DXFMT_R32_SINT = 177, 366 340 SVGA3D_DEVCAP_DXFMT_R24G8_TYPELESS = 178, 367 341 SVGA3D_DEVCAP_DXFMT_D24_UNORM_S8_UINT = 179, 368 - SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8_TYPELESS = 180, 369 - SVGA3D_DEVCAP_DXFMT_X24_TYPELESS_G8_UINT = 181, 342 + SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8 = 180, 343 + SVGA3D_DEVCAP_DXFMT_X24_G8_UINT = 181, 370 344 SVGA3D_DEVCAP_DXFMT_R8G8_TYPELESS = 182, 371 345 SVGA3D_DEVCAP_DXFMT_R8G8_UNORM = 183, 372 346 SVGA3D_DEVCAP_DXFMT_R8G8_UINT = 184, ··· 430 404 SVGA3D_DEVCAP_DXFMT_BC4_UNORM = 242, 431 405 SVGA3D_DEVCAP_DXFMT_BC5_UNORM = 243, 432 406 407 + /* 408 + * Advertises shaderModel 4.1 support, independent blend-states, 409 + * cube-map arrays, and a higher vertex input registers limit. 410 + * 411 + * (See documentation on SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS.) 412 + */ 413 + SVGA3D_DEVCAP_SM41 = 244, 414 + 415 + SVGA3D_DEVCAP_MULTISAMPLE_2X = 245, 416 + SVGA3D_DEVCAP_MULTISAMPLE_4X = 246, 417 + 433 418 SVGA3D_DEVCAP_MAX /* This must be the last index. */ 434 419 } SVGA3dDevCapIndex; 435 420 ··· 456 419 * MIPS: Does the format support mip levels? 457 420 * ARRAY: Does the format support texture arrays? 458 421 * VOLUME: Does the format support having volume? 459 - * MULTISAMPLE_2: Does the format support 2x multisample? 460 - * MULTISAMPLE_4: Does the format support 4x multisample? 461 - * MULTISAMPLE_8: Does the format support 8x multisample? 422 + * MULTISAMPLE: Does the format support multisample? 462 423 */ 463 424 #define SVGA3D_DXFMT_SUPPORTED (1 << 0) 464 425 #define SVGA3D_DXFMT_SHADER_SAMPLE (1 << 1) ··· 467 432 #define SVGA3D_DXFMT_ARRAY (1 << 6) 468 433 #define SVGA3D_DXFMT_VOLUME (1 << 7) 469 434 #define SVGA3D_DXFMT_DX_VERTEX_BUFFER (1 << 8) 470 - #define SVGADX_DXFMT_MULTISAMPLE_2 (1 << 9) 471 - #define SVGADX_DXFMT_MULTISAMPLE_4 (1 << 10) 472 - #define SVGADX_DXFMT_MULTISAMPLE_8 (1 << 11) 473 - #define SVGADX_DXFMT_MAX (1 << 12) 474 - 475 - /* 476 - * Convenience mask for any multisample capability. 477 - * 478 - * The multisample bits imply both load and render capability. 479 - */ 480 - #define SVGA3D_DXFMT_MULTISAMPLE ( \ 481 - SVGADX_DXFMT_MULTISAMPLE_2 | \ 482 - SVGADX_DXFMT_MULTISAMPLE_4 | \ 483 - SVGADX_DXFMT_MULTISAMPLE_8 ) 435 + #define SVGA3D_DXFMT_MULTISAMPLE (1 << 9) 436 + #define SVGA3D_DXFMT_MAX (1 << 10) 484 437 485 438 typedef union { 486 439 Bool b;
+222 -75
drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h
··· 56 56 #define SVGA3D_RESOURCE_TYPE_MAX 7 57 57 typedef uint32 SVGA3dResourceType; 58 58 59 + #define SVGA3D_COLOR_WRITE_ENABLE_RED (1 << 0) 60 + #define SVGA3D_COLOR_WRITE_ENABLE_GREEN (1 << 1) 61 + #define SVGA3D_COLOR_WRITE_ENABLE_BLUE (1 << 2) 62 + #define SVGA3D_COLOR_WRITE_ENABLE_ALPHA (1 << 3) 63 + #define SVGA3D_COLOR_WRITE_ENABLE_ALL (SVGA3D_COLOR_WRITE_ENABLE_RED | \ 64 + SVGA3D_COLOR_WRITE_ENABLE_GREEN | \ 65 + SVGA3D_COLOR_WRITE_ENABLE_BLUE | \ 66 + SVGA3D_COLOR_WRITE_ENABLE_ALPHA) 67 + typedef uint8 SVGA3dColorWriteEnable; 68 + 59 69 #define SVGA3D_DEPTH_WRITE_MASK_ZERO 0 60 70 #define SVGA3D_DEPTH_WRITE_MASK_ALL 1 61 71 typedef uint8 SVGA3dDepthWriteMask; ··· 98 88 #define SVGA3D_COMPARISON_MAX 9 99 89 typedef uint8 SVGA3dComparisonFunc; 100 90 91 + /* 92 + * SVGA3D_MULTISAMPLE_RAST_DISABLE disables MSAA for all primitives. 93 + * SVGA3D_MULTISAMPLE_RAST_DISABLE_LINE, which is supported in SM41, 94 + * disables MSAA for lines only. 95 + */ 96 + #define SVGA3D_MULTISAMPLE_RAST_DISABLE 0 97 + #define SVGA3D_MULTISAMPLE_RAST_ENABLE 1 98 + #define SVGA3D_MULTISAMPLE_RAST_DX_MAX 1 99 + #define SVGA3D_MULTISAMPLE_RAST_DISABLE_LINE 2 100 + #define SVGA3D_MULTISAMPLE_RAST_MAX 2 101 + typedef uint8 SVGA3dMultisampleRastEnable; 102 + 101 103 #define SVGA3D_DX_MAX_VERTEXBUFFERS 32 104 + #define SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 16 105 + #define SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS 32 102 106 #define SVGA3D_DX_MAX_SOTARGETS 4 103 107 #define SVGA3D_DX_MAX_SRVIEWS 128 104 108 #define SVGA3D_DX_MAX_CONSTBUFFERS 16 105 109 #define SVGA3D_DX_MAX_SAMPLERS 16 106 110 107 - /* Id limits */ 108 - static const uint32 SVGA3dBlendObjectCountPerContext = 4096; 109 - static const uint32 SVGA3dDepthStencilObjectCountPerContext = 4096; 111 + #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32)) 110 112 111 - typedef uint32 SVGA3dSurfaceId; 112 113 typedef uint32 SVGA3dShaderResourceViewId; 113 114 typedef uint32 SVGA3dRenderTargetViewId; 114 115 typedef uint32 SVGA3dDepthStencilViewId; ··· 212 191 } 213 192 #include "vmware_pack_end.h" 214 193 SVGA3dCmdDXInvalidateContext; /* SVGA_3D_CMD_DX_INVALIDATE_CONTEXT */ 215 - 216 - typedef 217 - #include "vmware_pack_begin.h" 218 - struct SVGA3dReplyFormatData { 219 - uint32 formatSupport; 220 - uint32 msaa2xQualityLevels:5; 221 - uint32 msaa4xQualityLevels:5; 222 - uint32 msaa8xQualityLevels:5; 223 - uint32 msaa16xQualityLevels:5; 224 - uint32 msaa32xQualityLevels:5; 225 - uint32 pad:7; 226 - } 227 - #include "vmware_pack_end.h" 228 - SVGA3dReplyFormatData; 229 194 230 195 typedef 231 196 #include "vmware_pack_begin.h" ··· 631 624 632 625 typedef 633 626 #include "vmware_pack_begin.h" 627 + struct SVGA3dCmdDXPredConvertRegion { 628 + SVGA3dSurfaceId dstSid; 629 + uint32 dstSubResource; 630 + SVGA3dBox destBox; 631 + SVGA3dSurfaceId srcSid; 632 + uint32 srcSubResource; 633 + SVGA3dBox srcBox; 634 + } 635 + #include "vmware_pack_end.h" 636 + SVGA3dCmdDXPredConvertRegion; /* SVGA_3D_CMD_DX_PRED_CONVERT_REGION */ 637 + 638 + typedef 639 + #include "vmware_pack_begin.h" 640 + struct SVGA3dCmdDXPredConvert { 641 + SVGA3dSurfaceId dstSid; 642 + SVGA3dSurfaceId srcSid; 643 + } 644 + #include "vmware_pack_end.h" 645 + SVGA3dCmdDXPredConvert; /* SVGA_3D_CMD_DX_PRED_CONVERT */ 646 + 647 + typedef 648 + #include "vmware_pack_begin.h" 634 649 struct SVGA3dCmdDXBufferCopy { 635 650 SVGA3dSurfaceId dest; 636 651 SVGA3dSurfaceId src; ··· 664 635 SVGA3dCmdDXBufferCopy; 665 636 /* SVGA_3D_CMD_DX_BUFFER_COPY */ 666 637 667 - typedef uint32 SVGA3dDXStretchBltMode; 668 - #define SVGADX_STRETCHBLT_LINEAR (1 << 0) 669 - #define SVGADX_STRETCHBLT_FORCE_SRC_SRGB (1 << 1) 638 + /* 639 + * Perform a surface copy between a multisample, and a non-multisampled 640 + * surface. 641 + */ 642 + typedef 643 + #include "vmware_pack_begin.h" 644 + struct { 645 + SVGA3dSurfaceId dstSid; 646 + uint32 dstSubResource; 647 + SVGA3dSurfaceId srcSid; 648 + uint32 srcSubResource; 649 + SVGA3dSurfaceFormat copyFormat; 650 + } 651 + #include "vmware_pack_end.h" 652 + SVGA3dCmdDXResolveCopy; /* SVGA_3D_CMD_DX_RESOLVE_COPY */ 653 + 654 + /* 655 + * Perform a predicated surface copy between a multisample, and a 656 + * non-multisampled surface. 657 + */ 658 + typedef 659 + #include "vmware_pack_begin.h" 660 + struct { 661 + SVGA3dSurfaceId dstSid; 662 + uint32 dstSubResource; 663 + SVGA3dSurfaceId srcSid; 664 + uint32 srcSubResource; 665 + SVGA3dSurfaceFormat copyFormat; 666 + } 667 + #include "vmware_pack_end.h" 668 + SVGA3dCmdDXPredResolveCopy; /* SVGA_3D_CMD_DX_PRED_RESOLVE_COPY */ 669 + 670 + typedef uint32 SVGA3dDXPresentBltMode; 671 + #define SVGADX_PRESENTBLT_LINEAR (1 << 0) 672 + #define SVGADX_PRESENTBLT_FORCE_SRC_SRGB (1 << 1) 673 + #define SVGADX_PRESENTBLT_FORCE_SRC_XRBIAS (1 << 2) 674 + #define SVGADX_PRESENTBLT_MODE_MAX (1 << 3) 670 675 671 676 typedef 672 677 #include "vmware_pack_begin.h" 673 - struct SVGA3dCmdDXStretchBlt { 678 + struct SVGA3dCmdDXPresentBlt { 674 679 SVGA3dSurfaceId srcSid; 675 680 uint32 srcSubResource; 676 681 SVGA3dSurfaceId dstSid; 677 682 uint32 destSubResource; 678 683 SVGA3dBox boxSrc; 679 684 SVGA3dBox boxDest; 680 - SVGA3dDXStretchBltMode mode; 685 + SVGA3dDXPresentBltMode mode; 681 686 } 682 687 #include "vmware_pack_end.h" 683 - SVGA3dCmdDXStretchBlt; /* SVGA_3D_CMD_DX_STRETCHBLT */ 688 + SVGA3dCmdDXPresentBlt; /* SVGA_3D_CMD_DX_PRESENTBLT*/ 684 689 685 690 typedef 686 691 #include "vmware_pack_begin.h" ··· 723 660 } 724 661 #include "vmware_pack_end.h" 725 662 SVGA3dCmdDXGenMips; /* SVGA_3D_CMD_DX_GENMIPS */ 726 - 727 - /* 728 - * Defines a resource/DX surface. Resources share the surfaceId namespace. 729 - * 730 - */ 731 - typedef 732 - #include "vmware_pack_begin.h" 733 - struct SVGA3dCmdDefineGBSurface_v2 { 734 - uint32 sid; 735 - SVGA3dSurfaceFlags surfaceFlags; 736 - SVGA3dSurfaceFormat format; 737 - uint32 numMipLevels; 738 - uint32 multisampleCount; 739 - SVGA3dTextureFilter autogenFilter; 740 - SVGA3dSize size; 741 - uint32 arraySize; 742 - uint32 pad; 743 - } 744 - #include "vmware_pack_end.h" 745 - SVGA3dCmdDefineGBSurface_v2; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 */ 746 663 747 664 /* 748 665 * Update a sub-resource in a guest-backed resource. ··· 767 724 768 725 /* 769 726 * Raw byte wise transfer from a buffer surface into another surface 770 - * of the requested box. 727 + * of the requested box. Supported if 3d is enabled and SVGA_CAP_DX 728 + * is set. This command does not take a context. 771 729 */ 772 730 typedef 773 731 #include "vmware_pack_begin.h" ··· 817 773 SVGA3dCmdDXSurfaceCopyAndReadback; 818 774 /* SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK */ 819 775 776 + /* 777 + * SVGA_DX_HINT_NONE: Does nothing. 778 + * 779 + * SVGA_DX_HINT_PREFETCH_OBJECT: 780 + * SVGA_DX_HINT_PREEVICT_OBJECT: 781 + * Consumes a SVGAObjectRef, and hints that the host should consider 782 + * fetching/evicting the specified object. 783 + * 784 + * An id of SVGA3D_INVALID_ID can be used if the guest isn't sure 785 + * what object was affected. (For instance, if the guest knows that 786 + * it is about to evict a DXShader, but doesn't know precisely which one, 787 + * the device can still use this to help limit it's search, or track 788 + * how many page-outs have happened.) 789 + * 790 + * SVGA_DX_HINT_PREFETCH_COBJECT: 791 + * SVGA_DX_HINT_PREEVICT_COBJECT: 792 + * Same as the above, except they consume an SVGACObjectRef. 793 + */ 794 + typedef uint32 SVGADXHintId; 795 + #define SVGA_DX_HINT_NONE 0 796 + #define SVGA_DX_HINT_PREFETCH_OBJECT 1 797 + #define SVGA_DX_HINT_PREEVICT_OBJECT 2 798 + #define SVGA_DX_HINT_PREFETCH_COBJECT 3 799 + #define SVGA_DX_HINT_PREEVICT_COBJECT 4 800 + #define SVGA_DX_HINT_MAX 5 801 + 802 + typedef 803 + #include "vmware_pack_begin.h" 804 + struct SVGAObjectRef { 805 + SVGAOTableType type; 806 + uint32 id; 807 + } 808 + #include "vmware_pack_end.h" 809 + SVGAObjectRef; 810 + 811 + typedef 812 + #include "vmware_pack_begin.h" 813 + struct SVGACObjectRef { 814 + SVGACOTableType type; 815 + uint32 cid; 816 + uint32 id; 817 + } 818 + #include "vmware_pack_end.h" 819 + SVGACObjectRef; 820 + 821 + typedef 822 + #include "vmware_pack_begin.h" 823 + struct SVGA3dCmdDXHint { 824 + SVGADXHintId hintId; 825 + 826 + /* 827 + * Followed by variable sized data depending on the hintId. 828 + */ 829 + } 830 + #include "vmware_pack_end.h" 831 + SVGA3dCmdDXHint; 832 + /* SVGA_3D_CMD_DX_HINT */ 833 + 834 + typedef 835 + #include "vmware_pack_begin.h" 836 + struct SVGA3dCmdDXBufferUpdate { 837 + SVGA3dSurfaceId sid; 838 + uint32 x; 839 + uint32 width; 840 + } 841 + #include "vmware_pack_end.h" 842 + SVGA3dCmdDXBufferUpdate; 843 + /* SVGA_3D_CMD_DX_BUFFER_UPDATE */ 844 + 845 + typedef 846 + #include "vmware_pack_begin.h" 847 + struct SVGA3dCmdDXSetConstantBufferOffset { 848 + uint32 slot; 849 + uint32 offsetInBytes; 850 + } 851 + #include "vmware_pack_end.h" 852 + SVGA3dCmdDXSetConstantBufferOffset; 853 + 854 + typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset; 855 + /* SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET */ 856 + 857 + typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset; 858 + /* SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET */ 859 + 860 + typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset; 861 + /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */ 862 + 820 863 821 864 typedef 822 865 #include "vmware_pack_begin.h" ··· 920 789 uint32 firstArraySlice; 921 790 uint32 mipLevels; 922 791 uint32 arraySize; 923 - } tex; 792 + } tex; /* 1d, 2d, 3d, cube */ 924 793 struct { 925 794 uint32 firstElement; 926 795 uint32 numElements; ··· 975 844 struct { 976 845 uint32 firstElement; 977 846 uint32 numElements; 847 + uint32 padding0; 978 848 } buffer; 979 849 struct { 980 850 uint32 mipSlice; ··· 1096 964 typedef 1097 965 #include "vmware_pack_begin.h" 1098 966 struct { 1099 - /* 1100 - * XXX: How many of these can there be? 1101 - */ 1102 967 uint32 elid; 1103 968 uint32 numDescs; 1104 969 SVGA3dInputElementDesc desc[32]; ··· 1136 1007 uint8 srcBlendAlpha; 1137 1008 uint8 destBlendAlpha; 1138 1009 uint8 blendOpAlpha; 1139 - uint8 renderTargetWriteMask; 1010 + SVGA3dColorWriteEnable renderTargetWriteMask; 1140 1011 uint8 logicOpEnable; 1141 1012 uint8 logicOp; 1142 1013 uint16 pad0; ··· 1254 1125 float slopeScaledDepthBias; 1255 1126 uint8 depthClipEnable; 1256 1127 uint8 scissorEnable; 1257 - uint8 multisampleEnable; 1128 + SVGA3dMultisampleRastEnable multisampleEnable; 1258 1129 uint8 antialiasedLineEnable; 1259 1130 float lineWidth; 1260 1131 uint8 lineStippleEnable; ··· 1281 1152 float slopeScaledDepthBias; 1282 1153 uint8 depthClipEnable; 1283 1154 uint8 scissorEnable; 1284 - uint8 multisampleEnable; 1155 + SVGA3dMultisampleRastEnable multisampleEnable; 1285 1156 uint8 antialiasedLineEnable; 1286 1157 float lineWidth; 1287 1158 uint8 lineStippleEnable; ··· 1351 1222 #include "vmware_pack_end.h" 1352 1223 SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */ 1353 1224 1354 - /* 1355 - */ 1356 - typedef 1357 - #include "vmware_pack_begin.h" 1358 - struct SVGA3dSignatureEntry { 1359 - uint8 systemValue; 1360 - uint8 reg; /* register is a reserved word */ 1361 - uint16 mask; 1362 - uint8 registerComponentType; 1363 - uint8 minPrecision; 1364 - uint16 pad0; 1365 - } 1366 - #include "vmware_pack_end.h" 1367 - SVGA3dSignatureEntry; 1368 - 1369 1225 typedef 1370 1226 #include "vmware_pack_begin.h" 1371 1227 struct SVGA3dCmdDXDefineShader { ··· 1368 1254 uint32 sizeInBytes; 1369 1255 uint32 offsetInBytes; 1370 1256 SVGAMobId mobid; 1371 - uint32 numInputSignatureEntries; 1372 - uint32 numOutputSignatureEntries; 1373 - 1374 - uint32 numPatchConstantSignatureEntries; 1375 - 1376 - uint32 pad; 1257 + uint32 pad[4]; 1377 1258 } 1378 1259 #include "vmware_pack_end.h" 1379 1260 SVGACOTableDXShaderEntry; ··· 1391 1282 } 1392 1283 #include "vmware_pack_end.h" 1393 1284 SVGA3dCmdDXBindShader; /* SVGA_3D_CMD_DX_BIND_SHADER */ 1285 + 1286 + typedef 1287 + #include "vmware_pack_begin.h" 1288 + struct SVGA3dCmdDXBindAllShader { 1289 + uint32 cid; 1290 + SVGAMobId mobid; 1291 + } 1292 + #include "vmware_pack_end.h" 1293 + SVGA3dCmdDXBindAllShader; /* SVGA_3D_CMD_DX_BIND_ALL_SHADER */ 1294 + 1295 + typedef 1296 + #include "vmware_pack_begin.h" 1297 + struct SVGA3dCmdDXCondBindAllShader { 1298 + uint32 cid; 1299 + SVGAMobId testMobid; 1300 + SVGAMobId mobid; 1301 + } 1302 + #include "vmware_pack_end.h" 1303 + SVGA3dCmdDXCondBindAllShader; /* SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER */ 1394 1304 1395 1305 /* 1396 1306 * The maximum number of streamout decl's in each streamout entry. ··· 1484 1356 * 1485 1357 * This command allows the guest to bind a mob to a context-object table. 1486 1358 */ 1487 - 1488 1359 typedef 1489 1360 #include "vmware_pack_begin.h" 1490 1361 struct SVGA3dCmdDXSetCOTable { ··· 1494 1367 } 1495 1368 #include "vmware_pack_end.h" 1496 1369 SVGA3dCmdDXSetCOTable; /* SVGA_3D_CMD_DX_SET_COTABLE */ 1370 + 1371 + /* 1372 + * Guests using SVGA_3D_CMD_DX_GROW_COTABLE are promising that 1373 + * the new COTable contains the same contents as the old one, except possibly 1374 + * for some new invalid entries at the end. 1375 + * 1376 + * If there is an old cotable mob bound, it also has to still be valid. 1377 + * 1378 + * (Otherwise, guests should use the DXSetCOTableBase command.) 1379 + */ 1380 + typedef 1381 + #include "vmware_pack_begin.h" 1382 + struct SVGA3dCmdDXGrowCOTable { 1383 + uint32 cid; 1384 + uint32 mobid; 1385 + SVGACOTableType type; 1386 + uint32 validSizeInBytes; 1387 + } 1388 + #include "vmware_pack_end.h" 1389 + SVGA3dCmdDXGrowCOTable; /* SVGA_3D_CMD_DX_GROW_COTABLE */ 1497 1390 1498 1391 typedef 1499 1392 #include "vmware_pack_begin.h" ··· 1618 1471 SVGA3dQueryId queryID[SVGA3D_MAX_QUERY]; 1619 1472 1620 1473 SVGA3dCOTableData cotables[SVGA_COTABLE_MAX]; 1621 - uint32 pad7[381]; 1474 + uint32 pad7[380]; 1622 1475 } 1623 1476 #include "vmware_pack_end.h" 1624 1477 SVGADXContextMobFormat;
+3 -1
drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h
··· 62 62 * Maximum size in dwords of shader text the SVGA device will allow. 63 63 * Currently 8 MB. 64 64 */ 65 - #define SVGA3D_MAX_SHADER_MEMORY (8 * 1024 * 1024 / sizeof(uint32)) 65 + #define SVGA3D_MAX_SHADER_MEMORY_BYTES (8 * 1024 * 1024) 66 + #define SVGA3D_MAX_SHADER_MEMORY (SVGA3D_MAX_SHADER_MEMORY_BYTES / \ 67 + sizeof(uint32)) 66 68 67 69 #define SVGA3D_MAX_CLIP_PLANES 6 68 70
+661 -511
drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h
··· 25 25 * 26 26 **************************************************************************/ 27 27 28 + /* 29 + * svga3d_surfacedefs.h -- 30 + * 31 + * Surface definitions and inlineable utilities for SVGA3d. 32 + */ 33 + 34 + #ifndef _SVGA3D_SURFACEDEFS_H_ 35 + #define _SVGA3D_SURFACEDEFS_H_ 36 + 37 + #define INCLUDE_ALLOW_USERLEVEL 38 + #define INCLUDE_ALLOW_MODULE 39 + #include "includeCheck.h" 40 + 28 41 #include <linux/kernel.h> 29 - 30 - #ifdef __KERNEL__ 31 - 32 42 #include <drm/vmwgfx_drm.h> 33 - #define surf_size_struct struct drm_vmw_size 34 - 35 - #else /* __KERNEL__ */ 36 - 37 - #ifndef ARRAY_SIZE 38 - #define ARRAY_SIZE(_A) (sizeof(_A) / sizeof((_A)[0])) 39 - #endif /* ARRAY_SIZE */ 40 - 41 - #define max_t(type, x, y) ((x) > (y) ? (x) : (y)) 42 - #define surf_size_struct SVGA3dSize 43 - #define u32 uint32 44 - 45 - #endif /* __KERNEL__ */ 46 43 47 44 #include "svga3d_reg.h" 48 45 46 + #define surf_size_struct struct drm_vmw_size 47 + 49 48 /* 50 - * enum svga3d_block_desc describes the active data channels in a block. 51 - * 52 - * There can be at-most four active channels in a block: 53 - * 1. Red, bump W, luminance and depth are stored in the first channel. 54 - * 2. Green, bump V and stencil are stored in the second channel. 55 - * 3. Blue and bump U are stored in the third channel. 56 - * 4. Alpha and bump Q are stored in the fourth channel. 57 - * 58 - * Block channels can be used to store compressed and buffer data: 59 - * 1. For compressed formats, only the data channel is used and its size 60 - * is equal to that of a singular block in the compression scheme. 61 - * 2. For buffer formats, only the data channel is used and its size is 62 - * exactly one byte in length. 63 - * 3. In each case the bit depth represent the size of a singular block. 64 - * 65 - * Note: Compressed and IEEE formats do not use the bitMask structure. 49 + * enum svga3d_block_desc - describes generic properties about formats. 66 50 */ 67 - 68 51 enum svga3d_block_desc { 69 - SVGA3DBLOCKDESC_NONE = 0, /* No channels are active */ 70 - SVGA3DBLOCKDESC_BLUE = 1 << 0, /* Block with red channel 71 - data */ 72 - SVGA3DBLOCKDESC_U = 1 << 0, /* Block with bump U channel 73 - data */ 74 - SVGA3DBLOCKDESC_UV_VIDEO = 1 << 7, /* Block with alternating video 75 - U and V */ 76 - SVGA3DBLOCKDESC_GREEN = 1 << 1, /* Block with green channel 77 - data */ 78 - SVGA3DBLOCKDESC_V = 1 << 1, /* Block with bump V channel 79 - data */ 80 - SVGA3DBLOCKDESC_STENCIL = 1 << 1, /* Block with a stencil 81 - channel */ 82 - SVGA3DBLOCKDESC_RED = 1 << 2, /* Block with blue channel 83 - data */ 84 - SVGA3DBLOCKDESC_W = 1 << 2, /* Block with bump W channel 85 - data */ 86 - SVGA3DBLOCKDESC_LUMINANCE = 1 << 2, /* Block with luminance channel 87 - data */ 88 - SVGA3DBLOCKDESC_Y = 1 << 2, /* Block with video luminance 89 - data */ 90 - SVGA3DBLOCKDESC_DEPTH = 1 << 2, /* Block with depth channel */ 91 - SVGA3DBLOCKDESC_ALPHA = 1 << 3, /* Block with an alpha 92 - channel */ 93 - SVGA3DBLOCKDESC_Q = 1 << 3, /* Block with bump Q channel 94 - data */ 95 - SVGA3DBLOCKDESC_BUFFER = 1 << 4, /* Block stores 1 byte of 96 - data */ 97 - SVGA3DBLOCKDESC_COMPRESSED = 1 << 5, /* Block stores n bytes of 98 - data depending on the 99 - compression method used */ 100 - SVGA3DBLOCKDESC_IEEE_FP = 1 << 6, /* Block stores data in an IEEE 101 - floating point 102 - representation in 103 - all channels */ 104 - SVGA3DBLOCKDESC_PLANAR_YUV = 1 << 8, /* Three separate blocks store 105 - data. */ 106 - SVGA3DBLOCKDESC_U_VIDEO = 1 << 9, /* Block with U video data */ 107 - SVGA3DBLOCKDESC_V_VIDEO = 1 << 10, /* Block with V video data */ 108 - SVGA3DBLOCKDESC_EXP = 1 << 11, /* Shared exponent */ 109 - SVGA3DBLOCKDESC_SRGB = 1 << 12, /* Data is in sRGB format */ 110 - SVGA3DBLOCKDESC_2PLANAR_YUV = 1 << 13, /* 2 planes of Y, UV, 111 - e.g., NV12. */ 112 - SVGA3DBLOCKDESC_3PLANAR_YUV = 1 << 14, /* 3 planes of separate 113 - Y, U, V, e.g., YV12. */ 52 + /* Nothing special can be said about this format. */ 53 + SVGA3DBLOCKDESC_NONE = 0, 114 54 115 - SVGA3DBLOCKDESC_RG = SVGA3DBLOCKDESC_RED | 116 - SVGA3DBLOCKDESC_GREEN, 117 - SVGA3DBLOCKDESC_RGB = SVGA3DBLOCKDESC_RG | 118 - SVGA3DBLOCKDESC_BLUE, 119 - SVGA3DBLOCKDESC_RGB_SRGB = SVGA3DBLOCKDESC_RGB | 120 - SVGA3DBLOCKDESC_SRGB, 121 - SVGA3DBLOCKDESC_RGBA = SVGA3DBLOCKDESC_RGB | 122 - SVGA3DBLOCKDESC_ALPHA, 123 - SVGA3DBLOCKDESC_RGBA_SRGB = SVGA3DBLOCKDESC_RGBA | 124 - SVGA3DBLOCKDESC_SRGB, 55 + /* Format contains Blue/U data */ 56 + SVGA3DBLOCKDESC_BLUE = 1 << 0, 57 + SVGA3DBLOCKDESC_W = 1 << 0, 58 + SVGA3DBLOCKDESC_BUMP_L = 1 << 0, 59 + 60 + /* Format contains Green/V data */ 61 + SVGA3DBLOCKDESC_GREEN = 1 << 1, 62 + SVGA3DBLOCKDESC_V = 1 << 1, 63 + 64 + /* Format contains Red/W/Luminance data */ 65 + SVGA3DBLOCKDESC_RED = 1 << 2, 66 + SVGA3DBLOCKDESC_U = 1 << 2, 67 + SVGA3DBLOCKDESC_LUMINANCE = 1 << 2, 68 + 69 + /* Format contains Alpha/Q data */ 70 + SVGA3DBLOCKDESC_ALPHA = 1 << 3, 71 + SVGA3DBLOCKDESC_Q = 1 << 3, 72 + 73 + /* Format is a buffer */ 74 + SVGA3DBLOCKDESC_BUFFER = 1 << 4, 75 + 76 + /* Format is compressed */ 77 + SVGA3DBLOCKDESC_COMPRESSED = 1 << 5, 78 + 79 + /* Format uses IEEE floating point */ 80 + SVGA3DBLOCKDESC_FP = 1 << 6, 81 + 82 + /* Three separate blocks store data. */ 83 + SVGA3DBLOCKDESC_PLANAR_YUV = 1 << 7, 84 + 85 + /* 2 planes of Y, UV, e.g., NV12. */ 86 + SVGA3DBLOCKDESC_2PLANAR_YUV = 1 << 8, 87 + 88 + /* 3 planes of separate Y, U, V, e.g., YV12. */ 89 + SVGA3DBLOCKDESC_3PLANAR_YUV = 1 << 9, 90 + 91 + /* Block with a stencil channel */ 92 + SVGA3DBLOCKDESC_STENCIL = 1 << 11, 93 + 94 + /* Typeless format */ 95 + SVGA3DBLOCKDESC_TYPELESS = 1 << 12, 96 + 97 + /* Channels are signed integers */ 98 + SVGA3DBLOCKDESC_SINT = 1 << 13, 99 + 100 + /* Channels are unsigned integers */ 101 + SVGA3DBLOCKDESC_UINT = 1 << 14, 102 + 103 + /* Channels are normalized (when sampling) */ 104 + SVGA3DBLOCKDESC_NORM = 1 << 15, 105 + 106 + /* Channels are in SRGB */ 107 + SVGA3DBLOCKDESC_SRGB = 1 << 16, 108 + 109 + /* Shared exponent */ 110 + SVGA3DBLOCKDESC_EXP = 1 << 17, 111 + 112 + /* Format contains color data. */ 113 + SVGA3DBLOCKDESC_COLOR = 1 << 18, 114 + /* Format contains depth data. */ 115 + SVGA3DBLOCKDESC_DEPTH = 1 << 19, 116 + /* Format contains bump data. */ 117 + SVGA3DBLOCKDESC_BUMP = 1 << 20, 118 + 119 + /* Format contains YUV video data. */ 120 + SVGA3DBLOCKDESC_YUV_VIDEO = 1 << 21, 121 + 122 + /* For mixed unsigned/signed formats. */ 123 + SVGA3DBLOCKDESC_MIXED = 1 << 22, 124 + 125 + /* For distingushing CxV8U8. */ 126 + SVGA3DBLOCKDESC_CX = 1 << 23, 127 + 128 + /* Different compressed format groups. */ 129 + SVGA3DBLOCKDESC_BC1 = 1 << 24, 130 + SVGA3DBLOCKDESC_BC2 = 1 << 25, 131 + SVGA3DBLOCKDESC_BC3 = 1 << 26, 132 + SVGA3DBLOCKDESC_BC4 = 1 << 27, 133 + SVGA3DBLOCKDESC_BC5 = 1 << 28, 134 + 135 + SVGA3DBLOCKDESC_A_UINT = SVGA3DBLOCKDESC_ALPHA | 136 + SVGA3DBLOCKDESC_UINT | 137 + SVGA3DBLOCKDESC_COLOR, 138 + SVGA3DBLOCKDESC_A_UNORM = SVGA3DBLOCKDESC_A_UINT | 139 + SVGA3DBLOCKDESC_NORM, 140 + SVGA3DBLOCKDESC_R_UINT = SVGA3DBLOCKDESC_RED | 141 + SVGA3DBLOCKDESC_UINT | 142 + SVGA3DBLOCKDESC_COLOR, 143 + SVGA3DBLOCKDESC_R_UNORM = SVGA3DBLOCKDESC_R_UINT | 144 + SVGA3DBLOCKDESC_NORM, 145 + SVGA3DBLOCKDESC_R_SINT = SVGA3DBLOCKDESC_RED | 146 + SVGA3DBLOCKDESC_SINT | 147 + SVGA3DBLOCKDESC_COLOR, 148 + SVGA3DBLOCKDESC_R_SNORM = SVGA3DBLOCKDESC_R_SINT | 149 + SVGA3DBLOCKDESC_NORM, 150 + SVGA3DBLOCKDESC_G_UINT = SVGA3DBLOCKDESC_GREEN | 151 + SVGA3DBLOCKDESC_UINT | 152 + SVGA3DBLOCKDESC_COLOR, 153 + SVGA3DBLOCKDESC_RG_UINT = SVGA3DBLOCKDESC_RED | 154 + SVGA3DBLOCKDESC_GREEN | 155 + SVGA3DBLOCKDESC_UINT | 156 + SVGA3DBLOCKDESC_COLOR, 157 + SVGA3DBLOCKDESC_RG_UNORM = SVGA3DBLOCKDESC_RG_UINT | 158 + SVGA3DBLOCKDESC_NORM, 159 + SVGA3DBLOCKDESC_RG_SINT = SVGA3DBLOCKDESC_RED | 160 + SVGA3DBLOCKDESC_GREEN | 161 + SVGA3DBLOCKDESC_SINT | 162 + SVGA3DBLOCKDESC_COLOR, 163 + SVGA3DBLOCKDESC_RG_SNORM = SVGA3DBLOCKDESC_RG_SINT | 164 + SVGA3DBLOCKDESC_NORM, 165 + SVGA3DBLOCKDESC_RGB_UINT = SVGA3DBLOCKDESC_RED | 166 + SVGA3DBLOCKDESC_GREEN | 167 + SVGA3DBLOCKDESC_BLUE | 168 + SVGA3DBLOCKDESC_UINT | 169 + SVGA3DBLOCKDESC_COLOR, 170 + SVGA3DBLOCKDESC_RGB_SINT = SVGA3DBLOCKDESC_RED | 171 + SVGA3DBLOCKDESC_GREEN | 172 + SVGA3DBLOCKDESC_BLUE | 173 + SVGA3DBLOCKDESC_SINT | 174 + SVGA3DBLOCKDESC_COLOR, 175 + SVGA3DBLOCKDESC_RGB_UNORM = SVGA3DBLOCKDESC_RGB_UINT | 176 + SVGA3DBLOCKDESC_NORM, 177 + SVGA3DBLOCKDESC_RGB_UNORM_SRGB = SVGA3DBLOCKDESC_RGB_UNORM | 178 + SVGA3DBLOCKDESC_SRGB, 179 + SVGA3DBLOCKDESC_RGBA_UINT = SVGA3DBLOCKDESC_RED | 180 + SVGA3DBLOCKDESC_GREEN | 181 + SVGA3DBLOCKDESC_BLUE | 182 + SVGA3DBLOCKDESC_ALPHA | 183 + SVGA3DBLOCKDESC_UINT | 184 + SVGA3DBLOCKDESC_COLOR, 185 + SVGA3DBLOCKDESC_RGBA_UNORM = SVGA3DBLOCKDESC_RGBA_UINT | 186 + SVGA3DBLOCKDESC_NORM, 187 + SVGA3DBLOCKDESC_RGBA_UNORM_SRGB = SVGA3DBLOCKDESC_RGBA_UNORM | 188 + SVGA3DBLOCKDESC_SRGB, 189 + SVGA3DBLOCKDESC_RGBA_SINT = SVGA3DBLOCKDESC_RED | 190 + SVGA3DBLOCKDESC_GREEN | 191 + SVGA3DBLOCKDESC_BLUE | 192 + SVGA3DBLOCKDESC_ALPHA | 193 + SVGA3DBLOCKDESC_SINT | 194 + SVGA3DBLOCKDESC_COLOR, 195 + SVGA3DBLOCKDESC_RGBA_SNORM = SVGA3DBLOCKDESC_RGBA_SINT | 196 + SVGA3DBLOCKDESC_NORM, 197 + SVGA3DBLOCKDESC_RGBA_FP = SVGA3DBLOCKDESC_RED | 198 + SVGA3DBLOCKDESC_GREEN | 199 + SVGA3DBLOCKDESC_BLUE | 200 + SVGA3DBLOCKDESC_ALPHA | 201 + SVGA3DBLOCKDESC_FP | 202 + SVGA3DBLOCKDESC_COLOR, 125 203 SVGA3DBLOCKDESC_UV = SVGA3DBLOCKDESC_U | 126 - SVGA3DBLOCKDESC_V, 204 + SVGA3DBLOCKDESC_V | 205 + SVGA3DBLOCKDESC_BUMP, 127 206 SVGA3DBLOCKDESC_UVL = SVGA3DBLOCKDESC_UV | 128 - SVGA3DBLOCKDESC_LUMINANCE, 207 + SVGA3DBLOCKDESC_BUMP_L | 208 + SVGA3DBLOCKDESC_MIXED | 209 + SVGA3DBLOCKDESC_BUMP, 129 210 SVGA3DBLOCKDESC_UVW = SVGA3DBLOCKDESC_UV | 130 - SVGA3DBLOCKDESC_W, 211 + SVGA3DBLOCKDESC_W | 212 + SVGA3DBLOCKDESC_BUMP, 131 213 SVGA3DBLOCKDESC_UVWA = SVGA3DBLOCKDESC_UVW | 132 - SVGA3DBLOCKDESC_ALPHA, 214 + SVGA3DBLOCKDESC_ALPHA | 215 + SVGA3DBLOCKDESC_MIXED | 216 + SVGA3DBLOCKDESC_BUMP, 133 217 SVGA3DBLOCKDESC_UVWQ = SVGA3DBLOCKDESC_U | 134 - SVGA3DBLOCKDESC_V | 135 - SVGA3DBLOCKDESC_W | 136 - SVGA3DBLOCKDESC_Q, 137 - SVGA3DBLOCKDESC_LA = SVGA3DBLOCKDESC_LUMINANCE | 138 - SVGA3DBLOCKDESC_ALPHA, 218 + SVGA3DBLOCKDESC_V | 219 + SVGA3DBLOCKDESC_W | 220 + SVGA3DBLOCKDESC_Q | 221 + SVGA3DBLOCKDESC_BUMP, 222 + SVGA3DBLOCKDESC_L_UNORM = SVGA3DBLOCKDESC_LUMINANCE | 223 + SVGA3DBLOCKDESC_UINT | 224 + SVGA3DBLOCKDESC_NORM | 225 + SVGA3DBLOCKDESC_COLOR, 226 + SVGA3DBLOCKDESC_LA_UNORM = SVGA3DBLOCKDESC_LUMINANCE | 227 + SVGA3DBLOCKDESC_ALPHA | 228 + SVGA3DBLOCKDESC_UINT | 229 + SVGA3DBLOCKDESC_NORM | 230 + SVGA3DBLOCKDESC_COLOR, 139 231 SVGA3DBLOCKDESC_R_FP = SVGA3DBLOCKDESC_RED | 140 - SVGA3DBLOCKDESC_IEEE_FP, 232 + SVGA3DBLOCKDESC_FP | 233 + SVGA3DBLOCKDESC_COLOR, 141 234 SVGA3DBLOCKDESC_RG_FP = SVGA3DBLOCKDESC_R_FP | 142 - SVGA3DBLOCKDESC_GREEN, 235 + SVGA3DBLOCKDESC_GREEN | 236 + SVGA3DBLOCKDESC_COLOR, 143 237 SVGA3DBLOCKDESC_RGB_FP = SVGA3DBLOCKDESC_RG_FP | 144 - SVGA3DBLOCKDESC_BLUE, 145 - SVGA3DBLOCKDESC_RGBA_FP = SVGA3DBLOCKDESC_RGB_FP | 146 - SVGA3DBLOCKDESC_ALPHA, 147 - SVGA3DBLOCKDESC_DS = SVGA3DBLOCKDESC_DEPTH | 148 - SVGA3DBLOCKDESC_STENCIL, 149 - SVGA3DBLOCKDESC_YUV = SVGA3DBLOCKDESC_UV_VIDEO | 150 - SVGA3DBLOCKDESC_Y, 238 + SVGA3DBLOCKDESC_BLUE | 239 + SVGA3DBLOCKDESC_COLOR, 240 + SVGA3DBLOCKDESC_YUV = SVGA3DBLOCKDESC_YUV_VIDEO | 241 + SVGA3DBLOCKDESC_COLOR, 151 242 SVGA3DBLOCKDESC_AYUV = SVGA3DBLOCKDESC_ALPHA | 152 - SVGA3DBLOCKDESC_Y | 153 - SVGA3DBLOCKDESC_U_VIDEO | 154 - SVGA3DBLOCKDESC_V_VIDEO, 155 - SVGA3DBLOCKDESC_RGBE = SVGA3DBLOCKDESC_RGB | 156 - SVGA3DBLOCKDESC_EXP, 157 - SVGA3DBLOCKDESC_COMPRESSED_SRGB = SVGA3DBLOCKDESC_COMPRESSED | 158 - SVGA3DBLOCKDESC_SRGB, 159 - SVGA3DBLOCKDESC_NV12 = SVGA3DBLOCKDESC_PLANAR_YUV | 160 - SVGA3DBLOCKDESC_2PLANAR_YUV, 161 - SVGA3DBLOCKDESC_YV12 = SVGA3DBLOCKDESC_PLANAR_YUV | 162 - SVGA3DBLOCKDESC_3PLANAR_YUV, 243 + SVGA3DBLOCKDESC_YUV_VIDEO | 244 + SVGA3DBLOCKDESC_COLOR, 245 + SVGA3DBLOCKDESC_RGB_EXP = SVGA3DBLOCKDESC_RED | 246 + SVGA3DBLOCKDESC_GREEN | 247 + SVGA3DBLOCKDESC_BLUE | 248 + SVGA3DBLOCKDESC_EXP | 249 + SVGA3DBLOCKDESC_COLOR, 250 + 251 + SVGA3DBLOCKDESC_COMP_TYPELESS = SVGA3DBLOCKDESC_COMPRESSED | 252 + SVGA3DBLOCKDESC_TYPELESS, 253 + SVGA3DBLOCKDESC_COMP_UNORM = SVGA3DBLOCKDESC_COMPRESSED | 254 + SVGA3DBLOCKDESC_UINT | 255 + SVGA3DBLOCKDESC_NORM | 256 + SVGA3DBLOCKDESC_COLOR, 257 + SVGA3DBLOCKDESC_COMP_SNORM = SVGA3DBLOCKDESC_COMPRESSED | 258 + SVGA3DBLOCKDESC_SINT | 259 + SVGA3DBLOCKDESC_NORM | 260 + SVGA3DBLOCKDESC_COLOR, 261 + SVGA3DBLOCKDESC_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_COMP_UNORM | 262 + SVGA3DBLOCKDESC_SRGB, 263 + SVGA3DBLOCKDESC_BC1_COMP_TYPELESS = SVGA3DBLOCKDESC_BC1 | 264 + SVGA3DBLOCKDESC_COMP_TYPELESS, 265 + SVGA3DBLOCKDESC_BC1_COMP_UNORM = SVGA3DBLOCKDESC_BC1 | 266 + SVGA3DBLOCKDESC_COMP_UNORM, 267 + SVGA3DBLOCKDESC_BC1_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC1_COMP_UNORM | 268 + SVGA3DBLOCKDESC_SRGB, 269 + SVGA3DBLOCKDESC_BC2_COMP_TYPELESS = SVGA3DBLOCKDESC_BC2 | 270 + SVGA3DBLOCKDESC_COMP_TYPELESS, 271 + SVGA3DBLOCKDESC_BC2_COMP_UNORM = SVGA3DBLOCKDESC_BC2 | 272 + SVGA3DBLOCKDESC_COMP_UNORM, 273 + SVGA3DBLOCKDESC_BC2_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC2_COMP_UNORM | 274 + SVGA3DBLOCKDESC_SRGB, 275 + SVGA3DBLOCKDESC_BC3_COMP_TYPELESS = SVGA3DBLOCKDESC_BC3 | 276 + SVGA3DBLOCKDESC_COMP_TYPELESS, 277 + SVGA3DBLOCKDESC_BC3_COMP_UNORM = SVGA3DBLOCKDESC_BC3 | 278 + SVGA3DBLOCKDESC_COMP_UNORM, 279 + SVGA3DBLOCKDESC_BC3_COMP_UNORM_SRGB = SVGA3DBLOCKDESC_BC3_COMP_UNORM | 280 + SVGA3DBLOCKDESC_SRGB, 281 + SVGA3DBLOCKDESC_BC4_COMP_TYPELESS = SVGA3DBLOCKDESC_BC4 | 282 + SVGA3DBLOCKDESC_COMP_TYPELESS, 283 + SVGA3DBLOCKDESC_BC4_COMP_UNORM = SVGA3DBLOCKDESC_BC4 | 284 + SVGA3DBLOCKDESC_COMP_UNORM, 285 + SVGA3DBLOCKDESC_BC4_COMP_SNORM = SVGA3DBLOCKDESC_BC4 | 286 + SVGA3DBLOCKDESC_COMP_SNORM, 287 + SVGA3DBLOCKDESC_BC5_COMP_TYPELESS = SVGA3DBLOCKDESC_BC5 | 288 + SVGA3DBLOCKDESC_COMP_TYPELESS, 289 + SVGA3DBLOCKDESC_BC5_COMP_UNORM = SVGA3DBLOCKDESC_BC5 | 290 + SVGA3DBLOCKDESC_COMP_UNORM, 291 + SVGA3DBLOCKDESC_BC5_COMP_SNORM = SVGA3DBLOCKDESC_BC5 | 292 + SVGA3DBLOCKDESC_COMP_SNORM, 293 + 294 + SVGA3DBLOCKDESC_NV12 = SVGA3DBLOCKDESC_YUV_VIDEO | 295 + SVGA3DBLOCKDESC_PLANAR_YUV | 296 + SVGA3DBLOCKDESC_2PLANAR_YUV | 297 + SVGA3DBLOCKDESC_COLOR, 298 + SVGA3DBLOCKDESC_YV12 = SVGA3DBLOCKDESC_YUV_VIDEO | 299 + SVGA3DBLOCKDESC_PLANAR_YUV | 300 + SVGA3DBLOCKDESC_3PLANAR_YUV | 301 + SVGA3DBLOCKDESC_COLOR, 302 + 303 + SVGA3DBLOCKDESC_DEPTH_UINT = SVGA3DBLOCKDESC_DEPTH | 304 + SVGA3DBLOCKDESC_UINT, 305 + SVGA3DBLOCKDESC_DEPTH_UNORM = SVGA3DBLOCKDESC_DEPTH_UINT | 306 + SVGA3DBLOCKDESC_NORM, 307 + SVGA3DBLOCKDESC_DS = SVGA3DBLOCKDESC_DEPTH | 308 + SVGA3DBLOCKDESC_STENCIL, 309 + SVGA3DBLOCKDESC_DS_UINT = SVGA3DBLOCKDESC_DEPTH | 310 + SVGA3DBLOCKDESC_STENCIL | 311 + SVGA3DBLOCKDESC_UINT, 312 + SVGA3DBLOCKDESC_DS_UNORM = SVGA3DBLOCKDESC_DS_UINT | 313 + SVGA3DBLOCKDESC_NORM, 314 + SVGA3DBLOCKDESC_DEPTH_FP = SVGA3DBLOCKDESC_DEPTH | 315 + SVGA3DBLOCKDESC_FP, 316 + 317 + SVGA3DBLOCKDESC_UV_UINT = SVGA3DBLOCKDESC_UV | 318 + SVGA3DBLOCKDESC_UINT, 319 + SVGA3DBLOCKDESC_UV_SNORM = SVGA3DBLOCKDESC_UV | 320 + SVGA3DBLOCKDESC_SINT | 321 + SVGA3DBLOCKDESC_NORM, 322 + SVGA3DBLOCKDESC_UVCX_SNORM = SVGA3DBLOCKDESC_UV_SNORM | 323 + SVGA3DBLOCKDESC_CX, 324 + SVGA3DBLOCKDESC_UVWQ_SNORM = SVGA3DBLOCKDESC_UVWQ | 325 + SVGA3DBLOCKDESC_SINT | 326 + SVGA3DBLOCKDESC_NORM, 163 327 }; 164 328 165 - /* 166 - * SVGA3dSurfaceDesc describes the actual pixel data. 167 - * 168 - * This structure provides the following information: 169 - * 1. Block description. 170 - * 2. Dimensions of a block in the surface. 171 - * 3. Size of block in bytes. 172 - * 4. Bit depth of the pixel data. 173 - * 5. Channel bit depths and masks (if applicable). 174 - */ 175 329 struct svga3d_channel_def { 176 330 union { 177 331 u8 blue; 178 - u8 u; 332 + u8 w_bump; 333 + u8 l_bump; 179 334 u8 uv_video; 180 335 u8 u_video; 181 336 }; 182 337 union { 183 338 u8 green; 184 - u8 v; 185 339 u8 stencil; 340 + u8 v_bump; 186 341 u8 v_video; 187 342 }; 188 343 union { 189 344 u8 red; 190 - u8 w; 345 + u8 u_bump; 191 346 u8 luminance; 192 - u8 y; 347 + u8 y_video; 193 348 u8 depth; 194 349 u8 data; 195 350 }; 196 351 union { 197 352 u8 alpha; 198 - u8 q; 353 + u8 q_bump; 199 354 u8 exp; 200 355 }; 201 356 }; 202 357 358 + /* 359 + * struct svga3d_surface_desc - describes the actual pixel data. 360 + * 361 + * @format: Format 362 + * @block_desc: Block description 363 + * @block_size: Dimensions in pixels of a block 364 + * @bytes_per_block: Size of block in bytes 365 + * @pitch_bytes_per_block: Size of a block in bytes for purposes of pitch 366 + * @bit_depth: Channel bit depths 367 + * @bit_offset: Channel bit masks (in bits offset from the start of the pointer) 368 + */ 203 369 struct svga3d_surface_desc { 204 370 SVGA3dSurfaceFormat format; 205 371 enum svga3d_block_desc block_desc; 372 + 206 373 surf_size_struct block_size; 207 374 u32 bytes_per_block; 208 375 u32 pitch_bytes_per_block; 209 376 210 - u32 total_bit_depth; 211 377 struct svga3d_channel_def bit_depth; 212 378 struct svga3d_channel_def bit_offset; 213 379 }; ··· 381 215 static const struct svga3d_surface_desc svga3d_surface_descs[] = { 382 216 {SVGA3D_FORMAT_INVALID, SVGA3DBLOCKDESC_NONE, 383 217 {1, 1, 1}, 0, 0, 384 - 0, {{0}, {0}, {0}, {0}}, 218 + {{0}, {0}, {0}, {0}}, 385 219 {{0}, {0}, {0}, {0}}}, 386 220 387 - {SVGA3D_X8R8G8B8, SVGA3DBLOCKDESC_RGB, 221 + {SVGA3D_X8R8G8B8, SVGA3DBLOCKDESC_RGB_UNORM, 388 222 {1, 1, 1}, 4, 4, 389 - 24, {{8}, {8}, {8}, {0}}, 223 + {{8}, {8}, {8}, {0}}, 390 224 {{0}, {8}, {16}, {24}}}, 391 225 392 - {SVGA3D_A8R8G8B8, SVGA3DBLOCKDESC_RGBA, 226 + {SVGA3D_A8R8G8B8, SVGA3DBLOCKDESC_RGBA_UNORM, 393 227 {1, 1, 1}, 4, 4, 394 - 32, {{8}, {8}, {8}, {8}}, 228 + {{8}, {8}, {8}, {8}}, 395 229 {{0}, {8}, {16}, {24}}}, 396 230 397 - {SVGA3D_R5G6B5, SVGA3DBLOCKDESC_RGB, 231 + {SVGA3D_R5G6B5, SVGA3DBLOCKDESC_RGB_UNORM, 398 232 {1, 1, 1}, 2, 2, 399 - 16, {{5}, {6}, {5}, {0}}, 233 + {{5}, {6}, {5}, {0}}, 400 234 {{0}, {5}, {11}, {0}}}, 401 235 402 - {SVGA3D_X1R5G5B5, SVGA3DBLOCKDESC_RGB, 236 + {SVGA3D_X1R5G5B5, SVGA3DBLOCKDESC_RGB_UNORM, 403 237 {1, 1, 1}, 2, 2, 404 - 15, {{5}, {5}, {5}, {0}}, 238 + {{5}, {5}, {5}, {0}}, 405 239 {{0}, {5}, {10}, {0}}}, 406 240 407 - {SVGA3D_A1R5G5B5, SVGA3DBLOCKDESC_RGBA, 241 + {SVGA3D_A1R5G5B5, SVGA3DBLOCKDESC_RGBA_UNORM, 408 242 {1, 1, 1}, 2, 2, 409 - 16, {{5}, {5}, {5}, {1}}, 243 + {{5}, {5}, {5}, {1}}, 410 244 {{0}, {5}, {10}, {15}}}, 411 245 412 - {SVGA3D_A4R4G4B4, SVGA3DBLOCKDESC_RGBA, 246 + {SVGA3D_A4R4G4B4, SVGA3DBLOCKDESC_RGBA_UNORM, 413 247 {1, 1, 1}, 2, 2, 414 - 16, {{4}, {4}, {4}, {4}}, 248 + {{4}, {4}, {4}, {4}}, 415 249 {{0}, {4}, {8}, {12}}}, 416 250 417 - {SVGA3D_Z_D32, SVGA3DBLOCKDESC_DEPTH, 251 + {SVGA3D_Z_D32, SVGA3DBLOCKDESC_DEPTH_UNORM, 418 252 {1, 1, 1}, 4, 4, 419 - 32, {{0}, {0}, {32}, {0}}, 253 + {{0}, {0}, {32}, {0}}, 420 254 {{0}, {0}, {0}, {0}}}, 421 255 422 - {SVGA3D_Z_D16, SVGA3DBLOCKDESC_DEPTH, 256 + {SVGA3D_Z_D16, SVGA3DBLOCKDESC_DEPTH_UNORM, 423 257 {1, 1, 1}, 2, 2, 424 - 16, {{0}, {0}, {16}, {0}}, 258 + {{0}, {0}, {16}, {0}}, 425 259 {{0}, {0}, {0}, {0}}}, 426 260 427 - {SVGA3D_Z_D24S8, SVGA3DBLOCKDESC_DS, 261 + {SVGA3D_Z_D24S8, SVGA3DBLOCKDESC_DS_UNORM, 428 262 {1, 1, 1}, 4, 4, 429 - 32, {{0}, {8}, {24}, {0}}, 430 - {{0}, {24}, {0}, {0}}}, 263 + {{0}, {8}, {24}, {0}}, 264 + {{0}, {0}, {8}, {0}}}, 431 265 432 - {SVGA3D_Z_D15S1, SVGA3DBLOCKDESC_DS, 266 + {SVGA3D_Z_D15S1, SVGA3DBLOCKDESC_DS_UNORM, 433 267 {1, 1, 1}, 2, 2, 434 - 16, {{0}, {1}, {15}, {0}}, 435 - {{0}, {15}, {0}, {0}}}, 268 + {{0}, {1}, {15}, {0}}, 269 + {{0}, {0}, {1}, {0}}}, 436 270 437 - {SVGA3D_LUMINANCE8, SVGA3DBLOCKDESC_LUMINANCE, 271 + {SVGA3D_LUMINANCE8, SVGA3DBLOCKDESC_L_UNORM, 438 272 {1, 1, 1}, 1, 1, 439 - 8, {{0}, {0}, {8}, {0}}, 273 + {{0}, {0}, {8}, {0}}, 440 274 {{0}, {0}, {0}, {0}}}, 441 275 442 - {SVGA3D_LUMINANCE4_ALPHA4, SVGA3DBLOCKDESC_LA, 443 - {1 , 1, 1}, 1, 1, 444 - 8, {{0}, {0}, {4}, {4}}, 276 + {SVGA3D_LUMINANCE4_ALPHA4, SVGA3DBLOCKDESC_LA_UNORM, 277 + {1, 1, 1}, 1, 1, 278 + {{0}, {0}, {4}, {4}}, 445 279 {{0}, {0}, {0}, {4}}}, 446 280 447 - {SVGA3D_LUMINANCE16, SVGA3DBLOCKDESC_LUMINANCE, 281 + {SVGA3D_LUMINANCE16, SVGA3DBLOCKDESC_L_UNORM, 448 282 {1, 1, 1}, 2, 2, 449 - 16, {{0}, {0}, {16}, {0}}, 283 + {{0}, {0}, {16}, {0}}, 450 284 {{0}, {0}, {0}, {0}}}, 451 285 452 - {SVGA3D_LUMINANCE8_ALPHA8, SVGA3DBLOCKDESC_LA, 286 + {SVGA3D_LUMINANCE8_ALPHA8, SVGA3DBLOCKDESC_LA_UNORM, 453 287 {1, 1, 1}, 2, 2, 454 - 16, {{0}, {0}, {8}, {8}}, 288 + {{0}, {0}, {8}, {8}}, 455 289 {{0}, {0}, {0}, {8}}}, 456 290 457 - {SVGA3D_DXT1, SVGA3DBLOCKDESC_COMPRESSED, 291 + {SVGA3D_DXT1, SVGA3DBLOCKDESC_BC1_COMP_UNORM, 458 292 {4, 4, 1}, 8, 8, 459 - 64, {{0}, {0}, {64}, {0}}, 293 + {{0}, {0}, {64}, {0}}, 460 294 {{0}, {0}, {0}, {0}}}, 461 295 462 - {SVGA3D_DXT2, SVGA3DBLOCKDESC_COMPRESSED, 296 + {SVGA3D_DXT2, SVGA3DBLOCKDESC_BC2_COMP_UNORM, 463 297 {4, 4, 1}, 16, 16, 464 - 128, {{0}, {0}, {128}, {0}}, 298 + {{0}, {0}, {128}, {0}}, 465 299 {{0}, {0}, {0}, {0}}}, 466 300 467 - {SVGA3D_DXT3, SVGA3DBLOCKDESC_COMPRESSED, 301 + {SVGA3D_DXT3, SVGA3DBLOCKDESC_BC2_COMP_UNORM, 468 302 {4, 4, 1}, 16, 16, 469 - 128, {{0}, {0}, {128}, {0}}, 303 + {{0}, {0}, {128}, {0}}, 470 304 {{0}, {0}, {0}, {0}}}, 471 305 472 - {SVGA3D_DXT4, SVGA3DBLOCKDESC_COMPRESSED, 306 + {SVGA3D_DXT4, SVGA3DBLOCKDESC_BC3_COMP_UNORM, 473 307 {4, 4, 1}, 16, 16, 474 - 128, {{0}, {0}, {128}, {0}}, 308 + {{0}, {0}, {128}, {0}}, 475 309 {{0}, {0}, {0}, {0}}}, 476 310 477 - {SVGA3D_DXT5, SVGA3DBLOCKDESC_COMPRESSED, 311 + {SVGA3D_DXT5, SVGA3DBLOCKDESC_BC3_COMP_UNORM, 478 312 {4, 4, 1}, 16, 16, 479 - 128, {{0}, {0}, {128}, {0}}, 313 + {{0}, {0}, {128}, {0}}, 480 314 {{0}, {0}, {0}, {0}}}, 481 315 482 - {SVGA3D_BUMPU8V8, SVGA3DBLOCKDESC_UV, 316 + {SVGA3D_BUMPU8V8, SVGA3DBLOCKDESC_UV_SNORM, 483 317 {1, 1, 1}, 2, 2, 484 - 16, {{0}, {0}, {8}, {8}}, 485 - {{0}, {0}, {0}, {8}}}, 318 + {{0}, {8}, {8}, {0}}, 319 + {{0}, {8}, {0}, {0}}}, 486 320 487 321 {SVGA3D_BUMPL6V5U5, SVGA3DBLOCKDESC_UVL, 488 322 {1, 1, 1}, 2, 2, 489 - 16, {{5}, {5}, {6}, {0}}, 490 - {{11}, {6}, {0}, {0}}}, 323 + {{6}, {5}, {5}, {0}}, 324 + {{10}, {5}, {0}, {0}}}, 491 325 492 326 {SVGA3D_BUMPX8L8V8U8, SVGA3DBLOCKDESC_UVL, 493 327 {1, 1, 1}, 4, 4, 494 - 32, {{8}, {8}, {8}, {0}}, 328 + {{8}, {8}, {8}, {0}}, 495 329 {{16}, {8}, {0}, {0}}}, 496 330 497 - {SVGA3D_BUMPL8V8U8, SVGA3DBLOCKDESC_UVL, 331 + {SVGA3D_FORMAT_DEAD1, SVGA3DBLOCKDESC_UVL, 498 332 {1, 1, 1}, 3, 3, 499 - 24, {{8}, {8}, {8}, {0}}, 333 + {{8}, {8}, {8}, {0}}, 500 334 {{16}, {8}, {0}, {0}}}, 501 335 502 336 {SVGA3D_ARGB_S10E5, SVGA3DBLOCKDESC_RGBA_FP, 503 337 {1, 1, 1}, 8, 8, 504 - 64, {{16}, {16}, {16}, {16}}, 338 + {{16}, {16}, {16}, {16}}, 505 339 {{32}, {16}, {0}, {48}}}, 506 340 507 341 {SVGA3D_ARGB_S23E8, SVGA3DBLOCKDESC_RGBA_FP, 508 342 {1, 1, 1}, 16, 16, 509 - 128, {{32}, {32}, {32}, {32}}, 343 + {{32}, {32}, {32}, {32}}, 510 344 {{64}, {32}, {0}, {96}}}, 511 345 512 - {SVGA3D_A2R10G10B10, SVGA3DBLOCKDESC_RGBA, 346 + {SVGA3D_A2R10G10B10, SVGA3DBLOCKDESC_RGBA_UNORM, 513 347 {1, 1, 1}, 4, 4, 514 - 32, {{10}, {10}, {10}, {2}}, 348 + {{10}, {10}, {10}, {2}}, 515 349 {{0}, {10}, {20}, {30}}}, 516 350 517 - {SVGA3D_V8U8, SVGA3DBLOCKDESC_UV, 351 + {SVGA3D_V8U8, SVGA3DBLOCKDESC_UV_SNORM, 518 352 {1, 1, 1}, 2, 2, 519 - 16, {{8}, {8}, {0}, {0}}, 520 - {{8}, {0}, {0}, {0}}}, 353 + {{0}, {8}, {8}, {0}}, 354 + {{0}, {8}, {0}, {0}}}, 521 355 522 - {SVGA3D_Q8W8V8U8, SVGA3DBLOCKDESC_UVWQ, 356 + {SVGA3D_Q8W8V8U8, SVGA3DBLOCKDESC_UVWQ_SNORM, 523 357 {1, 1, 1}, 4, 4, 524 - 32, {{8}, {8}, {8}, {8}}, 525 - {{24}, {16}, {8}, {0}}}, 358 + {{8}, {8}, {8}, {8}}, 359 + {{16}, {8}, {0}, {24}}}, 526 360 527 - {SVGA3D_CxV8U8, SVGA3DBLOCKDESC_UV, 361 + {SVGA3D_CxV8U8, SVGA3DBLOCKDESC_UVCX_SNORM, 528 362 {1, 1, 1}, 2, 2, 529 - 16, {{8}, {8}, {0}, {0}}, 530 - {{8}, {0}, {0}, {0}}}, 363 + {{0}, {8}, {8}, {0}}, 364 + {{0}, {8}, {0}, {0}}}, 531 365 532 366 {SVGA3D_X8L8V8U8, SVGA3DBLOCKDESC_UVL, 533 367 {1, 1, 1}, 4, 4, 534 - 24, {{8}, {8}, {8}, {0}}, 368 + {{8}, {8}, {8}, {0}}, 535 369 {{16}, {8}, {0}, {0}}}, 536 370 537 371 {SVGA3D_A2W10V10U10, SVGA3DBLOCKDESC_UVWA, 538 372 {1, 1, 1}, 4, 4, 539 - 32, {{10}, {10}, {10}, {2}}, 540 - {{0}, {10}, {20}, {30}}}, 373 + {{10}, {10}, {10}, {2}}, 374 + {{20}, {10}, {0}, {30}}}, 541 375 542 - {SVGA3D_ALPHA8, SVGA3DBLOCKDESC_ALPHA, 376 + {SVGA3D_ALPHA8, SVGA3DBLOCKDESC_A_UNORM, 543 377 {1, 1, 1}, 1, 1, 544 - 8, {{0}, {0}, {0}, {8}}, 378 + {{0}, {0}, {0}, {8}}, 545 379 {{0}, {0}, {0}, {0}}}, 546 380 547 381 {SVGA3D_R_S10E5, SVGA3DBLOCKDESC_R_FP, 548 382 {1, 1, 1}, 2, 2, 549 - 16, {{0}, {0}, {16}, {0}}, 383 + {{0}, {0}, {16}, {0}}, 550 384 {{0}, {0}, {0}, {0}}}, 551 385 552 386 {SVGA3D_R_S23E8, SVGA3DBLOCKDESC_R_FP, 553 387 {1, 1, 1}, 4, 4, 554 - 32, {{0}, {0}, {32}, {0}}, 388 + {{0}, {0}, {32}, {0}}, 555 389 {{0}, {0}, {0}, {0}}}, 556 390 557 391 {SVGA3D_RG_S10E5, SVGA3DBLOCKDESC_RG_FP, 558 392 {1, 1, 1}, 4, 4, 559 - 32, {{0}, {16}, {16}, {0}}, 393 + {{0}, {16}, {16}, {0}}, 560 394 {{0}, {16}, {0}, {0}}}, 561 395 562 396 {SVGA3D_RG_S23E8, SVGA3DBLOCKDESC_RG_FP, 563 397 {1, 1, 1}, 8, 8, 564 - 64, {{0}, {32}, {32}, {0}}, 398 + {{0}, {32}, {32}, {0}}, 565 399 {{0}, {32}, {0}, {0}}}, 566 400 567 401 {SVGA3D_BUFFER, SVGA3DBLOCKDESC_BUFFER, 568 402 {1, 1, 1}, 1, 1, 569 - 8, {{0}, {0}, {8}, {0}}, 403 + {{0}, {0}, {8}, {0}}, 570 404 {{0}, {0}, {0}, {0}}}, 571 405 572 - {SVGA3D_Z_D24X8, SVGA3DBLOCKDESC_DEPTH, 406 + {SVGA3D_Z_D24X8, SVGA3DBLOCKDESC_DEPTH_UNORM, 573 407 {1, 1, 1}, 4, 4, 574 - 32, {{0}, {0}, {24}, {0}}, 575 - {{0}, {24}, {0}, {0}}}, 408 + {{0}, {0}, {24}, {0}}, 409 + {{0}, {0}, {8}, {0}}}, 576 410 577 - {SVGA3D_V16U16, SVGA3DBLOCKDESC_UV, 411 + {SVGA3D_V16U16, SVGA3DBLOCKDESC_UV_SNORM, 578 412 {1, 1, 1}, 4, 4, 579 - 32, {{16}, {16}, {0}, {0}}, 580 - {{16}, {0}, {0}, {0}}}, 413 + {{0}, {16}, {16}, {0}}, 414 + {{0}, {16}, {0}, {0}}}, 581 415 582 - {SVGA3D_G16R16, SVGA3DBLOCKDESC_RG, 416 + {SVGA3D_G16R16, SVGA3DBLOCKDESC_RG_UNORM, 583 417 {1, 1, 1}, 4, 4, 584 - 32, {{0}, {16}, {16}, {0}}, 585 - {{0}, {0}, {16}, {0}}}, 418 + {{0}, {16}, {16}, {0}}, 419 + {{0}, {16}, {0}, {0}}}, 586 420 587 - {SVGA3D_A16B16G16R16, SVGA3DBLOCKDESC_RGBA, 421 + {SVGA3D_A16B16G16R16, SVGA3DBLOCKDESC_RGBA_UNORM, 588 422 {1, 1, 1}, 8, 8, 589 - 64, {{16}, {16}, {16}, {16}}, 423 + {{16}, {16}, {16}, {16}}, 590 424 {{32}, {16}, {0}, {48}}}, 591 425 592 426 {SVGA3D_UYVY, SVGA3DBLOCKDESC_YUV, 593 - {1, 1, 1}, 2, 2, 594 - 16, {{8}, {0}, {8}, {0}}, 427 + {2, 1, 1}, 4, 4, 428 + {{8}, {0}, {8}, {0}}, 595 429 {{0}, {0}, {8}, {0}}}, 596 430 597 431 {SVGA3D_YUY2, SVGA3DBLOCKDESC_YUV, 598 - {1, 1, 1}, 2, 2, 599 - 16, {{8}, {0}, {8}, {0}}, 432 + {2, 1, 1}, 4, 4, 433 + {{8}, {0}, {8}, {0}}, 600 434 {{8}, {0}, {0}, {0}}}, 601 435 602 436 {SVGA3D_NV12, SVGA3DBLOCKDESC_NV12, 603 437 {2, 2, 1}, 6, 2, 604 - 48, {{0}, {0}, {48}, {0}}, 438 + {{0}, {0}, {48}, {0}}, 605 439 {{0}, {0}, {0}, {0}}}, 606 440 607 441 {SVGA3D_AYUV, SVGA3DBLOCKDESC_AYUV, 608 442 {1, 1, 1}, 4, 4, 609 - 32, {{8}, {8}, {8}, {8}}, 443 + {{8}, {8}, {8}, {8}}, 610 444 {{0}, {8}, {16}, {24}}}, 611 445 612 - {SVGA3D_R32G32B32A32_TYPELESS, SVGA3DBLOCKDESC_RGBA, 446 + {SVGA3D_R32G32B32A32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 613 447 {1, 1, 1}, 16, 16, 614 - 128, {{32}, {32}, {32}, {32}}, 448 + {{32}, {32}, {32}, {32}}, 615 449 {{64}, {32}, {0}, {96}}}, 616 450 617 - {SVGA3D_R32G32B32A32_UINT, SVGA3DBLOCKDESC_RGBA, 451 + {SVGA3D_R32G32B32A32_UINT, SVGA3DBLOCKDESC_RGBA_UINT, 618 452 {1, 1, 1}, 16, 16, 619 - 128, {{32}, {32}, {32}, {32}}, 453 + {{32}, {32}, {32}, {32}}, 620 454 {{64}, {32}, {0}, {96}}}, 621 455 622 - {SVGA3D_R32G32B32A32_SINT, SVGA3DBLOCKDESC_UVWQ, 456 + {SVGA3D_R32G32B32A32_SINT, SVGA3DBLOCKDESC_RGBA_SINT, 623 457 {1, 1, 1}, 16, 16, 624 - 128, {{32}, {32}, {32}, {32}}, 458 + {{32}, {32}, {32}, {32}}, 625 459 {{64}, {32}, {0}, {96}}}, 626 460 627 - {SVGA3D_R32G32B32_TYPELESS, SVGA3DBLOCKDESC_RGB, 461 + {SVGA3D_R32G32B32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 628 462 {1, 1, 1}, 12, 12, 629 - 96, {{32}, {32}, {32}, {0}}, 463 + {{32}, {32}, {32}, {0}}, 630 464 {{64}, {32}, {0}, {0}}}, 631 465 632 466 {SVGA3D_R32G32B32_FLOAT, SVGA3DBLOCKDESC_RGB_FP, 633 467 {1, 1, 1}, 12, 12, 634 - 96, {{32}, {32}, {32}, {0}}, 468 + {{32}, {32}, {32}, {0}}, 635 469 {{64}, {32}, {0}, {0}}}, 636 470 637 - {SVGA3D_R32G32B32_UINT, SVGA3DBLOCKDESC_RGB, 471 + {SVGA3D_R32G32B32_UINT, SVGA3DBLOCKDESC_RGB_UINT, 638 472 {1, 1, 1}, 12, 12, 639 - 96, {{32}, {32}, {32}, {0}}, 473 + {{32}, {32}, {32}, {0}}, 640 474 {{64}, {32}, {0}, {0}}}, 641 475 642 - {SVGA3D_R32G32B32_SINT, SVGA3DBLOCKDESC_UVW, 476 + {SVGA3D_R32G32B32_SINT, SVGA3DBLOCKDESC_RGB_SINT, 643 477 {1, 1, 1}, 12, 12, 644 - 96, {{32}, {32}, {32}, {0}}, 478 + {{32}, {32}, {32}, {0}}, 645 479 {{64}, {32}, {0}, {0}}}, 646 480 647 - {SVGA3D_R16G16B16A16_TYPELESS, SVGA3DBLOCKDESC_RGBA, 481 + {SVGA3D_R16G16B16A16_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 648 482 {1, 1, 1}, 8, 8, 649 - 64, {{16}, {16}, {16}, {16}}, 483 + {{16}, {16}, {16}, {16}}, 650 484 {{32}, {16}, {0}, {48}}}, 651 485 652 - {SVGA3D_R16G16B16A16_UINT, SVGA3DBLOCKDESC_RGBA, 486 + {SVGA3D_R16G16B16A16_UINT, SVGA3DBLOCKDESC_RGBA_UINT, 653 487 {1, 1, 1}, 8, 8, 654 - 64, {{16}, {16}, {16}, {16}}, 488 + {{16}, {16}, {16}, {16}}, 655 489 {{32}, {16}, {0}, {48}}}, 656 490 657 - {SVGA3D_R16G16B16A16_SNORM, SVGA3DBLOCKDESC_UVWQ, 491 + {SVGA3D_R16G16B16A16_SNORM, SVGA3DBLOCKDESC_RGBA_SNORM, 658 492 {1, 1, 1}, 8, 8, 659 - 64, {{16}, {16}, {16}, {16}}, 493 + {{16}, {16}, {16}, {16}}, 660 494 {{32}, {16}, {0}, {48}}}, 661 495 662 - {SVGA3D_R16G16B16A16_SINT, SVGA3DBLOCKDESC_UVWQ, 496 + {SVGA3D_R16G16B16A16_SINT, SVGA3DBLOCKDESC_RGBA_SINT, 663 497 {1, 1, 1}, 8, 8, 664 - 64, {{16}, {16}, {16}, {16}}, 498 + {{16}, {16}, {16}, {16}}, 665 499 {{32}, {16}, {0}, {48}}}, 666 500 667 - {SVGA3D_R32G32_TYPELESS, SVGA3DBLOCKDESC_RG, 501 + {SVGA3D_R32G32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 668 502 {1, 1, 1}, 8, 8, 669 - 64, {{0}, {32}, {32}, {0}}, 503 + {{0}, {32}, {32}, {0}}, 670 504 {{0}, {32}, {0}, {0}}}, 671 505 672 - {SVGA3D_R32G32_UINT, SVGA3DBLOCKDESC_RG, 506 + {SVGA3D_R32G32_UINT, SVGA3DBLOCKDESC_RG_UINT, 673 507 {1, 1, 1}, 8, 8, 674 - 64, {{0}, {32}, {32}, {0}}, 508 + {{0}, {32}, {32}, {0}}, 675 509 {{0}, {32}, {0}, {0}}}, 676 510 677 - {SVGA3D_R32G32_SINT, SVGA3DBLOCKDESC_UV, 511 + {SVGA3D_R32G32_SINT, SVGA3DBLOCKDESC_RG_SINT, 678 512 {1, 1, 1}, 8, 8, 679 - 64, {{0}, {32}, {32}, {0}}, 513 + {{0}, {32}, {32}, {0}}, 680 514 {{0}, {32}, {0}, {0}}}, 681 515 682 - {SVGA3D_R32G8X24_TYPELESS, SVGA3DBLOCKDESC_RG, 516 + {SVGA3D_R32G8X24_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 683 517 {1, 1, 1}, 8, 8, 684 - 64, {{0}, {8}, {32}, {0}}, 518 + {{0}, {8}, {32}, {0}}, 685 519 {{0}, {32}, {0}, {0}}}, 686 520 687 521 {SVGA3D_D32_FLOAT_S8X24_UINT, SVGA3DBLOCKDESC_DS, 688 522 {1, 1, 1}, 8, 8, 689 - 64, {{0}, {8}, {32}, {0}}, 523 + {{0}, {8}, {32}, {0}}, 690 524 {{0}, {32}, {0}, {0}}}, 691 525 692 - {SVGA3D_R32_FLOAT_X8X24_TYPELESS, SVGA3DBLOCKDESC_R_FP, 526 + {SVGA3D_R32_FLOAT_X8X24, SVGA3DBLOCKDESC_R_FP, 693 527 {1, 1, 1}, 8, 8, 694 - 64, {{0}, {0}, {32}, {0}}, 528 + {{0}, {0}, {32}, {0}}, 695 529 {{0}, {0}, {0}, {0}}}, 696 530 697 - {SVGA3D_X32_TYPELESS_G8X24_UINT, SVGA3DBLOCKDESC_GREEN, 531 + {SVGA3D_X32_G8X24_UINT, SVGA3DBLOCKDESC_G_UINT, 698 532 {1, 1, 1}, 8, 8, 699 - 64, {{0}, {8}, {0}, {0}}, 533 + {{0}, {8}, {0}, {0}}, 700 534 {{0}, {32}, {0}, {0}}}, 701 535 702 - {SVGA3D_R10G10B10A2_TYPELESS, SVGA3DBLOCKDESC_RGBA, 536 + {SVGA3D_R10G10B10A2_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 703 537 {1, 1, 1}, 4, 4, 704 - 32, {{10}, {10}, {10}, {2}}, 705 - {{0}, {10}, {20}, {30}}}, 538 + {{10}, {10}, {10}, {2}}, 539 + {{20}, {10}, {0}, {30}}}, 706 540 707 - {SVGA3D_R10G10B10A2_UINT, SVGA3DBLOCKDESC_RGBA, 541 + {SVGA3D_R10G10B10A2_UINT, SVGA3DBLOCKDESC_RGBA_UINT, 708 542 {1, 1, 1}, 4, 4, 709 - 32, {{10}, {10}, {10}, {2}}, 710 - {{0}, {10}, {20}, {30}}}, 543 + {{10}, {10}, {10}, {2}}, 544 + {{20}, {10}, {0}, {30}}}, 711 545 712 546 {SVGA3D_R11G11B10_FLOAT, SVGA3DBLOCKDESC_RGB_FP, 713 547 {1, 1, 1}, 4, 4, 714 - 32, {{10}, {11}, {11}, {0}}, 715 - {{0}, {10}, {21}, {0}}}, 548 + {{10}, {11}, {11}, {0}}, 549 + {{22}, {11}, {0}, {0}}}, 716 550 717 - {SVGA3D_R8G8B8A8_TYPELESS, SVGA3DBLOCKDESC_RGBA, 551 + {SVGA3D_R8G8B8A8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 718 552 {1, 1, 1}, 4, 4, 719 - 32, {{8}, {8}, {8}, {8}}, 553 + {{8}, {8}, {8}, {8}}, 720 554 {{16}, {8}, {0}, {24}}}, 721 555 722 - {SVGA3D_R8G8B8A8_UNORM, SVGA3DBLOCKDESC_RGBA, 556 + {SVGA3D_R8G8B8A8_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 723 557 {1, 1, 1}, 4, 4, 724 - 32, {{8}, {8}, {8}, {8}}, 558 + {{8}, {8}, {8}, {8}}, 725 559 {{16}, {8}, {0}, {24}}}, 726 560 727 - {SVGA3D_R8G8B8A8_UNORM_SRGB, SVGA3DBLOCKDESC_RGBA_SRGB, 561 + {SVGA3D_R8G8B8A8_UNORM_SRGB, SVGA3DBLOCKDESC_RGBA_UNORM_SRGB, 728 562 {1, 1, 1}, 4, 4, 729 - 32, {{8}, {8}, {8}, {8}}, 563 + {{8}, {8}, {8}, {8}}, 730 564 {{16}, {8}, {0}, {24}}}, 731 565 732 - {SVGA3D_R8G8B8A8_UINT, SVGA3DBLOCKDESC_RGBA, 566 + {SVGA3D_R8G8B8A8_UINT, SVGA3DBLOCKDESC_RGBA_UINT, 733 567 {1, 1, 1}, 4, 4, 734 - 32, {{8}, {8}, {8}, {8}}, 568 + {{8}, {8}, {8}, {8}}, 735 569 {{16}, {8}, {0}, {24}}}, 736 570 737 - {SVGA3D_R8G8B8A8_SINT, SVGA3DBLOCKDESC_RGBA, 571 + {SVGA3D_R8G8B8A8_SINT, SVGA3DBLOCKDESC_RGBA_SINT, 738 572 {1, 1, 1}, 4, 4, 739 - 32, {{8}, {8}, {8}, {8}}, 573 + {{8}, {8}, {8}, {8}}, 740 574 {{16}, {8}, {0}, {24}}}, 741 575 742 - {SVGA3D_R16G16_TYPELESS, SVGA3DBLOCKDESC_RG, 576 + {SVGA3D_R16G16_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 743 577 {1, 1, 1}, 4, 4, 744 - 32, {{0}, {16}, {16}, {0}}, 578 + {{0}, {16}, {16}, {0}}, 745 579 {{0}, {16}, {0}, {0}}}, 746 580 747 - {SVGA3D_R16G16_UINT, SVGA3DBLOCKDESC_RG_FP, 581 + {SVGA3D_R16G16_UINT, SVGA3DBLOCKDESC_RG_UINT, 748 582 {1, 1, 1}, 4, 4, 749 - 32, {{0}, {16}, {16}, {0}}, 583 + {{0}, {16}, {16}, {0}}, 750 584 {{0}, {16}, {0}, {0}}}, 751 585 752 - {SVGA3D_R16G16_SINT, SVGA3DBLOCKDESC_UV, 586 + {SVGA3D_R16G16_SINT, SVGA3DBLOCKDESC_RG_SINT, 753 587 {1, 1, 1}, 4, 4, 754 - 32, {{0}, {16}, {16}, {0}}, 588 + {{0}, {16}, {16}, {0}}, 755 589 {{0}, {16}, {0}, {0}}}, 756 590 757 - {SVGA3D_R32_TYPELESS, SVGA3DBLOCKDESC_RED, 591 + {SVGA3D_R32_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 758 592 {1, 1, 1}, 4, 4, 759 - 32, {{0}, {0}, {32}, {0}}, 593 + {{0}, {0}, {32}, {0}}, 760 594 {{0}, {0}, {0}, {0}}}, 761 595 762 - {SVGA3D_D32_FLOAT, SVGA3DBLOCKDESC_DEPTH, 596 + {SVGA3D_D32_FLOAT, SVGA3DBLOCKDESC_DEPTH_FP, 763 597 {1, 1, 1}, 4, 4, 764 - 32, {{0}, {0}, {32}, {0}}, 598 + {{0}, {0}, {32}, {0}}, 765 599 {{0}, {0}, {0}, {0}}}, 766 600 767 - {SVGA3D_R32_UINT, SVGA3DBLOCKDESC_RED, 601 + {SVGA3D_R32_UINT, SVGA3DBLOCKDESC_R_UINT, 768 602 {1, 1, 1}, 4, 4, 769 - 32, {{0}, {0}, {32}, {0}}, 603 + {{0}, {0}, {32}, {0}}, 770 604 {{0}, {0}, {0}, {0}}}, 771 605 772 - {SVGA3D_R32_SINT, SVGA3DBLOCKDESC_RED, 606 + {SVGA3D_R32_SINT, SVGA3DBLOCKDESC_R_SINT, 773 607 {1, 1, 1}, 4, 4, 774 - 32, {{0}, {0}, {32}, {0}}, 608 + {{0}, {0}, {32}, {0}}, 775 609 {{0}, {0}, {0}, {0}}}, 776 610 777 - {SVGA3D_R24G8_TYPELESS, SVGA3DBLOCKDESC_RG, 611 + {SVGA3D_R24G8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 778 612 {1, 1, 1}, 4, 4, 779 - 32, {{0}, {8}, {24}, {0}}, 613 + {{0}, {8}, {24}, {0}}, 780 614 {{0}, {24}, {0}, {0}}}, 781 615 782 - {SVGA3D_D24_UNORM_S8_UINT, SVGA3DBLOCKDESC_DS, 616 + {SVGA3D_D24_UNORM_S8_UINT, SVGA3DBLOCKDESC_DS_UNORM, 783 617 {1, 1, 1}, 4, 4, 784 - 32, {{0}, {8}, {24}, {0}}, 618 + {{0}, {8}, {24}, {0}}, 785 619 {{0}, {24}, {0}, {0}}}, 786 620 787 - {SVGA3D_R24_UNORM_X8_TYPELESS, SVGA3DBLOCKDESC_RED, 621 + {SVGA3D_R24_UNORM_X8, SVGA3DBLOCKDESC_R_UNORM, 788 622 {1, 1, 1}, 4, 4, 789 - 32, {{0}, {0}, {24}, {0}}, 623 + {{0}, {0}, {24}, {0}}, 790 624 {{0}, {0}, {0}, {0}}}, 791 625 792 - {SVGA3D_X24_TYPELESS_G8_UINT, SVGA3DBLOCKDESC_GREEN, 626 + {SVGA3D_X24_G8_UINT, SVGA3DBLOCKDESC_G_UINT, 793 627 {1, 1, 1}, 4, 4, 794 - 32, {{0}, {8}, {0}, {0}}, 628 + {{0}, {8}, {0}, {0}}, 795 629 {{0}, {24}, {0}, {0}}}, 796 630 797 - {SVGA3D_R8G8_TYPELESS, SVGA3DBLOCKDESC_RG, 631 + {SVGA3D_R8G8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 798 632 {1, 1, 1}, 2, 2, 799 - 16, {{0}, {8}, {8}, {0}}, 633 + {{0}, {8}, {8}, {0}}, 800 634 {{0}, {8}, {0}, {0}}}, 801 635 802 - {SVGA3D_R8G8_UNORM, SVGA3DBLOCKDESC_RG, 636 + {SVGA3D_R8G8_UNORM, SVGA3DBLOCKDESC_RG_UNORM, 803 637 {1, 1, 1}, 2, 2, 804 - 16, {{0}, {8}, {8}, {0}}, 638 + {{0}, {8}, {8}, {0}}, 805 639 {{0}, {8}, {0}, {0}}}, 806 640 807 - {SVGA3D_R8G8_UINT, SVGA3DBLOCKDESC_RG, 641 + {SVGA3D_R8G8_UINT, SVGA3DBLOCKDESC_RG_UINT, 808 642 {1, 1, 1}, 2, 2, 809 - 16, {{0}, {8}, {8}, {0}}, 643 + {{0}, {8}, {8}, {0}}, 810 644 {{0}, {8}, {0}, {0}}}, 811 645 812 - {SVGA3D_R8G8_SINT, SVGA3DBLOCKDESC_UV, 646 + {SVGA3D_R8G8_SINT, SVGA3DBLOCKDESC_RG_SINT, 813 647 {1, 1, 1}, 2, 2, 814 - 16, {{0}, {8}, {8}, {0}}, 648 + {{0}, {8}, {8}, {0}}, 815 649 {{0}, {8}, {0}, {0}}}, 816 650 817 - {SVGA3D_R16_TYPELESS, SVGA3DBLOCKDESC_RED, 651 + {SVGA3D_R16_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 818 652 {1, 1, 1}, 2, 2, 819 - 16, {{0}, {0}, {16}, {0}}, 653 + {{0}, {0}, {16}, {0}}, 820 654 {{0}, {0}, {0}, {0}}}, 821 655 822 - {SVGA3D_R16_UNORM, SVGA3DBLOCKDESC_RED, 656 + {SVGA3D_R16_UNORM, SVGA3DBLOCKDESC_R_UNORM, 823 657 {1, 1, 1}, 2, 2, 824 - 16, {{0}, {0}, {16}, {0}}, 658 + {{0}, {0}, {16}, {0}}, 825 659 {{0}, {0}, {0}, {0}}}, 826 660 827 - {SVGA3D_R16_UINT, SVGA3DBLOCKDESC_RED, 661 + {SVGA3D_R16_UINT, SVGA3DBLOCKDESC_R_UINT, 828 662 {1, 1, 1}, 2, 2, 829 - 16, {{0}, {0}, {16}, {0}}, 663 + {{0}, {0}, {16}, {0}}, 830 664 {{0}, {0}, {0}, {0}}}, 831 665 832 - {SVGA3D_R16_SNORM, SVGA3DBLOCKDESC_U, 666 + {SVGA3D_R16_SNORM, SVGA3DBLOCKDESC_R_SNORM, 833 667 {1, 1, 1}, 2, 2, 834 - 16, {{0}, {0}, {16}, {0}}, 668 + {{0}, {0}, {16}, {0}}, 835 669 {{0}, {0}, {0}, {0}}}, 836 670 837 - {SVGA3D_R16_SINT, SVGA3DBLOCKDESC_U, 671 + {SVGA3D_R16_SINT, SVGA3DBLOCKDESC_R_SINT, 838 672 {1, 1, 1}, 2, 2, 839 - 16, {{0}, {0}, {16}, {0}}, 673 + {{0}, {0}, {16}, {0}}, 840 674 {{0}, {0}, {0}, {0}}}, 841 675 842 - {SVGA3D_R8_TYPELESS, SVGA3DBLOCKDESC_RED, 676 + {SVGA3D_R8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 843 677 {1, 1, 1}, 1, 1, 844 - 8, {{0}, {0}, {8}, {0}}, 678 + {{0}, {0}, {8}, {0}}, 845 679 {{0}, {0}, {0}, {0}}}, 846 680 847 - {SVGA3D_R8_UNORM, SVGA3DBLOCKDESC_RED, 681 + {SVGA3D_R8_UNORM, SVGA3DBLOCKDESC_R_UNORM, 848 682 {1, 1, 1}, 1, 1, 849 - 8, {{0}, {0}, {8}, {0}}, 683 + {{0}, {0}, {8}, {0}}, 850 684 {{0}, {0}, {0}, {0}}}, 851 685 852 - {SVGA3D_R8_UINT, SVGA3DBLOCKDESC_RED, 686 + {SVGA3D_R8_UINT, SVGA3DBLOCKDESC_R_UINT, 853 687 {1, 1, 1}, 1, 1, 854 - 8, {{0}, {0}, {8}, {0}}, 688 + {{0}, {0}, {8}, {0}}, 855 689 {{0}, {0}, {0}, {0}}}, 856 690 857 - {SVGA3D_R8_SNORM, SVGA3DBLOCKDESC_U, 691 + {SVGA3D_R8_SNORM, SVGA3DBLOCKDESC_R_SNORM, 858 692 {1, 1, 1}, 1, 1, 859 - 8, {{0}, {0}, {8}, {0}}, 693 + {{0}, {0}, {8}, {0}}, 860 694 {{0}, {0}, {0}, {0}}}, 861 695 862 - {SVGA3D_R8_SINT, SVGA3DBLOCKDESC_U, 696 + {SVGA3D_R8_SINT, SVGA3DBLOCKDESC_R_SINT, 863 697 {1, 1, 1}, 1, 1, 864 - 8, {{0}, {0}, {8}, {0}}, 698 + {{0}, {0}, {8}, {0}}, 865 699 {{0}, {0}, {0}, {0}}}, 866 700 867 - {SVGA3D_P8, SVGA3DBLOCKDESC_RED, 701 + {SVGA3D_P8, SVGA3DBLOCKDESC_NONE, 868 702 {1, 1, 1}, 1, 1, 869 - 8, {{0}, {0}, {8}, {0}}, 703 + {{0}, {0}, {8}, {0}}, 870 704 {{0}, {0}, {0}, {0}}}, 871 705 872 - {SVGA3D_R9G9B9E5_SHAREDEXP, SVGA3DBLOCKDESC_RGBE, 706 + {SVGA3D_R9G9B9E5_SHAREDEXP, SVGA3DBLOCKDESC_RGB_EXP, 873 707 {1, 1, 1}, 4, 4, 874 - 32, {{9}, {9}, {9}, {5}}, 708 + {{9}, {9}, {9}, {5}}, 875 709 {{18}, {9}, {0}, {27}}}, 876 710 877 - {SVGA3D_R8G8_B8G8_UNORM, SVGA3DBLOCKDESC_RG, 878 - {1, 1, 1}, 2, 2, 879 - 16, {{0}, {8}, {8}, {0}}, 711 + {SVGA3D_R8G8_B8G8_UNORM, SVGA3DBLOCKDESC_NONE, 712 + {2, 1, 1}, 4, 4, 713 + {{0}, {8}, {8}, {0}}, 714 + {{0}, {0}, {8}, {0}}}, 715 + 716 + {SVGA3D_G8R8_G8B8_UNORM, SVGA3DBLOCKDESC_NONE, 717 + {2, 1, 1}, 4, 4, 718 + {{0}, {8}, {8}, {0}}, 880 719 {{0}, {8}, {0}, {0}}}, 881 720 882 - {SVGA3D_G8R8_G8B8_UNORM, SVGA3DBLOCKDESC_RG, 721 + {SVGA3D_BC1_TYPELESS, SVGA3DBLOCKDESC_BC1_COMP_TYPELESS, 722 + {4, 4, 1}, 8, 8, 723 + {{0}, {0}, {64}, {0}}, 724 + {{0}, {0}, {0}, {0}}}, 725 + 726 + {SVGA3D_BC1_UNORM_SRGB, SVGA3DBLOCKDESC_BC1_COMP_UNORM_SRGB, 727 + {4, 4, 1}, 8, 8, 728 + {{0}, {0}, {64}, {0}}, 729 + {{0}, {0}, {0}, {0}}}, 730 + 731 + {SVGA3D_BC2_TYPELESS, SVGA3DBLOCKDESC_BC2_COMP_TYPELESS, 732 + {4, 4, 1}, 16, 16, 733 + {{0}, {0}, {128}, {0}}, 734 + {{0}, {0}, {0}, {0}}}, 735 + 736 + {SVGA3D_BC2_UNORM_SRGB, SVGA3DBLOCKDESC_BC2_COMP_UNORM_SRGB, 737 + {4, 4, 1}, 16, 16, 738 + {{0}, {0}, {128}, {0}}, 739 + {{0}, {0}, {0}, {0}}}, 740 + 741 + {SVGA3D_BC3_TYPELESS, SVGA3DBLOCKDESC_BC3_COMP_TYPELESS, 742 + {4, 4, 1}, 16, 16, 743 + {{0}, {0}, {128}, {0}}, 744 + {{0}, {0}, {0}, {0}}}, 745 + 746 + {SVGA3D_BC3_UNORM_SRGB, SVGA3DBLOCKDESC_BC3_COMP_UNORM_SRGB, 747 + {4, 4, 1}, 16, 16, 748 + {{0}, {0}, {128}, {0}}, 749 + {{0}, {0}, {0}, {0}}}, 750 + 751 + {SVGA3D_BC4_TYPELESS, SVGA3DBLOCKDESC_BC4_COMP_TYPELESS, 752 + {4, 4, 1}, 8, 8, 753 + {{0}, {0}, {64}, {0}}, 754 + {{0}, {0}, {0}, {0}}}, 755 + 756 + {SVGA3D_ATI1, SVGA3DBLOCKDESC_BC4_COMP_UNORM, 757 + {4, 4, 1}, 8, 8, 758 + {{0}, {0}, {64}, {0}}, 759 + {{0}, {0}, {0}, {0}}}, 760 + 761 + {SVGA3D_BC4_SNORM, SVGA3DBLOCKDESC_BC4_COMP_SNORM, 762 + {4, 4, 1}, 8, 8, 763 + {{0}, {0}, {64}, {0}}, 764 + {{0}, {0}, {0}, {0}}}, 765 + 766 + {SVGA3D_BC5_TYPELESS, SVGA3DBLOCKDESC_BC5_COMP_TYPELESS, 767 + {4, 4, 1}, 16, 16, 768 + {{0}, {0}, {128}, {0}}, 769 + {{0}, {0}, {0}, {0}}}, 770 + 771 + {SVGA3D_ATI2, SVGA3DBLOCKDESC_BC5_COMP_UNORM, 772 + {4, 4, 1}, 16, 16, 773 + {{0}, {0}, {128}, {0}}, 774 + {{0}, {0}, {0}, {0}}}, 775 + 776 + {SVGA3D_BC5_SNORM, SVGA3DBLOCKDESC_BC5_COMP_SNORM, 777 + {4, 4, 1}, 16, 16, 778 + {{0}, {0}, {128}, {0}}, 779 + {{0}, {0}, {0}, {0}}}, 780 + 781 + {SVGA3D_R10G10B10_XR_BIAS_A2_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 782 + {1, 1, 1}, 4, 4, 783 + {{10}, {10}, {10}, {2}}, 784 + {{20}, {10}, {0}, {30}}}, 785 + 786 + {SVGA3D_B8G8R8A8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 787 + {1, 1, 1}, 4, 4, 788 + {{8}, {8}, {8}, {8}}, 789 + {{0}, {8}, {16}, {24}}}, 790 + 791 + {SVGA3D_B8G8R8A8_UNORM_SRGB, SVGA3DBLOCKDESC_RGBA_UNORM_SRGB, 792 + {1, 1, 1}, 4, 4, 793 + {{8}, {8}, {8}, {8}}, 794 + {{0}, {8}, {16}, {24}}}, 795 + 796 + {SVGA3D_B8G8R8X8_TYPELESS, SVGA3DBLOCKDESC_TYPELESS, 797 + {1, 1, 1}, 4, 4, 798 + {{8}, {8}, {8}, {0}}, 799 + {{0}, {8}, {16}, {24}}}, 800 + 801 + {SVGA3D_B8G8R8X8_UNORM_SRGB, SVGA3DBLOCKDESC_RGB_UNORM_SRGB, 802 + {1, 1, 1}, 4, 4, 803 + {{8}, {8}, {8}, {0}}, 804 + {{0}, {8}, {16}, {24}}}, 805 + 806 + {SVGA3D_Z_DF16, SVGA3DBLOCKDESC_DEPTH_UNORM, 883 807 {1, 1, 1}, 2, 2, 884 - 16, {{0}, {8}, {8}, {0}}, 885 - {{0}, {8}, {0}, {0}}}, 886 - 887 - {SVGA3D_BC1_TYPELESS, SVGA3DBLOCKDESC_COMPRESSED, 888 - {4, 4, 1}, 8, 8, 889 - 64, {{0}, {0}, {64}, {0}}, 808 + {{0}, {0}, {16}, {0}}, 890 809 {{0}, {0}, {0}, {0}}}, 891 810 892 - {SVGA3D_BC1_UNORM_SRGB, SVGA3DBLOCKDESC_COMPRESSED_SRGB, 893 - {4, 4, 1}, 8, 8, 894 - 64, {{0}, {0}, {64}, {0}}, 895 - {{0}, {0}, {0}, {0}}}, 896 - 897 - {SVGA3D_BC2_TYPELESS, SVGA3DBLOCKDESC_COMPRESSED, 898 - {4, 4, 1}, 16, 16, 899 - 128, {{0}, {0}, {128}, {0}}, 900 - {{0}, {0}, {0}, {0}}}, 901 - 902 - {SVGA3D_BC2_UNORM_SRGB, SVGA3DBLOCKDESC_COMPRESSED_SRGB, 903 - {4, 4, 1}, 16, 16, 904 - 128, {{0}, {0}, {128}, {0}}, 905 - {{0}, {0}, {0}, {0}}}, 906 - 907 - {SVGA3D_BC3_TYPELESS, SVGA3DBLOCKDESC_COMPRESSED, 908 - {4, 4, 1}, 16, 16, 909 - 128, {{0}, {0}, {128}, {0}}, 910 - {{0}, {0}, {0}, {0}}}, 911 - 912 - {SVGA3D_BC3_UNORM_SRGB, SVGA3DBLOCKDESC_COMPRESSED_SRGB, 913 - {4, 4, 1}, 16, 16, 914 - 128, {{0}, {0}, {128}, {0}}, 915 - {{0}, {0}, {0}, {0}}}, 916 - 917 - {SVGA3D_BC4_TYPELESS, SVGA3DBLOCKDESC_COMPRESSED, 918 - {4, 4, 1}, 8, 8, 919 - 64, {{0}, {0}, {64}, {0}}, 920 - {{0}, {0}, {0}, {0}}}, 921 - 922 - {SVGA3D_ATI1, SVGA3DBLOCKDESC_COMPRESSED, 923 - {4, 4, 1}, 8, 8, 924 - 64, {{0}, {0}, {64}, {0}}, 925 - {{0}, {0}, {0}, {0}}}, 926 - 927 - {SVGA3D_BC4_SNORM, SVGA3DBLOCKDESC_COMPRESSED, 928 - {4, 4, 1}, 8, 8, 929 - 64, {{0}, {0}, {64}, {0}}, 930 - {{0}, {0}, {0}, {0}}}, 931 - 932 - {SVGA3D_BC5_TYPELESS, SVGA3DBLOCKDESC_COMPRESSED, 933 - {4, 4, 1}, 16, 16, 934 - 128, {{0}, {0}, {128}, {0}}, 935 - {{0}, {0}, {0}, {0}}}, 936 - 937 - {SVGA3D_ATI2, SVGA3DBLOCKDESC_COMPRESSED, 938 - {4, 4, 1}, 16, 16, 939 - 128, {{0}, {0}, {128}, {0}}, 940 - {{0}, {0}, {0}, {0}}}, 941 - 942 - {SVGA3D_BC5_SNORM, SVGA3DBLOCKDESC_COMPRESSED, 943 - {4, 4, 1}, 16, 16, 944 - 128, {{0}, {0}, {128}, {0}}, 945 - {{0}, {0}, {0}, {0}}}, 946 - 947 - {SVGA3D_R10G10B10_XR_BIAS_A2_UNORM, SVGA3DBLOCKDESC_RGBA, 811 + {SVGA3D_Z_DF24, SVGA3DBLOCKDESC_DEPTH_UNORM, 948 812 {1, 1, 1}, 4, 4, 949 - 32, {{10}, {10}, {10}, {2}}, 950 - {{0}, {10}, {20}, {30}}}, 813 + {{0}, {0}, {24}, {0}}, 814 + {{0}, {0}, {8}, {0}}}, 951 815 952 - {SVGA3D_B8G8R8A8_TYPELESS, SVGA3DBLOCKDESC_RGBA, 816 + {SVGA3D_Z_D24S8_INT, SVGA3DBLOCKDESC_DS_UNORM, 953 817 {1, 1, 1}, 4, 4, 954 - 32, {{8}, {8}, {8}, {8}}, 955 - {{0}, {8}, {16}, {24}}}, 956 - 957 - {SVGA3D_B8G8R8A8_UNORM_SRGB, SVGA3DBLOCKDESC_RGBA_SRGB, 958 - {1, 1, 1}, 4, 4, 959 - 32, {{8}, {8}, {8}, {8}}, 960 - {{0}, {8}, {16}, {24}}}, 961 - 962 - {SVGA3D_B8G8R8X8_TYPELESS, SVGA3DBLOCKDESC_RGB, 963 - {1, 1, 1}, 4, 4, 964 - 24, {{8}, {8}, {8}, {0}}, 965 - {{0}, {8}, {16}, {24}}}, 966 - 967 - {SVGA3D_B8G8R8X8_UNORM_SRGB, SVGA3DBLOCKDESC_RGB_SRGB, 968 - {1, 1, 1}, 4, 4, 969 - 24, {{8}, {8}, {8}, {0}}, 970 - {{0}, {8}, {16}, {24}}}, 971 - 972 - {SVGA3D_Z_DF16, SVGA3DBLOCKDESC_DEPTH, 973 - {1, 1, 1}, 2, 2, 974 - 16, {{0}, {0}, {16}, {0}}, 975 - {{0}, {0}, {0}, {0}}}, 976 - 977 - {SVGA3D_Z_DF24, SVGA3DBLOCKDESC_DEPTH, 978 - {1, 1, 1}, 4, 4, 979 - 32, {{0}, {8}, {24}, {0}}, 980 - {{0}, {24}, {0}, {0}}}, 981 - 982 - {SVGA3D_Z_D24S8_INT, SVGA3DBLOCKDESC_DS, 983 - {1, 1, 1}, 4, 4, 984 - 32, {{0}, {8}, {24}, {0}}, 985 - {{0}, {24}, {0}, {0}}}, 818 + {{0}, {8}, {24}, {0}}, 819 + {{0}, {0}, {8}, {0}}}, 986 820 987 821 {SVGA3D_YV12, SVGA3DBLOCKDESC_YV12, 988 822 {2, 2, 1}, 6, 2, 989 - 48, {{0}, {0}, {48}, {0}}, 823 + {{0}, {0}, {48}, {0}}, 990 824 {{0}, {0}, {0}, {0}}}, 991 825 992 826 {SVGA3D_R32G32B32A32_FLOAT, SVGA3DBLOCKDESC_RGBA_FP, 993 827 {1, 1, 1}, 16, 16, 994 - 128, {{32}, {32}, {32}, {32}}, 828 + {{32}, {32}, {32}, {32}}, 995 829 {{64}, {32}, {0}, {96}}}, 996 830 997 831 {SVGA3D_R16G16B16A16_FLOAT, SVGA3DBLOCKDESC_RGBA_FP, 998 832 {1, 1, 1}, 8, 8, 999 - 64, {{16}, {16}, {16}, {16}}, 833 + {{16}, {16}, {16}, {16}}, 1000 834 {{32}, {16}, {0}, {48}}}, 1001 835 1002 - {SVGA3D_R16G16B16A16_UNORM, SVGA3DBLOCKDESC_RGBA, 836 + {SVGA3D_R16G16B16A16_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 1003 837 {1, 1, 1}, 8, 8, 1004 - 64, {{16}, {16}, {16}, {16}}, 838 + {{16}, {16}, {16}, {16}}, 1005 839 {{32}, {16}, {0}, {48}}}, 1006 840 1007 841 {SVGA3D_R32G32_FLOAT, SVGA3DBLOCKDESC_RG_FP, 1008 842 {1, 1, 1}, 8, 8, 1009 - 64, {{0}, {32}, {32}, {0}}, 843 + {{0}, {32}, {32}, {0}}, 1010 844 {{0}, {32}, {0}, {0}}}, 1011 845 1012 - {SVGA3D_R10G10B10A2_UNORM, SVGA3DBLOCKDESC_RGBA, 846 + {SVGA3D_R10G10B10A2_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 1013 847 {1, 1, 1}, 4, 4, 1014 - 32, {{10}, {10}, {10}, {2}}, 1015 - {{0}, {10}, {20}, {30}}}, 848 + {{10}, {10}, {10}, {2}}, 849 + {{20}, {10}, {0}, {30}}}, 1016 850 1017 - {SVGA3D_R8G8B8A8_SNORM, SVGA3DBLOCKDESC_RGBA, 851 + {SVGA3D_R8G8B8A8_SNORM, SVGA3DBLOCKDESC_RGBA_SNORM, 1018 852 {1, 1, 1}, 4, 4, 1019 - 32, {{8}, {8}, {8}, {8}}, 1020 - {{24}, {16}, {8}, {0}}}, 853 + {{8}, {8}, {8}, {8}}, 854 + {{16}, {8}, {0}, {24}}}, 1021 855 1022 856 {SVGA3D_R16G16_FLOAT, SVGA3DBLOCKDESC_RG_FP, 1023 857 {1, 1, 1}, 4, 4, 1024 - 32, {{0}, {16}, {16}, {0}}, 858 + {{0}, {16}, {16}, {0}}, 1025 859 {{0}, {16}, {0}, {0}}}, 1026 860 1027 - {SVGA3D_R16G16_UNORM, SVGA3DBLOCKDESC_RG, 861 + {SVGA3D_R16G16_UNORM, SVGA3DBLOCKDESC_RG_UNORM, 1028 862 {1, 1, 1}, 4, 4, 1029 - 32, {{0}, {16}, {16}, {0}}, 1030 - {{0}, {0}, {16}, {0}}}, 863 + {{0}, {16}, {16}, {0}}, 864 + {{0}, {16}, {0}, {0}}}, 1031 865 1032 - {SVGA3D_R16G16_SNORM, SVGA3DBLOCKDESC_RG, 866 + {SVGA3D_R16G16_SNORM, SVGA3DBLOCKDESC_RG_SNORM, 1033 867 {1, 1, 1}, 4, 4, 1034 - 32, {{16}, {16}, {0}, {0}}, 1035 - {{16}, {0}, {0}, {0}}}, 868 + {{0}, {16}, {16}, {0}}, 869 + {{0}, {16}, {0}, {0}}}, 1036 870 1037 871 {SVGA3D_R32_FLOAT, SVGA3DBLOCKDESC_R_FP, 1038 872 {1, 1, 1}, 4, 4, 1039 - 32, {{0}, {0}, {32}, {0}}, 873 + {{0}, {0}, {32}, {0}}, 1040 874 {{0}, {0}, {0}, {0}}}, 1041 875 1042 - {SVGA3D_R8G8_SNORM, SVGA3DBLOCKDESC_RG, 876 + {SVGA3D_R8G8_SNORM, SVGA3DBLOCKDESC_RG_SNORM, 1043 877 {1, 1, 1}, 2, 2, 1044 - 16, {{8}, {8}, {0}, {0}}, 1045 - {{8}, {0}, {0}, {0}}}, 878 + {{0}, {8}, {8}, {0}}, 879 + {{0}, {8}, {0}, {0}}}, 1046 880 1047 881 {SVGA3D_R16_FLOAT, SVGA3DBLOCKDESC_R_FP, 1048 882 {1, 1, 1}, 2, 2, 1049 - 16, {{0}, {0}, {16}, {0}}, 883 + {{0}, {0}, {16}, {0}}, 1050 884 {{0}, {0}, {0}, {0}}}, 1051 885 1052 - {SVGA3D_D16_UNORM, SVGA3DBLOCKDESC_DEPTH, 886 + {SVGA3D_D16_UNORM, SVGA3DBLOCKDESC_DEPTH_UNORM, 1053 887 {1, 1, 1}, 2, 2, 1054 - 16, {{0}, {0}, {16}, {0}}, 888 + {{0}, {0}, {16}, {0}}, 1055 889 {{0}, {0}, {0}, {0}}}, 1056 890 1057 - {SVGA3D_A8_UNORM, SVGA3DBLOCKDESC_ALPHA, 891 + {SVGA3D_A8_UNORM, SVGA3DBLOCKDESC_A_UNORM, 1058 892 {1, 1, 1}, 1, 1, 1059 - 8, {{0}, {0}, {0}, {8}}, 893 + {{0}, {0}, {0}, {8}}, 1060 894 {{0}, {0}, {0}, {0}}}, 1061 895 1062 - {SVGA3D_BC1_UNORM, SVGA3DBLOCKDESC_COMPRESSED, 896 + {SVGA3D_BC1_UNORM, SVGA3DBLOCKDESC_BC1_COMP_UNORM, 1063 897 {4, 4, 1}, 8, 8, 1064 - 64, {{0}, {0}, {64}, {0}}, 898 + {{0}, {0}, {64}, {0}}, 1065 899 {{0}, {0}, {0}, {0}}}, 1066 900 1067 - {SVGA3D_BC2_UNORM, SVGA3DBLOCKDESC_COMPRESSED, 901 + {SVGA3D_BC2_UNORM, SVGA3DBLOCKDESC_BC2_COMP_UNORM, 1068 902 {4, 4, 1}, 16, 16, 1069 - 128, {{0}, {0}, {128}, {0}}, 903 + {{0}, {0}, {128}, {0}}, 1070 904 {{0}, {0}, {0}, {0}}}, 1071 905 1072 - {SVGA3D_BC3_UNORM, SVGA3DBLOCKDESC_COMPRESSED, 906 + {SVGA3D_BC3_UNORM, SVGA3DBLOCKDESC_BC3_COMP_UNORM, 1073 907 {4, 4, 1}, 16, 16, 1074 - 128, {{0}, {0}, {128}, {0}}, 908 + {{0}, {0}, {128}, {0}}, 1075 909 {{0}, {0}, {0}, {0}}}, 1076 910 1077 - {SVGA3D_B5G6R5_UNORM, SVGA3DBLOCKDESC_RGB, 911 + {SVGA3D_B5G6R5_UNORM, SVGA3DBLOCKDESC_RGB_UNORM, 1078 912 {1, 1, 1}, 2, 2, 1079 - 16, {{5}, {6}, {5}, {0}}, 913 + {{5}, {6}, {5}, {0}}, 1080 914 {{0}, {5}, {11}, {0}}}, 1081 915 1082 - {SVGA3D_B5G5R5A1_UNORM, SVGA3DBLOCKDESC_RGBA, 916 + {SVGA3D_B5G5R5A1_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 1083 917 {1, 1, 1}, 2, 2, 1084 - 16, {{5}, {5}, {5}, {1}}, 918 + {{5}, {5}, {5}, {1}}, 1085 919 {{0}, {5}, {10}, {15}}}, 1086 920 1087 - {SVGA3D_B8G8R8A8_UNORM, SVGA3DBLOCKDESC_RGBA, 921 + {SVGA3D_B8G8R8A8_UNORM, SVGA3DBLOCKDESC_RGBA_UNORM, 1088 922 {1, 1, 1}, 4, 4, 1089 - 32, {{8}, {8}, {8}, {8}}, 923 + {{8}, {8}, {8}, {8}}, 1090 924 {{0}, {8}, {16}, {24}}}, 1091 925 1092 - {SVGA3D_B8G8R8X8_UNORM, SVGA3DBLOCKDESC_RGB, 926 + {SVGA3D_B8G8R8X8_UNORM, SVGA3DBLOCKDESC_RGB_UNORM, 1093 927 {1, 1, 1}, 4, 4, 1094 - 24, {{8}, {8}, {8}, {0}}, 928 + {{8}, {8}, {8}, {0}}, 1095 929 {{0}, {8}, {16}, {24}}}, 1096 930 1097 - {SVGA3D_BC4_UNORM, SVGA3DBLOCKDESC_COMPRESSED, 931 + {SVGA3D_BC4_UNORM, SVGA3DBLOCKDESC_BC4_COMP_UNORM, 1098 932 {4, 4, 1}, 8, 8, 1099 - 64, {{0}, {0}, {64}, {0}}, 933 + {{0}, {0}, {64}, {0}}, 1100 934 {{0}, {0}, {0}, {0}}}, 1101 935 1102 - {SVGA3D_BC5_UNORM, SVGA3DBLOCKDESC_COMPRESSED, 936 + {SVGA3D_BC5_UNORM, SVGA3DBLOCKDESC_BC5_COMP_UNORM, 1103 937 {4, 4, 1}, 16, 16, 1104 - 128, {{0}, {0}, {128}, {0}}, 938 + {{0}, {0}, {128}, {0}}, 1105 939 {{0}, {0}, {0}, {0}}}, 1106 - 1107 940 }; 1108 941 1109 942 static inline u32 clamped_umul32(u32 a, u32 b) ··· 1111 946 return (tmp > (uint64_t) ((u32) -1)) ? (u32) -1 : tmp; 1112 947 } 1113 948 949 + /** 950 + * svga3dsurface_get_desc - Look up the appropriate SVGA3dSurfaceDesc for the 951 + * given format. 952 + */ 1114 953 static inline const struct svga3d_surface_desc * 1115 954 svga3dsurface_get_desc(SVGA3dSurfaceFormat format) 1116 955 { ··· 1124 955 return &svga3d_surface_descs[SVGA3D_FORMAT_INVALID]; 1125 956 } 1126 957 1127 - /* 1128 - *---------------------------------------------------------------------- 1129 - * 1130 - * svga3dsurface_get_mip_size -- 1131 - * 1132 - * Given a base level size and the mip level, compute the size of 1133 - * the mip level. 1134 - * 1135 - * Results: 1136 - * See above. 1137 - * 1138 - * Side effects: 1139 - * None. 1140 - * 1141 - *---------------------------------------------------------------------- 958 + /** 959 + * svga3dsurface_get_mip_size - Given a base level size and the mip level, 960 + * compute the size of the mip level. 1142 961 */ 1143 - 1144 962 static inline surf_size_struct 1145 963 svga3dsurface_get_mip_size(surf_size_struct base_level, u32 mip_level) 1146 964 { ··· 1174 1018 return pitch; 1175 1019 } 1176 1020 1177 - /* 1178 - *----------------------------------------------------------------------------- 1021 + /** 1022 + * svga3dsurface_get_image_buffer_size - Calculates image buffer size. 1179 1023 * 1180 - * svga3dsurface_get_image_buffer_size -- 1024 + * Return the number of bytes of buffer space required to store one image of a 1025 + * surface, optionally using the specified pitch. 1181 1026 * 1182 - * Return the number of bytes of buffer space required to store 1183 - * one image of a surface, optionally using the specified pitch. 1027 + * If pitch is zero, it is assumed that rows are tightly packed. 1184 1028 * 1185 - * If pitch is zero, it is assumed that rows are tightly packed. 1186 - * 1187 - * This function is overflow-safe. If the result would have 1188 - * overflowed, instead we return MAX_UINT32. 1189 - * 1190 - * Results: 1191 - * Byte count. 1192 - * 1193 - * Side effects: 1194 - * None. 1195 - * 1196 - *----------------------------------------------------------------------------- 1029 + * This function is overflow-safe. If the result would have overflowed, instead 1030 + * we return MAX_UINT32. 1197 1031 */ 1198 - 1199 1032 static inline u32 1200 1033 svga3dsurface_get_image_buffer_size(const struct svga3d_surface_desc *desc, 1201 1034 const surf_size_struct *size, ··· 1212 1067 return total_size; 1213 1068 } 1214 1069 1070 + /** 1071 + * svga3dsurface_get_serialized_size - Get the serialized size for the image. 1072 + */ 1215 1073 static inline u32 1216 1074 svga3dsurface_get_serialized_size(SVGA3dSurfaceFormat format, 1217 1075 surf_size_struct base_level_size, ··· 1354 1206 } 1355 1207 return svga3dsurface_is_dx_screen_target_format(format); 1356 1208 } 1209 + 1210 + #endif /* _SVGA3D_SURFACEDEFS_H_ */
+221 -110
drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h
··· 44 44 45 45 #define SVGA3D_INVALID_ID ((uint32)-1) 46 46 47 + typedef uint8 SVGABool8; /* 8-bit Bool definition */ 47 48 typedef uint32 SVGA3dBool; /* 32-bit Bool definition */ 48 49 typedef uint32 SVGA3dColor; /* a, r, g, b */ 50 + 51 + typedef uint32 SVGA3dSurfaceId; 52 + 53 + typedef 54 + #include "vmware_pack_begin.h" 55 + struct { 56 + uint32 numerator; 57 + uint32 denominator; 58 + } 59 + #include "vmware_pack_end.h" 60 + SVGA3dFraction64; 49 61 50 62 typedef 51 63 #include "vmware_pack_begin.h" ··· 157 145 SVGA3D_BUMPU8V8 = 20, 158 146 SVGA3D_BUMPL6V5U5 = 21, 159 147 SVGA3D_BUMPX8L8V8U8 = 22, 160 - SVGA3D_BUMPL8V8U8 = 23, 148 + SVGA3D_FORMAT_DEAD1 = 23, 161 149 162 150 SVGA3D_ARGB_S10E5 = 24, /* 16-bit floating-point ARGB */ 163 151 SVGA3D_ARGB_S23E8 = 25, /* 32-bit floating-point ARGB */ ··· 216 204 SVGA3D_R32G32_SINT = 59, 217 205 SVGA3D_R32G8X24_TYPELESS = 60, 218 206 SVGA3D_D32_FLOAT_S8X24_UINT = 61, 219 - SVGA3D_R32_FLOAT_X8X24_TYPELESS = 62, 220 - SVGA3D_X32_TYPELESS_G8X24_UINT = 63, 207 + SVGA3D_R32_FLOAT_X8X24 = 62, 208 + SVGA3D_X32_G8X24_UINT = 63, 221 209 SVGA3D_R10G10B10A2_TYPELESS = 64, 222 210 SVGA3D_R10G10B10A2_UINT = 65, 223 211 SVGA3D_R11G11B10_FLOAT = 66, ··· 235 223 SVGA3D_R32_SINT = 78, 236 224 SVGA3D_R24G8_TYPELESS = 79, 237 225 SVGA3D_D24_UNORM_S8_UINT = 80, 238 - SVGA3D_R24_UNORM_X8_TYPELESS = 81, 239 - SVGA3D_X24_TYPELESS_G8_UINT = 82, 226 + SVGA3D_R24_UNORM_X8 = 81, 227 + SVGA3D_X24_G8_UINT = 82, 240 228 SVGA3D_R8G8_TYPELESS = 83, 241 229 SVGA3D_R8G8_UNORM = 84, 242 230 SVGA3D_R8G8_UINT = 85, ··· 308 296 SVGA3D_FORMAT_MAX 309 297 } SVGA3dSurfaceFormat; 310 298 311 - typedef enum SVGA3dSurfaceFlags { 312 - SVGA3D_SURFACE_CUBEMAP = (1 << 0), 299 + /* 300 + * SVGA3d Surface Flags -- 301 + */ 302 + #define SVGA3D_SURFACE_CUBEMAP (1 << 0) 313 303 314 - /* 315 - * HINT flags are not enforced by the device but are useful for 316 - * performance. 317 - */ 318 - SVGA3D_SURFACE_HINT_STATIC = (1 << 1), 319 - SVGA3D_SURFACE_HINT_DYNAMIC = (1 << 2), 320 - SVGA3D_SURFACE_HINT_INDEXBUFFER = (1 << 3), 321 - SVGA3D_SURFACE_HINT_VERTEXBUFFER = (1 << 4), 322 - SVGA3D_SURFACE_HINT_TEXTURE = (1 << 5), 323 - SVGA3D_SURFACE_HINT_RENDERTARGET = (1 << 6), 324 - SVGA3D_SURFACE_HINT_DEPTHSTENCIL = (1 << 7), 325 - SVGA3D_SURFACE_HINT_WRITEONLY = (1 << 8), 326 - SVGA3D_SURFACE_MASKABLE_ANTIALIAS = (1 << 9), 327 - SVGA3D_SURFACE_AUTOGENMIPMAPS = (1 << 10), 328 - SVGA3D_SURFACE_DECODE_RENDERTARGET = (1 << 11), 304 + /* 305 + * HINT flags are not enforced by the device but are useful for 306 + * performance. 307 + */ 308 + #define SVGA3D_SURFACE_HINT_STATIC (CONST64U(1) << 1) 309 + #define SVGA3D_SURFACE_HINT_DYNAMIC (CONST64U(1) << 2) 310 + #define SVGA3D_SURFACE_HINT_INDEXBUFFER (CONST64U(1) << 3) 311 + #define SVGA3D_SURFACE_HINT_VERTEXBUFFER (CONST64U(1) << 4) 312 + #define SVGA3D_SURFACE_HINT_TEXTURE (CONST64U(1) << 5) 313 + #define SVGA3D_SURFACE_HINT_RENDERTARGET (CONST64U(1) << 6) 314 + #define SVGA3D_SURFACE_HINT_DEPTHSTENCIL (CONST64U(1) << 7) 315 + #define SVGA3D_SURFACE_HINT_WRITEONLY (CONST64U(1) << 8) 316 + #define SVGA3D_SURFACE_MASKABLE_ANTIALIAS (CONST64U(1) << 9) 317 + #define SVGA3D_SURFACE_AUTOGENMIPMAPS (CONST64U(1) << 10) 329 318 330 - /* 331 - * Is this surface using a base-level pitch for it's mob backing? 332 - * 333 - * This flag is not intended to be set by guest-drivers, but is instead 334 - * set by the device when the surface is bound to a mob with a specified 335 - * pitch. 336 - */ 337 - SVGA3D_SURFACE_MOB_PITCH = (1 << 12), 319 + #define SVGA3D_SURFACE_DECODE_RENDERTARGET (CONST64U(1) << 11) 338 320 339 - SVGA3D_SURFACE_INACTIVE = (1 << 13), 340 - SVGA3D_SURFACE_HINT_RT_LOCKABLE = (1 << 14), 341 - SVGA3D_SURFACE_VOLUME = (1 << 15), 321 + /* 322 + * Is this surface using a base-level pitch for it's mob backing? 323 + * 324 + * This flag is not intended to be set by guest-drivers, but is instead 325 + * set by the device when the surface is bound to a mob with a specified 326 + * pitch. 327 + */ 328 + #define SVGA3D_SURFACE_MOB_PITCH (CONST64U(1) << 12) 342 329 343 - /* 344 - * Required to be set on a surface to bind it to a screen target. 345 - */ 346 - SVGA3D_SURFACE_SCREENTARGET = (1 << 16), 330 + #define SVGA3D_SURFACE_INACTIVE (CONST64U(1) << 13) 331 + #define SVGA3D_SURFACE_HINT_RT_LOCKABLE (CONST64U(1) << 14) 332 + #define SVGA3D_SURFACE_VOLUME (CONST64U(1) << 15) 347 333 348 - /* 349 - * Align images in the guest-backing mob to 16-bytes. 350 - */ 351 - SVGA3D_SURFACE_ALIGN16 = (1 << 17), 334 + /* 335 + * Required to be set on a surface to bind it to a screen target. 336 + */ 337 + #define SVGA3D_SURFACE_SCREENTARGET (CONST64U(1) << 16) 352 338 353 - SVGA3D_SURFACE_1D = (1 << 18), 354 - SVGA3D_SURFACE_ARRAY = (1 << 19), 339 + /* 340 + * Align images in the guest-backing mob to 16-bytes. 341 + */ 342 + #define SVGA3D_SURFACE_ALIGN16 (CONST64U(1) << 17) 355 343 356 - /* 357 - * Bind flags. 358 - * These are enforced for any surface defined with DefineGBSurface_v2. 359 - */ 360 - SVGA3D_SURFACE_BIND_VERTEX_BUFFER = (1 << 20), 361 - SVGA3D_SURFACE_BIND_INDEX_BUFFER = (1 << 21), 362 - SVGA3D_SURFACE_BIND_CONSTANT_BUFFER = (1 << 22), 363 - SVGA3D_SURFACE_BIND_SHADER_RESOURCE = (1 << 23), 364 - SVGA3D_SURFACE_BIND_RENDER_TARGET = (1 << 24), 365 - SVGA3D_SURFACE_BIND_DEPTH_STENCIL = (1 << 25), 366 - SVGA3D_SURFACE_BIND_STREAM_OUTPUT = (1 << 26), 344 + #define SVGA3D_SURFACE_1D (CONST64U(1) << 18) 345 + #define SVGA3D_SURFACE_ARRAY (CONST64U(1) << 19) 367 346 368 - /* 369 - * A note on staging flags: 370 - * 371 - * The STAGING flags notes that the surface will not be used directly by the 372 - * drawing pipeline, i.e. that it will not be bound to any bind point. 373 - * Staging surfaces may be used by copy operations to move data in and out 374 - * of other surfaces. 375 - * 376 - * The HINT_INDIRECT_UPDATE flag suggests that the surface will receive 377 - * updates indirectly, i.e. the surface will not be updated directly, but 378 - * will receive copies from staging surfaces. 379 - */ 380 - SVGA3D_SURFACE_STAGING_UPLOAD = (1 << 27), 381 - SVGA3D_SURFACE_STAGING_DOWNLOAD = (1 << 28), 382 - SVGA3D_SURFACE_HINT_INDIRECT_UPDATE = (1 << 29), 347 + /* 348 + * Bind flags. 349 + * These are enforced for any surface defined with DefineGBSurface_v2. 350 + */ 351 + #define SVGA3D_SURFACE_BIND_VERTEX_BUFFER (CONST64U(1) << 20) 352 + #define SVGA3D_SURFACE_BIND_INDEX_BUFFER (CONST64U(1) << 21) 353 + #define SVGA3D_SURFACE_BIND_CONSTANT_BUFFER (CONST64U(1) << 22) 354 + #define SVGA3D_SURFACE_BIND_SHADER_RESOURCE (CONST64U(1) << 23) 355 + #define SVGA3D_SURFACE_BIND_RENDER_TARGET (CONST64U(1) << 24) 356 + #define SVGA3D_SURFACE_BIND_DEPTH_STENCIL (CONST64U(1) << 25) 357 + #define SVGA3D_SURFACE_BIND_STREAM_OUTPUT (CONST64U(1) << 26) 383 358 384 - /* 385 - * Setting this flag allow this surface to be used with the 386 - * SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER command. It is only valid for 387 - * buffer surfaces, an no bind flags are allowed to be set on surfaces 388 - * with this flag. 389 - */ 390 - SVGA3D_SURFACE_TRANSFER_FROM_BUFFER = (1 << 30), 359 + /* 360 + * The STAGING flags notes that the surface will not be used directly by the 361 + * drawing pipeline, i.e. that it will not be bound to any bind point. 362 + * Staging surfaces may be used by copy operations to move data in and out 363 + * of other surfaces. No bind flags may be set on surfaces with this flag. 364 + * 365 + * The HINT_INDIRECT_UPDATE flag suggests that the surface will receive 366 + * updates indirectly, i.e. the surface will not be updated directly, but 367 + * will receive copies from staging surfaces. 368 + */ 369 + #define SVGA3D_SURFACE_STAGING_UPLOAD (CONST64U(1) << 27) 370 + #define SVGA3D_SURFACE_STAGING_DOWNLOAD (CONST64U(1) << 28) 371 + #define SVGA3D_SURFACE_HINT_INDIRECT_UPDATE (CONST64U(1) << 29) 391 372 392 - /* 393 - * Marker for the last defined bit. 394 - */ 395 - SVGA3D_SURFACE_FLAG_MAX = (1 << 31), 396 - } SVGA3dSurfaceFlags; 373 + /* 374 + * Setting this flag allow this surface to be used with the 375 + * SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER command. It is only valid for 376 + * buffer surfaces, and no bind flags are allowed to be set on surfaces 377 + * with this flag. 378 + */ 379 + #define SVGA3D_SURFACE_TRANSFER_FROM_BUFFER (CONST64U(1) << 30) 380 + 381 + /* 382 + * Reserved for video operations. 383 + */ 384 + #define SVGA3D_SURFACE_RESERVED1 (CONST64U(1) << 31) 385 + 386 + /* 387 + * Specifies that a surface is multisample, and therefore requires the full 388 + * mob-backing to store all the samples. 389 + */ 390 + #define SVGA3D_SURFACE_MULTISAMPLE (CONST64U(1) << 32) 391 + 392 + #define SVGA3D_SURFACE_FLAG_MAX (CONST64U(1) << 33) 393 + 394 + /* 395 + * Surface flags types: 396 + * 397 + * SVGA3dSurface1Flags: Lower 32-bits of flags. 398 + * SVGA3dSurface2Flags: Upper 32-bits of flags. 399 + * SVGA3dSurfaceAllFlags: Full 64-bits of flags. 400 + */ 401 + typedef uint32 SVGA3dSurface1Flags; 402 + typedef uint32 SVGA3dSurface2Flags; 403 + typedef uint64 SVGA3dSurfaceAllFlags; 404 + 405 + #define SVGA3D_SURFACE_FLAGS1_MASK ((uint64_t)MAX_UINT32) 406 + #define SVGA3D_SURFACE_FLAGS2_MASK (MAX_UINT64 & ~SVGA3D_SURFACE_FLAGS1_MASK) 397 407 398 408 #define SVGA3D_SURFACE_HB_DISALLOWED_MASK \ 399 409 ( SVGA3D_SURFACE_MOB_PITCH | \ ··· 426 392 SVGA3D_SURFACE_STAGING_UPLOAD | \ 427 393 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 428 394 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 429 - SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 395 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 396 + SVGA3D_SURFACE_MULTISAMPLE \ 397 + ) 398 + 399 + #define SVGA3D_SURFACE_HB_PRESENT_DISALLOWED_MASK \ 400 + ( SVGA3D_SURFACE_1D | \ 401 + SVGA3D_SURFACE_MULTISAMPLE \ 430 402 ) 431 403 432 404 #define SVGA3D_SURFACE_2D_DISALLOWED_MASK \ 433 405 ( SVGA3D_SURFACE_CUBEMAP | \ 434 406 SVGA3D_SURFACE_MASKABLE_ANTIALIAS | \ 435 407 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 436 - SVGA3D_SURFACE_DECODE_RENDERTARGET | \ 437 408 SVGA3D_SURFACE_VOLUME | \ 438 409 SVGA3D_SURFACE_1D | \ 439 - SVGA3D_SURFACE_ARRAY | \ 440 410 SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ 441 411 SVGA3D_SURFACE_BIND_INDEX_BUFFER | \ 442 412 SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \ 443 413 SVGA3D_SURFACE_BIND_DEPTH_STENCIL | \ 444 414 SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 445 - SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 415 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 416 + SVGA3D_SURFACE_MULTISAMPLE \ 417 + ) 418 + 419 + #define SVGA3D_SURFACE_BASICOPS_DISALLOWED_MASK \ 420 + ( SVGA3D_SURFACE_CUBEMAP | \ 421 + SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 422 + SVGA3D_SURFACE_VOLUME | \ 423 + SVGA3D_SURFACE_1D | \ 424 + SVGA3D_SURFACE_MULTISAMPLE \ 446 425 ) 447 426 448 427 #define SVGA3D_SURFACE_SCREENTARGET_DISALLOWED_MASK \ 449 428 ( SVGA3D_SURFACE_CUBEMAP | \ 450 429 SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 451 - SVGA3D_SURFACE_DECODE_RENDERTARGET | \ 452 430 SVGA3D_SURFACE_VOLUME | \ 453 431 SVGA3D_SURFACE_1D | \ 454 432 SVGA3D_SURFACE_BIND_VERTEX_BUFFER | \ ··· 472 426 SVGA3D_SURFACE_STAGING_UPLOAD | \ 473 427 SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 474 428 SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \ 475 - SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 429 + SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \ 430 + SVGA3D_SURFACE_MULTISAMPLE \ 431 + ) 432 + 433 + #define SVGA3D_SURFACE_BUFFER_DISALLOWED_MASK \ 434 + ( SVGA3D_SURFACE_CUBEMAP | \ 435 + SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 436 + SVGA3D_SURFACE_VOLUME | \ 437 + SVGA3D_SURFACE_1D | \ 438 + SVGA3D_SURFACE_MASKABLE_ANTIALIAS | \ 439 + SVGA3D_SURFACE_ARRAY | \ 440 + SVGA3D_SURFACE_MULTISAMPLE | \ 441 + SVGA3D_SURFACE_MOB_PITCH \ 442 + ) 443 + 444 + #define SVGA3D_SURFACE_MULTISAMPLE_DISALLOWED_MASK \ 445 + ( SVGA3D_SURFACE_CUBEMAP | \ 446 + SVGA3D_SURFACE_AUTOGENMIPMAPS | \ 447 + SVGA3D_SURFACE_VOLUME | \ 448 + SVGA3D_SURFACE_1D | \ 449 + SVGA3D_SURFACE_SCREENTARGET | \ 450 + SVGA3D_SURFACE_MOB_PITCH \ 476 451 ) 477 452 478 453 #define SVGA3D_SURFACE_DX_ONLY_MASK \ 479 454 ( SVGA3D_SURFACE_BIND_STREAM_OUTPUT | \ 455 + SVGA3D_SURFACE_STAGING_UPLOAD | \ 456 + SVGA3D_SURFACE_STAGING_DOWNLOAD | \ 480 457 SVGA3D_SURFACE_TRANSFER_FROM_BUFFER \ 458 + ) 481 459 482 460 #define SVGA3D_SURFACE_STAGING_MASK \ 483 461 ( SVGA3D_SURFACE_STAGING_UPLOAD | \ ··· 557 487 558 488 /* 559 489 * Indicates that this format can be converted to any RGB format for which 560 - * SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB is specified 490 + * SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB is specified. 561 491 */ 562 492 SVGA3DFORMAT_OP_CONVERT_TO_ARGB = 0x00002000, 563 493 ··· 568 498 569 499 /* 570 500 * Indicated that this format can be read as an SRGB texture (meaning that the 571 - * sampler will linearize the looked up data) 501 + * sampler will linearize the looked up data). 572 502 */ 573 503 SVGA3DFORMAT_OP_SRGBREAD = 0x00008000, 574 504 575 505 /* 576 - * Indicates that this format can be used in the bumpmap instructions 506 + * Indicates that this format can be used in the bumpmap instructions. 577 507 */ 578 508 SVGA3DFORMAT_OP_BUMPMAP = 0x00010000, 579 509 580 510 /* 581 - * Indicates that this format can be sampled by the displacement map sampler 511 + * Indicates that this format can be sampled by the displacement map sampler. 582 512 */ 583 513 SVGA3DFORMAT_OP_DMAP = 0x00020000, 584 514 585 515 /* 586 - * Indicates that this format cannot be used with texture filtering 516 + * Indicates that this format cannot be used with texture filtering. 587 517 */ 588 518 SVGA3DFORMAT_OP_NOFILTER = 0x00040000, 589 519 ··· 600 530 SVGA3DFORMAT_OP_SRGBWRITE = 0x00100000, 601 531 602 532 /* 603 - * Indicates that this format cannot be used with alpha blending 533 + * Indicates that this format cannot be used with alpha blending. 604 534 */ 605 535 SVGA3DFORMAT_OP_NOALPHABLEND = 0x00200000, 606 536 607 537 /* 608 538 * Indicates that the device can auto-generated sublevels for resources 609 - * of this format 539 + * of this format. 610 540 */ 611 541 SVGA3DFORMAT_OP_AUTOGENMIPMAP = 0x00400000, 612 542 613 543 /* 614 - * Indicates that this format can be used by vertex texture sampler 544 + * Indicates that this format can be used by vertex texture sampler. 615 545 */ 616 546 SVGA3DFORMAT_OP_VERTEXTEXTURE = 0x00800000, 617 547 ··· 1571 1501 #include "vmware_pack_end.h" 1572 1502 SVGADXQueryResultUnion; 1573 1503 1574 - 1575 1504 typedef enum { 1576 1505 SVGA3D_QUERYSTATE_PENDING = 0, /* Query is not finished yet */ 1577 1506 SVGA3D_QUERYSTATE_SUCCEEDED = 1, /* Completed successfully */ ··· 1602 1533 struct { 1603 1534 union { 1604 1535 struct { 1605 - uint16 function; /* SVGA3dFogFunction */ 1606 - uint8 type; /* SVGA3dFogType */ 1607 - uint8 base; /* SVGA3dFogBase */ 1536 + uint16 function; /* SVGA3dFogFunction */ 1537 + uint8 type; /* SVGA3dFogType */ 1538 + uint8 base; /* SVGA3dFogBase */ 1608 1539 }; 1609 1540 uint32 uintValue; 1610 1541 }; ··· 1616 1547 * Uniquely identify one image (a 1D/2D/3D array) from a surface. This 1617 1548 * is a surface ID as well as face/mipmap indices. 1618 1549 */ 1619 - 1620 1550 typedef 1621 1551 #include "vmware_pack_begin.h" 1622 1552 struct SVGA3dSurfaceImageId { 1623 - uint32 sid; 1624 - uint32 face; 1625 - uint32 mipmap; 1553 + uint32 sid; 1554 + uint32 face; 1555 + uint32 mipmap; 1626 1556 } 1627 1557 #include "vmware_pack_end.h" 1628 1558 SVGA3dSurfaceImageId; 1559 + 1560 + typedef 1561 + #include "vmware_pack_begin.h" 1562 + struct SVGA3dSubSurfaceId { 1563 + uint32 sid; 1564 + uint32 subResourceId; 1565 + } 1566 + #include "vmware_pack_end.h" 1567 + SVGA3dSubSurfaceId; 1629 1568 1630 1569 typedef 1631 1570 #include "vmware_pack_begin.h" ··· 1659 1582 SVGA_OTABLE_DX9_MAX = 5, 1660 1583 1661 1584 SVGA_OTABLE_DXCONTEXT = 5, 1662 - SVGA_OTABLE_MAX = 6 1663 - } SVGAOTableType; 1585 + SVGA_OTABLE_DX_MAX = 6, 1664 1586 1665 - /* 1666 - * Deprecated. 1667 - */ 1668 - #define SVGA_OTABLE_COUNT 4 1587 + SVGA_OTABLE_RESERVED1 = 6, 1588 + SVGA_OTABLE_RESERVED2 = 7, 1589 + 1590 + /* 1591 + * Additions to this table need to be tied to HW-version features and 1592 + * checkpointed accordingly. 1593 + */ 1594 + SVGA_OTABLE_DEVEL_MAX = 8, 1595 + SVGA_OTABLE_MAX = 8 1596 + } SVGAOTableType; 1669 1597 1670 1598 typedef enum { 1671 1599 SVGA_COTABLE_MIN = 0, ··· 1687 1605 SVGA_COTABLE_DXSHADER = 10, 1688 1606 SVGA_COTABLE_DX10_MAX = 11, 1689 1607 SVGA_COTABLE_UAVIEW = 11, 1690 - SVGA_COTABLE_MAX 1608 + SVGA_COTABLE_MAX = 12, 1691 1609 } SVGACOTableType; 1692 1610 1693 1611 /* ··· 1708 1626 SVGA3D_MOBFMT_PREDX_MAX = 7, 1709 1627 SVGA3D_MOBFMT_EMPTY = 7, 1710 1628 SVGA3D_MOBFMT_MAX, 1629 + 1630 + /* 1631 + * This isn't actually used by the guest, but is a mob-format used 1632 + * internally by the SVGA device (and is therefore not binary compatible). 1633 + */ 1634 + SVGA3D_MOBFMT_HB, 1711 1635 } SVGAMobFormat; 1712 1636 1713 1637 #define SVGA3D_MOB_EMPTY_BASE 1 1638 + 1639 + /* 1640 + * Multisample pattern types. 1641 + */ 1642 + 1643 + typedef enum SVGA3dMSPattern { 1644 + SVGA3D_MS_PATTERN_NONE = 0, 1645 + SVGA3D_MS_PATTERN_MIN = 0, 1646 + SVGA3D_MS_PATTERN_STANDARD = 1, 1647 + SVGA3D_MS_PATTERN_CENTER = 2, 1648 + SVGA3D_MS_PATTERN_MAX = 3, 1649 + } SVGA3dMSPattern; 1650 + 1651 + /* 1652 + * Precision settings for each sample. 1653 + */ 1654 + 1655 + typedef enum SVGA3dMSQualityLevel { 1656 + SVGA3D_MS_QUALITY_NONE = 0, 1657 + SVGA3D_MS_QUALITY_MIN = 0, 1658 + SVGA3D_MS_QUALITY_FULL = 1, 1659 + SVGA3D_MS_QUALITY_MAX = 2, 1660 + } SVGA3dMSQualityLevel; 1714 1661 1715 1662 #endif /* _SVGA3D_TYPES_H_ */
+146 -31
drivers/gpu/drm/vmwgfx/device_include/svga_reg.h
··· 63 63 #define SVGA_MAX_BITS_PER_PIXEL 32 64 64 #define SVGA_MAX_DEPTH 24 65 65 #define SVGA_MAX_DISPLAYS 10 66 + #define SVGA_MAX_SCREEN_SIZE 8192 67 + #define SVGA_SCREEN_ROOT_LIMIT (SVGA_MAX_SCREEN_SIZE * SVGA_MAX_DISPLAYS) 68 + 66 69 67 70 /* 68 71 * Legal values for the SVGA_REG_CURSOR_ON register in old-fashioned 69 72 * cursor bypass mode. This is still supported, but no new guest 70 73 * drivers should use it. 71 74 */ 72 - #define SVGA_CURSOR_ON_HIDE 0x0 /* Must be 0 to maintain backward compatibility */ 73 - #define SVGA_CURSOR_ON_SHOW 0x1 /* Must be 1 to maintain backward compatibility */ 74 - #define SVGA_CURSOR_ON_REMOVE_FROM_FB 0x2 /* Remove the cursor from the framebuffer because we need to see what's under it */ 75 - #define SVGA_CURSOR_ON_RESTORE_TO_FB 0x3 /* Put the cursor back in the framebuffer so the user can see it */ 75 + #define SVGA_CURSOR_ON_HIDE 0x0 76 + #define SVGA_CURSOR_ON_SHOW 0x1 77 + 78 + /* 79 + * Remove the cursor from the framebuffer 80 + * because we need to see what's under it 81 + */ 82 + #define SVGA_CURSOR_ON_REMOVE_FROM_FB 0x2 83 + 84 + /* Put the cursor back in the framebuffer so the user can see it */ 85 + #define SVGA_CURSOR_ON_RESTORE_TO_FB 0x3 76 86 77 87 /* 78 88 * The maximum framebuffer size that can traced for guests unless the ··· 111 101 #define SVGA_VERSION_0 0 112 102 #define SVGA_ID_0 SVGA_MAKE_ID(SVGA_VERSION_0) 113 103 114 - /* "Invalid" value for all SVGA IDs. (Version ID, screen object ID, surface ID...) */ 104 + /* 105 + * "Invalid" value for all SVGA IDs. 106 + * (Version ID, screen object ID, surface ID...) 107 + */ 115 108 #define SVGA_ID_INVALID 0xFFFFFFFF 116 109 117 110 /* Port offsets, relative to BAR0 */ ··· 167 154 SVGA_REG_CONFIG_DONE = 20, /* Set when memory area configured */ 168 155 SVGA_REG_SYNC = 21, /* See "FIFO Synchronization Registers" */ 169 156 SVGA_REG_BUSY = 22, /* See "FIFO Synchronization Registers" */ 170 - SVGA_REG_GUEST_ID = 23, /* Set guest OS identifier */ 157 + SVGA_REG_GUEST_ID = 23, /* (Deprecated) */ 171 158 SVGA_REG_CURSOR_ID = 24, /* (Deprecated) */ 172 159 SVGA_REG_CURSOR_X = 25, /* (Deprecated) */ 173 160 SVGA_REG_CURSOR_Y = 26, /* (Deprecated) */ ··· 199 186 SVGA_REG_MEMORY_SIZE = 47, /* Total dedicated device memory excluding FIFO */ 200 187 SVGA_REG_COMMAND_LOW = 48, /* Lower 32 bits and submits commands */ 201 188 SVGA_REG_COMMAND_HIGH = 49, /* Upper 32 bits of command buffer PA */ 202 - SVGA_REG_MAX_PRIMARY_BOUNDING_BOX_MEM = 50, /* Max primary memory */ 189 + 190 + /* 191 + * Max primary memory. 192 + * See SVGA_CAP_NO_BB_RESTRICTION. 193 + */ 194 + SVGA_REG_MAX_PRIMARY_MEM = 50, 195 + SVGA_REG_MAX_PRIMARY_BOUNDING_BOX_MEM = 50, 196 + 203 197 SVGA_REG_SUGGESTED_GBOBJECT_MEM_SIZE_KB = 51, /* Sugested limit on mob mem */ 204 198 SVGA_REG_DEV_CAP = 52, /* Write dev cap index, read value */ 205 199 SVGA_REG_CMD_PREPEND_LOW = 53, ··· 214 194 SVGA_REG_SCREENTARGET_MAX_WIDTH = 55, 215 195 SVGA_REG_SCREENTARGET_MAX_HEIGHT = 56, 216 196 SVGA_REG_MOB_MAX_SIZE = 57, 217 - SVGA_REG_TOP = 58, /* Must be 1 more than the last register */ 197 + SVGA_REG_BLANK_SCREEN_TARGETS = 58, 198 + SVGA_REG_CAP2 = 59, 199 + SVGA_REG_DEVEL_CAP = 60, 200 + SVGA_REG_TOP = 61, /* Must be 1 more than the last register */ 218 201 219 202 SVGA_PALETTE_BASE = 1024, /* Base of SVGA color map */ 220 203 /* Next 768 (== 256*3) registers exist for colormap */ ··· 415 392 SVGA_CB_CONTEXT_0 = 0x0, 416 393 SVGA_CB_CONTEXT_1 = 0x1, /* Supported with SVGA_CAP_HP_CMD_QUEUE */ 417 394 SVGA_CB_CONTEXT_MAX = 0x2, 395 + SVGA_CB_CONTEXT_HP_MAX = 0x2, 418 396 } SVGACBContext; 419 397 420 398 ··· 472 448 * due to an error. No IRQ is raised. 473 449 */ 474 450 SVGA_CB_STATUS_SUBMISSION_ERROR = 6, 451 + 452 + /* 453 + * Written by the host when the host finished a 454 + * SVGA_DC_CMD_ASYNC_STOP_QUEUE request for this command buffer 455 + * queue. The offset of the first byte not processed is stored in 456 + * the errorOffset field of the command buffer header. All guest 457 + * visible side effects of commands till that point are guaranteed 458 + * to be finished before this is written. The 459 + * SVGA_IRQFLAG_COMMAND_BUFFER IRQ is raised as long as the 460 + * SVGA_CB_FLAG_NO_IRQ is not set. 461 + */ 462 + SVGA_CB_STATUS_PARTIAL_COMPLETE = 7, 475 463 } SVGACBStatus; 476 464 477 465 typedef enum { ··· 496 460 typedef 497 461 #include "vmware_pack_begin.h" 498 462 struct { 499 - volatile SVGACBStatus status; 500 - volatile uint32 errorOffset; 463 + volatile SVGACBStatus status; /* Modified by device. */ 464 + volatile uint32 errorOffset; /* Modified by device. */ 501 465 uint64 id; 502 466 SVGACBFlags flags; 503 467 uint32 length; ··· 508 472 uint32 mobOffset; 509 473 } mob; 510 474 } ptr; 511 - uint32 offset; /* Valid if CMD_BUFFERS_2 cap set, must be zero otherwise */ 475 + uint32 offset; /* Valid if CMD_BUFFERS_2 cap set, must be zero otherwise, 476 + * modified by device. 477 + */ 512 478 uint32 dxContext; /* Valid if DX_CONTEXT flag set, must be zero otherwise */ 513 479 uint32 mustBeZero[6]; 514 480 } ··· 521 483 SVGA_DC_CMD_NOP = 0, 522 484 SVGA_DC_CMD_START_STOP_CONTEXT = 1, 523 485 SVGA_DC_CMD_PREEMPT = 2, 524 - SVGA_DC_CMD_MAX = 3, 525 - SVGA_DC_CMD_FORCE_UINT = MAX_UINT32, 486 + SVGA_DC_CMD_START_QUEUE = 3, /* Requires SVGA_CAP_HP_CMD_QUEUE */ 487 + SVGA_DC_CMD_ASYNC_STOP_QUEUE = 4, /* Requires SVGA_CAP_HP_CMD_QUEUE */ 488 + SVGA_DC_CMD_EMPTY_CONTEXT_QUEUE = 5, /* Requires SVGA_CAP_HP_CMD_QUEUE */ 489 + SVGA_DC_CMD_MAX = 6, 526 490 } SVGADeviceContextCmdId; 527 491 528 - typedef struct { 492 + /* 493 + * Starts or stops both SVGA_CB_CONTEXT_0 and SVGA_CB_CONTEXT_1. 494 + */ 495 + 496 + typedef struct SVGADCCmdStartStop { 529 497 uint32 enable; 530 - SVGACBContext context; 498 + SVGACBContext context; /* Must be zero */ 531 499 } SVGADCCmdStartStop; 532 500 533 501 /* 534 502 * SVGADCCmdPreempt -- 535 503 * 536 504 * This command allows the guest to request that all command buffers 537 - * on the specified context be preempted that can be. After execution 505 + * on SVGA_CB_CONTEXT_0 be preempted that can be. After execution 538 506 * of this command all command buffers that were preempted will 539 507 * already have SVGA_CB_STATUS_PREEMPTED written into the status 540 508 * field. The device might still be processing a command buffer, ··· 550 506 * command buffer header set to zero. 551 507 */ 552 508 553 - typedef struct { 554 - SVGACBContext context; 509 + typedef struct SVGADCCmdPreempt { 510 + SVGACBContext context; /* Must be zero */ 555 511 uint32 ignoreIDZero; 556 512 } SVGADCCmdPreempt; 513 + 514 + /* 515 + * Starts the requested command buffer processing queue. Valid only 516 + * if the SVGA_CAP_HP_CMD_QUEUE cap is set. 517 + * 518 + * For a command queue to be considered runnable it must be enabled 519 + * and any corresponding higher priority queues must also be enabled. 520 + * For example in order for command buffers to be processed on 521 + * SVGA_CB_CONTEXT_0 both SVGA_CB_CONTEXT_0 and SVGA_CB_CONTEXT_1 must 522 + * be enabled. But for commands to be runnable on SVGA_CB_CONTEXT_1 523 + * only that queue must be enabled. 524 + */ 525 + 526 + typedef struct SVGADCCmdStartQueue { 527 + SVGACBContext context; 528 + } SVGADCCmdStartQueue; 529 + 530 + /* 531 + * Requests the SVGA device to stop processing the requested command 532 + * buffer queue as soon as possible. The guest knows the stop has 533 + * completed when one of the following happens. 534 + * 535 + * 1) A command buffer status of SVGA_CB_STATUS_PARTIAL_COMPLETE is returned 536 + * 2) A command buffer error is encountered with would stop the queue 537 + * regardless of the async stop request. 538 + * 3) All command buffers that have been submitted complete successfully. 539 + * 4) The stop completes synchronously if no command buffers are 540 + * active on the queue when it is issued. 541 + * 542 + * If the command queue is not in a runnable state there is no 543 + * guarentee this async stop will finish. For instance if the high 544 + * priority queue is not enabled and a stop is requested on the low 545 + * priority queue, the high priority queue must be reenabled to 546 + * guarantee that the async stop will finish. 547 + * 548 + * This command along with SVGA_DC_CMD_EMPTY_CONTEXT_QUEUE can be used 549 + * to implement mid command buffer preemption. 550 + * 551 + * Valid only if the SVGA_CAP_HP_CMD_QUEUE cap is set. 552 + */ 553 + 554 + typedef struct SVGADCCmdAsyncStopQueue { 555 + SVGACBContext context; 556 + } SVGADCCmdAsyncStopQueue; 557 + 558 + /* 559 + * Requests the SVGA device to throw away any full command buffers on 560 + * the requested command queue that have not been started. For a 561 + * driver to know which command buffers were thrown away a driver 562 + * should only issue this command when the queue is stopped, for 563 + * whatever reason. 564 + */ 565 + 566 + typedef struct SVGADCCmdEmptyQueue { 567 + SVGACBContext context; 568 + } SVGADCCmdEmptyQueue; 569 + 557 570 558 571 /* 559 572 * SVGAGMRImageFormat -- ··· 637 536 struct { 638 537 uint32 bitsPerPixel : 8; 639 538 uint32 colorDepth : 8; 640 - uint32 reserved : 16; /* Must be zero */ 539 + uint32 reserved : 16; /* Must be zero */ 641 540 }; 642 541 643 542 uint32 value; ··· 801 700 * large enough to express any possible topology without holes between 802 701 * monitors.) 803 702 * 703 + * SVGA_CAP_CAP2_REGISTER -- 704 + * If this cap is present, the SVGA_REG_CAP2 register is supported. 804 705 */ 805 706 806 707 #define SVGA_CAP_NONE 0x00000000 ··· 829 726 #define SVGA_CAP_DX 0x10000000 830 727 #define SVGA_CAP_HP_CMD_QUEUE 0x20000000 831 728 #define SVGA_CAP_NO_BB_RESTRICTION 0x40000000 729 + #define SVGA_CAP_CAP2_REGISTER 0x80000000 832 730 833 - #define SVGA_CAP_CMD_RESERVED 0x80000000 731 + /* 732 + * The SVGA_REG_CAP2 register is an additional set of SVGA capability bits. 733 + * 734 + * SVGA_CAP2_GROW_OTABLE -- 735 + * Allow the GrowOTable/DXGrowCOTable commands. 736 + * 737 + * SVGA_CAP2_INTRA_SURFACE_COPY -- 738 + * Allow the IntraSurfaceCopy command. 739 + * 740 + * SVGA_CAP2_DX2 -- 741 + * Allow the DefineGBSurface_v3, WholeSurfaceCopy. 742 + * 743 + * SVGA_CAP2_RESERVED -- 744 + * Reserve the last bit for extending the SVGA capabilities to some 745 + * future mechanisms. 746 + */ 747 + #define SVGA_CAP2_NONE 0x00000000 748 + #define SVGA_CAP2_GROW_OTABLE 0x00000001 749 + #define SVGA_CAP2_INTRA_SURFACE_COPY 0x00000002 750 + #define SVGA_CAP2_DX2 0x00000004 751 + #define SVGA_CAP2_RESERVED 0x80000000 834 752 835 753 836 754 /* ··· 873 749 SVGABackdoorCapDeviceCaps = 0, 874 750 SVGABackdoorCapFifoCaps = 1, 875 751 SVGABackdoorCap3dHWVersion = 2, 876 - SVGABackdoorCapMax = 3, 752 + SVGABackdoorCapDeviceCaps2 = 3, 753 + SVGABackdoorCapMax = 4, 877 754 } SVGABackdoorCapType; 878 755 879 756 ··· 2065 1940 #define SVGA_GRAPHICS_MEMORY_KB_DEFAULT (256 * 1024) 2066 1941 2067 1942 #define SVGA_VRAM_SIZE_W2K (64 * 1024 * 1024) /* 64 MB */ 2068 - 2069 - /* 2070 - * To simplify autoDetect display configuration, support a minimum of 2071 - * two 1920x1200 monitors, 32bpp, side-by-side, optionally rotated: 2072 - * numDisplays = 2 2073 - * maxWidth = numDisplay * 1920 = 3840 2074 - * maxHeight = rotated width of single monitor = 1920 2075 - * vramSize = maxWidth * maxHeight * 4 = 29491200 2076 - */ 2077 - #define SVGA_VRAM_SIZE_AUTODETECT (32 * 1024 * 1024) 2078 1943 2079 1944 #if defined(VMX86_SERVER) 2080 1945 #define SVGA_VRAM_SIZE (4 * 1024 * 1024)
+3
drivers/gpu/drm/vmwgfx/device_include/svga_types.h
··· 40 40 41 41 typedef bool Bool; 42 42 43 + #define MAX_UINT64 U64_MAX 43 44 #define MAX_UINT32 U32_MAX 44 45 #define MAX_UINT16 U16_MAX 46 + 47 + #define CONST64U(x) x##ULL 45 48 46 49 #endif
+1 -1
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
··· 884 884 885 885 if (dev_priv->has_mob) { 886 886 spin_lock(&dev_priv->cap_lock); 887 - vmw_write(dev_priv, SVGA_REG_DEV_CAP, SVGA3D_DEVCAP_DX); 887 + vmw_write(dev_priv, SVGA_REG_DEV_CAP, SVGA3D_DEVCAP_DXCONTEXT); 888 888 dev_priv->has_dx = !!vmw_read(dev_priv, SVGA_REG_DEV_CAP); 889 889 spin_unlock(&dev_priv->cap_lock); 890 890 }
+2 -2
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
··· 3230 3230 false, false, false), 3231 3231 VMW_CMD_DEF(SVGA_3D_CMD_SCREEN_DMA, &vmw_cmd_invalid, 3232 3232 false, false, false), 3233 - VMW_CMD_DEF(SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE, &vmw_cmd_invalid, 3233 + VMW_CMD_DEF(SVGA_3D_CMD_DEAD1, &vmw_cmd_invalid, 3234 3234 false, false, false), 3235 - VMW_CMD_DEF(SVGA_3D_CMD_OPEN_CONTEXT_SURFACE, &vmw_cmd_invalid, 3235 + VMW_CMD_DEF(SVGA_3D_CMD_DEAD2, &vmw_cmd_invalid, 3236 3236 false, false, false), 3237 3237 VMW_CMD_DEF(SVGA_3D_CMD_LOGICOPS_BITBLT, &vmw_cmd_invalid, 3238 3238 false, false, false),
+6 -9
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
··· 122 122 123 123 static u32 vmw_mask_multisample(unsigned int cap, u32 fmt_value) 124 124 { 125 - /* If the header is updated, update the format test as well! */ 126 - BUILD_BUG_ON(SVGA3D_DEVCAP_DXFMT_BC5_UNORM + 1 != SVGA3D_DEVCAP_MAX); 127 - 128 - if (cap >= SVGA3D_DEVCAP_DXFMT_X8R8G8B8 && 129 - cap <= SVGA3D_DEVCAP_DXFMT_BC5_UNORM) 130 - fmt_value &= ~(SVGADX_DXFMT_MULTISAMPLE_2 | 131 - SVGADX_DXFMT_MULTISAMPLE_4 | 132 - SVGADX_DXFMT_MULTISAMPLE_8); 133 - else if (cap == SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES) 125 + /* 126 + * A version of user-space exists which use MULTISAMPLE_MASKABLESAMPLES 127 + * to check the sample count supported by virtual device. Since there 128 + * never was support for multisample count for backing MOB return 0. 129 + */ 130 + if (cap == SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES) 134 131 return 0; 135 132 136 133 return fmt_value;