summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c142
1 files changed, 88 insertions, 54 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
index 029a89180..a057f0d7d 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/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.71 2002/09/11 00:29:32 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.80 2003/02/26 04:19:36 dawes Exp $ */
/*
* Reformatted with GNU indent (2.2.8), using the following options:
@@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*
* Authors:
- * Keith Whitwell <keithw@precisioninsight.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
*
*/
@@ -122,6 +122,8 @@ static SymTabRec I810Chipsets[] = {
#endif
{PCI_CHIP_I830_M, "i830M"},
{PCI_CHIP_845_G, "845G"},
+ {PCI_CHIP_I855_GM, "852GM/855GM"},
+ {PCI_CHIP_I865_G, "865G"},
{-1, NULL}
};
@@ -134,6 +136,8 @@ static PciChipsets I810PciChipsets[] = {
#endif
{PCI_CHIP_I830_M, PCI_CHIP_I830_M, RES_SHARED_VGA},
{PCI_CHIP_845_G, PCI_CHIP_845_G, RES_SHARED_VGA},
+ {PCI_CHIP_I855_GM, PCI_CHIP_I855_GM, RES_SHARED_VGA},
+ {PCI_CHIP_I865_G, PCI_CHIP_I865_G, RES_SHARED_VGA},
{-1, -1, RES_UNDEFINED }
};
@@ -146,6 +150,7 @@ typedef enum {
OPTION_DAC_6BIT,
OPTION_DRI,
OPTION_NO_DDC,
+ OPTION_SHOW_CACHE,
OPTION_XVMC_SURFACES
} I810Opts;
@@ -157,6 +162,7 @@ static const OptionInfoRec I810Options[] = {
{OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_NO_DDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE},
+ {OPTION_SHOW_CACHE, "ShowCache", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_XVMC_SURFACES, "XvMCSurfaces", OPTV_INTEGER, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
@@ -168,7 +174,6 @@ const char *I810vgahwSymbols[] = {
"vgaHWGetHWRec",
"vgaHWGetIOBase",
"vgaHWGetIndex",
- "vgaHWHandleColormaps",
"vgaHWInit",
"vgaHWLock",
"vgaHWMapMem",
@@ -189,15 +194,25 @@ const char *I810fbSymbols[] = {
};
const char *I810vbeSymbols[] = {
- "VBEInit",
- "vbeDoEDID",
- "vbeFree",
- "VBEFindSupportedDepths",
+ "VBEFreeModeInfo",
+ "VBEFreeVBEInfo",
+ "VBEGetModeInfo",
"VBEGetModePool",
+ "VBEGetVBEInfo",
+ "VBEGetVBEMode",
+ "VBEInit",
+ "VBEPrintModes",
+ "VBESaveRestore",
+ "VBESetDisplayStart",
+ "VBESetGetDACPaletteFormat",
+ "VBESetGetLogicalScanlineLength",
+ "VBESetGetPaletteData",
"VBESetModeNames",
"VBESetModeParameters",
+ "VBESetVBEMode",
"VBEValidateModes",
- "VBEPrintModes",
+ "vbeDoEDID",
+ "vbeFree",
NULL
};
@@ -224,14 +239,10 @@ const char *I810int10Symbols[] = {
};
const char *I810xaaSymbols[] = {
- "XAACachePlanarMonoStipple",
"XAACreateInfoRec",
"XAADestroyInfoRec",
"XAAFillSolidRects",
"XAAInit",
- "XAAOverlayFBfuncs",
- "XAAScreenIndex",
- "XAAStippleScanlineFuncLSBFirst",
NULL
};
@@ -254,46 +265,25 @@ static const char *drmSymbols[] = {
"drmAgpEnable",
"drmAgpFree",
"drmAgpRelease",
- "drmAvailable",
"drmAuthMagic",
-#ifdef HAVE_DRM_COMMAND
- "drmCommandNone",
- "drmCommandRead",
"drmCommandWrite",
- "drmCommandWriteRead",
-#endif
"drmCreateContext",
"drmCtlInstHandler",
+ "drmCtlUninstHandler",
"drmDestroyContext",
"drmFreeVersion",
"drmGetInterruptFromBusID",
-#ifdef HAVE_DRM_COMMAND
"drmGetLibVersion",
-#endif
"drmGetVersion",
-#ifndef HAVE_DRM_COMMAND
- "drmI810CleanupDma",
- "drmI810InitDma",
- "drmI830CleanupDma",
- "drmI830InitDma",
-#endif
NULL
};
-static const char *drmOptionalSymbols[] = {
-#ifndef HAVE_DRM_COMMAND
- "drmGetLibVersion",
-#endif
- NULL
-};
static const char *driSymbols[] = {
"DRICloseScreen",
"DRICreateInfoRec",
"DRIDestroyInfoRec",
"DRIFinishScreenInit",
- "DRIGetContext",
- "DRIGetDrawableIndex",
"DRIGetSAREAPrivate",
"DRILock",
"DRIQueryVersion",
@@ -302,7 +292,17 @@ static const char *driSymbols[] = {
"GlxSetVisualConfigs",
NULL
};
+
+#endif
#endif
+
+#ifdef XF86DRI
+const char *I810shadowSymbols[] = {
+ "shadowInit",
+ "shadowSetup",
+ "shadowAdd",
+ NULL
+};
#endif
#endif /* I830_ONLY */
@@ -356,7 +356,7 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = 0;
- /* This module should be loaded only once, but check to be sure.
+ /* This module should be loaded only once, but check to be sure.
*/
if (!setupDone) {
setupDone = 1;
@@ -369,7 +369,9 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
LoaderRefSymLists(I810vgahwSymbols,
I810fbSymbols, I810xaaSymbols, I810ramdacSymbols,
#ifdef XF86DRI
- drmSymbols, drmOptionalSymbols, driSymbols,
+ drmSymbols,
+ driSymbols,
+ I810shadowSymbols,
#endif
I810vbeSymbols, vbeOptionalSymbols,
I810ddcSymbols, I810int10Symbols, NULL);
@@ -392,7 +394,7 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
/*
* I810GetRec and I810FreeRec --
*
- * Private data for the driver is stored in the screen structure.
+ * Private data for the driver is stored in the screen structure.
* These two functions create and destroy that private data.
*
*/
@@ -423,12 +425,12 @@ I810FreeRec(ScrnInfoPtr pScrn)
*
* Returns the string name for the driver based on the chipset. In this
* case it will always be an I810, so we can return a static string.
- *
+ *
*/
static void
I810Identify(int flags)
{
- xf86PrintChipsets(I810_NAME, "Driver for Intel i810 chipset",
+ xf86PrintChipsets(I810_NAME, "Driver for Intel Integrated Graphics Chipsets",
I810Chipsets);
}
@@ -472,7 +474,7 @@ I810Probe(DriverPtr drv, int flags)
return FALSE;
}
- /*
+ /*
* This probing is just checking the PCI data the server already
* collected.
*/
@@ -531,11 +533,15 @@ I810Probe(DriverPtr drv, int flags)
pScrn->name = I810_NAME;
pScrn->Probe = I810Probe;
foundScreen = TRUE;
- if (pEnt->chipset == PCI_CHIP_I830_M ||
- pEnt->chipset == PCI_CHIP_845_G)
+ switch (pEnt->chipset) {
+ case PCI_CHIP_I830_M:
+ case PCI_CHIP_845_G:
+ case PCI_CHIP_I855_GM:
+ case PCI_CHIP_I865_G:
I830InitpScrn(pScrn);
- else {
+ break;
#ifndef I830_ONLY
+ default:
pScrn->PreInit = I810PreInit;
pScrn->ScreenInit = I810ScreenInit;
pScrn->SwitchMode = I810SwitchMode;
@@ -544,6 +550,7 @@ I810Probe(DriverPtr drv, int flags)
pScrn->LeaveVT = I810LeaveVT;
pScrn->FreeScreen = I810FreeScreen;
pScrn->ValidMode = I810ValidMode;
+ break;
#endif
}
}
@@ -708,6 +715,11 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE))
pScrn->rgbBits = 6;
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_SHOW_CACHE, FALSE))
+ pI810->showCache = TRUE;
+ else
+ pI810->showCache = FALSE;
+
/* 6-BIT dac isn't reasonable for modes with > 8bpp */
if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE) &&
pScrn->bitsPerPixel > 8) {
@@ -813,7 +825,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
/* Default to 4MB framebuffer, which is sufficient for all
* supported 2d resolutions. If the user has specified a different
* size in the XF86Config, use that amount instead.
- *
+ *
* Changed to 8 Meg so we can have acceleration by default (Mark).
*/
pScrn->videoRam = 8192;
@@ -954,7 +966,10 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
}
xf86LoaderReqSymLists(I810fbSymbols, NULL);
- if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
+ if (xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE))
+ pI810->noAccel = TRUE;
+
+ if (!pI810->noAccel) {
if (!xf86LoadSubModule(pScrn, "xaa")) {
I810FreeRec(pScrn);
return FALSE;
@@ -1130,7 +1145,7 @@ DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
vgaHWSave(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_CMAP);
/*
- * The port I/O code necessary to read in the extended registers
+ * The port I/O code necessary to read in the extended registers
* into the fields of the vgaI810Rec structure goes here.
*/
i810Reg->IOControl = hwp->readCrtc(hwp, IO_CTNL);
@@ -1301,7 +1316,7 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
/*
* Code to restore any SVGA registers that have been saved/modified
- * goes here. Note that it is allowable, and often correct, to
+ * goes here. Note that it is allowable, and often correct, to
* only modify certain bits in a register by a read/modify/write cycle.
*
* A special case - when using an external clock-setting program,
@@ -1335,9 +1350,17 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
pI810->writeControl(pI810, GRX, ADDRESS_MAPPING, temp);
/* Setting the OVRACT Register for video overlay */
- OUTREG(0x6001C,
- (i810Reg->OverlayActiveEnd << 16) | i810Reg->OverlayActiveStart);
-
+ {
+ CARD32 LCD_TV_Control = INREG(LCD_TV_C);
+
+ if(!(LCD_TV_Control & LCD_TV_ENABLE)
+ || (LCD_TV_Control & LCD_TV_VGAMOD)) {
+ OUTREG(LCD_TV_OVRACT,
+ (i810Reg->OverlayActiveEnd << 16)
+ | i810Reg->OverlayActiveStart);
+ }
+ }
+
/* Turn on DRAM Refresh */
temp = INREG8(DRAM_ROW_CNTL_HI);
temp &= ~DRAM_REFRESH_RATE;
@@ -1840,7 +1863,7 @@ I810AllocateFront(ScrnInfoPtr pScrn)
* Not sure why 256 was initially subtracted from videoRam in the
* maxCacheLines calculation, but that was causing a problem
* for configurations that have exactly enough Ram for the framebuffer.
- * Common code should catch the case where there isn't enough space for
+ * Common code should catch the case where there isn't enough space for
* framebuffer, we'll just check for no space for cache_lines. -jens
*
*/
@@ -2092,7 +2115,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#ifdef XF86DRI
if (pI810->directRenderingEnabled) {
- /* Now that mi, cfb, drm and others have done their thing,
+ /* Now that mi, cfb, drm and others have done their thing,
* complete the DRI setup.
*/
pI810->directRenderingEnabled = I810DRIFinishScreenInit(pScreen);
@@ -2138,7 +2161,18 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I810Ptr pI810 = I810PTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
- int Base = (y * pScrn->displayWidth + x) >> 2;
+ int Base;
+#if 1
+ if (pI810->showCache) {
+ int lastline = pI810->FbMapSize /
+ ((pScrn->displayWidth * pScrn->bitsPerPixel) / 8);
+ lastline -= pScrn->currentMode->VDisplay;
+ if (y > 0)
+ y += pScrn->currentMode->VDisplay;
+ if (y > lastline) y = lastline;
+ }
+#endif
+ Base = (y * pScrn->displayWidth + x) >> 2;
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
ErrorF("I810AdjustFrame %d,%d %x\n", x, y, flags);
@@ -2152,7 +2186,7 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags)
case 24:
/* KW: Need to do 16-pixel alignment for i810, otherwise you
* get bad watermark problems. Need to fixup the mouse
- * pointer positioning to take this into account.
+ * pointer positioning to take this into account.
*/
pI810->CursorOffset = (Base & 0x3) * 4;
Base &= ~0x3;