Changeset 55968 in vbox
- Timestamp:
- May 20, 2015 2:31:37 PM (10 years ago)
- Location:
- trunk/src/VBox/Additions/x11
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
r55385 r55968 271 271 if (!pState->fHaveRandR12) 272 272 notifyXServerRandR11(pState); 273 do274 rc = VbglR3WaitEvent( VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST275 | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED,276 RT_INDEFINITE_WAIT, &fEvents);277 while(rc == VERR_INTERRUPTED);273 rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED, RT_INDEFINITE_WAIT, 274 &fEvents); 275 /* Interrupted is used to re-set the mode without changing it. */ 276 if (rc == VERR_INTERRUPTED) 277 rc = VINF_SUCCESS; 278 278 if (RT_FAILURE(rc)) /* VERR_NO_MEMORY? */ 279 279 VBClFatalError(("event wait failed, rc=%Rrc\n", rc)); … … 367 367 { 368 368 struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface); 369 int rc; 369 370 370 371 if (!pSelf->mfInit) 371 372 return VERR_WRONG_ORDER; 372 return enableEventsAndCaps(); 373 rc = enableEventsAndCaps(); 374 /* RandR 1.1-based drivers only let us change mode when we are not switched 375 * out, so interrupt the wait when we switch in and re-set it. */ 376 VbglR3InterruptEventWaits(); 377 return rc; 373 378 } 374 379 -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r55875 r55968 301 301 /** Set a video mode to the hardware, RandR 1.1 version. Since we no longer do 302 302 * virtual frame buffers, adjust the screen pixmap dimensions to match. */ 303 static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool f LimitedContext)303 static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreenInitTime) 304 304 { 305 305 VBOXPtr pVBox = VBOXGetRec(pScrn); … … 308 308 pVBox->pScreens[0].aScreenLocation.cx = pMode->HDisplay; 309 309 pVBox->pScreens[0].aScreenLocation.cy = pMode->VDisplay; 310 if (fLimitedContext) 311 { 310 if (fScreenInitTime) 311 { 312 /* The screen structure is not fully set up yet, so do not touch it. */ 312 313 pScrn->displayWidth = pScrn->virtualX = pMode->HDisplay; 313 314 pScrn->virtualY = pMode->VDisplay; … … 1043 1044 #ifdef VBOXVIDEO_13 1044 1045 1045 static void setVirtualSizeRandR12(ScrnInfoPtr pScrn, bool f LimitedContext)1046 static void setVirtualSizeRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime) 1046 1047 { 1047 1048 VBOXPtr pVBox = VBOXGetRec(pScrn); … … 1070 1071 * cause problems setting up RandR 1.2 which needs it set to the 1071 1072 * maximum size at this point. */ 1072 if (!f LimitedContext)1073 if (!fScreenInitTime) 1073 1074 { 1074 1075 TRACE_LOG("cx=%u, cy=%u\n", cx, cy); … … 1081 1082 } 1082 1083 1083 static void setScreenSizesRandR12(ScrnInfoPtr pScrn, bool f LimitedContext)1084 static void setScreenSizesRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime) 1084 1085 { 1085 1086 VBOXPtr pVBox = VBOXGetRec(pScrn); … … 1096 1097 xf86CrtcSetMode(pVBox->pScreens[i].paCrtcs, pVBox->pScreens[i].paOutputs->probed_modes, RR_Rotate_0, 1097 1098 pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y); 1098 if (!f LimitedContext)1099 if (!fScreenInitTime) 1099 1100 RRCrtcNotify(pVBox->pScreens[i].paCrtcs->randr_crtc, pVBox->pScreens[i].paOutputs->randr_output->modes[0], 1100 1101 pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y, RR_Rotate_0, … … 1106 1107 } 1107 1108 1108 static void setSizesRandR12(ScrnInfoPtr pScrn, bool f LimitedContext)1109 { 1110 VBOXPtr pVBox = VBOXGetRec(pScrn); 1111 1112 if (!f LimitedContext)1109 static void setSizesRandR12(ScrnInfoPtr pScrn, bool fScreenInitTime) 1110 { 1111 VBOXPtr pVBox = VBOXGetRec(pScrn); 1112 1113 if (!fScreenInitTime) 1113 1114 { 1114 1115 # if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5 … … 1118 1119 # endif 1119 1120 } 1120 setVirtualSizeRandR12(pScrn, f LimitedContext);1121 setScreenSizesRandR12(pScrn, f LimitedContext);1122 if (!f LimitedContext)1121 setVirtualSizeRandR12(pScrn, fScreenInitTime); 1122 setScreenSizesRandR12(pScrn, fScreenInitTime); 1123 if (!fScreenInitTime) 1123 1124 { 1124 1125 /* We use RRScreenSizeSet() here and not RRScreenSizeNotify() because … … 1135 1136 #else 1136 1137 1137 static void setSizesRandR11(ScrnInfoPtr pScrn , bool fLimitedContext)1138 static void setSizesRandR11(ScrnInfoPtr pScrn) 1138 1139 { 1139 1140 VBOXPtr pVBox = VBOXGetRec(pScrn); … … 1143 1144 pNewMode->HDisplay = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL); 1144 1145 pNewMode->VDisplay = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL); 1145 setModeRandR11(pScrn, pNewMode, fLimitedContext);1146 1146 } 1147 1147 … … 1156 1156 setSizesRandR12(pScrn, fScreenInitTime); 1157 1157 #else 1158 setSizesRandR11(pScrn , fScreenInitTime);1158 setSizesRandR11(pScrn); 1159 1159 #endif 1160 1160 if (pScrn->vtSema) … … 1327 1327 } 1328 1328 1329 #endif1330 1329 /* set first video mode */ 1331 1330 setSizesAndCursorIntegration(pScrn, true); 1331 #else 1332 /* set first video mode */ 1333 setModeRandR11(pScrn, pScrn->currentMode, true); 1334 #endif 1332 1335 1333 1336 /* Register block and wake-up handlers for getting new screen size hints. */ … … 1396 1399 vboxEnableVbva(pScrn); 1397 1400 /* Re-set video mode */ 1401 #ifdef VBOXVIDEO_13 1398 1402 vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL); 1399 1403 vbvxReadSizesAndCursorIntegrationFromProperties(pScrn, NULL); 1404 setSizesAndCursorIntegration(pScrn, false); 1405 #else 1400 1406 /* This prevents a crash in CentOS 3. I was unable to debug it to 1401 1407 * satisfaction, partly due to the lack of symbols. My guess is that … … 1404 1410 * point of the VT switch. */ 1405 1411 pScrn->vtSema = FALSE; 1406 set SizesAndCursorIntegration(pScrn, false);1412 setModeRandR11(pScrn, pScrn->currentMode, false); 1407 1413 pScrn->vtSema = TRUE; 1414 #endif 1408 1415 #ifdef SET_HAVE_VT_PROPERTY 1409 1416 updateHasVTProperty(pScrn, TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.