summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-08-15 19:29:14 -0400
committerAlex Deucher <alexdeucher@gmail.com>2008-08-15 19:29:14 -0400
commit1c82022d0952c6953c87609b2a44cab3af6d86cb (patch)
tree16b6000469342dd8260458d05b3670fb90edee2b
parentc15d43dd0c74e4406c80c0cf0491003128d05fe9 (diff)
Add missing call to xf86SetCrtcForModes() and add pass through option
This fixes the problems with the crashes and other funnies. It was almost entirely down to a missing call to xf86SetCrtcForModes(). With that added the clock data appears valid and the card is working. I've also added support for the pass through switching as that is useful for debug when your text consoles are on the pass through display
-rw-r--r--src/voodoo.h2
-rw-r--r--src/voodoo_driver.c14
-rw-r--r--src/voodoo_hardware.c16
3 files changed, 28 insertions, 4 deletions
diff --git a/src/voodoo.h b/src/voodoo.h
index 750c42b..4f97a8a 100644
--- a/src/voodoo.h
+++ b/src/voodoo.h
@@ -13,7 +13,7 @@ typedef struct {
CloseScreenProcPtr CloseScreen; /* Wrapped Close */
XAAInfoRecPtr AccelInfoRec; /* Cached Accel rec for close */
Bool Blanked;
- Bool OnAtExit;
+ Bool PassThrough; /* Set to restore pass through on exit */
EntityInfoPtr pEnt;
OptionInfoPtr Options;
diff --git a/src/voodoo_driver.c b/src/voodoo_driver.c
index dc2176a..2822543 100644
--- a/src/voodoo_driver.c
+++ b/src/voodoo_driver.c
@@ -110,12 +110,14 @@ _X_EXPORT DriverRec VOODOO = {
typedef enum {
OPTION_NOACCEL,
- OPTION_SHADOW_FB
+ OPTION_SHADOW_FB,
+ OPTION_PASS_THROUGH,
} VoodooOpts;
static const OptionInfoRec VoodooOptions[] = {
{ OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_PASS_THROUGH,"PassThrough", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -436,6 +438,9 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
pVoo->Accel = 0;
}
+ if (xf86ReturnOptValBool(pVoo->Options, OPTION_PASS_THROUGH, FALSE))
+ pVoo->PassThrough = 1;
+
if (xf86ReturnOptValBool(pVoo->Options, OPTION_NOACCEL, FALSE)) {
pVoo->ShadowFB = 1;
pVoo->Accel = 0;
@@ -544,6 +549,7 @@ VoodooPreInit(ScrnInfoPtr pScrn, int flags)
}
/* Set the current mode to the first in the list */
+ xf86SetCrtcForModes(pScrn, 0);
pScrn->currentMode = pScrn->modes;
/* Do some checking, we will not support a virtual framebuffer larger than
@@ -914,8 +920,10 @@ VoodooRestore(ScrnInfoPtr pScrn, Bool Closing)
pVoo = VoodooPTR(pScrn);
pVoo->Blanked = TRUE;
- if (!Closing || !(pVoo->OnAtExit))
- VoodooBlank(pVoo);
+ if (!Closing)
+ VoodooBlank(pVoo);
+ if (Closing && pVoo->PassThrough)
+ VoodooRestorePassThrough(pVoo);
}
static void
diff --git a/src/voodoo_hardware.c b/src/voodoo_hardware.c
index 35e656f..d988b33 100644
--- a/src/voodoo_hardware.c
+++ b/src/voodoo_hardware.c
@@ -685,6 +685,17 @@ int VoodooHardwareInit(VoodooPtr pVoo)
}
/*
+ * Voodoo exit logic
+ */
+
+void VoodooRestorePassThrough(VoodooPtr pVoo)
+{
+ pci_enable(pVoo, 1, 0, 0);
+ mmio32_w(pVoo, 0x210, 0);
+ pci_enable(pVoo, 0, 0, 1);
+}
+
+/*
* Copiers for Voodoo1
*
* Voodoo1 has no CPU to screen blit, and also lacks SGRAM fill
@@ -969,6 +980,9 @@ static void Voodoo2SetupForSolidFill(ScrnInfoPtr pScrn, int color,
int rop, unsigned int planemask)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
+ if (debug)
+ ErrorF("Setup for solid fill colour %04X, rop %d, Mask %04X.\n",
+ color, rop, planemask);
Voodoo2Setup2D(pVoo);
mmio32_w_chuck(pVoo, 0x2EC, ropxlate[rop]); /* rop */
mmio32_w_chuck(pVoo, 0x2F0, color); /* fg color */
@@ -979,6 +993,8 @@ static void Voodoo2SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y,
int w, int h)
{
VoodooPtr pVoo = VoodooPTR(pScrn);
+ if (debug)
+ ErrorF("Fill (%d, %d) for (%d, %d)\n", x, y, w, h);
wait_idle(pVoo);
mmio32_w_chuck(pVoo, 0x2E4, (y<<16) | x); /* Dst x,y */
/* Set size and fire */