Changeset 51260 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
- Timestamp:
- May 15, 2014 3:35:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r51217 r51260 784 784 } 785 785 786 #ifdef VBOX_WITH_CRHGSMI 787 typedef struct VBOXVDMA_SOURCE 788 { 789 VBVAINFOSCREEN Screen; 790 VBOXCMDVBVA_SCREENMAP_DECL(uint32_t, aTargetMap); 791 } VBOXVDMA_SOURCE; 792 #endif 793 786 794 typedef struct VBOXVDMAHOST 787 795 { … … 795 803 RTSEMEVENTMULTI HostCrCtlCompleteEvent; 796 804 int32_t volatile i32cHostCrCtlCompleted; 805 // VBOXVDMA_SOURCE aSources[VBOX_VIDEO_MAX_SCREENS]; 797 806 #endif 798 807 #ifdef VBOX_VDMA_WITH_WATCHDOG … … 1367 1376 } 1368 1377 1378 static int vboxVDMACrGuestCtlResizeEntryProcess(struct VBOXVDMAHOST *pVdma, VBOXCMDVBVA_RESIZE_ENTRY *pEntry) 1379 { 1380 PVGASTATE pVGAState = pVdma->pVGAState; 1381 VBVAINFOSCREEN Screen = pEntry->Screen; 1382 VBVAINFOVIEW View; 1383 VBOXCMDVBVA_SCREENMAP_DECL(uint32_t, aTargetMap); 1384 uint32_t u32ViewIndex = Screen.u32ViewIndex; 1385 uint16_t u16Flags = Screen.u16Flags; 1386 bool fDisable = false; 1387 1388 memcpy(aTargetMap, pEntry->aTargetMap, sizeof (aTargetMap)); 1389 1390 ASMBitClearRange(aTargetMap, pVGAState->cMonitors, VBOX_VIDEO_MAX_SCREENS); 1391 1392 if (u16Flags & VBVA_SCREEN_F_DISABLED) 1393 { 1394 fDisable = true; 1395 memset(&Screen, 0, sizeof (Screen)); 1396 Screen.u32ViewIndex = u32ViewIndex; 1397 Screen.u16Flags = VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_DISABLED; 1398 } 1399 1400 if (u32ViewIndex > pVGAState->cMonitors) 1401 { 1402 if (u32ViewIndex != 0xffffffff) 1403 { 1404 WARN(("invalid view index\n")); 1405 return VERR_INVALID_PARAMETER; 1406 } 1407 else if (!fDisable) 1408 { 1409 WARN(("0xffffffff view index only valid for disable requests\n")); 1410 return VERR_INVALID_PARAMETER; 1411 } 1412 } 1413 1414 View.u32ViewOffset = 0; 1415 View.u32ViewSize = Screen.u32LineSize * Screen.u32Height + Screen.u32StartOffset; 1416 View.u32MaxScreenSize = View.u32ViewSize + Screen.u32Width + 1; /* <- make VBVAInfoScreen logic (offEnd < pView->u32MaxScreenSize) happy */ 1417 1418 int rc = VINF_SUCCESS; 1419 1420 for (int i = ASMBitFirstSet(aTargetMap, pVGAState->cMonitors); 1421 i >= 0; 1422 i = ASMBitNextSet(aTargetMap, pVGAState->cMonitors, i)) 1423 { 1424 Screen.u32ViewIndex = i; 1425 1426 VBVAINFOSCREEN CurScreen; 1427 VBVAINFOVIEW CurView; 1428 1429 rc = VBVAGetInfoViewAndScreen(pVGAState, i, &CurView, &CurScreen); 1430 AssertRC(rc); 1431 1432 if (!memcmp(&Screen, &CurScreen, sizeof (CurScreen))) 1433 continue; 1434 1435 if (!fDisable || !CurView.u32ViewSize) 1436 { 1437 View.u32ViewIndex = Screen.u32ViewIndex; 1438 1439 rc = VBVAInfoView(pVGAState, &View); 1440 if (RT_FAILURE(rc)) 1441 { 1442 WARN(("VBVAInfoView failed %d\n", rc)); 1443 break; 1444 } 1445 } 1446 1447 rc = VBVAInfoScreen(pVGAState, &Screen); 1448 if (RT_FAILURE(rc)) 1449 { 1450 WARN(("VBVAInfoScreen failed %d\n", rc)); 1451 break; 1452 } 1453 } 1454 1455 if (RT_FAILURE(rc)) 1456 return rc; 1457 1458 Screen.u32ViewIndex = u32ViewIndex; 1459 1460 rc = pVdma->CrSrvInfo.pfnResize(pVdma->CrSrvInfo.hSvr, &Screen, aTargetMap); 1461 if (RT_FAILURE(rc)) 1462 WARN(("pfnResize failed %d\n", rc)); 1463 1464 return rc; 1465 } 1466 1369 1467 static int vboxVDMACrGuestCtlProcess(struct VBOXVDMAHOST *pVdma, VBVAEXHOSTCTL *pCmd) 1370 1468 { … … 1405 1503 1406 1504 VBOXCMDVBVA_RESIZE *pResize = (VBOXCMDVBVA_RESIZE*)pCmd->u.cmd.pu8Cmd; 1407 PVGASTATE pVGAState = pVdma->pVGAState; 1505 1408 1506 int rc = VINF_SUCCESS; 1409 1507 … … 1411 1509 { 1412 1510 VBOXCMDVBVA_RESIZE_ENTRY *pEntry = &pResize->aEntries[i]; 1413 VBVAINFOSCREEN Screen = pEntry->Screen; 1414 VBVAINFOVIEW View; 1415 uint32_t u32StartOffsetPreserve = 0; 1416 if (Screen.u32StartOffset == 0xffffffff) 1511 rc = vboxVDMACrGuestCtlResizeEntryProcess(pVdma, pEntry); 1512 if (RT_FAILURE(rc)) 1417 1513 { 1418 if (Screen.u16Flags & VBVA_SCREEN_F_DISABLED) 1419 { 1420 u32StartOffsetPreserve = 0xffffffff; 1421 Screen.u32StartOffset = 0; 1422 } 1423 else 1424 { 1425 WARN(("invalid parameter\n")); 1426 rc = VERR_INVALID_PARAMETER; 1427 break; 1428 } 1429 } 1430 1431 1432 View.u32ViewIndex = Screen.u32ViewIndex; 1433 View.u32ViewOffset = 0; 1434 View.u32ViewSize = Screen.u32LineSize * Screen.u32Height + Screen.u32StartOffset; 1435 View.u32MaxScreenSize = View.u32ViewSize + Screen.u32Width + 1; /* <- make VBVAInfoScreen logic (offEnd < pView->u32MaxScreenSize) happy */ 1436 1437 rc = VBVAInfoView(pVGAState, &View); 1438 if (RT_SUCCESS(rc)) 1439 { 1440 1441 rc = VBVAInfoScreen(pVGAState, &Screen); 1442 if (RT_SUCCESS(rc)) 1443 { 1444 if (u32StartOffsetPreserve) 1445 Screen.u32StartOffset = u32StartOffsetPreserve; 1446 1447 rc = pVdma->CrSrvInfo.pfnResize(pVdma->CrSrvInfo.hSvr, &Screen, u32StartOffsetPreserve ? NULL : pVGAState->vram_ptrR3 + Screen.u32StartOffset); 1448 if (RT_SUCCESS(rc)) 1449 continue; 1450 else 1451 { 1452 WARN(("pfnResize failed %d\n", rc)); 1453 break; 1454 } 1455 } 1456 else 1457 { 1458 WARN(("VBVAInfoScreen failed %d\n", rc)); 1459 break; 1460 } 1461 } 1462 else 1463 { 1464 WARN(("VBVAInfoView failed %d\n", rc)); 1514 WARN(("vboxVDMACrGuestCtlResizeEntryProcess failed %d\n", rc)); 1465 1515 break; 1466 1516 }
Note:
See TracChangeset
for help on using the changeset viewer.