diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2008-03-02 20:13:11 -0800 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2008-03-06 14:42:00 -0800 |
commit | a8d760f567b19268329c4682495caa591f08a854 (patch) | |
tree | 2866f22e1319b4851c48312aaa8b0a827fda97e8 | |
parent | ca616b902b2c5d0f046c7a042c11f045479e373a (diff) |
Get modes code building with old X servers again.
This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer than 1.2"
since XORG_VERSION current went backwards at some point.
-rw-r--r-- | hw/xfree86/modes/xf86Cursors.c | 16 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86EdidModes.c | 4 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Modes.c | 5 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 35 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86gtf.c | 4 |
5 files changed, 60 insertions, 4 deletions
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 5a4d0f6fa..08cf78d82 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -226,8 +226,13 @@ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg) xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); CursorPtr cursor = xf86_config->cursor; int c; - CARD8 *bits = cursor ? dixLookupPrivate(&cursor->devPrivates, - screen) : NULL; + CARD8 *bits = cursor ? +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) + dixLookupPrivate(&cursor->devPrivates, screen) +#else + cursor->devPriv[screen->myNum] +#endif + : NULL; /* Save ARGB versions of these colors */ xf86_config->cursor_fg = (CARD32) fg | 0xff000000; @@ -613,7 +618,12 @@ xf86_reload_cursors (ScreenPtr screen) else #endif (*cursor_info->LoadCursorImage)(cursor_info->pScrn, - dixLookupPrivate(&cursor->devPrivates, screen)); +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) + dixLookupPrivate(&cursor->devPrivates, screen) +#else + cursor->devPriv[screen->myNum] +#endif + ); (*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y); (*cursor_info->ShowCursor)(cursor_info->pScrn); diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index ea36d0a59..2d1a6abd2 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -410,6 +410,7 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, return Mode; } +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) static DisplayModePtr DDCModesFromCVT(int scrnIndex, struct cvt_timings *t) { @@ -438,6 +439,7 @@ DDCModesFromCVT(int scrnIndex, struct cvt_timings *t) return modes; } +#endif /* @@ -621,10 +623,12 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) quirks, timing_level); Modes = xf86ModesAdd(Modes, Mode); break; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) case DS_CVT: Mode = DDCModesFromCVT(scrnIndex, det_mon->section.cvt); Modes = xf86ModesAdd(Modes, Mode); break; +#endif default: break; } diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 9e3151254..aa2635c48 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -513,7 +513,12 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList, for (mode = modeList; mode != NULL; mode = mode->next) { if (xf86ModeBandwidth(mode, depth) > bandwidth) +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) mode->status = MODE_BANDWIDTH; +#else + /* MODE_BANDWIDTH didn't exist in xserver 1.2 */ + mode->status = MODE_BAD; +#endif } } diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 8b13758af..816175cc3 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -60,11 +60,21 @@ static Bool xf86RandR12CreateScreenResources12 (ScreenPtr pScreen); #endif static int xf86RandR12Generation; -static DevPrivateKey xf86RandR12Key; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) +static DevPrivateKey xf86RandR12Key; #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \ dixLookupPrivate(&(p)->devPrivates, xf86RandR12Key)) +#else /* XORG_VERSION_CURRENT < 7.0 */ + +static int xf86RandR12Index; +#define XF86RANDRINFO(p) \ + ((XF86RandRInfoPtr)(p)->devPrivates[xf86RandR12Index].ptr) + +#endif /* XORG_VERSION_CURRENT < 7.0 */ + + static int xf86RandR12ModeRefresh (DisplayModePtr mode) { @@ -340,13 +350,17 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen); Bool ret = FALSE; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) if (xf86RandR12Key) { +#endif if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; } +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) } +#endif if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); @@ -468,8 +482,10 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) mmHeight); } +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) if (xf86RandR12Key == NULL) return TRUE; +#endif if (randrp->virtualX == -1 || randrp->virtualY == -1) { @@ -500,7 +516,11 @@ xf86RandR12Init (ScreenPtr pScreen) if (xf86RandR12Generation != serverGeneration) xf86RandR12Generation = serverGeneration; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) xf86RandR12Key = &xf86RandR12Key; +#else + xf86RandR12Index = AllocateScreenPrivateIndex(); +#endif randrp = xalloc (sizeof (XF86RandRInfoRec)); if (!randrp) @@ -526,7 +546,11 @@ xf86RandR12Init (ScreenPtr pScreen) randrp->maxX = randrp->maxY = 0; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) dixSetPrivate(&pScreen->devPrivates, xf86RandR12Key, randrp); +#else + pScreen->devPrivates[xf86RandR12Index].ptr = randrp; +#endif #if RANDR_12_INTERFACE if (!xf86RandR12Init12 (pScreen)) @@ -545,8 +569,10 @@ xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); #endif +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) if (xf86RandR12Key == NULL) return; +#endif randrp = XF86RANDRINFO(pScreen); #if RANDR_12_INTERFACE @@ -1090,8 +1116,10 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) if (xf86RandR12Key == NULL) return TRUE; +#endif for (c = 0; c < config->num_crtc; c++) xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc); @@ -1113,8 +1141,13 @@ xf86RandR12TellChanged (ScreenPtr pScreen) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0) if (xf86RandR12Key == NULL) return; +#else + if (!XF86RANDRINFO(pScreen)) + return; +#endif xf86RandR12SetInfo12 (pScreen); for (c = 0; c < config->num_crtc; c++) diff --git a/hw/xfree86/modes/xf86gtf.c b/hw/xfree86/modes/xf86gtf.c index acbac83b6..fed56bd12 100644 --- a/hw/xfree86/modes/xf86gtf.c +++ b/hw/xfree86/modes/xf86gtf.c @@ -62,6 +62,10 @@ #ifdef HAVE_XORG_CONFIG_H # include <xorg-config.h> +#else +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #endif #include "xf86.h" |