summaryrefslogtreecommitdiff
path: root/src/lg_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lg_driver.c')
-rw-r--r--src/lg_driver.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/lg_driver.c b/src/lg_driver.c
index 95b7655..4fda937 100644
--- a/src/lg_driver.c
+++ b/src/lg_driver.c
@@ -13,7 +13,7 @@
* David Dawes, Andrew E. Mileski, Leonard N. Zubkoff,
* Guy DESBIEF, Itai Nahshon.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.45 2003/08/23 15:02:57 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.49 2003/11/03 05:11:09 tsi Exp $ */
#define EXPERIMENTAL
@@ -63,7 +63,7 @@
#include "lg.h"
#include "xf86xv.h"
-#include "Xv.h"
+#include <X11/extensions/Xv.h>
/*
* Forward definitions for the functions that make up the driver.
@@ -84,7 +84,8 @@ void LgAdjustFrame(int scrnIndex, int x, int y, int flags);
/* Optional functions */
void LgFreeScreen(int scrnIndex, int flags);
-int LgValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags);
+ModeStatus LgValidMode(int scrnIndex, DisplayModePtr mode,
+ Bool verbose, int flags);
/* Internally used functions */
static void LgRestoreLgRegs(ScrnInfoPtr pScrn, LgRegPtr lgReg);
@@ -245,7 +246,7 @@ static XF86ModuleVersionInfo lgVersRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
LG_MAJOR_VERSION, LG_MINOR_VERSION, LG_PATCHLEVEL,
ABI_CLASS_VIDEODRV, /* This is a video driver */
ABI_VIDEODRV_VERSION,
@@ -370,10 +371,6 @@ LgDoDDC(ScrnInfoPtr pScrn)
if (!CirMapMem(pCir, pScrn->scrnIndex))
return FALSE;
- {
- ErrorF("RIF Control %#04x, RAC Control %#04x\n",
- memrw(0x200), memrw(0x201));
- }
#if LGuseI2C
if (!LgI2CInit(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I2C initialization failed\n");
@@ -383,7 +380,8 @@ LgDoDDC(ScrnInfoPtr pScrn)
/* Read and output monitor info using DDC2 over I2C bus */
MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, pCir->I2CPtr1);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Monitor info: %p\n", MonInfo);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "I2C Monitor info: %p\n",
+ (void *)MonInfo);
xf86PrintEDID(MonInfo);
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "end of I2C Monitor info\n\n");
#endif /* LGuseI2C */
@@ -949,7 +947,6 @@ static Bool
LgModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
vgaHWPtr hwp;
- vgaRegPtr vgaReg;
CirPtr pCir;
int width;
Bool VDiv2 = FALSE;
@@ -1000,8 +997,6 @@ LgModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
#ifdef LG_DEBUG
ErrorF("SynthClock = %d\n", mode->SynthClock);
#endif
- vgaReg = &hwp->ModeReg;
-
hwp->IOBase = 0x3D0;
hwp->ModeReg.MiscOutReg |= 0x01;
#if 0 /* Mono address */
@@ -1282,7 +1277,7 @@ LgRestore(ScrnInfoPtr pScrn)
LgRegPtr lgReg;
#ifdef LG_DEBUG
- ErrorF("LgRestore pScrn = 0x%08X\n", pScrn);
+ ErrorF("LgRestore pScrn = %p\n", (void *)pScrn);
#endif
pCir = CIRPTR(pScrn);
@@ -1348,6 +1343,9 @@ LgScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!LgModeInit(pScrn, pScrn->currentMode))
return FALSE;
+ /* Make things beautiful */
+ LgSaveScreen(pScreen, SCREEN_SAVER_ON);
+
/* Set the viewport */
LgAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
@@ -1725,7 +1723,7 @@ LgFreeScreen(int scrnIndex, int flags)
/* Checks if a mode is suitable for the selected chipset. */
/* Optional */
-int
+ModeStatus
LgValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
int lace;