diff options
author | Thomas Winischhofer <thomas@winischhofer.net> | 2005-10-11 19:02:18 +0000 |
---|---|---|
committer | Thomas Winischhofer <thomas@winischhofer.net> | 2005-10-11 19:02:18 +0000 |
commit | d91d18e1d6d663244288748ab86a35a6c151a535 (patch) | |
tree | 19c75c20b7e485e0fdef96560f084025967c83ea /hw/xfree86/common/xf86DGA.c | |
parent | c1a2abadfbb862cbaac3e23d0c1317ce5473ebdd (diff) |
Add DGAReInitModes in order to allow the driver to change the list of
supported DGA modes. (Part 1)
Diffstat (limited to 'hw/xfree86/common/xf86DGA.c')
-rw-r--r-- | hw/xfree86/common/xf86DGA.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 4e47f2eee..0db4ecd10 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -170,6 +170,57 @@ DGAInit( return TRUE; } +/* DGAReInitModes allows the driver to re-initialize + * the DGA mode list. + */ + +Bool +DGAReInitModes( + ScreenPtr pScreen, + DGAModePtr modes, + int num +){ + DGAScreenPtr pScreenPriv; + int i; + + /* No DGA? Ignore call (but don't make it look like it failed) */ + if(DGAScreenIndex < 0) + return TRUE; + + pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); + + /* Same as above */ + if(!pScreenPriv) + return TRUE; + + /* Can't do this while DGA is active */ + if(pScreenPriv->current) + return FALSE; + + /* Quick sanity check */ + if(!num) + modes = NULL; + else if(!modes) + num = 0; + + pScreenPriv->numModes = num; + pScreenPriv->modes = modes; + + /* This practically disables DGA. So be it. */ + if(!num) + return TRUE; + + for(i = 0; i < num; i++) + modes[i].num = i + 1; + +#ifdef PANORAMIX + if(!noPanoramiXExtension) + for(i = 0; i < num; i++) + modes[i].flags &= ~DGA_PIXMAP_AVAILABLE; +#endif + + return TRUE; +} static void FreeMarkedVisuals(ScreenPtr pScreen) |