Changeset 83142 in vbox
- Timestamp:
- Feb 24, 2020 7:24:26 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136260
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r82968 r83142 743 743 VBGLR3DECL(int) VbglR3SeamlessWaitEvent(VMMDevSeamlessMode *pMode); 744 744 VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects); 745 VBGLR3DECL(int) VbglR3SeamlessSendMonitorPositions(uint32_t cPositions, PRTPOINT pPositions); 745 746 VBGLR3DECL(int) VbglR3SeamlessGetLastEvent(VMMDevSeamlessMode *pMode); 746 747 … … 1263 1264 1264 1265 #endif /* !VBOX_INCLUDED_VBoxGuestLib_h */ 1265 -
trunk/include/VBox/VMMDev.h
r82968 r83142 202 202 VMMDevReq_HeartbeatConfigure = 220, 203 203 VMMDevReq_NtBugCheck = 221, 204 VMMDevReq_VideoUpdateMonitorPositions= 222, 204 205 VMMDevReq_SizeHack = 0x7fffffff 205 206 } VMMDevRequestType; … … 1349 1350 AssertCompileSize(RTRECT, 16); 1350 1351 AssertCompileSize(VMMDevVideoSetVisibleRegion, 24+4+16); 1352 1353 /** 1354 * VBVA monitor positions update request structure. 1355 * 1356 * Used by VMMDevReq_VideoUpdateMonitorPositions. 1357 */ 1358 typedef struct 1359 { 1360 /** Header. */ 1361 VMMDevRequestHeader header; 1362 /** Number of monitor positions (monitors) */ 1363 uint32_t cPositions; 1364 /** Positions array.*/ 1365 RTPOINT aPositions[1]; 1366 } VMMDevVideoUpdateMonitorPositions; 1367 AssertCompileSize(RTPOINT, 8); 1368 AssertCompileSize(VMMDevVideoUpdateMonitorPositions, 24+4+8); 1351 1369 1352 1370 /** … … 1822 1840 case VMMDevReq_GuestHeartbeat: 1823 1841 return sizeof(VMMDevRequestHeader); 1842 case VMMDevReq_VideoUpdateMonitorPositions: 1843 return sizeof(VMMDevVideoUpdateMonitorPositions); 1824 1844 default: 1825 1845 break; … … 1970 1990 1971 1991 #endif /* !VBOX_INCLUDED_VMMDev_h */ 1972 -
trunk/include/VBox/vmm/pdmifs.h
r82968 r83142 710 710 */ 711 711 DECLR3CALLBACKMEMBER(void, pfnReportHostCursorPosition, (PPDMIDISPLAYPORT pInterface, uint32_t x, uint32_t y, bool fOutOfRange)); 712 713 /** 714 * Notify the graphics device about the monitor positions since the ones we get from vmwgfx FIFO are not correct. In an ideal 715 * universe this method should not be here. 716 * 717 * @param pInterface Pointer to this interface. 718 * @param cPositions Number of monitor positions 719 * @param pPosition Monitor positions (offsets/origins) array 720 * @thread Any. 721 */ 722 DECLR3CALLBACKMEMBER(void, pfnReportMonitorPositions, (PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PRTPOINT pPosition)); 723 712 724 } PDMIDISPLAYPORT; 713 725 /** PDMIDISPLAYPORT interface ID. */ … … 1814 1826 1815 1827 /** 1828 * Update monitor positions (offsets). Passing monitor positions from the guest to host 1829 * exclusively since vmwgfx fails to do so (thru FIFO). 1830 * 1831 * @returns VBox status code. 1832 * @param pInterface Pointer to this interface. 1833 * @param cPositions Number of monitor positions 1834 * @param pPosition Positions array 1835 * @thread The emulation thread. 1836 * 1837 * @remarks Is allowed to be NULL. 1838 */ 1839 DECLR3CALLBACKMEMBER(int, pfnUpdateMonitorPositions,(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cPositions, PRTPOINT pPosition)); 1840 1841 /** 1816 1842 * Query the visible region of the display 1817 1843 * -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r82968 r83142 2388 2388 case VMMDevReq_VideoAccelFlush: 2389 2389 case VMMDevReq_VideoSetVisibleRegion: 2390 case VMMDevReq_VideoUpdateMonitorPositions: 2390 2391 case VMMDevReq_GetDisplayChangeRequestEx: 2391 2392 case VMMDevReq_GetDisplayChangeRequestMulti: … … 4504 4505 return fOurIrq; 4505 4506 } 4506 -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibGenericRequest.cpp
r82968 r83142 96 96 || pReq->requestType == VMMDevReq_LogString 97 97 || pReq->requestType == VMMDevReq_SetPointerShape 98 || pReq->requestType == VMMDevReq_VideoSetVisibleRegion) 98 || pReq->requestType == VMMDevReq_VideoSetVisibleRegion 99 || pReq->requestType == VMMDevReq_VideoUpdateMonitorPositions) 99 100 { 100 101 if (RT_UNLIKELY(cbReq > VMMDEV_MAX_VMMDEVREQ_SIZE)) … … 181 182 VbglR0PhysHeapFree(pReq); 182 183 } 183 -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibSeamless.cpp
r82968 r83142 171 171 } 172 172 173 VBGLR3DECL(int) VbglR3SeamlessSendMonitorPositions(uint32_t cPositions, PRTPOINT pPositions) 174 { 175 VMMDevVideoUpdateMonitorPositions *pReq; 176 int rc; 177 178 AssertReturn(cPositions || cPositions == 0, VERR_INVALID_PARAMETER); 179 //AssertMsgReturn(cRects <= _1M, ("%u\n", cRects), VERR_OUT_OF_RANGE); 180 181 rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, 182 sizeof(VMMDevVideoUpdateMonitorPositions) 183 + cPositions * sizeof(RTPOINT) 184 - sizeof(RTPOINT), 185 VMMDevReq_VideoUpdateMonitorPositions); 186 if (RT_SUCCESS(rc)) 187 { 188 pReq->cPositions = cPositions; 189 if (cPositions) 190 memcpy(&pReq->aPositions, pPositions, cPositions * sizeof(RTPOINT)); 191 rc = vbglR3GRPerform(&pReq->header); 192 LogFunc(("Monitor position update request returned %Rrc, internal %Rrc.\n", 193 rc, pReq->header.rc)); 194 if (RT_SUCCESS(rc)) 195 rc = pReq->header.rc; 196 vbglR3GRFree(&pReq->header); 197 } 198 LogFunc(("Sending monitor positions (%u of them) to the host: %Rrc\n", cPositions, rc)); 199 return rc; 200 } -
trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
r83140 r83142 142 142 } 143 143 144 static void sendMonitorPositions(RTPOINT *pPositions, size_t cPositions) 145 { 146 if (cPositions && !pPositions) 147 { 148 VBClLogError(("Monitor position update called with NULL pointer!\n")); 149 return; 150 } 151 VbglR3SeamlessSendMonitorPositions(cPositions, pPositions); 152 } 153 144 154 static void queryMonitorPositions() 145 155 { … … 181 191 mpMonitorPositions[iMonitorID].y = pMonitorInfo[i].y; 182 192 } 183 //if (iMonitorCount > 0)184 //mHostMonitorPositionSendCallback(mpMonitorPositions, x11Context.hOutputCount);193 if (iMonitorCount > 0) 194 mHostMonitorPositionSendCallback(mpMonitorPositions, x11Context.hOutputCount); 185 195 } 186 196 XRRFreeMonitors(pMonitorInfo); -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r83061 r83142 1290 1290 #ifdef IN_RING3 1291 1291 /** 1292 * Apply the current resolution settings to change the video mode.1292 * Updating screen information in API 1293 1293 * 1294 * @returns VBox status code. 1295 * @param pThis The shared VGA state. 1296 * @param pThisCC The ring-3 VGA state. 1297 */ 1298 static int vmsvgaR3ChangeMode(PVGASTATE pThis, PVGASTATECC pThisCC) 1294 * @param pThis The The shared VGA/VMSVGA instance data. 1295 * @param pThisCC The VGA/VMSVGA state for ring-3. 1296 */ 1297 void vmsvgaR3VBVAResize(PVGASTATE pThis, PVGASTATECC pThisCC) 1299 1298 { 1300 1299 int rc; 1301 1300 1302 /* Always do changemode on FIFO thread. */1303 Assert(RTThreadSelf() == pThisCC->svga.pFIFOIOThread->Thread);1304 1305 1301 PVMSVGAR3STATE pSVGAState = pThisCC->svga.pSvgaR3State; 1306 1307 pThisCC->pDrv->pfnLFBModeChange(pThisCC->pDrv, true);1308 1309 if (pThis->svga.fGFBRegisters)1310 {1311 /* "For backwards compatibility, when the GFB mode registers (WIDTH,1312 * HEIGHT, PITCHLOCK, BITS_PER_PIXEL) are modified, the SVGA device1313 * deletes all screens other than screen #0, and redefines screen1314 * #0 according to the specified mode. Drivers that use1315 * SVGA_CMD_DEFINE_SCREEN should destroy or redefine screen #0."1316 */1317 1318 VMSVGASCREENOBJECT *pScreen = &pSVGAState->aScreens[0];1319 pScreen->fDefined = true;1320 pScreen->fModified = true;1321 pScreen->fuScreen = SVGA_SCREEN_MUST_BE_SET | SVGA_SCREEN_IS_PRIMARY;1322 pScreen->idScreen = 0;1323 pScreen->xOrigin = 0;1324 pScreen->yOrigin = 0;1325 pScreen->offVRAM = 0;1326 pScreen->cbPitch = pThis->svga.cbScanline;1327 pScreen->cWidth = pThis->svga.uWidth;1328 pScreen->cHeight = pThis->svga.uHeight;1329 pScreen->cBpp = pThis->svga.uBpp;1330 1331 for (unsigned iScreen = 1; iScreen < RT_ELEMENTS(pSVGAState->aScreens); ++iScreen)1332 {1333 /* Delete screen. */1334 pScreen = &pSVGAState->aScreens[iScreen];1335 if (pScreen->fDefined)1336 {1337 pScreen->fModified = true;1338 pScreen->fDefined = false;1339 }1340 }1341 }1342 else1343 {1344 /* "If Screen Objects are supported, they can be used to fully1345 * replace the functionality provided by the framebuffer registers1346 * (SVGA_REG_WIDTH, HEIGHT, etc.) and by SVGA_CAP_DISPLAY_TOPOLOGY."1347 */1348 pThis->svga.uWidth = VMSVGA_VAL_UNINITIALIZED;1349 pThis->svga.uHeight = VMSVGA_VAL_UNINITIALIZED;1350 pThis->svga.uBpp = VMSVGA_VAL_UNINITIALIZED;1351 }1352 1302 1353 1303 for (unsigned iScreen = 0; iScreen < RT_ELEMENTS(pSVGAState->aScreens); ++iScreen) … … 1401 1351 AssertRC(rc); 1402 1352 } 1353 } 1354 1355 /** 1356 * Apply the current resolution settings to change the video mode. 1357 * 1358 * @returns VBox status code. 1359 * @param pThis The shared VGA state. 1360 * @param pThisCC The ring-3 VGA state. 1361 */ 1362 static int vmsvgaR3ChangeMode(PVGASTATE pThis, PVGASTATECC pThisCC) 1363 { 1364 /* Always do changemode on FIFO thread. */ 1365 Assert(RTThreadSelf() == pThisCC->svga.pFIFOIOThread->Thread); 1366 1367 PVMSVGAR3STATE pSVGAState = pThisCC->svga.pSvgaR3State; 1368 1369 pThisCC->pDrv->pfnLFBModeChange(pThisCC->pDrv, true); 1370 1371 if (pThis->svga.fGFBRegisters) 1372 { 1373 /* "For backwards compatibility, when the GFB mode registers (WIDTH, 1374 * HEIGHT, PITCHLOCK, BITS_PER_PIXEL) are modified, the SVGA device 1375 * deletes all screens other than screen #0, and redefines screen 1376 * #0 according to the specified mode. Drivers that use 1377 * SVGA_CMD_DEFINE_SCREEN should destroy or redefine screen #0." 1378 */ 1379 1380 VMSVGASCREENOBJECT *pScreen = &pSVGAState->aScreens[0]; 1381 pScreen->fDefined = true; 1382 pScreen->fModified = true; 1383 pScreen->fuScreen = SVGA_SCREEN_MUST_BE_SET | SVGA_SCREEN_IS_PRIMARY; 1384 pScreen->idScreen = 0; 1385 pScreen->xOrigin = 0; 1386 pScreen->yOrigin = 0; 1387 pScreen->offVRAM = 0; 1388 pScreen->cbPitch = pThis->svga.cbScanline; 1389 pScreen->cWidth = pThis->svga.uWidth; 1390 pScreen->cHeight = pThis->svga.uHeight; 1391 pScreen->cBpp = pThis->svga.uBpp; 1392 1393 for (unsigned iScreen = 1; iScreen < RT_ELEMENTS(pSVGAState->aScreens); ++iScreen) 1394 { 1395 /* Delete screen. */ 1396 pScreen = &pSVGAState->aScreens[iScreen]; 1397 if (pScreen->fDefined) 1398 { 1399 pScreen->fModified = true; 1400 pScreen->fDefined = false; 1401 } 1402 } 1403 } 1404 else 1405 { 1406 /* "If Screen Objects are supported, they can be used to fully 1407 * replace the functionality provided by the framebuffer registers 1408 * (SVGA_REG_WIDTH, HEIGHT, etc.) and by SVGA_CAP_DISPLAY_TOPOLOGY." 1409 */ 1410 pThis->svga.uWidth = VMSVGA_VAL_UNINITIALIZED; 1411 pThis->svga.uHeight = VMSVGA_VAL_UNINITIALIZED; 1412 pThis->svga.uBpp = VMSVGA_VAL_UNINITIALIZED; 1413 } 1414 1415 vmsvgaR3VBVAResize(pThis, pThisCC); 1403 1416 1404 1417 /* Last stuff. For the VGA device screenshot. */ … … 5460 5473 } 5461 5474 5475 /** 5476 * Used to update screen offsets (positions) since appearently vmwgfx fails to pass correct offsets thru FIFO. 5477 * 5478 * @param pInterface The device instance. 5479 * @param cPosition The size of the pPosition array 5480 * @param pPosition Monitor positions. We assume for the disable monitors the positions is (-1, -1) 5481 */ 5482 DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PRTPOINT pPosition) 5483 { 5484 PVGASTATECC pThisCC = RT_FROM_MEMBER(pInterface, VGASTATECC, IPort); 5485 PVGASTATE pThis = PDMDEVINS_2_DATA(pThisCC->pDevIns, PVGASTATE); 5486 5487 5488 PVMSVGAR3STATE pSVGAState = pThisCC->svga.pSvgaR3State; 5489 size_t cScreenCount = RT_ELEMENTS(pSVGAState->aScreens); 5490 5491 VMSVGASCREENOBJECT *pScreens = pSVGAState->aScreens; 5492 /* We assume cPositions is the # of outputs Xserver reports and pPosition is (-1, -1) for disabled monitors. */ 5493 for (unsigned i = 0; i < cPositions; ++i) 5494 { 5495 /* Stop walking the array once we go thru all the monitors. */ 5496 if (i >= cScreenCount) 5497 break; 5498 if ( pScreens[i].xOrigin == -1 5499 || pScreens[i].yOrigin == -1) 5500 continue; 5501 if ( pScreens[i].xOrigin == pPosition[i].x 5502 && pScreens[i].yOrigin == pPosition[i].y) 5503 continue; 5504 pScreens[i].xOrigin = pPosition[i].x; 5505 pScreens[i].yOrigin = pPosition[i].y; 5506 pScreens[i].fModified = true; 5507 } 5508 vmsvgaR3VBVAResize(pThis, pThisCC); 5509 } 5462 5510 5463 5511 /** … … 6523 6571 6524 6572 #endif /* IN_RING3 */ 6525 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h
r82968 r83142 393 393 DECLCALLBACK(void) vmsvgaR3PortSetViewport(PPDMIDISPLAYPORT pInterface, uint32_t uScreenId, 394 394 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy); 395 DECLCALLBACK(void) vmsvgaR3PortReportMonitorPositions(PPDMIDISPLAYPORT pInterface, uint32_t cPositions, PRTPOINT pPosition); 395 396 396 397 int vmsvgaR3Init(PPDMDEVINS pDevIns); … … 419 420 420 421 #endif /* !VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA_h */ 421 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r82968 r83142 6590 6590 pThisCC->IPort.pfnReportHostCursorCapabilities = vgaR3PortReportHostCursorCapabilities; 6591 6591 pThisCC->IPort.pfnReportHostCursorPosition = vgaR3PortReportHostCursorPosition; 6592 # ifdef VBOX_WITH_VMSVGA 6593 pThisCC->IPort.pfnReportMonitorPositions = vmsvgaR3PortReportMonitorPositions; 6594 # else 6595 pThisCC->IPort.pfnReportMonitorPositions = NULL; 6596 # endif 6597 6592 6598 6593 6599 # if defined(VBOX_WITH_HGSMI) && defined(VBOX_WITH_VIDEOHWACCEL) -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r82968 r83142 1995 1995 } 1996 1996 1997 /** 1998 * Handles VMMDevReq_VideoUpdateMonitorPositions. 1999 * 2000 * @returns VBox status code that the guest should see. 2001 * @param pThisCC The VMMDev ring-3 instance data. 2002 * @param pReqHdr The header of the request to handle. 2003 */ 2004 static int vmmdevReqHandler_VideoUpdateMonitorPositions(PVMMDEVCC pThisCC, VMMDevRequestHeader *pReqHdr) 2005 { 2006 VMMDevVideoUpdateMonitorPositions *pReq = (VMMDevVideoUpdateMonitorPositions *)pReqHdr; 2007 AssertMsgReturn(pReq->header.size + sizeof(RTRECT) >= sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER); 2008 if (!pThisCC->pDrv) 2009 { 2010 Log(("VMMDevReq_VideoUpdateMonitorPositions: Connector is NULL!!!\n")); 2011 return VERR_NOT_SUPPORTED; 2012 } 2013 if ( pReq->cPositions > _1M /* restrict to sane range */ 2014 || pReq->header.size != sizeof(VMMDevVideoUpdateMonitorPositions) + pReq->cPositions * sizeof(RTPOINT) - sizeof(RTPOINT)) 2015 { 2016 Log(("VMMDevReq_VideoUpdateMonitorPositions: cRects=%#x doesn't match size=%#x or is out of bounds\n", 2017 pReq->cPositions, pReq->header.size)); 2018 return VERR_INVALID_PARAMETER; 2019 } 2020 Log(("VMMDevReq_VideoUpdateMonitorPositions %d rectangles\n", pReq->cPositions)); 2021 /* forward the call */ 2022 return pThisCC->pDrv->pfnUpdateMonitorPositions(pThisCC->pDrv, pReq->cPositions, &(pReq->aPositions[0])); 2023 } 1997 2024 1998 2025 /** … … 2653 2680 int rcRet = VINF_SUCCESS; 2654 2681 Assert(*pfPostOptimize == 0); 2655 2656 2682 switch (pReqHdr->requestType) 2657 2683 { … … 2807 2833 case VMMDevReq_VideoSetVisibleRegion: 2808 2834 pReqHdr->rc = vmmdevReqHandler_VideoSetVisibleRegion(pThisCC, pReqHdr); 2835 break; 2836 2837 case VMMDevReq_VideoUpdateMonitorPositions: 2838 pReqHdr->rc = vmmdevReqHandler_VideoUpdateMonitorPositions(pThisCC, pReqHdr); 2809 2839 break; 2810 2840 -
trunk/src/VBox/Main/include/DisplayImpl.h
r82968 r83142 162 162 int i_saveVisibleRegion(uint32_t cRect, PRTRECT pRect); 163 163 int i_handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect); 164 int i_handleUpdateMonitorPositions(uint32_t cPositions, PRTPOINT pPosition); 164 165 int i_handleQueryVisibleRegion(uint32_t *pcRects, PRTRECT paRects); 165 166 -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r82968 r83142 76 76 /** Pointer to the driver instance structure. */ 77 77 PPDMDRVINS pDrvIns; 78 /** Pointer to the keyboardport interface of the driver/device above us. */78 /** Pointer to the display port interface of the driver/device above us. */ 79 79 PPDMIDISPLAYPORT pUpPort; 80 80 /** Our display connector interface. */ … … 1283 1283 RTMemTmpFree(pVisibleRegion); 1284 1284 1285 return VINF_SUCCESS; 1286 } 1287 1288 int Display::i_handleUpdateMonitorPositions(uint32_t cPositions, PRTPOINT pPosition) 1289 { 1290 AssertMsgReturn(pPosition, ("Empty monitor position array\n"), E_INVALIDARG); 1291 if (mpDrv && mpDrv->pUpPort->pfnReportMonitorPositions) 1292 mpDrv->pUpPort->pfnReportMonitorPositions(mpDrv->pUpPort, cPositions, pPosition); 1285 1293 return VINF_SUCCESS; 1286 1294 } -
trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
r82968 r83142 458 458 /* Forward to Display, which calls corresponding framebuffers. */ 459 459 pConsole->i_getDisplay()->i_handleSetVisibleRegion(cRect, pRect); 460 461 return VINF_SUCCESS; 462 } 463 464 DECLCALLBACK(int) vmmdevUpdateMonitorPositions(PPDMIVMMDEVCONNECTOR pInterface, uint32_t cPositions, PRTPOINT pPositions) 465 { 466 PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); 467 Console *pConsole = pDrv->pVMMDev->getParent(); 468 469 pConsole->i_getDisplay()->i_handleUpdateMonitorPositions(cPositions, pPositions); 460 470 461 471 return VINF_SUCCESS; … … 1070 1080 pThis->Connector.pfnSetCredentialsJudgementResult = vmmdevSetCredentialsJudgementResult; 1071 1081 pThis->Connector.pfnSetVisibleRegion = vmmdevSetVisibleRegion; 1082 pThis->Connector.pfnUpdateMonitorPositions = vmmdevUpdateMonitorPositions; 1072 1083 pThis->Connector.pfnQueryVisibleRegion = vmmdevQueryVisibleRegion; 1073 1084 pThis->Connector.pfnReportStatistics = vmmdevReportStatistics;
Note:
See TracChangeset
for help on using the changeset viewer.