Changeset 57092 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jul 27, 2015 11:07:29 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r56886 r57092 285 285 return FALSE; 286 286 } 287 vbvxClearVRAM(pScrn, ((size_t)pScrn->virtualX) * pScrn->virtualY * (pScrn->bitsPerPixel / 8), 288 ((size_t)adjustedWidth) * height * (pScrn->bitsPerPixel / 8)); 287 if (pScrn->vtSema) 288 vbvxClearVRAM(pScrn, ((size_t)pScrn->virtualX) * pScrn->virtualY * (pScrn->bitsPerPixel / 8), 289 ((size_t)adjustedWidth) * height * (pScrn->bitsPerPixel / 8)); 289 290 pScreen->ModifyPixmapHeader(pPixmap, adjustedWidth, height, pScrn->depth, pScrn->bitsPerPixel, cbLine, pVBox->base); 290 291 } … … 300 301 /** Set a video mode to the hardware, RandR 1.1 version. Since we no longer do 301 302 * virtual frame buffers, adjust the screen pixmap dimensions to match. */ 302 static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreenInitTime )303 static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreenInitTime, bool fEnterVTTime) 303 304 { 304 305 VBOXPtr pVBox = VBOXGetRec(pScrn); … … 317 318 xf86ScrnToScreen(pScrn)->width = pMode->HDisplay; 318 319 xf86ScrnToScreen(pScrn)->height = pMode->VDisplay; 320 /* This prevents a crash in CentOS 3. I was unable to debug it to 321 * satisfaction, partly due to the lack of symbols. My guess is that 322 * pScrn->ModifyPixmapHeader() expects certain things to be set up when 323 * it sees pScrn->vtSema set to true which are not quite done at this 324 * point of the VT switch. */ 325 if (fEnterVTTime) 326 pScrn->vtSema = FALSE; 319 327 adjustScreenPixmap(pScrn, pMode->HDisplay, pMode->VDisplay); 320 } 321 if (pMode->HDisplay != 0 && pMode->VDisplay != 0) 328 if (fEnterVTTime) 329 pScrn->vtSema = TRUE; 330 } 331 if (pMode->HDisplay != 0 && pMode->VDisplay != 0 && pScrn->vtSema) 322 332 vbvxSetMode(pScrn, 0, pMode->HDisplay, pMode->VDisplay, 0, 0, true, true, &frameBuffer); 323 333 pScrn->currentMode = pMode; … … 348 358 originalX, originalY)); 349 359 for (i = cFirst; i < cLast; ++i) 350 if (pVBox->pScreens[i].paCrtcs->mode.HDisplay != 0 && pVBox->pScreens[i].paCrtcs->mode.VDisplay != 0 )360 if (pVBox->pScreens[i].paCrtcs->mode.HDisplay != 0 && pVBox->pScreens[i].paCrtcs->mode.VDisplay != 0 && pScrn->vtSema) 351 361 vbvxSetMode(pScrn, i, pVBox->pScreens[i].paCrtcs->mode.HDisplay, pVBox->pScreens[i].paCrtcs->mode.VDisplay, 352 362 pVBox->pScreens[i].paCrtcs->x, pVBox->pScreens[i].paCrtcs->y, pVBox->pScreens[i].fPowerOn, … … 372 382 373 383 TRACE_LOG("width=%d, height=%d\n", cw, ch); 374 /* Don't fiddle with the hardware if we are switched375 * to a virtual terminal. */376 if (!pScrn->vtSema) {377 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,378 "We do not own the active VT, exiting.\n");379 return TRUE;380 }381 384 rc = adjustScreenPixmap(pScrn, cw, ch); 382 385 /* Power-on all screens (the server expects this) and set the new pitch to them. */ … … 439 442 pVBox->pScreens[cDisplay].aScreenLocation.x = x; 440 443 pVBox->pScreens[cDisplay].aScreenLocation.y = y; 441 /* Don't fiddle with the hardware if we are switched442 * to a virtual terminal. */443 if (!crtc->scrn->vtSema)444 {445 xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,446 "We do not own the active VT, exiting.\n");447 return;448 }449 444 setModeRandR12(crtc->scrn, cDisplay); 450 445 } … … 1169 1164 setSizesRandR11(pScrn); 1170 1165 #endif 1166 /* This calls EnableDisableFBAccess(), so only use when switched in. */ 1171 1167 if (pScrn->vtSema) 1172 1168 vbvxReprobeCursor(pScrn); … … 1341 1337 #else 1342 1338 /* set first video mode */ 1343 setModeRandR11(pScrn, pScrn->currentMode, true );1339 setModeRandR11(pScrn, pScrn->currentMode, true, false); 1344 1340 #endif 1345 1341 … … 1414 1410 setSizesAndCursorIntegration(pScrn, false); 1415 1411 #else 1416 /* This prevents a crash in CentOS 3. I was unable to debug it to 1417 * satisfaction, partly due to the lack of symbols. My guess is that 1418 * pScrn->ModifyPixmapHeader() expects certain things to be set up when 1419 * it sees pScrn->vtSema set to true which are not quite done at this 1420 * point of the VT switch. */ 1421 pScrn->vtSema = FALSE; 1422 setModeRandR11(pScrn, pScrn->currentMode, false); 1423 pScrn->vtSema = TRUE; 1412 setModeRandR11(pScrn, pScrn->currentMode, false, true); 1424 1413 #endif 1425 1414 #ifdef SET_HAVE_VT_PROPERTY … … 1513 1502 1514 1503 TRACE_LOG("HDisplay=%d, VDisplay=%d\n", pMode->HDisplay, pMode->VDisplay); 1515 if (!pScrn->vtSema)1516 {1517 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,1518 "We do not own the active VT, exiting.\n");1519 return TRUE;1520 }1521 1504 #ifdef VBOXVIDEO_13 1522 1505 rc = xf86SetSingleMode(pScrn, pMode, RR_Rotate_0); 1523 1506 #else 1524 setModeRandR11(pScrn, pMode, false );1507 setModeRandR11(pScrn, pMode, false, false); 1525 1508 #endif 1526 1509 TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE");
Note:
See TracChangeset
for help on using the changeset viewer.