summaryrefslogtreecommitdiff
path: root/driver/xf86-video-wsfb
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-06-01 20:57:21 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-06-01 20:57:21 +0000
commit0bfffeb7afc8c3fbc228530c390933238965402e (patch)
treea0729565adf684e3478486823fe2e96730c8f300 /driver/xf86-video-wsfb
parentd81fd04cc4497b86d162311541935c35f0bf5435 (diff)
Don't call xf1bpp or xf4bpp if they're not present (xorg-server-1.6 & later)
From Alan Coopersmith <alan.coopersmith@sun.com>.
Diffstat (limited to 'driver/xf86-video-wsfb')
-rw-r--r--driver/xf86-video-wsfb/configure.ac9
-rw-r--r--driver/xf86-video-wsfb/src/wsfb_driver.c18
2 files changed, 23 insertions, 4 deletions
diff --git a/driver/xf86-video-wsfb/configure.ac b/driver/xf86-video-wsfb/configure.ac
index dd50a6f47..a0882e9fb 100644
--- a/driver/xf86-video-wsfb/configure.ac
+++ b/driver/xf86-video-wsfb/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-wsfb],
- 0.2.0,
+ 0.2.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-wsfb)
@@ -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/driver/xf86-video-wsfb/src/wsfb_driver.c b/driver/xf86-video-wsfb/src/wsfb_driver.c
index 0ad83348a..1dcbac912 100644
--- a/driver/xf86-video-wsfb/src/wsfb_driver.c
+++ b/driver/xf86-video-wsfb/src/wsfb_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsfb_driver.c,v 1.14 2008/09/29 22:04:43 matthieu Exp $ */
+/* $OpenBSD: wsfb_driver.c,v 1.15 2009/06/01 20:57:20 matthieu Exp $ */
/*
* Copyright (c) 2001 Matthieu Herrb
* All rights reserved.
@@ -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"
@@ -748,14 +752,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;
@@ -939,17 +947,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,
fPtr->linebytes * 8);
break;
+#endif
case 4:
+#ifdef HAVE_XF4BPP
ret = xf4bppScreenInit(pScreen, fPtr->fbstart,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
fPtr->linebytes * 2);
break;
+#endif
case 8:
case 16:
case 24: