summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-07-10 00:32:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-10 09:36:40 +0100
commit232217eef8f99f5678d65bf9aa5b898ef6d3b3c6 (patch)
tree22d00db9c82250c2e971b08cc312f51233efe117
parent78dc0c04745ad4485b994f67833f4a155749f01d (diff)
i810: Make DGA optional
Don't build DGA when it's not available, or when we don't want it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--configure.ac20
-rw-r--r--src/legacy/i810/Makefile.am6
-rw-r--r--src/legacy/i810/i810_driver.c12
3 files changed, 30 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 15ed9b97..dde23f12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,7 +161,6 @@ fi
PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
-
AC_MSG_CHECKING([whether to include XAA support])
AC_ARG_ENABLE(xaa,
AS_HELP_STRING([--enable-xaa],
@@ -181,6 +180,25 @@ if test "x$XAA" = xyes; then
fi
AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
+AC_MSG_CHECKING([whether to include DGA support])
+AC_ARG_ENABLE(dga,
+ AS_HELP_STRING([--enable-dga],
+ [Enable legacy Direct Graphics Access (DGA) [default=auto]]),
+ [DGA="$enableval"],
+ [DGA=auto])
+AC_MSG_RESULT([$DGA])
+AM_CONDITIONAL(DGA, test "x$DGA" != xno)
+if test "x$DGA" != xno; then
+ save_CFLAGS=$CFLAGS
+ CFLAGS=$XSERVER_CFLAGS
+ AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no)
+ CFLAGS=$save_CFLAGS
+fi
+if test "x$DGA" = xyes; then
+ AC_DEFINE(USE_DGA, 1, [Enable DGA support])
+fi
+AM_CONDITIONAL(DGA, test "x$DGA" = xyes)
+
AC_ARG_WITH(default-accel,
AS_HELP_STRING([--with-default-accel],
[Select the default acceleration method [default=uxa if enabled, otherwise sna]]),
diff --git a/src/legacy/i810/Makefile.am b/src/legacy/i810/Makefile.am
index 01cc2183..07a384f6 100644
--- a/src/legacy/i810/Makefile.am
+++ b/src/legacy/i810/Makefile.am
@@ -10,7 +10,6 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ @PCIACCESS_CFLA
liblegacy_i810_la_SOURCES = \
i810_common.h \
i810_cursor.c \
- i810_dga.c \
i810_driver.c \
i810.h \
i810_memory.c \
@@ -24,6 +23,11 @@ liblegacy_i810_la_SOURCES += \
i810_accel.c
endif
+if DGA
+liblegacy_i810_la_SOURCES += \
+ i810_dga.c
+endif
+
if DRI
liblegacy_i810_la_SOURCES +=\
i810_dri.c \
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index df8f8e1b..f4f7f3e3 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -993,7 +993,7 @@ DoRestore(ScrnInfoPtr scrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
uint32_t LCD_TV_Control = INREG(LCD_TV_C);
uint32_t TV_HTotal = INREG(LCD_TV_HTOTAL);
uint32_t ActiveStart, ActiveEnd;
-
+
if((LCD_TV_Control & LCD_TV_ENABLE)
&& !(LCD_TV_Control & LCD_TV_VGAMOD)
&& TV_HTotal) {
@@ -1006,7 +1006,7 @@ DoRestore(ScrnInfoPtr scrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
OUTREG(LCD_TV_OVRACT,
(ActiveEnd << 16) | ActiveStart);
}
-
+
/* Turn on DRAM Refresh */
temp = INREG8(DRAM_ROW_CNTL_HI);
temp &= ~DRAM_REFRESH_RATE;
@@ -1585,11 +1585,11 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL)
pI810->LpRing = calloc(sizeof(I810RingBuffer),1);
if (!pI810->LpRing) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Could not allocate lpring data structure.\n");
return FALSE;
}
-
+
miClearVisualTypes();
/* Re-implemented Direct Color support, -jens */
@@ -1623,7 +1623,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL)
* pI810->directRenderingEnabled based on it each generation.
*/
pI810->directRenderingEnabled = !pI810->directRenderingDisabled;
-
+
if (pI810->directRenderingEnabled==TRUE)
pI810->directRenderingEnabled = I810DRIScreenInit(screen);
@@ -1693,7 +1693,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL)
}
#endif
-#ifdef XFreeXDGA
+#ifdef HAVE_DGA
I810DGAInit(screen);
#endif