Changeset 7168 in vbox for trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_68.c
- Timestamp:
- Feb 27, 2008 12:47:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_68.c
r6643 r7168 371 371 return (FALSE); 372 372 373 xf86 Msg(X_INFO,374 "VirtualBox guest additions video driver version "375 VBOX_VERSION_STRING "\n");373 xf86DrvMsg(pScrn->scrnIndex, X_INFO, 374 "VirtualBox guest additions video driver version " 375 VBOX_VERSION_STRING "\n"); 376 376 377 377 /* Get our private data from the ScrnInfoRec structure. */ … … 453 453 Support32bppFb)) 454 454 return FALSE; 455 if (pScrn-> depth != 24 && pScrn->depth!= 16)455 if (pScrn->bitsPerPixel != 32 && pScrn->bitsPerPixel != 16) 456 456 { 457 457 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, … … 497 497 } 498 498 499 /* Determine the virtual screen resolution from the first mode (which will be selected) */500 sscanf(pScrn->display->modes[0], "%dx%d",501 &pScrn->display->virtualX, &pScrn->display->virtualY);502 pScrn->display->virtualX = (pScrn->display->virtualX + 7) & ~7;503 504 499 /* Create a builtin mode for every specified mode. This allows to specify arbitrary 505 500 * screen resolutions */ … … 511 506 512 507 sscanf(pScrn->display->modes[i], "%dx%d", &x, &y); 513 /* sanity check, smaller resolutions does not make sense */514 if (x < 64 || y < 64)515 {516 xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Ignoring mode \"%s\"\n",517 pScrn->display->modes[i]);518 continue;519 }520 508 m = xnfcalloc(sizeof(DisplayModeRec), 1); 521 509 m->status = MODE_OK; … … 533 521 } 534 522 523 /* Set a sane minimum mode size and the maximum allowed by the available VRAM */ 524 { 525 unsigned maxSize, trySize = 512; 526 527 do { 528 maxSize = trySize; 529 trySize += 128; 530 } while (trySize * trySize * pScrn->bitsPerPixel / 8 < pScrn->videoRam * 1024); 531 532 /* I don't know exactly what these are for (and they are only used in a couple 533 of places in the X server code). */ 534 pScrn->display->virtualX = maxSize; 535 pScrn->display->virtualY = maxSize; 536 xf86DrvMsg(pScrn->scrnIndex, X_INFO, 537 "The maximum supported resolution is currently %dx%d\n", maxSize, maxSize); 538 } 539 535 540 /* Filter out video modes not supported by the virtual hardware 536 we described. All modes used by the Windows additions should 537 work fine. */ 541 we described. */ 538 542 i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, 539 543 pScrn->display->modes, 540 clockRanges, NULL, 0, 6400, 1, 0, 1440, 541 pScrn->display->virtualX, 542 pScrn->display->virtualY, 543 pScrn->videoRam, LOOKUP_BEST_REFRESH); 544 clockRanges, NULL, 64, pScrn->display->virtualX, 1, 545 64, pScrn->display->virtualY, 0, 0, 546 pScrn->videoRam * 1024, LOOKUP_BEST_REFRESH); 544 547 545 548 if (i <= 0) { … … 554 557 xf86PrintModes(pScrn); 555 558 556 /* Set display resolution. This was arbitrarily chosen to be about the same as my monitor. */557 xf86SetDpi(pScrn, 100, 100);559 /* Set display resolution. Perhaps we should read this from the host. */ 560 xf86SetDpi(pScrn, 96, 96); 558 561 559 562 if (pScrn->modes == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.