summaryrefslogtreecommitdiff
path: root/src/i810_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/i810_driver.c')
-rw-r--r--src/i810_driver.c49
1 files changed, 46 insertions, 3 deletions
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 62039190..73ddd1b3 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.95 2003/10/30 18:37:21 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.101 2004/01/02 20:15:47 dawes Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
@@ -244,6 +244,8 @@ const char *I810xaaSymbols[] = {
"XAACreateInfoRec",
"XAADestroyInfoRec",
"XAAInit",
+ "XAACopyROP",
+ "XAAPatternROP",
NULL
};
@@ -376,6 +378,7 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
I810drmSymbols,
I810driSymbols,
I810shadowSymbols,
+ driShadowFBSymbols,
#endif
I810vbeSymbols, vbeOptionalSymbols,
I810ddcSymbols, I810int10Symbols, NULL);
@@ -852,7 +855,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
pScrn->videoRam = 4096;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Less than 6MB of AGP memory"
- "is available. Cannot proceed.\n");
+ " is available. Cannot proceed.\n");
I810FreeRec(pScrn);
return FALSE;
}
@@ -927,7 +930,8 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
}
clockRanges = xnfcalloc(sizeof(ClockRange), 1);
clockRanges->next = NULL;
- clockRanges->minClock = 12000; /* !!! What's the min clock? !!! */
+ /* 9.4MHz appears to be the smallest that works. */
+ clockRanges->minClock = 9500;
clockRanges->maxClock = pI810->MaxClock;
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = TRUE;
@@ -1572,6 +1576,11 @@ I810CalcVCLK(ScrnInfoPtr pScrn, double freq)
double err_best = 999999.0;
p_best = p = log(MAX_VCO_FREQ / f_target) / log((double)2);
+ /* Make sure p is within range. */
+ if (p_best > 5) {
+ p_best = p = 5;
+ }
+
f_vco = f_target * (1 << p);
n = 2;
@@ -2213,10 +2222,39 @@ Bool
I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ I810Ptr pI810 = I810PTR(pScrn);
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
ErrorF("I810SwitchMode %p %x\n", (void *)mode, flags);
+#ifdef XF86DRI
+ if (pI810->directRenderingEnabled) {
+ if (I810_DEBUG & DEBUG_VERBOSE_DRI)
+ ErrorF("calling dri lock\n");
+ DRILock(screenInfo.screens[scrnIndex], 0);
+ pI810->LockHeld = 1;
+ }
+#endif
+
+ if (pI810->AccelInfoRec != NULL) {
+ I810RefreshRing(pScrn);
+ I810Sync(pScrn);
+ pI810->AccelInfoRec->NeedToSync = FALSE;
+ }
+ I810Restore(pScrn);
+
+#ifdef XF86DRI
+ if (!I810DRIEnter(pScrn)) {
+ return FALSE;
+ }
+ if (pI810->directRenderingEnabled) {
+ if (I810_DEBUG & DEBUG_VERBOSE_DRI)
+ ErrorF("calling dri unlock\n");
+ DRIUnlock(screenInfo.screens[scrnIndex]);
+ pI810->LockHeld = 0;
+ }
+#endif
+
return I810ModeInit(pScrn, mode);
}
@@ -2350,6 +2388,11 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
if (pScrn->vtSema == TRUE) {
+ if (pI810->AccelInfoRec != NULL) {
+ I810RefreshRing(pScrn);
+ I810Sync(pScrn);
+ pI810->AccelInfoRec->NeedToSync = FALSE;
+ }
I810Restore(pScrn);
vgaHWLock(hwp);
}