Changeset 44130 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 14, 2012 10:27:28 AM (12 years ago)
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Devices/VMMDev/VMMDev.cpp ¶
r43876 r44130 1525 1525 1526 1526 /* 1527 * Retrieve a display resize request sent by the host using 1528 * @a IDisplay:setVideoModeHint. 1529 * See documentation in VMMDev.h. 1530 */ 1531 case VMMDevReq_GetDisplayChangeRequestEx: 1532 { 1533 LogFlowFunc(("VMMDevReq_GetDisplayChangeRequestEx\n")); 1534 if (pRequestHeader->size != sizeof(VMMDevDisplayChangeRequestEx)) 1535 { 1536 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1537 } 1538 else 1539 { 1540 VMMDevDisplayChangeRequestEx *displayChangeRequest = (VMMDevDisplayChangeRequestEx*)pRequestHeader; 1541 1542 DISPLAYCHANGEREQUEST *pRequest = NULL; 1543 1544 if (displayChangeRequest->eventAck == VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST) 1545 { 1546 /* Select a pending request to report. */ 1547 unsigned i; 1548 for (i = 0; i < RT_ELEMENTS(pThis->displayChangeData.aRequests); i++) 1549 { 1550 if (pThis->displayChangeData.aRequests[i].fPending) 1551 { 1552 pRequest = &pThis->displayChangeData.aRequests[i]; 1553 /* Remember which request should be reported. */ 1554 pThis->displayChangeData.iCurrentMonitor = i; 1555 Log3(("VMMDev: will report pending request for %d\n", 1556 i)); 1557 break; 1558 } 1559 } 1560 1561 /* Check if there are more pending requests. */ 1562 i++; 1563 for (; i < RT_ELEMENTS(pThis->displayChangeData.aRequests); i++) 1564 { 1565 if (pThis->displayChangeData.aRequests[i].fPending) 1566 { 1567 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST); 1568 Log3(("VMMDev: another pending at %d\n", 1569 i)); 1570 break; 1571 } 1572 } 1573 1574 if (pRequest) 1575 { 1576 /* Current request has been read at least once. */ 1577 pRequest->fPending = false; 1578 1579 /* Remember which resolution the client has queried, subsequent reads 1580 * will return the same values. */ 1581 pRequest->lastReadDisplayChangeRequest = pRequest->displayChangeRequest; 1582 pThis->displayChangeData.fGuestSentChangeEventAck = true; 1583 } 1584 else 1585 { 1586 Log3(("VMMDev: no pending request!!!\n")); 1587 } 1588 } 1589 1590 if (!pRequest) 1591 { 1592 Log3(("VMMDev: default to %d\n", 1593 pThis->displayChangeData.iCurrentMonitor)); 1594 pRequest = &pThis->displayChangeData.aRequests[pThis->displayChangeData.iCurrentMonitor]; 1595 } 1596 1597 if (pThis->displayChangeData.fGuestSentChangeEventAck) 1598 { 1599 displayChangeRequest->xres = pRequest->lastReadDisplayChangeRequest.xres; 1600 displayChangeRequest->yres = pRequest->lastReadDisplayChangeRequest.yres; 1601 displayChangeRequest->bpp = pRequest->lastReadDisplayChangeRequest.bpp; 1602 displayChangeRequest->display = pRequest->lastReadDisplayChangeRequest.display; 1603 displayChangeRequest->cxOrigin = pRequest->lastReadDisplayChangeRequest.xOrigin; 1604 displayChangeRequest->cyOrigin = pRequest->lastReadDisplayChangeRequest.yOrigin; 1605 displayChangeRequest->fEnabled = pRequest->lastReadDisplayChangeRequest.fEnabled; 1606 displayChangeRequest->fChangeOrigin = pRequest->lastReadDisplayChangeRequest.fChangeOrigin; 1607 } 1608 else 1609 { 1610 /* This is not a response to a VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, just 1611 * read the last valid video mode hint. This happens when the guest X server 1612 * determines the initial video mode. */ 1613 displayChangeRequest->xres = pRequest->displayChangeRequest.xres; 1614 displayChangeRequest->yres = pRequest->displayChangeRequest.yres; 1615 displayChangeRequest->bpp = pRequest->displayChangeRequest.bpp; 1616 displayChangeRequest->display = pRequest->displayChangeRequest.display; 1617 displayChangeRequest->cxOrigin = pRequest->displayChangeRequest.xOrigin; 1618 displayChangeRequest->cyOrigin = pRequest->displayChangeRequest.yOrigin; 1619 displayChangeRequest->fEnabled = pRequest->displayChangeRequest.fEnabled; 1620 displayChangeRequest->fChangeOrigin = pRequest->displayChangeRequest.fChangeOrigin; 1621 1622 } 1623 Log(("VMMDevEx: returning display change request xres = %d, yres = %d, bpp = %d id %d \ 1624 xPos = %d, yPos = %d & Enabled=%d\n", 1625 displayChangeRequest->xres, displayChangeRequest->yres, 1626 displayChangeRequest->bpp, displayChangeRequest->display, 1627 displayChangeRequest->cxOrigin, displayChangeRequest->cyOrigin, 1628 displayChangeRequest->fEnabled)); 1629 1630 pRequestHeader->rc = VINF_SUCCESS; 1631 } 1632 break; 1633 } 1634 1635 1636 /* 1527 1637 * Query whether the given video mode is supported 1528 1638 */ … … 2604 2714 2605 2715 2606 static DECLCALLBACK(int) vmmdevRequestDisplayChange(PPDMIVMMDEVPORT pInterface, uint32_t xres, uint32_t yres, uint32_t bpp, uint32_t display) 2716 static DECLCALLBACK(int) vmmdevRequestDisplayChange(PPDMIVMMDEVPORT pInterface, uint32_t xres, uint32_t yres, 2717 uint32_t bpp, uint32_t display, uint32_t u32OriginX, 2718 uint32_t u32OriginY, bool fEnabled, bool fChangeOrigin) 2607 2719 { 2608 2720 VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface); … … 2621 2733 (!yres || (pRequest->lastReadDisplayChangeRequest.yres == yres)) && 2622 2734 (!bpp || (pRequest->lastReadDisplayChangeRequest.bpp == bpp)) && 2735 (pRequest->lastReadDisplayChangeRequest.xOrigin == u32OriginX) && 2736 (pRequest->lastReadDisplayChangeRequest.yOrigin == u32OriginY) && 2737 (pRequest->lastReadDisplayChangeRequest.fEnabled == fEnabled) && 2623 2738 pRequest->lastReadDisplayChangeRequest.display == display; 2624 2739 … … 2629 2744 } 2630 2745 2631 Log3(("vmmdevRequestDisplayChange: same=%d. new: xres=%d, yres=%d, bpp=%d, display=%d. old: xres=%d, yres=%d, bpp=%d, display=%d.\n", 2632 fSameResolution, xres, yres, bpp, display, pRequest->lastReadDisplayChangeRequest.xres, pRequest->lastReadDisplayChangeRequest.yres, pRequest->lastReadDisplayChangeRequest.bpp, pRequest->lastReadDisplayChangeRequest.display)); 2746 Log3(("vmmdevRequestDisplayChange: same=%d. new: xres=%d, yres=%d, bpp=%d, display=%d.\ 2747 old: xres=%d, yres=%d, bpp=%d, display=%d. \n \ 2748 ,OriginX = %d , OriginY=%d, Enabled=%d, ChangeOrigin=%d\n", 2749 fSameResolution, xres, yres, bpp, display, pRequest->lastReadDisplayChangeRequest.xres, 2750 pRequest->lastReadDisplayChangeRequest.yres, pRequest->lastReadDisplayChangeRequest.bpp, 2751 pRequest->lastReadDisplayChangeRequest.display, 2752 u32OriginX, u32OriginY, fEnabled, fChangeOrigin)); 2633 2753 2634 2754 if (!fSameResolution) … … 2638 2758 2639 2759 /* we could validate the information here but hey, the guest can do that as well! */ 2640 pRequest->displayChangeRequest.xres = xres; 2641 pRequest->displayChangeRequest.yres = yres; 2642 pRequest->displayChangeRequest.bpp = bpp; 2643 pRequest->displayChangeRequest.display = display; 2760 pRequest->displayChangeRequest.xres = xres; 2761 pRequest->displayChangeRequest.yres = yres; 2762 pRequest->displayChangeRequest.bpp = bpp; 2763 pRequest->displayChangeRequest.display = display; 2764 pRequest->displayChangeRequest.xOrigin = u32OriginX; 2765 pRequest->displayChangeRequest.yOrigin = u32OriginY; 2766 pRequest->displayChangeRequest.fEnabled = fEnabled; 2767 pRequest->displayChangeRequest.fChangeOrigin = fChangeOrigin; 2768 2644 2769 pRequest->fPending = true; 2645 2770 -
TabularUnified trunk/src/VBox/Devices/VMMDev/VMMDevState.h ¶
r39890 r44130 31 31 uint32_t bpp; 32 32 uint32_t display; 33 uint32_t xOrigin; 34 uint32_t yOrigin; 35 bool fEnabled; 36 bool fChangeOrigin; 33 37 } DISPLAYCHANGEINFO; 34 38
Note:
See TracChangeset
for help on using the changeset viewer.