VirtualBox

Changeset 8312 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 22, 2008 9:04:44 PM (17 years ago)
Author:
vboxsync
Message:

Devices/VMMDev, Frontends/VBoxBFE, Main: add a guest request to report the maximum resolution currently supported by the additions - host side

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r8155 r8312  
    572572
    573573                pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
     574                pRequestHeader->rc = VINF_SUCCESS;
     575            }
     576            break;
     577        }
     578
     579        case VMMDevReq_SetMaxGuestResolution:
     580        {
     581            if (pRequestHeader->size != sizeof(VMMDevReqGuestResolution))
     582            {
     583                AssertMsgFailed(("VMMDev guest resolution structure has invalid size!\n"));
     584                pRequestHeader->rc = VERR_INVALID_PARAMETER;
     585            }
     586            else
     587            {
     588                VMMDevReqGuestResolution *guestRes = (VMMDevReqGuestResolution*)pRequestHeader;
     589
     590                pData->u32MaxGuestWidth  = guestRes->u32MaxWidth;
     591                pData->u32MaxGuestHeight = guestRes->u32MaxHeight;
     592
     593                LogRel(("Guest Additions maximum resolution of %dx%d reported\n",
     594                        pData->u32MaxGuestWidth, pData->u32MaxGuestHeight));
     595
     596                /* Only notify frontends that are interested (i.e. Main, but not BFE) */
     597                if (NULL != pData->pDrv->pfnUpdateMaxGuestResolution)
     598                    pData->pDrv->pfnUpdateMaxGuestResolution(pData->pDrv, pData->u32MaxGuestWidth, pData->u32MaxGuestHeight);
    574599                pRequestHeader->rc = VINF_SUCCESS;
    575600            }
     
    19471972
    19481973
    1949 #define VMMDEV_SSM_VERSION  6
     1974#define VMMDEV_SSM_VERSION  7
    19501975
    19511976/**
     
    19782003    SSMR3PutU32(pSSMHandle, pData->guestCaps);
    19792004
     2005    SSMR3PutU32(pSSMHandle, pData->u32MaxGuestWidth);
     2006    SSMR3PutU32(pSSMHandle, pData->u32MaxGuestHeight);
     2007
    19802008#ifdef VBOX_HGCM
    19812009    vmmdevHGCMSaveState (pData, pSSMHandle);
     
    20172045    SSMR3GetU32(pSSMHandle, &pData->guestCaps);
    20182046
     2047    SSMR3GetU32(pSSMHandle, &pData->u32MaxGuestWidth);
     2048    SSMR3GetU32(pSSMHandle, &pData->u32MaxGuestHeight);
     2049
    20192050#ifdef VBOX_HGCM
    20202051    vmmdevHGCMLoadState (pData, pSSMHandle);
     
    20462077    if (pData->pDrv)
    20472078        pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
     2079
     2080    if (    pData->pDrv && pData->pDrv->pfnUpdateMaxGuestResolution)
     2081        pData->pDrv->pfnUpdateMaxGuestResolution(pData->pDrv, pData->u32MaxGuestWidth, pData->u32MaxGuestHeight);
    20482082
    20492083    return VINF_SUCCESS;
     
    23192353    pData->fu32AdditionsOk = false;
    23202354    memset (&pData->guestInfo, 0, sizeof (pData->guestInfo));
     2355
     2356    /* No maximum resolution specified yet */
     2357    pData->u32MaxGuestWidth  = 0;
     2358    pData->u32MaxGuestHeight = 0;
    23212359
    23222360    memset (&pData->lastReadDisplayChangeRequest, 0, sizeof (pData->lastReadDisplayChangeRequest));
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r8155 r8312  
    108108    uint32_t u32VideoAccelEnabled;
    109109
     110    /** Maximum guest resolution, width - a value of 0 mean no maximum */
     111    uint32_t u32MaxGuestWidth;
     112    /** Maximum guest resolution, height - a value of 0 mean no maximum */
     113    uint32_t u32MaxGuestHeight;
     114
    110115    /** resolution change request */
    111116    struct
  • trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp

    r8155 r8312  
    421421    pData->Connector.pfnUpdateGuestVersion      = VMMDev::UpdateGuestVersion;
    422422    pData->Connector.pfnUpdateGuestCapabilities = VMMDev::UpdateGuestCapabilities;
     423    pData->Connector.pfnUpdateMaxGuestResolution = NULL;
    423424    pData->Connector.pfnUpdateMouseCapabilities = VMMDev::UpdateMouseCapabilities;
    424425    pData->Connector.pfnUpdatePointerShape      = VMMDev::UpdatePointerShape;
  • trunk/src/VBox/Main/GuestImpl.cpp

    r8155 r8312  
    337337}
    338338
     339void Guest::setMaxGuestResolution (ULONG aMaxWidth, ULONG aMaxHeight)
     340{
     341    AutoCaller autoCaller (this);
     342    AssertComRCReturnVoid (autoCaller.rc());
     343
     344    AutoWriteLock alock (this);
     345
     346    mData.mMaxWidth  = aMaxWidth;
     347    mData.mMaxHeight = aMaxHeight;
     348}
     349
    339350void Guest::setSupportsSeamless (BOOL aSupportsSeamless)
    340351{
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r8155 r8312  
    215215    pDrv->pVMMDev->getParent()->onAdditionsStateChange();
    216216   
     217}
     218
     219/**
     220 * Update the maximum guest resolution.
     221 * This is called when the guest sends us a corresponding notification. The new resolution
     222 * is given and the connector should update its internal state.
     223 * @note    This member can be left null if the connector is not interested in the
     224 *          notification.
     225 *
     226 * @param   pInterface          Pointer to this interface.
     227 * @param   u32MaxWidth         New width.
     228 * @param   u32MaxHeight        New Height.
     229 * @thread  The emulation thread.
     230 */
     231DECLCALLBACK(void) vmmdevUpdateMaxGuestResolution(PPDMIVMMDEVCONNECTOR pInterface, uint32_t u32MaxWidth, uint32_t u32MaxHeight)
     232{
     233    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
     234
     235    /* store that information in IGuest */
     236    Guest* guest = pDrv->pVMMDev->getParent()->getGuest();
     237    Assert(guest);
     238    if (!guest)
     239        return;
     240
     241    guest->setMaxGuestResolution(u32MaxWidth, u32MaxHeight);
     242
     243    /* This information is queried when it is needed, so there is no need to
     244       issue any further notifications. */
    217245}
    218246
     
    677705    pData->Connector.pfnUpdateGuestVersion            = vmmdevUpdateGuestVersion;
    678706    pData->Connector.pfnUpdateGuestCapabilities       = vmmdevUpdateGuestCapabilities;
     707    pData->Connector.pfnUpdateMaxGuestResolution      = vmmdevUpdateMaxGuestResolution;
    679708    pData->Connector.pfnUpdateMouseCapabilities       = vmmdevUpdateMouseCapabilities;
    680709    pData->Connector.pfnUpdatePointerShape            = vmmdevUpdatePointerShape;
  • trunk/src/VBox/Main/include/GuestImpl.h

    r8155 r8312  
    7676    void setAdditionsVersion (Bstr aVersion);
    7777
     78    void setMaxGuestResolution (ULONG aMaxWidth, ULONG aMaxHeight);
     79
    7880    void setSupportsSeamless (BOOL aSupportsSeamless);
    7981
     
    8991    struct Data
    9092    {
    91         Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
     93        Data() : mAdditionsActive (FALSE), mMaxWidth (0),
     94                 mMaxHeight(0), mSupportsSeamless (FALSE),
    9295                  /* Windows and OS/2 guests take this for granted */
    9396                 mSupportsGraphics (TRUE) {}
     
    9699        BOOL  mAdditionsActive;
    97100        Bstr  mAdditionsVersion;
     101        /** The maximum width supported by the guest - zero means no maximum */
     102        ULONG mMaxWidth;
     103        /** The maximum height supported by the guest - zero means no maximum */
     104        ULONG mMaxHeight;
    98105        BOOL  mSupportsSeamless;
    99106        BOOL  mSupportsGraphics;
Note: See TracChangeset for help on using the changeset viewer.

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