Changeset 69848 in vbox for trunk/src/VBox
- Timestamp:
- Nov 27, 2017 6:08:01 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r69847 r69848 1278 1278 } 1279 1279 1280 if (!pVdma->CrSrvInfo.pfnEnable)1281 {1282 # ifdef DEBUG_misha1283 WARN(("pfnEnable is NULL\n"));1284 return VERR_NOT_SUPPORTED;1285 # endif1286 }1287 1288 1280 int rc = VBoxVBVAExHSEnable(&pVdma->CmdVbva, pVBVA); 1289 1281 if (RT_SUCCESS(rc)) 1290 1282 { 1283 if (!pVdma->CrSrvInfo.pfnEnable) 1284 { 1285 /* "HGCM-less" mode. All inited. */ 1286 return VINF_SUCCESS; 1287 } 1288 1291 1289 VBOXCRCMDCTL_DISABLE Disable; 1292 1290 Disable.Hdr.enmType = VBOXCRCMDCTL_TYPE_DISABLE; … … 1330 1328 } 1331 1329 1330 if (!pVdma->CrSrvInfo.pfnDisable) 1331 { 1332 /* "HGCM-less" mode. Just undo what vdmaVBVAEnableProcess did. */ 1333 VBoxVBVAExHSDisable(&pVdma->CmdVbva); 1334 return VINF_SUCCESS; 1335 } 1336 1332 1337 int rc = pVdma->CrSrvInfo.pfnDisable(pVdma->CrSrvInfo.hSvr); 1333 1338 if (RT_SUCCESS(rc)) … … 1374 1379 return VERR_INVALID_STATE; 1375 1380 } 1381 if (!pVdma->CrSrvInfo.pfnHostCtl) 1382 { 1383 /* Should not be. */ 1384 WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE for HGCM-less mode\n")); 1385 return VERR_INVALID_STATE; 1386 } 1376 1387 return pVdma->CrSrvInfo.pfnHostCtl(pVdma->CrSrvInfo.hSvr, pCmd->u.cmd.pu8Cmd, pCmd->u.cmd.cbCmd); 1377 1388 } … … 1418 1429 VGA_SAVED_STATE_PUT_MARKER(pCmd->u.state.pSSM, 4); 1419 1430 1431 if (!pVdma->CrSrvInfo.pfnSaveState) 1432 { 1433 /* Done. */ 1434 return VINF_SUCCESS; 1435 } 1436 1420 1437 return pVdma->CrSrvInfo.pfnSaveState(pVdma->CrSrvInfo.hSvr, pCmd->u.state.pSSM); 1421 1438 } … … 1433 1450 1434 1451 VGA_SAVED_STATE_GET_MARKER_RETURN_ON_MISMATCH(pCmd->u.state.pSSM, pCmd->u.state.u32Version, 4); 1452 if (!pVdma->CrSrvInfo.pfnLoadState) 1453 { 1454 /* Done. */ 1455 return VINF_SUCCESS; 1456 } 1457 1435 1458 rc = pVdma->CrSrvInfo.pfnLoadState(pVdma->CrSrvInfo.hSvr, pCmd->u.state.pSSM, pCmd->u.state.u32Version); 1436 1459 if (RT_FAILURE(rc)) … … 1549 1572 ASMBitClearRange(aTargetMap, pVGAState->cMonitors, VBOX_VIDEO_MAX_SCREENS); 1550 1573 1551 rc = pVdma->CrSrvInfo.pfnResize(pVdma->CrSrvInfo.hSvr, &Screen, aTargetMap); 1552 if (RT_FAILURE(rc)) 1553 { 1554 WARN(("pfnResize failed %d\n", rc)); 1555 return rc; 1574 if (pVdma->CrSrvInfo.pfnResize) 1575 { 1576 /* Also inform the HGCM service, if it is there. */ 1577 rc = pVdma->CrSrvInfo.pfnResize(pVdma->CrSrvInfo.hSvr, &Screen, aTargetMap); 1578 if (RT_FAILURE(rc)) 1579 { 1580 WARN(("pfnResize failed %d\n", rc)); 1581 return rc; 1582 } 1556 1583 } 1557 1584 … … 1614 1641 { 1615 1642 WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE for disabled vdma VBVA\n")); 1643 return VERR_INVALID_STATE; 1644 } 1645 if (!pVdma->CrSrvInfo.pfnGuestCtl) 1646 { 1647 /* Unexpected. */ 1648 WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE in HGCM-less mode\n")); 1616 1649 return VERR_INVALID_STATE; 1617 1650 } … … 1895 1928 } 1896 1929 default: 1930 if (!pVdma->CrSrvInfo.pfnCmd) 1931 { 1932 /* Unexpected. */ 1933 WARN(("no HGCM")); 1934 return -1; 1935 } 1897 1936 return pVdma->CrSrvInfo.pfnCmd(pVdma->CrSrvInfo.hSvr, pCmd, cbCmd); 1898 1937 } … … 2800 2839 { 2801 2840 pVGAState->pVdma = pVdma; 2802 int rcIgnored = vboxVDMACrCtlHgsmiSetup(pVdma); NOREF(rcIgnored); /** @todo is this ignoring intentional? */ 2841 2842 /* No HGCM service if VMSVGA is enabled. */ 2843 if (!pVGAState->fVMSVGAEnabled) 2844 { 2845 int rcIgnored = vboxVDMACrCtlHgsmiSetup(pVdma); NOREF(rcIgnored); /** @todo is this ignoring intentional? */ 2846 } 2803 2847 return VINF_SUCCESS; 2804 2848 } … … 2843 2887 return VINF_SUCCESS; 2844 2888 #ifdef VBOX_WITH_CRHGSMI 2845 vdmaVBVACtlDisableSync(pVdma); 2889 if (pVdma->pVGAState->fVMSVGAEnabled) 2890 VBoxVBVAExHSDisable(&pVdma->CmdVbva); 2891 else 2892 { 2893 /** @todo Remove. It does nothing because pVdma->CmdVbva is already disabled at this point 2894 * as the result of the SharedOpenGL HGCM service unloading. 2895 */ 2896 vdmaVBVACtlDisableSync(pVdma); 2897 } 2846 2898 VBoxVDMAThreadCleanup(&pVdma->Thread); 2847 2899 VBoxVBVAExHSTerm(&pVdma->CmdVbva);
Note:
See TracChangeset
for help on using the changeset viewer.