VirtualBox

Ignore:
Timestamp:
Jan 28, 2015 11:10:53 AM (10 years ago)
Author:
vboxsync
Message:

VMMDev: do not set VMMDEV_GUEST_SUPPORTS_GRAPHICS on reset

File:
1 edited

Legend:

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

    r53801 r54007  
    832832    AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER);
    833833
    834     /* Enable this automatically for guests using the old
    835        request to report their capabilities. */
    836     /** @todo change this when we next bump the interface version */
    837     pReq->caps |= VMMDEV_GUEST_SUPPORTS_GRAPHICS;
    838     if (pThis->guestCaps != pReq->caps)
     834    /* Enable VMMDEV_GUEST_SUPPORTS_GRAPHICS automatically for guests using the old
     835     * request to report their capabilities.
     836     */
     837    const uint32_t fu32Caps = pReq->caps | VMMDEV_GUEST_SUPPORTS_GRAPHICS;
     838
     839    if (pThis->guestCaps != fu32Caps)
    839840    {
    840841        /* make a copy of supplied information */
    841         pThis->guestCaps = pReq->caps;
    842 
    843         LogRel(("Guest Additions capability report: (0x%x) seamless: %s, hostWindowMapping: %s, graphics: %s\n",
    844                 pReq->caps,
    845                 pReq->caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
    846                 pReq->caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
    847                 pReq->caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
     842        pThis->guestCaps = fu32Caps;
     843
     844        LogRel(("Guest Additions capability report (legacy): (0x%x) seamless: %s, hostWindowMapping: %s, graphics: yes\n",
     845                fu32Caps,
     846                fu32Caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
     847                fu32Caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no"));
    848848
    849849        if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
    850             pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pReq->caps);
     850            pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, fu32Caps);
    851851    }
    852852    return VINF_SUCCESS;
     
    866866    AssertMsgReturn(pReq->header.size == sizeof(*pReq), ("%u\n", pReq->header.size), VERR_INVALID_PARAMETER);
    867867
    868     uint32_t const fOldCaps = pThis->guestCaps; NOREF(fOldCaps);
    869     pThis->guestCaps |= pReq->u32OrMask;
    870     pThis->guestCaps &= ~pReq->u32NotMask;
     868    uint32_t fu32Caps = pThis->guestCaps;
     869    fu32Caps |= pReq->u32OrMask;
     870    fu32Caps &= ~pReq->u32NotMask;
    871871
    872872    LogRel(("Guest Additions capability report: (%#x -> %#x) seamless: %s, hostWindowMapping: %s, graphics: %s\n",
    873             fOldCaps, pThis->guestCaps,
    874             pThis->guestCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
    875             pThis->guestCaps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
    876             pThis->guestCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
     873            pThis->guestCaps, fu32Caps,
     874            fu32Caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
     875            fu32Caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
     876            fu32Caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
     877
     878    pThis->guestCaps = fu32Caps;
    877879
    878880    if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
    879         pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
     881        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, fu32Caps);
    880882
    881883    return VINF_SUCCESS;
     
    36713673    memset (&pThis->guestInfo, 0, sizeof (pThis->guestInfo));
    36723674    RT_ZERO(pThis->guestInfo2);
     3675    const bool fCapsChanged = pThis->guestCaps != 0; /* Report transition to 0. */
     3676    pThis->guestCaps = 0;
    36733677
    36743678    /* Clear facilities. No need to tell Main as it will get a
     
    37193723    pThis->fNewGuestFilterMask   = 0;
    37203724
    3721     /* This is the default, as Windows and OS/2 guests take this for granted. (Actually, neither does...) */
    3722     /** @todo change this when we next bump the interface version */
    3723     const bool fCapsChanged = pThis->guestCaps != VMMDEV_GUEST_SUPPORTS_GRAPHICS;
    3724     if (fCapsChanged)
    3725         Log(("vmmdevReset: fCapsChanged=%#x -> %#x\n", pThis->guestCaps, VMMDEV_GUEST_SUPPORTS_GRAPHICS));
    3726     pThis->guestCaps = VMMDEV_GUEST_SUPPORTS_GRAPHICS; /** @todo r=bird: why? I cannot see this being done at construction?*/
    3727 
    37283725    /*
    37293726     * Call the update functions as required.
     
    37313728    if (fVersionChanged && pThis->pDrv && pThis->pDrv->pfnUpdateGuestInfo)
    37323729        pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo);
    3733     if (fCapsChanged    && pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
     3730    if (fCapsChanged && pThis->pDrv && pThis->pDrv->pfnUpdateGuestCapabilities)
    37343731        pThis->pDrv->pfnUpdateGuestCapabilities(pThis->pDrv, pThis->guestCaps);
    37353732
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