VirtualBox

Changeset 51513 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 3, 2014 2:36:21 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94133
Message:

DisplayImpl: should work without attached framebuffer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r51482 r51513  
    676676        return;
    677677
    678     ULONG ul;
    679     for (ul = 0; ul < mcMonitors; ul++)
    680         maFramebuffers[ul].pFramebuffer = NULL;
     678    unsigned uScreenId;
     679    for (uScreenId = 0; uScreenId < mcMonitors; uScreenId++)
     680    {
     681        maFramebuffers[uScreenId].pSourceBitmap.setNull();
     682        maFramebuffers[uScreenId].pFramebuffer.setNull();
     683    }
    681684
    682685    if (mParent)
     
    960963    }
    961964
    962     if (maFramebuffers[uScreenId].pFramebuffer.isNull())
    963     {
    964         return VINF_SUCCESS;
    965     }
     965    /* Guest screen image will be invalid during resize, make sure that it is not updated. */
     966    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     967    {
     968        mpDrv->pUpPort->pfnSetRenderVRAM(mpDrv->pUpPort, false);
     969
     970        mpDrv->IConnector.pu8Data    = NULL;
     971        mpDrv->IConnector.cbScanline = 0;
     972        mpDrv->IConnector.cBits      = 32; /* DevVGA does not work with cBits == 0. */
     973        mpDrv->IConnector.cx         = 0;
     974        mpDrv->IConnector.cy         = 0;
     975    }
     976
     977    maFramebuffers[uScreenId].pSourceBitmap.setNull();
    966978
    967979    ULONG pixelFormat;
     
    10091021    }
    10101022
    1011     /* Framebuffer will be invalid during resize, make sure that it is not accessed. */
    1012     if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
    1013     {
    1014         mpDrv->pUpPort->pfnSetRenderVRAM(mpDrv->pUpPort, false);
    1015 
    1016         mpDrv->IConnector.pu8Data    = NULL;
    1017         mpDrv->IConnector.cbScanline = 0;
    1018         mpDrv->IConnector.cBits      = 32; /* DevVGA does not work with cBits == 0. */
    1019         mpDrv->IConnector.cx         = 0;
    1020         mpDrv->IConnector.cy         = 0;
    1021     }
    1022 
    1023     maFramebuffers[uScreenId].pSourceBitmap.setNull();
    1024 
    1025     int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId,
    1026                                     pixelFormat, pvVRAM, bpp, cbLine, w, h);
    1027     if (rc == VINF_VGA_RESIZE_IN_PROGRESS)
    1028     {
    1029         /* Immediately return to the caller. ResizeCompleted will be called back by the
    1030          * GUI thread. The ResizeCompleted callback will change the resize status from
    1031          * InProgress to UpdateDisplayData. The latter status will be checked by the
    1032          * display timer callback on EMT and all required adjustments will be done there.
    1033          */
    1034         return rc;
     1023    if (!maFramebuffers[uScreenId].pFramebuffer.isNull())
     1024    {
     1025        int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId,
     1026                                        pixelFormat, pvVRAM, bpp, cbLine, w, h);
     1027        if (rc == VINF_VGA_RESIZE_IN_PROGRESS)
     1028        {
     1029            /* Immediately return to the caller. ResizeCompleted will be called back by the
     1030             * GUI thread. The ResizeCompleted callback will change the resize status from
     1031             * InProgress to UpdateDisplayData. The latter status will be checked by the
     1032             * display timer callback on EMT and all required adjustments will be done there.
     1033             */
     1034            return rc;
     1035        }
    10351036    }
    10361037
     
    12651266#endif /* DEBUG_sunlover */
    12661267
    1267     IFramebuffer *pFramebuffer = maFramebuffers[uScreenId].pFramebuffer;
    1268 
    1269     // if there is no framebuffer, this call is not interesting
    1270     if (   pFramebuffer == NULL
    1271         || maFramebuffers[uScreenId].fDisabled)
     1268    /* No updates for a disabled guest screen. */
     1269    if (maFramebuffers[uScreenId].fDisabled)
    12721270        return;
    1273 
    1274     pFramebuffer->Lock();
    12751271
    12761272    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     
    12801276                                          maFramebuffers[uScreenId].h);
    12811277
    1282     if (w != 0 && h != 0)
    1283         pFramebuffer->NotifyUpdate(x, y, w, h);
    1284 
    1285     pFramebuffer->Unlock();
     1278    IFramebuffer *pFramebuffer = maFramebuffers[uScreenId].pFramebuffer;
     1279    if (pFramebuffer != NULL)
     1280    {
     1281        pFramebuffer->Lock();
     1282
     1283        if (w != 0 && h != 0)
     1284            pFramebuffer->NotifyUpdate(x, y, w, h);
     1285
     1286        pFramebuffer->Unlock();
     1287    }
    12861288
    12871289#ifndef VBOX_WITH_HGSMI
     
    16221624    uint32_t h = pFBInfo->dirtyRect.yBottom - pFBInfo->dirtyRect.yTop;
    16231625
    1624     if (!pFBInfo->fDefaultFormat && pFBInfo->pFramebuffer && w != 0 && h != 0)
     1626    if (!pFBInfo->fDefaultFormat && w != 0 && h != 0)
    16251627    {
    16261628        //@todo pfnUpdateDisplayRect must take the vram offset parameter for the framebuffer
     
    33593361        if (RT_SUCCESS(rc))
    33603362        {
    3361             if (!pFBInfo->pFramebuffer.isNull())
     3363            if (!pFBInfo->pSourceBitmap.isNull())
    33623364            {
    3363                 /* Update the changed screen area. When framebuffer uses VRAM directly, just notify
    3364                  * it to update. And for default format, render the guest VRAM to framebuffer.
     3365                /* Update the changed screen area. When source bitmap uses VRAM directly, just notify
     3366                 * frontend to update. And for default format, render the guest VRAM to the source bitmap.
    33653367                 */
    33663368                if (   pFBInfo->fDefaultFormat
     
    34113413                    }
    34123414                }
    3413 
    3414                 pDisplay->handleDisplayUpdate(aScreenId, x, y, width, height);
    34153415            }
     3416
     3417            pDisplay->handleDisplayUpdate(aScreenId, x, y, width, height);
    34163418        }
    34173419    }
     
    34993501
    35003502        if (   !pFBInfo->fVBVAEnabled
    3501             && uScreenId == VBOX_VIDEO_PRIMARY_SCREEN
    3502             && !pFBInfo->pFramebuffer.isNull())
     3503            && uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
    35033504        {
    35043505            pDisplay->mpDrv->pUpPort->pfnUpdateDisplayAll(pDisplay->mpDrv->pUpPort);
     
    35063507        else
    35073508        {
    3508             if (   !pFBInfo->pFramebuffer.isNull()
    3509                 && !pFBInfo->fDisabled
     3509            if (   !pFBInfo->fDisabled
    35103510                && pFBInfo->u32ResizeStatus == ResizeStatus_Void)
    35113511            {
     
    41304130                /* No VBVA do a display update. */
    41314131                DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN];
    4132                 if (!pFBInfo->pFramebuffer.isNull() && pFBInfo->u32ResizeStatus == ResizeStatus_Void)
     4132                if (pFBInfo->u32ResizeStatus == ResizeStatus_Void)
    41334133                {
    41344134                    pDisplay->vbvaLock();
     
    41484148                DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[uScreenId];
    41494149
    4150                 if (!pFBInfo->pFramebuffer.isNull() && pFBInfo->u32ResizeStatus == ResizeStatus_Void)
     4150                if (pFBInfo->u32ResizeStatus == ResizeStatus_Void)
    41514151                {
    41524152                    Assert (pDisplay->mParent && pDisplay->mParent->consoleVRDPServer());
     
    42084208                    && pFBInfo->u32ResizeStatus == ResizeStatus_Void)
    42094209                {
    4210                     int rc;
     4210                    int rc = VERR_NOT_SUPPORTED;
    42114211                    if (   pFBInfo->fVBVAEnabled
    42124212                        && pFBInfo->pu8FramebufferVRAM)
     
    42184218                                                  pFBInfo->pu8FramebufferVRAM, u64Now);
    42194219                    }
    4220                     else
     4220                    else if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN && pDrv->IConnector.pu8Data)
    42214221                    {
    42224222                        rc = VideoRecCopyToIntBuf(pDisplay->mpVideoRecCtx, uScreenId, 0, 0,
     
    45344534
    45354535    if (pFramebuffer == NULL)
    4536         return VERR_INVALID_STATE; /* notify we can not handle request atm */
     4536        return VERR_NOT_IMPLEMENTED; /* Implementation is not available. */
    45374537
    45384538    HRESULT hr = pFramebuffer->ProcessVHWACommand((BYTE*)pCommand);
     
    49754975            /* Make sure that framebuffer contains the same image as the guest VRAM. */
    49764976            if (   uScreenId == VBOX_VIDEO_PRIMARY_SCREEN
    4977                 && !pFBInfo->pFramebuffer.isNull()
    49784977                && !pFBInfo->fDisabled)
    49794978            {
    49804979                pDrv->pUpPort->pfnUpdateDisplayRect (pDrv->pUpPort, pCmd->x, pCmd->y, pCmd->w, pCmd->h);
    49814980            }
    4982             else if (   !pFBInfo->pFramebuffer.isNull()
     4981            else if (   !pFBInfo->pSourceBitmap.isNull()
    49834982                     && !pFBInfo->fDisabled)
    49844983            {
     
    53025301    }
    53035302
    5304     if (pFBInfo->pFramebuffer.isNull())
    5305     {
    5306         /* If no framebuffer, the resize will be done later when a new framebuffer will be set in changeFramebuffer. */
    5307         return VINF_SUCCESS;
    5308     }
    5309 
    5310     /* If the framebuffer already set for the screen, do a regular resize. */
     5303    /* Do a regular resize. */
    53115304    return pThis->handleDisplayResize(pScreen->u32ViewIndex, pScreen->u16BitsPerPixel,
    53125305                                      (uint8_t *)pvVRAM + pScreen->u32StartOffset,
     
    53685361    PDRVMAINDISPLAY pThis = PDMINS_2_DATA(pDrvIns, PDRVMAINDISPLAY);
    53695362    LogRelFlowFunc(("iInstance=%d\n", pDrvIns->iInstance));
     5363
     5364    pThis->pUpPort->pfnSetRenderVRAM(pThis->pUpPort, false);
     5365
     5366    pThis->IConnector.pu8Data    = NULL;
     5367    pThis->IConnector.cbScanline = 0;
     5368    pThis->IConnector.cBits      = 32;
     5369    pThis->IConnector.cx         = 0;
     5370    pThis->IConnector.cy         = 0;
    53705371
    53715372    if (pThis->pDisplay)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette