summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-01-13 15:04:12 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-01-13 15:04:12 -0800
commitf5540f76b1c756521b541601902b20e1fa118a87 (patch)
tree251adff9981ab2bd3b6991e65f2a5c7b93f2b865
parent7a654c551ae470f63052fe58fd13d961090cc468 (diff)
Don't call xf1bpp or xf4bpp if they're not present (xorg-server-1.6 & later)
-rw-r--r--configure.ac7
-rw-r--r--src/wsfb_driver.c16
2 files changed, 21 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 893153d..a0882e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,13 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for header files.
AC_HEADER_STDC
+# Check for xf1bpp & xf4bpp (removed in xorg-server 1.6 & later)
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
+AC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[])
+AC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[])
+CPPFLAGS="$SAVE_CPPFLAGS"
+
AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])
diff --git a/src/wsfb_driver.c b/src/wsfb_driver.c
index 0d6246b..bb33a79 100644
--- a/src/wsfb_driver.c
+++ b/src/wsfb_driver.c
@@ -60,8 +60,12 @@
#include "dgaproc.h"
/* for visuals */
-#include "xf1bpp.h"
-#include "xf4bpp.h"
+#ifdef HAVE_XF1BPP
+# include "xf1bpp.h"
+#endif
+#ifdef HAVE_XF4BPP
+# include "xf4bpp.h"
+#endif
#include "fb.h"
#include "xf86Resources.h"
@@ -637,14 +641,18 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags)
/* Load bpp-specific modules */
switch(pScrn->bitsPerPixel) {
+#ifdef HAVE_XF1BPP
case 1:
mod = "xf1bpp";
reqSym = "xf1bppScreenInit";
break;
+#endif
+#ifdef HAVE_XF4BPP
case 4:
mod = "xf4bpp";
reqSym = "xf4bppScreenInit";
break;
+#endif
default:
mod = "fb";
break;
@@ -828,17 +836,21 @@ WsfbScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
switch (pScrn->bitsPerPixel) {
case 1:
+#ifdef HAVE_XF1BPP
ret = xf1bppScreenInit(pScreen, fPtr->fbstart,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth);
break;
+#endif
case 4:
+#ifdef HAVE_XF4BPP
ret = xf4bppScreenInit(pScreen, fPtr->fbstart,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth);
break;
+#endif
case 8:
case 16:
case 24: