VirtualBox

Changeset 78995 in vbox


Ignore:
Timestamp:
Jun 5, 2019 1:30:45 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131127
Message:

PDM, Devices, FE, Main: allow size hints without notification for initial hints.
bugref:9482: FE/Qt and Additions/WINNT: move away from -adjust size if...-
This change allows size hints/monitor information to be set in a machine
without generating an IRQ notification, for the purpose of setting the
initial monitor information. It also uses the function for that purpose.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmifs.h

    r77451 r78995  
    15281528     * @param   fForce          Whether to deliver the request to the guest even if the guest has
    15291529     *                          the requested resolution already.
     1530     * @param   fMayNotify      Whether to send a hotplug notification to the guest if appropriate.
    15301531     */
    15311532    DECLR3CALLBACKMEMBER(int, pfnRequestDisplayChange,(PPDMIVMMDEVPORT pInterface, uint32_t cDisplays,
    1532                                                        struct VMMDevDisplayDef const *paDisplays, bool fForce));
     1533                                                       struct VMMDevDisplayDef const *paDisplays, bool fForce, bool fMayNotify));
    15331534
    15341535    /**
     
    16281629} PDMIVMMDEVPORT;
    16291630/** PDMIVMMDEVPORT interface ID. */
    1630 #define PDMIVMMDEVPORT_IID                      "2ccc19a5-742a-4af0-a7d3-31ea67ff50e9"
     1631#define PDMIVMMDEVPORT_IID                      "9e004f1a-875d-11e9-a673-c77c30f53623"
    16311632
    16321633
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r78949 r78995  
    35703570 */
    35713571static DECLCALLBACK(int)
    3572 vmmdevIPort_RequestDisplayChange(PPDMIVMMDEVPORT pInterface, uint32_t cDisplays, VMMDevDisplayDef const *paDisplays, bool fForce)
     3572vmmdevIPort_RequestDisplayChange(PPDMIVMMDEVPORT pInterface, uint32_t cDisplays, VMMDevDisplayDef const *paDisplays, bool fForce, bool fMayNotify)
    35733573{
    35743574    int rc = VINF_SUCCESS;
     
    36043604        /* We could validate the information here but hey, the guest can do that as well! */
    36053605        pRequest->displayChangeRequest = *p;
    3606         pRequest->fPending = fDifferentResolution;
     3606        pRequest->fPending = fDifferentResolution && fMayNotify;
    36073607
    36083608        fNotifyGuest = fNotifyGuest || fDifferentResolution;
    36093609    }
    36103610
    3611     if (RT_SUCCESS(rc))
     3611    if (RT_SUCCESS(rc) && fMayNotify)
    36123612    {
    36133613        if (fNotifyGuest)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r77910 r78995  
    14391439            CHECK_ERROR_BREAK(pDisplay, SetVideoModeHint(uDisplayIdx, fEnabled,
    14401440                                                         fChangeOrigin, iOriginX, iOriginY,
    1441                                                          uXRes, uYRes, uBpp));
     1441                                                         uXRes, uYRes, uBpp, true));
    14421442        }
    14431443        else if (!strcmp(a->argv[1], "setscreenlayout"))
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r76553 r78995  
    28242824                gpDisplay->SetVideoModeHint(0 /*=display*/, true /*=enabled*/, false /*=changeOrigin*/,
    28252825                                            0 /*=originX*/, 0 /*=originY*/,
    2826                                             uResizeWidth, uResizeHeight, 0 /*=don't change bpp*/);
     2826                                            uResizeWidth, uResizeHeight, 0 /*=don't change bpp*/, true /*=notify*/);
    28272827                break;
    28282828
     
    52255225            gpDisplay->SetVideoModeHint(0 /*=display*/, true /*=enabled*/,
    52265226                                        false /*=changeOrigin*/, 0 /*=originX*/, 0 /*=originY*/,
    5227                                         NewWidth, NewHeight, 0 /*don't change bpp*/);
     5227                                        NewWidth, NewHeight, 0 /*don't change bpp*/, true /*=notify*/);
    52285228        }
    52295229    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r77703 r78995  
    316316                display().SetVideoModeHint(screenId(),
    317317                                           uisession()->isScreenVisible(screenId()),
    318                                            false, 0, 0, size.width(), size.height(), 0);
     318                                           false, 0, 0, size.width(), size.height(), 0, true);
    319319            /* If host desires to have guest-screen disabled and guest-screen is enabled, retrying: */
    320320            else if (!uisession()->isScreenVisibleHostDesires(screenId()))
    321                 display().SetVideoModeHint(screenId(), false, false, 0, 0, 0, 0, 0);
     321                display().SetVideoModeHint(screenId(), false, false, 0, 0, 0, 0, 0, true);
    322322            /* If host desires to have guest-screen enabled and guest-screen is disabled, retrying: */
    323323            else if (uisession()->isScreenVisibleHostDesires(screenId()))
    324                 display().SetVideoModeHint(screenId(), true, false, 0, 0, size.width(), size.height(), 0);
     324                display().SetVideoModeHint(screenId(), true, false, 0, 0, size.width(), size.height(), 0, true);
    325325        }
    326326    }
     
    332332            display().SetVideoModeHint(screenId(),
    333333                                       uisession()->isScreenVisible(screenId()),
    334                                        false, 0, 0, size.width(), size.height(), 0);
     334                                       false, 0, 0, size.width(), size.height(), 0, true);
    335335    }
    336336}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r76606 r78995  
    129129            LogRel(("GUI: UIMultiScreenLayout::update: Disabling excessive guest-screen %d\n", iGuestScreen));
    130130            m_pMachineLogic->uisession()->setScreenVisibleHostDesires(iGuestScreen, false);
    131             m_pMachineLogic->display().SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0);
     131            m_pMachineLogic->display().SetVideoModeHint(iGuestScreen, false, false, 0, 0, 0, 0, 0, true);
    132132        }
    133133    }
     
    163163                    iGuestScreen, uWidth, uHeight));
    164164            m_pMachineLogic->uisession()->setScreenVisibleHostDesires(iGuestScreen, true);
    165             m_pMachineLogic->display().SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32);
     165            m_pMachineLogic->display().SetVideoModeHint(iGuestScreen, true, false, 0, 0, uWidth, uHeight, 32, true);
    166166        }
    167167    }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r76606 r78995  
    225225    {
    226226        uisession()->setScreenVisibleHostDesires(iIndex, false);
    227         display().SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0);
     227        display().SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0, true);
    228228    }
    229229    else
     
    235235            uHeight = 600;
    236236        uisession()->setScreenVisibleHostDesires(iIndex, true);
    237         display().SetVideoModeHint(iIndex, true, false, 0, 0, uWidth, uHeight, 32);
     237        display().SetVideoModeHint(iIndex, true, false, 0, 0, uWidth, uHeight, 32, true);
    238238    }
    239239}
     
    243243    /* Resize guest to required size: */
    244244    display().SetVideoModeHint(iIndex, uisession()->isScreenVisible(iIndex),
    245                              false, 0, 0, size.width(), size.height(), 0);
     245                             false, 0, 0, size.width(), size.height(), 0, true);
    246246}
    247247
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r78778 r78995  
    166166    m_sizeHintOverride = QSize(800, 600).expandedTo(sizeHint);
    167167
    168     /* Send saved size-hint to the guest: */
    169     /// @todo What if not m_bIsGuestAutoresizeEnabled?
    170     ///       Just let the guest start at the default 800x600?
     168    /* Restore saved monitor information to the guest.  The guest may not respond
     169     * until a suitable driver or helper is enabled (or at all).  We do not notify
     170     * the guest (aNotify == false), because there is technically no change (same
     171     * hardware as before shutdown), and notifying would interfere with the Windows
     172     * guest driver which saves the video mode to the registry on shutdown. */
    171173    uisession()->setScreenVisibleHostDesires(screenId(), guestScreenVisibilityStatus());
    172174    display().SetVideoModeHint(screenId(),
    173175                               guestScreenVisibilityStatus(),
    174                                false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
     176                               false, 0, 0, sizeHint.width(), sizeHint.height(), 0, false);
    175177}
    176178
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r76606 r78995  
    177177    display().SetVideoModeHint(screenId(),
    178178                               guestScreenVisibilityStatus(),
    179                                false, 0, 0, sizeHint.width(), sizeHint.height(), 0);
     179                               false, 0, 0, sizeHint.width(), sizeHint.height(), 0, true);
    180180}
    181181
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r78940 r78995  
    1838118381  <enum
    1838218382    name="ScreenLayoutMode"
    18383     uuid="c7a9ee66-cfed-438b-9f8c-d3adf7588a4d"
     18383    uuid="8fa1964c-8774-11e9-ae5d-1f419105e68d"
    1838418384    wsmap="managed"
    1838518385    >
     
    1840318403      <desc>
    1840418404        Attach new screens and always set the new mode for existing screens.
     18405      </desc>
     18406    </const>
     18407
     18408    <const name="Silent" value="3">
     18409      <desc>
     18410        Do not notify the guest of the change.  Normally this is wished, but it
     18411        might not be when re-setting monitor information from the last session
     18412        (no hotplug happened, as it is still the same virtual monitor).
    1840518413      </desc>
    1840618414    </const>
     
    1842618434  <interface
    1842718435    name="IDisplay" extends="$unknown"
    18428     uuid="ab4164db-c13e-4dab-842d-61ee3f0c1e87"
     18436    uuid="4680b2de-8690-11e9-b83d-5719e53cf1de"
    1842918437    wsmap="managed"
    1843018438    wrap-hint-server-addinterfaces="IEventListener"
     
    1855818566        <desc>
    1855918567          The number of bits per pixel of the guest screen.
     18568        </desc>
     18569      </param>
     18570      <param name="notify" type="boolean" dir="in">
     18571        <desc>
     18572          Whether the guest should be notified of the change.  Normally this
     18573          is wished, but it might not be when re-setting monitor information
     18574          from the last session (no hotplug happened, as it is still the same
     18575          virtual monitor).  Might also be useful if several monitors are to be
     18576          changed at once, but this would not reflect physical hardware well,
     18577          and we also have @a setScreenLayout for that.
    1856018578        </desc>
    1856118579      </param>
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r78784 r78995  
    260260                                     ULONG aWidth,
    261261                                     ULONG aHeight,
    262                                      ULONG aBitsPerPixel);
     262                                     ULONG aBitsPerPixel,
     263                                     BOOL aNotify);
    263264    virtual HRESULT getVideoModeHint(ULONG aDisplay,
    264265                                     BOOL *aEnabled,
  • trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp

    r78897 r78995  
    12941294    server->mConsole->i_getDisplay()->SetVideoModeHint(uScreenId, TRUE /*=enabled*/,
    12951295                                                       FALSE /*=changeOrigin*/, 0/*=OriginX*/, 0/*=OriginY*/,
    1296                                                        cWidth, cHeight, cBitsPerPixel);
     1296                                                       cWidth, cHeight, cBitsPerPixel, TRUE /*=notify*/);
    12971297}
    12981298
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r78967 r78995  
    19491949HRESULT Display::setVideoModeHint(ULONG aDisplay, BOOL aEnabled,
    19501950                                  BOOL aChangeOrigin, LONG aOriginX, LONG aOriginY,
    1951                                   ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel)
     1951                                  ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel,
     1952                                  BOOL aNotify)
    19521953{
    19531954    if (aWidth == 0 || aHeight == 0 || aBitsPerPixel == 0)
     
    20112012                                    aChangeOrigin ? aOriginY : ~0,
    20122013                                    RT_BOOL(aEnabled),
    2013                                       mfGuestVBVACapabilities
    2014                                     & VBVACAPS_VIDEO_MODE_HINTS);
     2014                                       (  mfGuestVBVACapabilities
     2015                                        & VBVACAPS_VIDEO_MODE_HINTS)
     2016                                    && aNotify);
    20152017    if (   mfGuestVBVACapabilities & VBVACAPS_VIDEO_MODE_HINTS
    2016         && !(mfGuestVBVACapabilities & VBVACAPS_IRQ))
     2018        && !(mfGuestVBVACapabilities & VBVACAPS_IRQ)
     2019        && aNotify)
    20172020    {
    20182021        mParent->i_sendACPIMonitorHotPlugEvent();
     
    20282031        PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
    20292032        if (pVMMDevPort)
    2030             pVMMDevPort->pfnRequestDisplayChange(pVMMDevPort, 1, &d, false);
     2033            pVMMDevPort->pfnRequestDisplayChange(pVMMDevPort, 1, &d, false, aNotify);
    20312034    }
    20322035    /* Notify listeners. */
     
    30823085                bool const fForce =    aScreenLayoutMode == ScreenLayoutMode_Reset
    30833086                                    || aScreenLayoutMode == ScreenLayoutMode_Apply;
    3084                 pVMMDevPort->pfnRequestDisplayChange(pVMMDevPort, cDisplays, paDisplayDefs, fForce);
     3087                bool const fNotify = aScreenLayoutMode != ScreenLayoutMode_Silent;
     3088                pVMMDevPort->pfnRequestDisplayChange(pVMMDevPort, cDisplays, paDisplayDefs, fForce, fNotify);
    30853089
    30863090                RTMemFree(paDisplayDefs);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette