[PATCH] Xserver need not be compatible with old versions of xserver.

Aaron Plattner aplattner at nvidia.com
Fri Sep 17 09:24:13 PDT 2010


Reviewed-by: Aaron Plattner <aplattner at nvidia.com>

I think Gaetan purged the last of that code from the drivers recently.  At
least he did for nv:

http://cgit.freedesktop.org/xorg/driver/xf86-video-nv/commit/?id=6d2431a37ffd7a976e9046424a6c1f3c47ded2df

I think you can also delete the RANDR_12_INTERFACE ifdefs, since this code
only runs in the server now.  Plus I'll bet there's a lot of support code
that can go away.

I wonder if any of this will come back to bite anyone when we get to
xserver 7.0.  :)

On Fri, Sep 17, 2010 at 08:53:45AM -0700, Jamey Sharp wrote:
> Delete time-traveling multiple personality disorder from the server.
> 
> Gaetan notes:
> 
>     There were a couple of drivers containing an unknown version of the
>     modes/parser code. This was done in server 1.2 time frame because it
>     was released without mode code. It was barely or not maintained
>     afterwards. There are currently no video drivers with a copy of the
>     modes code.
> 
> Most of these ifdefs were introduced in commit
> a8d760f567b19268329c4682495caa591f08a854, where Aaron wrote,
> 
>     This change uses XORG_VERSION_CURRENT < 7.0 to mean "server newer
>     than 1.2" since XORG_VERSION current went backwards at some point.
> 
> Alan explains that:
> 
>     In Xorg 1.3, when we first released an Xorg server release decoupled
>     from the katamari release schedule.  (1.0 through 1.2 were released
>     as part of X11R7.0 through 7.2, while 1.3 came out between X11R7.2 &
>     7.3.)
> 
> Commit by Jamey Sharp and Josh Triplett.
> 
> Signed-off-by: Jamey Sharp <jamey at minilop.net>
> Signed-off-by: Josh Triplett <josh at joshtriplett.org>
> ---
> v2: There was more of this pattern, so delete all of it that I could
>     find; and cover the natural questions in the commit message.
> 
>  hw/xfree86/modes/xf86Cursors.c   |    8 --------
>  hw/xfree86/modes/xf86EdidModes.c |    4 ----
>  hw/xfree86/modes/xf86Modes.c     |   14 --------------
>  hw/xfree86/modes/xf86RandR12.c   |   36 ------------------------------------
>  4 files changed, 0 insertions(+), 62 deletions(-)
> 
> diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
> index 6b2ae97..ab07b60 100644
> --- a/hw/xfree86/modes/xf86Cursors.c
> +++ b/hw/xfree86/modes/xf86Cursors.c
> @@ -227,11 +227,7 @@ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
>      CursorPtr		cursor = xf86_config->cursor;
>      int			c;
>      CARD8		*bits = cursor ?
> -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
>          dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen))
> -#else
> -        cursor->devPriv[screen->myNum]
> -#endif
>        : NULL;
>  
>      /* Save ARGB versions of these colors */
> @@ -630,11 +626,7 @@ xf86_reload_cursors (ScreenPtr screen)
>  
>      if (cursor)
>      {
> -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
>  	void *src = dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen));
> -#else
> -	void *src = cursor->devPriv[screen->myNum];
> -#endif
>  #ifdef ARGB_CURSOR
>  	if (cursor->bits->argb && cursor_info->LoadCursorARGB)
>  	    (*cursor_info->LoadCursorARGB) (scrn, cursor);
> diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
> index 8f4d04f..c367749 100644
> --- a/hw/xfree86/modes/xf86EdidModes.c
> +++ b/hw/xfree86/modes/xf86EdidModes.c
> @@ -636,7 +636,6 @@ 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)
>  {
> @@ -665,7 +664,6 @@ DDCModesFromCVT(int scrnIndex, struct cvt_timings *t)
>  
>      return modes;
>  }
> -#endif
>  
>  static const struct {
>      short w;
> @@ -1021,12 +1019,10 @@ static void handle_detailed_modes(struct detailed_monitor_section *det_mon,
>                                            p->quirks, p->timing_level,p->rb);
>          p->Modes = xf86ModesAdd(p->Modes, Mode);
>          break;
> -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
>      case DS_CVT:
>          Mode = DDCModesFromCVT(p->DDC->scrnIndex, det_mon->section.cvt);
>          p->Modes = xf86ModesAdd(p->Modes, Mode);
>          break;
> -#endif
>      case DS_EST_III:
>  	Mode = DDCModesFromEstIII(det_mon->section.est_iii);
>  	p->Modes = xf86ModesAdd(p->Modes, Mode);
> diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
> index 05f4319..51eb4c9 100644
> --- a/hw/xfree86/modes/xf86Modes.c
> +++ b/hw/xfree86/modes/xf86Modes.c
> @@ -38,14 +38,6 @@
>  
>  extern XF86ConfigPtr xf86configptr;
>  
> -/*
> - * This is the version number where we epoched.  These files get copied
> - * into drivers that want to use this setup infrastructure on pre-1.3
> - * servers, so when that happens they need to define these symbols
> - * themselves.  However, _in_ the server, we basically always define them now.
> - */
> -#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,2,99,2,0)
> -
>  /**
>   * Calculates the horizontal sync rate of a mode.
>   */
> @@ -326,7 +318,6 @@ xf86PrintModeline(int scrnIndex,DisplayModePtr mode)
>  		   mode->VTotal, flags, xf86ModeHSync(mode));
>      free(flags);
>  }
> -#endif /* XORG_VERSION_CURRENT <= 7.2.99.2 */
>  
>  /**
>   * Marks as bad any modes with unsupported flags.
> @@ -503,12 +494,7 @@ 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 043ceee..dd2bdac 100644
> --- a/hw/xfree86/modes/xf86RandR12.c
> +++ b/hw/xfree86/modes/xf86RandR12.c
> @@ -69,21 +69,12 @@ static Bool xf86RandR12CreateScreenResources12 (ScreenPtr pScreen);
>  #endif
>  
>  static int xf86RandR12Generation;
> -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
>  
>  static DevPrivateKeyRec xf86RandR12KeyRec;
>  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)
> @@ -690,17 +681,13 @@ xf86RandR12ScreenSetSize (ScreenPtr	pScreen,
>      Bool		ret = FALSE;
>      int                 c;
>  
> -#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);
>  
> @@ -843,10 +830,8 @@ 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)
>      {
> @@ -882,13 +867,9 @@ xf86RandR12Init (ScreenPtr pScreen)
>      if (xf86RandR12Generation != serverGeneration)
>  	xf86RandR12Generation = serverGeneration;
>  
> -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
>      xf86RandR12Key = &xf86RandR12KeyRec;
>      if (!dixRegisterPrivateKey(&xf86RandR12KeyRec, PRIVATE_SCREEN, 0))
>  	return FALSE;
> -#else
> -    xf86RandR12Index = AllocateScreenPrivateIndex();
> -#endif
>  
>      randrp = malloc(sizeof (XF86RandRInfoRec));
>      if (!randrp)
> @@ -914,11 +895,7 @@ 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))
> @@ -932,10 +909,8 @@ xf86RandR12CloseScreen (ScreenPtr pScreen)
>  {
>      XF86RandRInfoPtr	randrp;
>  
> -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
>      if (xf86RandR12Key == NULL)
>  	return;
> -#endif
>  
>      randrp = XF86RANDRINFO(pScreen);
>  #if RANDR_12_INTERFACE
> @@ -955,10 +930,8 @@ 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
> @@ -981,10 +954,8 @@ xf86RandR12SetTransformSupport (ScreenPtr pScreen, Bool transforms)
>      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_13_INTERFACE
> @@ -1599,10 +1570,8 @@ 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);
> @@ -1624,13 +1593,8 @@ 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++)
> -- 
> 1.7.0
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list