[Intel-gfx] [PATCH] Make XAA support optional

Daniel Stone daniel at fooishbar.org
Wed Jan 18 04:45:51 CET 2012


Does what it says on the box.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 configure.ac                  |   14 ++++++++++++++
 src/legacy/i810/Makefile.am   |    6 +++++-
 src/legacy/i810/i810.h        |    4 ++++
 src/legacy/i810/i810_dga.c    |    2 ++
 src/legacy/i810/i810_driver.c |   10 +++++++++-
 src/legacy/i810/i810_hwmc.c   |    2 ++
 src/legacy/i810/i810_video.c  |    2 ++
 7 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 63beb64..c3cbfd4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -268,6 +268,20 @@ if test "x$DEBUG" = xfull; then
         CFLAGS="$CFLAGS -O0 -ggdb3"
 fi
 
+save_CFLAGS=$CFLAGS
+CFLAGS="$XORG_CFLAGS"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <xorg-server.h>
+#include "xaa.h"
+#include "xaalocal.h"
+]])],
+                  [have_xaa=yes],
+                  [have_xaa=no])
+CFLAGS=$save_CFLAGS
+if test "x$have_xaa" = xyes; then
+	AC_DEFINE(XAA,1,[Enable XAA acceleration for i810])
+fi
+AM_CONDITIONAL(XAA, test x$have_xaa = xyes)
+
 AC_CHECK_HEADERS([sys/timerfd.h])
 
 DRIVER_NAME=intel
diff --git a/src/legacy/i810/Makefile.am b/src/legacy/i810/Makefile.am
index a1bdd85..a88508c 100644
--- a/src/legacy/i810/Makefile.am
+++ b/src/legacy/i810/Makefile.am
@@ -8,7 +8,6 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ @PCIACCESS_CFLA
 	    $(NULL)
 
 liblegacy_i810_la_SOURCES = \
-         i810_accel.c \
          i810_common.h \
          i810_cursor.c \
          i810_dga.c \
@@ -20,6 +19,11 @@ liblegacy_i810_la_SOURCES = \
          i810_video.c \
          i810_wmark.c
 
+if XAA
+liblegacy_i810_la_SOURCES += \
+         i810_accel.c
+endif
+
 if DRI
 liblegacy_i810_la_SOURCES +=\
          i810_dri.c \
diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h
index 183c701..d10f304 100644
--- a/src/legacy/i810/i810.h
+++ b/src/legacy/i810/i810.h
@@ -42,7 +42,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "compiler.h"
 #include "xf86Pci.h"
 #include "i810_reg.h"
+#ifdef XAA
 #include "xaa.h"
+#endif
 #include "xf86Cursor.h"
 #include "xf86xv.h"
 #include "vbe.h"
@@ -201,7 +203,9 @@ typedef struct _I810Rec {
    I810RegRec SavedReg;
    I810RegRec ModeReg;
 
+#ifdef XAA
    XAAInfoRecPtr AccelInfoRec;
+#endif
    xf86CursorInfoPtr CursorInfoRec;
    CloseScreenProcPtr CloseScreen;
    ScreenBlockHandlerProcPtr BlockHandler;
diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c
index 44181c6..4174309 100644
--- a/src/legacy/i810/i810_dga.c
+++ b/src/legacy/i810/i810_dga.c
@@ -29,8 +29,10 @@
 #include "xf86.h"
 #include "xf86_OSproc.h"
 #include "xf86Pci.h"
+#ifdef XAA
 #include "xaa.h"
 #include "xaalocal.h"
+#endif
 #include "i810.h"
 #include "i810_reg.h"
 #include "dgaproc.h"
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index d8f7c45..5026a26 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -345,13 +345,15 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    if (xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE))
       pI810->noAccel = TRUE;
 
+#ifdef XAA
    if (!pI810->noAccel) {
       if (!xf86LoadSubModule(pScrn, "xaa")) {
 	 I810FreeRec(pScrn);
 	 return FALSE;
       }
    }
-   
+#endif
+
 #ifdef XF86DRI
    pI810->directRenderingDisabled =
      !xf86ReturnOptValBool(pI810->Options, OPTION_DRI, TRUE);
@@ -1701,6 +1703,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
       return FALSE;
    }
 
+#ifdef XAA
    if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
       if (pI810->LpRing->mem.Size != 0) {
 	 I810SetRingRegs(pScrn);
@@ -1712,6 +1715,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 	     I810EmitFlush(pScrn);
       }
    }
+#endif
 
    miInitializeBackingStore(pScreen);
    xf86SetBackingStore(pScreen);
@@ -1962,7 +1966,9 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
    vgaHWPtr hwp = VGAHWPTR(pScrn);
    I810Ptr pI810 = I810PTR(pScrn);
+#ifdef XAA
    XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
+#endif
 
    if (pScrn->vtSema == TRUE) {
       if (pI810->AccelInfoRec != NULL) {
@@ -1994,12 +2000,14 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
       pI810->ScanlineColorExpandBuffers = NULL;
    }
 
+#ifdef XAA
    if (infoPtr) {
       if (infoPtr->ScanlineColorExpandBuffers)
 	 free(infoPtr->ScanlineColorExpandBuffers);
       XAADestroyInfoRec(infoPtr);
       pI810->AccelInfoRec = NULL;
    }
+#endif
 
    if (pI810->CursorInfoRec) {
       xf86DestroyCursorInfoRec(pI810->CursorInfoRec);
diff --git a/src/legacy/i810/i810_hwmc.c b/src/legacy/i810/i810_hwmc.c
index ba50e1e..43feb55 100644
--- a/src/legacy/i810/i810_hwmc.c
+++ b/src/legacy/i810/i810_hwmc.c
@@ -53,8 +53,10 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xf86xvmc.h"
 #include <X11/extensions/Xv.h>
 #include <X11/extensions/XvMC.h>
+#ifdef XAA
 #include "xaa.h"
 #include "xaalocal.h"
+#endif
 #include "dixstruct.h"
 #include "fourcc.h"
 
diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index a0e6acd..82b6956 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -49,8 +49,10 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i810.h"
 #include "xf86xv.h"
 #include <X11/extensions/Xv.h>
+#ifdef XAA
 #include "xaa.h"
 #include "xaalocal.h"
+#endif
 #include "dixstruct.h"
 #include "fourcc.h"
 
-- 
1.7.8.3




More information about the Intel-gfx mailing list