VirtualBox

Changeset 7409 in vbox


Ignore:
Timestamp:
Mar 10, 2008 2:50:08 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28842
Message:

VMMDev: added VMMDEV_GUEST_SUPPORTS_GRAPHICS capability, enabled by default, to distinguish cases where the guest additions are loaded but graphics are not supported

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxDev.h

    r5999 r7409  
    6161/** the guest supports mapping guest to host windows */
    6262#define VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING     RT_BIT(1)
     63/**
     64 * the guest graphical additions are active - used for fast activation
     65 * and deactivation of certain graphical operations.
     66 * The legacy VMMDevReq_ReportGuestCapabilities request sets this
     67 * automatically, but VMMDevReq_SetGuestCapabilities does not. */
     68#define VMMDEV_GUEST_SUPPORTS_GRAPHICS                      RT_BIT(2)
    6369/** @} */
    6470
  • trunk/include/VBox/VBoxGuest.h

    r7233 r7409  
    149149    VMMDevReq_GetDisplayChangeRequest2   = 54,
    150150    VMMDevReq_ReportGuestCapabilities    = 55,
     151    VMMDevReq_SetGuestCapabilities       = 56,
    151152#ifdef VBOX_HGCM
    152153    VMMDevReq_HGCMConnect                = 60,
     
    286287    uint32_t    caps;
    287288} VMMDevReqGuestCapabilities;
     289
     290/** guest capabilites structure */
     291typedef struct
     292{
     293    /** header */
     294    VMMDevRequestHeader header;
     295    /** mask of capabilities to be added */
     296    uint32_t    u32OrMask;
     297    /** mask of capabilities to be removed */
     298    uint32_t    u32NotMask;
     299} VMMDevReqGuestCapabilities2;
    288300
    289301/** idle request structure */
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r6915 r7409  
    521521                VMMDevReqGuestCapabilities *guestCaps = (VMMDevReqGuestCapabilities*)pRequestHeader;
    522522
     523                /* Enable this automatically for guests using the old
     524                   request to report their capabilities. */
     525                /** @todo change this when we next bump the interface version */
     526                guestCaps->caps |= VMMDEV_GUEST_SUPPORTS_GRAPHICS;
    523527                if (pData->guestCaps != guestCaps->caps)
    524528                {
     
    528532                    LogRel(("Guest Additions capability report: (0x%x) "
    529533                            "VMMDEV_GUEST_SUPPORTS_SEAMLESS: %s "
    530                             "VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING: %s\n",
     534                            "VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING: %s"
     535                            "VMMDEV_GUEST_SUPPORTS_GRAPHICS: %s\n",
    531536                            guestCaps->caps,
    532537                            guestCaps->caps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
    533                             guestCaps->caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no"));
     538                            guestCaps->caps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
     539                            guestCaps->caps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
    534540
    535541                    pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, guestCaps->caps);
    536542                }
     543                pRequestHeader->rc = VINF_SUCCESS;
     544            }
     545            break;
     546        }
     547
     548        /* Change guest capabilities */
     549        case VMMDevReq_SetGuestCapabilities:
     550        {
     551            if (pRequestHeader->size != sizeof(VMMDevReqGuestCapabilities2))
     552            {
     553                AssertMsgFailed(("VMMDev guest caps structure has invalid size!\n"));
     554                pRequestHeader->rc = VERR_INVALID_PARAMETER;
     555            }
     556            else
     557            {
     558                VMMDevReqGuestCapabilities2 *guestCaps = (VMMDevReqGuestCapabilities2*)pRequestHeader;
     559
     560                pData->guestCaps |= guestCaps->u32OrMask;
     561                pData->guestCaps &= ~guestCaps->u32NotMask;
     562
     563                LogRel(("Guest Additions capability report: (0x%x) "
     564                        "VMMDEV_GUEST_SUPPORTS_SEAMLESS: %s "
     565                        "VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING: %s"
     566                        "VMMDEV_GUEST_SUPPORTS_GRAPHICS: %s\n",
     567                        pData->guestCaps,
     568                        pData->guestCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? "yes" : "no",
     569                        pData->guestCaps & VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING ? "yes" : "no",
     570                        pData->guestCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? "yes" : "no"));
     571
     572                pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
    537573                pRequestHeader->rc = VINF_SUCCESS;
    538574            }
     
    22942330    pData->fu32AdditionsOk = false;
    22952331    memset (&pData->guestInfo, 0, sizeof (pData->guestInfo));
    2296     pData->guestCaps = 0;
    22972332
    22982333    memset (&pData->lastReadDisplayChangeRequest, 0, sizeof (pData->lastReadDisplayChangeRequest));
     
    23162351    pData->u32NewGuestFilterMask = 0;
    23172352    pData->fNewGuestFilterMask   = 0;
     2353
     2354    /* This is the default, as Windows and OS/2 guests take this for granted. */
     2355    /** @todo change this when we next bump the interface version */
     2356    pData->guestCaps = VMMDEV_GUEST_SUPPORTS_GRAPHICS;
     2357    pData->pDrv->pfnUpdateGuestCapabilities(pData->pDrv, pData->guestCaps);
    23182358}
    23192359
  • trunk/src/VBox/Main/GuestImpl.cpp

    r5999 r7409  
    172172}
    173173
     174STDMETHODIMP Guest::COMGETTER(SupportsGraphics) (BOOL *aSupportsGraphics)
     175{
     176    if (!aSupportsGraphics)
     177        return E_POINTER;
     178
     179    AutoCaller autoCaller (this);
     180    CheckComRCReturnRC (autoCaller.rc());
     181
     182    AutoReaderLock alock (this);
     183
     184    *aSupportsGraphics = mData.mSupportsGraphics;
     185
     186    return S_OK;
     187}
     188
    174189STDMETHODIMP Guest::COMGETTER(MemoryBalloonSize) (ULONG *aMemoryBalloonSize)
    175190{
     
    327342    mData.mSupportsSeamless = aSupportsSeamless;
    328343}
     344
     345void Guest::setSupportsGraphics (BOOL aSupportsGraphics)
     346{
     347    AutoCaller autoCaller (this);
     348    AssertComRCReturnVoid (autoCaller.rc());
     349
     350    AutoLock alock (this);
     351
     352    mData.mSupportsGraphics = aSupportsGraphics;
     353}
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r6955 r7409  
    202202        return;
    203203
    204     Assert(!(newCapabilities & ~VMMDEV_GUEST_SUPPORTS_SEAMLESS));
    205 
    206204    guest->setSupportsSeamless(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_SEAMLESS));
     205    guest->setSupportsGraphics(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_GRAPHICS));
    207206
    208207    /*
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r7350 r7409  
    51395139  <interface
    51405140     name="IGuest" extends="$unknown"
    5141      uuid="c101f037-b03d-4bd4-bd25-381123980be2"
     5141     uuid="d8556fca-81bc-12af-fca3-365528fa38ca"
     5142
    51425143     wsmap="suppress"
    51435144     >
     
    51885189        Flag whether seamless guest display rendering (seamless desktop
    51895190        integration) is supported.
     5191      </desc>
     5192    </attribute>
     5193
     5194    <attribute name="supportsGraphics" type="boolean" readonly="yes">
     5195      <desc>
     5196        Flag whether the guest is in graphics mode.  If it is not, then
     5197        seamless rendering will not work, resize hints are not immediately
     5198        acted on and guest display resizes are probably not initiated by
     5199        the guest additions.
    51905200      </desc>
    51915201    </attribute>
  • trunk/src/VBox/Main/include/GuestImpl.h

    r5999 r7409  
    5858    STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
    5959    STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
     60    STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
    6061    STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
    6162    STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
     
    7374    void setSupportsSeamless (BOOL aSupportsSeamless);
    7475
     76    void setSupportsGraphics (BOOL aSupportsGraphics);
     77
    7578    STDMETHOD(SetStatistic)(ULONG aCpuId, GuestStatisticType_T aStatistic, ULONG aStatVal);
    7679
     
    8285    struct Data
    8386    {
    84         Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE) {}
     87        Data() : mAdditionsActive (FALSE), mSupportsSeamless (FALSE),
     88                  /* Windows and OS/2 guests take this for granted */
     89                 mSupportsGraphics (TRUE) {}
    8590
    8691        Bstr  mOSTypeId;
     
    8893        Bstr  mAdditionsVersion;
    8994        BOOL  mSupportsSeamless;
     95        BOOL  mSupportsGraphics;
    9096    };
    9197
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