Changeset 55194 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Apr 10, 2015 8:56:43 PM (10 years ago)
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/getmode.c
r55191 r55194 99 99 } 100 100 101 /** vboxvideo's list of standard video modes */102 struct103 {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 enum119 {120 vboxNumStdModes = sizeof(vboxStandardModes) / sizeof(vboxStandardModes[0])121 };122 123 /**124 * Returns a standard mode which the host likes. Can be called multiple125 * 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 are127 * available128 * @param pScrn the screen information structure129 * @param pScrn->bitsPerPixel130 * if this is non-null, only modes with this BPP will be131 * returned132 * @param cIndex the index of the last mode queried, or 0 to query the133 * first mode available. Note: the first index is 1134 * @param pcx where to store the mode's width135 * @param pcy where to store the mode's height136 * @param pcBits where to store the mode's BPP137 */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 160 101 /** 161 102 * Allocates an empty display mode and links it into the doubly linked list of … … 188 129 * of the graphics modes that we wish to support, that is: 189 130 * - A dynamic mode in first place which will be updated by the RandR code. 190 * - Several standard modes.191 131 * - Any modes that the user requested in xorg.conf/XFree86Config. 192 132 */ … … 203 143 pMode = vboxAddEmptyScreenMode(pScrn); 204 144 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. */ 216 147 for (i = 0; pScrn->display->modes && pScrn->display->modes[i]; i++) 217 148 { -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r55191 r55194 502 502 pVBox->pScreens[iScreen].aPreferredSize.cy, TRUE, FALSE); 503 503 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 }512 504 513 505 /* Also report any modes the user may have requested in the xorg.conf -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r55192 r55194 255 255 256 256 /* getmode.c */ 257 extern unsigned vboxNextStandardMode(ScrnInfoPtr pScrn, unsigned cIndex,258 uint32_t *pcx, uint32_t *pcy);259 257 extern void vboxAddModes(ScrnInfoPtr pScrn); 260 258 extern void VBoxInitialiseSizeHints(ScrnInfoPtr pScrn);
Note:
See TracChangeset
for help on using the changeset viewer.