update to xf86-video-vesa 2.2.0

This commit is contained in:
matthieu 2009-04-09 20:07:26 +00:00
parent 39fd371b0f
commit c8fe3e6a3b
5 changed files with 95 additions and 84 deletions

View File

@ -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

View File

@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-vesa],
2.0.0,
2.2.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-vesa)
@ -56,6 +56,14 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
PKG_CHECK_MODULES(XORG, xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES)
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,

View File

@ -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.

View File

@ -31,6 +31,14 @@
* Adam Jackson <ajax@redhat.com>
*/
/*
* 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
@ -93,8 +101,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,15 +131,19 @@ 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
#ifdef HAVE_ISA
static IsaChipsets VESAISAchipsets[] = {
{CHIP_VESA_GENERIC, RES_EXCLUSIVE_VGA},
{-1, 0 }
};
#endif
/*
@ -278,7 +288,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;
@ -440,6 +450,7 @@ VESAProbe(DriverPtr drv, int flags)
}
#endif
#ifdef HAVE_ISA
/* Isa Bus */
numUsed = xf86MatchIsaInstances(VESA_NAME,VESAChipsets,
VESAISAchipsets, drv,
@ -459,12 +470,14 @@ VESAProbe(DriverPtr drv, int flags)
}
xfree(usedChips);
}
#endif
xfree(devSections);
return (foundScreen);
}
#ifdef HAVE_ISA
static int
VESAFindIsaDevice(GDevPtr dev)
{
@ -489,6 +502,7 @@ VESAFindIsaDevice(GDevPtr dev)
#endif
return (int)CHIP_VESA_GENERIC;
}
#endif
static void
VESAFreeRec(ScrnInfoPtr pScrn)
@ -524,6 +538,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.
@ -670,27 +700,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);
@ -1093,6 +1133,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));
@ -1234,28 +1278,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)
@ -1395,13 +1417,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)
{
@ -1658,45 +1673,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
***********************************************************************/

View File

@ -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*/