VirtualBox

Changeset 50328 in vbox for trunk


Ignore:
Timestamp:
Feb 5, 2014 1:53:19 PM (11 years ago)
Author:
vboxsync
Message:

Devices/Graphics/vmsvga: don't loop forver if the guest doesn't respond

File:
1 edited

Legend:

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

    r49983 r50328  
    17951795#include <iprt/mem.h>
    17961796
    1797 static void *vmsvgaFIFOGetCmdBuffer(uint32_t *pFIFO, uint32_t cbCmd, uint32_t *pSize, void **ppfBounceBuffer)
     1797static void *vmsvgaFIFOGetCmdBuffer(PPDMTHREAD pThread, uint32_t *pFIFO, uint32_t cbCmd, uint32_t *pSize, void **ppfBounceBuffer)
    17981798{
    17991799    uint32_t cbLeft;
     
    18071807    *ppfBounceBuffer = NULL;
    18081808
    1809     while (true)
     1809    while (pThread->enmState == PDMTHREADSTATE_RUNNING)
    18101810    {
    18111811        Assert(pFIFO[SVGA_FIFO_NEXT_CMD] != pFIFO[SVGA_FIFO_STOP]);
     
    19411941            case SVGA_CMD_FENCE:
    19421942            {               
    1943                 SVGAFifoCmdFence *pCmdFence = (SVGAFifoCmdFence *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdFence), &size, &pBounceBuffer);
     1943                SVGAFifoCmdFence *pCmdFence = (SVGAFifoCmdFence *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdFence), &size, &pBounceBuffer);
    19441944
    19451945                Log(("vmsvgaFIFOLoop: SVGA_CMD_FENCE %x\n", pCmdFence->fence));
     
    19621962            case SVGA_CMD_UPDATE_VERBOSE:
    19631963            {
    1964                 SVGAFifoCmdUpdate *pUpdate = (SVGAFifoCmdUpdate *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdUpdate), &size, &pBounceBuffer);
     1964                SVGAFifoCmdUpdate *pUpdate = (SVGAFifoCmdUpdate *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdUpdate), &size, &pBounceBuffer);
    19651965
    19661966                Log(("vmsvgaFIFOLoop: UPDATE (%d,%d)(%d,%d)\n", pUpdate->x, pUpdate->y, pUpdate->width, pUpdate->height));
     
    19721972            {
    19731973                /* Followed by bitmap data. */
    1974                 SVGAFifoCmdDefineCursor *pCursor = (SVGAFifoCmdDefineCursor *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdDefineCursor), &size, &pBounceBuffer);
     1974                SVGAFifoCmdDefineCursor *pCursor = (SVGAFifoCmdDefineCursor *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineCursor), &size, &pBounceBuffer);
    19751975
    19761976                AssertFailed();
     
    19811981            {
    19821982                /* Followed by bitmap data. */
    1983                 SVGAFifoCmdDefineAlphaCursor *pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdDefineAlphaCursor), &size, &pBounceBuffer);
     1983                SVGAFifoCmdDefineAlphaCursor *pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineAlphaCursor), &size, &pBounceBuffer);
    19841984                uint32_t cbCursorShape, cbAndMask;
    19851985                uint8_t *pCursorCopy;
     
    19931993                if (pBounceBuffer)
    19941994                    RTMemFree(pBounceBuffer);
    1995                 pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(pFIFO, cbCmd, &size, &pBounceBuffer);
     1995                pCursor = (SVGAFifoCmdDefineAlphaCursor *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer);
    19961996
    19971997                /* The mouse pointer interface always expects an AND mask followed by the color data (XOR mask). */
     
    20272027            {
    20282028                /* Followed by nsize bytes of data. */
    2029                 SVGAFifoCmdEscape *pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdEscape), &size, &pBounceBuffer);
     2029                SVGAFifoCmdEscape *pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdEscape), &size, &pBounceBuffer);
    20302030                uint32_t cbCmd;
    20312031
     
    20352035                if (pBounceBuffer)
    20362036                    RTMemFree(pBounceBuffer);
    2037                 pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(pFIFO, cbCmd, &size, &pBounceBuffer);
     2037                pEscape = (SVGAFifoCmdEscape *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer);
    20382038
    20392039                if (pEscape->nsid == SVGA_ESCAPE_NSID_VMWARE)
     
    20722072            case SVGA_CMD_DEFINE_GMR2:
    20732073            {
    2074                 SVGAFifoCmdDefineGMR2 *pCmd = (SVGAFifoCmdDefineGMR2 *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdDefineGMR2), &size, &pBounceBuffer);
     2074                SVGAFifoCmdDefineGMR2 *pCmd = (SVGAFifoCmdDefineGMR2 *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineGMR2), &size, &pBounceBuffer);
    20752075                Log(("vmsvgaFIFOLoop: SVGA_CMD_DEFINE_GMR2 id=%x %x pages\n", pCmd->gmrId, pCmd->numPages));
    20762076
     
    20892089            {
    20902090                /* Followed by page descriptors. */
    2091                 SVGAFifoCmdRemapGMR2 *pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdRemapGMR2), &size, &pBounceBuffer);
     2091                SVGAFifoCmdRemapGMR2 *pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdRemapGMR2), &size, &pBounceBuffer);
    20922092                uint32_t cbPageDesc = (pCmd->flags & SVGA_REMAP_GMR2_PPN64) ? sizeof(uint64_t) : sizeof(uint32_t);
    20932093                uint32_t cbCmd;
     
    21142114                if (pBounceBuffer)
    21152115                    RTMemFree(pBounceBuffer);
    2116                 pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(pFIFO, cbCmd, &size, &pBounceBuffer);
     2116                pCmd = (SVGAFifoCmdRemapGMR2 *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer);
    21172117                AssertReturn(pCmd, VERR_INTERNAL_ERROR);
    21182118
     
    21882188                /* @note optional size depending on the capabilities */
    21892189                Assert(!(pThis->svga.pFIFOR3[SVGA_FIFO_CAPABILITIES] & SVGA_FIFO_CAP_SCREEN_OBJECT));
    2190                 SVGAFifoCmdDefineScreen *pCmd = (SVGAFifoCmdDefineScreen *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdDefineScreen), &size, &pBounceBuffer);
     2190                SVGAFifoCmdDefineScreen *pCmd = (SVGAFifoCmdDefineScreen *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineScreen), &size, &pBounceBuffer);
    21912191
    21922192                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));
     
    22102210            case SVGA_CMD_DESTROY_SCREEN:
    22112211            {
    2212                 SVGAFifoCmdDestroyScreen *pCmd = (SVGAFifoCmdDestroyScreen *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdDestroyScreen), &size, &pBounceBuffer);
     2212                SVGAFifoCmdDestroyScreen *pCmd = (SVGAFifoCmdDestroyScreen *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDestroyScreen), &size, &pBounceBuffer);
    22132213
    22142214                Log(("vmsvgaFIFOLoop: SVGA_CMD_DESTROY_SCREEN id=%x\n", pCmd->screenId));
     
    22182218            case SVGA_CMD_DEFINE_GMRFB:
    22192219            {
    2220                 SVGAFifoCmdDefineGMRFB *pCmd = (SVGAFifoCmdDefineGMRFB *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdDefineGMRFB), &size, &pBounceBuffer);
     2220                SVGAFifoCmdDefineGMRFB *pCmd = (SVGAFifoCmdDefineGMRFB *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdDefineGMRFB), &size, &pBounceBuffer);
    22212221
    22222222                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));
     
    22292229            case SVGA_CMD_BLIT_GMRFB_TO_SCREEN:
    22302230            {
    2231                 SVGAFifoCmdBlitGMRFBToScreen *pCmd = (SVGAFifoCmdBlitGMRFBToScreen *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdBlitGMRFBToScreen), &size, &pBounceBuffer);
     2231                SVGAFifoCmdBlitGMRFBToScreen *pCmd = (SVGAFifoCmdBlitGMRFBToScreen *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdBlitGMRFBToScreen), &size, &pBounceBuffer);
    22322232                int32_t width, height;
    22332233
     
    22732273            case SVGA_CMD_BLIT_SCREEN_TO_GMRFB:
    22742274            {
    2275                 SVGAFifoCmdBlitScreenToGMRFB *pCmd = (SVGAFifoCmdBlitScreenToGMRFB *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdBlitScreenToGMRFB), &size, &pBounceBuffer);
     2275                SVGAFifoCmdBlitScreenToGMRFB *pCmd = (SVGAFifoCmdBlitScreenToGMRFB *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdBlitScreenToGMRFB), &size, &pBounceBuffer);
    22762276
    22772277                /* @note this can fetch 3d render results as well!! */
     
    22832283            case SVGA_CMD_ANNOTATION_FILL:
    22842284            {
    2285                 SVGAFifoCmdAnnotationFill *pCmd = (SVGAFifoCmdAnnotationFill *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdAnnotationFill), &size, &pBounceBuffer);
     2285                SVGAFifoCmdAnnotationFill *pCmd = (SVGAFifoCmdAnnotationFill *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdAnnotationFill), &size, &pBounceBuffer);
    22862286
    22872287                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));
     
    22922292            case SVGA_CMD_ANNOTATION_COPY:
    22932293            {
    2294                 SVGAFifoCmdAnnotationCopy *pCmd = (SVGAFifoCmdAnnotationCopy*)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGAFifoCmdAnnotationCopy), &size, &pBounceBuffer);
     2294                SVGAFifoCmdAnnotationCopy *pCmd = (SVGAFifoCmdAnnotationCopy*)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGAFifoCmdAnnotationCopy), &size, &pBounceBuffer);
    22952295
    22962296                Log(("vmsvgaFIFOLoop: SVGA_CMD_ANNOTATION_COPY\n"));
     
    23052305                {
    23062306                    /* All 3d commands start with a common header, which defines the size of the command. */
    2307                     SVGA3dCmdHeader *pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(pFIFO, sizeof(SVGA3dCmdHeader), &size, &pBounceBuffer);
     2307                    SVGA3dCmdHeader *pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, sizeof(SVGA3dCmdHeader), &size, &pBounceBuffer);
    23082308                    uint32_t cbCmd;
    23092309
     
    23132313                    if (pBounceBuffer)
    23142314                        RTMemFree(pBounceBuffer);
    2315                     pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(pFIFO, cbCmd, &size, &pBounceBuffer);
     2315                    pHdr = (SVGA3dCmdHeader *)vmsvgaFIFOGetCmdBuffer(pThread, pFIFO, cbCmd, &size, &pBounceBuffer);
    23162316
    23172317                    switch (pFIFO[u32Cmd])
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