VirtualBox

Ignore:
Timestamp:
Oct 26, 2010 11:39:37 AM (14 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: remove the requirement that horizontal resolutions are multiples of eight pixels where it is not needed

File:
1 edited

Legend:

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

    r32692 r33460  
    202202
    203203    TRACE_LOG("width=%d, height=%d\n", width, height);
    204     /* We only support horizontal resolutions which are a multiple of 8.
    205      * Round up if necessary. */
    206     width = (width + 7) & ~7;
    207204    if (width * height * bpp / 8 >= scrn->videoRam * 1024)
    208205    {
     
    261258vbox_crtc_mode_fixup (xf86CrtcPtr crtc, DisplayModePtr mode,
    262259                      DisplayModePtr adjusted_mode)
    263 {
    264     ScrnInfoPtr pScrn = crtc->scrn;
    265     int xRes = adjusted_mode->HDisplay;
    266 
    267     (void) mode;
    268     TRACE_LOG("name=%s, HDisplay=%d, VDisplay=%d\n", adjusted_mode->name,
    269            adjusted_mode->HDisplay, adjusted_mode->VDisplay);
    270     /* We only support horizontal resolutions which are a multiple of 8.  Round down if
    271        necessary. */
    272     if (xRes % 8 != 0)
    273     {
    274         xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
    275                    "VirtualBox only supports screen widths which are a multiple of 8.  Rounding down from %d to %d\n",
    276                    xRes, xRes - (xRes % 8));
    277         adjusted_mode->HDisplay = xRes - (xRes % 8);
    278     }
    279     return TRUE;
    280 }
     260{ (void) crtc; (void) mode; (void) adjusted_mode; return TRUE; }
    281261
    282262static void
     
    379359
    380360static void
    381 vbox_output_add_mode (DisplayModePtr *pModes, const char *pszName, int x, int y,
     361vbox_output_add_mode (VBOXPtr pVBox, DisplayModePtr *pModes,
     362                      const char *pszName, int x, int y,
    382363                      Bool isPreferred, Bool isUserDef)
    383364{
     
    391372    if (isPreferred)
    392373        pMode->type     |= M_T_PREFERRED;
    393     /* VBox only supports screen widths which are a multiple of 8 */
    394     pMode->HDisplay      = (x + 7) & ~7;
     374    /* Older versions of VBox only support screen widths which are a multiple
     375     * of 8 */
     376    if (pVBox->fAnyX)
     377        pMode->HDisplay  = x;
     378    else
     379        pMode->HDisplay  = x & ~7;
    395380    pMode->HSyncStart    = pMode->HDisplay + 2;
    396381    pMode->HSyncEnd      = pMode->HDisplay + 4;
     
    428413        if (!rc || (0 == x) || (0 == y))
    429414            rc = vboxRetrieveVideoMode(pScrn, &x, &y, &bpp);
    430         if (rc && (0 != x) && (0 != y)) {
    431             /* We prefer a slightly smaller size to a slightly larger one */
    432             x -= (x % 8);
    433             vbox_output_add_mode(&pModes, NULL, x, y, TRUE, FALSE);
    434         }
     415        if (rc && (0 != x) && (0 != y))
     416            vbox_output_add_mode(pVBox, &pModes, NULL, x, y, TRUE, FALSE);
    435417    }
    436418    /* Also report any modes the user may have requested in the xorg.conf
     
    440422        int x, y;
    441423        if (2 == sscanf(pScrn->display->modes[i], "%dx%d", &x, &y))
    442             vbox_output_add_mode(&pModes, pScrn->display->modes[i], x, y,
     424            vbox_output_add_mode(pVBox, &pModes, pScrn->display->modes[i], x, y,
    443425                                 FALSE, TRUE);
    444426    }
     
    667649    rgb rzeros = {0, 0, 0};
    668650    xf86OutputPtr output;
     651    unsigned DispiId;
    669652
    670653    /* Are we really starting the server, or is this just a dummy run? */
     
    733716       sized video RAM configurations */
    734717    pScrn->videoRam = inl(VBE_DISPI_IOPORT_DATA) / 1024;
     718
     719    /* Check if the chip restricts horizontal resolution or not. */
     720    outw(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     721    outw(VBE_DISPI_IOPORT_DATA, VBE_DISPI_ID_ANYX);
     722    DispiId = inw(VBE_DISPI_IOPORT_DATA);
     723    if (DispiId == VBE_DISPI_ID_ANYX)
     724        pVBox->fAnyX = TRUE;
     725    else
     726        pVBox->fAnyX = FALSE;
    735727
    736728    /* Query the host for the preferred colour depth */
     
    898890
    899891    /* Needed before we initialise DRI. */
    900     pScrn->virtualX = (pScrn->virtualX + 7) & ~7;
    901892    pScrn->displayWidth = pScrn->virtualX;
    902893
Note: See TracChangeset for help on using the changeset viewer.

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