VirtualBox

Changeset 55194 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Apr 10, 2015 8:56:43 PM (10 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: remove standard modes. For old X servers modes can still be added using xorg.conf.

Location:
trunk/src/VBox/Additions/x11/vboxvideo
Files:
3 edited

Legend:

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

    r55191 r55194  
    9999}
    100100
    101 /** vboxvideo's list of standard video modes */
    102 struct
    103 {
    104     /** mode width */
    105     uint32_t cx;
    106     /** mode height */
    107     uint32_t cy;
    108 } vboxStandardModes[] =
    109 {
    110     { 1600, 1200 },
    111     { 1440, 1050 },
    112     { 1280, 960 },
    113     { 1024, 768 },
    114     { 800, 600 },
    115     { 640, 480 },
    116     { 0, 0 }
    117 };
    118 enum
    119 {
    120     vboxNumStdModes = sizeof(vboxStandardModes) / sizeof(vboxStandardModes[0])
    121 };
    122 
    123 /**
    124  * Returns a standard mode which the host likes.  Can be called multiple
    125  * times with the index returned by the previous call to get a list of modes.
    126  * @returns  the index of the mode in the list, or 0 if no more modes are
    127  *           available
    128  * @param    pScrn   the screen information structure
    129  * @param    pScrn->bitsPerPixel
    130  *                   if this is non-null, only modes with this BPP will be
    131  *                   returned
    132  * @param    cIndex  the index of the last mode queried, or 0 to query the
    133  *                   first mode available.  Note: the first index is 1
    134  * @param    pcx     where to store the mode's width
    135  * @param    pcy     where to store the mode's height
    136  * @param    pcBits  where to store the mode's BPP
    137  */
    138 unsigned vboxNextStandardMode(ScrnInfoPtr pScrn, unsigned cIndex,
    139                               uint32_t *pcx, uint32_t *pcy)
    140 {
    141     unsigned i;
    142 
    143     VBVXASSERT(cIndex < vboxNumStdModes,
    144                ("cIndex = %d, vboxNumStdModes = %d\n", cIndex,
    145                 vboxNumStdModes));
    146     for (i = cIndex; i < vboxNumStdModes - 1; ++i)
    147     {
    148         uint32_t cx = vboxStandardModes[i].cx;
    149         uint32_t cy = vboxStandardModes[i].cy;
    150 
    151         if (pcx)
    152             *pcx = cx;
    153         if (pcy)
    154             *pcy = cy;
    155         return i + 1;
    156     }
    157     return 0;
    158 }
    159 
    160101/**
    161102 * Allocates an empty display mode and links it into the doubly linked list of
     
    188129 * of the graphics modes that we wish to support, that is:
    189130 *  - A dynamic mode in first place which will be updated by the RandR code.
    190  *  - Several standard modes.
    191131 *  - Any modes that the user requested in xorg.conf/XFree86Config.
    192132 */
     
    203143    pMode = vboxAddEmptyScreenMode(pScrn);
    204144    vboxFillDisplayMode(pScrn, pMode, NULL, 1024, 768);
    205     /* Add standard modes supported by the host */
    206     for ( ; ; )
    207     {
    208         cIndex = vboxNextStandardMode(pScrn, cIndex, &cx, &cy);
    209         if (cIndex == 0)
    210             break;
    211         pMode = vboxAddEmptyScreenMode(pScrn);
    212         vboxFillDisplayMode(pScrn, pMode, NULL, cx, cy);
    213     }
    214     /* And finally any modes specified by the user.  We assume here that
    215      * the mode names reflect the mode sizes. */
     145    /* Add any modes specified by the user.  We assume here that the mode names
     146     * reflect the mode sizes. */
    216147    for (i = 0; pScrn->display->modes && pScrn->display->modes[i]; i++)
    217148    {
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r55191 r55194  
    502502                                 pVBox->pScreens[iScreen].aPreferredSize.cy, TRUE, FALSE);
    503503    VBOXEDIDSet(output, pMode);
    504     /* Add standard modes supported by the host */
    505     for ( ; ; )
    506     {
    507         cIndex = vboxNextStandardMode(pScrn, cIndex, &x, &y);
    508         if (cIndex == 0)
    509             break;
    510         vbox_output_add_mode(pVBox, &pModes, NULL, x, y, FALSE, FALSE);
    511     }
    512504
    513505    /* Also report any modes the user may have requested in the xorg.conf
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h

    r55192 r55194  
    255255
    256256/* getmode.c */
    257 extern unsigned vboxNextStandardMode(ScrnInfoPtr pScrn, unsigned cIndex,
    258                                      uint32_t *pcx, uint32_t *pcy);
    259257extern void vboxAddModes(ScrnInfoPtr pScrn);
    260258extern void VBoxInitialiseSizeHints(ScrnInfoPtr pScrn);
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