Changeset 51513 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 3, 2014 2:36:21 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94133
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r51482 r51513 676 676 return; 677 677 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 } 681 684 682 685 if (mParent) … … 960 963 } 961 964 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(); 966 978 967 979 ULONG pixelFormat; … … 1009 1021 } 1010 1022 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 } 1035 1036 } 1036 1037 … … 1265 1266 #endif /* DEBUG_sunlover */ 1266 1267 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) 1272 1270 return; 1273 1274 pFramebuffer->Lock();1275 1271 1276 1272 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) … … 1280 1276 maFramebuffers[uScreenId].h); 1281 1277 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 } 1286 1288 1287 1289 #ifndef VBOX_WITH_HGSMI … … 1622 1624 uint32_t h = pFBInfo->dirtyRect.yBottom - pFBInfo->dirtyRect.yTop; 1623 1625 1624 if (!pFBInfo->fDefaultFormat && pFBInfo->pFramebuffer &&w != 0 && h != 0)1626 if (!pFBInfo->fDefaultFormat && w != 0 && h != 0) 1625 1627 { 1626 1628 //@todo pfnUpdateDisplayRect must take the vram offset parameter for the framebuffer … … 3359 3361 if (RT_SUCCESS(rc)) 3360 3362 { 3361 if (!pFBInfo->p Framebuffer.isNull())3363 if (!pFBInfo->pSourceBitmap.isNull()) 3362 3364 { 3363 /* Update the changed screen area. When framebufferuses VRAM directly, just notify3364 * 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. 3365 3367 */ 3366 3368 if ( pFBInfo->fDefaultFormat … … 3411 3413 } 3412 3414 } 3413 3414 pDisplay->handleDisplayUpdate(aScreenId, x, y, width, height);3415 3415 } 3416 3417 pDisplay->handleDisplayUpdate(aScreenId, x, y, width, height); 3416 3418 } 3417 3419 } … … 3499 3501 3500 3502 if ( !pFBInfo->fVBVAEnabled 3501 && uScreenId == VBOX_VIDEO_PRIMARY_SCREEN 3502 && !pFBInfo->pFramebuffer.isNull()) 3503 && uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 3503 3504 { 3504 3505 pDisplay->mpDrv->pUpPort->pfnUpdateDisplayAll(pDisplay->mpDrv->pUpPort); … … 3506 3507 else 3507 3508 { 3508 if ( !pFBInfo->pFramebuffer.isNull() 3509 && !pFBInfo->fDisabled 3509 if ( !pFBInfo->fDisabled 3510 3510 && pFBInfo->u32ResizeStatus == ResizeStatus_Void) 3511 3511 { … … 4130 4130 /* No VBVA do a display update. */ 4131 4131 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN]; 4132 if ( !pFBInfo->pFramebuffer.isNull() &&pFBInfo->u32ResizeStatus == ResizeStatus_Void)4132 if (pFBInfo->u32ResizeStatus == ResizeStatus_Void) 4133 4133 { 4134 4134 pDisplay->vbvaLock(); … … 4148 4148 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[uScreenId]; 4149 4149 4150 if ( !pFBInfo->pFramebuffer.isNull() &&pFBInfo->u32ResizeStatus == ResizeStatus_Void)4150 if (pFBInfo->u32ResizeStatus == ResizeStatus_Void) 4151 4151 { 4152 4152 Assert (pDisplay->mParent && pDisplay->mParent->consoleVRDPServer()); … … 4208 4208 && pFBInfo->u32ResizeStatus == ResizeStatus_Void) 4209 4209 { 4210 int rc ;4210 int rc = VERR_NOT_SUPPORTED; 4211 4211 if ( pFBInfo->fVBVAEnabled 4212 4212 && pFBInfo->pu8FramebufferVRAM) … … 4218 4218 pFBInfo->pu8FramebufferVRAM, u64Now); 4219 4219 } 4220 else 4220 else if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN && pDrv->IConnector.pu8Data) 4221 4221 { 4222 4222 rc = VideoRecCopyToIntBuf(pDisplay->mpVideoRecCtx, uScreenId, 0, 0, … … 4534 4534 4535 4535 if (pFramebuffer == NULL) 4536 return VERR_ INVALID_STATE; /* notify we can not handle request atm*/4536 return VERR_NOT_IMPLEMENTED; /* Implementation is not available. */ 4537 4537 4538 4538 HRESULT hr = pFramebuffer->ProcessVHWACommand((BYTE*)pCommand); … … 4975 4975 /* Make sure that framebuffer contains the same image as the guest VRAM. */ 4976 4976 if ( uScreenId == VBOX_VIDEO_PRIMARY_SCREEN 4977 && !pFBInfo->pFramebuffer.isNull()4978 4977 && !pFBInfo->fDisabled) 4979 4978 { 4980 4979 pDrv->pUpPort->pfnUpdateDisplayRect (pDrv->pUpPort, pCmd->x, pCmd->y, pCmd->w, pCmd->h); 4981 4980 } 4982 else if ( !pFBInfo->p Framebuffer.isNull()4981 else if ( !pFBInfo->pSourceBitmap.isNull() 4983 4982 && !pFBInfo->fDisabled) 4984 4983 { … … 5302 5301 } 5303 5302 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. */ 5311 5304 return pThis->handleDisplayResize(pScreen->u32ViewIndex, pScreen->u16BitsPerPixel, 5312 5305 (uint8_t *)pvVRAM + pScreen->u32StartOffset, … … 5368 5361 PDRVMAINDISPLAY pThis = PDMINS_2_DATA(pDrvIns, PDRVMAINDISPLAY); 5369 5362 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; 5370 5371 5371 5372 if (pThis->pDisplay)
Note:
See TracChangeset
for help on using the changeset viewer.