[PATCH sis] Untangle XF86DRI from the driver-specific DRI define

Peter Hutterer peter.hutterer at who-t.net
Mon Jan 16 21:22:53 PST 2012


On Sat, Jan 14, 2012 at 10:20:03AM +0100, Tormod Volden wrote:
> On Wed, Jan 4, 2012 at 5:14 AM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > XF86DRI is defined by xorg-server.h, so --disable-dri in the sis driver
> > itself does exactly nothing other than not fill in the CFLAGS and thus stop
> > the driver from compiling.
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  configure.ac     |    4 ++--
> >  src/sis.h        |   16 +++++++++++-----
> >  src/sis_dri.c    |    2 +-
> >  src/sis_driver.c |   14 +++++++-------
> >  src/sis_opt.c    |    4 ++--
> >  5 files changed, 23 insertions(+), 17 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 036a448..a599108 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -99,8 +99,8 @@ AC_MSG_RESULT([$DRI])
> >  AM_CONDITIONAL(DRI, test x$DRI = xyes)
> >  if test "$DRI" = yes; then
> >         PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
> > -        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
> > -        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
> > +        AC_DEFINE(SISDRI,1,[Enable DRI driver support])
> > +        AC_DEFINE(SIDDRI_DEVEL,1,[Enable developmental DRI driver support])
> 
> s/SIDDRI_DEVEL/SISDRI_DEVEL I suppose.
> 
> >  fi
> >
> >  # technically this should be a configure flag.  meh.
> > diff --git a/src/sis.h b/src/sis.h
> > index 9af31a5..f2ca3a9 100644
> > --- a/src/sis.h
> > +++ b/src/sis.h
> > @@ -181,7 +181,13 @@
> >
> >  #undef SISHAVEDRMWRITE
> >  #undef SISNEWDRI
> > -#ifdef XF86DRI
> > +
> > +/* if the server was built without DRI support, force-disable DRI */
> > +#ifndef XF86DRI
> > +#undef SISDRI
> > +#endif
> > +
> > +#ifdef SISDRI
> >  #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,3,0)
> >  #define SISHAVEDRMWRITE
> >  #endif
> > @@ -195,7 +201,7 @@
> >  #include "dri.h"
> >  #include "GL/glxint.h"
> >  #include "sis_dri.h"
> > -#endif /* XF86DRI */
> > +#endif /* SISDRI */
> >
> >  /* Configurable stuff: ------------------------------------- */
> >
> > @@ -812,7 +818,7 @@ typedef struct {
> >     ScrnInfoPtr                pScrn_2;
> >     UChar              *BIOS;
> >     struct SiS_Private *SiS_Pr;
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     SISAGPHTYPE                agpHandle;
> >     ULong              agpAddr;
> >     UChar              *agpBase;
> > @@ -1092,7 +1098,7 @@ typedef struct {
> >     unsigned int       cmdQueueSize_div2;
> >     unsigned int       cmdQueueSize_div4;
> >     unsigned int       cmdQueueSize_4_3;
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     SISAGPHTYPE                agpHandle;
> >     ULong              agpAddr;
> >     UChar              *agpBase;
> > @@ -1151,7 +1157,7 @@ typedef struct {
> >
> >     /* DRI */
> >     Bool               loadDRI;
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     Bool               directRenderingEnabled;
> >     DRIInfoPtr                 pDRIInfo;
> >     int                        drmSubFD;
> > diff --git a/src/sis_dri.c b/src/sis_dri.c
> > index 97ed951..d0c4fba 100644
> > --- a/src/sis_dri.c
> > +++ b/src/sis_dri.c
> > @@ -369,7 +369,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
> >    */
> >   pDRIInfo->SAREASize =
> >     ((sizeof(XF86DRISAREARec) + getpagesize() - 1) & getpagesize()); /* round to page */
> > -    /* ((sizeof(XF86DRISAREARec) + 0xfff) & 0x1000); */ /* round to page */
> > +    /* ((sizeof(SISDRISAREARec) + 0xfff) & 0x1000); */ /* round to page */
> 
> This looks like an accidental find-and-replace.

oops, thanks. both fixed and pushed.

Cheers,
  Peter
 
> >   /* + shared memory device private rec */
> >  #else
> >   /* For now the mapping works by using a fixed size defined
> > diff --git a/src/sis_driver.c b/src/sis_driver.c
> > index 3218239..d733f48 100644
> > --- a/src/sis_driver.c
> > +++ b/src/sis_driver.c
> > @@ -90,7 +90,7 @@
> >  #endif
> >
> >
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >  #include "dri.h"
> >  #endif
> >
> > @@ -6895,7 +6895,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
> >     }
> >
> >     /* Load the dri and glx modules if requested. */
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     if(pSiS->loadDRI) {
> >        if(!xf86LoaderCheckSymbol("DRIScreenInit")) {
> >          if(xf86LoadSubModule(pScrn, "dri")) {
> > @@ -8731,7 +8731,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
> >
> >     pSiS->cmdQueueLen = 0; /* Force an EngineIdle() at start */
> >
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     if(pSiS->loadDRI) {
> >  #ifdef SISDUALHEAD
> >        /* No DRI in dual head mode */
> > @@ -9044,7 +9044,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
> >     }
> >  #endif
> >
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     if(pSiS->loadDRI) {
> >        if(pSiS->directRenderingEnabled) {
> >           /* Now that mi, drm and others have done their thing,
> > @@ -9778,7 +9778,7 @@ SISEnterVT(int scrnIndex, int flags)
> >
> >     SISAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
> >
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     if(pSiS->directRenderingEnabled) {
> >        DRIUnlock(screenInfo.screens[scrnIndex]);
> >     }
> > @@ -9804,7 +9804,7 @@ SISLeaveVT(int scrnIndex, int flags)
> >  {
> >     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
> >     SISPtr pSiS = SISPTR(pScrn);
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     ScreenPtr pScreen;
> >
> >     if(pSiS->directRenderingEnabled) {
> > @@ -9888,7 +9888,7 @@ SISCloseScreen(int scrnIndex, ScreenPtr pScreen)
> >        SiSCtrlExtUnregister(pSiS, pScrn->scrnIndex);
> >     }
> >
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     if(pSiS->directRenderingEnabled) {
> >        SISDRICloseScreen(pScreen);
> >        pSiS->directRenderingEnabled = FALSE;
> > diff --git a/src/sis_opt.c b/src/sis_opt.c
> > index d39ff6e..3fa12c9 100644
> > --- a/src/sis_opt.c
> > +++ b/src/sis_opt.c
> > @@ -480,7 +480,7 @@ SiSOptions(ScrnInfoPtr pScrn)
> >  #endif
> >     pSiS->ShadowFB = FALSE;
> >     pSiS->loadDRI = FALSE;
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     pSiS->agpWantedPages = AGP_PAGES;
> >  #endif
> >     pSiS->VESA = -1;
> > @@ -2034,7 +2034,7 @@ SiSOptions(ScrnInfoPtr pScrn)
> >        }
> >     }
> >
> > -#ifdef XF86DRI
> > +#ifdef SISDRI
> >     /* DRI */
> >     from = X_DEFAULT;
> >     if(xf86GetOptValBool(pSiS->Options, OPTION_DRI, &pSiS->loadDRI)) {
> > --
> > 1.7.7.4
> >
> > Cheers,
> >  Peter
> 
> Other than those two things,
> Reviewed-by: Tormod Volden <debian.tormod at gmail.com>
> 
> Tormod
> 
> 


More information about the xorg-devel mailing list