VirtualBox

Changeset 22089 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Aug 7, 2009 9:00:23 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50838
Message:

Additions/x11/vboxvideo_13: merged back vboxvideo_15 parts of r50005: Additions/x11/vboxvideo: fix initial display corruption with large amounts of virtual video RAM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo_13.c

    r22088 r22089  
    206206
    207207    TRACE_LOG("width=%d, height=%d\n", width, height);
    208     /* We only support horizontal resolutions which are a multiple of 8.  Round down if
    209        necessary. */
    210     if (width % 8 != 0)
    211     {
    212         xf86DrvMsg(scrn->scrnIndex, X_WARNING,
    213                    "VirtualBox only supports virtual screen widths which are a multiple of 8.  Rounding down from %d to %d\n",
    214                    width, width - (width % 8));
    215         width = width - (width % 8);
    216     }
     208    /* We only support horizontal resolutions which are a multiple of 8.
     209     * Round up if necessary. */
     210    width = (width + 7) & ~7;
    217211    if (width * height * bpp / 8 >= scrn->videoRam * 1024)
    218212    {
     
    854848    output = xf86OutputCreate(pScrn, &VBOXOutputFuncs, "VBOX1");
    855849
    856     /* Set a sane minimum mode size and the maximum allowed by the available VRAM */
    857     {
    858 #if 0
    859         unsigned maxSize, trySize = 512;
    860 
    861         do {
    862             maxSize = trySize;
    863             trySize += 128;
    864         } while (trySize * trySize * pScrn->bitsPerPixel / 8 < pScrn->videoRam * 1024);
    865 #else
    866         unsigned maxSize = 32000;
    867 #endif
    868 
    869         xf86CrtcSetSizeRange(pScrn, 64, 64, maxSize, maxSize);
    870 
    871         /* I don't know exactly what these are for (and they are only used in a couple
    872            of places in the X server code), but due to a bug in RandR 1.2 they place
    873            an upper limit on possible resolutions.  To add to the fun, they get set
    874            automatically if we don't do it ourselves. */
    875         pScrn->display->virtualX = maxSize;
    876         pScrn->display->virtualY = maxSize;
    877         xf86DrvMsg(pScrn->scrnIndex, X_INFO,
    878                    "The maximum supported resolution is currently %dx%d\n", maxSize, maxSize);
    879     }
     850    /* Set a sane minimum and maximum mode size */
     851    xf86CrtcSetSizeRange(pScrn, 64, 64, 32000, 32000);
    880852
    881853    /* We are not interested in the monitor section in the configuration file. */
     
    991963
    992964    /* Needed before we initialise DRI. */
     965    pScrn->virtualX = (pScrn->virtualX + 7) & ~7;
    993966    pScrn->displayWidth = pScrn->virtualX;
    994967
     
    12621235
    12631236    int bpp = pScrn->depth == 24 ? 32 : 16;
    1264     TRACE_LOG("HDisplay=%d, VDisplay=%d\n", pMode->HDisplay, pMode->VDisplay);
     1237    TRACE_LOG("HDisplay=%d, VDisplay=%d, displayWidth=%d\n",
     1238              pMode->HDisplay, pMode->VDisplay, pScrn->displayWidth);
    12651239    pVBox = VBOXGetRec(pScrn);
    12661240    /* Don't fiddle with the hardware if we are switched
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette