VirtualBox

Changeset 3246 in vbox


Ignore:
Timestamp:
Jun 23, 2007 5:24:37 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22265
Message:

Added and additional xorg server header file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/xgraphics/vboxvideo.c

    r3057 r3246  
    5050 * Conectiva Linux.
    5151 *
    52  * Authors: Paulo Car Pereira de Andrade <[email protected]>
     52 * Authors: Paulo César Pereira de Andrade <[email protected]>
    5353 */
    5454
     
    6666#include "vboxvideo.h"
    6767#include "version-generated.h"
     68#include <xf86.h>
    6869
    6970/* All drivers initialising the SW cursor need this */
     
    9495static Bool VBOXSaveScreen(ScreenPtr pScreen, int mode);
    9596static Bool VBOXSwitchMode(int scrnIndex, DisplayModePtr pMode, int flags);
     97static ModeStatus VBOXValidMode(int scrn, DisplayModePtr p, Bool flag, int pass);
    9698static Bool VBOXSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode);
    9799static void VBOXAdjustFrame(int scrnIndex, int x, int y, int flags);
     
    298300VBOXIdentify(int flags)
    299301{
    300     xf86PrintChipsets(VBOX_NAME, "guest driver for VBox", VBOXChipsets);
     302    xf86PrintChipsets(VBOX_NAME, "guest driver for VirtualBox", VBOXChipsets);
    301303}
    302304
     
    346348                        pScrn->ScreenInit    = VBOXScreenInit;
    347349                        pScrn->SwitchMode    = VBOXSwitchMode;
     350                        pScrn->ValidMode     = VBOXValidMode;
    348351                        pScrn->AdjustFrame   = VBOXAdjustFrame;
    349352                        pScrn->EnterVT       = VBOXEnterVT;
     
    820823    pScreen->CloseScreen = pVBox->CloseScreen;
    821824    return pScreen->CloseScreen(scrnIndex, pScreen);
     825}
     826
     827/**
     828 * Quoted from "How to add an (S)VGA driver to XFree86"
     829 * (http://www.xfree86.org/3.3.6/VGADriver.html):
     830 *
     831 * The ValidMode() function is required. It is used to check for any
     832 * chipset-dependent reasons why a graphics mode might not be valid. It gets
     833 * called by higher levels of the code after the Probe() stage. In many cases
     834 * no special checking will be required and this function will simply return
     835 * TRUE always.
     836 */
     837static ModeStatus
     838VBOXValidMode(int scrn, DisplayModePtr p, Bool flag, int pass)
     839{
     840    static int warned = 0;
     841    ScrnInfoPtr pScrn = xf86Screens[scrn];
     842    MonPtr mon = pScrn->monitor;
     843    ModeStatus ret;
     844    DisplayModePtr mode;
     845    float v;
     846
     847    if (pass != MODECHECK_FINAL) {
     848        if (!warned) {
     849            xf86DrvMsg(scrn, X_WARNING, "VBOXValidMode called unexpectedly\n");
     850            warned = 1;
     851        }
     852    }
     853    /*
     854     * First off, if this isn't a mode we handed to the server (ie,
     855     * M_T_BUILTIN), then we reject it out of hand.
     856     */
     857    if (!(p->type & M_T_BUILTIN))
     858        return MODE_NOMODE;
     859    /*
     860     * Finally, walk through the vsync rates 1Hz at a time looking for a mode
     861     * that will fit.  This is assuredly a terrible way to do this, but
     862     * there's no obvious method for computing a mode of a given size that
     863     * will pass xf86CheckModeForMonitor.
     864     */
     865    for (v = mon->vrefresh[0].lo; v <= mon->vrefresh[0].hi; v++) {
     866        mode = xf86CVTMode(p->HDisplay, p->VDisplay, v, 0, 0);
     867        ret = xf86CheckModeForMonitor(mode, mon);
     868        xfree(mode);
     869        if (ret == MODE_OK)
     870            break;
     871    }
     872
     873    return ret;
    822874}
    823875
Note: See TracChangeset for help on using the changeset viewer.

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