VirtualBox

Changeset 50940 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Apr 1, 2014 11:22:34 AM (11 years ago)
Author:
vboxsync
Message:

compilable w/o CROGL

Location:
trunk/src/VBox/Devices/Graphics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r50848 r50940  
    52325232#endif
    52335233
     5234#ifdef VBOX_WITH_CRHGSMI
    52345235    vboxCmdVBVACmdTimer(pThis);
     5236#endif
    52355237}
    52365238
     
    59525954    pThis->IVBVACallbacks.pfnCrHgsmiCommandCompleteAsync = vboxVDMACrHgsmiCommandCompleteAsync;
    59535955    pThis->IVBVACallbacks.pfnCrHgsmiControlCompleteAsync = vboxVDMACrHgsmiControlCompleteAsync;
    5954 # endif
    5955 #endif
     5956
    59565957    pThis->IVBVACallbacks.pfnCrCtlSubmit = vboxCmdVBVACmdHostCtl;
    59575958    pThis->IVBVACallbacks.pfnCrCtlSubmitSync = vboxCmdVBVACmdHostCtlSync;
    5958 
     5959# endif
     5960#endif
    59595961    /*
    59605962     * We use our own critical section to avoid unncessary pointer indirections
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r50850 r50940  
    622622int vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
    623623int vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc);
    624 # endif
    625624int vboxCmdVBVACmdHostCtl(PPDMIDISPLAYVBVACALLBACKS pInterface,
    626625                                                               struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
     
    629628int vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface,
    630629                                                               struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
     630# endif
    631631
    632632int vboxVBVASaveStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
     
    645645# endif /* VBOX_WITH_VDMA */
    646646
     647# ifdef VBOX_WITH_CRHGSMI
    647648int vboxCmdVBVACmdSubmit(PVGASTATE pVGAState);
    648649int vboxCmdVBVACmdFlush(PVGASTATE pVGAState);
    649650void vboxCmdVBVACmdTimer(PVGASTATE pVGAState);
    650651int vboxCmdVBVACmdCtl(PVGASTATE pVGAState, VBOXCMDVBVA_CTL *pCtl, uint32_t cbCtl);
    651 
     652# endif /* VBOX_WITH_CRHGSMI */
    652653#endif /* VBOX_WITH_HGSMI */
    653654
  • trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp

    r50754 r50940  
    19421942        case VBVA_CMDVBVA_SUBMIT:
    19431943        {
     1944# ifdef VBOX_WITH_CRHGSMI
    19441945            rc = vboxCmdVBVACmdSubmit(pVGAState);
     1946#endif
    19451947            break;
    19461948        }
    19471949        case VBVA_CMDVBVA_FLUSH:
    19481950        {
     1951# ifdef VBOX_WITH_CRHGSMI
    19491952            rc =vboxCmdVBVACmdFlush(pVGAState);
     1953#endif
    19501954            break;
    19511955        }
    19521956        case VBVA_CMDVBVA_CTL:
    19531957        {
     1958#ifdef VBOX_WITH_CRHGSMI
    19541959            if (cbBuffer < VBoxSHGSMIBufferHeaderSize() + sizeof (VBOXCMDVBVA_CTL))
    19551960            {
     
    19611966                break;
    19621967            }
    1963 
    19641968            VBOXCMDVBVA_CTL *pCtl = (VBOXCMDVBVA_CTL*)VBoxSHGSMIBufferData((PVBOXSHGSMIHEADER)pvBuffer);
    19651969            rc = vboxCmdVBVACmdCtl(pVGAState, pCtl, cbBuffer - VBoxSHGSMIBufferHeaderSize());
     1970#endif
    19661971            break;
    19671972        }
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r50928 r50940  
    666666    PHGSMIINSTANCE pHgsmi;
    667667    PVGASTATE pVGAState;
     668#ifdef VBOX_WITH_CRHGSMI
    668669    VBVAEXHOSTCONTEXT CmdVbva;
    669670    VBOXVDMATHREAD Thread;
     
    672673    RTSEMEVENTMULTI HostCrCtlCompleteEvent;
    673674    int32_t volatile i32cHostCrCtlCompleted;
     675#endif
    674676#ifdef VBOX_VDMA_WITH_WATCHDOG
    675677    PTMTIMERR3 WatchDogTimer;
    676678#endif
    677679} VBOXVDMAHOST, *PVBOXVDMAHOST;
     680
     681#ifdef VBOX_WITH_CRHGSMI
    678682
    679683int VBoxVDMAThreadNotifyConstructSucceeded(PVBOXVDMATHREAD pThread)
     
    778782
    779783static int vdmaVBVACtlSubmitSync(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL* pCtl, VBVAEXHOSTCTL_SOURCE enmSource);
    780 
    781 #ifdef VBOX_WITH_CRHGSMI
    782784
    783785typedef DECLCALLBACK(void) FNVBOXVDMACRCTL_CALLBACK(PVGASTATE pVGAState, PVBOXVDMACMD_CHROMIUM_CTL pCmd, void* pvContext);
     
    17061708}
    17071709
    1708 #endif
    1709 
    1710 #ifdef VBOX_VDMA_WITH_WORKERTHREAD
    1711 /* to simplify things and to avoid extra backend if modifications we assume the VBOXVDMA_RECTL is the same as VBVACMDHDR */
    1712 AssertCompile(sizeof(VBOXVDMA_RECTL) == sizeof(VBVACMDHDR));
    1713 AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, left) == RT_SIZEOFMEMB(VBVACMDHDR, x));
    1714 AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, top) == RT_SIZEOFMEMB(VBVACMDHDR, y));
    1715 AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, width) == RT_SIZEOFMEMB(VBVACMDHDR, w));
    1716 AssertCompile(RT_SIZEOFMEMB(VBOXVDMA_RECTL, height) == RT_SIZEOFMEMB(VBVACMDHDR, h));
    1717 AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, left) == RT_OFFSETOF(VBVACMDHDR, x));
    1718 AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, top) == RT_OFFSETOF(VBVACMDHDR, y));
    1719 AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, width) == RT_OFFSETOF(VBVACMDHDR, w));
    1720 AssertCompile(RT_OFFSETOF(VBOXVDMA_RECTL, height) == RT_OFFSETOF(VBVACMDHDR, h));
    1721 
    1722 static int vboxVDMANotifyPrimaryUpdate (PVGASTATE pVGAState, unsigned uScreenId, const VBOXVDMA_RECTL * pRectl)
    1723 {
    1724     pVGAState->pDrv->pfnVBVAUpdateBegin (pVGAState->pDrv, uScreenId);
    1725 
    1726     /* Updates the rectangle and sends the command to the VRDP server. */
    1727     pVGAState->pDrv->pfnVBVAUpdateProcess (pVGAState->pDrv, uScreenId,
    1728             (const PVBVACMDHDR)pRectl /* <- see above AssertCompile's and comments */,
    1729             sizeof (VBOXVDMA_RECTL));
    1730 
    1731     pVGAState->pDrv->pfnVBVAUpdateEnd (pVGAState->pDrv, uScreenId, pRectl->left, pRectl->top,
    1732                                                pRectl->width, pRectl->height);
    1733 
    1734     return VINF_SUCCESS;
    1735 }
    1736 #endif
    1737 
    17381710static int vboxVDMACmdExecBltPerform(PVBOXVDMAHOST pVdma,
    17391711        uint8_t *pvDstSurf, const uint8_t *pvSrcSurf,
     
    18891861        vboxVDMARectlUnite(&updateRectl, &pBlt->dstRectl);
    18901862    }
    1891 
    1892 #ifdef VBOX_VDMA_WITH_WORKERTHREAD
    1893     int iView = 0;
    1894     /* @todo: fixme: check if update is needed and get iView */
    1895     vboxVDMANotifyPrimaryUpdate (pVdma->pVGAState, iView, &updateRectl);
    1896 #endif
    18971863
    18981864    return cbBlt;
     
    21922158}
    21932159
     2160#endif /* #ifdef VBOX_WITH_CRHGSMI */
     2161
    21942162#ifdef VBOX_VDMA_WITH_WATCHDOG
    21952163static DECLCALLBACK(void) vboxVDMAWatchDogTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
     
    22142182{
    22152183    int rc;
    2216 #ifdef VBOX_VDMA_WITH_WORKERTHREAD
    2217     PVBOXVDMAHOST pVdma = (PVBOXVDMAHOST)RTMemAllocZ(RT_OFFSETOF(VBOXVDMAHOST, CmdPool.aCmds[cPipeElements]));
    2218 #else
    22192184    PVBOXVDMAHOST pVdma = (PVBOXVDMAHOST)RTMemAllocZ(sizeof(*pVdma));
    2220 #endif
    22212185    Assert(pVdma);
    22222186    if (pVdma)
     
    22252189        pVdma->pVGAState = pVGAState;
    22262190
    2227         rc = RTSemEventMultiCreate(&pVdma->HostCrCtlCompleteEvent);
    2228         if (RT_SUCCESS(rc))
    2229         {
    22302191#ifdef VBOX_VDMA_WITH_WATCHDOG
    22312192            rc = PDMDevHlpTMTimerCreate(pVGAState->pDevInsR3, TMCLOCK_REAL, vboxVDMAWatchDogTimer,
     
    22342195            AssertRC(rc);
    22352196#endif
     2197
     2198#ifdef VBOX_WITH_CRHGSMI
     2199        rc = RTSemEventMultiCreate(&pVdma->HostCrCtlCompleteEvent);
     2200        if (RT_SUCCESS(rc))
     2201        {
    22362202            rc = VBoxVBVAExHSInit(&pVdma->CmdVbva);
    22372203            if (RT_SUCCESS(rc))
     
    22412207                {
    22422208                    pVGAState->pVdma = pVdma;
    2243 #ifdef VBOX_WITH_CRHGSMI
    22442209                    int rcIgnored = vboxVDMACrCtlHgsmiSetup(pVdma); NOREF(rcIgnored); /** @todo is this ignoring intentional? */
    2245 #endif
    22462210                    return VINF_SUCCESS;
    22472211                }
     
    22612225
    22622226        RTMemFree(pVdma);
     2227#else
     2228        pVGAState->pVdma = pVdma;
     2229        return VINF_SUCCESS;
     2230#endif
    22632231    }
    22642232    else
     
    22702238int vboxVDMAReset(struct VBOXVDMAHOST *pVdma)
    22712239{
     2240#ifdef VBOX_WITH_CRHGSMI
    22722241    VBVAEXHOSTCTL Ctl;
    22732242    Ctl.enmType = VBVAEXHOSTCTL_TYPE_HH_RESET;
     
    22782247        return rc;
    22792248    }
     2249#endif
    22802250    return VINF_SUCCESS;
    22812251}
     
    22832253int vboxVDMADestruct(struct VBOXVDMAHOST *pVdma)
    22842254{
     2255#ifdef VBOX_WITH_CRHGSMI
    22852256    VBVAEXHOSTCTL Ctl;
    22862257    Ctl.enmType = VBVAEXHOSTCTL_TYPE_HH_TERM;
     
    22942265    VBoxVBVAExHSTerm(&pVdma->CmdVbva);
    22952266    RTSemEventMultiDestroy(pVdma->HostCrCtlCompleteEvent);
     2267#endif
    22962268    RTMemFree(pVdma);
    22972269    return VINF_SUCCESS;
     
    23482320void vboxVDMAControl(struct VBOXVDMAHOST *pVdma, PVBOXVDMA_CTL pCmd, uint32_t cbCmd)
    23492321{
    2350 #if 1
    23512322    PHGSMIINSTANCE pIns = pVdma->pHgsmi;
    23522323
     
    23682339#endif
    23692340        default:
    2370             AssertBreakpoint();
     2341            WARN(("cmd not supported"));
    23712342            pCmd->i32Result = VERR_NOT_SUPPORTED;
    23722343    }
     
    23742345    int rc = VBoxSHGSMICommandComplete (pIns, pCmd);
    23752346    AssertRC(rc);
    2376 #else
    2377     /* test asinch completion */
    2378     VBOXVDMACMD_SUBMIT_CONTEXT Context;
    2379     Context.pVdma = pVdma;
    2380     Context.Cmd.enmType = VBOXVDMAPIPE_CMD_TYPE_DMACTL;
    2381     Context.Cmd.u.pCtl = pCmd;
    2382 
    2383     int rc = vboxVDMAPipeModifyClient(&pVdma->Pipe, vboxVDMACommandSubmitCb, &Context);
    2384     AssertRC(rc);
    2385     if (RT_SUCCESS(rc))
    2386     {
    2387         Assert(Context.bQueued);
    2388         if (Context.bQueued)
    2389         {
    2390             /* success */
    2391             return;
    2392         }
    2393         rc = VERR_OUT_OF_RESOURCES;
    2394     }
    2395 
    2396     /* failure */
    2397     Assert(RT_FAILURE(rc));
    2398     PHGSMIINSTANCE pIns = pVdma->pHgsmi;
    2399     pCmd->i32Result = rc;
    2400     int tmpRc = VBoxSHGSMICommandComplete (pIns, pCmd);
    2401     AssertRC(tmpRc);
    2402 
    2403 #endif
    24042347}
    24052348
     
    24222365        return;
    24232366    }
    2424 #endif
    2425 
    2426 #ifndef VBOX_VDMA_WITH_WORKERTHREAD
     2367
    24272368    vboxVDMACommandProcess(pVdma, pCmd, cbCmd);
    24282369#else
    2429 
    2430 # ifdef DEBUG_misha
    2431     Assert(0);
    2432 # endif
    2433 
    2434     VBOXVDMACMD_SUBMIT_CONTEXT Context;
    2435     Context.pVdma = pVdma;
    2436     Context.Cmd.enmType = VBOXVDMAPIPE_CMD_TYPE_DMACMD;
    2437     Context.Cmd.u.pDr = pCmd;
    2438 
    2439     rc = vboxVDMAPipeModifyClient(&pVdma->Pipe, vboxVDMACommandSubmitCb, &Context);
     2370    pCmd->rc = rc;
     2371    rc = VBoxSHGSMICommandComplete (pVdma->pHgsmi, pCmd);
    24402372    AssertRC(rc);
    2441     if (RT_SUCCESS(rc))
    2442     {
    2443         Assert(Context.bQueued);
    2444         if (Context.bQueued)
    2445         {
    2446             /* success */
    2447             return;
    2448         }
    2449         rc = VERR_OUT_OF_RESOURCES;
    2450     }
    2451     /* failure */
    2452     Assert(RT_FAILURE(rc));
    2453     PHGSMIINSTANCE pIns = pVdma->pHgsmi;
    2454     pCmd->rc = rc;
    2455     int tmpRc = VBoxSHGSMICommandComplete (pIns, pCmd);
    2456     AssertRC(tmpRc);
    24572373#endif
    24582374}
    24592375
    24602376/**/
    2461 
     2377#ifdef VBOX_WITH_CRHGSMI
    24622378static int vdmaVBVACtlSubmit(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL* pCtl, VBVAEXHOSTCTL_SOURCE enmSource, PFNVBVAEXHOSTCTL_COMPLETE pfnComplete, void *pvComplete)
    24632379{
     
    27942710    vboxVDMACmdSubmitPerform(pVGAState->pVdma);
    27952711}
     2712
     2713#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