VirtualBox

Changeset 71626 in vbox


Ignore:
Timestamp:
Apr 2, 2018 9:12:58 PM (7 years ago)
Author:
vboxsync
Message:

DevVGA,VBoxC: Code cleanup in progress. bugref:9094

Location:
trunk
Files:
8 edited

Legend:

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

    r71619 r71626  
    843843     * @param   pInterface          Pointer to this interface.
    844844     * @param   enmCmd              The command type (don't re-read from pCmd).
     845     * @param   fGuestCmd           Set if the command origins with the guest and
     846     *                              pCmd must be considered volatile.
    845847     * @param   pCmd                Video HW Acceleration Command to be processed.
    846      * @returns VINF_SUCCESS - command is completed,
    847      * VINF_CALLBACK_RETURN - command will by asynchronously completed via complete callback
    848      * VERR_INVALID_STATE - the command could not be processed (most likely because the framebuffer was disconnected) - the post should be retried later
    849      * @thread  The emulation thread.
    850      */
    851     DECLR3CALLBACKMEMBER(int, pfnVHWACommandProcess,(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd,
     848     * @retval  VINF_SUCCESS - command is completed,
     849     * @retval  VINF_CALLBACK_RETURN if command will by asynchronously completed via
     850     *          complete callback.
     851     * @retval  VERR_INVALID_STATE if the command could not be processed (most
     852     *          likely because the framebuffer was disconnected) - the post should
     853     *          be retried later.
     854     * @thread  EMT
     855     */
     856    DECLR3CALLBACKMEMBER(int, pfnVHWACommandProcess,(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd, bool fGuestCmd,
    852857                                                     VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd));
    853858
     
    857862     * @param   pInterface          Pointer to this interface.
    858863     * @param   pCmd                Video HW Acceleration Command to be processed.
    859      * @thread  The emulation thread.
     864     * @thread  EMT
    860865     */
    861866    DECLR3CALLBACKMEMBER(void, pfnCrHgsmiCommandProcess,(PPDMIDISPLAYCONNECTOR pInterface,
     
    868873     * @param   pInterface          Pointer to this interface.
    869874     * @param   pCmd                Video HW Acceleration Command to be processed.
    870      * @thread  The emulation thread.
     875     * @thread  EMT
    871876     */
    872877    DECLR3CALLBACKMEMBER(void, pfnCrHgsmiControlProcess,(PPDMIDISPLAYCONNECTOR pInterface,
     
    882887     * @param   pfnCompletion       Undocumented!
    883888     * @param   pvCompletion        Undocumented!
    884      * @thread  The emulation thread.
     889     * @thread  EMT
    885890     */
    886891    DECLR3CALLBACKMEMBER(int, pfnCrHgcmCtlSubmit,(PPDMIDISPLAYCONNECTOR pInterface, struct VBOXCRCMDCTL *pCmd, uint32_t cbCmd,
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r71622 r71626  
    773773        if (cbPointerData > pCtx->mouseShapeInfo.cbAllocated)
    774774        {
    775             RTMemFree (pCtx->mouseShapeInfo.pu8Shape);
     775            RTMemFree(pCtx->mouseShapeInfo.pu8Shape);
    776776            pCtx->mouseShapeInfo.pu8Shape = NULL;
    777777            pCtx->mouseShapeInfo.cbShape = 0;
    778778
    779             uint8_t *pu8Shape = (uint8_t *)RTMemAlloc (cbPointerData);
     779            uint8_t *pu8Shape = (uint8_t *)RTMemAlloc(cbPointerData);
    780780            if (pu8Shape)
    781781            {
     
    10041004    RTListForEach(&pVGAState->pendingVhwaCommands.PendingList, pIter, VBOX_VHWA_PENDINGCMD, Node)
    10051005    {
    1006         rc = SSMR3PutU32(pSSM, (uint32_t)(((uint8_t*)pIter->pCommand) - ((uint8_t*)pVGAState->vram_ptrR3)));
     1006        AssertContinue((uintptr_t)pIter->pCommand - (uintptr_t)pVGAState->vram_ptrR3 < pVGAState->vram_size);
     1007        rc = SSMR3PutU32(pSSM, (uint32_t)(((uint8_t *)pIter->pCommand) - ((uint8_t *)pVGAState->vram_ptrR3)));
    10071008        AssertRCReturn(rc, rc);
    10081009    }
     
    10311032
    10321033
     1034/** Worker for vbvaVHWACommandSubmit. */
     1035static bool vbvaVHWACommandSubmitInner(PVGASTATE pVGAState, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand, bool *pfPending)
     1036{
     1037    *pfPending = false;
     1038
     1039    /*
     1040     * Read the command type and validate it and our driver state.
     1041     */
     1042    VBOXVHWACMD_TYPE enmCmd = pCommand->enmCmd;
     1043    RT_UNTRUSTED_NONVOLATILE_COPY_FENCE();
     1044
     1045    bool fGuestCmd = (uintptr_t)pCommand - (uintptr_t)pVGAState->vram_ptrR3 < pVGAState->vram_size;
     1046    ASSERT_GUEST_LOGREL_MSG_STMT_RETURN(   !fGuestCmd
     1047                                        || (   enmCmd != VBOXVHWACMD_TYPE_HH_CONSTRUCT
     1048                                            && enmCmd != VBOXVHWACMD_TYPE_HH_RESET
     1049                                            && enmCmd != VBOXVHWACMD_TYPE_HH_DISABLE
     1050                                            && enmCmd != VBOXVHWACMD_TYPE_HH_ENABLE
     1051                                            && enmCmd != VBOXVHWACMD_TYPE_HH_SAVESTATE_SAVEBEGIN
     1052                                            && enmCmd != VBOXVHWACMD_TYPE_HH_SAVESTATE_SAVEEND
     1053                                            && enmCmd != VBOXVHWACMD_TYPE_HH_SAVESTATE_SAVEPERFORM
     1054                                            && enmCmd != VBOXVHWACMD_TYPE_HH_SAVESTATE_LOADPERFORM),
     1055                                        ("enmCmd=%d\n", enmCmd),
     1056                                        pCommand->rc = VERR_INVALID_PARAMETER,
     1057                                        true);
     1058    ASSERT_GUEST_STMT_RETURN(pVGAState->pDrv->pfnVHWACommandProcess, pCommand->rc = VERR_INVALID_STATE, true);
     1059    RT_UNTRUSTED_VALIDATED_FENCE();
     1060
     1061    /*
     1062     * Call the driver to process the command.
     1063     */
     1064    Log(("VGA Command >>> %#p, %d\n", pCommand, enmCmd));
     1065    int rc = pVGAState->pDrv->pfnVHWACommandProcess(pVGAState->pDrv, enmCmd, fGuestCmd, pCommand);
     1066    if (rc == VINF_CALLBACK_RETURN)
     1067    {
     1068        Log(("VGA Command --- Going Async %#p, %d\n", pCommand, enmCmd));
     1069        *pfPending = true;
     1070        return true; /* Command will be completed asynchronously by the driver and need not be put in the pending list. */
     1071    }
     1072
     1073    if (rc == VERR_INVALID_STATE)
     1074    {
     1075        Log(("VGA Command --- Trying Pend %#p, %d\n", pCommand, enmCmd));
     1076        if (vbvaVHWACommandCanPend(enmCmd))
     1077        {
     1078            Log(("VGA Command --- Can Pend %#p, %d\n", pCommand, enmCmd));
     1079            *pfPending = true;
     1080            return false; /* put on pending list so it can be retried?? */
     1081        }
     1082
     1083        Log(("VGA Command --- Can NOT Pend %#p, %d\n", pCommand, enmCmd));
     1084    }
     1085    else
     1086        Log(("VGA Command --- Going Complete Sync rc %d %#p, %d\n", rc, pCommand, enmCmd));
     1087
     1088    /* the command was completed, take a special care about it (see caller) */
     1089    pCommand->rc = rc;
     1090    return true;
     1091}
     1092
     1093
    10331094static bool vbvaVHWACommandSubmit(PVGASTATE pVGAState, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand, bool fAsyncCommand)
    10341095{
    1035     VBOXVHWACMD_TYPE enmCmd = pCommand->enmCmd;
    1036     ASMCompilerBarrier();
    1037 
    1038     bool fPend = false;
    1039     if (pVGAState->pDrv->pfnVHWACommandProcess)
    1040     {
    1041         Log(("VGA Command >>> %#p, %d\n", pCommand, enmCmd));
    1042         int rc = pVGAState->pDrv->pfnVHWACommandProcess(pVGAState->pDrv, enmCmd, pCommand);
    1043         if (rc == VINF_CALLBACK_RETURN)
    1044         {
    1045             Log(("VGA Command --- Going Async %#p, %d\n", pCommand, enmCmd));
    1046             return true; /* command will be completed asynchronously, return right away */
    1047         }
    1048         if (rc == VERR_INVALID_STATE)
    1049         {
    1050             Log(("VGA Command --- Trying Pend %#p, %d\n", pCommand, enmCmd));
    1051             fPend = vbvaVHWACommandCanPend(enmCmd);
    1052             if (!fPend)
    1053             {
    1054                 Log(("VGA Command --- Can NOT Pend %#p, %d\n", pCommand, enmCmd));
    1055                 pCommand->rc = rc;
    1056             }
    1057             else
    1058                 Log(("VGA Command --- Can Pend %#p, %d\n", pCommand, enmCmd));
    1059         }
    1060         else
    1061         {
    1062             Log(("VGA Command --- Going Complete Sync rc %d %#p, %d\n", rc, pCommand, enmCmd));
    1063             pCommand->rc = rc;
    1064         }
    1065 
    1066         /* the command was completed, take a special care about it (seee below) */
    1067     }
    1068     else
    1069     {
    1070         AssertFailed();
    1071         pCommand->rc = VERR_INVALID_STATE;
    1072     }
    1073 
    1074     if (fPend)
    1075         return false;
    1076 
    1077     vbvaVHWACommandComplete(pVGAState, pCommand, fAsyncCommand);
    1078 
    1079     return true;
    1080 }
    1081 
     1096    bool fPending = false;
     1097    bool fRet = vbvaVHWACommandSubmitInner(pVGAState, pCommand, &fPending);
     1098    if (!fPending)
     1099        vbvaVHWACommandComplete(pVGAState, pCommand, fAsyncCommand);
     1100    return fRet;
     1101}
     1102
     1103
     1104/**
     1105 * @returns false if commands are pending, otherwise true.
     1106 */
    10821107static bool vbvaVHWACheckPendingCommands(PVGASTATE pVGAState)
    10831108{
     
    10931118        {
    10941119            PDMCritSectLeave(&pVGAState->CritSect);
    1095             return false; /* the command should be pended still */
     1120            return false; /* the command should be still pending */
    10961121        }
    10971122
     
    11111136    vbvaVHWACheckPendingCommands(pVGAState);
    11121137}
     1138
    11131139static void vbvaVHWAHandleCommand(PVGASTATE pVGAState, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd)
    11141140{
     
    11271153}
    11281154
    1129 static int vbvaVHWAHHCommandPost(PVGASTATE pVGAState, VBOXVHWACMD* pCmd)
     1155static int vbvaVHWAHHCommandPost(PVGASTATE pVGAState, VBOXVHWACMD *pCmd)
    11301156{
    11311157    RTSEMEVENT hComplEvent;
    11321158    int rc = RTSemEventCreate(&hComplEvent);
    11331159    AssertRC(rc);
    1134     if(RT_SUCCESS(rc))
     1160    if (RT_SUCCESS(rc))
    11351161    {
    11361162        /* ensure the cmd is not deleted until we process it */
    1137         vbvaVHWAHHCommandRetain (pCmd);
    1138         VBOXVHWA_HH_CALLBACK_SET(pCmd, vbvaVHWAHHCommandSetEventCallback, (void*)hComplEvent);
     1163        vbvaVHWAHHCommandRetain(pCmd);
     1164
     1165        VBOXVHWA_HH_CALLBACK_SET(pCmd, vbvaVHWAHHCommandSetEventCallback, (void *)hComplEvent);
    11391166        vbvaVHWAHandleCommand(pVGAState, pCmd);
    1140         if((ASMAtomicReadU32((volatile uint32_t *)&pCmd->Flags)  & VBOXVHWACMD_FLAG_HG_ASYNCH) != 0)
    1141         {
    1142             rc = RTSemEventWaitNoResume(hComplEvent, RT_INDEFINITE_WAIT);
    1143         }
    1144         else
    1145         {
    1146             /* the command is completed */
    1147         }
     1167
     1168        if ((ASMAtomicReadU32((volatile uint32_t *)&pCmd->Flags) & VBOXVHWACMD_FLAG_HG_ASYNCH) != 0)
     1169            rc = RTSemEventWaitNoResume(hComplEvent, RT_INDEFINITE_WAIT); /** @todo Why the NoResume and event leaking here? */
     1170        /* else: the command is completed */
    11481171
    11491172        AssertRC(rc);
    1150         if(RT_SUCCESS(rc))
    1151         {
     1173        if (RT_SUCCESS(rc))
    11521174            RTSemEventDestroy(hComplEvent);
    1153         }
     1175
    11541176        vbvaVHWAHHCommandRelease(pCmd);
    11551177    }
     
    12221244    VBOXVHWACMD *pCmd = vbvaVHWAHHCommandCreate(VBOXVHWACMD_TYPE_HH_RESET, 0, 0);
    12231245    Assert(pCmd);
    1224     if(pCmd)
     1246    if (pCmd)
    12251247    {
    12261248        int rc = VINF_SUCCESS;
     
    12291251        do
    12301252        {
    1231             rc =vbvaVHWAHHCommandPost(pVGAState, pCmd);
     1253            rc = vbvaVHWAHHCommandPost(pVGAState, pCmd);
    12321254            AssertRC(rc);
    12331255            if(RT_SUCCESS(rc))
     
    13331355}
    13341356
     1357/**
     1358 * @interface_method_impl{PDMIDISPLAYVBVACALLBACKS,pfnVHWACommandCompleteAsync}
     1359 */
    13351360DECLCALLBACK(int) vbvaVHWACommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd)
    13361361{
     1362    PVGASTATE pVGAState = PPDMIDISPLAYVBVACALLBACKS_2_PVGASTATE(pInterface);
    13371363    int rc;
    13381364    Log(("VGA Command <<< Async rc %d %#p, %d\n", pCmd->rc, pCmd, pCmd->enmCmd));
    13391365
    1340     if ((pCmd->Flags & VBOXVHWACMD_FLAG_HH_CMD) == 0)
    1341     {
    1342         PVGASTATE pVGAState = PPDMIDISPLAYVBVACALLBACKS_2_PVGASTATE(pInterface);
     1366    if ((uintptr_t)pCmd - (uintptr_t)pVGAState->vram_ptrR3 < pVGAState->vram_size)
     1367    {
    13431368        PHGSMIINSTANCE pIns = pVGAState->pHGSMI;
    1344 
     1369        Assert(!(pCmd->Flags & VBOXVHWACMD_FLAG_HH_CMD));
    13451370        Assert(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH);
    13461371#ifdef VBOX_WITH_WDDM
     
    14101435    else
    14111436    {
     1437        Assert(pCmd->Flags & VBOXVHWACMD_FLAG_HH_CMD);
    14121438        PFNVBOXVHWA_HH_CALLBACK pfn = VBOXVHWA_HH_CALLBACK_GET(pCmd);
    14131439        if (pfn)
     
    23242350    VBVACONTEXT   *pCtx = (VBVACONTEXT *)HGSMIContext(pIns);
    23252351
     2352    /*
     2353     * Copy and validate the request.
     2354     */
    23262355    uint16_t const cHintsQueried         = pQueryModeHints->cHintsQueried;
    23272356    uint16_t const cbHintStructureGuest  = pQueryModeHints->cbHintStructureGuest;
    2328     ASMCompilerBarrier();
     2357    RT_UNTRUSTED_NONVOLATILE_COPY_FENCE();
    23292358
    23302359    LogRelFlowFunc(("VBVA: HandleQueryModeHints: cHintsQueried=%RU16, cbHintStructureGuest=%RU16\n",
    23312360                    cHintsQueried, cbHintStructureGuest));
    2332     if (cbBuffer < sizeof(VBVAQUERYMODEHINTS) + (uint32_t)cHintsQueried * cbHintStructureGuest)
    2333         return VERR_INVALID_PARAMETER;
    2334 
     2361    ASSERT_GUEST_RETURN(cbBuffer >= sizeof(VBVAQUERYMODEHINTS) + (uint32_t)cHintsQueried * cbHintStructureGuest,
     2362                        VERR_INVALID_PARAMETER);
     2363    RT_UNTRUSTED_VALIDATED_FENCE();
     2364
     2365    /*
     2366     * Produce the requested data.
     2367     */
    23352368    uint8_t *pbHint = (uint8_t *)(pQueryModeHints + 1);
    23362369    memset(pbHint, ~0, cbBuffer - sizeof(VBVAQUERYMODEHINTS));
     
    25822615            if (cbBuffer >= sizeof(VBVAQUERYMODEHINTS))
    25832616            {
    2584                 VBVAQUERYMODEHINTS RT_UNTRUSTED_VOLATILE_GUEST *pQueryModeHints;
    2585                 pQueryModeHints = (VBVAQUERYMODEHINTS RT_UNTRUSTED_VOLATILE_GUEST *)pvBuffer;
     2617                VBVAQUERYMODEHINTS RT_UNTRUSTED_VOLATILE_GUEST *pQueryModeHints
     2618                    = (VBVAQUERYMODEHINTS RT_UNTRUSTED_VOLATILE_GUEST *)pvBuffer;
    25862619                rc = vbvaHandleQueryModeHints(pVGAState, pQueryModeHints, cbBuffer);
    25872620                pQueryModeHints->rc = rc;
     
    25982631                    VBVAREPORTINPUTMAPPING RT_UNTRUSTED_VOLATILE_GUEST *pInputMapping
    25992632                        = (VBVAREPORTINPUTMAPPING RT_UNTRUSTED_VOLATILE_GUEST *)pvBuffer;
    2600                     inputMapping.x = pInputMapping->x;
    2601                     inputMapping.y = pInputMapping->y;
     2633                    inputMapping.x  = pInputMapping->x;
     2634                    inputMapping.y  = pInputMapping->y;
    26022635                    inputMapping.cx = pInputMapping->cx;
    26032636                    inputMapping.cy = pInputMapping->cy;
  • trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp

    r71619 r71626  
    983983     */
    984984    int rc = hgsmiHostHeapLock(pIns);
    985     AssertReturn(rc, rc);
     985    AssertRCReturn(rc, rc);
    986986
    987987    /* It is possible to change the heap only if there is no pending allocations. */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp

    r71594 r71626  
    233233    char *buf = (char*)malloc(VBOXVHWACMD_SIZE_FROMBODYSIZE(size));
    234234    memset(buf, 0, size);
    235     VBOXVHWACMD * pCmd = (VBOXVHWACMD*)buf;
     235    VBOXVHWACMD *pCmd = (VBOXVHWACMD *)buf;
    236236    pCmd->enmCmd = type;
    237237    pCmd->Flags = VBOXVHWACMD_FLAG_HH_CMD;
     
    31953195    char *buf = (char*)malloc(VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE));
    31963196    memset(buf, 0, sizeof(VBOXVHWACMD_SIZE(VBOXVHWACMD_SURF_CREATE)));
    3197     VBOXVHWACMD * pCmd = (VBOXVHWACMD*)buf;
     3197    VBOXVHWACMD *pCmd = (VBOXVHWACMD *)buf;
    31983198    pCmd->enmCmd = VBOXVHWACMD_TYPE_SURF_CREATE;
    31993199    pCmd->Flags = VBOXVHWACMD_FLAG_HH_CMD;
     
    33473347}
    33483348
    3349 int VBoxVHWAImage::vhwaLoadOverlayData(VHWACommandList * pCmdList, struct SSMHANDLE * pSSM, uint32_t u32Version)
     3349int VBoxVHWAImage::vhwaLoadOverlayData(VHWACommandList *pCmdList, struct SSMHANDLE *pSSM, uint32_t u32Version)
    33503350{
    33513351    Q_UNUSED(u32Version);
     
    35103510    {
    35113511        memset(buf, 0, sizeof(VBOXVHWACMD));
    3512         VBOXVHWACMD * pCmd = (VBOXVHWACMD*)buf;
     3512        VBOXVHWACMD *pCmd = (VBOXVHWACMD *)buf;
    35133513        pCmd->enmCmd = VBOXVHWACMD_TYPE_ENABLE;
    35143514        pCmd->Flags = VBOXVHWACMD_FLAG_HH_CMD;
     
    42964296}
    42974297
    4298 int VBoxQGLOverlay::onVHWACommand(struct VBOXVHWACMD * pCmd)
     4298int VBoxQGLOverlay::onVHWACommand(struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd)
    42994299{
    43004300    Log(("VHWA Command >>> %#p, %d\n", pCmd, pCmd->enmCmd));
     
    44004400    pCmd->Flags |= VBOXVHWACMD_FLAG_HG_ASYNCH;
    44014401
    4402     mCmdPipe.postCmd(VBOXVHWA_PIPECMD_VHWA, pCmd);
     4402    mCmdPipe.postCmd(VBOXVHWA_PIPECMD_VHWA, (void *)pCmd);
    44034403    return VINF_CALLBACK_RETURN;
    44044404
     
    45274527}
    45284528
    4529 void VBoxQGLOverlay::vboxDoVHWACmd(void *cmd)
     4529void VBoxQGLOverlay::vboxDoVHWACmd(void RT_UNTRUSTED_VOLATILE_GUEST *cmd)
    45304530{
    45314531    vboxDoVHWACmdExec(cmd);
     
    46884688}
    46894689
    4690 void VBoxQGLOverlay::vboxDoVHWACmdExec(void *cmd)
    4691 {
    4692     struct VBOXVHWACMD * pCmd = (struct VBOXVHWACMD *)cmd;
    4693     switch(pCmd->enmCmd)
     4690void VBoxQGLOverlay::vboxDoVHWACmdExec(void RT_UNTRUSTED_VOLATILE_GUEST *cmd)
     4691{
     4692    struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd = (struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *)cmd;
     4693    VBOXVHWACMD_TYPE enmCmd = pCmd->enmCmd;
     4694    RT_UNTRUSTED_NONVOLATILE_COPY_FENCE();
     4695    switch (enmCmd)
    46944696    {
    46954697        case VBOXVHWACMD_TYPE_SURF_CANCREATE:
    46964698        {
    4697             VBOXVHWACMD_SURF_CANCREATE RT_UNTRUSTED_VOLATILE_GUEST  *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CANCREATE);
     4699            VBOXVHWACMD_SURF_CANCREATE RT_UNTRUSTED_VOLATILE_GUEST *pBody = VBOXVHWACMD_BODY(pCmd, VBOXVHWACMD_SURF_CANCREATE);
    46984700            Assert(!mGlOn == !mOverlayImage.hasSurfaces());
    46994701            initGl();
     
    50435045}
    50445046
    5045 void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData)
     5047void VBoxVHWACommandElementProcessor::postCmd(VBOXVHWA_PIPECMD_TYPE aType, void *pvData)
    50465048{
    50475049    QObject *pNotifyObject = NULL;
     
    52395241        case VBOXVHWA_PIPECMD_VHWA:
    52405242            {
    5241                 struct VBOXVHWACMD * pCmd = pCur->vhwaCmd();
     5243                struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd = pCur->vhwaCmd();
    52425244                pCmd->rc = VERR_INVALID_STATE;
    52435245                Log(("VHWA Command <<< Async RESET %#p, %d\n", pCmd, pCmd->enmCmd));
    5244                 pDisplay->CompleteVHWACommand((BYTE*)pCmd);
     5246                pDisplay->CompleteVHWACommand((BYTE *)pCmd);
    52455247            }
    52465248            break;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.h

    r71594 r71626  
    12201220{
    12211221public:
    1222     void setVHWACmd(struct VBOXVHWACMD * pCmd)
     1222    void setVHWACmd(struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCmd)
    12231223    {
    12241224        mType = VBOXVHWA_PIPECMD_VHWA;
     
    12381238    }
    12391239
    1240     void setData(VBOXVHWA_PIPECMD_TYPE aType, void * pvData)
     1240    void setData(VBOXVHWA_PIPECMD_TYPE aType, void *pvData)
    12411241    {
    12421242        switch(aType)
     
    12591259    VBOXVHWA_PIPECMD_TYPE type() const {return mType;}
    12601260    const QRect & rect() const {return mRect;}
    1261     struct VBOXVHWACMD * vhwaCmd() const {return u.mpCmd;}
     1261    struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *vhwaCmd() const {return u.mpCmd;}
    12621262    const VBOXVHWAFUNCCALLBACKINFO & func() const {return u.mFuncCallback; }
    12631263
     
    12671267    union
    12681268    {
    1269         struct VBOXVHWACMD * mpCmd;
     1269        struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *mpCmd;
    12701270        VBOXVHWAFUNCCALLBACKINFO mFuncCallback;
    12711271    }u;
     
    13211321    void init(QObject *pNotifyObject);
    13221322    ~VBoxVHWACommandElementProcessor();
    1323     void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData);
     1323    void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void *pvData);
    13241324    VBoxVHWACommandElement *getCmd();
    13251325    void doneCmd();
     
    17091709    void updateAttachment(QWidget *pViewport, QObject *pPostEventObject);
    17101710
    1711     int onVHWACommand (struct VBOXVHWACMD * pCommand);
     1711    int onVHWACommand (struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
    17121712
    17131713    void onVHWACommandEvent (QEvent * pEvent);
     
    17991799    bool vboxGetGlOn() { return mGlOn; }
    18001800    bool vboxSynchGl();
    1801     void vboxDoVHWACmdExec(void *cmd);
     1801    void vboxDoVHWACmdExec(void RT_UNTRUSTED_VOLATILE_GUEST *cmd);
    18021802    void vboxShowOverlay (bool show);
    18031803    void vboxDoCheckUpdateViewport();
    1804     void vboxDoVHWACmd (void *cmd);
     1804    void vboxDoVHWACmd (void RT_UNTRUSTED_VOLATILE_GUEST *cmd);
    18051805    void addMainDirtyRect (const QRect & aRect);
    18061806    void vboxCheckUpdateOverlay (const QRect & rect);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r71615 r71626  
    433433            return E_ACCESSDENIED;
    434434        }
    435         rc = mOverlay.onVHWACommand ((struct VBOXVHWACMD*)pCommand);
     435        rc = mOverlay.onVHWACommand((struct VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *)pCommand);
    436436        UIFrameBufferPrivate::unlock();
    437437        if (rc == VINF_CALLBACK_RETURN)
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r71619 r71626  
    169169    void i_handleUpdateVBVAInputMapping(int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy);
    170170#ifdef VBOX_WITH_VIDEOHWACCEL
    171     int  i_handleVHWACommandProcess(int enmCmd, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
     171    int  i_handleVHWACommandProcess(int enmCmd, bool fGuestCmd, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
    172172#endif
    173173#ifdef VBOX_WITH_CRHGSMI
     
    338338
    339339#ifdef VBOX_WITH_VIDEOHWACCEL
    340     static DECLCALLBACK(int)  i_displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd,
     340    static DECLCALLBACK(int)  i_displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd, bool fGuestCmd,
    341341                                                          VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
    342342#endif
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r71619 r71626  
    35313531#endif
    35323532
    3533 int Display::i_handleVHWACommandProcess(int enmCmd, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand)
     3533int Display::i_handleVHWACommandProcess(int enmCmd, bool fGuestCmd, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand)
    35343534{
    35353535    unsigned id = (unsigned)pCommand->iDisplay;
     
    35463546        return VERR_NOT_IMPLEMENTED; /* Implementation is not available. */
    35473547
    3548     NOREF(enmCmd);
    3549     HRESULT hr = pFramebuffer->ProcessVHWACommand((BYTE*)pCommand);
     3548    RT_NOREF(enmCmd, fGuestCmd);
     3549    HRESULT hr = pFramebuffer->ProcessVHWACommand((BYTE *)pCommand);
    35503550    if (hr == S_FALSE)
    35513551        return VINF_SUCCESS;
     
    35593559}
    35603560
    3561 DECLCALLBACK(int) Display::i_displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd,
     3561DECLCALLBACK(int) Display::i_displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd, bool fGuestCmd,
    35623562                                                       VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand)
    35633563{
    35643564    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
    35653565
    3566     return pDrv->pDisplay->i_handleVHWACommandProcess(enmCmd, pCommand);
     3566    return pDrv->pDisplay->i_handleVHWACommandProcess(enmCmd, fGuestCmd, pCommand);
    35673567}
    35683568#endif
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