diff --git a/configure.ac b/configure.ac index 876bc07..1d47b17 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,8 @@ CFLAGS="$XORG_CFLAGS" AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no], [#include "xorg-server.h"]) +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])],[]) CFLAGS="$save_CFLAGS" if test "x$XSERVER_LIBPCIACCESS" = xyes; then diff --git a/src/vesa.c b/src/vesa.c index 57ca3a7..28a3c83 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -106,6 +106,7 @@ enum GenericTypes CHIP_VESA_GENERIC }; +/* Supported chipsets */ #ifdef XSERVER_LIBPCIACCESS static const struct pci_id_match vesa_device_match[] = { { @@ -115,26 +116,24 @@ static const struct pci_id_match vesa_device_match[] = { { 0, 0, 0 }, }; +#else +static PciChipsets VESAPCIchipsets[] = { + { CHIP_VESA_GENERIC, PCI_CHIP_VGA, RES_SHARED_VGA }, + { -1, -1, RES_UNDEFINED }, +}; #endif -/* Supported chipsets */ static SymTabRec VESAChipsets[] = { {CHIP_VESA_GENERIC, "vesa"}, {-1, NULL} }; -static PciChipsets VESAPCIchipsets[] = { - { CHIP_VESA_GENERIC, PCI_CHIP_VGA, RES_SHARED_VGA }, - { -1, -1, RES_UNDEFINED }, -}; - static IsaChipsets VESAISAchipsets[] = { {CHIP_VESA_GENERIC, RES_EXCLUSIVE_VGA}, {-1, 0 } }; - /* * This contains the functions needed by the server after loading the * driver module. It must be supplied, and gets added the driver list by @@ -183,8 +182,12 @@ static const OptionInfoRec VESAOptions[] = { */ #ifdef XFree86LOADER static const char *miscfbSymbols[] = { +#ifdef HAVE_XF1BPP "xf1bppScreenInit", +#endif +#ifdef HAVE_XF4BPP "xf4bppScreenInit", +#endif #ifdef USE_AFB "afbScreenInit", #endif @@ -729,14 +732,18 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags) } else { 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: #ifdef USE_AFB mod = "afb"; @@ -921,6 +928,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) return (FALSE); case 0x3: /* Planar */ switch (pScrn->bitsPerPixel) { +#ifdef HAVE_XF1BPP case 1: if (!xf1bppScreenInit(pScreen, pVesa->base, pScrn->virtualX, pScrn->virtualY, @@ -928,6 +936,8 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->displayWidth)) return (FALSE); break; +#endif +#ifdef HAVE_XF4BPP case 4: if (!xf4bppScreenInit(pScreen, pVesa->base, pScrn->virtualX, pScrn->virtualY, @@ -935,6 +945,7 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->displayWidth)) return (FALSE); break; +#endif default: #ifdef USE_AFB if (!afbScreenInit(pScreen, pVesa->base, diff --git a/src/vesa.h b/src/vesa.h index 0705d76..d408034 100644 --- a/src/vesa.h +++ b/src/vesa.h @@ -69,20 +69,26 @@ #include "xf86Resources.h" #include "xf86RAC.h" +#ifdef HAVE_XF1BPP #include "xf1bpp.h" +#endif +#ifdef HAVE_XF4BPP #include "xf4bpp.h" +#endif #include "fb.h" #ifdef USE_AFB #include "afb.h" #endif -#include "mfb.h" - #ifdef XSERVER_LIBPCIACCESS #include #endif +/* usleep */ +#include + + #define VESA_VERSION 4000 #define VESA_NAME "VESA" #define VESA_DRIVER_NAME "vesa"