README | 20 ++++++++ configure.ac | 10 +++- man/vesa.man | 2 src/vesa.c | 141 +++++++++++++++++++++++++---------------------------------- src/vesa.h | 6 +- 5 files changed, 95 insertions(+), 84 deletions(-)
New commits: commit 68ca3d10ab33ee2347928b0340198aff4f620144 Author: Adam Jackson <[email protected]> Date: Tue Feb 17 18:04:29 2009 -0500 vesa 2.2.0 diff --git a/configure.ac b/configure.ac index 62e710f..090be35 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-vesa], - 2.1.0, + 2.2.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-vesa) commit 817fb65fc3a95d6c34952f241c92ba2d3760968e Author: Adam Jackson <[email protected]> Date: Thu Feb 5 16:09:32 2009 -0500 Add yet another pass to mode validation. Now it's: exact intersection, range based, optimistic range based. The final pass tries to stretch out the bottom of the sync ranges to fit down to 640x480. We'll skip the last pass if the sync range is already that optimistic though. diff --git a/src/vesa.c b/src/vesa.c index 2e1b2f7..aee5018 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -536,6 +536,22 @@ VESAFreeRec(ScrnInfoPtr pScrn) pScrn->driverPrivate = NULL; } +static int +VESAValidateModes(ScrnInfoPtr pScrn) +{ + VESAPtr pVesa = VESAGetRec(pScrn); + DisplayModePtr mode; + + for (mode = pScrn->monitor->Modes; mode; mode = mode->next) + mode->status = MODE_OK; + + return VBEValidateModes(pScrn, NULL, pScrn->display->modes, + NULL, NULL, 0, 2048, 1, 0, 2048, + pScrn->display->virtualX, + pScrn->display->virtualY, + pVesa->mapSize, LOOKUP_BEST_REFRESH); +} + /* * This function is called once for each screen at the start of the first * server generation to initialise the screen for all server generations. @@ -682,27 +698,37 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags) VBESetModeNames(pScrn->modePool); pVesa->strict_validation = TRUE; - i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, - NULL, NULL, 0, 2048, 1, 0, 2048, - pScrn->display->virtualX, - pScrn->display->virtualY, - pVesa->mapSize, LOOKUP_BEST_REFRESH); + i = VESAValidateModes(pScrn); if (i <= 0) { - DisplayModePtr mode; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "No valid modes left. Trying less strict filter...\n"); - for (mode = pScrn->monitor->Modes; mode; mode = mode->next) - mode->status = MODE_OK; + "No valid modes left. Trying less strict filter...\n"); pVesa->strict_validation = FALSE; - i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, - NULL, NULL, 0, 2048, 1, 0, 2048, - pScrn->display->virtualX, - pScrn->display->virtualY, - pVesa->mapSize, LOOKUP_BEST_REFRESH); + i = VESAValidateModes(pScrn); } + if (i <= 0) do { + Bool changed = FALSE; + /* maybe there's more modes at the bottom... */ + if (pScrn->monitor->vrefresh[0].lo > 50) { + changed = TRUE; + pScrn->monitor->vrefresh[0].lo = 50; + } + if (pScrn->monitor->hsync[0].lo > 31.5) { + changed = TRUE; + pScrn->monitor->hsync[0].lo = 31.5; + } + + if (!changed) + break; + + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "No valid modes left. Trying aggressive sync range...\n"); + i = VESAValidateModes(pScrn); + } while (0); + if (i <= 0) { + /* alright, i'm out of ideas */ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes\n"); vbeFree(pVesa->pVbe); return (FALSE); commit 5522f06c2305d52b12d6934133f46f7b7927ebf7 Author: Alan Coopersmith <[email protected]> Date: Fri Jan 30 21:06:38 2009 -0800 Add README with pointers to mailing list, bugzilla & git repos diff --git a/README b/README new file mode 100644 index 0000000..03f7dc1 --- /dev/null +++ b/README @@ -0,0 +1,20 @@ +xf86-video-vesa - Generic VESA video driver for the Xorg X server + +Please submit bugs & patches to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/driver/xf86-video-vesa + + http://cgit.freedesktop.org/xorg/driver/xf86-video-vesa + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage commit 566270b780a3f68b02d39f913372dc558ac931f2 Author: Alan Coopersmith <[email protected]> Date: Fri Jan 9 16:38:18 2009 -0800 Remove xorgconfig & xorgcfg from See Also list in man page diff --git a/man/vesa.man b/man/vesa.man index 046c2fa..19cb766 100644 --- a/man/vesa.man +++ b/man/vesa.man @@ -54,6 +54,6 @@ clear the screen during mode setting. If you experience problems try to turn this option off. Default: on. .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgcfg(__appmansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS Authors include: Paulo Ce\'sar Pereira de Andrade. commit c7f6d282ccbe1931f5ae6472cbfb4f80fc749525 Author: Dave Airlie <[email protected]> Date: Mon Dec 22 12:36:21 2008 +1000 vesa 2.1.0 diff --git a/configure.ac b/configure.ac index de2456a..62e710f 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-vesa], - 2.0.0, + 2.1.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-vesa) commit d994a9abbda582ccd6d38447ca2201de10cc36a5 Author: Adam Jackson <[email protected]> Date: Sun Nov 23 17:28:33 2008 -0500 Make ISA support optional. diff --git a/configure.ac b/configure.ac index 027a5cf..de2456a 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,14 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server) save_CFLAGS="$CFLAGS" CFLAGS="$XORG_CFLAGS" +AC_CHECK_DECL(xf86ConfigIsaEntity, + [AC_DEFINE(HAVE_ISA, 1, [Have ISA support])], + [], + [#include "xf86.h"]) +CFLAGS="$save_CFLAGS" + +save_CFLAGS="$CFLAGS" +CFLAGS="$XORG_CFLAGS" AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no], [#include "xorg-server.h"]) diff --git a/src/vesa.c b/src/vesa.c index 61461ab..2e1b2f7 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -138,10 +138,12 @@ static PciChipsets VESAPCIchipsets[] = { }; #endif +#ifdef HAVE_ISA static IsaChipsets VESAISAchipsets[] = { {CHIP_VESA_GENERIC, RES_EXCLUSIVE_VGA}, {-1, 0 } }; +#endif /* @@ -446,6 +448,7 @@ VESAProbe(DriverPtr drv, int flags) } #endif +#ifdef HAVE_ISA /* Isa Bus */ numUsed = xf86MatchIsaInstances(VESA_NAME,VESAChipsets, VESAISAchipsets, drv, @@ -465,12 +468,14 @@ VESAProbe(DriverPtr drv, int flags) } xfree(usedChips); } +#endif xfree(devSections); return (foundScreen); } +#ifdef HAVE_ISA static int VESAFindIsaDevice(GDevPtr dev) { @@ -495,6 +500,7 @@ VESAFindIsaDevice(GDevPtr dev) #endif return (int)CHIP_VESA_GENERIC; } +#endif static void VESAFreeRec(ScrnInfoPtr pScrn) commit 38431c99ccb625d0fd784f86f6a8a9cdbfbf872e Author: Luc Verhaegen <[email protected]> Date: Thu Sep 18 16:58:59 2008 +0200 VESASetMode: be verbose about the mode that's being set. diff --git a/src/vesa.c b/src/vesa.c index 2efe2d5..61461ab 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -1099,6 +1099,10 @@ VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) data = (VbeModeInfoData*)pMode->Private; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Setting up VESA Mode 0x%X (%dx%d)\n", + data->mode & 0x7FF, pMode->HDisplay, pMode->VDisplay); + /* careful, setting the bit means don't clear the screen */ mode = data->mode | (pVesa->ModeSetClearScreen ? 0 : (1U << 15)); commit e670b3e4a1102a36a01edf1fd38676b9b13fb957 Author: Julien Cristau <[email protected]> Date: Tue Jul 15 00:26:12 2008 +0200 Properly define the driver version Define VESA_VERSION_MAJOR/MINOR/PATCHLEVEL using the version from configure.ac. diff --git a/src/vesa.h b/src/vesa.h index 562cd76..1b8f4e5 100644 --- a/src/vesa.h +++ b/src/vesa.h @@ -78,9 +78,9 @@ #define VESA_VERSION 4000 #define VESA_NAME "VESA" #define VESA_DRIVER_NAME "vesa" -#define VESA_MAJOR_VERSION 1 -#define VESA_MINOR_VERSION 3 -#define VESA_PATCHLEVEL 0 +#define VESA_MAJOR_VERSION PACKAGE_VERSION_MAJOR +#define VESA_MINOR_VERSION PACKAGE_VERSION_MINOR +#define VESA_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL /*XXX*/ commit 4939ada882feeafe4b2f233a4a27d6ad38d5bf99 Author: Adam Jackson <[email protected]> Date: Tue Jul 1 14:27:48 2008 -0400 Default VESAValidMode to returning MODE_BAD. diff --git a/src/vesa.c b/src/vesa.c index ffe40c5..2efe2d5 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -286,7 +286,7 @@ VESAValidMode(int scrn, DisplayModePtr p, Bool flag, int pass) ScrnInfoPtr pScrn = xf86Screens[scrn]; VESAPtr pVesa = VESAGetRec(pScrn); MonPtr mon = pScrn->monitor; - ModeStatus ret; + ModeStatus ret = MODE_BAD; DisplayModePtr mode; float v; commit 9d27e31dca8e0bddbf82ef2f19064160cff3a59e Author: Adam Jackson <[email protected]> Date: Tue Jul 1 14:19:04 2008 -0400 Add a TODO list. diff --git a/src/vesa.c b/src/vesa.c index b23a04e..ffe40c5 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -31,6 +31,14 @@ * Adam Jackson <[email protected]> */ +/* + * TODO: + * - PanelID might give us useful size hints. + * - Port to RANDR 1.2 setup to make mode selection slightly better + * - Port to RANDR 1.2 to drop the old-school DGA junk + * - VBE/SCI for secondary DDC method? + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif commit bcf3514b99431b6935ea568b59d94f266ccd7aeb Author: Adam Jackson <[email protected]> Date: Tue Jul 1 14:09:00 2008 -0400 Warning cleanup. diff --git a/src/vesa.c b/src/vesa.c index 865bdb0..b23a04e 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -93,8 +93,6 @@ static void RestoreFonts(ScrnInfoPtr pScrn); static Bool VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function); -static void *VESAWindowPlanar(ScreenPtr pScrn, CARD32 row, CARD32 offset, - int mode, CARD32 *size, void *closure); static void *VESAWindowLinear(ScreenPtr pScrn, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure); static void *VESAWindowWindowed(ScreenPtr pScrn, CARD32 row, CARD32 offset, @@ -125,10 +123,12 @@ static SymTabRec VESAChipsets[] = {-1, NULL} }; +#ifndef XSERVER_LIBPCIACCESS static PciChipsets VESAPCIchipsets[] = { { CHIP_VESA_GENERIC, PCI_CHIP_VGA, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED }, }; +#endif static IsaChipsets VESAISAchipsets[] = { {CHIP_VESA_GENERIC, RES_EXCLUSIVE_VGA}, @@ -1232,28 +1232,6 @@ VESAUnmapVidMem(ScrnInfoPtr pScrn) pVesa->base = NULL; } -void * -VESAWindowPlanar(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, - CARD32 *size, void *closure) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - VESAPtr pVesa = VESAGetRec(pScrn); - VbeModeInfoBlock *data = ((VbeModeInfoData*)(pScrn->currentMode->Private))->data; - int window; - int mask = 1 << (offset & 3); - - outb(pVesa->ioBase + VGA_SEQ_INDEX, 2); - outb(pVesa->ioBase + VGA_SEQ_DATA, mask); - offset = (offset >> 2) + pVesa->maxBytesPerScanline * row; - window = offset / (data->WinGranularity * 1024); - pVesa->windowAoffset = window * data->WinGranularity * 1024; - VESABankSwitch(pScreen, window); - *size = data->WinSize * 1024 - (offset - pVesa->windowAoffset); - - return (void *)((unsigned long)pVesa->base + - (offset - pVesa->windowAoffset)); -} - static void * VESAWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) @@ -1393,13 +1371,6 @@ ReadGr(VESAPtr pVesa, int index) outb(pVesa->ioBase + (VGA_IOBASE_COLOR + VGA_CRTC_INDEX_OFFSET), index); \ outb(pVesa->ioBase + (VGA_IOBASE_COLOR + VGA_CRTC_DATA_OFFSET), value) -static int -ReadCrtc(VESAPtr pVesa, int index) -{ - outb(pVesa->ioBase + (VGA_IOBASE_COLOR + VGA_CRTC_INDEX_OFFSET), index); - return inb(pVesa->ioBase + (VGA_IOBASE_COLOR + VGA_CRTC_DATA_OFFSET)); -} - static void SeqReset(VESAPtr pVesa, Bool start) { commit ea57dcf423ebc3cb24060eebfc1943703448c320 Author: Adam Jackson <[email protected]> Date: Tue Jul 1 14:07:15 2008 -0400 Use VBE services for DPMS instead of banging VGA registers manually. diff --git a/src/vesa.c b/src/vesa.c index f0f2522..865bdb0 100644 --- a/src/vesa.c +++ b/src/vesa.c @@ -1656,45 +1656,13 @@ VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode, int flags) { VESAPtr pVesa = VESAGetRec(pScrn); - unsigned char seq1 = 0, crtc17 = 0; if (!pScrn->vtSema) return; - switch (mode) { - case DPMSModeOn: - /* Screen: On; HSync: On, VSync: On */ - seq1 = 0x00; - crtc17 = 0x80; - break; - case DPMSModeStandby: - /* Screen: Off; HSync: Off, VSync: On -- Not Supported */ - seq1 = 0x20; - crtc17 = 0x80; - break; - case DPMSModeSuspend: - /* Screen: Off; HSync: On, VSync: Off -- Not Supported */ - seq1 = 0x20; - crtc17 = 0x80; - break; - case DPMSModeOff: - /* Screen: Off; HSync: Off, VSync: Off */ - seq1 = 0x20; - crtc17 = 0x00; - break; - } - WriteSeq(0x00, 0x01); /* Synchronous Reset */ - seq1 |= ReadSeq(pVesa, 0x01) & ~0x20; - WriteSeq(0x01, seq1); - crtc17 |= ReadCrtc(pVesa, 0x17) & ~0x80; - usleep(10000); - WriteCrtc(0x17, crtc17); - WriteSeq(0x00, 0x03); /* End Reset */ + VBEDPMSSet(pVesa->pVbe, mode); } - - - /*********************************************************************** * DGA stuff ***********************************************************************/ -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

