- Timestamp:
- Feb 5, 2014 1:53:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r49983 r50328 1795 1795 #include <iprt/mem.h> 1796 1796 1797 static void *vmsvgaFIFOGetCmdBuffer( uint32_t *pFIFO, uint32_t cbCmd, uint32_t *pSize, void **ppfBounceBuffer)1797 static void *vmsvgaFIFOGetCmdBuffer(PPDMTHREAD pThread, uint32_t *pFIFO, uint32_t cbCmd, uint32_t *pSize, void **ppfBounceBuffer) 1798 1798 { 1799 1799 uint32_t cbLeft; … … 1807 1807 *ppfBounceBuffer = NULL; 1808 1808 1809 while ( true)1809 while (pThread->enmState == PDMTHREADSTATE_RUNNING) 1810 1810 { 1811 1811 Assert(pFIFO[SVGA_FIFO_NEXT_CMD] != pFIFO[SVGA_FIFO_STOP]); … … 1941 1941 case SVGA_CMD_FENCE: 1942 1942 { 1943 SVGAFifoCmdFence *pCmdFence = (SVGAFifoCmdFence *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdFence), &size, &pBounceBuffer);1943 SVGAFifoCmdFence *pCmdFence = (SVGAFifoCmdFence *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdFence), &size, &pBounceBuffer); 1944 1944 1945 1945 Log(("vmsvgaFIFOLoop: SVGA_CMD_FENCE %x\n", pCmdFence->fence)); … … 1962 1962 case SVGA_CMD_UPDATE_VERBOSE: 1963 1963 { 1964 SVGAFifoCmdUpdate *pUpdate = (SVGAFifoCmdUpdate *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdUpdate), &size, &pBounceBuffer);1964 SVGAFifoCmdUpdate *pUpdate = (SVGAFifoCmdUpdate *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdUpdate), &size, &pBounceBuffer); 1965 1965 1966 1966 Log(("vmsvgaFIFOLoop: UPDATE (%d,%d)(%d,%d)\n", pUpdate->x, pUpdate->y, pUpdate->width, pUpdate->height)); … … 1972 1972 { 1973 1973 /* Followed by bitmap data. */ 1974 SVGAFifoCmdDefineCursor *pCursor = (SVGAFifoCmdDefineCursor *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdDefineCursor), &size, &pBounceBuffer);1974 SVGAFifoCmdDefineCursor *pCursor = (SVGAFifoCmdDefineCursor *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineCursor), &size, &pBounceBuffer); 1975 1975 1976 1976 AssertFailed(); … … 1981 1981 { 1982 1982 /* Followed by bitmap data. */ 1983 SVGAFifoCmdDefineAlphaCursor *pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdDefineAlphaCursor), &size, &pBounceBuffer);1983 SVGAFifoCmdDefineAlphaCursor *pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineAlphaCursor), &size, &pBounceBuffer); 1984 1984 uint32_t cbCursorShape, cbAndMask; 1985 1985 uint8_t *pCursorCopy; … … 1993 1993 if (pBounceBuffer) 1994 1994 RTMemFree(pBounceBuffer); 1995 pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(p FIFO, cbCmd, &size, &pBounceBuffer);1995 pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer); 1996 1996 1997 1997 /* The mouse pointer interface always expects an AND mask followed by the color data (XOR mask). */ … … 2027 2027 { 2028 2028 /* Followed by nsize bytes of data. */ 2029 SVGAFifoCmdEscape *pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdEscape), &size, &pBounceBuffer);2029 SVGAFifoCmdEscape *pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdEscape), &size, &pBounceBuffer); 2030 2030 uint32_t cbCmd; 2031 2031 … … 2035 2035 if (pBounceBuffer) 2036 2036 RTMemFree(pBounceBuffer); 2037 pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(p FIFO, cbCmd, &size, &pBounceBuffer);2037 pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer); 2038 2038 2039 2039 if (pEscape->nsid == SVGA_ESCAPE_NSID_VMWARE) … … 2072 2072 case SVGA_CMD_DEFINE_GMR2: 2073 2073 { 2074 SVGAFifoCmdDefineGMR2 *pCmd = (SVGAFifoCmdDefineGMR2 *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdDefineGMR2), &size, &pBounceBuffer);2074 SVGAFifoCmdDefineGMR2 *pCmd = (SVGAFifoCmdDefineGMR2 *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineGMR2), &size, &pBounceBuffer); 2075 2075 Log(("vmsvgaFIFOLoop: SVGA_CMD_DEFINE_GMR2 id=%x %x pages\n", pCmd->gmrId, pCmd->numPages)); 2076 2076 … … 2089 2089 { 2090 2090 /* Followed by page descriptors. */ 2091 SVGAFifoCmdRemapGMR2 *pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdRemapGMR2), &size, &pBounceBuffer);2091 SVGAFifoCmdRemapGMR2 *pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdRemapGMR2), &size, &pBounceBuffer); 2092 2092 uint32_t cbPageDesc = (pCmd->flags & SVGA_REMAP_GMR2_PPN64) ? sizeof(uint64_t) : sizeof(uint32_t); 2093 2093 uint32_t cbCmd; … … 2114 2114 if (pBounceBuffer) 2115 2115 RTMemFree(pBounceBuffer); 2116 pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(p FIFO, cbCmd, &size, &pBounceBuffer);2116 pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer); 2117 2117 AssertReturn(pCmd, VERR_INTERNAL_ERROR); 2118 2118 … … 2188 2188 /* @note optional size depending on the capabilities */ 2189 2189 Assert(!(pThis->svga.pFIFOR3[SVGA_FIFO_CAPABILITIES] & SVGA_FIFO_CAP_SCREEN_OBJECT)); 2190 SVGAFifoCmdDefineScreen *pCmd = (SVGAFifoCmdDefineScreen *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdDefineScreen), &size, &pBounceBuffer);2190 SVGAFifoCmdDefineScreen *pCmd = (SVGAFifoCmdDefineScreen *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineScreen), &size, &pBounceBuffer); 2191 2191 2192 2192 Log(("vmsvgaFIFOLoop: SVGA_CMD_DEFINE_SCREEN id=%x flags=%x size=(%d,%d) root=(%d,%d)\n", pCmd->screen.id, pCmd->screen.flags, pCmd->screen.size.width, pCmd->screen.size.height, pCmd->screen.root.x, pCmd->screen.root.y)); … … 2210 2210 case SVGA_CMD_DESTROY_SCREEN: 2211 2211 { 2212 SVGAFifoCmdDestroyScreen *pCmd = (SVGAFifoCmdDestroyScreen *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdDestroyScreen), &size, &pBounceBuffer);2212 SVGAFifoCmdDestroyScreen *pCmd = (SVGAFifoCmdDestroyScreen *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDestroyScreen), &size, &pBounceBuffer); 2213 2213 2214 2214 Log(("vmsvgaFIFOLoop: SVGA_CMD_DESTROY_SCREEN id=%x\n", pCmd->screenId)); … … 2218 2218 case SVGA_CMD_DEFINE_GMRFB: 2219 2219 { 2220 SVGAFifoCmdDefineGMRFB *pCmd = (SVGAFifoCmdDefineGMRFB *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdDefineGMRFB), &size, &pBounceBuffer);2220 SVGAFifoCmdDefineGMRFB *pCmd = (SVGAFifoCmdDefineGMRFB *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineGMRFB), &size, &pBounceBuffer); 2221 2221 2222 2222 Log(("vmsvgaFIFOLoop: SVGA_CMD_DEFINE_GMRFB gmr=%x offset=%x bytesPerLine=%x bpp=%d color depth=%d\n", pCmd->ptr.gmrId, pCmd->ptr.offset, pCmd->bytesPerLine, pCmd->format.s.bitsPerPixel, pCmd->format.s.colorDepth)); … … 2229 2229 case SVGA_CMD_BLIT_GMRFB_TO_SCREEN: 2230 2230 { 2231 SVGAFifoCmdBlitGMRFBToScreen *pCmd = (SVGAFifoCmdBlitGMRFBToScreen *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdBlitGMRFBToScreen), &size, &pBounceBuffer);2231 SVGAFifoCmdBlitGMRFBToScreen *pCmd = (SVGAFifoCmdBlitGMRFBToScreen *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdBlitGMRFBToScreen), &size, &pBounceBuffer); 2232 2232 int32_t width, height; 2233 2233 … … 2273 2273 case SVGA_CMD_BLIT_SCREEN_TO_GMRFB: 2274 2274 { 2275 SVGAFifoCmdBlitScreenToGMRFB *pCmd = (SVGAFifoCmdBlitScreenToGMRFB *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdBlitScreenToGMRFB), &size, &pBounceBuffer);2275 SVGAFifoCmdBlitScreenToGMRFB *pCmd = (SVGAFifoCmdBlitScreenToGMRFB *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdBlitScreenToGMRFB), &size, &pBounceBuffer); 2276 2276 2277 2277 /* @note this can fetch 3d render results as well!! */ … … 2283 2283 case SVGA_CMD_ANNOTATION_FILL: 2284 2284 { 2285 SVGAFifoCmdAnnotationFill *pCmd = (SVGAFifoCmdAnnotationFill *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdAnnotationFill), &size, &pBounceBuffer);2285 SVGAFifoCmdAnnotationFill *pCmd = (SVGAFifoCmdAnnotationFill *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdAnnotationFill), &size, &pBounceBuffer); 2286 2286 2287 2287 Log(("vmsvgaFIFOLoop: SVGA_CMD_ANNOTATION_FILL red=%x green=%x blue=%x\n", pCmd->color.s.r, pCmd->color.s.g, pCmd->color.s.b)); … … 2292 2292 case SVGA_CMD_ANNOTATION_COPY: 2293 2293 { 2294 SVGAFifoCmdAnnotationCopy *pCmd = (SVGAFifoCmdAnnotationCopy*)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGAFifoCmdAnnotationCopy), &size, &pBounceBuffer);2294 SVGAFifoCmdAnnotationCopy *pCmd = (SVGAFifoCmdAnnotationCopy*)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdAnnotationCopy), &size, &pBounceBuffer); 2295 2295 2296 2296 Log(("vmsvgaFIFOLoop: SVGA_CMD_ANNOTATION_COPY\n")); … … 2305 2305 { 2306 2306 /* All 3d commands start with a common header, which defines the size of the command. */ 2307 SVGA3dCmdHeader *pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(p FIFO, sizeof(SVGA3dCmdHeader), &size, &pBounceBuffer);2307 SVGA3dCmdHeader *pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGA3dCmdHeader), &size, &pBounceBuffer); 2308 2308 uint32_t cbCmd; 2309 2309 … … 2313 2313 if (pBounceBuffer) 2314 2314 RTMemFree(pBounceBuffer); 2315 pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(p FIFO, cbCmd, &size, &pBounceBuffer);2315 pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer); 2316 2316 2317 2317 switch (pFIFO[u32Cmd])
Note:
See TracChangeset
for help on using the changeset viewer.