[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-vesa: Changes to 'debian-experimental'



 .cvsignore       |   19 +++++++
 autogen.sh       |   12 ++++
 configure.ac     |   10 ++++
 debian/changelog |    4 +
 man/.cvsignore   |    2 
 src/.cvsignore   |    6 ++
 src/vesa.c       |  133 ++++++++++++++++++++++++++++++++++++++++++++++---------
 src/vesa.h       |   10 +++-
 8 files changed, 173 insertions(+), 23 deletions(-)

New commits:
commit 9bbe1c49b9d22736eded05909e144cc6e03050b4
Author: Ian Romanick <idr@us.ibm.com>
Date:   Mon Jan 15 17:31:18 2007 -0800

    Correct '#ifdef' to '#ifndef'.  Oops.

diff --git a/src/vesa.c b/src/vesa.c
index 0b35180..fa9d526 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -350,7 +350,7 @@ VESAProbe(DriverPtr drv, int flags)
 					  &devSections)) <= 0)
 	return (FALSE);
 
-#ifdef PCIACCESS
+#ifndef PCIACCESS
     /* PCI BUS */
     if (xf86GetPciVideoInfo()) {
 	numUsed = xf86MatchPciInstances(VESA_NAME, PCI_VENDOR_GENERIC,

commit 824ccaab986e1c2be6229350731b43f8831ebef7
Author: Ian Romanick <idr@us.ibm.com>
Date:   Mon Jan 15 13:16:52 2007 -0800

    Add conditional support for pci-rework branch.
    
    To build VESA driver for use with pci-rework Xserver, add
    --enable-pciacces to the configure command line.  Otherwise, the
    "traditional" VESA driver will be built.

diff --git a/configure.ac b/configure.ac
index 9989d58..1bf0074 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,6 +44,9 @@ AH_TOP([#include "xorg-server.h"])
 AC_ARG_WITH(xorg-module-dir, [  --with-xorg-module-dir=DIR ],
                              [ moduledir="$withval" ],
                              [ moduledir="$libdir/xorg/modules" ])
+AC_ARG_ENABLE(pciaccess,     AS_HELP_STRING([--enable-pciaccess],
+                             [Enable use of libpciaccess (default: disabled)]),
+			     [PCIACCESS=$enableval], [PCIACCESS=no])
 AC_SUBST(moduledir)
 
 
@@ -56,6 +59,13 @@ # Checks for pkg-config packages
 PKG_CHECK_MODULES(XORG, xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES)
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
+AM_CONDITIONAL(PCIACCESS, [test "x$PCIACCESS" = xyes])
+if test "x$PCIACCESS" = xyes; then
+    AC_DEFINE(PCIACCESS, 1, [Use libpciaccess])
+    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.7.0])
+    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+fi
+
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
 INCLUDES="$XORG_INCS -I${sdkdir} "'-I$(top_srcdir)/src -I$(prefix)/include'
 AC_SUBST([CFLAGS])
diff --git a/src/vesa.c b/src/vesa.c
index 63e2491..0b35180 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -57,6 +57,10 @@ #include <X11/extensions/dpms.h>
 static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid);
 static void VESAIdentify(int flags);
 static Bool VESAProbe(DriverPtr drv, int flags);
+#ifdef PCIACCESS
+static Bool VESAPciProbe(DriverPtr drv, int entity_num,
+     struct pci_device *dev, intptr_t match_data);
+#endif
 static Bool VESAPreInit(ScrnInfoPtr pScrn, int flags);
 static Bool VESAScreenInit(int Index, ScreenPtr pScreen, int argc,
 			   char **argv);
@@ -70,6 +74,7 @@ static Bool VESASetMode(ScrnInfoPtr pScr
 static void VESAAdjustFrame(int scrnIndex, int x, int y, int flags);
 static void VESAFreeScreen(int scrnIndex, int flags);
 static void VESAFreeRec(ScrnInfoPtr pScrn);
+static VESAPtr VESAGetRec(ScrnInfoPtr pScrn);
 
 static void
 VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode,
@@ -96,28 +101,22 @@ static void *VESAWindowWindowed(ScreenPt
 
 static Bool VESADGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
 
-/* 
- * This contains the functions needed by the server after loading the
- * driver module.  It must be supplied, and gets added the driver list by
- * the Module Setup funtion in the dynamic case.  In the static case a
- * reference to this is compiled in, and this requires that the name of
- * this DriverRec be an upper-case version of the driver name.
- */
-_X_EXPORT DriverRec VESA = {
-    VESA_VERSION,
-    VESA_DRIVER_NAME,
-    VESAIdentify,
-    VESAProbe,
-    VESAAvailableOptions,
-    NULL,
-    0
-};
-
 enum GenericTypes
 {
     CHIP_VESA_GENERIC
 };
 
+#ifdef PCIACCESS
+static const struct pci_id_match vesa_device_match[] = {
+    {
+	PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
+	0x00030000, 0x00ffffff, CHIP_VESA_GENERIC 
+    },
+
+    { 0, 0, 0 },
+};
+#endif
+    
 /* Supported chipsets */
 static SymTabRec VESAChipsets[] =
 {
@@ -135,6 +134,31 @@ static IsaChipsets VESAISAchipsets[] = {
   {-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
+ * the Module Setup funtion in the dynamic case.  In the static case a
+ * reference to this is compiled in, and this requires that the name of
+ * this DriverRec be an upper-case version of the driver name.
+ */
+_X_EXPORT DriverRec VESA = {
+    VESA_VERSION,
+    VESA_DRIVER_NAME,
+    VESAIdentify,
+    VESAProbe,
+    VESAAvailableOptions,
+    NULL,
+    0,
+    NULL,
+
+#ifdef PCIACCESS
+    vesa_device_match,
+    VESAPciProbe
+#endif
+};
+
+
 typedef enum {
     OPTION_SHADOW_FB,
     OPTION_DFLT_REFRESH,
@@ -244,7 +268,7 @@ vesaSetup(pointer Module, pointer Option
     if (!Initialised)
     {
 	Initialised = TRUE;
-	xf86AddDriver(&VESA, Module, 0);
+	xf86AddDriver(&VESA, Module, 1);
 	LoaderRefSymLists(miscfbSymbols,
 			  fbSymbols,
 			  shadowSymbols,
@@ -278,6 +302,37 @@ VESAIdentify(int flags)
  * do a minimal probe for supported hardware.
  */
 
+#ifdef PCIACCESS
+static Bool
+VESAPciProbe(DriverPtr drv, int entity_num, struct pci_device *dev,
+	     intptr_t match_data)
+{
+    ScrnInfoPtr pScrn;
+    
+    pScrn = xf86ConfigPciEntity(NULL, 0, entity_num, NULL, 
+				NULL, NULL, NULL, NULL, NULL);
+    if (pScrn != NULL) {
+	VESAPtr pVesa = VESAGetRec(pScrn);
+
+	pScrn->driverVersion = VESA_VERSION;
+	pScrn->driverName    = VESA_DRIVER_NAME;
+	pScrn->name	     = VESA_NAME;
+	pScrn->Probe	     = VESAProbe;
+	pScrn->PreInit       = VESAPreInit;
+	pScrn->ScreenInit    = VESAScreenInit;
+	pScrn->SwitchMode    = VESASwitchMode;
+	pScrn->AdjustFrame   = VESAAdjustFrame;
+	pScrn->EnterVT       = VESAEnterVT;
+	pScrn->LeaveVT       = VESALeaveVT;
+	pScrn->FreeScreen    = VESAFreeScreen;
+	
+	pVesa->pciInfo = dev;
+    }
+    
+    return (pScrn != NULL);
+}
+#endif
+
 static Bool
 VESAProbe(DriverPtr drv, int flags)
 {
@@ -295,6 +350,7 @@ VESAProbe(DriverPtr drv, int flags)
 					  &devSections)) <= 0)
 	return (FALSE);
 
+#ifdef PCIACCESS
     /* PCI BUS */
     if (xf86GetPciVideoInfo()) {
 	numUsed = xf86MatchPciInstances(VESA_NAME, PCI_VENDOR_GENERIC,
@@ -329,6 +385,7 @@ VESAProbe(DriverPtr drv, int flags)
 	    xfree(usedChips);
 	}
     }
+#endif
 
     /* Isa Bus */
     numUsed = xf86MatchIsaInstances(VESA_NAME,VESAChipsets,
@@ -482,14 +539,13 @@ #endif
 				       | RESTORE_BIOS_SCRATCH)) == NULL)
         return (FALSE);
 
+#ifndef PCIACCESS
     if (pVesa->pEnt->location.type == BUS_PCI) {
 	pVesa->pciInfo = xf86GetPciInfoForEntity(pVesa->pEnt->index);
 	pVesa->pciTag = pciTag(pVesa->pciInfo->bus, pVesa->pciInfo->device,
 			       pVesa->pciInfo->func);
-	pVesa->primary = xf86IsPrimaryPci(pVesa->pciInfo);
     }
-    else
-	pVesa->primary = TRUE;
+#endif
 
     pScrn->chipset = "vesa";
     pScrn->monitor = pScrn->confScreen->monitor;
@@ -1136,6 +1192,28 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
     pScrn->memPhysBase = pVesa->mapPhys;
     pScrn->fbOffset = pVesa->mapOff;
 
+#ifdef PCIACCESS
+    if ((pVesa->mapPhys != 0xa0000) && (pVesa->pciInfo != NULL)) {
+	(void) pci_device_map_memory_range(pVesa->pciInfo,
+					   pScrn->memPhysBase,
+					   pVesa->mapSize,
+					   TRUE,
+					   & pVesa->base);
+    }
+    else
+	pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, pVesa->pciInfo,
+					  pScrn->memPhysBase, pVesa->mapSize);
+
+    if (pVesa->base) {
+	if (pVesa->mapPhys != 0xa0000)
+	    pVesa->VGAbase = xf86MapDomainMemory(pScrn->scrnIndex, 0,
+						 pVesa->pciInfo,
+						 0xa0000, 0x10000);
+	else
+	    pVesa->VGAbase = pVesa->base;
+
+    }
+#else
     if (pVesa->mapPhys != 0xa0000 && pVesa->pEnt->location.type == BUS_PCI)
 	pVesa->base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
 				    pVesa->pciTag, pScrn->memPhysBase,
@@ -1152,6 +1230,7 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
 	else
 	    pVesa->VGAbase = pVesa->base;
     }
+#endif
 
     pVesa->ioBase = pScrn->domainIOBase;
 
@@ -1171,9 +1250,21 @@ VESAUnmapVidMem(ScrnInfoPtr pScrn)
     if (pVesa->base == NULL)
 	return;
 
+#ifdef PCIACCESS
+    if (pVesa->mapPhys != 0xa0000) {
+	(void) pci_device_unmap_memory_range(pVesa->pciInfo,
+					     pVesa->base,
+					     pVesa->mapSize);
+	xf86UnMapVidMem(pScrn->scrnIndex, pVesa->VGAbase, 0x10000);
+    }
+    else {
+	xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);
+    }
+#else
     xf86UnMapVidMem(pScrn->scrnIndex, pVesa->base, pVesa->mapSize);
     if (pVesa->mapPhys != 0xa0000)
 	xf86UnMapVidMem(pScrn->scrnIndex, pVesa->VGAbase, 0x10000);
+#endif
     pVesa->base = NULL;
 }
 
diff --git a/src/vesa.h b/src/vesa.h
index b377360..f0c79da 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -79,6 +79,10 @@ #endif
 
 #include "mfb.h"
 
+#ifdef PCIACCESS
+#include <pciaccess.h>
+#endif
+
 #define VESA_VERSION		4000
 #define VESA_NAME		"VESA"
 #define VESA_DRIVER_NAME	"vesa"
@@ -95,8 +99,12 @@ typedef struct _VESARec
     CARD16 major, minor;
     VbeInfoBlock *vbeInfo;
     GDevPtr device;
+#ifdef PCIACCESS
+    struct pci_device *pciInfo;
+#else
     pciVideoPtr pciInfo;
     PCITAG pciTag;
+#endif
     miBankInfoRec bank;
     int curBank, bankSwitchWindowB;
     CARD16 maxBytesPerScanline;
@@ -108,7 +116,7 @@ typedef struct _VESARec
     CARD32 *pal, *savedPal;
     CARD8 *fonts;
     xf86MonPtr monitor;
-    Bool shadowFB, primary;
+    Bool shadowFB;
     CARD32 windowAoffset;
     /* Don't override the default refresh rate. */
     Bool defaultRefresh;

commit 7f4f198b21bc1df254912adb9592339b21d121f5
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
Date:   Thu Nov 30 16:04:26 2006 -0500

    Bump to 1.3.0

diff --git a/configure.ac b/configure.ac
index f043fc3..9989d58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.2.2,
+        1.3.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 
diff --git a/src/vesa.h b/src/vesa.h
index 6110a71..b377360 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -83,7 +83,7 @@ #define VESA_VERSION		4000
 #define VESA_NAME		"VESA"
 #define VESA_DRIVER_NAME	"vesa"
 #define VESA_MAJOR_VERSION	1
-#define VESA_MINOR_VERSION	2
+#define VESA_MINOR_VERSION	3
 #define VESA_PATCHLEVEL		0
 
 /*XXX*/

commit 7777730e7749fe6921e76a4a1738e0e2a0b16376
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
Date:   Thu Nov 30 16:03:35 2006 -0500

    Fix shadow support yet again.

diff --git a/src/vesa.c b/src/vesa.c
index bd4bf42..63e2491 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -747,6 +747,23 @@ #endif
 }
 
 static Bool
+vesaCreateScreenResources(ScreenPtr pScreen)
+{
+    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    VESAPtr pVesa = VESAGetRec(pScrn);
+    Bool ret;
+
+    pScreen->CreateScreenResources = pVesa->CreateScreenResources;
+    ret = pScreen->CreateScreenResources(pScreen);
+    pScreen->CreateScreenResources = vesaCreateScreenResources;
+
+    shadowAdd(pScreen, pScreen->GetScreenPixmap(pScreen), pVesa->update,
+	      pVesa->window, 0, 0);
+
+    return ret;
+}
+
+static Bool
 VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 {
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
@@ -788,6 +805,16 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
     if (pVesa->shadowFB && pScrn->bitsPerPixel == 4)
 	pScrn->bitsPerPixel = 8;
 
+    if (pVesa->shadowFB) {
+	pVesa->shadow = xcalloc(1, pScrn->displayWidth * pScrn->virtualY *
+				   ((pScrn->bitsPerPixel + 7) / 8));
+	if (!pVesa->shadow) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "Failed to allocate shadow buffer\n");
+	    return FALSE;
+	}
+    }
+
     /* save current video state */
     VESASaveRestore(pScrn, MODE_SAVE);
     pVesa->savedPal = VBESetGetPaletteData(pVesa->pVbe, FALSE, 0, 256,
@@ -865,7 +892,7 @@ #endif
 		case 24:
 		case 32:
 		    if (!fbScreenInit(pScreen,
-				       pVesa->base,
+				pVesa->shadowFB ? pVesa->shadow : pVesa->base,
 				       pScrn->virtualX, pScrn->virtualY,
 				       pScrn->xDpi, pScrn->yDpi,
 				       pScrn->displayWidth, pScrn->bitsPerPixel))
@@ -901,27 +928,26 @@ #endif
 	fbPictureInit(pScreen, 0, 0);
 
     if (pVesa->shadowFB) {
-	ShadowUpdateProc update;
-	ShadowWindowProc window;
-
 	if (mode->MemoryModel == 3) {	/* Planar */
 	  if (pScrn->bitsPerPixel == 8)
-		update = shadowUpdatePlanar4x8Weak();
+		pVesa->update = shadowUpdatePlanar4x8Weak();
 	    else
-		update = shadowUpdatePlanar4Weak();
-	    window = VESAWindowPlanar;
+		pVesa->update = shadowUpdatePlanar4Weak();
+	    pVesa->window = VESAWindowPlanar;
 	}
 	else if (pVesa->mapPhys == 0xa0000) {	/* Windowed */
-	    update = shadowUpdatePackedWeak();
-	    window = VESAWindowWindowed;
+	    pVesa->update = shadowUpdatePackedWeak();
+	    pVesa->window = VESAWindowWindowed;
 	}
 	else {	/* Linear */
-	    update = shadowUpdatePackedWeak();
-	    window = VESAWindowLinear;
+	    pVesa->update = shadowUpdatePackedWeak();
+	    pVesa->window = VESAWindowLinear;
 	}
 
-	if (!shadowInit(pScreen, update, window))
-	    return (FALSE);
+	if (!shadowSetup(pScreen))
+	    return FALSE;
+	pVesa->CreateScreenResources = pScreen->CreateScreenResources;
+	pScreen->CreateScreenResources = vesaCreateScreenResources;
     }
     else if (pVesa->mapPhys == 0xa0000 && mode->MemoryModel != 0x3) {
 	unsigned int bankShift = 0;
@@ -1005,6 +1031,8 @@ VESACloseScreen(int scrnIndex, ScreenPtr
 				 pVesa->savedPal, FALSE, TRUE);
 	VESAUnmapVidMem(pScrn);
     }
+    if (pVesa->shadowFB && pVesa->shadow)
+	xfree(pVesa->shadow);
     if (pVesa->pDGAMode) {
 	xfree(pVesa->pDGAMode);
 	pVesa->pDGAMode = NULL;
@@ -1012,6 +1040,7 @@ VESACloseScreen(int scrnIndex, ScreenPtr
     }
     pScrn->vtSema = FALSE;
 
+    pScreen->CreateScreenResources = pVesa->CreateScreenResources;
     pScreen->CloseScreen = pVesa->CloseScreen;
     return pScreen->CloseScreen(scrnIndex, pScreen);
 }
diff --git a/src/vesa.h b/src/vesa.h
index 300281d..6110a71 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -116,9 +116,13 @@ typedef struct _VESARec
     DGAModePtr pDGAMode;
     int nDGAMode;
     CloseScreenProcPtr CloseScreen;
+    CreateScreenResourcesProcPtr CreateScreenResources;
     OptionInfoPtr Options;
     IOADDRESS ioBase;
     Bool ModeSetClearScreen;
+    void *shadow;
+    ShadowUpdateProc update;
+    ShadowWindowProc window;
 } VESARec, *VESAPtr;
 
 

commit 7664016db9869d57d4279a9cb32a6ae0086c5b28
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
Date:   Fri Oct 13 18:48:08 2006 -0400

    Bump to 1.2.2

diff --git a/configure.ac b/configure.ac
index 39b4dc5..f043fc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.2.1,
+        1.2.2,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 

commit 3b07dd7f43be7c1263f80eb279605a89c860dc4b
Author: Daniel Stone <daniel@fooishbar.org>
Date:   Sat Jun 3 09:46:27 2006 +0000

    Don't call VBEGetSetDACPaletteFormat when running in direct colour or YUV
        modes. (David Sterratt) Bump to 1.2.1.

diff --git a/ChangeLog b/ChangeLog
index b021a7c..fa37d43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-03  Daniel Stone  <daniel@freedesktop.org>
+
+	* configure.ac:
+	Bump to 1.2.1.
+
+	* src/vesa.c:
+	Don't call VBEGetSetDACPaletteFormat when running in direct colour or
+	YUV modes.  (David Sterratt)
+
 2006-05-19  Adam Jackson  <ajax@freedesktop.org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index b40a469..39b4dc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.2.0,
+        1.2.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 
diff --git a/src/vesa.c b/src/vesa.c
index 3dc3905..bd4bf42 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -1073,7 +1073,8 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayMo
     if (data->data->XResolution != pScrn->displayWidth)
 	VBESetLogicalScanline(pVesa->pVbe, pScrn->displayWidth);
 
-    if (pScrn->bitsPerPixel == 8 && pVesa->vbeInfo->Capabilities[0] & 0x01)
+    if (pScrn->bitsPerPixel == 8 && pVesa->vbeInfo->Capabilities[0] & 0x01 &&
+        !(data->data->MemoryModel & 0x6 || data->data->MemoryModel & 0x7)) 
 	VBESetGetDACPaletteFormat(pVesa->pVbe, 8);
 
     pScrn->vtSema = TRUE;

commit a7315a314fa647a427805dc51f29558f6c607faa
Author: Adam Jackson <ajax@nwnk.net>
Date:   Fri May 19 19:10:12 2006 +0000

    Bump to 1.2.0

diff --git a/ChangeLog b/ChangeLog
index 7da8c94..b021a7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-19  Adam Jackson  <ajax@freedesktop.org>
+
+	* configure.ac:
+	* src/vesa.h:
+	Bump to 1.2.0
+
 2006-05-18  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* src/vesa.c: (VESAScreenInit), (VESACloseScreen):
diff --git a/configure.ac b/configure.ac
index 68d05ed..b40a469 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.1.0,
+        1.2.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 
diff --git a/src/vesa.h b/src/vesa.h
index 269064e..300281d 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -83,7 +83,7 @@ #define VESA_VERSION		4000
 #define VESA_NAME		"VESA"
 #define VESA_DRIVER_NAME	"vesa"
 #define VESA_MAJOR_VERSION	1
-#define VESA_MINOR_VERSION	1
+#define VESA_MINOR_VERSION	2
 #define VESA_PATCHLEVEL		0
 
 /*XXX*/

commit 2f586dac58dfa30246c7d404a3b08f6e287e5975
Author: Kevin E Martin <kem@kem.org>
Date:   Thu May 18 21:14:44 2006 +0000

    Fix ShadowFB support to work with recent miext/shadow changes from bug
        #5460.

diff --git a/ChangeLog b/ChangeLog
index 67986fa..7da8c94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-18  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* src/vesa.c: (VESAScreenInit), (VESACloseScreen):
+	* src/vesa.h:
+	Fix ShadowFB support to work with recent miext/shadow changes from
+	bug #5460.
+
 2006-04-07  Adam Jackson  <ajax@freedesktop.org>
 
 	* configure.ac:
diff --git a/src/vesa.c b/src/vesa.c
index 3e3fc8b..3dc3905 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -176,7 +176,6 @@ static const char *fbSymbols[] = {
 };
 
 static const char *shadowSymbols[] = {
-    "shadowAlloc",
     "shadowInit",
     "shadowUpdatePackedWeak",
     "shadowUpdatePlanar4Weak",
@@ -789,11 +788,6 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
     if (pVesa->shadowFB && pScrn->bitsPerPixel == 4)
 	pScrn->bitsPerPixel = 8;
 
-    if (pVesa->shadowFB && (pVesa->shadowPtr =
-	shadowAlloc(pScrn->virtualX, pScrn->virtualY,
-		    pScrn->bitsPerPixel)) == NULL)
-	return (FALSE);
-
     /* save current video state */
     VESASaveRestore(pScrn, MODE_SAVE);
     pVesa->savedPal = VBESetGetPaletteData(pVesa->pVbe, FALSE, 0, 256,
@@ -838,24 +832,6 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 		       "Unsupported Memory Model: %d", mode->MemoryModel);
 	    return (FALSE);
 	case 0x3:	/* Planar */
-	    if (pVesa->shadowFB) {
-	        if (pScrn->depth == 1) {
-		    if (!mfbScreenInit(pScreen,
-				      pVesa->shadowPtr,
-				      pScrn->virtualX, pScrn->virtualY,
-				      pScrn->xDpi, pScrn->yDpi,
-				      pScrn->displayWidth))
-		        return FALSE;
-		} else {
-		    if (!fbScreenInit(pScreen,
-				      pVesa->shadowPtr,
-				      pScrn->virtualX, pScrn->virtualY,
-				      pScrn->xDpi, pScrn->yDpi,
-				      pScrn->displayWidth, pScrn->bitsPerPixel))
-		    return (FALSE);
-		    init_picture = 1;
-		}
-	    } else {
 		switch (pScrn->bitsPerPixel) {
 		    case 1:
 			if (!xf1bppScreenInit(pScreen, pVesa->base,
@@ -880,7 +856,6 @@ #endif
 			    return (FALSE);
 			break;
 		}
-	    }
 	    break;
 	case 0x4:	/* Packed pixel */
 	case 0x6:	/*  Direct Color */
@@ -890,7 +865,7 @@ #endif
 		case 24:
 		case 32:
 		    if (!fbScreenInit(pScreen,
-			    pVesa->shadowFB ? pVesa->shadowPtr : pVesa->base,
+				       pVesa->base,
 				       pScrn->virtualX, pScrn->virtualY,
 				       pScrn->xDpi, pScrn->yDpi,
 				       pScrn->displayWidth, pScrn->bitsPerPixel))
@@ -1030,10 +1005,6 @@ VESACloseScreen(int scrnIndex, ScreenPtr
 				 pVesa->savedPal, FALSE, TRUE);
 	VESAUnmapVidMem(pScrn);
     }
-    if (pVesa->shadowPtr) {
-	xfree(pVesa->shadowPtr);
-	pVesa->shadowPtr = NULL;
-    }
     if (pVesa->pDGAMode) {
 	xfree(pVesa->pDGAMode);
 	pVesa->pDGAMode = NULL;
diff --git a/src/vesa.h b/src/vesa.h
index c321329..269064e 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -109,7 +109,6 @@ typedef struct _VESARec
     CARD8 *fonts;
     xf86MonPtr monitor;
     Bool shadowFB, primary;
-    CARD8 *shadowPtr;
     CARD32 windowAoffset;
     /* Don't override the default refresh rate. */
     Bool defaultRefresh;

commit 4129d5a0c0648afcf36b004e7f7b5b2de9b7ac27
Author: Adam Jackson <ajax@nwnk.net>
Date:   Fri Apr 7 21:47:15 2006 +0000

    Unlibcwrap. Bump server version requirement. Bump to 1.1.0.

diff --git a/ChangeLog b/ChangeLog
index e6c8681..67986fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-07  Adam Jackson  <ajax@freedesktop.org>
+
+	* configure.ac:
+	* src/vesa.c:
+	* src/vesa.h:
+	Unlibcwrap.  Bump server version requirement.  Bump to 1.1.0.
+
 2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index 8c82130..68d05ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.0.1.3,
+        1.1.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 
@@ -53,7 +53,7 @@ XORG_DRIVER_CHECK_EXT(RENDER, renderprot
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, xorg-server xproto fontsproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES)
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
diff --git a/src/vesa.c b/src/vesa.c
index f83d28d..3e3fc8b 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -35,6 +35,8 @@ #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+#include <string.h>
+
 #include "vesa.h"
 
 /* All drivers initialising the SW cursor need this */
diff --git a/src/vesa.h b/src/vesa.h
index 787c229..c321329 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -38,7 +38,6 @@ #include "xf86_OSproc.h"
 #include "xf86Resources.h"
 
 /* All drivers need this */
-#include "xf86_ansic.h"
 
 #include "compiler.h"
 
@@ -84,8 +83,8 @@ #define VESA_VERSION		4000
 #define VESA_NAME		"VESA"
 #define VESA_DRIVER_NAME	"vesa"
 #define VESA_MAJOR_VERSION	1
-#define VESA_MINOR_VERSION	0
-#define VESA_PATCHLEVEL		1
+#define VESA_MINOR_VERSION	1
+#define VESA_PATCHLEVEL		0
 
 /*XXX*/
 

commit fba272fcbedd2c03760646f587144ab4c111c7df
Author: Kevin E Martin <kem@kem.org>
Date:   Wed Dec 21 02:30:04 2005 +0000

    Update package version for X11R7 release.

diff --git a/ChangeLog b/ChangeLog
index 253fecf..e6c8681 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* configure.ac:
+	Update package version for X11R7 release.
+
 2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index 40b1a9c..8c82130 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.0.1.2,
+        1.0.1.3,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 

commit 1bfb30439eccfa39a021cf84b630fe8b2a51bf3c
Author: Adam Jackson <ajax@nwnk.net>
Date:   Mon Dec 19 16:25:56 2005 +0000

    Stub COPYING files

diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..7f33cbf
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,12 @@
+This is a stub file.  This package has not yet had its complete licensing
+information compiled.  Please see the individual source files for details on
+your rights to use and modify this software.
+
+Please submit updated COPYING files to the Xorg bugzilla:
+
+https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+All licensing questions regarding this software should be directed at the
+Xorg mailing list:
+
+http://lists.freedesktop.org/mailman/listinfo/xorg

commit 6eae0ead000939ee39967e580d9d356fa00bc236
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date:   Mon Dec 19 09:07:51 2005 +0000

    Typo fixes, mailing list & url updates, and other changes to prepare for
        X11R6.9 & 7.0 releases.

diff --git a/man/vesa.man b/man/vesa.man
index 2806565..046c2fa 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -49,7 +49,7 @@ This option is recommended for performan
 .TP
 .BI "Option \*qModeSetClearScreen\*q \*q" boolean \*q
 Clear the screen on mode set. Some BIOSes seem to be broken in the
-sence that the newly set video mode is bogus if they are asked to 
+sense that the newly set video mode is bogus if they are asked to 
 clear the screen during mode setting. If you experience problems try
 to turn this option off. Default: on.
 

commit 14a6c4cb9adde5f5f6009bd4eb30f6649eeea540
Author: Kevin E Martin <kem@kem.org>
Date:   Thu Dec 15 00:24:21 2005 +0000

    Update package version number for final X11R7 release candidate.

diff --git a/ChangeLog b/ChangeLog
index f1bd720..253fecf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* configure.ac:
+	Update package version number for final X11R7 release candidate.
+
 2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* man/Makefile.am:
diff --git a/configure.ac b/configure.ac
index 8ce3cb5..40b1a9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.0.1.1,
+        1.0.1.2,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 

commit a7f95952dcc8319051118db938d0341bf5479a6e
Author: Kevin E Martin <kem@kem.org>
Date:   Tue Dec 6 22:48:40 2005 +0000

    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.

diff --git a/ChangeLog b/ChangeLog
index e56beeb..f1bd720 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* man/Makefile.am:
+	Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
 2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* configure.ac:
diff --git a/man/Makefile.am b/man/Makefile.am
index 27106a2..bf7ec17 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -27,9 +27,9 @@ # 
 
 drivermandir = $(DRIVER_MAN_DIR)
 
-driverman_SOURCES = @DRIVER_NAME@.man
+driverman_PRE = @DRIVER_NAME@.man
 
-driverman_DATA = $(driverman_SOURCES:man=@DRIVER_MAN_SUFFIX@)
+driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
 
 EXTRA_DIST = @DRIVER_NAME@.man
 

commit 7ddc236e517ddae2660523a63c3d060029121e3d
Author: Kevin E Martin <kem@kem.org>
Date:   Sat Dec 3 05:49:36 2005 +0000

    Update package version number for X11R7 RC3 release.

diff --git a/ChangeLog b/ChangeLog
index 749c638..e56beeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* configure.ac:
+	Update package version number for X11R7 RC3 release.
+
 2005-12-01  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index d4dd34e..8ce3cb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.0.1,
+        1.0.1.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 

commit 45d73281a9efe09292eab995c9796eb613edd6d1
Author: Kevin E Martin <kem@kem.org>
Date:   Fri Dec 2 02:16:11 2005 +0000

    Remove extraneous AC_MSG_RESULT.

diff --git a/ChangeLog b/ChangeLog
index 1cc1dfb..749c638 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-01  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* configure.ac:
+	Remove extraneous AC_MSG_RESULT.
+
 2005-11-29  Adam Jackson  <ajax@freedesktop.org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index 5493333..d4dd34e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,6 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xex
 
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(XORG, xorg-server xproto fontsproto $REQUIRED_MODULES)
-AC_MSG_RESULT([yes])
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'

commit ea8c88acd1cc1962cf8360144d4ea1c4b222ba17
Author: Adam Jackson <ajax@nwnk.net>
Date:   Tue Nov 29 23:30:06 2005 +0000

    Only build dlloader modules by default.

diff --git a/ChangeLog b/ChangeLog
index be8ef2c..1cc1dfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-29  Adam Jackson  <ajax@freedesktop.org>
+
+	* configure.ac:
+	Only build dlloader modules by default.
+
 2005-11-09  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index 68c549e..5493333 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,7 @@ AM_INIT_AUTOMAKE([dist-bzip2])
 AM_MAINTAINER_MODE
 
 # Checks for programs.
+AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 AC_PROG_CC
 

commit 62a4b6d0ec9b2ace7660cefd7d4aef6162c0d54d
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date:   Mon Nov 28 22:04:14 2005 +0000

    Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
        update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)

diff --git a/man/Makefile.am b/man/Makefile.am
index a16ec06..27106a2 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -25,7 +25,7 @@ # other dealings in this Software withou
 # from the copyright holders.
 # 
 
-drivermandir = $(mandir)/man$(DRIVER_MAN_SUFFIX)
+drivermandir = $(DRIVER_MAN_DIR)
 
 driverman_SOURCES = @DRIVER_NAME@.man
 

commit 415fa60ef3a042851e93de5842312a8a695131b8
Author: Eric Anholt <anholt@freebsd.org>
Date:   Mon Nov 21 10:49:22 2005 +0000

    Add .cvsignores for drivers.

diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..fb1befd
--- /dev/null
+++ b/.cvsignore
@@ -0,0 +1,19 @@
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
diff --git a/man/.cvsignore b/man/.cvsignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/man/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/src/.cvsignore b/src/.cvsignore
new file mode 100644
index 0000000..9730646
--- /dev/null
+++ b/src/.cvsignore
@@ -0,0 +1,6 @@
+.deps
+.libs
+Makefile
+Makefile.in
+*.la
+*.lo

commit 10f025468598dafe646013cddafc43d90f6cbf0c
Author: Kevin E Martin <kem@kem.org>
Date:   Wed Nov 9 21:31:21 2005 +0000

    Bump version numbers for X11R6.9/X11R7 RC2.

diff --git a/src/vesa.h b/src/vesa.h
index 5bc5324..787c229 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -85,7 +85,7 @@ #define VESA_NAME		"VESA"
 #define VESA_DRIVER_NAME	"vesa"
 #define VESA_MAJOR_VERSION	1
 #define VESA_MINOR_VERSION	0
-#define VESA_PATCHLEVEL		0
+#define VESA_PATCHLEVEL		1
 
 /*XXX*/
 

commit e559685ed6f0e5ab2d947ea02dea11129623a37d
Author: Kevin E Martin <kem@kem.org>
Date:   Wed Nov 9 21:15:22 2005 +0000

    Update package version number for X11R7 RC2 release.

diff --git a/ChangeLog b/ChangeLog
index e4d905b..be8ef2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-09  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* configure.ac:
+	Update package version number for X11R7 RC2 release.
+
 2005-11-01  Kevin E. Martin  <kem-at-freedesktop-dot-org>
 
 	* configure.ac:
diff --git a/configure.ac b/configure.ac
index ab48c59..68c549e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.0.0.1,
+        1.0.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 

commit 0eb288746f85c73e7ae21838dfc52f177b963b29
Author: Kevin E Martin <kem@kem.org>
Date:   Tue Nov 1 15:08:57 2005 +0000

    Update pkgcheck depedencies to work with separate build roots.

diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e4d905b
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,4 @@
+2005-11-01  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+	* configure.ac:
+	Update pkgcheck dependencies to work with separate build roots.
diff --git a/configure.ac b/configure.ac
index 68bd25e..ab48c59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,8 +45,15 @@ AC_ARG_WITH(xorg-module-dir, [  --with-x
                              [ moduledir="$libdir/xorg/modules" ])
 AC_SUBST(moduledir)
 
+
+# Checks for extensions
+XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
+XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
+XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
+
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, xorg-server xproto)
+PKG_CHECK_MODULES(XORG, xorg-server xproto fontsproto $REQUIRED_MODULES)
+AC_MSG_RESULT([yes])
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'

commit 4e79cb7dd2d91af9777f4bea952c962c4e6c3a24
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date:   Wed Oct 26 21:36:25 2005 +0000

    Don't try to restore savedPal in CloseScreen if savedPal is NULL, to avoid
        segfault.

diff --git a/src/vesa.c b/src/vesa.c
index 6dce306..f83d28d 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -1023,8 +1023,9 @@ VESACloseScreen(int scrnIndex, ScreenPtr
 
     if (pScrn->vtSema) {
 	VESASaveRestore(xf86Screens[scrnIndex], MODE_RESTORE);
-	VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
-			     pVesa->savedPal, FALSE, TRUE);
+	if (pVesa->savedPal)
+	    VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256,
+				 pVesa->savedPal, FALSE, TRUE);
 	VESAUnmapVidMem(pScrn);
     }
     if (pVesa->shadowPtr) {

commit 1ec47d75f37e1ab13145981524fc0c5bd6caae97
Author: Kevin E Martin <kem@kem.org>
Date:   Wed Oct 19 02:48:06 2005 +0000

    Update package version number for RC1 release.

diff --git a/configure.ac b/configure.ac
index 74a1765..68bd25e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        1.0.0,
+        1.0.0.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 

commit 12cd0de9c963f61347ffde4513d5ed7deced79cc
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date:   Tue Oct 18 00:01:55 2005 +0000

    Use @DRIVER_MAN_SUFFIX@ instead of $(DRIVER_MAN_SUFFIX) in macro
        substitutions to work better with BSD make

diff --git a/man/Makefile.am b/man/Makefile.am
index eb3fe06..a16ec06 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -29,7 +29,7 @@ drivermandir = $(mandir)/man$(DRIVER_MAN
 
 driverman_SOURCES = @DRIVER_NAME@.man
 
-driverman_DATA = $(driverman_SOURCES:man=$(DRIVER_MAN_SUFFIX))
+driverman_DATA = $(driverman_SOURCES:man=@DRIVER_MAN_SUFFIX@)
 
 EXTRA_DIST = @DRIVER_NAME@.man
 

commit 849b2b280720536ba318a3fb79b34b0eb920245d
Author: Adam Jackson <ajax@nwnk.net>
Date:   Mon Oct 17 22:57:37 2005 +0000

    More 1.7 braindamage: define EXTRA_DIST in terms of @DRIVER_NAME@ instead
        of indirectly

diff --git a/man/Makefile.am b/man/Makefile.am
index 0eabf46..eb3fe06 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -31,7 +31,7 @@ driverman_SOURCES = @DRIVER_NAME@.man
 
 driverman_DATA = $(driverman_SOURCES:man=$(DRIVER_MAN_SUFFIX))
 
-EXTRA_DIST = $(driverman_SOURCES)
+EXTRA_DIST = @DRIVER_NAME@.man
 
 CLEANFILES = $(driverman_DATA)
 

commit 08beda07409160136c8fbe846144731af699a66f
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date:   Mon Oct 17 00:09:08 2005 +0000

    Use sed & cpp to substitute variables in driver man pages

diff --git a/configure.ac b/configure.ac
index ebd70d8..74a1765 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,10 @@ # Checks for libraries.
 # Checks for header files.
 AC_HEADER_STDC
 
+DRIVER_NAME=vesa
+AC_SUBST([DRIVER_NAME])
+
+XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
 
 AC_OUTPUT([
diff --git a/man/Makefile.am b/man/Makefile.am
index 0adc2e4..0eabf46 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,22 +1,59 @@
-#  Copyright 2005 Adam Jackson.
+# $Id$
 #
-#  Permission is hereby granted, free of charge, to any person obtaining a
-#  copy of this software and associated documentation files (the "Software"),
-#  to deal in the Software without restriction, including without limitation
-#  on the rights to use, copy, modify, merge, publish, distribute, sub
-#  license, and/or sell copies of the Software, and to permit persons to whom
-#  the Software is furnished to do so, subject to the following conditions:
-#
-#  The above copyright notice and this permission notice (including the next
-#  paragraph) shall be included in all copies or substantial portions of the
-#  Software.
-#
-#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
-#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-dist_man_MANS = \
-         vesa.4
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# 
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation.
+# 
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+# 
+# Except as contained in this notice, the name of the copyright holders shall
+# not be used in advertising or otherwise to promote the sale, use or
+# other dealings in this Software without prior written authorization
+# from the copyright holders.
+# 
+
+drivermandir = $(mandir)/man$(DRIVER_MAN_SUFFIX)
+
+driverman_SOURCES = @DRIVER_NAME@.man
+
+driverman_DATA = $(driverman_SOURCES:man=$(DRIVER_MAN_SUFFIX))
+
+EXTRA_DIST = $(driverman_SOURCES)
+
+CLEANFILES = $(driverman_DATA)
+
+SED = sed
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+  XORGMANNAME = X Version 11
+
+MAN_SUBSTS = \
+	-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+	-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+	-e 's|__xservername__|Xorg|g' \
+	-e 's|__xconfigfile__|xorg.conf|g' \
+	-e 's|__projectroot__|$(prefix)|g' \
+	-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
+	-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
+	-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
+	-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
+	-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+
+SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
+
+.man.$(DRIVER_MAN_SUFFIX):
+	sed $(MAN_SUBSTS) < $< > $@

commit ff8c7b0b4d3c6789d9ff8d37e84f9c5a445c3515
Author: Daniel Stone <daniel@fooishbar.org>
Date:   Fri Aug 26 07:39:03 2005 +0000

    Wrap afb calls in #ifdef USE_AFB. (Debian #015)

diff --git a/src/vesa.h b/src/vesa.h
index f168a79..5bc5324 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -73,7 +73,11 @@ #include "xf86RAC.h"
 #include "xf1bpp.h"
 #include "xf4bpp.h"
 #include "fb.h"
+
+#ifdef USE_AFB
 #include "afb.h"
+#endif
+
 #include "mfb.h"
 
 #define VESA_VERSION		4000

commit 58313d626fbd332209f28e345aa8bdcc47113729
Author: Daniel Stone <daniel@fooishbar.org>
Date:   Fri Aug 26 06:55:35 2005 +0000

    Wrap afb calls in #ifdef USE_AFB. (Debian #015)

diff --git a/src/vesa.c b/src/vesa.c
index b3e06ff..6dce306 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -159,7 +159,9 @@ #ifdef XFree86LOADER
 static const char *miscfbSymbols[] = {
     "xf1bppScreenInit",
     "xf4bppScreenInit",
+#ifdef USE_AFB
     "afbScreenInit",
+#endif
     "mfbScreenInit",
     NULL
 };
@@ -680,9 +682,14 @@ #endif
 			reqSym = "xf4bppScreenInit";
 			break;
 		    default:
+#ifdef USE_AFB
 			mod = "afb";
 			reqSym = "afbScreenInit";
 			break;
+#else
+			xf86DrvMsg(pScrn->scrnIndex, X_ERROR, 
+				   "Unsupported bpp: %d", pScrn->bitsPerPixel);
+#endif
 		}
 	    }
 	    break;
@@ -863,9 +870,11 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 			    return (FALSE);
 			break;
 		    default:
+#ifdef USE_AFB
 			if (!afbScreenInit(pScreen, pVesa->base,
 					   pScrn->virtualX, pScrn->virtualY,
 					   pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth))
+#endif
 			    return (FALSE);
 			break;
 		}

commit 0a3e6b28c75312d42ed5dc5db3d31262d7ec3b75
Author: Daniel Stone <daniel@fooishbar.org>
Date:   Thu Aug 18 09:03:55 2005 +0000

    Update autogen.sh to one that does objdir != srcdir.

diff --git a/autogen.sh b/autogen.sh
index e81f989..904cd67 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -10,4 +10,3 @@ autoreconf -v --install || exit 1
 cd $ORIGDIR || exit $?
 
 $srcdir/configure --enable-maintainer-mode "$@"
-

commit 3251a5e09646f88a80b40385d2bb8e5417bdc388
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date:   Wed Aug 10 14:07:25 2005 +0000

    Don\'t lose existing CFLAGS in all the input drivers and some of the video
        drivers

diff --git a/configure.ac b/configure.ac
index b2800cd..ebd70d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ # Checks for pkg-config packages
 PKG_CHECK_MODULES(XORG, xorg-server xproto)
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
-CFLAGS="$XORG_CFLAGS "' -I$(top_srcdir)/src'
+CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
 INCLUDES="$XORG_INCS -I${sdkdir} "'-I$(top_srcdir)/src -I$(prefix)/include'
 AC_SUBST([CFLAGS])
 AC_SUBST([INCLUDES])

commit ab1ec5ee5b02d4cd3faf7ae5338fa4081ec1257c
Author: Kevin E Martin <kem@kem.org>
Date:   Fri Jul 29 21:22:46 2005 +0000

    Various changes preparing packages for RC0:
    - Verify and update package version numbers as needed
    - Implement versioning scheme
    - Change bug address to point to bugzilla bug entry form
    - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
        reenable it)
    - Fix makedepend to use pkgconfig and pass distcheck
    - Update build script to build macros first
    - Update modular Xorg version

diff --git a/configure.ac b/configure.ac
index 18afebd..b2800cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,8 +22,8 @@ # Process this file with autoconf to pro
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-vesa],
-        0.1.0,
-        [ajax@freedesktop.org],
+        1.0.0,
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-vesa)
 
 AC_CONFIG_SRCDIR([Makefile.am])
@@ -59,6 +59,8 @@ # Checks for libraries.
 # Checks for header files.
 AC_HEADER_STDC
 
+XORG_RELEASE_VERSION
+
 AC_OUTPUT([
 	Makefile
 	src/Makefile

commit dfe2847e4720793b4ff80d717aba31079a065392
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date:   Wed Jul 13 21:51:06 2005 +0000

    add Makefile.am

diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..0adc2e4
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,22 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+dist_man_MANS = \
+         vesa.4

commit 8100f70d79c0d1a405eeb576898a182cef8d4c3b
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date:   Wed Jul 13 21:50:33 2005 +0000

    add Makefile.am

diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..88da8a2
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,33 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+# this is obnoxious:
+# -module lets us name the module exactly how we want
+# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
+# _ladir passes a dummy rpath to libtool so the thing will actually link
+# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
+vesa_drv_la_LTLIBRARIES = vesa_drv.la
+vesa_drv_la_LDFLAGS = -module -avoid-version
+vesa_drv_ladir = @moduledir@/drivers
+
+vesa_drv_la_SOURCES = \
+         vesa.c \
+         vesa.h

commit be230c6144ff1dd12b0d7acce4a2a478c0be3527
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date:   Wed Jul 13 21:46:36 2005 +0000

    Build system for vesa video driver

diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..7052905
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,22 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+AUTOMAKE_OPTIONS = foreign
+SUBDIRS = src man
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..e81f989
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..18afebd
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,66 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Process this file with autoconf to produce a configure script
+
+AC_PREREQ(2.57)
+AC_INIT([xf86-video-vesa],
+        0.1.0,
+        [ajax@freedesktop.org],
+        xf86-video-vesa)
+
+AC_CONFIG_SRCDIR([Makefile.am])
+AM_CONFIG_HEADER([config.h])
+AC_CONFIG_AUX_DIR(.)
+
+AM_INIT_AUTOMAKE([dist-bzip2])
+
+AM_MAINTAINER_MODE
+
+# Checks for programs.
+AC_PROG_LIBTOOL
+AC_PROG_CC
+
+AH_TOP([#include "xorg-server.h"])
+
+AC_ARG_WITH(xorg-module-dir, [  --with-xorg-module-dir=DIR ],
+                             [ moduledir="$withval" ],
+                             [ moduledir="$libdir/xorg/modules" ])
+AC_SUBST(moduledir)
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XORG, xorg-server xproto)
+sdkdir=$(pkg-config --variable=sdkdir xorg-server)
+
+CFLAGS="$XORG_CFLAGS "' -I$(top_srcdir)/src'
+INCLUDES="$XORG_INCS -I${sdkdir} "'-I$(top_srcdir)/src -I$(prefix)/include'
+AC_SUBST([CFLAGS])
+AC_SUBST([INCLUDES])
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+
+AC_OUTPUT([
+	Makefile
+	src/Makefile
+	man/Makefile
+])

commit af35fdc8d552424cc74872aac364e48f42d5e409
Author: Adam Jackson <ajax@nwnk.net>
Date:   Mon Jul 11 02:30:06 2005 +0000

    Prep for modular builds by adding guarded #include "config.h" everywhere.

diff --git a/src/vesa.c b/src/vesa.c
index 58ea805..b3e06ff 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -31,6 +31,10 @@ #define DEBUG_VERB 2
  * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "vesa.h"
 
 /* All drivers initialising the SW cursor need this */

commit b3ef5c7885d59f81847e2e7394683c91617b5cc1
Author: Adam Jackson <ajax@nwnk.net>
Date:   Sat Jun 25 21:17:00 2005 +0000

    Bug #3626: _X_EXPORT tags for video and input drivers.

diff --git a/src/vesa.c b/src/vesa.c
index f81e7aa..58ea805 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -97,7 +97,7 @@ static Bool VESADGAInit(ScrnInfoPtr pScr
  * reference to this is compiled in, and this requires that the name of
  * this DriverRec be an upper-case version of the driver name.
  */
-DriverRec VESA = {
+_X_EXPORT DriverRec VESA = {
     VESA_VERSION,
     VESA_DRIVER_NAME,
     VESAIdentify,
@@ -227,7 +227,7 @@ static XF86ModuleVersionInfo vesaVersion
  * This data is accessed by the loader.  The name must be the module name
  * followed by "ModuleData".
  */
-XF86ModuleData vesaModuleData = { &vesaVersionRec, vesaSetup, NULL };
+_X_EXPORT XF86ModuleData vesaModuleData = { &vesaVersionRec, vesaSetup, NULL };
 
 static pointer
 vesaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)

commit 9f2b6b63add7822dea966f489f496c7a2edfa19c
Author: Egbert Eich <eich@suse.de>
Date:   Mon May 9 17:40:51 2005 +0000

    VBE Set Mode (0x02) to not clear the screen causes problems on some BIOSes.
        This fix adds an option to disable it (Bugzilla #3246).

diff --git a/man/vesa.man b/man/vesa.man
index 5a9dfd5..2806565 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.2 2001/01/27 18:20:56 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
@@ -14,7 +14,7 @@ vesa \- Generic VESA video driver
 .fi
 .SH DESCRIPTION
 .B vesa
-is an XFree86 driver for generic VESA video cards.  It can drive most
+is an __xservername__ driver for generic VESA video cards.  It can drive most
 VESA-compatible video cards, but only makes use of the basic standard
 VESA core that is common to these cards.  The driver supports depths 8, 15
 16 and 24.
@@ -24,7 +24,7 @@ The
 driver supports most VESA-compatible video cards.  There are some known
 exceptions, and those should be listed here.
 .SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
 details.  This section only covers configuration details specific to this
 driver.
 .PP
@@ -46,7 +46,14 @@ are supported:
 Enable or disable use of the shadow framebuffer layer.  Default: on.
 
 This option is recommended for performance reasons.
+.TP
+.BI "Option \*qModeSetClearScreen\*q \*q" boolean \*q
+Clear the screen on mode set. Some BIOSes seem to be broken in the
+sence that the newly set video mode is bogus if they are asked to 
+clear the screen during mode setting. If you experience problems try
+to turn this option off. Default: on.
+
 .SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86cfg(1), xf86config(1), Xserver(1), X(__miscmansuffix__)
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgcfg(__appmansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
 .SH AUTHORS
-Authors include: Paulo César Pereira de Andrade.
+Authors include: Paulo Ce\'sar Pereira de Andrade.
diff --git a/src/vesa.c b/src/vesa.c
index 0fc9ab5..f81e7aa 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -131,12 +131,15 @@ static IsaChipsets VESAISAchipsets[] = {
 
 typedef enum {
     OPTION_SHADOW_FB,
-    OPTION_DFLT_REFRESH
+    OPTION_DFLT_REFRESH,
+    OPTION_MODESET_CLEAR_SCREEN
 } VESAOpts;
 
 static const OptionInfoRec VESAOptions[] = {
     { OPTION_SHADOW_FB,    "ShadowFB",		OPTV_BOOLEAN,	{0},	FALSE },
     { OPTION_DFLT_REFRESH, "DefaultRefresh",	OPTV_BOOLEAN,	{0},	FALSE },
+    { OPTION_MODESET_CLEAR_SCREEN, "ModeSetClearScreen",
+						OPTV_BOOLEAN,	{0},	FALSE },
     { -1,		   NULL,		OPTV_NONE,	{0},	FALSE }
 };
 
@@ -638,6 +641,10 @@ #endif
     if (xf86ReturnOptValBool(pVesa->Options, OPTION_DFLT_REFRESH, FALSE))
 	pVesa->defaultRefresh = TRUE;
 
+    if (xf86ReturnOptValBool(pVesa->Options, OPTION_MODESET_CLEAR_SCREEN, 
+			     TRUE))
+	pVesa->ModeSetClearScreen = TRUE;
+
     if (!pVesa->defaultRefresh)
 	VBESetModeParameters(pScrn, pVesa->pVbe);
 
@@ -1025,7 +1032,16 @@ VESACloseScreen(int scrnIndex, ScreenPtr
 static Bool
 VESASwitchMode(int scrnIndex, DisplayModePtr pMode, int flags)
 {
-    return VESASetMode(xf86Screens[scrnIndex], pMode);
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+    VESAPtr pVesa = VESAGetRec(pScrn);
+    Bool ret;
+
+    if (pVesa->ModeSetClearScreen) 
+	pScrn->EnableDisableFBAccess(scrnIndex,FALSE);
+    ret = VESASetMode(xf86Screens[scrnIndex], pMode);
+    if (pVesa->ModeSetClearScreen) 
+	pScrn->EnableDisableFBAccess(scrnIndex,TRUE);
+    return ret;
 }
 
 /* Set a graphics mode */
@@ -1039,8 +1055,7 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayMo
     pVesa = VESAGetRec(pScrn);
 
     data = (VbeModeInfoData*)pMode->Private;
-
-    mode = data->mode | (1 << 15);
+    mode = data->mode | ( pVesa->ModeSetClearScreen ?  (1U << 15)  : 0);
 
     /* enable linear addressing */
     if (pVesa->mapPhys != 0xa0000)
@@ -1071,7 +1086,7 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayMo
     if (data->data->XResolution != pScrn->displayWidth)
 	VBESetLogicalScanline(pVesa->pVbe, pScrn->displayWidth);
 
-    if (pScrn->bitsPerPixel >= 8 && pVesa->vbeInfo->Capabilities[0] & 0x01)
+    if (pScrn->bitsPerPixel == 8 && pVesa->vbeInfo->Capabilities[0] & 0x01)
 	VBESetGetDACPaletteFormat(pVesa->pVbe, 8);
 
     pScrn->vtSema = TRUE;
diff --git a/src/vesa.h b/src/vesa.h
index 390a25b..f168a79 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -116,6 +116,7 @@ typedef struct _VESARec
     CloseScreenProcPtr CloseScreen;
     OptionInfoPtr Options;
     IOADDRESS ioBase;
+    Bool ModeSetClearScreen;
 } VESARec, *VESAPtr;
 
 

commit 0b142fd735496c72ead409e1f89caa1da8d80f6e
Author: Daniel Stone <daniel@fooishbar.org>
Date:   Wed Apr 20 12:25:32 2005 +0000

    Fix includes right throughout the Xserver tree:
    change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h;
    change "foo.h", "extensions/foo.h" and "X11/foo.h" to
        <X11/extensions/foo.h> for extension headers, e.g. Xv.h;
    change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.

diff --git a/src/vesa.c b/src/vesa.c
index 5c43e7e..0fc9ab5 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -45,7 +45,7 @@ #include "xf86cmap.h"
 
 /* DPMS */
 #define DPMS_SERVER
-#include "extensions/dpms.h"
+#include <X11/extensions/dpms.h>
 
 /* Mandatory functions */
 static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid);

commit 16af3cc966b0f79388e9a8a68f75f62f6c30a756
Author: Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>
Date:   Sat Dec 4 00:43:10 2004 +0000

    Encoding of numerous files changed to UTF-8

diff --git a/src/vesa.c b/src/vesa.c
index 77b7ae2..5c43e7e 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -25,7 +25,7 @@ #define DEBUG_VERB 2
  * dealings in this Software without prior written authorization from
  * Conectiva Linux.
  *
- * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
  * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
diff --git a/src/vesa.h b/src/vesa.h
index 2bb19c1..390a25b 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -24,7 +24,7 @@
  * dealings in this Software without prior written authorization from
  * Conectiva Linux.
  *
- * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
  * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
  */

commit 160cc48048a4944d0a8d0b8a42c22bae61de0319
Author: Adam Jackson <ajax@nwnk.net>
Date:   Fri Sep 17 03:04:54 2004 +0000

    Bug #1192: Remove cfb support from drivers where its use is an option.
        Delete xf24_32bpp, as s3virge was the last user. Fix up some comments
        to refer to fb rather than cfb.

diff --git a/src/vesa.h b/src/vesa.h
index cc448eb..2bb19c1 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
  */
 
 #ifndef _VESA_H_
@@ -75,7 +75,6 @@ #include "xf4bpp.h"
 #include "fb.h"
 #include "afb.h"
 #include "mfb.h"
-#include "cfb24_32.h"
 
 #define VESA_VERSION		4000
 #define VESA_NAME		"VESA"

commit 09f88863a0bdf236200107631ff93f27bb03f6f4
Author: Adam Jackson <ajax@nwnk.net>
Date:   Wed Aug 11 19:52:13 2004 +0000

    Fix vesa.c's shadow symbol list.

diff --git a/src/vesa.c b/src/vesa.c
index 9a0f682..77b7ae2 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -167,9 +167,9 @@ static const char *fbSymbols[] = {
 static const char *shadowSymbols[] = {
     "shadowAlloc",
     "shadowInit",
-    "shadowUpdatePacked",
-    "shadowUpdatePlanar4",
-    "shadowUpdatePlanar4x8",
+    "shadowUpdatePackedWeak",
+    "shadowUpdatePlanar4Weak",
+    "shadowUpdatePlanar4x8Weak",
     NULL
 };
 

commit 088edb719db194dd352c09ae3fa799e4653de9e6
Author: Adam Jackson <ajax@nwnk.net>
Date:   Tue Aug 3 02:44:21 2004 +0000

    Bug #962: Remove LoaderSymbol calls introduced by the dlloader work so
        DoLoadableServer NO builds work again.

diff --git a/src/vesa.c b/src/vesa.c
index d8bb5ae..9a0f682 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -909,17 +909,17 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 
 	if (mode->MemoryModel == 3) {	/* Planar */
 	  if (pScrn->bitsPerPixel == 8)
-		update = LoaderSymbol("shadowUpdatePlanar4x8");
+		update = shadowUpdatePlanar4x8Weak();
 	    else
-		update = LoaderSymbol("shadowUpdatePlanar4");
+		update = shadowUpdatePlanar4Weak();
 	    window = VESAWindowPlanar;
 	}
 	else if (pVesa->mapPhys == 0xa0000) {	/* Windowed */
-	    update = LoaderSymbol("shadowUpdatePacked");
+	    update = shadowUpdatePackedWeak();
 	    window = VESAWindowWindowed;
 	}
 	else {	/* Linear */
-	    update = LoaderSymbol("shadowUpdatePacked");
+	    update = shadowUpdatePackedWeak();
 	    window = VESAWindowLinear;
 	}
 

commit a6a753d5a5c1c167670a4144c7ace39d688fd1e5
Author: Adam Jackson <ajax@nwnk.net>
Date:   Fri Jul 30 20:30:55 2004 +0000

    Bug #400 (partial): Driver fixes for the dlloader. When using dlloader, all
        framebuffer formats except cfb and the overlay modes should work, and
        r128 and radeon need to be loaded from the ati driver (both issues to
        be fixed soon). Tested on i740, s3virge, mach64, tdfx, vesa, and vga
        drivers. elfloader users shouldn't be affected.

diff --git a/src/vesa.c b/src/vesa.c
index a606284..d8bb5ae 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.37 2003/08/23 16:09:22 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
  */
 
 #include "vesa.h"
@@ -212,7 +212,7 @@ static XF86ModuleVersionInfo vesaVersion
     MODULEVENDORSTRING,
     MODINFOSTRING1,
     MODINFOSTRING2,
-    XF86_VERSION_CURRENT,
+    XORG_VERSION_CURRENT,
     VESA_MAJOR_VERSION, VESA_MINOR_VERSION, VESA_PATCHLEVEL,
     ABI_CLASS_VIDEODRV,			/* This is a video driver */
     ABI_VIDEODRV_VERSION,
@@ -439,7 +439,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags
     const char *reqSym = NULL;
     Gamma gzeros = {0.0, 0.0, 0.0};
     rgb rzeros = {0, 0, 0};
-    pointer pVbeModule, pDDCModule;
+    pointer pDDCModule;
     int i;
     int flags24 = 0;
     int defaultDepth = 0;
@@ -462,7 +462,7 @@ #if 0
 #endif
 
     /* Load vbe module */
-    if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL)
+    if (!xf86LoadSubModule(pScrn, "vbe"))
         return (FALSE);
 
     xf86LoaderReqSymLists(vbeSymbols, NULL);
@@ -585,85 +585,6 @@ #endif
 
     VBESetModeNames(pScrn->modePool);
 
-    /*
-     * If DDC information is available, use it to try to set the monitor
-     * parameters if they're not already set.
-     *
-     * The common layer will already do this, but doesn't try as hard.  If
-     * this proves useful, it should probably be moved into the common layer.
-     */
-    if (pVesa->monitor != NULL) {
-	MonPtr pMon;
-
-	pMon = pScrn->monitor;
-	if (pMon->nHsync == 0 || pMon->nVrefresh == 0) {
-	    struct monitor_ranges *mRange;
-	    float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0;
-	    float h;
-	    struct std_timings *t;
-	    int j, k;
-
-	    j = 0;
-	    for (i = 0; i < DET_TIMINGS; i++) {
-		if (pVesa->monitor->det_mon[i].type == DS_RANGES) {
-		    mRange = &pVesa->monitor->det_mon[i].section.ranges;
-		    pMon->hsync[j].lo = mRange->min_h;
-		    pMon->hsync[j].hi = mRange->max_h;
-		    pMon->vrefresh[j].lo = mRange->min_v;
-		    pMon->vrefresh[j].hi = mRange->max_v;
-		    j++;
-		} else if (pVesa->monitor->det_mon[i].type == DS_STD_TIMINGS) {
-		    t = pVesa->monitor->det_mon[i].section.std_t;
-		    for (k = 0; k < 5; k++) {
-			if (t[k].hsize > 256) { /* sanity check */
-			    if (t[k].refresh < vmin)
-				vmin = t[i].refresh;
-			    if (t[k].refresh > vmax)
-				vmax = t[i].refresh;
-			    h = t[k].refresh * 1.07 * t[k].vsize / 1000.0;
-			    if (h < hmin)
-				hmin = h;
-			    if (h > hmax)
-				hmax = h;
-			}
-		    }
-		}
-		
-		if (j > MAX_HSYNC)
-		    break;
-	    }
-
-	    if (j == 0) {
-		t = pVesa->monitor->timings2;
-		for (i = 0; i < STD_TIMINGS; i++) {
-		    if (t[i].hsize > 256) { /* sanity check */
-			if (t[i].refresh < vmin)
-			    vmin = t[i].refresh;
-			if (t[i].refresh > vmax)
-			    vmax = t[i].refresh;
-			h = t[i].refresh * 1.07 * t[i].vsize / 1000.0;
-			if (h < hmin)
-			    hmin = h;
-			if (h > hmax)
-			    hmax = h;
-		    }
-		}
-		if (hmax > 0.0) {
-		    pMon->hsync[j].lo = hmin;
-		    pMon->hsync[j].hi = hmax;
-		    pMon->vrefresh[j].lo = vmin;
-		    pMon->vrefresh[j].hi = vmax;
-		    j++;
-		}
-	    }
-	    if (j > 0) {
-		pMon->nHsync = pMon->nVrefresh = j;
-		xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-			   "Monitor parameters set to DDC-probed values\n");
-	    }
-	}
-    }
-
     i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, 
 			  NULL, NULL, 0, 2048, 1, 0, 2048,
 			  pScrn->display->virtualX,
@@ -862,6 +783,12 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
     if (!VESASetMode(pScrn, pScrn->currentMode))
 	return (FALSE);
 
+    /* set the viewport */
+    VESAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+
+    /* Blank the screen for aesthetic reasons. */
+    VESASaveScreen(pScreen, SCREEN_SAVER_ON);
+
     /* mi layer */
     miClearVisualTypes();
     if (!xf86SetDefaultVisual(pScrn, -1))
@@ -982,17 +909,17 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 
 	if (mode->MemoryModel == 3) {	/* Planar */
 	  if (pScrn->bitsPerPixel == 8)
-		update = shadowUpdatePlanar4x8;
+		update = LoaderSymbol("shadowUpdatePlanar4x8");
 	    else
-		update = shadowUpdatePlanar4;
+		update = LoaderSymbol("shadowUpdatePlanar4");
 	    window = VESAWindowPlanar;
 	}
 	else if (pVesa->mapPhys == 0xa0000) {	/* Windowed */
-	    update = shadowUpdatePacked;
+	    update = LoaderSymbol("shadowUpdatePacked");
 	    window = VESAWindowWindowed;
 	}
 	else {	/* Linear */
-	    update = shadowUpdatePacked;
+	    update = LoaderSymbol("shadowUpdatePacked");
 	    window = VESAWindowLinear;
 	}
 
@@ -1054,8 +981,12 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 static Bool
 VESAEnterVT(int scrnIndex, int flags)
 {
-    return (VESASetMode(xf86Screens[scrnIndex],
-			xf86Screens[scrnIndex]->currentMode));
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+
+    if (!VESASetMode(pScrn, pScrn->currentMode))
+	return FALSE;
+    VESAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+    return TRUE;
 }
 
 static void
@@ -1194,7 +1125,7 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB,
 		   "virtual address = %p,\n"
-		   "\tphysical address = %p, size = %d\n",
+		   "\tphysical address = 0x%lx, size = %ld\n",
 		   pVesa->base, pScrn->memPhysBase, pVesa->mapSize);
 
     return (pVesa->base != NULL);
@@ -1329,9 +1260,7 @@ #endif
 static void
 WriteAttr(VESAPtr pVesa, int index, int value)
 {
-    CARD8 tmp;
-
-    tmp = inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
+    (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
 
     index |= 0x20;
     outb(pVesa->ioBase + VGA_ATTR_INDEX, index);
@@ -1341,9 +1270,7 @@ WriteAttr(VESAPtr pVesa, int index, int 
 static int
 ReadAttr(VESAPtr pVesa, int index)
 {
-    CARD8 tmp;
-
-    tmp = inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
+    (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
 
     index |= 0x20;
     outb(pVesa->ioBase + VGA_ATTR_INDEX, index);

commit 03b2fd85a09d9787d1895cdb7e418e7543288fd9
Author: Eric Anholt <anholt@freebsd.org>
Date:   Wed Jun 16 09:24:10 2004 +0000

    DRI XFree86-4_3_99_12-merge import

diff --git a/man/vesa.man b/man/vesa.man
index 4ae43bb..5a9dfd5 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.2 2001/01/27 18:20:56 dawes Exp $ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
@@ -14,7 +14,7 @@ vesa \- Generic VESA video driver
 .fi
 .SH DESCRIPTION
 .B vesa
-is an __xservername__ driver for generic VESA video cards.  It can drive most
+is an XFree86 driver for generic VESA video cards.  It can drive most
 VESA-compatible video cards, but only makes use of the basic standard
 VESA core that is common to these cards.  The driver supports depths 8, 15
 16 and 24.
@@ -24,7 +24,7 @@ The
 driver supports most VESA-compatible video cards.  There are some known
 exceptions, and those should be listed here.
 .SH CONFIGURATION DETAILS
-Please refer to __xconfigfile__(__filemansuffix__) for general configuration
+Please refer to XF86Config(__filemansuffix__) for general configuration
 details.  This section only covers configuration details specific to this
 driver.
 .PP
@@ -47,6 +47,6 @@ Enable or disable use of the shadow fram
 
 This option is recommended for performance reasons.
 .SH "SEE ALSO"
-__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgcfg(__appmansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
+XFree86(1), XF86Config(__filemansuffix__), xf86cfg(1), xf86config(1), Xserver(1), X(__miscmansuffix__)
 .SH AUTHORS
-Authors include: Paulo Ce\'sar Pereira de Andrade.
+Authors include: Paulo César Pereira de Andrade.
diff --git a/src/vesa.c b/src/vesa.c
index 298391e..a606284 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.37 2003/08/23 16:09:22 dawes Exp $
  */
 
 #include "vesa.h"
@@ -212,7 +212,7 @@ static XF86ModuleVersionInfo vesaVersion
     MODULEVENDORSTRING,
     MODINFOSTRING1,
     MODINFOSTRING2,
-    XORG_VERSION_CURRENT,
+    XF86_VERSION_CURRENT,
     VESA_MAJOR_VERSION, VESA_MINOR_VERSION, VESA_PATCHLEVEL,
     ABI_CLASS_VIDEODRV,			/* This is a video driver */
     ABI_VIDEODRV_VERSION,
@@ -439,7 +439,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags
     const char *reqSym = NULL;
     Gamma gzeros = {0.0, 0.0, 0.0};
     rgb rzeros = {0, 0, 0};
-    pointer pDDCModule;
+    pointer pVbeModule, pDDCModule;
     int i;
     int flags24 = 0;
     int defaultDepth = 0;
@@ -462,7 +462,7 @@ #if 0
 #endif
 
     /* Load vbe module */
-    if (!xf86LoadSubModule(pScrn, "vbe"))
+    if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL)
         return (FALSE);
 
     xf86LoaderReqSymLists(vbeSymbols, NULL);
@@ -585,6 +585,85 @@ #endif
 
     VBESetModeNames(pScrn->modePool);
 
+    /*
+     * If DDC information is available, use it to try to set the monitor
+     * parameters if they're not already set.
+     *
+     * The common layer will already do this, but doesn't try as hard.  If
+     * this proves useful, it should probably be moved into the common layer.
+     */
+    if (pVesa->monitor != NULL) {
+	MonPtr pMon;
+
+	pMon = pScrn->monitor;
+	if (pMon->nHsync == 0 || pMon->nVrefresh == 0) {
+	    struct monitor_ranges *mRange;
+	    float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0;
+	    float h;
+	    struct std_timings *t;
+	    int j, k;
+
+	    j = 0;
+	    for (i = 0; i < DET_TIMINGS; i++) {
+		if (pVesa->monitor->det_mon[i].type == DS_RANGES) {
+		    mRange = &pVesa->monitor->det_mon[i].section.ranges;
+		    pMon->hsync[j].lo = mRange->min_h;
+		    pMon->hsync[j].hi = mRange->max_h;
+		    pMon->vrefresh[j].lo = mRange->min_v;
+		    pMon->vrefresh[j].hi = mRange->max_v;
+		    j++;
+		} else if (pVesa->monitor->det_mon[i].type == DS_STD_TIMINGS) {
+		    t = pVesa->monitor->det_mon[i].section.std_t;
+		    for (k = 0; k < 5; k++) {
+			if (t[k].hsize > 256) { /* sanity check */
+			    if (t[k].refresh < vmin)
+				vmin = t[i].refresh;
+			    if (t[k].refresh > vmax)
+				vmax = t[i].refresh;
+			    h = t[k].refresh * 1.07 * t[k].vsize / 1000.0;
+			    if (h < hmin)
+				hmin = h;
+			    if (h > hmax)
+				hmax = h;
+			}
+		    }
+		}
+		
+		if (j > MAX_HSYNC)
+		    break;
+	    }
+
+	    if (j == 0) {
+		t = pVesa->monitor->timings2;
+		for (i = 0; i < STD_TIMINGS; i++) {
+		    if (t[i].hsize > 256) { /* sanity check */
+			if (t[i].refresh < vmin)
+			    vmin = t[i].refresh;
+			if (t[i].refresh > vmax)
+			    vmax = t[i].refresh;
+			h = t[i].refresh * 1.07 * t[i].vsize / 1000.0;
+			if (h < hmin)
+			    hmin = h;
+			if (h > hmax)
+			    hmax = h;
+		    }
+		}
+		if (hmax > 0.0) {
+		    pMon->hsync[j].lo = hmin;
+		    pMon->hsync[j].hi = hmax;
+		    pMon->vrefresh[j].lo = vmin;
+		    pMon->vrefresh[j].hi = vmax;
+		    j++;
+		}
+	    }
+	    if (j > 0) {
+		pMon->nHsync = pMon->nVrefresh = j;
+		xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+			   "Monitor parameters set to DDC-probed values\n");
+	    }
+	}
+    }
+
     i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, 
 			  NULL, NULL, 0, 2048, 1, 0, 2048,
 			  pScrn->display->virtualX,
@@ -783,12 +862,6 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
     if (!VESASetMode(pScrn, pScrn->currentMode))
 	return (FALSE);
 
-    /* set the viewport */
-    VESAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
-
-    /* Blank the screen for aesthetic reasons. */
-    VESASaveScreen(pScreen, SCREEN_SAVER_ON);
-
     /* mi layer */
     miClearVisualTypes();
     if (!xf86SetDefaultVisual(pScrn, -1))
@@ -981,12 +1054,8 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 static Bool
 VESAEnterVT(int scrnIndex, int flags)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
-    if (!VESASetMode(pScrn, pScrn->currentMode))
-	return FALSE;
-    VESAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
-    return TRUE;
+    return (VESASetMode(xf86Screens[scrnIndex],
+			xf86Screens[scrnIndex]->currentMode));
 }
 
 static void
@@ -1125,7 +1194,7 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB,
 		   "virtual address = %p,\n"
-		   "\tphysical address = 0x%lx, size = %ld\n",
+		   "\tphysical address = %p, size = %d\n",
 		   pVesa->base, pScrn->memPhysBase, pVesa->mapSize);
 
     return (pVesa->base != NULL);
@@ -1260,7 +1329,9 @@ #endif
 static void
 WriteAttr(VESAPtr pVesa, int index, int value)
 {
-    (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
+    CARD8 tmp;
+
+    tmp = inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
 
     index |= 0x20;
     outb(pVesa->ioBase + VGA_ATTR_INDEX, index);
@@ -1270,7 +1341,9 @@ WriteAttr(VESAPtr pVesa, int index, int 
 static int
 ReadAttr(VESAPtr pVesa, int index)
 {
-    (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
+    CARD8 tmp;
+
+    tmp = inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
 
     index |= 0x20;
     outb(pVesa->ioBase + VGA_ATTR_INDEX, index);
diff --git a/src/vesa.h b/src/vesa.h
index 78b9e1e..cc448eb 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
  */
 
 #ifndef _VESA_H_

commit 283c0359be82bfac45781ad06d2ff0965daef73e
Author: Egbert Eich <eich@suse.de>
Date:   Fri Apr 23 19:52:54 2004 +0000

    Merging XORG-CURRENT into trunk

diff --git a/man/vesa.man b/man/vesa.man
index 5a9dfd5..4ae43bb 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.2 2001/01/27 18:20:56 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
@@ -14,7 +14,7 @@ vesa \- Generic VESA video driver
 .fi
 .SH DESCRIPTION
 .B vesa
-is an XFree86 driver for generic VESA video cards.  It can drive most
+is an __xservername__ driver for generic VESA video cards.  It can drive most
 VESA-compatible video cards, but only makes use of the basic standard
 VESA core that is common to these cards.  The driver supports depths 8, 15
 16 and 24.
@@ -24,7 +24,7 @@ The
 driver supports most VESA-compatible video cards.  There are some known
 exceptions, and those should be listed here.
 .SH CONFIGURATION DETAILS
-Please refer to XF86Config(__filemansuffix__) for general configuration
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
 details.  This section only covers configuration details specific to this
 driver.
 .PP
@@ -47,6 +47,6 @@ Enable or disable use of the shadow fram
 
 This option is recommended for performance reasons.
 .SH "SEE ALSO"
-XFree86(1), XF86Config(__filemansuffix__), xf86cfg(1), xf86config(1), Xserver(1), X(__miscmansuffix__)
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgcfg(__appmansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
 .SH AUTHORS
-Authors include: Paulo César Pereira de Andrade.
+Authors include: Paulo Ce\'sar Pereira de Andrade.
diff --git a/src/vesa.c b/src/vesa.c
index 86eb228..298391e 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.41 2003/11/07 22:50:57 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
  */
 
 #include "vesa.h"
@@ -212,7 +212,7 @@ static XF86ModuleVersionInfo vesaVersion
     MODULEVENDORSTRING,
     MODINFOSTRING1,
     MODINFOSTRING2,
-    XF86_VERSION_CURRENT,
+    XORG_VERSION_CURRENT,
     VESA_MAJOR_VERSION, VESA_MINOR_VERSION, VESA_PATCHLEVEL,
     ABI_CLASS_VIDEODRV,			/* This is a video driver */
     ABI_VIDEODRV_VERSION,
diff --git a/src/vesa.h b/src/vesa.h
index cc448eb..78b9e1e 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
  */
 
 #ifndef _VESA_H_

commit fd59c1875f4f249cf42b46cfa763a1d221463f74
Author: Egbert Eich <eich@suse.de>
Date:   Sun Mar 14 08:33:41 2004 +0000

    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004

diff --git a/man/vesa.man b/man/vesa.man
index 1a4bbef..5a9dfd5 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.2 2001/01/27 18:20:56 dawes Exp $ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
diff --git a/src/vesa.c b/src/vesa.c
index f37318b..86eb228 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.41 2003/11/07 22:50:57 dawes Exp $
  */
 
 #include "vesa.h"
diff --git a/src/vesa.h b/src/vesa.h
index 78b9e1e..cc448eb 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
  */
 
 #ifndef _VESA_H_

commit 3837d4b3421a71c631b6f17813c747446bf49246
Author: Egbert Eich <eich@suse.de>
Date:   Wed Mar 3 12:12:28 2004 +0000

    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004

diff --git a/man/vesa.man b/man/vesa.man
index 5a9dfd5..1a4bbef 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.2 2001/01/27 18:20:56 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
diff --git a/src/vesa.c b/src/vesa.c
index 86eb228..f37318b 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.41 2003/11/07 22:50:57 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.40 2003/11/03 05:11:45 tsi Exp $
  */
 
 #include "vesa.h"
diff --git a/src/vesa.h b/src/vesa.h
index cc448eb..78b9e1e 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.12 2002/08/06 13:46:27 dawes Exp $
  */
 
 #ifndef _VESA_H_

commit acd0b5c42b504749bb6bd3f0c416fc838fc31b05
Author: Egbert Eich <eich@suse.de>
Date:   Thu Feb 26 13:35:55 2004 +0000

    readding XFree86's cvs IDs

diff --git a/man/vesa.man b/man/vesa.man
index a614457..5a9dfd5 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86$ 
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
diff --git a/src/vesa.c b/src/vesa.c
index ba0e609..86eb228 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86$
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.41 2003/11/07 22:50:57 dawes Exp $
  */
 
 #include "vesa.h"
diff --git a/src/vesa.h b/src/vesa.h
index 9de531c..cc448eb 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86$
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
  */
 
 #ifndef _VESA_H_

commit 11f19e03e7d229b3828513d464288c4aad99d26d
Author: Egbert Eich <eich@suse.de>
Date:   Thu Feb 26 09:23:28 2004 +0000

    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004

diff --git a/man/vesa.man b/man/vesa.man
index 5a9dfd5..a614457 100644
--- a/man/vesa.man
+++ b/man/vesa.man
@@ -1,4 +1,4 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ 
+.\" $XFree86$ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH VESA __drivermansuffix__ __vendorversion__
diff --git a/src/vesa.c b/src/vesa.c
index 86eb228..ba0e609 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.41 2003/11/07 22:50:57 dawes Exp $
+ * $XFree86$
  */
 
 #include "vesa.h"
diff --git a/src/vesa.h b/src/vesa.h
index cc448eb..9de531c 100644
--- a/src/vesa.h
+++ b/src/vesa.h
@@ -26,7 +26,7 @@
  *
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $
+ * $XFree86$
  */
 
 #ifndef _VESA_H_

commit 617431e758a198202ba5f54347492e9b25084c07
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date:   Tue Nov 25 19:28:43 2003 +0000

    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks

diff --git a/src/vesa.c b/src/vesa.c
index f54becc..86eb228 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -28,7 +28,7 @@ #define DEBUG_VERB 2
  * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
  *          David Dawes <dawes@xfree86.org>
  *
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.36 2003/01/23 17:20:46 tsi Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.41 2003/11/07 22:50:57 dawes Exp $
  */
 
 #include "vesa.h"
@@ -148,6 +148,7 @@ static const OptionInfoRec VESAOptions[]
  * xf86LoaderReqSymLists().  The purpose is this is to avoid warnings about
  * unresolved symbols that are not required.
  */
+#ifdef XFree86LOADER
 static const char *miscfbSymbols[] = {
     "xf1bppScreenInit",
     "xf4bppScreenInit",
@@ -155,6 +156,7 @@ static const char *miscfbSymbols[] = {
     "mfbScreenInit",
     NULL
 };
+#endif
 
 static const char *fbSymbols[] = {
     "fbPictureInit",
@@ -193,13 +195,13 @@ static const char *vbeSymbols[] = {
     NULL
 };
 
+#ifdef XFree86LOADER
 static const char *ddcSymbols[] = {
     "xf86PrintEDID",
     "xf86SetDDCproperties",
     NULL
 };
 
-#ifdef XFree86LOADER
 
 /* Module loader interface */
 static MODULESETUPPROTO(vesaSetup);
@@ -437,7 +439,7 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags
     const char *reqSym = NULL;
     Gamma gzeros = {0.0, 0.0, 0.0};
     rgb rzeros = {0, 0, 0};
-    pointer pVbeModule, pDDCModule;
+    pointer pDDCModule;
     int i;
     int flags24 = 0;
     int defaultDepth = 0;
@@ -460,7 +462,7 @@ #if 0
 #endif
 
     /* Load vbe module */
-    if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL)
+    if (!xf86LoadSubModule(pScrn, "vbe"))
         return (FALSE);
 
     xf86LoaderReqSymLists(vbeSymbols, NULL);
@@ -583,85 +585,6 @@ #endif
 
     VBESetModeNames(pScrn->modePool);
 
-    /*
-     * If DDC information is available, use it to try to set the monitor
-     * parameters if they're not already set.
-     *
-     * The common layer will already do this, but doesn't try as hard.  If
-     * this proves useful, it should probably be moved into the common layer.
-     */
-    if (pVesa->monitor != NULL) {
-	MonPtr pMon;
-
-	pMon = pScrn->monitor;
-	if (pMon->nHsync == 0 || pMon->nVrefresh == 0) {
-	    struct monitor_ranges *mRange;
-	    float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0;
-	    float h;
-	    struct std_timings *t;
-	    int j, k;
-
-	    j = 0;
-	    for (i = 0; i < DET_TIMINGS; i++) {
-		if (pVesa->monitor->det_mon[i].type == DS_RANGES) {
-		    mRange = &pVesa->monitor->det_mon[i].section.ranges;
-		    pMon->hsync[j].lo = mRange->min_h;
-		    pMon->hsync[j].hi = mRange->max_h;
-		    pMon->vrefresh[j].lo = mRange->min_v;
-		    pMon->vrefresh[j].hi = mRange->max_v;
-		    j++;
-		} else if (pVesa->monitor->det_mon[i].type == DS_STD_TIMINGS) {
-		    t = pVesa->monitor->det_mon[i].section.std_t;
-		    for (k = 0; k < 5; k++) {
-			if (t[k].hsize > 256) { /* sanity check */
-			    if (t[k].refresh < vmin)
-				vmin = t[i].refresh;
-			    if (t[k].refresh > vmax)
-				vmax = t[i].refresh;
-			    h = t[k].refresh * 1.07 * t[k].vsize / 1000.0;
-			    if (h < hmin)
-				hmin = h;
-			    if (h > hmax)
-				hmax = h;
-			}
-		    }
-		}
-		
-		if (j > MAX_HSYNC)
-		    break;
-	    }
-
-	    if (j == 0) {
-		t = pVesa->monitor->timings2;
-		for (i = 0; i < STD_TIMINGS; i++) {
-		    if (t[i].hsize > 256) { /* sanity check */
-			if (t[i].refresh < vmin)
-			    vmin = t[i].refresh;
-			if (t[i].refresh > vmax)
-			    vmax = t[i].refresh;
-			h = t[i].refresh * 1.07 * t[i].vsize / 1000.0;
-			if (h < hmin)
-			    hmin = h;
-			if (h > hmax)
-			    hmax = h;
-		    }
-		}
-		if (hmax > 0.0) {
-		    pMon->hsync[j].lo = hmin;
-		    pMon->hsync[j].hi = hmax;
-		    pMon->vrefresh[j].lo = vmin;
-		    pMon->vrefresh[j].hi = vmax;
-		    j++;
-		}
-	    }
-	    if (j > 0) {
-		pMon->nHsync = pMon->nVrefresh = j;
-		xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-			   "Monitor parameters set to DDC-probed values\n");
-	    }
-	}
-    }
-
     i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, 
 			  NULL, NULL, 0, 2048, 1, 0, 2048,
 			  pScrn->display->virtualX,
@@ -860,6 +783,12 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
     if (!VESASetMode(pScrn, pScrn->currentMode))
 	return (FALSE);
 
+    /* set the viewport */
+    VESAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+
+    /* Blank the screen for aesthetic reasons. */
+    VESASaveScreen(pScreen, SCREEN_SAVER_ON);
+
     /* mi layer */
     miClearVisualTypes();
     if (!xf86SetDefaultVisual(pScrn, -1))
@@ -1052,8 +981,12 @@ VESAScreenInit(int scrnIndex, ScreenPtr 
 static Bool
 VESAEnterVT(int scrnIndex, int flags)
 {
-    return (VESASetMode(xf86Screens[scrnIndex],
-			xf86Screens[scrnIndex]->currentMode));
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+
+    if (!VESASetMode(pScrn, pScrn->currentMode))
+	return FALSE;
+    VESAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+    return TRUE;
 }
 
 static void
@@ -1192,7 +1125,7 @@ VESAMapVidMem(ScrnInfoPtr pScrn)
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB,
 		   "virtual address = %p,\n"
-		   "\tphysical address = %p, size = %d\n",
+		   "\tphysical address = 0x%lx, size = %ld\n",
 		   pVesa->base, pScrn->memPhysBase, pVesa->mapSize);
 
     return (pVesa->base != NULL);
@@ -1327,9 +1260,7 @@ #endif
 static void
 WriteAttr(VESAPtr pVesa, int index, int value)
 {
-    CARD8 tmp;
-
-    tmp = inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
+    (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
 
     index |= 0x20;
     outb(pVesa->ioBase + VGA_ATTR_INDEX, index);
@@ -1339,9 +1270,7 @@ WriteAttr(VESAPtr pVesa, int index, int 
 static int
 ReadAttr(VESAPtr pVesa, int index)
 {
-    CARD8 tmp;
-
-    tmp = inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
+    (void) inb(pVesa->ioBase + VGA_IOBASE_COLOR + VGA_IN_STAT_1_OFFSET);
 
     index |= 0x20;
     outb(pVesa->ioBase + VGA_ATTR_INDEX, index);



Reply to: