Changeset 66400 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Apr 3, 2017 1:54:44 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114352
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r66396 r66400 922 922 int Display::i_handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM, 923 923 uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags, 924 uint32_t xOrigin, uint32_t yOrigin, bool fVGAResize)924 int32_t xOrigin, int32_t yOrigin, bool fVGAResize) 925 925 #endif 926 926 { … … 1020 1020 AssertReturn(!isWriteLockOnCurrentThread(), VERR_INVALID_STATE); 1021 1021 1022 /* Note: the old code checked if the video mode was actially chnaged and 1023 * did not invalidate the source bitmap if the mode did not change. 1024 * The new code always invalidates the source bitmap, i.e. it will 1025 * notify the frontend even if nothing actually changed. 1026 * 1027 * Implementing the filtering is possible but might lead to pfnSetRenderVRAM races 1028 * between this method and QuerySourceBitmap. Such races can be avoided by implementing 1029 * the @todo below. 1030 */ 1031 1022 1032 /* Make sure that the VGA device does not access the source bitmap. */ 1023 1033 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN && mpDrv) 1024 1034 { 1035 /// @todo It is probably more convenient to implement 1036 // mpDrv->pUpPort->pfnSetOutputBitmap(pvVRAM, cbScanline, cBits, cx, cy, bool fSet); 1037 // and remove IConnector.pbData, cbScanline, cBits, cx, cy. 1038 // fSet = false disables rendering and VGA can check 1039 // if it is already rendering to a different bitmap, avoiding 1040 // enable/disable rendering races. 1025 1041 mpDrv->pUpPort->pfnSetRenderVRAM(mpDrv->pUpPort, false); 1026 1042 … … 1039 1055 1040 1056 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId]; 1057 1058 /* Whether the monitor position has changed. 1059 * A resize initiated by the VGA device does not change the monitor position. 1060 */ 1061 const bool fNewOrigin = !fVGAResize 1062 && ( pFBInfo->xOrigin != xOrigin 1063 || pFBInfo->yOrigin != yOrigin); 1064 1065 /* The event for disabled->enabled transition. 1066 * VGA resizes also come when the guest uses VBVA mode. They do not affect pFBInfo->fDisabled. 1067 * The primary screen is re-enabled when the guest leaves the VBVA mode in i_displayVBVADisable. 1068 */ 1069 const bool fGuestMonitorChangedEvent = !fVGAResize 1070 && (pFBInfo->fDisabled != RT_BOOL(flags & VBVA_SCREEN_F_DISABLED)); 1041 1071 1042 1072 /* Reset the update mode. */ … … 1054 1084 pFBInfo->pu8FramebufferVRAM = (uint8_t *)pvVRAM; 1055 1085 pFBInfo->u32LineSize = cbLine; 1056 pFBInfo->flags = flags;1057 1086 if (!fVGAResize) 1058 1087 { 1088 /* Fields which are not used in not VBVA modes and not affected by a VGA resize. */ 1089 pFBInfo->flags = flags; 1059 1090 pFBInfo->xOrigin = xOrigin; 1060 1091 pFBInfo->yOrigin = yOrigin; … … 1065 1096 /* Prepare local vars for the notification code below. */ 1066 1097 ComPtr<IFramebuffer> pFramebuffer = pFBInfo->pFramebuffer; 1098 const bool fDisabled = pFBInfo->fDisabled; 1067 1099 1068 1100 alock.release(); … … 1074 1106 NOREF(hr); 1075 1107 } 1108 1109 if (fGuestMonitorChangedEvent) 1110 { 1111 if (fDisabled) 1112 fireGuestMonitorChangedEvent(mParent->i_getEventSource(), 1113 GuestMonitorChangedEventType_Disabled, 1114 uScreenId, 1115 0, 0, 0, 0); 1116 else 1117 fireGuestMonitorChangedEvent(mParent->i_getEventSource(), 1118 GuestMonitorChangedEventType_Enabled, 1119 uScreenId, 1120 xOrigin, yOrigin, w, h); 1121 } 1122 1123 if (fNewOrigin) 1124 fireGuestMonitorChangedEvent(mParent->i_getEventSource(), 1125 GuestMonitorChangedEventType_NewOrigin, 1126 uScreenId, 1127 xOrigin, yOrigin, 0, 0); 1076 1128 1077 1129 /* Inform the VRDP server about the change of display parameters. */ … … 3359 3411 int rc = pThis->i_handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy, VBVA_SCREEN_F_ACTIVE); 3360 3412 #else 3361 int rc = pThis->i_handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy, 3362 VBVA_SCREEN_F_ACTIVE, 0, 0, true); 3413 int rc = pThis->i_handleDisplayResize(VBOX_VIDEO_PRIMARY_SCREEN, bpp, pvVRAM, cbLine, cx, cy, 0, 0, 0, true); 3363 3414 #endif 3364 3415 … … 4143 4194 * The guest can't use VBVA anymore, so only only the VGA device output works. 4144 4195 */ 4196 #ifdef NEW_RESIZE 4197 pFBInfo->flags = 0; 4198 #endif 4145 4199 if (pFBInfo->fDisabled) 4146 4200 { … … 4527 4581 u32Width, u32Height, pScreen->u16Flags, xOrigin, yOrigin, false); 4528 4582 4529 fireGuestMonitorChangedEvent(mParent->i_getEventSource(),4530 GuestMonitorChangedEventType_Disabled,4531 pScreen->u32ViewIndex,4532 0, 0, 0, 0);4533 4583 return VINF_SUCCESS; 4534 4584 } … … 4556 4606 } 4557 4607 4558 /* Resize if VBVA was just enabled or display was in disabled state.4559 * Also if there is no framebuffer, a resize will be required, because the framebuffer was/will be changed.4560 */4561 bool fResize = pFBInfo->fVBVAForceResize || pFBInfo->fDisabled || pFBInfo->pFramebuffer.isNull();4562 4563 /* If the screen blanked state is changing, then do a resize request to make sure that the framebuffer4564 * is notified and requests a new source bitmap.4565 */4566 fResize = fResize || RT_BOOL((pScreen->u16Flags ^ pFBInfo->flags) & VBVA_SCREEN_F_BLANK);4567 4568 /* Check if this is a real resize or a notification about the screen origin.4569 * The guest uses this VBVAResize call for both.4570 */4571 fResize = fResize4572 || pFBInfo->u16BitsPerPixel != pScreen->u16BitsPerPixel4573 || pFBInfo->pu8FramebufferVRAM != (uint8_t *)pvVRAM + pScreen->u32StartOffset4574 || pFBInfo->u32LineSize != pScreen->u32LineSize4575 || pFBInfo->w != pScreen->u32Width4576 || pFBInfo->h != pScreen->u32Height;4577 4578 bool fNewOrigin = pFBInfo->xOrigin != pScreen->i32OriginX4579 || pFBInfo->yOrigin != pScreen->i32OriginY;4580 4581 /* The event for disabled->enabled transition. */4582 const bool fGuestMonitorChangedEvent = pFBInfo->fDisabled;4583 4584 4608 if (fResetInputMapping) 4585 4609 { … … 4593 4617 alock.release(); 4594 4618 4595 if (fNewOrigin || fResize) 4596 i_notifyCroglResize(pView, pScreen, pvVRAM); 4597 4598 if (fGuestMonitorChangedEvent) 4599 fireGuestMonitorChangedEvent(mParent->i_getEventSource(), 4600 GuestMonitorChangedEventType_Enabled, 4601 pScreen->u32ViewIndex, 4602 pScreen->i32OriginX, pScreen->i32OriginY, 4603 pScreen->u32Width, pScreen->u32Height); 4604 4605 if (fNewOrigin) 4606 fireGuestMonitorChangedEvent(mParent->i_getEventSource(), 4607 GuestMonitorChangedEventType_NewOrigin, 4608 pScreen->u32ViewIndex, 4609 pScreen->i32OriginX, pScreen->i32OriginY, 4610 0, 0); 4611 4612 if (!fResize) 4613 { 4614 /* No parameters of the framebuffer have actually changed. */ 4615 if (fNewOrigin) 4616 { 4617 /* VRDP server still need this notification. */ 4618 LogRelFlowFunc(("Calling VRDP\n")); 4619 mParent->i_consoleVRDPServer()->SendResize(); 4620 } 4621 return VINF_SUCCESS; 4622 } 4623 4624 /* Do a regular resize. */ 4619 i_notifyCroglResize(pView, pScreen, pvVRAM); 4620 4625 4621 return i_handleDisplayResize(pScreen->u32ViewIndex, pScreen->u16BitsPerPixel, 4626 4622 (uint8_t *)pvVRAM + pScreen->u32StartOffset,
Note:
See TracChangeset
for help on using the changeset viewer.