VirtualBox

Changeset 9826 in vbox


Ignore:
Timestamp:
Jun 19, 2008 4:06:49 PM (17 years ago)
Author:
vboxsync
Message:

Additions/x11: make the Xorg 1.3+ Additions handle modes specified by the user in xorg.conf

Location:
trunk/src/VBox/Additions/x11/xgraphics
Files:
2 edited

Legend:

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

    r9811 r9826  
    352352    int rc = MODE_OK;
    353353    TRACE3("HDisplay=%d, VDisplay=%d\n", mode->HDisplay, mode->VDisplay);
    354     if (   vbox_device_available(VBOXGetRec(pScrn))
     354    /* We always like modes specified by the user in the configuration
     355     * file, as doing otherwise is likely to annoy people. */
     356    if (   !(mode->type & M_T_USERDEF)
     357        && vbox_device_available(VBOXGetRec(pScrn))
    355358        && !vboxHostLikesVideoMode(pScrn, mode->HDisplay,
    356359                                   mode->VDisplay, pScrn->bitsPerPixel)
     
    381384static void
    382385vbox_output_add_mode (DisplayModePtr *pModes, const char *pszName, int x, int y,
    383                       Bool isPreferred)
     386                      Bool isPreferred, Bool isUserDef)
    384387{
    385388    TRACE3("pszName=%s, x=%d, y=%d\n", pszName, x, y);
     
    387390
    388391    pMode->status        = MODE_OK;
    389     pMode->type          = isPreferred ? M_T_PREFERRED : M_T_BUILTIN;
     392    /* We don't ask the host whether it likes user defined modes,
     393     * as we assume that the user really wanted that mode. */
     394    pMode->type          = isUserDef ? M_T_USERDEF : M_T_BUILTIN;
     395    if (isPreferred)
     396        pMode->type     |= M_T_PREFERRED;
    390397    /* VBox only supports screen widths which are a multiple of 8 */
    391398    pMode->HDisplay      = (x + 7) & ~7;
     
    411418    uint32_t x, y, bpp, display;
    412419    bool rc;
     420    unsigned i;
    413421    DisplayModePtr pModes = NULL;
    414422    ScrnInfoPtr pScrn = output->scrn;
     
    433441            /* We prefer a slightly smaller size to a slightly larger one */
    434442            x -= (x % 8);
    435             vbox_output_add_mode(&pModes, NULL, x, y, TRUE);
     443            vbox_output_add_mode(&pModes, NULL, x, y, TRUE, FALSE);
    436444        }
    437445    }
     446    /* Also report any modes the user may have requested in the xorg.conf
     447     * configuration file. */
     448    for (i = 0; pScrn->display->modes[i] != NULL; i++)
     449        if (2 == sscanf(pScrn->display->modes[i], "%dx%d", &x, &y))
     450            vbox_output_add_mode(&pModes, pScrn->display->modes[i], x, y,
     451                                 FALSE, TRUE);
     452   
    438453    TRACE2;
    439454    return pModes;
  • trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_15.c

    r9811 r9826  
    385385    int rc = MODE_OK;
    386386    TRACE3("HDisplay=%d, VDisplay=%d\n", mode->HDisplay, mode->VDisplay);
    387     if (   vbox_device_available(VBOXGetRec(pScrn))
     387    /* We always like modes specified by the user in the configuration
     388     * file, as doing otherwise is likely to annoy people. */
     389    if (   !(mode->type & M_T_USERDEF)
     390        && vbox_device_available(VBOXGetRec(pScrn))
    388391        && !vboxHostLikesVideoMode(pScrn, mode->HDisplay, mode->VDisplay,
    389392                                   pScrn->bitsPerPixel)
     
    414417static void
    415418vbox_output_add_mode (DisplayModePtr *pModes, const char *pszName, int x, int y,
    416                       Bool isPreferred)
     419                      Bool isPreferred, Bool isUserDef)
    417420{
    418421    TRACE3("pszName=%s, x=%d, y=%d\n", pszName, x, y);
     
    420423
    421424    pMode->status        = MODE_OK;
    422     pMode->type          = isPreferred ? M_T_PREFERRED : M_T_BUILTIN;
     425    /* We don't ask the host whether it likes user defined modes,
     426     * as we assume that the user really wanted that mode. */
     427    pMode->type          = isUserDef ? M_T_USERDEF : M_T_BUILTIN;
     428    if (isPreferred)
     429        pMode->type     |= M_T_PREFERRED;
    423430    /* VBox only supports screen widths which are a multiple of 8 */
    424431    pMode->HDisplay      = (x + 7) & ~7;
     
    444451    uint32_t x, y, bpp, display;
    445452    bool rc;
     453    unsigned i;
    446454    DisplayModePtr pModes = NULL;
    447455    ScrnInfoPtr pScrn = output->scrn;
     
    460468            /* We prefer a slightly smaller size to a slightly larger one */
    461469            x -= (x % 8);
    462             vbox_output_add_mode(&pModes, NULL, x, y, TRUE);
     470            vbox_output_add_mode(&pModes, NULL, x, y, TRUE, FALSE);
    463471        }
    464472    }
     473    /* Also report any modes the user may have requested in the xorg.conf
     474     * configuration file. */
     475    for (i = 0; pScrn->display->modes[i] != NULL; i++)
     476        if (2 == sscanf(pScrn->display->modes[i], "%dx%d", &x, &y))
     477            vbox_output_add_mode(&pModes, pScrn->display->modes[i], x, y,
     478                                 FALSE, TRUE);
    465479    TRACE2;
    466480    return pModes;
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