summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2006-01-01 03:24:18 +0000
committerLuc Verhaegen <libv@skynet.be>2006-01-01 03:24:18 +0000
commita5c98258a5bb2e57d14f991d13efe55ede52f344 (patch)
tree1bd44254aab0290380316aa30a80bacea9690838
parentbfbd72e9ac5018b73cb9b7373207be14e74aa954 (diff)
[devel-ViaScratch]
- Create struct ViaScratch, where all highly stable and trustworthy VIA scratch area info is held for the driver to ignore. - Move last remaining members of ModeInfo into pVia. Most of the info sits in ViaOutput. - Adjust to new year. Wee.
-rw-r--r--src/via_ch7xxx.c4
-rw-r--r--src/via_dri.c1
-rw-r--r--src/via_driver.c171
-rw-r--r--src/via_driver.h30
-rw-r--r--src/via_mode.c64
-rw-r--r--src/via_mode.h21
-rw-r--r--src/via_panel.c7
-rw-r--r--src/via_panel.h6
-rw-r--r--src/via_vt162x.c6
9 files changed, 170 insertions, 140 deletions
diff --git a/src/via_ch7xxx.c b/src/via_ch7xxx.c
index 90e558a..0b47171 100644
--- a/src/via_ch7xxx.c
+++ b/src/via_ch7xxx.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005 Luc Verhaegen.
+ * Copyright 2005-2006 Luc Verhaegen.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -156,7 +156,7 @@ CH7xxxGetOptions(ScrnInfoPtr pScrn, struct CH7xxxOutputPrivate *Private)
}
/* TV standard */
- Private->Standard = VIAPTR(pScrn)->ModeInfo->TVStandard;
+ Private->Standard = VIAPTR(pScrn)->Scratch->TVStandard;
if ((s = xf86GetOptValString(Options, OPTION_TVSTANDARD))) {
if (!xf86NameCmp(s, "NTSC")) {
Private->Standard = TVSTANDARD_NTSC;
diff --git a/src/via_dri.c b/src/via_dri.c
index eed6355..ca6f583 100644
--- a/src/via_dri.c
+++ b/src/via_dri.c
@@ -553,7 +553,6 @@ ViaDRMGetVersion(ScrnInfoPtr pScrn)
pVia->drmVersion = (drmVersion->version_major << 16) |
(drmVersion->version_minor << 8) | drmVersion->version_patchlevel;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "drm: 0x%lX\n", pVia->drmVersion);
}
/* Check wether we can use DMA for copying */
diff --git a/src/via_driver.c b/src/via_driver.c
index cb25718..13d7192 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -1,4 +1,5 @@
/*
+ * Copyright 2004-2006 Luc Verhaegen.
* Copyright 2004-2005 The Unichrome Project [unichrome.sf.net]
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
@@ -361,9 +362,7 @@ VIAGetRec(ScrnInfoPtr pScrn)
pVia = VIAPTR(pScrn);
pVia->scrnIndex = pScrn->scrnIndex;
- pVia->ModeInfo = xnfcalloc(sizeof(struct ViaModeInfo), 1);
- pVia->ModeInfo->scrnIndex = pScrn->scrnIndex;
-
+ pVia->Scratch = NULL;
pVia->Outputs = NULL;
pVia->Cursor = NULL;
@@ -388,7 +387,8 @@ VIAFreeRec(ScrnInfoPtr pScrn)
ViaOutputsDestroy(pScrn);
- xfree(pVia->ModeInfo);
+ if (pVia->Scratch)
+ xfree(pVia->Scratch);
VIAUnmapMem(pScrn);
@@ -543,12 +543,102 @@ static int LookupChipSet(PciChipsets *pset, int chipSet)
}
/*
+ * Concentrate all VIA scratch area stuff in one struct
+ *
+ */
+static struct ViaScratch *
+ViaScratchGet(ScrnInfoPtr pScrn)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ VIAPtr pVia = VIAPTR(pScrn);
+ struct ViaScratch *Scratch = xnfcalloc(sizeof(struct ViaScratch), 1);
+ int tmp;
+
+ VIAFUNC(pScrn->scrnIndex);
+
+ if (!xf86IsScreenPrimary(pScrn->scrnIndex))
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s called when not the primary"
+ "VGA device. Some scratch areas might be uninitialised.\n",
+ __func__);
+
+ /*
+ * Get Memory size first. Should really use the RAM controller pci config.
+ */
+ if (pVia->Chipset == VT3122) {
+ tmp = hwp->readSeq(hwp, 0x34);
+
+ if (!tmp) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: VideoRam Scratch area"
+ " uninitialised. Trying CR39.\n", __func__);
+ tmp = hwp->readSeq(hwp, 0x39);
+ }
+ } else
+ tmp = hwp->readSeq(hwp, 0x39);
+
+ if ((tmp > 16) && (tmp <= 128))
+ Scratch->VideoRam = (tmp + 1) << 9;
+ else if ((tmp > 0) && (tmp < 31))
+ Scratch->VideoRam = tmp << 12;
+ else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: VideoRam Scratch area"
+ " uninitialised.\n", __func__);
+ Scratch->VideoRam = 16 << 10;
+ }
+
+ ViaDebug(pScrn->scrnIndex, "%s: VideoRam: %d\n", __func__,
+ Scratch->VideoRam);
+
+
+ /*
+ * Get the memory clock.
+ */
+ tmp = hwp->readCrtc(hwp, 0x3D) >> 4;
+
+ /* Actual values:
+ * 0: SDR 66Mhz
+ * 1: SDR 100Mhz
+ * 2: SDR 133Mhz
+ * 3: DDR 100Mhz (PC1600 or DDR200)
+ * 4: DDR 133Mhz (PC2100 or DDR266)
+ * 5: DDR 166Mhz (PC2700 or DDR333)
+ * 6: DDR 200Mhz (PC3200 or DDR400)
+ * 7: fairytale.
+ */
+ /* SDR won't happen, assume badly set up register. */
+ if ((tmp < 3) || (tmp > 6)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: Unknown Memory Clock (%d)."
+ " Defaulting to DDR200\n", __func__, tmp);
+ Scratch->MemClk = VIA_MEM_DDR200;
+ } else
+ Scratch->MemClk = tmp - 3;
+ ViaDebug(pScrn->scrnIndex, "%s: MemClk: %d\n", __func__, Scratch->MemClk);
+
+ /*
+ * Get output device status.
+ */
+ Scratch->ActiveDevice = hwp->readCrtc(hwp, 0x3E) >> 4;
+ ViaDebug(pScrn->scrnIndex, "%s: ActiveDevice: %d\n", __func__,
+ Scratch->ActiveDevice);
+
+ /*
+ * Get TV Standard.
+ */
+ if (hwp->readCrtc(hwp, 0x3B) & 0x02)
+ Scratch->TVStandard = TVSTANDARD_PAL;
+ else
+ Scratch->TVStandard = TVSTANDARD_NTSC;
+ ViaDebug(pScrn->scrnIndex, "%s: TVStandard: %d\n", __func__,
+ Scratch->TVStandard);
+
+ return Scratch;
+}
+
+/*
*
*/
static CARD8
ViaGetMemoryClock(ScrnInfoPtr pScrn)
{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
int temp;
CARD8 MemClk = VIA_MEM_NONE;
@@ -579,28 +669,9 @@ ViaGetMemoryClock(ScrnInfoPtr pScrn)
}
}
- if (MemClk == VIA_MEM_NONE) {
- /* Read BIOS initialised register. Not always initialised though. */
- temp = hwp->readCrtc(hwp, 0x3D) >> 4;
-
- /* Actual values:
- * 0: SDR 66Mhz
- * 1: SDR 100Mhz
- * 2: SDR 133Mhz
- * 3: DDR 100Mhz (PC1600 or DDR200)
- * 4: DDR 133Mhz (PC2100 or DDR266)
- * 5: DDR 166Mhz (PC2700 or DDR333)
- * 6: DDR 200Mhz (PC3200 or DDR400)
- * 7: fairytale.
- */
- /* SDR won't happen, assume badly set up register. */
- if ((temp < 3) || (temp > 6)) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown Memory Clock (%d)."
- " Defaulting to DDR200\n", temp);
- MemClk = VIA_MEM_DDR200;
- } else
- MemClk = temp - 3;
- }
+ if (MemClk == VIA_MEM_NONE)
+ MemClk = VIAPTR(pScrn)->Scratch->MemClk;
+
ViaDebug(pScrn->scrnIndex, "Memory clock: %d.\n", MemClk);
return MemClk;
}
@@ -709,7 +780,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
{
EntityInfoPtr pEnt;
VIAPtr pVia;
- struct ViaModeInfo *ModeInfo;
MessageType from = X_DEFAULT;
ClockRangePtr clockRanges;
char *s = NULL;
@@ -751,7 +821,6 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
pVia = VIAPTR(pScrn);
- ModeInfo = pVia->ModeInfo;
pVia->IsSecondary = FALSE;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
@@ -1155,21 +1224,11 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
ViaCheckCardId(pScrn);
- pVia->MemClk = ViaGetMemoryClock(pScrn);
- ModeInfo->Bandwidth = ViaGetMemoryBandwidth(pScrn);
+ pVia->Scratch = ViaScratchGet(pScrn);
- if (ModeInfo->TVStandard == TVSTANDARD_NONE) {
- /* use jumper to determine TV Type */
+ pVia->MemClk = ViaGetMemoryClock(pScrn);
+ pVia->Bandwidth = ViaGetMemoryBandwidth(pScrn);
- if (hwp->readCrtc(hwp, 0x3B) & 0x02) {
- ModeInfo->TVStandard = TVSTANDARD_PAL;
- ViaDebug(pScrn->scrnIndex, "Detected TV Standard: PAL.\n");
- }
- else {
- ModeInfo->TVStandard = TVSTANDARD_NTSC;
- ViaDebug(pScrn->scrnIndex, "Detected TV Standard: NTSC.\n");
- }
- }
{
Gamma zeros = {0.0, 0.0, 0.0};
@@ -1180,29 +1239,8 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags)
}
}
- /* detect amount of installed ram */
- if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) {
- int bMemSize = 0;
-
- if (pVia->Chipset == VT3122)
- bMemSize = hwp->readSeq(hwp, 0x34);
-
- if (!bMemSize) {
- if (pVia->Chipset == VT3122)
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "videoRam: BIOS didn't"
- " set up CR34 properly. Trying CR39.\n");
- bMemSize = hwp->readSeq(hwp, 0x39);
- }
-
- if (bMemSize > 16 && bMemSize <= 128)
- pScrn->videoRam = (bMemSize + 1) << 9;
- else if (bMemSize > 0 && bMemSize < 31)
- pScrn->videoRam = bMemSize << 12;
- else {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Memory size detection failed: using 16MB\n");
- pScrn->videoRam = 16 << 10; /* Assume the base 16Mb */
- }
- }
+ if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536)
+ pScrn->videoRam = pVia->Scratch->VideoRam;
/* Split FB for SAMM */
/* FIXME: For now, split FB into two equal sections. This should
@@ -2269,7 +2307,6 @@ static void VIADPMS(ScrnInfoPtr pScrn, int mode, int flags)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
CARD8 val;
VIAFUNC(pScrn->scrnIndex);
@@ -2279,7 +2316,7 @@ static void VIADPMS(ScrnInfoPtr pScrn, int mode, int flags)
val &= 0xCF;
/* Turn Off CRT, if user doesn't want crt on */
- if (!pVia->IsSecondary && !ModeInfo->CrtActive)
+ if (!pVia->IsSecondary && !pVia->CrtActive)
val |= 0x30;
switch (mode) {
diff --git a/src/via_driver.h b/src/via_driver.h
index af9fd88..9bc5aa3 100644
--- a/src/via_driver.h
+++ b/src/via_driver.h
@@ -1,4 +1,5 @@
/*
+ * Copyright 2004-2006 Luc Verhaegen.
* Copyright 2004-2005 The Unichrome Project [unichrome.sf.net]
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
@@ -86,7 +87,7 @@
#define VIA_DEVICE_CRT 0x01
#define VIA_DEVICE_LCD 0x02
#define VIA_DEVICE_TV 0x04
-#define VIA_DEVICE_DFP 0x08
+#define VIA_DEVICE_DVI 0x08
/* For pVia->MemClk */
#define VIA_MEM_DDR200 0x00
@@ -96,6 +97,18 @@
#define VIA_MEM_END 0x04
#define VIA_MEM_NONE 0xFF
+/* For Scratch->TVStandard */
+#define TVSTANDARD_NONE 0x00
+#define TVSTANDARD_NTSC 0x01
+#define TVSTANDARD_PAL 0x02
+
+struct ViaScratch {
+ int VideoRam;
+ CARD8 MemClk;
+ CARD8 ActiveDevice;
+ CARD8 TVStandard;
+};
+
typedef struct {
CARD8 SR08, SR0A, SR0F;
@@ -155,7 +168,9 @@ typedef struct _VIA {
unsigned char* BltBase;
unsigned char* MapBaseDense;
unsigned char* FBBase;
+
CARD8 MemClk;
+ CARD32 Bandwidth; /* available memory bandwidth */
#ifndef X_USE_LINEARFB
/* memory "management" */
@@ -198,10 +213,19 @@ typedef struct _VIA {
ViaTwodContext td;
ViaCBuffer cBuf;
- struct ViaOutput *Outputs;
- struct ViaModeInfo *ModeInfo;
+ struct ViaScratch *Scratch;
struct ViaCardId *Id;
+ /* ModeSetting and Output devices */
+ Bool CrtPresent;
+ Bool CrtActive;
+ int CrtOwner;
+
+ Bool ClockSlave; /* is the unichrome the master or the slave? */
+ CARD32 PanelClock; /* need to clean up that crap */
+
+ struct ViaOutput *Outputs;
+
/* Support for DGA */
int numDGAModes;
DGAModePtr DGAModes;
diff --git a/src/via_mode.c b/src/via_mode.c
index 2b4dacf..ded51cc 100644
--- a/src/via_mode.c
+++ b/src/via_mode.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2005 Luc Verhaegen.
+ * Copyright 2004-2006 Luc Verhaegen.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -375,17 +375,17 @@ ViaOutputsPrintRegs(ScrnInfoPtr pScrn, const char *function)
static void
ViaOutputsFindDotclockMaster(ScrnInfoPtr pScrn)
{
- struct ViaModeInfo *ModeInfo = VIAPTR(pScrn)->ModeInfo;
- struct ViaOutput *Output = VIAPTR(pScrn)->Outputs;
+ VIAPtr pVia = VIAPTR(pScrn);
+ struct ViaOutput *Output = pVia->Outputs;
- ModeInfo->ClockSlave = FALSE;
+ pVia->ClockSlave = FALSE;
while (Output) {
if (Output->Active && Output->ClockMaster) {
- if (ModeInfo->ClockSlave)
+ if (pVia->ClockSlave)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: multiple Outputs "
"want to be the dotclock master.\n", __func__);
- ModeInfo->ClockSlave = TRUE;
+ pVia->ClockSlave = TRUE;
}
Output = Output->Next;
}
@@ -437,22 +437,21 @@ void
ViaOutputsDetect(ScrnInfoPtr pScrn)
{
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
VIAFUNC(pScrn->scrnIndex);
#if 0
- ModeInfo->CrtPresent = FALSE;
+ pVia->CrtPresent = FALSE;
/* Crt */
if (pVia->DDC1)
- ModeInfo->CrtPresent = TRUE;
+ pVia->CrtPresent = TRUE;
/* If any of the unichromes support this, add CRT detection here */
else
- ModeInfo->CrtPresent = FALSE;
+ pVia->CrtPresent = FALSE;
#endif
- ModeInfo->CrtPresent = TRUE;
+ pVia->CrtPresent = TRUE;
ViaOutputsInit(pScrn);
}
@@ -464,8 +463,6 @@ Bool
ViaOutputsSelect(ScrnInfoPtr pScrn)
{
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
- vgaHWPtr hwp = VGAHWPTR(pScrn);
if (pVia->IsSecondary) { /* we just abort for now */
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s: Not handling secondary.\n",
@@ -475,17 +472,15 @@ ViaOutputsSelect(ScrnInfoPtr pScrn)
VIAFUNC(pScrn->scrnIndex);
ViaDebug(pScrn->scrnIndex, "X Configuration: 0x%02x\n", pVia->ActiveDevice);
- ViaDebug(pScrn->scrnIndex, "BIOS Initialised register: 0x%02x\n",
- hwp->readCrtc(hwp, 0x3E));
- ModeInfo->CrtActive = FALSE;
+ pVia->CrtActive = FALSE;
if (!pVia->ActiveDevice) {
ViaOutputsSense(pScrn);
/* CRT can be used with everything when present */
- if (ModeInfo->CrtPresent)
- ModeInfo->CrtActive = TRUE;
+ if (pVia->CrtPresent)
+ pVia->CrtActive = TRUE;
} else {
if (pVia->ActiveDevice & VIA_DEVICE_LCD) {
struct ViaOutput *Output = pVia->Outputs;
@@ -536,8 +531,8 @@ ViaOutputsSelect(ScrnInfoPtr pScrn)
}
if ((pVia->ActiveDevice & VIA_DEVICE_CRT))
- ModeInfo->CrtPresent = TRUE;
- ModeInfo->CrtActive = TRUE;
+ pVia->CrtPresent = TRUE;
+ pVia->CrtActive = TRUE;
}
/* Make sure that a panel is the only Active Output device */
@@ -573,7 +568,7 @@ ViaOutputsSelect(ScrnInfoPtr pScrn)
}
ViaDebug(pScrn->scrnIndex, "Output CRT: %s.\n",
- ModeInfo->CrtActive ? "Active" : "Disabled");
+ pVia->CrtActive ? "Active" : "Disabled");
ViaOutputsActivePrint(pScrn);
@@ -966,13 +961,9 @@ ViaValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
ModeStatus ret;
CARD32 temp;
- /* workaround for crappy panel code */
- ModeInfo->PanelClock = 0x00;
-
ViaDebug(scrnIndex, "%s: Validating %s (%d)\n", __func__, mode->name,
mode->Clock);
@@ -996,9 +987,9 @@ ViaValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
temp = mode->CrtcHDisplay * mode->CrtcVDisplay * mode->VRefresh *
(pScrn->bitsPerPixel >> 3);
- if (ModeInfo->Bandwidth < temp) {
+ if (pVia->Bandwidth < temp) {
xf86DrvMsg(scrnIndex, X_INFO, "Required bandwidth is not available. (%u > %u)\n",
- (unsigned) temp, (unsigned) ModeInfo->Bandwidth);
+ (unsigned) temp, (unsigned) pVia->Bandwidth);
return MODE_CLOCK_HIGH; /* since there is no MODE_BANDWIDTH */
}
@@ -1242,7 +1233,6 @@ ViaModePrimary(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
struct ViaOutput *Output = pVia->Outputs;
VIAFUNC(pScrn->scrnIndex);
@@ -1267,9 +1257,12 @@ ViaModePrimary(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaSetPrimaryFIFO(pScrn, mode);
- if (!ModeInfo->CrtActive)
+ if (!pVia->CrtActive)
ViaCrtcMask(hwp, 0x36, 0x30, 0x30);
+ /* Work around panel blob. */
+ pVia->PanelClock = 0x00;
+
while (Output) {
if (Output->Active) {
if (Output->Mode) {
@@ -1316,9 +1309,9 @@ ViaModePrimary(ScrnInfoPtr pScrn, DisplayModePtr mode)
Output = Output->Next;
}
- if (!ModeInfo->ClockSlave) {
- if (ModeInfo->PanelClock)
- ViaSetPrimaryDotclock(pScrn, ModeInfo->PanelClock);
+ if (!pVia->ClockSlave) {
+ if (pVia->PanelClock)
+ ViaSetPrimaryDotclock(pScrn, pVia->PanelClock);
else
ViaSetPrimaryDotclock(pScrn, VT3122PLLGenerate(pScrn, mode->Clock));
@@ -1477,7 +1470,6 @@ ViaModeSecondary(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
struct ViaOutput *Output = pVia->Outputs;
VIAFUNC(pScrn->scrnIndex);
@@ -1488,7 +1480,7 @@ ViaModeSecondary(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaModeSecondaryVGA(pScrn, mode);
ViaSetSecondaryFIFO(pScrn, mode);
- ModeInfo->PanelClock = 0x00;
+ pVia->PanelClock = 0x00;
while (Output) {
if (Output->Active && Output->Mode)
Output->Mode(Output, mode);
@@ -1502,8 +1494,8 @@ ViaModeSecondary(ScrnInfoPtr pScrn, DisplayModePtr mode)
if ((pVia->Chipset != VT3122) || (pVia->ChipRev != 0x02))
ViaCrtcMask(hwp, 0x6C, 0x00, 0x1E);
- if (ModeInfo->PanelClock)
- ViaSetSecondaryDotclock(pScrn, ModeInfo->PanelClock);
+ if (pVia->PanelClock)
+ ViaSetSecondaryDotclock(pScrn, pVia->PanelClock);
else
ViaSetSecondaryDotclock(pScrn, VT3122PLLGenerate(pScrn, mode->Clock));
ViaSetUseExternalClock(pScrn);
diff --git a/src/via_mode.h b/src/via_mode.h
index f287d09..0a74a84 100644
--- a/src/via_mode.h
+++ b/src/via_mode.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2005 Luc Verhaegen.
+ * Copyright 2004-2006 Luc Verhaegen.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -24,25 +24,6 @@
#ifndef _VIA_MODE_H_
#define _VIA_MODE_H_ 1
-/* For ModeInfo->TVStandard
- * This can also be gathered from a scratch register. */
-#define TVSTANDARD_NONE 0x00
-#define TVSTANDARD_NTSC 0x01
-#define TVSTANDARD_PAL 0x02
-
-struct ViaModeInfo {
- int scrnIndex;
-
- Bool CrtPresent;
- Bool CrtActive;
-
- CARD32 Bandwidth; /* available memory bandwidth */
-
- Bool ClockSlave; /* is the unichrome the master or the slave? */
- CARD32 TVStandard; /* should be moved to pVia->Scratch */
- CARD32 PanelClock;
-};
-
/* For Output->Type */
#define OUTPUT_NONE 0x00
#define OUTPUT_TV 0x01
diff --git a/src/via_panel.c b/src/via_panel.c
index 2f80fa5..67e80e5 100644
--- a/src/via_panel.c
+++ b/src/via_panel.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2005 Luc Verhaegen.
+ * Copyright 2004-2006 Luc Verhaegen.
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
@@ -511,8 +511,6 @@ ViaPanelModeValid(struct ViaOutput *Output, DisplayModePtr mode)
ViaDebug(Output->scrnIndex, "%s: index: %d (%dx%d)\n", __func__,
Private->Index, Private->X, Private->Y);
- /* work around */
- VIAPTR(pScrn)->ModeInfo->PanelClock = 1;
return MODE_OK;
}
@@ -536,7 +534,6 @@ ViaPanelMode(struct ViaOutput *Output, DisplayModePtr mode)
ScrnInfoPtr pScrn = xf86Screens[Output->scrnIndex];
vgaHWPtr hwp = VGAHWPTR(pScrn);
VIAPtr pVia = VIAPTR(pScrn);
- struct ViaModeInfo *ModeInfo = pVia->ModeInfo;
struct ViaPanelOutputPrivate *Private = Output->Private;
VIALCDModeTableRec Table = lcdTable[Private->Index];
@@ -702,7 +699,7 @@ ViaPanelMode(struct ViaOutput *Output, DisplayModePtr mode)
}
}
- ModeInfo->PanelClock = Clock;
+ pVia->PanelClock = Clock;
/* LCD patch 3D5.02 */
misc = hwp->readCrtc(hwp, 0x01);
diff --git a/src/via_panel.h b/src/via_panel.h
index 24530bd..5766126 100644
--- a/src/via_panel.h
+++ b/src/via_panel.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2005 Luc Verhaegen.
+ * Copyright 2004-2006 Luc Verhaegen.
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
@@ -32,11 +32,11 @@
*
*/
-/* For ModeInfo->BusWidth */
+/* For ViaPanelOutputPrivate->BusWidth */
#define VIA_DI_12BIT 0x00
#define VIA_DI_24BIT 0x01
-/* For ModeInfo->PanelSize */
+/* For ViaPanelOutputPrivate->Size */
#define VIA_PANEL6X4 0
#define VIA_PANEL8X6 1
#define VIA_PANEL10X7 2
diff --git a/src/via_vt162x.c b/src/via_vt162x.c
index 6a7a845..d1d74c5 100644
--- a/src/via_vt162x.c
+++ b/src/via_vt162x.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2005 Luc Verhaegen.
+ * Copyright 2004-2006 Luc Verhaegen.
* Copyright 2004 The Unichrome Project [unichrome.sf.net]
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
@@ -103,7 +103,7 @@ VT162xPrivateCreate(struct ViaOutput *Output)
*
*/
-/* For ModeInfo->TVOutput */
+/* For Output->Output */
#define TVOUTPUT_NONE 0x00
#define TVOUTPUT_COMPOSITE 0x01
#define TVOUTPUT_SVIDEO 0x02
@@ -176,7 +176,7 @@ VT162xGetOptions(ScrnInfoPtr pScrn, struct VT162xOutputPrivate *Private)
}
/* TV standard */
- Private->Standard = VIAPTR(pScrn)->ModeInfo->TVStandard;
+ Private->Standard = VIAPTR(pScrn)->Scratch->TVStandard;
if ((s = xf86GetOptValString(Options, OPTION_TVSTANDARD))) {
if (!xf86NameCmp(s, "NTSC")) {
Private->Standard = TVSTANDARD_NTSC;