- Timestamp:
- Jun 25, 2007 9:42:44 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/xgraphics/vboxvideo_70.c
r3268 r3270 93 93 static Bool VBOXSaveScreen(ScreenPtr pScreen, int mode); 94 94 static Bool VBOXSwitchMode(int scrnIndex, DisplayModePtr pMode, int flags); 95 static ModeStatus VBOXValidMode(int scrn, DisplayModePtr p, Bool flag, int pass);96 95 static Bool VBOXSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode); 97 96 static void VBOXAdjustFrame(int scrnIndex, int x, int y, int flags); … … 311 310 pScrn->ScreenInit = VBOXScreenInit; 312 311 pScrn->SwitchMode = VBOXSwitchMode; 313 pScrn->ValidMode = VBOXValidMode;314 312 pScrn->AdjustFrame = VBOXAdjustFrame; 315 313 pScrn->EnterVT = VBOXEnterVT; … … 782 780 } 783 781 784 /**785 * Quoted from "How to add an (S)VGA driver to XFree86"786 * (http://www.xfree86.org/3.3.6/VGADriver.html):787 *788 * The ValidMode() function is required. It is used to check for any789 * chipset-dependent reasons why a graphics mode might not be valid. It gets790 * called by higher levels of the code after the Probe() stage. In many cases791 * no special checking will be required and this function will simply return792 * TRUE always.793 *794 * Note: we check here that our generated video modes fulfil the X server's795 * criteria for the monitor, since this can otherwise cause problems in796 * randr 1.2.797 */798 static ModeStatus799 VBOXValidMode(int scrn, DisplayModePtr p, Bool flag, int pass)800 {801 static int warned = 0;802 ScrnInfoPtr pScrn = xf86Screens[scrn];803 MonPtr mon = pScrn->monitor;804 ModeStatus ret = MODE_BAD;805 DisplayModePtr mode;806 float v;807 808 if (pass != MODECHECK_FINAL) {809 if (!warned) {810 xf86DrvMsg(scrn, X_WARNING, "VBOXValidMode called unexpectedly\n");811 warned = 1;812 }813 }814 /*815 * First off, if this isn't a mode we handed to the server (ie,816 * M_T_BUILTIN), then we reject it out of hand.817 */818 if (!(p->type & M_T_BUILTIN))819 return MODE_NOMODE;820 /*821 * Finally, walk through the vsync rates 1Hz at a time looking for a mode822 * that will fit. This is assuredly a terrible way to do this, but823 * there's no obvious method for computing a mode of a given size that824 * will pass xf86CheckModeForMonitor.825 */826 for (v = mon->vrefresh[0].lo; v <= mon->vrefresh[0].hi; v++) {827 mode = xf86CVTMode(p->HDisplay, p->VDisplay, v, 0, 0);828 ret = xf86CheckModeForMonitor(mode, mon);829 xfree(mode);830 if (ret == MODE_OK)831 break;832 }833 834 if (ret != MODE_OK)835 {836 xf86DrvMsg(scrn, X_WARNING, "Graphics mode %s rejected by the X server\n", p->name);837 }838 return ret;839 }840 841 782 static Bool 842 783 VBOXSwitchMode(int scrnIndex, DisplayModePtr pMode, int flags)
Note:
See TracChangeset
for help on using the changeset viewer.