Changeset 50940 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Apr 1, 2014 11:22:34 AM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r50848 r50940 5232 5232 #endif 5233 5233 5234 #ifdef VBOX_WITH_CRHGSMI 5234 5235 vboxCmdVBVACmdTimer(pThis); 5236 #endif 5235 5237 } 5236 5238 … … 5952 5954 pThis->IVBVACallbacks.pfnCrHgsmiCommandCompleteAsync = vboxVDMACrHgsmiCommandCompleteAsync; 5953 5955 pThis->IVBVACallbacks.pfnCrHgsmiControlCompleteAsync = vboxVDMACrHgsmiControlCompleteAsync; 5954 # endif 5955 #endif 5956 5956 5957 pThis->IVBVACallbacks.pfnCrCtlSubmit = vboxCmdVBVACmdHostCtl; 5957 5958 pThis->IVBVACallbacks.pfnCrCtlSubmitSync = vboxCmdVBVACmdHostCtlSync; 5958 5959 # endif 5960 #endif 5959 5961 /* 5960 5962 * We use our own critical section to avoid unncessary pointer indirections -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r50850 r50940 622 622 int vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc); 623 623 int vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc); 624 # endif625 624 int vboxCmdVBVACmdHostCtl(PPDMIDISPLAYVBVACALLBACKS pInterface, 626 625 struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, … … 629 628 int vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface, 630 629 struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd); 630 # endif 631 631 632 632 int vboxVBVASaveStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); … … 645 645 # endif /* VBOX_WITH_VDMA */ 646 646 647 # ifdef VBOX_WITH_CRHGSMI 647 648 int vboxCmdVBVACmdSubmit(PVGASTATE pVGAState); 648 649 int vboxCmdVBVACmdFlush(PVGASTATE pVGAState); 649 650 void vboxCmdVBVACmdTimer(PVGASTATE pVGAState); 650 651 int vboxCmdVBVACmdCtl(PVGASTATE pVGAState, VBOXCMDVBVA_CTL *pCtl, uint32_t cbCtl); 651 652 # endif /* VBOX_WITH_CRHGSMI */ 652 653 #endif /* VBOX_WITH_HGSMI */ 653 654 -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r50754 r50940 1942 1942 case VBVA_CMDVBVA_SUBMIT: 1943 1943 { 1944 # ifdef VBOX_WITH_CRHGSMI 1944 1945 rc = vboxCmdVBVACmdSubmit(pVGAState); 1946 #endif 1945 1947 break; 1946 1948 } 1947 1949 case VBVA_CMDVBVA_FLUSH: 1948 1950 { 1951 # ifdef VBOX_WITH_CRHGSMI 1949 1952 rc =vboxCmdVBVACmdFlush(pVGAState); 1953 #endif 1950 1954 break; 1951 1955 } 1952 1956 case VBVA_CMDVBVA_CTL: 1953 1957 { 1958 #ifdef VBOX_WITH_CRHGSMI 1954 1959 if (cbBuffer < VBoxSHGSMIBufferHeaderSize() + sizeof (VBOXCMDVBVA_CTL)) 1955 1960 { … … 1961 1966 break; 1962 1967 } 1963 1964 1968 VBOXCMDVBVA_CTL *pCtl = (VBOXCMDVBVA_CTL*)VBoxSHGSMIBufferData((PVBOXSHGSMIHEADER)pvBuffer); 1965 1969 rc = vboxCmdVBVACmdCtl(pVGAState, pCtl, cbBuffer - VBoxSHGSMIBufferHeaderSize()); 1970 #endif 1966 1971 break; 1967 1972 } -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r50928 r50940 666 666 PHGSMIINSTANCE pHgsmi; 667 667 PVGASTATE pVGAState; 668 #ifdef VBOX_WITH_CRHGSMI 668 669 VBVAEXHOSTCONTEXT CmdVbva; 669 670 VBOXVDMATHREAD Thread; … … 672 673 RTSEMEVENTMULTI HostCrCtlCompleteEvent; 673 674 int32_t volatile i32cHostCrCtlCompleted; 675 #endif 674 676 #ifdef VBOX_VDMA_WITH_WATCHDOG 675 677 PTMTIMERR3 WatchDogTimer; 676 678 #endif 677 679 } VBOXVDMAHOST, *PVBOXVDMAHOST; 680 681 #ifdef VBOX_WITH_CRHGSMI 678 682 679 683 int VBoxVDMAThreadNotifyConstructSucceeded(PVBOXVDMATHREAD pThread) … … 778 782 779 783 static int vdmaVBVACtlSubmitSync(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL* pCtl, VBVAEXHOSTCTL_SOURCE enmSource); 780 781 #ifdef VBOX_WITH_CRHGSMI782 784 783 785 typedef DECLCALLBACK(void) FNVBOXVDMACRCTL_CALLBACK(PVGASTATE pVGAState, PVBOXVDMACMD_CHROMIUM_CTL pCmd, void* pvContext); … … 1706 1708 } 1707 1709 1708 #endif1709 1710 #ifdef VBOX_VDMA_WITH_WORKERTHREAD1711 /* 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 #endif1737 1738 1710 static int vboxVDMACmdExecBltPerform(PVBOXVDMAHOST pVdma, 1739 1711 uint8_t *pvDstSurf, const uint8_t *pvSrcSurf, … … 1889 1861 vboxVDMARectlUnite(&updateRectl, &pBlt->dstRectl); 1890 1862 } 1891 1892 #ifdef VBOX_VDMA_WITH_WORKERTHREAD1893 int iView = 0;1894 /* @todo: fixme: check if update is needed and get iView */1895 vboxVDMANotifyPrimaryUpdate (pVdma->pVGAState, iView, &updateRectl);1896 #endif1897 1863 1898 1864 return cbBlt; … … 2192 2158 } 2193 2159 2160 #endif /* #ifdef VBOX_WITH_CRHGSMI */ 2161 2194 2162 #ifdef VBOX_VDMA_WITH_WATCHDOG 2195 2163 static DECLCALLBACK(void) vboxVDMAWatchDogTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) … … 2214 2182 { 2215 2183 int rc; 2216 #ifdef VBOX_VDMA_WITH_WORKERTHREAD2217 PVBOXVDMAHOST pVdma = (PVBOXVDMAHOST)RTMemAllocZ(RT_OFFSETOF(VBOXVDMAHOST, CmdPool.aCmds[cPipeElements]));2218 #else2219 2184 PVBOXVDMAHOST pVdma = (PVBOXVDMAHOST)RTMemAllocZ(sizeof(*pVdma)); 2220 #endif2221 2185 Assert(pVdma); 2222 2186 if (pVdma) … … 2225 2189 pVdma->pVGAState = pVGAState; 2226 2190 2227 rc = RTSemEventMultiCreate(&pVdma->HostCrCtlCompleteEvent);2228 if (RT_SUCCESS(rc))2229 {2230 2191 #ifdef VBOX_VDMA_WITH_WATCHDOG 2231 2192 rc = PDMDevHlpTMTimerCreate(pVGAState->pDevInsR3, TMCLOCK_REAL, vboxVDMAWatchDogTimer, … … 2234 2195 AssertRC(rc); 2235 2196 #endif 2197 2198 #ifdef VBOX_WITH_CRHGSMI 2199 rc = RTSemEventMultiCreate(&pVdma->HostCrCtlCompleteEvent); 2200 if (RT_SUCCESS(rc)) 2201 { 2236 2202 rc = VBoxVBVAExHSInit(&pVdma->CmdVbva); 2237 2203 if (RT_SUCCESS(rc)) … … 2241 2207 { 2242 2208 pVGAState->pVdma = pVdma; 2243 #ifdef VBOX_WITH_CRHGSMI2244 2209 int rcIgnored = vboxVDMACrCtlHgsmiSetup(pVdma); NOREF(rcIgnored); /** @todo is this ignoring intentional? */ 2245 #endif2246 2210 return VINF_SUCCESS; 2247 2211 } … … 2261 2225 2262 2226 RTMemFree(pVdma); 2227 #else 2228 pVGAState->pVdma = pVdma; 2229 return VINF_SUCCESS; 2230 #endif 2263 2231 } 2264 2232 else … … 2270 2238 int vboxVDMAReset(struct VBOXVDMAHOST *pVdma) 2271 2239 { 2240 #ifdef VBOX_WITH_CRHGSMI 2272 2241 VBVAEXHOSTCTL Ctl; 2273 2242 Ctl.enmType = VBVAEXHOSTCTL_TYPE_HH_RESET; … … 2278 2247 return rc; 2279 2248 } 2249 #endif 2280 2250 return VINF_SUCCESS; 2281 2251 } … … 2283 2253 int vboxVDMADestruct(struct VBOXVDMAHOST *pVdma) 2284 2254 { 2255 #ifdef VBOX_WITH_CRHGSMI 2285 2256 VBVAEXHOSTCTL Ctl; 2286 2257 Ctl.enmType = VBVAEXHOSTCTL_TYPE_HH_TERM; … … 2294 2265 VBoxVBVAExHSTerm(&pVdma->CmdVbva); 2295 2266 RTSemEventMultiDestroy(pVdma->HostCrCtlCompleteEvent); 2267 #endif 2296 2268 RTMemFree(pVdma); 2297 2269 return VINF_SUCCESS; … … 2348 2320 void vboxVDMAControl(struct VBOXVDMAHOST *pVdma, PVBOXVDMA_CTL pCmd, uint32_t cbCmd) 2349 2321 { 2350 #if 12351 2322 PHGSMIINSTANCE pIns = pVdma->pHgsmi; 2352 2323 … … 2368 2339 #endif 2369 2340 default: 2370 AssertBreakpoint();2341 WARN(("cmd not supported")); 2371 2342 pCmd->i32Result = VERR_NOT_SUPPORTED; 2372 2343 } … … 2374 2345 int rc = VBoxSHGSMICommandComplete (pIns, pCmd); 2375 2346 AssertRC(rc); 2376 #else2377 /* 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 #endif2404 2347 } 2405 2348 … … 2422 2365 return; 2423 2366 } 2424 #endif 2425 2426 #ifndef VBOX_VDMA_WITH_WORKERTHREAD 2367 2427 2368 vboxVDMACommandProcess(pVdma, pCmd, cbCmd); 2428 2369 #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); 2440 2372 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);2457 2373 #endif 2458 2374 } 2459 2375 2460 2376 /**/ 2461 2377 #ifdef VBOX_WITH_CRHGSMI 2462 2378 static int vdmaVBVACtlSubmit(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL* pCtl, VBVAEXHOSTCTL_SOURCE enmSource, PFNVBVAEXHOSTCTL_COMPLETE pfnComplete, void *pvComplete) 2463 2379 { … … 2794 2710 vboxVDMACmdSubmitPerform(pVGAState->pVdma); 2795 2711 } 2712 2713 #endif
Note:
See TracChangeset
for help on using the changeset viewer.