Changeset 55384 in vbox for trunk/src/VBox
- Timestamp:
- Apr 22, 2015 4:46:42 PM (10 years ago)
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/getmode.c
r55378 r55384 527 527 ssize_t rc; 528 528 529 pVBox->fHaveReadHGSMIModeHintData = false;530 RRGetInfo(pScreen531 # if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 5532 , TRUE533 # endif534 );535 VBVXASSERT(pVBox->fHaveReadHGSMIModeHintData == true, ("fHaveReadHGSMIModeHintData not set.\n"));536 529 do 537 530 rc = read(fd, &event, sizeof(event)); -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r55377 r55384 83 83 #include "vboxvideo.h" 84 84 #include <VBox/VBoxGuest.h> 85 #include <VBox/Hardware/VBoxVideoVBE.h> 85 86 #include "version-generated.h" 86 87 #include "product-generated.h" … … 373 374 { 374 375 VBOXPtr pVBox = VBOXGetRec(pScrn); 376 Bool rc; 377 unsigned i; 378 375 379 TRACE_LOG("width=%d, height=%d\n", cw, ch); 376 /* Save the size in case we need to re-set it later. */377 pVBox->FBSize.cx = cw;378 pVBox->FBSize.cy = ch;379 380 /* Don't fiddle with the hardware if we are switched 380 381 * to a virtual terminal. */ … … 384 385 return TRUE; 385 386 } 386 return VBOXAdjustScreenPixmap(pScrn, cw, ch); 387 rc = adjustScreenPixmap(pScrn, cw, ch); 388 /* Power-on all screens (the server expects this) and set the new pitch to them. */ 389 for (i = 0; i < pVBox->cScreens; ++i) 390 pVBox->pScreens[i].fPowerOn = true; 391 setAllModesRandR12(pScrn); 392 vbvxSetSolarisMouseRange(cw, ch); 393 return rc; 387 394 } 388 395 … … 394 401 vbox_crtc_dpms(xf86CrtcPtr crtc, int mode) 395 402 { 396 VBOXPtr pVBox = VBOXGetRec(crtc->scrn); 403 ScrnInfoPtr pScrn = crtc->scrn; 404 VBOXPtr pVBox = VBOXGetRec(pScrn); 397 405 unsigned cDisplay = (uintptr_t)crtc->driver_private; 398 bool fEnabled = (mode != DPMSModeOff); 399 400 TRACE_LOG("cDisplay=%u, mode=%i\n", cDisplay, mode); 401 pVBox->pScreens[cDisplay].fCrtcEnabled = fEnabled; 402 /* Don't fiddle with the hardware if we are switched 403 * to a virtual terminal. */ 404 if (!crtc->scrn->vtSema) { 405 xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, 406 "We do not own the active VT, exiting.\n"); 407 return; 408 } 409 if ( pVBox->pScreens[cDisplay].aScreenLocation.cx 410 && pVBox->pScreens[cDisplay].aScreenLocation.cy) 411 VBOXSetMode(crtc->scrn, cDisplay, 412 pVBox->pScreens[cDisplay].aScreenLocation.cx, 413 pVBox->pScreens[cDisplay].aScreenLocation.cy, 414 pVBox->pScreens[cDisplay].aScreenLocation.x, 415 pVBox->pScreens[cDisplay].aScreenLocation.y); 406 407 TRACE_LOG("mode=%d\n", mode); 408 pVBox->pScreens[cDisplay].fPowerOn = (mode != DPMSModeOff); 409 setModeRandR12(pScrn, cDisplay); 416 410 } 417 411 … … 446 440 TRACE_LOG("name=%s, HDisplay=%d, VDisplay=%d, x=%d, y=%d\n", adjusted_mode->name, 447 441 adjusted_mode->HDisplay, adjusted_mode->VDisplay, x, y); 448 pVBox->pScreens[cDisplay].fCrtcEnabled = true; 449 pVBox->pScreens[cDisplay].fOutputEnabled = true; 442 pVBox->pScreens[cDisplay].fPowerOn = true; 450 443 pVBox->pScreens[cDisplay].aScreenLocation.cx = adjusted_mode->HDisplay; 451 444 pVBox->pScreens[cDisplay].aScreenLocation.cy = adjusted_mode->VDisplay; … … 460 453 return; 461 454 } 462 VBOXSetMode(crtc->scrn, cDisplay, adjusted_mode->HDisplay, 463 adjusted_mode->VDisplay, x, y); 455 setModeRandR12(crtc->scrn, cDisplay); 464 456 } 465 457 … … 580 572 uint32_t x, y, iScreen; 581 573 iScreen = (uintptr_t)output->driver_private; 582 VBoxUpdateSizeHints(pScrn); 583 pMode = vbox_output_add_mode(pVBox, &pModes, NULL, pVBox->pScreens[iScreen].aPreferredSize.cx, 584 pVBox->pScreens[iScreen].aPreferredSize.cy, TRUE, FALSE); 574 pMode = vbox_output_add_mode(pVBox, &pModes, NULL, 575 RT_CLAMP(pVBox->pScreens[iScreen].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL), 576 RT_CLAMP(pVBox->pScreens[iScreen].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL), 577 TRUE, FALSE); 585 578 TRACE_EXIT(); 586 579 return pModes; … … 1288 1281 return FALSE; 1289 1282 VBoxInitialiseSizeHints(pScrn); 1283 /* Get any screen size hints from HGSMI. Do not yet try to access X11 1284 * properties, as they are not yet set up, and nor are the clients that 1285 * might have set them. */ 1286 vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL); 1290 1287 1291 1288 #ifdef VBOXVIDEO_13 … … 1331 1328 } 1332 1329 1333 /* Initialise randr 1.2 mode-setting functions and set first mode. 1334 * Note that the mode won't be usable until the server has resized the 1335 * framebuffer to something reasonable. */ 1330 /* Initialise randr 1.2 mode-setting functions. */ 1336 1331 if (!xf86CrtcScreenInit(pScreen)) { 1337 1332 return FALSE; 1338 1333 } 1339 1334 1340 if (!xf86SetDesiredModes(pScrn)) { 1341 return FALSE; 1342 } 1343 #else /* !VBOXVIDEO_13 */ 1344 VBoxSetUpRandR11(pScreen); 1335 #endif 1345 1336 /* set first video mode */ 1346 if (!VBOXSetMode(pScrn, 0, pScrn->currentMode->HDisplay, 1347 pScrn->currentMode->VDisplay, pScrn->frameX0, 1348 pScrn->frameY0)) 1349 return FALSE; 1350 /* Save the size in case we need to re-set it later. */ 1351 pVBox->FBSize.cx = pScrn->currentMode->HDisplay; 1352 pVBox->FBSize.cy = pScrn->currentMode->VDisplay; 1353 pVBox->pScreens[0].aScreenLocation.cx = pScrn->currentMode->HDisplay; 1354 pVBox->pScreens[0].aScreenLocation.cy = pScrn->currentMode->VDisplay; 1355 pVBox->pScreens[0].aScreenLocation.x = pScrn->frameX0; 1356 pVBox->pScreens[0].aScreenLocation.y = pScrn->frameY0; 1357 #endif /* !VBOXVIDEO_13 */ 1337 setSizesAndCursorIntegration(pScrn, true); 1338 1339 /* Register block and wake-up handlers for getting new screen size hints. */ 1340 RegisterBlockAndWakeupHandlers(updateSizeHintsBlockHandler, (WakeupHandlerProcPtr)NoopDDA, (pointer)pScrn); 1358 1341 1359 1342 /* software cursor */ … … 1418 1401 vbvxSetUpHGSMIHeapInGuest(pVBox, pScrn->videoRam * 1024); 1419 1402 vboxEnableVbva(pScrn); 1420 /* Re-assert this in case we had a change request while switched out. */ 1421 if (pVBox->FBSize.cx && pVBox->FBSize.cy) 1422 VBOXAdjustScreenPixmap(pScrn, pVBox->FBSize.cx, pVBox->FBSize.cy); 1423 #ifdef VBOXVIDEO_13 1424 if (!xf86SetDesiredModes(pScrn)) 1425 return FALSE; 1426 #else 1427 if (!VBOXSetMode(pScrn, 0, pScrn->currentMode->HDisplay, 1428 pScrn->currentMode->VDisplay, pScrn->frameX0, 1429 pScrn->frameY0)) 1430 return FALSE; 1431 #endif 1403 /* Re-set video mode */ 1404 vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL); 1405 vbvxReadSizesAndCursorIntegrationFromProperties(pScrn, NULL); 1406 /* This prevents a crash in CentOS 3. I was unable to debug it to 1407 * satisfaction, partly due to the lack of symbols. My guess is that 1408 * pScrn->ModifyPixmapHeader() expects certain things to be set up when 1409 * it sees pScrn->vtSema set to true which are not quite done at this 1410 * point of the VT switch. */ 1411 pScrn->vtSema = FALSE; 1412 setSizesAndCursorIntegration(pScrn, false); 1413 pScrn->vtSema = TRUE; 1432 1414 #ifdef SET_HAVE_VT_PROPERTY 1433 1415 updateHasVTProperty(pScrn, TRUE); … … 1449 1431 #endif 1450 1432 vboxDisableVbva(pScrn); 1451 vb oxClearVRAM(pScrn, 0, 0);1433 vbvxClearVRAM(pScrn, pScrn->virtualX * pScrn->virtualY * pScrn->bitsPerPixel / 8, 0); 1452 1434 #ifdef VBOX_DRI_OLD 1453 1435 if (pVBox->useDRI) … … 1480 1462 #endif 1481 1463 vboxDisableVbva(pScrn); 1482 vb oxClearVRAM(pScrn, 0, 0);1464 vbvxClearVRAM(pScrn, pScrn->virtualX * pScrn->virtualY * pScrn->bitsPerPixel / 8, 0); 1483 1465 } 1484 1466 #ifdef VBOX_DRI … … 1519 1501 { 1520 1502 VBOXPtr pVBox; 1521 Bool rc ;1503 Bool rc = TRUE; 1522 1504 1523 1505 TRACE_LOG("HDisplay=%d, VDisplay=%d\n", pMode->HDisplay, pMode->VDisplay); 1524 #ifndef VBOXVIDEO_131525 pVBox = VBOXGetRec(pScrn);1526 /* Save the size in case we need to re-set it later. */1527 pVBox->FBSize.cx = pMode->HDisplay;1528 pVBox->FBSize.cy = pMode->VDisplay;1529 pVBox->pScreens[0].aScreenLocation.cx = pMode->HDisplay;1530 pVBox->pScreens[0].aScreenLocation.cy = pMode->VDisplay;1531 pVBox->pScreens[0].aScreenLocation.x = pScrn->frameX0;1532 pVBox->pScreens[0].aScreenLocation.y = pScrn->frameY0;1533 #endif1534 1506 if (!pScrn->vtSema) 1535 1507 { … … 1541 1513 rc = xf86SetSingleMode(pScrn, pMode, RR_Rotate_0); 1542 1514 #else 1543 VBOXAdjustScreenPixmap(pScrn, pMode->HDisplay, pMode->VDisplay); 1544 rc = VBOXSetMode(pScrn, 0, pMode->HDisplay, pMode->VDisplay, 1545 pScrn->frameX0, pScrn->frameY0); 1515 setModeRandR11(pScrn, pMode, false); 1546 1516 #endif 1547 1517 TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE"); … … 1550 1520 1551 1521 static void VBOXAdjustFrame(ScrnInfoPtr pScrn, int x, int y) 1552 { 1553 VBOXPtr pVBox = VBOXGetRec(pScrn); 1554 1555 TRACE_ENTRY(); 1556 pVBox->pScreens[0].aScreenLocation.x = x; 1557 pVBox->pScreens[0].aScreenLocation.y = y; 1558 /* Don't fiddle with the hardware if we are switched 1559 * to a virtual terminal. */ 1560 if (!pScrn->vtSema) 1561 { 1562 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 1563 "We do not own the active VT, exiting.\n"); 1564 return; 1565 } 1566 VBOXSetMode(pScrn, 0, pVBox->pScreens[0].aScreenLocation.cx, 1567 pVBox->pScreens[0].aScreenLocation.cy, x, y); 1568 TRACE_EXIT(); 1569 } 1522 { (void)pScrn; (void)x; (void)y; } 1570 1523 1571 1524 static void VBOXFreeScreen(ScrnInfoPtr pScrn) -
trunk/src/VBox/Additions/x11/vboxvideo/vbva.c
r55373 r55384 231 231 VBVXASSERT(rc, ("Failed to enable screen update reporting for at least one virtual monitor.\n")); 232 232 #ifdef VBOXVIDEO_13 233 # ifdef RT_OS_LINUX 234 if (rc && pVBox->hACPIEventHandler != NULL) 235 /* We ignore the return value as the fall-back should be active 236 * anyway. */ 237 VBoxHGSMISendCapsInfo(&pVBox->guestCtx, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION); 238 # endif 233 VBoxHGSMISendCapsInfo(&pVBox->guestCtx, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION); 239 234 pVBox->fHaveHGSMIModeHints = haveHGSMIModeHintAndCursorReportingInterface(pVBox); 240 235 pVBox->fHostHasScreenBlankingFlag = hostHasScreenBlankingFlag(pVBox);
Note:
See TracChangeset
for help on using the changeset viewer.