Changeset 55837 in vbox
- Timestamp:
- May 13, 2015 6:55:42 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100280
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r55133 r55837 1000 1000 1001 1001 #ifdef DEBUG_sunlover 1002 LogFlowFunc(("[%d] %d,%d %dx%d (%d,%d)\n",1003 uScreenId, x, y, w, h , mpDrv->IConnector.cx, mpDrv->IConnector.cy));1002 LogFlowFunc(("[%d] %d,%d %dx%d\n", 1003 uScreenId, x, y, w, h)); 1004 1004 #endif /* DEBUG_sunlover */ 1005 1005 … … 1014 1014 return; */ 1015 1015 1016 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 1017 i_checkCoordBounds (&x, &y, &w, &h, mpDrv->IConnector.cx, mpDrv->IConnector.cy); 1018 else 1019 i_checkCoordBounds (&x, &y, &w, &h, maFramebuffers[uScreenId].w, 1020 maFramebuffers[uScreenId].h); 1016 i_checkCoordBounds (&x, &y, &w, &h, maFramebuffers[uScreenId].w, 1017 maFramebuffers[uScreenId].h); 1021 1018 1022 1019 IFramebuffer *pFramebuffer = maFramebuffers[uScreenId].pFramebuffer; … … 1155 1152 x1 = (int32_t)maFramebuffers[0].xOrigin; 1156 1153 y1 = (int32_t)maFramebuffers[0].yOrigin; 1157 x2 = mpDrv->IConnector.cx+ (int32_t)maFramebuffers[0].xOrigin;1158 y2 = mpDrv->IConnector.cy+ (int32_t)maFramebuffers[0].yOrigin;1154 x2 = (int32_t)maFramebuffers[0].w + (int32_t)maFramebuffers[0].xOrigin; 1155 y2 = (int32_t)maFramebuffers[0].h + (int32_t)maFramebuffers[0].yOrigin; 1159 1156 } 1160 1157 if (cxInputMapping && cyInputMapping) … … 1272 1269 */ 1273 1270 RTRECT rectFramebuffer; 1274 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 1275 { 1276 rectFramebuffer.xLeft = 0; 1277 rectFramebuffer.yTop = 0; 1278 if (mpDrv) 1279 { 1280 rectFramebuffer.xRight = mpDrv->IConnector.cx; 1281 rectFramebuffer.yBottom = mpDrv->IConnector.cy; 1282 } 1283 else 1284 { 1285 rectFramebuffer.xRight = 0; 1286 rectFramebuffer.yBottom = 0; 1287 } 1288 } 1289 else 1290 { 1291 rectFramebuffer.xLeft = pFBInfo->xOrigin; 1292 rectFramebuffer.yTop = pFBInfo->yOrigin; 1293 rectFramebuffer.xRight = pFBInfo->xOrigin + pFBInfo->w; 1294 rectFramebuffer.yBottom = pFBInfo->yOrigin + pFBInfo->h; 1295 } 1271 rectFramebuffer.xLeft = pFBInfo->xOrigin; 1272 rectFramebuffer.yTop = pFBInfo->yOrigin; 1273 rectFramebuffer.xRight = pFBInfo->xOrigin + pFBInfo->w; 1274 rectFramebuffer.yBottom = pFBInfo->yOrigin + pFBInfo->h; 1296 1275 1297 1276 uint32_t cRectVisibleRegion = 0; … … 1547 1526 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1548 1527 1549 uint32_t u32Width = 0;1550 uint32_t u32Height = 0;1551 uint32_t u32BitsPerPixel = 0; 1552 int32_t xOrigin = 0;1553 int32_t yOrigin = 0; 1528 if (aScreenId >= mcMonitors) 1529 return E_INVALIDARG; 1530 1531 DISPLAYFBINFO *pFBInfo = &maFramebuffers[aScreenId]; 1532 1554 1533 GuestMonitorStatus_T guestMonitorStatus = GuestMonitorStatus_Enabled; 1555 1556 if (aScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 1557 { 1558 if (mpDrv) 1559 { 1560 u32Width = mpDrv->IConnector.cx; 1561 u32Height = mpDrv->IConnector.cy; 1562 1563 alock.release(); 1564 1565 int rc = mpDrv->pUpPort->pfnQueryColorDepth(mpDrv->pUpPort, &u32BitsPerPixel); 1566 AssertRC(rc); 1567 1568 alock.acquire(); 1569 } 1570 } 1571 else if (aScreenId < mcMonitors) 1572 { 1573 DISPLAYFBINFO *pFBInfo = &maFramebuffers[aScreenId]; 1574 u32Width = pFBInfo->w; 1575 u32Height = pFBInfo->h; 1576 u32BitsPerPixel = pFBInfo->u16BitsPerPixel; 1577 xOrigin = pFBInfo->xOrigin; 1578 yOrigin = pFBInfo->yOrigin; 1579 if (pFBInfo->flags & VBVA_SCREEN_F_DISABLED) 1580 guestMonitorStatus = GuestMonitorStatus_Disabled; 1581 } 1582 else 1583 { 1584 return E_INVALIDARG; 1585 } 1534 if (pFBInfo->flags & VBVA_SCREEN_F_DISABLED) 1535 guestMonitorStatus = GuestMonitorStatus_Disabled; 1586 1536 1587 1537 if (aWidth) 1588 *aWidth = u32Width;1538 *aWidth = pFBInfo->w; 1589 1539 if (aHeight) 1590 *aHeight = u32Height;1540 *aHeight = pFBInfo->h; 1591 1541 if (aBitsPerPixel) 1592 *aBitsPerPixel = u32BitsPerPixel;1542 *aBitsPerPixel = pFBInfo->u16BitsPerPixel; 1593 1543 if (aXOrigin) 1594 *aXOrigin = xOrigin;1544 *aXOrigin = pFBInfo->xOrigin; 1595 1545 if (aYOrigin) 1596 *aYOrigin = yOrigin;1546 *aYOrigin = pFBInfo->yOrigin; 1597 1547 if (aGuestMonitorStatus) 1598 1548 *aGuestMonitorStatus = guestMonitorStatus; … … 1736 1686 ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel) 1737 1687 { 1738 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1688 if (aWidth == 0 || aHeight == 0 || aBitsPerPixel == 0) 1689 { 1690 /* Some of parameters must not change. Query current mode. */ 1691 ULONG ulWidth = 0; 1692 ULONG ulHeight = 0; 1693 ULONG ulBitsPerPixel = 0; 1694 HRESULT hr = getScreenResolution(aDisplay, &ulWidth, &ulHeight, &ulBitsPerPixel, NULL, NULL, NULL); 1695 if (FAILED(hr)) 1696 return hr; 1697 1698 /* Assign current values to not changing parameters. */ 1699 if (aWidth == 0) 1700 aWidth = ulWidth; 1701 if (aHeight == 0) 1702 aHeight = ulHeight; 1703 if (aBitsPerPixel == 0) 1704 aBitsPerPixel = ulBitsPerPixel; 1705 } 1706 1707 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1708 1709 if (aDisplay >= mcMonitors) 1710 return E_INVALIDARG; 1739 1711 1740 1712 CHECK_CONSOLE_DRV(mpDrv); 1741 1713 1742 1714 /* 1743 * Do some rough checks for valid input. 1715 * It is up to the guest to decide whether the hint is 1716 * valid. Therefore don't do any VRAM sanity checks here. 1744 1717 */ 1745 ULONG width = aWidth;1746 if (!width)1747 width = mpDrv->IConnector.cx;1748 ULONG height = aHeight;1749 if (!height)1750 height = mpDrv->IConnector.cy;1751 ULONG bpp = aBitsPerPixel;1752 if (!bpp)1753 {1754 alock.release();1755 1756 uint32_t cBits = 0;1757 int rc = mpDrv->pUpPort->pfnQueryColorDepth(mpDrv->pUpPort, &cBits);1758 AssertRC(rc);1759 bpp = cBits;1760 1761 alock.acquire();1762 }1763 ULONG cMonitors;1764 mParent->i_machine()->COMGETTER(MonitorCount)(&cMonitors);1765 if (cMonitors == 0 && aDisplay > 0)1766 return E_INVALIDARG;1767 if (aDisplay >= cMonitors)1768 return E_INVALIDARG;1769 1770 /*1771 * sunlover 20070614: It is up to the guest to decide whether the hint is1772 * valid. Therefore don't do any VRAM sanity checks here!1773 */1774 1718 1775 1719 /* Have to release the lock because the pfnRequestDisplayChange … … 1789 1733 && !(mfGuestVBVACapabilities & VBVACAPS_IRQ)) 1790 1734 { 1791 HRESULT hrc = mParent->i_sendACPIMonitorHotPlugEvent(); 1792 if (FAILED(hrc)) 1793 return hrc; 1735 mParent->i_sendACPIMonitorHotPlugEvent(); 1794 1736 } 1795 1737 … … 3607 3549 int rc; 3608 3550 3609 pData->fUnscaledHiDPI = fUnscaledHiDPI;3551 pData->fUnscaledHiDPI = RT_BOOL(fUnscaledHiDPI); 3610 3552 3611 3553 pCtl->Hdr.enmType = VBOXCRCMDCTL_TYPE_HGCM;
Note:
See TracChangeset
for help on using the changeset viewer.