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.c115
1 files changed, 27 insertions, 88 deletions
diff --git a/src/i810_driver.c b/src/i810_driver.c
index 0d07f296..25a60f9d 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.101 2004/01/02 20:15:47 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.87 2003/08/23 15:03:01 dawes Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
@@ -96,8 +96,8 @@ static void I810FreeScreen(int scrnIndex, int flags);
static void I810DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagermentMode,
int flags);
-static ModeStatus I810ValidMode(int scrnIndex, DisplayModePtr mode,
- Bool verbose, int flags);
+static int I810ValidMode(int scrnIndex, DisplayModePtr mode, Bool
+ verbose, int flags);
#endif /* I830_ONLY */
@@ -243,9 +243,8 @@ const char *I810int10Symbols[] = {
const char *I810xaaSymbols[] = {
"XAACreateInfoRec",
"XAADestroyInfoRec",
+ "XAAFillSolidRects",
"XAAInit",
- "XAACopyROP",
- "XAAPatternROP",
NULL
};
@@ -256,8 +255,10 @@ const char *I810ramdacSymbols[] = {
NULL
};
+#ifndef I830_ONLY
+#ifdef XFree86LOADER
#ifdef XF86DRI
-const char *I810drmSymbols[] = {
+static const char *drmSymbols[] = {
"drmAddBufs",
"drmAddMap",
"drmAgpAcquire",
@@ -266,7 +267,6 @@ const char *I810drmSymbols[] = {
"drmAgpEnable",
"drmAgpFree",
"drmAgpRelease",
- "drmAgpUnbind",
"drmAuthMagic",
"drmCommandWrite",
"drmCreateContext",
@@ -281,7 +281,7 @@ const char *I810drmSymbols[] = {
};
-const char *I810driSymbols[] = {
+static const char *driSymbols[] = {
"DRICloseScreen",
"DRICreateInfoRec",
"DRIDestroyInfoRec",
@@ -295,6 +295,9 @@ const char *I810driSymbols[] = {
NULL
};
+#endif
+#endif
+
#ifdef XF86DRI
static const char *driShadowFBSymbols[] = {
@@ -347,7 +350,7 @@ static XF86ModuleVersionInfo i810VersRec = {
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
- XORG_VERSION_CURRENT,
+ XF86_VERSION_CURRENT,
I810_MAJOR_VERSION, I810_MINOR_VERSION, I810_PATCHLEVEL,
ABI_CLASS_VIDEODRV,
ABI_VIDEODRV_VERSION,
@@ -375,10 +378,10 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
LoaderRefSymLists(I810vgahwSymbols,
I810fbSymbols, I810xaaSymbols, I810ramdacSymbols,
#ifdef XF86DRI
- I810drmSymbols,
- I810driSymbols,
- I810shadowSymbols,
+ drmSymbols,
+ driSymbols,
driShadowFBSymbols,
+ I810shadowSymbols,
#endif
I810vbeSymbols, vbeOptionalSymbols,
I810ddcSymbols, I810int10Symbols, NULL);
@@ -855,7 +858,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;
}
@@ -930,8 +933,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
}
clockRanges = xnfcalloc(sizeof(ClockRange), 1);
clockRanges->next = NULL;
- /* 9.4MHz appears to be the smallest that works. */
- clockRanges->minClock = 9500;
+ clockRanges->minClock = 12000; /* !!! What's the min clock? !!! */
clockRanges->maxClock = pI810->MaxClock;
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = TRUE;
@@ -1066,15 +1068,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
pI810->numSurfaces = 0;
}
-#ifdef XF86DRI
- /* Load the dri module if requested. */
- if (xf86ReturnOptValBool(pI810->Options, OPTION_DRI, FALSE)) {
- if (xf86LoadSubModule(pScrn, "dri")) {
- xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL);
- }
- }
-#endif
-
/* We won't be using the VGA access after the probe */
I810SetMMIOAccess(pI810);
xf86SetOperatingState(resVgaIo, pI810->pEnt->index, ResUnusedOpr);
@@ -1411,20 +1404,13 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
/* Setting the OVRACT Register for video overlay */
{
CARD32 LCD_TV_Control = INREG(LCD_TV_C);
- CARD32 TV_HTotal = INREG(LCD_TV_HTOTAL);
- CARD32 ActiveStart, ActiveEnd;
- if((LCD_TV_Control & LCD_TV_ENABLE)
- && !(LCD_TV_Control & LCD_TV_VGAMOD)
- && TV_HTotal) {
- ActiveStart = ((TV_HTotal >> 16) & 0xfff) - 31;
- ActiveEnd = (TV_HTotal & 0x3ff) - 31;
- } else {
- ActiveStart = i810Reg->OverlayActiveStart;
- ActiveEnd = i810Reg->OverlayActiveEnd;
+ if(!(LCD_TV_Control & LCD_TV_ENABLE)
+ || (LCD_TV_Control & LCD_TV_VGAMOD)) {
+ OUTREG(LCD_TV_OVRACT,
+ (i810Reg->OverlayActiveEnd << 16)
+ | i810Reg->OverlayActiveStart);
}
- OUTREG(LCD_TV_OVRACT,
- (ActiveEnd << 16) | ActiveStart);
}
/* Turn on DRAM Refresh */
@@ -1576,11 +1562,6 @@ 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;
@@ -1610,7 +1591,7 @@ I810CalcVCLK(ScrnInfoPtr pScrn, double freq)
i810Reg->VideoClk2_DivisorSel = (p_best << 4);
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,
- "Setting dot clock to %.1f MHz " "[ 0x%x 0x%x 0x%x ] "
+ "Setting dot clock to %.1lf MHz " "[ 0x%x 0x%x 0x%x ] "
"[ %d %d %d ]\n", CALC_VCLK(m_best, n_best, p_best),
i810Reg->VideoClk2_M, i810Reg->VideoClk2_N,
i810Reg->VideoClk2_DivisorSel, m_best, n_best, p_best);
@@ -2222,38 +2203,9 @@ 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
+ ErrorF("I810SwitchMode %p %x\n", mode, flags);
return I810ModeInit(pScrn, mode);
}
@@ -2265,7 +2217,6 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags)
I810Ptr pI810 = I810PTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
int Base;
-
#if 1
if (pI810->showCache) {
int lastline = pI810->FbMapSize /
@@ -2322,13 +2273,10 @@ I810EnterVT(int scrnIndex, int flags)
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("\n\nENTER VT\n");
- if (!I810BindGARTMemory(pScrn)) {
+ if (!I810BindGARTMemory(pScrn))
return FALSE;
- }
+
#ifdef XF86DRI
- if (!I810DRIEnter(pScrn)) {
- return FALSE;
- }
if (pI810->directRenderingEnabled) {
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("calling dri unlock\n");
@@ -2371,10 +2319,6 @@ I810LeaveVT(int scrnIndex, int flags)
if (!I810UnbindGARTMemory(pScrn))
return;
-#ifdef XF86DRI
- if (!I810DRILeave(pScrn))
- return;
-#endif
vgaHWLock(hwp);
}
@@ -2388,11 +2332,6 @@ 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);
}
@@ -2453,7 +2392,7 @@ I810FreeScreen(int scrnIndex, int flags)
vgaHWFreeHWRec(xf86Screens[scrnIndex]);
}
-static ModeStatus
+static int
I810ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
if (mode->Flags & V_INTERLACE) {