Changeset 86855 in vbox
- Timestamp:
- Nov 11, 2020 1:03:54 AM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r86841 r86855 314 314 */ 315 315 316 static int vmsvgaR3GboCreate(PVMSVGAR3STATE pSvgaR3State, SVGAMobFormat ptDepth, PPN64 baseAddress, uint32_t sizeInBytes, bool fGCPhys64, PVMSVGAGBO pGbo) 316 /** 317 * HC access handler for GBOs which require write protection, i.e. OTables, etc. 318 * 319 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. 320 * @param pVM VM Handle. 321 * @param pVCpu The cross context CPU structure for the calling EMT. 322 * @param GCPhys The physical address the guest is writing to. 323 * @param pvPhys The HC mapping of that address. 324 * @param pvBuf What the guest is reading/writing. 325 * @param cbBuf How much it's reading/writing. 326 * @param enmAccessType The access type. 327 * @param enmOrigin Who is making the access. 328 * @param pvUser User argument. 329 */ 330 DECLCALLBACK(VBOXSTRICTRC) 331 vmsvgaR3GboAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, 332 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) 333 { 334 RT_NOREF(pVM, pVCpu, pvPhys, enmAccessType); 335 336 if (RT_LIKELY(enmOrigin == PGMACCESSORIGIN_DEVICE || enmOrigin == PGMACCESSORIGIN_DEBUGGER)) 337 return VINF_PGM_HANDLER_DO_DEFAULT; 338 339 PPDMDEVINS pDevIns = (PPDMDEVINS)pvUser; 340 PVGASTATE pThis = PDMDEVINS_2_DATA(pDevIns, PVGASTATE); 341 PVGASTATECC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVGASTATECC); 342 PVMSVGAR3STATE pSvgaR3State = pThisCC->svga.pSvgaR3State; 343 344 /* 345 * The guest is not allowed to access the memory. 346 * Set the error condition. 347 */ 348 ASMAtomicWriteBool(&pThis->svga.fBadGuest, true); 349 350 /* Try to find the GBO which the guest is accessing. */ 351 char const *pszTarget = NULL; 352 for (uint32_t i = 0; i < RT_ELEMENTS(pSvgaR3State->aGboOTables) && !pszTarget; ++i) 353 { 354 PVMSVGAGBO pGbo = &pSvgaR3State->aGboOTables[i]; 355 if (pGbo->cDescriptors) 356 { 357 for (uint32_t j = 0; j < pGbo->cDescriptors; ++j) 358 { 359 if ( GCPhys >= pGbo->paDescriptors[j].GCPhys 360 && GCPhys < pGbo->paDescriptors[j].GCPhys + pGbo->paDescriptors[j].cPages * PAGE_SIZE) 361 { 362 switch (i) 363 { 364 case SVGA_OTABLE_MOB: pszTarget = "SVGA_OTABLE_MOB"; break; 365 case SVGA_OTABLE_SURFACE: pszTarget = "SVGA_OTABLE_SURFACE"; break; 366 case SVGA_OTABLE_CONTEXT: pszTarget = "SVGA_OTABLE_CONTEXT"; break; 367 case SVGA_OTABLE_SHADER: pszTarget = "SVGA_OTABLE_SHADER"; break; 368 case SVGA_OTABLE_SCREENTARGET: pszTarget = "SVGA_OTABLE_SCREENTARGET"; break; 369 case SVGA_OTABLE_DXCONTEXT: pszTarget = "SVGA_OTABLE_DXCONTEXT"; break; 370 default: pszTarget = "Unknown OTABLE"; break; 371 } 372 break; 373 } 374 } 375 } 376 } 377 378 LogRelMax(8, ("VMSVGA: invalid guest access to page %RGp, target %s:\n" 379 "%.*Rhxd\n", 380 GCPhys, pszTarget ? pszTarget : "unknown", RT_MIN(cbBuf, 256), pvBuf)); 381 382 return VINF_PGM_HANDLER_DO_DEFAULT; 383 } 384 385 386 static int vmsvgaR3GboCreate(PVMSVGAR3STATE pSvgaR3State, SVGAMobFormat ptDepth, PPN64 baseAddress, uint32_t sizeInBytes, bool fGCPhys64, bool fWriteProtected, PVMSVGAGBO pGbo) 317 387 { 318 388 ASSERT_GUEST_RETURN(sizeInBytes <= _128M, VERR_INVALID_PARAMETER); /** @todo Less than SVGA_REG_MOB_MAX_SIZE */ … … 481 551 pGbo->paDescriptors = paDescriptors; 482 552 553 if (fWriteProtected) 554 { 555 pGbo->fGboFlags |= VMSVGAGBO_F_WRITE_PROTECTED; 556 for (uint32_t i = 0; i < pGbo->cDescriptors; ++i) 557 { 558 rc = PGMHandlerPhysicalRegister(PDMDevHlpGetVM(pSvgaR3State->pDevIns), 559 pGbo->paDescriptors[i].GCPhys, pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1, 560 pSvgaR3State->hGboAccessHandlerType, pSvgaR3State->pDevIns, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GBO"); 561 AssertRC(rc); 562 } 563 } 564 483 565 return VINF_SUCCESS; 484 566 } … … 487 569 static void vmsvgaR3GboDestroy(PVMSVGAR3STATE pSvgaR3State, PVMSVGAGBO pGbo) 488 570 { 489 RT_NOREF(pSvgaR3State);490 571 if (RT_LIKELY(VMSVGA_IS_GBO_CREATED(pGbo))) 491 572 { 573 if (pGbo->fGboFlags & VMSVGAGBO_F_WRITE_PROTECTED) 574 { 575 for (uint32_t i = 0; i < pGbo->cDescriptors; ++i) 576 { 577 int rc = PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pSvgaR3State->pDevIns), pGbo->paDescriptors[i].GCPhys); 578 AssertRC(rc); 579 } 580 } 492 581 RTMemFree(pGbo->paDescriptors); 493 582 RT_ZERO(pGbo); … … 644 733 entry.sizeInBytes = sizeInBytes; 645 734 entry.base = baseAddress; 646 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableMob,735 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_MOB], 647 736 mobid, SVGA3D_OTABLE_MOB_ENTRY_SIZE, &entry, sizeof(entry)); 648 737 if (RT_SUCCESS(rc)) 649 738 { 650 739 /* Create the corresponding GBO. */ 651 rc = vmsvgaR3GboCreate(pSvgaR3State, ptDepth, baseAddress, sizeInBytes, fGCPhys64, &pMob->Gbo);740 rc = vmsvgaR3GboCreate(pSvgaR3State, ptDepth, baseAddress, sizeInBytes, fGCPhys64, /* fWriteProtected = */ false, &pMob->Gbo); 652 741 if (RT_SUCCESS(rc)) 653 742 { … … 673 762 SVGAOTableMobEntry entry; 674 763 RT_ZERO(entry); 675 vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableMob,764 vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_MOB], 676 765 mobid, SVGA3D_OTABLE_MOB_ENTRY_SIZE, &entry, sizeof(entry)); 677 766 … … 1008 1097 // entry.arraySize = 0; 1009 1098 // entry.mobPitch = 0; 1010 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1099 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1011 1100 pCmd->sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entry, sizeof(entry)); 1012 1101 if (RT_SUCCESS(rc)) … … 1031 1120 RT_ZERO(entry); 1032 1121 entry.mobid = SVGA_ID_INVALID; 1033 vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1122 vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1034 1123 pCmd->sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entry, sizeof(entry)); 1035 1124 … … 1048 1137 int rc = VINF_SUCCESS; 1049 1138 if (pCmd->mobid != SVGA_ID_INVALID) 1050 rc = vmsvgaR3OTableVerifyIndex(pSvgaR3State, &pSvgaR3State-> GboOTableMob,1139 rc = vmsvgaR3OTableVerifyIndex(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_MOB], 1051 1140 pCmd->mobid, SVGA3D_OTABLE_MOB_ENTRY_SIZE); 1052 1141 if (RT_SUCCESS(rc)) 1053 1142 { 1054 1143 SVGAOTableSurfaceEntry entry; 1055 rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1144 rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1056 1145 pCmd->sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entry, sizeof(entry)); 1057 1146 if (RT_SUCCESS(rc)) 1058 1147 { 1059 1148 entry.mobid = pCmd->mobid; 1060 rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1149 rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1061 1150 pCmd->sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entry, sizeof(entry)); 1062 1151 if (RT_SUCCESS(rc)) … … 1142 1231 /* "update a surface from its backing MOB." */ 1143 1232 SVGAOTableSurfaceEntry entrySurface; 1144 int rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1233 int rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1145 1234 pCmd->image.sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entrySurface, sizeof(entrySurface)); 1146 1235 if (RT_SUCCESS(rc)) … … 1202 1291 */ 1203 1292 PVMSVGAGBO pGbo; 1204 switch (pCmd->type) 1205 { 1206 case SVGA_OTABLE_MOB: 1207 { 1208 pGbo = &pSvgaR3State->GboOTableMob; 1209 break; 1210 } 1211 case SVGA_OTABLE_SURFACE: 1212 { 1213 pGbo = &pSvgaR3State->GboOTableSurface; 1214 break; 1215 } 1216 case SVGA_OTABLE_CONTEXT: 1217 { 1218 pGbo = &pSvgaR3State->GboOTableContext; 1219 break; 1220 } 1221 case SVGA_OTABLE_SHADER: 1222 { 1223 pGbo = &pSvgaR3State->GboOTableShader; 1224 break; 1225 } 1226 case SVGA_OTABLE_SCREENTARGET: 1227 { 1228 pGbo = &pSvgaR3State->GboOTableScreenTarget; 1229 break; 1230 } 1231 default: 1232 pGbo = NULL; 1233 ASSERT_GUEST_FAILED(); 1234 break; 1293 if (pCmd->type <= RT_ELEMENTS(pSvgaR3State->aGboOTables)) 1294 { 1295 RT_UNTRUSTED_VALIDATED_FENCE(); 1296 pGbo = &pSvgaR3State->aGboOTables[pCmd->type]; 1297 } 1298 else 1299 { 1300 ASSERT_GUEST_FAILED(); 1301 pGbo = NULL; 1235 1302 } 1236 1303 … … 1239 1306 /* Recreate. */ 1240 1307 vmsvgaR3GboDestroy(pSvgaR3State, pGbo); 1241 int rc = vmsvgaR3GboCreate(pSvgaR3State, pCmd->ptDepth, pCmd->baseAddress, pCmd->sizeInBytes, /*fGCPhys64=*/ true, pGbo);1308 int rc = vmsvgaR3GboCreate(pSvgaR3State, pCmd->ptDepth, pCmd->baseAddress, pCmd->sizeInBytes, /*fGCPhys64=*/ true, /* fWriteProtected = */ true, pGbo); 1242 1309 AssertRC(rc); 1243 1310 } … … 1268 1335 entry.flags = pCmd->flags; 1269 1336 entry.dpi = pCmd->dpi; 1270 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableScreenTarget,1337 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SCREENTARGET], 1271 1338 pCmd->stid, SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE, &entry, sizeof(entry)); 1272 1339 if (RT_SUCCESS(rc)) … … 1316 1383 SVGAOTableScreenTargetEntry entry; 1317 1384 RT_ZERO(entry); 1318 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableScreenTarget,1385 int rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SCREENTARGET], 1319 1386 pCmd->stid, SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE, &entry, sizeof(entry)); 1320 1387 if (RT_SUCCESS(rc)) … … 1353 1420 int rc = VINF_SUCCESS; 1354 1421 if (pCmd->image.sid != SVGA_ID_INVALID) 1355 rc = vmsvgaR3OTableVerifyIndex(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1422 rc = vmsvgaR3OTableVerifyIndex(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1356 1423 pCmd->image.sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE); 1357 1424 if (RT_SUCCESS(rc)) 1358 1425 { 1359 1426 SVGAOTableScreenTargetEntry entry; 1360 rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State-> GboOTableScreenTarget,1427 rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SCREENTARGET], 1361 1428 pCmd->stid, SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE, &entry, sizeof(entry)); 1362 1429 if (RT_SUCCESS(rc)) 1363 1430 { 1364 1431 entry.image = pCmd->image; 1365 rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State-> GboOTableScreenTarget,1432 rc = vmsvgaR3OTableWrite(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SCREENTARGET], 1366 1433 pCmd->stid, SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE, &entry, sizeof(entry)); 1367 1434 if (RT_SUCCESS(rc)) … … 1388 1455 /* Get the screen target info. */ 1389 1456 SVGAOTableScreenTargetEntry entryScreenTarget; 1390 int rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State-> GboOTableScreenTarget,1457 int rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SCREENTARGET], 1391 1458 pCmd->stid, SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE, &entryScreenTarget, sizeof(entryScreenTarget)); 1392 1459 if (RT_SUCCESS(rc)) … … 1398 1465 { 1399 1466 SVGAOTableSurfaceEntry entrySurface; 1400 rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State-> GboOTableSurface,1467 rc = vmsvgaR3OTableRead(pSvgaR3State, &pSvgaR3State->aGboOTables[SVGA_OTABLE_SURFACE], 1401 1468 entryScreenTarget.image.sid, SVGA3D_OTABLE_SURFACE_ENTRY_SIZE, &entrySurface, sizeof(entrySurface)); 1402 1469 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-internal.h
r86838 r86855 78 78 typedef struct VMSVGAGBO 79 79 { 80 uint32_t u32Reserved;80 uint32_t fGboFlags; 81 81 uint32_t cTotalPages; 82 82 uint32_t cbTotal; … … 85 85 } VMSVGAGBO, *PVMSVGAGBO; 86 86 typedef VMSVGAGBO const *PCVMSVGAGBO; 87 88 #define VMSVGAGBO_F_WRITE_PROTECTED 1 87 89 88 90 #define VMSVGA_IS_GBO_CREATED(a_Gbo) ((a_Gbo)->paDescriptors != NULL) … … 175 177 RTCRITSECT CritSectCmdBuf; 176 178 179 /** Write protected GBOs (OTables) access handler type handle. */ 180 PGMPHYSHANDLERTYPE hGboAccessHandlerType; 181 177 182 /** */ 178 VMSVGAGBO GboOTableMob; 179 VMSVGAGBO GboOTableSurface; 180 VMSVGAGBO GboOTableContext; 181 VMSVGAGBO GboOTableShader; 182 VMSVGAGBO GboOTableScreenTarget; 183 VMSVGAGBO aGboOTables[SVGA_OTABLE_MAX]; 183 184 184 185 /** Tree of guest's Memory OBjects. Key is mobid. */ … … 285 286 #endif 286 287 288 DECLCALLBACK(VBOXSTRICTRC) vmsvgaR3GboAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, 289 PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser); 290 287 291 void vmsvgaR3ResetScreens(PVGASTATE pThis, PVGASTATECC pThisCC); 288 292 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r86838 r86855 420 420 421 421 422 #define SVGA_CASE_ID2STR(idx) case idx: return #idx 422 423 #if defined(LOG_ENABLED) 423 # define SVGA_CASE_ID2STR(idx) case idx: return #idx424 424 /** 425 425 * Index register string name lookup … … 507 507 } 508 508 } 509 # undef SVGA_CASE_ID2STR510 509 #endif /* LOG_ENABLED */ 510 511 static const char *vmsvgaDevCapIndexToString(SVGA3dDevCapIndex idxDevCap) 512 { 513 switch (idxDevCap) 514 { 515 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_INVALID); 516 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_3D); 517 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_LIGHTS); 518 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURES); 519 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_CLIP_PLANES); 520 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_VERTEX_SHADER_VERSION); 521 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_VERTEX_SHADER); 522 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION); 523 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_FRAGMENT_SHADER); 524 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_RENDER_TARGETS); 525 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_S23E8_TEXTURES); 526 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_S10E5_TEXTURES); 527 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND); 528 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_D16_BUFFER_FORMAT); 529 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT); 530 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT); 531 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_QUERY_TYPES); 532 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING); 533 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_POINT_SIZE); 534 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_SHADER_TEXTURES); 535 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH); 536 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT); 537 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_VOLUME_EXTENT); 538 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT); 539 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO); 540 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY); 541 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT); 542 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_VERTEX_INDEX); 543 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS); 544 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS); 545 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS); 546 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS); 547 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_TEXTURE_OPS); 548 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8); 549 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8); 550 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10); 551 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5); 552 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5); 553 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4); 554 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_R5G6B5); 555 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16); 556 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8); 557 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_ALPHA8); 558 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8); 559 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Z_D16); 560 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8); 561 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8); 562 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_DXT1); 563 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_DXT2); 564 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_DXT3); 565 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_DXT4); 566 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_DXT5); 567 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8); 568 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10); 569 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8); 570 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8); 571 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_CxV8U8); 572 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_R_S10E5); 573 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_R_S23E8); 574 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5); 575 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8); 576 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5); 577 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8); 578 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MISSING62); 579 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES); 580 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS); 581 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_V16U16); 582 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_G16R16); 583 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16); 584 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_UYVY); 585 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_YUY2); 586 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES); 587 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES); 588 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_ALPHATOCOVERAGE); 589 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SUPERSAMPLE); 590 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_AUTOGENMIPMAPS); 591 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_NV12); 592 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_AYUV); 593 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_CONTEXT_IDS); 594 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_SURFACE_IDS); 595 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Z_DF16); 596 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Z_DF24); 597 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT); 598 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_ATI1); 599 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_ATI2); 600 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DEAD1); 601 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_VIDEO_DECODE); 602 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_VIDEO_PROCESS); 603 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_LINE_AA); 604 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_LINE_STIPPLE); 605 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_LINE_WIDTH); 606 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH); 607 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_SURFACEFMT_YV12); 608 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_LOGICOPS); 609 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_TS_COLOR_KEY); 610 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DEAD2); 611 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DX); 612 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX_TEXTURE_ARRAY_SIZE); 613 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DX_MAX_VERTEXBUFFERS); 614 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DX_MAX_CONSTANT_BUFFERS); 615 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DX_PROVOKING_VERTEX); 616 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_X8R8G8B8); 617 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A8R8G8B8); 618 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R5G6B5); 619 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_X1R5G5B5); 620 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A1R5G5B5); 621 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A4R4G4B4); 622 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_D32); 623 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_D16); 624 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_D24S8); 625 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_D15S1); 626 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_LUMINANCE8); 627 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_LUMINANCE4_ALPHA4); 628 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_LUMINANCE16); 629 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_LUMINANCE8_ALPHA8); 630 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_DXT1); 631 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_DXT2); 632 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_DXT3); 633 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_DXT4); 634 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_DXT5); 635 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BUMPU8V8); 636 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BUMPL6V5U5); 637 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BUMPX8L8V8U8); 638 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_FORMAT_DEAD1); 639 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_ARGB_S10E5); 640 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_ARGB_S23E8); 641 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A2R10G10B10); 642 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_V8U8); 643 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Q8W8V8U8); 644 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_CxV8U8); 645 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_X8L8V8U8); 646 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A2W10V10U10); 647 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_ALPHA8); 648 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R_S10E5); 649 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R_S23E8); 650 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_RG_S10E5); 651 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_RG_S23E8); 652 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BUFFER); 653 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_D24X8); 654 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_V16U16); 655 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_G16R16); 656 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A16B16G16R16); 657 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_UYVY); 658 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_YUY2); 659 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_NV12); 660 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_AYUV); 661 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_TYPELESS); 662 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_UINT); 663 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_SINT); 664 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32_TYPELESS); 665 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32_FLOAT); 666 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32_UINT); 667 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32_SINT); 668 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_TYPELESS); 669 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UINT); 670 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SNORM); 671 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_SINT); 672 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32_TYPELESS); 673 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32_UINT); 674 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32_SINT); 675 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G8X24_TYPELESS); 676 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_D32_FLOAT_S8X24_UINT); 677 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32_FLOAT_X8X24_TYPELESS); 678 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_X32_TYPELESS_G8X24_UINT); 679 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R10G10B10A2_TYPELESS); 680 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UINT); 681 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R11G11B10_FLOAT); 682 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_TYPELESS); 683 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM); 684 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UNORM_SRGB); 685 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_UINT); 686 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SINT); 687 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16_TYPELESS); 688 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16_UINT); 689 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16_SINT); 690 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32_TYPELESS); 691 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_D32_FLOAT); 692 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32_UINT); 693 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32_SINT); 694 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R24G8_TYPELESS); 695 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_D24_UNORM_S8_UINT); 696 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R24_UNORM_X8_TYPELESS); 697 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_X24_TYPELESS_G8_UINT); 698 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8_TYPELESS); 699 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8_UNORM); 700 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8_UINT); 701 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8_SINT); 702 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16_TYPELESS); 703 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16_UNORM); 704 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16_UINT); 705 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16_SNORM); 706 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16_SINT); 707 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8_TYPELESS); 708 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8_UNORM); 709 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8_UINT); 710 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8_SNORM); 711 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8_SINT); 712 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_P8); 713 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R9G9B9E5_SHAREDEXP); 714 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8_B8G8_UNORM); 715 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_G8R8_G8B8_UNORM); 716 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC1_TYPELESS); 717 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC1_UNORM_SRGB); 718 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC2_TYPELESS); 719 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC2_UNORM_SRGB); 720 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC3_TYPELESS); 721 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC3_UNORM_SRGB); 722 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC4_TYPELESS); 723 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_ATI1); 724 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC4_SNORM); 725 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC5_TYPELESS); 726 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_ATI2); 727 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC5_SNORM); 728 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R10G10B10_XR_BIAS_A2_UNORM); 729 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B8G8R8A8_TYPELESS); 730 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM_SRGB); 731 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B8G8R8X8_TYPELESS); 732 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM_SRGB); 733 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_DF16); 734 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_DF24); 735 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_Z_D24S8_INT); 736 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_YV12); 737 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32B32A32_FLOAT); 738 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_FLOAT); 739 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16B16A16_UNORM); 740 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32G32_FLOAT); 741 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R10G10B10A2_UNORM); 742 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8B8A8_SNORM); 743 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16_FLOAT); 744 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16_UNORM); 745 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16G16_SNORM); 746 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R32_FLOAT); 747 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R8G8_SNORM); 748 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_R16_FLOAT); 749 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_D16_UNORM); 750 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_A8_UNORM); 751 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC1_UNORM); 752 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC2_UNORM); 753 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC3_UNORM); 754 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B5G6R5_UNORM); 755 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B5G5R5A1_UNORM); 756 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B8G8R8A8_UNORM); 757 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_B8G8R8X8_UNORM); 758 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC4_UNORM); 759 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_DXFMT_BC5_UNORM); 760 761 SVGA_CASE_ID2STR(SVGA3D_DEVCAP_MAX); 762 763 default: 764 break; 765 } 766 return "UNKNOWN"; 767 } 768 #undef SVGA_CASE_ID2STR 511 769 512 770 … … 1488 1746 Log(("vmsvgaWritePort: SVGA_ID_0 reg adj %#x -> %#x\n", pThis->svga.u32IndexReg, idxReg)); 1489 1747 } 1490 Log(("vmsvgaWritePort index=%s (%d) val=%#x\n", vmsvgaIndexToString(pThis, idxReg), idxReg, u32)); 1748 #ifdef LOG_ENABLED 1749 if (idxReg != SVGA_REG_DEV_CAP) 1750 Log(("vmsvgaWritePort index=%s (%d) val=%#x\n", vmsvgaIndexToString(pThis, idxReg), idxReg, u32)); 1751 else 1752 Log(("vmsvgaWritePort index=%s (%d) val=%s (%d)\n", vmsvgaIndexToString(pThis, idxReg), idxReg, vmsvgaDevCapIndexToString((SVGA3dDevCapIndex)u32), u32)); 1753 #endif 1491 1754 /* Check if the guest uses legacy registers. See vmsvgaR3ChangeMode */ 1492 1755 switch (idxReg) … … 4023 4286 to recheck it before doing the signalling. */ 4024 4287 if ( vmsvgaR3FifoHasWork(pThisCC, ASMAtomicReadU32(&pThis->svga.uLastCursorUpdateCount)) 4025 && pThis->svga.fFIFOThreadSleeping) 4288 && pThis->svga.fFIFOThreadSleeping 4289 && !ASMAtomicReadBool(&pThis->svga.fBadGuest)) 4026 4290 { 4027 4291 int rc = PDMDevHlpSUPSemEventSignal(pDevIns, pThis->svga.hFIFORequestSem); … … 4179 4443 */ 4180 4444 LogFlow(("vmsvgaR3FifoLoop: started loop\n")); 4181 bool fBadOrDisabledFifo = false;4445 bool fBadOrDisabledFifo = ASMAtomicReadBool(&pThis->svga.fBadGuest); 4182 4446 while (pThread->enmState == PDMTHREADSTATE_RUNNING) 4183 4447 { … … 4230 4494 else 4231 4495 rc = VINF_SUCCESS; 4232 fBadOrDisabledFifo = false;4496 fBadOrDisabledFifo = ASMAtomicReadBool(&pThis->svga.fBadGuest); 4233 4497 if (rc == VERR_TIMEOUT) 4234 4498 { … … 4256 4520 { 4257 4521 vmsvgaR3FifoHandleExtCmd(pDevIns, pThis, pThisCC); 4522 continue; 4523 } 4524 4525 /* 4526 * If guest misbehaves, then do nothing. 4527 */ 4528 if (ASMAtomicReadBool(&pThis->svga.fBadGuest)) 4529 { 4530 vmsvgaR3FifoSetNotBusy(pDevIns, pThis, pThisCC, pSVGAState, pFIFO[SVGA_FIFO_MIN]); 4531 cMsSleep = cMsExtendedSleep; 4532 LogRelMax(1, ("VMSVGA: FIFO processing stopped because of the guest misbehavior\n")); 4258 4533 continue; 4259 4534 } … … 5473 5748 5474 5749 # ifdef VBOX_WITH_VMSVGA3D 5475 /** Names for the vmsvga 3d capabilities, prefixed with format type hint char. */5476 static const char * const g_apszVmSvgaDevCapNames[] =5477 {5478 "x3D", /* = 0 */5479 "xMAX_LIGHTS",5480 "xMAX_TEXTURES",5481 "xMAX_CLIP_PLANES",5482 "xVERTEX_SHADER_VERSION",5483 "xVERTEX_SHADER",5484 "xFRAGMENT_SHADER_VERSION",5485 "xFRAGMENT_SHADER",5486 "xMAX_RENDER_TARGETS",5487 "xS23E8_TEXTURES",5488 "xS10E5_TEXTURES",5489 "xMAX_FIXED_VERTEXBLEND",5490 "xD16_BUFFER_FORMAT",5491 "xD24S8_BUFFER_FORMAT",5492 "xD24X8_BUFFER_FORMAT",5493 "xQUERY_TYPES",5494 "xTEXTURE_GRADIENT_SAMPLING",5495 "rMAX_POINT_SIZE",5496 "xMAX_SHADER_TEXTURES",5497 "xMAX_TEXTURE_WIDTH",5498 "xMAX_TEXTURE_HEIGHT",5499 "xMAX_VOLUME_EXTENT",5500 "xMAX_TEXTURE_REPEAT",5501 "xMAX_TEXTURE_ASPECT_RATIO",5502 "xMAX_TEXTURE_ANISOTROPY",5503 "xMAX_PRIMITIVE_COUNT",5504 "xMAX_VERTEX_INDEX",5505 "xMAX_VERTEX_SHADER_INSTRUCTIONS",5506 "xMAX_FRAGMENT_SHADER_INSTRUCTIONS",5507 "xMAX_VERTEX_SHADER_TEMPS",5508 "xMAX_FRAGMENT_SHADER_TEMPS",5509 "xTEXTURE_OPS",5510 "xSURFACEFMT_X8R8G8B8",5511 "xSURFACEFMT_A8R8G8B8",5512 "xSURFACEFMT_A2R10G10B10",5513 "xSURFACEFMT_X1R5G5B5",5514 "xSURFACEFMT_A1R5G5B5",5515 "xSURFACEFMT_A4R4G4B4",5516 "xSURFACEFMT_R5G6B5",5517 "xSURFACEFMT_LUMINANCE16",5518 "xSURFACEFMT_LUMINANCE8_ALPHA8",5519 "xSURFACEFMT_ALPHA8",5520 "xSURFACEFMT_LUMINANCE8",5521 "xSURFACEFMT_Z_D16",5522 "xSURFACEFMT_Z_D24S8",5523 "xSURFACEFMT_Z_D24X8",5524 "xSURFACEFMT_DXT1",5525 "xSURFACEFMT_DXT2",5526 "xSURFACEFMT_DXT3",5527 "xSURFACEFMT_DXT4",5528 "xSURFACEFMT_DXT5",5529 "xSURFACEFMT_BUMPX8L8V8U8",5530 "xSURFACEFMT_A2W10V10U10",5531 "xSURFACEFMT_BUMPU8V8",5532 "xSURFACEFMT_Q8W8V8U8",5533 "xSURFACEFMT_CxV8U8",5534 "xSURFACEFMT_R_S10E5",5535 "xSURFACEFMT_R_S23E8",5536 "xSURFACEFMT_RG_S10E5",5537 "xSURFACEFMT_RG_S23E8",5538 "xSURFACEFMT_ARGB_S10E5",5539 "xSURFACEFMT_ARGB_S23E8",5540 "xMISSING62",5541 "xMAX_VERTEX_SHADER_TEXTURES",5542 "xMAX_SIMULTANEOUS_RENDER_TARGETS",5543 "xSURFACEFMT_V16U16",5544 "xSURFACEFMT_G16R16",5545 "xSURFACEFMT_A16B16G16R16",5546 "xSURFACEFMT_UYVY",5547 "xSURFACEFMT_YUY2",5548 "xMULTISAMPLE_NONMASKABLESAMPLES",5549 "xMULTISAMPLE_MASKABLESAMPLES",5550 "xALPHATOCOVERAGE",5551 "xSUPERSAMPLE",5552 "xAUTOGENMIPMAPS",5553 "xSURFACEFMT_NV12",5554 "xSURFACEFMT_AYUV",5555 "xMAX_CONTEXT_IDS",5556 "xMAX_SURFACE_IDS",5557 "xSURFACEFMT_Z_DF16",5558 "xSURFACEFMT_Z_DF24",5559 "xSURFACEFMT_Z_D24S8_INT",5560 "xSURFACEFMT_ATI1",5561 "xSURFACEFMT_ATI2", /* 83 */5562 "xDEAD1",5563 "xVIDEO_DECODE",5564 "xVIDEO_PROCESS",5565 "xLINE_AA",5566 "xLINE_STIPPLE",5567 "rMAX_LINE_WIDTH",5568 "rMAX_AA_LINE_WIDTH",5569 "xSURFACEFMT_YV12",5570 "xLOGICOPS",5571 "xTS_COLOR_KEY",5572 "xDEAD2",5573 "xDX",5574 "xMAX_TEXTURE_ARRAY_SIZE",5575 "xDX_MAX_VERTEXBUFFERS",5576 "xDX_MAX_CONSTANT_BUFFERS",5577 "xDX_PROVOKING_VERTEX",5578 "xDXFMT_X8R8G8B8",5579 "xDXFMT_A8R8G8B8",5580 "xDXFMT_R5G6B5",5581 "xDXFMT_X1R5G5B5",5582 "xDXFMT_A1R5G5B5",5583 "xDXFMT_A4R4G4B4",5584 "xDXFMT_Z_D32",5585 "xDXFMT_Z_D16",5586 "xDXFMT_Z_D24S8",5587 "xDXFMT_Z_D15S1",5588 "xDXFMT_LUMINANCE8",5589 "xDXFMT_LUMINANCE4_ALPHA4",5590 "xDXFMT_LUMINANCE16",5591 "xDXFMT_LUMINANCE8_ALPHA8",5592 "xDXFMT_DXT1",5593 "xDXFMT_DXT2",5594 "xDXFMT_DXT3",5595 "xDXFMT_DXT4",5596 "xDXFMT_DXT5",5597 "xDXFMT_BUMPU8V8",5598 "xDXFMT_BUMPL6V5U5",5599 "xDXFMT_BUMPX8L8V8U8",5600 "xDXFMT_FORMAT_DEAD1",5601 "xDXFMT_ARGB_S10E5",5602 "xDXFMT_ARGB_S23E8",5603 "xDXFMT_A2R10G10B10",5604 "xDXFMT_V8U8",5605 "xDXFMT_Q8W8V8U8",5606 "xDXFMT_CxV8U8",5607 "xDXFMT_X8L8V8U8",5608 "xDXFMT_A2W10V10U10",5609 "xDXFMT_ALPHA8",5610 "xDXFMT_R_S10E5",5611 "xDXFMT_R_S23E8",5612 "xDXFMT_RG_S10E5",5613 "xDXFMT_RG_S23E8",5614 "xDXFMT_BUFFER",5615 "xDXFMT_Z_D24X8",5616 "xDXFMT_V16U16",5617 "xDXFMT_G16R16",5618 "xDXFMT_A16B16G16R16",5619 "xDXFMT_UYVY",5620 "xDXFMT_YUY2",5621 "xDXFMT_NV12",5622 "xDXFMT_AYUV",5623 "xDXFMT_R32G32B32A32_TYPELESS",5624 "xDXFMT_R32G32B32A32_UINT",5625 "xDXFMT_R32G32B32A32_SINT",5626 "xDXFMT_R32G32B32_TYPELESS",5627 "xDXFMT_R32G32B32_FLOAT",5628 "xDXFMT_R32G32B32_UINT",5629 "xDXFMT_R32G32B32_SINT",5630 "xDXFMT_R16G16B16A16_TYPELESS",5631 "xDXFMT_R16G16B16A16_UINT",5632 "xDXFMT_R16G16B16A16_SNORM",5633 "xDXFMT_R16G16B16A16_SINT",5634 "xDXFMT_R32G32_TYPELESS",5635 "xDXFMT_R32G32_UINT",5636 "xDXFMT_R32G32_SINT",5637 "xDXFMT_R32G8X24_TYPELESS",5638 "xDXFMT_D32_FLOAT_S8X24_UINT",5639 "xDXFMT_R32_FLOAT_X8X24_TYPELESS",5640 "xDXFMT_X32_TYPELESS_G8X24_UINT",5641 "xDXFMT_R10G10B10A2_TYPELESS",5642 "xDXFMT_R10G10B10A2_UINT",5643 "xDXFMT_R11G11B10_FLOAT",5644 "xDXFMT_R8G8B8A8_TYPELESS",5645 "xDXFMT_R8G8B8A8_UNORM",5646 "xDXFMT_R8G8B8A8_UNORM_SRGB",5647 "xDXFMT_R8G8B8A8_UINT",5648 "xDXFMT_R8G8B8A8_SINT",5649 "xDXFMT_R16G16_TYPELESS",5650 "xDXFMT_R16G16_UINT",5651 "xDXFMT_R16G16_SINT",5652 "xDXFMT_R32_TYPELESS",5653 "xDXFMT_D32_FLOAT",5654 "xDXFMT_R32_UINT",5655 "xDXFMT_R32_SINT",5656 "xDXFMT_R24G8_TYPELESS",5657 "xDXFMT_D24_UNORM_S8_UINT",5658 "xDXFMT_R24_UNORM_X8_TYPELESS",5659 "xDXFMT_X24_TYPELESS_G8_UINT",5660 "xDXFMT_R8G8_TYPELESS",5661 "xDXFMT_R8G8_UNORM",5662 "xDXFMT_R8G8_UINT",5663 "xDXFMT_R8G8_SINT",5664 "xDXFMT_R16_TYPELESS",5665 "xDXFMT_R16_UNORM",5666 "xDXFMT_R16_UINT",5667 "xDXFMT_R16_SNORM",5668 "xDXFMT_R16_SINT",5669 "xDXFMT_R8_TYPELESS",5670 "xDXFMT_R8_UNORM",5671 "xDXFMT_R8_UINT",5672 "xDXFMT_R8_SNORM",5673 "xDXFMT_R8_SINT",5674 "xDXFMT_P8",5675 "xDXFMT_R9G9B9E5_SHAREDEXP",5676 "xDXFMT_R8G8_B8G8_UNORM",5677 "xDXFMT_G8R8_G8B8_UNORM",5678 "xDXFMT_BC1_TYPELESS",5679 "xDXFMT_BC1_UNORM_SRGB",5680 "xDXFMT_BC2_TYPELESS",5681 "xDXFMT_BC2_UNORM_SRGB",5682 "xDXFMT_BC3_TYPELESS",5683 "xDXFMT_BC3_UNORM_SRGB",5684 "xDXFMT_BC4_TYPELESS",5685 "xDXFMT_ATI1",5686 "xDXFMT_BC4_SNORM",5687 "xDXFMT_BC5_TYPELESS",5688 "xDXFMT_ATI2",5689 "xDXFMT_BC5_SNORM",5690 "xDXFMT_R10G10B10_XR_BIAS_A2_UNORM",5691 "xDXFMT_B8G8R8A8_TYPELESS",5692 "xDXFMT_B8G8R8A8_UNORM_SRGB",5693 "xDXFMT_B8G8R8X8_TYPELESS",5694 "xDXFMT_B8G8R8X8_UNORM_SRGB",5695 "xDXFMT_Z_DF16",5696 "xDXFMT_Z_DF24",5697 "xDXFMT_Z_D24S8_INT",5698 "xDXFMT_YV12",5699 "xDXFMT_R32G32B32A32_FLOAT",5700 "xDXFMT_R16G16B16A16_FLOAT",5701 "xDXFMT_R16G16B16A16_UNORM",5702 "xDXFMT_R32G32_FLOAT",5703 "xDXFMT_R10G10B10A2_UNORM",5704 "xDXFMT_R8G8B8A8_SNORM",5705 "xDXFMT_R16G16_FLOAT",5706 "xDXFMT_R16G16_UNORM",5707 "xDXFMT_R16G16_SNORM",5708 "xDXFMT_R32_FLOAT",5709 "xDXFMT_R8G8_SNORM",5710 "xDXFMT_R16_FLOAT",5711 "xDXFMT_D16_UNORM",5712 "xDXFMT_A8_UNORM",5713 "xDXFMT_BC1_UNORM",5714 "xDXFMT_BC2_UNORM",5715 "xDXFMT_BC3_UNORM",5716 "xDXFMT_B5G6R5_UNORM",5717 "xDXFMT_B5G5R5A1_UNORM",5718 "xDXFMT_B8G8R8A8_UNORM",5719 "xDXFMT_B8G8R8X8_UNORM",5720 "xDXFMT_BC4_UNORM",5721 "xDXFMT_BC5_UNORM",5722 };5723 5724 5750 /** 5725 5751 * Initializes the host 3D capabilities and writes them to FIFO memory. … … 5744 5770 5745 5771 /* LogRel the capability value. */ 5746 if (i < RT_ELEMENTS(g_apszVmSvgaDevCapNames))5772 if (i < SVGA3D_DEVCAP_MAX) 5747 5773 { 5774 char const *pszDevCapName = &vmsvgaDevCapIndexToString((SVGA3dDevCapIndex)i)[sizeof("SVGA3D_DEVCAP")]; 5748 5775 if (RT_SUCCESS(rc)) 5749 5776 { 5750 if ( g_apszVmSvgaDevCapNames[i][0] == 'x')5751 LogRel(("VMSVGA3d: cap[%u]=%#010x {%s}\n", i, val, &g_apszVmSvgaDevCapNames[i][1]));5752 else5777 if ( i == SVGA3D_DEVCAP_MAX_POINT_SIZE 5778 || i == SVGA3D_DEVCAP_MAX_LINE_WIDTH 5779 || i == SVGA3D_DEVCAP_MAX_AA_LINE_WIDTH) 5753 5780 { 5754 5781 float const fval = *(float *)&val; 5755 LogRel(("VMSVGA3d: cap[%u]=" FLOAT_FMT_STR " {%s}\n", i, FLOAT_FMT_ARGS(fval), &g_apszVmSvgaDevCapNames[i][1]));5782 LogRel(("VMSVGA3d: cap[%u]=" FLOAT_FMT_STR " {%s}\n", i, FLOAT_FMT_ARGS(fval), pszDevCapName)); 5756 5783 } 5784 else 5785 LogRel(("VMSVGA3d: cap[%u]=%#010x {%s}\n", i, val, pszDevCapName)); 5757 5786 } 5758 5787 else 5759 LogRel(("VMSVGA3d: cap[%u]=failed rc=%Rrc {%s}\n", i, rc, &g_apszVmSvgaDevCapNames[i][1]));5788 LogRel(("VMSVGA3d: cap[%u]=failed rc=%Rrc {%s}\n", i, rc, pszDevCapName)); 5760 5789 } 5761 5790 else … … 5822 5851 RT_ZERO(pThis->svga.au32ScratchRegion); 5823 5852 5853 ASMAtomicWriteBool(&pThis->svga.fBadGuest, false); 5854 5824 5855 vmsvgaR3StateTerm(pThis, pThisCC->svga.pSvgaR3State); 5825 5856 vmsvgaR3StateInit(pDevIns, pThis, pThisCC->svga.pSvgaR3State); … … 5937 5968 AssertRCReturn(rc, rc); 5938 5969 5939 pThisCC->svga.pSvgaR3State = (PVMSVGAR3STATE)RTMemAlloc (sizeof(VMSVGAR3STATE));5970 pThisCC->svga.pSvgaR3State = (PVMSVGAR3STATE)RTMemAllocZ(sizeof(VMSVGAR3STATE)); 5940 5971 AssertReturn(pThisCC->svga.pSvgaR3State, VERR_NO_MEMORY); 5941 5972 … … 5944 5975 5945 5976 pSVGAState = pThisCC->svga.pSvgaR3State; 5977 5978 /* Register the write-protected GBO access handler type. */ 5979 rc = PGMR3HandlerPhysicalTypeRegister(PDMDevHlpGetVM(pDevIns), PGMPHYSHANDLERKIND_WRITE, 5980 vmsvgaR3GboAccessHandler, 5981 NULL, NULL, NULL, 5982 NULL, NULL, NULL, 5983 "VMSVGA GBO", &pSVGAState->hGboAccessHandlerType); 5984 AssertRCReturn(rc, rc); 5946 5985 5947 5986 /* Initialize FIFO and register capabilities. */ -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h
r86838 r86855 329 329 /** SVGA 3D overlay enabled or not. */ 330 330 bool f3DOverlayEnabled; 331 bool afPadding[5]; 331 /** Indicates that the guest behaves incorrectly. */ 332 bool volatile fBadGuest; 333 bool afPadding[4]; 332 334 uint32_t uWidth; 333 335 uint32_t uHeight; … … 382 384 /** Index written to the SVGA_REG_DEV_CAP register. */ 383 385 uint32_t u32DevCapIndex; 386 /** Low 32 bit of a command buffer address written to the SVGA_REG_COMMAND_LOW register. */ 384 387 uint32_t u32RegCommandLow; 388 /** High 32 bit of a command buffer address written to the SVGA_REG_COMMAND_HIGH register. */ 385 389 uint32_t u32RegCommandHigh; 386 390 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-dx.cpp
r86836 r86855 799 799 AssertReturn(pState, VERR_INVALID_STATE); 800 800 801 int rc = VINF_SUCCESS;801 int rc = VINF_SUCCESS; 802 802 803 803 switch (idx3dCaps) 804 804 { 805 case SVGA3D_DEVCAP_3D: 806 *pu32Val = 1; 807 break; 808 805 809 case SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH: 806 810 *pu32Val = 8192; … … 809 813 case SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT: 810 814 *pu32Val = 8192; 815 break; 816 817 case SVGA3D_DEVCAP_DX: 818 *pu32Val = 1; 811 819 break; 812 820
Note:
See TracChangeset
for help on using the changeset viewer.